").append( jQuery.parseHTML( responseText ) ).find( selector ) :
-
- // Otherwise use the full result
- responseText );
-
- }).complete( callback && function( jqXHR, status ) {
- self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
- });
- }
-
- 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( [ "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;
- }
-
- return jQuery.ajax({
- url: url,
- type: method,
- dataType: type,
- data: data,
- success: callback
- });
- };
-});
-
-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"
- },
-
- // Data converters
- // Keys separate source (or catchall "*") and destination types with a single space
- converters: {
-
- // Convert anything to text
- "* text": window.String,
-
- // Text to html (true = no transformation)
- "text html": true,
-
- // Evaluate text as a json expression
- "text json": jQuery.parseJSON,
-
- // Parse text as xml
- "text xml": jQuery.parseXML
- },
-
- // 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
- }
- },
-
- // 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 ?
-
- // Building a settings object
- ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
-
- // Extending ajaxSettings
- ajaxExtend( jQuery.ajaxSettings, target );
- },
-
- ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
- ajaxTransport: addToPrefiltersOrTransports( transports ),
-
- // Main method
- ajax: function( url, options ) {
-
- // If url is an object, simulate pre-1.5 signature
- if ( typeof url === "object" ) {
- options = url;
- url = undefined;
- }
-
- // Force options to be an object
- options = options || {};
-
- var // Cross-domain detection vars
- parts,
- // Loop variable
- i,
- // URL without anti-cache param
- cacheURL,
- // Response headers as string
- responseHeadersString,
- // timeout handle
- timeoutTimer,
-
- // To know if global events are to be dispatched
- fireGlobals,
-
- 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,
-
- // 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;
- },
-
- // 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;
- },
-
- // 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 (#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 ] + "//" );
-
- // Alias method option to type as per ticket #12004
- s.type = options.method || options.type || s.method || s.type;
-
- // Extract dataTypes list
- s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
-
- // 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 ) ) )
- );
- }
-
- // Convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- s.data = jQuery.param( s.data, s.traditional );
- }
-
- // Apply prefilters
- inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
- // If request was aborted inside a prefilter, stop there
- if ( state === 2 ) {
- return jqXHR;
- }
-
- // We can fire global events as of now if asked to
- fireGlobals = s.global;
-
- // Watch for a new set of requests
- if ( fireGlobals && jQuery.active++ === 0 ) {
- jQuery.event.trigger("ajaxStart");
- }
-
- // Uppercase the type
- s.type = s.type.toUpperCase();
-
- // Determine if request has content
- s.hasContent = !rnoContent.test( s.type );
-
- // Save the URL in case we're toying with the If-Modified-Since
- // and/or If-None-Match header later on
- cacheURL = s.url;
-
- // More options handling for requests with no content
- if ( !s.hasContent ) {
-
- // 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;
- }
-
- // Add anti-cache in url if needed
- if ( s.cache === false ) {
- s.url = rts.test( cacheURL ) ?
-
- // If there is already a '_' parameter, set its value
- cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
-
- // Otherwise add one to the end
- cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
- }
- }
-
- // 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 ] );
- }
- }
-
- // 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[ "*" ]
- );
-
- // Check for headers option
- for ( i in s.headers ) {
- jqXHR.setRequestHeader( i, s.headers[ i ] );
- }
-
- // 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 ] );
- }
-
- // Get transport
- transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
- // If no transport, we auto-abort
- if ( !transport ) {
- done( -1, "No Transport" );
- } else {
- jqXHR.readyState = 1;
-
- // 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 );
- }
-
- 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;
- }
- }
- }
-
- // 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;
- }
-
- // State is "done" now
- state = 2;
-
- // Clear timeout if it exists
- if ( timeoutTimer ) {
- clearTimeout( timeoutTimer );
- }
-
- // Dereference transport for early garbage collection
- // (no matter how long the jqXHR object will be used)
- transport = undefined;
-
- // Cache response headers
- responseHeadersString = headers || "";
-
- // Set readyState
- jqXHR.readyState = status > 0 ? 4 : 0;
-
- // Get response data
- if ( responses ) {
- response = ajaxHandleResponses( s, jqXHR, responses );
- }
-
- // If successful, handle type chaining
- if ( status >= 200 && status < 300 || status === 304 ) {
-
- // 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;
- }
- }
-
- // if no content
- if ( status === 204 ) {
- isSuccess = true;
- statusText = "nocontent";
-
- // if not modified
- } else if ( status === 304 ) {
- isSuccess = true;
- statusText = "notmodified";
-
- // If we have data, let's convert it
- } else {
- isSuccess = ajaxConvert( s, response );
- statusText = isSuccess.state;
- success = isSuccess.data;
- error = isSuccess.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;
- }
- }
- }
-
- // Set data for the fake xhr object
- jqXHR.status = status;
- jqXHR.statusText = ( nativeStatusText || statusText ) + "";
-
- // Success/Error
- if ( isSuccess ) {
- deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
- } else {
- deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
- }
-
- // Status-dependent callbacks
- jqXHR.statusCode( statusCode );
- statusCode = undefined;
-
- if ( fireGlobals ) {
- globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
- [ jqXHR, s, isSuccess ? success : error ] );
- }
-
- // 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");
- }
- }
- }
-
- return jqXHR;
- },
-
- getScript: function( url, callback ) {
- return jQuery.get( url, undefined, callback, "script" );
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get( url, data, callback, "json" );
- }
-});
-
-/* Handles responses to an ajax request:
- * - sets all responseXXX fields accordingly
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
-function ajaxHandleResponses( s, jqXHR, responses ) {
- var firstDataType, ct, finalDataType, type,
- contents = s.contents,
- dataTypes = s.dataTypes,
- responseFields = s.responseFields;
-
- // Fill responseXXX fields
- for ( type in responseFields ) {
- if ( type in responses ) {
- jqXHR[ responseFields[type] ] = responses[ type ];
- }
- }
-
- // Remove auto dataType and get content-type in the process
- while( dataTypes[ 0 ] === "*" ) {
- dataTypes.shift();
- if ( ct === undefined ) {
- ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
- }
- }
-
- // Check if we're dealing with a known content-type
- if ( ct ) {
- for ( type in contents ) {
- if ( contents[ type ] && contents[ type ].test( ct ) ) {
- dataTypes.unshift( type );
- break;
- }
- }
- }
-
- // Check to see if we have a response for the expected dataType
- if ( dataTypes[ 0 ] in responses ) {
- finalDataType = dataTypes[ 0 ];
- } else {
- // Try convertible dataTypes
- for ( type in responses ) {
- if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
- finalDataType = type;
- break;
- }
- if ( !firstDataType ) {
- firstDataType = type;
- }
- }
- // Or just use first one
- finalDataType = finalDataType || firstDataType;
- }
-
- // If we found a dataType
- // We add the dataType to the list if needed
- // and return the corresponding response
- if ( finalDataType ) {
- if ( finalDataType !== dataTypes[ 0 ] ) {
- dataTypes.unshift( finalDataType );
- }
- return responses[ finalDataType ];
- }
-}
-
-// Chain conversions given the request and the original response
-function ajaxConvert( s, response ) {
- var conv2, current, conv, tmp,
- converters = {},
- i = 0,
- // Work with a copy of dataTypes in case we need to modify it for conversion
- dataTypes = s.dataTypes.slice(),
- prev = dataTypes[ 0 ];
-
- // Apply the dataFilter if provided
- if ( s.dataFilter ) {
- response = s.dataFilter( response, s.dataType );
- }
-
- // Create converters map with lowercased keys
- if ( dataTypes[ 1 ] ) {
- for ( conv in s.converters ) {
- converters[ conv.toLowerCase() ] = s.converters[ conv ];
- }
- }
-
- // Convert to each sequential dataType, tolerating list modification
- for ( ; (current = dataTypes[++i]); ) {
-
- // There's only work to do if current dataType is non-auto
- if ( current !== "*" ) {
-
- // Convert response if prev dataType is non-auto and differs from current
- if ( prev !== "*" && prev !== current ) {
-
- // Seek a direct converter
- conv = converters[ prev + " " + current ] || converters[ "* " + current ];
-
- // If none found, seek a pair
- if ( !conv ) {
- for ( conv2 in converters ) {
-
- // If conv2 outputs current
- tmp = conv2.split(" ");
- if ( tmp[ 1 ] === current ) {
-
- // If prev can be converted to accepted input
- conv = converters[ prev + " " + tmp[ 0 ] ] ||
- converters[ "* " + tmp[ 0 ] ];
- if ( conv ) {
- // Condense equivalence converters
- if ( conv === true ) {
- conv = converters[ conv2 ];
-
- // Otherwise, insert the intermediate dataType
- } else if ( converters[ conv2 ] !== true ) {
- current = tmp[ 0 ];
- dataTypes.splice( i--, 0, current );
- }
-
- break;
- }
- }
- }
- }
-
- // Apply converter (if not an equivalence)
- if ( conv !== true ) {
-
- // Unless errors are allowed to bubble, catch and return them
- if ( conv && s["throws"] ) {
- response = conv( response );
- } else {
- try {
- response = conv( response );
- } catch ( e ) {
- return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
- }
- }
- }
- }
-
- // Update prev for next iteration
- prev = current;
- }
- }
-
- 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;
- }
- }
-});
-
-// 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;
- }
-});
-
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function(s) {
-
- // This transport only deals with cross domain requests
- if ( s.crossDomain ) {
-
- var script,
- head = document.head || jQuery("head")[0] || document.documentElement;
-
- return {
-
- send: function( _, callback ) {
-
- script = document.createElement("script");
-
- script.async = true;
-
- if ( s.scriptCharset ) {
- script.charset = s.scriptCharset;
- }
-
- script.src = s.url;
-
- // Attach handlers for all browsers
- script.onload = script.onreadystatechange = function( _, isAbort ) {
-
- if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
-
- // Handle memory leak in IE
- script.onload = script.onreadystatechange = null;
-
- // Remove the script
- if ( script.parentNode ) {
- script.parentNode.removeChild( script );
- }
-
- // Dereference the script
- script = null;
-
- // Callback if not abort
- if ( !isAbort ) {
- callback( 200, "success" );
- }
- }
- };
-
- // 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 );
- },
-
- abort: function() {
- if ( script ) {
- script.onload( undefined, true );
- }
- }
- };
- }
-});
-var oldCallbacks = [],
- rjsonp = /(=)\?(?=&|$)|\?\?/;
-
-// Default jsonp settings
-jQuery.ajaxSetup({
- jsonp: "callback",
- jsonpCallback: function() {
- var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
- this[ callback ] = true;
- return callback;
- }
-});
-
-// Detect, normalize options and install callbacks for jsonp requests
-jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, 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"
- );
-
- // Handle iff the expected data type is "jsonp" or we have a parameter to set
- if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
-
- // Get callback name, remembering preexisting value associated with it
- callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
- s.jsonpCallback() :
- s.jsonpCallback;
-
- // 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;
- }
-
- // 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 ];
- };
-
- // force json dataType
- s.dataTypes[ 0 ] = "json";
-
- // Install callback
- overwritten = window[ callbackName ];
- window[ callbackName ] = function() {
- responseContainer = arguments;
- };
-
- // Clean-up function (fires after converters)
- jqXHR.always(function() {
- // Restore preexisting value
- window[ callbackName ] = overwritten;
-
- // 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 );
- }
-
- // Call if it was a function and we have a response
- if ( responseContainer && jQuery.isFunction( overwritten ) ) {
- overwritten( responseContainer[ 0 ] );
- }
-
- responseContainer = overwritten = undefined;
- });
-
- // 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 );
- }
- };
-
-// Functions to create xhrs
-function createStandardXHR() {
- try {
- return new window.XMLHttpRequest();
- } catch( e ) {}
-}
-
-function createActiveXHR() {
- try {
- return new window.ActiveXObject("Microsoft.XMLHTTP");
- } catch( e ) {}
-}
-
-// 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;
-
-// Determine support properties
-xhrSupported = jQuery.ajaxSettings.xhr();
-jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
-xhrSupported = jQuery.support.ajax = !!xhrSupported;
-
-// Create transport if the browser can provide an xhr
-if ( xhrSupported ) {
-
- jQuery.ajaxTransport(function( s ) {
- // Cross domain only allowed if supported through XMLHttpRequest
- if ( !s.crossDomain || jQuery.support.cors ) {
-
- var callback;
-
- return {
- send: function( headers, complete ) {
-
- // Get a new xhr
- var handle, i,
- xhr = s.xhr();
-
- // 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 );
- }
-
- // Apply custom fields if provided
- if ( s.xhrFields ) {
- for ( i in s.xhrFields ) {
- xhr[ i ] = s.xhrFields[ i ];
- }
- }
-
- // Override mime type if needed
- if ( s.mimeType && xhr.overrideMimeType ) {
- xhr.overrideMimeType( s.mimeType );
- }
-
- // 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";
- }
-
- // Need an extra try/catch for cross domain requests in Firefox 3
- try {
- for ( i in headers ) {
- xhr.setRequestHeader( i, headers[ i ] );
- }
- } catch( err ) {}
-
- // 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 );
-
- // Listener
- callback = function( _, isAbort ) {
- var status, responseHeaders, statusText, responses;
-
- // 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 {
-
- // Was never called and is aborted or complete
- if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
-
- // Only called once
- callback = undefined;
-
- // Do not keep as active anymore
- if ( handle ) {
- xhr.onreadystatechange = jQuery.noop;
- if ( xhrOnUnloadAbort ) {
- delete xhrCallbacks[ handle ];
- }
- }
-
- // 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;
- }
-
- // 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 = "";
- }
-
- // 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;
- }
- },
-
- 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 end, unit,
- tween = this.createTween( prop, value ),
- parts = rfxnum.exec( value ),
- target = tween.cur(),
- start = +target || 0,
- scale = 1,
- maxIterations = 20;
-
- if ( parts ) {
- end = +parts[2];
- unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
-
- // We need to compute starting value
- if ( unit !== "px" && start ) {
- // Iteratively approximate from a nonzero starting point
- // Prefer the current property, because this process will be trivial if it uses the same units
- // Fallback to end or a simple constant
- start = jQuery.css( tween.elem, prop, true ) || end || 1;
-
- 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";
-
- // Adjust and apply
- start = start / scale;
- jQuery.style( tween.elem, prop, start + unit );
-
- // 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 );
- }
-
- tween.unit = unit;
- tween.start = start;
- // If a +=/-= token was provided, we're doing a relative animation
- tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
- }
- return tween;
- }]
- };
-
-// Animations created synchronously will run synchronously
-function createFxNow() {
- setTimeout(function() {
- fxNow = undefined;
- });
- return ( fxNow = jQuery.now() );
-}
-
-function createTweens( animation, props ) {
- jQuery.each( props, function( prop, value ) {
- var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
- index = 0,
- length = collection.length;
- for ( ; index < length; index++ ) {
- if ( collection[ index ].call( animation, prop, value ) ) {
-
- // we're done with this property
- return;
- }
- }
- });
-}
-
-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;
-
- for ( ; index < length ; index++ ) {
- animation.tweens[ index ].run( percent );
- }
-
- deferred.notifyWith( elem, [ animation, percent, remaining ]);
-
- 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;
-
- propFilter( props, animation.opts.specialEasing );
-
- for ( ; index < length ; index++ ) {
- result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
- if ( result ) {
- return result;
- }
- }
-
- createTweens( animation, props );
-
- if ( jQuery.isFunction( animation.opts.start ) ) {
- animation.opts.start.call( elem, animation );
- }
-
- jQuery.fx.timer(
- jQuery.extend( tick, {
- elem: elem,
- anim: animation,
- queue: animation.opts.queue
- })
- );
-
- // 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 );
-}
-
-function propFilter( props, specialEasing ) {
- var value, name, index, easing, 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 ];
- }
-
- if ( index !== name ) {
- props[ name ] = value;
- delete props[ index ];
- }
-
- hooks = jQuery.cssHooks[ name ];
- if ( hooks && "expand" in hooks ) {
- value = hooks.expand( value );
- delete props[ name ];
-
- // 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;
- }
- }
-}
-
-jQuery.Animation = jQuery.extend( Animation, {
-
- tweener: function( props, callback ) {
- if ( jQuery.isFunction( props ) ) {
- callback = props;
- props = [ "*" ];
- } else {
- props = props.split(" ");
- }
-
- var prop,
- index = 0,
- length = props.length;
-
- for ( ; index < length ; index++ ) {
- prop = props[ index ];
- tweeners[ prop ] = tweeners[ prop ] || [];
- tweeners[ prop ].unshift( callback );
- }
- },
-
- prefilter: function( callback, prepend ) {
- if ( prepend ) {
- animationPrefilters.unshift( callback );
- } else {
- animationPrefilters.push( callback );
- }
- }
-});
-
-function defaultPrefilter( elem, props, opts ) {
- /*jshint validthis:true */
- var prop, index, length,
- value, dataShow, toggle,
- tween, hooks, oldfire,
- anim = this,
- style = elem.style,
- orig = {},
- handled = [],
- hidden = elem.nodeType && isHidden( 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();
- }
- });
- });
- }
-
- // 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 ];
-
- // 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" ) {
-
- // 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 {
- style.zoom = 1;
- }
- }
- }
-
- 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 ];
- });
- }
- }
-
-
- // show/hide pass
- for ( index in props ) {
- value = props[ index ];
- if ( rfxtypes.exec( value ) ) {
- delete props[ index ];
- toggle = toggle || value === "toggle";
- if ( value === ( hidden ? "hide" : "show" ) ) {
- continue;
- }
- handled.push( index );
- }
- }
-
- length = handled.length;
- if ( length ) {
- dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
- if ( "hidden" in dataShow ) {
- hidden = dataShow.hidden;
- }
-
- // 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 ( index = 0 ; index < length ; index++ ) {
- prop = handled[ index ];
- tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
- orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
-
- 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;
-
-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 ];
-
- return hooks && hooks.get ?
- hooks.get( this ) :
- Tween.propHooks._default.get( this );
- },
- run: function( percent ) {
- var eased,
- hooks = Tween.propHooks[ this.prop ];
-
- 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;
-
- if ( this.options.step ) {
- this.options.step.call( this.elem, this.now, this );
- }
-
- if ( hooks && hooks.set ) {
- hooks.set( this );
- } else {
- Tween.propHooks._default.set( this );
- }
- return this;
- }
-};
-
-Tween.prototype.init.prototype = Tween.prototype;
-
-Tween.propHooks = {
- _default: {
- get: function( tween ) {
- var result;
-
- if ( tween.elem[ tween.prop ] != null &&
- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
- return tween.elem[ tween.prop ];
- }
-
- // 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;
- }
- }
- }
-};
-
-// Remove in 2.0 - this supports IE8's panic based approach
-// to setting things on disconnected nodes
-
-Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
- set: function( tween ) {
- if ( tween.elem.nodeType && tween.elem.parentNode ) {
- tween.elem[ tween.prop ] = tween.now;
- }
- }
-};
-
-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 );
- };
-});
-
-jQuery.fn.extend({
- fadeTo: function( speed, to, easing, callback ) {
-
- // show any hidden elements after setting opacity to 0
- return this.filter( isHidden ).css( "opacity", 0 ).show()
-
- // 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 );
- doAnimation.finish = function() {
- anim.stop( true );
- };
- // Empty animations, or finishing resolves immediately
- if ( empty || jQuery._data( this, "finish" ) ) {
- anim.stop( true );
- }
- };
- doAnimation.finish = doAnimation;
-
- 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 );
- };
-
- if ( typeof type !== "string" ) {
- gotoEnd = clearQueue;
- clearQueue = type;
- type = undefined;
- }
- if ( clearQueue && type !== false ) {
- this.queue( type || "fx", [] );
- }
-
- return this.each(function() {
- var dequeue = true,
- index = type != null && type + "queueHooks",
- timers = jQuery.timers,
- data = jQuery._data( this );
-
- if ( index ) {
- if ( data[ index ] && data[ index ].stop ) {
- stopQueue( data[ index ] );
- }
- } else {
- for ( index in data ) {
- if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
- stopQueue( data[ index ] );
- }
- }
- }
-
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
- timers[ index ].anim.stop( gotoEnd );
- dequeue = false;
- timers.splice( index, 1 );
- }
- }
-
- // start the next in the queue if the last step wasn't forced
- // timers currently will call their complete callbacks, which will dequeue
- // but only if they were gotoEnd
- if ( dequeue || !gotoEnd ) {
- jQuery.dequeue( this, type );
- }
- });
- },
- finish: function( type ) {
- if ( type !== false ) {
- type = type || "fx";
- }
- return this.each(function() {
- var index,
- data = jQuery._data( this ),
- queue = data[ type + "queue" ],
- hooks = data[ type + "queueHooks" ],
- timers = jQuery.timers,
- length = queue ? queue.length : 0;
-
- // enable finishing flag on private data
- data.finish = true;
-
- // empty the queue first
- jQuery.queue( this, type, [] );
-
- if ( hooks && hooks.cur && hooks.cur.finish ) {
- hooks.cur.finish.call( this );
- }
-
- // look for any active animations, and finish them
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
- timers[ index ].anim.stop( true );
- timers.splice( index, 1 );
- }
- }
-
- // look for any animations in the old queue and finish them
- for ( index = 0; index < length; index++ ) {
- if ( queue[ index ] && queue[ index ].finish ) {
- queue[ index ].finish.call( this );
- }
- }
-
- // turn off finishing flag
- delete data.finish;
- });
- }
-});
-
-// Generate parameters to create a standard animation
-function genFx( type, includeWidth ) {
- var which,
- attrs = { height: type },
- i = 0;
-
- // if we include width, step value is 1 to do all cssExpand values,
- // if we don't include width, step value is 2 to skip over Left and Right
- includeWidth = includeWidth? 1 : 0;
- for( ; i < 4 ; i += 2 - includeWidth ) {
- which = cssExpand[ i ];
- attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
- }
-
- if ( includeWidth ) {
- attrs.opacity = attrs.width = type;
- }
-
- return attrs;
-}
-
-// Generate shortcuts for custom animations
-jQuery.each({
- slideDown: genFx("show"),
- slideUp: genFx("hide"),
- slideToggle: genFx("toggle"),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" },
- fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return this.animate( props, speed, easing, callback );
- };
-});
-
-jQuery.speed = function( speed, easing, fn ) {
- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
- complete: fn || !fn && easing ||
- jQuery.isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
- };
-
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
- opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
-
- // normalize opt.queue - true/undefined/null -> "fx"
- if ( opt.queue == null || opt.queue === true ) {
- opt.queue = "fx";
- }
-
- // Queueing
- opt.old = opt.complete;
-
- opt.complete = function() {
- if ( jQuery.isFunction( opt.old ) ) {
- opt.old.call( this );
- }
-
- if ( opt.queue ) {
- jQuery.dequeue( this, opt.queue );
- }
- };
-
- return opt;
-};
-
-jQuery.easing = {
- linear: function( p ) {
- return p;
- },
- swing: function( p ) {
- return 0.5 - Math.cos( p*Math.PI ) / 2;
- }
-};
-
-jQuery.timers = [];
-jQuery.fx = Tween.prototype.init;
-jQuery.fx.tick = function() {
- var timer,
- timers = jQuery.timers,
- i = 0;
-
- fxNow = jQuery.now();
-
- for ( ; i < timers.length; i++ ) {
- timer = timers[ i ];
- // Checks the timer has not already been removed
- if ( !timer() && timers[ i ] === timer ) {
- timers.splice( i--, 1 );
- }
- }
-
- if ( !timers.length ) {
- jQuery.fx.stop();
- }
- fxNow = undefined;
-};
-
-jQuery.fx.timer = function( timer ) {
- if ( timer() && jQuery.timers.push( timer ) ) {
- jQuery.fx.start();
- }
-};
-
-jQuery.fx.interval = 13;
-
-jQuery.fx.start = function() {
- if ( !timerId ) {
- timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
- }
-};
-
-jQuery.fx.stop = function() {
- clearInterval( timerId );
- timerId = null;
-};
-
-jQuery.fx.speeds = {
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
-};
-
-// Back Compat <1.8 extension point
-jQuery.fx.step = {};
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.animated = function( elem ) {
- return jQuery.grep(jQuery.timers, function( fn ) {
- return elem === fn.elem;
- }).length;
- };
-}
-jQuery.fn.offset = function( options ) {
- if ( arguments.length ) {
- return options === undefined ?
- this :
- this.each(function( i ) {
- jQuery.offset.setOffset( this, options, i );
- });
- }
-
- var docElem, win,
- box = { top: 0, left: 0 },
- elem = this[ 0 ],
- doc = elem && elem.ownerDocument;
-
- if ( !doc ) {
- return;
- }
-
- docElem = doc.documentElement;
-
- // Make sure it's not a disconnected DOM node
- if ( !jQuery.contains( docElem, elem ) ) {
- return box;
- }
-
- // If we don't have gBCR, just use 0,0 rather than error
- // BlackBerry 5, iOS 3 (original iPhone)
- if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
- box = elem.getBoundingClientRect();
- }
- win = getWindow( doc );
- return {
- top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
- left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
- };
-};
-
-jQuery.offset = {
-
- setOffset: function( elem, options, i ) {
- var position = jQuery.css( elem, "position" );
-
- // set position first, in-case top/left are set even on static elem
- if ( position === "static" ) {
- elem.style.position = "relative";
- }
-
- var curElem = jQuery( elem ),
- curOffset = curElem.offset(),
- curCSSTop = jQuery.css( elem, "top" ),
- curCSSLeft = jQuery.css( elem, "left" ),
- calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
- props = {}, curPosition = {}, curTop, curLeft;
-
- // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
- if ( calculatePosition ) {
- curPosition = curElem.position();
- curTop = curPosition.top;
- curLeft = curPosition.left;
- } else {
- curTop = parseFloat( curCSSTop ) || 0;
- curLeft = parseFloat( curCSSLeft ) || 0;
- }
-
- if ( jQuery.isFunction( options ) ) {
- options = options.call( elem, i, curOffset );
- }
-
- if ( options.top != null ) {
- props.top = ( options.top - curOffset.top ) + curTop;
- }
- if ( options.left != null ) {
- props.left = ( options.left - curOffset.left ) + curLeft;
- }
-
- if ( "using" in options ) {
- options.using.call( elem, props );
- } else {
- curElem.css( props );
- }
- }
-};
-
-
-jQuery.fn.extend({
-
- position: function() {
- if ( !this[ 0 ] ) {
- return;
- }
-
- var offsetParent, offset,
- parentOffset = { top: 0, left: 0 },
- elem = this[ 0 ];
-
- // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
- if ( jQuery.css( elem, "position" ) === "fixed" ) {
- // we assume that getBoundingClientRect is available when computed position is fixed
- offset = elem.getBoundingClientRect();
- } else {
- // Get *real* offsetParent
- offsetParent = this.offsetParent();
-
- // Get correct offsets
- offset = this.offset();
- if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
- parentOffset = offsetParent.offset();
- }
-
- // Add offsetParent borders
- parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
- parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
- }
-
- // Subtract parent offsets and element margins
- // note: when an element has margin: auto the offsetLeft and marginLeft
- // are the same in Safari causing offset.left to incorrectly be 0
- return {
- top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
- left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
- };
- },
-
- offsetParent: function() {
- return this.map(function() {
- var offsetParent = this.offsetParent || document.documentElement;
- while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
- offsetParent = offsetParent.offsetParent;
- }
- return offsetParent || document.documentElement;
- });
- }
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
- var top = /Y/.test( prop );
-
- jQuery.fn[ method ] = function( val ) {
- return jQuery.access( this, function( elem, method, val ) {
- var win = getWindow( elem );
-
- if ( val === undefined ) {
- return win ? (prop in win) ? win[ prop ] :
- win.document.documentElement[ method ] :
- elem[ method ];
- }
-
- if ( win ) {
- win.scrollTo(
- !top ? val : jQuery( win ).scrollLeft(),
- top ? val : jQuery( win ).scrollTop()
- );
-
- } else {
- elem[ method ] = val;
- }
- }, method, val, arguments.length, null );
- };
-});
-
-function getWindow( elem ) {
- return jQuery.isWindow( elem ) ?
- elem :
- elem.nodeType === 9 ?
- elem.defaultView || elem.parentWindow :
- false;
-}
-// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
-jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
- jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
- // margin is only for outerHeight, outerWidth
- jQuery.fn[ funcName ] = function( margin, value ) {
- var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
- extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
-
- return jQuery.access( this, function( elem, type, value ) {
- var doc;
-
- if ( jQuery.isWindow( elem ) ) {
- // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
- // isn't a whole lot we can do. See pull request at this URL for discussion:
- // https://github.com/jquery/jquery/pull/764
- return elem.document.documentElement[ "client" + name ];
- }
-
- // Get document width or height
- if ( elem.nodeType === 9 ) {
- doc = elem.documentElement;
-
- // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
- // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
- return Math.max(
- elem.body[ "scroll" + name ], doc[ "scroll" + name ],
- elem.body[ "offset" + name ], doc[ "offset" + name ],
- doc[ "client" + name ]
- );
- }
-
- return value === undefined ?
- // Get width or height on the element, requesting but not forcing parseFloat
- jQuery.css( elem, type, extra ) :
-
- // Set width or height on the element
- jQuery.style( elem, type, value, extra );
- }, type, chainable ? margin : undefined, chainable, null );
- };
- });
-});
-// Limit scope pollution from any deprecated API
-// (function() {
-
-// })();
-// Expose jQuery to the global object
-window.jQuery = window.$ = jQuery;
-
-// Expose jQuery as an AMD module, but only for AMD loaders that
-// understand the issues with loading multiple versions of jQuery
-// in a page that all might call define(). The loader will indicate
-// they have special allowances for multiple jQuery versions by
-// specifying define.amd.jQuery = true. Register as a named module,
-// since jQuery can be concatenated with other files that may use define,
-// but not use a proper concatenation script that understands anonymous
-// AMD modules. A named AMD is safest and most robust way to register.
-// Lowercase jquery is used because AMD module names are derived from
-// file names, and jQuery is normally delivered in a lowercase file name.
-// Do this after creating the global so that if an AMD module wants to call
-// noConflict to hide this version of jQuery, it will work.
-if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
- define( "jquery", [], function () { return jQuery; } );
-}
-
-})( window );
diff --git a/framework/yii/assets/jquery.min.js b/framework/yii/assets/jquery.min.js
deleted file mode 100644
index 006e953..0000000
--- a/framework/yii/assets/jquery.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
-//@ sourceMappingURL=jquery.min.map
-*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
a ",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="
",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;
-return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="
";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="
",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="
",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="
",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="
",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="
",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&>(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/
\s*$/g,At={option:[1,""," "],legend:[1,""," "],area:[1,""," "],param:[1,""," "],thead:[1,""],tr:[2,""],col:[2,""],td:[3,""],_default:b.support.htmlSerialize?[0,"",""]:[1,"X","
"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l)
-}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write(""),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}b.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(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(b.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?b("").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,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"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window);
\ No newline at end of file
diff --git a/framework/yii/base/ActionFilter.php b/framework/yii/base/ActionFilter.php
index 60be177..648211c 100644
--- a/framework/yii/base/ActionFilter.php
+++ b/framework/yii/base/ActionFilter.php
@@ -8,6 +8,11 @@
namespace yii\base;
/**
+ * ActionFilter provides a base implementation for action filters that can be added to a controller
+ * to handle the `beforeAction` event.
+ *
+ * Check implementation of [[AccessControl]], [[PageCache]] and [[HttpCache]] as examples on how to use it.
+ *
* @author Qiang Xue
* @since 2.0
*/
diff --git a/framework/yii/base/Application.php b/framework/yii/base/Application.php
index 80e93a6..497cb2f 100644
--- a/framework/yii/base/Application.php
+++ b/framework/yii/base/Application.php
@@ -15,6 +15,7 @@ use yii\web\HttpException;
* Application is the base class for all application classes.
*
* @property \yii\rbac\Manager $authManager The auth manager for this application. This property is read-only.
+ * @property string $basePath The root directory of the application.
* @property \yii\caching\Cache $cache The cache application component. Null if the component is not enabled.
* This property is read-only.
* @property \yii\db\Connection $db The database connection. This property is read-only.
@@ -208,6 +209,11 @@ abstract class Application extends Module
protected function initExtensions($extensions)
{
foreach ($extensions as $extension) {
+ if (!empty($extension['alias'])) {
+ foreach ($extension['alias'] as $name => $path) {
+ Yii::setAlias($name, $path);
+ }
+ }
if (isset($extension['bootstrap'])) {
/** @var Extension $class */
$class = $extension['bootstrap'];
@@ -256,6 +262,7 @@ abstract class Application extends Module
* Sets the root directory of the applicaition and the @app alias.
* This method can only be invoked at the beginning of the constructor.
* @param string $path the root directory of the application.
+ * @property string the root directory of the application.
* @throws InvalidParamException if the directory does not exist.
*/
public function setBasePath($path)
@@ -466,7 +473,7 @@ abstract class Application extends Module
'formatter' => ['class' => 'yii\base\Formatter'],
'i18n' => ['class' => 'yii\i18n\I18N'],
'urlManager' => ['class' => 'yii\web\UrlManager'],
- 'view' => ['class' => 'yii\base\View'],
+ 'view' => ['class' => 'yii\web\View'],
]);
}
@@ -609,10 +616,8 @@ abstract class Application extends Module
{
$category = get_class($exception);
if ($exception instanceof HttpException) {
- /** @var $exception HttpException */
$category .= '\\' . $exception->statusCode;
} elseif ($exception instanceof \ErrorException) {
- /** @var $exception \ErrorException */
$category .= '\\' . $exception->getSeverity();
}
Yii::error((string)$exception, $category);
diff --git a/framework/yii/base/Component.php b/framework/yii/base/Component.php
index 9d5258a..2ef4ead 100644
--- a/framework/yii/base/Component.php
+++ b/framework/yii/base/Component.php
@@ -10,6 +10,8 @@ namespace yii\base;
use Yii;
/**
+ * Component is the base class that implements the *property*, *event* and *behavior* features.
+ *
* @include @yii/base/Component.md
*
* @property Behavior[] $behaviors List of behaviors attached to this component. This property is read-only.
@@ -41,7 +43,7 @@ class Component extends Object
* @return mixed the property value or the value of a behavior's property
* @throws UnknownPropertyException if the property is not defined
* @throws InvalidCallException if the property is write-only.
- * @see __set
+ * @see __set()
*/
public function __get($name)
{
@@ -80,7 +82,7 @@ class Component extends Object
* @param mixed $value the property value
* @throws UnknownPropertyException if the property is not defined
* @throws InvalidCallException if the property is read-only.
- * @see __get
+ * @see __get()
*/
public function __set($name, $value)
{
@@ -225,8 +227,8 @@ class Component extends Object
* @param boolean $checkVars whether to treat member variables as properties
* @param boolean $checkBehaviors whether to treat behaviors' properties as properties of this component
* @return boolean whether the property is defined
- * @see canGetProperty
- * @see canSetProperty
+ * @see canGetProperty()
+ * @see canSetProperty()
*/
public function hasProperty($name, $checkVars = true, $checkBehaviors = true)
{
@@ -246,7 +248,7 @@ class Component extends Object
* @param boolean $checkVars whether to treat member variables as properties
* @param boolean $checkBehaviors whether to treat behaviors' properties as properties of this component
* @return boolean whether the property can be read
- * @see canSetProperty
+ * @see canSetProperty()
*/
public function canGetProperty($name, $checkVars = true, $checkBehaviors = true)
{
@@ -276,7 +278,7 @@ class Component extends Object
* @param boolean $checkVars whether to treat member variables as properties
* @param boolean $checkBehaviors whether to treat behaviors' properties as properties of this component
* @return boolean whether the property can be written
- * @see canGetProperty
+ * @see canGetProperty()
*/
public function canSetProperty($name, $checkVars = true, $checkBehaviors = true)
{
@@ -358,13 +360,13 @@ class Component extends Object
public function hasEventHandlers($name)
{
$this->ensureBehaviors();
- return !empty($this->_events[$name]);
+ return !empty($this->_events[$name]) || Event::hasHandlers($this, $name);
}
/**
* Attaches an event handler to an event.
*
- * An event handler must be a valid PHP callback. The followings are
+ * The event handler must be a valid PHP callback. The followings are
* some examples:
*
* ~~~
@@ -374,7 +376,7 @@ class Component extends Object
* 'handleClick' // global function handleClick()
* ~~~
*
- * An event handler must be defined with the following signature,
+ * The event handler must be defined with the following signature,
*
* ~~~
* function ($event)
@@ -406,24 +408,25 @@ class Component extends Object
public function off($name, $handler = null)
{
$this->ensureBehaviors();
- if (isset($this->_events[$name])) {
- if ($handler === null) {
- $this->_events[$name] = [];
- } else {
- $removed = false;
- foreach ($this->_events[$name] as $i => $event) {
- if ($event[0] === $handler) {
- unset($this->_events[$name][$i]);
- $removed = true;
- }
- }
- if ($removed) {
- $this->_events[$name] = array_values($this->_events[$name]);
+ if (empty($this->_events[$name])) {
+ return false;
+ }
+ if ($handler === null) {
+ unset($this->_events[$name]);
+ return true;
+ } else {
+ $removed = false;
+ foreach ($this->_events[$name] as $i => $event) {
+ if ($event[0] === $handler) {
+ unset($this->_events[$name][$i]);
+ $removed = true;
}
- return $removed;
}
+ if ($removed) {
+ $this->_events[$name] = array_values($this->_events[$name]);
+ }
+ return $removed;
}
- return false;
}
/**
@@ -454,6 +457,7 @@ class Component extends Object
}
}
}
+ Event::trigger($this, $name, $event);
}
/**
@@ -490,7 +494,7 @@ class Component extends Object
* - an object configuration array that will be passed to [[Yii::createObject()]] to create the behavior object.
*
* @return Behavior the behavior object
- * @see detachBehavior
+ * @see detachBehavior()
*/
public function attachBehavior($name, $behavior)
{
@@ -503,7 +507,7 @@ class Component extends Object
* Each behavior is indexed by its name and should be a [[Behavior]] object,
* a string specifying the behavior class, or an configuration array for creating the behavior.
* @param array $behaviors list of behaviors to be attached to the component
- * @see attachBehavior
+ * @see attachBehavior()
*/
public function attachBehaviors($behaviors)
{
diff --git a/framework/yii/base/Controller.php b/framework/yii/base/Controller.php
index d2f491c..c8f2d48 100644
--- a/framework/yii/base/Controller.php
+++ b/framework/yii/base/Controller.php
@@ -111,7 +111,7 @@ class Controller extends Component implements ViewContextInterface
* @param array $params the parameters (name-value pairs) to be passed to the action.
* @return mixed the result of the action
* @throws InvalidRouteException if the requested action ID cannot be resolved into an action successfully.
- * @see createAction
+ * @see createAction()
*/
public function runAction($id, $params = [])
{
@@ -149,8 +149,7 @@ class Controller extends Component implements ViewContextInterface
* @param string $route the route to be handled, e.g., 'view', 'comment/view', '/admin/comment/view'.
* @param array $params the parameters to be passed to the action.
* @return mixed the result of the action
- * @see runAction
- * @see forward
+ * @see runAction()
*/
public function run($route, $params = [])
{
diff --git a/framework/yii/base/ErrorHandler.php b/framework/yii/base/ErrorHandler.php
index ead9646..c96ca5e 100644
--- a/framework/yii/base/ErrorHandler.php
+++ b/framework/yii/base/ErrorHandler.php
@@ -16,6 +16,9 @@ use yii\web\HttpException;
* ErrorHandler displays these errors using appropriate views based on the
* nature of the errors and the mode the application runs at.
*
+ * ErrorHandler is configured as an application component in [[yii\base\Application]] by default.
+ * You can access that instance via `Yii::$app->errorHandler`.
+ *
* @author Qiang Xue
* @author Timur Ruziev
* @since 2.0
diff --git a/framework/yii/base/Event.php b/framework/yii/base/Event.php
index 5d40736..a678c89 100644
--- a/framework/yii/base/Event.php
+++ b/framework/yii/base/Event.php
@@ -45,4 +45,136 @@ class Event extends Object
* Note that this varies according to which event handler is currently executing.
*/
public $data;
+
+ private static $_events = [];
+
+ /**
+ * Attaches an event handler to a class-level event.
+ *
+ * When a class-level event is triggered, event handlers attached
+ * to that class and all parent classes will be invoked.
+ *
+ * For example, the following code attaches an event handler to `ActiveRecord`'s
+ * `afterInsert` event:
+ *
+ * ~~~
+ * Event::on(ActiveRecord::className(), ActiveRecord::EVENT_AFTER_INSERT, function ($event) {
+ * Yii::trace(get_class($event->sender) . ' is inserted.');
+ * });
+ * ~~~
+ *
+ * The handler will be invoked for EVERY successful ActiveRecord insertion.
+ *
+ * For more details about how to declare an event handler, please refer to [[Component::on()]].
+ *
+ * @param string $class the fully qualified class name to which the event handler needs to attach
+ * @param string $name the event name
+ * @param callback $handler the event handler
+ * @param mixed $data the data to be passed to the event handler when the event is triggered.
+ * When the event handler is invoked, this data can be accessed via [[Event::data]].
+ * @see off()
+ */
+ public static function on($class, $name, $handler, $data = null)
+ {
+ self::$_events[$name][ltrim($class, '\\')][] = [$handler, $data];
+ }
+
+ /**
+ * Detaches an event handler from a class-level event.
+ *
+ * This method is the opposite of [[on()]].
+ *
+ * @param string $class the fully qualified class name from which the event handler needs to be detached
+ * @param string $name the event name
+ * @param callback $handler the event handler to be removed.
+ * If it is null, all handlers attached to the named event will be removed.
+ * @return boolean if a handler is found and detached
+ * @see on()
+ */
+ public static function off($class, $name, $handler = null)
+ {
+ $class = ltrim($class, '\\');
+ if (empty(self::$_events[$name][$class])) {
+ return false;
+ }
+ if ($handler === null) {
+ unset(self::$_events[$name][$class]);
+ return true;
+ } else {
+ $removed = false;
+ foreach (self::$_events[$name][$class] as $i => $event) {
+ if ($event[0] === $handler) {
+ unset(self::$_events[$name][$class][$i]);
+ $removed = true;
+ }
+ }
+ if ($removed) {
+ self::$_events[$name][$class] = array_values(self::$_events[$name][$class]);
+ }
+ return $removed;
+ }
+ }
+
+ /**
+ * Returns a value indicating whether there is any handler attached to the specified class-level event.
+ * Note that this method will also check all parent classes to see if there is any handler attached
+ * to the named event.
+ * @param string|object $class the object or the fully qualified class name specifying the class-level event
+ * @param string $name the event name
+ * @return boolean whether there is any handler attached to the event.
+ */
+ public static function hasHandlers($class, $name)
+ {
+ if (empty(self::$_events[$name])) {
+ return false;
+ }
+ if (is_object($class)) {
+ $class = get_class($class);
+ } else {
+ $class = ltrim($class, '\\');
+ }
+ do {
+ if (!empty(self::$_events[$name][$class])) {
+ return true;
+ }
+ } while (($class = get_parent_class($class)) !== false);
+ return false;
+ }
+
+ /**
+ * Triggers a class-level event.
+ * This method will cause invocation of event handlers that are attached to the named event
+ * for the specified class and all its parent classes.
+ * @param string|object $class the object or the fully qualified class name specifying the class-level event
+ * @param string $name the event name
+ * @param Event $event the event parameter. If not set, a default [[Event]] object will be created.
+ */
+ public static function trigger($class, $name, $event = null)
+ {
+ if (empty(self::$_events[$name])) {
+ return;
+ }
+ if ($event === null) {
+ $event = new self;
+ }
+ $event->handled = false;
+ $event->name = $name;
+
+ if (is_object($class)) {
+ $class = get_class($class);
+ } else {
+ $class = ltrim($class, '\\');
+ }
+ do {
+ if (!empty(self::$_events[$name][$class])) {
+ foreach (self::$_events[$name][$class] as $handler) {
+ $event->data = $handler[1];
+ call_user_func($handler[0], $event);
+ if ($event instanceof Event && $event->handled) {
+ return;
+ }
+ }
+ }
+ } while (($class = get_parent_class($class)) !== false);
+ }
}
diff --git a/framework/yii/base/Formatter.php b/framework/yii/base/Formatter.php
index 18faaff..30df3c3 100644
--- a/framework/yii/base/Formatter.php
+++ b/framework/yii/base/Formatter.php
@@ -19,6 +19,9 @@ use yii\helpers\Html;
* The behavior of some of them may be configured via the properties of Formatter. For example,
* by configuring [[dateFormat]], one may control how [[asDate()]] formats the value into a date string.
*
+ * Formatter is configured as an application component in [[yii\base\Application]] by default.
+ * You can access that instance via `Yii::$app->formatter`.
+ *
* @author Qiang Xue
* @since 2.0
*/
diff --git a/framework/yii/base/Model.php b/framework/yii/base/Model.php
index 99c1df9..8090ebc 100644
--- a/framework/yii/base/Model.php
+++ b/framework/yii/base/Model.php
@@ -46,7 +46,8 @@ use yii\validators\Validator;
* @property ArrayIterator $iterator An iterator for traversing the items in the list. This property is
* read-only.
* @property string $scenario The scenario that this model is in. Defaults to [[DEFAULT_SCENARIO]].
- * @property ArrayObject $validators All the validators declared in the model. This property is read-only.
+ * @property ArrayObject|\yii\validators\Validator[] $validators All the validators declared in the model.
+ * This property is read-only.
*
* @author Qiang Xue
* @since 2.0
@@ -144,7 +145,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
* merge the parent rules with child rules using functions such as `array_merge()`.
*
* @return array validation rules
- * @see scenarios
+ * @see scenarios()
*/
public function rules()
{
@@ -255,7 +256,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
* merge the parent labels with child labels using functions such as `array_merge()`.
*
* @return array attribute labels (name => label)
- * @see generateAttributeLabel
+ * @see generateAttributeLabel()
*/
public function attributeLabels()
{
@@ -349,7 +350,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
* $model->validators[] = $newValidator;
* ~~~
*
- * @return ArrayObject all the validators declared in the model.
+ * @return ArrayObject|\yii\validators\Validator[] all the validators declared in the model.
*/
public function getValidators()
{
@@ -369,7 +370,6 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
{
$validators = [];
$scenario = $this->getScenario();
- /** @var $validator Validator */
foreach ($this->getValidators() as $validator) {
if ($validator->isActive($scenario) && ($attribute === null || in_array($attribute, $validator->attributes, true))) {
$validators[] = $validator;
@@ -444,8 +444,8 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
* Returns the text label for the specified attribute.
* @param string $attribute the attribute name
* @return string the attribute label
- * @see generateAttributeLabel
- * @see attributeLabels
+ * @see generateAttributeLabel()
+ * @see attributeLabels()
*/
public function getAttributeLabel($attribute)
{
@@ -483,8 +483,8 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
* ]
* ~~~
*
- * @see getFirstErrors
- * @see getFirstError
+ * @see getFirstErrors()
+ * @see getFirstError()
*/
public function getErrors($attribute = null)
{
@@ -498,8 +498,8 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
/**
* Returns the first error of every attribute in the model.
* @return array the first errors. An empty array will be returned if there is no error.
- * @see getErrors
- * @see getFirstError
+ * @see getErrors()
+ * @see getFirstError()
*/
public function getFirstErrors()
{
@@ -520,8 +520,8 @@ class Model extends Component implements IteratorAggregate, ArrayAccess
* Returns the first error of the specified attribute.
* @param string $attribute attribute name.
* @return string the error message. Null is returned if no error.
- * @see getErrors
- * @see getFirstErrors
+ * @see getErrors()
+ * @see getFirstErrors()
*/
public function getFirstError($attribute)
{
diff --git a/framework/yii/base/Module.php b/framework/yii/base/Module.php
index 4bc5351..1e5302c 100644
--- a/framework/yii/base/Module.php
+++ b/framework/yii/base/Module.php
@@ -241,7 +241,7 @@ abstract class Module extends Component
* Sets the directory that contains the controller classes.
* @param string $path the directory that contains the controller classes.
* This can be either a directory name or a path alias.
- * @throws Exception if the directory is invalid
+ * @throws InvalidParamException if the directory is invalid
*/
public function setControllerPath($path)
{
@@ -264,7 +264,7 @@ abstract class Module extends Component
/**
* Sets the directory that contains the view files.
* @param string $path the root directory of view files.
- * @throws Exception if the directory is invalid
+ * @throws InvalidParamException if the directory is invalid
*/
public function setViewPath($path)
{
@@ -287,7 +287,7 @@ abstract class Module extends Component
/**
* Sets the directory that contains the layout files.
* @param string $path the root directory of layout files.
- * @throws Exception if the directory is invalid
+ * @throws InvalidParamException if the directory is invalid
*/
public function setLayoutPath($path)
{
@@ -578,7 +578,7 @@ abstract class Module extends Component
{
$parts = $this->createController($route);
if (is_array($parts)) {
- /** @var $controller Controller */
+ /** @var Controller $controller */
list($controller, $actionID) = $parts;
$oldController = Yii::$app->controller;
Yii::$app->controller = $controller;
diff --git a/framework/yii/base/Object.php b/framework/yii/base/Object.php
index f0bd92b..06fca50 100644
--- a/framework/yii/base/Object.php
+++ b/framework/yii/base/Object.php
@@ -10,7 +10,10 @@ namespace yii\base;
use Yii;
/**
+ * Object is the base class that implements the *property* feature.
+ *
* @include @yii/base/Object.md
+ *
* @author Qiang Xue
* @since 2.0
*/
@@ -64,7 +67,7 @@ class Object implements Arrayable
* @return mixed the property value
* @throws UnknownPropertyException if the property is not defined
* @throws InvalidCallException if the property is write-only
- * @see __set
+ * @see __set()
*/
public function __get($name)
{
@@ -87,7 +90,7 @@ class Object implements Arrayable
* @param mixed $value the property value
* @throws UnknownPropertyException if the property is not defined
* @throws InvalidCallException if the property is read-only
- * @see __get
+ * @see __get()
*/
public function __set($name, $value)
{
@@ -168,8 +171,8 @@ class Object implements Arrayable
* @param string $name the property name
* @param boolean $checkVars whether to treat member variables as properties
* @return boolean whether the property is defined
- * @see canGetProperty
- * @see canSetProperty
+ * @see canGetProperty()
+ * @see canSetProperty()
*/
public function hasProperty($name, $checkVars = true)
{
@@ -187,7 +190,7 @@ class Object implements Arrayable
* @param string $name the property name
* @param boolean $checkVars whether to treat member variables as properties
* @return boolean whether the property can be read
- * @see canSetProperty
+ * @see canSetProperty()
*/
public function canGetProperty($name, $checkVars = true)
{
@@ -205,7 +208,7 @@ class Object implements Arrayable
* @param string $name the property name
* @param boolean $checkVars whether to treat member variables as properties
* @return boolean whether the property can be written
- * @see canGetProperty
+ * @see canGetProperty()
*/
public function canSetProperty($name, $checkVars = true)
{
diff --git a/framework/yii/base/Request.php b/framework/yii/base/Request.php
index 0d660d6..cd3ffdc 100644
--- a/framework/yii/base/Request.php
+++ b/framework/yii/base/Request.php
@@ -8,6 +8,7 @@
namespace yii\base;
/**
+ * Request represents a request that is handled by an [[Application]].
*
* @property boolean $isConsoleRequest The value indicating whether the current request is made via console.
* @property string $scriptFile Entry script file path (processed w/ realpath()).
diff --git a/framework/yii/base/Response.php b/framework/yii/base/Response.php
index 467de9e..1403b69 100644
--- a/framework/yii/base/Response.php
+++ b/framework/yii/base/Response.php
@@ -8,6 +8,8 @@
namespace yii\base;
/**
+ * Response represents the response of an [[Application]] to a [[Request]].
+ *
* @author Qiang Xue
* @since 2.0
*/
diff --git a/framework/yii/base/Theme.php b/framework/yii/base/Theme.php
index ff6780c..1d8771f 100644
--- a/framework/yii/base/Theme.php
+++ b/framework/yii/base/Theme.php
@@ -13,17 +13,38 @@ use yii\helpers\FileHelper;
/**
* Theme represents an application theme.
*
- * A theme is directory consisting of view and layout files which are meant to replace their
- * non-themed counterparts.
+ * When [[View]] renders a view file, it will check the [[Application::theme|active theme]]
+ * to see if there is a themed version of the view file exists. If so, the themed version will be rendered instead.
*
- * Theme uses [[pathMap]] to achieve the file replacement. A view or layout file will be replaced
- * with its themed version if part of its path matches one of the keys in [[pathMap]].
- * Then the matched part will be replaced with the corresponding array value.
+ * A theme is a directory consisting of view files which are meant to replace their non-themed counterparts.
+ *
+ * Theme uses [[pathMap]] to achieve the view file replacement:
+ *
+ * 1. It first looks for a key in [[pathMap]] that is a substring of the given view file path;
+ * 2. If such a key exists, the corresponding value will be used to replace the corresponding part
+ * in the view file path;
+ * 3. It will then check if the updated view file exists or not. If so, that file will be used
+ * to replace the original view file.
+ * 4. If Step 2 or 3 fails, the original view file will be used.
*
* For example, if [[pathMap]] is `['/web/views' => '/web/themes/basic']`,
* then the themed version for a view file `/web/views/site/index.php` will be
* `/web/themes/basic/site/index.php`.
*
+ * It is possible to map a single path to multiple paths. For example,
+ *
+ * ~~~
+ * 'pathMap' => [
+ * '/web/views' => [
+ * '/web/themes/christmas',
+ * '/web/themes/basic',
+ * ],
+ * ]
+ * ~~~
+ *
+ * In this case, the themed version could be either `/web/themes/christmas/site/index.php` or
+ * `/web/themes/basic/site/index.php`. The former has precedence over the latter if both files exist.
+ *
* To use a theme, you should configure the [[View::theme|theme]] property of the "view" application
* component like the following:
*
@@ -75,16 +96,18 @@ class Theme extends Component
if (empty($this->pathMap)) {
if ($this->basePath !== null) {
$this->basePath = Yii::getAlias($this->basePath);
- $this->pathMap = [Yii::$app->getBasePath() => $this->basePath];
+ $this->pathMap = [Yii::$app->getBasePath() => [$this->basePath]];
} else {
throw new InvalidConfigException('The "basePath" property must be set.');
}
}
$paths = [];
- foreach ($this->pathMap as $from => $to) {
+ foreach ($this->pathMap as $from => $tos) {
$from = FileHelper::normalizePath(Yii::getAlias($from));
- $to = FileHelper::normalizePath(Yii::getAlias($to));
- $paths[$from . DIRECTORY_SEPARATOR] = $to . DIRECTORY_SEPARATOR;
+ foreach ((array)$tos as $to) {
+ $to = FileHelper::normalizePath(Yii::getAlias($to));
+ $paths[$from . DIRECTORY_SEPARATOR][] = $to . DIRECTORY_SEPARATOR;
+ }
}
$this->pathMap = $paths;
if ($this->baseUrl === null) {
@@ -103,12 +126,14 @@ class Theme extends Component
public function applyTo($path)
{
$path = FileHelper::normalizePath($path);
- foreach ($this->pathMap as $from => $to) {
+ foreach ($this->pathMap as $from => $tos) {
if (strpos($path, $from) === 0) {
$n = strlen($from);
- $file = $to . substr($path, $n);
- if (is_file($file)) {
- return $file;
+ foreach ($tos as $to) {
+ $file = $to . substr($path, $n);
+ if (is_file($file)) {
+ return $file;
+ }
}
}
}
diff --git a/framework/yii/base/View.php b/framework/yii/base/View.php
index 222f94b..61d9373 100644
--- a/framework/yii/base/View.php
+++ b/framework/yii/base/View.php
@@ -9,9 +9,6 @@ namespace yii\base;
use Yii;
use yii\helpers\FileHelper;
-use yii\helpers\Html;
-use yii\web\JqueryAsset;
-use yii\web\AssetBundle;
use yii\widgets\Block;
use yii\widgets\ContentDecorator;
use yii\widgets\FragmentCache;
@@ -21,9 +18,6 @@ use yii\widgets\FragmentCache;
*
* View provides a set of methods (e.g. [[render()]]) for rendering purpose.
*
- * @property \yii\web\AssetManager $assetManager The asset manager. Defaults to the "assetManager" application
- * component.
- *
* @author Qiang Xue
* @since 2.0
*/
@@ -38,14 +32,6 @@ class View extends Component
*/
const EVENT_END_PAGE = 'endPage';
/**
- * @event Event an event that is triggered by [[beginBody()]].
- */
- const EVENT_BEGIN_BODY = 'beginBody';
- /**
- * @event Event an event that is triggered by [[endBody()]].
- */
- const EVENT_END_BODY = 'endBody';
- /**
* @event ViewEvent an event that is triggered by [[renderFile()]] right before it renders a view file.
*/
const EVENT_BEFORE_RENDER = 'beforeRender';
@@ -55,40 +41,6 @@ class View extends Component
const EVENT_AFTER_RENDER = 'afterRender';
/**
- * The location of registered JavaScript code block or files.
- * This means the location is in the head section.
- */
- const POS_HEAD = 1;
- /**
- * The location of registered JavaScript code block or files.
- * This means the location is at the beginning of the body section.
- */
- const POS_BEGIN = 2;
- /**
- * The location of registered JavaScript code block or files.
- * This means the location is at the end of the body section.
- */
- const POS_END = 3;
- /**
- * The location of registered JavaScript code block.
- * This means the JavaScript code block will be enclosed within `jQuery(document).ready()`.
- */
- const POS_READY = 4;
- /**
- * This is internally used as the placeholder for receiving the content registered for the head section.
- */
- const PH_HEAD = '';
- /**
- * This is internally used as the placeholder for receiving the content registered for the beginning of the body section.
- */
- const PH_BODY_BEGIN = '';
- /**
- * This is internally used as the placeholder for receiving the content registered for the end of the body section.
- */
- const PH_BODY_END = '';
-
-
- /**
* @var ViewContextInterface the context under which the [[renderFile()]] method is being invoked.
*/
public $context;
@@ -136,46 +88,6 @@ class View extends Component
* @internal
*/
public $dynamicPlaceholders = [];
- /**
- * @var AssetBundle[] list of the registered asset bundles. The keys are the bundle names, and the values
- * are the registered [[AssetBundle]] objects.
- * @see registerAssetBundle
- */
- public $assetBundles = [];
- /**
- * @var string the page title
- */
- public $title;
- /**
- * @var array the registered meta tags.
- * @see registerMetaTag
- */
- public $metaTags;
- /**
- * @var array the registered link tags.
- * @see registerLinkTag
- */
- public $linkTags;
- /**
- * @var array the registered CSS code blocks.
- * @see registerCss
- */
- public $css;
- /**
- * @var array the registered CSS files.
- * @see registerCssFile
- */
- public $cssFiles;
- /**
- * @var array the registered JS code blocks
- * @see registerJs
- */
- public $js;
- /**
- * @var array the registered JS files.
- * @see registerJsFile
- */
- public $jsFiles;
/**
@@ -211,7 +123,7 @@ class View extends Component
* existing [[context]] will be used.
* @return string the rendering result
* @throws InvalidParamException if the view cannot be resolved or the view file does not exist.
- * @see renderFile
+ * @see renderFile()
*/
public function render($view, $params = [], $context = null)
{
@@ -498,7 +410,7 @@ class View extends Component
{
$properties['id'] = $id;
$properties['view'] = $this;
- /** @var $cache FragmentCache */
+ /** @var FragmentCache $cache */
$cache = FragmentCache::begin($properties);
if ($cache->getCachedContent() !== false) {
$this->endCache();
@@ -516,29 +428,8 @@ class View extends Component
FragmentCache::end();
}
-
- private $_assetManager;
-
- /**
- * Registers the asset manager being used by this view object.
- * @return \yii\web\AssetManager the asset manager. Defaults to the "assetManager" application component.
- */
- public function getAssetManager()
- {
- return $this->_assetManager ?: Yii::$app->getAssetManager();
- }
-
- /**
- * Sets the asset manager.
- * @param \yii\web\AssetManager $value the asset manager
- */
- public function setAssetManager($value)
- {
- $this->_assetManager = $value;
- }
-
/**
- * Marks the beginning of an HTML page.
+ * Marks the beginning of a page.
*/
public function beginPage()
{
@@ -549,301 +440,11 @@ class View extends Component
}
/**
- * Marks the ending of an HTML page.
+ * Marks the ending of a page.
*/
public function endPage()
{
$this->trigger(self::EVENT_END_PAGE);
-
- $content = ob_get_clean();
- foreach (array_keys($this->assetBundles) as $bundle) {
- $this->registerAssetFiles($bundle);
- }
- echo strtr($content, [
- self::PH_HEAD => $this->renderHeadHtml(),
- self::PH_BODY_BEGIN => $this->renderBodyBeginHtml(),
- self::PH_BODY_END => $this->renderBodyEndHtml(),
- ]);
-
- unset(
- $this->metaTags,
- $this->linkTags,
- $this->css,
- $this->cssFiles,
- $this->js,
- $this->jsFiles
- );
- }
-
- /**
- * Registers all files provided by an asset bundle including depending bundles files.
- * Removes a bundle from [[assetBundles]] once files are registered.
- * @param string $name name of the bundle to register
- */
- private function registerAssetFiles($name)
- {
- if (!isset($this->assetBundles[$name])) {
- return;
- }
- $bundle = $this->assetBundles[$name];
- foreach ($bundle->depends as $dep) {
- $this->registerAssetFiles($dep);
- }
- $bundle->registerAssetFiles($this);
- unset($this->assetBundles[$name]);
- }
-
- /**
- * Marks the beginning of an HTML body section.
- */
- public function beginBody()
- {
- echo self::PH_BODY_BEGIN;
- $this->trigger(self::EVENT_BEGIN_BODY);
- }
-
- /**
- * Marks the ending of an HTML body section.
- */
- public function endBody()
- {
- $this->trigger(self::EVENT_END_BODY);
- echo self::PH_BODY_END;
- }
-
- /**
- * Marks the position of an HTML head section.
- */
- public function head()
- {
- echo self::PH_HEAD;
- }
-
- /**
- * Registers the named asset bundle.
- * All dependent asset bundles will be registered.
- * @param string $name the name of the asset bundle.
- * @param integer|null $position if set, this forces a minimum position for javascript files.
- * This will adjust depending assets javascript file position or fail if requirement can not be met.
- * If this is null, asset bundles position settings will not be changed.
- * See [[registerJsFile]] for more details on javascript position.
- * @return AssetBundle the registered asset bundle instance
- * @throws InvalidConfigException if the asset bundle does not exist or a circular dependency is detected
- */
- public function registerAssetBundle($name, $position = null)
- {
- if (!isset($this->assetBundles[$name])) {
- $am = $this->getAssetManager();
- $bundle = $am->getBundle($name);
- $this->assetBundles[$name] = false;
- // register dependencies
- $pos = isset($bundle->jsOptions['position']) ? $bundle->jsOptions['position'] : null;
- foreach ($bundle->depends as $dep) {
- $this->registerAssetBundle($dep, $pos);
- }
- $this->assetBundles[$name] = $bundle;
- } elseif ($this->assetBundles[$name] === false) {
- throw new InvalidConfigException("A circular dependency is detected for bundle '$name'.");
- } else {
- $bundle = $this->assetBundles[$name];
- }
-
- if ($position !== null) {
- $pos = isset($bundle->jsOptions['position']) ? $bundle->jsOptions['position'] : null;
- if ($pos === null) {
- $bundle->jsOptions['position'] = $pos = $position;
- } elseif ($pos > $position) {
- throw new InvalidConfigException("An asset bundle that depends on '$name' has a higher javascript file position configured than '$name'.");
- }
- // update position for all dependencies
- foreach ($bundle->depends as $dep) {
- $this->registerAssetBundle($dep, $pos);
- }
- }
- return $bundle;
- }
-
- /**
- * Registers a meta tag.
- * @param array $options the HTML attributes for the meta tag.
- * @param string $key the key that identifies the meta tag. If two meta tags are registered
- * with the same key, the latter will overwrite the former. If this is null, the new meta tag
- * will be appended to the existing ones.
- */
- public function registerMetaTag($options, $key = null)
- {
- if ($key === null) {
- $this->metaTags[] = Html::tag('meta', '', $options);
- } else {
- $this->metaTags[$key] = Html::tag('meta', '', $options);
- }
- }
-
- /**
- * Registers a link tag.
- * @param array $options the HTML attributes for the link tag.
- * @param string $key the key that identifies the link tag. If two link tags are registered
- * with the same key, the latter will overwrite the former. If this is null, the new link tag
- * will be appended to the existing ones.
- */
- public function registerLinkTag($options, $key = null)
- {
- if ($key === null) {
- $this->linkTags[] = Html::tag('link', '', $options);
- } else {
- $this->linkTags[$key] = Html::tag('link', '', $options);
- }
- }
-
- /**
- * Registers a CSS code block.
- * @param string $css the CSS code block to be registered
- * @param array $options the HTML attributes for the style tag.
- * @param string $key the key that identifies the CSS code block. If null, it will use
- * $css as the key. If two CSS code blocks are registered with the same key, the latter
- * will overwrite the former.
- */
- public function registerCss($css, $options = [], $key = null)
- {
- $key = $key ?: md5($css);
- $this->css[$key] = Html::style($css, $options);
- }
-
- /**
- * Registers a CSS file.
- * @param string $url the CSS file to be registered.
- * @param array $options the HTML attributes for the link tag.
- * @param string $key the key that identifies the CSS script file. If null, it will use
- * $url as the key. If two CSS files are registered with the same key, the latter
- * will overwrite the former.
- */
- public function registerCssFile($url, $options = [], $key = null)
- {
- $key = $key ?: $url;
- $this->cssFiles[$key] = Html::cssFile($url, $options);
- }
-
- /**
- * Registers a JS code block.
- * @param string $js the JS code block to be registered
- * @param integer $position the position at which the JS script tag should be inserted
- * in a page. The possible values are:
- *
- * - [[POS_HEAD]]: in the head section
- * - [[POS_BEGIN]]: at the beginning of the body section
- * - [[POS_END]]: at the end of the body section
- * - [[POS_READY]]: enclosed within jQuery(document).ready(). This is the default value.
- * Note that by using this position, the method will automatically register the jQuery js file.
- *
- * @param string $key the key that identifies the JS code block. If null, it will use
- * $js as the key. If two JS code blocks are registered with the same key, the latter
- * will overwrite the former.
- */
- public function registerJs($js, $position = self::POS_READY, $key = null)
- {
- $key = $key ?: md5($js);
- $this->js[$position][$key] = $js;
- if ($position === self::POS_READY) {
- JqueryAsset::register($this);
- }
- }
-
- /**
- * Registers a JS file.
- * Please note that when this file depends on other JS files to be registered before,
- * for example jQuery, you should use [[registerAssetBundle]] instead.
- * @param string $url the JS file to be registered.
- * @param array $options the HTML attributes for the script tag. A special option
- * named "position" is supported which specifies where the JS script tag should be inserted
- * in a page. The possible values of "position" are:
- *
- * - [[POS_HEAD]]: in the head section
- * - [[POS_BEGIN]]: at the beginning of the body section
- * - [[POS_END]]: at the end of the body section. This is the default value.
- *
- * @param string $key the key that identifies the JS script file. If null, it will use
- * $url as the key. If two JS files are registered with the same key, the latter
- * will overwrite the former.
- */
- public function registerJsFile($url, $options = [], $key = null)
- {
- $position = isset($options['position']) ? $options['position'] : self::POS_END;
- unset($options['position']);
- $key = $key ?: $url;
- $this->jsFiles[$position][$key] = Html::jsFile($url, $options);
- }
-
- /**
- * Renders the content to be inserted in the head section.
- * The content is rendered using the registered meta tags, link tags, CSS/JS code blocks and files.
- * @return string the rendered content
- */
- protected function renderHeadHtml()
- {
- $lines = [];
- if (!empty($this->metaTags)) {
- $lines[] = implode("\n", $this->metaTags);
- }
-
- $request = Yii::$app->getRequest();
- if ($request instanceof \yii\web\Request && $request->enableCsrfValidation) {
- $lines[] = Html::tag('meta', '', ['name' => 'csrf-var', 'content' => $request->csrfVar]);
- $lines[] = Html::tag('meta', '', ['name' => 'csrf-token', 'content' => $request->getCsrfToken()]);
- }
-
- if (!empty($this->linkTags)) {
- $lines[] = implode("\n", $this->linkTags);
- }
- if (!empty($this->cssFiles)) {
- $lines[] = implode("\n", $this->cssFiles);
- }
- if (!empty($this->css)) {
- $lines[] = implode("\n", $this->css);
- }
- if (!empty($this->jsFiles[self::POS_HEAD])) {
- $lines[] = implode("\n", $this->jsFiles[self::POS_HEAD]);
- }
- if (!empty($this->js[self::POS_HEAD])) {
- $lines[] = Html::script(implode("\n", $this->js[self::POS_HEAD]), ['type' => 'text/javascript']);
- }
- return empty($lines) ? '' : implode("\n", $lines);
- }
-
- /**
- * Renders the content to be inserted at the beginning of the body section.
- * The content is rendered using the registered JS code blocks and files.
- * @return string the rendered content
- */
- protected function renderBodyBeginHtml()
- {
- $lines = [];
- if (!empty($this->jsFiles[self::POS_BEGIN])) {
- $lines[] = implode("\n", $this->jsFiles[self::POS_BEGIN]);
- }
- if (!empty($this->js[self::POS_BEGIN])) {
- $lines[] = Html::script(implode("\n", $this->js[self::POS_BEGIN]), ['type' => 'text/javascript']);
- }
- return empty($lines) ? '' : implode("\n", $lines);
- }
-
- /**
- * Renders the content to be inserted at the end of the body section.
- * The content is rendered using the registered JS code blocks and files.
- * @return string the rendered content
- */
- protected function renderBodyEndHtml()
- {
- $lines = [];
- if (!empty($this->jsFiles[self::POS_END])) {
- $lines[] = implode("\n", $this->jsFiles[self::POS_END]);
- }
- if (!empty($this->js[self::POS_END])) {
- $lines[] = Html::script(implode("\n", $this->js[self::POS_END]), ['type' => 'text/javascript']);
- }
- if (!empty($this->js[self::POS_READY])) {
- $js = "jQuery(document).ready(function(){\n" . implode("\n", $this->js[self::POS_READY]) . "\n});";
- $lines[] = Html::script($js, ['type' => 'text/javascript']);
- }
- return empty($lines) ? '' : implode("\n", $lines);
+ ob_end_flush();
}
}
diff --git a/framework/yii/base/ViewEvent.php b/framework/yii/base/ViewEvent.php
index b5734f4..d02e180 100644
--- a/framework/yii/base/ViewEvent.php
+++ b/framework/yii/base/ViewEvent.php
@@ -8,6 +8,8 @@
namespace yii\base;
/**
+ * ViewEvent represents events triggered by the [[View]] component.
+ *
* @author Qiang Xue
* @since 2.0
*/
diff --git a/framework/yii/bootstrap/assets/css/bootstrap-theme.css b/framework/yii/bootstrap/assets/css/bootstrap-theme.css
deleted file mode 100644
index ad11735..0000000
--- a/framework/yii/bootstrap/assets/css/bootstrap-theme.css
+++ /dev/null
@@ -1,384 +0,0 @@
-.btn-default,
-.btn-primary,
-.btn-success,
-.btn-info,
-.btn-warning,
-.btn-danger {
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-
-.btn-default:active,
-.btn-primary:active,
-.btn-success:active,
-.btn-info:active,
-.btn-warning:active,
-.btn-danger:active,
-.btn-default.active,
-.btn-primary.active,
-.btn-success.active,
-.btn-info.active,
-.btn-warning.active,
-.btn-danger.active {
- -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
- box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
-}
-
-.btn:active,
-.btn.active {
- background-image: none;
-}
-
-.btn-default {
- text-shadow: 0 1px 0 #fff;
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#ffffff), to(#e6e6e6));
- background-image: -webkit-linear-gradient(top, #ffffff, 0%, #e6e6e6, 100%);
- background-image: -moz-linear-gradient(top, #ffffff 0%, #e6e6e6 100%);
- background-image: linear-gradient(to bottom, #ffffff 0%, #e6e6e6 100%);
- background-repeat: repeat-x;
- border-color: #e0e0e0;
- border-color: #ccc;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
-}
-
-.btn-default:active,
-.btn-default.active {
- background-color: #e6e6e6;
- border-color: #e0e0e0;
-}
-
-.btn-primary {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#3071a9));
- background-image: -webkit-linear-gradient(top, #428bca, 0%, #3071a9, 100%);
- background-image: -moz-linear-gradient(top, #428bca 0%, #3071a9 100%);
- background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%);
- background-repeat: repeat-x;
- border-color: #2d6ca2;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0);
-}
-
-.btn-primary:active,
-.btn-primary.active {
- background-color: #3071a9;
- border-color: #2d6ca2;
-}
-
-.btn-success {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5cb85c), to(#449d44));
- background-image: -webkit-linear-gradient(top, #5cb85c, 0%, #449d44, 100%);
- background-image: -moz-linear-gradient(top, #5cb85c 0%, #449d44 100%);
- background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
- background-repeat: repeat-x;
- border-color: #419641;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
-}
-
-.btn-success:active,
-.btn-success.active {
- background-color: #449d44;
- border-color: #419641;
-}
-
-.btn-warning {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f0ad4e), to(#ec971f));
- background-image: -webkit-linear-gradient(top, #f0ad4e, 0%, #ec971f, 100%);
- background-image: -moz-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
- background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
- background-repeat: repeat-x;
- border-color: #eb9316;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
-}
-
-.btn-warning:active,
-.btn-warning.active {
- background-color: #ec971f;
- border-color: #eb9316;
-}
-
-.btn-danger {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9534f), to(#c9302c));
- background-image: -webkit-linear-gradient(top, #d9534f, 0%, #c9302c, 100%);
- background-image: -moz-linear-gradient(top, #d9534f 0%, #c9302c 100%);
- background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
- background-repeat: repeat-x;
- border-color: #c12e2a;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
-}
-
-.btn-danger:active,
-.btn-danger.active {
- background-color: #c9302c;
- border-color: #c12e2a;
-}
-
-.btn-info {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5bc0de), to(#31b0d5));
- background-image: -webkit-linear-gradient(top, #5bc0de, 0%, #31b0d5, 100%);
- background-image: -moz-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
- background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
- background-repeat: repeat-x;
- border-color: #2aabd2;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
-}
-
-.btn-info:active,
-.btn-info.active {
- background-color: #31b0d5;
- border-color: #2aabd2;
-}
-
-.thumbnail,
-.img-thumbnail {
- -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
-}
-
-.dropdown-menu > li > a:hover,
-.dropdown-menu > li > a:focus,
-.dropdown-menu > .active > a,
-.dropdown-menu > .active > a:hover,
-.dropdown-menu > .active > a:focus {
- background-color: #357ebd;
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#357ebd));
- background-image: -webkit-linear-gradient(top, #428bca, 0%, #357ebd, 100%);
- background-image: -moz-linear-gradient(top, #428bca 0%, #357ebd 100%);
- background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
-}
-
-.navbar {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#ffffff), to(#f8f8f8));
- background-image: -webkit-linear-gradient(top, #ffffff, 0%, #f8f8f8, 100%);
- background-image: -moz-linear-gradient(top, #ffffff 0%, #f8f8f8 100%);
- background-image: linear-gradient(to bottom, #ffffff 0%, #f8f8f8 100%);
- background-repeat: repeat-x;
- border-radius: 4px;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 5px rgba(0, 0, 0, 0.075);
-}
-
-.navbar .navbar-nav > .active > a {
- background-color: #f8f8f8;
-}
-
-.navbar-brand,
-.navbar-nav > li > a {
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
-}
-
-.navbar-inverse {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#3c3c3c), to(#222222));
- background-image: -webkit-linear-gradient(top, #3c3c3c, 0%, #222222, 100%);
- background-image: -moz-linear-gradient(top, #3c3c3c 0%, #222222 100%);
- background-image: linear-gradient(to bottom, #3c3c3c 0%, #222222 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);
-}
-
-.navbar-inverse .navbar-nav > .active > a {
- background-color: #222222;
-}
-
-.navbar-inverse .navbar-brand,
-.navbar-inverse .navbar-nav > li > a {
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
-}
-
-.navbar-static-top,
-.navbar-fixed-top,
-.navbar-fixed-bottom {
- border-radius: 0;
-}
-
-.alert {
- text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.alert-success {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#dff0d8), to(#c8e5bc));
- background-image: -webkit-linear-gradient(top, #dff0d8, 0%, #c8e5bc, 100%);
- background-image: -moz-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
- background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);
- background-repeat: repeat-x;
- border-color: #b2dba1;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);
-}
-
-.alert-info {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9edf7), to(#b9def0));
- background-image: -webkit-linear-gradient(top, #d9edf7, 0%, #b9def0, 100%);
- background-image: -moz-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
- background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);
- background-repeat: repeat-x;
- border-color: #9acfea;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
-}
-
-.alert-warning {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#fcf8e3), to(#f8efc0));
- background-image: -webkit-linear-gradient(top, #fcf8e3, 0%, #f8efc0, 100%);
- background-image: -moz-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
- background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);
- background-repeat: repeat-x;
- border-color: #f5e79e;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);
-}
-
-.alert-danger {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f2dede), to(#e7c3c3));
- background-image: -webkit-linear-gradient(top, #f2dede, 0%, #e7c3c3, 100%);
- background-image: -moz-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
- background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);
- background-repeat: repeat-x;
- border-color: #dca7a7;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
-}
-
-.progress {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#ebebeb), to(#f5f5f5));
- background-image: -webkit-linear-gradient(top, #ebebeb, 0%, #f5f5f5, 100%);
- background-image: -moz-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
- background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);
-}
-
-.progress-bar {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#3071a9));
- background-image: -webkit-linear-gradient(top, #428bca, 0%, #3071a9, 100%);
- background-image: -moz-linear-gradient(top, #428bca 0%, #3071a9 100%);
- background-image: linear-gradient(to bottom, #428bca 0%, #3071a9 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0);
-}
-
-.progress-bar-success {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5cb85c), to(#449d44));
- background-image: -webkit-linear-gradient(top, #5cb85c, 0%, #449d44, 100%);
- background-image: -moz-linear-gradient(top, #5cb85c 0%, #449d44 100%);
- background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
-}
-
-.progress-bar-info {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#5bc0de), to(#31b0d5));
- background-image: -webkit-linear-gradient(top, #5bc0de, 0%, #31b0d5, 100%);
- background-image: -moz-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
- background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
-}
-
-.progress-bar-warning {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f0ad4e), to(#ec971f));
- background-image: -webkit-linear-gradient(top, #f0ad4e, 0%, #ec971f, 100%);
- background-image: -moz-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
- background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
-}
-
-.progress-bar-danger {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9534f), to(#c9302c));
- background-image: -webkit-linear-gradient(top, #d9534f, 0%, #c9302c, 100%);
- background-image: -moz-linear-gradient(top, #d9534f 0%, #c9302c 100%);
- background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
-}
-
-.list-group {
- border-radius: 4px;
- -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.075);
-}
-
-.list-group-item.active,
-.list-group-item.active:hover,
-.list-group-item.active:focus {
- text-shadow: 0 -1px 0 #3071a9;
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#3278b3));
- background-image: -webkit-linear-gradient(top, #428bca, 0%, #3278b3, 100%);
- background-image: -moz-linear-gradient(top, #428bca 0%, #3278b3 100%);
- background-image: linear-gradient(to bottom, #428bca 0%, #3278b3 100%);
- background-repeat: repeat-x;
- border-color: #3278b3;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);
-}
-
-.panel {
- -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
-}
-
-.panel-default > .panel-heading {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f5f5f5), to(#e8e8e8));
- background-image: -webkit-linear-gradient(top, #f5f5f5, 0%, #e8e8e8, 100%);
- background-image: -moz-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
- background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
-}
-
-.panel-primary > .panel-heading {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#428bca), to(#357ebd));
- background-image: -webkit-linear-gradient(top, #428bca, 0%, #357ebd, 100%);
- background-image: -moz-linear-gradient(top, #428bca 0%, #357ebd 100%);
- background-image: linear-gradient(to bottom, #428bca 0%, #357ebd 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);
-}
-
-.panel-success > .panel-heading {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#dff0d8), to(#d0e9c6));
- background-image: -webkit-linear-gradient(top, #dff0d8, 0%, #d0e9c6, 100%);
- background-image: -moz-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
- background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);
-}
-
-.panel-info > .panel-heading {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#d9edf7), to(#c4e3f3));
- background-image: -webkit-linear-gradient(top, #d9edf7, 0%, #c4e3f3, 100%);
- background-image: -moz-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
- background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);
-}
-
-.panel-warning > .panel-heading {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#fcf8e3), to(#faf2cc));
- background-image: -webkit-linear-gradient(top, #fcf8e3, 0%, #faf2cc, 100%);
- background-image: -moz-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
- background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);
-}
-
-.panel-danger > .panel-heading {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#f2dede), to(#ebcccc));
- background-image: -webkit-linear-gradient(top, #f2dede, 0%, #ebcccc, 100%);
- background-image: -moz-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
- background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);
-}
-
-.well {
- background-image: -webkit-gradient(linear, left 0%, left 100%, from(#e8e8e8), to(#f5f5f5));
- background-image: -webkit-linear-gradient(top, #e8e8e8, 0%, #f5f5f5, 100%);
- background-image: -moz-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
- background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);
- background-repeat: repeat-x;
- border-color: #dcdcdc;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);
- -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);
- box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(255, 255, 255, 0.1);
-}
\ No newline at end of file
diff --git a/framework/yii/bootstrap/assets/css/bootstrap.css b/framework/yii/bootstrap/assets/css/bootstrap.css
deleted file mode 100644
index bbda4ee..0000000
--- a/framework/yii/bootstrap/assets/css/bootstrap.css
+++ /dev/null
@@ -1,6805 +0,0 @@
-/*!
- * Bootstrap v3.0.0
- *
- * Copyright 2013 Twitter, Inc
- * Licensed under the Apache License v2.0
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Designed and built with all the love in the world by @mdo and @fat.
- */
-
-/*! normalize.css v2.1.0 | MIT License | git.io/normalize */
-
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-main,
-nav,
-section,
-summary {
- display: block;
-}
-
-audio,
-canvas,
-video {
- display: inline-block;
-}
-
-audio:not([controls]) {
- display: none;
- height: 0;
-}
-
-[hidden] {
- display: none;
-}
-
-html {
- font-family: sans-serif;
- -webkit-text-size-adjust: 100%;
- -ms-text-size-adjust: 100%;
-}
-
-body {
- margin: 0;
-}
-
-a:focus {
- outline: thin dotted;
-}
-
-a:active,
-a:hover {
- outline: 0;
-}
-
-h1 {
- margin: 0.67em 0;
- font-size: 2em;
-}
-
-abbr[title] {
- border-bottom: 1px dotted;
-}
-
-b,
-strong {
- font-weight: bold;
-}
-
-dfn {
- font-style: italic;
-}
-
-hr {
- height: 0;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
-}
-
-mark {
- color: #000;
- background: #ff0;
-}
-
-code,
-kbd,
-pre,
-samp {
- font-family: monospace, serif;
- font-size: 1em;
-}
-
-pre {
- white-space: pre-wrap;
-}
-
-q {
- quotes: "\201C" "\201D" "\2018" "\2019";
-}
-
-small {
- font-size: 80%;
-}
-
-sub,
-sup {
- position: relative;
- font-size: 75%;
- line-height: 0;
- vertical-align: baseline;
-}
-
-sup {
- top: -0.5em;
-}
-
-sub {
- bottom: -0.25em;
-}
-
-img {
- border: 0;
-}
-
-svg:not(:root) {
- overflow: hidden;
-}
-
-figure {
- margin: 0;
-}
-
-fieldset {
- padding: 0.35em 0.625em 0.75em;
- margin: 0 2px;
- border: 1px solid #c0c0c0;
-}
-
-legend {
- padding: 0;
- border: 0;
-}
-
-button,
-input,
-select,
-textarea {
- margin: 0;
- font-family: inherit;
- font-size: 100%;
-}
-
-button,
-input {
- line-height: normal;
-}
-
-button,
-select {
- text-transform: none;
-}
-
-button,
-html input[type="button"],
-input[type="reset"],
-input[type="submit"] {
- cursor: pointer;
- -webkit-appearance: button;
-}
-
-button[disabled],
-html input[disabled] {
- cursor: default;
-}
-
-input[type="checkbox"],
-input[type="radio"] {
- padding: 0;
- box-sizing: border-box;
-}
-
-input[type="search"] {
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
- -webkit-appearance: textfield;
-}
-
-input[type="search"]::-webkit-search-cancel-button,
-input[type="search"]::-webkit-search-decoration {
- -webkit-appearance: none;
-}
-
-button::-moz-focus-inner,
-input::-moz-focus-inner {
- padding: 0;
- border: 0;
-}
-
-textarea {
- overflow: auto;
- vertical-align: top;
-}
-
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-
-@media print {
- * {
- color: #000 !important;
- text-shadow: none !important;
- background: transparent !important;
- box-shadow: none !important;
- }
- a,
- a:visited {
- text-decoration: underline;
- }
- a[href]:after {
- content: " (" attr(href) ")";
- }
- abbr[title]:after {
- content: " (" attr(title) ")";
- }
- .ir a:after,
- a[href^="javascript:"]:after,
- a[href^="#"]:after {
- content: "";
- }
- pre,
- blockquote {
- border: 1px solid #999;
- page-break-inside: avoid;
- }
- thead {
- display: table-header-group;
- }
- tr,
- img {
- page-break-inside: avoid;
- }
- img {
- max-width: 100% !important;
- }
- @page {
- margin: 2cm .5cm;
- }
- p,
- h2,
- h3 {
- orphans: 3;
- widows: 3;
- }
- h2,
- h3 {
- page-break-after: avoid;
- }
- .navbar {
- display: none;
- }
- .table td,
- .table th {
- background-color: #fff !important;
- }
- .btn > .caret,
- .dropup > .btn > .caret {
- border-top-color: #000 !important;
- }
- .label {
- border: 1px solid #000;
- }
- .table {
- border-collapse: collapse !important;
- }
- .table-bordered th,
- .table-bordered td {
- border: 1px solid #ddd !important;
- }
-}
-
-*,
-*:before,
-*:after {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-html {
- font-size: 62.5%;
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-}
-
-body {
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-size: 14px;
- line-height: 1.428571429;
- color: #333333;
- background-color: #ffffff;
-}
-
-input,
-button,
-select,
-textarea {
- font-family: inherit;
- font-size: inherit;
- line-height: inherit;
-}
-
-button,
-input,
-select[multiple],
-textarea {
- background-image: none;
-}
-
-a {
- color: #428bca;
- text-decoration: none;
-}
-
-a:hover,
-a:focus {
- color: #2a6496;
- text-decoration: underline;
-}
-
-a:focus {
- outline: thin dotted #333;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-
-img {
- vertical-align: middle;
-}
-
-.img-responsive {
- display: block;
- height: auto;
- max-width: 100%;
-}
-
-.img-rounded {
- border-radius: 6px;
-}
-
-.img-thumbnail {
- display: inline-block;
- height: auto;
- max-width: 100%;
- padding: 4px;
- line-height: 1.428571429;
- background-color: #ffffff;
- border: 1px solid #dddddd;
- border-radius: 4px;
- -webkit-transition: all 0.2s ease-in-out;
- transition: all 0.2s ease-in-out;
-}
-
-.img-circle {
- border-radius: 50%;
-}
-
-hr {
- margin-top: 20px;
- margin-bottom: 20px;
- border: 0;
- border-top: 1px solid #eeeeee;
-}
-
-.sr-only {
- position: absolute;
- width: 1px;
- height: 1px;
- padding: 0;
- margin: -1px;
- overflow: hidden;
- clip: rect(0 0 0 0);
- border: 0;
-}
-
-p {
- margin: 0 0 10px;
-}
-
-.lead {
- margin-bottom: 20px;
- font-size: 16.099999999999998px;
- font-weight: 200;
- line-height: 1.4;
-}
-
-@media (min-width: 768px) {
- .lead {
- font-size: 21px;
- }
-}
-
-small {
- font-size: 85%;
-}
-
-cite {
- font-style: normal;
-}
-
-.text-muted {
- color: #999999;
-}
-
-.text-primary {
- color: #428bca;
-}
-
-.text-warning {
- color: #c09853;
-}
-
-.text-danger {
- color: #b94a48;
-}
-
-.text-success {
- color: #468847;
-}
-
-.text-info {
- color: #3a87ad;
-}
-
-.text-left {
- text-align: left;
-}
-
-.text-right {
- text-align: right;
-}
-
-.text-center {
- text-align: center;
-}
-
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-.h1,
-.h2,
-.h3,
-.h4,
-.h5,
-.h6 {
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
- font-weight: 500;
- line-height: 1.1;
-}
-
-h1 small,
-h2 small,
-h3 small,
-h4 small,
-h5 small,
-h6 small,
-.h1 small,
-.h2 small,
-.h3 small,
-.h4 small,
-.h5 small,
-.h6 small {
- font-weight: normal;
- line-height: 1;
- color: #999999;
-}
-
-h1,
-h2,
-h3 {
- margin-top: 20px;
- margin-bottom: 10px;
-}
-
-h4,
-h5,
-h6 {
- margin-top: 10px;
- margin-bottom: 10px;
-}
-
-h1,
-.h1 {
- font-size: 36px;
-}
-
-h2,
-.h2 {
- font-size: 30px;
-}
-
-h3,
-.h3 {
- font-size: 24px;
-}
-
-h4,
-.h4 {
- font-size: 18px;
-}
-
-h5,
-.h5 {
- font-size: 14px;
-}
-
-h6,
-.h6 {
- font-size: 12px;
-}
-
-h1 small,
-.h1 small {
- font-size: 24px;
-}
-
-h2 small,
-.h2 small {
- font-size: 18px;
-}
-
-h3 small,
-.h3 small,
-h4 small,
-.h4 small {
- font-size: 14px;
-}
-
-.page-header {
- padding-bottom: 9px;
- margin: 40px 0 20px;
- border-bottom: 1px solid #eeeeee;
-}
-
-ul,
-ol {
- margin-top: 0;
- margin-bottom: 10px;
-}
-
-ul ul,
-ol ul,
-ul ol,
-ol ol {
- margin-bottom: 0;
-}
-
-.list-unstyled {
- padding-left: 0;
- list-style: none;
-}
-
-.list-inline {
- padding-left: 0;
- list-style: none;
-}
-
-.list-inline > li {
- display: inline-block;
- padding-right: 5px;
- padding-left: 5px;
-}
-
-dl {
- margin-bottom: 20px;
-}
-
-dt,
-dd {
- line-height: 1.428571429;
-}
-
-dt {
- font-weight: bold;
-}
-
-dd {
- margin-left: 0;
-}
-
-@media (min-width: 768px) {
- .dl-horizontal dt {
- float: left;
- width: 160px;
- overflow: hidden;
- clear: left;
- text-align: right;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .dl-horizontal dd {
- margin-left: 180px;
- }
- .dl-horizontal dd:before,
- .dl-horizontal dd:after {
- display: table;
- content: " ";
- }
- .dl-horizontal dd:after {
- clear: both;
- }
- .dl-horizontal dd:before,
- .dl-horizontal dd:after {
- display: table;
- content: " ";
- }
- .dl-horizontal dd:after {
- clear: both;
- }
-}
-
-abbr[title],
-abbr[data-original-title] {
- cursor: help;
- border-bottom: 1px dotted #999999;
-}
-
-abbr.initialism {
- font-size: 90%;
- text-transform: uppercase;
-}
-
-blockquote {
- padding: 10px 20px;
- margin: 0 0 20px;
- border-left: 5px solid #eeeeee;
-}
-
-blockquote p {
- font-size: 17.5px;
- font-weight: 300;
- line-height: 1.25;
-}
-
-blockquote p:last-child {
- margin-bottom: 0;
-}
-
-blockquote small {
- display: block;
- line-height: 1.428571429;
- color: #999999;
-}
-
-blockquote small:before {
- content: '\2014 \00A0';
-}
-
-blockquote.pull-right {
- padding-right: 15px;
- padding-left: 0;
- border-right: 5px solid #eeeeee;
- border-left: 0;
-}
-
-blockquote.pull-right p,
-blockquote.pull-right small {
- text-align: right;
-}
-
-blockquote.pull-right small:before {
- content: '';
-}
-
-blockquote.pull-right small:after {
- content: '\00A0 \2014';
-}
-
-q:before,
-q:after,
-blockquote:before,
-blockquote:after {
- content: "";
-}
-
-address {
- display: block;
- margin-bottom: 20px;
- font-style: normal;
- line-height: 1.428571429;
-}
-
-code,
-pre {
- font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
-}
-
-code {
- padding: 2px 4px;
- font-size: 90%;
- color: #c7254e;
- white-space: nowrap;
- background-color: #f9f2f4;
- border-radius: 4px;
-}
-
-pre {
- display: block;
- padding: 9.5px;
- margin: 0 0 10px;
- font-size: 13px;
- line-height: 1.428571429;
- color: #333333;
- word-break: break-all;
- word-wrap: break-word;
- background-color: #f5f5f5;
- border: 1px solid #cccccc;
- border-radius: 4px;
-}
-
-pre.prettyprint {
- margin-bottom: 20px;
-}
-
-pre code {
- padding: 0;
- font-size: inherit;
- color: inherit;
- white-space: pre-wrap;
- background-color: transparent;
- border: 0;
-}
-
-.pre-scrollable {
- max-height: 340px;
- overflow-y: scroll;
-}
-
-.container {
- padding-right: 15px;
- padding-left: 15px;
- margin-right: auto;
- margin-left: auto;
-}
-
-.container:before,
-.container:after {
- display: table;
- content: " ";
-}
-
-.container:after {
- clear: both;
-}
-
-.container:before,
-.container:after {
- display: table;
- content: " ";
-}
-
-.container:after {
- clear: both;
-}
-
-.row {
- margin-right: -15px;
- margin-left: -15px;
-}
-
-.row:before,
-.row:after {
- display: table;
- content: " ";
-}
-
-.row:after {
- clear: both;
-}
-
-.row:before,
-.row:after {
- display: table;
- content: " ";
-}
-
-.row:after {
- clear: both;
-}
-
-.col-xs-1,
-.col-xs-2,
-.col-xs-3,
-.col-xs-4,
-.col-xs-5,
-.col-xs-6,
-.col-xs-7,
-.col-xs-8,
-.col-xs-9,
-.col-xs-10,
-.col-xs-11,
-.col-xs-12,
-.col-sm-1,
-.col-sm-2,
-.col-sm-3,
-.col-sm-4,
-.col-sm-5,
-.col-sm-6,
-.col-sm-7,
-.col-sm-8,
-.col-sm-9,
-.col-sm-10,
-.col-sm-11,
-.col-sm-12,
-.col-md-1,
-.col-md-2,
-.col-md-3,
-.col-md-4,
-.col-md-5,
-.col-md-6,
-.col-md-7,
-.col-md-8,
-.col-md-9,
-.col-md-10,
-.col-md-11,
-.col-md-12,
-.col-lg-1,
-.col-lg-2,
-.col-lg-3,
-.col-lg-4,
-.col-lg-5,
-.col-lg-6,
-.col-lg-7,
-.col-lg-8,
-.col-lg-9,
-.col-lg-10,
-.col-lg-11,
-.col-lg-12 {
- position: relative;
- min-height: 1px;
- padding-right: 15px;
- padding-left: 15px;
-}
-
-.col-xs-1,
-.col-xs-2,
-.col-xs-3,
-.col-xs-4,
-.col-xs-5,
-.col-xs-6,
-.col-xs-7,
-.col-xs-8,
-.col-xs-9,
-.col-xs-10,
-.col-xs-11 {
- float: left;
-}
-
-.col-xs-1 {
- width: 8.333333333333332%;
-}
-
-.col-xs-2 {
- width: 16.666666666666664%;
-}
-
-.col-xs-3 {
- width: 25%;
-}
-
-.col-xs-4 {
- width: 33.33333333333333%;
-}
-
-.col-xs-5 {
- width: 41.66666666666667%;
-}
-
-.col-xs-6 {
- width: 50%;
-}
-
-.col-xs-7 {
- width: 58.333333333333336%;
-}
-
-.col-xs-8 {
- width: 66.66666666666666%;
-}
-
-.col-xs-9 {
- width: 75%;
-}
-
-.col-xs-10 {
- width: 83.33333333333334%;
-}
-
-.col-xs-11 {
- width: 91.66666666666666%;
-}
-
-.col-xs-12 {
- width: 100%;
-}
-
-@media (min-width: 768px) {
- .container {
- max-width: 750px;
- }
- .col-sm-1,
- .col-sm-2,
- .col-sm-3,
- .col-sm-4,
- .col-sm-5,
- .col-sm-6,
- .col-sm-7,
- .col-sm-8,
- .col-sm-9,
- .col-sm-10,
- .col-sm-11 {
- float: left;
- }
- .col-sm-1 {
- width: 8.333333333333332%;
- }
- .col-sm-2 {
- width: 16.666666666666664%;
- }
- .col-sm-3 {
- width: 25%;
- }
- .col-sm-4 {
- width: 33.33333333333333%;
- }
- .col-sm-5 {
- width: 41.66666666666667%;
- }
- .col-sm-6 {
- width: 50%;
- }
- .col-sm-7 {
- width: 58.333333333333336%;
- }
- .col-sm-8 {
- width: 66.66666666666666%;
- }
- .col-sm-9 {
- width: 75%;
- }
- .col-sm-10 {
- width: 83.33333333333334%;
- }
- .col-sm-11 {
- width: 91.66666666666666%;
- }
- .col-sm-12 {
- width: 100%;
- }
- .col-sm-push-1 {
- left: 8.333333333333332%;
- }
- .col-sm-push-2 {
- left: 16.666666666666664%;
- }
- .col-sm-push-3 {
- left: 25%;
- }
- .col-sm-push-4 {
- left: 33.33333333333333%;
- }
- .col-sm-push-5 {
- left: 41.66666666666667%;
- }
- .col-sm-push-6 {
- left: 50%;
- }
- .col-sm-push-7 {
- left: 58.333333333333336%;
- }
- .col-sm-push-8 {
- left: 66.66666666666666%;
- }
- .col-sm-push-9 {
- left: 75%;
- }
- .col-sm-push-10 {
- left: 83.33333333333334%;
- }
- .col-sm-push-11 {
- left: 91.66666666666666%;
- }
- .col-sm-pull-1 {
- right: 8.333333333333332%;
- }
- .col-sm-pull-2 {
- right: 16.666666666666664%;
- }
- .col-sm-pull-3 {
- right: 25%;
- }
- .col-sm-pull-4 {
- right: 33.33333333333333%;
- }
- .col-sm-pull-5 {
- right: 41.66666666666667%;
- }
- .col-sm-pull-6 {
- right: 50%;
- }
- .col-sm-pull-7 {
- right: 58.333333333333336%;
- }
- .col-sm-pull-8 {
- right: 66.66666666666666%;
- }
- .col-sm-pull-9 {
- right: 75%;
- }
- .col-sm-pull-10 {
- right: 83.33333333333334%;
- }
- .col-sm-pull-11 {
- right: 91.66666666666666%;
- }
- .col-sm-offset-1 {
- margin-left: 8.333333333333332%;
- }
- .col-sm-offset-2 {
- margin-left: 16.666666666666664%;
- }
- .col-sm-offset-3 {
- margin-left: 25%;
- }
- .col-sm-offset-4 {
- margin-left: 33.33333333333333%;
- }
- .col-sm-offset-5 {
- margin-left: 41.66666666666667%;
- }
- .col-sm-offset-6 {
- margin-left: 50%;
- }
- .col-sm-offset-7 {
- margin-left: 58.333333333333336%;
- }
- .col-sm-offset-8 {
- margin-left: 66.66666666666666%;
- }
- .col-sm-offset-9 {
- margin-left: 75%;
- }
- .col-sm-offset-10 {
- margin-left: 83.33333333333334%;
- }
- .col-sm-offset-11 {
- margin-left: 91.66666666666666%;
- }
-}
-
-@media (min-width: 992px) {
- .container {
- max-width: 970px;
- }
- .col-md-1,
- .col-md-2,
- .col-md-3,
- .col-md-4,
- .col-md-5,
- .col-md-6,
- .col-md-7,
- .col-md-8,
- .col-md-9,
- .col-md-10,
- .col-md-11 {
- float: left;
- }
- .col-md-1 {
- width: 8.333333333333332%;
- }
- .col-md-2 {
- width: 16.666666666666664%;
- }
- .col-md-3 {
- width: 25%;
- }
- .col-md-4 {
- width: 33.33333333333333%;
- }
- .col-md-5 {
- width: 41.66666666666667%;
- }
- .col-md-6 {
- width: 50%;
- }
- .col-md-7 {
- width: 58.333333333333336%;
- }
- .col-md-8 {
- width: 66.66666666666666%;
- }
- .col-md-9 {
- width: 75%;
- }
- .col-md-10 {
- width: 83.33333333333334%;
- }
- .col-md-11 {
- width: 91.66666666666666%;
- }
- .col-md-12 {
- width: 100%;
- }
- .col-md-push-0 {
- left: auto;
- }
- .col-md-push-1 {
- left: 8.333333333333332%;
- }
- .col-md-push-2 {
- left: 16.666666666666664%;
- }
- .col-md-push-3 {
- left: 25%;
- }
- .col-md-push-4 {
- left: 33.33333333333333%;
- }
- .col-md-push-5 {
- left: 41.66666666666667%;
- }
- .col-md-push-6 {
- left: 50%;
- }
- .col-md-push-7 {
- left: 58.333333333333336%;
- }
- .col-md-push-8 {
- left: 66.66666666666666%;
- }
- .col-md-push-9 {
- left: 75%;
- }
- .col-md-push-10 {
- left: 83.33333333333334%;
- }
- .col-md-push-11 {
- left: 91.66666666666666%;
- }
- .col-md-pull-0 {
- right: auto;
- }
- .col-md-pull-1 {
- right: 8.333333333333332%;
- }
- .col-md-pull-2 {
- right: 16.666666666666664%;
- }
- .col-md-pull-3 {
- right: 25%;
- }
- .col-md-pull-4 {
- right: 33.33333333333333%;
- }
- .col-md-pull-5 {
- right: 41.66666666666667%;
- }
- .col-md-pull-6 {
- right: 50%;
- }
- .col-md-pull-7 {
- right: 58.333333333333336%;
- }
- .col-md-pull-8 {
- right: 66.66666666666666%;
- }
- .col-md-pull-9 {
- right: 75%;
- }
- .col-md-pull-10 {
- right: 83.33333333333334%;
- }
- .col-md-pull-11 {
- right: 91.66666666666666%;
- }
- .col-md-offset-0 {
- margin-left: 0;
- }
- .col-md-offset-1 {
- margin-left: 8.333333333333332%;
- }
- .col-md-offset-2 {
- margin-left: 16.666666666666664%;
- }
- .col-md-offset-3 {
- margin-left: 25%;
- }
- .col-md-offset-4 {
- margin-left: 33.33333333333333%;
- }
- .col-md-offset-5 {
- margin-left: 41.66666666666667%;
- }
- .col-md-offset-6 {
- margin-left: 50%;
- }
- .col-md-offset-7 {
- margin-left: 58.333333333333336%;
- }
- .col-md-offset-8 {
- margin-left: 66.66666666666666%;
- }
- .col-md-offset-9 {
- margin-left: 75%;
- }
- .col-md-offset-10 {
- margin-left: 83.33333333333334%;
- }
- .col-md-offset-11 {
- margin-left: 91.66666666666666%;
- }
-}
-
-@media (min-width: 1200px) {
- .container {
- max-width: 1170px;
- }
- .col-lg-1,
- .col-lg-2,
- .col-lg-3,
- .col-lg-4,
- .col-lg-5,
- .col-lg-6,
- .col-lg-7,
- .col-lg-8,
- .col-lg-9,
- .col-lg-10,
- .col-lg-11 {
- float: left;
- }
- .col-lg-1 {
- width: 8.333333333333332%;
- }
- .col-lg-2 {
- width: 16.666666666666664%;
- }
- .col-lg-3 {
- width: 25%;
- }
- .col-lg-4 {
- width: 33.33333333333333%;
- }
- .col-lg-5 {
- width: 41.66666666666667%;
- }
- .col-lg-6 {
- width: 50%;
- }
- .col-lg-7 {
- width: 58.333333333333336%;
- }
- .col-lg-8 {
- width: 66.66666666666666%;
- }
- .col-lg-9 {
- width: 75%;
- }
- .col-lg-10 {
- width: 83.33333333333334%;
- }
- .col-lg-11 {
- width: 91.66666666666666%;
- }
- .col-lg-12 {
- width: 100%;
- }
- .col-lg-push-0 {
- left: auto;
- }
- .col-lg-push-1 {
- left: 8.333333333333332%;
- }
- .col-lg-push-2 {
- left: 16.666666666666664%;
- }
- .col-lg-push-3 {
- left: 25%;
- }
- .col-lg-push-4 {
- left: 33.33333333333333%;
- }
- .col-lg-push-5 {
- left: 41.66666666666667%;
- }
- .col-lg-push-6 {
- left: 50%;
- }
- .col-lg-push-7 {
- left: 58.333333333333336%;
- }
- .col-lg-push-8 {
- left: 66.66666666666666%;
- }
- .col-lg-push-9 {
- left: 75%;
- }
- .col-lg-push-10 {
- left: 83.33333333333334%;
- }
- .col-lg-push-11 {
- left: 91.66666666666666%;
- }
- .col-lg-pull-0 {
- right: auto;
- }
- .col-lg-pull-1 {
- right: 8.333333333333332%;
- }
- .col-lg-pull-2 {
- right: 16.666666666666664%;
- }
- .col-lg-pull-3 {
- right: 25%;
- }
- .col-lg-pull-4 {
- right: 33.33333333333333%;
- }
- .col-lg-pull-5 {
- right: 41.66666666666667%;
- }
- .col-lg-pull-6 {
- right: 50%;
- }
- .col-lg-pull-7 {
- right: 58.333333333333336%;
- }
- .col-lg-pull-8 {
- right: 66.66666666666666%;
- }
- .col-lg-pull-9 {
- right: 75%;
- }
- .col-lg-pull-10 {
- right: 83.33333333333334%;
- }
- .col-lg-pull-11 {
- right: 91.66666666666666%;
- }
- .col-lg-offset-0 {
- margin-left: 0;
- }
- .col-lg-offset-1 {
- margin-left: 8.333333333333332%;
- }
- .col-lg-offset-2 {
- margin-left: 16.666666666666664%;
- }
- .col-lg-offset-3 {
- margin-left: 25%;
- }
- .col-lg-offset-4 {
- margin-left: 33.33333333333333%;
- }
- .col-lg-offset-5 {
- margin-left: 41.66666666666667%;
- }
- .col-lg-offset-6 {
- margin-left: 50%;
- }
- .col-lg-offset-7 {
- margin-left: 58.333333333333336%;
- }
- .col-lg-offset-8 {
- margin-left: 66.66666666666666%;
- }
- .col-lg-offset-9 {
- margin-left: 75%;
- }
- .col-lg-offset-10 {
- margin-left: 83.33333333333334%;
- }
- .col-lg-offset-11 {
- margin-left: 91.66666666666666%;
- }
-}
-
-table {
- max-width: 100%;
- background-color: transparent;
-}
-
-th {
- text-align: left;
-}
-
-.table {
- width: 100%;
- margin-bottom: 20px;
-}
-
-.table thead > tr > th,
-.table tbody > tr > th,
-.table tfoot > tr > th,
-.table thead > tr > td,
-.table tbody > tr > td,
-.table tfoot > tr > td {
- padding: 8px;
- line-height: 1.428571429;
- vertical-align: top;
- border-top: 1px solid #dddddd;
-}
-
-.table thead > tr > th {
- vertical-align: bottom;
- border-bottom: 2px solid #dddddd;
-}
-
-.table caption + thead tr:first-child th,
-.table colgroup + thead tr:first-child th,
-.table thead:first-child tr:first-child th,
-.table caption + thead tr:first-child td,
-.table colgroup + thead tr:first-child td,
-.table thead:first-child tr:first-child td {
- border-top: 0;
-}
-
-.table tbody + tbody {
- border-top: 2px solid #dddddd;
-}
-
-.table .table {
- background-color: #ffffff;
-}
-
-.table-condensed thead > tr > th,
-.table-condensed tbody > tr > th,
-.table-condensed tfoot > tr > th,
-.table-condensed thead > tr > td,
-.table-condensed tbody > tr > td,
-.table-condensed tfoot > tr > td {
- padding: 5px;
-}
-
-.table-bordered {
- border: 1px solid #dddddd;
-}
-
-.table-bordered > thead > tr > th,
-.table-bordered > tbody > tr > th,
-.table-bordered > tfoot > tr > th,
-.table-bordered > thead > tr > td,
-.table-bordered > tbody > tr > td,
-.table-bordered > tfoot > tr > td {
- border: 1px solid #dddddd;
-}
-
-.table-bordered > thead > tr > th,
-.table-bordered > thead > tr > td {
- border-bottom-width: 2px;
-}
-
-.table-striped > tbody > tr:nth-child(odd) > td,
-.table-striped > tbody > tr:nth-child(odd) > th {
- background-color: #f9f9f9;
-}
-
-.table-hover > tbody > tr:hover > td,
-.table-hover > tbody > tr:hover > th {
- background-color: #f5f5f5;
-}
-
-table col[class*="col-"] {
- display: table-column;
- float: none;
-}
-
-table td[class*="col-"],
-table th[class*="col-"] {
- display: table-cell;
- float: none;
-}
-
-.table > thead > tr > td.active,
-.table > tbody > tr > td.active,
-.table > tfoot > tr > td.active,
-.table > thead > tr > th.active,
-.table > tbody > tr > th.active,
-.table > tfoot > tr > th.active,
-.table > thead > tr.active > td,
-.table > tbody > tr.active > td,
-.table > tfoot > tr.active > td,
-.table > thead > tr.active > th,
-.table > tbody > tr.active > th,
-.table > tfoot > tr.active > th {
- background-color: #f5f5f5;
-}
-
-.table > thead > tr > td.success,
-.table > tbody > tr > td.success,
-.table > tfoot > tr > td.success,
-.table > thead > tr > th.success,
-.table > tbody > tr > th.success,
-.table > tfoot > tr > th.success,
-.table > thead > tr.success > td,
-.table > tbody > tr.success > td,
-.table > tfoot > tr.success > td,
-.table > thead > tr.success > th,
-.table > tbody > tr.success > th,
-.table > tfoot > tr.success > th {
- background-color: #dff0d8;
- border-color: #d6e9c6;
-}
-
-.table-hover > tbody > tr > td.success:hover,
-.table-hover > tbody > tr > th.success:hover,
-.table-hover > tbody > tr.success:hover > td {
- background-color: #d0e9c6;
- border-color: #c9e2b3;
-}
-
-.table > thead > tr > td.danger,
-.table > tbody > tr > td.danger,
-.table > tfoot > tr > td.danger,
-.table > thead > tr > th.danger,
-.table > tbody > tr > th.danger,
-.table > tfoot > tr > th.danger,
-.table > thead > tr.danger > td,
-.table > tbody > tr.danger > td,
-.table > tfoot > tr.danger > td,
-.table > thead > tr.danger > th,
-.table > tbody > tr.danger > th,
-.table > tfoot > tr.danger > th {
- background-color: #f2dede;
- border-color: #eed3d7;
-}
-
-.table-hover > tbody > tr > td.danger:hover,
-.table-hover > tbody > tr > th.danger:hover,
-.table-hover > tbody > tr.danger:hover > td {
- background-color: #ebcccc;
- border-color: #e6c1c7;
-}
-
-.table > thead > tr > td.warning,
-.table > tbody > tr > td.warning,
-.table > tfoot > tr > td.warning,
-.table > thead > tr > th.warning,
-.table > tbody > tr > th.warning,
-.table > tfoot > tr > th.warning,
-.table > thead > tr.warning > td,
-.table > tbody > tr.warning > td,
-.table > tfoot > tr.warning > td,
-.table > thead > tr.warning > th,
-.table > tbody > tr.warning > th,
-.table > tfoot > tr.warning > th {
- background-color: #fcf8e3;
- border-color: #fbeed5;
-}
-
-.table-hover > tbody > tr > td.warning:hover,
-.table-hover > tbody > tr > th.warning:hover,
-.table-hover > tbody > tr.warning:hover > td {
- background-color: #faf2cc;
- border-color: #f8e5be;
-}
-
-@media (max-width: 768px) {
- .table-responsive {
- width: 100%;
- margin-bottom: 15px;
- overflow-x: scroll;
- overflow-y: hidden;
- border: 1px solid #dddddd;
- }
- .table-responsive > .table {
- margin-bottom: 0;
- background-color: #fff;
- }
- .table-responsive > .table > thead > tr > th,
- .table-responsive > .table > tbody > tr > th,
- .table-responsive > .table > tfoot > tr > th,
- .table-responsive > .table > thead > tr > td,
- .table-responsive > .table > tbody > tr > td,
- .table-responsive > .table > tfoot > tr > td {
- white-space: nowrap;
- }
- .table-responsive > .table-bordered {
- border: 0;
- }
- .table-responsive > .table-bordered > thead > tr > th:first-child,
- .table-responsive > .table-bordered > tbody > tr > th:first-child,
- .table-responsive > .table-bordered > tfoot > tr > th:first-child,
- .table-responsive > .table-bordered > thead > tr > td:first-child,
- .table-responsive > .table-bordered > tbody > tr > td:first-child,
- .table-responsive > .table-bordered > tfoot > tr > td:first-child {
- border-left: 0;
- }
- .table-responsive > .table-bordered > thead > tr > th:last-child,
- .table-responsive > .table-bordered > tbody > tr > th:last-child,
- .table-responsive > .table-bordered > tfoot > tr > th:last-child,
- .table-responsive > .table-bordered > thead > tr > td:last-child,
- .table-responsive > .table-bordered > tbody > tr > td:last-child,
- .table-responsive > .table-bordered > tfoot > tr > td:last-child {
- border-right: 0;
- }
- .table-responsive > .table-bordered > thead > tr:last-child > th,
- .table-responsive > .table-bordered > tbody > tr:last-child > th,
- .table-responsive > .table-bordered > tfoot > tr:last-child > th,
- .table-responsive > .table-bordered > thead > tr:last-child > td,
- .table-responsive > .table-bordered > tbody > tr:last-child > td,
- .table-responsive > .table-bordered > tfoot > tr:last-child > td {
- border-bottom: 0;
- }
-}
-
-fieldset {
- padding: 0;
- margin: 0;
- border: 0;
-}
-
-legend {
- display: block;
- width: 100%;
- padding: 0;
- margin-bottom: 20px;
- font-size: 21px;
- line-height: inherit;
- color: #333333;
- border: 0;
- border-bottom: 1px solid #e5e5e5;
-}
-
-label {
- display: inline-block;
- margin-bottom: 5px;
- font-weight: bold;
-}
-
-input[type="search"] {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-input[type="radio"],
-input[type="checkbox"] {
- margin: 4px 0 0;
- margin-top: 1px \9;
- /* IE8-9 */
-
- line-height: normal;
-}
-
-input[type="file"] {
- display: block;
-}
-
-select[multiple],
-select[size] {
- height: auto;
-}
-
-select optgroup {
- font-family: inherit;
- font-size: inherit;
- font-style: inherit;
-}
-
-input[type="file"]:focus,
-input[type="radio"]:focus,
-input[type="checkbox"]:focus {
- outline: thin dotted #333;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-
-input[type="number"]::-webkit-outer-spin-button,
-input[type="number"]::-webkit-inner-spin-button {
- height: auto;
-}
-
-.form-control:-moz-placeholder {
- color: #999999;
-}
-
-.form-control::-moz-placeholder {
- color: #999999;
-}
-
-.form-control:-ms-input-placeholder {
- color: #999999;
-}
-
-.form-control::-webkit-input-placeholder {
- color: #999999;
-}
-
-.form-control {
- display: block;
- width: 100%;
- height: 34px;
- padding: 6px 12px;
- font-size: 14px;
- line-height: 1.428571429;
- color: #555555;
- vertical-align: middle;
- background-color: #ffffff;
- border: 1px solid #cccccc;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
- transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
-}
-
-.form-control:focus {
- border-color: #66afe9;
- outline: 0;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
-}
-
-.form-control[disabled],
-.form-control[readonly],
-fieldset[disabled] .form-control {
- cursor: not-allowed;
- background-color: #eeeeee;
-}
-
-textarea.form-control {
- height: auto;
-}
-
-.form-group {
- margin-bottom: 15px;
-}
-
-.radio,
-.checkbox {
- display: block;
- min-height: 20px;
- padding-left: 20px;
- margin-top: 10px;
- margin-bottom: 10px;
- vertical-align: middle;
-}
-
-.radio label,
-.checkbox label {
- display: inline;
- margin-bottom: 0;
- font-weight: normal;
- cursor: pointer;
-}
-
-.radio input[type="radio"],
-.radio-inline input[type="radio"],
-.checkbox input[type="checkbox"],
-.checkbox-inline input[type="checkbox"] {
- float: left;
- margin-left: -20px;
-}
-
-.radio + .radio,
-.checkbox + .checkbox {
- margin-top: -5px;
-}
-
-.radio-inline,
-.checkbox-inline {
- display: inline-block;
- padding-left: 20px;
- margin-bottom: 0;
- font-weight: normal;
- vertical-align: middle;
- cursor: pointer;
-}
-
-.radio-inline + .radio-inline,
-.checkbox-inline + .checkbox-inline {
- margin-top: 0;
- margin-left: 10px;
-}
-
-input[type="radio"][disabled],
-input[type="checkbox"][disabled],
-.radio[disabled],
-.radio-inline[disabled],
-.checkbox[disabled],
-.checkbox-inline[disabled],
-fieldset[disabled] input[type="radio"],
-fieldset[disabled] input[type="checkbox"],
-fieldset[disabled] .radio,
-fieldset[disabled] .radio-inline,
-fieldset[disabled] .checkbox,
-fieldset[disabled] .checkbox-inline {
- cursor: not-allowed;
-}
-
-.input-sm {
- height: 30px;
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-
-select.input-sm {
- height: 30px;
- line-height: 30px;
-}
-
-textarea.input-sm {
- height: auto;
-}
-
-.input-lg {
- height: 45px;
- padding: 10px 16px;
- font-size: 18px;
- line-height: 1.33;
- border-radius: 6px;
-}
-
-select.input-lg {
- height: 45px;
- line-height: 45px;
-}
-
-textarea.input-lg {
- height: auto;
-}
-
-.has-warning .help-block,
-.has-warning .control-label {
- color: #c09853;
-}
-
-.has-warning .form-control {
- border-color: #c09853;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-
-.has-warning .form-control:focus {
- border-color: #a47e3c;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
-}
-
-.has-warning .input-group-addon {
- color: #c09853;
- background-color: #fcf8e3;
- border-color: #c09853;
-}
-
-.has-error .help-block,
-.has-error .control-label {
- color: #b94a48;
-}
-
-.has-error .form-control {
- border-color: #b94a48;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-
-.has-error .form-control:focus {
- border-color: #953b39;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
-}
-
-.has-error .input-group-addon {
- color: #b94a48;
- background-color: #f2dede;
- border-color: #b94a48;
-}
-
-.has-success .help-block,
-.has-success .control-label {
- color: #468847;
-}
-
-.has-success .form-control {
- border-color: #468847;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-}
-
-.has-success .form-control:focus {
- border-color: #356635;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
-}
-
-.has-success .input-group-addon {
- color: #468847;
- background-color: #dff0d8;
- border-color: #468847;
-}
-
-.form-control-static {
- padding-top: 7px;
- margin-bottom: 0;
-}
-
-.help-block {
- display: block;
- margin-top: 5px;
- margin-bottom: 10px;
- color: #737373;
-}
-
-@media (min-width: 768px) {
- .form-inline .form-group {
- display: inline-block;
- margin-bottom: 0;
- vertical-align: middle;
- }
- .form-inline .form-control {
- display: inline-block;
- }
- .form-inline .radio,
- .form-inline .checkbox {
- display: inline-block;
- padding-left: 0;
- margin-top: 0;
- margin-bottom: 0;
- }
- .form-inline .radio input[type="radio"],
- .form-inline .checkbox input[type="checkbox"] {
- float: none;
- margin-left: 0;
- }
-}
-
-.form-horizontal .control-label,
-.form-horizontal .radio,
-.form-horizontal .checkbox,
-.form-horizontal .radio-inline,
-.form-horizontal .checkbox-inline {
- padding-top: 7px;
- margin-top: 0;
- margin-bottom: 0;
-}
-
-.form-horizontal .form-group {
- margin-right: -15px;
- margin-left: -15px;
-}
-
-.form-horizontal .form-group:before,
-.form-horizontal .form-group:after {
- display: table;
- content: " ";
-}
-
-.form-horizontal .form-group:after {
- clear: both;
-}
-
-.form-horizontal .form-group:before,
-.form-horizontal .form-group:after {
- display: table;
- content: " ";
-}
-
-.form-horizontal .form-group:after {
- clear: both;
-}
-
-@media (min-width: 768px) {
- .form-horizontal .control-label {
- text-align: right;
- }
-}
-
-.btn {
- display: inline-block;
- padding: 6px 12px;
- margin-bottom: 0;
- font-size: 14px;
- font-weight: normal;
- line-height: 1.428571429;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- cursor: pointer;
- border: 1px solid transparent;
- border-radius: 4px;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- -o-user-select: none;
- user-select: none;
-}
-
-.btn:focus {
- outline: thin dotted #333;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-
-.btn:hover,
-.btn:focus {
- color: #333333;
- text-decoration: none;
-}
-
-.btn:active,
-.btn.active {
- background-image: none;
- outline: 0;
- -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
- box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
-}
-
-.btn.disabled,
-.btn[disabled],
-fieldset[disabled] .btn {
- pointer-events: none;
- cursor: not-allowed;
- opacity: 0.65;
- filter: alpha(opacity=65);
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-
-.btn-default {
- color: #333333;
- background-color: #ffffff;
- border-color: #cccccc;
-}
-
-.btn-default:hover,
-.btn-default:focus,
-.btn-default:active,
-.btn-default.active,
-.open .dropdown-toggle.btn-default {
- color: #333333;
- background-color: #ebebeb;
- border-color: #adadad;
-}
-
-.btn-default:active,
-.btn-default.active,
-.open .dropdown-toggle.btn-default {
- background-image: none;
-}
-
-.btn-default.disabled,
-.btn-default[disabled],
-fieldset[disabled] .btn-default,
-.btn-default.disabled:hover,
-.btn-default[disabled]:hover,
-fieldset[disabled] .btn-default:hover,
-.btn-default.disabled:focus,
-.btn-default[disabled]:focus,
-fieldset[disabled] .btn-default:focus,
-.btn-default.disabled:active,
-.btn-default[disabled]:active,
-fieldset[disabled] .btn-default:active,
-.btn-default.disabled.active,
-.btn-default[disabled].active,
-fieldset[disabled] .btn-default.active {
- background-color: #ffffff;
- border-color: #cccccc;
-}
-
-.btn-primary {
- color: #ffffff;
- background-color: #428bca;
- border-color: #357ebd;
-}
-
-.btn-primary:hover,
-.btn-primary:focus,
-.btn-primary:active,
-.btn-primary.active,
-.open .dropdown-toggle.btn-primary {
- color: #ffffff;
- background-color: #3276b1;
- border-color: #285e8e;
-}
-
-.btn-primary:active,
-.btn-primary.active,
-.open .dropdown-toggle.btn-primary {
- background-image: none;
-}
-
-.btn-primary.disabled,
-.btn-primary[disabled],
-fieldset[disabled] .btn-primary,
-.btn-primary.disabled:hover,
-.btn-primary[disabled]:hover,
-fieldset[disabled] .btn-primary:hover,
-.btn-primary.disabled:focus,
-.btn-primary[disabled]:focus,
-fieldset[disabled] .btn-primary:focus,
-.btn-primary.disabled:active,
-.btn-primary[disabled]:active,
-fieldset[disabled] .btn-primary:active,
-.btn-primary.disabled.active,
-.btn-primary[disabled].active,
-fieldset[disabled] .btn-primary.active {
- background-color: #428bca;
- border-color: #357ebd;
-}
-
-.btn-warning {
- color: #ffffff;
- background-color: #f0ad4e;
- border-color: #eea236;
-}
-
-.btn-warning:hover,
-.btn-warning:focus,
-.btn-warning:active,
-.btn-warning.active,
-.open .dropdown-toggle.btn-warning {
- color: #ffffff;
- background-color: #ed9c28;
- border-color: #d58512;
-}
-
-.btn-warning:active,
-.btn-warning.active,
-.open .dropdown-toggle.btn-warning {
- background-image: none;
-}
-
-.btn-warning.disabled,
-.btn-warning[disabled],
-fieldset[disabled] .btn-warning,
-.btn-warning.disabled:hover,
-.btn-warning[disabled]:hover,
-fieldset[disabled] .btn-warning:hover,
-.btn-warning.disabled:focus,
-.btn-warning[disabled]:focus,
-fieldset[disabled] .btn-warning:focus,
-.btn-warning.disabled:active,
-.btn-warning[disabled]:active,
-fieldset[disabled] .btn-warning:active,
-.btn-warning.disabled.active,
-.btn-warning[disabled].active,
-fieldset[disabled] .btn-warning.active {
- background-color: #f0ad4e;
- border-color: #eea236;
-}
-
-.btn-danger {
- color: #ffffff;
- background-color: #d9534f;
- border-color: #d43f3a;
-}
-
-.btn-danger:hover,
-.btn-danger:focus,
-.btn-danger:active,
-.btn-danger.active,
-.open .dropdown-toggle.btn-danger {
- color: #ffffff;
- background-color: #d2322d;
- border-color: #ac2925;
-}
-
-.btn-danger:active,
-.btn-danger.active,
-.open .dropdown-toggle.btn-danger {
- background-image: none;
-}
-
-.btn-danger.disabled,
-.btn-danger[disabled],
-fieldset[disabled] .btn-danger,
-.btn-danger.disabled:hover,
-.btn-danger[disabled]:hover,
-fieldset[disabled] .btn-danger:hover,
-.btn-danger.disabled:focus,
-.btn-danger[disabled]:focus,
-fieldset[disabled] .btn-danger:focus,
-.btn-danger.disabled:active,
-.btn-danger[disabled]:active,
-fieldset[disabled] .btn-danger:active,
-.btn-danger.disabled.active,
-.btn-danger[disabled].active,
-fieldset[disabled] .btn-danger.active {
- background-color: #d9534f;
- border-color: #d43f3a;
-}
-
-.btn-success {
- color: #ffffff;
- background-color: #5cb85c;
- border-color: #4cae4c;
-}
-
-.btn-success:hover,
-.btn-success:focus,
-.btn-success:active,
-.btn-success.active,
-.open .dropdown-toggle.btn-success {
- color: #ffffff;
- background-color: #47a447;
- border-color: #398439;
-}
-
-.btn-success:active,
-.btn-success.active,
-.open .dropdown-toggle.btn-success {
- background-image: none;
-}
-
-.btn-success.disabled,
-.btn-success[disabled],
-fieldset[disabled] .btn-success,
-.btn-success.disabled:hover,
-.btn-success[disabled]:hover,
-fieldset[disabled] .btn-success:hover,
-.btn-success.disabled:focus,
-.btn-success[disabled]:focus,
-fieldset[disabled] .btn-success:focus,
-.btn-success.disabled:active,
-.btn-success[disabled]:active,
-fieldset[disabled] .btn-success:active,
-.btn-success.disabled.active,
-.btn-success[disabled].active,
-fieldset[disabled] .btn-success.active {
- background-color: #5cb85c;
- border-color: #4cae4c;
-}
-
-.btn-info {
- color: #ffffff;
- background-color: #5bc0de;
- border-color: #46b8da;
-}
-
-.btn-info:hover,
-.btn-info:focus,
-.btn-info:active,
-.btn-info.active,
-.open .dropdown-toggle.btn-info {
- color: #ffffff;
- background-color: #39b3d7;
- border-color: #269abc;
-}
-
-.btn-info:active,
-.btn-info.active,
-.open .dropdown-toggle.btn-info {
- background-image: none;
-}
-
-.btn-info.disabled,
-.btn-info[disabled],
-fieldset[disabled] .btn-info,
-.btn-info.disabled:hover,
-.btn-info[disabled]:hover,
-fieldset[disabled] .btn-info:hover,
-.btn-info.disabled:focus,
-.btn-info[disabled]:focus,
-fieldset[disabled] .btn-info:focus,
-.btn-info.disabled:active,
-.btn-info[disabled]:active,
-fieldset[disabled] .btn-info:active,
-.btn-info.disabled.active,
-.btn-info[disabled].active,
-fieldset[disabled] .btn-info.active {
- background-color: #5bc0de;
- border-color: #46b8da;
-}
-
-.btn-link {
- font-weight: normal;
- color: #428bca;
- cursor: pointer;
- border-radius: 0;
-}
-
-.btn-link,
-.btn-link:active,
-.btn-link[disabled],
-fieldset[disabled] .btn-link {
- background-color: transparent;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-
-.btn-link,
-.btn-link:hover,
-.btn-link:focus,
-.btn-link:active {
- border-color: transparent;
-}
-
-.btn-link:hover,
-.btn-link:focus {
- color: #2a6496;
- text-decoration: underline;
- background-color: transparent;
-}
-
-.btn-link[disabled]:hover,
-fieldset[disabled] .btn-link:hover,
-.btn-link[disabled]:focus,
-fieldset[disabled] .btn-link:focus {
- color: #999999;
- text-decoration: none;
-}
-
-.btn-lg {
- padding: 10px 16px;
- font-size: 18px;
- line-height: 1.33;
- border-radius: 6px;
-}
-
-.btn-sm,
-.btn-xs {
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-
-.btn-xs {
- padding: 1px 5px;
-}
-
-.btn-block {
- display: block;
- width: 100%;
- padding-right: 0;
- padding-left: 0;
-}
-
-.btn-block + .btn-block {
- margin-top: 5px;
-}
-
-input[type="submit"].btn-block,
-input[type="reset"].btn-block,
-input[type="button"].btn-block {
- width: 100%;
-}
-
-.fade {
- opacity: 0;
- -webkit-transition: opacity 0.15s linear;
- transition: opacity 0.15s linear;
-}
-
-.fade.in {
- opacity: 1;
-}
-
-.collapse {
- display: none;
-}
-
-.collapse.in {
- display: block;
-}
-
-.collapsing {
- position: relative;
- height: 0;
- overflow: hidden;
- -webkit-transition: height 0.35s ease;
- transition: height 0.35s ease;
-}
-
-@font-face {
- font-family: 'Glyphicons Halflings';
- src: url('../fonts/glyphicons-halflings-regular.eot');
- src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
-}
-
-.glyphicon {
- position: relative;
- top: 1px;
- display: inline-block;
- font-family: 'Glyphicons Halflings';
- -webkit-font-smoothing: antialiased;
- font-style: normal;
- font-weight: normal;
- line-height: 1;
-}
-
-.glyphicon-asterisk:before {
- content: "\2a";
-}
-
-.glyphicon-plus:before {
- content: "\2b";
-}
-
-.glyphicon-euro:before {
- content: "\20ac";
-}
-
-.glyphicon-minus:before {
- content: "\2212";
-}
-
-.glyphicon-cloud:before {
- content: "\2601";
-}
-
-.glyphicon-envelope:before {
- content: "\2709";
-}
-
-.glyphicon-pencil:before {
- content: "\270f";
-}
-
-.glyphicon-glass:before {
- content: "\e001";
-}
-
-.glyphicon-music:before {
- content: "\e002";
-}
-
-.glyphicon-search:before {
- content: "\e003";
-}
-
-.glyphicon-heart:before {
- content: "\e005";
-}
-
-.glyphicon-star:before {
- content: "\e006";
-}
-
-.glyphicon-star-empty:before {
- content: "\e007";
-}
-
-.glyphicon-user:before {
- content: "\e008";
-}
-
-.glyphicon-film:before {
- content: "\e009";
-}
-
-.glyphicon-th-large:before {
- content: "\e010";
-}
-
-.glyphicon-th:before {
- content: "\e011";
-}
-
-.glyphicon-th-list:before {
- content: "\e012";
-}
-
-.glyphicon-ok:before {
- content: "\e013";
-}
-
-.glyphicon-remove:before {
- content: "\e014";
-}
-
-.glyphicon-zoom-in:before {
- content: "\e015";
-}
-
-.glyphicon-zoom-out:before {
- content: "\e016";
-}
-
-.glyphicon-off:before {
- content: "\e017";
-}
-
-.glyphicon-signal:before {
- content: "\e018";
-}
-
-.glyphicon-cog:before {
- content: "\e019";
-}
-
-.glyphicon-trash:before {
- content: "\e020";
-}
-
-.glyphicon-home:before {
- content: "\e021";
-}
-
-.glyphicon-file:before {
- content: "\e022";
-}
-
-.glyphicon-time:before {
- content: "\e023";
-}
-
-.glyphicon-road:before {
- content: "\e024";
-}
-
-.glyphicon-download-alt:before {
- content: "\e025";
-}
-
-.glyphicon-download:before {
- content: "\e026";
-}
-
-.glyphicon-upload:before {
- content: "\e027";
-}
-
-.glyphicon-inbox:before {
- content: "\e028";
-}
-
-.glyphicon-play-circle:before {
- content: "\e029";
-}
-
-.glyphicon-repeat:before {
- content: "\e030";
-}
-
-.glyphicon-refresh:before {
- content: "\e031";
-}
-
-.glyphicon-list-alt:before {
- content: "\e032";
-}
-
-.glyphicon-flag:before {
- content: "\e034";
-}
-
-.glyphicon-headphones:before {
- content: "\e035";
-}
-
-.glyphicon-volume-off:before {
- content: "\e036";
-}
-
-.glyphicon-volume-down:before {
- content: "\e037";
-}
-
-.glyphicon-volume-up:before {
- content: "\e038";
-}
-
-.glyphicon-qrcode:before {
- content: "\e039";
-}
-
-.glyphicon-barcode:before {
- content: "\e040";
-}
-
-.glyphicon-tag:before {
- content: "\e041";
-}
-
-.glyphicon-tags:before {
- content: "\e042";
-}
-
-.glyphicon-book:before {
- content: "\e043";
-}
-
-.glyphicon-print:before {
- content: "\e045";
-}
-
-.glyphicon-font:before {
- content: "\e047";
-}
-
-.glyphicon-bold:before {
- content: "\e048";
-}
-
-.glyphicon-italic:before {
- content: "\e049";
-}
-
-.glyphicon-text-height:before {
- content: "\e050";
-}
-
-.glyphicon-text-width:before {
- content: "\e051";
-}
-
-.glyphicon-align-left:before {
- content: "\e052";
-}
-
-.glyphicon-align-center:before {
- content: "\e053";
-}
-
-.glyphicon-align-right:before {
- content: "\e054";
-}
-
-.glyphicon-align-justify:before {
- content: "\e055";
-}
-
-.glyphicon-list:before {
- content: "\e056";
-}
-
-.glyphicon-indent-left:before {
- content: "\e057";
-}
-
-.glyphicon-indent-right:before {
- content: "\e058";
-}
-
-.glyphicon-facetime-video:before {
- content: "\e059";
-}
-
-.glyphicon-picture:before {
- content: "\e060";
-}
-
-.glyphicon-map-marker:before {
- content: "\e062";
-}
-
-.glyphicon-adjust:before {
- content: "\e063";
-}
-
-.glyphicon-tint:before {
- content: "\e064";
-}
-
-.glyphicon-edit:before {
- content: "\e065";
-}
-
-.glyphicon-share:before {
- content: "\e066";
-}
-
-.glyphicon-check:before {
- content: "\e067";
-}
-
-.glyphicon-move:before {
- content: "\e068";
-}
-
-.glyphicon-step-backward:before {
- content: "\e069";
-}
-
-.glyphicon-fast-backward:before {
- content: "\e070";
-}
-
-.glyphicon-backward:before {
- content: "\e071";
-}
-
-.glyphicon-play:before {
- content: "\e072";
-}
-
-.glyphicon-pause:before {
- content: "\e073";
-}
-
-.glyphicon-stop:before {
- content: "\e074";
-}
-
-.glyphicon-forward:before {
- content: "\e075";
-}
-
-.glyphicon-fast-forward:before {
- content: "\e076";
-}
-
-.glyphicon-step-forward:before {
- content: "\e077";
-}
-
-.glyphicon-eject:before {
- content: "\e078";
-}
-
-.glyphicon-chevron-left:before {
- content: "\e079";
-}
-
-.glyphicon-chevron-right:before {
- content: "\e080";
-}
-
-.glyphicon-plus-sign:before {
- content: "\e081";
-}
-
-.glyphicon-minus-sign:before {
- content: "\e082";
-}
-
-.glyphicon-remove-sign:before {
- content: "\e083";
-}
-
-.glyphicon-ok-sign:before {
- content: "\e084";
-}
-
-.glyphicon-question-sign:before {
- content: "\e085";
-}
-
-.glyphicon-info-sign:before {
- content: "\e086";
-}
-
-.glyphicon-screenshot:before {
- content: "\e087";
-}
-
-.glyphicon-remove-circle:before {
- content: "\e088";
-}
-
-.glyphicon-ok-circle:before {
- content: "\e089";
-}
-
-.glyphicon-ban-circle:before {
- content: "\e090";
-}
-
-.glyphicon-arrow-left:before {
- content: "\e091";
-}
-
-.glyphicon-arrow-right:before {
- content: "\e092";
-}
-
-.glyphicon-arrow-up:before {
- content: "\e093";
-}
-
-.glyphicon-arrow-down:before {
- content: "\e094";
-}
-
-.glyphicon-share-alt:before {
- content: "\e095";
-}
-
-.glyphicon-resize-full:before {
- content: "\e096";
-}
-
-.glyphicon-resize-small:before {
- content: "\e097";
-}
-
-.glyphicon-exclamation-sign:before {
- content: "\e101";
-}
-
-.glyphicon-gift:before {
- content: "\e102";
-}
-
-.glyphicon-leaf:before {
- content: "\e103";
-}
-
-.glyphicon-eye-open:before {
- content: "\e105";
-}
-
-.glyphicon-eye-close:before {
- content: "\e106";
-}
-
-.glyphicon-warning-sign:before {
- content: "\e107";
-}
-
-.glyphicon-plane:before {
- content: "\e108";
-}
-
-.glyphicon-random:before {
- content: "\e110";
-}
-
-.glyphicon-comment:before {
- content: "\e111";
-}
-
-.glyphicon-magnet:before {
- content: "\e112";
-}
-
-.glyphicon-chevron-up:before {
- content: "\e113";
-}
-
-.glyphicon-chevron-down:before {
- content: "\e114";
-}
-
-.glyphicon-retweet:before {
- content: "\e115";
-}
-
-.glyphicon-shopping-cart:before {
- content: "\e116";
-}
-
-.glyphicon-folder-close:before {
- content: "\e117";
-}
-
-.glyphicon-folder-open:before {
- content: "\e118";
-}
-
-.glyphicon-resize-vertical:before {
- content: "\e119";
-}
-
-.glyphicon-resize-horizontal:before {
- content: "\e120";
-}
-
-.glyphicon-hdd:before {
- content: "\e121";
-}
-
-.glyphicon-bullhorn:before {
- content: "\e122";
-}
-
-.glyphicon-certificate:before {
- content: "\e124";
-}
-
-.glyphicon-thumbs-up:before {
- content: "\e125";
-}
-
-.glyphicon-thumbs-down:before {
- content: "\e126";
-}
-
-.glyphicon-hand-right:before {
- content: "\e127";
-}
-
-.glyphicon-hand-left:before {
- content: "\e128";
-}
-
-.glyphicon-hand-up:before {
- content: "\e129";
-}
-
-.glyphicon-hand-down:before {
- content: "\e130";
-}
-
-.glyphicon-circle-arrow-right:before {
- content: "\e131";
-}
-
-.glyphicon-circle-arrow-left:before {
- content: "\e132";
-}
-
-.glyphicon-circle-arrow-up:before {
- content: "\e133";
-}
-
-.glyphicon-circle-arrow-down:before {
- content: "\e134";
-}
-
-.glyphicon-globe:before {
- content: "\e135";
-}
-
-.glyphicon-tasks:before {
- content: "\e137";
-}
-
-.glyphicon-filter:before {
- content: "\e138";
-}
-
-.glyphicon-fullscreen:before {
- content: "\e140";
-}
-
-.glyphicon-dashboard:before {
- content: "\e141";
-}
-
-.glyphicon-heart-empty:before {
- content: "\e143";
-}
-
-.glyphicon-link:before {
- content: "\e144";
-}
-
-.glyphicon-phone:before {
- content: "\e145";
-}
-
-.glyphicon-usd:before {
- content: "\e148";
-}
-
-.glyphicon-gbp:before {
- content: "\e149";
-}
-
-.glyphicon-sort:before {
- content: "\e150";
-}
-
-.glyphicon-sort-by-alphabet:before {
- content: "\e151";
-}
-
-.glyphicon-sort-by-alphabet-alt:before {
- content: "\e152";
-}
-
-.glyphicon-sort-by-order:before {
- content: "\e153";
-}
-
-.glyphicon-sort-by-order-alt:before {
- content: "\e154";
-}
-
-.glyphicon-sort-by-attributes:before {
- content: "\e155";
-}
-
-.glyphicon-sort-by-attributes-alt:before {
- content: "\e156";
-}
-
-.glyphicon-unchecked:before {
- content: "\e157";
-}
-
-.glyphicon-expand:before {
- content: "\e158";
-}
-
-.glyphicon-collapse-down:before {
- content: "\e159";
-}
-
-.glyphicon-collapse-up:before {
- content: "\e160";
-}
-
-.glyphicon-log-in:before {
- content: "\e161";
-}
-
-.glyphicon-flash:before {
- content: "\e162";
-}
-
-.glyphicon-log-out:before {
- content: "\e163";
-}
-
-.glyphicon-new-window:before {
- content: "\e164";
-}
-
-.glyphicon-record:before {
- content: "\e165";
-}
-
-.glyphicon-save:before {
- content: "\e166";
-}
-
-.glyphicon-open:before {
- content: "\e167";
-}
-
-.glyphicon-saved:before {
- content: "\e168";
-}
-
-.glyphicon-import:before {
- content: "\e169";
-}
-
-.glyphicon-export:before {
- content: "\e170";
-}
-
-.glyphicon-send:before {
- content: "\e171";
-}
-
-.glyphicon-floppy-disk:before {
- content: "\e172";
-}
-
-.glyphicon-floppy-saved:before {
- content: "\e173";
-}
-
-.glyphicon-floppy-remove:before {
- content: "\e174";
-}
-
-.glyphicon-floppy-save:before {
- content: "\e175";
-}
-
-.glyphicon-floppy-open:before {
- content: "\e176";
-}
-
-.glyphicon-credit-card:before {
- content: "\e177";
-}
-
-.glyphicon-transfer:before {
- content: "\e178";
-}
-
-.glyphicon-cutlery:before {
- content: "\e179";
-}
-
-.glyphicon-header:before {
- content: "\e180";
-}
-
-.glyphicon-compressed:before {
- content: "\e181";
-}
-
-.glyphicon-earphone:before {
- content: "\e182";
-}
-
-.glyphicon-phone-alt:before {
- content: "\e183";
-}
-
-.glyphicon-tower:before {
- content: "\e184";
-}
-
-.glyphicon-stats:before {
- content: "\e185";
-}
-
-.glyphicon-sd-video:before {
- content: "\e186";
-}
-
-.glyphicon-hd-video:before {
- content: "\e187";
-}
-
-.glyphicon-subtitles:before {
- content: "\e188";
-}
-
-.glyphicon-sound-stereo:before {
- content: "\e189";
-}
-
-.glyphicon-sound-dolby:before {
- content: "\e190";
-}
-
-.glyphicon-sound-5-1:before {
- content: "\e191";
-}
-
-.glyphicon-sound-6-1:before {
- content: "\e192";
-}
-
-.glyphicon-sound-7-1:before {
- content: "\e193";
-}
-
-.glyphicon-copyright-mark:before {
- content: "\e194";
-}
-
-.glyphicon-registration-mark:before {
- content: "\e195";
-}
-
-.glyphicon-cloud-download:before {
- content: "\e197";
-}
-
-.glyphicon-cloud-upload:before {
- content: "\e198";
-}
-
-.glyphicon-tree-conifer:before {
- content: "\e199";
-}
-
-.glyphicon-tree-deciduous:before {
- content: "\e200";
-}
-
-.glyphicon-briefcase:before {
- content: "\1f4bc";
-}
-
-.glyphicon-calendar:before {
- content: "\1f4c5";
-}
-
-.glyphicon-pushpin:before {
- content: "\1f4cc";
-}
-
-.glyphicon-paperclip:before {
- content: "\1f4ce";
-}
-
-.glyphicon-camera:before {
- content: "\1f4f7";
-}
-
-.glyphicon-lock:before {
- content: "\1f512";
-}
-
-.glyphicon-bell:before {
- content: "\1f514";
-}
-
-.glyphicon-bookmark:before {
- content: "\1f516";
-}
-
-.glyphicon-fire:before {
- content: "\1f525";
-}
-
-.glyphicon-wrench:before {
- content: "\1f527";
-}
-
-.caret {
- display: inline-block;
- width: 0;
- height: 0;
- margin-left: 2px;
- vertical-align: middle;
- border-top: 4px solid #000000;
- border-right: 4px solid transparent;
- border-bottom: 0 dotted;
- border-left: 4px solid transparent;
- content: "";
-}
-
-.dropdown {
- position: relative;
-}
-
-.dropdown-toggle:focus {
- outline: 0;
-}
-
-.dropdown-menu {
- position: absolute;
- top: 100%;
- left: 0;
- z-index: 1000;
- display: none;
- float: left;
- min-width: 160px;
- padding: 5px 0;
- margin: 2px 0 0;
- font-size: 14px;
- list-style: none;
- background-color: #ffffff;
- border: 1px solid #cccccc;
- border: 1px solid rgba(0, 0, 0, 0.15);
- border-radius: 4px;
- -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
- box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
- background-clip: padding-box;
-}
-
-.dropdown-menu.pull-right {
- right: 0;
- left: auto;
-}
-
-.dropdown-menu .divider {
- height: 1px;
- margin: 9px 0;
- overflow: hidden;
- background-color: #e5e5e5;
-}
-
-.dropdown-menu > li > a {
- display: block;
- padding: 3px 20px;
- clear: both;
- font-weight: normal;
- line-height: 1.428571429;
- color: #333333;
- white-space: nowrap;
-}
-
-.dropdown-menu > li > a:hover,
-.dropdown-menu > li > a:focus {
- color: #ffffff;
- text-decoration: none;
- background-color: #428bca;
-}
-
-.dropdown-menu > .active > a,
-.dropdown-menu > .active > a:hover,
-.dropdown-menu > .active > a:focus {
- color: #ffffff;
- text-decoration: none;
- background-color: #428bca;
- outline: 0;
-}
-
-.dropdown-menu > .disabled > a,
-.dropdown-menu > .disabled > a:hover,
-.dropdown-menu > .disabled > a:focus {
- color: #999999;
-}
-
-.dropdown-menu > .disabled > a:hover,
-.dropdown-menu > .disabled > a:focus {
- text-decoration: none;
- cursor: not-allowed;
- background-color: transparent;
- background-image: none;
- filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
-}
-
-.open > .dropdown-menu {
- display: block;
-}
-
-.open > a {
- outline: 0;
-}
-
-.dropdown-header {
- display: block;
- padding: 3px 20px;
- font-size: 12px;
- line-height: 1.428571429;
- color: #999999;
-}
-
-.dropdown-backdrop {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- z-index: 990;
-}
-
-.pull-right > .dropdown-menu {
- right: 0;
- left: auto;
-}
-
-.dropup .caret,
-.navbar-fixed-bottom .dropdown .caret {
- border-top: 0 dotted;
- border-bottom: 4px solid #000000;
- content: "";
-}
-
-.dropup .dropdown-menu,
-.navbar-fixed-bottom .dropdown .dropdown-menu {
- top: auto;
- bottom: 100%;
- margin-bottom: 1px;
-}
-
-@media (min-width: 768px) {
- .navbar-right .dropdown-menu {
- right: 0;
- left: auto;
- }
-}
-
-.btn-default .caret {
- border-top-color: #333333;
-}
-
-.btn-primary .caret,
-.btn-success .caret,
-.btn-warning .caret,
-.btn-danger .caret,
-.btn-info .caret {
- border-top-color: #fff;
-}
-
-.dropup .btn-default .caret {
- border-bottom-color: #333333;
-}
-
-.dropup .btn-primary .caret,
-.dropup .btn-success .caret,
-.dropup .btn-warning .caret,
-.dropup .btn-danger .caret,
-.dropup .btn-info .caret {
- border-bottom-color: #fff;
-}
-
-.btn-group,
-.btn-group-vertical {
- position: relative;
- display: inline-block;
- vertical-align: middle;
-}
-
-.btn-group > .btn,
-.btn-group-vertical > .btn {
- position: relative;
- float: left;
-}
-
-.btn-group > .btn:hover,
-.btn-group-vertical > .btn:hover,
-.btn-group > .btn:focus,
-.btn-group-vertical > .btn:focus,
-.btn-group > .btn:active,
-.btn-group-vertical > .btn:active,
-.btn-group > .btn.active,
-.btn-group-vertical > .btn.active {
- z-index: 2;
-}
-
-.btn-group > .btn:focus,
-.btn-group-vertical > .btn:focus {
- outline: none;
-}
-
-.btn-group .btn + .btn,
-.btn-group .btn + .btn-group,
-.btn-group .btn-group + .btn,
-.btn-group .btn-group + .btn-group {
- margin-left: -1px;
-}
-
-.btn-toolbar:before,
-.btn-toolbar:after {
- display: table;
- content: " ";
-}
-
-.btn-toolbar:after {
- clear: both;
-}
-
-.btn-toolbar:before,
-.btn-toolbar:after {
- display: table;
- content: " ";
-}
-
-.btn-toolbar:after {
- clear: both;
-}
-
-.btn-toolbar .btn-group {
- float: left;
-}
-
-.btn-toolbar > .btn + .btn,
-.btn-toolbar > .btn-group + .btn,
-.btn-toolbar > .btn + .btn-group,
-.btn-toolbar > .btn-group + .btn-group {
- margin-left: 5px;
-}
-
-.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
- border-radius: 0;
-}
-
-.btn-group > .btn:first-child {
- margin-left: 0;
-}
-
-.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-.btn-group > .btn:last-child:not(:first-child),
-.btn-group > .dropdown-toggle:not(:first-child) {
- border-bottom-left-radius: 0;
- border-top-left-radius: 0;
-}
-
-.btn-group > .btn-group {
- float: left;
-}
-
-.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
- border-radius: 0;
-}
-
-.btn-group > .btn-group:first-child > .btn:last-child,
-.btn-group > .btn-group:first-child > .dropdown-toggle {
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-.btn-group > .btn-group:last-child > .btn:first-child {
- border-bottom-left-radius: 0;
- border-top-left-radius: 0;
-}
-
-.btn-group .dropdown-toggle:active,
-.btn-group.open .dropdown-toggle {
- outline: 0;
-}
-
-.btn-group-xs > .btn {
- padding: 5px 10px;
- padding: 1px 5px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-
-.btn-group-sm > .btn {
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-
-.btn-group-lg > .btn {
- padding: 10px 16px;
- font-size: 18px;
- line-height: 1.33;
- border-radius: 6px;
-}
-
-.btn-group > .btn + .dropdown-toggle {
- padding-right: 8px;
- padding-left: 8px;
-}
-
-.btn-group > .btn-lg + .dropdown-toggle {
- padding-right: 12px;
- padding-left: 12px;
-}
-
-.btn-group.open .dropdown-toggle {
- -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
- box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
-}
-
-.btn .caret {
- margin-left: 0;
-}
-
-.btn-lg .caret {
- border-width: 5px 5px 0;
- border-bottom-width: 0;
-}
-
-.dropup .btn-lg .caret {
- border-width: 0 5px 5px;
-}
-
-.btn-group-vertical > .btn,
-.btn-group-vertical > .btn-group {
- display: block;
- float: none;
- width: 100%;
- max-width: 100%;
-}
-
-.btn-group-vertical > .btn-group:before,
-.btn-group-vertical > .btn-group:after {
- display: table;
- content: " ";
-}
-
-.btn-group-vertical > .btn-group:after {
- clear: both;
-}
-
-.btn-group-vertical > .btn-group:before,
-.btn-group-vertical > .btn-group:after {
- display: table;
- content: " ";
-}
-
-.btn-group-vertical > .btn-group:after {
- clear: both;
-}
-
-.btn-group-vertical > .btn-group > .btn {
- float: none;
-}
-
-.btn-group-vertical > .btn + .btn,
-.btn-group-vertical > .btn + .btn-group,
-.btn-group-vertical > .btn-group + .btn,
-.btn-group-vertical > .btn-group + .btn-group {
- margin-top: -1px;
- margin-left: 0;
-}
-
-.btn-group-vertical > .btn:not(:first-child):not(:last-child) {
- border-radius: 0;
-}
-
-.btn-group-vertical > .btn:first-child:not(:last-child) {
- border-top-right-radius: 4px;
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-.btn-group-vertical > .btn:last-child:not(:first-child) {
- border-top-right-radius: 0;
- border-bottom-left-radius: 4px;
- border-top-left-radius: 0;
-}
-
-.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
- border-radius: 0;
-}
-
-.btn-group-vertical > .btn-group:first-child > .btn:last-child,
-.btn-group-vertical > .btn-group:first-child > .dropdown-toggle {
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-.btn-group-vertical > .btn-group:last-child > .btn:first-child {
- border-top-right-radius: 0;
- border-top-left-radius: 0;
-}
-
-.btn-group-justified {
- display: table;
- width: 100%;
- border-collapse: separate;
- table-layout: fixed;
-}
-
-.btn-group-justified .btn {
- display: table-cell;
- float: none;
- width: 1%;
-}
-
-[data-toggle="buttons"] > .btn > input[type="radio"],
-[data-toggle="buttons"] > .btn > input[type="checkbox"] {
- display: none;
-}
-
-.input-group {
- position: relative;
- display: table;
- border-collapse: separate;
-}
-
-.input-group.col {
- float: none;
- padding-right: 0;
- padding-left: 0;
-}
-
-.input-group .form-control {
- width: 100%;
- margin-bottom: 0;
-}
-
-.input-group-lg > .form-control,
-.input-group-lg > .input-group-addon,
-.input-group-lg > .input-group-btn > .btn {
- height: 45px;
- padding: 10px 16px;
- font-size: 18px;
- line-height: 1.33;
- border-radius: 6px;
-}
-
-select.input-group-lg > .form-control,
-select.input-group-lg > .input-group-addon,
-select.input-group-lg > .input-group-btn > .btn {
- height: 45px;
- line-height: 45px;
-}
-
-textarea.input-group-lg > .form-control,
-textarea.input-group-lg > .input-group-addon,
-textarea.input-group-lg > .input-group-btn > .btn {
- height: auto;
-}
-
-.input-group-sm > .form-control,
-.input-group-sm > .input-group-addon,
-.input-group-sm > .input-group-btn > .btn {
- height: 30px;
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 3px;
-}
-
-select.input-group-sm > .form-control,
-select.input-group-sm > .input-group-addon,
-select.input-group-sm > .input-group-btn > .btn {
- height: 30px;
- line-height: 30px;
-}
-
-textarea.input-group-sm > .form-control,
-textarea.input-group-sm > .input-group-addon,
-textarea.input-group-sm > .input-group-btn > .btn {
- height: auto;
-}
-
-.input-group-addon,
-.input-group-btn,
-.input-group .form-control {
- display: table-cell;
-}
-
-.input-group-addon:not(:first-child):not(:last-child),
-.input-group-btn:not(:first-child):not(:last-child),
-.input-group .form-control:not(:first-child):not(:last-child) {
- border-radius: 0;
-}
-
-.input-group-addon,
-.input-group-btn {
- width: 1%;
- white-space: nowrap;
- vertical-align: middle;
-}
-
-.input-group-addon {
- padding: 6px 12px;
- font-size: 14px;
- font-weight: normal;
- line-height: 1;
- text-align: center;
- background-color: #eeeeee;
- border: 1px solid #cccccc;
- border-radius: 4px;
-}
-
-.input-group-addon.input-sm {
- padding: 5px 10px;
- font-size: 12px;
- border-radius: 3px;
-}
-
-.input-group-addon.input-lg {
- padding: 10px 16px;
- font-size: 18px;
- border-radius: 6px;
-}
-
-.input-group-addon input[type="radio"],
-.input-group-addon input[type="checkbox"] {
- margin-top: 0;
-}
-
-.input-group .form-control:first-child,
-.input-group-addon:first-child,
-.input-group-btn:first-child > .btn,
-.input-group-btn:first-child > .dropdown-toggle,
-.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-.input-group-addon:first-child {
- border-right: 0;
-}
-
-.input-group .form-control:last-child,
-.input-group-addon:last-child,
-.input-group-btn:last-child > .btn,
-.input-group-btn:last-child > .dropdown-toggle,
-.input-group-btn:first-child > .btn:not(:first-child) {
- border-bottom-left-radius: 0;
- border-top-left-radius: 0;
-}
-
-.input-group-addon:last-child {
- border-left: 0;
-}
-
-.input-group-btn {
- position: relative;
- white-space: nowrap;
-}
-
-.input-group-btn > .btn {
- position: relative;
-}
-
-.input-group-btn > .btn + .btn {
- margin-left: -4px;
-}
-
-.input-group-btn > .btn:hover,
-.input-group-btn > .btn:active {
- z-index: 2;
-}
-
-.nav {
- padding-left: 0;
- margin-bottom: 0;
- list-style: none;
-}
-
-.nav:before,
-.nav:after {
- display: table;
- content: " ";
-}
-
-.nav:after {
- clear: both;
-}
-
-.nav:before,
-.nav:after {
- display: table;
- content: " ";
-}
-
-.nav:after {
- clear: both;
-}
-
-.nav > li {
- position: relative;
- display: block;
-}
-
-.nav > li > a {
- position: relative;
- display: block;
- padding: 10px 15px;
-}
-
-.nav > li > a:hover,
-.nav > li > a:focus {
- text-decoration: none;
- background-color: #eeeeee;
-}
-
-.nav > li.disabled > a {
- color: #999999;
-}
-
-.nav > li.disabled > a:hover,
-.nav > li.disabled > a:focus {
- color: #999999;
- text-decoration: none;
- cursor: not-allowed;
- background-color: transparent;
-}
-
-.nav .open > a,
-.nav .open > a:hover,
-.nav .open > a:focus {
- background-color: #eeeeee;
- border-color: #428bca;
-}
-
-.nav .nav-divider {
- height: 1px;
- margin: 9px 0;
- overflow: hidden;
- background-color: #e5e5e5;
-}
-
-.nav > li > a > img {
- max-width: none;
-}
-
-.nav-tabs {
- border-bottom: 1px solid #dddddd;
-}
-
-.nav-tabs > li {
- float: left;
- margin-bottom: -1px;
-}
-
-.nav-tabs > li > a {
- margin-right: 2px;
- line-height: 1.428571429;
- border: 1px solid transparent;
- border-radius: 4px 4px 0 0;
-}
-
-.nav-tabs > li > a:hover {
- border-color: #eeeeee #eeeeee #dddddd;
-}
-
-.nav-tabs > li.active > a,
-.nav-tabs > li.active > a:hover,
-.nav-tabs > li.active > a:focus {
- color: #555555;
- cursor: default;
- background-color: #ffffff;
- border: 1px solid #dddddd;
- border-bottom-color: transparent;
-}
-
-.nav-tabs.nav-justified {
- width: 100%;
- border-bottom: 0;
-}
-
-.nav-tabs.nav-justified > li {
- float: none;
-}
-
-.nav-tabs.nav-justified > li > a {
- text-align: center;
-}
-
-@media (min-width: 768px) {
- .nav-tabs.nav-justified > li {
- display: table-cell;
- width: 1%;
- }
-}
-
-.nav-tabs.nav-justified > li > a {
- margin-right: 0;
- border-bottom: 1px solid #dddddd;
-}
-
-.nav-tabs.nav-justified > .active > a {
- border-bottom-color: #ffffff;
-}
-
-.nav-pills > li {
- float: left;
-}
-
-.nav-pills > li > a {
- border-radius: 5px;
-}
-
-.nav-pills > li + li {
- margin-left: 2px;
-}
-
-.nav-pills > li.active > a,
-.nav-pills > li.active > a:hover,
-.nav-pills > li.active > a:focus {
- color: #ffffff;
- background-color: #428bca;
-}
-
-.nav-stacked > li {
- float: none;
-}
-
-.nav-stacked > li + li {
- margin-top: 2px;
- margin-left: 0;
-}
-
-.nav-justified {
- width: 100%;
-}
-
-.nav-justified > li {
- float: none;
-}
-
-.nav-justified > li > a {
- text-align: center;
-}
-
-@media (min-width: 768px) {
- .nav-justified > li {
- display: table-cell;
- width: 1%;
- }
-}
-
-.nav-tabs-justified {
- border-bottom: 0;
-}
-
-.nav-tabs-justified > li > a {
- margin-right: 0;
- border-bottom: 1px solid #dddddd;
-}
-
-.nav-tabs-justified > .active > a {
- border-bottom-color: #ffffff;
-}
-
-.tabbable:before,
-.tabbable:after {
- display: table;
- content: " ";
-}
-
-.tabbable:after {
- clear: both;
-}
-
-.tabbable:before,
-.tabbable:after {
- display: table;
- content: " ";
-}
-
-.tabbable:after {
- clear: both;
-}
-
-.tab-content > .tab-pane,
-.pill-content > .pill-pane {
- display: none;
-}
-
-.tab-content > .active,
-.pill-content > .active {
- display: block;
-}
-
-.nav .caret {
- border-top-color: #428bca;
- border-bottom-color: #428bca;
-}
-
-.nav a:hover .caret {
- border-top-color: #2a6496;
- border-bottom-color: #2a6496;
-}
-
-.nav-tabs .dropdown-menu {
- margin-top: -1px;
- border-top-right-radius: 0;
- border-top-left-radius: 0;
-}
-
-.navbar {
- position: relative;
- z-index: 1000;
- min-height: 50px;
- margin-bottom: 20px;
- border: 1px solid transparent;
-}
-
-.navbar:before,
-.navbar:after {
- display: table;
- content: " ";
-}
-
-.navbar:after {
- clear: both;
-}
-
-.navbar:before,
-.navbar:after {
- display: table;
- content: " ";
-}
-
-.navbar:after {
- clear: both;
-}
-
-@media (min-width: 768px) {
- .navbar {
- border-radius: 4px;
- }
-}
-
-.navbar-header:before,
-.navbar-header:after {
- display: table;
- content: " ";
-}
-
-.navbar-header:after {
- clear: both;
-}
-
-.navbar-header:before,
-.navbar-header:after {
- display: table;
- content: " ";
-}
-
-.navbar-header:after {
- clear: both;
-}
-
-@media (min-width: 768px) {
- .navbar-header {
- float: left;
- }
-}
-
-.navbar-collapse {
- max-height: 340px;
- padding-right: 15px;
- padding-left: 15px;
- overflow-x: visible;
- border-top: 1px solid transparent;
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
- -webkit-overflow-scrolling: touch;
-}
-
-.navbar-collapse:before,
-.navbar-collapse:after {
- display: table;
- content: " ";
-}
-
-.navbar-collapse:after {
- clear: both;
-}
-
-.navbar-collapse:before,
-.navbar-collapse:after {
- display: table;
- content: " ";
-}
-
-.navbar-collapse:after {
- clear: both;
-}
-
-.navbar-collapse.in {
- overflow-y: auto;
-}
-
-@media (min-width: 768px) {
- .navbar-collapse {
- width: auto;
- border-top: 0;
- box-shadow: none;
- }
- .navbar-collapse.collapse {
- display: block !important;
- height: auto !important;
- padding-bottom: 0;
- overflow: visible !important;
- }
- .navbar-collapse.in {
- overflow-y: visible;
- }
- .navbar-collapse .navbar-nav.navbar-left:first-child {
- margin-left: -15px;
- }
- .navbar-collapse .navbar-nav.navbar-right:last-child {
- margin-right: -15px;
- }
- .navbar-collapse .navbar-text:last-child {
- margin-right: 0;
- }
-}
-
-.container > .navbar-header,
-.container > .navbar-collapse {
- margin-right: -15px;
- margin-left: -15px;
-}
-
-@media (min-width: 768px) {
- .container > .navbar-header,
- .container > .navbar-collapse {
- margin-right: 0;
- margin-left: 0;
- }
-}
-
-.navbar-static-top {
- border-width: 0 0 1px;
-}
-
-@media (min-width: 768px) {
- .navbar-static-top {
- border-radius: 0;
- }
-}
-
-.navbar-fixed-top,
-.navbar-fixed-bottom {
- position: fixed;
- right: 0;
- left: 0;
- border-width: 0 0 1px;
-}
-
-@media (min-width: 768px) {
- .navbar-fixed-top,
- .navbar-fixed-bottom {
- border-radius: 0;
- }
-}
-
-.navbar-fixed-top {
- top: 0;
- z-index: 1030;
-}
-
-.navbar-fixed-bottom {
- bottom: 0;
- margin-bottom: 0;
-}
-
-.navbar-brand {
- float: left;
- padding: 15px 15px;
- font-size: 18px;
- line-height: 20px;
-}
-
-.navbar-brand:hover,
-.navbar-brand:focus {
- text-decoration: none;
-}
-
-@media (min-width: 768px) {
- .navbar > .container .navbar-brand {
- margin-left: -15px;
- }
-}
-
-.navbar-toggle {
- position: relative;
- float: right;
- padding: 9px 10px;
- margin-top: 8px;
- margin-right: 15px;
- margin-bottom: 8px;
- background-color: transparent;
- border: 1px solid transparent;
- border-radius: 4px;
-}
-
-.navbar-toggle .icon-bar {
- display: block;
- width: 22px;
- height: 2px;
- border-radius: 1px;
-}
-
-.navbar-toggle .icon-bar + .icon-bar {
- margin-top: 4px;
-}
-
-@media (min-width: 768px) {
- .navbar-toggle {
- display: none;
- }
-}
-
-.navbar-nav {
- margin: 7.5px -15px;
-}
-
-.navbar-nav > li > a {
- padding-top: 10px;
- padding-bottom: 10px;
- line-height: 20px;
-}
-
-@media (max-width: 767px) {
- .navbar-nav .open .dropdown-menu {
- position: static;
- float: none;
- width: auto;
- margin-top: 0;
- background-color: transparent;
- border: 0;
- box-shadow: none;
- }
- .navbar-nav .open .dropdown-menu > li > a,
- .navbar-nav .open .dropdown-menu .dropdown-header {
- padding: 5px 15px 5px 25px;
- }
- .navbar-nav .open .dropdown-menu > li > a {
- line-height: 20px;
- }
- .navbar-nav .open .dropdown-menu > li > a:hover,
- .navbar-nav .open .dropdown-menu > li > a:focus {
- background-image: none;
- }
-}
-
-@media (min-width: 768px) {
- .navbar-nav {
- float: left;
- margin: 0;
- }
- .navbar-nav > li {
- float: left;
- }
- .navbar-nav > li > a {
- padding-top: 15px;
- padding-bottom: 15px;
- }
-}
-
-@media (min-width: 768px) {
- .navbar-left {
- float: left !important;
- }
- .navbar-right {
- float: right !important;
- }
-}
-
-.navbar-form {
- padding: 10px 15px;
- margin-top: 8px;
- margin-right: -15px;
- margin-bottom: 8px;
- margin-left: -15px;
- border-top: 1px solid transparent;
- border-bottom: 1px solid transparent;
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
-}
-
-@media (min-width: 768px) {
- .navbar-form .form-group {
- display: inline-block;
- margin-bottom: 0;
- vertical-align: middle;
- }
- .navbar-form .form-control {
- display: inline-block;
- }
- .navbar-form .radio,
- .navbar-form .checkbox {
- display: inline-block;
- padding-left: 0;
- margin-top: 0;
- margin-bottom: 0;
- }
- .navbar-form .radio input[type="radio"],
- .navbar-form .checkbox input[type="checkbox"] {
- float: none;
- margin-left: 0;
- }
-}
-
-@media (max-width: 767px) {
- .navbar-form .form-group {
- margin-bottom: 5px;
- }
-}
-
-@media (min-width: 768px) {
- .navbar-form {
- width: auto;
- padding-top: 0;
- padding-bottom: 0;
- margin-right: 0;
- margin-left: 0;
- border: 0;
- -webkit-box-shadow: none;
- box-shadow: none;
- }
-}
-
-.navbar-nav > li > .dropdown-menu {
- margin-top: 0;
- border-top-right-radius: 0;
- border-top-left-radius: 0;
-}
-
-.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
- border-bottom-right-radius: 0;
- border-bottom-left-radius: 0;
-}
-
-.navbar-nav.pull-right > li > .dropdown-menu,
-.navbar-nav > li > .dropdown-menu.pull-right {
- right: 0;
- left: auto;
-}
-
-.navbar-btn {
- margin-top: 8px;
- margin-bottom: 8px;
-}
-
-.navbar-text {
- float: left;
- margin-top: 15px;
- margin-bottom: 15px;
-}
-
-@media (min-width: 768px) {
- .navbar-text {
- margin-right: 15px;
- margin-left: 15px;
- }
-}
-
-.navbar-default {
- background-color: #f8f8f8;
- border-color: #e7e7e7;
-}
-
-.navbar-default .navbar-brand {
- color: #777777;
-}
-
-.navbar-default .navbar-brand:hover,
-.navbar-default .navbar-brand:focus {
- color: #5e5e5e;
- background-color: transparent;
-}
-
-.navbar-default .navbar-text {
- color: #777777;
-}
-
-.navbar-default .navbar-nav > li > a {
- color: #777777;
-}
-
-.navbar-default .navbar-nav > li > a:hover,
-.navbar-default .navbar-nav > li > a:focus {
- color: #333333;
- background-color: transparent;
-}
-
-.navbar-default .navbar-nav > .active > a,
-.navbar-default .navbar-nav > .active > a:hover,
-.navbar-default .navbar-nav > .active > a:focus {
- color: #555555;
- background-color: #e7e7e7;
-}
-
-.navbar-default .navbar-nav > .disabled > a,
-.navbar-default .navbar-nav > .disabled > a:hover,
-.navbar-default .navbar-nav > .disabled > a:focus {
- color: #cccccc;
- background-color: transparent;
-}
-
-.navbar-default .navbar-toggle {
- border-color: #dddddd;
-}
-
-.navbar-default .navbar-toggle:hover,
-.navbar-default .navbar-toggle:focus {
- background-color: #dddddd;
-}
-
-.navbar-default .navbar-toggle .icon-bar {
- background-color: #cccccc;
-}
-
-.navbar-default .navbar-collapse,
-.navbar-default .navbar-form {
- border-color: #e6e6e6;
-}
-
-.navbar-default .navbar-nav > .dropdown > a:hover .caret,
-.navbar-default .navbar-nav > .dropdown > a:focus .caret {
- border-top-color: #333333;
- border-bottom-color: #333333;
-}
-
-.navbar-default .navbar-nav > .open > a,
-.navbar-default .navbar-nav > .open > a:hover,
-.navbar-default .navbar-nav > .open > a:focus {
- color: #555555;
- background-color: #e7e7e7;
-}
-
-.navbar-default .navbar-nav > .open > a .caret,
-.navbar-default .navbar-nav > .open > a:hover .caret,
-.navbar-default .navbar-nav > .open > a:focus .caret {
- border-top-color: #555555;
- border-bottom-color: #555555;
-}
-
-.navbar-default .navbar-nav > .dropdown > a .caret {
- border-top-color: #777777;
- border-bottom-color: #777777;
-}
-
-@media (max-width: 767px) {
- .navbar-default .navbar-nav .open .dropdown-menu > li > a {
- color: #777777;
- }
- .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover,
- .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus {
- color: #333333;
- background-color: transparent;
- }
- .navbar-default .navbar-nav .open .dropdown-menu > .active > a,
- .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover,
- .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus {
- color: #555555;
- background-color: #e7e7e7;
- }
- .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a,
- .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover,
- .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus {
- color: #cccccc;
- background-color: transparent;
- }
-}
-
-.navbar-default .navbar-link {
- color: #777777;
-}
-
-.navbar-default .navbar-link:hover {
- color: #333333;
-}
-
-.navbar-inverse {
- background-color: #222222;
- border-color: #080808;
-}
-
-.navbar-inverse .navbar-brand {
- color: #999999;
-}
-
-.navbar-inverse .navbar-brand:hover,
-.navbar-inverse .navbar-brand:focus {
- color: #ffffff;
- background-color: transparent;
-}
-
-.navbar-inverse .navbar-text {
- color: #999999;
-}
-
-.navbar-inverse .navbar-nav > li > a {
- color: #999999;
-}
-
-.navbar-inverse .navbar-nav > li > a:hover,
-.navbar-inverse .navbar-nav > li > a:focus {
- color: #ffffff;
- background-color: transparent;
-}
-
-.navbar-inverse .navbar-nav > .active > a,
-.navbar-inverse .navbar-nav > .active > a:hover,
-.navbar-inverse .navbar-nav > .active > a:focus {
- color: #ffffff;
- background-color: #080808;
-}
-
-.navbar-inverse .navbar-nav > .disabled > a,
-.navbar-inverse .navbar-nav > .disabled > a:hover,
-.navbar-inverse .navbar-nav > .disabled > a:focus {
- color: #444444;
- background-color: transparent;
-}
-
-.navbar-inverse .navbar-toggle {
- border-color: #333333;
-}
-
-.navbar-inverse .navbar-toggle:hover,
-.navbar-inverse .navbar-toggle:focus {
- background-color: #333333;
-}
-
-.navbar-inverse .navbar-toggle .icon-bar {
- background-color: #ffffff;
-}
-
-.navbar-inverse .navbar-collapse,
-.navbar-inverse .navbar-form {
- border-color: #101010;
-}
-
-.navbar-inverse .navbar-nav > .open > a,
-.navbar-inverse .navbar-nav > .open > a:hover,
-.navbar-inverse .navbar-nav > .open > a:focus {
- color: #ffffff;
- background-color: #080808;
-}
-
-.navbar-inverse .navbar-nav > .dropdown > a:hover .caret {
- border-top-color: #ffffff;
- border-bottom-color: #ffffff;
-}
-
-.navbar-inverse .navbar-nav > .dropdown > a .caret {
- border-top-color: #999999;
- border-bottom-color: #999999;
-}
-
-.navbar-inverse .navbar-nav > .open > a .caret,
-.navbar-inverse .navbar-nav > .open > a:hover .caret,
-.navbar-inverse .navbar-nav > .open > a:focus .caret {
- border-top-color: #ffffff;
- border-bottom-color: #ffffff;
-}
-
-@media (max-width: 767px) {
- .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header {
- border-color: #080808;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
- color: #999999;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
- .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
- color: #ffffff;
- background-color: transparent;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
- .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
- .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
- color: #ffffff;
- background-color: #080808;
- }
- .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
- .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
- .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
- color: #444444;
- background-color: transparent;
- }
-}
-
-.navbar-inverse .navbar-link {
- color: #999999;
-}
-
-.navbar-inverse .navbar-link:hover {
- color: #ffffff;
-}
-
-.breadcrumb {
- padding: 8px 15px;
- margin-bottom: 20px;
- list-style: none;
- background-color: #f5f5f5;
- border-radius: 4px;
-}
-
-.breadcrumb > li {
- display: inline-block;
-}
-
-.breadcrumb > li + li:before {
- padding: 0 5px;
- color: #cccccc;
- content: "/\00a0";
-}
-
-.breadcrumb > .active {
- color: #999999;
-}
-
-.pagination {
- display: inline-block;
- padding-left: 0;
- margin: 20px 0;
- border-radius: 4px;
-}
-
-.pagination > li {
- display: inline;
-}
-
-.pagination > li > a,
-.pagination > li > span {
- position: relative;
- float: left;
- padding: 6px 12px;
- margin-left: -1px;
- line-height: 1.428571429;
- text-decoration: none;
- background-color: #ffffff;
- border: 1px solid #dddddd;
-}
-
-.pagination > li:first-child > a,
-.pagination > li:first-child > span {
- margin-left: 0;
- border-bottom-left-radius: 4px;
- border-top-left-radius: 4px;
-}
-
-.pagination > li:last-child > a,
-.pagination > li:last-child > span {
- border-top-right-radius: 4px;
- border-bottom-right-radius: 4px;
-}
-
-.pagination > li > a:hover,
-.pagination > li > span:hover,
-.pagination > li > a:focus,
-.pagination > li > span:focus {
- background-color: #eeeeee;
-}
-
-.pagination > .active > a,
-.pagination > .active > span,
-.pagination > .active > a:hover,
-.pagination > .active > span:hover,
-.pagination > .active > a:focus,
-.pagination > .active > span:focus {
- z-index: 2;
- color: #ffffff;
- cursor: default;
- background-color: #428bca;
- border-color: #428bca;
-}
-
-.pagination > .disabled > span,
-.pagination > .disabled > a,
-.pagination > .disabled > a:hover,
-.pagination > .disabled > a:focus {
- color: #999999;
- cursor: not-allowed;
- background-color: #ffffff;
- border-color: #dddddd;
-}
-
-.pagination-lg > li > a,
-.pagination-lg > li > span {
- padding: 10px 16px;
- font-size: 18px;
-}
-
-.pagination-lg > li:first-child > a,
-.pagination-lg > li:first-child > span {
- border-bottom-left-radius: 6px;
- border-top-left-radius: 6px;
-}
-
-.pagination-lg > li:last-child > a,
-.pagination-lg > li:last-child > span {
- border-top-right-radius: 6px;
- border-bottom-right-radius: 6px;
-}
-
-.pagination-sm > li > a,
-.pagination-sm > li > span {
- padding: 5px 10px;
- font-size: 12px;
-}
-
-.pagination-sm > li:first-child > a,
-.pagination-sm > li:first-child > span {
- border-bottom-left-radius: 3px;
- border-top-left-radius: 3px;
-}
-
-.pagination-sm > li:last-child > a,
-.pagination-sm > li:last-child > span {
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-.pager {
- padding-left: 0;
- margin: 20px 0;
- text-align: center;
- list-style: none;
-}
-
-.pager:before,
-.pager:after {
- display: table;
- content: " ";
-}
-
-.pager:after {
- clear: both;
-}
-
-.pager:before,
-.pager:after {
- display: table;
- content: " ";
-}
-
-.pager:after {
- clear: both;
-}
-
-.pager li {
- display: inline;
-}
-
-.pager li > a,
-.pager li > span {
- display: inline-block;
- padding: 5px 14px;
- background-color: #ffffff;
- border: 1px solid #dddddd;
- border-radius: 15px;
-}
-
-.pager li > a:hover,
-.pager li > a:focus {
- text-decoration: none;
- background-color: #eeeeee;
-}
-
-.pager .next > a,
-.pager .next > span {
- float: right;
-}
-
-.pager .previous > a,
-.pager .previous > span {
- float: left;
-}
-
-.pager .disabled > a,
-.pager .disabled > a:hover,
-.pager .disabled > a:focus,
-.pager .disabled > span {
- color: #999999;
- cursor: not-allowed;
- background-color: #ffffff;
-}
-
-.label {
- display: inline;
- padding: .2em .6em .3em;
- font-size: 75%;
- font-weight: bold;
- line-height: 1;
- color: #ffffff;
- text-align: center;
- white-space: nowrap;
- vertical-align: baseline;
- border-radius: .25em;
-}
-
-.label[href]:hover,
-.label[href]:focus {
- color: #ffffff;
- text-decoration: none;
- cursor: pointer;
-}
-
-.label:empty {
- display: none;
-}
-
-.label-default {
- background-color: #999999;
-}
-
-.label-default[href]:hover,
-.label-default[href]:focus {
- background-color: #808080;
-}
-
-.label-primary {
- background-color: #428bca;
-}
-
-.label-primary[href]:hover,
-.label-primary[href]:focus {
- background-color: #3071a9;
-}
-
-.label-success {
- background-color: #5cb85c;
-}
-
-.label-success[href]:hover,
-.label-success[href]:focus {
- background-color: #449d44;
-}
-
-.label-info {
- background-color: #5bc0de;
-}
-
-.label-info[href]:hover,
-.label-info[href]:focus {
- background-color: #31b0d5;
-}
-
-.label-warning {
- background-color: #f0ad4e;
-}
-
-.label-warning[href]:hover,
-.label-warning[href]:focus {
- background-color: #ec971f;
-}
-
-.label-danger {
- background-color: #d9534f;
-}
-
-.label-danger[href]:hover,
-.label-danger[href]:focus {
- background-color: #c9302c;
-}
-
-.badge {
- display: inline-block;
- min-width: 10px;
- padding: 3px 7px;
- font-size: 12px;
- font-weight: bold;
- line-height: 1;
- color: #ffffff;
- text-align: center;
- white-space: nowrap;
- vertical-align: baseline;
- background-color: #999999;
- border-radius: 10px;
-}
-
-.badge:empty {
- display: none;
-}
-
-a.badge:hover,
-a.badge:focus {
- color: #ffffff;
- text-decoration: none;
- cursor: pointer;
-}
-
-.btn .badge {
- position: relative;
- top: -1px;
-}
-
-a.list-group-item.active > .badge,
-.nav-pills > .active > a > .badge {
- color: #428bca;
- background-color: #ffffff;
-}
-
-.nav-pills > li > a > .badge {
- margin-left: 3px;
-}
-
-.jumbotron {
- padding: 30px;
- margin-bottom: 30px;
- font-size: 21px;
- font-weight: 200;
- line-height: 2.1428571435;
- color: inherit;
- background-color: #eeeeee;
-}
-
-.jumbotron h1 {
- line-height: 1;
- color: inherit;
-}
-
-.jumbotron p {
- line-height: 1.4;
-}
-
-.container .jumbotron {
- border-radius: 6px;
-}
-
-@media screen and (min-width: 768px) {
- .jumbotron {
- padding-top: 48px;
- padding-bottom: 48px;
- }
- .container .jumbotron {
- padding-right: 60px;
- padding-left: 60px;
- }
- .jumbotron h1 {
- font-size: 63px;
- }
-}
-
-.thumbnail {
- display: inline-block;
- display: block;
- height: auto;
- max-width: 100%;
- padding: 4px;
- line-height: 1.428571429;
- background-color: #ffffff;
- border: 1px solid #dddddd;
- border-radius: 4px;
- -webkit-transition: all 0.2s ease-in-out;
- transition: all 0.2s ease-in-out;
-}
-
-.thumbnail > img {
- display: block;
- height: auto;
- max-width: 100%;
-}
-
-a.thumbnail:hover,
-a.thumbnail:focus {
- border-color: #428bca;
-}
-
-.thumbnail > img {
- margin-right: auto;
- margin-left: auto;
-}
-
-.thumbnail .caption {
- padding: 9px;
- color: #333333;
-}
-
-.alert {
- padding: 15px;
- margin-bottom: 20px;
- border: 1px solid transparent;
- border-radius: 4px;
-}
-
-.alert h4 {
- margin-top: 0;
- color: inherit;
-}
-
-.alert .alert-link {
- font-weight: bold;
-}
-
-.alert > p,
-.alert > ul {
- margin-bottom: 0;
-}
-
-.alert > p + p {
- margin-top: 5px;
-}
-
-.alert-dismissable {
- padding-right: 35px;
-}
-
-.alert-dismissable .close {
- position: relative;
- top: -2px;
- right: -21px;
- color: inherit;
-}
-
-.alert-success {
- color: #468847;
- background-color: #dff0d8;
- border-color: #d6e9c6;
-}
-
-.alert-success hr {
- border-top-color: #c9e2b3;
-}
-
-.alert-success .alert-link {
- color: #356635;
-}
-
-.alert-info {
- color: #3a87ad;
- background-color: #d9edf7;
- border-color: #bce8f1;
-}
-
-.alert-info hr {
- border-top-color: #a6e1ec;
-}
-
-.alert-info .alert-link {
- color: #2d6987;
-}
-
-.alert-warning {
- color: #c09853;
- background-color: #fcf8e3;
- border-color: #fbeed5;
-}
-
-.alert-warning hr {
- border-top-color: #f8e5be;
-}
-
-.alert-warning .alert-link {
- color: #a47e3c;
-}
-
-.alert-danger {
- color: #b94a48;
- background-color: #f2dede;
- border-color: #eed3d7;
-}
-
-.alert-danger hr {
- border-top-color: #e6c1c7;
-}
-
-.alert-danger .alert-link {
- color: #953b39;
-}
-
-@-webkit-keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-
-@-moz-keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-
-@-o-keyframes progress-bar-stripes {
- from {
- background-position: 0 0;
- }
- to {
- background-position: 40px 0;
- }
-}
-
-@keyframes progress-bar-stripes {
- from {
- background-position: 40px 0;
- }
- to {
- background-position: 0 0;
- }
-}
-
-.progress {
- height: 20px;
- margin-bottom: 20px;
- overflow: hidden;
- background-color: #f5f5f5;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
-}
-
-.progress-bar {
- float: left;
- width: 0;
- height: 100%;
- font-size: 12px;
- color: #ffffff;
- text-align: center;
- background-color: #428bca;
- -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- -webkit-transition: width 0.6s ease;
- transition: width 0.6s ease;
-}
-
-.progress-striped .progress-bar {
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-size: 40px 40px;
-}
-
-.progress.active .progress-bar {
- -webkit-animation: progress-bar-stripes 2s linear infinite;
- -moz-animation: progress-bar-stripes 2s linear infinite;
- -ms-animation: progress-bar-stripes 2s linear infinite;
- -o-animation: progress-bar-stripes 2s linear infinite;
- animation: progress-bar-stripes 2s linear infinite;
-}
-
-.progress-bar-success {
- background-color: #5cb85c;
-}
-
-.progress-striped .progress-bar-success {
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.progress-bar-info {
- background-color: #5bc0de;
-}
-
-.progress-striped .progress-bar-info {
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.progress-bar-warning {
- background-color: #f0ad4e;
-}
-
-.progress-striped .progress-bar-warning {
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.progress-bar-danger {
- background-color: #d9534f;
-}
-
-.progress-striped .progress-bar-danger {
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.media,
-.media-body {
- overflow: hidden;
- zoom: 1;
-}
-
-.media,
-.media .media {
- margin-top: 15px;
-}
-
-.media:first-child {
- margin-top: 0;
-}
-
-.media-object {
- display: block;
-}
-
-.media-heading {
- margin: 0 0 5px;
-}
-
-.media > .pull-left {
- margin-right: 10px;
-}
-
-.media > .pull-right {
- margin-left: 10px;
-}
-
-.media-list {
- padding-left: 0;
- list-style: none;
-}
-
-.list-group {
- padding-left: 0;
- margin-bottom: 20px;
-}
-
-.list-group-item {
- position: relative;
- display: block;
- padding: 10px 15px;
- margin-bottom: -1px;
- background-color: #ffffff;
- border: 1px solid #dddddd;
-}
-
-.list-group-item:first-child {
- border-top-right-radius: 4px;
- border-top-left-radius: 4px;
-}
-
-.list-group-item:last-child {
- margin-bottom: 0;
- border-bottom-right-radius: 4px;
- border-bottom-left-radius: 4px;
-}
-
-.list-group-item > .badge {
- float: right;
-}
-
-.list-group-item > .badge + .badge {
- margin-right: 5px;
-}
-
-a.list-group-item {
- color: #555555;
-}
-
-a.list-group-item .list-group-item-heading {
- color: #333333;
-}
-
-a.list-group-item:hover,
-a.list-group-item:focus {
- text-decoration: none;
- background-color: #f5f5f5;
-}
-
-.list-group-item.active,
-.list-group-item.active:hover,
-.list-group-item.active:focus {
- z-index: 2;
- color: #ffffff;
- background-color: #428bca;
- border-color: #428bca;
-}
-
-.list-group-item.active .list-group-item-heading,
-.list-group-item.active:hover .list-group-item-heading,
-.list-group-item.active:focus .list-group-item-heading {
- color: inherit;
-}
-
-.list-group-item.active .list-group-item-text,
-.list-group-item.active:hover .list-group-item-text,
-.list-group-item.active:focus .list-group-item-text {
- color: #e1edf7;
-}
-
-.list-group-item-heading {
- margin-top: 0;
- margin-bottom: 5px;
-}
-
-.list-group-item-text {
- margin-bottom: 0;
- line-height: 1.3;
-}
-
-.panel {
- margin-bottom: 20px;
- background-color: #ffffff;
- border: 1px solid transparent;
- border-radius: 4px;
- -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
-}
-
-.panel-body {
- padding: 15px;
-}
-
-.panel-body:before,
-.panel-body:after {
- display: table;
- content: " ";
-}
-
-.panel-body:after {
- clear: both;
-}
-
-.panel-body:before,
-.panel-body:after {
- display: table;
- content: " ";
-}
-
-.panel-body:after {
- clear: both;
-}
-
-.panel > .list-group {
- margin-bottom: 0;
-}
-
-.panel > .list-group .list-group-item {
- border-width: 1px 0;
-}
-
-.panel > .list-group .list-group-item:first-child {
- border-top-right-radius: 0;
- border-top-left-radius: 0;
-}
-
-.panel > .list-group .list-group-item:last-child {
- border-bottom: 0;
-}
-
-.panel-heading + .list-group .list-group-item:first-child {
- border-top-width: 0;
-}
-
-.panel > .table {
- margin-bottom: 0;
-}
-
-.panel > .panel-body + .table {
- border-top: 1px solid #dddddd;
-}
-
-.panel-heading {
- padding: 10px 15px;
- border-bottom: 1px solid transparent;
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
-}
-
-.panel-title {
- margin-top: 0;
- margin-bottom: 0;
- font-size: 16px;
-}
-
-.panel-title > a {
- color: inherit;
-}
-
-.panel-footer {
- padding: 10px 15px;
- background-color: #f5f5f5;
- border-top: 1px solid #dddddd;
- border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
-}
-
-.panel-group .panel {
- margin-bottom: 0;
- overflow: hidden;
- border-radius: 4px;
-}
-
-.panel-group .panel + .panel {
- margin-top: 5px;
-}
-
-.panel-group .panel-heading {
- border-bottom: 0;
-}
-
-.panel-group .panel-heading + .panel-collapse .panel-body {
- border-top: 1px solid #dddddd;
-}
-
-.panel-group .panel-footer {
- border-top: 0;
-}
-
-.panel-group .panel-footer + .panel-collapse .panel-body {
- border-bottom: 1px solid #dddddd;
-}
-
-.panel-default {
- border-color: #dddddd;
-}
-
-.panel-default > .panel-heading {
- color: #333333;
- background-color: #f5f5f5;
- border-color: #dddddd;
-}
-
-.panel-default > .panel-heading + .panel-collapse .panel-body {
- border-top-color: #dddddd;
-}
-
-.panel-default > .panel-footer + .panel-collapse .panel-body {
- border-bottom-color: #dddddd;
-}
-
-.panel-primary {
- border-color: #428bca;
-}
-
-.panel-primary > .panel-heading {
- color: #ffffff;
- background-color: #428bca;
- border-color: #428bca;
-}
-
-.panel-primary > .panel-heading + .panel-collapse .panel-body {
- border-top-color: #428bca;
-}
-
-.panel-primary > .panel-footer + .panel-collapse .panel-body {
- border-bottom-color: #428bca;
-}
-
-.panel-success {
- border-color: #d6e9c6;
-}
-
-.panel-success > .panel-heading {
- color: #468847;
- background-color: #dff0d8;
- border-color: #d6e9c6;
-}
-
-.panel-success > .panel-heading + .panel-collapse .panel-body {
- border-top-color: #d6e9c6;
-}
-
-.panel-success > .panel-footer + .panel-collapse .panel-body {
- border-bottom-color: #d6e9c6;
-}
-
-.panel-warning {
- border-color: #fbeed5;
-}
-
-.panel-warning > .panel-heading {
- color: #c09853;
- background-color: #fcf8e3;
- border-color: #fbeed5;
-}
-
-.panel-warning > .panel-heading + .panel-collapse .panel-body {
- border-top-color: #fbeed5;
-}
-
-.panel-warning > .panel-footer + .panel-collapse .panel-body {
- border-bottom-color: #fbeed5;
-}
-
-.panel-danger {
- border-color: #eed3d7;
-}
-
-.panel-danger > .panel-heading {
- color: #b94a48;
- background-color: #f2dede;
- border-color: #eed3d7;
-}
-
-.panel-danger > .panel-heading + .panel-collapse .panel-body {
- border-top-color: #eed3d7;
-}
-
-.panel-danger > .panel-footer + .panel-collapse .panel-body {
- border-bottom-color: #eed3d7;
-}
-
-.panel-info {
- border-color: #bce8f1;
-}
-
-.panel-info > .panel-heading {
- color: #3a87ad;
- background-color: #d9edf7;
- border-color: #bce8f1;
-}
-
-.panel-info > .panel-heading + .panel-collapse .panel-body {
- border-top-color: #bce8f1;
-}
-
-.panel-info > .panel-footer + .panel-collapse .panel-body {
- border-bottom-color: #bce8f1;
-}
-
-.well {
- min-height: 20px;
- padding: 19px;
- margin-bottom: 20px;
- background-color: #f5f5f5;
- border: 1px solid #e3e3e3;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-}
-
-.well blockquote {
- border-color: #ddd;
- border-color: rgba(0, 0, 0, 0.15);
-}
-
-.well-lg {
- padding: 24px;
- border-radius: 6px;
-}
-
-.well-sm {
- padding: 9px;
- border-radius: 3px;
-}
-
-.close {
- float: right;
- font-size: 21px;
- font-weight: bold;
- line-height: 1;
- color: #000000;
- text-shadow: 0 1px 0 #ffffff;
- opacity: 0.2;
- filter: alpha(opacity=20);
-}
-
-.close:hover,
-.close:focus {
- color: #000000;
- text-decoration: none;
- cursor: pointer;
- opacity: 0.5;
- filter: alpha(opacity=50);
-}
-
-button.close {
- padding: 0;
- cursor: pointer;
- background: transparent;
- border: 0;
- -webkit-appearance: none;
-}
-
-.modal-open {
- overflow: hidden;
-}
-
-body.modal-open,
-.modal-open .navbar-fixed-top,
-.modal-open .navbar-fixed-bottom {
- margin-right: 15px;
-}
-
-.modal {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- z-index: 1040;
- display: none;
- overflow: auto;
- overflow-y: scroll;
-}
-
-.modal.fade .modal-dialog {
- -webkit-transform: translate(0, -25%);
- -ms-transform: translate(0, -25%);
- transform: translate(0, -25%);
- -webkit-transition: -webkit-transform 0.3s ease-out;
- -moz-transition: -moz-transform 0.3s ease-out;
- -o-transition: -o-transform 0.3s ease-out;
- transition: transform 0.3s ease-out;
-}
-
-.modal.in .modal-dialog {
- -webkit-transform: translate(0, 0);
- -ms-transform: translate(0, 0);
- transform: translate(0, 0);
-}
-
-.modal-dialog {
- z-index: 1050;
- width: auto;
- padding: 10px;
- margin-right: auto;
- margin-left: auto;
-}
-
-.modal-content {
- position: relative;
- background-color: #ffffff;
- border: 1px solid #999999;
- border: 1px solid rgba(0, 0, 0, 0.2);
- border-radius: 6px;
- outline: none;
- -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
- box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5);
- background-clip: padding-box;
-}
-
-.modal-backdrop {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- z-index: 1030;
- background-color: #000000;
-}
-
-.modal-backdrop.fade {
- opacity: 0;
- filter: alpha(opacity=0);
-}
-
-.modal-backdrop.in {
- opacity: 0.5;
- filter: alpha(opacity=50);
-}
-
-.modal-header {
- min-height: 16.428571429px;
- padding: 15px;
- border-bottom: 1px solid #e5e5e5;
-}
-
-.modal-header .close {
- margin-top: -2px;
-}
-
-.modal-title {
- margin: 0;
- line-height: 1.428571429;
-}
-
-.modal-body {
- position: relative;
- padding: 20px;
-}
-
-.modal-footer {
- padding: 19px 20px 20px;
- margin-top: 15px;
- text-align: right;
- border-top: 1px solid #e5e5e5;
-}
-
-.modal-footer:before,
-.modal-footer:after {
- display: table;
- content: " ";
-}
-
-.modal-footer:after {
- clear: both;
-}
-
-.modal-footer:before,
-.modal-footer:after {
- display: table;
- content: " ";
-}
-
-.modal-footer:after {
- clear: both;
-}
-
-.modal-footer .btn + .btn {
- margin-bottom: 0;
- margin-left: 5px;
-}
-
-.modal-footer .btn-group .btn + .btn {
- margin-left: -1px;
-}
-
-.modal-footer .btn-block + .btn-block {
- margin-left: 0;
-}
-
-@media screen and (min-width: 768px) {
- .modal-dialog {
- right: auto;
- left: 50%;
- width: 600px;
- padding-top: 30px;
- padding-bottom: 30px;
- }
- .modal-content {
- -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
- box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
- }
-}
-
-.tooltip {
- position: absolute;
- z-index: 1030;
- display: block;
- font-size: 12px;
- line-height: 1.4;
- opacity: 0;
- filter: alpha(opacity=0);
- visibility: visible;
-}
-
-.tooltip.in {
- opacity: 0.9;
- filter: alpha(opacity=90);
-}
-
-.tooltip.top {
- padding: 5px 0;
- margin-top: -3px;
-}
-
-.tooltip.right {
- padding: 0 5px;
- margin-left: 3px;
-}
-
-.tooltip.bottom {
- padding: 5px 0;
- margin-top: 3px;
-}
-
-.tooltip.left {
- padding: 0 5px;
- margin-left: -3px;
-}
-
-.tooltip-inner {
- max-width: 200px;
- padding: 3px 8px;
- color: #ffffff;
- text-align: center;
- text-decoration: none;
- background-color: #000000;
- border-radius: 4px;
-}
-
-.tooltip-arrow {
- position: absolute;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
-}
-
-.tooltip.top .tooltip-arrow {
- bottom: 0;
- left: 50%;
- margin-left: -5px;
- border-top-color: #000000;
- border-width: 5px 5px 0;
-}
-
-.tooltip.top-left .tooltip-arrow {
- bottom: 0;
- left: 5px;
- border-top-color: #000000;
- border-width: 5px 5px 0;
-}
-
-.tooltip.top-right .tooltip-arrow {
- right: 5px;
- bottom: 0;
- border-top-color: #000000;
- border-width: 5px 5px 0;
-}
-
-.tooltip.right .tooltip-arrow {
- top: 50%;
- left: 0;
- margin-top: -5px;
- border-right-color: #000000;
- border-width: 5px 5px 5px 0;
-}
-
-.tooltip.left .tooltip-arrow {
- top: 50%;
- right: 0;
- margin-top: -5px;
- border-left-color: #000000;
- border-width: 5px 0 5px 5px;
-}
-
-.tooltip.bottom .tooltip-arrow {
- top: 0;
- left: 50%;
- margin-left: -5px;
- border-bottom-color: #000000;
- border-width: 0 5px 5px;
-}
-
-.tooltip.bottom-left .tooltip-arrow {
- top: 0;
- left: 5px;
- border-bottom-color: #000000;
- border-width: 0 5px 5px;
-}
-
-.tooltip.bottom-right .tooltip-arrow {
- top: 0;
- right: 5px;
- border-bottom-color: #000000;
- border-width: 0 5px 5px;
-}
-
-.popover {
- position: absolute;
- top: 0;
- left: 0;
- z-index: 1010;
- display: none;
- max-width: 276px;
- padding: 1px;
- text-align: left;
- white-space: normal;
- background-color: #ffffff;
- border: 1px solid #cccccc;
- border: 1px solid rgba(0, 0, 0, 0.2);
- border-radius: 6px;
- -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- background-clip: padding-box;
-}
-
-.popover.top {
- margin-top: -10px;
-}
-
-.popover.right {
- margin-left: 10px;
-}
-
-.popover.bottom {
- margin-top: 10px;
-}
-
-.popover.left {
- margin-left: -10px;
-}
-
-.popover-title {
- padding: 8px 14px;
- margin: 0;
- font-size: 14px;
- font-weight: normal;
- line-height: 18px;
- background-color: #f7f7f7;
- border-bottom: 1px solid #ebebeb;
- border-radius: 5px 5px 0 0;
-}
-
-.popover-content {
- padding: 9px 14px;
-}
-
-.popover .arrow,
-.popover .arrow:after {
- position: absolute;
- display: block;
- width: 0;
- height: 0;
- border-color: transparent;
- border-style: solid;
-}
-
-.popover .arrow {
- border-width: 11px;
-}
-
-.popover .arrow:after {
- border-width: 10px;
- content: "";
-}
-
-.popover.top .arrow {
- bottom: -11px;
- left: 50%;
- margin-left: -11px;
- border-top-color: #999999;
- border-top-color: rgba(0, 0, 0, 0.25);
- border-bottom-width: 0;
-}
-
-.popover.top .arrow:after {
- bottom: 1px;
- margin-left: -10px;
- border-top-color: #ffffff;
- border-bottom-width: 0;
- content: " ";
-}
-
-.popover.right .arrow {
- top: 50%;
- left: -11px;
- margin-top: -11px;
- border-right-color: #999999;
- border-right-color: rgba(0, 0, 0, 0.25);
- border-left-width: 0;
-}
-
-.popover.right .arrow:after {
- bottom: -10px;
- left: 1px;
- border-right-color: #ffffff;
- border-left-width: 0;
- content: " ";
-}
-
-.popover.bottom .arrow {
- top: -11px;
- left: 50%;
- margin-left: -11px;
- border-bottom-color: #999999;
- border-bottom-color: rgba(0, 0, 0, 0.25);
- border-top-width: 0;
-}
-
-.popover.bottom .arrow:after {
- top: 1px;
- margin-left: -10px;
- border-bottom-color: #ffffff;
- border-top-width: 0;
- content: " ";
-}
-
-.popover.left .arrow {
- top: 50%;
- right: -11px;
- margin-top: -11px;
- border-left-color: #999999;
- border-left-color: rgba(0, 0, 0, 0.25);
- border-right-width: 0;
-}
-
-.popover.left .arrow:after {
- right: 1px;
- bottom: -10px;
- border-left-color: #ffffff;
- border-right-width: 0;
- content: " ";
-}
-
-.carousel {
- position: relative;
-}
-
-.carousel-inner {
- position: relative;
- width: 100%;
- overflow: hidden;
-}
-
-.carousel-inner > .item {
- position: relative;
- display: none;
- -webkit-transition: 0.6s ease-in-out left;
- transition: 0.6s ease-in-out left;
-}
-
-.carousel-inner > .item > img,
-.carousel-inner > .item > a > img {
- display: block;
- height: auto;
- max-width: 100%;
- line-height: 1;
-}
-
-.carousel-inner > .active,
-.carousel-inner > .next,
-.carousel-inner > .prev {
- display: block;
-}
-
-.carousel-inner > .active {
- left: 0;
-}
-
-.carousel-inner > .next,
-.carousel-inner > .prev {
- position: absolute;
- top: 0;
- width: 100%;
-}
-
-.carousel-inner > .next {
- left: 100%;
-}
-
-.carousel-inner > .prev {
- left: -100%;
-}
-
-.carousel-inner > .next.left,
-.carousel-inner > .prev.right {
- left: 0;
-}
-
-.carousel-inner > .active.left {
- left: -100%;
-}
-
-.carousel-inner > .active.right {
- left: 100%;
-}
-
-.carousel-control {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- width: 15%;
- font-size: 20px;
- color: #ffffff;
- text-align: center;
- text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
- opacity: 0.5;
- filter: alpha(opacity=50);
-}
-
-.carousel-control.left {
- background-image: -webkit-gradient(linear, 0 top, 100% top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001)));
- background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.5) 0), color-stop(rgba(0, 0, 0, 0.0001) 100%));
- background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%);
- background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);
-}
-
-.carousel-control.right {
- right: 0;
- left: auto;
- background-image: -webkit-gradient(linear, 0 top, 100% top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5)));
- background-image: -webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, 0.0001) 0), color-stop(rgba(0, 0, 0, 0.5) 100%));
- background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%);
- background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);
-}
-
-.carousel-control:hover,
-.carousel-control:focus {
- color: #ffffff;
- text-decoration: none;
- opacity: 0.9;
- filter: alpha(opacity=90);
-}
-
-.carousel-control .icon-prev,
-.carousel-control .icon-next,
-.carousel-control .glyphicon-chevron-left,
-.carousel-control .glyphicon-chevron-right {
- position: absolute;
- top: 50%;
- left: 50%;
- z-index: 5;
- display: inline-block;
-}
-
-.carousel-control .icon-prev,
-.carousel-control .icon-next {
- width: 20px;
- height: 20px;
- margin-top: -10px;
- margin-left: -10px;
- font-family: serif;
-}
-
-.carousel-control .icon-prev:before {
- content: '\2039';
-}
-
-.carousel-control .icon-next:before {
- content: '\203a';
-}
-
-.carousel-indicators {
- position: absolute;
- bottom: 10px;
- left: 50%;
- z-index: 15;
- width: 60%;
- padding-left: 0;
- margin-left: -30%;
- text-align: center;
- list-style: none;
-}
-
-.carousel-indicators li {
- display: inline-block;
- width: 10px;
- height: 10px;
- margin: 1px;
- text-indent: -999px;
- cursor: pointer;
- border: 1px solid #ffffff;
- border-radius: 10px;
-}
-
-.carousel-indicators .active {
- width: 12px;
- height: 12px;
- margin: 0;
- background-color: #ffffff;
-}
-
-.carousel-caption {
- position: absolute;
- right: 15%;
- bottom: 20px;
- left: 15%;
- z-index: 10;
- padding-top: 20px;
- padding-bottom: 20px;
- color: #ffffff;
- text-align: center;
- text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
-}
-
-.carousel-caption .btn {
- text-shadow: none;
-}
-
-@media screen and (min-width: 768px) {
- .carousel-control .icon-prev,
- .carousel-control .icon-next {
- width: 30px;
- height: 30px;
- margin-top: -15px;
- margin-left: -15px;
- font-size: 30px;
- }
- .carousel-caption {
- right: 20%;
- left: 20%;
- padding-bottom: 30px;
- }
- .carousel-indicators {
- bottom: 20px;
- }
-}
-
-.clearfix:before,
-.clearfix:after {
- display: table;
- content: " ";
-}
-
-.clearfix:after {
- clear: both;
-}
-
-.pull-right {
- float: right !important;
-}
-
-.pull-left {
- float: left !important;
-}
-
-.hide {
- display: none !important;
-}
-
-.show {
- display: block !important;
-}
-
-.invisible {
- visibility: hidden;
-}
-
-.text-hide {
- font: 0/0 a;
- color: transparent;
- text-shadow: none;
- background-color: transparent;
- border: 0;
-}
-
-.affix {
- position: fixed;
-}
-
-@-ms-viewport {
- width: device-width;
-}
-
-@media screen and (max-width: 400px) {
- @-ms-viewport {
- width: 320px;
- }
-}
-
-.hidden {
- display: none !important;
- visibility: hidden !important;
-}
-
-.visible-xs {
- display: none !important;
-}
-
-tr.visible-xs {
- display: none !important;
-}
-
-th.visible-xs,
-td.visible-xs {
- display: none !important;
-}
-
-@media (max-width: 767px) {
- .visible-xs {
- display: block !important;
- }
- tr.visible-xs {
- display: table-row !important;
- }
- th.visible-xs,
- td.visible-xs {
- display: table-cell !important;
- }
-}
-
-@media (min-width: 768px) and (max-width: 991px) {
- .visible-xs.visible-sm {
- display: block !important;
- }
- tr.visible-xs.visible-sm {
- display: table-row !important;
- }
- th.visible-xs.visible-sm,
- td.visible-xs.visible-sm {
- display: table-cell !important;
- }
-}
-
-@media (min-width: 992px) and (max-width: 1199px) {
- .visible-xs.visible-md {
- display: block !important;
- }
- tr.visible-xs.visible-md {
- display: table-row !important;
- }
- th.visible-xs.visible-md,
- td.visible-xs.visible-md {
- display: table-cell !important;
- }
-}
-
-@media (min-width: 1200px) {
- .visible-xs.visible-lg {
- display: block !important;
- }
- tr.visible-xs.visible-lg {
- display: table-row !important;
- }
- th.visible-xs.visible-lg,
- td.visible-xs.visible-lg {
- display: table-cell !important;
- }
-}
-
-.visible-sm {
- display: none !important;
-}
-
-tr.visible-sm {
- display: none !important;
-}
-
-th.visible-sm,
-td.visible-sm {
- display: none !important;
-}
-
-@media (max-width: 767px) {
- .visible-sm.visible-xs {
- display: block !important;
- }
- tr.visible-sm.visible-xs {
- display: table-row !important;
- }
- th.visible-sm.visible-xs,
- td.visible-sm.visible-xs {
- display: table-cell !important;
- }
-}
-
-@media (min-width: 768px) and (max-width: 991px) {
- .visible-sm {
- display: block !important;
- }
- tr.visible-sm {
- display: table-row !important;
- }
- th.visible-sm,
- td.visible-sm {
- display: table-cell !important;
- }
-}
-
-@media (min-width: 992px) and (max-width: 1199px) {
- .visible-sm.visible-md {
- display: block !important;
- }
- tr.visible-sm.visible-md {
- display: table-row !important;
- }
- th.visible-sm.visible-md,
- td.visible-sm.visible-md {
- display: table-cell !important;
- }
-}
-
-@media (min-width: 1200px) {
- .visible-sm.visible-lg {
- display: block !important;
- }
- tr.visible-sm.visible-lg {
- display: table-row !important;
- }
- th.visible-sm.visible-lg,
- td.visible-sm.visible-lg {
- display: table-cell !important;
- }
-}
-
-.visible-md {
- display: none !important;
-}
-
-tr.visible-md {
- display: none !important;
-}
-
-th.visible-md,
-td.visible-md {
- display: none !important;
-}
-
-@media (max-width: 767px) {
- .visible-md.visible-xs {
- display: block !important;
- }
- tr.visible-md.visible-xs {
- display: table-row !important;
- }
- th.visible-md.visible-xs,
- td.visible-md.visible-xs {
- display: table-cell !important;
- }
-}
-
-@media (min-width: 768px) and (max-width: 991px) {
- .visible-md.visible-sm {
- display: block !important;
- }
- tr.visible-md.visible-sm {
- display: table-row !important;
- }
- th.visible-md.visible-sm,
- td.visible-md.visible-sm {
- display: table-cell !important;
- }
-}
-
-@media (min-width: 992px) and (max-width: 1199px) {
- .visible-md {
- display: block !important;
- }
- tr.visible-md {
- display: table-row !important;
- }
- th.visible-md,
- td.visible-md {
- display: table-cell !important;
- }
-}
-
-@media (min-width: 1200px) {
- .visible-md.visible-lg {
- display: block !important;
- }
- tr.visible-md.visible-lg {
- display: table-row !important;
- }
- th.visible-md.visible-lg,
- td.visible-md.visible-lg {
- display: table-cell !important;
- }
-}
-
-.visible-lg {
- display: none !important;
-}
-
-tr.visible-lg {
- display: none !important;
-}
-
-th.visible-lg,
-td.visible-lg {
- display: none !important;
-}
-
-@media (max-width: 767px) {
- .visible-lg.visible-xs {
- display: block !important;
- }
- tr.visible-lg.visible-xs {
- display: table-row !important;
- }
- th.visible-lg.visible-xs,
- td.visible-lg.visible-xs {
- display: table-cell !important;
- }
-}
-
-@media (min-width: 768px) and (max-width: 991px) {
- .visible-lg.visible-sm {
- display: block !important;
- }
- tr.visible-lg.visible-sm {
- display: table-row !important;
- }
- th.visible-lg.visible-sm,
- td.visible-lg.visible-sm {
- display: table-cell !important;
- }
-}
-
-@media (min-width: 992px) and (max-width: 1199px) {
- .visible-lg.visible-md {
- display: block !important;
- }
- tr.visible-lg.visible-md {
- display: table-row !important;
- }
- th.visible-lg.visible-md,
- td.visible-lg.visible-md {
- display: table-cell !important;
- }
-}
-
-@media (min-width: 1200px) {
- .visible-lg {
- display: block !important;
- }
- tr.visible-lg {
- display: table-row !important;
- }
- th.visible-lg,
- td.visible-lg {
- display: table-cell !important;
- }
-}
-
-.hidden-xs {
- display: block !important;
-}
-
-tr.hidden-xs {
- display: table-row !important;
-}
-
-th.hidden-xs,
-td.hidden-xs {
- display: table-cell !important;
-}
-
-@media (max-width: 767px) {
- .hidden-xs {
- display: none !important;
- }
- tr.hidden-xs {
- display: none !important;
- }
- th.hidden-xs,
- td.hidden-xs {
- display: none !important;
- }
-}
-
-@media (min-width: 768px) and (max-width: 991px) {
- .hidden-xs.hidden-sm {
- display: none !important;
- }
- tr.hidden-xs.hidden-sm {
- display: none !important;
- }
- th.hidden-xs.hidden-sm,
- td.hidden-xs.hidden-sm {
- display: none !important;
- }
-}
-
-@media (min-width: 992px) and (max-width: 1199px) {
- .hidden-xs.hidden-md {
- display: none !important;
- }
- tr.hidden-xs.hidden-md {
- display: none !important;
- }
- th.hidden-xs.hidden-md,
- td.hidden-xs.hidden-md {
- display: none !important;
- }
-}
-
-@media (min-width: 1200px) {
- .hidden-xs.hidden-lg {
- display: none !important;
- }
- tr.hidden-xs.hidden-lg {
- display: none !important;
- }
- th.hidden-xs.hidden-lg,
- td.hidden-xs.hidden-lg {
- display: none !important;
- }
-}
-
-.hidden-sm {
- display: block !important;
-}
-
-tr.hidden-sm {
- display: table-row !important;
-}
-
-th.hidden-sm,
-td.hidden-sm {
- display: table-cell !important;
-}
-
-@media (max-width: 767px) {
- .hidden-sm.hidden-xs {
- display: none !important;
- }
- tr.hidden-sm.hidden-xs {
- display: none !important;
- }
- th.hidden-sm.hidden-xs,
- td.hidden-sm.hidden-xs {
- display: none !important;
- }
-}
-
-@media (min-width: 768px) and (max-width: 991px) {
- .hidden-sm {
- display: none !important;
- }
- tr.hidden-sm {
- display: none !important;
- }
- th.hidden-sm,
- td.hidden-sm {
- display: none !important;
- }
-}
-
-@media (min-width: 992px) and (max-width: 1199px) {
- .hidden-sm.hidden-md {
- display: none !important;
- }
- tr.hidden-sm.hidden-md {
- display: none !important;
- }
- th.hidden-sm.hidden-md,
- td.hidden-sm.hidden-md {
- display: none !important;
- }
-}
-
-@media (min-width: 1200px) {
- .hidden-sm.hidden-lg {
- display: none !important;
- }
- tr.hidden-sm.hidden-lg {
- display: none !important;
- }
- th.hidden-sm.hidden-lg,
- td.hidden-sm.hidden-lg {
- display: none !important;
- }
-}
-
-.hidden-md {
- display: block !important;
-}
-
-tr.hidden-md {
- display: table-row !important;
-}
-
-th.hidden-md,
-td.hidden-md {
- display: table-cell !important;
-}
-
-@media (max-width: 767px) {
- .hidden-md.hidden-xs {
- display: none !important;
- }
- tr.hidden-md.hidden-xs {
- display: none !important;
- }
- th.hidden-md.hidden-xs,
- td.hidden-md.hidden-xs {
- display: none !important;
- }
-}
-
-@media (min-width: 768px) and (max-width: 991px) {
- .hidden-md.hidden-sm {
- display: none !important;
- }
- tr.hidden-md.hidden-sm {
- display: none !important;
- }
- th.hidden-md.hidden-sm,
- td.hidden-md.hidden-sm {
- display: none !important;
- }
-}
-
-@media (min-width: 992px) and (max-width: 1199px) {
- .hidden-md {
- display: none !important;
- }
- tr.hidden-md {
- display: none !important;
- }
- th.hidden-md,
- td.hidden-md {
- display: none !important;
- }
-}
-
-@media (min-width: 1200px) {
- .hidden-md.hidden-lg {
- display: none !important;
- }
- tr.hidden-md.hidden-lg {
- display: none !important;
- }
- th.hidden-md.hidden-lg,
- td.hidden-md.hidden-lg {
- display: none !important;
- }
-}
-
-.hidden-lg {
- display: block !important;
-}
-
-tr.hidden-lg {
- display: table-row !important;
-}
-
-th.hidden-lg,
-td.hidden-lg {
- display: table-cell !important;
-}
-
-@media (max-width: 767px) {
- .hidden-lg.hidden-xs {
- display: none !important;
- }
- tr.hidden-lg.hidden-xs {
- display: none !important;
- }
- th.hidden-lg.hidden-xs,
- td.hidden-lg.hidden-xs {
- display: none !important;
- }
-}
-
-@media (min-width: 768px) and (max-width: 991px) {
- .hidden-lg.hidden-sm {
- display: none !important;
- }
- tr.hidden-lg.hidden-sm {
- display: none !important;
- }
- th.hidden-lg.hidden-sm,
- td.hidden-lg.hidden-sm {
- display: none !important;
- }
-}
-
-@media (min-width: 992px) and (max-width: 1199px) {
- .hidden-lg.hidden-md {
- display: none !important;
- }
- tr.hidden-lg.hidden-md {
- display: none !important;
- }
- th.hidden-lg.hidden-md,
- td.hidden-lg.hidden-md {
- display: none !important;
- }
-}
-
-@media (min-width: 1200px) {
- .hidden-lg {
- display: none !important;
- }
- tr.hidden-lg {
- display: none !important;
- }
- th.hidden-lg,
- td.hidden-lg {
- display: none !important;
- }
-}
-
-.visible-print {
- display: none !important;
-}
-
-tr.visible-print {
- display: none !important;
-}
-
-th.visible-print,
-td.visible-print {
- display: none !important;
-}
-
-@media print {
- .visible-print {
- display: block !important;
- }
- tr.visible-print {
- display: table-row !important;
- }
- th.visible-print,
- td.visible-print {
- display: table-cell !important;
- }
- .hidden-print {
- display: none !important;
- }
- tr.hidden-print {
- display: none !important;
- }
- th.hidden-print,
- td.hidden-print {
- display: none !important;
- }
-}
\ No newline at end of file
diff --git a/framework/yii/bootstrap/assets/fonts/glyphicons-halflings-regular.eot b/framework/yii/bootstrap/assets/fonts/glyphicons-halflings-regular.eot
deleted file mode 100644
index 87eaa43..0000000
Binary files a/framework/yii/bootstrap/assets/fonts/glyphicons-halflings-regular.eot and /dev/null differ
diff --git a/framework/yii/bootstrap/assets/fonts/glyphicons-halflings-regular.svg b/framework/yii/bootstrap/assets/fonts/glyphicons-halflings-regular.svg
deleted file mode 100644
index 5fee068..0000000
--- a/framework/yii/bootstrap/assets/fonts/glyphicons-halflings-regular.svg
+++ /dev/null
@@ -1,228 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/framework/yii/bootstrap/assets/fonts/glyphicons-halflings-regular.ttf b/framework/yii/bootstrap/assets/fonts/glyphicons-halflings-regular.ttf
deleted file mode 100644
index be784dc..0000000
Binary files a/framework/yii/bootstrap/assets/fonts/glyphicons-halflings-regular.ttf and /dev/null differ
diff --git a/framework/yii/bootstrap/assets/fonts/glyphicons-halflings-regular.woff b/framework/yii/bootstrap/assets/fonts/glyphicons-halflings-regular.woff
deleted file mode 100644
index 2cc3e48..0000000
Binary files a/framework/yii/bootstrap/assets/fonts/glyphicons-halflings-regular.woff and /dev/null differ
diff --git a/framework/yii/bootstrap/assets/js/bootstrap.js b/framework/yii/bootstrap/assets/js/bootstrap.js
deleted file mode 100644
index 2c64257..0000000
--- a/framework/yii/bootstrap/assets/js/bootstrap.js
+++ /dev/null
@@ -1,1999 +0,0 @@
-/**
-* bootstrap.js v3.0.0 by @fat and @mdo
-* Copyright 2013 Twitter Inc.
-* http://www.apache.org/licenses/LICENSE-2.0
-*/
-if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
-
-/* ========================================================================
- * Bootstrap: transition.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#transitions
- * ========================================================================
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================================== */
-
-
-+function ($) { "use strict";
-
- // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
- // ============================================================
-
- function transitionEnd() {
- var el = document.createElement('bootstrap')
-
- var transEndEventNames = {
- 'WebkitTransition' : 'webkitTransitionEnd'
- , 'MozTransition' : 'transitionend'
- , 'OTransition' : 'oTransitionEnd otransitionend'
- , 'transition' : 'transitionend'
- }
-
- for (var name in transEndEventNames) {
- if (el.style[name] !== undefined) {
- return { end: transEndEventNames[name] }
- }
- }
- }
-
- // http://blog.alexmaccaw.com/css-transitions
- $.fn.emulateTransitionEnd = function (duration) {
- var called = false, $el = this
- $(this).one($.support.transition.end, function () { called = true })
- var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
- setTimeout(callback, duration)
- return this
- }
-
- $(function () {
- $.support.transition = transitionEnd()
- })
-
-}(window.jQuery);
-
-/* ========================================================================
- * Bootstrap: alert.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#alerts
- * ========================================================================
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================================== */
-
-
-+function ($) { "use strict";
-
- // ALERT CLASS DEFINITION
- // ======================
-
- var dismiss = '[data-dismiss="alert"]'
- var Alert = function (el) {
- $(el).on('click', dismiss, this.close)
- }
-
- Alert.prototype.close = function (e) {
- var $this = $(this)
- var selector = $this.attr('data-target')
-
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
- }
-
- var $parent = $(selector)
-
- if (e) e.preventDefault()
-
- if (!$parent.length) {
- $parent = $this.hasClass('alert') ? $this : $this.parent()
- }
-
- $parent.trigger(e = $.Event('close.bs.alert'))
-
- if (e.isDefaultPrevented()) return
-
- $parent.removeClass('in')
-
- function removeElement() {
- $parent.trigger('closed.bs.alert').remove()
- }
-
- $.support.transition && $parent.hasClass('fade') ?
- $parent
- .one($.support.transition.end, removeElement)
- .emulateTransitionEnd(150) :
- removeElement()
- }
-
-
- // ALERT PLUGIN DEFINITION
- // =======================
-
- var old = $.fn.alert
-
- $.fn.alert = function (option) {
- return this.each(function () {
- var $this = $(this)
- var data = $this.data('bs.alert')
-
- if (!data) $this.data('bs.alert', (data = new Alert(this)))
- if (typeof option == 'string') data[option].call($this)
- })
- }
-
- $.fn.alert.Constructor = Alert
-
-
- // ALERT NO CONFLICT
- // =================
-
- $.fn.alert.noConflict = function () {
- $.fn.alert = old
- return this
- }
-
-
- // ALERT DATA-API
- // ==============
-
- $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
-
-}(window.jQuery);
-
-/* ========================================================================
- * Bootstrap: button.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#buttons
- * ========================================================================
- * Copyright 2013 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================================== */
-
-
-+function ($) { "use strict";
-
- // BUTTON PUBLIC CLASS DEFINITION
- // ==============================
-
- var Button = function (element, options) {
- this.$element = $(element)
- this.options = $.extend({}, Button.DEFAULTS, options)
- }
-
- Button.DEFAULTS = {
- loadingText: 'loading...'
- }
-
- Button.prototype.setState = function (state) {
- var d = 'disabled'
- var $el = this.$element
- var val = $el.is('input') ? 'val' : 'html'
- var data = $el.data()
-
- state = state + 'Text'
-
- if (!data.resetText) $el.data('resetText', $el[val]())
-
- $el[val](data[state] || this.options[state])
-
- // push to event loop to allow forms to submit
- setTimeout(function () {
- state == 'loadingText' ?
- $el.addClass(d).attr(d, d) :
- $el.removeClass(d).removeAttr(d);
- }, 0)
- }
-
- Button.prototype.toggle = function () {
- var $parent = this.$element.closest('[data-toggle="buttons"]')
-
- if ($parent.length) {
- var $input = this.$element.find('input')
- .prop('checked', !this.$element.hasClass('active'))
- .trigger('change')
- if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active')
- }
-
- this.$element.toggleClass('active')
- }
-
-
- // BUTTON PLUGIN DEFINITION
- // ========================
-
- var old = $.fn.button
-
- $.fn.button = function (option) {
- return this.each(function () {
- var $this = $(this)
- var data = $this.data('bs.button')
- var options = typeof option == 'object' && option
-
- if (!data) $this.data('bs.button', (data = new Button(this, options)))
-
- if (option == 'toggle') data.toggle()
- else if (option) data.setState(option)
- })
- }
-
- $.fn.button.Constructor = Button
-
-
- // BUTTON NO CONFLICT
- // ==================
-
- $.fn.button.noConflict = function () {
- $.fn.button = old
- return this
- }
-
-
- // BUTTON DATA-API
- // ===============
-
- $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
- var $btn = $(e.target)
- if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
- $btn.button('toggle')
- e.preventDefault()
- })
-
-}(window.jQuery);
-
-/* ========================================================================
- * Bootstrap: carousel.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#carousel
- * ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================================== */
-
-
-+function ($) { "use strict";
-
- // CAROUSEL CLASS DEFINITION
- // =========================
-
- var Carousel = function (element, options) {
- this.$element = $(element)
- this.$indicators = this.$element.find('.carousel-indicators')
- this.options = options
- this.paused =
- this.sliding =
- this.interval =
- this.$active =
- this.$items = null
-
- this.options.pause == 'hover' && this.$element
- .on('mouseenter', $.proxy(this.pause, this))
- .on('mouseleave', $.proxy(this.cycle, this))
- }
-
- Carousel.DEFAULTS = {
- interval: 5000
- , pause: 'hover'
- , wrap: true
- }
-
- Carousel.prototype.cycle = function (e) {
- e || (this.paused = false)
-
- this.interval && clearInterval(this.interval)
-
- this.options.interval
- && !this.paused
- && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
-
- return this
- }
-
- Carousel.prototype.getActiveIndex = function () {
- this.$active = this.$element.find('.item.active')
- this.$items = this.$active.parent().children()
-
- return this.$items.index(this.$active)
- }
-
- Carousel.prototype.to = function (pos) {
- var that = this
- var activeIndex = this.getActiveIndex()
-
- if (pos > (this.$items.length - 1) || pos < 0) return
-
- if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })
- if (activeIndex == pos) return this.pause().cycle()
-
- return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
- }
-
- Carousel.prototype.pause = function (e) {
- e || (this.paused = true)
-
- if (this.$element.find('.next, .prev').length && $.support.transition.end) {
- this.$element.trigger($.support.transition.end)
- this.cycle(true)
- }
-
- this.interval = clearInterval(this.interval)
-
- return this
- }
-
- Carousel.prototype.next = function () {
- if (this.sliding) return
- return this.slide('next')
- }
-
- Carousel.prototype.prev = function () {
- if (this.sliding) return
- return this.slide('prev')
- }
-
- Carousel.prototype.slide = function (type, next) {
- var $active = this.$element.find('.item.active')
- var $next = next || $active[type]()
- var isCycling = this.interval
- var direction = type == 'next' ? 'left' : 'right'
- var fallback = type == 'next' ? 'first' : 'last'
- var that = this
-
- if (!$next.length) {
- if (!this.options.wrap) return
- $next = this.$element.find('.item')[fallback]()
- }
-
- this.sliding = true
-
- isCycling && this.pause()
-
- var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
-
- if ($next.hasClass('active')) return
-
- if (this.$indicators.length) {
- this.$indicators.find('.active').removeClass('active')
- this.$element.one('slid', function () {
- var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
- $nextIndicator && $nextIndicator.addClass('active')
- })
- }
-
- if ($.support.transition && this.$element.hasClass('slide')) {
- this.$element.trigger(e)
- if (e.isDefaultPrevented()) return
- $next.addClass(type)
- $next[0].offsetWidth // force reflow
- $active.addClass(direction)
- $next.addClass(direction)
- $active
- .one($.support.transition.end, function () {
- $next.removeClass([type, direction].join(' ')).addClass('active')
- $active.removeClass(['active', direction].join(' '))
- that.sliding = false
- setTimeout(function () { that.$element.trigger('slid') }, 0)
- })
- .emulateTransitionEnd(600)
- } else {
- this.$element.trigger(e)
- if (e.isDefaultPrevented()) return
- $active.removeClass('active')
- $next.addClass('active')
- this.sliding = false
- this.$element.trigger('slid')
- }
-
- isCycling && this.cycle()
-
- return this
- }
-
-
- // CAROUSEL PLUGIN DEFINITION
- // ==========================
-
- var old = $.fn.carousel
-
- $.fn.carousel = function (option) {
- return this.each(function () {
- var $this = $(this)
- var data = $this.data('bs.carousel')
- var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
- var action = typeof option == 'string' ? option : options.slide
-
- if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
- if (typeof option == 'number') data.to(option)
- else if (action) data[action]()
- else if (options.interval) data.pause().cycle()
- })
- }
-
- $.fn.carousel.Constructor = Carousel
-
-
- // CAROUSEL NO CONFLICT
- // ====================
-
- $.fn.carousel.noConflict = function () {
- $.fn.carousel = old
- return this
- }
-
-
- // CAROUSEL DATA-API
- // =================
-
- $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
- var $this = $(this), href
- var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
- var options = $.extend({}, $target.data(), $this.data())
- var slideIndex = $this.attr('data-slide-to')
- if (slideIndex) options.interval = false
-
- $target.carousel(options)
-
- if (slideIndex = $this.attr('data-slide-to')) {
- $target.data('bs.carousel').to(slideIndex)
- }
-
- e.preventDefault()
- })
-
- $(window).on('load', function () {
- $('[data-ride="carousel"]').each(function () {
- var $carousel = $(this)
- $carousel.carousel($carousel.data())
- })
- })
-
-}(window.jQuery);
-
-/* ========================================================================
- * Bootstrap: collapse.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#collapse
- * ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================================== */
-
-
-+function ($) { "use strict";
-
- // COLLAPSE PUBLIC CLASS DEFINITION
- // ================================
-
- var Collapse = function (element, options) {
- this.$element = $(element)
- this.options = $.extend({}, Collapse.DEFAULTS, options)
- this.transitioning = null
-
- if (this.options.parent) this.$parent = $(this.options.parent)
- if (this.options.toggle) this.toggle()
- }
-
- Collapse.DEFAULTS = {
- toggle: true
- }
-
- Collapse.prototype.dimension = function () {
- var hasWidth = this.$element.hasClass('width')
- return hasWidth ? 'width' : 'height'
- }
-
- Collapse.prototype.show = function () {
- if (this.transitioning || this.$element.hasClass('in')) return
-
- var startEvent = $.Event('show.bs.collapse')
- this.$element.trigger(startEvent)
- if (startEvent.isDefaultPrevented()) return
-
- var actives = this.$parent && this.$parent.find('> .panel > .in')
-
- if (actives && actives.length) {
- var hasData = actives.data('bs.collapse')
- if (hasData && hasData.transitioning) return
- actives.collapse('hide')
- hasData || actives.data('bs.collapse', null)
- }
-
- var dimension = this.dimension()
-
- this.$element
- .removeClass('collapse')
- .addClass('collapsing')
- [dimension](0)
-
- this.transitioning = 1
-
- var complete = function () {
- this.$element
- .removeClass('collapsing')
- .addClass('in')
- [dimension]('auto')
- this.transitioning = 0
- this.$element.trigger('shown.bs.collapse')
- }
-
- if (!$.support.transition) return complete.call(this)
-
- var scrollSize = $.camelCase(['scroll', dimension].join('-'))
-
- this.$element
- .one($.support.transition.end, $.proxy(complete, this))
- .emulateTransitionEnd(350)
- [dimension](this.$element[0][scrollSize])
- }
-
- Collapse.prototype.hide = function () {
- if (this.transitioning || !this.$element.hasClass('in')) return
-
- var startEvent = $.Event('hide.bs.collapse')
- this.$element.trigger(startEvent)
- if (startEvent.isDefaultPrevented()) return
-
- var dimension = this.dimension()
-
- this.$element
- [dimension](this.$element[dimension]())
- [0].offsetHeight
-
- this.$element
- .addClass('collapsing')
- .removeClass('collapse')
- .removeClass('in')
-
- this.transitioning = 1
-
- var complete = function () {
- this.transitioning = 0
- this.$element
- .trigger('hidden.bs.collapse')
- .removeClass('collapsing')
- .addClass('collapse')
- }
-
- if (!$.support.transition) return complete.call(this)
-
- this.$element
- [dimension](0)
- .one($.support.transition.end, $.proxy(complete, this))
- .emulateTransitionEnd(350)
- }
-
- Collapse.prototype.toggle = function () {
- this[this.$element.hasClass('in') ? 'hide' : 'show']()
- }
-
-
- // COLLAPSE PLUGIN DEFINITION
- // ==========================
-
- var old = $.fn.collapse
-
- $.fn.collapse = function (option) {
- return this.each(function () {
- var $this = $(this)
- var data = $this.data('bs.collapse')
- var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
-
- if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.collapse.Constructor = Collapse
-
-
- // COLLAPSE NO CONFLICT
- // ====================
-
- $.fn.collapse.noConflict = function () {
- $.fn.collapse = old
- return this
- }
-
-
- // COLLAPSE DATA-API
- // =================
-
- $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
- var $this = $(this), href
- var target = $this.attr('data-target')
- || e.preventDefault()
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
- var $target = $(target)
- var data = $target.data('bs.collapse')
- var option = data ? 'toggle' : $this.data()
- var parent = $this.attr('data-parent')
- var $parent = parent && $(parent)
-
- if (!data || !data.transitioning) {
- if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
- $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
- }
-
- $target.collapse(option)
- })
-
-}(window.jQuery);
-
-/* ========================================================================
- * Bootstrap: dropdown.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#dropdowns
- * ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================================== */
-
-
-+function ($) { "use strict";
-
- // DROPDOWN CLASS DEFINITION
- // =========================
-
- var backdrop = '.dropdown-backdrop'
- var toggle = '[data-toggle=dropdown]'
- var Dropdown = function (element) {
- var $el = $(element).on('click.bs.dropdown', this.toggle)
- }
-
- Dropdown.prototype.toggle = function (e) {
- var $this = $(this)
-
- if ($this.is('.disabled, :disabled')) return
-
- var $parent = getParent($this)
- var isActive = $parent.hasClass('open')
-
- clearMenus()
-
- if (!isActive) {
- if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
- // if mobile we we use a backdrop because click events don't delegate
- $('
').insertAfter($(this)).on('click', clearMenus)
- }
-
- $parent.trigger(e = $.Event('show.bs.dropdown'))
-
- if (e.isDefaultPrevented()) return
-
- $parent
- .toggleClass('open')
- .trigger('shown.bs.dropdown')
-
- $this.focus()
- }
-
- return false
- }
-
- Dropdown.prototype.keydown = function (e) {
- if (!/(38|40|27)/.test(e.keyCode)) return
-
- var $this = $(this)
-
- e.preventDefault()
- e.stopPropagation()
-
- if ($this.is('.disabled, :disabled')) return
-
- var $parent = getParent($this)
- var isActive = $parent.hasClass('open')
-
- if (!isActive || (isActive && e.keyCode == 27)) {
- if (e.which == 27) $parent.find(toggle).focus()
- return $this.click()
- }
-
- var $items = $('[role=menu] li:not(.divider):visible a', $parent)
-
- if (!$items.length) return
-
- var index = $items.index($items.filter(':focus'))
-
- if (e.keyCode == 38 && index > 0) index-- // up
- if (e.keyCode == 40 && index < $items.length - 1) index++ // down
- if (!~index) index=0
-
- $items.eq(index).focus()
- }
-
- function clearMenus() {
- $(backdrop).remove()
- $(toggle).each(function (e) {
- var $parent = getParent($(this))
- if (!$parent.hasClass('open')) return
- $parent.trigger(e = $.Event('hide.bs.dropdown'))
- if (e.isDefaultPrevented()) return
- $parent.removeClass('open').trigger('hidden.bs.dropdown')
- })
- }
-
- function getParent($this) {
- var selector = $this.attr('data-target')
-
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
- }
-
- var $parent = selector && $(selector)
-
- return $parent && $parent.length ? $parent : $this.parent()
- }
-
-
- // DROPDOWN PLUGIN DEFINITION
- // ==========================
-
- var old = $.fn.dropdown
-
- $.fn.dropdown = function (option) {
- return this.each(function () {
- var $this = $(this)
- var data = $this.data('dropdown')
-
- if (!data) $this.data('dropdown', (data = new Dropdown(this)))
- if (typeof option == 'string') data[option].call($this)
- })
- }
-
- $.fn.dropdown.Constructor = Dropdown
-
-
- // DROPDOWN NO CONFLICT
- // ====================
-
- $.fn.dropdown.noConflict = function () {
- $.fn.dropdown = old
- return this
- }
-
-
- // APPLY TO STANDARD DROPDOWN ELEMENTS
- // ===================================
-
- $(document)
- .on('click.bs.dropdown.data-api', clearMenus)
- .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
- .on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
- .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
-
-}(window.jQuery);
-
-/* ========================================================================
- * Bootstrap: modal.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#modals
- * ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================================== */
-
-
-+function ($) { "use strict";
-
- // MODAL CLASS DEFINITION
- // ======================
-
- var Modal = function (element, options) {
- this.options = options
- this.$element = $(element)
- this.$backdrop =
- this.isShown = null
-
- if (this.options.remote) this.$element.load(this.options.remote)
- }
-
- Modal.DEFAULTS = {
- backdrop: true
- , keyboard: true
- , show: true
- }
-
- Modal.prototype.toggle = function (_relatedTarget) {
- return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
- }
-
- Modal.prototype.show = function (_relatedTarget) {
- var that = this
- var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
-
- this.$element.trigger(e)
-
- if (this.isShown || e.isDefaultPrevented()) return
-
- this.isShown = true
-
- this.escape()
-
- this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
-
- this.backdrop(function () {
- var transition = $.support.transition && that.$element.hasClass('fade')
-
- if (!that.$element.parent().length) {
- that.$element.appendTo(document.body) // don't move modals dom position
- }
-
- that.$element.show()
-
- if (transition) {
- that.$element[0].offsetWidth // force reflow
- }
-
- that.$element
- .addClass('in')
- .attr('aria-hidden', false)
-
- that.enforceFocus()
-
- var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
-
- transition ?
- that.$element.find('.modal-dialog') // wait for modal to slide in
- .one($.support.transition.end, function () {
- that.$element.focus().trigger(e)
- })
- .emulateTransitionEnd(300) :
- that.$element.focus().trigger(e)
- })
- }
-
- Modal.prototype.hide = function (e) {
- if (e) e.preventDefault()
-
- e = $.Event('hide.bs.modal')
-
- this.$element.trigger(e)
-
- if (!this.isShown || e.isDefaultPrevented()) return
-
- this.isShown = false
-
- this.escape()
-
- $(document).off('focusin.bs.modal')
-
- this.$element
- .removeClass('in')
- .attr('aria-hidden', true)
- .off('click.dismiss.modal')
-
- $.support.transition && this.$element.hasClass('fade') ?
- this.$element
- .one($.support.transition.end, $.proxy(this.hideModal, this))
- .emulateTransitionEnd(300) :
- this.hideModal()
- }
-
- Modal.prototype.enforceFocus = function () {
- $(document)
- .off('focusin.bs.modal') // guard against infinite focus loop
- .on('focusin.bs.modal', $.proxy(function (e) {
- if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
- this.$element.focus()
- }
- }, this))
- }
-
- Modal.prototype.escape = function () {
- if (this.isShown && this.options.keyboard) {
- this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
- e.which == 27 && this.hide()
- }, this))
- } else if (!this.isShown) {
- this.$element.off('keyup.dismiss.bs.modal')
- }
- }
-
- Modal.prototype.hideModal = function () {
- var that = this
- this.$element.hide()
- this.backdrop(function () {
- that.removeBackdrop()
- that.$element.trigger('hidden.bs.modal')
- })
- }
-
- Modal.prototype.removeBackdrop = function () {
- this.$backdrop && this.$backdrop.remove()
- this.$backdrop = null
- }
-
- Modal.prototype.backdrop = function (callback) {
- var that = this
- var animate = this.$element.hasClass('fade') ? 'fade' : ''
-
- if (this.isShown && this.options.backdrop) {
- var doAnimate = $.support.transition && animate
-
- this.$backdrop = $('
')
- .appendTo(document.body)
-
- this.$element.on('click.dismiss.modal', $.proxy(function (e) {
- if (e.target !== e.currentTarget) return
- this.options.backdrop == 'static'
- ? this.$element[0].focus.call(this.$element[0])
- : this.hide.call(this)
- }, this))
-
- if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
-
- this.$backdrop.addClass('in')
-
- if (!callback) return
-
- doAnimate ?
- this.$backdrop
- .one($.support.transition.end, callback)
- .emulateTransitionEnd(150) :
- callback()
-
- } else if (!this.isShown && this.$backdrop) {
- this.$backdrop.removeClass('in')
-
- $.support.transition && this.$element.hasClass('fade')?
- this.$backdrop
- .one($.support.transition.end, callback)
- .emulateTransitionEnd(150) :
- callback()
-
- } else if (callback) {
- callback()
- }
- }
-
-
- // MODAL PLUGIN DEFINITION
- // =======================
-
- var old = $.fn.modal
-
- $.fn.modal = function (option, _relatedTarget) {
- return this.each(function () {
- var $this = $(this)
- var data = $this.data('bs.modal')
- var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
-
- if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
- if (typeof option == 'string') data[option](_relatedTarget)
- else if (options.show) data.show(_relatedTarget)
- })
- }
-
- $.fn.modal.Constructor = Modal
-
-
- // MODAL NO CONFLICT
- // =================
-
- $.fn.modal.noConflict = function () {
- $.fn.modal = old
- return this
- }
-
-
- // MODAL DATA-API
- // ==============
-
- $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
- var $this = $(this)
- var href = $this.attr('href')
- var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
- var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
-
- e.preventDefault()
-
- $target
- .modal(option, this)
- .one('hide', function () {
- $this.is(':visible') && $this.focus()
- })
- })
-
- $(document)
- .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
- .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
-
-}(window.jQuery);
-
-/* ========================================================================
- * Bootstrap: tooltip.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#tooltip
- * Inspired by the original jQuery.tipsy by Jason Frame
- * ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================================== */
-
-
-+function ($) { "use strict";
-
- // TOOLTIP PUBLIC CLASS DEFINITION
- // ===============================
-
- var Tooltip = function (element, options) {
- this.type =
- this.options =
- this.enabled =
- this.timeout =
- this.hoverState =
- this.$element = null
-
- this.init('tooltip', element, options)
- }
-
- Tooltip.DEFAULTS = {
- animation: true
- , placement: 'top'
- , selector: false
- , template: ''
- , trigger: 'hover focus'
- , title: ''
- , delay: 0
- , html: false
- , container: false
- }
-
- Tooltip.prototype.init = function (type, element, options) {
- this.enabled = true
- this.type = type
- this.$element = $(element)
- this.options = this.getOptions(options)
-
- var triggers = this.options.trigger.split(' ')
-
- for (var i = triggers.length; i--;) {
- var trigger = triggers[i]
-
- if (trigger == 'click') {
- this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
- } else if (trigger != 'manual') {
- var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
- var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
-
- this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
- this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
- }
- }
-
- this.options.selector ?
- (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
- this.fixTitle()
- }
-
- Tooltip.prototype.getDefaults = function () {
- return Tooltip.DEFAULTS
- }
-
- Tooltip.prototype.getOptions = function (options) {
- options = $.extend({}, this.getDefaults(), this.$element.data(), options)
-
- if (options.delay && typeof options.delay == 'number') {
- options.delay = {
- show: options.delay
- , hide: options.delay
- }
- }
-
- return options
- }
-
- Tooltip.prototype.getDelegateOptions = function () {
- var options = {}
- var defaults = this.getDefaults()
-
- this._options && $.each(this._options, function (key, value) {
- if (defaults[key] != value) options[key] = value
- })
-
- return options
- }
-
- Tooltip.prototype.enter = function (obj) {
- var self = obj instanceof this.constructor ?
- obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
-
- clearTimeout(self.timeout)
-
- self.hoverState = 'in'
-
- if (!self.options.delay || !self.options.delay.show) return self.show()
-
- self.timeout = setTimeout(function () {
- if (self.hoverState == 'in') self.show()
- }, self.options.delay.show)
- }
-
- Tooltip.prototype.leave = function (obj) {
- var self = obj instanceof this.constructor ?
- obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
-
- clearTimeout(self.timeout)
-
- self.hoverState = 'out'
-
- if (!self.options.delay || !self.options.delay.hide) return self.hide()
-
- self.timeout = setTimeout(function () {
- if (self.hoverState == 'out') self.hide()
- }, self.options.delay.hide)
- }
-
- Tooltip.prototype.show = function () {
- var e = $.Event('show.bs.'+ this.type)
-
- if (this.hasContent() && this.enabled) {
- this.$element.trigger(e)
-
- if (e.isDefaultPrevented()) return
-
- var $tip = this.tip()
-
- this.setContent()
-
- if (this.options.animation) $tip.addClass('fade')
-
- var placement = typeof this.options.placement == 'function' ?
- this.options.placement.call(this, $tip[0], this.$element[0]) :
- this.options.placement
-
- var autoToken = /\s?auto?\s?/i
- var autoPlace = autoToken.test(placement)
- if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
-
- $tip
- .detach()
- .css({ top: 0, left: 0, display: 'block' })
- .addClass(placement)
-
- this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
-
- var pos = this.getPosition()
- var actualWidth = $tip[0].offsetWidth
- var actualHeight = $tip[0].offsetHeight
-
- if (autoPlace) {
- var $parent = this.$element.parent()
-
- var orgPlacement = placement
- var docScroll = document.documentElement.scrollTop || document.body.scrollTop
- var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()
- var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
- var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
-
- placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :
- placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :
- placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :
- placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :
- placement
-
- $tip
- .removeClass(orgPlacement)
- .addClass(placement)
- }
-
- var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
-
- this.applyPlacement(calculatedOffset, placement)
- this.$element.trigger('shown.bs.' + this.type)
- }
- }
-
- Tooltip.prototype.applyPlacement = function(offset, placement) {
- var replace
- var $tip = this.tip()
- var width = $tip[0].offsetWidth
- var height = $tip[0].offsetHeight
-
- // manually read margins because getBoundingClientRect includes difference
- var marginTop = parseInt($tip.css('margin-top'), 10)
- var marginLeft = parseInt($tip.css('margin-left'), 10)
-
- // we must check for NaN for ie 8/9
- if (isNaN(marginTop)) marginTop = 0
- if (isNaN(marginLeft)) marginLeft = 0
-
- offset.top = offset.top + marginTop
- offset.left = offset.left + marginLeft
-
- $tip
- .offset(offset)
- .addClass('in')
-
- // check to see if placing tip in new offset caused the tip to resize itself
- var actualWidth = $tip[0].offsetWidth
- var actualHeight = $tip[0].offsetHeight
-
- if (placement == 'top' && actualHeight != height) {
- replace = true
- offset.top = offset.top + height - actualHeight
- }
-
- if (/bottom|top/.test(placement)) {
- var delta = 0
-
- if (offset.left < 0) {
- delta = offset.left * -2
- offset.left = 0
-
- $tip.offset(offset)
-
- actualWidth = $tip[0].offsetWidth
- actualHeight = $tip[0].offsetHeight
- }
-
- this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
- } else {
- this.replaceArrow(actualHeight - height, actualHeight, 'top')
- }
-
- if (replace) $tip.offset(offset)
- }
-
- Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
- this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
- }
-
- Tooltip.prototype.setContent = function () {
- var $tip = this.tip()
- var title = this.getTitle()
-
- $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
- $tip.removeClass('fade in top bottom left right')
- }
-
- Tooltip.prototype.hide = function () {
- var that = this
- var $tip = this.tip()
- var e = $.Event('hide.bs.' + this.type)
-
- function complete() {
- if (that.hoverState != 'in') $tip.detach()
- }
-
- this.$element.trigger(e)
-
- if (e.isDefaultPrevented()) return
-
- $tip.removeClass('in')
-
- $.support.transition && this.$tip.hasClass('fade') ?
- $tip
- .one($.support.transition.end, complete)
- .emulateTransitionEnd(150) :
- complete()
-
- this.$element.trigger('hidden.bs.' + this.type)
-
- return this
- }
-
- Tooltip.prototype.fixTitle = function () {
- var $e = this.$element
- if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
- $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
- }
- }
-
- Tooltip.prototype.hasContent = function () {
- return this.getTitle()
- }
-
- Tooltip.prototype.getPosition = function () {
- var el = this.$element[0]
- return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
- width: el.offsetWidth
- , height: el.offsetHeight
- }, this.$element.offset())
- }
-
- Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
- return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
- placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
- placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
- /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
- }
-
- Tooltip.prototype.getTitle = function () {
- var title
- var $e = this.$element
- var o = this.options
-
- title = $e.attr('data-original-title')
- || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
-
- return title
- }
-
- Tooltip.prototype.tip = function () {
- return this.$tip = this.$tip || $(this.options.template)
- }
-
- Tooltip.prototype.arrow = function () {
- return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
- }
-
- Tooltip.prototype.validate = function () {
- if (!this.$element[0].parentNode) {
- this.hide()
- this.$element = null
- this.options = null
- }
- }
-
- Tooltip.prototype.enable = function () {
- this.enabled = true
- }
-
- Tooltip.prototype.disable = function () {
- this.enabled = false
- }
-
- Tooltip.prototype.toggleEnabled = function () {
- this.enabled = !this.enabled
- }
-
- Tooltip.prototype.toggle = function (e) {
- var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
- self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
- }
-
- Tooltip.prototype.destroy = function () {
- this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
- }
-
-
- // TOOLTIP PLUGIN DEFINITION
- // =========================
-
- var old = $.fn.tooltip
-
- $.fn.tooltip = function (option) {
- return this.each(function () {
- var $this = $(this)
- var data = $this.data('bs.tooltip')
- var options = typeof option == 'object' && option
-
- if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.tooltip.Constructor = Tooltip
-
-
- // TOOLTIP NO CONFLICT
- // ===================
-
- $.fn.tooltip.noConflict = function () {
- $.fn.tooltip = old
- return this
- }
-
-}(window.jQuery);
-
-/* ========================================================================
- * Bootstrap: popover.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#popovers
- * ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================================== */
-
-
-+function ($) { "use strict";
-
- // POPOVER PUBLIC CLASS DEFINITION
- // ===============================
-
- var Popover = function (element, options) {
- this.init('popover', element, options)
- }
-
- if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
-
- Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
- placement: 'right'
- , trigger: 'click'
- , content: ''
- , template: ''
- })
-
-
- // NOTE: POPOVER EXTENDS tooltip.js
- // ================================
-
- Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
-
- Popover.prototype.constructor = Popover
-
- Popover.prototype.getDefaults = function () {
- return Popover.DEFAULTS
- }
-
- Popover.prototype.setContent = function () {
- var $tip = this.tip()
- var title = this.getTitle()
- var content = this.getContent()
-
- $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
- $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
-
- $tip.removeClass('fade top bottom left right in')
-
- // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
- // this manually by checking the contents.
- if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
- }
-
- Popover.prototype.hasContent = function () {
- return this.getTitle() || this.getContent()
- }
-
- Popover.prototype.getContent = function () {
- var $e = this.$element
- var o = this.options
-
- return $e.attr('data-content')
- || (typeof o.content == 'function' ?
- o.content.call($e[0]) :
- o.content)
- }
-
- Popover.prototype.arrow = function () {
- return this.$arrow = this.$arrow || this.tip().find('.arrow')
- }
-
- Popover.prototype.tip = function () {
- if (!this.$tip) this.$tip = $(this.options.template)
- return this.$tip
- }
-
-
- // POPOVER PLUGIN DEFINITION
- // =========================
-
- var old = $.fn.popover
-
- $.fn.popover = function (option) {
- return this.each(function () {
- var $this = $(this)
- var data = $this.data('bs.popover')
- var options = typeof option == 'object' && option
-
- if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.popover.Constructor = Popover
-
-
- // POPOVER NO CONFLICT
- // ===================
-
- $.fn.popover.noConflict = function () {
- $.fn.popover = old
- return this
- }
-
-}(window.jQuery);
-
-/* ========================================================================
- * Bootstrap: scrollspy.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#scrollspy
- * ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================================== */
-
-
-+function ($) { "use strict";
-
- // SCROLLSPY CLASS DEFINITION
- // ==========================
-
- function ScrollSpy(element, options) {
- var href
- var process = $.proxy(this.process, this)
-
- this.$element = $(element).is('body') ? $(window) : $(element)
- this.$body = $('body')
- this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
- this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
- this.selector = (this.options.target
- || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
- || '') + ' .nav li > a'
- this.offsets = $([])
- this.targets = $([])
- this.activeTarget = null
-
- this.refresh()
- this.process()
- }
-
- ScrollSpy.DEFAULTS = {
- offset: 10
- }
-
- ScrollSpy.prototype.refresh = function () {
- var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
-
- this.offsets = $([])
- this.targets = $([])
-
- var self = this
- var $targets = this.$body
- .find(this.selector)
- .map(function () {
- var $el = $(this)
- var href = $el.data('target') || $el.attr('href')
- var $href = /^#\w/.test(href) && $(href)
-
- return ($href
- && $href.length
- && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
- })
- .sort(function (a, b) { return a[0] - b[0] })
- .each(function () {
- self.offsets.push(this[0])
- self.targets.push(this[1])
- })
- }
-
- ScrollSpy.prototype.process = function () {
- var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
- var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
- var maxScroll = scrollHeight - this.$scrollElement.height()
- var offsets = this.offsets
- var targets = this.targets
- var activeTarget = this.activeTarget
- var i
-
- if (scrollTop >= maxScroll) {
- return activeTarget != (i = targets.last()[0]) && this.activate(i)
- }
-
- for (i = offsets.length; i--;) {
- activeTarget != targets[i]
- && scrollTop >= offsets[i]
- && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
- && this.activate( targets[i] )
- }
- }
-
- ScrollSpy.prototype.activate = function (target) {
- this.activeTarget = target
-
- $(this.selector)
- .parents('.active')
- .removeClass('active')
-
- var selector = this.selector
- + '[data-target="' + target + '"],'
- + this.selector + '[href="' + target + '"]'
-
- var active = $(selector)
- .parents('li')
- .addClass('active')
-
- if (active.parent('.dropdown-menu').length) {
- active = active
- .closest('li.dropdown')
- .addClass('active')
- }
-
- active.trigger('activate')
- }
-
-
- // SCROLLSPY PLUGIN DEFINITION
- // ===========================
-
- var old = $.fn.scrollspy
-
- $.fn.scrollspy = function (option) {
- return this.each(function () {
- var $this = $(this)
- var data = $this.data('bs.scrollspy')
- var options = typeof option == 'object' && option
-
- if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.scrollspy.Constructor = ScrollSpy
-
-
- // SCROLLSPY NO CONFLICT
- // =====================
-
- $.fn.scrollspy.noConflict = function () {
- $.fn.scrollspy = old
- return this
- }
-
-
- // SCROLLSPY DATA-API
- // ==================
-
- $(window).on('load', function () {
- $('[data-spy="scroll"]').each(function () {
- var $spy = $(this)
- $spy.scrollspy($spy.data())
- })
- })
-
-}(window.jQuery);
-
-/* ========================================================================
- * Bootstrap: tab.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#tabs
- * ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================================== */
-
-
-+function ($) { "use strict";
-
- // TAB CLASS DEFINITION
- // ====================
-
- var Tab = function (element) {
- this.element = $(element)
- }
-
- Tab.prototype.show = function () {
- var $this = this.element
- var $ul = $this.closest('ul:not(.dropdown-menu)')
- var selector = $this.attr('data-target')
-
- if (!selector) {
- selector = $this.attr('href')
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
- }
-
- if ($this.parent('li').hasClass('active')) return
-
- var previous = $ul.find('.active:last a')[0]
- var e = $.Event('show.bs.tab', {
- relatedTarget: previous
- })
-
- $this.trigger(e)
-
- if (e.isDefaultPrevented()) return
-
- var $target = $(selector)
-
- this.activate($this.parent('li'), $ul)
- this.activate($target, $target.parent(), function () {
- $this.trigger({
- type: 'shown.bs.tab'
- , relatedTarget: previous
- })
- })
- }
-
- Tab.prototype.activate = function (element, container, callback) {
- var $active = container.find('> .active')
- var transition = callback
- && $.support.transition
- && $active.hasClass('fade')
-
- function next() {
- $active
- .removeClass('active')
- .find('> .dropdown-menu > .active')
- .removeClass('active')
-
- element.addClass('active')
-
- if (transition) {
- element[0].offsetWidth // reflow for transition
- element.addClass('in')
- } else {
- element.removeClass('fade')
- }
-
- if (element.parent('.dropdown-menu')) {
- element.closest('li.dropdown').addClass('active')
- }
-
- callback && callback()
- }
-
- transition ?
- $active
- .one($.support.transition.end, next)
- .emulateTransitionEnd(150) :
- next()
-
- $active.removeClass('in')
- }
-
-
- // TAB PLUGIN DEFINITION
- // =====================
-
- var old = $.fn.tab
-
- $.fn.tab = function ( option ) {
- return this.each(function () {
- var $this = $(this)
- var data = $this.data('bs.tab')
-
- if (!data) $this.data('bs.tab', (data = new Tab(this)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.tab.Constructor = Tab
-
-
- // TAB NO CONFLICT
- // ===============
-
- $.fn.tab.noConflict = function () {
- $.fn.tab = old
- return this
- }
-
-
- // TAB DATA-API
- // ============
-
- $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
- e.preventDefault()
- $(this).tab('show')
- })
-
-}(window.jQuery);
-
-/* ========================================================================
- * Bootstrap: affix.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#affix
- * ========================================================================
- * Copyright 2012 Twitter, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ======================================================================== */
-
-
-+function ($) { "use strict";
-
- // AFFIX CLASS DEFINITION
- // ======================
-
- var Affix = function (element, options) {
- this.options = $.extend({}, Affix.DEFAULTS, options)
- this.$window = $(window)
- .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
- .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
-
- this.$element = $(element)
- this.affixed =
- this.unpin = null
-
- this.checkPosition()
- }
-
- Affix.RESET = 'affix affix-top affix-bottom'
-
- Affix.DEFAULTS = {
- offset: 0
- }
-
- Affix.prototype.checkPositionWithEventLoop = function () {
- setTimeout($.proxy(this.checkPosition, this), 1)
- }
-
- Affix.prototype.checkPosition = function () {
- if (!this.$element.is(':visible')) return
-
- var scrollHeight = $(document).height()
- var scrollTop = this.$window.scrollTop()
- var position = this.$element.offset()
- var offset = this.options.offset
- var offsetTop = offset.top
- var offsetBottom = offset.bottom
-
- if (typeof offset != 'object') offsetBottom = offsetTop = offset
- if (typeof offsetTop == 'function') offsetTop = offset.top()
- if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
-
- var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
- offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
- offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
-
- if (this.affixed === affix) return
- if (this.unpin) this.$element.css('top', '')
-
- this.affixed = affix
- this.unpin = affix == 'bottom' ? position.top - scrollTop : null
-
- this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))
-
- if (affix == 'bottom') {
- this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
- }
- }
-
-
- // AFFIX PLUGIN DEFINITION
- // =======================
-
- var old = $.fn.affix
-
- $.fn.affix = function (option) {
- return this.each(function () {
- var $this = $(this)
- var data = $this.data('bs.affix')
- var options = typeof option == 'object' && option
-
- if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
- if (typeof option == 'string') data[option]()
- })
- }
-
- $.fn.affix.Constructor = Affix
-
-
- // AFFIX NO CONFLICT
- // =================
-
- $.fn.affix.noConflict = function () {
- $.fn.affix = old
- return this
- }
-
-
- // AFFIX DATA-API
- // ==============
-
- $(window).on('load', function () {
- $('[data-spy="affix"]').each(function () {
- var $spy = $(this)
- var data = $spy.data()
-
- data.offset = data.offset || {}
-
- if (data.offsetBottom) data.offset.bottom = data.offsetBottom
- if (data.offsetTop) data.offset.top = data.offsetTop
-
- $spy.affix(data)
- })
- })
-
-}(window.jQuery);
diff --git a/framework/yii/caching/ChainedDependency.php b/framework/yii/caching/ChainedDependency.php
index 20cb632..f8bfee3 100644
--- a/framework/yii/caching/ChainedDependency.php
+++ b/framework/yii/caching/ChainedDependency.php
@@ -23,7 +23,7 @@ class ChainedDependency extends Dependency
* @var Dependency[] list of dependencies that this dependency is composed of.
* Each array element must be a dependency object.
*/
- public $dependencies;
+ public $dependencies = [];
/**
* @var boolean whether this dependency is depending on every dependency in [[dependencies]].
* Defaults to true, meaning if any of the dependencies has changed, this dependency is considered changed.
@@ -33,18 +33,6 @@ class ChainedDependency extends Dependency
public $dependOnAll = true;
/**
- * Constructor.
- * @param Dependency[] $dependencies list of dependencies that this dependency is composed of.
- * Each array element should be a dependency object.
- * @param array $config name-value pairs that will be used to initialize the object properties
- */
- public function __construct($dependencies = [], $config = [])
- {
- $this->dependencies = $dependencies;
- parent::__construct($config);
- }
-
- /**
* Evaluates the dependency by generating and saving the data related with dependency.
* @param Cache $cache the cache component that is currently evaluating this dependency
*/
diff --git a/framework/yii/caching/DbDependency.php b/framework/yii/caching/DbDependency.php
index e8e1e68..ac6f2e7 100644
--- a/framework/yii/caching/DbDependency.php
+++ b/framework/yii/caching/DbDependency.php
@@ -34,20 +34,7 @@ class DbDependency extends Dependency
/**
* @var array the parameters (name => value) to be bound to the SQL statement specified by [[sql]].
*/
- public $params;
-
- /**
- * Constructor.
- * @param string $sql the SQL query whose result is used to determine if the dependency has been changed.
- * @param array $params the parameters (name => value) to be bound to the SQL statement specified by [[sql]].
- * @param array $config name-value pairs that will be used to initialize the object properties
- */
- public function __construct($sql, $params = [], $config = [])
- {
- $this->sql = $sql;
- $this->params = $params;
- parent::__construct($config);
- }
+ public $params = [];
/**
* Generates the data needed to determine if dependency has been changed.
@@ -62,6 +49,9 @@ class DbDependency extends Dependency
if (!$db instanceof Connection) {
throw new InvalidConfigException("DbDependency::db must be the application component ID of a DB connection.");
}
+ if ($this->sql === null) {
+ throw new InvalidConfigException("DbDependency::sql must be set.");
+ }
if ($db->enableQueryCache) {
// temporarily disable and re-enable query caching
diff --git a/framework/yii/caching/ExpressionDependency.php b/framework/yii/caching/ExpressionDependency.php
index 36250d2..f6642b4 100644
--- a/framework/yii/caching/ExpressionDependency.php
+++ b/framework/yii/caching/ExpressionDependency.php
@@ -27,7 +27,7 @@ class ExpressionDependency extends Dependency
* A PHP expression can be any PHP code that evaluates to a value. To learn more about what an expression is,
* please refer to the [php manual](http://www.php.net/manual/en/language.expressions.php).
*/
- public $expression;
+ public $expression = 'true';
/**
* @var mixed custom parameters associated with this dependency. You may get the value
* of this property in [[expression]] using `$this->params`.
@@ -35,19 +35,6 @@ class ExpressionDependency extends Dependency
public $params;
/**
- * Constructor.
- * @param string $expression the PHP expression whose result is used to determine the dependency.
- * @param mixed $params the custom parameters associated with this dependency
- * @param array $config name-value pairs that will be used to initialize the object properties
- */
- public function __construct($expression = 'true', $params = null, $config = [])
- {
- $this->expression = $expression;
- $this->params = $params;
- parent::__construct($config);
- }
-
- /**
* Generates the data needed to determine if dependency has been changed.
* This method returns the result of the PHP expression.
* @param Cache $cache the cache component that is currently evaluating this dependency
diff --git a/framework/yii/caching/FileDependency.php b/framework/yii/caching/FileDependency.php
index fa8b147..11afde3 100644
--- a/framework/yii/caching/FileDependency.php
+++ b/framework/yii/caching/FileDependency.php
@@ -6,6 +6,7 @@
*/
namespace yii\caching;
+use yii\base\InvalidConfigException;
/**
* FileDependency represents a dependency based on a file's last modification time.
@@ -25,24 +26,17 @@ class FileDependency extends Dependency
public $fileName;
/**
- * Constructor.
- * @param string $fileName name of the file whose change is to be checked.
- * @param array $config name-value pairs that will be used to initialize the object properties
- */
- public function __construct($fileName = null, $config = [])
- {
- $this->fileName = $fileName;
- parent::__construct($config);
- }
-
- /**
* Generates the data needed to determine if dependency has been changed.
* This method returns the file's last modification time.
* @param Cache $cache the cache component that is currently evaluating this dependency
* @return mixed the data needed to determine if dependency has been changed.
+ * @throws InvalidConfigException if [[fileName]] is not set
*/
protected function generateDependencyData($cache)
{
+ if ($this->fileName === null) {
+ throw new InvalidConfigException('FileDependency::fileName must be set');
+ }
return @filemtime($this->fileName);
}
}
diff --git a/framework/yii/caching/GroupDependency.php b/framework/yii/caching/GroupDependency.php
index 48673f6..1cf7869 100644
--- a/framework/yii/caching/GroupDependency.php
+++ b/framework/yii/caching/GroupDependency.php
@@ -6,6 +6,7 @@
*/
namespace yii\caching;
+use yii\base\InvalidConfigException;
/**
* GroupDependency marks a cached data item with a group name.
@@ -19,29 +20,22 @@ namespace yii\caching;
class GroupDependency extends Dependency
{
/**
- * @var string the group name
+ * @var string the group name. This property must be set.
*/
public $group;
/**
- * Constructor.
- * @param string $group the group name
- * @param array $config name-value pairs that will be used to initialize the object properties
- */
- public function __construct($group, $config = [])
- {
- $this->group = $group;
- parent::__construct($config);
- }
-
- /**
* Generates the data needed to determine if dependency has been changed.
* This method does nothing in this class.
* @param Cache $cache the cache component that is currently evaluating this dependency
* @return mixed the data needed to determine if dependency has been changed.
+ * @throws InvalidConfigException if [[group]] is not set.
*/
protected function generateDependencyData($cache)
{
+ if ($this->group === null) {
+ throw new InvalidConfigException('GroupDependency::group must be set');
+ }
$version = $cache->get([__CLASS__, $this->group]);
if ($version === false) {
$version = $this->invalidate($cache, $this->group);
@@ -53,9 +47,13 @@ class GroupDependency extends Dependency
* Performs the actual dependency checking.
* @param Cache $cache the cache component that is currently evaluating this dependency
* @return boolean whether the dependency is changed or not.
+ * @throws InvalidConfigException if [[group]] is not set.
*/
public function getHasChanged($cache)
{
+ if ($this->group === null) {
+ throw new InvalidConfigException('GroupDependency::group must be set');
+ }
$version = $cache->get([__CLASS__, $this->group]);
return $version === false || $version !== $this->data;
}
diff --git a/framework/yii/caching/MemCache.php b/framework/yii/caching/MemCache.php
index fc7efb4..6f7a760 100644
--- a/framework/yii/caching/MemCache.php
+++ b/framework/yii/caching/MemCache.php
@@ -31,7 +31,7 @@ use yii\base\InvalidConfigException;
* [
* 'components' => [
* 'cache' => [
- * 'class' => 'MemCache',
+ * 'class' => 'yii\caching\MemCache',
* 'servers' => [
* [
* 'host' => 'server1',
diff --git a/framework/yii/captcha/CaptchaAsset.php b/framework/yii/captcha/CaptchaAsset.php
index adece3c..4fc722f 100644
--- a/framework/yii/captcha/CaptchaAsset.php
+++ b/framework/yii/captcha/CaptchaAsset.php
@@ -10,6 +10,8 @@ namespace yii\captcha;
use yii\web\AssetBundle;
/**
+ * This asset bundle provides the javascript files needed for the [[Captcha]] widget.
+ *
* @author Qiang Xue
* @since 2.0
*/
diff --git a/framework/yii/captcha/CaptchaValidator.php b/framework/yii/captcha/CaptchaValidator.php
index 9d9d0fd..01c9d11 100644
--- a/framework/yii/captcha/CaptchaValidator.php
+++ b/framework/yii/captcha/CaptchaValidator.php
@@ -96,7 +96,7 @@ class CaptchaValidator extends Validator
* Returns the JavaScript needed for performing client-side validation.
* @param \yii\base\Model $object the data object being validated
* @param string $attribute the name of the attribute to be validated.
- * @param \yii\base\View $view the view object that is going to be used to render views or view files
+ * @param \yii\web\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @return string the client-side validation script.
*/
diff --git a/framework/yii/classes.php b/framework/yii/classes.php
index 1a3824b..c89e4ff 100644
--- a/framework/yii/classes.php
+++ b/framework/yii/classes.php
@@ -23,6 +23,7 @@ return [
'yii\base\ErrorHandler' => YII_PATH . '/base/ErrorHandler.php',
'yii\base\Event' => YII_PATH . '/base/Event.php',
'yii\base\Exception' => YII_PATH . '/base/Exception.php',
+ 'yii\base\Extension' => YII_PATH . '/base/Extension.php',
'yii\base\Formatter' => YII_PATH . '/base/Formatter.php',
'yii\base\InlineAction' => YII_PATH . '/base/InlineAction.php',
'yii\base\InvalidCallException' => YII_PATH . '/base/InvalidCallException.php',
@@ -42,26 +43,11 @@ return [
'yii\base\UnknownPropertyException' => YII_PATH . '/base/UnknownPropertyException.php',
'yii\base\UserException' => YII_PATH . '/base/UserException.php',
'yii\base\View' => YII_PATH . '/base/View.php',
+ 'yii\base\ViewContextInterface' => YII_PATH . '/base/ViewContextInterface.php',
'yii\base\ViewEvent' => YII_PATH . '/base/ViewEvent.php',
'yii\base\ViewRenderer' => YII_PATH . '/base/ViewRenderer.php',
'yii\base\Widget' => YII_PATH . '/base/Widget.php',
'yii\behaviors\AutoTimestamp' => YII_PATH . '/behaviors/AutoTimestamp.php',
- 'yii\bootstrap\Alert' => YII_PATH . '/bootstrap/Alert.php',
- 'yii\bootstrap\BootstrapAsset' => YII_PATH . '/bootstrap/BootstrapAsset.php',
- 'yii\bootstrap\BootstrapPluginAsset' => YII_PATH . '/bootstrap/BootstrapPluginAsset.php',
- 'yii\bootstrap\BootstrapThemeAsset' => YII_PATH . '/bootstrap/BootstrapThemeAsset.php',
- 'yii\bootstrap\Button' => YII_PATH . '/bootstrap/Button.php',
- 'yii\bootstrap\ButtonDropdown' => YII_PATH . '/bootstrap/ButtonDropdown.php',
- 'yii\bootstrap\ButtonGroup' => YII_PATH . '/bootstrap/ButtonGroup.php',
- 'yii\bootstrap\Carousel' => YII_PATH . '/bootstrap/Carousel.php',
- 'yii\bootstrap\Collapse' => YII_PATH . '/bootstrap/Collapse.php',
- 'yii\bootstrap\Dropdown' => YII_PATH . '/bootstrap/Dropdown.php',
- 'yii\bootstrap\Modal' => YII_PATH . '/bootstrap/Modal.php',
- 'yii\bootstrap\Nav' => YII_PATH . '/bootstrap/Nav.php',
- 'yii\bootstrap\NavBar' => YII_PATH . '/bootstrap/NavBar.php',
- 'yii\bootstrap\Progress' => YII_PATH . '/bootstrap/Progress.php',
- 'yii\bootstrap\Tabs' => YII_PATH . '/bootstrap/Tabs.php',
- 'yii\bootstrap\Widget' => YII_PATH . '/bootstrap/Widget.php',
'yii\caching\ApcCache' => YII_PATH . '/caching/ApcCache.php',
'yii\caching\Cache' => YII_PATH . '/caching/Cache.php',
'yii\caching\ChainedDependency' => YII_PATH . '/caching/ChainedDependency.php',
@@ -154,6 +140,7 @@ return [
'yii\i18n\GettextMoFile' => YII_PATH . '/i18n/GettextMoFile.php',
'yii\i18n\GettextPoFile' => YII_PATH . '/i18n/GettextPoFile.php',
'yii\i18n\I18N' => YII_PATH . '/i18n/I18N.php',
+ 'yii\i18n\MessageFormatter' => YII_PATH . '/i18n/MessageFormatter.php',
'yii\i18n\MessageSource' => YII_PATH . '/i18n/MessageSource.php',
'yii\i18n\MissingTranslationEvent' => YII_PATH . '/i18n/MissingTranslationEvent.php',
'yii\i18n\PhpMessageSource' => YII_PATH . '/i18n/PhpMessageSource.php',
@@ -162,6 +149,10 @@ return [
'yii\log\FileTarget' => YII_PATH . '/log/FileTarget.php',
'yii\log\Logger' => YII_PATH . '/log/Logger.php',
'yii\log\Target' => YII_PATH . '/log/Target.php',
+ 'yii\mutex\DbMutex' => YII_PATH . '/mutex/DbMutex.php',
+ 'yii\mutex\FileMutex' => YII_PATH . '/mutex/FileMutex.php',
+ 'yii\mutex\Mutex' => YII_PATH . '/mutex/Mutex.php',
+ 'yii\mutex\MysqlMutex' => YII_PATH . '/mutex/MysqlMutex.php',
'yii\rbac\Assignment' => YII_PATH . '/rbac/Assignment.php',
'yii\rbac\DbManager' => YII_PATH . '/rbac/DbManager.php',
'yii\rbac\Item' => YII_PATH . '/rbac/Item.php',
@@ -222,6 +213,7 @@ return [
'yii\web\User' => YII_PATH . '/web/User.php',
'yii\web\UserEvent' => YII_PATH . '/web/UserEvent.php',
'yii\web\VerbFilter' => YII_PATH . '/web/VerbFilter.php',
+ 'yii\web\View' => YII_PATH . '/web/View.php',
'yii\web\XmlResponseFormatter' => YII_PATH . '/web/XmlResponseFormatter.php',
'yii\web\YiiAsset' => YII_PATH . '/web/YiiAsset.php',
'yii\widgets\ActiveField' => YII_PATH . '/widgets/ActiveField.php',
diff --git a/framework/yii/console/Request.php b/framework/yii/console/Request.php
index d99c321..d4d3af0 100644
--- a/framework/yii/console/Request.php
+++ b/framework/yii/console/Request.php
@@ -8,6 +8,10 @@
namespace yii\console;
/**
+ * The console Request represents the environment information for a console application.
+ *
+ * It is a wrapper for the PHP `$_SERVER` variable which holds information about the
+ * currently running PHP script and the command line arguments given to it.
*
* @property array $params The command line arguments. It does not include the entry script name.
*
diff --git a/framework/yii/console/Response.php b/framework/yii/console/Response.php
index 9c23e83..f6e6dd0 100644
--- a/framework/yii/console/Response.php
+++ b/framework/yii/console/Response.php
@@ -8,6 +8,8 @@
namespace yii\console;
/**
+ * The console Response represents the result of a console application by holding the [[exitCode]].
+ *
* @author Qiang Xue
* @since 2.0
*/
diff --git a/framework/yii/console/controllers/CacheController.php b/framework/yii/console/controllers/CacheController.php
index 1822b73..43932d1 100644
--- a/framework/yii/console/controllers/CacheController.php
+++ b/framework/yii/console/controllers/CacheController.php
@@ -52,7 +52,7 @@ class CacheController extends Controller
*/
public function actionFlush($component = 'cache')
{
- /** @var $cache Cache */
+ /** @var Cache $cache */
$cache = Yii::$app->getComponent($component);
if (!$cache || !$cache instanceof Cache) {
throw new Exception('Application component "'.$component.'" is not defined or not a cache.');
diff --git a/framework/yii/db/ActiveQuery.php b/framework/yii/db/ActiveQuery.php
index 3b245fe..94494bc 100644
--- a/framework/yii/db/ActiveQuery.php
+++ b/framework/yii/db/ActiveQuery.php
@@ -92,7 +92,7 @@ class ActiveQuery extends Query
if ($this->asArray) {
$model = $row;
} else {
- /** @var $class ActiveRecord */
+ /** @var ActiveRecord $class */
$class = $this->modelClass;
$model = $class::create($row);
}
@@ -115,7 +115,7 @@ class ActiveQuery extends Query
*/
public function createCommand($db = null)
{
- /** @var $modelClass ActiveRecord */
+ /** @var ActiveRecord $modelClass */
$modelClass = $this->modelClass;
if ($db === null) {
$db = $modelClass::getDb();
diff --git a/framework/yii/db/ActiveRecord.php b/framework/yii/db/ActiveRecord.php
index be44a07..57c5c8b 100644
--- a/framework/yii/db/ActiveRecord.php
+++ b/framework/yii/db/ActiveRecord.php
@@ -29,6 +29,8 @@ use yii\helpers\Inflector;
* @property mixed $oldPrimaryKey The old primary key value. An array (column name => column value) is
* returned if the primary key is composite or `$asArray` is true. A string is returned otherwise (null will be
* returned if the key value is null). This property is read-only.
+ * @property array $populatedRelations An array of relation data indexed by relation names. This property is
+ * read-only.
* @property mixed $primaryKey The primary key value. An array (column name => column value) is returned if
* the primary key is composite or `$asArray` is true. A string is returned otherwise (null will be returned if
* the key value is null). This property is read-only.
@@ -107,7 +109,7 @@ class ActiveRecord extends Model
/**
* @var array related models indexed by the relation names
*/
- private $_related;
+ private $_related = [];
/**
@@ -374,22 +376,21 @@ class ActiveRecord extends Model
* This method is overridden so that attributes and related objects can be accessed like properties.
* @param string $name property name
* @return mixed property value
- * @see getAttribute
+ * @see getAttribute()
*/
public function __get($name)
{
if (isset($this->_attributes[$name]) || array_key_exists($name, $this->_attributes)) {
return $this->_attributes[$name];
- } elseif (isset($this->getTableSchema()->columns[$name])) {
+ } elseif ($this->hasAttribute($name)) {
return null;
} else {
- $t = strtolower($name);
- if (isset($this->_related[$t]) || $this->_related !== null && array_key_exists($t, $this->_related)) {
- return $this->_related[$t];
+ if (isset($this->_related[$name]) || array_key_exists($name, $this->_related)) {
+ return $this->_related[$name];
}
$value = parent::__get($name);
if ($value instanceof $this->relationClassName) {
- return $this->_related[$t] = $value->multiple ? $value->all() : $value->one();
+ return $this->_related[$name] = $value->multiple ? $value->all() : $value->one();
} else {
return $value;
}
@@ -434,12 +435,11 @@ class ActiveRecord extends Model
*/
public function __unset($name)
{
- if (isset($this->getTableSchema()->columns[$name])) {
+ if ($this->hasAttribute($name)) {
unset($this->_attributes[$name]);
} else {
- $t = strtolower($name);
- if (isset($this->_related[$t])) {
- unset($this->_related[$t]);
+ if (isset($this->_related[$name])) {
+ unset($this->_related[$name]);
} else {
parent::__unset($name);
}
@@ -527,12 +527,31 @@ class ActiveRecord extends Model
/**
* Populates the named relation with the related records.
* Note that this method does not check if the relation exists or not.
- * @param string $name the relation name (case-insensitive)
+ * @param string $name the relation name (case-sensitive)
* @param ActiveRecord|array|null the related records to be populated into the relation.
*/
public function populateRelation($name, $records)
{
- $this->_related[strtolower($name)] = $records;
+ $this->_related[$name] = $records;
+ }
+
+ /**
+ * Check whether the named relation has been populated with records.
+ * @param string $name the relation name (case-sensitive)
+ * @return bool whether relation has been populated with records.
+ */
+ public function isRelationPopulated($name)
+ {
+ return array_key_exists($name, $this->_related);
+ }
+
+ /**
+ * Returns all populated relations.
+ * @return array an array of relation data indexed by relation names.
+ */
+ public function getPopulatedRelations()
+ {
+ return $this->_related;
}
/**
@@ -546,12 +565,22 @@ class ActiveRecord extends Model
}
/**
+ * Returns a value indicating whether the model has an attribute with the specified name.
+ * @param string $name the name of the attribute
+ * @return boolean whether the model has an attribute with the specified name.
+ */
+ public function hasAttribute($name)
+ {
+ return isset($this->_attributes[$name]) || isset($this->getTableSchema()->columns[$name]);
+ }
+
+ /**
* Returns the named attribute value.
* If this record is the result of a query and the attribute is not loaded,
* null will be returned.
* @param string $name the attribute name
* @return mixed the attribute value. Null if the attribute is not set or does not exist.
- * @see hasAttribute
+ * @see hasAttribute()
*/
public function getAttribute($name)
{
@@ -563,7 +592,7 @@ class ActiveRecord extends Model
* @param string $name the attribute name
* @param mixed $value the attribute value.
* @throws InvalidParamException if the named attribute does not exist.
- * @see hasAttribute
+ * @see hasAttribute()
*/
public function setAttribute($name, $value)
{
@@ -575,16 +604,6 @@ class ActiveRecord extends Model
}
/**
- * Returns a value indicating whether the model has an attribute with the specified name.
- * @param string $name the name of the attribute
- * @return boolean whether the model has an attribute with the specified name.
- */
- public function hasAttribute($name)
- {
- return isset($this->_attributes[$name]) || isset($this->getTableSchema()->columns[$name]);
- }
-
- /**
* Returns the old attribute values.
* @return array the old attribute values (name-value pairs)
*/
@@ -610,7 +629,7 @@ class ActiveRecord extends Model
* @param string $name the attribute name
* @return mixed the old attribute value. Null if the attribute is not loaded before
* or does not exist.
- * @see hasAttribute
+ * @see hasAttribute()
*/
public function getOldAttribute($name)
{
@@ -622,11 +641,11 @@ class ActiveRecord extends Model
* @param string $name the attribute name
* @param mixed $value the old attribute value.
* @throws InvalidParamException if the named attribute does not exist.
- * @see hasAttribute
+ * @see hasAttribute()
*/
public function setOldAttribute($name, $value)
{
- if (isset($this->_oldAttributes[$name]) || isset($this->getTableSchema()->columns[$name])) {
+ if (isset($this->_oldAttributes[$name]) || $this->hasAttribute($name)) {
$this->_oldAttributes[$name] = $value;
} else {
throw new InvalidParamException(get_class($this) . ' has no attribute named "' . $name . '".');
@@ -1015,7 +1034,7 @@ class ActiveRecord extends Model
/**
* Sets the value indicating whether the record is new.
* @param boolean $value whether the record is new and should be inserted when calling [[save()]].
- * @see getIsNewRecord
+ * @see getIsNewRecord()
*/
public function setIsNewRecord($value)
{
@@ -1142,7 +1161,7 @@ class ActiveRecord extends Model
$this->_attributes[$name] = $record->_attributes[$name];
}
$this->_oldAttributes = $this->_attributes;
- $this->_related = null;
+ $this->_related = [];
return true;
}
@@ -1270,6 +1289,8 @@ class ActiveRecord extends Model
$relation = $this->$getter();
if ($relation instanceof $this->relationClassName) {
return $relation;
+ } else {
+ return null;
}
} catch (UnknownMethodException $e) {
throw new InvalidParamException(get_class($this) . ' has no relation named "' . $name . '".', 0, $e);
@@ -1288,7 +1309,7 @@ class ActiveRecord extends Model
*
* Note that this method requires that the primary key value is not null.
*
- * @param string $name the name of the relationship
+ * @param string $name the case sensitive name of the relationship
* @param ActiveRecord $model the model to be linked with the current one.
* @param array $extraColumns additional column values to be saved into the pivot table.
* This parameter is only meaningful for a relationship involving a pivot table
@@ -1304,13 +1325,13 @@ class ActiveRecord extends Model
throw new InvalidCallException('Unable to link models: both models must NOT be newly created.');
}
if (is_array($relation->via)) {
- /** @var $viaRelation ActiveRelation */
+ /** @var ActiveRelation $viaRelation */
list($viaName, $viaRelation) = $relation->via;
- /** @var $viaClass ActiveRecord */
+ /** @var ActiveRecord $viaClass */
$viaClass = $viaRelation->modelClass;
$viaTable = $viaClass::tableName();
// unset $viaName so that it can be reloaded to reflect the change
- unset($this->_related[strtolower($viaName)]);
+ unset($this->_related[$viaName]);
} else {
$viaRelation = $relation->via;
$viaTable = reset($relation->via->from);
@@ -1366,7 +1387,7 @@ class ActiveRecord extends Model
* The model with the foreign key of the relationship will be deleted if `$delete` is true.
* Otherwise, the foreign key will be set null and the model will be saved without validation.
*
- * @param string $name the name of the relationship.
+ * @param string $name the case sensitive name of the relationship.
* @param ActiveRecord $model the model to be unlinked from the current one.
* @param boolean $delete whether to delete the model that contains the foreign key.
* If false, the model's foreign key will be set null and saved.
@@ -1379,12 +1400,12 @@ class ActiveRecord extends Model
if ($relation->via !== null) {
if (is_array($relation->via)) {
- /** @var $viaRelation ActiveRelation */
+ /** @var ActiveRelation $viaRelation */
list($viaName, $viaRelation) = $relation->via;
- /** @var $viaClass ActiveRecord */
+ /** @var ActiveRecord $viaClass */
$viaClass = $viaRelation->modelClass;
$viaTable = $viaClass::tableName();
- unset($this->_related[strtolower($viaName)]);
+ unset($this->_related[$viaName]);
} else {
$viaRelation = $relation->via;
$viaTable = reset($relation->via->from);
@@ -1427,7 +1448,7 @@ class ActiveRecord extends Model
if (!$relation->multiple) {
unset($this->_related[$name]);
} elseif (isset($this->_related[$name])) {
- /** @var $b ActiveRecord */
+ /** @var ActiveRecord $b */
foreach ($this->_related[$name] as $a => $b) {
if ($model->getPrimaryKey() == $b->getPrimaryKey()) {
unset($this->_related[$name][$a]);
diff --git a/framework/yii/db/ActiveRelation.php b/framework/yii/db/ActiveRelation.php
index 72b5667..13ceb14 100644
--- a/framework/yii/db/ActiveRelation.php
+++ b/framework/yii/db/ActiveRelation.php
@@ -31,6 +31,12 @@ class ActiveRelation extends ActiveQuery
use \yii\ar\ActiveRelationTrait;
/**
+ * @var array|ActiveRelation the query associated with the pivot table. Please call [[via()]]
+ * or [[viaTable()]] to set this property instead of directly setting it.
+ */
+ public $via;
+
+ /**
* Specifies the pivot table.
* @param string $tableName the name of the pivot table.
* @param array $link the link between the pivot table and the table associated with [[primaryModel]].
@@ -72,7 +78,7 @@ class ActiveRelation extends ActiveQuery
$this->filterByModels($viaModels);
} elseif (is_array($this->via)) {
// via relation
- /** @var $viaQuery ActiveRelation */
+ /** @var ActiveRelation $viaQuery */
list($viaName, $viaQuery) = $this->via;
if ($viaQuery->multiple) {
$viaModels = $viaQuery->all();
diff --git a/framework/yii/db/Command.php b/framework/yii/db/Command.php
index e1f15b8..6ed0d9c 100644
--- a/framework/yii/db/Command.php
+++ b/framework/yii/db/Command.php
@@ -67,13 +67,15 @@ class Command extends \yii\base\Component
*/
public $fetchMode = \PDO::FETCH_ASSOC;
/**
- * @var string the SQL statement that this command represents
+ * @var array the parameters (name => value) that are bound to the current PDO statement.
+ * This property is maintained by methods such as [[bindValue()]].
+ * Do not modify it directly.
*/
- private $_sql;
+ public $params = [];
/**
- * @var array the parameter log information (name => value)
+ * @var string the SQL statement that this command represents
*/
- private $_params = [];
+ private $_sql;
/**
* Returns the SQL statement for this command.
@@ -95,7 +97,7 @@ class Command extends \yii\base\Component
if ($sql !== $this->_sql) {
$this->cancel();
$this->_sql = $this->db->quoteSql($sql);
- $this->_params = [];
+ $this->params = [];
}
return $this;
}
@@ -108,11 +110,11 @@ class Command extends \yii\base\Component
*/
public function getRawSql()
{
- if (empty($this->_params)) {
+ if (empty($this->params)) {
return $this->_sql;
} else {
$params = [];
- foreach ($this->_params as $name => $value) {
+ foreach ($this->params as $name => $value) {
if (is_string($value)) {
$params[$name] = $this->db->quoteValue($value);
} elseif ($value === null) {
@@ -190,7 +192,7 @@ class Command extends \yii\base\Component
} else {
$this->pdoStatement->bindParam($name, $value, $dataType, $length, $driverOptions);
}
- $this->_params[$name] =& $value;
+ $this->params[$name] =& $value;
return $this;
}
@@ -212,7 +214,7 @@ class Command extends \yii\base\Component
$dataType = $this->db->getSchema()->getPdoType($value);
}
$this->pdoStatement->bindValue($name, $value, $dataType);
- $this->_params[$name] = $value;
+ $this->params[$name] = $value;
return $this;
}
@@ -239,7 +241,7 @@ class Command extends \yii\base\Component
$type = $this->db->getSchema()->getPdoType($value);
}
$this->pdoStatement->bindValue($name, $value, $type);
- $this->_params[$name] = $value;
+ $this->params[$name] = $value;
}
}
return $this;
@@ -258,7 +260,7 @@ class Command extends \yii\base\Component
$rawSql = $this->getRawSql();
- Yii::trace($rawSql, __METHOD__);
+ Yii::info($rawSql, __METHOD__);
if ($sql == '') {
return 0;
@@ -362,9 +364,9 @@ class Command extends \yii\base\Component
$db = $this->db;
$rawSql = $this->getRawSql();
- Yii::trace($rawSql, __METHOD__);
+ Yii::info($rawSql, __METHOD__);
- /** @var $cache \yii\caching\Cache */
+ /** @var \yii\caching\Cache $cache */
if ($db->enableQueryCache && $method !== '') {
$cache = is_string($db->queryCache) ? Yii::$app->getComponent($db->queryCache) : $db->queryCache;
}
diff --git a/framework/yii/db/Migration.php b/framework/yii/db/Migration.php
index 307b02a..37fdf3f 100644
--- a/framework/yii/db/Migration.php
+++ b/framework/yii/db/Migration.php
@@ -158,6 +158,21 @@ class Migration extends \yii\base\Component
}
/**
+ * Creates and executes an batch INSERT SQL statement.
+ * The method will properly escape the column names, and bind the values to be inserted.
+ * @param string $table the table that new rows will be inserted into.
+ * @param array $columns the column names.
+ * @param array $rows the rows to be batch inserted into the table
+ */
+ public function batchInsert($table, $columns, $rows)
+ {
+ echo " > insert into $table ...";
+ $time = microtime(true);
+ $this->db->createCommand()->batchInsert($table, $columns, $rows)->execute();
+ echo " done (time: " . sprintf('%.3f', microtime(true) - $time) . "s)\n";
+ }
+
+ /**
* Creates and executes an UPDATE SQL statement.
* The method will properly escape the column names and bind the values to be updated.
* @param string $table the table to be updated.
diff --git a/framework/yii/db/Query.php b/framework/yii/db/Query.php
index 103cb67..0a26fd9 100644
--- a/framework/yii/db/Query.php
+++ b/framework/yii/db/Query.php
@@ -41,12 +41,12 @@ class Query extends Component
/**
* Sort ascending
- * @see orderBy
+ * @see orderBy()
*/
const SORT_ASC = false;
/**
* Sort descending
- * @see orderBy
+ * @see orderBy()
*/
const SORT_DESC = true;
diff --git a/framework/yii/db/QueryBuilder.php b/framework/yii/db/QueryBuilder.php
index e41fc4d..09948c8 100644
--- a/framework/yii/db/QueryBuilder.php
+++ b/framework/yii/db/QueryBuilder.php
@@ -797,7 +797,13 @@ class QueryBuilder extends \yii\base\Object
}
}
- private function buildHashCondition($condition, &$params)
+ /**
+ * Creates a condition based on column-value pairs.
+ * @param array $condition the condition specification.
+ * @param array $params the binding parameters to be populated
+ * @return string the generated SQL expression
+ */
+ public function buildHashCondition($condition, &$params)
{
$parts = [];
foreach ($condition as $column => $value) {
@@ -824,7 +830,14 @@ class QueryBuilder extends \yii\base\Object
return count($parts) === 1 ? $parts[0] : '(' . implode(') AND (', $parts) . ')';
}
- private function buildAndCondition($operator, $operands, &$params)
+ /**
+ * Connects two or more SQL expressions with the `AND` or `OR` operator.
+ * @param string $operator the operator to use for connecting the given operands
+ * @param array $operands the SQL expressions to connect.
+ * @param array $params the binding parameters to be populated
+ * @return string the generated SQL expression
+ */
+ public function buildAndCondition($operator, $operands, &$params)
{
$parts = [];
foreach ($operands as $operand) {
@@ -842,7 +855,16 @@ class QueryBuilder extends \yii\base\Object
}
}
- private function buildBetweenCondition($operator, $operands, &$params)
+ /**
+ * Creates an SQL expressions with the `BETWEEN` operator.
+ * @param string $operator the operator to use (e.g. `BETWEEN` or `NOT BETWEEN`)
+ * @param array $operands the first operand is the column name. The second and third operands
+ * describe the interval that column value should be in.
+ * @param array $params the binding parameters to be populated
+ * @return string the generated SQL expression
+ * @throws Exception if wrong number of operands have been given.
+ */
+ public function buildBetweenCondition($operator, $operands, &$params)
{
if (!isset($operands[0], $operands[1], $operands[2])) {
throw new Exception("Operator '$operator' requires three operands.");
@@ -861,7 +883,19 @@ class QueryBuilder extends \yii\base\Object
return "$column $operator $phName1 AND $phName2";
}
- private function buildInCondition($operator, $operands, &$params)
+ /**
+ * Creates an SQL expressions with the `IN` operator.
+ * @param string $operator the operator to use (e.g. `IN` or `NOT IN`)
+ * @param array $operands the first operand is the column name. If it is an array
+ * a composite IN condition will be generated.
+ * The second operand is an array of values that column value should be among.
+ * If it is an empty array the generated expression will be a `false` value if
+ * operator is `IN` and empty if operator is `NOT IN`.
+ * @param array $params the binding parameters to be populated
+ * @return string the generated SQL expression
+ * @throws Exception if wrong number of operands have been given.
+ */
+ public function buildInCondition($operator, $operands, &$params)
{
if (!isset($operands[0], $operands[1])) {
throw new Exception("Operator '$operator' requires two operands.");
@@ -933,7 +967,19 @@ class QueryBuilder extends \yii\base\Object
return '(' . implode(', ', $columns) . ") $operator (" . implode(', ', $vss) . ')';
}
- private function buildLikeCondition($operator, $operands, &$params)
+ /**
+ * Creates an SQL expressions with the `LIKE` operator.
+ * @param string $operator the operator to use (e.g. `LIKE`, `NOT LIKE`, `OR LIKE` or `OR NOT LIKE`)
+ * @param array $operands the first operand is the column name.
+ * The second operand is a single value or an array of values that column value
+ * should be compared with.
+ * If it is an empty array the generated expression will be a `false` value if
+ * operator is `LIKE` or `OR LIKE` and empty if operator is `NOT LIKE` or `OR NOT LIKE`.
+ * @param array $params the binding parameters to be populated
+ * @return string the generated SQL expression
+ * @throws Exception if wrong number of operands have been given.
+ */
+ public function buildLikeCondition($operator, $operands, &$params)
{
if (!isset($operands[0], $operands[1])) {
throw new Exception("Operator '$operator' requires two operands.");
diff --git a/framework/yii/db/Schema.php b/framework/yii/db/Schema.php
index 2b3a187..f2ae94c 100644
--- a/framework/yii/db/Schema.php
+++ b/framework/yii/db/Schema.php
@@ -92,14 +92,16 @@ abstract class Schema extends Object
$realName = $this->getRawTableName($name);
if ($db->enableSchemaCache && !in_array($name, $db->schemaCacheExclude, true)) {
- /** @var $cache Cache */
+ /** @var Cache $cache */
$cache = is_string($db->schemaCache) ? Yii::$app->getComponent($db->schemaCache) : $db->schemaCache;
if ($cache instanceof Cache) {
$key = $this->getCacheKey($name);
if ($refresh || ($table = $cache->get($key)) === false) {
$table = $this->loadTableSchema($realName);
if ($table !== null) {
- $cache->set($key, $table, $db->schemaCacheDuration, new GroupDependency($this->getCacheGroup()));
+ $cache->set($key, $table, $db->schemaCacheDuration, new GroupDependency([
+ 'group' => $this->getCacheGroup(),
+ ]));
}
}
return $this->_tables[$name] = $table;
@@ -213,7 +215,7 @@ abstract class Schema extends Object
*/
public function refresh()
{
- /** @var $cache Cache */
+ /** @var Cache $cache */
$cache = is_string($this->db->schemaCache) ? Yii::$app->getComponent($this->db->schemaCache) : $this->db->schemaCache;
if ($this->db->enableSchemaCache && $cache instanceof Cache) {
GroupDependency::invalidate($cache, $this->getCacheGroup());
@@ -289,7 +291,7 @@ abstract class Schema extends Object
* then this method will do nothing.
* @param string $name table name
* @return string the properly quoted table name
- * @see quoteSimpleTableName
+ * @see quoteSimpleTableName()
*/
public function quoteTableName($name)
{
@@ -314,7 +316,7 @@ abstract class Schema extends Object
* then this method will do nothing.
* @param string $name column name
* @return string the properly quoted column name
- * @see quoteSimpleColumnName
+ * @see quoteSimpleColumnName()
*/
public function quoteColumnName($name)
{
diff --git a/framework/yii/db/mssql/Schema.php b/framework/yii/db/mssql/Schema.php
index 0bb5924..deb92f9 100644
--- a/framework/yii/db/mssql/Schema.php
+++ b/framework/yii/db/mssql/Schema.php
@@ -118,6 +118,8 @@ class Schema extends \yii\db\Schema
if ($this->findColumns($table)) {
$this->findForeignKeys($table);
return $table;
+ } else {
+ return null;
}
}
diff --git a/framework/yii/db/pgsql/Schema.php b/framework/yii/db/pgsql/Schema.php
index c4da801..4925984 100644
--- a/framework/yii/db/pgsql/Schema.php
+++ b/framework/yii/db/pgsql/Schema.php
@@ -48,6 +48,7 @@ class Schema extends \yii\db\Schema
'double precision' => self::TYPE_DECIMAL,
'inet' => self::TYPE_STRING,
'smallint' => self::TYPE_SMALLINT,
+ 'int4' => self::TYPE_INTEGER,
'integer' => self::TYPE_INTEGER,
'bigint' => self::TYPE_BIGINT,
'interval' => self::TYPE_STRING,
@@ -130,6 +131,28 @@ class Schema extends \yii\db\Schema
}
/**
+ * Determines the PDO type for the given PHP data value.
+ * @param mixed $data the data whose PDO type is to be determined
+ * @return integer the PDO type
+ * @see http://www.php.net/manual/en/pdo.constants.php
+ */
+ public function getPdoType($data)
+ {
+ // php type => PDO type
+ static $typeMap = [
+ // https://github.com/yiisoft/yii2/issues/1115
+ // Cast boolean to integer values to work around problems with PDO casting false to string '' https://bugs.php.net/bug.php?id=33876
+ 'boolean' => \PDO::PARAM_INT,
+ 'integer' => \PDO::PARAM_INT,
+ 'string' => \PDO::PARAM_STR,
+ 'resource' => \PDO::PARAM_LOB,
+ 'NULL' => \PDO::PARAM_NULL,
+ ];
+ $type = gettype($data);
+ return isset($typeMap[$type]) ? $typeMap[$type] : \PDO::PARAM_STR;
+ }
+
+ /**
* Returns all table names in the database.
* @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema.
* If not empty, the returned table names will be prefixed with the schema name.
@@ -281,7 +304,7 @@ SQL;
$table->columns[$column->name] = $column;
if ($column->isPrimaryKey === true) {
$table->primaryKey[] = $column->name;
- if ($table->sequenceName === null && preg_match("/nextval\('\w+'(::regclass)?\)/", $column->defaultValue) === 1) {
+ if ($table->sequenceName === null && preg_match("/nextval\\('\"?\\w+\"?'(::regclass)?\\)/", $column->defaultValue) === 1) {
$table->sequenceName = preg_replace(['/nextval/', '/::/', '/regclass/', '/\'\)/', '/\(\'/'], '', $column->defaultValue);
}
}
@@ -303,7 +326,7 @@ SQL;
$column->dbType = $info['data_type'];
$column->defaultValue = $info['column_default'];
$column->enumValues = explode(',', str_replace(["''"], ["'"], $info['enum_values']));
- $column->unsigned = false; // has no meanining in PG
+ $column->unsigned = false; // has no meaning in PG
$column->isPrimaryKey = $info['is_pkey'];
$column->name = $info['column_name'];
$column->precision = $info['numeric_precision'];
diff --git a/framework/yii/db/sqlite/QueryBuilder.php b/framework/yii/db/sqlite/QueryBuilder.php
index 2a6f345..4a5407f 100644
--- a/framework/yii/db/sqlite/QueryBuilder.php
+++ b/framework/yii/db/sqlite/QueryBuilder.php
@@ -80,6 +80,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
* @param boolean $check whether to turn on or off the integrity check.
* @param string $schema the schema of the tables. Meaningless for SQLite.
* @param string $table the table name. Meaningless for SQLite.
+ * @return string the SQL statement for checking integrity
* @throws NotSupportedException this is not supported by SQLite
*/
public function checkIntegrity($check = true, $schema = '', $table = '')
diff --git a/framework/yii/db/sqlite/Schema.php b/framework/yii/db/sqlite/Schema.php
index 294c97e..38fbf3a 100644
--- a/framework/yii/db/sqlite/Schema.php
+++ b/framework/yii/db/sqlite/Schema.php
@@ -153,7 +153,7 @@ class Schema extends \yii\db\Schema
$column->type = self::TYPE_STRING;
if (preg_match('/^(\w+)(?:\(([^\)]+)\))?/', $column->dbType, $matches)) {
- $type = $matches[1];
+ $type = strtolower($matches[1]);
if (isset($this->typeMap[$type])) {
$column->type = $this->typeMap[$type];
}
diff --git a/framework/yii/gii/components/ActiveField.php b/framework/yii/gii/components/ActiveField.php
deleted file mode 100644
index 8bb67a9..0000000
--- a/framework/yii/gii/components/ActiveField.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
- * @since 2.0
- */
-class ActiveField extends \yii\widgets\ActiveField
-{
- /**
- * @var Generator
- */
- public $model;
-
- public function init()
- {
- $stickyAttributes = $this->model->stickyAttributes();
- if (in_array($this->attribute, $stickyAttributes)) {
- $this->sticky();
- }
- $hints = $this->model->hints();
- if (isset($hints[$this->attribute])) {
- $this->hint($hints[$this->attribute]);
- }
- }
-
- /**
- * Makes filed remember its value between page reloads
- * @return static the field object itself
- */
- public function sticky()
- {
- $this->options['class'] .= ' sticky';
- return $this;
- }
-}
diff --git a/framework/yii/grid/ActionColumn.php b/framework/yii/grid/ActionColumn.php
index 794198e..2ee1db2 100644
--- a/framework/yii/grid/ActionColumn.php
+++ b/framework/yii/grid/ActionColumn.php
@@ -12,6 +12,8 @@ use Closure;
use yii\helpers\Html;
/**
+ * ActionColumn is a column for the [[GridView]] widget that displays buttons for viewing and manipulating the items.
+ *
* @author Qiang Xue
* @since 2.0
*/
diff --git a/framework/yii/grid/DataColumn.php b/framework/yii/grid/DataColumn.php
index e8a25a7..bd6eacb 100644
--- a/framework/yii/grid/DataColumn.php
+++ b/framework/yii/grid/DataColumn.php
@@ -15,6 +15,10 @@ use yii\helpers\Html;
use yii\helpers\Inflector;
/**
+ * DataColumn is the default column type for the [[GridView]] widget.
+ *
+ * It is used to show data columns and allows sorting them.
+ *
* @author Qiang Xue
* @since 2.0
*/
diff --git a/framework/yii/grid/GridView.php b/framework/yii/grid/GridView.php
index 2981c82..de99a18 100644
--- a/framework/yii/grid/GridView.php
+++ b/framework/yii/grid/GridView.php
@@ -16,6 +16,10 @@ use yii\helpers\Json;
use yii\widgets\BaseListView;
/**
+ * The GridView widget is used to display data in a grid.
+ *
+ * It provides features like sorting, paging and also filtering the data.
+ *
* @author Qiang Xue
* @since 2.0
*/
@@ -89,10 +93,9 @@ class GridView extends BaseListView
*/
public $showFooter = false;
/**
- * @var string|boolean the HTML content to be displayed when [[dataProvider]] does not have any data.
- * If false, the grid view will still be displayed (without body content though).
+ * @var boolean whether to show the grid view if [[dataProvider]] returns no data.
*/
- public $empty = false;
+ public $showOnEmpty = true;
/**
* @var array|Formatter the formatter used to format model attribute values into displayable texts.
* This can be either an instance of [[Formatter]] or an configuration array for creating the [[Formatter]]
@@ -342,7 +345,13 @@ class GridView extends BaseListView
}
}
}
- return "\n" . implode("\n", $rows) . "\n ";
+
+ if (empty($rows)) {
+ $colspan = count($this->columns);
+ return "\n" . $this->renderEmpty() . " \n ";
+ } else {
+ return "\n" . implode("\n", $rows) . "\n ";
+ }
}
/**
diff --git a/framework/yii/grid/GridViewAsset.php b/framework/yii/grid/GridViewAsset.php
index ae49070..a67999d 100644
--- a/framework/yii/grid/GridViewAsset.php
+++ b/framework/yii/grid/GridViewAsset.php
@@ -10,6 +10,7 @@ namespace yii\grid;
use yii\web\AssetBundle;
/**
+ * This asset bundle provides the javascript files for the [[GridView]] widget.
*
* @author Qiang Xue
* @since 2.0
diff --git a/framework/yii/helpers/BaseHtml.php b/framework/yii/helpers/BaseHtml.php
index 9f3df0e..71ad9ea 100644
--- a/framework/yii/helpers/BaseHtml.php
+++ b/framework/yii/helpers/BaseHtml.php
@@ -86,7 +86,7 @@ class BaseHtml
* @param boolean $doubleEncode whether to encode HTML entities in `$content`. If false,
* HTML entities in `$content` will not be further encoded.
* @return string the encoded content
- * @see decode
+ * @see decode()
* @see http://www.php.net/manual/en/function.htmlspecialchars.php
*/
public static function encode($content, $doubleEncode = true)
@@ -99,7 +99,7 @@ class BaseHtml
* This is the opposite of [[encode()]].
* @param string $content the content to be decoded
* @return string the decoded content
- * @see encode
+ * @see encode()
* @see http://www.php.net/manual/en/function.htmlspecialchars-decode.php
*/
public static function decode($content)
@@ -116,8 +116,8 @@ class BaseHtml
* the attributes of the resulting tag. The values will be HTML-encoded using [[encode()]].
* If a value is null, the corresponding attribute will not be rendered.
* @return string the generated HTML tag
- * @see beginTag
- * @see endTag
+ * @see beginTag()
+ * @see endTag()
*/
public static function tag($name, $content = '', $options = [])
{
@@ -132,8 +132,8 @@ class BaseHtml
* the attributes of the resulting tag. The values will be HTML-encoded using [[encode()]].
* If a value is null, the corresponding attribute will not be rendered.
* @return string the generated start tag
- * @see endTag
- * @see tag
+ * @see endTag()
+ * @see tag()
*/
public static function beginTag($name, $options = [])
{
@@ -144,8 +144,8 @@ class BaseHtml
* Generates an end tag.
* @param string $name the tag name
* @return string the generated end tag
- * @see beginTag
- * @see tag
+ * @see beginTag()
+ * @see tag()
*/
public static function endTag($name)
{
@@ -187,7 +187,7 @@ class BaseHtml
* the attributes of the resulting tag. The values will be HTML-encoded using [[encode()]].
* If a value is null, the corresponding attribute will not be rendered.
* @return string the generated link tag
- * @see url
+ * @see url()
*/
public static function cssFile($url, $options = [])
{
@@ -203,7 +203,7 @@ class BaseHtml
* the attributes of the resulting tag. The values will be HTML-encoded using [[encode()]].
* If a value is null, the corresponding attribute will not be rendered.
* @return string the generated script tag
- * @see url
+ * @see url()
*/
public static function jsFile($url, $options = [])
{
@@ -222,7 +222,7 @@ class BaseHtml
* the attributes of the resulting tag. The values will be HTML-encoded using [[encode()]].
* If a value is null, the corresponding attribute will not be rendered.
* @return string the generated form start tag.
- * @see endForm
+ * @see endForm()
*/
public static function beginForm($action = '', $method = 'post', $options = [])
{
@@ -271,7 +271,7 @@ class BaseHtml
/**
* Generates a form end tag.
* @return string the generated tag
- * @see beginForm
+ * @see beginForm()
*/
public static function endForm()
{
@@ -290,7 +290,7 @@ class BaseHtml
* the attributes of the resulting tag. The values will be HTML-encoded using [[encode()]].
* If a value is null, the corresponding attribute will not be rendered.
* @return string the generated hyperlink
- * @see url
+ * @see url()
*/
public static function a($text, $url = null, $options = [])
{
diff --git a/framework/yii/helpers/BaseInflector.php b/framework/yii/helpers/BaseInflector.php
index 8d5fe28..deb8239 100644
--- a/framework/yii/helpers/BaseInflector.php
+++ b/framework/yii/helpers/BaseInflector.php
@@ -328,7 +328,7 @@ class BaseInflector
* Converts a word like "send_email" to "SendEmail". It
* will remove non alphanumeric character from the word, so
* "who's online" will be converted to "WhoSOnline"
- * @see variablize
+ * @see variablize()
* @param string $word the word to CamelCase
* @return string
*/
diff --git a/framework/yii/helpers/BaseSecurity.php b/framework/yii/helpers/BaseSecurity.php
index 6b7f1cf..8e86654 100644
--- a/framework/yii/helpers/BaseSecurity.php
+++ b/framework/yii/helpers/BaseSecurity.php
@@ -175,7 +175,7 @@ class BaseSecurity
/**
* Returns a secret key associated with the specified name.
* If the secret key does not exist, a random key will be generated
- * and saved in the file "keys.php" under the application's runtime directory
+ * and saved in the file "keys.data" under the application's runtime directory
* so that the same secret key can be returned in future requests.
* @param string $name the name that is associated with the secret key
* @param integer $length the length of the key that should be generated if not exists
@@ -184,16 +184,16 @@ class BaseSecurity
public static function getSecretKey($name, $length = 32)
{
static $keys;
- $keyFile = Yii::$app->getRuntimePath() . '/keys.php';
+ $keyFile = Yii::$app->getRuntimePath() . '/keys.json';
if ($keys === null) {
$keys = [];
if (is_file($keyFile)) {
- $keys = require($keyFile);
+ $keys = json_decode(file_get_contents($keyFile), true);
}
}
if (!isset($keys[$name])) {
$keys[$name] = static::generateRandomKey($length);
- file_put_contents($keyFile, " [
+ * 'class' => 'yii\i18n\Formatter',
+ * ]
+ * ```
+ *
* @author Qiang Xue
* @since 2.0
*/
@@ -131,7 +140,12 @@ class Formatter extends \yii\base\Formatter
$formatter = new IntlDateFormatter($this->locale, $this->_dateFormats[$format], IntlDateFormatter::NONE);
} else {
$formatter = new IntlDateFormatter($this->locale, IntlDateFormatter::NONE, IntlDateFormatter::NONE);
- $formatter->setPattern($format);
+ if ($formatter !== null) {
+ $formatter->setPattern($format);
+ }
+ }
+ if ($formatter === null) {
+ throw new InvalidConfigException(intl_get_error_message());
}
return $formatter->format($value);
}
@@ -167,7 +181,12 @@ class Formatter extends \yii\base\Formatter
$formatter = new IntlDateFormatter($this->locale, IntlDateFormatter::NONE, $this->_dateFormats[$format]);
} else {
$formatter = new IntlDateFormatter($this->locale, IntlDateFormatter::NONE, IntlDateFormatter::NONE);
- $formatter->setPattern($format);
+ if ($formatter !== null) {
+ $formatter->setPattern($format);
+ }
+ }
+ if ($formatter === null) {
+ throw new InvalidConfigException(intl_get_error_message());
}
return $formatter->format($value);
}
@@ -203,7 +222,12 @@ class Formatter extends \yii\base\Formatter
$formatter = new IntlDateFormatter($this->locale, $this->_dateFormats[$format], $this->_dateFormats[$format]);
} else {
$formatter = new IntlDateFormatter($this->locale, IntlDateFormatter::NONE, IntlDateFormatter::NONE);
- $formatter->setPattern($format);
+ if ($formatter !== null) {
+ $formatter->setPattern($format);
+ }
+ }
+ if ($formatter === null) {
+ throw new InvalidConfigException(intl_get_error_message());
}
return $formatter->format($value);
}
diff --git a/framework/yii/i18n/GettextMoFile.php b/framework/yii/i18n/GettextMoFile.php
index a92293c..b4a016d 100644
--- a/framework/yii/i18n/GettextMoFile.php
+++ b/framework/yii/i18n/GettextMoFile.php
@@ -54,6 +54,7 @@ class GettextMoFile extends GettextFile
* @param string $context message context
* @return array message translations. Array keys are source messages and array values are translated messages:
* source message => translated message.
+ * @throws Exception if unable to read the MO file
*/
public function load($filePath, $context)
{
@@ -128,6 +129,7 @@ class GettextMoFile extends GettextFile
* @param array $messages message translations. Array keys are source messages and array values are
* translated messages: source message => translated message. Note if the message has a context,
* the message ID must be prefixed with the context with chr(4) as the separator.
+ * @throws Exception if unable to save the MO file
*/
public function save($filePath, $messages)
{
@@ -203,6 +205,8 @@ class GettextMoFile extends GettextFile
{
if ($byteCount > 0) {
return fread($fileHandle, $byteCount);
+ } else {
+ return null;
}
}
diff --git a/framework/yii/i18n/I18N.php b/framework/yii/i18n/I18N.php
index fe0b533..5575621 100644
--- a/framework/yii/i18n/I18N.php
+++ b/framework/yii/i18n/I18N.php
@@ -14,6 +14,9 @@ use yii\base\InvalidConfigException;
/**
* I18N provides features related with internationalization (I18N) and localization (L10N).
*
+ * I18N is configured as an application component in [[yii\base\Application]] by default.
+ * You can access that instance via `Yii::$app->i18n`.
+ *
* @property MessageFormatter $messageFormatter The message formatter to be used to format message via ICU
* message format. Note that the type of this property differs in getter and setter. See
* [[getMessageFormatter()]] and [[setMessageFormatter()]] for details.
diff --git a/framework/yii/i18n/MessageFormatter.php b/framework/yii/i18n/MessageFormatter.php
index 7abff83..43aebdd 100644
--- a/framework/yii/i18n/MessageFormatter.php
+++ b/framework/yii/i18n/MessageFormatter.php
@@ -26,7 +26,7 @@ use yii\base\NotSupportedException;
* to use MessageFormatter features.
*
* The fallback implementation only supports the following message formats:
- * - plural formatting for english
+ * - plural formatting for english ('one' and 'other' selectors)
* - select format
* - simple parameters
* - integer number parameters
@@ -92,14 +92,16 @@ class MessageFormatter extends Component
return $this->fallbackFormat($pattern, $params, $language);
}
- if (version_compare(PHP_VERSION, '5.5.0', '<')) {
- $pattern = $this->replaceNamedArguments($pattern, $params);
- $params = array_values($params);
+ if (version_compare(PHP_VERSION, '5.5.0', '<') || version_compare(INTL_ICU_VERSION, '4.8', '<')) {
+ // replace named arguments
+ $pattern = $this->replaceNamedArguments($pattern, $params, $newParams);
+ $params = $newParams;
}
+
$formatter = new \MessageFormatter($language, $pattern);
if ($formatter === null) {
- $this->_errorCode = -1;
- $this->_errorMessage = "Message pattern is invalid.";
+ $this->_errorCode = intl_get_error_code();
+ $this->_errorMessage = "Message pattern is invalid: " . intl_get_error_message();
return false;
}
$result = $formatter->format($params);
@@ -136,6 +138,8 @@ class MessageFormatter extends Component
// replace named arguments
if (($tokens = $this->tokenizePattern($pattern)) === false) {
+ $this->_errorCode = -1;
+ $this->_errorMessage = "Message pattern is invalid.";
return false;
}
$map = [];
@@ -179,48 +183,49 @@ class MessageFormatter extends Component
* @param array $args The array of values to insert into the format string.
* @return string The pattern string with placeholders replaced.
*/
- private static function replaceNamedArguments($pattern, $args)
+ private function replaceNamedArguments($pattern, $givenParams, &$resultingParams, &$map = [])
{
- $map = array_flip(array_keys($args));
-
- // parsing pattern based on ICU grammar:
- // http://icu-project.org/apiref/icu4c/classMessageFormat.html#details
- $parts = explode('{', $pattern);
- $c = count($parts);
- $pattern = $parts[0];
- $d = 0;
- $stack = [];
- for ($i = 1; $i < $c; $i++) {
- if (preg_match('~^(\s*)([\d\w]+)(\s*)([},])(\s*)(.*)$~us', $parts[$i], $matches)) {
- // if we are not inside a plural or select this is a message
- if (!isset($stack[$d]) || $stack[$d] != 'plural' && $stack[$d] != 'select') {
- $d++;
- // replace normal arg if it is available
- if (isset($map[$matches[2]])) {
- $q = '';
- $pattern .= '{' . $matches[1] . $map[$matches[2]] . $matches[3];
- } else {
- // quote unused args
- $q = ($matches[4] == '}') ? "'" : "";
- $pattern .= "$q{" . $matches[1] . $matches[2] . $matches[3];
- }
- $pattern .= ($term = $matches[4] . $q . $matches[5] . $matches[6]);
- // store type of current level
- $stack[$d] = ($matches[4] == ',') ? substr($matches[6], 0, 6) : 'none';
- // if it's plural or select, the next bracket is NOT begin of a message then!
- if ($stack[$d] == 'plural' || $stack[$d] == 'select') {
- $i++;
- $d -= substr_count($term, '}');
- } else {
- $d -= substr_count($term, '}');
- continue;
+ if (($tokens = $this->tokenizePattern($pattern)) === false) {
+ return false;
+ }
+ foreach($tokens as $i => $token) {
+ if (!is_array($token)) {
+ continue;
+ }
+ $param = trim($token[0]);
+ if (isset($givenParams[$param])) {
+ // if param is given, replace it with a number
+ if (!isset($map[$param])) {
+ $map[$param] = count($map);
+ // make sure only used params are passed to format method
+ $resultingParams[$map[$param]] = $givenParams[$param];
+ }
+ $token[0] = $map[$param];
+ $quote = "";
+ } else {
+ // quote unused token
+ $quote = "'";
+ }
+ $type = isset($token[1]) ? trim($token[1]) : 'none';
+ // replace plural and select format recursively
+ if ($type == 'plural' || $type == 'select') {
+ if (!isset($token[2])) {
+ return false;
+ }
+ $subtokens = $this->tokenizePattern($token[2]);
+ $c = count($subtokens);
+ for ($k = 0; $k + 1 < $c; $k++) {
+ if (is_array($subtokens[$k]) || !is_array($subtokens[++$k])) {
+ return false;
}
+ $subpattern = $this->replaceNamedArguments(implode(',', $subtokens[$k]), $givenParams, $resultingParams, $map);
+ $subtokens[$k] = $quote . '{' . $quote . $subpattern . $quote . '}' . $quote;
}
+ $token[2] = implode('', $subtokens);
}
- $pattern .= '{' . $parts[$i];
- $d += 1 - substr_count($parts[$i], '}');
+ $tokens[$i] = $quote . '{' . $quote . implode(',', $token) . $quote . '}' . $quote;
}
- return $pattern;
+ return implode('', $tokens);
}
/**
@@ -233,11 +238,15 @@ class MessageFormatter extends Component
protected function fallbackFormat($pattern, $args, $locale)
{
if (($tokens = $this->tokenizePattern($pattern)) === false) {
+ $this->_errorCode = -1;
+ $this->_errorMessage = "Message pattern is invalid.";
return false;
}
foreach($tokens as $i => $token) {
if (is_array($token)) {
if (($tokens[$i] = $this->parseToken($token, $args, $locale)) === false) {
+ $this->_errorCode = -1;
+ $this->_errorMessage = "Message pattern is invalid.";
return false;
}
}
@@ -296,6 +305,9 @@ class MessageFormatter extends Component
*/
private function parseToken($token, $args, $locale)
{
+ // parsing pattern based on ICU grammar:
+ // http://icu-project.org/apiref/icu4c/classMessageFormat.html#details
+
$param = trim($token[0]);
if (isset($args[$param])) {
$arg = $args[$param];
@@ -323,6 +335,9 @@ class MessageFormatter extends Component
/* http://icu-project.org/apiref/icu4c/classicu_1_1SelectFormat.html
selectStyle = (selector '{' message '}')+
*/
+ if (!isset($token[2])) {
+ return false;
+ }
$select = static::tokenizePattern($token[2]);
$c = count($select);
$message = false;
@@ -348,6 +363,9 @@ class MessageFormatter extends Component
keyword = [^[[:Pattern_Syntax:][:Pattern_White_Space:]]]+
message: see MessageFormat
*/
+ if (!isset($token[2])) {
+ return false;
+ }
$plural = static::tokenizePattern($token[2]);
$c = count($plural);
$message = false;
@@ -363,9 +381,7 @@ class MessageFormatter extends Component
}
if ($message === false && $selector == 'other' ||
$selector[0] == '=' && (int) mb_substr($selector, 1) == $arg ||
- $selector == 'zero' && $arg - $offset == 0 ||
- $selector == 'one' && $arg - $offset == 1 ||
- $selector == 'two' && $arg - $offset == 2
+ $selector == 'one' && $arg - $offset == 1
) {
$message = implode(',', str_replace('#', $arg - $offset, $plural[$i]));
}
diff --git a/framework/yii/log/Target.php b/framework/yii/log/Target.php
index cd1256a..c9d5d97 100644
--- a/framework/yii/log/Target.php
+++ b/framework/yii/log/Target.php
@@ -112,7 +112,7 @@ abstract class Target extends Component
{
$context = [];
if ($this->logUser && ($user = Yii::$app->getComponent('user', false)) !== null) {
- /** @var $user \yii\web\User */
+ /** @var \yii\web\User $user */
$context[] = 'User: ' . $user->getId();
}
diff --git a/framework/yii/mail/BaseMailer.php b/framework/yii/mail/BaseMailer.php
new file mode 100644
index 0000000..90565c9
--- /dev/null
+++ b/framework/yii/mail/BaseMailer.php
@@ -0,0 +1,300 @@
+
+ * @since 2.0
+ */
+abstract class BaseMailer extends Component implements MailerInterface, ViewContextInterface
+{
+ /**
+ * @var string directory containing view files for this email messages.
+ * This can be specified as an absolute path or path alias.
+ */
+ public $viewPath = '@app/mails';
+ /**
+ * @var string|boolean HTML layout view name. This is the layout used to render HTML mail body.
+ * The property can take the following values:
+ *
+ * - a relative view name: a view file relative to [[viewPath]], e.g., 'layouts/html'.
+ * - a path alias: an absolute view file path specified as a path alias, e.g., '@app/mails/html'.
+ * - a boolean false: the layout is disabled.
+ */
+ public $htmlLayout = 'layouts/html';
+ /**
+ * @var string|boolean text layout view name. This is the layout used to render TEXT mail body.
+ * Please refer to [[htmlLayout]] for possible values that this property can take.
+ */
+ public $textLayout = 'layouts/text';
+ /**
+ * @var array the configuration that should be applied to any newly created
+ * email message instance by [[createMessage()]] or [[compose()]]. Any valid property defined
+ * by [[MessageInterface]] can be configured, such as `from`, `to`, `subject`, `textBody`, `htmlBody`, etc.
+ *
+ * For example:
+ *
+ * ~~~
+ * [
+ * 'charset' => 'UTF-8',
+ * 'from' => 'noreply@mydomain.com',
+ * 'bcc' => 'developer@mydomain.com',
+ * ]
+ * ~~~
+ */
+ public $messageConfig = [];
+ /**
+ * @var string the default class name of the new message instances created by [[createMessage()]]
+ */
+ public $messageClass = 'yii\mail\BaseMessage';
+ /**
+ * @var boolean whether to save email messages as files under [[fileTransportPath]] instead of sending them
+ * to the actual recipients. This is usually used during development for debugging purpose.
+ * @see fileTransportPath
+ */
+ public $useFileTransport = false;
+ /**
+ * @var string the directory where the email messages are saved when [[useFileTransport]] is true.
+ */
+ public $fileTransportPath = '@runtime/mail';
+ /**
+ * @var callback a PHP callback that will be called by [[send()]] when [[useFileTransport]] is true.
+ * The callback should return a file name which will be used to save the email message.
+ * If not set, the file name will be generated based on the current timestamp.
+ *
+ * The signature of the callback is:
+ *
+ * ~~~
+ * function ($mailer, $message)
+ * ~~~
+ */
+ public $fileTransportCallback;
+
+ /**
+ * @var \yii\base\View|array view instance or its array configuration.
+ */
+ private $_view = [];
+
+ /**
+ * @param array|View $view view instance or its array configuration that will be used to
+ * render message bodies.
+ * @throws InvalidConfigException on invalid argument.
+ */
+ public function setView($view)
+ {
+ if (!is_array($view) && !is_object($view)) {
+ throw new InvalidConfigException('"' . get_class($this) . '::view" should be either object or configuration array, "' . gettype($view) . '" given.');
+ }
+ $this->_view = $view;
+ }
+
+ /**
+ * @return View view instance.
+ */
+ public function getView()
+ {
+ if (!is_object($this->_view)) {
+ $this->_view = $this->createView($this->_view);
+ }
+ return $this->_view;
+ }
+
+ /**
+ * Creates view instance from given configuration.
+ * @param array $config view configuration.
+ * @return View view instance.
+ */
+ protected function createView(array $config)
+ {
+ if (!array_key_exists('class', $config)) {
+ $config['class'] = View::className();
+ }
+ return Yii::createObject($config);
+ }
+
+ /**
+ * Creates a new message instance and optionally composes its body content via view rendering.
+ *
+ * @param string|array $view the view to be used for rendering the message body. This can be:
+ *
+ * - a string, which represents the view name or path alias for rendering the HTML body of the email.
+ * In this case, the text body will be generated by applying `strip_tags()` to the HTML body.
+ * - an array with 'html' and/or 'text' elements. The 'html' element refers to the view name or path alias
+ * for rendering the HTML body, while 'text' element is for rendering the text body. For example,
+ * `['html' => 'contact-html', 'text' => 'contact-text']`.
+ * - null, meaning the message instance will be returned without body content.
+ *
+ * The view to be rendered can be specified in one of the following formats:
+ *
+ * - path alias (e.g. "@app/mails/contact");
+ * - a relative view name (e.g. "contact"): the actual view file will be resolved by [[findViewFile()]]
+ *
+ * @param array $params the parameters (name-value pairs) that will be extracted and made available in the view file.
+ * @return MessageInterface message instance.
+ */
+ public function compose($view = null, array $params = [])
+ {
+ $message = $this->createMessage();
+ if ($view !== null) {
+ $params['message'] = $message;
+ if (is_array($view)) {
+ if (isset($view['html'])) {
+ $html = $this->render($view['html'], $params, $this->htmlLayout);
+ }
+ if (isset($view['text'])) {
+ $text = $this->render($view['text'], $params, $this->textLayout);
+ }
+ } else {
+ $html = $this->render($view, $params, $this->htmlLayout);
+ }
+ if (isset($html)) {
+ $message->setHtmlBody($html);
+ }
+ if (isset($text)) {
+ $message->setTextBody($text);
+ } elseif (isset($html)) {
+ $message->setTextBody(strip_tags($html));
+ }
+ }
+ return $message;
+ }
+
+ /**
+ * Creates a new message instance.
+ * The newly created instance will be initialized with the configuration specified by [[messageConfig]].
+ * If the configuration does not specify a 'class', the [[messageClass]] will be used as the class
+ * of the new message instance.
+ * @return MessageInterface message instance.
+ */
+ protected function createMessage()
+ {
+ $config = $this->messageConfig;
+ if (!array_key_exists('class', $config)) {
+ $config['class'] = $this->messageClass;
+ }
+ return Yii::createObject($config);
+ }
+
+ /**
+ * Sends the given email message.
+ * This method will log a message about the email being sent.
+ * If [[useFileTransport]] is true, it will save the email as a file under [[fileTransportPath]].
+ * Otherwise, it will call [[sendMessage()]] to send the email to its recipient(s).
+ * Child classes should implement [[sendMessage()]] with the actual email sending logic.
+ * @param MessageInterface $message email message instance to be sent
+ * @return boolean whether the message has been sent successfully
+ */
+ public function send($message)
+ {
+ $address = $message->getTo();
+ if (is_array($address)) {
+ $address = implode(', ', array_keys($address));
+ }
+ Yii::info('Sending email "' . $message->getSubject() . '" to "' . $address . '"', __METHOD__);
+
+ if ($this->useFileTransport) {
+ return $this->saveMessage($message);
+ } else {
+ return $this->sendMessage($message);
+ }
+ }
+
+ /**
+ * Sends multiple messages at once.
+ *
+ * The default implementation simply calls [[send()]] multiple times.
+ * Child classes may override this method to implement more efficient way of
+ * sending multiple messages.
+ *
+ * @param array $messages list of email messages, which should be sent.
+ * @return integer number of messages that are successfully sent.
+ */
+ public function sendMultiple(array $messages)
+ {
+ $successCount = 0;
+ foreach ($messages as $message) {
+ if ($this->send($message)) {
+ $successCount++;
+ }
+ }
+ return $successCount;
+ }
+
+ /**
+ * Renders the specified view with optional parameters and layout.
+ * The view will be rendered using the [[view]] component.
+ * @param string $view the view name or the path alias of the view file.
+ * @param array $params the parameters (name-value pairs) that will be extracted and made available in the view file.
+ * @param string|boolean $layout layout view name or path alias. If false, no layout will be applied.
+ * @return string the rendering result.
+ */
+ public function render($view, $params = [], $layout = false)
+ {
+ $output = $this->getView()->render($view, $params, $this);
+ if ($layout !== false) {
+ return $this->getView()->render($layout, ['content' => $output], $this);
+ } else {
+ return $output;
+ }
+ }
+
+ /**
+ * Sends the specified message.
+ * This method should be implemented by child classes with the actual email sending logic.
+ * @param MessageInterface $message the message to be sent
+ * @return boolean whether the message is sent successfully
+ */
+ abstract protected function sendMessage($message);
+
+ /**
+ * Saves the message as a file under [[fileTransportPath]].
+ * @param MessageInterface $message
+ * @return boolean whether the message is saved successfully
+ */
+ protected function saveMessage($message)
+ {
+ $path = Yii::getAlias($this->fileTransportPath);
+ if (!is_dir(($path))) {
+ mkdir($path, 0777, true);
+ }
+ if ($this->fileTransportCallback !== null) {
+ $file = $path . '/' . call_user_func($this->fileTransportCallback, $this, $message);
+ } else {
+ $time = microtime(true);
+ $file = $path . '/' . date('Ymd-His-', $time) . sprintf('%04d', (int)(($time - (int)$time) * 10000)) . '-' . sprintf('%04d', mt_rand(0, 10000)) . '.eml';
+ }
+ file_put_contents($file, $message->toString());
+ return true;
+ }
+
+ /**
+ * Finds the view file corresponding to the specified relative view name.
+ * This method will return the view file by prefixing the view name with [[viewPath]].
+ * @param string $view a relative view name. The name does NOT start with a slash.
+ * @return string the view file path. Note that the file may not exist.
+ */
+ public function findViewFile($view)
+ {
+ return Yii::getAlias($this->viewPath) . DIRECTORY_SEPARATOR . $view;
+ }
+}
diff --git a/framework/yii/mail/BaseMessage.php b/framework/yii/mail/BaseMessage.php
new file mode 100644
index 0000000..01b671c
--- /dev/null
+++ b/framework/yii/mail/BaseMessage.php
@@ -0,0 +1,59 @@
+
+ * @since 2.0
+ */
+abstract class BaseMessage extends Object implements MessageInterface
+{
+ /**
+ * @return MailerInterface the mailer component
+ */
+ public function getMailer()
+ {
+ return Yii::$app->getComponent('mail');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function send()
+ {
+ return $this->getMailer()->send($this);
+ }
+
+ /**
+ * PHP magic method that returns the string representation of this object.
+ * @return string the string representation of this object.
+ */
+ public function __toString()
+ {
+ // __toString cannot throw exception
+ // use trigger_error to bypass this limitation
+ try {
+ return $this->toString();
+ } catch (\Exception $e) {
+ trigger_error($e->getMessage());
+ return '';
+ }
+ }
+}
diff --git a/framework/yii/mail/MailerInterface.php b/framework/yii/mail/MailerInterface.php
new file mode 100644
index 0000000..5ee9ccd
--- /dev/null
+++ b/framework/yii/mail/MailerInterface.php
@@ -0,0 +1,64 @@
+mail->compose('contact/html', ['contactForm' => $form])
+ * ->setFrom('from@domain.com')
+ * ->setTo($form->email)
+ * ->setSubject($form->subject)
+ * ->send();
+ * ~~~
+ *
+ * @see MessageInterface
+ *
+ * @author Paul Klimov
+ * @since 2.0
+ */
+interface MailerInterface
+{
+ /**
+ * Creates a new message instance and optionally composes its body content via view rendering.
+ *
+ * @param string|array $view the view to be used for rendering the message body. This can be:
+ *
+ * - a string, which represents the view name or path alias for rendering the HTML body of the email.
+ * In this case, the text body will be generated by applying `strip_tags()` to the HTML body.
+ * - an array with 'html' and/or 'text' elements. The 'html' element refers to the view name or path alias
+ * for rendering the HTML body, while 'text' element is for rendering the text body. For example,
+ * `['html' => 'contact-html', 'text' => 'contact-text']`.
+ * - null, meaning the message instance will be returned without body content.
+ *
+ * @param array $params the parameters (name-value pairs) that will be extracted and made available in the view file.
+ * @return MessageInterface message instance.
+ */
+ public function compose($view = null, array $params = []);
+
+ /**
+ * Sends the given email message.
+ * @param MessageInterface $message email message instance to be sent
+ * @return boolean whether the message has been sent successfully
+ */
+ public function send($message);
+
+ /**
+ * Sends multiple messages at once.
+ *
+ * This method may be implemented by some mailers which support more efficient way of sending multiple messages in the same batch.
+ *
+ * @param array $messages list of email messages, which should be sent.
+ * @return integer number of messages that are successfully sent.
+ */
+ public function sendMultiple(array $messages);
+}
diff --git a/framework/yii/mail/MessageInterface.php b/framework/yii/mail/MessageInterface.php
new file mode 100644
index 0000000..eba9064
--- /dev/null
+++ b/framework/yii/mail/MessageInterface.php
@@ -0,0 +1,216 @@
+mail->compose()
+ * ->setFrom('from@domain.com')
+ * ->setTo($form->email)
+ * ->setSubject($form->subject)
+ * ->setTextBody('Plain text content')
+ * ->setHtmlBody('HTML content ')
+ * ->send();
+ * ~~~
+ *
+ * @see MailerInterface
+ *
+ * @author Paul Klimov
+ * @since 2.0
+ */
+interface MessageInterface
+{
+ /**
+ * Returns the character set of this message.
+ * @return string the character set of this message.
+ */
+ public function getCharset();
+
+ /**
+ * Sets the character set of this message.
+ * @param string $charset character set name.
+ * @return static self reference.
+ */
+ public function setCharset($charset);
+
+ /**
+ * Returns the message sender.
+ * @return string the sender
+ */
+ public function getFrom();
+
+ /**
+ * Sets the message sender.
+ * @param string|array $from sender email address.
+ * You may pass an array of addresses if this message is from multiple people.
+ * You may also specify sender name in addition to email address using format:
+ * `[email => name]`.
+ * @return static self reference.
+ */
+ public function setFrom($from);
+
+ /**
+ * Returns the message recipient(s).
+ * @return array the message recipients
+ */
+ public function getTo();
+
+ /**
+ * Sets the message recipient(s).
+ * @param string|array $to receiver email address.
+ * You may pass an array of addresses if multiple recipients should receive this message.
+ * You may also specify receiver name in addition to email address using format:
+ * `[email => name]`.
+ * @return static self reference.
+ */
+ public function setTo($to);
+
+ /**
+ * Returns the reply-to address of this message.
+ * @return string the reply-to address of this message.
+ */
+ public function getReplyTo();
+
+ /**
+ * Sets the reply-to address of this message.
+ * @param string|array $replyTo the reply-to address.
+ * You may pass an array of addresses if this message should be replied to multiple people.
+ * You may also specify reply-to name in addition to email address using format:
+ * `[email => name]`.
+ * @return static self reference.
+ */
+ public function setReplyTo($replyTo);
+
+ /**
+ * Returns the Cc (additional copy receiver) addresses of this message.
+ * @return array the Cc (additional copy receiver) addresses of this message.
+ */
+ public function getCc();
+
+ /**
+ * Sets the Cc (additional copy receiver) addresses of this message.
+ * @param string|array $cc copy receiver email address.
+ * You may pass an array of addresses if multiple recipients should receive this message.
+ * You may also specify receiver name in addition to email address using format:
+ * `[email => name]`.
+ * @return static self reference.
+ */
+ public function setCc($cc);
+
+ /**
+ * Returns the Bcc (hidden copy receiver) addresses of this message.
+ * @return array the Bcc (hidden copy receiver) addresses of this message.
+ */
+ public function getBcc();
+
+ /**
+ * Sets the Bcc (hidden copy receiver) addresses of this message.
+ * @param string|array $bcc hidden copy receiver email address.
+ * You may pass an array of addresses if multiple recipients should receive this message.
+ * You may also specify receiver name in addition to email address using format:
+ * `[email => name]`.
+ * @return static self reference.
+ */
+ public function setBcc($bcc);
+
+ /**
+ * Returns the message subject.
+ * @return string the message subject
+ */
+ public function getSubject();
+
+ /**
+ * Sets the message subject.
+ * @param string $subject message subject
+ * @return static self reference.
+ */
+ public function setSubject($subject);
+
+ /**
+ * Sets message plain text content.
+ * @param string $text message plain text content.
+ * @return static self reference.
+ */
+ public function setTextBody($text);
+
+ /**
+ * Sets message HTML content.
+ * @param string $html message HTML content.
+ * @return static self reference.
+ */
+ public function setHtmlBody($html);
+
+ /**
+ * Attaches existing file to the email message.
+ * @param string $fileName full file name
+ * @param array $options options for embed file. Valid options are:
+ *
+ * - fileName: name, which should be used to attach file.
+ * - contentType: attached file MIME type.
+ *
+ * @return static self reference.
+ */
+ public function attach($fileName, array $options = []);
+
+ /**
+ * Attach specified content as file for the email message.
+ * @param string $content attachment file content.
+ * @param array $options options for embed file. Valid options are:
+ *
+ * - fileName: name, which should be used to attach file.
+ * - contentType: attached file MIME type.
+ *
+ * @return static self reference.
+ */
+ public function attachContent($content, array $options = []);
+
+ /**
+ * Attach a file and return it's CID source.
+ * This method should be used when embedding images or other data in a message.
+ * @param string $fileName file name.
+ * @param array $options options for embed file. Valid options are:
+ *
+ * - fileName: name, which should be used to attach file.
+ * - contentType: attached file MIME type.
+ *
+ * @return string attachment CID.
+ */
+ public function embed($fileName, array $options = []);
+
+ /**
+ * Attach a content as file and return it's CID source.
+ * This method should be used when embedding images or other data in a message.
+ * @param string $content attachment file content.
+ * @param array $options options for embed file. Valid options are:
+ *
+ * - fileName: name, which should be used to attach file.
+ * - contentType: attached file MIME type.
+ *
+ * @return string attachment CID.
+ */
+ public function embedContent($content, array $options = []);
+
+ /**
+ * Sends this email message.
+ * @return boolean whether this message is sent successfully.
+ */
+ public function send();
+
+ /**
+ * Returns string representation of this message.
+ * @return string the string representation of this message.
+ */
+ public function toString();
+}
diff --git a/extensions/mutex/yii/mutex/DbMutex.php b/framework/yii/mutex/DbMutex.php
similarity index 100%
rename from extensions/mutex/yii/mutex/DbMutex.php
rename to framework/yii/mutex/DbMutex.php
diff --git a/extensions/mutex/yii/mutex/FileMutex.php b/framework/yii/mutex/FileMutex.php
similarity index 100%
rename from extensions/mutex/yii/mutex/FileMutex.php
rename to framework/yii/mutex/FileMutex.php
diff --git a/extensions/mutex/yii/mutex/Mutex.php b/framework/yii/mutex/Mutex.php
similarity index 100%
rename from extensions/mutex/yii/mutex/Mutex.php
rename to framework/yii/mutex/Mutex.php
diff --git a/extensions/mutex/yii/mutex/MysqlMutex.php b/framework/yii/mutex/MysqlMutex.php
similarity index 100%
rename from extensions/mutex/yii/mutex/MysqlMutex.php
rename to framework/yii/mutex/MysqlMutex.php
diff --git a/framework/yii/rbac/PhpManager.php b/framework/yii/rbac/PhpManager.php
index a91d9bd..57ede09 100644
--- a/framework/yii/rbac/PhpManager.php
+++ b/framework/yii/rbac/PhpManager.php
@@ -36,8 +36,8 @@ class PhpManager extends Manager
* If not set, it will be using 'protected/data/rbac.php' as the data file.
* Make sure this file is writable by the Web server process if the authorization
* needs to be changed.
- * @see loadFromFile
- * @see saveToFile
+ * @see loadFromFile()
+ * @see saveToFile()
*/
public $authFile;
@@ -74,7 +74,7 @@ class PhpManager extends Manager
if (!isset($this->_items[$itemName])) {
return false;
}
- /** @var $item Item */
+ /** @var Item $item */
$item = $this->_items[$itemName];
Yii::trace('Checking permission: ' . $item->getName(), __METHOD__);
if (!isset($params['userId'])) {
@@ -85,7 +85,7 @@ class PhpManager extends Manager
return true;
}
if (isset($this->_assignments[$userId][$itemName])) {
- /** @var $assignment Assignment */
+ /** @var Assignment $assignment */
$assignment = $this->_assignments[$userId][$itemName];
if ($this->executeBizRule($assignment->bizRule, $params, $assignment->data)) {
return true;
@@ -113,9 +113,9 @@ class PhpManager extends Manager
if (!isset($this->_items[$childName], $this->_items[$itemName])) {
throw new Exception("Either '$itemName' or '$childName' does not exist.");
}
- /** @var $child Item */
+ /** @var Item $child */
$child = $this->_items[$childName];
- /** @var $item Item */
+ /** @var Item $item */
$item = $this->_items[$itemName];
$this->checkItemChildType($item->type, $child->type);
if ($this->detectLoop($itemName, $childName)) {
@@ -270,14 +270,14 @@ class PhpManager extends Manager
$items = [];
if ($userId === null) {
foreach ($this->_items as $name => $item) {
- /** @var $item Item */
+ /** @var Item $item */
if ($item->type == $type) {
$items[$name] = $item;
}
}
} elseif (isset($this->_assignments[$userId])) {
foreach ($this->_assignments[$userId] as $assignment) {
- /** @var $assignment Assignment */
+ /** @var Assignment $assignment */
$name = $assignment->itemName;
if (isset($this->_items[$name]) && ($type === null || $this->_items[$name]->type == $type)) {
$items[$name] = $this->_items[$name];
@@ -400,7 +400,7 @@ class PhpManager extends Manager
{
$items = [];
foreach ($this->_items as $name => $item) {
- /** @var $item Item */
+ /** @var Item $item */
$items[$name] = [
'type' => $item->type,
'description' => $item->description,
@@ -409,7 +409,7 @@ class PhpManager extends Manager
];
if (isset($this->_children[$name])) {
foreach ($this->_children[$name] as $child) {
- /** @var $child Item */
+ /** @var Item $child */
$items[$name]['children'][] = $child->getName();
}
}
@@ -417,7 +417,7 @@ class PhpManager extends Manager
foreach ($this->_assignments as $userId => $assignments) {
foreach ($assignments as $name => $assignment) {
- /** @var $assignment Assignment */
+ /** @var Assignment $assignment */
if (isset($items[$name])) {
$items[$name]['assignments'][$userId] = [
'bizRule' => $assignment->bizRule,
@@ -505,7 +505,7 @@ class PhpManager extends Manager
return false;
}
foreach ($this->_children[$childName] as $child) {
- /** @var $child Item */
+ /** @var Item $child */
if ($this->detectLoop($itemName, $child->getName())) {
return true;
}
@@ -517,7 +517,7 @@ class PhpManager extends Manager
* Loads the authorization data from a PHP script file.
* @param string $file the file path.
* @return array the authorization data
- * @see saveToFile
+ * @see saveToFile()
*/
protected function loadFromFile($file)
{
@@ -532,7 +532,7 @@ class PhpManager extends Manager
* Saves the authorization data to a PHP script file.
* @param array $data the authorization data
* @param string $file the file path.
- * @see loadFromFile
+ * @see loadFromFile()
*/
protected function saveToFile($data, $file)
{
diff --git a/framework/yii/requirements/requirements.php b/framework/yii/requirements/requirements.php
index f70f414..34b556e 100644
--- a/framework/yii/requirements/requirements.php
+++ b/framework/yii/requirements/requirements.php
@@ -3,7 +3,7 @@
* These are the Yii core requirements for the [[YiiRequirementChecker]] instance.
* These requirements are mandatory for any Yii application.
*
- * @var $this YiiRequirementChecker
+ * @var YiiRequirementChecker $this
*/
return array(
array(
diff --git a/framework/yii/requirements/views/console/index.php b/framework/yii/requirements/views/console/index.php
index 6935107..1d87fe9 100644
--- a/framework/yii/requirements/views/console/index.php
+++ b/framework/yii/requirements/views/console/index.php
@@ -1,7 +1,7 @@
diff --git a/framework/yii/validators/BooleanValidator.php b/framework/yii/validators/BooleanValidator.php
index 02b11d7..9d74705 100644
--- a/framework/yii/validators/BooleanValidator.php
+++ b/framework/yii/validators/BooleanValidator.php
@@ -79,7 +79,7 @@ class BooleanValidator extends Validator
* Returns the JavaScript needed for performing client-side validation.
* @param \yii\base\Model $object the data object being validated
* @param string $attribute the name of the attribute to be validated.
- * @param \yii\base\View $view the view object that is going to be used to render views or view files
+ * @param \yii\web\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @return string the client-side validation script.
*/
diff --git a/framework/yii/validators/CompareValidator.php b/framework/yii/validators/CompareValidator.php
index 8a694ad..08d4809 100644
--- a/framework/yii/validators/CompareValidator.php
+++ b/framework/yii/validators/CompareValidator.php
@@ -179,7 +179,7 @@ class CompareValidator extends Validator
* @param \yii\base\Model $object the data object being validated
* @param string $attribute the name of the attribute to be validated
* @return string the client-side validation script
- * @param \yii\base\View $view the view object that is going to be used to render views or view files
+ * @param \yii\web\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @throws InvalidConfigException if CompareValidator::operator is invalid
*/
diff --git a/framework/yii/validators/EmailValidator.php b/framework/yii/validators/EmailValidator.php
index 7e28738..bc105a5 100644
--- a/framework/yii/validators/EmailValidator.php
+++ b/framework/yii/validators/EmailValidator.php
@@ -119,7 +119,7 @@ class EmailValidator extends Validator
* Returns the JavaScript needed for performing client-side validation.
* @param \yii\base\Model $object the data object being validated
* @param string $attribute the name of the attribute to be validated.
- * @param \yii\base\View $view the view object that is going to be used to render views or view files
+ * @param \yii\web\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @return string the client-side validation script.
*/
diff --git a/framework/yii/validators/ExistValidator.php b/framework/yii/validators/ExistValidator.php
index 2746b06..ba3f332 100644
--- a/framework/yii/validators/ExistValidator.php
+++ b/framework/yii/validators/ExistValidator.php
@@ -65,7 +65,7 @@ class ExistValidator extends Validator
return;
}
- /** @var $className \yii\db\ActiveRecord */
+ /** @var \yii\db\ActiveRecord $className */
$className = $this->className === null ? get_class($object) : $this->className;
$attributeName = $this->attributeName === null ? $attribute : $this->attributeName;
$query = $className::find();
@@ -92,7 +92,7 @@ class ExistValidator extends Validator
if ($this->attributeName === null) {
throw new InvalidConfigException('The "attributeName" property must be set.');
}
- /** @var $className \yii\db\ActiveRecord */
+ /** @var \yii\db\ActiveRecord $className */
$className = $this->className;
$query = $className::find();
$query->where([$this->attributeName => $value]);
diff --git a/framework/yii/validators/FileValidator.php b/framework/yii/validators/FileValidator.php
index f27c010..4726c6c 100644
--- a/framework/yii/validators/FileValidator.php
+++ b/framework/yii/validators/FileValidator.php
@@ -26,6 +26,7 @@ class FileValidator extends Validator
* separated by space or comma (e.g. "gif, jpg").
* Extension names are case-insensitive. Defaults to null, meaning all file name
* extensions are allowed.
+ * @see wrongType
*/
public $types;
/**
@@ -46,6 +47,7 @@ class FileValidator extends Validator
* @var integer the maximum file count the given attribute can hold.
* It defaults to 1, meaning single file upload. By defining a higher number,
* multiple uploads become possible.
+ * @see tooMany
*/
public $maxFiles = 1;
/**
@@ -76,9 +78,10 @@ class FileValidator extends Validator
public $tooSmall;
/**
* @var string the error message used when the uploaded file has an extension name
- * that is not listed in [[extensions]]. You may use the following tokens in the message:
+ * that is not listed in [[types]]. You may use the following tokens in the message:
*
* - {attribute}: the attribute name
+ * - {file}: the uploaded file name
* - {extensions}: the list of the allowed extensions.
*/
public $wrongType;
@@ -87,7 +90,6 @@ class FileValidator extends Validator
* You may use the following tokens in the message:
*
* - {attribute}: the attribute name
- * - {file}: the uploaded file name
* - {limit}: the value of [[maxFiles]]
*/
public $tooMany;
@@ -166,7 +168,7 @@ class FileValidator extends Validator
* @param string $attribute the attribute being validated
* @param UploadedFile $file uploaded file passed to check against a set of rules
*/
- protected function validateFile($object, $attribute, $file)
+ public function validateFile($object, $attribute, $file)
{
switch ($file->error) {
case UPLOAD_ERR_OK:
diff --git a/framework/yii/validators/ImageValidator.php b/framework/yii/validators/ImageValidator.php
new file mode 100644
index 0000000..a60cc93
--- /dev/null
+++ b/framework/yii/validators/ImageValidator.php
@@ -0,0 +1,197 @@
+
+ * @since 2.0
+ */
+class ImageValidator extends FileValidator
+{
+ /**
+ * @var string the error message used when the uploaded file is not an image.
+ * You may use the following tokens in the message:
+ *
+ * - {attribute}: the attribute name
+ * - {file}: the uploaded file name
+ */
+ public $notImage;
+ /**
+ * @var integer the minimum width in pixels.
+ * Defaults to null, meaning no limit.
+ * @see underWidth
+ */
+ public $minWidth;
+ /**
+ * @var integer the maximum width in pixels.
+ * Defaults to null, meaning no limit.
+ * @see overWidth
+ */
+ public $maxWidth;
+ /**
+ * @var integer the minimum height in pixels.
+ * Defaults to null, meaning no limit.
+ * @see underHeight
+ */
+ public $minHeight;
+ /**
+ * @var integer the maximum width in pixels.
+ * Defaults to null, meaning no limit.
+ * @see overWidth
+ */
+ public $maxHeight;
+ /**
+ * @var array|string a list of file mime types that are allowed to be uploaded.
+ * This can be either an array or a string consisting of file mime types
+ * separated by space or comma (e.g. "image/jpeg, image/png").
+ * Mime type names are case-insensitive. Defaults to null, meaning all mime types
+ * are allowed.
+ * @see wrongMimeType
+ */
+ public $mimeTypes;
+ /**
+ * @var string the error message used when the image is under [[minWidth]].
+ * You may use the following tokens in the message:
+ *
+ * - {attribute}: the attribute name
+ * - {file}: the uploaded file name
+ * - {limit}: the value of [[minWidth]]
+ */
+ public $underWidth;
+ /**
+ * @var string the error message used when the image is over [[maxWidth]].
+ * You may use the following tokens in the message:
+ *
+ * - {attribute}: the attribute name
+ * - {file}: the uploaded file name
+ * - {limit}: the value of [[maxWidth]]
+ */
+ public $overWidth;
+ /**
+ * @var string the error message used when the image is under [[minHeight]].
+ * You may use the following tokens in the message:
+ *
+ * - {attribute}: the attribute name
+ * - {file}: the uploaded file name
+ * - {limit}: the value of [[minHeight]]
+ */
+ public $underHeight;
+ /**
+ * @var string the error message used when the image is over [[maxHeight]].
+ * You may use the following tokens in the message:
+ *
+ * - {attribute}: the attribute name
+ * - {file}: the uploaded file name
+ * - {limit}: the value of [[maxHeight]]
+ */
+ public $overHeight;
+ /**
+ * @var string the error message used when the file has an mime type
+ * that is not listed in [[mimeTypes]].
+ * You may use the following tokens in the message:
+ *
+ * - {attribute}: the attribute name
+ * - {file}: the uploaded file name
+ * - {mimeTypes}: the value of [[mimeTypes]]
+ */
+ public $wrongMimeType;
+
+ /**
+ * Initializes the validator.
+ */
+ public function init()
+ {
+ parent::init();
+
+ if ($this->notImage === null) {
+ $this->notImage = Yii::t('yii', 'The file "{file}" is not an image.');
+ }
+ if ($this->underWidth === null) {
+ $this->underWidth = Yii::t('yii', 'The file "{file}" is too small. The width cannot be smaller than {limit} pixels.');
+ }
+ if ($this->underHeight === null) {
+ $this->underHeight = Yii::t('yii', 'The file "{file}" is too small. The height cannot be smaller than {limit} pixels.');
+ }
+ if ($this->overWidth === null) {
+ $this->overWidth = Yii::t('yii', 'The file "{file}" is too large. The width cannot be larger than {limit} pixels.');
+ }
+ if ($this->overHeight === null) {
+ $this->overHeight = Yii::t('yii', 'The file "{file}" is too large. The height cannot be larger than {limit} pixels.');
+ }
+ if ($this->wrongMimeType === null) {
+ $this->wrongMimeType = Yii::t('yii', 'Only files with these mimeTypes are allowed: {mimeTypes}.');
+ }
+ if (!is_array($this->mimeTypes)) {
+ $this->mimeTypes = preg_split('/[\s,]+/', strtolower($this->mimeTypes), -1, PREG_SPLIT_NO_EMPTY);
+ }
+ }
+
+ /**
+ * Internally validates a file object.
+ * @param \yii\base\Model $object the object being validated
+ * @param string $attribute the attribute being validated
+ * @param UploadedFile $file uploaded file passed to check against a set of rules
+ */
+ public function validateFile($object, $attribute, $file)
+ {
+ parent::validateFile($object, $attribute, $file);
+
+ if (!$object->hasErrors($attribute)) {
+ $this->validateImage($object, $attribute, $file);
+ }
+ }
+
+ /**
+ * Internally validates a file object.
+ * @param \yii\base\Model $object the object being validated
+ * @param string $attribute the attribute being validated
+ * @param UploadedFile $image uploaded file passed to check against a set of rules
+ */
+ public function validateImage($object, $attribute, $image)
+ {
+ if (!empty($this->mimeTypes) && !in_array(FileHelper::getMimeType($image->tempName), $this->mimeTypes, true)) {
+ $this->addError($object, $attribute, $this->wrongMimeType, ['file' => $image->name, 'mimeTypes' => implode(', ', $this->mimeTypes)]);
+ }
+
+ if (false === ($imageInfo = getimagesize($image->tempName))) {
+ $this->addError($object, $attribute, $this->notImage, ['file' => $image->name]);
+ return;
+ }
+
+ list($width, $height, $type) = $imageInfo;
+
+ if ($width == 0 || $height == 0) {
+ $this->addError($object, $attribute, $this->notImage, ['file' => $image->name]);
+ return;
+ }
+
+ if ($this->minWidth !== null && $width < $this->minWidth) {
+ $this->addError($object, $attribute, $this->underWidth, ['file' => $image->name, 'limit' => $this->minWidth]);
+ }
+
+ if ($this->minHeight !== null && $height < $this->minHeight) {
+ $this->addError($object, $attribute, $this->underHeight, ['file' => $image->name, 'limit' => $this->minHeight]);
+ }
+
+ if ($this->maxWidth !== null && $width > $this->maxWidth) {
+ $this->addError($object, $attribute, $this->overWidth, ['file' => $image->name, 'limit' => $this->maxWidth]);
+ }
+
+ if ($this->maxHeight !== null && $height > $this->maxHeight) {
+ $this->addError($object, $attribute, $this->overHeight, ['file' => $image->name, 'limit' => $this->maxHeight]);
+ }
+ }
+}
diff --git a/framework/yii/validators/InlineValidator.php b/framework/yii/validators/InlineValidator.php
index 8099977..febf8dc 100644
--- a/framework/yii/validators/InlineValidator.php
+++ b/framework/yii/validators/InlineValidator.php
@@ -26,8 +26,11 @@ class InlineValidator extends Validator
{
/**
* @var string|\Closure an anonymous function or the name of a model class method that will be
- * called to perform the actual validation. Note that if you use anonymous function, you cannot
- * use `$this` in it unless you are using PHP 5.4 or above.
+ * called to perform the actual validation. The signature of the method should be like the following:
+ *
+ * ~~~
+ * function foo($attribute, $params)
+ * ~~~
*/
public $method;
/**
@@ -39,7 +42,7 @@ class InlineValidator extends Validator
* The signature of the method should be like the following:
*
* ~~~
- * function foo($attribute)
+ * function foo($attribute, $params)
* {
* return "javascript";
* }
@@ -79,7 +82,7 @@ class InlineValidator extends Validator
*
* @param \yii\base\Model $object the data object being validated
* @param string $attribute the name of the attribute to be validated.
- * @param \yii\base\View $view the view object that is going to be used to render views or view files
+ * @param \yii\web\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @return string the client-side validation script. Null if the validator does not support
* client-side validation.
@@ -93,7 +96,7 @@ class InlineValidator extends Validator
if (is_string($method)) {
$method = [$object, $method];
}
- return call_user_func($method, $attribute);
+ return call_user_func($method, $attribute, $this->params);
} else {
return null;
}
diff --git a/framework/yii/validators/NumberValidator.php b/framework/yii/validators/NumberValidator.php
index 0df73e6..c114300 100644
--- a/framework/yii/validators/NumberValidator.php
+++ b/framework/yii/validators/NumberValidator.php
@@ -114,7 +114,7 @@ class NumberValidator extends Validator
* Returns the JavaScript needed for performing client-side validation.
* @param \yii\base\Model $object the data object being validated
* @param string $attribute the name of the attribute to be validated.
- * @param \yii\base\View $view the view object that is going to be used to render views or view files
+ * @param \yii\web\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @return string the client-side validation script.
*/
diff --git a/framework/yii/validators/PunycodeAsset.php b/framework/yii/validators/PunycodeAsset.php
index 08439bf..c0c1e2b 100644
--- a/framework/yii/validators/PunycodeAsset.php
+++ b/framework/yii/validators/PunycodeAsset.php
@@ -9,6 +9,8 @@ namespace yii\validators;
use yii\web\AssetBundle;
/**
+ * This asset bundle provides the javascript files needed for the [[EmailValidator]]s client validation.
+ *
* @author Qiang Xue
* @since 2.0
*/
diff --git a/framework/yii/validators/RangeValidator.php b/framework/yii/validators/RangeValidator.php
index 7abc41d..6668969 100644
--- a/framework/yii/validators/RangeValidator.php
+++ b/framework/yii/validators/RangeValidator.php
@@ -81,7 +81,7 @@ class RangeValidator extends Validator
* Returns the JavaScript needed for performing client-side validation.
* @param \yii\base\Model $object the data object being validated
* @param string $attribute the name of the attribute to be validated.
- * @param \yii\base\View $view the view object that is going to be used to render views or view files
+ * @param \yii\web\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @return string the client-side validation script.
*/
diff --git a/framework/yii/validators/RegularExpressionValidator.php b/framework/yii/validators/RegularExpressionValidator.php
index ae79d32..efa9e22 100644
--- a/framework/yii/validators/RegularExpressionValidator.php
+++ b/framework/yii/validators/RegularExpressionValidator.php
@@ -78,7 +78,7 @@ class RegularExpressionValidator extends Validator
* Returns the JavaScript needed for performing client-side validation.
* @param \yii\base\Model $object the data object being validated
* @param string $attribute the name of the attribute to be validated.
- * @param \yii\base\View $view the view object that is going to be used to render views or view files
+ * @param \yii\web\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @return string the client-side validation script.
*/
diff --git a/framework/yii/validators/RequiredValidator.php b/framework/yii/validators/RequiredValidator.php
index eb4a394..2b5e333 100644
--- a/framework/yii/validators/RequiredValidator.php
+++ b/framework/yii/validators/RequiredValidator.php
@@ -102,7 +102,7 @@ class RequiredValidator extends Validator
* Returns the JavaScript needed for performing client-side validation.
* @param \yii\base\Model $object the data object being validated
* @param string $attribute the name of the attribute to be validated.
- * @param \yii\base\View $view the view object that is going to be used to render views or view files
+ * @param \yii\web\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @return string the client-side validation script.
*/
diff --git a/framework/yii/validators/StringValidator.php b/framework/yii/validators/StringValidator.php
index 329cab0..92aad56 100644
--- a/framework/yii/validators/StringValidator.php
+++ b/framework/yii/validators/StringValidator.php
@@ -142,7 +142,7 @@ class StringValidator extends Validator
* Returns the JavaScript needed for performing client-side validation.
* @param \yii\base\Model $object the data object being validated
* @param string $attribute the name of the attribute to be validated.
- * @param \yii\base\View $view the view object that is going to be used to render views or view files
+ * @param \yii\web\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @return string the client-side validation script.
*/
diff --git a/framework/yii/validators/UniqueValidator.php b/framework/yii/validators/UniqueValidator.php
index 334d057..7006cc4 100644
--- a/framework/yii/validators/UniqueValidator.php
+++ b/framework/yii/validators/UniqueValidator.php
@@ -60,7 +60,7 @@ class UniqueValidator extends Validator
return;
}
- /** @var $className \yii\db\ActiveRecord */
+ /** @var \yii\db\ActiveRecord $className */
$className = $this->className === null ? get_class($object) : $this->className;
$attributeName = $this->attributeName === null ? $attribute : $this->attributeName;
diff --git a/framework/yii/validators/UrlValidator.php b/framework/yii/validators/UrlValidator.php
index f65c347..5400c32 100644
--- a/framework/yii/validators/UrlValidator.php
+++ b/framework/yii/validators/UrlValidator.php
@@ -115,7 +115,7 @@ class UrlValidator extends Validator
* Returns the JavaScript needed for performing client-side validation.
* @param \yii\base\Model $object the data object being validated
* @param string $attribute the name of the attribute to be validated.
- * @param \yii\base\View $view the view object that is going to be used to render views or view files
+ * @param \yii\web\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @return string the client-side validation script.
* @see \yii\Web\ActiveForm::enableClientValidation
diff --git a/framework/yii/validators/ValidationAsset.php b/framework/yii/validators/ValidationAsset.php
index 8ff1b2d..14d7ad0 100644
--- a/framework/yii/validators/ValidationAsset.php
+++ b/framework/yii/validators/ValidationAsset.php
@@ -9,6 +9,8 @@ namespace yii\validators;
use yii\web\AssetBundle;
/**
+ * This asset bundle provides the javascript files for client validation.
+ *
* @author Qiang Xue
* @since 2.0
*/
diff --git a/framework/yii/validators/Validator.php b/framework/yii/validators/Validator.php
index dc0e935..012f392 100644
--- a/framework/yii/validators/Validator.php
+++ b/framework/yii/validators/Validator.php
@@ -31,6 +31,7 @@ use yii\base\NotSupportedException;
* - `exist`: [[ExistValidator]]
* - `file`: [[FileValidator]]
* - `filter`: [[FilterValidator]]
+ * - `image`: [[ImageValidator]]
* - `in`: [[RangeValidator]]
* - `integer`: [[NumberValidator]]
* - `match`: [[RegularExpressionValidator]]
@@ -59,6 +60,7 @@ abstract class Validator extends Component
'exist' => 'yii\validators\ExistValidator',
'file' => 'yii\validators\FileValidator',
'filter' => 'yii\validators\FilterValidator',
+ 'image' => 'yii\validators\ImageValidator',
'in' => 'yii\validators\RangeValidator',
'integer' => [
'class' => 'yii\validators\NumberValidator',
@@ -213,7 +215,7 @@ abstract class Validator extends Component
*
* @param \yii\base\Model $object the data object being validated
* @param string $attribute the name of the attribute to be validated.
- * @param \yii\base\View $view the view object that is going to be used to render views or view files
+ * @param \yii\web\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @return string the client-side validation script. Null if the validator does not support
* client-side validation.
diff --git a/framework/yii/views/errorHandler/exception.php b/framework/yii/views/errorHandler/exception.php
index 4b90de9..426447a 100644
--- a/framework/yii/views/errorHandler/exception.php
+++ b/framework/yii/views/errorHandler/exception.php
@@ -359,7 +359,7 @@ pre .diff .change{
}
?>
- = $handler->htmlEncode($exception->getMessage()) ?>
+ = nl2br($handler->htmlEncode($exception->getMessage())) ?>
= $handler->renderPreviousExceptions($exception) ?>
diff --git a/framework/yii/views/errorHandler/previousException.php b/framework/yii/views/errorHandler/previousException.php
index 5e8ded8..766c0a7 100644
--- a/framework/yii/views/errorHandler/previousException.php
+++ b/framework/yii/views/errorHandler/previousException.php
@@ -15,7 +15,7 @@
= $handler->htmlEncode(get_class($exception)) ?>
- = $handler->htmlEncode($exception->getMessage()) ?>
+ = nl2br($handler->htmlEncode($exception->getMessage())) ?>
in = $exception->getFile() ?> at line = $exception->getLine() ?>
= $handler->renderPreviousExceptions($exception) ?>
diff --git a/framework/yii/web/AccessControl.php b/framework/yii/web/AccessControl.php
index d11f59c..549f087 100644
--- a/framework/yii/web/AccessControl.php
+++ b/framework/yii/web/AccessControl.php
@@ -102,7 +102,7 @@ class AccessControl extends ActionFilter
{
$user = Yii::$app->getUser();
$request = Yii::$app->getRequest();
- /** @var $rule AccessRule */
+ /** @var AccessRule $rule */
foreach ($this->rules as $rule) {
if ($allow = $rule->allows($action, $user, $request)) {
return true;
diff --git a/framework/yii/web/AssetBundle.php b/framework/yii/web/AssetBundle.php
index 5ea6f67..964fe98 100644
--- a/framework/yii/web/AssetBundle.php
+++ b/framework/yii/web/AssetBundle.php
@@ -10,7 +10,7 @@ namespace yii\web;
use Yii;
use yii\base\InvalidConfigException;
use yii\base\Object;
-use yii\base\View;
+use yii\web\View;
/**
* AssetBundle represents a collection of asset files, such as CSS, JS, images.
@@ -97,12 +97,12 @@ class AssetBundle extends Object
*/
public $css = [];
/**
- * @var array the options that will be passed to [[\yii\base\View::registerJsFile()]]
+ * @var array the options that will be passed to [[\yii\web\View::registerJsFile()]]
* when registering the JS files in this bundle.
*/
public $jsOptions = [];
/**
- * @var array the options that will be passed to [[\yii\base\View::registerCssFile()]]
+ * @var array the options that will be passed to [[\yii\web\View::registerCssFile()]]
* when registering the CSS files in this bundle.
*/
public $cssOptions = [];
@@ -140,7 +140,7 @@ class AssetBundle extends Object
/**
* Registers the CSS and JS files with the given view.
- * @param \yii\base\View $view the view that the asset files are to be registered with.
+ * @param \yii\web\View $view the view that the asset files are to be registered with.
*/
public function registerAssetFiles($view)
{
diff --git a/framework/yii/web/AssetConverter.php b/framework/yii/web/AssetConverter.php
index b7f406d..a93b915 100644
--- a/framework/yii/web/AssetConverter.php
+++ b/framework/yii/web/AssetConverter.php
@@ -9,10 +9,13 @@ namespace yii\web;
use Yii;
use yii\base\Component;
+use yii\base\Exception;
/**
* AssetConverter supports conversion of several popular script formats into JS or CSS scripts.
*
+ * It is used by [[AssetManager]] to convert files after they have been published.
+ *
* @author Qiang Xue
* @since 2.0
*/
@@ -24,10 +27,12 @@ class AssetConverter extends Component implements AssetConverterInterface
* target script types (either "css" or "js") and the commands used for the conversion.
*/
public $commands = [
- 'less' => ['css', 'lessc {from} {to}'],
+ 'less' => ['css', 'lessc {from} {to} --no-color'],
'scss' => ['css', 'sass {from} {to}'],
'sass' => ['css', 'sass {from} {to}'],
'styl' => ['js', 'stylus < {from} > {to}'],
+ 'coffee' => ['js', 'coffee -p {from} > {to}'],
+ 'ts' => ['js', 'tsc --out {to} {from}'],
];
/**
@@ -45,17 +50,50 @@ class AssetConverter extends Component implements AssetConverterInterface
list ($ext, $command) = $this->commands[$ext];
$result = substr($asset, 0, $pos + 1) . $ext;
if (@filemtime("$basePath/$result") < filemtime("$basePath/$asset")) {
- $output = [];
- $command = strtr($command, [
- '{from}' => escapeshellarg("$basePath/$asset"),
- '{to}' => escapeshellarg("$basePath/$result"),
- ]);
- exec($command, $output);
- Yii::trace("Converted $asset into $result: " . implode("\n", $output), __METHOD__);
+ $this->runCommand($command, $basePath, $asset, $result);
}
return $result;
}
}
return $asset;
}
+
+ /**
+ * Runs a command to convert asset files.
+ * @param string $command the command to run
+ * @param string $basePath asset base path and command working directory
+ * @param string $asset the name of the asset file
+ * @param string $result the name of the file to be generated by the converter command
+ * @return bool true on success, false on failure. Failures will be logged.
+ * @throws \yii\base\Exception when the command fails and YII_DEBUG is true.
+ * In production mode the error will be logged.
+ */
+ protected function runCommand($command, $basePath, $asset, $result)
+ {
+ $command = strtr($command, [
+ '{from}' => escapeshellarg("$basePath/$asset"),
+ '{to}' => escapeshellarg("$basePath/$result"),
+ ]);
+ $descriptor = array(
+ 1 => array('pipe', 'w'),
+ 2 => array('pipe', 'w'),
+ );
+ $pipes = array();
+ $proc = proc_open($command, $descriptor, $pipes, $basePath);
+ $stdout = stream_get_contents($pipes[1]);
+ $stderr = stream_get_contents($pipes[2]);
+ foreach($pipes as $pipe) {
+ fclose($pipe);
+ }
+ $status = proc_close($proc);
+
+ if ($status === 0) {
+ Yii::trace("Converted $asset into $result:\nSTDOUT:\n$stdout\nSTDERR:\n$stderr", __METHOD__);
+ } elseif (YII_DEBUG) {
+ throw new Exception("AssetConverter command '$command' failed with exit code $status:\nSTDOUT:\n$stdout\nSTDERR:\n$stderr");
+ } else {
+ Yii::error("AssetConverter command '$command' failed with exit code $status:\nSTDOUT:\n$stdout\nSTDERR:\n$stderr");
+ }
+ return $status === 0;
+ }
}
diff --git a/framework/yii/web/AssetManager.php b/framework/yii/web/AssetManager.php
index 49374f0..b562cf6 100644
--- a/framework/yii/web/AssetManager.php
+++ b/framework/yii/web/AssetManager.php
@@ -16,6 +16,22 @@ use yii\helpers\FileHelper;
/**
* AssetManager manages asset bundles and asset publishing.
*
+ * AssetManager is configured as an application component in [[yii\web\Application]] by default.
+ * You can access that instance via `Yii::$app->assetManager`.
+ *
+ * You can modify its configuration by adding an array to your application config under `components`
+ * as it is shown in the following example:
+ *
+ * ~~~
+ * 'assetManager' => [
+ * 'bundles' => [
+ * // you can override AssetBundle configs here
+ * ],
+ * //'linkAssets' => true,
+ * // ...
+ * ]
+ * ~~~
+ *
* @property AssetConverterInterface $converter The asset converter. Note that the type of this property
* differs in getter and setter. See [[getConverter()]] and [[setConverter()]] for details.
*
diff --git a/framework/yii/web/CacheSession.php b/framework/yii/web/CacheSession.php
index 84033b7..7b4a98d 100644
--- a/framework/yii/web/CacheSession.php
+++ b/framework/yii/web/CacheSession.php
@@ -19,7 +19,17 @@ use yii\base\InvalidConfigException;
*
* Beware, by definition cache storage are volatile, which means the data stored on them
* may be swapped out and get lost. Therefore, you must make sure the cache used by this component
- * is NOT volatile. If you want to use database as storage medium, use [[DbSession]] is a better choice.
+ * is NOT volatile. If you want to use database as storage medium, [[DbSession]] is a better choice.
+ *
+ * The following example shows how you can configure the application to use CacheSession:
+ * Add the following to your application config under `components`:
+ *
+ * ~~~
+ * 'session' => [
+ * 'class' => 'yii\web\CacheSession',
+ * // 'cache' => 'mycache',
+ * ]
+ * ~~~
*
* @property boolean $useCustomStorage Whether to use custom storage. This property is read-only.
*
diff --git a/framework/yii/web/Controller.php b/framework/yii/web/Controller.php
index 9d22d01..3b08b7e 100644
--- a/framework/yii/web/Controller.php
+++ b/framework/yii/web/Controller.php
@@ -14,6 +14,9 @@ use yii\helpers\Html;
/**
* Controller is the base class of web controllers.
*
+ * @property string $canonicalUrl The canonical URL of the currently requested page. This property is
+ * read-only.
+ *
* @author Qiang Xue
* @since 2.0
*/
@@ -24,6 +27,10 @@ class Controller extends \yii\base\Controller
* CSRF validation is enabled only when both this property and [[Request::enableCsrfValidation]] are true.
*/
public $enableCsrfValidation = true;
+ /**
+ * @var array the parameters bound to the current action. This is mainly used by [[getCanonicalUrl()]].
+ */
+ public $actionParams = [];
/**
* Binds the parameters to the action.
@@ -34,7 +41,7 @@ class Controller extends \yii\base\Controller
* @param \yii\base\Action $action the action to be bound with parameters
* @param array $params the parameters to be bound to the action
* @return array the valid parameters that the action can run with.
- * @throws HttpException if there are missing parameters.
+ * @throws HttpException if there are missing or invalid parameters.
*/
public function bindActionParams($action, $params)
{
@@ -46,13 +53,22 @@ class Controller extends \yii\base\Controller
$args = [];
$missing = [];
+ $actionParams = [];
foreach ($method->getParameters() as $param) {
$name = $param->getName();
if (array_key_exists($name, $params)) {
- $args[] = $params[$name];
+ if ($param->isArray()) {
+ $args[] = $actionParams[$name] = is_array($params[$name]) ? $params[$name] : [$params[$name]];
+ } elseif (!is_array($params[$name])) {
+ $args[] = $actionParams[$name] = $params[$name];
+ } else {
+ throw new HttpException(400, Yii::t('yii', 'Invalid data received for parameter "{param}".', [
+ 'param' => $name,
+ ]));
+ }
unset($params[$name]);
} elseif ($param->isDefaultValueAvailable()) {
- $args[] = $param->getDefaultValue();
+ $args[] = $actionParams[$name] = $param->getDefaultValue();
} else {
$missing[] = $name;
}
@@ -63,6 +79,8 @@ class Controller extends \yii\base\Controller
'params' => implode(', ', $missing),
]));
}
+
+ $this->actionParams = $actionParams;
return $args;
}
@@ -113,9 +131,32 @@ class Controller extends \yii\base\Controller
}
/**
+ * Returns the canonical URL of the currently requested page.
+ * The canonical URL is constructed using [[route]] and [[actionParams]]. You may use the following code
+ * in the layout view to add a link tag about canonical URL:
+ *
+ * ~~~
+ * $this->registerLinkTag(['rel' => 'canonical', 'href' => Yii::$app->controller->canonicalUrl]);
+ * ~~~
+ *
+ * @return string the canonical URL of the currently requested page
+ */
+ public function getCanonicalUrl()
+ {
+ return Yii::$app->getUrlManager()->createAbsoluteUrl($this->getRoute(), $this->actionParams);
+ }
+
+ /**
* Redirects the browser to the specified URL.
* This method is a shortcut to [[Response::redirect()]].
*
+ * You can use it in an action by returning the [[Response]] directly:
+ *
+ * ```php
+ * // stop executing this action and redirect to login page
+ * return $this->redirect(['login']);
+ * ```
+ *
* @param string|array $url the URL to be redirected to. This can be in one of the following formats:
*
* - a string representing a URL (e.g. "http://example.com")
@@ -138,6 +179,14 @@ class Controller extends \yii\base\Controller
/**
* Redirects the browser to the home page.
+ *
+ * You can use this method in an action by returning the [[Response]] directly:
+ *
+ * ```php
+ * // stop executing this action and redirect to home page
+ * return $this->goHome();
+ * ```
+ *
* @return Response the current response object
*/
public function goHome()
@@ -147,6 +196,14 @@ class Controller extends \yii\base\Controller
/**
* Redirects the browser to the last visited page.
+ *
+ * You can use this method in an action by returning the [[Response]] directly:
+ *
+ * ```php
+ * // stop executing this action and redirect to last visited page
+ * return $this->goBack();
+ * ```
+ *
* @param string|array $defaultUrl the default return URL in case it was not set previously.
* If this is null and the return URL was not set previously, [[Application::homeUrl]] will be redirected to.
* Please refer to [[User::setReturnUrl()]] on accepted format of the URL.
@@ -161,6 +218,14 @@ class Controller extends \yii\base\Controller
/**
* Refreshes the current page.
* This method is a shortcut to [[Response::refresh()]].
+ *
+ * You can use it in an action by returning the [[Response]] directly:
+ *
+ * ```php
+ * // stop executing this action and refresh the current page
+ * return $this->refresh();
+ * ```
+ *
* @param string $anchor the anchor that should be appended to the redirection URL.
* Defaults to empty. Make sure the anchor starts with '#' if you want to specify it.
* @return Response the response object itself
diff --git a/framework/yii/web/DbSession.php b/framework/yii/web/DbSession.php
index 410439b..d5d1742 100644
--- a/framework/yii/web/DbSession.php
+++ b/framework/yii/web/DbSession.php
@@ -19,6 +19,7 @@ use yii\base\InvalidConfigException;
* must be pre-created. The table name can be changed by setting [[sessionTable]].
*
* The following example shows how you can configure the application to use DbSession:
+ * Add the following to your application config under `components`:
*
* ~~~
* 'session' => [
diff --git a/framework/yii/web/HttpCache.php b/framework/yii/web/HttpCache.php
index d2f3923..134df71 100644
--- a/framework/yii/web/HttpCache.php
+++ b/framework/yii/web/HttpCache.php
@@ -12,7 +12,32 @@ use yii\base\ActionFilter;
use yii\base\Action;
/**
- * The HttpCache provides functionality for caching via HTTP Last-Modified and Etag headers
+ * The HttpCache provides functionality for caching via HTTP Last-Modified and Etag headers.
+ *
+ * It is an action filter that can be added to a controller and handles the `beforeAction` event.
+ *
+ * To use AccessControl, declare it in the `behaviors()` method of your controller class.
+ * In the following example the filter will be applied to the `list`-action and
+ * the Last-Modified header will contain the date of the last update to the user table in the database.
+ *
+ * ~~~
+ * public function behaviors()
+ * {
+ * return [
+ * 'httpCache' => [
+ * 'class' => \yii\web\HttpCache::className(),
+ * 'only' => ['list'],
+ * 'lastModified' => function ($action, $params) {
+ * $q = new Query();
+ * return strtotime($q->from('users')->max('updated_timestamp'));
+ * },
+ * // 'etagSeed' => function ($action, $params) {
+ * // return // generate etag seed here
+ * // }
+ * ],
+ * ];
+ * }
+ * ~~~
*
* @author Da:Sourcerer
* @author Qiang Xue
diff --git a/framework/yii/web/HttpException.php b/framework/yii/web/HttpException.php
index 2e677d5..2398437 100644
--- a/framework/yii/web/HttpException.php
+++ b/framework/yii/web/HttpException.php
@@ -16,6 +16,14 @@ use yii\base\UserException;
* keeps a standard HTTP status code (e.g. 404, 500). Error handlers may use this status code
* to decide how to format the error page.
*
+ * Throwing an HttpException like in the following example will result in the 404 page to be displayed.
+ *
+ * ```php
+ * if ($item === null) { // item does not exist
+ * throw new \yii\web\HttpException(404, 'The requested Item could not be found.');
+ * }
+ * ```
+ *
* @author Qiang Xue
* @since 2.0
*/
diff --git a/framework/yii/web/JqueryAsset.php b/framework/yii/web/JqueryAsset.php
index f1324ab..90d2df6 100644
--- a/framework/yii/web/JqueryAsset.php
+++ b/framework/yii/web/JqueryAsset.php
@@ -15,7 +15,7 @@ namespace yii\web;
*/
class JqueryAsset extends AssetBundle
{
- public $sourcePath = '@yii/assets';
+ public $sourcePath = '@vendor/yiisoft/jquery';
public $js = [
'jquery.js',
];
diff --git a/framework/yii/web/PageCache.php b/framework/yii/web/PageCache.php
index a97659c..4c8cc50 100644
--- a/framework/yii/web/PageCache.php
+++ b/framework/yii/web/PageCache.php
@@ -10,12 +10,40 @@ namespace yii\web;
use Yii;
use yii\base\ActionFilter;
use yii\base\Action;
-use yii\base\View;
use yii\caching\Dependency;
/**
* The PageCache provides functionality for whole page caching
*
+ * It is an action filter that can be added to a controller and handles the `beforeAction` event.
+ *
+ * To use PageCache, declare it in the `behaviors()` method of your controller class.
+ * In the following example the filter will be applied to the `list`-action and
+ * cache the whole page for maximum 60 seconds or until the count of entries in the post table changes.
+ * It also stores different versions of the page depended on the route ([[varyByRoute]] is true by default),
+ * the application language and user id.
+ *
+ * ~~~
+ * public function behaviors()
+ * {
+ * return [
+ * 'pageCache' => [
+ * 'class' => \yii\web\PageCache::className(),
+ * 'only' => ['list'],
+ * 'duration' => 60,
+ * 'dependecy' => [
+ * 'class' => 'yii\caching\DbDependency',
+ * 'sql' => 'SELECT COUNT(*) FROM post',
+ * ],
+ * 'variations' => [
+ * Yii::$app->language,
+ * Yii::$app->user->id
+ * ]
+ * ],
+ * ];
+ * }
+ * ~~~
+ *
* @author Qiang Xue
* @since 2.0
*/
@@ -61,6 +89,7 @@ class PageCache extends ActionFilter
* [
* Yii::$app->language,
* ]
+ * ~~~
*/
public $variations;
/**
@@ -69,7 +98,7 @@ class PageCache extends ActionFilter
*/
public $enabled = true;
/**
- * @var View the view component to use for caching. If not set, the default application view component
+ * @var \yii\base\View the view component to use for caching. If not set, the default application view component
* [[Application::view]] will be used.
*/
public $view;
diff --git a/framework/yii/web/Request.php b/framework/yii/web/Request.php
index 610e907..2071afa 100644
--- a/framework/yii/web/Request.php
+++ b/framework/yii/web/Request.php
@@ -18,6 +18,9 @@ use yii\helpers\Security;
* Also it provides an interface to retrieve request parameters from $_POST, $_GET, $_COOKIES and REST
* parameters sent via other HTTP methods like PUT or DELETE.
*
+ * Request is configured as an application component in [[yii\web\Application]] by default.
+ * You can access that instance via `Yii::$app->request`.
+ *
* @property string $absoluteUrl The currently requested absolute URL. This property is read-only.
* @property string $acceptTypes User browser accept types, null if not present. This property is read-only.
* @property array $acceptedContentTypes The content types ordered by the preference level. The first element
@@ -31,6 +34,8 @@ use yii\helpers\Security;
* @property string $csrfToken The random token for CSRF validation. This property is read-only.
* @property string $csrfTokenFromHeader The CSRF token sent via [[CSRF_HEADER]] by browser. Null is returned
* if no such header is sent. This property is read-only.
+ * @property array $delete The DELETE request parameter values. This property is read-only.
+ * @property array $get The GET request parameter values. This property is read-only.
* @property string $hostInfo Schema and hostname part (with port number if needed) of the request URL (e.g.
* `http://www.yiiframework.com`).
* @property boolean $isAjax Whether this is an AJAX (XMLHttpRequest) request. This property is read-only.
@@ -47,11 +52,14 @@ use yii\helpers\Security;
* read-only.
* @property string $method Request method, such as GET, POST, HEAD, PUT, PATCH, DELETE. The value returned is
* turned into upper case. This property is read-only.
+ * @property array $patch The PATCH request parameter values. This property is read-only.
* @property string $pathInfo Part of the request URL that is after the entry script and before the question
* mark. Note, the returned path info is already URL-decoded.
* @property integer $port Port number for insecure requests.
+ * @property array $post The POST request parameter values. This property is read-only.
* @property string $preferredLanguage The language that the application should use. Null is returned if both
* [[getAcceptedLanguages()]] and `$languages` are empty. This property is read-only.
+ * @property array $put The PUT request parameter values. This property is read-only.
* @property string $queryString Part of the request URL that is after the question mark. This property is
* read-only.
* @property string $rawBody The request body. This property is read-only.
@@ -111,8 +119,8 @@ class Request extends \yii\base\Request
/**
* @var string|boolean the name of the POST parameter that is used to indicate if a request is a PUT, PATCH or DELETE
* request tunneled through POST. Default to '_method'.
- * @see getMethod
- * @see getRestParams
+ * @see getMethod()
+ * @see getRestParams()
*/
public $restVar = '_method';
@@ -237,7 +245,7 @@ class Request extends \yii\base\Request
/**
* Returns the request parameters for the RESTful request.
* @return array the RESTful request parameters
- * @see getMethod
+ * @see getMethod()
*/
public function getRestParams()
{
@@ -290,59 +298,87 @@ class Request extends \yii\base\Request
/**
* Returns the named GET parameter value.
* If the GET parameter does not exist, the second parameter to this method will be returned.
- * @param string $name the GET parameter name
+ * @param string $name the GET parameter name. If not specified, whole $_GET is returned.
* @param mixed $defaultValue the default parameter value if the GET parameter does not exist.
* @return mixed the GET parameter value
- * @see getPost
+ * @see getPost()
*/
- public function get($name, $defaultValue = null)
+ public function get($name = null, $defaultValue = null)
{
+ if ($name === null) {
+ return $_GET;
+ }
return isset($_GET[$name]) ? $_GET[$name] : $defaultValue;
}
/**
+ * Returns the GET request parameter values.
+ * @return array the GET request parameter values
+ */
+ public function getGet()
+ {
+ return $_GET;
+ }
+
+ /**
* Returns the named POST parameter value.
* If the POST parameter does not exist, the second parameter to this method will be returned.
- * @param string $name the POST parameter name
+ * @param string $name the POST parameter name. If not specified, whole $_POST is returned.
* @param mixed $defaultValue the default parameter value if the POST parameter does not exist.
+ * @property array the POST request parameter values
* @return mixed the POST parameter value
- * @see getParam
+ * @see get()
*/
- public function getPost($name, $defaultValue = null)
+ public function getPost($name = null, $defaultValue = null)
{
+ if ($name === null) {
+ return $_POST;
+ }
return isset($_POST[$name]) ? $_POST[$name] : $defaultValue;
}
/**
* Returns the named DELETE parameter value.
- * @param string $name the DELETE parameter name
+ * @param string $name the DELETE parameter name. If not specified, an array of DELETE parameters is returned.
* @param mixed $defaultValue the default parameter value if the DELETE parameter does not exist.
+ * @property array the DELETE request parameter values
* @return mixed the DELETE parameter value
*/
- public function getDelete($name, $defaultValue = null)
+ public function getDelete($name = null, $defaultValue = null)
{
+ if ($name === null) {
+ return $this->getRestParams();
+ }
return $this->getIsDelete() ? $this->getRestParam($name, $defaultValue) : null;
}
/**
* Returns the named PUT parameter value.
- * @param string $name the PUT parameter name
+ * @param string $name the PUT parameter name. If not specified, an array of PUT parameters is returned.
* @param mixed $defaultValue the default parameter value if the PUT parameter does not exist.
+ * @property array the PUT request parameter values
* @return mixed the PUT parameter value
*/
- public function getPut($name, $defaultValue = null)
+ public function getPut($name = null, $defaultValue = null)
{
+ if ($name === null) {
+ return $this->getRestParams();
+ }
return $this->getIsPut() ? $this->getRestParam($name, $defaultValue) : null;
}
/**
* Returns the named PATCH parameter value.
- * @param string $name the PATCH parameter name
+ * @param string $name the PATCH parameter name. If not specified, an array of PATCH parameters is returned.
* @param mixed $defaultValue the default parameter value if the PATCH parameter does not exist.
+ * @property array the PATCH request parameter values
* @return mixed the PATCH parameter value
*/
- public function getPatch($name, $defaultValue = null)
+ public function getPatch($name = null, $defaultValue = null)
{
+ if ($name === null) {
+ return $this->getRestParams();
+ }
return $this->getIsPatch() ? $this->getRestParam($name, $defaultValue) : null;
}
@@ -354,7 +390,7 @@ class Request extends \yii\base\Request
* By default this is determined based on the user request information.
* You may explicitly specify it by setting the [[setHostInfo()|hostInfo]] property.
* @return string schema and hostname part (with port number if needed) of the request URL (e.g. `http://www.yiiframework.com`)
- * @see setHostInfo
+ * @see setHostInfo()
*/
public function getHostInfo()
{
@@ -393,7 +429,7 @@ class Request extends \yii\base\Request
* This is similar to [[scriptUrl]] except that it does not include the script file name,
* and the ending slashes are removed.
* @return string the relative URL for the application
- * @see setScriptUrl
+ * @see setScriptUrl()
*/
public function getBaseUrl()
{
@@ -710,7 +746,7 @@ class Request extends \yii\base\Request
* Defaults to 80, or the port specified by the server if the current
* request is insecure.
* @return integer port number for insecure requests.
- * @see setPort
+ * @see setPort()
*/
public function getPort()
{
@@ -741,7 +777,7 @@ class Request extends \yii\base\Request
* Defaults to 443, or the port specified by the server if the current
* request is secure.
* @return integer port number for secure requests.
- * @see setSecurePort
+ * @see setSecurePort()
*/
public function getSecurePort()
{
diff --git a/framework/yii/web/Response.php b/framework/yii/web/Response.php
index ea1f0d9..8934fa1 100644
--- a/framework/yii/web/Response.php
+++ b/framework/yii/web/Response.php
@@ -22,6 +22,20 @@ use yii\helpers\StringHelper;
* It holds the [[headers]], [[cookies]] and [[content]] that is to be sent to the client.
* It also controls the HTTP [[statusCode|status code]].
*
+ * Response is configured as an application component in [[yii\web\Application]] by default.
+ * You can access that instance via `Yii::$app->response`.
+ *
+ * You can modify its configuration by adding an array to your application config under `components`
+ * as it is shown in the following example:
+ *
+ * ~~~
+ * 'response' => [
+ * 'format' => yii\web\Response::FORMAT_JSON,
+ * 'charset' => 'UTF-8',
+ * // ...
+ * ]
+ * ~~~
+ *
* @property CookieCollection $cookies The cookie collection. This property is read-only.
* @property HeaderCollection $headers The header collection. This property is read-only.
* @property boolean $isClientError Whether this response indicates a client error. This property is
diff --git a/framework/yii/web/Session.php b/framework/yii/web/Session.php
index b03c74b..9fba49a 100644
--- a/framework/yii/web/Session.php
+++ b/framework/yii/web/Session.php
@@ -15,7 +15,7 @@ use yii\base\InvalidParamException;
* Session provides session data management and the related configurations.
*
* Session is a Web application component that can be accessed via `Yii::$app->session`.
-
+ *
* To start the session, call [[open()]]; To complete and send out session data, call [[close()]];
* To destroy the session, call [[destroy()]].
*
@@ -80,11 +80,12 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
* @var string the name of the session variable that stores the flash message data.
*/
public $flashVar = '__flash';
-
/**
- * @var array parameter-value pairs to override default session cookie parameters
+ * @var array parameter-value pairs to override default session cookie parameters that are used for session_set_cookie_params() function
+ * Array may have the following possible keys: 'lifetime', 'path', 'domain', 'secure', 'httpOnly'
+ * @see http://www.php.net/manual/en/function.session-set-cookie-params.php
*/
- public $cookieParams = ['httpOnly' => true];
+ private $_cookieParams = ['httpOnly' => true];
/**
* Initializes the application component.
@@ -135,7 +136,7 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
);
}
- $this->setCookieParams($this->cookieParams);
+ $this->setCookieParamsInternal();
@session_start();
@@ -263,26 +264,36 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
$params['httpOnly'] = $params['httponly'];
unset($params['httponly']);
}
- return $params;
+ return array_merge($params, $this->_cookieParams);
}
/**
* Sets the session cookie parameters.
- * The effect of this method only lasts for the duration of the script.
- * Call this method before the session starts.
+ * The cookie parameters passed to this method will be merged with the result
+ * of `session_get_cookie_params()`.
* @param array $value cookie parameters, valid keys include: `lifetime`, `path`, `domain`, `secure` and `httpOnly`.
* @throws InvalidParamException if the parameters are incomplete.
* @see http://us2.php.net/manual/en/function.session-set-cookie-params.php
*/
- public function setCookieParams($value)
+ public function setCookieParams(array $value)
+ {
+ $this->_cookieParams = $value;
+ }
+
+ /**
+ * Sets the session cookie parameters.
+ * This method is called by [[open()]] when it is about to open the session.
+ * @throws InvalidParamException if the parameters are incomplete.
+ * @see http://us2.php.net/manual/en/function.session-set-cookie-params.php
+ */
+ private function setCookieParamsInternal()
{
$data = $this->getCookieParams();
extract($data);
- extract($value);
if (isset($lifetime, $path, $domain, $secure, $httpOnly)) {
session_set_cookie_params($lifetime, $path, $domain, $secure, $httpOnly);
} else {
- throw new InvalidParamException('Please make sure these parameters are provided: lifetime, path, domain, secure and httpOnly.');
+ throw new InvalidParamException('Please make sure cookieParams contains these elements: lifetime, path, domain, secure and httpOnly.');
}
}
diff --git a/framework/yii/web/UploadedFile.php b/framework/yii/web/UploadedFile.php
index 3cb6813..1de4d46 100644
--- a/framework/yii/web/UploadedFile.php
+++ b/framework/yii/web/UploadedFile.php
@@ -74,7 +74,7 @@ class UploadedFile extends Object
* For example, '[1]file' for tabular file uploading; and 'file[1]' for an element in a file array.
* @return UploadedFile the instance of the uploaded file.
* Null is returned if no file is uploaded for the specified model attribute.
- * @see getInstanceByName
+ * @see getInstanceByName()
*/
public static function getInstance($model, $attribute)
{
diff --git a/framework/yii/web/UrlManager.php b/framework/yii/web/UrlManager.php
index c5f4c28..540e8d5 100644
--- a/framework/yii/web/UrlManager.php
+++ b/framework/yii/web/UrlManager.php
@@ -14,6 +14,22 @@ use yii\caching\Cache;
/**
* UrlManager handles HTTP request parsing and creation of URLs based on a set of rules.
*
+ * UrlManager is configured as an application component in [[yii\base\Application]] by default.
+ * You can access that instance via `Yii::$app->urlManager`.
+ *
+ * You can modify its configuration by adding an array to your application config under `components`
+ * as it is shown in the following example:
+ *
+ * ~~~
+ * 'urlManager' => [
+ * 'enablePrettyUrl' => true,
+ * 'rules' => [
+ * // your rules go here
+ * ],
+ * // ...
+ * ]
+ * ~~~
+ *
* @property string $baseUrl The base URL that is used by [[createUrl()]] to prepend URLs it creates.
* @property string $hostInfo The host info (e.g. "http://www.example.com") that is used by
* [[createAbsoluteUrl()]] to prepend URLs it creates.
@@ -169,7 +185,7 @@ class UrlManager extends Component
{
if ($this->enablePrettyUrl) {
$pathInfo = $request->getPathInfo();
- /** @var $rule UrlRule */
+ /** @var UrlRule $rule */
foreach ($this->rules as $rule) {
if (($result = $rule->parseRequest($this, $request)) !== false) {
Yii::trace("Request parsed with URL rule: {$rule->name}", __METHOD__);
@@ -224,7 +240,7 @@ class UrlManager extends Component
$baseUrl = $this->getBaseUrl();
if ($this->enablePrettyUrl) {
- /** @var $rule UrlRule */
+ /** @var UrlRule $rule */
foreach ($this->rules as $rule) {
if (($url = $rule->createUrl($this, $route, $params)) !== false) {
if ($rule->host !== null) {
@@ -251,7 +267,7 @@ class UrlManager extends Component
if (!empty($params)) {
$url .= '&' . http_build_query($params);
}
- return $url;
+ return $url . $anchor;
}
}
@@ -282,7 +298,7 @@ class UrlManager extends Component
public function getBaseUrl()
{
if ($this->_baseUrl === null) {
- /** @var $request \yii\web\Request */
+ /** @var \yii\web\Request $request */
$request = Yii::$app->getRequest();
$this->_baseUrl = $this->showScriptName || !$this->enablePrettyUrl ? $request->getScriptUrl() : $request->getBaseUrl();
}
diff --git a/framework/yii/web/UrlRule.php b/framework/yii/web/UrlRule.php
index 6ebc615..af227cd 100644
--- a/framework/yii/web/UrlRule.php
+++ b/framework/yii/web/UrlRule.php
@@ -11,7 +11,17 @@ use yii\base\Object;
use yii\base\InvalidConfigException;
/**
- * UrlRule represents a rule used for parsing and generating URLs.
+ * UrlRule represents a rule used by [[UrlManager]] for parsing and generating URLs.
+ *
+ * To define your own URL parsing and creation logic you can extend from this class
+ * and add it to [[UrlManager::rules]] like this:
+ *
+ * ~~~
+ * 'rules' => [
+ * ['class' => 'MyUrlRule', 'pattern' => '...', 'route' => 'site/index', ...],
+ * // ...
+ * ]
+ * ~~~
*
* @author Qiang Xue
* @since 2.0
diff --git a/framework/yii/web/User.php b/framework/yii/web/User.php
index eca2ed6..682d78e 100644
--- a/framework/yii/web/User.php
+++ b/framework/yii/web/User.php
@@ -20,6 +20,21 @@ use yii\base\InvalidConfigException;
* User works with a class implementing the [[IdentityInterface]]. This class implements
* the actual user authentication logic and is often backed by a user database table.
*
+ * User is configured as an application component in [[yii\web\Application]] by default.
+ * You can access that instance via `Yii::$app->user`.
+ *
+ * You can modify its configuration by adding an array to your application config under `components`
+ * as it is shown in the following example:
+ *
+ * ~~~
+ * 'user' => [
+ * 'identityClass' => 'app\models\User', // User must implement the IdentityInterface
+ * 'enableAutoLogin' => true,
+ * // 'loginUrl' => ['user/login'],
+ * // ...
+ * ]
+ * ~~~
+ *
* @property string|integer $id The unique identifier for the user. If null, it means the user is a guest.
* This property is read-only.
* @property IdentityInterface $identity The identity object associated with the currently logged user. Null
@@ -129,8 +144,8 @@ class User extends Component
* Returns the identity object associated with the currently logged user.
* @return IdentityInterface the identity object associated with the currently logged user.
* Null is returned if the user is not logged in (not authenticated).
- * @see login
- * @see logout
+ * @see login()
+ * @see logout()
*/
public function getIdentity()
{
@@ -139,7 +154,7 @@ class User extends Component
if ($id === null) {
$this->_identity = null;
} else {
- /** @var $class IdentityInterface */
+ /** @var IdentityInterface $class */
$class = $this->identityClass;
$this->_identity = $class::findIdentity($id);
}
@@ -180,6 +195,9 @@ class User extends Component
{
if ($this->beforeLogin($identity, false)) {
$this->switchIdentity($identity, $duration);
+ $id = $identity->getId();
+ $ip = Yii::$app->getRequest()->getUserIP();
+ Yii::info("User '$id' logged in from $ip.", __METHOD__);
$this->afterLogin($identity, false);
}
return !$this->getIsGuest();
@@ -199,12 +217,14 @@ class User extends Component
$data = json_decode($value, true);
if (count($data) === 3 && isset($data[0], $data[1], $data[2])) {
list ($id, $authKey, $duration) = $data;
- /** @var $class IdentityInterface */
+ /** @var IdentityInterface $class */
$class = $this->identityClass;
$identity = $class::findIdentity($id);
if ($identity !== null && $identity->validateAuthKey($authKey)) {
if ($this->beforeLogin($identity, true)) {
$this->switchIdentity($identity, $this->autoRenewCookie ? $duration : 0);
+ $ip = Yii::$app->getRequest()->getUserIP();
+ Yii::info("User '$id' logged in from $ip via cookie.", __METHOD__);
$this->afterLogin($identity, true);
}
} elseif ($identity !== null) {
@@ -225,6 +245,9 @@ class User extends Component
$identity = $this->getIdentity();
if ($identity !== null && $this->beforeLogout($identity)) {
$this->switchIdentity(null);
+ $id = $identity->getId();
+ $ip = Yii::$app->getRequest()->getUserIP();
+ Yii::info("User '$id' logged out from $ip.", __METHOD__);
if ($destroySession) {
Yii::$app->getSession()->destroy();
}
@@ -258,7 +281,7 @@ class User extends Component
* If this is null and the return URL was not set previously, [[Application::homeUrl]] will be redirected to.
* Please refer to [[setReturnUrl()]] on accepted format of the URL.
* @return string the URL that the user should be redirected to after login.
- * @see loginRequired
+ * @see loginRequired()
*/
public function getReturnUrl($defaultUrl = null)
{
@@ -405,7 +428,7 @@ class User extends Component
* information in the cookie.
* @param IdentityInterface $identity
* @param integer $duration number of seconds that the user can remain in logged-in status.
- * @see loginByCookie
+ * @see loginByCookie()
*/
protected function sendIdentityCookie($identity, $duration)
{
diff --git a/framework/yii/web/View.php b/framework/yii/web/View.php
new file mode 100644
index 0000000..db0c500
--- /dev/null
+++ b/framework/yii/web/View.php
@@ -0,0 +1,447 @@
+view`.
+ *
+ * You can modify its configuration by adding an array to your application config under `components`
+ * as it is shown in the following example:
+ *
+ * ~~~
+ * 'view' => [
+ * 'theme' => 'app\themes\MyTheme',
+ * 'renderers' => [
+ * // you may add Smarty or Twig renderer here
+ * ]
+ * // ...
+ * ]
+ * ~~~
+ *
+ * @property \yii\web\AssetManager $assetManager The asset manager. Defaults to the "assetManager" application
+ * component.
+ *
+ * @author Qiang Xue
+ * @since 2.0
+ */
+class View extends \yii\base\View
+{
+ const EVENT_BEGIN_BODY = 'beginBody';
+ /**
+ * @event Event an event that is triggered by [[endBody()]].
+ */
+ const EVENT_END_BODY = 'endBody';
+
+ /**
+ * The location of registered JavaScript code block or files.
+ * This means the location is in the head section.
+ */
+ const POS_HEAD = 1;
+ /**
+ * The location of registered JavaScript code block or files.
+ * This means the location is at the beginning of the body section.
+ */
+ const POS_BEGIN = 2;
+ /**
+ * The location of registered JavaScript code block or files.
+ * This means the location is at the end of the body section.
+ */
+ const POS_END = 3;
+ /**
+ * The location of registered JavaScript code block.
+ * This means the JavaScript code block will be enclosed within `jQuery(document).ready()`.
+ */
+ const POS_READY = 4;
+ /**
+ * This is internally used as the placeholder for receiving the content registered for the head section.
+ */
+ const PH_HEAD = '';
+ /**
+ * This is internally used as the placeholder for receiving the content registered for the beginning of the body section.
+ */
+ const PH_BODY_BEGIN = '';
+ /**
+ * This is internally used as the placeholder for receiving the content registered for the end of the body section.
+ */
+ const PH_BODY_END = '';
+
+ /**
+ * @var AssetBundle[] list of the registered asset bundles. The keys are the bundle names, and the values
+ * are the registered [[AssetBundle]] objects.
+ * @see registerAssetBundle()
+ */
+ public $assetBundles = [];
+ /**
+ * @var string the page title
+ */
+ public $title;
+ /**
+ * @var array the registered meta tags.
+ * @see registerMetaTag()
+ */
+ public $metaTags;
+ /**
+ * @var array the registered link tags.
+ * @see registerLinkTag()
+ */
+ public $linkTags;
+ /**
+ * @var array the registered CSS code blocks.
+ * @see registerCss()
+ */
+ public $css;
+ /**
+ * @var array the registered CSS files.
+ * @see registerCssFile()
+ */
+ public $cssFiles;
+ /**
+ * @var array the registered JS code blocks
+ * @see registerJs()
+ */
+ public $js;
+ /**
+ * @var array the registered JS files.
+ * @see registerJsFile()
+ */
+ public $jsFiles;
+
+ private $_assetManager;
+
+ /**
+ * Registers the asset manager being used by this view object.
+ * @return \yii\web\AssetManager the asset manager. Defaults to the "assetManager" application component.
+ */
+ public function getAssetManager()
+ {
+ return $this->_assetManager ?: Yii::$app->getAssetManager();
+ }
+
+ /**
+ * Sets the asset manager.
+ * @param \yii\web\AssetManager $value the asset manager
+ */
+ public function setAssetManager($value)
+ {
+ $this->_assetManager = $value;
+ }
+
+ /**
+ * Marks the ending of an HTML page.
+ */
+ public function endPage()
+ {
+ $this->trigger(self::EVENT_END_PAGE);
+
+ $content = ob_get_clean();
+ foreach (array_keys($this->assetBundles) as $bundle) {
+ $this->registerAssetFiles($bundle);
+ }
+ echo strtr($content, [
+ self::PH_HEAD => $this->renderHeadHtml(),
+ self::PH_BODY_BEGIN => $this->renderBodyBeginHtml(),
+ self::PH_BODY_END => $this->renderBodyEndHtml(),
+ ]);
+
+ unset(
+ $this->metaTags,
+ $this->linkTags,
+ $this->css,
+ $this->cssFiles,
+ $this->js,
+ $this->jsFiles
+ );
+ }
+
+ /**
+ * Registers all files provided by an asset bundle including depending bundles files.
+ * Removes a bundle from [[assetBundles]] once files are registered.
+ * @param string $name name of the bundle to register
+ */
+ private function registerAssetFiles($name)
+ {
+ if (!isset($this->assetBundles[$name])) {
+ return;
+ }
+ $bundle = $this->assetBundles[$name];
+ foreach ($bundle->depends as $dep) {
+ $this->registerAssetFiles($dep);
+ }
+ $bundle->registerAssetFiles($this);
+ unset($this->assetBundles[$name]);
+ }
+
+ /**
+ * Marks the beginning of an HTML body section.
+ */
+ public function beginBody()
+ {
+ echo self::PH_BODY_BEGIN;
+ $this->trigger(self::EVENT_BEGIN_BODY);
+ }
+
+ /**
+ * Marks the ending of an HTML body section.
+ */
+ public function endBody()
+ {
+ $this->trigger(self::EVENT_END_BODY);
+ echo self::PH_BODY_END;
+ }
+
+ /**
+ * Marks the position of an HTML head section.
+ */
+ public function head()
+ {
+ echo self::PH_HEAD;
+ }
+
+ /**
+ * Registers the named asset bundle.
+ * All dependent asset bundles will be registered.
+ * @param string $name the name of the asset bundle.
+ * @param integer|null $position if set, this forces a minimum position for javascript files.
+ * This will adjust depending assets javascript file position or fail if requirement can not be met.
+ * If this is null, asset bundles position settings will not be changed.
+ * See [[registerJsFile]] for more details on javascript position.
+ * @return AssetBundle the registered asset bundle instance
+ * @throws InvalidConfigException if the asset bundle does not exist or a circular dependency is detected
+ */
+ public function registerAssetBundle($name, $position = null)
+ {
+ if (!isset($this->assetBundles[$name])) {
+ $am = $this->getAssetManager();
+ $bundle = $am->getBundle($name);
+ $this->assetBundles[$name] = false;
+ // register dependencies
+ $pos = isset($bundle->jsOptions['position']) ? $bundle->jsOptions['position'] : null;
+ foreach ($bundle->depends as $dep) {
+ $this->registerAssetBundle($dep, $pos);
+ }
+ $this->assetBundles[$name] = $bundle;
+ } elseif ($this->assetBundles[$name] === false) {
+ throw new InvalidConfigException("A circular dependency is detected for bundle '$name'.");
+ } else {
+ $bundle = $this->assetBundles[$name];
+ }
+
+ if ($position !== null) {
+ $pos = isset($bundle->jsOptions['position']) ? $bundle->jsOptions['position'] : null;
+ if ($pos === null) {
+ $bundle->jsOptions['position'] = $pos = $position;
+ } elseif ($pos > $position) {
+ throw new InvalidConfigException("An asset bundle that depends on '$name' has a higher javascript file position configured than '$name'.");
+ }
+ // update position for all dependencies
+ foreach ($bundle->depends as $dep) {
+ $this->registerAssetBundle($dep, $pos);
+ }
+ }
+ return $bundle;
+ }
+
+ /**
+ * Registers a meta tag.
+ * @param array $options the HTML attributes for the meta tag.
+ * @param string $key the key that identifies the meta tag. If two meta tags are registered
+ * with the same key, the latter will overwrite the former. If this is null, the new meta tag
+ * will be appended to the existing ones.
+ */
+ public function registerMetaTag($options, $key = null)
+ {
+ if ($key === null) {
+ $this->metaTags[] = Html::tag('meta', '', $options);
+ } else {
+ $this->metaTags[$key] = Html::tag('meta', '', $options);
+ }
+ }
+
+ /**
+ * Registers a link tag.
+ * @param array $options the HTML attributes for the link tag.
+ * @param string $key the key that identifies the link tag. If two link tags are registered
+ * with the same key, the latter will overwrite the former. If this is null, the new link tag
+ * will be appended to the existing ones.
+ */
+ public function registerLinkTag($options, $key = null)
+ {
+ if ($key === null) {
+ $this->linkTags[] = Html::tag('link', '', $options);
+ } else {
+ $this->linkTags[$key] = Html::tag('link', '', $options);
+ }
+ }
+
+ /**
+ * Registers a CSS code block.
+ * @param string $css the CSS code block to be registered
+ * @param array $options the HTML attributes for the style tag.
+ * @param string $key the key that identifies the CSS code block. If null, it will use
+ * $css as the key. If two CSS code blocks are registered with the same key, the latter
+ * will overwrite the former.
+ */
+ public function registerCss($css, $options = [], $key = null)
+ {
+ $key = $key ?: md5($css);
+ $this->css[$key] = Html::style($css, $options);
+ }
+
+ /**
+ * Registers a CSS file.
+ * @param string $url the CSS file to be registered.
+ * @param array $options the HTML attributes for the link tag.
+ * @param string $key the key that identifies the CSS script file. If null, it will use
+ * $url as the key. If two CSS files are registered with the same key, the latter
+ * will overwrite the former.
+ */
+ public function registerCssFile($url, $options = [], $key = null)
+ {
+ $key = $key ?: $url;
+ $this->cssFiles[$key] = Html::cssFile($url, $options);
+ }
+
+ /**
+ * Registers a JS code block.
+ * @param string $js the JS code block to be registered
+ * @param integer $position the position at which the JS script tag should be inserted
+ * in a page. The possible values are:
+ *
+ * - [[POS_HEAD]]: in the head section
+ * - [[POS_BEGIN]]: at the beginning of the body section
+ * - [[POS_END]]: at the end of the body section
+ * - [[POS_READY]]: enclosed within jQuery(document).ready(). This is the default value.
+ * Note that by using this position, the method will automatically register the jQuery js file.
+ *
+ * @param string $key the key that identifies the JS code block. If null, it will use
+ * $js as the key. If two JS code blocks are registered with the same key, the latter
+ * will overwrite the former.
+ */
+ public function registerJs($js, $position = self::POS_READY, $key = null)
+ {
+ $key = $key ?: md5($js);
+ $this->js[$position][$key] = $js;
+ if ($position === self::POS_READY) {
+ JqueryAsset::register($this);
+ }
+ }
+
+ /**
+ * Registers a JS file.
+ * Please note that when this file depends on other JS files to be registered before,
+ * for example jQuery, you should use [[registerAssetBundle]] instead.
+ * @param string $url the JS file to be registered.
+ * @param array $options the HTML attributes for the script tag. A special option
+ * named "position" is supported which specifies where the JS script tag should be inserted
+ * in a page. The possible values of "position" are:
+ *
+ * - [[POS_HEAD]]: in the head section
+ * - [[POS_BEGIN]]: at the beginning of the body section
+ * - [[POS_END]]: at the end of the body section. This is the default value.
+ *
+ * @param string $key the key that identifies the JS script file. If null, it will use
+ * $url as the key. If two JS files are registered with the same key, the latter
+ * will overwrite the former.
+ */
+ public function registerJsFile($url, $options = [], $key = null)
+ {
+ $position = isset($options['position']) ? $options['position'] : self::POS_END;
+ unset($options['position']);
+ $key = $key ?: $url;
+ $this->jsFiles[$position][$key] = Html::jsFile($url, $options);
+ }
+
+ /**
+ * Renders the content to be inserted in the head section.
+ * The content is rendered using the registered meta tags, link tags, CSS/JS code blocks and files.
+ * @return string the rendered content
+ */
+ protected function renderHeadHtml()
+ {
+ $lines = [];
+ if (!empty($this->metaTags)) {
+ $lines[] = implode("\n", $this->metaTags);
+ }
+
+ $request = Yii::$app->getRequest();
+ if ($request instanceof \yii\web\Request && $request->enableCsrfValidation) {
+ $lines[] = Html::tag('meta', '', ['name' => 'csrf-var', 'content' => $request->csrfVar]);
+ $lines[] = Html::tag('meta', '', ['name' => 'csrf-token', 'content' => $request->getCsrfToken()]);
+ }
+
+ if (!empty($this->linkTags)) {
+ $lines[] = implode("\n", $this->linkTags);
+ }
+ if (!empty($this->cssFiles)) {
+ $lines[] = implode("\n", $this->cssFiles);
+ }
+ if (!empty($this->css)) {
+ $lines[] = implode("\n", $this->css);
+ }
+ if (!empty($this->jsFiles[self::POS_HEAD])) {
+ $lines[] = implode("\n", $this->jsFiles[self::POS_HEAD]);
+ }
+ if (!empty($this->js[self::POS_HEAD])) {
+ $lines[] = Html::script(implode("\n", $this->js[self::POS_HEAD]), ['type' => 'text/javascript']);
+ }
+ return empty($lines) ? '' : implode("\n", $lines);
+ }
+
+ /**
+ * Renders the content to be inserted at the beginning of the body section.
+ * The content is rendered using the registered JS code blocks and files.
+ * @return string the rendered content
+ */
+ protected function renderBodyBeginHtml()
+ {
+ $lines = [];
+ if (!empty($this->jsFiles[self::POS_BEGIN])) {
+ $lines[] = implode("\n", $this->jsFiles[self::POS_BEGIN]);
+ }
+ if (!empty($this->js[self::POS_BEGIN])) {
+ $lines[] = Html::script(implode("\n", $this->js[self::POS_BEGIN]), ['type' => 'text/javascript']);
+ }
+ return empty($lines) ? '' : implode("\n", $lines);
+ }
+
+ /**
+ * Renders the content to be inserted at the end of the body section.
+ * The content is rendered using the registered JS code blocks and files.
+ * @return string the rendered content
+ */
+ protected function renderBodyEndHtml()
+ {
+ $lines = [];
+ if (!empty($this->jsFiles[self::POS_END])) {
+ $lines[] = implode("\n", $this->jsFiles[self::POS_END]);
+ }
+ if (!empty($this->js[self::POS_END])) {
+ $lines[] = Html::script(implode("\n", $this->js[self::POS_END]), ['type' => 'text/javascript']);
+ }
+ if (!empty($this->js[self::POS_READY])) {
+ $js = "jQuery(document).ready(function(){\n" . implode("\n", $this->js[self::POS_READY]) . "\n});";
+ $lines[] = Html::script($js, ['type' => 'text/javascript']);
+ }
+ return empty($lines) ? '' : implode("\n", $lines);
+ }
+}
diff --git a/framework/yii/web/XmlResponseFormatter.php b/framework/yii/web/XmlResponseFormatter.php
index 05c2762..292424a 100644
--- a/framework/yii/web/XmlResponseFormatter.php
+++ b/framework/yii/web/XmlResponseFormatter.php
@@ -17,6 +17,8 @@ use yii\helpers\StringHelper;
/**
* XmlResponseFormatter formats the given data into an XML response content.
*
+ * It is used by [[Response]] to format response data.
+ *
* @author Qiang Xue
* @since 2.0
*/
diff --git a/framework/yii/web/YiiAsset.php b/framework/yii/web/YiiAsset.php
index e49082d..d38b711 100644
--- a/framework/yii/web/YiiAsset.php
+++ b/framework/yii/web/YiiAsset.php
@@ -8,6 +8,8 @@
namespace yii\web;
/**
+ * This asset bundle provides the base javascript files for the Yii Framework.
+ *
* @author Qiang Xue
* @since 2.0
*/
diff --git a/framework/yii/widgets/ActiveField.php b/framework/yii/widgets/ActiveField.php
index fc30af5..dc97cbd 100644
--- a/framework/yii/widgets/ActiveField.php
+++ b/framework/yii/widgets/ActiveField.php
@@ -324,6 +324,7 @@ class ActiveField extends Component
*/
public function fileInput($options = [])
{
+ // https://github.com/yiisoft/yii2/pull/795
if ($this->inputOptions !== ['class' => 'form-control']) {
$options = array_merge($this->inputOptions, $options);
}
diff --git a/framework/yii/widgets/ActiveForm.php b/framework/yii/widgets/ActiveForm.php
index c018011..b218a2e 100644
--- a/framework/yii/widgets/ActiveForm.php
+++ b/framework/yii/widgets/ActiveForm.php
@@ -220,7 +220,7 @@ class ActiveForm extends Widget
$lines = [];
foreach ($models as $model) {
- /** @var $model Model */
+ /** @var Model $model */
foreach ($model->getFirstErrors() as $error) {
$lines[] = Html::encode($error);
}
diff --git a/framework/yii/widgets/BaseListView.php b/framework/yii/widgets/BaseListView.php
index ffbba38..4c4e5a4 100644
--- a/framework/yii/widgets/BaseListView.php
+++ b/framework/yii/widgets/BaseListView.php
@@ -53,10 +53,13 @@ abstract class BaseListView extends Widget
*/
public $summary;
/**
- * @var string|boolean the HTML content to be displayed when [[dataProvider]] does not have any data.
- * If false, the list view will still be displayed (without body content though).
+ * @var boolean whether to show the list view if [[dataProvider]] returns no data.
*/
- public $empty;
+ public $showOnEmpty = false;
+ /**
+ * @var string the HTML content to be displayed when [[dataProvider]] does not have any data.
+ */
+ public $emptyText;
/**
* @var string the layout that determines how different sections of the list view should be organized.
* The following tokens will be replaced with the corresponding section contents:
@@ -83,6 +86,9 @@ abstract class BaseListView extends Widget
if ($this->dataProvider === null) {
throw new InvalidConfigException('The "dataProvider" property must be set.');
}
+ if ($this->emptyText === null) {
+ $this->emptyText = Yii::t('yii', 'No results found.');
+ }
$this->dataProvider->prepare();
}
@@ -91,13 +97,13 @@ abstract class BaseListView extends Widget
*/
public function run()
{
- if ($this->dataProvider->getCount() > 0 || $this->empty === false) {
+ if ($this->dataProvider->getCount() > 0 || $this->showOnEmpty) {
$content = preg_replace_callback("/{\\w+}/", function ($matches) {
$content = $this->renderSection($matches[0]);
return $content === false ? $matches[0] : $content;
}, $this->layout);
} else {
- $content = '' . ($this->empty === null ? Yii::t('yii', 'No results found.') : $this->empty) . '
';
+ $content = $this->renderEmpty();
}
$tag = ArrayHelper::remove($this->options, 'tag', 'div');
echo Html::tag($tag, $content, $this->options);
@@ -126,27 +132,43 @@ abstract class BaseListView extends Widget
}
/**
+ * Renders the HTML content indicating that the list view has no data.
+ * @return string the rendering result
+ * @see emptyText
+ */
+ public function renderEmpty()
+ {
+ return '' . ($this->emptyText === null ? Yii::t('yii', 'No results found.') : $this->emptyText) . '
';
+ }
+
+ /**
* Renders the summary text.
*/
public function renderSummary()
{
$count = $this->dataProvider->getCount();
+ if ($count <= 0) {
+ return '';
+ }
if (($pagination = $this->dataProvider->getPagination()) !== false) {
$totalCount = $this->dataProvider->getTotalCount();
$begin = $pagination->getPage() * $pagination->pageSize + 1;
$end = $begin + $count - 1;
+ if ($begin > $end) {
+ $begin = $end;
+ }
$page = $pagination->getPage() + 1;
$pageCount = $pagination->pageCount;
if (($summaryContent = $this->summary) === null) {
$summaryContent = ''
- . Yii::t('yii', 'Showing {totalCount, plural, =0{0} other{{begin, number, integer}-{end, number, integer}}} of {totalCount, number, integer} {totalCount, plural, one{item} other{items}}.')
+ . Yii::t('yii', 'Showing {begin, number}-{end, number} of {totalCount, number} {totalCount, plural, one{item} other{items}}.')
. '
';
}
} else {
$begin = $page = $pageCount = 1;
$end = $totalCount = $count;
if (($summaryContent = $this->summary) === null) {
- $summaryContent = '' . Yii::t('yii', 'Total {count} {count, plural, one{item} other{items}}.') . '
';
+ $summaryContent = '' . Yii::t('yii', 'Total {count, number} {count, plural, one{item} other{items}}.') . '
';
}
}
return Yii::$app->getI18n()->format($summaryContent, [
diff --git a/framework/yii/widgets/Menu.php b/framework/yii/widgets/Menu.php
index 7ea7717..d5ff8ef 100644
--- a/framework/yii/widgets/Menu.php
+++ b/framework/yii/widgets/Menu.php
@@ -104,7 +104,7 @@ class Menu extends Widget
/**
* @var boolean whether to automatically activate items according to whether their route setting
* matches the currently requested route.
- * @see isItemActive
+ * @see isItemActive()
*/
public $activateItems = true;
/**
@@ -137,14 +137,14 @@ class Menu extends Widget
* @var string the route used to determine if a menu item is active or not.
* If not set, it will use the route of the current request.
* @see params
- * @see isItemActive
+ * @see isItemActive()
*/
public $route;
/**
* @var array the parameters used to determine if a menu item is active or not.
* If not set, it will use `$_GET`.
* @see route
- * @see isItemActive
+ * @see isItemActive()
*/
public $params;
diff --git a/tests/unit/VendorTestCase.php b/tests/unit/VendorTestCase.php
new file mode 100644
index 0000000..d633d02
--- /dev/null
+++ b/tests/unit/VendorTestCase.php
@@ -0,0 +1,30 @@
+> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
-echo "apc.enable_cli = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
\ No newline at end of file
+#!/bin/sh
+
+if [ "$(expr "$TRAVIS_PHP_VERSION" "<" "5.5")" -eq 1 ]; then
+ echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
+ echo "apc.enable_cli = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
+else
+ echo "Not installing APC as it is not available in PHP 5.5 anymore."
+fi
\ No newline at end of file
diff --git a/tests/unit/data/views/layout.php b/tests/unit/data/views/layout.php
index 0b5a0e1..97a0888 100644
--- a/tests/unit/data/views/layout.php
+++ b/tests/unit/data/views/layout.php
@@ -1,7 +1,7 @@
beginPage(); ?>
@@ -19,4 +19,4 @@
endBody(); ?>
-endPage(); ?>
\ No newline at end of file
+endPage(); ?>
diff --git a/tests/unit/data/views/rawlayout.php b/tests/unit/data/views/rawlayout.php
index 6864642..aaa489f 100644
--- a/tests/unit/data/views/rawlayout.php
+++ b/tests/unit/data/views/rawlayout.php
@@ -1,5 +1,5 @@
beginPage(); ?>1head(); ?>2beginBody(); ?>3endBody(); ?>4endPage(); ?>
\ No newline at end of file
+?>beginPage(); ?>1head(); ?>2beginBody(); ?>3endBody(); ?>4endPage(); ?>
diff --git a/tests/unit/extensions/swiftmailer/MailerTest.php b/tests/unit/extensions/swiftmailer/MailerTest.php
new file mode 100644
index 0000000..24602b2
--- /dev/null
+++ b/tests/unit/extensions/swiftmailer/MailerTest.php
@@ -0,0 +1,71 @@
+mockApplication([
+ 'components' => [
+ 'email' => $this->createTestEmailComponent()
+ ]
+ ]);
+ }
+
+ /**
+ * @return Mailer test email component instance.
+ */
+ protected function createTestEmailComponent()
+ {
+ $component = new Mailer();
+ return $component;
+ }
+
+ // Tests :
+
+ public function testSetupTransport()
+ {
+ $mailer = new Mailer();
+
+ $transport = \Swift_MailTransport::newInstance();
+ $mailer->setTransport($transport);
+ $this->assertEquals($transport, $mailer->getTransport(), 'Unable to setup transport!');
+ }
+
+ /**
+ * @depends testSetupTransport
+ */
+ public function testConfigureTransport()
+ {
+ $mailer = new Mailer();
+
+ $transportConfig = [
+ 'class' => 'Swift_SmtpTransport',
+ 'host' => 'localhost',
+ 'username' => 'username',
+ 'password' => 'password',
+ ];
+ $mailer->setTransport($transportConfig);
+ $transport = $mailer->getTransport();
+ $this->assertTrue(is_object($transport), 'Unable to setup transport via config!');
+ $this->assertEquals($transportConfig['class'], get_class($transport), 'Invalid transport class!');
+ $this->assertEquals($transportConfig['host'], $transport->getHost(), 'Invalid transport host!');
+ }
+
+ public function testGetSwiftMailer()
+ {
+ $mailer = new Mailer();
+ $this->assertTrue(is_object($mailer->getSwiftMailer()), 'Unable to get Swift mailer instance!');
+ }
+}
\ No newline at end of file
diff --git a/tests/unit/extensions/swiftmailer/MessageTest.php b/tests/unit/extensions/swiftmailer/MessageTest.php
new file mode 100644
index 0000000..6309f15
--- /dev/null
+++ b/tests/unit/extensions/swiftmailer/MessageTest.php
@@ -0,0 +1,340 @@
+mockApplication([
+ 'components' => [
+ 'mail' => $this->createTestEmailComponent()
+ ]
+ ]);
+ $filePath = $this->getTestFilePath();
+ if (!file_exists($filePath)) {
+ FileHelper::createDirectory($filePath);
+ }
+ }
+
+ public function tearDown()
+ {
+ $filePath = $this->getTestFilePath();
+ if (file_exists($filePath)) {
+ FileHelper::removeDirectory($filePath);
+ }
+ }
+
+ /**
+ * @return string test file path.
+ */
+ protected function getTestFilePath()
+ {
+ return Yii::getAlias('@yiiunit/runtime') . DIRECTORY_SEPARATOR . basename(get_class($this)) . '_' . getmypid();
+ }
+
+ /**
+ * @return Mailer test email component instance.
+ */
+ protected function createTestEmailComponent()
+ {
+ $component = new Mailer();
+ return $component;
+ }
+
+ /**
+ * @return Message test message instance.
+ */
+ protected function createTestMessage()
+ {
+ return Yii::$app->getComponent('mail')->compose();
+ }
+
+ /**
+ * Creates image file with given text.
+ * @param string $fileName file name.
+ * @param string $text text to be applied on image.
+ * @return string image file full name.
+ */
+ protected function createImageFile($fileName = 'test.jpg', $text = 'Test Image')
+ {
+ if (!function_exists('imagecreatetruecolor')) {
+ $this->markTestSkipped('GD lib required.');
+ }
+ $fileFullName = $this->getTestFilePath() . DIRECTORY_SEPARATOR . $fileName;
+ $image = imagecreatetruecolor(120, 20);
+ $textColor = imagecolorallocate($image, 233, 14, 91);
+ imagestring($image, 1, 5, 5, $text, $textColor);
+ imagejpeg($image, $fileFullName);
+ imagedestroy($image);
+ return $fileFullName;
+ }
+
+ /**
+ * Finds the attachment object in the message.
+ * @param Message $message message instance
+ * @return null|\Swift_Mime_Attachment attachment instance.
+ */
+ protected function getAttachment(Message $message)
+ {
+ $messageParts = $message->getSwiftMessage()->getChildren();
+ $attachment = null;
+ foreach ($messageParts as $part) {
+ if ($part instanceof \Swift_Mime_Attachment) {
+ $attachment = $part;
+ break;
+ }
+ }
+ return $attachment;
+ }
+
+ // Tests :
+
+ public function testGetSwiftMessage()
+ {
+ $message = new Message();
+ $this->assertTrue(is_object($message->getSwiftMessage()), 'Unable to get Swift message!');
+ }
+
+ /**
+ * @depends testGetSwiftMessage
+ */
+ public function testSetGet()
+ {
+ $message = new Message();
+
+ $charset = 'utf-16';
+ $message->setCharset($charset);
+ $this->assertEquals($charset, $message->getCharset(), 'Unable to set charset!');
+
+ $subject = 'Test Subject';
+ $message->setSubject($subject);
+ $this->assertEquals($subject, $message->getSubject(), 'Unable to set subject!');
+
+ $from = 'from@somedomain.com';
+ $message->setFrom($from);
+ $this->assertContains($from, array_keys($message->getFrom()), 'Unable to set from!');
+
+ $replyTo = 'reply-to@somedomain.com';
+ $message->setReplyTo($replyTo);
+ $this->assertContains($replyTo, array_keys($message->getReplyTo()), 'Unable to set replyTo!');
+
+ $to = 'someuser@somedomain.com';
+ $message->setTo($to);
+ $this->assertContains($to, array_keys($message->getTo()), 'Unable to set to!');
+
+ $cc = 'ccuser@somedomain.com';
+ $message->setCc($cc);
+ $this->assertContains($cc, array_keys($message->getCc()), 'Unable to set cc!');
+
+ $bcc = 'bccuser@somedomain.com';
+ $message->setBcc($bcc);
+ $this->assertContains($bcc, array_keys($message->getBcc()), 'Unable to set bcc!');
+ }
+
+ /**
+ * @depends testGetSwiftMessage
+ */
+ public function testSetupHeaders()
+ {
+ $charset = 'utf-16';
+ $subject = 'Test Subject';
+ $from = 'from@somedomain.com';
+ $replyTo = 'reply-to@somedomain.com';
+ $to = 'someuser@somedomain.com';
+ $cc = 'ccuser@somedomain.com';
+ $bcc = 'bccuser@somedomain.com';
+
+ $messageString = $this->createTestMessage()
+ ->setCharset($charset)
+ ->setSubject($subject)
+ ->setFrom($from)
+ ->setReplyTo($replyTo)
+ ->setTo($to)
+ ->setCc($cc)
+ ->setBcc($bcc)
+ ->toString();
+
+ $this->assertContains('charset=' . $charset, $messageString, 'Incorrect charset!');
+ $this->assertContains('Subject: ' . $subject, $messageString, 'Incorrect "Subject" header!');
+ $this->assertContains('From: ' . $from, $messageString, 'Incorrect "From" header!');
+ $this->assertContains('Reply-To: ' . $replyTo, $messageString, 'Incorrect "Reply-To" header!');
+ $this->assertContains('To: ' . $to, $messageString, 'Incorrect "To" header!');
+ $this->assertContains('Cc: ' . $cc, $messageString, 'Incorrect "Cc" header!');
+ $this->assertContains('Bcc: ' . $bcc, $messageString, 'Incorrect "Bcc" header!');
+ }
+
+ /**
+ * @depends testGetSwiftMessage
+ */
+ public function testSend()
+ {
+ $message = $this->createTestMessage();
+ $message->setTo($this->testEmailReceiver);
+ $message->setFrom('someuser@somedomain.com');
+ $message->setSubject('Yii Swift Test');
+ $message->setTextBody('Yii Swift Test body');
+ $this->assertTrue($message->send());
+ }
+
+ /**
+ * @depends testSend
+ */
+ public function testAttachFile()
+ {
+ $message = $this->createTestMessage();
+
+ $message->setTo($this->testEmailReceiver);
+ $message->setFrom('someuser@somedomain.com');
+ $message->setSubject('Yii Swift Attach File Test');
+ $message->setTextBody('Yii Swift Attach File Test body');
+ $fileName = __FILE__;
+ $message->attach($fileName);
+
+ $this->assertTrue($message->send());
+
+ $attachment = $this->getAttachment($message);
+ $this->assertTrue(is_object($attachment), 'No attachment found!');
+ $this->assertContains($attachment->getFilename(), $fileName, 'Invalid file name!');
+ }
+
+ /**
+ * @depends testSend
+ */
+ public function testAttachContent()
+ {
+ $message = $this->createTestMessage();
+
+ $message->setTo($this->testEmailReceiver);
+ $message->setFrom('someuser@somedomain.com');
+ $message->setSubject('Yii Swift Create Attachment Test');
+ $message->setTextBody('Yii Swift Create Attachment Test body');
+ $fileName = 'test.txt';
+ $fileContent = 'Test attachment content';
+ $message->attachContent($fileContent, ['fileName' => $fileName]);
+
+ $this->assertTrue($message->send());
+
+ $attachment = $this->getAttachment($message);
+ $this->assertTrue(is_object($attachment), 'No attachment found!');
+ $this->assertEquals($fileName, $attachment->getFilename(), 'Invalid file name!');
+ }
+
+ /**
+ * @depends testSend
+ */
+ public function testEmbedFile()
+ {
+ $fileName = $this->createImageFile('embed_file.jpg', 'Embed Image File');
+
+ $message = $this->createTestMessage();
+
+ $cid = $message->embed($fileName);
+
+ $message->setTo($this->testEmailReceiver);
+ $message->setFrom('someuser@somedomain.com');
+ $message->setSubject('Yii Swift Embed File Test');
+ $message->setHtmlBody('Embed image: ');
+
+ $this->assertTrue($message->send());
+
+ $attachment = $this->getAttachment($message);
+ $this->assertTrue(is_object($attachment), 'No attachment found!');
+ $this->assertContains($attachment->getFilename(), $fileName, 'Invalid file name!');
+ }
+
+ /**
+ * @depends testSend
+ */
+ public function testEmbedContent()
+ {
+ $fileFullName = $this->createImageFile('embed_file.jpg', 'Embed Image File');
+ $message = $this->createTestMessage();
+
+ $fileName = basename($fileFullName);
+ $contentType = 'image/jpeg';
+ $fileContent = file_get_contents($fileFullName);
+
+ $cid = $message->embedContent($fileContent, ['fileName' => $fileName, 'contentType' => $contentType]);
+
+ $message->setTo($this->testEmailReceiver);
+ $message->setFrom('someuser@somedomain.com');
+ $message->setSubject('Yii Swift Embed File Test');
+ $message->setHtmlBody('Embed image: ');
+
+ $this->assertTrue($message->send());
+
+ $attachment = $this->getAttachment($message);
+ $this->assertTrue(is_object($attachment), 'No attachment found!');
+ $this->assertEquals($fileName, $attachment->getFilename(), 'Invalid file name!');
+ $this->assertEquals($contentType, $attachment->getContentType(), 'Invalid content type!');
+ }
+
+ /**
+ * @depends testSend
+ */
+ public function testSendAlternativeBody()
+ {
+ $message = $this->createTestMessage();
+
+ $message->setTo($this->testEmailReceiver);
+ $message->setFrom('someuser@somedomain.com');
+ $message->setSubject('Yii Swift Alternative Body Test');
+ $message->setHtmlBody('Yii Swift test HTML body');
+ $message->setTextBody('Yii Swift test plain text body');
+
+ $this->assertTrue($message->send());
+
+ $messageParts = $message->getSwiftMessage()->getChildren();
+ $textPresent = false;
+ $htmlPresent = false;
+ foreach ($messageParts as $part) {
+ if (!($part instanceof \Swift_Mime_Attachment)) {
+ /* @var \Swift_Mime_MimePart $part */
+ if ($part->getContentType() == 'text/plain') {
+ $textPresent = true;
+ }
+ if ($part->getContentType() == 'text/html') {
+ $htmlPresent = true;
+ }
+ }
+ }
+ $this->assertTrue($textPresent, 'No text!');
+ $this->assertTrue($htmlPresent, 'No HTML!');
+ }
+
+ /**
+ * @depends testGetSwiftMessage
+ */
+ public function testSerialize()
+ {
+ $message = $this->createTestMessage();
+
+ $message->setTo($this->testEmailReceiver);
+ $message->setFrom('someuser@somedomain.com');
+ $message->setSubject('Yii Swift Alternative Body Test');
+ $message->setTextBody('Yii Swift test plain text body');
+
+ $serializedMessage = serialize($message);
+ $this->assertNotEmpty($serializedMessage, 'Unable to serialize message!');
+
+ $unserializedMessaage = unserialize($serializedMessage);
+ $this->assertEquals($message, $unserializedMessaage, 'Unable to unserialize message!');
+ }
+}
diff --git a/tests/unit/framework/base/ComponentTest.php b/tests/unit/framework/base/ComponentTest.php
index d1698eb..2cad56d 100644
--- a/tests/unit/framework/base/ComponentTest.php
+++ b/tests/unit/framework/base/ComponentTest.php
@@ -302,7 +302,6 @@ class ComponentTest extends TestCase
$component->detachBehaviors();
$this->assertNull($component->getBehavior('a'));
$this->assertNull($component->getBehavior('b'));
-
}
}
diff --git a/tests/unit/framework/base/EventTest.php b/tests/unit/framework/base/EventTest.php
new file mode 100644
index 0000000..6226793
--- /dev/null
+++ b/tests/unit/framework/base/EventTest.php
@@ -0,0 +1,93 @@
+
+ * @since 2.0
+ */
+class EventTest extends TestCase
+{
+ public $counter;
+
+ public function setUp()
+ {
+ $this->counter = 0;
+ Event::off(ActiveRecord::className(), 'save');
+ Event::off(Post::className(), 'save');
+ Event::off(User::className(), 'save');
+ }
+
+ public function testOn()
+ {
+ Event::on(Post::className(), 'save', function ($event) {
+ $this->counter += 1;
+ });
+ Event::on(ActiveRecord::className(), 'save', function ($event) {
+ $this->counter += 3;
+ });
+ $this->assertEquals(0, $this->counter);
+ $post = new Post;
+ $post->save();
+ $this->assertEquals(4, $this->counter);
+ $user = new User;
+ $user->save();
+ $this->assertEquals(7, $this->counter);
+ }
+
+ public function testOff()
+ {
+ $handler = function ($event) {
+ $this->counter ++;
+ };
+ $this->assertFalse(Event::hasHandlers(Post::className(), 'save'));
+ Event::on(Post::className(), 'save', $handler);
+ $this->assertTrue(Event::hasHandlers(Post::className(), 'save'));
+ Event::off(Post::className(), 'save', $handler);
+ $this->assertFalse(Event::hasHandlers(Post::className(), 'save'));
+ }
+
+ public function testHasHandlers()
+ {
+ $this->assertFalse(Event::hasHandlers(Post::className(), 'save'));
+ $this->assertFalse(Event::hasHandlers(ActiveRecord::className(), 'save'));
+ Event::on(Post::className(), 'save', function ($event) {
+ $this->counter += 1;
+ });
+ $this->assertTrue(Event::hasHandlers(Post::className(), 'save'));
+ $this->assertFalse(Event::hasHandlers(ActiveRecord::className(), 'save'));
+
+ $this->assertFalse(Event::hasHandlers(User::className(), 'save'));
+ Event::on(ActiveRecord::className(), 'save', function ($event) {
+ $this->counter += 1;
+ });
+ $this->assertTrue(Event::hasHandlers(User::className(), 'save'));
+ $this->assertTrue(Event::hasHandlers(ActiveRecord::className(), 'save'));
+ }
+}
+
+class ActiveRecord extends Component
+{
+ public function save()
+ {
+ $this->trigger('save');
+ }
+}
+
+class Post extends ActiveRecord
+{
+}
+
+class User extends ActiveRecord
+{
+
+}
diff --git a/tests/unit/framework/caching/MemCacheTest.php b/tests/unit/framework/caching/MemCacheTest.php
index 32374b5..e489a39 100644
--- a/tests/unit/framework/caching/MemCacheTest.php
+++ b/tests/unit/framework/caching/MemCacheTest.php
@@ -26,4 +26,12 @@ class MemCacheTest extends CacheTestCase
}
return $this->_cacheInstance;
}
+
+ public function testExpire()
+ {
+ if (getenv('TRAVIS') == 'true') {
+ $this->markTestSkipped('Can not reliably test memcache expiry on travis-ci.');
+ }
+ parent::testExpire();
+ }
}
diff --git a/tests/unit/framework/caching/MemCachedTest.php b/tests/unit/framework/caching/MemCachedTest.php
index 807cef1..57ee110 100644
--- a/tests/unit/framework/caching/MemCachedTest.php
+++ b/tests/unit/framework/caching/MemCachedTest.php
@@ -26,4 +26,12 @@ class MemCachedTest extends CacheTestCase
}
return $this->_cacheInstance;
}
+
+ public function testExpire()
+ {
+ if (getenv('TRAVIS') == 'true') {
+ $this->markTestSkipped('Can not reliably test memcached expiry on travis-ci.');
+ }
+ parent::testExpire();
+ }
}
diff --git a/tests/unit/framework/db/ActiveRecordTest.php b/tests/unit/framework/db/ActiveRecordTest.php
index d8d8f8f..d0d2f12 100644
--- a/tests/unit/framework/db/ActiveRecordTest.php
+++ b/tests/unit/framework/db/ActiveRecordTest.php
@@ -4,6 +4,7 @@ namespace yiiunit\framework\db;
use yii\db\ActiveQuery;
use yiiunit\data\ar\ActiveRecord;
use yiiunit\data\ar\Customer;
+use yiiunit\data\ar\NullValues;
use yiiunit\data\ar\OrderItem;
use yiiunit\data\ar\Order;
use yiiunit\data\ar\Item;
@@ -116,7 +117,7 @@ class ActiveRecordTest extends DatabaseTestCase
public function testFindLazy()
{
- /** @var $customer Customer */
+ /** @var Customer $customer */
$customer = Customer::find(2);
$orders = $customer->orders;
$this->assertEquals(2, count($orders));
@@ -136,7 +137,7 @@ class ActiveRecordTest extends DatabaseTestCase
public function testFindLazyVia()
{
- /** @var $order Order */
+ /** @var Order $order */
$order = Order::find(1);
$this->assertEquals(1, $order->id);
$this->assertEquals(2, count($order->items));
@@ -161,7 +162,7 @@ class ActiveRecordTest extends DatabaseTestCase
public function testFindLazyViaTable()
{
- /** @var $order Order */
+ /** @var Order $order */
$order = Order::find(1);
$this->assertEquals(1, $order->id);
$this->assertEquals(2, count($order->books));
@@ -375,4 +376,101 @@ class ActiveRecordTest extends DatabaseTestCase
$customers = Customer::find()->all();
$this->assertEquals(0, count($customers));
}
+
+ public function testStoreNull()
+ {
+ $record = new NullValues();
+ $this->assertNull($record->var1);
+ $this->assertNull($record->var2);
+ $this->assertNull($record->var3);
+ $this->assertNull($record->stringcol);
+
+ $record->id = 1;
+
+ $record->var1 = 123;
+ $record->var2 = 456;
+ $record->var3 = 789;
+ $record->stringcol = 'hello!';
+
+ $record->save(false);
+ $this->assertTrue($record->refresh());
+
+ $this->assertEquals(123, $record->var1);
+ $this->assertEquals(456, $record->var2);
+ $this->assertEquals(789, $record->var3);
+ $this->assertEquals('hello!', $record->stringcol);
+
+ $record->var1 = null;
+ $record->var2 = null;
+ $record->var3 = null;
+ $record->stringcol = null;
+
+ $record->save(false);
+ $this->assertTrue($record->refresh());
+
+ $this->assertNull($record->var1);
+ $this->assertNull($record->var2);
+ $this->assertNull($record->var3);
+ $this->assertNull($record->stringcol);
+
+ $record->var1 = 0;
+ $record->var2 = 0;
+ $record->var3 = 0;
+ $record->stringcol = '';
+
+ $record->save(false);
+ $this->assertTrue($record->refresh());
+
+ $this->assertEquals(0, $record->var1);
+ $this->assertEquals(0, $record->var2);
+ $this->assertEquals(0, $record->var3);
+ $this->assertEquals('', $record->stringcol);
+ }
+
+ public function testStoreEmpty()
+ {
+ $record = new NullValues();
+ $record->id = 1;
+
+ // this is to simulate empty html form submission
+ $record->var1 = '';
+ $record->var2 = '';
+ $record->var3 = '';
+ $record->stringcol = '';
+
+ $record->save(false);
+ $this->assertTrue($record->refresh());
+
+ // https://github.com/yiisoft/yii2/commit/34945b0b69011bc7cab684c7f7095d837892a0d4#commitcomment-4458225
+ $this->assertTrue($record->var1 === $record->var2);
+ $this->assertTrue($record->var2 === $record->var3);
+ }
+
+ /**
+ * Some PDO implementations(e.g. cubrid) do not support boolean values.
+ * Make sure this does not affect AR layer.
+ */
+ public function testBooleanAttribute()
+ {
+ $customer = new Customer();
+ $customer->name = 'boolean customer';
+ $customer->email = 'mail@example.com';
+ $customer->status = true;
+ $customer->save(false);
+
+ $customer->refresh();
+ $this->assertEquals(1, $customer->status);
+
+ $customer->status = false;
+ $customer->save(false);
+
+ $customer->refresh();
+ $this->assertEquals(0, $customer->status);
+
+ $customers = Customer::find()->where(['status' => true])->all();
+ $this->assertEquals(2, count($customers));
+
+ $customers = Customer::find()->where(['status' => false])->all();
+ $this->assertEquals(1, count($customers));
+ }
}
diff --git a/tests/unit/framework/db/cubrid/CubridActiveRecordTest.php b/tests/unit/framework/db/cubrid/CubridActiveRecordTest.php
index 9fb9915..3949ba2 100644
--- a/tests/unit/framework/db/cubrid/CubridActiveRecordTest.php
+++ b/tests/unit/framework/db/cubrid/CubridActiveRecordTest.php
@@ -11,32 +11,4 @@ use yiiunit\framework\db\ActiveRecordTest;
class CubridActiveRecordTest extends ActiveRecordTest
{
public $driverName = 'cubrid';
-
- /**
- * cubrid PDO does not support boolean values.
- * Make sure this does not affect AR layer.
- */
- public function testBooleanAttribute()
- {
- $customer = new Customer();
- $customer->name = 'boolean customer';
- $customer->email = 'mail@example.com';
- $customer->status = true;
- $customer->save(false);
-
- $customer->refresh();
- $this->assertEquals(1, $customer->status);
-
- $customer->status = false;
- $customer->save(false);
-
- $customer->refresh();
- $this->assertEquals(0, $customer->status);
-
- $customers = Customer::find()->where(['status' => true])->all();
- $this->assertEquals(2, count($customers));
-
- $customers = Customer::find()->where(['status' => false])->all();
- $this->assertEquals(1, count($customers));
- }
}
diff --git a/tests/unit/framework/db/sqlite/SqliteActiveRecordTest.php b/tests/unit/framework/db/sqlite/SqliteActiveRecordTest.php
index a689e5d..88e950a 100644
--- a/tests/unit/framework/db/sqlite/SqliteActiveRecordTest.php
+++ b/tests/unit/framework/db/sqlite/SqliteActiveRecordTest.php
@@ -1,6 +1,7 @@
markTestSkipped("intl not installed. Skipping.");
- }
- }
-
public function patterns()
{
return [
@@ -76,7 +69,9 @@ _MSG_
'num_guests' => 4,
'host' => 'ralph',
'guest' => 'beep'
- ]
+ ],
+ defined('INTL_ICU_VERSION') && version_compare(INTL_ICU_VERSION, '4.8', '<'),
+ 'select format is available in ICU > 4.4 and plural format with =X selector is avilable since 4.8'
],
[
@@ -86,6 +81,8 @@ _MSG_
'name' => 'Alexander',
'gender' => 'male',
],
+ defined('INTL_ICU_VERSION') && version_compare(INTL_ICU_VERSION, '4.4.2', '<'),
+ 'select format is available in ICU > 4.4'
],
// verify pattern in select does not get replaced
@@ -99,7 +96,9 @@ _MSG_
'he' => 'wtf',
'she' => 'wtf',
'it' => 'wtf',
- ]
+ ],
+ defined('INTL_ICU_VERSION') && version_compare(INTL_ICU_VERSION, '4.4.2', '<'),
+ 'select format is available in ICU > 4.4'
],
// verify pattern in select message gets replaced
@@ -112,6 +111,8 @@ _MSG_
'he' => 'wtf',
'she' => 'wtf',
],
+ defined('INTL_ICU_VERSION') && version_compare(INTL_ICU_VERSION, '4.8', '<'),
+ 'parameters in select format do not seem to work in ICU < 4.8'
],
// some parser specific verifications
@@ -124,6 +125,92 @@ _MSG_
'he' => 'wtf',
'she' => 'wtf',
],
+ defined('INTL_ICU_VERSION') && version_compare(INTL_ICU_VERSION, '4.4.2', '<'),
+ 'select format is available in ICU > 4.4'
+ ],
+
+ // test ICU version compatibility
+ [
+ 'Showing {begin, number}-{end, number} of {totalCount, number} {totalCount, plural, one{item} other{items}}.',
+ 'Showing {begin, number}-{end, number} of {totalCount, number} {totalCount, plural, one{item} other{items}}.',
+ [],
+ ],
+ [
+ 'Showing {begin, number}-{end, number} of {totalCount, number} {totalCount, plural, one{item} other{items}}.',
+ 'Showing 1-10 of 12 items.',
+ [// A
+ 'begin' => 1,
+ 'end' => 10,
+ 'count' => 10,
+ 'totalCount' => 12,
+ 'page' => 1,
+ 'pageCount' => 2,
+ ]
+ ],
+ [
+ 'Showing {begin, number}-{end, number} of {totalCount, number} {totalCount, plural, one{item} other{items}}.',
+ 'Showing 1-1 of 1 item.',
+ [// B
+ 'begin' => 1,
+ 'end' => 1,
+ 'count' => 1,
+ 'totalCount' => 1,
+ 'page' => 1,
+ 'pageCount' => 1,
+ ]
+ ],
+ [
+ 'Showing {begin, number}-{end, number} of {totalCount, number} {totalCount, plural, one{item} other{items}}.',
+ 'Showing 0-0 of 0 items.',
+ [// C
+ 'begin' => 0,
+ 'end' => 0,
+ 'count' => 0,
+ 'totalCount' => 0,
+ 'page' => 1,
+ 'pageCount' => 1,
+ ]
+ ],
+ [
+ 'Total {count, number} {count, plural, one{item} other{items}}.',
+ 'Total {count, number} {count, plural, one{item} other{items}}.',
+ []
+ ],
+ [
+ 'Total {count, number} {count, plural, one{item} other{items}}.',
+ 'Total 1 item.',
+ [
+ 'count' => 1,
+ ]
+ ],
+ [
+ 'Total {count, number} {count, plural, one{item} other{items}}.',
+ 'Total 1 item.',
+ [
+ 'begin' => 5,
+ 'count' => 1,
+ 'end' => 10,
+ ]
+ ],
+ [
+ '{0, plural, one {offer} other {offers}}',
+ '{0, plural, one {offer} other {offers}}',
+ [],
+ ],
+ [
+ '{0, plural, one {offer} other {offers}}',
+ 'offers',
+ [0],
+ ],
+ [
+ '{0, plural, one {offer} other {offers}}',
+ 'offer',
+ [1],
+ ],
+ [
+ '{0, plural, one {offer} other {offers}}',
+ 'offers',
+ [13],
],
];
}
@@ -204,8 +291,11 @@ _MSG_
/**
* @dataProvider patterns
*/
- public function testNamedArguments($pattern, $expected, $args)
+ public function testNamedArguments($pattern, $expected, $args, $skip = false, $skipMessage = '')
{
+ if ($skip) {
+ $this->markTestSkipped($skipMessage);
+ }
$formatter = new MessageFormatter();
$result = $formatter->format($pattern, $args, 'en_US');
$this->assertEquals($expected, $result, $formatter->getErrorMessage());
@@ -216,6 +306,10 @@ _MSG_
*/
public function testParseNamedArguments($pattern, $expected, $args, $locale = 'en_US')
{
+ if (!extension_loaded("intl")) {
+ $this->markTestSkipped("intl not installed. Skipping.");
+ }
+
$formatter = new MessageFormatter();
$result = $formatter->parse($pattern, $expected, $locale);
$this->assertEquals($args, $result, $formatter->getErrorMessage() . ' Pattern: ' . $pattern);
diff --git a/tests/unit/framework/log/LoggerTest.php b/tests/unit/framework/log/LoggerTest.php
new file mode 100644
index 0000000..31a4c3b
--- /dev/null
+++ b/tests/unit/framework/log/LoggerTest.php
@@ -0,0 +1,33 @@
+
+ */
+
+namespace yiiunit\framework\log;
+
+
+use yii\debug\LogTarget;
+use yii\log\FileTarget;
+use yii\log\Logger;
+use yiiunit\TestCase;
+
+class LoggerTest extends TestCase
+{
+
+ public function testLog()
+ {
+ $logger = new Logger();
+
+ $logger->log('test1', Logger::LEVEL_INFO);
+ $this->assertEquals(1, count($logger->messages));
+ $this->assertEquals('test1', $logger->messages[0][0]);
+ $this->assertEquals(Logger::LEVEL_INFO, $logger->messages[0][1]);
+ $this->assertEquals('application', $logger->messages[0][2]);
+
+ $logger->log('test2', Logger::LEVEL_ERROR, 'category');
+ $this->assertEquals(2, count($logger->messages));
+ $this->assertEquals('test2', $logger->messages[1][0]);
+ $this->assertEquals(Logger::LEVEL_ERROR, $logger->messages[1][1]);
+ $this->assertEquals('category', $logger->messages[1][2]);
+ }
+}
\ No newline at end of file
diff --git a/tests/unit/framework/log/TargetTest.php b/tests/unit/framework/log/TargetTest.php
new file mode 100644
index 0000000..b4ceb4c
--- /dev/null
+++ b/tests/unit/framework/log/TargetTest.php
@@ -0,0 +1,90 @@
+
+ */
+
+namespace yiiunit\framework\log;
+
+
+use yii\debug\LogTarget;
+use yii\log\FileTarget;
+use yii\log\Logger;
+use yii\log\Target;
+use yiiunit\TestCase;
+
+class TargetTest extends TestCase
+{
+ public static $messages;
+
+ public function filters()
+ {
+ return [
+ [[], ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']],
+
+ [['levels' => 0], ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']],
+ [
+ ['levels' => Logger::LEVEL_INFO | Logger::LEVEL_WARNING | Logger::LEVEL_ERROR | Logger::LEVEL_TRACE],
+ ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
+ ],
+ [['levels' => ['error']], ['B', 'G', 'H']],
+ [['levels' => Logger::LEVEL_ERROR], ['B', 'G', 'H']],
+ [['levels' => ['error', 'warning']], ['B', 'C', 'G', 'H']],
+ [['levels' => Logger::LEVEL_ERROR | Logger::LEVEL_WARNING], ['B', 'C', 'G', 'H']],
+
+ [['categories' => ['application']], ['A', 'B', 'C', 'D', 'E']],
+ [['categories' => ['application*']], ['A', 'B', 'C', 'D', 'E', 'F']],
+ [['categories' => ['application.*']], ['F']],
+ [['categories' => ['application.components']], []],
+ [['categories' => ['application.components.Test']], ['F']],
+ [['categories' => ['application.components.*']], ['F']],
+ [['categories' => ['application.*', 'yii.db.*']], ['F', 'G', 'H']],
+ [['categories' => ['application.*', 'yii.db.*'], 'except' => ['yii.db.Command.*']], ['F', 'G']],
+
+ [['categories' => ['application', 'yii.db.*'], 'levels' => Logger::LEVEL_ERROR], ['B', 'G', 'H']],
+ [['categories' => ['application'], 'levels' => Logger::LEVEL_ERROR], ['B']],
+ [['categories' => ['application'], 'levels' => Logger::LEVEL_ERROR | Logger::LEVEL_WARNING], ['B', 'C']],
+ ];
+ }
+
+ /**
+ * @dataProvider filters
+ */
+ public function testFilter($filter, $expected)
+ {
+ static::$messages = [];
+
+ $logger = new Logger([
+ 'targets' => [new TestTarget(array_merge($filter, ['logVars' => []]))],
+ 'flushInterval' => 1,
+ ]);
+ $logger->log('testA', Logger::LEVEL_INFO);
+ $logger->log('testB', Logger::LEVEL_ERROR);
+ $logger->log('testC', Logger::LEVEL_WARNING);
+ $logger->log('testD', Logger::LEVEL_TRACE);
+ $logger->log('testE', Logger::LEVEL_INFO, 'application');
+ $logger->log('testF', Logger::LEVEL_INFO, 'application.components.Test');
+ $logger->log('testG', Logger::LEVEL_ERROR, 'yii.db.Command');
+ $logger->log('testH', Logger::LEVEL_ERROR, 'yii.db.Command.whatever');
+
+ $this->assertEquals(count($expected), count(static::$messages));
+ $i = 0;
+ foreach($expected as $e) {
+ $this->assertEquals('test' . $e, static::$messages[$i++][0]);
+ }
+ }
+}
+
+class TestTarget extends Target
+{
+ public $exportInterval = 1;
+
+ /**
+ * Exports log [[messages]] to a specific destination.
+ * Child classes must implement this method.
+ */
+ public function export()
+ {
+ TargetTest::$messages = array_merge(TargetTest::$messages, $this->messages);
+ $this->messages = [];
+ }
+}
\ No newline at end of file
diff --git a/tests/unit/framework/mail/BaseMailerTest.php b/tests/unit/framework/mail/BaseMailerTest.php
new file mode 100644
index 0000000..1c3ee22
--- /dev/null
+++ b/tests/unit/framework/mail/BaseMailerTest.php
@@ -0,0 +1,367 @@
+mockApplication([
+ 'components' => [
+ 'mail' => $this->createTestMailComponent(),
+ ]
+ ]);
+ $filePath = $this->getTestFilePath();
+ if (!file_exists($filePath)) {
+ FileHelper::createDirectory($filePath);
+ }
+ }
+
+ public function tearDown()
+ {
+ $filePath = $this->getTestFilePath();
+ if (file_exists($filePath)) {
+ FileHelper::removeDirectory($filePath);
+ }
+ }
+
+ /**
+ * @return string test file path.
+ */
+ protected function getTestFilePath()
+ {
+ return Yii::getAlias('@yiiunit/runtime') . DIRECTORY_SEPARATOR . basename(get_class($this)) . '_' . getmypid();
+ }
+
+ /**
+ * @return Mailer test email component instance.
+ */
+ protected function createTestMailComponent()
+ {
+ $component = new Mailer();
+ $component->viewPath = $this->getTestFilePath();
+ return $component;
+ }
+
+ /**
+ * @return Mailer mailer instance
+ */
+ protected function getTestMailComponent()
+ {
+ return Yii::$app->getComponent('mail');
+ }
+
+ // Tests :
+
+ public function testSetupView()
+ {
+ $mailer = new Mailer();
+
+ $view = new View();
+ $mailer->setView($view);
+ $this->assertEquals($view, $mailer->getView(), 'Unable to setup view!');
+
+ $viewConfig = [
+ 'params' => [
+ 'param1' => 'value1',
+ 'param2' => 'value2',
+ ]
+ ];
+ $mailer->setView($viewConfig);
+ $view = $mailer->getView();
+ $this->assertTrue(is_object($view), 'Unable to setup view via config!');
+ $this->assertEquals($viewConfig['params'], $view->params, 'Unable to configure view via config array!');
+ }
+
+ /**
+ * @depends testSetupView
+ */
+ public function testGetDefaultView()
+ {
+ $mailer = new Mailer();
+ $view = $mailer->getView();
+ $this->assertTrue(is_object($view), 'Unable to get default view!');
+ }
+
+ public function testCreateMessage()
+ {
+ $mailer = new Mailer();
+ $message = $mailer->compose();
+ $this->assertTrue(is_object($message), 'Unable to create message instance!');
+ $this->assertEquals($mailer->messageClass, get_class($message), 'Invalid message class!');
+ }
+
+ /**
+ * @depends testCreateMessage
+ */
+ public function testDefaultMessageConfig()
+ {
+ $mailer = new Mailer();
+
+ $notPropertyConfig = [
+ 'charset' => 'utf-16',
+ 'from' => 'from@domain.com',
+ 'to' => 'to@domain.com',
+ 'cc' => 'cc@domain.com',
+ 'bcc' => 'bcc@domain.com',
+ 'subject' => 'Test subject',
+ 'textBody' => 'Test text body',
+ 'htmlBody' => 'Test HTML body',
+ ];
+ $propertyConfig = [
+ 'id' => 'test-id',
+ 'encoding' => 'test-encoding',
+ ];
+ $messageConfig = array_merge($notPropertyConfig, $propertyConfig);
+ $mailer->messageConfig = $messageConfig;
+
+ $message = $mailer->compose();
+
+ foreach ($notPropertyConfig as $name => $value) {
+ $this->assertEquals($value, $message->{'_' . $name});
+ }
+ foreach ($propertyConfig as $name => $value) {
+ $this->assertEquals($value, $message->$name);
+ }
+ }
+
+ /**
+ * @depends testGetDefaultView
+ */
+ public function testRender()
+ {
+ $mailer = $this->getTestMailComponent();
+
+ $viewName = 'test_view';
+ $viewFileName = $this->getTestFilePath() . DIRECTORY_SEPARATOR . $viewName . '.php';
+ $viewFileContent = '';
+ file_put_contents($viewFileName, $viewFileContent);
+
+ $params = [
+ 'testParam' => 'test output'
+ ];
+ $renderResult = $mailer->render($viewName, $params);
+ $this->assertEquals($params['testParam'], $renderResult);
+ }
+
+ /**
+ * @depends testRender
+ */
+ public function testRenderLayout()
+ {
+ $mailer = $this->getTestMailComponent();
+
+ $filePath = $this->getTestFilePath();
+
+ $viewName = 'test_view';
+ $viewFileName = $filePath . DIRECTORY_SEPARATOR . $viewName . '.php';
+ $viewFileContent = 'view file content';
+ file_put_contents($viewFileName, $viewFileContent);
+
+ $layoutName = 'test_layout';
+ $layoutFileName = $filePath . DIRECTORY_SEPARATOR . $layoutName . '.php';
+ $layoutFileContent = 'Begin Layout End Layout';
+ file_put_contents($layoutFileName, $layoutFileContent);
+
+ $renderResult = $mailer->render($viewName, [], $layoutName);
+ $this->assertEquals('Begin Layout ' . $viewFileContent . ' End Layout', $renderResult);
+ }
+
+ /**
+ * @depends testCreateMessage
+ * @depends testRender
+ */
+ public function testCompose()
+ {
+ $mailer = $this->getTestMailComponent();
+ $mailer->htmlLayout = false;
+ $mailer->textLayout = false;
+
+ $htmlViewName = 'test_html_view';
+ $htmlViewFileName = $this->getTestFilePath() . DIRECTORY_SEPARATOR . $htmlViewName . '.php';
+ $htmlViewFileContent = 'HTML view file content';
+ file_put_contents($htmlViewFileName, $htmlViewFileContent);
+
+ $textViewName = 'test_text_view';
+ $textViewFileName = $this->getTestFilePath() . DIRECTORY_SEPARATOR . $textViewName . '.php';
+ $textViewFileContent = 'Plain text view file content';
+ file_put_contents($textViewFileName, $textViewFileContent);
+
+ $message = $mailer->compose([
+ 'html' => $htmlViewName,
+ 'text' => $textViewName,
+ ]);
+ $this->assertEquals($htmlViewFileContent, $message->_htmlBody, 'Unable to render html!');
+ $this->assertEquals($textViewFileContent, $message->_textBody, 'Unable to render text!');
+
+ $message = $mailer->compose($htmlViewName);
+ $this->assertEquals($htmlViewFileContent, $message->_htmlBody, 'Unable to render html by direct view!');
+ $this->assertEquals(strip_tags($htmlViewFileContent), $message->_textBody, 'Unable to render text by direct view!');
+ }
+
+ public function testUseFileTransport()
+ {
+ $mailer = new Mailer();
+ $this->assertFalse($mailer->useFileTransport);
+ $this->assertEquals('@runtime/mail', $mailer->fileTransportPath);
+
+ $mailer->fileTransportPath = '@yiiunit/runtime/mail';
+ $mailer->useFileTransport = true;
+ $mailer->fileTransportCallback = function () {
+ return 'message.txt';
+ };
+ $message = $mailer->compose()
+ ->setTo('to@example.com')
+ ->setFrom('from@example.com')
+ ->setSubject('test subject')
+ ->setTextBody('text body' . microtime(true));
+ $this->assertTrue($mailer->send($message));
+ $file = Yii::getAlias($mailer->fileTransportPath) . '/message.txt';
+ $this->assertTrue(is_file($file));
+ $this->assertEquals($message->toString(), file_get_contents($file));
+ }
+}
+
+/**
+ * Test Mailer class
+ */
+class Mailer extends BaseMailer
+{
+ public $messageClass = 'yiiunit\framework\mail\Message';
+ public $sentMessages = [];
+
+ protected function sendMessage($message)
+ {
+ $this->sentMessages[] = $message;
+ }
+}
+
+/**
+ * Test Message class
+ */
+class Message extends BaseMessage
+{
+ public $id;
+ public $encoding;
+ public $_charset;
+ public $_from;
+ public $_replyTo;
+ public $_to;
+ public $_cc;
+ public $_bcc;
+ public $_subject;
+ public $_textBody;
+ public $_htmlBody;
+
+ public function getCharset()
+ {
+ return $this->_charset;
+ }
+
+ public function setCharset($charset)
+ {
+ $this->_charset = $charset;
+ return $this;
+ }
+
+ public function getFrom()
+ {
+ return $this->_from;
+ }
+
+ public function setFrom($from)
+ {
+ $this->_from = $from;
+ return $this;
+ }
+
+ public function getTo()
+ {
+ return $this->_to;
+ }
+
+ public function setTo($to)
+ {
+ $this->_to = $to;
+ return $this;
+ }
+
+ public function getCc()
+ {
+ return $this->_cc;
+ }
+
+ public function setCc($cc)
+ {
+ $this->_cc = $cc;
+ return $this;
+ }
+
+ public function getBcc()
+ {
+ return $this->_bcc;
+ }
+
+ public function setBcc($bcc)
+ {
+ $this->_bcc = $bcc;
+ return $this;
+ }
+
+ public function getSubject()
+ {
+ return $this->_subject;
+ }
+
+ public function setSubject($subject)
+ {
+ $this->_subject = $subject;
+ return $this;
+ }
+
+ public function getReplyTo()
+ {
+ return $this->_replyTo;
+ }
+
+ public function setReplyTo($replyTo)
+ {
+ $this->_replyTo = $replyTo;
+ return $this;
+ }
+
+ public function setTextBody($text)
+ {
+ $this->_textBody = $text;
+ return $this;
+ }
+
+ public function setHtmlBody($html)
+ {
+ $this->_htmlBody = $html;
+ return $this;
+ }
+
+ public function attachContent($content, array $options = []) {}
+
+ public function attach($fileName, array $options = []) {}
+
+ public function embed($fileName, array $options = []) {}
+
+ public function embedContent($content, array $options = []) {}
+
+ public function toString()
+ {
+ return var_export($this, true);
+ }
+}
diff --git a/tests/unit/framework/mail/BaseMessageTest.php b/tests/unit/framework/mail/BaseMessageTest.php
new file mode 100644
index 0000000..d80d4f7
--- /dev/null
+++ b/tests/unit/framework/mail/BaseMessageTest.php
@@ -0,0 +1,136 @@
+mockApplication([
+ 'components' => [
+ 'mail' => $this->createTestEmailComponent()
+ ]
+ ]);
+ }
+
+ /**
+ * @return Mailer test email component instance.
+ */
+ protected function createTestEmailComponent()
+ {
+ $component = new TestMailer();
+ return $component;
+ }
+
+ /**
+ * @return TestMailer mailer instance.
+ */
+ protected function getMailer()
+ {
+ return Yii::$app->getComponent('mail');
+ }
+
+ // Tests :
+
+ public function testGetMailer()
+ {
+ $mailer = $this->getMailer();
+ $message = $mailer->compose();
+ $this->assertEquals($mailer, $message->getMailer());
+ }
+
+ public function testSend()
+ {
+ $mailer = $this->getMailer();
+ $message = $mailer->compose();
+ $message->send();
+ $this->assertEquals($message, $mailer->sentMessages[0], 'Unable to send message!');
+ }
+
+ public function testToString()
+ {
+ $mailer = $this->getMailer();
+ $message = $mailer->compose();
+ $this->assertEquals($message->toString(), '' . $message);
+ }
+}
+
+/**
+ * Test Mailer class
+ */
+class TestMailer extends BaseMailer
+{
+ public $messageClass = 'yiiunit\framework\mail\TestMessage';
+ public $sentMessages = array();
+
+ protected function sendMessage($message)
+ {
+ $this->sentMessages[] = $message;
+ }
+}
+
+/**
+ * Test Message class
+ */
+class TestMessage extends BaseMessage
+{
+ public $text;
+ public $html;
+
+ public function getCharset() {return '';}
+
+ public function setCharset($charset) {}
+
+ public function getFrom() {return '';}
+
+ public function setFrom($from) {}
+
+ public function getReplyTo() {return '';}
+
+ public function setReplyTo($replyTo) {}
+
+ public function getTo() {return '';}
+
+ public function setTo($to) {}
+
+ public function getCc() {return '';}
+
+ public function setCc($cc) {}
+
+ public function getBcc() {return '';}
+
+ public function setBcc($bcc) {}
+
+ public function getSubject() {return '';}
+
+ public function setSubject($subject) {}
+
+ public function setTextBody($text) {
+ $this->text = $text;
+ }
+
+ public function setHtmlBody($html) {
+ $this->html = $html;
+ }
+
+ public function attachContent($content, array $options = []) {}
+
+ public function attach($fileName, array $options = []) {}
+
+ public function embed($fileName, array $options = []) {}
+
+ public function embedContent($content, array $options = []) {}
+
+ public function toString()
+ {
+ return get_class($this);
+ }
+}
diff --git a/tests/unit/framework/validators/ValidatorTest.php b/tests/unit/framework/validators/ValidatorTest.php
index fc69c2f..b248a9b 100644
--- a/tests/unit/framework/validators/ValidatorTest.php
+++ b/tests/unit/framework/validators/ValidatorTest.php
@@ -30,7 +30,7 @@ class ValidatorTest extends TestCase
public function testCreateValidator()
{
$model = FakedValidationModel::createWithAttributes(['attr_test1' => 'abc', 'attr_test2' => '2013']);
- /** @var $numberVal NumberValidator */
+ /** @var NumberValidator $numberVal */
$numberVal = TestValidator::createValidator('number', $model, ['attr_test1']);
$this->assertInstanceOf(NumberValidator::className(), $numberVal);
$numberVal = TestValidator::createValidator('integer', $model, ['attr_test2']);
@@ -229,4 +229,4 @@ class ValidatorTest extends TestCase
$errors = $m->getErrors('attr_msg_val');
$this->assertEquals('attr_msg_val::abc::param_value', $errors[0]);
}
-}
\ No newline at end of file
+}
diff --git a/tests/unit/framework/web/AssetBundleTest.php b/tests/unit/framework/web/AssetBundleTest.php
index 9cc3894..24c36d6 100644
--- a/tests/unit/framework/web/AssetBundleTest.php
+++ b/tests/unit/framework/web/AssetBundleTest.php
@@ -8,7 +8,7 @@
namespace yiiunit\framework\web;
use Yii;
-use yii\base\View;
+use yii\web\View;
use yii\web\AssetBundle;
use yii\web\AssetManager;
diff --git a/tests/unit/framework/web/AssetConverterTest.php b/tests/unit/framework/web/AssetConverterTest.php
new file mode 100644
index 0000000..54669b3
--- /dev/null
+++ b/tests/unit/framework/web/AssetConverterTest.php
@@ -0,0 +1,42 @@
+
+ */
+
+namespace yiiunit\framework\web;
+use yii\web\AssetConverter;
+
+/**
+ * @group web
+ */
+class AssetConverterTest extends \yiiunit\TestCase
+{
+ protected function setUp()
+ {
+ parent::setUp();
+ $this->mockApplication();
+ }
+
+
+ public function testConvert()
+ {
+ $tmpPath = \Yii::$app->runtimePath . '/assetConverterTest';
+ if (!is_dir($tmpPath)) {
+ mkdir($tmpPath, 0777, true);
+ }
+ file_put_contents($tmpPath . '/test.php', <<commands['php'] = ['txt', 'php {from} > {to}'];
+ $this->assertEquals('test.txt', $converter->convert('test.php', $tmpPath));
+
+ $this->assertTrue(file_exists($tmpPath . '/test.txt'), 'Failed asserting that asset output file exists.');
+ $this->assertEquals("Hello World!\nHello Yii!", file_get_contents($tmpPath . '/test.txt'));
+ }
+}
\ No newline at end of file