Mark next/prev pagination links with the `rel` attribute
authorAlexander Ebert <ebert@woltlab.com>
Thu, 13 Dec 2018 21:49:23 +0000 (22:49 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 13 Dec 2018 21:49:23 +0000 (22:49 +0100)
See #2663

wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Pagination.js
wcfsetup/install/files/lib/system/template/plugin/PagesFunctionTemplatePlugin.class.php

index 345b16b59d690aff33b56750395366ae17a45fd0..8c163f1028d8618e7b52d30f27ca98768098b30f 100644 (file)
@@ -65,6 +65,7 @@ define(['Core', 'Language', 'ObjectMap', 'StringUtil', 'WoltLabSuite/Core/Ui/Pag
                                link.className = iconClassNames + ' jsTooltip';
                                link.href = '#';
                                link.title = Language.get('wcf.global.page.previous');
+                               link.rel = 'prev';
                                listItem.appendChild(link);
                                
                                link.addEventListener(WCF_CLICK_EVENT, this.switchPage.bind(this, this._options.activePage - 1));
@@ -163,6 +164,7 @@ define(['Core', 'Language', 'ObjectMap', 'StringUtil', 'WoltLabSuite/Core/Ui/Pag
                                link.className = iconClassNames + ' jsTooltip';
                                link.href = '#';
                                link.title = Language.get('wcf.global.page.next');
+                               link.rel = 'next';
                                listItem.appendChild(link);
                                
                                link.addEventListener(WCF_CLICK_EVENT, this.switchPage.bind(this, this._options.activePage + 1));
index 33eab40cbe7efc69e4275610a0f12debd50b86fb..58ebca26c0d62faafc34952ad2c94c72a9b3d19c 100644 (file)
@@ -74,7 +74,7 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin {
         */
        protected function makePreviousLink($link, $pageNo) {
                if ($pageNo > 1) {
-                       return '<li class="skip"><a href="'.self::insertPageNumber($link, $pageNo - 1).'" title="'.WCF::getLanguage()->getDynamicVariable('wcf.global.page.previous').'" class="icon icon24 fa-chevron-left jsTooltip"></a></li>'."\n";
+                       return '<li class="skip"><a href="'.self::insertPageNumber($link, $pageNo - 1).'" title="'.WCF::getLanguage()->getDynamicVariable('wcf.global.page.previous').'" class="icon icon24 fa-chevron-left jsTooltip" rel="prev"></a></li>'."\n";
                }
                else {
                        return '<li class="skip disabled"><span class="icon icon24 fa-chevron-left"></span></li>'."\n";
@@ -91,7 +91,7 @@ class PagesFunctionTemplatePlugin implements IFunctionTemplatePlugin {
         */
        protected function makeNextLink($link, $pageNo, $pages) {
                if ($pageNo && $pageNo < $pages) {
-                       return '<li class="skip"><a href="'.self::insertPageNumber($link, $pageNo + 1).'" title="'.WCF::getLanguage()->getDynamicVariable('wcf.global.page.next').'" class="icon icon24 fa-chevron-right jsTooltip"></a></li>'."\n";
+                       return '<li class="skip"><a href="'.self::insertPageNumber($link, $pageNo + 1).'" title="'.WCF::getLanguage()->getDynamicVariable('wcf.global.page.next').'" class="icon icon24 fa-chevron-right jsTooltip" rel="next"></a></li>'."\n";
                }
                else {
                        return '<li class="skip disabled"><span class="icon icon24 fa-chevron-right"></span></li>'."\n";