-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report: header, footer, leftnav, share, oh my #2000
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
45b289e
Report header
ebidel 9f8014d
Reponsive styling. Use share icon instead of "Export..."
ebidel fef3a99
Runtime settings
ebidel 8b4d2e7
Support report re-ender into page
ebidel 7d9e20c
Add report functionality
ebidel 6887af7
Split files
ebidel 2b84229
Remove css focus stuff
ebidel b138885
Remove placeholders
ebidel c9633af
Fix tests
ebidel ee7fcb1
Feedback
ebidel 3b7e90f
lighthouse -> lh
ebidel c717870
Tests for header/footer
ebidel 85d6b8e
Tests for header/footer/formatter helps
ebidel 2ff34f7
Add more tests
ebidel e9751c7
Fix rebase
ebidel 2918469
Fix travis tests
ebidel 2a60c3a
Feedback and leftnav
ebidel 121fda3
Add 2nd arg
ebidel a445a6e
Styling tweaks
ebidel 703043a
Leftnav tests
ebidel c237657
Disable open in viewer in ui
ebidel d7f3c29
Adjust passing audits summary
ebidel aa93acc
Merge branch 'master' into GoogleChrome-tablesclear
patrickhulce 3899e47
Merge after rebase
ebidel 33021e5
Fix up styling after merge
ebidel 31a7385
Update dom usage and reset state of template stamping when exporting …
ebidel d33cc21
Closure cleanup
ebidel 4bbba21
cleanup
ebidel a30c86e
Tests
ebidel d8ce09f
lh-analytics custom event
ebidel 777adfe
fix travis
ebidel a1ffbf5
Travis fix?
ebidel e542539
bckenny feedback
ebidel 8bf076f
3 big changes
ebidel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/** | ||
* @license | ||
* Copyright 2017 Google Inc. All Rights Reserved. | ||
* | ||
* 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. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
/** | ||
* Logs messages via a UI butter. | ||
*/ | ||
class Logger { | ||
/** | ||
* @param {!Element} element | ||
*/ | ||
constructor(element) { | ||
/** @type {!Element} */ | ||
this.el = element; | ||
/** @private {?number} */ | ||
this._id = null; | ||
} | ||
|
||
/** | ||
* Shows a butter bar. | ||
* @param {!string} msg The message to show. | ||
* @param {boolean=} autoHide True to hide the message after a duration. | ||
* Default is true. | ||
*/ | ||
log(msg, autoHide = true) { | ||
clearTimeout(this._id); | ||
|
||
this.el.textContent = msg; | ||
this.el.classList.add('show'); | ||
if (autoHide) { | ||
this._id = setTimeout(_ => { | ||
this.el.classList.remove('show'); | ||
}, 7000); | ||
} | ||
} | ||
|
||
/** | ||
* @param {string} msg | ||
*/ | ||
warn(msg) { | ||
this.log('Warning: ' + msg); | ||
} | ||
|
||
/** | ||
* @param {string} msg | ||
*/ | ||
error(msg) { | ||
this.log(msg); | ||
} | ||
|
||
/** | ||
* Explicitly hides the butter bar. | ||
*/ | ||
hide() { | ||
clearTimeout(this._id); | ||
this.el.classList.remove('show'); | ||
} | ||
} | ||
|
||
if (typeof module !== 'undefined' && module.exports) { | ||
module.exports = Logger; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does devtools want a logger? This PR might need to adjust to the model in #2002
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDK. I'm just porting :)
Knowing the separation of LH proper and integrations of LH is still unclear. Right now the operating assumption is that we're keeping everything we currently have b/c #1937 doesn't capture these types of details.
For me, the dream is that there will be all sorts of existing tools that adopt a LH report. It's impossible to foresee all those integration touch points. Rather than designing our system around a particular integration , it might be easier to flip it. IOW, the integration (e.g. devtools) decides what parts of LH it wants to throw away or replace. Removing handlebars, adding
templateContext
are a step towards that.For the features stuff, I've updated it to take the approach in b12f2ea. Devtools can decide not to load the feature (including logger).
Some open thoughts/questions for everyone. "Integration X" can be substituted for "devtools".
#lh-log { display: none}
. We're already doing that today.ReportUIFeature
(here), or stub files:class Logger { log() {} }
. We could even provide those files for people if it makes sense.