You are here

function _amp_get_amp_js_list in Accelerated Mobile Pages (AMP) 7

Return info on AMP JS components returned from the AMP library.

Return value

array $amp_js An array containing AMP components, with the key as the AMP component name

1 call to _amp_get_amp_js_list()
amp_add_component_libraries in ./amp.module
Given an array of components e.g. amp-iframe, add these components to head.

File

./amp.module, line 1324

Code

function _amp_get_amp_js_list() {
  $amp_js =& drupal_static(__FUNCTION__, array());
  if ($amp_js) {
    return $amp_js;
  }

  // Mirrors the order of https://www.ampproject.org/docs/reference/components.
  $amp_js = array(
    // Ads and analytics.
    'amp-ad' => 'https://cdn.ampproject.org/v0/amp-ad-0.1.js',
    'amp-ad-exit' => 'https://cdn.ampproject.org/v0/amp-ad-exit-0.1.js',
    'amp-analytics' => 'https://cdn.ampproject.org/v0/amp-analytics-0.1.js',
    'amp-auto-ads' => 'https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js',
    'amp-call-tracking' => 'https://cdn.ampproject.org/v0/amp-call-tracking-0.1.js',
    'amp-experiment' => 'https://cdn.ampproject.org/v0/amp-experiment-0.1.js',
    'amp-sticky-ad' => 'https://cdn.ampproject.org/v0/amp-sticky-ad-1.0.js',
    // Dynamic content.
    'amp-access-laterpay' => 'https://cdn.ampproject.org/v0/amp-access-laterpay-0.1.js',
    'amp-access' => 'https://cdn.ampproject.org/v0/amp-access-0.1.js',
    'amp-bind' => 'https://cdn.ampproject.org/v0/amp-bind-0.1.js',
    'amp-byside-content' => 'https://cdn.ampproject.org/v0/amp-byside-content-0.1.js',
    'amp-consent' => 'https://cdn.ampproject.org/v0/amp-consent-0.1.js',
    'amp-date-picker' => 'https://cdn.ampproject.org/v0/amp-date-picker-0.1.js',
    'amp-form' => 'https://cdn.ampproject.org/v0/amp-form-0.1.js',
    'amp-geo' => 'https://cdn.ampproject.org/v0/amp-geo-0.1.js',
    'amp-gist' => 'https://cdn.ampproject.org/v0/amp-gist-0.1.js',
    'amp-google-document-embed' => 'https://cdn.ampproject.org/v0/amp-google-document-embed-0.1.js',
    'amp-install-serviceworker' => 'https://cdn.ampproject.org/v0/amp-install-serviceworker-0.1.js',
    'amp-list' => 'https://cdn.ampproject.org/v0/amp-list-0.1.js',
    'amp-live-list' => 'https://cdn.ampproject.org/v0/amp-live-list-0.1.js',
    'amp-mustache' => 'https://cdn.ampproject.org/v0/amp-mustache-0.2.js',
    'amp-next-page' => 'https://cdn.ampproject.org/v0/amp-next-page-0.1.js',
    'amp-selector' => 'https://cdn.ampproject.org/v0/amp-selector-0.1.js',
    'amp-user-notification' => 'https://cdn.ampproject.org/v0/amp-user-notification-0.1.js',
    'amp-web-push' => 'https://cdn.ampproject.org/v0/amp-web-push-0.1.js',
    // Layout.
    'amp-accordion' => 'https://cdn.ampproject.org/v0/amp-accordion-0.1.js',
    'amp-app-banner' => 'https://cdn.ampproject.org/v0/amp-app-banner-0.1.js',
    'amp-carousel' => 'https://cdn.ampproject.org/v0/amp-carousel-0.1.js',
    'amp-fx-flying-carpet' => 'https://cdn.ampproject.org/v0/amp-fx-flying-carpet-0.1.js',
    'amp-fx-collection' => 'https://cdn.ampproject.org/v0/amp-fx-collection-0.1.js',
    'amp-iframe' => 'https://cdn.ampproject.org/v0/amp-iframe-0.1.js',
    'amp-image-lightbox' => 'https://cdn.ampproject.org/v0/amp-image-lightbox-0.1.js',
    'amp-lightbox' => 'https://cdn.ampproject.org/v0/amp-lightbox-0.1.js',
    'amp-lightbox-gallery' => 'https://cdn.ampproject.org/v0/amp-lightbox-gallery-0.1.js',
    'amp-orientation-observer' => 'https://cdn.ampproject.org/v0/amp-orientation-observer-0.1.js',
    'amp-position-observer' => 'https://cdn.ampproject.org/v0/amp-position-observer-0.1.js',
    'amp-sidebar' => 'https://cdn.ampproject.org/v0/amp-sidebar-0.1.js',
    // Media.
    'amp-3d-gltf' => 'https://cdn.ampproject.org/v0/amp-3d-gltf-0.1.js',
    'amp-3q-player' => 'https://cdn.ampproject.org/v0/amp-3q-player-0.1.js',
    'amp-anim' => 'https://cdn.ampproject.org/v0/amp-anim-0.1.js',
    'amp-apester-media' => 'https://cdn.ampproject.org/v0/amp-apester-media-0.1.js',
    'amp-audio' => 'https://cdn.ampproject.org/v0/amp-audio-0.1.js',
    'amp-bodymovin-animation' => 'https://cdn.ampproject.org/v0/amp-bodymovin-animation-0.1.js',
    'amp-brid-player' => 'https://cdn.ampproject.org/v0/amp-brid-player-0.1.js',
    'amp-brightcove' => 'https://cdn.ampproject.org/v0/amp-brightcove-0.1.js',
    'amp-dailymotion' => 'https://cdn.ampproject.org/v0/amp-dailymotion-0.1.js',
    'amp-embedly-card' => 'https://cdn.ampproject.org/v0/amp-embedly-card-0.1.js',
    'amp-google-vrview-image' => 'https://cdn.ampproject.org/v0/amp-google-vrview-image-0.1.js',
    'amp-hulu' => 'https://cdn.ampproject.org/v0/amp-hulu-0.1.js',
    'amp-ima-video' => 'https://cdn.ampproject.org/v0/amp-ima-video-0.1.js',
    'amp-imgur' => 'https://cdn.ampproject.org/v0/amp-imgur-0.1.js',
    'amp-izlesene' => 'https://cdn.ampproject.org/v0/amp-izlesene-0.1.js',
    'amp-jwplayer' => 'https://cdn.ampproject.org/v0/amp-jwplayer-0.1.js',
    'amp-kaltura-player' => 'https://cdn.ampproject.org/v0/amp-kaltura-player-0.1.js',
    'amp-nexxtv-player' => 'https://cdn.ampproject.org/v0/amp-nexxtv-player-0.1.js',
    'amp-o2-player' => 'https://cdn.ampproject.org/v0/amp-o2-player-0.1.js',
    'amp-ooyala-player' => 'https://cdn.ampproject.org/v0/amp-ooyala-player-0.1.js',
    'amp-playbuzz' => 'https://cdn.ampproject.org/v0/amp-playbuzz-0.1.js',
    'amp-reach-player' => 'https://cdn.ampproject.org/v0/amp-reach-player-0.1.js',
    'amp-soundcloud' => 'https://cdn.ampproject.org/v0/amp-soundcloud-0.1.js',
    'amp-springboard-player' => 'https://cdn.ampproject.org/v0/amp-springboard-player-0.1.js',
    'amp-video' => 'https://cdn.ampproject.org/v0/amp-video-0.1.js',
    'amp-vimeo' => 'https://cdn.ampproject.org/v0/amp-vimeo-0.1.js',
    'amp-wistia-player' => 'https://cdn.ampproject.org/v0/amp-wistia-player-0.1.js',
    'amp-yotpo' => 'https://cdn.ampproject.org/v0/amp-yotpo-0.1.js',
    'amp-youtube' => 'https://cdn.ampproject.org/v0/amp-youtube-0.1.js',
    // Presentation.
    'amp-animation' => 'https://cdn.ampproject.org/v0/amp-animation-0.1.js',
    'amp-date-countdown' => 'https://cdn.ampproject.org/v0/amp-date-countdown-0.1.js',
    'amp-dynamic-css-classes' => 'https://cdn.ampproject.org/v0/amp-dynamic-css-classes-0.1.js',
    'amp-fit-text' => 'https://cdn.ampproject.org/v0/amp-fit-text-0.1.js',
    'amp-font' => 'https://cdn.ampproject.org/v0/amp-font-0.1.js',
    'amp-mathml' => 'https://cdn.ampproject.org/v0/amp-mathml-0.1.js',
    'amp-pan-zoom' => 'https://cdn.ampproject.org/v0/amp-pan-zoom-0.1.js',
    'amp-story' => 'https://cdn.ampproject.org/v0/amp-story-0.1.js',
    'amp-timeago' => 'https://cdn.ampproject.org/v0/amp-timeago-0.1.js',
    'amp-viz-vega' => 'https://cdn.ampproject.org/v0/amp-viz-vega-0.1.js',
    // Social.
    'amp-beopinion' => 'https://cdn.ampproject.org/v0/amp-beopinion-0.1.js',
    'amp-addthis' => 'https://cdn.ampproject.org/v0/amp-addthis-0.1.js',
    'amp-facebook-comments' => 'https://cdn.ampproject.org/v0/amp-facebook-comments-0.1.js',
    'amp-facebook-like' => 'https://cdn.ampproject.org/v0/amp-facebook-like-0.1.js',
    'amp-facebook-page' => 'https://cdn.ampproject.org/v0/amp-facebook-page-0.1.js',
    'amp-facebook' => 'https://cdn.ampproject.org/v0/amp-facebook-0.1.js',
    'amp-gfycat' => 'https://cdn.ampproject.org/v0/amp-gfycat-0.1.js',
    'amp-instagram' => 'https://cdn.ampproject.org/v0/amp-instagram-0.1.js',
    'amp-pinterest' => 'https://cdn.ampproject.org/v0/amp-pinterest-0.1.js',
    'amp-reddit' => 'https://cdn.ampproject.org/v0/amp-reddit-0.1.js',
    'amp-riddle-quiz' => 'https://cdn.ampproject.org/v0/amp-riddle-quiz-0.1.js',
    'amp-social-share' => 'https://cdn.ampproject.org/v0/amp-social-share-0.1.js',
    'amp-twitter' => 'https://cdn.ampproject.org/v0/amp-twitter-0.1.js',
    'amp-vine' => 'https://cdn.ampproject.org/v0/amp-vine-0.1.js',
    'amp-vk' => 'https://cdn.ampproject.org/v0/amp-vk-0.1.js',
  );
  drupal_alter('amp_js_list', $amp_js);
  return $amp_js;
}