From 37654f3346dcc54375c5691022e1e358907cc225 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 18 Dec 2014 15:58:35 +0100 Subject: [PATCH] Added JS-based pagination for phrase management --- .../install/files/acp/js/WCF.ACP.Language.js | 35 ++++++++++++++++++- .../files/acp/templates/languageItemList.tpl | 4 +-- .../acp/page/LanguageItemListPage.class.php | 26 ++++++++++++++ 3 files changed, 62 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.Language.js b/wcfsetup/install/files/acp/js/WCF.ACP.Language.js index 78286bfde1..8f11d52372 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.Language.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.Language.js @@ -9,6 +9,9 @@ WCF.ACP.Language = { }; /** * Handles language item list management. + * + * @param integer count + * @param integer pageNo */ WCF.ACP.Language.ItemList = Class.extend({ /** @@ -31,8 +34,11 @@ WCF.ACP.Language.ItemList = Class.extend({ /** * Initializes the WCF.ACP.Style.List class. + * + * @param integer count + * @param integer pageNo */ - init: function() { + init: function(count, pageNo) { this._proxy = new WCF.Action.Proxy({ success: $.proxy(this._success, this) }); @@ -44,6 +50,33 @@ WCF.ACP.Language.ItemList = Class.extend({ var self = this; $button.click(function() { self._click($languageItemID); }); }, this)); + + count = parseInt(count) || 0; + if (count > 100) { + this._createPagination(count, pageNo); + } + }, + + /** + * Creates a pagination for current search result. + * + * @param integer count + * @param integer pageNo + */ + _createPagination: function(count, pageNo) { + $('.contentNavigation').each(function(index, contentNavigation) { + var $contentNavigation = $(contentNavigation); + var $nav = $('