diff --git a/js/refreshless.js b/js/refreshless.js index 3a199e5..05985de 100644 --- a/js/refreshless.js +++ b/js/refreshless.js @@ -1,3 +1,7 @@ +/** + * @file + */ + (function ($, Drupal, drupalSettings, history, JSON, storage) { /* eslint-disable no-console */ @@ -163,6 +167,7 @@ * History-based navigation: back/forward buttons, so both directions. * * Scroll handling is performed by History API: scrollRestoration = auto. + * * @see https://html.spec.whatwg.org/multipage/browsers.html#dom-history-scroll-restoration * * @fixme Uses the currentPos global. @@ -223,6 +228,7 @@ * The state we're navigating back in history to. * @param {string} regionName * The name of the region. + * * @return {string} * The HTML for the region. */ @@ -380,7 +386,7 @@ }; /** - * Helpers + * Helpers. */ function followIntra(target) { @@ -466,7 +472,7 @@ // librariesBefore: before response is applied // response: the response to apply - // drupalSettings: after the response is applied + // drupalSettings: after the response is applied. function buildPageStateContent(librariesBefore, response, drupalSettings) { var updateHtmlHeadCommand = response.filter(function (command) { return command.command === 'refreshlessUpdateHtmlHead'; })[0]; diff --git a/src/Ajax/RefreshlessUpdateHtmlHeadCommand.php b/src/Ajax/RefreshlessUpdateHtmlHeadCommand.php index 791b506..9e7518b 100644 --- a/src/Ajax/RefreshlessUpdateHtmlHeadCommand.php +++ b/src/Ajax/RefreshlessUpdateHtmlHeadCommand.php @@ -3,7 +3,6 @@ namespace Drupal\refreshless\Ajax; use Drupal\Core\Ajax\CommandInterface; -use Drupal\Core\Ajax\CommandWithAttachedAssetsTrait; /** * AJAX command for updating the HTML . @@ -11,6 +10,7 @@ use Drupal\Core\Ajax\CommandWithAttachedAssetsTrait; * Note that this does not touch CSS or JS in : for those, the AJAX system * has separate commands, we don't need to do anything about that. This is for * everything in *except* CSS and JS. + * * @see \Drupal\Core\Ajax\AjaxResponseAttachmentsProcessor::buildAttachmentsCommands() * * This command is implemented by Drupal.AjaxCommands.prototype.refreshlessUpdateHtmlHead() diff --git a/src/Ajax/RefreshlessUpdateRegionCommand.php b/src/Ajax/RefreshlessUpdateRegionCommand.php index 4eb080f..b7275ca 100644 --- a/src/Ajax/RefreshlessUpdateRegionCommand.php +++ b/src/Ajax/RefreshlessUpdateRegionCommand.php @@ -10,7 +10,7 @@ use Drupal\Core\Ajax\CommandWithAttachedAssetsTrait; * AJAX command for updating a region in the page. * * This command is implemented by Drupal.AjaxCommands.prototype.refreshlessUpdateRegion() - * defined in js/refreshless.js + * defined in js/refreshless.js. * * @ingroup ajax * diff --git a/src/EventSubscriber/BlockPageDisplayVariantSubscriber.php b/src/EventSubscriber/BlockPageDisplayVariantSubscriber.php index 0b9d7e7..f1ce3da 100644 --- a/src/EventSubscriber/BlockPageDisplayVariantSubscriber.php +++ b/src/EventSubscriber/BlockPageDisplayVariantSubscriber.php @@ -26,7 +26,7 @@ class BlockPageDisplayVariantSubscriber implements EventSubscriberInterface { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + static public function getSubscribedEvents() { // Set a very low priority, so that it runs last. $events[RenderEvents::SELECT_PAGE_DISPLAY_VARIANT][] = ['onBlockPageDisplayVariantSelected', -1000]; return $events; diff --git a/src/EventSubscriber/HtmlResponseSubscriber.php b/src/EventSubscriber/HtmlResponseSubscriber.php index a4922f1..52d729d 100644 --- a/src/EventSubscriber/HtmlResponseSubscriber.php +++ b/src/EventSubscriber/HtmlResponseSubscriber.php @@ -12,7 +12,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; * Response subscriber to process HTML responses for Refreshless. * * All modifications this makes are harmless: they don't ever break HTML or - * normal site operation. Even if JavaScript is turned + * normal site operation. Even if JavaScript is turned. */ class HtmlResponseSubscriber implements EventSubscriberInterface { diff --git a/src/EventSubscriber/RedirectResponseSubscriber.php b/src/EventSubscriber/RedirectResponseSubscriber.php index 604b251..c467767 100644 --- a/src/EventSubscriber/RedirectResponseSubscriber.php +++ b/src/EventSubscriber/RedirectResponseSubscriber.php @@ -64,7 +64,7 @@ class RedirectResponseSubscriber implements EventSubscriberInterface { /** * {@inheritdoc} */ - static function getSubscribedEvents() { + static public function getSubscribedEvents() { // Run after \Drupal\Core\EventSubscriber\RedirectResponseSubscriber, which // has priority 0. This way, we can rely on any local redirects having been // converted to LocalRedirectResponse objects, so we don't have to check diff --git a/src/RefreshlessPageState.php b/src/RefreshlessPageState.php index cad8596..e97f4a6 100644 --- a/src/RefreshlessPageState.php +++ b/src/RefreshlessPageState.php @@ -8,6 +8,9 @@ use Drupal\Core\Cache\Context\CacheContextsManager; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\HttpException; +/** + * + */ class RefreshlessPageState { /** @@ -84,7 +87,7 @@ class RefreshlessPageState { * The cacheability of a region (or block or …), to check whether it would * have changed compared to the previous page. * @param \Symfony\Component\HttpFoundation\Request $request - * The current request, to check whether + * The current request, to check whether. * * @return bool * Whether this region (or block or …) has changed. diff --git a/src/Render/MainContent/RefreshlessRenderer.php b/src/Render/MainContent/RefreshlessRenderer.php index e5f0ccf..807a596 100644 --- a/src/Render/MainContent/RefreshlessRenderer.php +++ b/src/Render/MainContent/RefreshlessRenderer.php @@ -4,7 +4,6 @@ namespace Drupal\refreshless\Render\MainContent; use Drupal\Component\Utility\Crypt; use Drupal\Core\Ajax\AjaxResponse; -use Drupal\Core\Ajax\InsertCommand; use Drupal\Core\Render\AttachmentsResponseProcessorInterface; use Drupal\Core\Render\BubbleableMetadata; use Drupal\Core\Render\HtmlResponse; @@ -37,6 +36,9 @@ class RefreshlessRenderer implements MainContentRendererInterface { */ protected $htmlResponseAttachmentsProcessor; + /** + * + */ public function __construct(MainContentRendererInterface $html_renderer, RefreshlessPageState $refreshless_page_state, AttachmentsResponseProcessorInterface $html_response_attachments_processor) { $this->htmlRenderer = $html_renderer; $this->renderer = \Drupal::service('renderer'); @@ -121,7 +123,7 @@ class RefreshlessRenderer implements MainContentRendererInterface { * Renders HTML attachments into HTML. * * @param array $html_head_attachments - * An attachments array containing only attachments destined for HTML . + * An attachments array containing only attachments destined for HTML . * * @return string * The HTML to be inserted in the HTML tag.