Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(751)

Unified Diff: third_party/WebKit/Source/devtools/front_end/help/ReleaseNote.js

Issue 2649023007: DevTools: implement release note behind an experiment (Closed)
Patch Set: make test platform independent Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/help/ReleaseNote.js
diff --git a/third_party/WebKit/Source/devtools/front_end/help/ReleaseNote.js b/third_party/WebKit/Source/devtools/front_end/help/ReleaseNote.js
new file mode 100644
index 0000000000000000000000000000000000000000..3af1db26c822cbc0a0514768c3083763af96c71d
--- /dev/null
+++ b/third_party/WebKit/Source/devtools/front_end/help/ReleaseNote.js
@@ -0,0 +1,49 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+Help.ReleaseNoteView = class extends UI.VBox {
+ constructor() {
+ super(true);
+ this.registerRequiredCSS('help/releaseNote.css');
+ var releaseNoteElement = this._createReleaseNoteElement(Help.latestReleaseNote());
+ this.contentElement.appendChild(releaseNoteElement);
+ }
+
+ /**
+ * @param {!Help.ReleaseNote} releaseNote
+ * @return {!Element}
+ */
+ _createReleaseNoteElement(releaseNote) {
+ var container = createElementWithClass('div', 'release-note-container');
+ var textContainer = container.createChild('div', 'release-note-text-container');
+ textContainer.createChild('div', 'release-note-header').textContent =
+ Common.UIString('New in DevTools %d', releaseNote.version);
+ var highlightContainer = textContainer.createChild('ul', 'release-note-highlight-container');
+ for (var highlight of releaseNote.highlights) {
+ var className = highlight.featured ? 'release-note-featured-link' : 'release-note-link';
+ var highlightLink = UI.createExternalLink(highlight.link, highlight.text, className);
+ highlightContainer.createChild('li').appendChild(highlightLink);
+ }
+
+ var viewMoreButton = UI.createTextButton(Common.UIString('And more...'), event => {
+ event.consume(true);
+ InspectorFrontendHost.openInNewTab(releaseNote.link);
+ });
+ textContainer.appendChild(viewMoreButton);
+
+ var closeButton = UI.createTextButton(Common.UIString('Dismiss'), event => {
+ event.consume(true);
+ UI.inspectorView.closeDrawerTab(Help._releaseNoteViewId, true);
+ }, 'close-release-note');
+ textContainer.appendChild(closeButton);
+
+ var imageLink = UI.createExternalLink(releaseNote.link, ' ', 'release-note-image-container');
+ container.appendChild(imageLink);
+ var image = imageLink.createChild('img', 'release-note-image');
+ image.src = releaseNote.image.src;
+ image.addEventListener('mouseover', e => container.classList.add('image-hover'));
+ image.addEventListener('mouseout', e => container.classList.remove('image-hover'));
+ return container;
+ }
+};

Powered by Google App Engine
This is Rietveld 408576698