diff --git a/classes/notificationsmanager.class.php b/classes/notificationsmanager.class.php index 74d01a32..7ed25383 100644 --- a/classes/notificationsmanager.class.php +++ b/classes/notificationsmanager.class.php @@ -333,7 +333,7 @@ public function load_staff_pms() { } if ($NewStaffPMs > 0) { - $Title = 'You have new ' . ($NewStaffPMs == 1 ? 'a' : $NewStaffPMs) . ' Staff PM' . ($NewStaffPMs > 1 ? 's' : ''); + $Title = 'You have ' . ($NewStaffPMs == 1 ? 'a' : $NewStaffPMs) . ' new Staff PM' . ($NewStaffPMs > 1 ? 's' : ''); $this->create_notification(self::STAFFPM, 0, $Title, 'staffpm.php', self::INFO); } } diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index b0d441a1..6e38da33 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -1,5 +1,14 @@ CHANGE LOG +2014-01-18 by alderaan +Fix grammar in pop-up notifications about new Staff PMs. + +2014-01-18 by flaming +Rename "Unrelated Ebooks" torrent report type to "Ebook Collection". + +2014-01-18 by alderaan +Rename the "Dismiss" button to "Hide" for pop-up notifications. + 2014-01-05 by Ajax Wildcard searches in IP history diff --git a/sections/reportsv2/array.php b/sections/reportsv2/array.php index 7f13f6b6..8e70a244 100644 --- a/sections/reportsv2/array.php +++ b/sections/reportsv2/array.php @@ -818,7 +818,7 @@ 'unrelated' => array( 'priority' => '270', 'reason' => '-1', - 'title' => 'Unrelated Ebooks', + 'title' => 'Ebook Collection', 'report_messages' => array( 'Please include as much information as possible to verify the report.' ), diff --git a/static/functions/ajax.class.js b/static/functions/ajax.class.js index 52d74495..59778933 100644 --- a/static/functions/ajax.class.js +++ b/static/functions/ajax.class.js @@ -145,7 +145,7 @@ function Unbookmark(type, id, newName) { $('.groupid_' + id).remove(); $('.bookmark_' + id).remove(); }); - } else if (window.location.pathname.indexOf('top10.php') != -1 || window.location.search.indexOf('?action=notify') != -1) { + } else if (window.location.pathname.indexOf('top10.php') != -1 || window.location.search.indexOf('?action=notify') != -1) { var oldName = $('#bookmarklink_' + type + '_' + id).raw().innerHTML; ajax.get("bookmarks.php?action=remove&type=" + type + "&auth=" + authkey + "&id=" + id, function() { var bookmarklinks = $('#bookmarklink_' + type + '_' + id); diff --git a/static/functions/collage.js b/static/functions/collage.js index 7fcca5e6..4f4b6753 100644 --- a/static/functions/collage.js +++ b/static/functions/collage.js @@ -93,7 +93,7 @@ var collageShow = { if (this.max - this.pg < 2) { first = Math.max(this.max - 4, 0); } - last = Math.min(first + 4, this.max); + last = Math.min(first + 4, this.max); for (i = 0; i < first; i++) { $('#pagelink' + i).ghide(); } @@ -134,7 +134,7 @@ var collageShow = { } }, nextPage:function() { - this.pg = this.pg < this.max ? this.pg + 1 : this.pg; + this.pg = this.pg < this.max ? this.pg + 1 : this.pg; this.pager(); }, prevPage:function() { diff --git a/static/functions/global.js b/static/functions/global.js index d4053ea9..e3e7d3ce 100644 --- a/static/functions/global.js +++ b/static/functions/global.js @@ -6,9 +6,9 @@ function toggleChecks(formElem, masterElem, elemSelector) { elemSelector = elemSelector || 'input:checkbox'; if (masterElem) { - $('#'+formElem+' '+elemSelector).prop('checked', masterElem.checked); + $('#' + formElem + ' ' + elemSelector).prop('checked', masterElem.checked); } else { - $('#'+formElem+' '+elemSelector).each(function() { + $('#' + formElem + ' ' + elemSelector).each(function() { this.checked = !this.checked; }) } @@ -17,16 +17,16 @@ function toggleChecks(formElem, masterElem, elemSelector) { //Lightbox stuff /* - * If loading from a thumbnail, the lightbox is shown first with a "loading" screen - * while the full size image loads, then the HTML of the lightbox is replaced with the image. + * If loading from a thumbnail, the lightbox is shown first with a "loading" screen + * while the full size image loads, then the HTML of the lightbox is replaced with the image. */ var lightbox = { init: function (image, size) { if (typeof(image) == 'string') { - $('#lightbox').gshow().listen('click',lightbox.unbox).raw().innerHTML = + $('#lightbox').gshow().listen('click', lightbox.unbox).raw().innerHTML = '

Loading...

'; - $('#curtain').gshow().listen('click',lightbox.unbox); + $('#curtain').gshow().listen('click', lightbox.unbox); var src = image; image = new Image(); image.onload = function() { @@ -51,8 +51,8 @@ var lightbox = { hasA = true; } if (!hasA) { - $('#lightbox').gshow().listen('click',lightbox.unbox).raw().innerHTML = ''; - $('#curtain').gshow().listen('click',lightbox.unbox); + $('#lightbox').gshow().listen('click', lightbox.unbox).raw().innerHTML = ''; + $('#curtain').gshow().listen('click', lightbox.unbox); } }, box_async: function (image) { @@ -81,7 +81,7 @@ function caps_check(e) { if (e.which > 47 && e.which < 58) { return; } - if ((e.which > 64 && e.which < 91 && !e.shiftKey) || (e.which > 96 && e.which < 123 && e.shiftKey)) { + if ((e.which > 64 && e.which < 91 && !e.shiftKey) || (e.which > 96 && e.which < 123 && e.shiftKey)) { $('#capslock').gshow(); } } @@ -112,9 +112,9 @@ function add_selection() { if (selected.disabled === false) { var listitem = document.createElement("li"); listitem.id = 'list' + selected.value; - listitem.innerHTML = ' ' + -' '+selected.innerHTML+'' + -' X' + + listitem.innerHTML = ' ' + +' ' + selected.innerHTML + '' + +' X' + '
'; $('#list').raw().appendChild(listitem); $('#opt' + selected.value).raw().disabled = true; @@ -123,20 +123,20 @@ function add_selection() { function remove_selection(index) { $('#list' + index).remove(); - $('#opt' + index).raw().disabled=''; + $('#opt' + index).raw().disabled = ''; } // Thank you http://stackoverflow.com/questions/4578398/selecting-all-text-within-a-div-on-a-single-left-click-with-javascript function select_all(el) { - if (typeof window.getSelection != "undefined" && typeof document.createRange != "undefined") { - var range = document.createRange(); - range.selectNodeContents(el); - var sel = window.getSelection(); - sel.removeAllRanges(); - sel.addRange(range); - } else if (typeof document.selection != "undefined" && typeof document.body.createTextRange != "undefined") { - var textRange = document.body.createTextRange(); - textRange.moveToElementText(el); - textRange.select(); - } + if (typeof window.getSelection != "undefined" && typeof document.createRange != "undefined") { + var range = document.createRange(); + range.selectNodeContents(el); + var sel = window.getSelection(); + sel.removeAllRanges(); + sel.addRange(range); + } else if (typeof document.selection != "undefined" && typeof document.body.createTextRange != "undefined") { + var textRange = document.body.createTextRange(); + textRange.moveToElementText(el); + textRange.select(); + } } diff --git a/static/functions/jquery.datetimepicker.js b/static/functions/jquery.datetimepicker.js index 17e5fcd2..6efd158e 100644 --- a/static/functions/jquery.datetimepicker.js +++ b/static/functions/jquery.datetimepicker.js @@ -98,11 +98,11 @@ event.preventDefault(); }; }); - timeboxparent.on('touchend touchcancel',function( event ){ + timeboxparent.on('touchend touchcancel', function(event){ start = false; }); } - timeboxparent.trigger('resize_scroll.xdsoft_scroller',[_percent]); + timeboxparent.trigger('resize_scroll.xdsoft_scroller', [_percent]); }); }; $.fn.datetimepicker = function( opt ){ @@ -127,7 +127,7 @@ ZKEY = 90, YKEY = 89, ctrlDown = false, - default_options = { + default_options = { i18n:{ ru:{ months:[ @@ -543,13 +543,13 @@ stop = false; (function(v){ - var month = _xdsoft_datetime.currentTime.getMonth(); + var month = _xdsoft_datetime.currentTime.getMonth(); if( $this.hasClass( options.next ) ){ _xdsoft_datetime.nextMonth(); }else if( $this.hasClass( options.prev ) ){ _xdsoft_datetime.prevMonth(); } - !stop&&(timer = setTimeout(arguments.callee,v?v:100)); + !stop && (timer = setTimeout(arguments.callee, v ? v : 100)); })(500); $([document.body,window]).on('mouseup.xdsoft',function(){ @@ -572,7 +572,7 @@ top = Math.abs(parseInt(timebox.css('marginTop'))); if( $this.hasClass(options.next) && (height-pheight)- options.timeHeightInTimePicker>=top ){ timebox.css('marginTop','-'+(top+options.timeHeightInTimePicker)+'px') - }else if( $this.hasClass(options.prev) && top-options.timeHeightInTimePicker>=0 ){ + }else if( $this.hasClass(options.prev) && top-options.timeHeightInTimePicker>=0 ){ timebox.css('marginTop','-'+(top-options.timeHeightInTimePicker)+'px') } timeboxparent.trigger('scroll_element.xdsoft_scroller',[Math.abs(parseInt(timebox.css('marginTop'))/(height-pheight))]); diff --git a/static/functions/multiformat_uploader.js b/static/functions/multiformat_uploader.js index 88a59696..5eb21bca 100644 --- a/static/functions/multiformat_uploader.js +++ b/static/functions/multiformat_uploader.js @@ -90,7 +90,7 @@ function addReleaseDescription(row) { name:"extra_release_desc[]", cols:60, rows:4, - style:'display:none; margin-left: 5px; margin-top: 10px; margin-bottom: 10px;' + style:'display:none; margin-left: 5px; margin-top: 10px; margin-bottom: 10px;' }).appendTo(desc_row); } diff --git a/static/functions/recommend.js b/static/functions/recommend.js index 9ae3a51a..cb510e87 100644 --- a/static/functions/recommend.js +++ b/static/functions/recommend.js @@ -41,7 +41,7 @@ }); $("#recommendation_note").keypress(function(e) { state = $("#send_recommendation").attr("disabled"); - if (typeof state === 'undefined' && e.keyCode == 13) { + if (typeof state === 'undefined' && e.keyCode == 13) { e.preventDefault(); send_recommendation(); } diff --git a/static/functions/requests.js b/static/functions/requests.js index b53680ff..4a177b4f 100644 --- a/static/functions/requests.js +++ b/static/functions/requests.js @@ -18,12 +18,12 @@ function Vote(amount, requestid) { index = true; } - if (amount > 20*1024*1024) { + if (amount > 20 * 1024 * 1024) { upload = $('#current_uploaded').raw().value; download = $('#current_downloaded').raw().value; rr = $('#current_rr').raw().value; - if (amount > .3*(upload - rr * download)) { - if (!confirm('This vote is more than 30% of your buffer. Please confirm that you wish to place this large a vote.')) { + if (amount > 0.3 * (upload - rr * download)) { + if (!confirm('This vote is more than 30% of your buffer. Please confirm that you wish to place this large of a vote.')) { return false; } } @@ -60,14 +60,14 @@ function Calculate() { if (amt > $('#current_uploaded').raw().value) { $('#new_uploaded').raw().innerHTML = "You can't afford that request!"; $('#new_bounty').raw().innerHTML = "0.00 MB"; - $('#bounty_after_tax').raw().innerHTML = "0.00 MB"; + $('#bounty_after_tax').raw().innerHTML = "0.00 MB"; $('#button').raw().disabled = true; } else if (isNaN($('#amount_box').raw().value) - || (window.location.search.indexOf('action=new') != -1 && $('#amount_box').raw().value*mul < 100*1024*1024) - || (window.location.search.indexOf('action=view') != -1 && $('#amount_box').raw().value*mul < 20*1024*1024)) { + || (window.location.search.indexOf('action=new') != -1 && $('#amount_box').raw().value * mul < 100 * 1024 * 1024) + || (window.location.search.indexOf('action=view') != -1 && $('#amount_box').raw().value * mul < 20 * 1024 * 1024)) { $('#new_uploaded').raw().innerHTML = get_size(($('#current_uploaded').raw().value)); $('#new_bounty').raw().innerHTML = "0.00 MB"; - $('#bounty_after_tax').raw().innerHTML = "0.00 MB"; + $('#bounty_after_tax').raw().innerHTML = "0.00 MB"; $('#button').raw().disabled = true; } else { $('#button').raw().disabled = false; @@ -75,7 +75,7 @@ function Calculate() { $('#new_uploaded').raw().innerHTML = get_size(($('#current_uploaded').raw().value) - amt); $('#new_ratio').raw().innerHTML = ratio($('#current_uploaded').raw().value - amt, $('#current_downloaded').raw().value); $('#new_bounty').raw().innerHTML = get_size(mul * $('#amount_box').raw().value); - $('#bounty_after_tax').raw().innerHTML = get_size(mul * 0.9 * $('#amount_box').raw().value); + $('#bounty_after_tax').raw().innerHTML = get_size(mul * 0.9 * $('#amount_box').raw().value); } } @@ -120,7 +120,9 @@ function AddArtistField() { function RemoveArtistField() { var ArtistCount = document.getElementsByName("artists[]").length; - if (ArtistCount == 1) { return; } + if (ArtistCount == 1) { + return; + } var x = $('#artistfields').raw(); while (x.lastChild.tagName != "INPUT") { diff --git a/static/functions/top10.js b/static/functions/top10.js index e756d6d9..56d220fb 100644 --- a/static/functions/top10.js +++ b/static/functions/top10.js @@ -24,10 +24,12 @@ $(document).ready(function() { } function getResized(srcWidth, srcHeight, maxWidth, maxHeight) { + var ratio = [maxWidth / srcWidth, maxHeight / srcHeight ]; + ratio = Math.min(ratio[0], ratio[1]); - var ratio = [maxWidth / srcWidth, maxHeight / srcHeight ]; - ratio = Math.min(ratio[0], ratio[1]); - - return { width:srcWidth*ratio, height:srcHeight*ratio }; + return { + width: srcWidth * ratio, + height: srcHeight * ratio + }; } -}); \ No newline at end of file +}); diff --git a/static/functions/user_notifications.js b/static/functions/user_notifications.js index 602efe28..f0362532 100644 --- a/static/functions/user_notifications.js +++ b/static/functions/user_notifications.js @@ -83,7 +83,7 @@ function createNoty(type, id, message, url, importance) { } }, { - addClass: 'brackets noty_button_close ', text: 'Dismiss', onClick: function($noty) { + addClass: 'brackets noty_button_close ', text: 'Hide', onClick: function($noty) { $noty.close(); } }, diff --git a/static/functions/user_settings.js b/static/functions/user_settings.js index 31199cf3..ee8d464c 100644 --- a/static/functions/user_settings.js +++ b/static/functions/user_settings.js @@ -1,12 +1,12 @@ $(document).ready(function() { var top = $('#settings_sections').offset().top - parseFloat($('#settings_sections').css('marginTop').replace(/auto/, 0)); $(window).scroll(function (event) { - var y = $(this).scrollTop(); - if (y >= top) { - $('#settings_sections').addClass('fixed'); - } else { - $('#settings_sections').removeClass('fixed'); - } + var y = $(this).scrollTop(); + if (y >= top) { + $('#settings_sections').addClass('fixed'); + } else { + $('#settings_sections').removeClass('fixed'); + } }); $("#settings_sections li").each(function(index) { @@ -59,4 +59,4 @@ $(document).ready(function() { function fuzzyMatch(str, pattern){ pattern = pattern.split("").reduce(function(a,b){ return a+".*"+b; }); return new RegExp(pattern).test(str); -}; \ No newline at end of file +}; diff --git a/static/styles/global.css b/static/styles/global.css index c6c167f9..c8406053 100644 --- a/static/styles/global.css +++ b/static/styles/global.css @@ -543,8 +543,8 @@ tr.torrent .bookmark>a:after { overflow: auto; } -.setting_description>* { - margin: 1em 0 0 0; +.setting_description > * { + margin: 1em 0 0 0; } .settings_sidebar { diff --git a/static/styles/tiles/style.css b/static/styles/tiles/style.css index c7d79607..fadce649 100644 --- a/static/styles/tiles/style.css +++ b/static/styles/tiles/style.css @@ -1,62 +1,61 @@ - .tiles_container { - position: relative; + position: relative; } /** * Grid container */ - .tiles { - list-style-type: none; - position: relative; /** Needed to ensure items are laid out relative to this container **/ - margin: 0; - padding: 0; +.tiles { + list-style-type: none; + position: relative; /** Needed to ensure items are laid out relative to this container **/ + margin: 0; + padding: 0; } /** * Grid items */ - .tiles li { - background-color: #ffffff; - border: 1px solid #dedede; - border-radius: 2px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - display: none; /** Hide items initially to avoid a flicker effect **/ - cursor: pointer; - padding: 4px; +.tiles li { + background-color: #ffffff; + border: 1px solid #dedede; + border-radius: 2px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + display: none; /** Hide items initially to avoid a flicker effect **/ + cursor: pointer; + padding: 4px; } .tiles li.inactive { - visibility: hidden; - opacity: 0; + visibility: hidden; + opacity: 0; } .tiles li img { - display: block; + display: block; } .large_tile { - max-width: 252px; + max-width: 252px; } /** * Grid item text */ - .tiles li p { - color: #666; - font-size: 12px; - margin: 7px 0 0 7px; +.tiles li p { + color: #666; + font-size: 12px; + margin: 7px 0 0 7px; } /** * Placerholder css */ - .wookmark-placeholder { - border-radius: 2px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - background-color: #eee; - border: 1px solid #dedede; - z-index: -1; -} \ No newline at end of file +.wookmark-placeholder { + border-radius: 2px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + background-color: #eee; + border: 1px solid #dedede; + z-index: -1; +}