HelpImpl.js 1.7 KB

1234567891011
  1. export const releaseNoteViewId='release-note';export function latestReleaseNote(){if(!Help._latestReleaseNote){Help._latestReleaseNote=Help.releaseNoteText.reduce((acc,note)=>note.version>acc.version?note:acc);}
  2. return Help._latestReleaseNote;}
  3. function _showReleaseNoteIfNeeded(){_innerShowReleaseNoteIfNeeded(Help._releaseNoteVersionSetting.get(),latestReleaseNote().version,Common.settings.moduleSetting('help.show-release-note').get());}
  4. function _innerShowReleaseNoteIfNeeded(lastSeenVersion,latestVersion,showReleaseNote){if(!lastSeenVersion){Help._releaseNoteVersionSetting.set(latestVersion);return;}
  5. if(!showReleaseNote){return;}
  6. if(lastSeenVersion>=latestVersion){return;}
  7. Help._releaseNoteVersionSetting.set(latestVersion);UI.viewManager.showView(releaseNoteViewId,true);}
  8. export class HelpLateInitialization{async run(){if(!Host.isUnderTest()){_showReleaseNoteIfNeeded();}}}
  9. export class ReleaseNotesActionDelegate{handleAction(context,actionId){Host.InspectorFrontendHost.openInNewTab(latestReleaseNote().link);return true;}}
  10. export class ReportIssueActionDelegate{handleAction(context,actionId){Host.InspectorFrontendHost.openInNewTab('https://bugs.chromium.org/p/chromium/issues/entry?template=DevTools+issue');return true;}}
  11. self.Help=self.Help||{};Help=Help||{};Help.releaseNoteViewId=releaseNoteViewId;Help.latestReleaseNote=latestReleaseNote;Help._innerShowReleaseNoteIfNeeded=_innerShowReleaseNoteIfNeeded;Help._showReleaseNoteIfNeeded=_showReleaseNoteIfNeeded;Help._releaseNoteVersionSetting=Common.settings.createSetting('releaseNoteVersionSeen',0);Help.ReleaseNoteHighlight;Help.ReleaseNote;Help.HelpLateInitialization=HelpLateInitialization;Help.ReleaseNotesActionDelegate=ReleaseNotesActionDelegate;Help.ReportIssueActionDelegate=ReportIssueActionDelegate;