From 561febabb6b282c7a59a7aa466a99ad441a5da9b Mon Sep 17 00:00:00 2001 From: singularity43 <46550600+singularity43@users.noreply.github.com> Date: Sat, 19 Jan 2019 02:23:17 -0500 Subject: [PATCH 01/19] (Update) Helper JS Add support for user history table filters. Went JS visibility based to avoid an extra ajax call. --- resources/js/unit3d/helper.js | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/resources/js/unit3d/helper.js b/resources/js/unit3d/helper.js index 7b8d4572ab..600d979715 100644 --- a/resources/js/unit3d/helper.js +++ b/resources/js/unit3d/helper.js @@ -1,3 +1,55 @@ +class historyFilterBuilder { + constructor() { + this.filter = ''; + } + set(filter) { + this.filter = filter; + } + get() { + return this.filter; + } + handle() { + $('.historyFiltered').each(function() { + var filter = historyFilter.get(); + if(filter == 'active' && (!$(this).attr('active') || $(this).attr('active') != 1)) { + $(this).hide(); + return; + } + if(filter == 'seeding' && (!$(this).attr('seeding') || $(this).attr('seeding') != 1)) { + $(this).hide(); + return; + } + if(filter == 'prewarned' && (!$(this).attr('prewarned') || $(this).attr('prewarned') != 1)) { + $(this).hide(); + return; + } + if(filter == 'hr' && (!$(this).attr('hr') || $(this).attr('hr') != 1)) { + $(this).hide(); + return; + } + if(filter == 'immune' && (!$(this).attr('immune') || $(this).attr('immune') != 1)) { + $(this).hide(); + return; + } + $(this).show(); + }); + } + init() { + $('.historyFilter').each(function() { + $(this).off('click'); + $(this).on('click', function(e) { + var filter = $(this).attr('filter'); + e.preventDefault(); + $('.historyList').each(function() { + $(this).removeClass('active'); + }); + $('#'+filter).addClass('active'); + historyFilter.set(filter); + historyFilter.handle(); + }); + }); + } +} class facetedSearchBuilder { constructor() { this.lazyloader = ''; @@ -446,6 +498,9 @@ $(document).ready(function () { var facetedType = document.getElementById('facetedSearch').getAttribute('type'); facetedSearch.init(facetedType); } + if(document.getElementById('historyFilter')) { + historyFilter.init(); + } torrentBookmark.update(); }); $(document).on('click', '.pagination a', function (e) { @@ -468,6 +523,7 @@ $(document).on('click', '.pagination a', function (e) { }); const facetedSearch = new facetedSearchBuilder(); const torrentBookmark = new torrentBookmarkBuilder(); +const historyFilter = new historyFilterBuilder(); var facetedSearchXHR = null; var torrentBookmarkXHR = null; From 006c2fece9a73011bada98fa07ee61478354271e Mon Sep 17 00:00:00 2001 From: singularity43 <46550600+singularity43@users.noreply.github.com> Date: Sat, 19 Jan 2019 02:23:49 -0500 Subject: [PATCH 02/19] (Update) Torrent English Lang File Case fixes. --- resources/lang/en/torrent.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/lang/en/torrent.php b/resources/lang/en/torrent.php index 507d8a3150..06da50a26d 100644 --- a/resources/lang/en/torrent.php +++ b/resources/lang/en/torrent.php @@ -34,21 +34,21 @@ 'created_at' => 'Created at', 'credited' => 'Credited', 'current' => 'Current', - 'current-filters' => 'Current filters', - 'currently-leeching' => 'Currently leeching', - 'currently-seeding' => 'Currently seeding', - 'dead-torrent' => 'Dead torrent', - 'dead-torrents' => 'Dead torrents', - 'delete-bookmark' => 'Delete this bookmark', + 'current-filters' => 'Current Filters', + 'currently-leeching' => 'Currently Leeching', + 'currently-seeding' => 'Currently Seeding', + 'dead-torrent' => 'Dead Torrent', + 'dead-torrents' => 'Dead Torrents', + 'delete-bookmark' => 'Delete This Bookmark', 'description' => 'Description', 'discounts' => 'Discounts', 'double-upload' => 'Double upload', 'download-all' => 'Download All', 'download-check' => 'Download check', 'downloaded' => 'Downloaded', - 'dying-torrent' => 'Dying torrent', - 'dying-torrents' => 'Dying torrents', - 'encode-settings' => 'Encode settings', + 'dying-torrent' => 'Dying Torrent', + 'dying-torrents' => 'Dying Torrents', + 'encode-settings' => 'Encode Settings', 'estimated-ratio' => 'Estimated Ratio after Download', 'failed' => 'Failed', 'feature' => 'Feature', From 4179e4e527995c8fb1f89a996e8cd253a5d4e6e3 Mon Sep 17 00:00:00 2001 From: singularity43 <46550600+singularity43@users.noreply.github.com> Date: Sat, 19 Jan 2019 02:24:18 -0500 Subject: [PATCH 03/19] (Update) User English Lang File Case fixes. --- resources/lang/en/user.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/resources/lang/en/user.php b/resources/lang/en/user.php index 55617b5199..d6562a230e 100644 --- a/resources/lang/en/user.php +++ b/resources/lang/en/user.php @@ -12,7 +12,7 @@ 'account-settings' => 'Account Settings', 'achievements' => 'Achievements', 'active' => 'Active', - 'active-table' => 'My active table', + 'active-table' => 'My Active Table', 'active-torrents' => 'Active torrents', 'active-warning' => 'Active Warning', 'active-warnings' => 'Active Warnings', @@ -60,10 +60,10 @@ 'follow' => 'Follow', 'followers' => 'Followers', 'formats-are-supported' => ':formats are supported', - 'forum-signature' => 'Forum signature', + 'forum-signature' => 'Forum Signature', 'gift-given' => 'Gift Given', 'gift-received' => 'Gift Received', - 'history-table' => 'My history table', + 'history-table' => 'My History Table', 'hit-n-runs' => 'Hit and Runs', 'hit-n-runs-count' => 'Hit and Run Count (All Time)', 'hit-n-runs-history' => 'Torrent Hit and Runs History', @@ -85,7 +85,7 @@ 'member-since' => 'Member since', 'members-desc' => 'List of users registered on :title with all groups. Find an user now.', 'moderated-by' => 'Moderated by :mod on', - 'my-bonus-points' => 'My bonus points', + 'my-bonus-points' => 'My Bonus Points', 'my-bookmarks' => 'My Bookmarks', 'my-fl-tokens' => 'My FL tokens', 'my-profile' => 'My Profile', @@ -117,27 +117,27 @@ 'tips-given' => 'Tips Given', 'tips-received' => 'Tips Received', 'title' => 'Title', - 'top-bankers' => 'Top bankers', - 'top-downloaders-data' => 'Top downloaders (data)', - 'top-leechers' => 'Top leechers', - 'top-seeders' => 'Top seeders', - 'top-seedtime' => 'Top seedtime', - 'top-uploaders-data' => 'Top uploaders (data)', - 'top-uploaders-torrents' => 'Top uploaders (torrents)', + 'top-bankers' => 'Top Bankers', + 'top-downloaders-data' => 'Top Downloaders (Data)', + 'top-leechers' => 'Top Leechers', + 'top-seeders' => 'Top Seeders', + 'top-seedtime' => 'Top Seedtime', + 'top-uploaders-data' => 'Top Uploaders (data)', + 'top-uploaders-torrents' => 'Top Uploaders (torrents)', 'topics' => 'Forum Topics Made', 'torrent-comments' => 'Torrent Comments Made', - 'torrents-history' => 'Torrents history', - 'total-download' => 'Total download', - 'total-downloads' => 'Total downloads', - 'total-leeching' => 'Total leeching', - 'total-seeding' => 'Total seeding', + 'torrents-history' => 'Torrents History', + 'total-download' => 'Total Download', + 'total-downloads' => 'Total Downloads', + 'total-leeching' => 'Total Leeching', + 'total-seeding' => 'Total Seeding', 'total-seedtime-all' => 'Total Seedtime (All Torrents)', - 'total-upload' => 'Total upload', - 'total-uploads' => 'Total uploads', + 'total-upload' => 'Total Upload', + 'total-uploads' => 'Total Uploads', 'unban' => 'Unban User', 'unfollow' => 'Unfollow', 'unlocked' => 'Unlocked', - 'unlocked-achievements' => 'Unlocked achievements', + 'unlocked-achievements' => 'Unlocked Achievements', 'upload-bon' => 'Upload Added From BON Store', 'upload-recorded' => 'Recorded Upload', 'upload-true' => 'True Upload', From 5057659e0b74834ffb5aa1906a62c409faa14bf4 Mon Sep 17 00:00:00 2001 From: singularity43 <46550600+singularity43@users.noreply.github.com> Date: Sat, 19 Jan 2019 02:25:08 -0500 Subject: [PATCH 04/19] (Update) User History Table View Add JS filters to history. --- resources/views/user/history.blade.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/resources/views/user/history.blade.php b/resources/views/user/history.blade.php index c47a1c91e2..a6e9f86c25 100644 --- a/resources/views/user/history.blade.php +++ b/resources/views/user/history.blade.php @@ -29,11 +29,20 @@ class="l-breadcrumb-item-link"> @lang('user.history-table') - @lang('torrent.download-all') @lang('torrent.torrent') + @lang('torrent.download-all') @lang('torrent.torrents') +