Merge "Preload REST API calls for change page and diff page"
This commit is contained in:
@@ -28,6 +28,11 @@
|
||||
{@param? polyfillSD: ?}
|
||||
{@param? polyfillSC: ?}
|
||||
{@param? useGoogleFonts: ?}
|
||||
{@param? changeRequestsPath: ?}
|
||||
{@param? defaultChangeDetailHex: ?}
|
||||
{@param? defaultDiffDetailHex: ?}
|
||||
{@param? preloadChangePage: ?}
|
||||
{@param? preloadDiffPage: ?}
|
||||
<!DOCTYPE html>{\n}
|
||||
<html lang="en">{\n}
|
||||
<meta charset="utf-8">{\n}
|
||||
@@ -43,6 +48,14 @@
|
||||
// Disable extra font load from paper-styles
|
||||
window.polymerSkipLoadingFontRoboto = true;
|
||||
window.CLOSURE_NO_DEPS = true;
|
||||
window.DEFAULT_DETAIL_HEXES = {lb}
|
||||
{if $defaultChangeDetailHex}
|
||||
changePage: '{$defaultChangeDetailHex}',
|
||||
{/if}
|
||||
{if $defaultDiffDetailHex}
|
||||
diffPage: '{$defaultDiffDetailHex}',
|
||||
{/if}
|
||||
{rb};
|
||||
{if $canonicalPath != ''}window.CANONICAL_PATH = '{$canonicalPath}';{/if}
|
||||
{if $versionInfo}window.VERSION_INFO = '{$versionInfo}';{/if}
|
||||
{if $staticResourcePath != ''}window.STATIC_RESOURCE_PATH = '{$staticResourcePath}';{/if}
|
||||
@@ -68,6 +81,16 @@
|
||||
{else}
|
||||
<link rel="icon" type="image/x-icon" href="{$canonicalPath}/favicon.ico">{\n}
|
||||
{/if}
|
||||
{if $changeRequestsPath}
|
||||
{if $preloadChangePage and $defaultChangeDetailHex}
|
||||
<link rel="preload" href="{$canonicalPath}/{$changeRequestsPath}/detail?O={$defaultChangeDetailHex}" as="fetch" type="application/json" crossorigin="anonymous"/>{\n}
|
||||
{/if}
|
||||
{if $preloadDiffPage and $defaultDiffDetailHex}
|
||||
<link rel="preload" href="{$canonicalPath}/{$changeRequestsPath}/detail?O={$defaultDiffDetailHex}" as="fetch" type="application/json" crossorigin="anonymous"/>{\n}
|
||||
{/if}
|
||||
<link rel="preload" href="{$canonicalPath}/{$changeRequestsPath}/comments" as="fetch" type="application/json" crossorigin="anonymous"/>{\n}
|
||||
<link rel="preload" href="{$canonicalPath}/{$changeRequestsPath}/robotcomments" as="fetch" type="application/json" crossorigin="anonymous"/>{\n}
|
||||
{/if}
|
||||
|
||||
// RobotoMono fonts are used in styles/fonts.css
|
||||
{if $useGoogleFonts}
|
||||
|
||||
Reference in New Issue
Block a user