diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt
index 81ad3429..a4d93a5e 100644
--- a/docs/CHANGES.txt
+++ b/docs/CHANGES.txt
@@ -1,5 +1,8 @@
CHANGE LOG
+2015-11-14 by techietrash
+Fix ctrl+click group collapsing/expanding on OSX
+
2015-11-06 by newman
Add proper title to torrent stats page. Update token history to display deleted torrents.
diff --git a/sections/ajax/forum/forum.php b/sections/ajax/forum/forum.php
index 8e185972..a465d8c6 100644
--- a/sections/ajax/forum/forum.php
+++ b/sections/ajax/forum/forum.php
@@ -20,7 +20,9 @@
}
if (isset($_GET['pp'])) {
- $PerPage = $_GET['pp'];
+
+ $PerPage = $_GET['pp'];
+
} elseif (isset($LoggedUser['PostsPerPage'])) {
$PerPage = $LoggedUser['PostsPerPage'];
} else {
diff --git a/sections/artist/artist.php b/sections/artist/artist.php
index f25eb18e..d6244609 100644
--- a/sections/artist/artist.php
+++ b/sections/artist/artist.php
@@ -387,7 +387,7 @@ function compare($X, $Y) {
|
@@ -442,7 +442,7 @@ function compare($X, $Y) {
?>
|
- − =Torrents::edition_string($Torrent, $TorrentList[$Group['GroupID']])?> |
+ − =Torrents::edition_string($Torrent, $TorrentList[$Group['GroupID']])?> |
}
diff --git a/sections/bookmarks/torrents.php b/sections/bookmarks/torrents.php
index edd1450a..c3970e45 100644
--- a/sections/bookmarks/torrents.php
+++ b/sections/bookmarks/torrents.php
@@ -87,7 +87,7 @@ function compare($X, $Y) {
|
@@ -133,7 +133,7 @@ function compare($X, $Y) {
$EditionID++;
?>
|
- − =Torrents::edition_string($Torrent, $Group)?> |
+ − =Torrents::edition_string($Torrent, $Group)?> |
}
diff --git a/sections/collages/torrent_collage.php b/sections/collages/torrent_collage.php
index 02b64d67..b7ccdd2f 100644
--- a/sections/collages/torrent_collage.php
+++ b/sections/collages/torrent_collage.php
@@ -107,7 +107,7 @@ function compare($X, $Y) {
|
@@ -157,7 +157,7 @@ function compare($X, $Y) {
$EditionID++;
?>
|
- − =Torrents::edition_string($Torrent, $Group)?> |
+ − =Torrents::edition_string($Torrent, $Group)?> |
}
diff --git a/sections/top10/votes.php b/sections/top10/votes.php
index f579d61f..361f8bf9 100644
--- a/sections/top10/votes.php
+++ b/sections/top10/votes.php
@@ -203,7 +203,7 @@
|
@@ -279,7 +279,7 @@
$EditionID++;
?>
|
- − =Torrents::edition_string($Torrent, $Group)?> |
+ − =Torrents::edition_string($Torrent, $Group)?> |
}
diff --git a/sections/torrents/browse.php b/sections/torrents/browse.php
index 4dd1dc73..0e7f62ac 100644
--- a/sections/torrents/browse.php
+++ b/sections/torrents/browse.php
@@ -559,7 +559,7 @@ function header_link($SortKey, $DefaultWay = 'desc') {
?>
|
@@ -630,7 +630,7 @@ function header_link($SortKey, $DefaultWay = 'desc') {
?>
|
- − =Torrents::edition_string($Data, $GroupInfo)?> |
+ − =Torrents::edition_string($Data, $GroupInfo)?> |
}
diff --git a/sections/torrents/details.php b/sections/torrents/details.php
index 18012781..30e5da50 100644
--- a/sections/torrents/details.php
+++ b/sections/torrents/details.php
@@ -665,7 +665,7 @@ function filelist($Str) {
?>
- − =Torrents::edition_string($Torrent, $TorrentDetails)?> |
+ − =Torrents::edition_string($Torrent, $TorrentDetails)?> |
}
diff --git a/sections/torrents/functions.php b/sections/torrents/functions.php
index 5fc15cb3..167b690a 100644
--- a/sections/torrents/functions.php
+++ b/sections/torrents/functions.php
@@ -446,7 +446,7 @@ function filelist($Str) {
$EditionID++;
?>
- − = Torrents::edition_string($Torrent, $TorrentDetails) ?> |
+ − = Torrents::edition_string($Torrent, $TorrentDetails) ?> |
}
diff --git a/sections/userhistory/subscribed_collages.php b/sections/userhistory/subscribed_collages.php
index 80fe1170..07daa82f 100644
--- a/sections/userhistory/subscribed_collages.php
+++ b/sections/userhistory/subscribed_collages.php
@@ -132,7 +132,7 @@
|
@@ -174,7 +174,7 @@
$EditionID++;
?>
|
- − =Torrents::edition_string($Torrent, $Group)?> |
+ − =Torrents::edition_string($Torrent, $Group)?> |
}
diff --git a/static/functions/browse.js b/static/functions/browse.js
index 32c2728d..addf1048 100644
--- a/static/functions/browse.js
+++ b/static/functions/browse.js
@@ -86,13 +86,14 @@ function add_tag(tag) {
}
function toggle_group(groupid, link, event) {
+ var showRow = true;
var clickedRow = link;
while (clickedRow.nodeName != 'TR') {
clickedRow = clickedRow.parentNode;
}
var group_rows = clickedRow.parentNode.children;
var showing = $(clickedRow).nextElementSibling().has_class('hidden');
- var allGroups = event.ctrlKey;
+ var allGroups = (event.ctrlKey || event.metaKey); // detect ctrl or cmd
// for dealing with Mac OS X
// http://stackoverflow.com/a/3922353
@@ -101,7 +102,8 @@ function toggle_group(groupid, link, event) {
|| event.keyCode == 93 // WebKit (right apple)
|| event.keyCode == 224 // Firefox
|| event.keyCode == 17 // Opera
- ) ? 91 : null;
+ ) ? true : null;
+
for (var i = 0; i < group_rows.length; i++) {
var row = $(group_rows[i]);
@@ -111,6 +113,9 @@ function toggle_group(groupid, link, event) {
if (row.has_class('colhead')) {
continue;
}
+ if (row.has_class('torrent')) {
+ continue; // Prevents non-grouped torrents from disappearing when collapsing all groups
+ }
var relevantRow = row.has_class('group') ? $(group_rows[i + 1]) : row;
if (allGroups || allGroupsMac || relevantRow.has_class('groupid_' + groupid)) {
row = $(group_rows[i]); // idk why we need this :S
@@ -122,8 +127,8 @@ function toggle_group(groupid, link, event) {
section = 'on this page.';
}
var tooltip = showing
- ? 'Collapse this group. Hold "Ctrl" while clicking to collapse all groups '+section
- : 'Expand this group. Hold "Ctrl" while clicking to expand all groups '+section;
+ ? 'Collapse this group. Hold [Command] (Mac) or [Ctrl] (PC) while clicking to collapse all groups '+section
+ : 'Expand this group. Hold [Command] (Mac) or [Ctrl] (PC) while clicking to expand all groups '+section;
$('a.show_torrents_link', row).updateTooltip(tooltip);
$('a.show_torrents_link', row).raw().parentNode.className = (showing) ? 'hide_torrents' : 'show_torrents';
} else {
@@ -160,19 +165,28 @@ function toggle_edition(groupid, editionid, lnk, event) {
}
//var showing = has_class(nextElementSibling(clickedRow), 'hidden');
var showing = $(clickedRow).nextElementSibling().has_class('hidden');
- var allEditions = event.ctrlKey;
+ var allEditions = (event.ctrlKey || event.metaKey); // detect ctrl and cmd
+ // for dealing with Mac OS X
+ // http://stackoverflow.com/a/3922353
+ var allEditionsMac = (
+ event.keyCode == 91 // WebKit (left apple)
+ || event.keyCode == 93 // WebKit (right apple)
+ || event.keyCode == 224 // Firefox
+ || event.keyCode == 17 // Opera
+ ) ? true : null;
+
var group_rows = $('tr.groupid_' + groupid);
for (var i = 0; i < group_rows.results(); i++) {
var row = $(group_rows.raw(i));
if (row.has_class('edition') && (allEditions || row.raw(0) == clickedRow)) {
var tooltip = showing
- ? 'Collapse this edition. Hold "Ctrl" while clicking to collapse all editions in this torrent group.'
- : 'Expand this edition. Hold "Ctrl" while clicking to expand all editions in this torrent group.';
+ ? 'Collapse this edition. Hold [Command] (Mac) or [Ctrl] (PC) while clicking to collapse all editions in this torrent group.'
+ : 'Expand this edition. Hold [Command] (Mac) or [Ctrl] (PC) while clicking to expand all editions in this torrent group.';
$('a', row).raw().innerHTML = (showing) ? '−' : '+';
$('a', row).updateTooltip(tooltip);
continue;
}
- if (allEditions || row.has_class('edition_' + editionid)) {
+ if (allEditions || allEditionsMac || row.has_class('edition_' + editionid)) {
if (showing && !row.has_class('torrentdetails')) {
row.gshow();
} else {
@@ -282,4 +296,4 @@ function ToggleEditionRows() {
$('#edition_title').gtoggle();
$('#edition_label').gtoggle();
$('#edition_catalogue').gtoggle();
-}
+}
\ No newline at end of file