diff --git a/classes/debug.class.php b/classes/debug.class.php index f3437ec5..d7cc347d 100644 --- a/classes/debug.class.php +++ b/classes/debug.class.php @@ -314,7 +314,7 @@ public function perf_table($Perf = false) { ?> - +
View Performance stats:View Performance stats:
@@ -339,7 +339,7 @@ public function include_table($Includes = false) { ?> - +
View Includes:View Includes:
@@ -363,7 +363,7 @@ public function class_table($Classes = false) { ?> - +
View Classes:View Classes:
@@ -380,7 +380,7 @@ public function extension_table() { ?> - +
View Extensions:View Extensions:
@@ -403,7 +403,7 @@ public function flag_table($Flags = false) { ?> - +
View Flags:View Flags:
@@ -441,7 +441,7 @@ public function constant_table($Constants = false) { ?> - +
View Constants:View Constants:
@@ -469,14 +469,14 @@ public function cache_table($CacheKeys = false) { ?> - +
ViewView
@@ -1190,7 +1187,7 @@ function check_paranoia_here($Setting) { -

+ -
@@ -1279,7 +1276,7 @@ function check_paranoia_here($Setting) {

+ diff --git a/sections/userhistory/email_history2.php b/sections/userhistory/email_history2.php index 2fad3544..b6507693 100644 --- a/sections/userhistory/email_history2.php +++ b/sections/userhistory/email_history2.php @@ -255,7 +255,7 @@ ob_end_clean(); ?> - + @@ -312,7 +312,7 @@ } ?> - + diff --git a/sections/userhistory/ip_history.php b/sections/userhistory/ip_history.php index da78a5f5..5f635f74 100644 --- a/sections/userhistory/ip_history.php +++ b/sections/userhistory/ip_history.php @@ -41,7 +41,7 @@ ?> ( new torrent)   -    Catch up   Unsubscribe +    Catch up   Unsubscribe diff --git a/static/functions/ajax.class.js b/static/functions/ajax.class.js index 13923015..77ac7f1a 100644 --- a/static/functions/ajax.class.js +++ b/static/functions/ajax.class.js @@ -9,7 +9,7 @@ Example usage 1: ajax.handle = function () { $('#preview' + postid).raw().innerHTML = ajax.response; - $('#editbox' + postid).hide(); + $('#editbox' + postid).ghide(); } ajax.post("ajax.php?action=preview","#form-id" + postid); diff --git a/static/functions/artists.js b/static/functions/artists.js index f5e775cd..cb245511 100644 --- a/static/functions/artists.js +++ b/static/functions/artists.js @@ -2,50 +2,52 @@ var dragObjects = null; var dragObjectPlaceholder = null; function editOrdering() { - $('#editlayout').hide(); - $('#releasetypes').hide(); - $('#linkbox').hide(); - $('.sidebar').hide(); - $('.main_column > .box').hide(); // Artist info - $('.main_column > #requests').hide(); + $('#editlayout').ghide(); + $('#releasetypes').ghide(); + $('#linkbox').ghide(); + $('.sidebar').ghide(); + $('.main_column > .box').ghide(); // Artist info + $('.main_column > #requests').ghide(); - $('#savelayout').show(); - $('#emptylinkbox').show(); - $('#torrents_allopenclose').show(); + $('#savelayout').gshow(); + $('#emptylinkbox').gshow(); + $('#torrents_allopenclose').gshow(); dragObjects = new Array(); var elems = $('#torrents_tables table').objects; - for(i in elems) { + for (i in elems) { var elemID = elems[i].id; if (elemID == undefined) { continue; } if (elemID.indexOf('torrents_') == 0) { - $('#'+elemID).show(); + $('#' + elemID).gshow(); dragObjects[elemID] = new dragObject(elemID, elemID+'_handle', startDrag, moveDrag, endDrag); var classes = elems[i].className.split(' '); - for(var j=0; classes.length; j++) { + for (var j = 0; classes.length; j++) { if (classes[j].indexOf('releases_') == 0) { - $('.'+classes[j].replace('_table', '')).hide(); - $('.artist_editcol').show(); - $('.artist_normalcol').hide(); + $('.'+classes[j].replace('_table', '')).ghide(); + $('.artist_editcol').gshow(); + $('.artist_normalcol').ghide(); break; } } } } - for(i in dragObjects) { dragObjects[i].StartListening(); } + for (i in dragObjects) { + dragObjects[i].StartListening(); + } } function saveOrdering() { - $('#savelayout').hide(); - $('#savinglayout').show(); + $('#savelayout').ghide(); + $('#savinglayout').gshow(); var elems = $('#torrents_tables table').objects; var releaseTypes = "{"; - for(i in elems) { + for (i in elems) { var elemID = elems[i].id; var releaseType = null; if (elemID == undefined) { @@ -87,7 +89,7 @@ function saveOrderingCallback(response) { //Ordering in linkbox var prevOrderedLink = null; - for(releaseType in releaseTypes) { + for (releaseType in releaseTypes) { var elem = $('#torrents_' + releaseType + '_anchorlink').raw(); if (elem == undefined) { continue; @@ -102,7 +104,7 @@ function saveOrderingCallback(response) { //Now let's return to the non editing layout. var elems = $('#torrents_tables table').objects; - for(i in elems) { + for (i in elems) { var elemID = elems[i].id; if (elemID == undefined) { continue; @@ -110,45 +112,45 @@ function saveOrderingCallback(response) { if (elemID.indexOf('torrents_') == 0) { var classes = elems[i].className.split(' '); var empty = false; - for(var j=0; classes.length; j++) { + for (var j = 0; classes.length; j++) { if (classes[j] == null) { break; } if (classes[j].indexOf('releases_') == 0) { - $('.artist_editcol').hide(); - $('.artist_normalcol').show(); + $('.artist_editcol').ghide(); + $('.artist_normalcol').gshow(); } if (classes[j].indexOf('empty') == 0) { empty = true; } } if (empty) { - $('#'+elemID).hide(); + $('#' + elemID).ghide(); } } } - for(i in dragObjects) { + for (i in dragObjects) { dragObjects[i].StopListening(); } dragObjects = null; - $('#savinglayout').hide(); - $('#emptylinkbox').hide(); - $('#torrents_allopenclose').hide(); + $('#savinglayout').ghide(); + $('#emptylinkbox').ghide(); + $('#torrents_allopenclose').ghide(); - $('#editlayout').show(); - $('#releasetypes').show(); - $('#linkbox').show(); - $('.sidebar').show(); - $('.main_column > .box').show(); // Artist info - $('.main_column > #requests').show(); + $('#editlayout').gshow(); + $('#releasetypes').gshow(); + $('#linkbox').gshow(); + $('.sidebar').gshow(); + $('.main_column > .box').gshow(); // Artist info + $('.main_column > #requests').gshow(); } function setDefaultShow(id, show) { if (id == 'all') { var elems = $('#torrents_tables table').objects; - for(i in elems) { + for (i in elems) { var elemID = elems[i].id; var releaseType = null; if (elemID == undefined) { @@ -156,7 +158,7 @@ function setDefaultShow(id, show) { } if (elemID.indexOf('torrents_') == 0) { var classes = elems[i].className.split(' '); - for(var j=0; classes.length; j++) { + for (var j = 0; classes.length; j++) { if (classes[j] == null) { break; } @@ -168,25 +170,25 @@ function setDefaultShow(id, show) { setDefaultShow(releaseType, show); } } else if (show) { - $('#releases_'+id+'_openlink').hide(); - $('#releases_'+id+'_closedlink').show(); + $('#releases_'+id+'_openlink').ghide(); + $('#releases_'+id+'_closedlink').gshow(); $('#releases_'+id+'_defaultopen').raw().checked = 'checked'; } else { - $('#releases_'+id+'_openlink').show(); - $('#releases_'+id+'_closedlink').hide(); + $('#releases_'+id+'_openlink').gshow(); + $('#releases_'+id+'_closedlink').ghide(); $('#releases_'+id+'_defaultopen').raw().checked = ''; } } function setShow(id, show) { if (show) { - $('#releases_'+id+'_viewlink').hide(); - $('#releases_'+id+'_hidelink').show(); - $('.releases_'+id).show(); + $('#releases_'+id+'_viewlink').ghide(); + $('#releases_'+id+'_hidelink').gshow(); + $('.releases_'+id).gshow(); } else { - $('#releases_'+id+'_viewlink').show(); - $('#releases_'+id+'_hidelink').hide(); - $('.releases_'+id).hide(); + $('#releases_'+id+'_viewlink').gshow(); + $('#releases_'+id+'_hidelink').ghide(); + $('.releases_'+id).ghide(); } } @@ -215,7 +217,7 @@ function moveDrag(element) { var bestItem = 'END'; elems = element.parentNode.childNodes; - for(var i=0; i < elems.length; i++) { + for (var i = 0; i < elems.length; i++) { elem = elems[i]; if (elem == element || elem.nodeName != 'TABLE') { continue; diff --git a/static/functions/bbcode.js b/static/functions/bbcode.js index 4014e13c..09c34444 100644 --- a/static/functions/bbcode.js +++ b/static/functions/bbcode.js @@ -1,10 +1,10 @@ var BBCode = { spoiler: function(link) { if ($(link.nextSibling).has_class('hidden')) { - $(link.nextSibling).show(); + $(link.nextSibling).gshow(); $(link).html('Hide'); } else { - $(link.nextSibling).hide(); + $(link.nextSibling).ghide(); $(link).html('Show'); } } diff --git a/static/functions/browse.js b/static/functions/browse.js index a19965d6..7f64e424 100644 --- a/static/functions/browse.js +++ b/static/functions/browse.js @@ -1,80 +1,80 @@ function show_peers (TorrentID, Page) { if (Page > 0) { ajax.get('torrents.php?action=peerlist&page='+Page+'&torrentid=' + TorrentID,function(response) { - $('#peers_' + TorrentID).show().raw().innerHTML=response; + $('#peers_' + TorrentID).gshow().raw().innerHTML=response; }); } else { if ($('#peers_' + TorrentID).raw().innerHTML === '') { - $('#peers_' + TorrentID).show().raw().innerHTML = '

Loading...

'; + $('#peers_' + TorrentID).gshow().raw().innerHTML = '

Loading...

'; ajax.get('torrents.php?action=peerlist&torrentid=' + TorrentID,function(response) { - $('#peers_' + TorrentID).show().raw().innerHTML=response; + $('#peers_' + TorrentID).gshow().raw().innerHTML=response; }); } else { - $('#peers_' + TorrentID).toggle(); + $('#peers_' + TorrentID).gtoggle(); } } - $('#snatches_' + TorrentID).hide(); - $('#downloads_' + TorrentID).hide(); - $('#files_' + TorrentID).hide(); - $('#reported_' + TorrentID).hide(); + $('#snatches_' + TorrentID).ghide(); + $('#downloads_' + TorrentID).ghide(); + $('#files_' + TorrentID).ghide(); + $('#reported_' + TorrentID).ghide(); } function show_snatches (TorrentID, Page) { if (Page > 0) { ajax.get('torrents.php?action=snatchlist&page='+Page+'&torrentid=' + TorrentID,function(response) { - $('#snatches_' + TorrentID).show().raw().innerHTML=response; + $('#snatches_' + TorrentID).gshow().raw().innerHTML=response; }); } else { if ($('#snatches_' + TorrentID).raw().innerHTML === '') { - $('#snatches_' + TorrentID).show().raw().innerHTML = '

Loading...

'; + $('#snatches_' + TorrentID).gshow().raw().innerHTML = '

Loading...

'; ajax.get('torrents.php?action=snatchlist&torrentid=' + TorrentID,function(response) { - $('#snatches_' + TorrentID).show().raw().innerHTML=response; + $('#snatches_' + TorrentID).gshow().raw().innerHTML=response; }); } else { - $('#snatches_' + TorrentID).toggle(); + $('#snatches_' + TorrentID).gtoggle(); } } - $('#peers_' + TorrentID).hide(); - $('#downloads_' + TorrentID).hide(); - $('#files_' + TorrentID).hide(); - $('#reported_' + TorrentID).hide(); + $('#peers_' + TorrentID).ghide(); + $('#downloads_' + TorrentID).ghide(); + $('#files_' + TorrentID).ghide(); + $('#reported_' + TorrentID).ghide(); } function show_downloads (TorrentID, Page) { if (Page > 0) { ajax.get('torrents.php?action=downloadlist&page='+Page+'&torrentid=' + TorrentID,function(response) { - $('#downloads_' + TorrentID).show().raw().innerHTML=response; + $('#downloads_' + TorrentID).gshow().raw().innerHTML=response; }); } else { if ($('#downloads_' + TorrentID).raw().innerHTML === '') { - $('#downloads_' + TorrentID).show().raw().innerHTML = '

Loading...

'; + $('#downloads_' + TorrentID).gshow().raw().innerHTML = '

Loading...

'; ajax.get('torrents.php?action=downloadlist&torrentid=' + TorrentID,function(response) { $('#downloads_' + TorrentID).raw().innerHTML=response; }); } else { - $('#downloads_' + TorrentID).toggle(); + $('#downloads_' + TorrentID).gtoggle(); } } - $('#peers_' + TorrentID).hide(); - $('#snatches_' + TorrentID).hide(); - $('#files_' + TorrentID).hide(); - $('#reported_' + TorrentID).hide(); + $('#peers_' + TorrentID).ghide(); + $('#snatches_' + TorrentID).ghide(); + $('#files_' + TorrentID).ghide(); + $('#reported_' + TorrentID).ghide(); } function show_files(TorrentID) { - $('#files_' + TorrentID).toggle(); - $('#peers_' + TorrentID).hide(); - $('#snatches_' + TorrentID).hide(); - $('#downloads_' + TorrentID).hide(); - $('#reported_' + TorrentID).hide(); + $('#files_' + TorrentID).gtoggle(); + $('#peers_' + TorrentID).ghide(); + $('#snatches_' + TorrentID).ghide(); + $('#downloads_' + TorrentID).ghide(); + $('#reported_' + TorrentID).ghide(); } function show_reported(TorrentID) { - $('#files_' + TorrentID).hide(); - $('#peers_' + TorrentID).hide(); - $('#snatches_' + TorrentID).hide(); - $('#downloads_' + TorrentID).hide(); - $('#reported_' + TorrentID).toggle(); + $('#files_' + TorrentID).ghide(); + $('#peers_' + TorrentID).ghide(); + $('#snatches_' + TorrentID).ghide(); + $('#downloads_' + TorrentID).ghide(); + $('#reported_' + TorrentID).gtoggle(); } function add_tag(tag) { @@ -111,17 +111,17 @@ function toggle_group(groupid, link, event) { if (showing) { // show the row depending on whether the edition it's in is collapsed or not if (row.has_class('edition')) { - row.show(); + row.gshow(); showRow = ($('a', row.raw()).raw().innerHTML != '+'); } else { if (showRow) { - row.show(); + row.gshow(); } else { - row.hide(); + row.ghide(); } } } else { - row.hide(); + row.ghide(); } } } @@ -151,9 +151,9 @@ function toggle_edition(groupid, editionid, lnk, event) { } if (allEditions || row.has_class('edition_' + editionid)) { if (showing && !row.has_class('torrentdetails')) { - row.show(); + row.gshow(); } else { - row.hide(); + row.ghide(); } } } @@ -167,27 +167,27 @@ function toggle_edition(groupid, editionid, lnk, event) { function toggleTorrentSearch(mode) { if (mode == 0) { var link = $('#ft_toggle').raw(); - $('#ft_container').toggle(); + $('#ft_container').gtoggle(); link.innerHTML = link.textContent == 'Hide' ? 'Show' : 'Hide'; } if (mode == 'basic') { $('.fti_advanced').disable(); $('.fti_basic').enable(); - $('.ftr_advanced').hide(true); - $('.ftr_basic').show(); - $('#ft_advanced_link').show(); - $('#ft_advanced_text').hide(); - $('#ft_basic_link').hide(); - $('#ft_basic_text').show(); + $('.ftr_advanced').ghide(true); + $('.ftr_basic').gshow(); + $('#ft_advanced_link').gshow(); + $('#ft_advanced_text').ghide(); + $('#ft_basic_link').ghide(); + $('#ft_basic_text').gshow(); $('#ft_type').raw().value = 'basic'; } else if (mode == 'advanced') { $('.fti_advanced').enable(); $('.fti_basic').disable(); - $('.ftr_advanced').show(); - $('.ftr_basic').hide(); - $('#ft_advanced_link').hide(); - $('#ft_advanced_text').show(); - $('#ft_basic_link').show(); - $('#ft_basic_text').hide(); + $('.ftr_advanced').gshow(); + $('.ftr_basic').ghide(); + $('#ft_advanced_link').ghide(); + $('#ft_advanced_text').gshow(); + $('#ft_basic_link').gshow(); + $('#ft_basic_text').ghide(); $('#ft_type').raw().value = 'advanced'; } return false; @@ -197,9 +197,9 @@ function toggleTorrentSearch(mode) { function Bitrate() { $('#other_bitrate').raw().value = ''; if ($('#bitrate').raw().options[$('#bitrate').raw().selectedIndex].value == 'Other') { - $('#other_bitrate_span').show(); + $('#other_bitrate_span').gshow(); } else { - $('#other_bitrate_span').hide(); + $('#other_bitrate_span').ghide(); } } @@ -256,11 +256,10 @@ function addCoverField() { } } - function ToggleEditionRows() { - $('#edition_title').toggle(); - $('#edition_label').toggle(); - $('#edition_catalogue').toggle(); + $('#edition_title').gtoggle(); + $('#edition_label').gtoggle(); + $('#edition_catalogue').gtoggle(); } function check_private(TorrentID) { diff --git a/static/functions/collage.js b/static/functions/collage.js index 4786f253..b1740a90 100644 --- a/static/functions/collage.js +++ b/static/functions/collage.js @@ -65,10 +65,10 @@ var collageShow = { lists = $('.collage_images').objects; i = lists.length; while (i--) { - $(lists[i]).hide(); + $(lists[i]).ghide(); } - $(ul).show(); + $(ul).gshow(); if (s) { $(s).remove_class('selected'); } @@ -84,13 +84,13 @@ var collageShow = { } last = Math.min(first + 4, this.max); for (i = 0; i < first; i++) { - $('#pagelink' + i).hide(); + $('#pagelink' + i).ghide(); } for (i = first; i <= last; i++) { - $('#pagelink' + i).show(); + $('#pagelink' + i).gshow(); } for (i = last + 1; i <= this.max; i++) { - $('#pagelink' + i).hide(); + $('#pagelink' + i).ghide(); } // Toggle the first, prev, next, and last links @@ -117,9 +117,9 @@ var collageShow = { // Toggle the bar if ((last == this.max) && (this.pg != this.max)) { - $('#nextbar').show(); + $('#nextbar').gshow(); } else { - $('#nextbar').hide(); + $('#nextbar').ghide(); } }, nextPage:function() { diff --git a/static/functions/comments.js b/static/functions/comments.js index 17b37298..7e889531 100644 --- a/static/functions/comments.js +++ b/static/functions/comments.js @@ -38,7 +38,7 @@ function Edit_Form(post,key) { postid = post; //If no edit is already going underway or a previous edit was finished, make the necessary dom changes. if (!$('#editbox' + postid).objects[0] || $('#editbox' + postid + '.hidden').objects[0]) { - $('#reply_box').hide(); + $('#reply_box').ghide(); if (location.href.match(/torrents\.php/) || location.href.match(/artist\.php/)) { boxWidth="50"; @@ -74,7 +74,7 @@ function Edit_Form(post,key) { function Cancel_Edit(postid) { var answer = confirm("Are you sure you want to cancel?"); if (answer) { - $('#reply_box').show(); + $('#reply_box').gshow(); $('#bar' + postid).raw().innerHTML = $('#bar' + postid).raw().oldbar; $('#content' + postid).raw().innerHTML = $('#bar' + postid).raw().cancel; } @@ -84,48 +84,48 @@ function Preview_Edit(postid) { $('#bar' + postid).raw().innerHTML = ""; ajax.post("ajax.php?action=preview","form" + postid, function(response) { $('#preview' + postid).raw().innerHTML = response; - $('#editbox' + postid).hide(); + $('#editbox' + postid).ghide(); }); } function Cancel_Preview(postid) { $('#bar' + postid).raw().innerHTML = ""; $('#preview' + postid).raw().innerHTML = ""; - $('#editbox' + postid).show(); + $('#editbox' + postid).gshow(); } function Save_Edit(postid) { - $('#reply_box').show(); + $('#reply_box').gshow(); if (location.href.match(/forums\.php/)) { ajax.post("forums.php?action=takeedit","form" + postid, function (response) { $('#bar' + postid).raw().innerHTML = "Report "; $('#preview' + postid).raw().innerHTML = response; - $('#editbox' + postid).hide(); - $('#pmbox' + postid).hide(); + $('#editbox' + postid).ghide(); + $('#pmbox' + postid).ghide(); }); } else if (location.href.match(/collages?\.php/)) { ajax.post("collages.php?action=takeedit_comment","form" + postid, function (response) { $('#bar' + postid).raw().innerHTML = ""; $('#preview' + postid).raw().innerHTML = response; - $('#editbox' + postid).hide(); + $('#editbox' + postid).ghide(); }); } else if (location.href.match(/requests\.php/)) { ajax.post("requests.php?action=takeedit_comment","form" + postid, function (response) { $('#bar' + postid).raw().innerHTML = ""; $('#preview' + postid).raw().innerHTML = response; - $('#editbox' + postid).hide(); + $('#editbox' + postid).ghide(); }); } else if (location.href.match(/artist\.php/)) { ajax.post("artist.php?action=takeedit_post","form" + postid, function (response) { $('#bar' + postid).raw().innerHTML = ""; $('#preview' + postid).raw().innerHTML = response; - $('#editbox' + postid).hide(); + $('#editbox' + postid).ghide(); }); } else { ajax.post("torrents.php?action=takeedit_post","form" + postid, function (response) { $('#bar' + postid).raw().innerHTML = ""; $('#preview' + postid).raw().innerHTML = response; - $('#editbox' + postid).hide(); + $('#editbox' + postid).ghide(); }); } } @@ -135,23 +135,23 @@ function Delete(post) { if (confirm('Are you sure you wish to delete this post?') == true) { if (location.href.match(/forums\.php/)) { ajax.get("forums.php?action=delete&auth=" + authkey + "&postid=" + postid, function () { - $('#post' + postid).hide(); + $('#post' + postid).ghide(); }); } else if (location.href.match(/collages?\.php/)) { ajax.get("collages.php?action=delete_comment&auth=" + authkey + "&postid=" + postid, function () { - $('#post' + postid).hide(); + $('#post' + postid).ghide(); }); } else if (location.href.match(/requests\.php/)) { ajax.get("requests.php?action=delete_comment&auth=" + authkey + "&postid=" + postid, function () { - $('#post' + postid).hide(); + $('#post' + postid).ghide(); }); } else if (location.href.match(/artist\.php/)) { ajax.get("artist.php?action=delete_comment&auth="+authkey+ "&postid=" + postid, function () { - $('#post' + postid).hide(); + $('#post' + postid).ghide(); }); } else { ajax.get("torrents.php?action=delete_post&auth=" + authkey + "&postid=" + postid, function () { - $('#post' + postid).hide(); + $('#post' + postid).ghide(); }); } } @@ -162,9 +162,9 @@ function Quick_Preview() { $('#post_preview').raw().value = "Make changes"; $('#post_preview').raw().preview = true; ajax.post("ajax.php?action=preview","quickpostform", function(response) { - $('#quickreplypreview').show(); + $('#quickreplypreview').gshow(); $('#contentpreview').raw().innerHTML = response; - $('#quickreplytext').hide(); + $('#quickreplytext').ghide(); }); } @@ -172,13 +172,13 @@ function Quick_Edit() { var quickreplybuttons; $('#post_preview').raw().value = "Preview"; $('#post_preview').raw().preview = false; - $('#quickreplypreview').hide(); - $('#quickreplytext').show(); + $('#quickreplypreview').ghide(); + $('#quickreplytext').gshow(); } function Newthread_Preview(mode) { - $('#newthreadpreviewbutton').toggle(); - $('#newthreadeditbutton').toggle(); + $('#newthreadpreviewbutton').gtoggle(); + $('#newthreadeditbutton').gtoggle(); if (mode) { // Preview ajax.post("ajax.php?action=preview","newthreadform", function(response) { $('#contentpreview').raw().innerHTML = response; @@ -205,11 +205,11 @@ function Newthread_Preview(mode) { $('#pollanswers').raw().appendChild(document.createElement('br')); } if ($('#pollanswers').raw().children.length > 4) { - $('#pollpreview').show(); + $('#pollpreview').gshow(); } } } else { // Back to editor - $('#pollpreview').hide(); + $('#pollpreview').ghide(); $('#newthreadtitle').raw().innerHTML = 'New Topic'; var pollanswers = $('#pollanswers').raw(); if (pollanswers) { @@ -218,9 +218,9 @@ function Newthread_Preview(mode) { pollanswers.parentNode.replaceChild(el, pollanswers); } } - $('#newthreadtext').toggle(); - $('#newthreadpreview').toggle(); - $('#subscribediv').toggle(); + $('#newthreadtext').gtoggle(); + $('#newthreadpreview').gtoggle(); + $('#subscribediv').gtoggle(); } function LoadEdit(type, post, depth) { diff --git a/static/functions/global.js b/static/functions/global.js index 417fd1a4..09fe4360 100644 --- a/static/functions/global.js +++ b/static/functions/global.js @@ -21,9 +21,9 @@ function toggleChecks(formElem,masterElem) { var lightbox = { init: function (image, size) { if (typeof(image) == 'string') { - $('#lightbox').show().listen('click',lightbox.unbox).raw().innerHTML = + $('#lightbox').gshow().listen('click',lightbox.unbox).raw().innerHTML = '

Loading...

'; - $('#curtain').show().listen('click',lightbox.unbox); + $('#curtain').gshow().listen('click',lightbox.unbox); var src = image; image = new Image(); image.onload = function() { @@ -48,8 +48,8 @@ var lightbox = { hasA = true; } if (!hasA) { - $('#lightbox').show().listen('click',lightbox.unbox).raw().innerHTML = ''; - $('#curtain').show().listen('click',lightbox.unbox); + $('#lightbox').gshow().listen('click',lightbox.unbox).raw().innerHTML = ''; + $('#curtain').gshow().listen('click',lightbox.unbox); } }, box_async: function (image) { @@ -58,12 +58,12 @@ var lightbox = { hasA = true; } if (!hasA) { - $('#lightbox').raw().innerHTML = ''; + $('#lightbox').raw().innerHTML = ''; } }, unbox: function (data) { - $('#curtain').hide(); - $('#lightbox').hide().raw().innerHTML = ''; + $('#curtain').ghide(); + $('#lightbox').ghide().raw().innerHTML = ''; } }; @@ -79,7 +79,7 @@ function caps_check(e) { return; } if ((e.which > 64 && e.which < 91 && !e.shiftKey) || (e.which > 96 && e.which < 123 && e.shiftKey)) { - $('#capslock').show(); + $('#capslock').gshow(); } } */ diff --git a/static/functions/inbox.js b/static/functions/inbox.js index 19f60393..6bcc78c5 100644 --- a/static/functions/inbox.js +++ b/static/functions/inbox.js @@ -3,14 +3,14 @@ function Quick_Preview() { $('#buttons').raw().innerHTML = ""; ajax.post("ajax.php?action=preview","messageform", function(response) { - $('#quickpost').hide(); + $('#quickpost').ghide(); $('#preview').raw().innerHTML = response; - $('#preview').show(); + $('#preview').gshow(); }); } function Quick_Edit() { $('#buttons').raw().innerHTML = ""; - $('#preview').hide(); - $('#quickpost').show(); + $('#preview').ghide(); + $('#quickpost').gshow(); } diff --git a/static/functions/release_sort.js b/static/functions/release_sort.js index bc8103d3..8f077fd2 100644 --- a/static/functions/release_sort.js +++ b/static/functions/release_sort.js @@ -1,7 +1,7 @@ -//Couldn't use an associative array because javascript sorting is stupid http://dev-answers.blogspot.com/2012/03/javascript-object-keys-being-sorted-in.html +//Couldn't use an associative array because JavaScript sorting is stupid http://dev-answers.blogspot.com/2012/03/javascript-object-keys-being-sorted-in.html jQuery(document).ready(function ($) { - var serialize = function () { + var serialize = function () { var a = []; $('#sortable input').each(function () { a.push($(this).attr('id')); diff --git a/static/functions/requests.js b/static/functions/requests.js index 8f7e2169..a9b0ce6a 100644 --- a/static/functions/requests.js +++ b/static/functions/requests.js @@ -122,32 +122,32 @@ function RemoveArtistField() { function Categories() { var cat = $('#categories').raw().options[$('#categories').raw().selectedIndex].value; if (cat == "Music") { - $('#artist_tr').show(); - $('#releasetypes_tr').show(); - $('#formats_tr').show(); - $('#bitrates_tr').show(); - $('#media_tr').show(); + $('#artist_tr').gshow(); + $('#releasetypes_tr').gshow(); + $('#formats_tr').gshow(); + $('#bitrates_tr').gshow(); + $('#media_tr').gshow(); ToggleLogCue(); - $('#year_tr').show(); - $('#cataloguenumber_tr').show(); + $('#year_tr').gshow(); + $('#cataloguenumber_tr').gshow(); } else if (cat == "Audiobooks" || cat == "Comedy") { - $('#year_tr').show(); - $('#artist_tr').hide(); - $('#releasetypes_tr').hide(); - $('#formats_tr').hide(); - $('#bitrates_tr').hide(); - $('#media_tr').hide(); - $('#logcue_tr').hide(); - $('#cataloguenumber_tr').hide(); + $('#year_tr').gshow(); + $('#artist_tr').ghide(); + $('#releasetypes_tr').ghide(); + $('#formats_tr').ghide(); + $('#bitrates_tr').ghide(); + $('#media_tr').ghide(); + $('#logcue_tr').ghide(); + $('#cataloguenumber_tr').ghide(); } else { - $('#artist_tr').hide(); - $('#releasetypes_tr').hide(); - $('#formats_tr').hide(); - $('#bitrates_tr').hide(); - $('#media_tr').hide(); - $('#logcue_tr').hide(); - $('#year_tr').hide(); - $('#cataloguenumber_tr').hide(); + $('#artist_tr').ghide(); + $('#releasetypes_tr').ghide(); + $('#formats_tr').ghide(); + $('#bitrates_tr').ghide(); + $('#media_tr').ghide(); + $('#logcue_tr').ghide(); + $('#year_tr').ghide(); + $('#cataloguenumber_tr').ghide(); } } @@ -184,17 +184,17 @@ function ToggleLogCue() { } if (flac) { - $('#logcue_tr').show(); + $('#logcue_tr').gshow(); } else { - $('#logcue_tr').hide(); + $('#logcue_tr').ghide(); } ToggleLogScore(); } function ToggleLogScore() { if ($('#needlog').raw().checked) { - $('#minlogscore_span').show(); + $('#minlogscore_span').gshow(); } else { - $('#minlogscore_span').hide(); + $('#minlogscore_span').ghide(); } } diff --git a/static/functions/script_start.js b/static/functions/script_start.js index 695e3cdc..b0e16d29 100644 --- a/static/functions/script_start.js +++ b/static/functions/script_start.js @@ -177,9 +177,15 @@ util.fn = util.prototype = { show: function () { return this.remove_class('hidden'); }, + gshow: function () { + return this.remove_class('hidden'); + }, hide: function (force) { return this.add_class('hidden', force); }, + ghide: function (force) { + return this.add_class('hidden', force); + }, toggle: function (force) { //Should we interate and invert all entries, or just go by the first? if (!in_array('hidden', this.objects[0].className.split(' '))) { @@ -189,6 +195,15 @@ util.fn = util.prototype = { } return this; }, + gtoggle: function (force) { + //Should we interate and invert all entries, or just go by the first? + if (!in_array('hidden', this.objects[0].className.split(' '))) { + this.add_class('hidden', force); + } else { + this.remove_class('hidden'); + } + return this; + }, listen: function (event, callback) { for (var i = 0, il = this.objects.length; i < il; i++) { var object = this.objects[i]; diff --git a/static/functions/staffpm.js b/static/functions/staffpm.js index 2d9ba280..2e8d6897 100644 --- a/static/functions/staffpm.js +++ b/static/functions/staffpm.js @@ -3,7 +3,7 @@ function SetMessage() { ajax.get("?action=get_response&plain=1&id=" + id, function (data) { $('#quickpost').raw().value = data; - $('#common_answers').hide(); + $('#common_answers').ghide(); }); } @@ -32,8 +32,8 @@ function SaveMessage(id) { } else { document.getElementById(ajax_message).textContent = 'Something went wrong.'; } - $('#' + ajax_message).show(); - var t = setTimeout("$('#" + ajax_message + "').hide()", 2000); + $('#' + ajax_message).gshow(); + var t = setTimeout("$('#" + ajax_message + "').ghide()", 2000); } ); } @@ -46,14 +46,14 @@ function DeleteMessage(id) { ToPost['id'] = id; ajax.post("?action=delete_response", ToPost, function (data) { - $(div).hide(); + $(div).ghide(); if (data == '1') { document.getElementById(ajax_message).textContent = 'Response successfully deleted.'; } else { document.getElementById(ajax_message).textContent = 'Something went wrong.'; } - $('#'+ajax_message).show(); - var t = setTimeout("$('#" + ajax_message + "').hide()", 2000); + $('#'+ajax_message).gshow(); + var t = setTimeout("$('#" + ajax_message + "').ghide()", 2000); }); } @@ -68,8 +68,8 @@ function Assign() { } else { document.getElementById('ajax_message').textContent = 'Something went wrong.'; } - $('#ajax_message').show(); - var t = setTimeout("$('#ajax_message').hide()", 2000); + $('#ajax_message').gshow(); + var t = setTimeout("$('#ajax_message').ghide()", 2000); }); } @@ -80,12 +80,12 @@ function PreviewResponse(id) { ToPost['message'] = document.getElementById('response_message_'+id).value; ajax.post('?action=preview', ToPost, function (data) { document.getElementById('response_div_'+id).innerHTML = data; - $(div).toggle(); - $('#response_message_'+id).toggle(); + $(div).gtoggle(); + $('#response_message_'+id).gtoggle(); }); } else { - $(div).toggle(); - $('#response_message_'+id).toggle(); + $(div).gtoggle(); + $('#response_message_'+id).gtoggle(); } } @@ -95,13 +95,13 @@ function PreviewMessage() { ToPost['message'] = document.getElementById('quickpost').value; ajax.post('?action=preview', ToPost, function (data) { document.getElementById('preview').innerHTML = data; - $('#preview').toggle(); - $('#quickpost').toggle(); + $('#preview').gtoggle(); + $('#quickpost').gtoggle(); $('#previewbtn').raw().value = "Edit"; }); } else { - $('#preview').toggle(); - $('#quickpost').toggle(); + $('#preview').gtoggle(); + $('#quickpost').gtoggle(); $('#previewbtn').raw().value = "Preview"; } } diff --git a/static/functions/subscriptions.js b/static/functions/subscriptions.js index 9f7749a6..d7ef72a4 100644 --- a/static/functions/subscriptions.js +++ b/static/functions/subscriptions.js @@ -20,7 +20,7 @@ function Collapse() { var collapseLink = $('#collapselink').raw(); var hide = (collapseLink.innerHTML.substr(0,1) == 'H' ? 1 : 0); if ($('.row').results() > 0) { - $('.row').toggle(); + $('.row').gtoggle(); } if (hide) { collapseLink.innerHTML = 'Show post bodies'; diff --git a/static/functions/torrent.js b/static/functions/torrent.js index 0db15398..244eb400 100644 --- a/static/functions/torrent.js +++ b/static/functions/torrent.js @@ -1,16 +1,16 @@ function ChangeCategory(catid) { if (catid == 1) { - $('#split_releasetype').show(); - $('#split_artist').show(); - $('#split_year').show(); + $('#split_releasetype').gshow(); + $('#split_artist').gshow(); + $('#split_year').gshow(); } else if (catid == 4 || catid == 6) { - $('#split_releasetype').hide(); - $('#split_year').show(); - $('#split_artist').hide(); + $('#split_releasetype').ghide(); + $('#split_year').gshow(); + $('#split_artist').ghide(); } else { - $('#split_releasetype').hide(); - $('#split_artist').hide(); - $('#split_year').hide(); + $('#split_releasetype').ghide(); + $('#split_artist').ghide(); + $('#split_year').ghide(); } } @@ -25,8 +25,8 @@ function ArtistManager() { if (!(ArtistList = $('#artist_list').raw())) { return false; } else if ($('#artistmanager').raw()) { - $('#artistmanager').toggle(); - $('#artist_list').toggle(); + $('#artistmanager').gtoggle(); + $('#artist_list').gtoggle(); } else { MainArtistCount = 0; var elArtistManager = document.createElement('div'); @@ -156,7 +156,7 @@ function ArtistManager() { elArtistForm.appendChild(elSubmitDiv); elArtistManager.appendChild(elArtistForm); ArtistList.parentNode.appendChild(elArtistManager); - $('#artist_list').hide(); + $('#artist_list').ghide(); } } @@ -267,10 +267,10 @@ function DownVoteGroup(groupid, authkey) { } } ); - $('#vote_message').hide(); - $('#unvote_message').show(); - $('#upvoted').hide(); - $('#downvoted').show(); + $('#vote_message').ghide(); + $('#unvote_message').gshow(); + $('#upvoted').ghide(); + $('#downvoted').gshow(); voteLock = false; } @@ -289,10 +289,10 @@ function UpVoteGroup(groupid, authkey) { } } ); - $('#vote_message').hide(); - $('#unvote_message').show(); - $('#upvoted').show(); - $('#downvoted').hide(); + $('#vote_message').ghide(); + $('#unvote_message').gshow(); + $('#upvoted').gshow(); + $('#downvoted').ghide(); voteLock = false; } @@ -312,9 +312,9 @@ function UnvoteGroup(groupid, authkey) { } } ); - $('#vote_message').show(); - $('#unvote_message').hide(); - $('#upvoted').hide(); - $('#downvoted').hide(); + $('#vote_message').gshow(); + $('#unvote_message').ghide(); + $('#upvoted').ghide(); + $('#downvoted').ghide(); voteLock = false; } diff --git a/static/functions/upload.js b/static/functions/upload.js index dc817d39..d1118863 100644 --- a/static/functions/upload.js +++ b/static/functions/upload.js @@ -8,9 +8,9 @@ function Categories() { function Remaster() { if ($('#remaster').raw().checked) { - $('#remaster_true').show(); + $('#remaster_true').gshow(); } else { - $('#remaster_true').hide(); + $('#remaster_true').ghide(); } } @@ -22,11 +22,11 @@ function Format() { $('#bitrate').raw()[i].selected = true; } } - $('#upload_logs').show(); - $('#other_bitrate_span').hide(); + $('#upload_logs').gshow(); + $('#other_bitrate_span').ghide(); } else { $('#bitrate').raw()[0].selected = true; - $('#upload_logs').hide(); + $('#upload_logs').ghide(); } if ($('#format').raw().options[$('#format').raw().selectedIndex].value == 'AAC') { @@ -39,9 +39,9 @@ function Format() { function Bitrate() { $('#other_bitrate').raw().value = ''; if ($('#bitrate').raw().options[$('#bitrate').raw().selectedIndex].value == 'Other') { - $('#other_bitrate_span').show(); + $('#other_bitrate_span').gshow(); } else { - $('#other_bitrate_span').hide(); + $('#other_bitrate_span').ghide(); } } @@ -251,9 +251,9 @@ function RemoveArtistField() { function CheckVA () { if ($('#artist').raw().value.toLowerCase().trim().match(/^(va|various(\sa|a)rtis(t|ts)|various)$/)) { - $('#vawarning').show(); + $('#vawarning').gshow(); } else { - $('#vawarning').hide(); + $('#vawarning').ghide(); } } @@ -264,15 +264,15 @@ function CheckYear() { } var x = $('#year').raw(); if (x.value < 1982 && x.value != '' && media != "old" && !$('#unknown').raw().checked) { - $('#yearwarning').show(); + $('#yearwarning').gshow(); $('#remaster').raw().checked = true; - $('#remaster_true').show(); + $('#remaster_true').gshow(); } else if ($('#unknown').raw().checked) { $('#remaster').raw().checked = true; - $('#yearwarning').hide(); - $('#remaster_true').show(); + $('#yearwarning').ghide(); + $('#remaster_true').gshow(); } else { - $('#yearwarning').hide(); + $('#yearwarning').ghide(); } } diff --git a/static/functions/user.js b/static/functions/user.js index fb3337b5..eb343be0 100644 --- a/static/functions/user.js +++ b/static/functions/user.js @@ -1,7 +1,7 @@ function ChangeTo(to) { if (to == "text") { - $('#admincommentlinks').hide(); - $('#admincomment').show(); + $('#admincommentlinks').ghide(); + $('#admincomment').gshow(); resize('admincomment'); var buttons = document.getElementsByName('admincommentbutton'); for (var i = 0; i < buttons.length; i++) { @@ -10,8 +10,8 @@ function ChangeTo(to) { } else if (to == "links") { ajax.post("ajax.php?action=preview","form", function(response) { $('#admincommentlinks').raw().innerHTML = response; - $('#admincomment').hide(); - $('#admincommentlinks').show(); + $('#admincomment').ghide(); + $('#admincommentlinks').gshow(); var buttons = document.getElementsByName('admincommentbutton'); for (var i = 0; i < buttons.length; i++) { buttons[i].setAttribute('onclick',"ChangeTo('text'); return false;"); @@ -138,10 +138,10 @@ addDOMLoadEvent(AlterParanoia); function ToggleWarningAdjust(selector) { if (selector.options[selector.selectedIndex].value == '---') { - $('#ReduceWarningTR').show(); + $('#ReduceWarningTR').gshow(); $('#ReduceWarning').raw().disabled = false; } else { - $('#ReduceWarningTR').hide(); + $('#ReduceWarningTR').ghide(); $('#ReduceWarning').raw().disabled = true; } } @@ -150,9 +150,9 @@ addDOMLoadEvent(ToggleIdenticons); function ToggleIdenticons() { var selected = $('#disableavatars').raw().selectedIndex; if (selected == 2 || selected == 3) { - $('#identicons').show(); + $('#identicons').gshow(); } else { - $('#identicons').hide(); + $('#identicons').ghide(); } } @@ -172,4 +172,50 @@ function togglePassKey(key) { $('#passkey').raw().innerHTML = 'View'; } -} \ No newline at end of file +} + +function commStats(userid) { + $('.user_commstats').html('Loading...'); + ajax.get('ajax.php?action=community_stats&userid=' + userid, function(JSONresponse) { + var response = JSON.parse(JSONresponse) || false; + if (!response || response.status == 'failure') { + $('.user_commstats').html('An error occured'); + return; + } + displayCommStats(response.response); + }); +} + +function displayCommStats(stats) { + var baseid = '#user_commstats_'; + for (x in stats) { + if (stats[x] === false) { + continue; + } + switch (x) { + case 'leeching': + $(baseid + x).html(stats[x]); + break; + case 'seeding': + $(baseid + x).html(stats[x]); + break; + case 'downloaded': + $(baseid + x).html(stats[x]); + break; + case 'snatched': + $(baseid + x).html(stats[x]); + break; + case 'usnatched': + $(baseid + x).html('(' + stats[x] + ')'); + break; + case 'udownloaded': + $(baseid + x).html('(' + stats[x] + ')'); + break; + case 'seedingperc': + if (stats[x] !== -1) { + $(baseid + x).html('(' + stats[x] + '%)'); + } + break; + } + } +} diff --git a/static/functions/voting.js b/static/functions/voting.js index 7db5f227..6e5f8eff 100644 --- a/static/functions/voting.js +++ b/static/functions/voting.js @@ -5,10 +5,10 @@ function DownVoteGroup(groupid, authkey) { } voteLock = true; ajax.get('ajax.php?action=votefavorite&do=vote&groupid='+groupid+'&vote=down'+'&auth='+authkey, function (response) {return}); - $('.vote_link_'+groupid).hide(); - $('.vote_clear_'+groupid).show(); - $('.voted_down_'+groupid).show(); - $('.voted_up_'+groupid).hide(); + $('.vote_link_'+groupid).ghide(); + $('.vote_clear_'+groupid).gshow(); + $('.voted_down_'+groupid).gshow(); + $('.voted_up_'+groupid).ghide(); voteLock = false; } @@ -18,10 +18,10 @@ function UpVoteGroup(groupid, authkey) { } voteLock = true; ajax.get('ajax.php?action=votefavorite&do=vote&groupid='+groupid+'&vote=up'+'&auth='+authkey, function (response) {return}); - $('.vote_link_'+groupid).hide(); - $('.vote_clear_'+groupid).show(); - $('.voted_down_'+groupid).hide(); - $('.voted_up_'+groupid).show(); + $('.vote_link_'+groupid).ghide(); + $('.vote_clear_'+groupid).gshow(); + $('.voted_down_'+groupid).ghide(); + $('.voted_up_'+groupid).gshow(); voteLock = false; } @@ -31,9 +31,9 @@ function UnvoteGroup(groupid, authkey) { } voteLock = true; ajax.get('ajax.php?action=votefavorite&do=unvote&groupid='+groupid+'&auth='+authkey, function (response) {return}); - $('.vote_link_'+groupid).show(); - $('.vote_clear_'+groupid).hide(); - $('.voted_down_'+groupid).hide(); - $('.voted_up_'+groupid).hide(); + $('.vote_link_'+groupid).gshow(); + $('.vote_clear_'+groupid).ghide(); + $('.voted_down_'+groupid).ghide(); + $('.voted_up_'+groupid).ghide(); voteLock = false; -} \ No newline at end of file +} diff --git a/static/functions/wiki.js b/static/functions/wiki.js index fce3537d..fe27a9b4 100644 --- a/static/functions/wiki.js +++ b/static/functions/wiki.js @@ -1,5 +1,5 @@ function Remove_Alias(alias) { ajax.get("wiki.php?action=delete_alias&auth=" + authkey + "&alias=" + alias, function(response) { - $('#alias_' + alias).hide(); + $('#alias_' + alias).ghide(); }); } diff --git a/static/styles/dark_ambient/style.css b/static/styles/dark_ambient/style.css index 09f4bf36..65867b5c 100644 --- a/static/styles/dark_ambient/style.css +++ b/static/styles/dark_ambient/style.css @@ -73,7 +73,7 @@ a img { #footer p { float: left; - width: 120px; + width: 130px; height: 50px; border-right: 1px solid #4f4f4f; margin: 0 0 0 20px;

0) ? ' ('.$MatchCount.')' : '')?> 0) ? ' ('.$MatchCount.')' : '')?>
0) ? ' ('.$MatchCount.')' : '')?> 0) ? ' ('.$MatchCount.')' : '')?> Never