7 lines
17 KiB
JavaScript
7 lines
17 KiB
JavaScript
|
|
Help.latestReleaseNote=function(){if(!Help._latestReleaseNote){Help._latestReleaseNote=Help.releaseNoteText.reduce((acc,note)=>note.version>acc.version?note:acc);}
|
||
|
|
return Help._latestReleaseNote;};Help._showReleaseNoteIfNeeded=function(){Help._innerShowReleaseNoteIfNeeded(Help._releaseNoteVersionSetting.get(),Help.latestReleaseNote().version,Common.settings.moduleSetting('help.show-release-note').get());};Help._innerShowReleaseNoteIfNeeded=function(lastSeenVersion,latestVersion,showReleaseNote){if(!lastSeenVersion){Help._releaseNoteVersionSetting.set(latestVersion);return;}
|
||
|
|
if(!showReleaseNote)
|
||
|
|
return;if(lastSeenVersion>=latestVersion)
|
||
|
|
return;Help._releaseNoteVersionSetting.set(latestVersion);UI.viewManager.showView(Help.releaseNoteViewId,true);};Help.releaseNoteViewId='release-note';Help.ReleaseNoteHighlight;Help.ReleaseNote;Help.HelpLateInitialization=class{run(){Help._showReleaseNoteIfNeeded();}};Help.ReleaseNotesActionDelegate=class{handleAction(context,actionId){InspectorFrontendHost.openInNewTab(Help.latestReleaseNote().link);return true;}};Help._releaseNoteVersionSetting=Common.settings.createSetting('releaseNoteVersionSeen',0);;Help.ReleaseNoteView=class extends UI.VBox{constructor(){super(true);this.registerRequiredCSS('help/releaseNote.css');const releaseNoteElement=this._createReleaseNoteElement(Help.latestReleaseNote());const topSection=this.contentElement.createChild('div','release-note-top-section');topSection.textContent=Common.UIString(Help.latestReleaseNote().header);this.contentElement.appendChild(releaseNoteElement);}
|
||
|
|
_createReleaseNoteElement(releaseNote){const hbox=createElementWithClass('div','hbox');const container=hbox.createChild('div','release-note-container');const contentContainer=container.createChild('ul');for(const highlight of releaseNote.highlights){const listItem=contentContainer.createChild('li');const title=UI.XLink.create(highlight.link,highlight.title+' ','release-note-title');title.title='';listItem.appendChild(title);const subtitle=UI.XLink.create(highlight.link,highlight.subtitle+' ','release-note-subtitle');subtitle.title='';listItem.appendChild(subtitle);}
|
||
|
|
const actionContainer=container.createChild('div','release-note-action-container');actionContainer.appendChild(UI.createTextButton(Common.UIString('Learn more'),event=>{event.consume(true);InspectorFrontendHost.openInNewTab(releaseNote.link);}));actionContainer.appendChild(UI.createTextButton(Common.UIString('Close'),event=>{event.consume(true);UI.inspectorView.closeDrawerTab(Help.releaseNoteViewId,true);},'close-release-note'));const imageLink=UI.XLink.create(releaseNote.link,' ');imageLink.classList.add('release-note-image');imageLink.title='';hbox.appendChild(imageLink);const image=imageLink.createChild('img');image.src='Images/whatsnew.png';return hbox;}};;const continueToHereShortcut=Host.isMac()?'Command':'Control';const networkSearchShortcut=Host.isMac()?'Command + F':'Control + F';const commandMenuShortcut=Host.isMac()?'Command + Shift + P':'Control + Shift + P';Help.releaseNoteText=[{version:11,header:'Highlights from the Chrome 68 update',highlights:[{title:'Eager evaluation',subtitle:'Preview return values in the Console without explicitly executing expressions.',link:'https://developers.google.com/web/updates/2018/05/devtools#eagerevaluation',},{title:'Argument hints',subtitle:`View a function's expected arguments in the Console.`,link:'https://developers.google.com/web/updates/2018/05/devtools#hints',},{title:'Function autocompletion',subtitle:'View available properties and methods after calling a function in the Console.',link:'https://developers.google.com/web/updates/2018/05/devtools#autocomplete',},{title:'Audits panel updates',subtitle:'Faster, more consisent audits, a new UI, and new audits, thanks to Lighthouse 3.0.',link:'https://developers.google.com/web/updates/2018/05/devtools#lh3',}],link:'https://developers.google.com/web/updates/2018/05/devtools',},{version:10,header:'Highlights from the Chrome 67 update',highlights:[{title:'Search across all network headers',subtitle:`Press ${networkSearchShortcut} in the Network panel to open the Network Search pane.`,link:'https://developers.google.com/web/updates/2018/04/devtools#network-search',},{title:'CSS variable value previews in the Styles pane',subtitle:'When a property value is a CSS variable, DevTools now shows a color preview next to the variable.',link:'https://developers.google.com/web/updates/2018/04/devtools#vars',},{title:'Stop infinite loops',subtitle:'Pause JavaScript execution then select the new Stop Current JavaScript Call button.',link:'https://developers.google.com/web/updates/2018/04/devtools#stop',},{title:'Copy as fetch',subtitle:'Right-click a network request then select Copy > Copy as fetch.',link:'https://developers.google.com/web/updates/2018/04/devtools#fetch',},{title:'More audits',subtitle:'Two new audits, desktop configuration options, and viewing traces.',link:'https://developers.google.com/web/updates/2018/04/devtools#audits',},{title:'User Timing in the Performance tabs',subtitle:'Click the User Timing section to view measures in the Summary, Bottom-Up, and Call Tree tabs.',link:'https://developers.google.com/web/updates/2018/04/devtools#tabs',},],link:'https://developers.google.com/web/updates/2018/04/devtools',},{version:9,header:'Highlights from the Chrome 66 update',highlights:[{title:'Pretty-printing in the Preview and Response tabs',subtitle:'The Preview tab now pretty-prints by default, and you can force '+'pretty-printing in the Response tab via the new Format button.',link:'https://developers.google.com/web/updates/2018/02/devtools#pretty-printing',},{title:'Previewing HTML content in the Preview tab',subtitle:'The Preview tab now always does a basic rendering of HTML content.',link:'https://developers.google.com/web/updates/2018/02/devtools#previews',},{title:'Local Overrides with styles defined in HTML',subtitle:'Local Overrides now works with styles defined in HTML, with one exception.',link:'https://developers.google.com/web/updates/2018/02/devtools#overrides',},{title:'Blackboxing in the Initiator column',subtitle:'Hide framework scripts in order to see the app code that caused a request.',link:'https://de
|