Provide the static resource path via index

When the side loader for the syntax library was written, it needed to be
compatible with CDN configurations, but at that time the simplest way to
determine the CDN's path was by extracting it from the URL of the
application's main link element.

Since that time, the CDN path is provided to the page's index Soy
template using a trusted string. This can be safely inserted into the
page's JS block of constants and provided to the loader more directly.

Change-Id: I3a3432c1bf99a650645a7adf1d6979a900988ac4
diff --git a/polygerrit-ui/app/elements/shared/gr-lib-loader/gr-lib-loader.js b/polygerrit-ui/app/elements/shared/gr-lib-loader/gr-lib-loader.js
index fc26b51..3ca4aa8 100644
--- a/polygerrit-ui/app/elements/shared/gr-lib-loader/gr-lib-loader.js
+++ b/polygerrit-ui/app/elements/shared/gr-lib-loader/gr-lib-loader.js
@@ -102,6 +102,10 @@
      * @return {string}
      */
     _getLibRoot() {
+      // TODO(wyatta): Remove the remainder of this method logic once the
+      // STATIC_RESOURCE_PATH variable is being provided generally.
+      if (window.STATIC_RESOURCE_PATH) { return window.STATIC_RESOURCE_PATH; }
+
       if (this._cachedLibRoot) { return this._cachedLibRoot; }
 
       const appLink = document.head
diff --git a/resources/com/google/gerrit/httpd/raw/PolyGerritIndexHtml.soy b/resources/com/google/gerrit/httpd/raw/PolyGerritIndexHtml.soy
index 699dd0e..c51e9dc 100644
--- a/resources/com/google/gerrit/httpd/raw/PolyGerritIndexHtml.soy
+++ b/resources/com/google/gerrit/httpd/raw/PolyGerritIndexHtml.soy
@@ -33,6 +33,7 @@
     window.CLOSURE_NO_DEPS = true;
     {if $canonicalPath != ''}window.CANONICAL_PATH = '{$canonicalPath}';{/if}
     {if $versionInfo}window.VERSION_INFO = '{$versionInfo}';{/if}
+    {if $staticResourcePath != ''}window.STATIC_RESOURCE_PATH = '{$staticResourcePath}';{/if}
   </script>{\n}
 
   {if $faviconPath}