// ==UserScript== // @name Airdates.tv enhancer // @namespace V@no // @author V@no // @description 2.5 tons of enhancements // @include http://www.airdates.tv/* // @include https://www.airdates.tv/* // @include /^https?:\/\/(www\.)?disqus(cdn)?\.com\/embed\/comments\/.*$/ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsSAAALEgHS3X78AAADv0lEQVRYw+1Wv08jVxD+Zt7uWy92jOMjh6ULBUkHVbiU5A9If6LKSUdqUNLQsnIKlC7FgZQmoqFCgvQoQog0F0EXqNOQAsjZHBL22t43k8K7iw25S5OcpeRGGu3b3TfvzXzzE3hHIybKFlEU0dzc3Henp6flOI4BQI0xaozRTqfDzjl4nqciAlWlJEkAAKqKIAhgjFEAYGaoqhLlR7PneVQqlZiZsbS09GxQAe+OMp8BmEjfBYCmzOk3HdhLA7I68A931pyyeSMUURTx4uJisrOzo+041nYca6/3jTpH6hypOig5lzM7KDtWdqyLPyyqI5ezAOqI1BEpSJXhlOH0yZOfdX19/ep1CMA5B1UFp/AREZhvjdEciMxESeEgsPKQQaSaYyWpnO/be4bnUvV6XYwxYGa8TRq6LQ2w0SlQrVYRhuHoFEjTaXQKtFot9Hq9f+0yEfdmBay1o0Vg5EGYJAlE5L+LgHP3jXu7VefvEMhK8cgUYGYMtNF/nMQlr1cgiiLudDpYXVUEgUUQWJTfKyIMawjDGqgICN8yjQG1sIZaWMOPv1bBgpwL1QcoTE6iMDkJFUC1C9Uuvvr6Prp5N5ydnaWzs7MhFygI4+P999gA1BoQrPhQSXsiC3QAuPehQwNBt9t/Jsn9IMzFtre3w/39/Yubm5tis9mEiFAQBP1NRNA+IeuYxhhYazX9RwAQx3GWyuR5HlQ1iysNggDT09OYmpq6vry8fFCv190QAvPz89/u7u6WDg4OUCgU0Gw2USqVAACFQgHn5+dERDDG5LVCREhEEAQBrLVoNpuoVqsQEVhr0Wg0wMwolUqkqri6ukIQBOOVSqUI4DpH4OTkxK6urnaOjo4A3GZDt9uFqkJEUC6X+25RharC932ICJxzeQHzfR/WWlhr0Wq1QEQgIvi+D1VFkiRoNBpYXl52a2trHgDQ8fGxv7m5+dvFxcWjDLJMiawwZQd5ngdjDB4//gSe56NcLsMYg3a7jRcvfkGxWAQR5QiFYQjf9zN3YWxsDBMTEyiXy2DmYGFhoevNzMx82m63HxWLxSELkyTpj2fphJT5HwDirgMnirjzEsQMZsL0Rx/j+tVVNhUPp7MCKn3jer0ekiQBEXWiKDLe1tYW7e3t5RGZWZtxKp8e1I/uw8PDv8hyxcOuwv/8FX7/qZLLqQjCKUHhYQ9/fPAlkufPoalLv3j6tB8DKysrz+I4/rA/zlN2nzAzRCRH4U6jYmRTKcBEpESk2X4RGSpyaaZk3xJV/X5jY+Ml3tH/nv4E5KQFif7uYoAAAAAASUVORK5CYII= // @license MIT // @version 1.73b5 // @run-at document-start // @grant none // @downloadURL https://update.greasyfork.cloud/scripts/28787/Airdatestv%20enhancer.user.js // @updateURL https://update.greasyfork.cloud/scripts/28787/Airdatestv%20enhancer.meta.js // ==/UserScript== //tab = 2 spaces /*global DB, GM_info, DISQUS, device, Colors, assignColor, loadColor, engines, ymToday, ym2str, coalesce, markSearchResults, search, updateSelectedOnly, readCookieRaw, loadArchiveFromPathname, hashChanged, require, HTMLDocument*/ /*jshint supernew: true, globals: true, evil: true, loopfunc: true, jquery: true, boss: true, expr: true, devel: true, strict: global, scripturl: true, -W018, -W014*/ "use strict"; var changesLogText = multiline(function(){/* if all your settings are lost after website upgrade to secure connection on Oct 13, 2019, go to this page and backup your settings, then you can restore them in options 1.73b5 (2021-10-08) + restrict maximum width of the content (helps for wide resolution monitors) ! "collapse multiple" would collapse "premiere" or "returning" shows if there is an episode without season before it ! clicking on search link at the header would show arrow pointing at the searchbar without animation until page refreshed. * clean up for jslint //enableEpDateFixMenu 1.73b4 (2021-07-25) + setting to activate date offset + date offset of displays in tooltip which episode it's inherit current position + filter in changes log by clicking at legend titles + archive date to website title ! disqus reload button didn't scroll down properly ! disqus message count didn't work ! disqus theme didn't change together with main site ! opened details would get closed when "today" is changed ! date offset + time offset = incorrect date offset position ! errors on "_u" pages * changes log will not longer popup when script first installed or when localStorage data deleted * legend in changes log is always visible - ability enable/disable episode offset feature via #epdatefix0 and #epdatefix1 hashtags - disqus recommendations b.s. ? date offset + collapsemulti = hidden/incorrect title 1.73b3 (2020-12-13) + hide "Also on" section of disqus 1.73b2 (2020-10-15) + ability set date offset for episodes ! wrong svg icons color on light background 1.72.2 (2020-10-10) ! watched filter didn't work properly when show highlighted by search or marked as new/returned 1.72.1 (2020-10-10) * tooltip on watched checkboxes now show additional info if SHIFT+click available 1.72 (2020-10-10) + while "Show all episodes" list is opened, holding SHIFT key and clicking on "watched" checkbox will select/deselect all previous episodes + filter to hide watched episodes ! duplicate week days for custom shows were not removed and not in order ! in some browsers (Tor Browser) after clicking left mouse button on a link that opens link in a new tab it would delete some of the user settings (that was some WTF bug) 1.71 (2020-06-26) + new option "number of opisodes per day" for custom shows ! menu popup did not change size with page zoom 1.70.1 (2020-05-13) ! links incorrectly selected for middle click in some cases ! watched incorrectly set on shows with changed "Episode # offset" 1.70 (2020-05-08) + date of content's last update at the bottom of the page * table min width decreased to allow display without scrollbars on low resolution screens ! old unused settings were not deleted ! messages under search bar displayed in one line ! custom links not properly sorted 1.69 (2020-03-18) * option "Sunday is first day of the week" changed to "First day of the week" with ability select Monday, Sunday or Saturday. ! missing days in the past in some situations 1.68 (2020-03-13) + option "Sunday is first day of the week" ! some show's name incorrectly truncated in links in the search result 1.67 (2020-02-02) + ability change some colors of the website + ability enter RGB and HSB values in colorpicker ! accounts with hundreds "my shows" could fail properly sort shows ! colorpicker not shown in Custom Shows settings 1.66.1 (2020-01-14) ! option's misalignment in default theme * color picker for today's color now shows the color value in option's field 1.66 (2020-01-14) + option for today's color 1.65.2 (2020-01-12) ! error when trying open an item when searched for info:myshows * today's color in dark theme to orange 1.65.1 (2020-01-12) ! account popup would show up after closing secondary popup via X icon (options, custom shows, etc) ! my shows on top shown in wrong ordered * improved my show on top sorting performance 1.65 (2020-01-1) + option to show "My Shows" on top of the list 1.64.1 (2020-01-06) ! middle click on a show would not open selected links 1.64 (2020-01-04) + new tags for custom links: {YEAR}, {MONTH}, {DAY} 1.63.2 (2020-01-04) * it's possible now add custom show without specifying season 1.63.1 (2020-01-04) ! custom shows with day of the week would not set correct date with time offset activated * horizontal scrollbar shown in Custom Shows popup 1.63 (2020-01-03) + prompt's buttons now highlighted when cursor over + option to make popups more stand out by bluring background around them + ability specify day of the week of a custom show ! horizontal scrollbar shown in Links Manager ! account popup not dimmed when import/export colors prompt opened * when popups are opened, page scroll is disabled 1.62.2 (2019-10-24) ! fixed missing weeks 1.62.1 (2019-10-24) + tooltip for "go to the top" button ! leave archive bottom link was not scroll to the top 1.62 (2019-10-24) + jump to the top button + option to show next/prev month buttons under calendar ! some color issue in changes log with dark theme ! prompt to enter a date to jump to (when clicked on archive's date) was not showing correct currently viewing date 1.61.2 (2019-10-20) + information about server upgrade inside changes log and what to do 1.61.1 (2019-10-13) + #backupsettings to the link under search bar ! link in disqus comments to non-secure website with a hashtag command would execute command instead of opening webpage 1.61 (2019-10-13) + added hashtag command #backupsettings 1.60.4 (2019-10-13) + tooltip explaining how user's colors saved ! links favicons used insecured connection 1.60.3 (2019-07-14) + main menu icon instead of "Account" link ! Sunday column would wrap under Saturday in small windows * cookies icon for guests 1.60.2 (2019-07-14) + search icons ! cookies that store guest's colors will no longer expire * search bar placeholder to "Find Show ..." * text "Account" to "Tools" on main menu link 1.60.1 (2019-03-31) ! watched checkbox was removed from first custom show of the week when new day started 1.60 (2019-03-04) + ADEU keyword in disqus ! disqus troll script would not initialize on new comments which were loaded without page refresh * custom shows link no longer shown when viewing as another user 1.59 (2018-12-09) + ability add custom icon for each link (can be an URL or "data:" type) + option to change how custom colors displayed: use all available width or wrap in 7 per line ! some changes links manager would not reflect in opened details of a show ! improved drag'n drop in links manager ! greatly improved performance during changing number of custom colors to display in settings * quick colors and link's icons are now scalable with page zoom in Waterfox * replaced color picker icon with a SVG, which allows to be scaled without compromising quality 1.58.1 (2018-12-02) ! in some situations all days disappear ! search bar not centered 1.58 (2018-12-02) + ability change order in list of all episodes of a show 1.57 (2018-11-20) + after an update changes log highlights changes between new and old versions ! "My Shows" displayed duplicate entries when settings where restored from old backups ! deleted custom show has "edit" link in "My Shows" list, producing error in console ! newly added custom color wasn't pre-selected 1.56.1 (2018-11-18) * selected color in quick color picks now shows rounded 1.56 (2018-11-18) + changes log shown after update (can be disabled via checkbox in top-right corner) + quick color picks shows which one is the current color ! after a link was changed, middle click on a show would use old data for the selected links ! links manager missing cursor-over indicator on edit/delete buttons ! custom show name field shown as "error" after "clear" button used 1.55.2 (2018-11-10) ! settings restore could create duplicate custom shows ! clicking on disqus notification icon would not open the notification panel 1.55.1 (2018-11-10) ! search by name failed find custom shows * custom shows no longer displayed as duplicate if original show with exact same name + season + episode already exists in the same day 1.55 (2018-11-10) + tooltips on quick color pick + option to change displayed number of custom colors + when editing a custom show, if name changed to an existing show, the submit button label changes to "Merge", the name in the list changes color to red and the show it will be merged with changes to green ! color box of a last in the list custom show would display outside of the area, requiring user to scroll ! clicking edit link on custom show from search results would not highlight line in episodes data ! when colors box opened in custom shows popup, escape button closes the color box instead of whole custom shows popup ! clicking outside of color box in "Custom shows" could activate other actions on clicked element * increased number of custom colors to remember from 7 to 100 * when color box in "Custom shows" list is opened, popup around of it fades and hovering cursor over other elements on the page no longer trigger anything 1.54.2 (2018-11-07) ! number of weeks ignored if number of past weeks changed immediately after number of weeks changed from "All" to any number 1.54.1 (2018-11-07) ! incorrect number of weeks shown in search results 1.54 (2018-11-07) + option to limit how many weeks to show (past weeks are included into the count) * increased number of past weeks to 5 1.53.2 (2018-11-06) ! disqus trolls script didn't work 1.53.1 (2018-11-06) ! custom show's color box was displayed on it's own line in older browsers 1.53 (2018-11-06) + colors in custom shows list + clicking "Edit" on custom show from details dropdown automatically highlights the episode data line ! collapse multiple didn't work on added/updated shows without page refresh ! some icons in details dropdown were black on dark background * if custom show name matches any existing custom shows, it automatically highlighted and currently selected one shows as crossed off (because it would be merged with the matched one) * season/episode number is no longer restricted to max 99 1.52 (2018-11-05) + when editing a custom show and name changed to unique, it's now possible add it as a new show or update existing + "More info" state in custom show editor is now remembered * any field that prevent custom show from submitting is now highlighted 1.51.1 (2018-11-05) ! custom shows not shown in past weeks 1.51 (2018-11-04) + new show episode data fields are now can be separated by any character(s) that is not 0-9, date also may be spited as separate year, month and day + visual aid in the custom shows list highlighting affected item after submitting data + more explanation about episode data format + Custom shows form changes label on submit button to reflect if a show being edited or a new show will be created + arrow keys in custom shows list would select for editing next/prev show ! text-shadow on titles highlighted by search would affect new/returning tags, producing unreadable text ! clicking "Show all episodes" from "My Shows" list would not properly display list of episodes ! missing "Edit" link in for custom shows in "My shows" list ! white icon in show's details in search results * new show episodes data fields are now showing evenly spaced 1.50 (2018-11-03) + backup/restore custom shows 1.49 (2018-11-03) + if custom show fields are empty, deleting a show would fill up the fields with information from deleted show 1.48.1 (2018-11-03) ! myshow list would not update new name of custom shows 1.48 (2018-11-03) + ability add custom shows + text shadow on highlighted (rainbow) search results ! in some cases script totally failed, due to work around for SVG images showing too large while page is still loading. 1.47 (2018-10-19) + links regex now applied to the entire url, but only if MONKEY_REGEXP or MONKEY_N_REGEXP tags were not used ! MagnetDL links included unnecessary / at the end search keyword 1.46.2 (2018-10-19) ! horizontal scrollbar shown when links manager is overflowing ! submit button not disabled after new link was submitted 1.46.1 (2018-10-19) ! issues after a link was created and deleted without page refresh 1.46 (2018-10-18) + ability add regular expressions filters to links (one regexp per line) ! edit buttons not shown in links manager in some browsers ! edited link would fail in opened show details ! in older browsers show details would not open on first click and episode offset would fail ! MagnetDL links 1.45.3 (2018-10-02) ! track today not working when 1st of the month is Monday 1.45.2 (2018-09-29) ! missing comments reload button in some browsers ! black comments reload icon in dark theme 1.45.1 (2018-08-12) ! filter checkboxes were too close to each other 1.45 (2018-08-12) + clicking on logo changes theme ! JS errors at login page * tweaked colors of day's date in dark theme * changed theme handling/selection in options, this will allow user add custom themes in the future 1.44.2 (2018-07-19) ! loading icon when clicked at disqus notification badge would hide prematurely before notification window opened. ! disqus badge routine start multiple timers 1.44.1 (2018-07-15) ! dark theme looked bad in archive * tweaked the look of notification badge 1.44 (2018-07-15) + disqus message notification badge on top of the page + colorpicker set to last used color if current show has no assigned color 1.43.1 (2018-07-14) ! colorpicker stops working if used at search results ! on small screens sundays would move underneath of saturday when search is active ! when myshows list is opened, adding/removing a show would not reflect at the list 1.43 (2018-07-14) + remember and show last 7 custom colors as quick pick, they can be removed via middle click ! main input hex color in colopicker would fail * updated logo with less outline on darker theme 1.42 (2018-07-14) + updated logo, it now looks good with any background. ! disqus would not show text after switching theme without page refresh 1.41 (2018-07-13) + dark theme build-in 1.40.2 (2018-07-13) * better support for dark themes 1.40.1 (2018-07-10) ! on small screens sundays would move underneath of saturday * opened show border now obeys color of the text 1.40 (2018-07-09) + episode season number offset 1.39 (2018-07-09) + episode number offset ! script fails on some pages displaying huge characters (i.e. login page) ! in some browsers it shows huge "something" while page still loading 1.38.3 (2018-05-26) ! collapse multiple failed at midnight when enabled "Track today" 1.38.2 (2018-04-23) ! Show details would not open 1.38.1 (2018-04-22) * clean up saved settings (remove any non-existing or with missmatched type settings) 1.38 (2018-04-16) + option to track today (feature introduced in v 1.35) 1.37.4 (2018-04-15) ! MS Edge compatibility 1.37.3 (2018-04-13) ! if episode is in the past and hidden via "show past weeks" setting, clicking on "Show in calendar" from search result would not reveal the episode. * if getting name of same show failed, next attempt will be possible only after 1 hour * if getting name of a show failed during period of 4 weeks, the show will be removed from the account. 1.37.2 (2018-03-27) + enter key now submits form in links manager ! left click on links didn't work ! links with empty URL field no longer accepted * undo message after clear colors/hidde or watched list now visible even when page scrolled down * when viewing as different user, links to clear colors/hidden and watched lists are no longer visible * Add and Reset buttons in links manager renamed to Submit and Clear 1.37.1 (2018-03-25) ! broken my shows list in Firefox * renamed "Show hidden" checkbox to "Hidden shows" 1.37 (2018-03-23) + reload disqus button ! clicking on engine's checkboxes would open the engine link 1.36.3 (2018-03-18) ! errors in console in MS Edge 1.36.2 (2018-03-18) ! in certain situations changing time offset would break collapse multiple ! auto scroll setting were inverted on page refresh * settings "Scroll on search" renamed to "Auto scroll to the top" 1.36.1 (2018-03-18) ! in certain situations changing time offset would break collapse multiple 1.36 (2018-03-18) + links to Wikipedia in search result + information about shows stored in local storage, now included in settings backup ! 1.35 broke disqus ! links to airdates hashtags mistakenly opened in new tab if hashtag was was after domain name instead of / ! invalid colors would display show with white text ! searches that include info:A-Z no longer sent to server ! info:myshows didn't list shows without name 1.35 (2018-03-17) + today automatically changes at midnight without page refresh and updates listing of current month ! possible open multiple popups via hashtags * back button now shows on popups opened via hashtag 1.34.1 (2018-03-15) ! search result had too much empty space on top ! link under search bar covers Sundays date when small logo enabled * different approach stopping page from scrolling on search 1.34 (2018-03-15) + time offset option + option to disable scroll when using search field 1.33.1 (2018-03-12) ! color input field undo now records when color picked via palette 1.33 (2018-03-12) + missing color input field in color picker * improved color input field in color picker: no need for # and it automatically filters out non-valid values, custom undo/redo that works between shows 1.32 (2018-03-04) + add/reset buttons in Links Manager are now disabled when fields are empty + clear colors/hidden/watched lists in options + ability undo after clear colors/hidden/watched ! reset button in Links Manager would not remove icon in result when clicked first time ! broken restore settings ! when a popup once opened via a hashtag (#options, #linksmanager, #changes), opening that popup via click would not show back button * alert popup after clear colors/hidden/watched replaced with a notification message with ability to undo 1.31 (2018-02-25) + button in prompt popup to save/load file + hashtags #options and #linksmanager + tooltips on links in links manager ! color validation during import colors didn't work properly ! the end of text in url field in links manager was covered up by the dropdown menu button ! color picker in search result displayed behind the search results and was inaccessible ! asterisk on new links in links manager is now always visible even if link's title is truncated * export colors filters out invalid colors * links manager is now consistent width - save/load from file links, they are now integrated into prompt itself 1.30.2 (2018-02-18) ! incorrect favicon for internal airdates.tv links 1.30.1 (2018-02-18) ! error opening show from "My shows" list 1.30 (2018-02-18) + animation speed setting + links manager automatically scrolls to new (or edited) link after submit + custom prompt popup for import/export colors/settings ! exporting ~160 colors via text string would corrupt some colors due to Chrome limitations ! errors in console when attempting restore settings or import colors with invalid data * importing colors now validates input before saving to the account 1.29 (2018-02-12) + ESC key closes popups + show/hide this show icon ! when number of visible links different from default, opening a show would make the animation jump ! long text wrapped in popup windows ! clicking on edit link icon in Links Manager, would not display correct lin in the "Result" row ! "reset sort" link in Links Manager would take whole row ! MS Edge would not initialize properly * links with long names are longer "wrap" * significally improved performance of Links manager * faster opening/closing show animation * selectable links in show details are now separate from other links * links manager popup now has limited max size 1.28.4 (2018-02-07) + random series as example in links manager ! editing/adding a link while a show opened would produce incorrect links in the opened show until page refresh 1.28.3 (2018-02-07) ! Firefox decided render shadow much bigger then supposed to 1.28.2 (2018-02-07) ! in Firefox shadow would show on opened show when popup was opened 1.28.1 (2018-02-07) + shadow on "popups", making them more pronounced 1.28 (2018-02-04) + search by adding #s:keyword in the address + changes log + ability use hash tags as links in comments (#s:search-keyword, #info:NN, #myshows, #hidden, #changes). Without ADE it will open a blank page. + option for small logo ! disqus troll would not work at all in some browsers ! disqus troll would not work on additionally loaded comments ! "watched" checkboxes shown through search field ! close button on popups would not work if cursor not in the middle of it * removed disq.us from links in comments * links in comments open in new tab * when searching via hash tag, clearing search field with X icon would also remove the hash tag from address bar 1.27.5 (2018-01-22) ! broken fix for paste via right click in search bar 1.27.4 (2018-01-22) + cloud icon next to member name 1.27.3 (2018-01-22) ! fails initialize with some invalid colors in cookies * replaced some icons with SVG, should now be more browser independent and consistent 1.27.2 (2018-01-21) ! sorting by color with fallback to sorting by name was in reverse 1.27 (2018-01-21) + link to support website ! middle click on title would attempt open 2 tabs for each selected link ! significantly improved initialization speed for guests and members with no colors (very noticeable with #showhidden in the address) */}, true).trim(); let log = console.log.bind(console), self = this, timeOffset = 0, isFrame = window.top !== window.self, _Date = Date, today, blankFunc = function(){}, SVG = { del: '', search: '', show: '', hide: '', backup: '', restore: '', clear: '', edit: '', guest: '', link: '', customlinks: '', customshows: '', settings: '', menu: '', user: '', reload: 'Reload', close: '', closehover: '', viewas: '', back: '', }; /*work around for some SVG pictures shown huge before page is fully loaded*/ (function loop() { let head = document.head; if (!head) { return setTimeout(loop, 0); } let style = document.createElement("style"); head.appendChild(style); style.innerHTML = "svg{max-width:1.2em;max-height:1.2em;}"; if (!isFrame && window.location.href.match(/^http:/)) { let s = document.createElement("script"); s.src = "/public/javascripts/db.js"; head.appendChild(s); s = document.createElement("script"); s.src = "/public/javascripts/main.js"; head.appendChild(s); s = document.createElement("script"); s.src = "/public/javascripts/jqColorPicker.min.js"; head.appendChild(s); window.engines = []; } })(); receiveMessage.f = {};//list of functions receiveMessage.f.reloadDisqus = function messageFunc_reloadDisqus(r) { if (typeof(r) == "undefined") { this.r = true; DISQUS.reset({ reload: true, }); } else if (this.r) { $("html, body").animate({scrollTop: $("#disqus_thread").find("iframe")[0].offsetTop + r }, 300); } }; window.self.addEventListener("message", receiveMessage, false); if (!isFrame) { try { timeOffset = ~~ls("settings").timeOffset; if (!(timeOffset instanceof Number)) timeOffset = 0; } catch(er){} Date = function() { let args = Array.prototype.slice.call(arguments); args.splice(0, 0, this); let n = (new (Function.prototype.bind.apply(_Date, args))).getTime() + 3600000 * timeOffset; return new _Date(n); }; Date._now = function() { return (new _Date()).getTime(); // return Math.floor((Date.now() - 1523246400000) / 1000); //2018-04-09 00:00:00 }; } if (!Date.now) { Date.now = function() { return (new Date()).getTime(); }; } Object.defineProperty(window, 'browser', { get: function() { let browser = ""; if((navigator.userAgent.indexOf("Opera") || navigator.userAgent.indexOf('OPR')) != -1 ) { browser = "opera"; } else if(navigator.userAgent.indexOf("Edge") != -1) { browser = "edge"; } else if(navigator.userAgent.indexOf("Chrome") != -1 ) { browser = "chrome"; } else if(navigator.userAgent.indexOf("Firefox") != -1 ) { browser = "ff"; } else if(navigator.userAgent.indexOf("Safari") != -1) { browser = "safari"; } else if((navigator.userAgent.indexOf("MSIE") != -1 ) || (!!document.documentMode == true )) //IF IE > 10 { browser = "ie"; } return browser; }}); let mainFunc = function mainFunc(event) { /* jshint validthis: true */ if (typeof($) == "undefined") return; //create a DIV container and move everything into that container const elContent = document.getElementById("content") || document.createElement("div"), elSearchbarContainer = document.createElement("div"); elContent.id = "content"; elSearchbarContainer.id = "searchbarContainer"; elSearchbarContainer.appendChild(document.getElementById("searchbar")); elContent.appendChild(elSearchbarContainer); while(document.body.children.length) elContent.appendChild(document.body.firstChild); document.body.appendChild(elContent); let browser = window.browser; if (browser) document.body.classList.toggle(browser, true); let disqusMessageCount = function disqusMessageCount(count) { if (count) { disqusMessageCount.el.setAttribute("unread", ""); disqusMessageNotifLoaded(false); } else { disqusMessageCount.el.removeAttribute("unread"); // disqusMessageCount.el.classList.toggle("loading", false); disqusMessageNotifLoaded(false); count = ""; } disqusMessageCount.el.textContent = count; }; receiveMessage.f.disqusMessageCount = disqusMessageCount; let adeName = "Airdates.tv enhancer", adeVersion = "n/a", prevVersion = null, force = false, enginesDefault = [], _engines = [], _hidden = ls("hidden") || [], loopWait = 1000, _enginesList = [], pickerCallbacks = {}; try { adeName = GM_info.script.name; adeVersion = GM_info.script.version; }catch(er){} cs.list = ["s","n"]; cs.listLegacy = { sh: "showHidden", sn: "showNew", sr: "showReturn", cm: "collapseMulti", w: "weeksPast", wa: "enableWatched", middleClick: "middleClick" }; let enginesHide = ls("enginesHide") || []; let Settings = { SORT_NAME: 0, SORT_COLOR: 1, inited: false, box: null, /* colorsDef: { "807fff": {name: ""}, "ff7fff": {name: ""}, "80ff7f": {name: ""}, "7fffff": {name: ""}, "ff7f7f": {name: ""}, }, */ prefs: {}, prefsDef: { animSpeed: 2, archiveBottom: 1, //show next/prev month links below calendar collapseMulti: 0, cushowsHelp: 0, enableWatched: 0, enableEpDateFix: 0, lastColor: "", lastColors: [], lastColorsLine: 7, //number of last colors per line lastColorsShow: 7, //number of last colors to show middleClick: [], myShowsTop: 0, //move my shows on top of the list noChangesLog: 0, popupBlur: 1, //blur background when popups are shown searchOrder: 0, searchScroll: 1, shortTitle: 0, shortTitleExpand: 1, showHidden: 0, showNew: 0, showReturn: 0, showWatched: 1, smallLogo: 0, sortBy: 0, theme: "", themeColors: { text: "", bg: "", date: "", dateBg: "", today: "", todayBg: "", todayBorder: "" }, timeOffset: 0, todayChange: 1, version: "", weeks: 0, //total number of weeks to show weeksPast: 0, //number of past weeks weekStart: 0, //0=Mon, 1=Sun, 2=Sat }, prefsFilter: { animSpeed: function(p) { return Math.max(0, Math.min(9, p)); }, }, filter: function Settings_filter(id, val) { if (id in this.prefsFilter) return this.prefsFilter[id](val); return val; }, pref: function Settings_pref(id, val, prefs) { prefs = prefs || this.prefs; let ids = id.split("."); if (ids.length > 1) { return this.pref(ids[1], val, prefs[ids[0]]); } if (typeof(val) == "undefined") return typeof(prefs[id]) == "undefined" ? null : prefs[id]; prefs[id] = this.filter(id, val); this.save(); }, init: function Settings_init() { if (this.inited) return; this.prefs = ls("settings"); if (!this.prefs || typeof(this.prefs) != "object") this.prefs = cloneObj(this.prefsDef); if ("weeks" in this.prefs && !("weeksPast" in this.prefs)) { this.prefs.weeksPast = this.prefs.weeks; this.prefs.weeks = this.prefsDef.weeks; } //add any missing settings and remove any non-existing function fixPref(pref, def) { for(let i in def) { if (!(i in pref)) pref[i] = def[i]; if (typeof(def[i]) == "object" && !Array.isArray(def[i])) fixPref(pref[i], def[i]); } for(let i in pref) { if (!(i in def)) delete pref[i]; } } fixPref(this.prefs, this.prefsDef); if (this.prefs.theme === 1) this.prefs.theme = "dark"; //remove any non-existing settings for(let i in this.prefs) { if (!(i in this.prefsDef) || typeof(this.prefs[i]) !== typeof(this.prefsDef[i])) delete this.prefs[i]; } let c,// = cs("wa"), s = false; /* //too old compatibility to care? if (c !== null) { this.prefs.enableWatched = c ? 1 : 0; eraseCookie("wa"); s = true; } c = cs("showhidden"); if (c !== null) { this.prefs.showHidden = c ? 1 : 0; eraseCookie("showhidden"); s = true; } c = cs("sh"); if (c !== null) { this.prefs.showHidden = c ? 1 : 0; eraseCookie("sh"); s = true; } c = cs("cm"); if (c !== null) { this.prefs.collapseMulti = c ? 1 : 0; eraseCookie("cm"); s = true; } c = cs("middleClick"); if (c !== null) { this.prefs.middleClick = c ? c : []; eraseCookie("middleClick"); s = true; } c = cs("w"); if (c !== null) { this.prefs.weeks = c; eraseCookie("w"); s = true; } */ /* splitting New/Returning into two separate filters */ c = cs("sn"); if (c === null && this.pref("showNew") === null) { let n = cs("n") ? 1 : 0; this.prefs.showNew = n; this.prefs.showReturn = n; s = true; } else if (c !== null) { this.prefs.showNew = c; eraseCookie("sn"); s = true; } c = cs("sr"); if (c !== null) { this.prefs.showReturn = c; eraseCookie("sr"); s = true; } window.createCookie = createCookie; // window.eraseCookie = eraseCookie; // window.readCookie = readCookie; if (this.pref("version") != adeVersion) { if (!Settings.prefs.noChangesLog && Settings.prefs.version != adeVersion) { prevVersion = Settings.prefs.version; if (Settings.prefs.version !== "") { setTimeout(function() { changesLog.show(true); }); } if (!DB.loggedInUsername) { setTimeout(function() { for(let id in DB.savedColors) { DB.setColor(id, DB.savedColors[id]); } }); } } if ("weekSunday" in this.prefs) { this.prefs.weekStart = this.prefs.weekSunday; delete this.prefs.weekSunday; this.save(); } if (versionsCompare(this.pref("version"), "1.71") < 0) { let l = ls("customShows") || {i:1,l:{}}, changed = false; for (let obj in l.l) { for (let i = 0; i < l.l[obj][1].length; i++) { let data = l.l[obj][1][i]; if (data.length == 6) { data[6] = data[5]; //custom show days of the week data[5] = 1; changed = true; } } } if (changed) { ls("customShows", l); } } if (versionsCompare(this.pref("version"), "1.72") < 0) { let w = watched._list; for (let i in w) { let l = w[i], n = []; for (let e = 0; e < l.length; e++) { n[n.length] = episodeTools.short(l[e]); } w[i] = n; } watched.save(1); } this.prefs.version = adeVersion; s = true; } if (s) this.save(); this.themes.init(); this.create(); this.lastUpdateShow(); this.inited = true; },//Settings.init() create: function Settings_create(callback) { if (Settings.box) return callback ? callback() : true; let html = multiline(function(){/* */});//html let popup = $(html).appendTo("#content"), content = popup.find(".content"), a = document.createElement("a"), i = document.createElement("span"), span = document.createElement("div"), that = self, opt; span.appendChild(i); span.appendChild(a); Settings.box = popup; content.append(createCheckbox("enableWatched", "Enable watched", this.prefs.enableWatched ? true : false, this.callback, null, "")); //enableEpDateFixMenu content.append(createCheckbox("enableEpDateFix", "Enable Episode Date Offset", this.prefs.enableEpDateFix ? true : false, function(e, id, check) { epDateFix.init(check); }, ['Warning! This will increase page loading time.\n\nRequires page reload'], "")); content.append(createCheckbox("shortTitle", "Truncate long titles", this.prefs.shortTitle ? true : false, this.callback, ["Shorten titles to fit into single row."], "")); content.append(createCheckbox("shortTitleExpand", "Auto expand truncated titles", this.prefs.shortTitleExpand ? true : false, this.callback, ["Show full title when cursor over it. If disabled you still be able see full title in tooltip or when show is opened."], "")); content.append(createCheckbox("smallLogo", "Small logo", this.prefs.smallLogo ? true : false, this.callback, null, "")); content.append(createCheckbox("searchScroll", "Auto scroll to the top", this.prefs.searchScroll ? true : false, this.callback, ["Scroll to the top on search and page refresh"], "")); content.append(createCheckbox("todayChange", "Track today", this.prefs.todayChange ? true : false, this.callback, ['Automatically change "today" at midnight'], "")); content.append(createCheckbox("archiveBottom", "Show bottom archive links", this.prefs.archiveBottom ? true : false, this.callback, ['Show next/prev month links below calendar'], "")); content.append(createCheckbox("popupBlur", "Blur behind popups", this.prefs.popupBlur ? true : false, this.callback, ['Make popups standout more'], "")); content.append(createCheckbox("myShowsTop", "My Shows on top", this.prefs.myShowsTop ? true : false, function(e, id, check) { that.callback(e, id, check); sortMyShows(); }, ['Move My Shows to the top of the list'], "")); opt = $(multiline(function(){/* First day of the week: */})) .appendTo(content) .find("select") .val(Settings.pref("weekStart")) .on("input", function(evt) { Settings.pref("weekStart", ~~this.value); if (!evt.isTrigger) pastLoaded(); }) .trigger("input"); opt = $(multiline(function(){/* Show number of weeks: */})) .appendTo(content) .find("#weeks") .val(Settings.pref("weeks")) .on("input", function(evt) { // this.nextSibling.textContent = " week" + ((this.value == 1) ? "" : "s"); Settings.pref("weeks", ~~this.value); if (!evt.isTrigger) pastLoaded(); }) .trigger("input"); opt = $(multiline(function(){/* Show last custom colors */})) .appendTo(content) .find("input") .val(Settings.pref("lastColorsShow")) .attr("max", Settings.colors.max) .on("input", function(evt) { this.nextSibling.textContent = " last custom color" + ((this.value == 1) ? "" : "s"); let s = this.selectionStart, e = this.selectionEnd, val = Math.min(Settings.colors.max, Math.max(0, ~~this.value.replace(/[^0-9\-]/g, ""))); this.value = val; if (e !== null) this.selectionEnd = e; if (s !== null) this.selectionStart = s; Settings.pref("lastColorsShow", val); if (!evt.isTrigger) { clearTimeout(opt.timer); opt.timer = setTimeout(Settings.colors.init, 100); } }) .trigger("input"); content.append(createCheckbox("lastColorsLine", "Custom colors fill width", this.prefs.lastColorsLine ? false : true, function(e, id, check) { let num = check ? 0 : 7; Settings.pref("lastColorsLine", num); if (!e.isTrigger) Settings.colors.init(); }, ['Use all available width, or show 7 custOm colors per line'], "")); opt = $(multiline(function(){/* Time offset: hours */})) .appendTo(content) .find("#timeOffset") .val(Settings.pref("timeOffset")) .on("input", function(evt) { this.nextSibling.textContent = " hour" + ((this.value == 1) ? "" : "s"); let s = this.selectionStart, e = this.selectionEnd; timeOffset = Math.min(24, Math.max(-24, Number(this.value.replace(/[^0-9\-]/g, "")))); this.value = timeOffset; if (e !== null) this.selectionEnd = e; if (s !== null) this.selectionStart = s; Settings.pref("timeOffset", timeOffset); if (!evt.isTrigger) todayChange(timeOffset); }) .trigger("input"); if (!device.tablet() && !device.mobile()) { opt = $(multiline(function(){/*
Animation speed
1 2 3 4 5 6 7 8 9 10
*/})) .appendTo(content) .find("#animSpeed") .val(10-Settings.pref("animSpeed")) .on("input", function(e) { Settings.pref("animSpeed", 10-Number(this.value)); $("#animSpeedVal").text(this.value); }) .trigger("input"); } opt = $(multiline(function(){/* Theme: */})) .appendTo(content) .find("select") .each(function(i, el) { let option = document.createElement("option"); for(let id in Settings.themes.list) { option = option.cloneNode(false); option.value = id; let name = id; if ("name" in Settings.themes.list[name]) name = Settings.themes.list[name].name; if (name === "") name = "Default"; option.innerHTML = name; el.appendChild(option); } el.value = Settings.prefs.theme; }) .on("change", function(evt) { Settings.themes.load(evt.target.value); }) .trigger("change"); let box = $('
'), info = Settings.themes.quickOverrideTempl, samples = {}, sampleGroup = 0; let templ = multiline(function(){/*
{SVG-DEL}
*/}); for(let i in Settings.prefsDef.themeColors) { opt = $(templ .replace(/\{ID\}/g, i) .replace(/\{LABEL\}/g, info[i].label || "") .replace(/\{TITLE\}/g, info[i].title || "")) .appendTo(box) .find(".color") .each(function() { let that = this, name = i, data = {}; data[name] = Settings.pref("themeColors." + name); Settings.themes.quickOverride(data); if (data[name]) that.parentNode.setAttribute("color", data[name]); else that.parentNode.removeAttribute("color"); pickerCallbacks["themeColor_" + name] = function(val, temp) { let c = (typeof(val) == "boolean") ? val : temp ? true :false; that.parentNode.classList.toggle("colorpicker", c); that.parentNode.parentNode.classList.toggle("colorpicker", c); let b = document.getElementById("themeColorBox_" + that.parentNode._example), s = b.getElementsByClassName("example")[0]; if (c) b.setAttribute("down", that.parentNode._down); else b.removeAttribute("down"); if (typeof(val) == "boolean") val = null; if (!temp) { if (val) that.parentNode.setAttribute("color", val); else that.parentNode.removeAttribute("color"); Settings.pref("themeColors." + name, val); } if (val === null) { val = Settings.prefs.themeColors[name]; } let data = {}; data[name] = val; Settings.themes.quickOverride(data); }; }) .parent() .find(".del") .on("click", function() { pickerCallbacks["themeColor_" + i](""); }); if (info[i].sample) { let p = opt.parent(); let s = info[i].sample.split(","); for(let i = 0; i < s.length; i++) { if (typeof(samples[s[i]]) == "undefined") samples[s[i]] = [0, sampleGroup++]; samples[s[i]][0]++; p[0]._down = samples[s[i]][0]; p[0].classList.toggle("group" + (samples[s[i]][1] % 2), true); } p[0]._example = info[i].sample; } } box.appendTo(content); for (let s in samples) { let b = $("#themeColorBox_" + s); if (b.prev().hasClass("themeColorBox")) { b.before('
'); } b.append($('Example')); for(let i = 1; i < samples[s][0]; i++) { b = b.next(); b[0]._down = samples[s][0] - (samples[s][0] - ~~b[0]._down); } } content.append('
'); a.href = "#"; i.innerHTML = SVG.backup; a.textContent = "Backup settings"; a.id = "settingsBackup"; span.title = "Backup all settings, including links manager data, watched and hidden shows lists, middle click selection, last custom colors and custom shows."; a.addEventListener("click", function backupSettings_link_evtClick(e) { e.preventDefault(); Settings.backup(); return false; }, false); content.append(span); span = span.cloneNode(true); i = span.firstChild; a = i.nextSibling; a.id = "settingsRestore"; span.title = "Note, your current watched and hidden shows list will stay intact, new shows will be added to it.\nCustom links will only overwrite existing with matched ID.\nAll other settings will be overwritten"; i.innerHTML = SVG.restore; a.textContent = "Restore settings"; function restore(str) { let reload = false, txt = "Error restoring settings"; if(!str) return; let hiddenNum = 0, watchedNum = 0, settingsNum = 0, enginesNum = 0, engineHideNum = 0, customShowsNum = 0, themesNum = 0; let json = null; try { json = JSON.parse(str); } catch(er){log(er);} if (json && typeof(json) == "object") { if ("hidden" in json) { hiddenNum = json.hidden.length; for(let i = 0; i < hiddenNum; i++) showHide(parseInt(json.hidden[i]), 1); } if ("watched" in json) { for(let id in json.watched) { for(let i = 0; i < json.watched[id].length; i++) { let ep = json.watched[id][i]; watched.add(id, ep); watchedNum++; $('div.entry[data-series-id="' + id + '"]').each(function(n, entry) { if (episodeTools.short(entry) == ep) watched.update(entry, true); }); } } watched.save(true); } if (!json.cookies) json.cookies = {}; if ("settings" in json) { let save = false; for(let i in json.settings) { let val = json.settings[i]; if (i in cs.listLegacy && !(i in Settings.prefsDef)) { val = json.settings[i]; i = cs.listLegacy[i]; } if (!(i in Settings.prefsDef)) { if (!(i in json.cookies) && cs.list.indexOf(i) != -1) json.cookies[i] = val; continue; } if (!command(i, val)) { settingsNum++; Settings.prefs[i] = val; reload = true; save = true; } } if (save) Settings.save(); } if ("cookies" in json) { for(let i in json.cookies) { if (cs.list.indexOf(i) == -1) continue; if (!command(i, json.cookies[i])) { settingsNum++; cs(i, json.cookies[i]); reload = true; } } } let enginesNew = []; if ("customLinks" in json) { let changed = false; for (i in json.customLinks) { enginesNum++; changed = reload = true; customLinks._list[i] = json.customLinks[i]; enginesNew.push(json.customLinks[i]); } if (changed) ls("customLinks", customLinks._list); } if ("enginesHide" in json) { let changed = false; let list = []; for(let i = 0; i < json.enginesHide.length; i++) { if (enginesFind(json.enginesHide[i]) != -1 || enginesFind(json.enginesHide[i], enginesNew) != -1) { list[list.length] = json.enginesHide[i]; changed = reload = true; engineHideNum++; } } enginesHide = list; if (changed) ls("enginesHide", enginesHide); } if ("enginesSort" in json) { let changed = false; enginesSort._list = []; for(let i = 0; i < json.enginesSort.length; i++) { if (enginesFind(json.enginesSort[i]) != -1 || enginesFind(json.enginesSort[i], enginesNew) != -1) { changed = reload = true; enginesSort._list.push(json.enginesSort[i]); } } if (changed) ls("enginesSort", enginesSort._list); } if ("info" in json) { let changed = false; for(let i in json.info) { if (!(i in DB.info)) { DB.info[i] = json.info[i]; changed = true; } } if (changed) DB.infoSave(); } if ("epNumFix" in json) { let changed = false; for(let i in json.epNumFix) { if (!(i in episodeNumberFix.list)) { episodeNumberFix.list[i] = json.epNumFix[i]; changed = true; } } if (changed) episodeNumberFix.save(); } if ("themes" in json) { let changed = false; for(let i in json.themes) { if (!(i in Settings.themes._default)) { Settings.themes.list[i] = json.themes[i]; changed = true; themesNum++; } } if (changed) Settings.themes.save(); } if ("customShows" in json) { let changed = false, upgrade = versionsCompare(json.version, "1.71") < 0; for(let i in json.customShows.l) { let data = json.customShows.l[i]; if (upgrade) { for (let n = 0; n < data[1].length; n++) { if (data[1][n].length == 6) { data[1][n][6] = data[1][n][5]; //custom show days of the week data[1][n][5] = 1; } } } customShows._list.l[i] = data; changed = true; customShowsNum++; } //remove duplicate let newData = {}, names = {}; for(let f in customShows._list.l) { let data = customShows._list.l[f], name = data[0], seen = {}, id = f; if (name in names) { data[1] = [].concat(names[name].d[1], data[1]); id = names[name].i; } data[1] = data[1].sort().filter(function(item) { var k = JSON.stringify(item); return k in seen ? false : (seen[k] = true); }); names[name] = { i: f, d: data }; newData[id] = data; } customShows._list.l = newData; if (changed) { customShows._list.i = Math.max(json.customShows.i, customShows._list.i); customShows.save(); customShows.init(customShows._list); customShows(); } } txt = settingsNum + " setting" + (settingsNum > 1 ? "s" : "") + " imported" + ((hiddenNum || watchedNum) ? " and marked " : ""); if (hiddenNum) txt += hiddenNum + " show" + (hiddenNum > 1 ? "s" : "") + " as hidden"; if (watchedNum) txt += (hiddenNum ? ", " : " ") + watchedNum + " as watched"; if (themesNum) txt += (themesNum ? ", " : " ") + themesNum + " theme" + (themesNum > 1 ? "s" : ""); if (customShowsNum) txt += (customShowsNum ? ", " : " ") + customShowsNum + " custom show" + (customShowsNum > 1 ? "s" : ""); } alert(txt); if (reload) window.location.reload(); } a.addEventListener("click", function restoreSettings_link_evtClick(e) { e.preventDefault(); _prompt({ callback: function(data) { setTimeout(function() { restore(data); }); }, text: "Please enter the " + adeName + " settings text" }); }, false); content.append(span); content.append('

More...

'); span = span.cloneNode(true); i = span.firstChild; a = $(".clearColors")[0]; if (a) { a = a.cloneNode(true); i.parentNode.replaceChild(a, i.nextSibling); span.title = "Did you make a backup?"; i.innerHTML = SVG.clear; let moreOpt = $("div.moreOpt"); moreOpt.find("div").append(span); moreOpt.on("click", function() { moreOpt.attr("opened", true); }); } },//Settings.create() _backup: function Settings__backup() { let cookies = {}, str = "", obj = { version: adeVersion, settings: Settings.prefs }, add = function(name, o) { for(let i in o) { obj[name] = o; break; } }; for(let i = 0; i < cs.list.length; i++) { let v = cs(cs.list[i]); if (v !== null) { cookies[cs.list[i]] = v; } } add("cookies", cookies); add("hidden", _hidden); add("watched", watched._list); add("customLinks", customLinks._list); add("enginesHide", enginesHide); add("enginesSort", enginesSort._list); add("info", DB.info); add("epNumFix", episodeNumberFix.list); add("themes", Settings.themes.getCustomThemes()); add("customShows", customShows._list); str = JSON.stringify(obj); return str; }, backup: function Settings_backup() { let str = this._backup(); if (str) _prompt({ callback: function(){}, text: adeName + " Settings \nYou can save it in a normal textfile and restore it to another computer/browser.", value: str }); else alert("Nothing to backup"); }, callback: function Settings_callback(e, id, check) { Settings.prefs[id] = check ? 1 : 0; Settings.save(); }, save: function Settings_save(f) { ls("settings", this.prefs); }, show: function Settings_show(noBack) { /* if (noBack) Settings.box.attr("noback", ""); else Settings.box.removeAttr("noback"); */ hidePopups(); Settings.box.show(); setPopup(true); }, hide: function Settings_hide() { Settings.box.hide(); setPopup(false); Settings.box.find("div.moreOpt").removeAttr("opened"); }, colors: { default: [], //list of predefined colors max: 100, //max num of colors to remember inited: false, add: function Settings_colors_add(color, save) { color = color.toUpperCase(); if (color == "FFFFFF" || this.default.indexOf(color) != -1 || Settings.prefs.lastColors.indexOf(color) != -1) return; let colors = Settings.prefs.lastColors; colors[colors.length] = color; if (colors.length + 1 > this.max) colors.splice(0, colors.length - this.max); this.css(); if (save) this.save(); }, save: function Settings_colors_save(color) { Settings.save(); }, css: function Settings_colors_css() { let css = "", colors = Settings.prefs.lastColors; for(let i = 0; i < colors.length; i++) css += ".soft_cust" + i + "{background-color:#" + colors[colors.length - i - 1] + ";display:inline-block}\n"; $(".colors").toggleClass("nopre", (!Settings.prefs.lastColorsLine || Settings.prefs.lastColorsLine > 19) ? true : false); document.getElementById("customColorsCSS2").innerHTML = css; $('.colors [class^="color soft_"]').each(function(i) { this.title = "#" + new Colors().setColor($(this).css( "background-color" )).HEX.toUpperCase(); }); }, init: function Settings_colors_init() { $("#detailsTemplate div.colors .color").each(function(i, e) { if (!this.classList.contains( "none" )) Settings.colors.default[Settings.colors.default.length] = new Colors().setColor($(this).css( "background-color" )).HEX.toUpperCase(); }); let css = "", style = document.createElement("style"), style2 = document.createElement("style"), span = document.createElement("span"), box = document.createElement("div"), last = $("#detailsTemplate .colors"), colors = Settings.prefs.lastColors, max = Math.min(Settings.prefs.lastColorsShow, Settings.prefs.lastColors.length); $('.colors .none').each(function(i) { this.title = "Remove color"; }); $('.colors .picker').each(function(i) { this.title = "Custom color"; // this.classList.add("svg"); }); for(let i = 0; i < max; i++) { let cl = "soft_cust" + i; css += "." + cl + "{display:none;}\n"; span = span.cloneNode(true); span.className = "color " + cl; span.setAttribute("i", i); box.appendChild(span); let br = (Settings.prefs.lastColorsLine && !((i+1) % Settings.prefs.lastColorsLine)) ? document.createTextNode("\n") : document.createTextNode(" "); box.appendChild(br); } $("#customColorsCSS, #customColorsCSS2").remove(); let b = $(".customColors"); if (b.length) b.html(box.innerHTML); else $("#detailsTemplate .colors").append(box); style.innerHTML = css; style.id = "customColorsCSS"; style2.id = "customColorsCSS2"; box.className = "customColors"; $("head").append(style); $("head").append(style2); let c = []; for(let i = 0; i < colors.length; i++) { if (colors[i] && (""+colors[i]).match(/^([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/)) c[c.length] = colors[i].toUpperCase(); } Settings.prefs.lastColors = c; let that = Settings.colors; that.css(); if (that.inited) return; $( document ).off( "mouseover", ".color"); $( document ).off( "mouseout", ".color"); let coltimer; $( document ).on( "mouseover", ".colors", function(e) { clearTimeout(coltimer); if (e.target.classList.contains("color")) { var $this = $( e.target ); assignColor( $this.parents("div.entry").data( "series-id" ), $this.hasClass( "none" )? "" : $this.css( "background-color" ) ); } }); $( document ).on( "mouseout", ".colors", function(){ clearTimeout(coltimer); let $this = $(this); coltimer = setTimeout(function(){loadColor( $this.parents("div.entry").data( "series-id" ) );}, 100); }); $( document ).on( "mousedown", "div.colors .color", function(e) { if (e.which != 2) return; let col = new Colors().setColor($(this).css( "background-color" )).HEX.toUpperCase(), index = Settings.prefs.lastColors.indexOf(col); if (index != -1) { Settings.prefs.lastColors.splice(index, 1); Settings.colors.css(); Settings.colors.save(); } e.preventDefault(); }); that.inited = true; }//Settings.colors.init() },//Settings.colors themes: { _default: { "" : { name: "Default", isDark: false, css: null }, dark: { name: "Dark", isDark: true, css: multiline(function(){/* /* Dark Theme *//* body { background-color: #191919 !important; } body, .header h4, #account-popup-content, #settings-popup .content, #manage-cushows-popup-content, #manage-links-popup-content, #changesLogBox { color: #E0DEDE; } body.archive { background-color: #292929 !important; } a { color: #737373; } .title:hover { background: #D2D2D2 !important; } #searchbar { background-color: rgb(76, 76, 76); } #account-popup-content, #settings-popup .content, #manage-cushows-popup-content, #manage-links-popup-content, #changesLogBox { background: rgb(76, 76, 76) !important; } #searchResults a { color: #D2D2D2; fill: #D2D2D2; } svg, #account-popup-content .content a, #settings-popup .content a, #manage-cushows-popup-content a, #manage-links-popup-content a, #changesLogBox, #noChangesLog > a { color: #D2D2D2 !important; fill: #D2D2D2 !important; } .close:hover, .back:hover, .back:hover svg, #cushows-list > li:hover, #cushows-list > li:hover *:not(.color), #cushows-list.opened > li.opened, #cushows-list.opened > li.opened *:not(.color), #cushows-list.opened > li.opened .color > .colors, #manage-links-popup .content > div.dragging:not(.hide), #manage-links-popup .content > div.dragging:not(.hide) *, #manage-links-popup .content:not(.dragging) > div:hover, #manage-links-popup .content:not(.dragging) > div:hover * { color: rgb(76, 76, 76) !important; fill: rgb(76, 76, 76) !important; } #cushows-list > li:hover, #cushows-list.opened > li.opened, #cushows-list.opened > li.opened .color > .colors, #manage-links-popup .content > div.dragging:not(.hide), #manage-links-popup .content:not(.dragging) > div:hover { background-color: #D2D2D2; border: 1px dotted grey; } div.entry:not([color]) svg { fill: white !important; } div.entry[color="black"] svg, .cl_added > span:first-child, .cl_changed > span:first-child, .cl_removed > span:first-child, .cl_notfixed > span:first-child, .cl_fixed > span:first-child { color: black; fill: black !important; } span.button, .header, .header h4 { background: rgb(112, 112, 112) !important; } .details a, .day a { color: inherit !important; } .header a { color: inherit; } body.collapseMulti div.day:not(.expand):not(.opened) div.entry.multif div.title:after { background-color: white; border-left: 1px solid black; } .details:hover, .engines:hover { background:none !important; } div.date { color: #8c8c8c; background-color: #4c4c4c; } div.today div.date { background-color: rgb(190, 150, 0); } div.today div.date { color: black; } div.day, body.archive div.day { border: 1px solid #595959; } body.archive div.day { background-color: #191919; } .entry:not([color="white"]) div.details > span.engines > br + div.tools, .entry:not([color="white"]) div.details, .entry:not([color="white"]) div.colors, div.entry { border-top: 1px dashed #4c4c4c; } /* highlight opened entry *//* .entry[opened] { border: 1px solid white; border-top: 1px solid white; } /* .entry[opened][color="black"] { border: 1px solid black; border-top: 1px solid black; } *//* #resultsBecauseNoOneChecks, #searchResults .description { color: #b9b2b2; } #cushows-list > li.updated, #cushows-list > li.new { border-width: 1px; } #cushows-list > li.edit { border: 1px solid white; } #cushows-list > li.selected:not(.edit) { border: 1px dotted white; } #cushows-list > li.selected:not(.edit) { color: forestgreeen; } #cushows-list > li.edit.delete, #cushows-list > li.edit.delete > * { color: coral; } #searchResults div.entry { border-color: #6c6c6c; } #searchResults div.entry.separating { border-color: #aaa; } .desc > div.entry { border-top: none; border-bottom: 1px dashed #ccc; } .desc > div.entry.separating { border-bottom: 1px solid #555; } :not(.desc) > div.entry.separating { border-top: 1px solid; } #searchIcon > svg { fill: #737373 !important; vertical-align: middle; } .cookieIconHoles { fill: #000; } .warning.info, .warning.info > a { color: #FFBFBF; } div.undoBar * { color: black; } /* END DARK THEME *//* */}, true) }//dark theme },//themes.list._default list: {}, init: function Settings_themes_nit() { for (let theme in this._default) { this.list[theme] = this._default[theme]; } let themes = ls("themes") || {}; for(let theme in themes) { this.list[theme] = themes[theme]; } let head = document.getElementsByTagName("head")[0]; for(let cssName in this.list) { if (!this.list[cssName].css) continue; let name = cssName.replace(/[^a-zA-Z0-9_-]/g, "_"), id = "theme_" + name, style = document.getElementById(id) || document.createElement("style"), reg = function(a) { let r = "body." + id; if (a.toLowerCase() != "body") r += " " + a; return r; }; style.id = id; style.innerHTML = this.list[cssName].css.replace(/^(?!\*\/)(body|\w|[\.#\[\:\$@\*])/gm, reg).replace(/(\/\*([\s\S]*?)\*\/)|(\/\/(.*)$)/gm, '').replace(/[\n\t]*/g, ""); head.appendChild(style); } this.quickOverrideInit(); // this.quickOverride(); }, //Settings.themes.init() load: function Settings_themes_load(theme) { if (typeof(theme) == "undefined") { theme = Settings.prefs.theme; } else { Settings.prefs.theme = theme; Settings.save(); } let data = Settings.themes.list[theme]; if (!data) data = theme ? Settings.themes.list.dark : Settings.themes.list[""]; let body = $("body"), className = "theme_" + theme; if (Settings.themes.prev) body.toggleClass(Settings.themes.prev, false); if (theme) { body.toggleClass(className, true); Settings.themes.prev = className; } let disqusFrameRemoved = false, disqusDiv = document.getElementById("disqus_thread"); disqusDiv && disqusDiv.addEventListener('DOMNodeInserted', e => { if (e.target.tagName != "IFRAME") return; // $("#disqus_recommendations").remove(); e.target.addEventListener("load", e=> { // if (!disqusFrameRemoved && disqusDiv.querySelector("iframe") === e.target) // return e.target.parentNode.removeChild(e.target); if (!e.target.src) try{return e.target.parentNode.removeChild(e.target);}catch(er){return;} //remove ads try { e.target.contentWindow && e.target.contentWindow.postMessage({id: "ade", func: "disqusTheme", args: [data.isDark], return: null}, "https://disqus.com"); } catch(er){console.log(er);} }); }, false); $("#disqus_thread").find('iframe[src^="https://disqus.com"]').each(function(o) { try { this.contentWindow.postMessage({id: "ade", func: "disqusTheme", args: [data.isDark], return: null}, "https://disqus.com"); } catch(er){console.log(er);} }); $("select#theme").val(theme); },//Settings.themes.load() getCustomThemes: function Settings_themes_getCustomThemes() { let themes = Object.assign({}, this.list); for(let t in this._default) { if (t in themes && themes[t] == this._default[t]) delete themes[t]; } return themes; }, quickOverrideStyle: [], quickOverrideInit: function Settings_themes_quickOverrideInit() { if (this.quickOverride.inited) return; for( let i in Settings.prefs.themeColors) { let id = "CSS_override_" + i; if (document.getElementById(id)) continue; this.quickOverrideStyle[i] = document.createElement("style"); this.quickOverrideStyle[i].id = id; document.getElementsByTagName("head")[0].appendChild(this.quickOverrideStyle[i]); } this.quickOverride.inited = true; }, quickOverride: function Settings_themes_quickOverride(data, commonOnly) { if (typeof(data) != "object") data = Settings.prefs.themeColors; for(let i in data) { let val = "" + data[i], c1 = "", c2 = "", r = this.quickOverrideTempl._common.css, css = ""; if (val.length == 3) { val = val[0] + val[0] + val[1] + val[1] + val[2] + val[2]; } c1 = val; if (val) c2 = new Colors().setColor(val).rgbaMixBlack.luminance > 0.22 ? "000" : "FFF"; if (val && !commonOnly) r += this.quickOverrideTempl[i].css || ""; r = r .replace(/\{ID\}/g, i) .replace(/\{C1\}/g, c1) .replace(/\{C2\}/g, c2); if (val) css += r; this.quickOverrideStyle[i].innerHTML = css; if (this.quickOverrideStyle[i].nextSibling) { document.getElementsByTagName("head")[0].appendChild(this.quickOverrideStyle[i]); } } },//Settings.themes.quickOverride() quickOverrideTempl: { _common: { css: multiline(function(){/* #themeColorBox_{ID} > .color { background-color: #{C1} !important; color: #{C2} !important; } /* #themeColorBox_{ID} > .color { border-color: #{C2} !important; }*//* */}) }, today: { css: multiline(function(){/* .example_today, div.today > .date { color: #{C1} !important; fill: #{C1} !important; } */}), title: "Leave empty to use theme's color", label: "Today text", sample: "today" }, todayBg: { css: multiline(function(){/* .example_today, div.today > .date { background-color: #{C1} !important; } */}), title: "Leave empty to use theme's color", label: "Today background", sample: "today" }, todayBorder: { css: multiline(function(){/* .example_today, div.today { border-color: #{C1} !important; -webkit-box-shadow: 0px 0px 10px 0px #{C1} !important; -moz-box-shadow: 0px 0px 10px 0px #{C1} !important; box-shadow: 0px 0px 10px 0px #{C1} !important; } */}), title: "Leave empty to use theme's color", label: "Today border", sample: "today" }, bg: { css: multiline(function(){/* .example_text, .example_day, body, body[class*="theme_"] { background-color: #{C1} !important; } */}), title: "Leave empty to use theme's color", label: "Background", // sample: "text,day" sample: "text" }, text: { css: multiline(function(){/* .example_text, body #content > :not(.popup) #searchIcon > svg, body[class*="theme_"] > :not(.popup) #searchIcon > svg, body #content > :not(.popup), body[class*="theme_"] > :not(.popup) svg, body #content > :not(.popup) svg body[class*="theme_"] > :not(.popup), body #content > :not(.popup) a { color: #{C1} !important; fill: #{C1} !important; } */}), /* css: multiline(function(){/* .example_text, body #content > :not(.popup) > *:not(.days), body #content > :not(.popup) > *:not(.days) *, body[class*="theme_"] > :not(.popup) > *:not(.days) *, body #content > :not(.popup) > :not(.days), body #content > :not(.popup) > :not(.days) a, body[class*="theme_"] > :not(.popup) > :not(.days) a { color: #{C1} !important; fill: #{C1} !important; } */ // }), title: "Leave empty to use theme's color", label: "Text", sample: "text" }, /* day: { css: multiline(function(){/* .example_day, div.entry:not([color]), body[class*="theme_"] div.entry:not([color]) { color: #{C1} !important; fill: #{C1} !important; } */ /* }), title: "Leave empty to use theme's color", label: "Day text", sample: "day" }, */ date: { css: multiline(function(){/* .example_date, body div.day:not(.today) div.date, body[class*="theme_"] div.day:not(.today) div.date { color: #{C1} !important; fill: #{C1} !important; } */}), title: "Leave empty to use theme's color", label: "Date text", sample: "date" }, dateBg: { css: multiline(function(){/* .example_date, body div.day:not(.today) div.date, body[class*="theme_"] div.day:not(.today) div.date { background-color: #{C1} !important; } .example_date, body div.day:not(.today), body[class*="theme_"] div.day:not(.today) { border-color: #{C1} !important; } */}), title: "Leave empty to use theme's color", label: "Date background", sample: "date" } },//quickOverrideTempl save: function themesSave() { ls("themes", this.getCustomThemes()); }, },//themes lastUpdate: new Date(), lastUpdateDiv: null, lastUpdateShow: function Settings_lastUpdateShow() { if (!this.lastUpdateDiv) { this.lastUpdateDiv = document.createElement("span"); this.lastUpdateDiv.className = "lastupdate"; const footer = document.querySelector("div.footer"); footer && footer.appendChild(this.lastUpdateDiv); } this.lastUpdateDiv.textContent = "Page updated " + this.lastUpdate; } };//Settings Object.seal(Settings); let episodeTools = (function() { const SEID = 1000000; function fromNode(node) { let r; if (node._episode) r = node._episode; else { r = node._title && node._title._titleDefault ? node._title._titleDefault : $(node).find("div.title").text(); r = r.substring(r.lastIndexOf(" ") + 1).replace(/\s+$/g, "").trim(); if (!r.match(/(^S[0-9]+)?E[0-9]+$/i)) return ""; } return r; } return { id: function episodeTools_id(s, e) { s = this.split(s, e); e = s[1]; s = ~~s[0]; return typeof(e) == "undefined" ? s : s * SEID + ~~e; }, id2se: function episodeTools_id2se(se) { se = ~~se; return [Math.floor(se / SEID), se % SEID]; }, full: function episodeTools_full(s, e) { if (s instanceof HTMLElement) s = fromNode(s); if (typeof(e) == "undefined" && typeof(s) == "number" && s >= SEID) s = this.id2se(s); if (s instanceof Array) { e = s[1]; s = s[0]; } if (typeof(e) == "undefined" && typeof(s) == "string") return s.replace(/^\s*(S?0*([0-9]+)?E)?0*([0-9]+)\s*$/i, function(a, b, c, d) { return (~~c ? "S" + pad(~~c) : "") + "E" + pad(~~d); }); if (typeof(e) == "undefined") { e = s; s = 0; } s = ~~s; e = ~~e; return (s ? "S" + pad(s) : "") + "E" + pad(e); }, short: function episodeTools_short(s, e) { if (s instanceof HTMLElement) s = fromNode(s); if (typeof(e) == "undefined" && typeof(s) == "number" && s >= SEID) s = this.id2se(s); if (s instanceof Array) { e = s[1]; s = s[0]; } if (typeof(e) == "undefined" && typeof(s) == "string") return s.replace(/^\s*(S?0*([0-9]+))?E0*([0-9]+)|0*([0-9]+)\.0*([0-9]+)\s*$/i, "$2$4E$3$5").replace(/^E/, ""); return ("" + (typeof(e) == "undefined" ? ~~s : ~~s + "E" + ~~e)).replace(/^0*E*/, ""); }, split: function episodeTools_split(s, e) { if (s instanceof HTMLElement) s = fromNode(s); if (typeof(e) == "undefined" && typeof(s) == "number" && s >= SEID) s = this.id2se(s); if (s instanceof Array) { e = s[1]; s = s[0]; } let m = ("" + (typeof(e) == "undefined" ? s : s + "E" + e)).match(/^\s*(S?0*([0-9]+)?E+)?0*([0-9]+)\s*$/i); if (m) return [~~m[2], ~~m[3]]; return typeof(e) == "undefined" ? [0, ~~s] : [~~s, ~~e]; } }; })(); function fileLoad(callback, ext) { let f = document.createElement("input"); f.type = "file"; if (typeof(ext) == "undefined") ext = ".json"; if (ext) f.setAttribute("accept", ext); function readFile(e) { f.removeEventListener("change", readFile, false); let files = f.files; if (!f.files.length) { alert('Please select a file!'); return; } let reader = new FileReader(); reader.onloadend = function(evt) { if (evt.target.readyState == FileReader.DONE) { callback(evt.target.result); } }; let blob = f.files[0].slice(0, f.files[0].size); reader.readAsBinaryString(blob); } f.addEventListener("change", readFile, false); f.click(); } function fileSave(name, data, type) { type = type ? type : 'text/json'; let blob = new Blob([data], {type: type}), a = document.createElement("a"); a.download = name; a.isTrigger = true; a.href = window.URL.createObjectURL(blob); a.dataset.downloadurl = [type, a.download, a.href].join(':'); $("#account-popup").append(a); a.click(); a.parentNode.removeChild(a); } function exportGetColors() { return Object.keys(DB.savedColors).map(function(i) { if (i.match(/[^0-9]/) || !DB.savedColors[i].match(/^#([0-9A-F]{6})|FFFFFF$/i)) return; return i + "=" + DB.savedColors[i].trim(); }).join(";"); } function pad(t, s, n) { n = n || 2; n = Math.max(n, ~~(("" + t).length)); s = String(s || "0").repeat(n); return (s + t).substr(-n); } function dateTimestamp() { let d = new Date(); return d.getFullYear() + pad(d.getMonth()+1) + pad(d.getDate()) + pad(d.getHours()) + pad(d.getMinutes()) + pad(d.getSeconds()); } function enginesBackup() { if (!enginesBackup.backup) enginesBackup.backup = window.engines; } function enginesRestore() { if (enginesBackup.backup) { window.engines = enginesBackup.backup; enginesBackup.backup = null; } } function enginesAdd(id) { for(let i = 0; i < _engines.length; i++) { if (_engines[i].name == id || _engines[i].host == id) return; } for(let i = 0; i < engines.length; i++) { if (engines[i].name == id || engines[i].host == id) { _enginesList.push(engines[i].host); _engines.push(engines[i]); Settings.pref("middleClick", _enginesList); return; } } } function enginesRemove(id) { for(let i = 0; i < _engines.length; i++) { if (_engines[i].name == id || _engines[i].host == id) { let n = _enginesList.indexOf(_engines[i].host); if (n != -1) _enginesList.splice(n, 1); Settings.pref("middleClick", _enginesList); _engines.splice(i, 1); return; } } } function enginesCheck(id) { for(let i = 0; i < _engines.length; i++) { // if (_engines[i].name == id || _engines[i].host == id) if (_engines[i].host == id) return i; } return -1; } function enginesFind(id, obj, field) { obj = typeof(obj) == "undefined" ? window.engines : obj; for(let i = 0; i < obj.length; i++) { if ((field && obj[i][field] == id) || (!field && (obj[i].name == id || obj[i].host == id))) return i; } return -1; } function enginesSort(list, save) { if (typeof(list) == "undefined") { list = ls("enginesSort") || []; save = true; } let newList = [], newEnginesList = [], engs = [window.engines, customLinks._list]; for(let i = 0; i < list.length; i++) { for(let n = 0; n < engs.length; n++) { let index = enginesFind(list[i], engs[n], "host"); if (index == -1 || newList.indexOf(engs[n][index].host) != -1) continue; newEnginesList[newEnginesList.length] = engs[n][index]; newList[newList.length] = engs[n][index].host; break; } } for(let i = 0; i < window.engines.length; i++) { if (newList.indexOf(window.engines[i].host) == -1) { newEnginesList[newEnginesList.length] = window.engines[i]; newList[newList.length] = window.engines[i].host; } } for(let i in customLinks._list) { if (newList.indexOf(i) == -1) { newEnginesList[newEnginesList.length] = customLinks._list[i]; newList[newList.length] = i; } } if (save) enginesSort._list = newList; window.engines = newEnginesList; } enginesSort.changed = function() { let list = []; for (let i = 0; i < enginesDefault.length; i++) { list[list.length] = enginesDefault[i].host; } for (let i in customLinks._list) { if (list.indexOf(i) == -1) list[list.length] = i; } return !isEqual(list, enginesSort._list); }; function isEqual (a, b) { if (typeof(a) == "undefined" || typeof(b) == "undefined") return false; for(let i in a) { if (typeof(a[i]) == "object") { if (!isEqual(a[i], b[i])) return false; } else if (!(i in b) || a[i] != b[i]) return false; } for(let i in b) { if (typeof(b[i]) == "object") { if (!isEqual(a[i], b[i])) return false; } else if (!(i in a) || a[i] != b[i]) return false; } return true; } function cleanName(id) { return id !== null ? id.replace(/[^a-zA-Z0-9-_]/g, "_") : ""; } function getHost(url) { let a = document.createElement('a'); a.href = url; return a.hostname; } function engineFixHost(engine) { if (engine.host) return; engine.host = getHost(engine.href); } function showHide(id, t) { let hidden = _hidden.indexOf(id); if (typeof(t) == "undefined") return hidden != -1; if (t == 2) t = hidden == -1 ? 1 : 0; switch(t) { case 0: _hidden.splice(hidden, 1); if (!DB.savedColors[id]) DB.infoRemove(id); hidden = false; break; case 1: if (hidden == -1) { _hidden.push(id); DB.infoAdd(id); } hidden = true; break; } let css = $("#css" + id); if (hidden) { if (!css.length) { let style = ""; $(style).appendTo("body"); } } else css.remove(); ls("hidden", _hidden); return hidden; } function command(id, val) { if (!command.list[id]) return false; try { command.list[id].func({preventDefault:function(){},stopPropagation:function(){}}, val); } catch(er) { return false; } return true; } command.list = {}; command.add = function(id, objId, func) { command.list[id] = { id: id, objId: objId, func: func }; }; /* watched checkbox */ function watched(entry) { if (entry._input.checked) watched.add(entry.getAttribute("data-series-id"), entry); else watched.remove(entry.getAttribute("data-series-id"), entry); watched.update(entry, entry._input.checked); } watched._list = ls("watched") || {}; watched._saving = false; watched.add = function(id, episode) { episode = episodeTools.short(episode); if (!watched._list[id]) watched._list[id] = []; if (watched._list[id].indexOf(episode) == -1) watched._list[id].push(episode); watched.save(); }; watched.remove = function(id, episode) { if (!watched._list[id]) return; episode = episodeTools.short(episode); let n = watched._list[id].indexOf(episode); if (n == -1) return; watched._list[id].splice(n, 1); if (!watched._list[id].length) delete watched._list[id]; watched.save(); }; watched.save = function(f) { if (watched._saving && !f) return; function func() { watched._saving = false; ls("watched", watched._list); } clearTimeout(watched._saving); if (f) func(); else watched._saving = setTimeout(func, 500); }; watched.has = function(entry) { let id = entry.getAttribute("data-series-id"); return watched._list[id] && watched._list[id].indexOf(episodeTools.short(entry)) != -1; }; watched.update = function(entry, enable) { if (enable) entry.setAttribute("watched", ""); else entry.removeAttribute("watched"); let span = $(entry).find(".title > span")[0]; entry.title = span.lastChild ? span.lastChild.textContent : span.textContent;// + " (" + text + ")"; entry._input.checked = enable; watched.checkboxTooltip(entry); }; watched.checkboxTooltip = function(entry) { let input = entry.querySelector('input[type="checkbox"]'); input.title = input.checked ? "Watched" : "Not watched"; if (entry.parentNode.id == "searchResults" || entry.classList.contains("searchResult")) input.title += "\n\nHold SHIFT key to check/uncheck all previous episides"; }; watched.attach = function(i,entry) { if (entry._input) return; let input = document.createElement("input"), id = entry.dataset.seriesId, episodeID = episodeTools.id(entry); setEpisodes([entry]); input.type = "checkbox"; input.checked = watched.has(entry); entry._input = input; input.addEventListener("mouseover", function(e) { watched.checkboxTooltip(entry); }, false); input.addEventListener("click", function(ev) { let isBatch = ev.shiftKey && (entry.parentNode.id == "searchResults" || entry.classList.contains("searchResult") && document.getElementById("searchBecauseNoOneChecks").value.trim() == "info:" + id); $('div.entry[data-series-id="' + id + '"]').each(function(i, _entry) { let _episodeID = episodeTools.id(_entry); if (_episodeID == episodeID || (isBatch && _episodeID < episodeID)) { _entry._input.checked = input.checked; watched(_entry); } }); }, false); let title = $(entry).find(".title")[0], text = "", div = null; if (!title) return; for(let i = 0; i < title.childNodes.length; i++) { if (title.childNodes[i].nodeType == 3) { text += title.childNodes[i].textContent; } else div = title.childNodes[i].cloneNode(true); } title.innerHTML = ""; title.appendChild(input); // if (div) // $(title).append(div) let span = document.createElement("span"); title.appendChild(span); if (div) span.appendChild(div); let titleSpan = document.createElement("span"); titleSpan.textContent = text.trim(); span.appendChild(titleSpan); if (!entry._title) { entry._title = titleSpan; entry._title._titleDefault = titleSpan.textContent; entry.setAttribute("data-title", titleSpan.textContent); } entry._title.textContent = episodeNumberFix(id, entry._title.textContent); watched.update(entry, input.checked); }; //watched.attach() /* custom links */ function customLinks(obj) { } customLinks._list = ls("customLinks") || {}; customLinks.show = function(noBack) { let div = $(customLinks.div); hidePopups(); div.show(); setPopup(true); }; customLinks.hide = function() { $(customLinks.div).hide(); setPopup(false); }; customLinks.manager = function customLinksManager(callback) { if (customLinks.div) return callback ? callback() : true; let html = multiline(function(){/* */});//html let popup = $(html).appendTo("#content"); customLinks.div = popup[0]; $(popup).find("[id^=account]").each(function() { this.id = this.id.replace("account", "manage-links"); }); let content = $(popup).find(".content").html(""); html = multiline(function(){/*
*/});//html $(html).appendTo(content.parent()); let engId = $("#engine-id"), engUrl = $("#engine-url"), engIcon = $("#engine-icon"), engName = $("#engine-name"), engForm = $("#engine-form"), engSubmit = $("#engine-submit"), engTags = $("#engine-tags"), engRes = $("#engine-res"), engReset = $("#engine-reset"), engSortReset = $("#sort-reset"), engResHidden = $('
Monsuno S01E01
').appendTo(popup), engRegexp = $("#engine-regexp"), engRegexpReplace = $("#engine-regexp-replace"), entry = $("div.entry"); if (entry.length) { entry = $(entry[rand(0, entry.length)]); engResHidden.attr("data-series-id", entry.attr("data-series-id")); engResHidden.attr("data-series-source", entry.attr("data-series-source")); engResHidden.attr("data-date", entry.attr("data-date")); engResHidden.find("div.title").text(entry.find("div.title").text()); } setAttr(popup, "changed", enginesSort.changed()); function change(e) { clearTimeout(change.timer); change.timer = setTimeout(function() { engResHidden.find(".details").remove(); let txt = engRegexp.val().trim(), reg = getRegexp(txt, engRegexpReplace.val().trim()), ok = txt ? reg.length : true; regexpCheck(reg); let eng = [{ name: engName.val(), host: engId.val().trim(), href: engUrl.val().trim(), icon: engIcon.val().trim(), regexp: reg }]; if (!eng[0].href.match(/[a-z]+:\/\//i)) eng[0].href = "http://" + eng[0].href; engineFixHost(eng[0]); entryOpen({target: $(engResHidden).find(".title")[0]}, eng); let list = engResHidden.find(".engines").children(), a = list.filter("a"), img = a.find("img")[0], children = engRes.children(), domain = getHost(eng[0].href) || null; img.setAttribute("src", eng[0].icon ? eng[0].icon : "https://www.google.com/s2/favicons?domain=" + domain); engRes.html(""); if (domain || a.text()) engRes.append(a); return; }, 300); buttonsUpdate(); }//change() function buttonsUpdate() { engSubmit.prop("disabled", !engName.val().trim() || !engUrl.val().trim() || engRegexp.hasClass("error")); engReset.prop("disabled", !(engName.val().trim() + engId.val() + engUrl.val() + engIcon.val() + engRegexp.val() + engRegexpReplace.val())); } engId.on("input change", change); engIcon.on("input change", change); engUrl.on("input change", change); engName.on("input change", change); engTags.on("change", function(e) { let start = engUrl[0].selectionStart, end = engUrl[0].selectionEnd, endNew = start + e.target.value.length, startNew = endNew, txt = engUrl.val(); engUrl.val(txt.substring(0, start) + e.target.value + txt.substring(end)); engUrl[0].selectionStart = startNew; engUrl[0].selectionEnd = endNew; engUrl.focus(); engUrl.trigger("input"); e.target.value = ""; }); function regexpCheck(reg) { let txt = engRegexp.val().trim(); if (!reg) reg = getRegexp(txt, ""); let ok = txt ? reg.length : true; engRegexp.toggleClass("error", !ok); } engRegexp.on("input change", change); engRegexpReplace.on("input change",change); engReset.click(function(e) { clearTimeout(change.timer); engRes.html(""); setTimeout(buttonsUpdate); }); buttonsUpdate(); function flash(obj, color, scroll) { if (!obj[0].parentElement) return; let p = obj[0].parentElement.getBoundingClientRect(), el = obj[0].getBoundingClientRect(); if (typeof(scroll) == "undefined") scroll = true; if (scroll) { if (p.bottom < el.bottom) { obj[0].parentElement.scrollTop = obj[0].parentElement.scrollTop + (el.top - p.bottom) + el.height + 3; } if (el.top < p.top) { obj[0].parentElement.scrollTop = obj[0].parentElement.scrollTop + (el.bottom - p.top) - el.height - 3; } } obj.toggleClass("update", false); obj.css("background-color", color ? color : "#90FF90"); setTimeout(function() { obj.toggleClass("update", true); obj.removeAttr("style"); }, 100); } engForm.on("submit", function(e) { e.preventDefault(); let reg = getRegexp(engRegexp.val().trim(), engRegexpReplace.val()); let engine = { name: engName.val().trim(), href: engUrl.val().trim(), host: engId.val().trim(), icon: engIcon.val().trim() }; if (engine.icon === "") delete engine.icon; if (reg.length) { engine.regexp = reg; } if (!engine.href.match(/[a-z]+:\/\//i)) engine.href = "http://" + engine.href; // engUrl.val(engine.href); engineFixHost(engine); let id = "engine_" + cleanName(engine.host), update = $("#" + id), exists = customLinks._list[engine.host]; if (!engine.name || !engine.href || engine.href == "http://") return false; let equal = false, n = -1; for(let i = 0; i < window.engines.length; i++) { if (window.engines[i].host == engine.host) { equal = isEqual(window.engines[i], engine); n = i; break; } } if (equal) { flash(update); return false; } if (!exists || update.length) { customLinks._list[engine.host] = engine; if (update.length) { if (n > -1) window.engines[n] = engine; } else window.engines.push(engine); ls("customLinks", customLinks._list); customLinksAddCss(id); } function updater(update) { flash($(update)); updateDetails(); } if (update.length) { if (exists) { for (let i = 0; i < enginesDefault.length; i++) { if (isEqual(enginesDefault[i], engine)) { update.find(".del").trigger("click"); updateDetails(); return; } } } update.replaceWith(create(engine, !exists ? updater : function(update) { flash($(update)); })); let entry = $("div.entry").find(".engines"); entry.each(function() { $(this).find("." + id).filter("a.link").attr("href", parseLink(this.parentNode.parentNode, engine).href).contents().filter(function() { if (this.nodeType === 3) this.textContent = engine.name; }); }); } else { let last = content.children(":last-child"); content.append(create(engine, updater)); // updateDetails(); } engName.val(""); engId.val(""); engIcon.val(""); engUrl.val(""); engRegexp.val(""); engRegexpReplace.val(""); buttonsUpdate(); updateDetails(); });//engForm.submit() function updateDetails() { let clone = engResHidden.clone(); clone.find(".details").remove(); $("body").append(clone); let opened = $('.details[style="display: block;"]').toggleClass("details", false); force = true; clone.find(".title").trigger("click"); opened.toggleClass("details", true); setTimeout(function() { $('div:not([id]) > .details').find(".engines").replaceWith(clone.find(".engines")); $('div:not([id]) > .details').find(".engines").each(function() { for(let i = 0; i < window.engines.length; i++) { let eng = window.engines[i], id = "engine_" + cleanName(eng.host); $(this).find("." + id).filter("a.link").attr("href", parseLink(this.parentNode.parentNode, eng).href); } }); clone.remove(); }, 300); } engSortReset.click(function(e) { // e.stopPropagation(); e.preventDefault(); let host = engId.val(), name = engName.val(), href = engUrl.val(), icon = engIcon.val(), list = []; for (let i = 0; i < enginesDefault.length; i++) { list[list.length] = enginesDefault[i].host; } for (let i in customLinks._list) { list[list.length] = customLinks._list[i].host; } enginesSort(list, true); ls("enginesSort", []); updateDetails(); $(customLinks.div).remove(); customLinks.div = null; popup.removeAttr("changed"); customLinks.manager(function() { if (host || name || href) { $("#engine-id").val(host); $("#engine-name").val(name); $("#engine-icon").val(icon); let url = $("#engine-url"); url.val(href); url.trigger("input"); } }); customLinks.show(); }); let dragged = null, draggedNext = null; document.body.addEventListener('dragover', dndEvent, false); content[0].addEventListener('drop', dndEvent, false); content[0].addEventListener('dragend', dndEvent, false); function dndEvent(e) { let r = null; switch(e.type) { case "mousedown": // if (typeof(e.target.className) != "string" || e.target.className.indexOf("dndh") != -1) if (typeof(e.target.className) == "string" && e.target.className.indexOf("dndh") != -1) dragged = e.target.parentNode; break; case "dragstart": if (!dragged) { return; } e.dataTransfer.effectAllowed = 'move'; dragged = this; draggedNext = this.nextElementSibling; dragged.classList.add("dragging"); this.parentNode.classList.add("dragging"); setTimeout(function() { dragged.classList.add("hide"); }); // e.dataTransfer.setData('application/x-moz-node', dragged); e.dataTransfer.setDragImage(dragged, 0, 0); e.dataTransfer.setData('text/plain', ""); break; case "dragenter": if (!dragged) { if (e.stopPropagation) e.stopPropagation(); if (e.preventDefault) e.preventDefault(); // Necessary. Allows us to drop. return; } let node = this, up = (node.nextSibling == dragged), moveold = up ? node : node.nextSibling, movenew = dragged; node.parentNode.insertBefore(movenew, moveold); break; case "dragover": if (!dragged) { if (e.stopPropagation) e.stopPropagation(); if (e.preventDefault) e.preventDefault(); // Necessary. Allows us to drop. return; } let p = e.target; while(p && p != content[0]) p = p.parentNode; e.dataTransfer.dropEffect = p ? 'move' : "none"; if (!p) { if (draggedNext) dragged.parentNode.insertBefore(dragged, draggedNext); else dragged.parentNode.appendChild(dragged); } if (e.stopPropagation) e.stopPropagation(); if (e.preventDefault) e.preventDefault(); // Necessary. Allows us to drop. r = false; break; case "dragleave": break; case "dragend": if (!dragged) return; dragged.classList.remove("dragging"); dragged.classList.remove("hide"); let div = document.querySelectorAll('#manage-links-popup-content .content [draggable]'), list = []; [].forEach.call(div, function (col) { list[list.length] = col._engine.host; }); dragged.parentNode.classList.remove("dragging"); enginesSort(list, true); ls("enginesSort", list); setAttr(popup, "changed", enginesSort.changed()); updateDetails(); dragged = false; break; case "drop": if (!dragged) return; if (e.stopPropagation) e.stopPropagation(); if (e.preventDefault) e.preventDefault(); // Necessary. Allows us to drop. break; } if (r !== null) return r; } function create(engine, callback) { let div = document.createElement("div"), id = "engine_" + cleanName(engine.host), cb = createCheckbox(id, "", enginesHide.indexOf(engine.host) == -1, function(e, id, checked) { if (checked) enginesHide.splice(enginesHide.indexOf(engine.host), 1); else enginesHide.push(engine.host); ls("enginesHide", enginesHide); }, ["Visible", "Hidden"]), dndHandle = document.createElement("span"); div._engine = engine; div.id = id; content[0].setAttribute("draggable", true); div.setAttribute("draggable", true); div.addEventListener('dragstart', dndEvent, false); div.addEventListener('dragenter', dndEvent, false); div.addEventListener("mousedown", dndEvent, false); dndHandle.innerText = "☰"; dndHandle.className = "dndh"; div.appendChild(dndHandle); div.appendChild(cb); let clone = engResHidden.clone(); $("body").append(clone); clone.find(".details").remove(); entryOpen({target: $(clone).find(".title")[0]}, [engine]); let n = 100; setTimeout(function loop() { // let list = clone.find(".engines").children().filter(".engine_" + cleanName(engine.host)), let list = clone.find(".engines").children(); if (!list.length && n--) { setTimeout(loop); return; } let a = list.filter("a"), img = a.find("img")[0], def = false; for (let i = 0; i < enginesDefault.length; i++) { if (enginesDefault[i].host == engine.host) { def = true; break; } } $(div).append(img); $(div).append($("
").attr("title", a[0].textContent + "\n" + a[0].href).append(a).append('*')); if (def) $(div).toggleClass("def", true); clone.remove(); let editBox = $('').appendTo(div); $('' + SVG.edit + '').appendTo(editBox).click(function(e) { engId.val((getHost(engine.href) == engine.host) ? "" : engine.host); engName.val(engine.name); engUrl.val(engine.href.replace(/http:\/\//i, "")); engIcon.val(engine.icon || ""); let reg = engine.regexp || [], regexp = [], repl = []; for(let i = 0; i < reg.length; i++) { regexp[regexp.length] = reg[i][0]; repl[repl.length] = reg[i][1]; } engRegexp.val(regexp.join("\n")); engRegexpReplace.val(repl.join("\n")); engRegexp.trigger("input"); engId.trigger("input"); }); if (customLinks._list[engine.host]) { $('' + SVG.del + '') .appendTo(editBox) .click(function(e) { e.stopPropagation(); e.preventDefault(); flash($("#" + id), e.isTrigger ? null : "#FF9090"); let scroll = $(customLinks.div).find(".content")[0].scrollTop; let _engine = Object.assign(Array.isArray(engine) ? [] : {}, engine); setTimeout(function() { let host = engId.val(), name = engName.val(), href = engUrl.val(), icon = engIcon.val(), engine = _engine, update = false; delete customLinks._list[engine.host]; for(let i = 0; i < window.engines.length; i++) { if (window.engines[i].host == engine.host) { for(let d = 0; d < enginesDefault.length; d++) { if (enginesDefault[d].host == engine.host) { update = d; break; } } if (update !== false) window.engines[i] = enginesDefault[update]; else { let index = enginesSort._list.indexOf(engine.host); if (index != -1) { enginesSort._list.splice(i, 1); ls("enginesSort", enginesSort._list); } window.engines.splice(i, 1); } break; } } ls("customLinks", customLinks._list); if (update === false) { $("#" + id).remove(); $(".engines").find("." + id).remove(); $("." + id).toggleClass(id, false); $("#css_" + id).remove(); let index = enginesHide.indexOf(engine.host); if (index != -1) { enginesHide.splice(index, 1); ls("enginesHide", enginesHide); } } $(customLinks.div).remove(); customLinks.div = null; customLinks.manager(function() { if (update !== false) { for(let i = 0; i < window.engines.length; i++) { if (window.engines[i].host == engine.host) { engine = Object.assign(Array.isArray(window.engines[i]) ? [] : {}, window.engines[i]); break; } } let aNew = $("#manage-links-popup").find("#" + id).find("a.link"); $('.details') .find(".engines") .find("a." + id) .each(function() { $(this).attr("href", parseLink(this.parentNode.parentNode.parentNode, engine).href); }) .contents() .filter(function() { if (this.nodeType === 3) this.textContent = aNew.text(); }); } if (host || name || href) { $("#engine-id").val(host); $("#engine-name").val(name); $("#engine-icon").val(icon); let url = $("#engine-url"); url.val(href); url.trigger("input"); } if (scroll) $(customLinks.div).find(".content")[0].scrollTop = scroll; }); customLinks.show(); updateDetails(); }, 300); }); } if (callback) callback(div); }); return div; }//create(); // enginesBackup(); let eng = window.engines, n = eng.length; function finished() { if (!--n) callback(); } for(let i = 0; i < eng.length; i++) { if (eng[i].host == "airdates.tv" && eng[i].name == "edit") continue; content.append(create(eng[i], callback ? finished : null)); } // setTimeout(enginesRestore,100); };//customLinks.manager() function customLinksAdd() { let listNew = [], remove = [], list = []; for(let l in customLinks._list) { listNew.push(customLinks._list[l]); } let hosts = []; for(let n = 0; n < window.engines.length; n++) { hosts[hosts.length] = window.engines[n].host; enginesDefault[enginesDefault.length] = window.engines[n]; } for(let i = 0; i < listNew.length; i++) { let n = hosts.indexOf(listNew[i].host); if (n != -1) window.engines[n] = listNew[i]; else list.push(listNew[i]); customLinks._list[listNew[i].host] = listNew[i]; } ls("customLinks", customLinks._list); window.engines = window.engines.concat(list); enginesSort(); let css = [], css2 = []; for (let i = 0; i < window.engines.length; i++) { let id = "engine_" + cleanName(window.engines[i].host); customLinksAddCss(id); } customLinks.manager(); $(customLinks.div).remove(); customLinks.div = null; /* middle click on day's title opens selected engines for user's shows */ _enginesList = Settings.pref("middleClick") || []; if (!(_enginesList instanceof Array)) _enginesList = []; let engines = enginesBackup.backup ? enginesBackup.backup : window.engines, del = [], add = []; for(let i = 0; i < _enginesList.length; i++) { let found = false; for (let n = 0; n < engines.length; n++) { if (engines[n].name == _enginesList[i]) _enginesList[i] = engines[n].host; if (engines[n].host == _enginesList[i]) { _engines.push(engines[n]); /* if (!i && engines[n].host == "thepiratebay.org") { // sort by date instead of seeds engines[n].href = engines[n].href.replace(/\.se\//, ".org").replace(/\/0\/7\/0$/, "/0/3/0"); } */ found = true; break; } } if (!found) del.push(_enginesList[i]); } for(let i = 0; i < del.length; i++) { _enginesList.splice(_enginesList.indexOf(del[i]), 1); } let l = _enginesList.length; try { _enginesList = Array.from(new Set(_enginesList)); }catch(er){} if (l != _enginesList.length) Settings.pref("middleClick", _enginesList); }//customLinksAdd() function customLinksAddCss(id) { let css = 'body:not(.' + id + ') .engines .' + id + "{display:none;}", css2 = 'body:not(.' + id + ') #' + id + " img"; css2 += ',body:not(.' + id + ') #' + id + " a.link"; css2 += "{font-style: italic; opacity: 0.5;}"; $('').html(css+css2).appendTo("head"); } function setAttr(popup, attr, val) { if (val) popup.attr(attr, true); else popup.removeAttr(attr); } /* colors manager */ function colorsManager() { let html = multiline(function(){/* */});//html let popup = $(html).appendTo("#content"); colorsManager.div = popup[0]; }//colorsManager() colorsManager.show = function(noBack) { let div = $(colorsManager.div); /* if (noBack) div.attr("noback", ""); else div.attr("noback"); */ hidePopups(); div.show(); setPopup(true); }; colorsManager.hide = function() { $(colorsManager.div).hide(); setPopup(false); }; function createCheckbox(id, label, cookie, callback, title, className) { let span = document.createElement("span"), // checkon = document.createElement("span"), // checkoff = document.createElement("span"), a = document.createElement("a"), check = typeof(cookie) == "boolean" ? cookie : cs(cookie) ? true : false; if (title) { // checkon.title = title[0]; // checkoff.title = title[1] || title[0]; a.title = title[2] || title[0]; } a.className = "checkbox " + id + " " + (typeof(className) == "undefined" ? "filter" : className); span.className = "checkbox"; /* checkon.className = "checkon nu"; checkoff.className = "checkoff nu"; checkon.innerHTML = "☑"; // checkon.innerHTML = ''; checkoff.innerHTML = "☐"; // checkoff.innerHTML = ''; // a.href = "#"; span.appendChild(checkon); span.appendChild(checkoff); */ span.appendChild(document.createTextNode(label)); a.appendChild(span); $(a).insertBefore("#nu-showing"); let func = function(e, val) { e.preventDefault(); // e.stopPropagation(); let check = span.hasAttribute("checked"); if (val !== undefined) check = !val; if (check) span.removeAttribute("checked"); else span.setAttribute("checked", "checked"); $(".calendar").toggleClass(id, !check); $("body").toggleClass(id, !check); if (typeof(cookie) != "boolean") cs(cookie, check ? 0 : 1); return (typeof(callback) == "function") ? callback(e, id, !check) : e; }; command.add(cookie, id, func); a.addEventListener("click", func, false); if (check) span.setAttribute("checked", "checked"); /* //real checkboxes let box = document.createElement("span"), labelNode = document.createElement("label"), checkbox = document.createElement("input"), checkboxId = "cb_" + id, suf = "", i = 1; checkbox.type = "checkbox"; box.className = (typeof(className) == "undefined" ? "filter " : className + " ") + id; if (title) box.title = title[0]; labelNode.textContent = label; box.appendChild(checkbox); box.appendChild(labelNode); while($("#" + checkboxId + suf).length) { suf = "_" + i++; } checkbox.addEventListener("change", func, false); checkbox.id = checkboxId + suf; checkbox.checked = check; labelNode.setAttribute("for", checkbox.id); $(box).insertBefore("#nu-showing"); */ $(".calendar").toggleClass(id, check); $("body").toggleClass(id, check); return a; } function rand(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } (function loop() { if ((typeof(engines) == "undefined" || !engines.length) && --loopWait) return setTimeout(loop, 0); if (!loopWait) return; Settings.init(); customLinksAdd(); })(); Settings.init(); /*logo*/ $("body #content > h1 > img").click(function() { let keys = Object.keys(Settings.themes.list), i = keys.indexOf(Settings.prefs.theme); if (++i >= keys.length) i = 0; Settings.themes.load(keys[i]); }).attr("src", "data:image/gif;base64,R0lGODlhkQBtAPf/AC390f8A/yBFS42N93yDehiboBkVn63/UgH+MsHBwZoSnvX1Zdr/JXFx/ff30v8AACrUKv8Ajc3N7aYBWQD//0lRUf0A0+Ee4QAA//8AM6yqrv///nON/v//AOXl5AH80v7+KBcXFv//+Y1z/5GSkrKwyGAMafn5/zMxM4AKCSwuuHP/jAnP7guACcc2xyop7SgB1Pr69UhI2AQDwo1yjfv75DyiVwTn50YBuTLDxNfX6Crw8AoLc88J7WxrfHZ22yN/PfAq8ATNzICAC+cE5wD/AAEB6hYrLMcEyP39UgD/bdQBKfz8APr6+evr7fDw9OgAF6PSVSvxaAAA8wD/ujYVN+zExYWE5Pf2+ff4+Ob/Ga6WqxkCA4AWGv39OVdX3cXr6+zE683Mtqswte/IKcXqxQD/9u8K7nt8M6/Q2vv7uv//GgYZBYPMgivtKzlybf8AaxrlGwz/84MDfskpAxMSMQfHLPz8g/ApAwgXF4b/eQQGAwru7xcYBoesWQD/4xkB5gLy8v8A8C3uBfDIAvr6+izIBff3/+8pyb6+4AX6/xgKFcruA/ErfCrI7wXIBA1rdQEA+kjSMQ0jFP8AWskp7/QB9QH9/QYoxwD8AMnHAq6tmBsbGkC/QNHRagD/Hxsay8nHKQqv1gQo8NIueQv+/gkJF//9AJTtWw309AgI+C4/tP8A+svtKvv7+ff29v8ADHZ+EMkpKO4pJwwM8gH+/8kCAe/u8wD/WO7tKSsB8PoF/wQE/yEhIAD/gP0K/e4R7gL9AgL8AH+AAqHMUvkB+fLtKPkABgAF//j49QD6//n5+fgH9gMD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EAHStCBXuEHDUioQhe60B/woA57MIVEJ0pRU+yhCkhQ1i7msIc9LOKjIA3pIrgggEBU5qQorQwFnPEBSEQ0DzCNqUzzsAcfbGADrsgGNnWa05yKoAY/qBUGXsADi1b0qHuoAxFYoSyOmkKkIuUCScUhpXC41BQzzWpNY6CkWcpyAzW4QiRqRdQ69IETaE2rWkPABowqixwmYMNZ1UrXEOyhpD9yRiAgwYVFcCIEgA1sYBdR05ua8rBZ+GlQTRWJsvZBsJAFbFszqiwT9CEPkRXsSAVA1R/tta+ZFeweKiCCDbgJrD8Yq6kcG9rATlZZAYjrY1sbApLSBiKvn/Vray1qU9PmSBqKFWo3Hjrb1r62qWzYQwg+2gfmfrS2JDVDVfm6CNrylqs3za52bwpUXpCVuLRlay+QUAwimPe86CWCJc5ggkkcoRfu7cV753sETiziHzcYBx/2y9/+8mEcN+BrCOiq1l7Y1QdPeIUTFszgBr/CAT+YgipoQeEKW5jCZQ1BHTbM4Q7XAbMmUICIR0xiEptAAChOsYpVDIkCuPjFMIZxPd6AAhSg2MYoroAAUKBjHmvgx0AOMpA3QQN7GPnISLaHDIy8ioAAADs="); // $("body").toggleClass("dark", Settings.prefs["theme"] == 1); Settings.themes.load(); // fix highlighting today would remove /u/user .. $( "#linkToday" ).click(function linkToday_click(e) { e.stopPropagation(); e.preventDefault(); e.stopImmediatePropagation(); _loadArchiveFromPathname("#today", "#today"); return false; }); let _today, showHidden = Settings.pref("showHidden") ? true : false, _assignColor = assignColor; /* work around for expand/collapse same series in one day */ window.assignColor = function assignColor ( seriesId, color, permanent ) { let r = _assignColor(seriesId, color, permanent), css = $("#css_"+seriesId), html = css.html(); if (html) { if (permanent) { Settings.prefs.lastColor = html.match(/background-color:#([0-9a-fA-F]{6})/)[1]; Settings.save(); } css.html(html.replace(/(\s+)(\.activeOnly)([^\{]+)\{/, "$1$2$3:not(.multi),body:not(.collapseMulti) $2$3,$2 .day.expand $3,$2 .day.opened $3{")); let col = "#" + new Colors().setColor(color||"#FFF").HEX; if (col == "#FFFFFF") col = "Remove color"; css.html(css.html() + '.entry[data-series-id="' + seriesId + '"] .color[title="' + col + '"], li[data-series-id="' + seriesId + '"] .color[title="' + col + '"]{border:1px solid white;border-radius:10px;box-shadow:0px 0px 0px 1px black;}'); try { let c = html.match(/ color\:([^;}]+)[;}]/i)[1]; css.attr("color", c); setTimeout(function() { $('div.entry[data-series-id="' + seriesId + '"]').attr("color", c); }, 1000); } catch(er){log(er);} } else { delete css._color; setTimeout(function() { $('div.entry[data-series-id="' + seriesId + '"]').removeAttr("color"); }, 1000); } if (permanent && Settings.prefs.myShowsTop) { sortMyShows(); } return r; }; /* fixing browser history inflating after each page refresh and prev/next history jump don't work */ var prevPath; //MS Edge get's /undefined in the address if (window.location.pathname.match(/\/undefined/)) { history.go(-1); let path = window.location.href; history.go(1); history.replaceState({}, "", path); history.go(-1); } function _loadArchiveFromPathname(originalPath,highlightSelector) { let path = originalPath||document.location.pathname; var match = path.match(/^\/archive\/([0-9]+)-([0-9]+)$/); var ym = match ? (~~match[1]*12+~~match[2]-1) : ymToday; if (!document._title) document._title = document.title; document.title = document._title + (match ? " (" + ~~(ym/12) + "-" + ~~((ym%12)+1) + ")" : ""); //start fix - browser history inflating after each page refresh if (originalPath && prevPath != originalPath) { prevPath = originalPath; history.pushState({originalPath:originalPath,highlightSelector:highlightSelector}, "", originalPath); } //end fix $("#archive-prev").attr("href", "/archive/" + ym2str(ym-1)); $("#archive-next").attr("href", "/archive/" + ym2str(ym+1)); $("body").toggleClass("archive", !!match&&match.length==3); $("#leaveArchive").text(ym>ymToday?"Leave future":"Leave archive"); $("#archive-prev2").attr("href", "/archive/" + ym2str(ym-1)); $("#archive-next2").attr("href", "/archive/" + ym2str(ym+1)); $("#leaveArchive2").text(ym>ymToday?"Leave future":"Leave archive"); let whenDone = function(){ // insert custom shows // set title $("#archive-current").text((!!match&&match.length==3)?ym2str(ym):"Go waste your time"); $("#archive-current2").text((!!match&&match.length==3)?ym2str(ym):"Go waste your time"); // highlight today with a happy yellow background $( "div.day[data-date='" + today.getFullYear() + pad( today.getMonth() + 1 ) + pad( today.getDate() ) + "']" ).addClass( "today" ).attr( "id", "today" ); markSearchResults(); var $hl = $(highlightSelector||".does-not-exist-and-never-will"); if($hl.get().length>0){ // blink for( var i = 0; i < 8; i++ ) $hl.animate( {"opacity":i%2}, 1 ).delay( 100 ); // scroll to if (Settings.pref("searchScroll")) { var val = function(){return $hl.offset().top-Math.max(document.documentElement.clientHeight, window.innerHeight || 0)/2;}; $('html, body').animate({ scrollTop: val() },{duration:500, step:function(top,info){ info.end = val(); }}); } } //injecting userscript function execution showPast(function() { customShows(); //adding watched checkboxes // $("div.day > div.entry").each(watched.attach); //collapse multiple entries of the same series in one day $("div.day").each(function(i, e, c) { let entries = $(e).find("div.entry"); for(let n = 0; n < entries.length; n++) { //adding watched checkboxes entries[n]._iOrig = n; watched.attach(i, entries[n]); } epDateFix(entries); collapseMulti(i, e, c); // sortMyShows(); sortMyShows(Settings.prefs.enableEpDateFix ? undefined : entries); }); }); showHideLoad(); Settings.lastUpdate = new Date(); Settings.lastUpdateShow(); };//whenDone() if(window.ymCurrent != ym) { $(".days").load("/_archive/" + ~~(ym/12) + "-" + ~~((ym%12)+1), function() { window.ymCurrent = ym; whenDone(); }); } else { whenDone(); } _loadArchiveFromPathname.firstRun = true; }//_loadArchiveFromPathname(originalPath,highlightSelector) window.loadArchiveFromPathname = _loadArchiveFromPathname; /* end fixing browser history inflating after each page refresh and prev/next history jump don't work */ function epDateFix(_entries) { if (!Settings.prefs.enableEpDateFix) return false; if (typeof(_entries) == "undefined") _entries = $('div.calendar > div.days > div.day > div.entry'); _entries = _entries.add(epDateFix.div.childNodes); if (typeof(epDateFix._list) == "undefined") epDateFix._list = ls("epDateFix") || {}; let list = epDateFix._list, days = []; for(let id in list) { let entries = _entries.filter('[data-series-id="' + id + '"]'); // setEpisodes(entries); for (let i = 0; i < entries.length; i++) { let data = epDateFix.check(id, entries[i]._episodeID); if (!data.offset && entries[i]._episode == entries[i].parentNode.dataset.date) continue; let day = epDateFix.move(entries[i], data.episode, data.offset); if (day && days.indexOf(day) == -1) { days[days.length] = day; } } } return days; } epDateFix.move = function epDateFix_move(entry, episodeID, offset) { offset = ~~offset; let newDate = new _Date(entry._episodeDate.substr(0, 4), entry._episodeDate.substr(4,2) - 1, ~~entry._episodeDate.substr(6,2) + offset); newDate = newDate.getFullYear() * 10000 + (newDate.getMonth() + 1) * 100 + newDate.getDate(); if (entry._episodeID < episodeID) return false; let day = $('div.calendar > div.days > div.day[data-date="' + newDate + '"]')[0] || epDateFix.div; day.appendChild(entry); return day; }; epDateFix.check = function epDateFix_check(id, episodeID) { let data = epDateFix._list ? epDateFix._list[id] || [] : [], parentList = [], offset = 0, offsetRelative = 0, index = -1, episode = -1; for(let i = 0; i < data.length; i++) { let epID = episodeTools.id(data[i][0], data[i][1]); if (episodeID >= epID) { let o = ~~data[i][2]; parentList[parentList.length] = epID; if (episodeID == epID) { index = i; offsetRelative = ~~data[i][2]; episode = epID; } else offset += o; } } return { index: index, parentList: parentList, offset: offset + offsetRelative, offsetPrev: offset, offsetRelative: offsetRelative, episode: episode }; }; epDateFix.update = function epDateFix_update(id, episode, offset) { episode = episodeTools.id(episode); offset = ~~offset; let ep = episodeTools.split(episode), data = this.check(id, episode); if (data.index == -1 && !offset) return; if (!this._list[id]) this._list[id] = []; if (data.index != -1) { if (!offset) { this._list[id].splice(data.index, 1); } else this._list[id][data.index][2] = offset; } else this._list[id][this._list[id].length] = [ep[0], ep[1], offset]; }; epDateFix.save = function epDateFix_save() { for(let id in this._list) if (!this._list[id].length) delete this._list[id]; ls("epDateFix", this._list); }; epDateFix.init = function(enable) { if (typeof(enable) == "undefined") enable = Settings.pref("enableEpDateFix"); else Settings.pref("enableEpDateFix", enable ? 1 : 0); document.body.classList.toggle("enableEpDateFix", enable); }; epDateFix._list = ls("epDateFix") || {}; epDateFix.div = document.createElement("div"); epDateFix.div.id = "epDateFix"; document.body.appendChild(epDateFix.div); epDateFix.init(); let sortMyShows = function(entries) { if (typeof(entries) == "undefined") { $("div.day").each(function(i, e) { sortMyShows($(e).find("div.entry")); }); return; } let changed = false; entries.sort(function(a, b) { let r = a.title.toLowerCase().localeCompare(b.title.toLowerCase()); if (r) changed = true; return r; }); if (Settings.prefs.myShowsTop && Object.keys(DB.savedColors).length) { entries.sort(function(a, b) { let r = (b.dataset.seriesId in DB.savedColors) - (a.dataset.seriesId in DB.savedColors); if (r) changed = true; return r; }); } if (changed); $(entries.context).append(entries); };//sortMyShows() let episodeNumberFix = function(id, title) { let data = episodeNumberFix.Get(id, title, true, true); if (!data) return title; let episodeNew = data.episode + data.episodeOffset, seasonNew = data.season + data.seasonOffset; if (seasonNew < 0) seasonNew = 0; if (episodeNew < 0) episodeNew = 0; //if (data.episodeOffset || data.seasonOffset) //log(data); return data.name + " S" + pad(seasonNew) + "E" + pad(episodeNew); }; episodeNumberFix.Get = function (id, title, inherit, all) { if (typeof(inherit) == "undefined") inherit = true; let match = title.match(/(.*) S([0-9]{2,})E([0-9]{2,})/); if (!match) return null; let data = episodeNumberFix.list[id], name = match[1], season = Number(match[2]), episode = Number(match[3]), r = { name: name, season: season, episode: episode, seasonOffset: 0, episodeOffset: 0, index: -1, data: data }; if (!data) return r; for(let i = 0; i < data.length; i++) { if ((season == data[i][0] || (inherit && season > data[i][0])) && (episode == data[i][1] || (inherit && episode > data[i][1]))) { r.episodeOffset += data[i][3]; r.seasonOffset += data[i][2]; r.index = i; if (!all) break; } } return r; }; episodeNumberFix.Set = function(id, title, seasonOffset, episodeOffset) { let data = episodeNumberFix.Get(id, title, false, false); if (!data) return title; if (seasonOffset || episodeOffset) { if (!data.data) episodeNumberFix.list[id] = data.data = []; if (data.index == -1) data.index = data.data.length; episodeNumberFix.list[id][data.index] = [data.season, data.episode, seasonOffset, episodeOffset]; } else { if (!data.data) return title; if (data.index != -1) data.data.splice(data.index, 1); if (!data.data.length) delete episodeNumberFix.list[id]; } }; episodeNumberFix.save = function() { ls("epNumFix", episodeNumberFix.list); }; episodeNumberFix.load = function() { /* id: [[season, episode, episodeOffset, seasonOffset]] */ episodeNumberFix.list = ls("epNumFix") || {}; for(let i in episodeNumberFix.list) { for(let n=0; n < episodeNumberFix.list[i].length; n++) { if (episodeNumberFix.list[i][n].length < 4) { episodeNumberFix.list[i][n][3] = episodeNumberFix.list[i][n][2]; episodeNumberFix.list[i][n][2] = 0; } } } }; episodeNumberFix.load(); //collapse multiple entries of the same series in one day let collapseMulti = function collapseMulti(i, day, update) { let _day = $(day), entries = _day.find("div.entry"); if (!update && !entries.find(".title > span").length) return; if (!update && day.list) { return collapseMulti.setTitle(day.list, Settings.prefs.collapseMulti && !_day.hasClass("opened") ? "_titleCollapsed" : "_titleOrig"); } if (!day.list) day.list = {}; let list = {}; if (!day.inited) { day.addEventListener("mouseenter", function(e) { collapseMulti.mouseOver(e, day); }, true); day.addEventListener("mouseleave", function(e) { collapseMulti.mouseOut(e, day); }, true); day.inited = true; } entries.each(function(i, entry) { let id = entry.getAttribute("data-series-id"); // entry._title = $(entry).find(".title > span")[0]; if (!entry._title) return; if (!entry._title._titleOrig) { entry._title._titleOrig = entry._title.textContent || ""; entry.setAttribute("title", entry._title.textContent); } if (list[id]) $(entry).toggleClass("multi", true); else list[id] = []; if (entry.classList.contains("series-premiere") || entry.classList.contains("season-premiere")) { entry.classList.remove("multi"); list[id].unshift(entry); } else { list[id].push(entry); } }); for(let i in list) { if (list[i].length < 2) continue; list[i][0]._title._titleCollapsed = list[i][0]._title._titleOrig + "-" + list[i][list[i].length - 1]._title._titleOrig.replace(/.* ([^ ]+)$/, "$1"); $(list[i][0]).toggleClass("multif", true); day.list[i] = list[i][0]._title; if (Settings.prefs.collapseMulti && !_day.hasClass("opened")) $(day.list[i]).html(day.list[i]._titleCollapsed); } }; //collapseMulti() collapseMulti.setTitle = function(list, title) { for (let i in list) $(list[i]).html(list[i][title]); }; collapseMulti.mouseOver = function(e, day) { if (e.target != day) return; day._type = "over"; clearTimeout(day._collapseMultiTimer); $(day).toggleClass("expand", true); if (!Settings.prefs.collapseMulti) return; collapseMulti.setTitle(day.list, "_titleOrig"); }; collapseMulti.mouseOut = function(e, day, id) { if (e.target != day) return; day._type = "out"; day._collapseMultiTimer = setTimeout(function() { $(day).toggleClass("expand", false); if (!Settings.prefs.collapseMulti) return; if (!$(day).hasClass("opened")) collapseMulti.setTitle(day.list, "_titleCollapsed"); }, 300); }; collapseMulti.animateDone = function(e, n) { e.elem.style.overflow = ""; e.elem.style.height = ""; e.elem.style.display = ""; e.elem.style.textOverflow = ""; $(e.elem).find(".title").css("white-space", ""); }; collapseMulti.animate = function(day, cl, val, title) { if (!day._animatingQuie) day._animatingQuie = {}; if (day._animating) { clearTimeout(day._animatingQuie[cl+val]); return day._animatingQuie[cl+val] = setTimeout(function() { collapseMulti.animate(day, cl, val, title); }); } let type = day._type; if (Settings.prefs.collapseMulti) clearTimeout(day._collapseMultiTimer); let clone = day.cloneNode(true); $(clone).toggleClass(cl, val); if (title) { clone.list = {}; for (let i in day.list) { clone.list[i] = $($(clone).find(".multif[data-series-id=" + i + "]")[0]); clone.list[i]._titleCollapsed = day.list[i]._titleCollapsed; clone.list[i]._titleOrig = day.list[i]._titleOrig; } collapseMulti.setTitle(clone.list, title); } clone.style.visibility = "hidden"; clone.style.position = "absolute"; clone.style.top = 0; clone.style.width = day.clientWidth + "px"; $(clone).toggleClass("clone", true); day.parentNode.appendChild(clone); let n = 0; collapseMulti.setTitle(day.list, title); let stopped = false; day._animating = true; $(clone).find(".entry").each(function(i, c) { n++; let e = $(day).find(".entry")[i]; e.style.height = (e.clientHeight ? e.clientHeight : 1) + "px"; e.style.overflow = "hidden"; e.style.textOverflow = "unset"; e.style.display = "block !important"; $(e).find(".title").css("white-space", "normal"); $(e).show(); $(e).css("display", "block !important"); if (!$(e).is( ":visible" )) { e.style.setProperty("display", $(c).css("display"), "important"); } $(e).stop(true); $(e).animate({ height: c.clientHeight, }, { duration: 200, progress: function(e) { if (day._type != type) { e.stop(true); stopped = true; } }, always: function(e) { if (!--n) { if (!stopped) $(day).toggleClass(cl, val); day._animating = false; } collapseMulti.animateDone(e); } }); }); };//collapseMulti.animate() collapseMulti.onOff = function(e, id, checked) { Settings.prefs.collapseMulti = checked; $("div.day").each(collapseMulti); Settings.callback(e, id, checked); }; //fixing prev/next history jump does nothing $(window).on("popstate", function(e) { let state = e.originalEvent.state; prevPath = (state ? state.originalPath : undefined) || e.target.location.pathname; _loadArchiveFromPathname(prevPath, state ? state.highlightSelector : undefined); }); function showPast(callback) { // hide all past days let d = new Date(), _todayDate = d.getFullYear() + pad((new Date()).getMonth() + 1) + pad((new Date()).getDate()); _today = $("div.day[data-date='" + _todayDate + "']"); if (!_today || $(".archive").length) { setEpisodes(); if (callback) return callback(); return; } let firstDay = $(".days").children().first(), firstDate = firstDay.attr("data-date"); if (!firstDay.length) return; let div = [document.createElement("div")], y = firstDate.slice(0, 4), m = firstDate.slice(4, 6); if (~~firstDate.slice(6, 8) - weekDay() < 15) div.push(document.createElement("div")); let c = div.length; for (let n = 0; n < c; n++) { let d = new Date(y, m - n - 1); $(div[n]).load("/_archive/" + d.getFullYear() + "-" + pad(d.getMonth() + 1), pastLoadDone); } function pastLoadDone() { if (--c > 0) return; let stop = false, prev = 0, dayDiv = $("div.days"), remove = [], _tD = ~~_todayDate; for (let n = 0; n < div.length; n++) dayDiv.prepend(div[n].children); //remove any duplicate dates; for(let i = 0; i < dayDiv[0].children.length; i++) { let day = dayDiv[0].children[i], date = ~~day.getAttribute("data-date"); if (_today[0] == day) break; if (date <= prev || date >= _tD) remove[remove.length] = day; else prev = date; } for(let i = 0; i < remove.length; i++) remove[i].parentNode.removeChild(remove[i]); pastLoaded(); if (callback) callback(); }//pastLoadDone() }//showPast() function setEpisodes(entries) { if (typeof(entries) == "undefined") entries = document.querySelectorAll("div.entry"); for (let e = 0; e < entries.length; e++) { let entry = entries[e], episode = episodeTools.split(entry); if (!entry._episode) { entry._episode = episodeTools.full(episode); if (entry._episode == "E00") entry._episode = ""; entry.setAttribute("data-episode", entry._episode); } if (!entry._episodeID) entry._episodeID = episodeTools.id(episode); if (!entry._episodeDate) entry._episodeDate = entry.parentNode.dataset.date || entry.dataset.date || ""; } } function weekDay() { let week = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], match = $(_today).find(".date").text().toLowerCase().match(/([^,]{3})/); week = week.concat(week.splice(0, 7 - Settings.prefs.weekStart)); return match ? week.indexOf(match[1]) : -1; } function removeClass(node, c) { let n = node.prop("classList"); for(let i = 0; i < n.length; i++) if (n[i].match(c)) node.removeClass(n[i]); } function pastLoaded() { setEpisodes(); let hasLoaded = $("#pastWeeks").length, stop = false, days = $("div.days")[0], today = _today[0], that = self; for(let i = 0; i < days.children.length; i++) { let day = days.children[i]; day.classList.toggle("today", day == today); if (day == today) { day.setAttribute("id", "today"); day.setAttribute("today", true); stop = true; } if (stop) { removeClass($(day), /^past[0-9]?/); } else { day.classList.toggle("past", true); } } let daysNum = weekDay(), prev = _today.prev(); //there is no identication of which week a day belong to, so we must make sure that previous days of current week don't count as previous week. if (daysNum > 0) { for(let i = 0; i < daysNum && prev; i++) { removeClass(prev, /^past[0-9]?/); prev = prev.prev(); } } //remove more then 5 weeks worth of days. for(let i = 0; i < 34 && prev; i++) { prev = prev.prev(); } if (!that.weekStart) { that.weekStart = []; that.weekStart[0] = Settings.prefs.weekStart ? Settings.prefs.weekStart == 1 ? prev : prev.next() : prev.prev(); //Sunday that.weekStart[1] = that.weekStart[0].prev(); // Saturday } if (prev.length) { let found = false, remove = [], _prev = prev[0]; for(let i = 0; i < days.children.length; i++) { let day = days.children[i]; if (_prev == day) break; if (day != that.weekStart[0] && day != that.weekStart[1]) remove[remove.length] = day; } for(let i = 0; i < remove.length; i++) days.removeChild(remove[i]); } for(let i = 0; i < that.weekStart.length; i++) { if (Settings.prefs.weekStart && i + 1 <= Settings.prefs.weekStart) that.weekStart[i].prependTo(days); else that.weekStart[i] = that.weekStart[i].detach(); } for(let i = 0; i < days.children.length; i++) { days.children[i].setAttribute("week", (Math.ceil((i+1) / 7))); } let daysPast = $('div.past'), daysCount = Math.round((days.children.length) / 7) + 1, weeks = ~~Settings.prefs.weeksPast, weeksPastMax = Math.round((daysPast.length) / 7);//how many past weeks do we have available? if (weeks > weeksPastMax) weeks = weeksPastMax; //main function that shows/hides past days function showWeeks() { let weeksMax = ~~Settings.pref("weeks") || daysCount; //get week numbers from dropdown let weeks = ~~$("#pastWeeks").val(); //just some sanity check if (weeks * 7 > daysPast.length) weeks = weeksPastMax; if (weeks < 1) weeks = 0; let startWeek = weeksPastMax-weeks; for(let i = weeksPastMax, shown = 1; i > 0; i--) { $( "div.calendar" ).toggleClass("showPast" + i, (weeks >= i && shown++ <= weeksMax)); } for(let i = 1, shown = 1; i < daysCount; i++) { $( "div.calendar" ).toggleClass("showWeek" + i, i > startWeek && shown++ <= weeksMax); } Settings.pref("weeksPast", weeks); } //add new class pastNN to each past day, where NN is a week number. let func = function(i) { this.className = this.className.replace(/ ?past[0-9]+/, ''); this.classList.toggle("past" + (Math.ceil((daysPast.length - i) / 7 % (weeksPastMax + 1))), true); }; daysPast.each(func); if (!hasLoaded) { //create dropdown menu with number of available past weeks let dropdown = document.createElement("select"); dropdown.id = "pastWeeks"; for(let i = 0; i <= weeksPastMax; i++) { let option = document.createElement("option"); option.value = i; option.text = i; option.selected = (weeks == i); dropdown.appendChild(option); } //add event listener to dropdown $(dropdown).change(showWeeks); let span = document.createElement("span"); span.id = "past-weeks"; span.appendChild(document.createTextNode("Show past weeks:")); span.appendChild(dropdown); //insert our dropdown and new text into document $(".calendar").prepend(span); //hide "Show/Hide past month" links $("#past-showing").toggle(true); //togglePast();//make sure we disable "Show past month" $("#past-showing").toggle(false); $("#past-hidden").toggle(false); } showWeeks(); }//pastLoaded() //create stylesheet. A little trick to have multi-line text in javascript let style = document.createElement("style"), css = multiline(function(){/* body { } #content { max-width: 200em; _transform: translateZ(0); /* this will force any "fixed" positions be relative to this container, not viewport*//* position: relative; margin: auto; } #searchbar { right: unset; } #searchbarContainer { position: absolute; right: 6%; margin-right: 200px; padding: 0; height: 0; width: 0; overflow: hidden; } #searchResults { margin-top: 0.5em; display: none; } #searchResults2 { position: fixed; width: 200px; margin-left: -11px; padding: 10px; max-height: 93vh; top: 3em; overflow: auto; border: 1px solid transparent;; border-top-color: transparent; border-top-width: 0; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; } #searchbar.active #searchResults2 { border-color: black; } #account-overview > span.nu > svg { width: 1.2em; height: 1.2em; vertical-align: top; margin-right: 0.3em; fill: #3e3e3e; } #account-overview > span.nu > svg.cookieIcon { width: 1em; height: 1em; vertical-align: sub; } .cookieIcon { width: 1em; height: 1em; vertical-align: sub; } .cookieIconHoles { fill: #fff; opacity: .5; } svg { max-width: 1.2em; max-height: 1.2em; vertical-align: top; width: 1.2em; } body.userViewer .settings > div.spacer, body.userViewer .myHidden, body.userViewer .moreOpt, body.userViewer .clearHidden, body.userViewer .clearHiddenIcon, body.userViewer .clearWatched, body.userViewer .clearWatchedIcon, body.userViewer .importColors, body.userViewer .importColorsIcon, body.userViewer .clearColorsIcon, body.userViewer .clearColors, body.userViewer .colors, body.userViewer .myCustomShows { display: none !important; } /* div.calendar.searching > #past-weeks { text-decoration: line-through; } *//* #past-weeks { margin-left: 0.2%; } #pastWeeks { margin-left: 0.5em; } .archive #past-weeks { text-decoration: line-through; } /* today column border *//* div.today { border-color: #FFC800; -webkit-box-shadow: 0px 0px 10px 0px #FFC800D0; -moz-box-shadow: 0px 0px 10px 0px #FFC800D0; box-shadow: 0px 0px 10px 0px #FFC800D0; } /* higlighted title under cursor *//* div.title > input[type="checkbox"]:hover + div.title, div.title:hover { background-color: #ffffd5; -webkit-transition: background 0s; color: black; } /* highlight opened entry *//* .entry[opened] { border: 1px solid black; } .entry[opened][color="white"] { border: 1px solid white; } div[opened] + div { border-top: 0; } .engines input[type="checkbox"] { width: unset !important; vertical-align: top; } .engines img { vertical-align: text-bottom !important; } .engines { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; } div.entry { float: left; width: 100%; } .pointer, .checkbox, .date { cursor: pointer; } .filter { margin-left: 1em; cursor: pointer; } .showhide0 > svg, .showhide1 > svg { margin: 0 0.1em 0 -1px; width: 1.2em; height: 1.2em; max-width: unset; max-height: unset; } div.entry[color="white"] { fill: white; } div.details > span.engines > br + div.tools { margin-top: 0.3em; border-top: 1px dashed #eee; padding-top: 0.3em; overflow: hidden; text-overflow: ellipsis; } div.colors { margin-top: 0.3em; } div.details > span.engines > div.tools > * { margin: 0.2em; } body:not(.archive) div.day[week], body:not(.archive) div.day.past, .showhide0, span[checked] > .checkoff, span:not([checked]) > .checkon, /*separate showing searies and season premiere*//* div.calendar.showNew div.entry:not(.series-premiere):not(.searchResult), div.calendar.showReturn div.entry:not(.season-premiere):not(.searchResult) { display: none; } body:not(.archive) div.showWeek1 div[week="1"], body:not(.archive) div.showWeek2 div[week="2"], body:not(.archive) div.showWeek3 div[week="3"], body:not(.archive) div.showWeek4 div[week="4"], body:not(.archive) div.showWeek5 div[week="5"], body:not(.archive) div.showWeek6 div[week="6"], body:not(.archive) div.showWeek7 div[week="7"], body:not(.archive) div.showWeek8 div[week="8"], body:not(.archive) div.showWeek9 div[week="9"], body:not(.archive) div.showWeek10 div[week="10"], body:not(.archive) div.showWeek11 div[week="11"], body:not(.archive) div.showWeek12 div[week="12"], body:not(.archive) div.showWeek13 div[week="13"], body:not(.archive) div.showWeek14 div[week="14"], body:not(.archive) div.showWeek15 div[week="15"], body:not(.archive) div.showWeek16 div[week="16"], body:not(.archive) div.showWeek17 div[week="17"], body:not(.archive) div.showWeek18 div[week="18"], body:not(.archive) div.showWeek19 div[week="19"], body:not(.archive) div.showWeek19 div[week="20"], body:not(.archive) div.showPast1 div.past1, body:not(.archive) div.showPast2 div.past2, body:not(.archive) div.showPast3 div.past3, body:not(.archive) div.showPast4 div.past4, body:not(.archive) div.showPast5 div.past5, body:not(.archive) div.showPast6 div.past6, body:not(.archive) div.showPast7 div.past7, body:not(.archive) div.showPast8 div.past8, body:not(.archive) div.showPast9 div.past9 { display: block; } /*separate showing searies and season premiere*//* #nu-showing, #nu-hidden, #selected-only-hidden { display: none !important; } div.calendar.showNew div.entry.series-premiere:not(.searchResult), div.calendar.showReturn div.entry.season-premiere:not(.searchResult) { display: block; } /*Search field overlaps text below in Firefox*//* #searchFieldContainer { background-color: unset; } /*Watched*//* body.enableWatched:not(.showWatched) :not(#searchResults) > div.entry[watched]:not(.searchResult):not(:hover), body:not(.enableWatched) div.calendar > a.showWatched, body:not(.enableWatched) div.title > input[type="checkbox"] { display: none !important; } body.enableWatched div.entry[watched] > div.title { text-decoration: line-through; } div.title > input[type="checkbox"] { vertical-align: middle; margin: 1px 3px 0 1px; height: 1em; } #searchResults div.title > input[type="checkbox"] { width: unset; float: left; z-index: auto; } #searchResults > div.entry:last-child { margin-bottom: 1em; } /*Past related*//* body:not(.archive) .past { opacity: 0.5; } body.collapseMulti div.day:not(.expand):not(.opened) div.entry.multi { display: none !important; } body.collapseMulti div.day:not(.expand):not(.opened) div.entry.multif div.title:after { content: ""; background-color: black; border-left: 1px solid white; } body.collapseMulti div.day:not(.expand):not(.opened) div.entry.multif div.title:after { position: absolute; height: 100%; right: -1px; top: 0; width: 3px; } div.entry.custom div.title:after { content: ""; background-color: lightgreen; border-left: 1px solid white; } div.entry.custom div.title:after { position: absolute; height: 100%; right: -1px; top: 0; width: 3px; } /*Account popup*//* #settings-popup .content h4, #manage-cushows-popup .content h4, #manage-links-popup .content h4, #account-popup-content .content h4 { margin-top: 1em; margin-bottom: 1em; display: inline-block; } .header h4 { margin: 0.2em 0 0 0; color: black; } #settings-popup .content div.moreOpt:not([opened]) > h4 { cursor: pointer; margin-bottom: 0.2em; } #settings-popup .content div.moreOpt > h4 { cursor: default; margin: 0.2em 0 1em 0; } div.moreOpt:not([opened]) > div { display: none; } #settings-popup .content, #manage-cushows-popup .content, #manage-links-popup .content, #account-popup-content .content { padding-top: 0; padding-bottom: 1em; } #settings-popup-content .content > div > *:first-child, #account-popup-content .content > div > *:first-child { width: 1.6em; display: inline-block; vertical-align: bottom; } #manage-links-popup-content .content > div > div { min-width: 21em; max-width: 21em; overflow: hidden; vertical-align: bottom; } #manage-links-popup-content .content a.link { display: inline-block; max-width: 14.5em; text-overflow: ellipsis; overflow: hidden; } #manage-links-popup .content > div.def > div > span { display: none; } /* #manage-links-popup .content > div.def > div > a { font-weight: bold; } *//* #manage-links-popup .content > div:not(.def) > div > span { text-decoration: none; display: inline-block; color: red; padding: 0.2em; vertical-align: super; cursor: default; } #account-popup, #settings-popup, #manage-cushows-popup, #manage-links-popup { position: absolute; top: 50px; left: 4.7%; bottom: 10px; right: 4.7%; width: 1px; display: none; } body.prompt #account-popup { z-index: 1; } body.popup .popup { z-index: 1234; } body.popup .cp-color-picker { z-index: 1235; } body.prompt .popup { z-index: unset; } #account-popup-content, #settings-popup-content, #manage-cushows-popup-content, #manage-links-popup-content { position: absolute; top: 0px; left: 0px; background-color: whitesmoke !important; border: 1px dotted black; min-width: 30.4em; min-height: 10px; max-width: 100%; max-height: 100%; overflow: auto; } img.icon { width: 1.333em; } div.back { font-size: 1.2em; width: 1.3em; height: 1.3em; cursor: pointer; position: absolute; top: 0; left: 0; padding: 5px 3px 4px 5px; } .close > svg:first-child { display: none; } div.close { font-size: 1.2em; width: 1.3em; height: 1.3em; cursor: pointer; position: absolute; top: 0; right: 0; padding: 7px 3px 2px 5px; } div:not(#account-popup-content) > .header { background-color: #7FFFFF; padding: 5px; text-align: center; height: 1.5em; } #settings-popup .content, #manage-cushows-popup .content, #manage-links-popup .content, #engine-form, #cushows-edit { padding: 3px 10px; overflow-x: hidden; overflow-y: auto; max-height: 100em; } #settings-popup .content { max-height: unset; } #cushows-edit, #engine-edit { overflow: inherit; border-top: 1px dotted; padding-top: 0.5em; } #cushows-edit > div, #engine-edit > div, #manage-links-popup .content > div { display: table-row; white-space: nowrap; height: 100%; } #cushows-edit > div > *, #engine-edit > div > *, #manage-links-popup .content > div > * { display: table-cell; vertical-align: middle; margin: 0 4px 0 1px; padding: 1px 0; } #manage-links-popup .content > div > img { vertical-align: sub; display: inline-block; margin: 0 4px 1px 0; } body.edge #manage-links-popup .content > div > img { margin-bottom: -2px !important; } .editBox > span { padding: 3px; display: inline-block; height: 1em; } .editBox { } .editBox > span:hover { cursor: pointer; outline: 1px dotted #FF9090; } body.colorbox:not(.colorpicker) #manage-cushows-popup .content li:not(.opened), body.colorpicker .colors, body.colorbox #cushows-form, #cushows-list.opened > li.opened > .editBox, #cushows-list.opened > li:not(.opened) { -webkit-filter: opacity(40%); -moz-filter: opacity(40%); -o-filter: opacity(40%); -ms-filter: opacity(40%); filter: opacity(40%); pointer-events: none; } body.colorpicker *, body.colorbox * { pointer-events: none; } body.colorbox:not(.colorpicker) #manage-cushows-popup .content, body.colorpicker .cp-color-picker, body.colorpicker .cp-color-picker *, body.colorbox:not(.colorpicker) li.opened div.color, body.colorbox:not(.colorpicker) li.opened div.color * { pointer-events: auto; } #cushows-list > li:hover, #cushows-list.opened > li.opened, #manage-links-popup .content > div.dragging:not(.hide), #manage-links-popup .content:not(.dragging) > div:hover { background-color: #FFFFB7; outline: 1px dotted grey; } #cushows-list.opened>li.opened .colors { width: 26em; } .close:hover, .back:hover { background-color: rgba(255,255,255,0.5); } .close:hover > svg { background-color: #e81123; } .close:hover > svg:last-child { display: none; } .close:hover > svg:first-child { fill: #FFFFFF; display: inline-block; } #manage-links-popup .content > div.dragging.hide > * { opacity: 0; } #manage-links-popup .content > div.dragging.hide { outline: 1px dashed grey; } #cushows-edit > div > label, #engine-edit > div > label { text-align: right; min-width: 5.5em; } #cushows-edit > div.info > label { vertical-align: top; } #engine-edit > div:last-child > label { vertical-align: top; padding-top: 0.3em; } #engine-edit > div > div { width: 100%; padding: 0.1em 0.5em; max-width: 20em; } #engine-edit > div > div.engine-url { padding: 0.1em 2.2em 0.1em 0.5em; } body.ff #engine-edit > div > div.engine-url { padding-right: 2.0em; } #cushows-edit > div > div > input, #cushows-edit > div > div > textarea, #engine-edit > div > div > input { width: 100%; } input#engine-url { padding-right: 1.5em; } #engine-edit > div > div > select { width: 1.5em; position: relative; left: -1.5em; margin: 0; padding: 0; height: 1.58em; } body.ff #engine-edit > div > div > select { height: 1.57em; left: -1.4em; } body.edge #engine-edit > div > div > select { height: 1.6em; } #engine-res { overflow: hidden; text-overflow: ellipsis; min-height: 2em; padding: 0.3em 0 0.3em 0.5em !important; } #engine-res > a > img.icon:not([src]) { display: none; } #engine-hidden { display: none !important; } #engine-res > a > img { vertical-align: middle; display: inline-block; margin: 0 4px 0 0; } body.ff #engine-reset { margin-right: -0.6em; } #engine-reset { float: right; margin-right: -0.4em; } div.reset { display: none !important; } #manage-links-popup[changed] div.reset { display: block !important; } div.reset > span { display: block !important; text-align: right; margin-right: 0.5em; margin-bottom: 0.5em; } #engine-edit { } #manage-links-popup .nu, #manage-links-popup .nu { vertical-align: bottom; font-size: 1.3em; } #cushows-list > li.update, #manage-cushows-popup-content .content > div.update, #manage-links-popup-content .content > div.update { -webkit-transition:background-color 0.4s ease-in; -moz-transition:background-color 0.4s ease-in; -o-transition:background-color 0.4s ease-in; transition:background-color 0.4s ease-in; } .engine-regexp { height: 100%; } #engine-edit #engine-regexp { width: 70%; } body.ff #engine-edit #engine-regexp-replace { left: 2px; } #engine-edit #engine-regexp-replace { width: 30%; } input.error, textarea.error { box-shadow: 0 0 8px 1px #FF9090; -webkit-box-shadow: 0 0 8px 1px #FF9090; -moz-box-shadow: 0 0 8px 1px #FF9090; } #engine-edit textarea { white-space: pre; overflow: auto; vertical-align: top; height: 100%; margin: 0; padding: 0; position: relative; } [draggable] { -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; user-select: none; /* Required to make elements draggable in old WebKit *//* -khtml-user-drag: element; -webkit-user-drag: element; } [draggable] .dndh { cursor: move; font-size: 1.2em; vertical-align: bottom !important; display: inline-block !important; padding-left: 0.2em !important; padding-right: 0.2em !important; } body.ff [draggable] .dndh { font-size: 1em; margin-top: 0.2em !important; vertical-align: super !important; } #settings-popup-content > .content > * { margin: 0.3em 0; display: table; } /* .user > svg { margin-right: 0.3em; } *//* /*fixing menu wrapping too soon*//* @media screen and (max-width: 1000px) { body #menu li, body:not(.userViewer) #menu li { display: inline-block; } body #menu li .nu, body:not(.userViewer) #menu li .nu { min-width: unset; } body #account-popup, body:not(.userViewer) #account-popup { top: 50px; } } #menu .nu { font-weight: bold; } #menu .close { font-size: 0.9em; position: relative; top: -0.6em; cursor: pointer; padding: 0.3em; } #menu .close > svg { width: 0.9em; height: 0.9em; position: unset; } .user > svg, .back > svg, .content > div > span > svg { width: 1.3em; height: 1.3em; vertical-align: bottom; } .search > svg, .content > div.search > span > svg { width: 1em; height: 1em; vertical-align: middle; } #searchResults > div.entry > div.title, body:not(.shortTitle) div > div.entry > div.title, body.shortTitle.shortTitleExpand div.day.expand > div.entry > div.title, body.shortTitle div.day.opened > div.entry > div.title { display: flex; } /* logo new frame *//* #content > h1:first-of-type > img { background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJEAAABtCAYAAAChiINBAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAG9dJREFUeNrsXXuQFcV67znn7AOWXVh2F+QhAhoeQhKxQLyVVElFr95EjWLUG0KVFPiHWqZMacrXHwpYaKzyGR+lf1zNLSgkJVJgrLqpRCviI4p3Eb0iWCqFkos85bHAPs7unjP5fn3md/bb3jm4e2YFRqep4ez0dPd8/fWvv1f3zHhmAMn3fW/ZsmWek50ypz7hnvnTcO98OZW2b9/un3/++T7oVX+fcWn58uUD7p9gwnj9Lbx06VI9YCkB0zD5nS5Hoxxdpe6hfn0n3w8p5yZvAPn9GRgvOPJlTgC/jHv6ZdL6Q33Q9Hshh3F+Pee+qNsqxxcylvvKBRJAlBmABCqe33DDDam2trZL3nrrrQe/+OKLsZlMpiufz/tymLDDx53QC88rMjD4256nUil7zo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q7pBW6X6T5pcb1ZH9vnAodOG59JKXodscfZCYlCejmb3Azw5qdMt5bNiC50Q4GyfOHHivwcA6vPiBXc/ER6jbXjsscf+Wjy0tNxwqDRSnYdqE+3JAQsAVRxAPXA6Bhlc9Io+s9MRHaIP61wYg92Y0cmun4xhDm2GfVH9CaU/pH4+LI9/A/whNNln3sP677araXAnhqZbT6YSL2dIOfSnOPGd7R1oKCcH3PdsW1vbkZqamo8FB3sbGxtbSJe7dtaLprFjxx665ppr1jY3N48IHrUFeDDjIr/cqru7G89/s6MpN595pcq518Qt9XS9Mz3pfrp9PhPpFODkWlpautrb24/t3bu3U0Dk9/e5M3/evHmdGzduxENaqWw262nkJunnZN75+dbW1tzIkSOzr776al5HqXW5/xdgAMivxGzqpL5RAAAAAElFTkSuQmCC'); } body.smallLogo h1 > img { height: 1em; margin-bottom: -0.3em; background-size: 100%; } body.smallLogo h1, body.smallLogo h1 + h2 { margin: 0; } /* body.smallLogo h1:first-of-type > img { margin-top: 0.67em; position: absolute; z-index: -10; } body.smallLogo h1 { display: flex; flex-direction: column; align-items: center; width: 100%; } body.smallLogo h1, body.smallLogo h2 { background-color: rgba(255,255,255,0.6); } *//* body.shortTitle:not(.shortTitleExpand) div.day.expand:not(.opened) > div.entry > div.title > input[type="checkbox"], body.shortTitle div.day:not(.expand):not(.opened) div.title > input[type="checkbox"] { float: left; } body.shortTitle:not(.shortTitleExpand) div.day.expand:not(.opened) > div.entry > div.title, body.shortTitle div.day:not(.expand):not(.opened) > div.entry > div.title { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; } div.spacer { height: 0; border-bottom: 1px dotted silver; margin-top: 0.5em !important; margin-bottom: 0.5em !important; display: block !important; } .parentheses, a.file { margin-left: 0.5em; } .parentheses:before, a.file:before { text-decoration: none; display: inline-block; content: "("; } .parentheses:after, a.file:after { text-decoration: none; display: inline-block; content: ")"; } #searchResults > .info { margin-bottom: 0.7em; } #searchResults > .info > small { vertical-align: text-bottom; } #searchResults > .info > small > span:not(.info) { position: absolute; right: 1em; } span.button { cursor: pointer; background-color: #DDDDDD; border-radius: 4px; padding: 3px; } /* fix search field box covers text on bottom *//* #searchFieldContainer { width: 100%; height: 0; display: grid; position: relative; padding-top: 0; padding-bottom: 0; } #searchFieldContainer > img { padding-top: 10px; } #searchFieldPlaceholder { height: 2em; } #searchbar input { width: unset; } /* changes log *//* body:not(.changesLog) #changesLog { display: none; } body.changesLog #content > :not(#changesLog) { /* -webkit-filter: blur(5px); -moz-filter: blur(5px); -o-filter: blur(5px); -ms-filter: blur(5px); filter: blur(5px); *//* } div[noback] .back { display: none; } #changesLog { position: fixed; width: 100%; height: 100%; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; z-index: 10; } #changesLogBox { position: relative; max-width: 1024px; margin: 1em; overflow: hidden; background-color: white; border: 1px solid black; font-family: Monaco,"DejaVu Sans Mono",'courier new', 'times new roman', fixed, monospace; background-color: whitesmoke; color: black; } div[id*="-popup"] { white-space: nowrap; } #changesLogBox, div[id*="-popup"], /*body:not(.popup) .cp-color-picker*//* .cp-color-picker { -webkit-box-shadow: 0px 0px 40px 0px black; -moz-box-shadow: 0px 0px 40px 0px black; box-shadow: 0px 0px 40px 0px black; } #changesLogBox, div[id*="-popup"] { z-index: 1; } body:not(.popup) div.entry[opened] { -webkit-box-shadow: 0px 0px 30px 0px black; -moz-box-shadow: 0px 0px 30px 0px black; box-shadow: 0px 0px 30px 0px black; z-index: 1; } /* firefox what the actual f.k? *//* @-moz-document url-prefix() { #changesLogBox, div[id*="-popup"], /* body:not(.popup) .cp-color-picker*//* .cp-color-picker { box-shadow: 0px 0px 30px 0px black; -webkit-box-shadow: 0px 0px 30px 0px black; -moz-box-shadow: 0px 0px 30px 0px black; } body:not(.popup) div.entry[opened] { box-shadow: 0px 0px 20px 0px black; -webkit-box-shadow: 0px 0px 20px 0px black; -moz-box-shadow: 0px 0px 20px 0px black; } } #changesLogHead { text-align: center; } #changesLogLegend { padding: 4px; border-bottom: 1px solid #D4D4D4; } #changesLogLegend > span > span:first-child { margin-left: inherit; } #changesLogLegend > span:not(:last-child) > span:last-child { margin-right: 1em; } #changesLogLegend > span { padding-left: inherit; } #changesLogContent { padding: 4px; } .changesLogContentBox { overflow: auto; height: calc(100% - 4.5em); } #changesLogContent > div > div:not(.cl_ver_head) { margin-top: 1px; display: flex; white-space: pre-wrap; } #changesLogContent > div[class^="cl_ver_v"].prev:not(:hover) { opacity: 0.3; } #changesLogContent > div[class^="cl_ver_"]:not(:last-child) { padding-bottom: 1px; border-bottom: 1px solid #D4D4D4; } .cl_ver_head { font-weight: bold; margin-top: 0.5em; } #changesLog.cl_added .cl_added:not(.cl_filter), #changesLog.cl_changed .cl_changed:not(.cl_filter), #changesLog.cl_fixed .cl_fixed:not(.cl_filter), #changesLog.cl_removed .cl_removed:not(.cl_filter), #changesLog.cl_notfixed .cl_notfixed:not(.cl_filter) { max-height: 0; overflow: hidden; margin: 0; } #changesLog.cl_added .cl_filter.cl_added, #changesLog.cl_changed .cl_filter.cl_changed, #changesLog.cl_fixed .cl_filter.cl_fixed, #changesLog.cl_removed .cl_filter.cl_removed, #changesLog.cl_notfixed .cl_filter.cl_notfixed { opacity: 0.3; } .cl_filter { cursor: pointer; } .cl_filter:hover { background-color: #858585; } .cl_added, .cl_changed, .cl_fixed, .cl_removed, .cl_notfixed, .cl_comment { } .cl_added > span:first-child, .cl_changed > span:first-child, .cl_fixed > span:first-child, .cl_removed > span:first-child, .cl_notfixed > span:first-child { font-weight: bold; margin: 0 0.5em 0 1em; width: 0.7em; display: inline-block; text-align: center; } .cl_added > span:first-child { background-color: #C9F5C9; } .cl_changed > span:first-child { background-color: #BFEEFF; } .cl_fixed > span:first-child { background-color: #FFFFBF; } .cl_removed > span:first-child { background-color: #FFBFBF; } .cl_notfixed > span:first-child { background-color: #E4DADB; } .cl_notfixed > span:last-child { font-style: italic; } .cl_notfixed:not(.cl_filter) > span:last-child { opacity: 0.8; } #changesLogContent > div[class^="cl_ver_v"] .cl_comment > span:last-child { font-style: italic; opacity: 0.5; } .cl_added > span:last-child, .cl_changed > span:last-child, .cl_fixed > span:last-child, .cl_removed > span:last-child, .cl_notfixed > span:last-child, .cl_comment > span:last-child { width: 100%; } #animSpeedBox { margin-top: 1em !important; margin-bottom: 0.5em !important; } #animSpeedBox > div { position: relative; margin: 0 0.5em; width: 10em !important; } /* The slider itself *//* .slider { -webkit-appearance: none; /* Override default CSS styles *//* appearance: none; width: 100%; /* Full-width *//* height: 5px; /* Specified height *//* background: #d3d3d3; /* Grey background *//* -webkit-transition: .2s; /* 0.2 seconds transition on hover *//* transition: opacity .2s; margin: 0; vertical-align: middle !important; } /* Mouse-over effects *//* .slider:focus { } /* The slider handle (use -webkit- (Chrome, Opera, Safari, Edge) and -moz- (Firefox) to override default look) *//* .slider::-webkit-slider-thumb:after { background-color: red; width: 10px; } .slider::-webkit-slider-thumb { -webkit-appearance: none; /* Override default look *//* appearance: none; width: 1em; /* Set a specific slider handle width *//* height: 1em; /* Slider handle height *//* background: #66A2E3; /* Green background *//* cursor: pointer; /* Cursor on hover *//* border-radius: 50%; content: "wtf"; } .slider::-moz-range-thumb { width: 1em; /* Set a specific slider handle width *//* height: 1em; /* Slider handle height *//* background: #66A2E3; /* Green background *//* cursor: pointer; /* Cursor on hover *//* border-radius: 50%; content: "wtf"; } .ticks { width: 10em; } .ticks > span { position: absolute; top: -1.2em; font-size: 0.7em; } .ticks > span:after { content: " "; width: 1px; height: 10px; background-color: black; } .ticks > span:nth-child(1) { left: 4%; } .ticks > span:nth-child(2) { left: 14%; } .ticks > span:nth-child(3) { left: 24%; } .ticks > span:nth-child(4) { left: 34%; } .ticks > span:nth-child(5) { left: 43%; } .ticks > span:nth-child(6) { left: 53.5%; } .ticks > span:nth-child(7) { left: 63.5%; } .ticks > span:nth-child(8) { left: 73%; } .ticks > span:nth-child(9) { left: 83%; } .ticks > span:nth-child(10) { left: 91%; } div.undoBar { position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; text-align: center; display: none; z-index: 999999; height: 0; width: 100% !important; } div.undoBar > div { background: #fde073; line-height: 2.5; overflow: hidden; -webkit-box-shadow: 0 0 5px black; -moz-box-shadow: 0 0 5px black; box-shadow: 0 0 5px black; display: inline-block; padding: 0 0 0 1em; } div.undoBar > div a { cursor: pointer; text-decoration: underline; } div.undoBar > div > .close { cursor: pointer; margin-left: 1em; padding: 0.5em; } .cp-color-picker { box-sizing: content-box; width: 214px; border: 1px solid black; } .cp-color-picker .cp-panel { line-height: 21px; float:right; padding: 0 1px 0 8px; margin-top: -1px; overflow: visible; } .cp-xy-slider:active { cursor: none; } .cp-panel, .cp-panel input { color: #bbb; font-family: Monaco, "DejaVu Sans Mono", "Courier New", "Lucida Console", Courier, fixed, monospace; font-size: 1em; } .cp-panel input { width: 28px; height: 12px; padding: 2px 3px 1px; text-align: right; line-height: 12px; background: transparent; border: 1px solid; border-color: #222 #666 #666 #222; } .cp-panel hr { margin: 0 -2px 2px; height: 1px; border: 0; background: #666; border-top: 1px solid #222; } .cp-alpha { width: 155px; } .cp-disp { padding-bottom: 5px; clear: both; text-align: center; display: inline-block; } .cp-disp > input { margin-right: 3px; line-height: 1.2em; } .cp-hex { position: absolute; left: 0; bottom: -1.9em; text-align: start; display: inline-block; width: 5em; } #colorpicker-hex { margin-right: 0; width: 3.6em; padding-left: 3px; padding-right: 3px; border-width: 1px; text-align: start; } #timeOffsetBox { display: block; } input[type="number"] { width: 2.8em; } #resultsBecauseNoOneChecks { margin-top: 0; } /* https://kazzkiq.github.io/balloon.css/ *//* [msg] { position: relative; cursor: pointer; } [msg]:after { filter: alpha(opacity=0); -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; -moz-opacity: 0; -khtml-opacity: 0; opacity: 0; pointer-events: none; -webkit-transition: all 0.05s ease-out 0.05s; -moz-transition: all 0.05s ease-out 0.05s; -ms-transition: all 0.05s ease-out 0.05s; -o-transition: all 0.05s ease-out 0.05s; transition: all 0.05s ease-out 0.05s; font-family: sans-serif !important; font-weight: normal !important; font-style: normal !important; text-shadow: none !important; font-size: 12px !important; background: rgba(17, 17, 17, 0.9); border-radius: 4px; color: #fff; content: attr(msg); padding: .5em 1em; position: absolute; white-space: nowrap; z-index: 10; bottom: 100%; left: 50%; margin-bottom: 11px; -webkit-transform: translate(-50%, 10px); -moz-transform: translate(-50%, 10px); -ms-transform: translate(-50%, 10px); transform: translate(-50%, 10px); -webkit-transform-origin: top; -moz-transform-origin: top; -ms-transform-origin: top; transform-origin: top; } [msg]:before { background: no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba(17, 17, 17, 0.9)%22%20transform%3D%22rotate(0)%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E"); background-size: 100% auto; width: 1.2em; height: 0.5em; filter: alpha(opacity=0); -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; -moz-opacity: 0; -khtml-opacity: 0; opacity: 0; pointer-events: none; -webkit-transition: all 0.05s ease-out 0.05s; -moz-transition: all 0.05s ease-out 0.05s; -ms-transition: all 0.05s ease-out 0.05s; -o-transition: all 0.05s ease-out 0.05s; transition: all 0.05s ease-out 0.05s; content: ''; position: absolute; z-index: 10; bottom: 100%; left: 50%; margin-bottom: 5px; -webkit-transform: translate(-50%, 10px); -moz-transform: translate(-50%, 10px); -ms-transform: translate(-50%, 10px); transform: translate(-50%, 10px); -webkit-transform-origin: top; -moz-transform-origin: top; -ms-transform-origin: top; transform-origin: top; } [msg][msg-show]:before, [msg][msg-show]:after { filter: alpha(opacity=100); -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; -moz-opacity: 1; -khtml-opacity: 1; opacity: 1; pointer-events: auto; } [msg][msg-show]:after { -webkit-transform: translate(-50%, 0); -moz-transform: translate(-50%, 0); -ms-transform: translate(-50%, 0); transform: translate(-50%, 0); } [msg][msg-show]:before { -webkit-transform: translate(-50%, 0); -moz-transform: translate(-50%, 0); -ms-transform: translate(-50%, 0); transform: translate(-50%, 0); } .epNumFix { margin: 0.3em 0 !important; display: table; text-align: center; } .epNumFix input { max-width: 3em; border: 0; } .epNumFix .input { background-color: white; color: black; border: 1px solid black; } div.entry[color="white"] .epNumFix .input { border: 1px solid white; } body:not(.enableEpDateFix) .epDateFix, div.entry[data-episode=""] .epDateFix { display: none; } .epDateFix { margin: 0.3em 0 !important; display: table; text-align: center; } .epDateFix input { width: 100%; max-width: 100%; border: 0; } .epDateFix .input { width: 8em; background-color: white; color: black; border: 1px solid black; } div.entry[color="white"] .epDateFix .input { border: 1px solid white; } .epDateFix:not([title]) > div > span { display: none; } .epDateFix[title] input { background-color: lightgreen; } #epDateFix { display: none; } div.days { min-width: 1001px; } div.day { min-width: 137px; } /* disqus notificaiton badge *//* .notifBadge.loading:before { border-radius: 25px; border: 2px solid transparent; border-color: transparent #c2c6cc; animation: rotate-loading 1.5s linear 0s infinite normal; transform-origin: 50% 50%; position: absolute; content: ""; width: 1.5em; height: 1.5em; left: 0.4em; top: -0.2em; } .notifBadge.loading { color: transparent; } .notifBadge { display: inline-block; width: 1.5em; height: 1.5em; position: relative; top: -0.8em; } .notifBadge:not(.loading) { color: #fff; font-size: 1em; font-weight: bold; text-align: center; background-color: #f05f70; border-radius: 1.5em; vertical-align: top; line-height: 1.5em; padding-right: 0.1em; cursor: pointer; margin-left: 0.5em; z-index: 1; } .notifBadge:not(.loading):before { content: ""; position: absolute; top: 0.88em; left: 0.13em; width: 1em; height: 0.5em; background-color: #f05f70; transform: rotateZ(-5deg) skewX(-30deg); z-index: -1; } .notifBadge:not([unread]):not(.loading) { display: none; } #manage-cushows-popup .content { padding: 0 5px; } #cushows-edit > div > div { padding: 0.1em 0 0.1em 0.5em; } #cushows-edit > div > span { width: 22em; padding: 0.1em 0 0.1em 0.5em; } #cushows-list { margin: 5px 0; } #cushows-edit > .data > label { vertical-align: top } #cushows-edit textarea { font-size: 0.9em; } #cushows-edit { border-top: 1px dotted } #cushows-edit > div { display: table-row; } #cushows-edit textarea { white-space: pre; overflow: auto; vertical-align: top; height: 100%; min-height: 3em; height: 5em; min-width: 20em; margin: 0; padding: 0 2px 0 0; } body.ff #cushows-edit textarea { padding: 2px; } #cushows-season, #cushows-episode, #cushows-num, #cushows-days { width: 3em; } #cushows-date { width: 6em; } #cushows-edit:not(.help) #cushows-help > .expand, #cushows-edit.help #cushows-help > .collapse, #cushows-edit:not(.help) > div.info { display: none; } #cushows-edit #cushows-help { cursor: pointer; } #cushows-edit #cushows-help, #cushows-edit > div.info { font-size: 0.9em; color: grey; } #cushows-edit > div > span { max-width: unset; margin-right: 3em; display: block; } #cushows-list > li { padding-left: 5px; padding-right: 5px; cursor: default; border: 1px solid transparent; display: block; transition: margin 0.2s; } #cushows-list > li > span { } #cushows-list > li > :nth-child(1) { width: 1em; height: 1em; border: 1px solid black; float: unset; margin: 0; vertical-align: text-top; display: inline-block !important; } #cushows-list > li > :nth-child(2) { width: 100%; max-width: 24.5em; overflow: hidden; text-overflow: ellipsis; display: inline-block; margin-left: 4px; vertical-align: text-top; } .entry:not(.custom) .edit { display: none; } .searchResult .title span { color: black; text-shadow: 0 1px 2px white, 0 -1px 2px white, 1px 0 2px white, -1px 0 2px white, 1px 1px 2px white, -1px -1px 2px white, -1px 1px 2px white, 1px -1px 2px white; } #cushows-edit .info.format { vertical-align: top; } #cushows-edit .table { display: table; } #cushows-edit .table > div { display: table-row; } #cushows-edit .table > div > span { display: table-cell; padding: 2px; } #cushows-edit .table > div > span:nth-child(1) { text-align: right; } #cushows-list > li.updated { border: 1px dotted #90FF90; } #cushows-list > li.new { border: 1px dotted #FF9090; } #cushows-list > li.edit { border: 1px solid black; font-weight: bold; } #cushows-list > li.selected:not(.edit) { border: 1px dotted black; color: green; font-weight: bold } #cushows-list > li.edit.delete, #cushows-list > li.edit.delete > * { text-decoration: line-through; color: red; font-weight: normal; font-style: italic; } #engine-edit .action, #cushows-edit .action { margin: 0.5em 0 0.3em; display: inline-flex; width: 100%; } .break { white-space: pre-line; } #engine-edit .action > input, #cushows-edit .action > input { font-size: 90%; float: left; } .customColors { white-space: pre; } .colors.nopre .customColors { white-space: normal; } .color { color: white; } #cushows-list .color > .colors { display: none; position: relative; padding: 5px; margin: 0; top: 1.3em; left: -0.6em; border: 1px solid black; z-index: 1; cursor: default; max-width: 27em; background-color: white; } #cushows-list li.opened > .color > .colors { display: inline-block; } #noChangesLog { float: right; line-height: 1em; } @keyframes rotate-loading { 0% { transform:rotate(0) } 100% { transform:rotate(360deg) } } #searchResults .colors > .picker, #searchResults .colors .color { width: 1em; height: 1em; } #searchResults span.picker, #searchResUlts span.color { width: 1.2em; height: 1.2em; } .picker { background-image: none; width: 0.9em; height: 0.9em; vertical-align: top; } .entry.colorbox:hover:after, .colorpicker > .picker-light.self:before, .picker-light:hover:before, .picker:before { content: ""; display: inline-block; background-repeat: no-repeat; vertical-align: top; display: block; width: 1.2em; height: 1.2em; position: absolute; background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDE0IDE0IiB2ZXJzaW9uPSIxLjAiIHZpZXdCb3g9IjAgMCAxNCAxNCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMy4xIDEzLjdjLTAuNiAwLjQtMS40IDAuMy0xLjktMC4ybC0wLjgtMC44Yy0wLjUtMC41LTAuNi0xLjMtMC4yLTEuOWwwLjgtMS4zYzAuMS0wLjggMC40LTEuNiAxLTIuMmwzLjMtMy4zYzAtMC42IDAuMi0xLjQgMC43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MC4xIDAuNCAwIDAuNXoiLz48L3N2Zz4="); background-position: center; } .entry.colorbox:hover:after, .color, .svg:before { width: 0.9em; height: 0.9em; } .picker-light:before, .picker-light:hover { background-image: none; } .colorpicker > .picker-light.self:before, .picker-light:hover:before { width: 90%; height: 90%; position: relative; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); -moz-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%); } .desc > div.entry { border-top: none; border-bottom: 1px dashed #ccc; } .desc > div.entry.separating { border-bottom: 1px solid #555; } :not(.desc) > div.entry.separating { border-top: 1px solid; } li .color { vertical-align: 2px; } .colors, .colors *:not(.color):not(.picker) { cursor: default; } .none { background-position: center; background-repeat: no-repeat; background-size: cover; } span.checkbox { } span.checkbox:before { content: "☐"; padding-right: 3px; font-size: 1.3em; } span.checkbox[checked]:before { content: "☑"; } .content span.checkbox:before { font-size: 1.3em; } /*search bar icon*//* #searchBecauseNoOneChecks:not(.x) { background: #fff url('data:image/svg+xml;utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%206%206%22%3E%3Cpath%20fill%3D%22%23929292%22%20d%3D%22M2.23%200a2.23%202.23%200%200%201%201.7%203.68l.08.1h.28L6%205.47%205.49%206%203.77%204.29V4l-.1-.09A2.23%202.23%200%201%201%202.24%200m0%20.69a1.54%201.54%200%201%200%201.54%201.54A1.54%201.54%200%200%200%202.23.69z%22%2F%3E%3C%2Fsvg%3E') right 5px center/1em no-repeat; } #searchIcon > svg { vertical-align: middle; margin-right: 0.3em; width: 1em; height: 1em; } .menuIcon { margin: 0.2em 0.5em 0 0; } #menu li { margin-right: 0.7em; } #arrow { top: -20px; position: fixed; } .warning.info { display: block; text-align: center; width: 100%; } .warning.info, .warning.info > a { color: red; font-style: normal; } #go2top { position: sticky; bottom: 10px; margin-right: 10px; float: right; z-index: 1; outline: none; background-color: silver; color: white; cursor: pointer; padding: 0; width: 1.5em; height: 1.5em; text-align: center; vertical-align: middle; display: none; border: 1px solid grey; border-radius: 3px; opacity: 0.8; } #go2top > i { border: solid black; border-width: 0 3px 3px 0; display: inline-block; transform: rotate(-135deg); -webkit-transform: rotate(-135deg); padding: 0.3em; vertical-align: bottom; } body.archiveBottom div.archiveBottom { display: block; } div.archiveBottom { clear: both; display: none; } #archive-current2 { text-align: center; display: inline-block; } #leaveArchive2 { display: none; } body.archive #leaveArchive2 { display: block; } #archive-next2,#archive-prev2,#archive-current2 { padding: 5px 10px; text-decoration: none; } #archive-current2 { min-width: 180px; } div.separator { margin-top: 0; } #account-popup.promptbox, .promptbox { display: none; z-index: 999999 !important; width: 100%; top: 0; left: 0; right: 0; bottom: 0; } .prompt-content { display: flex; flex-direction: column; align-items: center; width: 100%; z-index: 999999; margin: 0 auto; } .prompt-form { background: #FBFBFB; border: 1px solid silver; padding: 1em; border-radius: 3px; -webkit-box-shadow: 0 4px 4px -2px grey; -moz-box-shadow: 0 4px 4px -2px grey; box-shadow: 0 4px 4px -2px grey; color: black; } .prompt-form > .msg { margin-bottom: 1em; white-space: pre-wrap; } .prompt-form > .control { float: right; margin-top: 1em; } .prompt-form > .control > span { display: inline-block; } .prompt-form > .control input[type="button"] { height: 2.6em; width: 6.1em; font-size: 0.96em; border-radius: 2px; border-image: none; border: 1px solid rgba(0,0,0,0.3); margin-left: 1em; } .prompt-form > .control > input[type="button"]:hover { background-color: initial;/*hover*//* } .prompt-form > .control > input[type="button"]:active { background-color: initial;/*active*//* } .prompt-form > .control > input.ok { background-color: #5A97FF; color: white; } .prompt-form > .control > input.ok:hover { background-color: #64A5FF; } .prompt-form > .control > input.ok:active { background-color: #2F7DFF; } .prompt-form .input { width: 100%; min-width: 5em; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .prompt-form > textarea { height: 4em; } body.popupBlur.popup:not(.prompt) #content > :not(.popup), body.popupBlur.prompt #content > :not(.promptbox) { -webkit-filter: blur(10px); -moz-filter: blur(10px); -o-filter: blur(10px); -ms-filter: blur(10px); filter: blur(10px); } body.popup, body.prompt { overflow: hidden; margin-right: 1.5em; } body.popupBlur.popup:after, body.popupBlur.prompt:after { } body.popup > #content:after, body.promp > #contentt:after { background-color: black; opacity: 0.7; content: ""; position: fixed; top: 0; left: 0; bottom: 0; right: 0; z-index: 9; } body:not(.prompt) #content > .promptbox { display: none !important; } body.prompt #content > .promptbox { display: flex !important; } body.prompts #content > *:not(.promptbox) { -webkit-filter: grayscale(100%); filter: grayscale(100%); } body.prompt.scrollbar { position: absolute; } .themeColorsSettings { display: table; } .themeColorBox > div.color { width: 1em; height: 1em; border: 1px solid black; margin-left: 0.5em; display: inline-block !important; float: unset; vertical-align: middle; text-align: center; padding: 0.1em; position: relative; } .themeColorBox { display: table-row !important; line-height: 2em; height: 2em; } .themeColorBox > * { display: table-cell !important; vertical-align: middle; } .themeColorBox > label { text-align: end; } .themeColorsSettings { text-align: center; width: 100%; } .themeColorsSettings > label { width: 100% !important; } .themeColorsSettings > * { text-align: initial; } .themeColorsSettings.colorpicker > .colorpicker .color { border: 1px solid black; -webkit-box-shadow: 0px 0px 10px 0px black; -moz-box-shadow: 0px 0px 10px 0px black; box-shadow: 0px 0px 10px 0px black; } .themeColorsSettings .example { display: inline-block !important; margin-left: 1em; padding: 0.4em; line-height: 1em; vertical-align: middle; position: relative; } .themeColorsSettings .example.example_down_1 { bottom: 0; } .themeColorsSettings .example.example_down_2 { bottom: -1em; } .themeColorsSettings .example.example_down_3 { bottom: -2em; } .themeColorsSettings .themeColorBox[down="1"] .example { bottom: 1em; } .themeColorsSettings .themeColorBox[down="2"] .example { bottom: -1em; } .themeColorsSettings .themeColorBox[down="3"] .example { bottom: -3em; } .themeColorsSettings .themeColorBox:not([color]) > .del { opacity: 0.3; } .themeColorsSettings .themeColorBox[color] > .del { cursor: pointer; } .themeColorsSettings .themeColorBox > .del { display: inline-block !important; height: 0.5em; vertical-align: text-top; } .themeColorsSettings > div { height: 1em; } .lastupdate { font-size: 0.9em; opacity: 0.5; } #disqus_recommendations { display: none; } */});//css style.innerHTML = css; style.id = "mainCSS"; let s = document.getElementsByTagName("head")[0].getElementsByTagName("style")[0]; s.parentNode.insertBefore(style, s); //fix incorrect initial color in colorpicker //fix clicking outside of colorpicker saves selected color instead of discarding //fix close colorpicker by pressing escape button var editingSeriesId = -1, pickerCallback = "", pickerColor = ""; var clone = $("#colorPickerHolder").clone(); $("#colorPickerHolder").remove(); var picker = clone.length && clone.colorPicker( { customBG: '#222', margin: '4px -2px 0', doRender: 'div div', animationSpeed: 0, opacity: false, buildCallback: function($elm) { $elm.toggleClass("popup", true); let cp = this; /* $elm .append('
') .on( "click", "input", function() { if (!this.value || this.id == 'colorpicker-hex') return; if (this.value == 'Save') { if (editingSeriesId != -2) { Settings.colors.add(cp.color.colors.HEX, cp.color.colors.HEX.toUpperCase() != "FFFFFF"); assignColor( editingSeriesId, "#" + cp.color.colors.HEX, true ); } if (pickerCallback && pickerCallback in pickerCallbacks && typeof(pickerCallbacks[pickerCallback]) == "function") { pickerCallbacks[pickerCallback](cp.color.colors.HEX); } Settings.colors.init(); editingSeriesId = -1; pickerCallback = ""; pickerColor = ""; } cp.toggle(); }) */ var colorInstance = this.color, colorPicker = this; $elm.prepend(multiline(function(){/*
R
G
B
H
S
B
#
*/ })).on( "input keydown keyup click", 'input', function(e) { if (this.type == 'button') { if (this.value == 'Save') { if (editingSeriesId != -2) { Settings.colors.add(cp.color.colors.HEX, cp.color.colors.HEX.toUpperCase() != "FFFFFF"); assignColor( editingSeriesId, "#" + cp.color.colors.HEX, true ); } if (pickerCallback && pickerCallback in pickerCallbacks && typeof(pickerCallbacks[pickerCallback]) == "function") { pickerCallbacks[pickerCallback](cp.color.colors.HEX); } Settings.colors.init(); editingSeriesId = -1; pickerCallback = ""; pickerColor = ""; } cp.toggle(); return; } if (e.key == "Enter" || e.which == 13) //ENTER(13) { $elm.find('input[value="Save"]').click(); return; } if (this.id != "colorpicker-hex") { let value = this.value.replace(/[^0-9]/g, ""), className = this.className, type = className.split('-')[1], color = {}; color[type] = value; colorInstance.setColor(type === 'HEX' ? value : color, type === 'HEX' ? 'HEX' : /(?:r|g|b)/.test(type) ? 'rgb' : 'hsv'); colorPicker.render(); return; } let start = this.selectionStart, end = this.selectionEnd; if (e.type == "keydown") { if (!e.shiftKey && ((start == 1 && end == 1 && (e.key == "ArrowLeft" || e.which == 37)) || (e.key == "ArrowUp" || e.which == 38) || (e.key == "Home" || e.which == 36))) { e.preventDefault(); start = end = 0; } if ((e.ctrlKey || e.metaKey)) { let k = 0; if (e.key == "z" || e.which == 90) k = -1; else if (e.key == "y" || e.which == 89) k = 1; if (k) { let u = cp.undo(k); if (u) { this.value = u.v; this.selectionStart = u.s || start-1; this.selectionEnd = u.e || end-1; } e.preventDefault(); $(this).trigger("input"); } } } if (!start && !end) { this.selectionStart = ++start; this.selectionEnd = ++end; } if (e.type != "input") return; let rs = 0, re = 0, r = "", val = this.value.toUpperCase(); for(let i = 0; i < val.length && r.length < 6; i++) { if (val.charAt(i).match(/[A-F0-9]/)) { r += val[i]; } else { if (i < start) rs++; if (i < end) re++; } } if (r != this.value) { this.value = r; this.selectionStart = start - rs; this.selectionEnd = end - re; } if (!e.isTrigger) cp.undo({v: this.value, s: this.selectionStart, e: this.selectionEnd}); try { var col = "#" + new Colors().setColor(this.value).HEX; log(col); if(col.length == 7) { if (editingSeriesId != -2) assignColor(editingSeriesId, col, false); if (pickerCallback && pickerCallback in pickerCallbacks && typeof(pickerCallbacks[pickerCallback]) == "function") { pickerCallbacks[pickerCallback](col, true); } cp.color.setColor(col); cp.render(undefined); } } catch(err) { //log(err); } }).find(".cp-disp").appendTo($elm);//.on( "input keydown keyup click", '#colorpicker-hex' /* this.keyhandle = function(obj, e) { log(arguments); let start = obj.selectionStart, end = obj.selectionEnd; if (e.type == "keydown") { if (!e.shiftKey && ((start == 1 && end == 1 && (e.key == "ArrowLeft" || e.which == 37)) || (e.key == "ArrowUp" || e.which == 38) || (e.key == "Home" || e.which == 36))) { e.preventDefault(); start = end = 0; } if ((e.ctrlKey || e.metaKey)) { let k = 0; if (e.key == "z" || e.which == 90) k = -1; else if (e.key == "y" || e.which == 89) k = 1; if (k) { let u = cp.undo(k); if (u) { obj.value = u.v; obj.selectionStart = u.s || start-1; obj.selectionEnd = u.e || end-1; } e.preventDefault(); $(obj).trigger("input"); } } } if (!start && !end) { obj.selectionStart = ++start; obj.selectionEnd = ++end; } if (e.type != "input") return; let rs = 0, re = 0, r = "", val = obj.value.toUpperCase(); for(let i = 0; i < val.length && r.length < 6; i++) { if (val.charAt(i).match(/[A-F0-9]/)) { r += val[i]; } else { if (i < start) rs++ if (i < end) re++ } } if (r != obj.value) { obj.value = r; obj.selectionStart = start - rs; obj.selectionEnd = end - re; } if (!e.isTrigger) cp.undo({v: obj.value, s: obj.selectionStart, e: obj.selectionEnd}); } */ $("body").on("keydown", function(e) { //ESC(27) = cancel if ((e.key == "Esc" || e.which == 27) && $elm.is(":visible")) cp.toggle(); }); //for some reason Chrome has issues with undo/redo after value was changed by the filter this.undo = function (val, init) { if (!this.store || init) { this.store = []; this.index = -1; } if (typeof(val) == "object") { let p = this.store[this.index]; if (p) { if (val.v == p.v) { this.store[this.index] = val; return; } } this.store[++this.index] = val; if (this.store.length > this.index + 1) this.store.splice(this.index + 1); } else { let i = this.index + val; if (i > -1 && i < this.store.length) this.index = i; return this.store[i]; } return this; };//undo() }, renderCallback: function($elm, toggled) { let colors = this.color.colors, cpHex = $("#colorpicker-hex"), modes = { r: colors.RND.rgb.r, g: colors.RND.rgb.g, b: colors.RND.rgb.b, h: colors.RND.hsv.h, s: colors.RND.hsv.s, v: colors.RND.hsv.v, // HEX: "#" + this.color.colors.HEX }; $('input', '.cp-panel').each(function() { let val = modes[this.className.substr(3)]; if (typeof(val) != "undefined") this.value = val; }); if (pickerCallback && pickerCallback in pickerCallbacks && typeof(pickerCallbacks[pickerCallback]) == "function") { pickerCallbacks[pickerCallback](typeof(toggled) == "undefined" ? colors.HEX : toggled , true); } // on show if( toggled === true ){ let col = editingSeriesId == -2 ? pickerColor : coalesce(DB.getColor(editingSeriesId), colors.HEX), val = colFix(col).replace(/[^0-9a-f]/gi, ""); cpHex.val(val); this.undo({v: val, s: 0, e: 0}); document.body.classList.toggle("colorpicker", true); } // on change else if( typeof(toggled) == "undefined" ){ //preview new color if (editingSeriesId != -2) assignColor( editingSeriesId, "#" + colors.HEX, false ); if (colors.HEX != new Colors().setColor(cpHex.val()).HEX) { // this.undo({v: "#" + colors.HEX, s: cpHex.selectionStart, e: cpHex.selectionEnd}); // cpHex.val("#" + colors.HEX); this.undo({v: colors.HEX, s: cpHex.selectionStart, e: cpHex.selectionEnd}); cpHex.val(colors.HEX); } } // on hide else if( toggled === false ){ document.body.classList.toggle("colorpicker", false); document.body.classList.toggle("colorpickerclose", true); //work around click firing on other elements setTimeout(function() { document.body.classList.toggle("colorpickerclose", false); }, 500); //restore entry color if( editingSeriesId > 0 ) loadColor( editingSeriesId ); editingSeriesId = -1; pickerCallback = ""; pickerColor = ""; picker.detach().appendTo("body"); } }//renderCallback() }).attr("id", "colorPickerHolderNew"); //replace ID so it won't initialize in main.js //log(picker); function colFix(c) { return "#" + String(c).toUpperCase().replace(/[^A-F0-9]/g, ""); } $("body").off("click", ".picker"); // now hook up the picker to the picker icons $("body").on("click", ".picker", function(e) { if( !$(e.target).hasClass("picker") ) return; editingSeriesId = $(this).parents("[data-series-id]").data("series-id"); let col = DB.savedColors[editingSeriesId]; if (!editingSeriesId && this.classList.contains("self")) { editingSeriesId = -2; pickerCallback = this.getAttribute("callback"); col = new Colors().setColor(coalesce($(this).css("background-color"), "#FFFFFF")).HEX; col = coalesce(col, "#FFFFFF"); } //set initial color in colorpicker based on current entry or default to white col = coalesce(col, "#FFFFFF"); if (col == "#FFFFFF" && Settings.prefs.lastColor) col = "#" + Settings.prefs.lastColor; picker.val(col); pickerColor = col; picker.detach().appendTo(this).click(); }); function middleClick(e) { if (e.button != 1 && !(!e.button && e.ctrlKey)) return; e.stopPropagation(); e.preventDefault(); if (e.target.tagName == "INPUT") return; let parent, entry = true; if (e.target.closest("div.title")) parent = [e.target.closest("div.entry")]; else { parent = e.target.parentNode.querySelectorAll("div.entry"); entry = false; } const engines = []; for(let i = 0; i < _engines.length; i++) { let engine = _engines[i]; if (engine.host in customLinks._list) //using up-to-date data engine = customLinks._list[engine.host]; if (document.body.classList.contains("engine_" + cleanName(engine.host))) engines[engines.length] = engine; } for(let i = 0; i < parent.length; i++) { const div = parent[i], MONKEY_ID = encodeURIComponent( div.dataset.seriesId ); if (!entry && !DB.getColor(MONKEY_ID)) continue; for(let i = 0; i < engines.length; i++) { const link = parseLink(div, engines[i]); window.open(link.href, (link.MONKEY + engines[i].name).replace(/[^0-9a-zA-Z_-]/g, "")); } } }//middleClick() function parseLink(div, engine) { //on middle click let el = $(div), title = (div._title && div._title._titleOrig ? div._title._titleOrig : el.children("div.title").text()) .replace("?", "").replace(/[0-9]+-[0-9]+-[0-9]+/, ""), _MONKEY = title.replace(/ E[0-9]+/g, "") || "", _MONKEY_N = title.replace( /\s*S[0-9]+E[0-9]+$/g, '' ) || "", _WIKI_TITLE = el.data("series-source"), _MONKEY_ID = el.data("series-id"), regexp = getRegexp(engine.regexp, undefined, true), MONKEY_REGEXP = _MONKEY, MONKEY_N_REGEXP = _MONKEY_N; if (regexp.length) { for(let i = 0; i < regexp.length; i++) { MONKEY_REGEXP = MONKEY_REGEXP.replace(regexp[i][0], regexp[i][1]); MONKEY_N_REGEXP = MONKEY_N_REGEXP.replace(regexp[i][0], regexp[i][1]); } } MONKEY_REGEXP = encodeURIComponent(MONKEY_REGEXP); MONKEY_N_REGEXP = encodeURIComponent(MONKEY_N_REGEXP); let MONKEY = encodeURIComponent( _MONKEY ), MONKEY_N = encodeURIComponent( _MONKEY_N ), WIKI_TITLE = encodeURIComponent( _WIKI_TITLE ), MONKEY_ID = encodeURIComponent( _MONKEY_ID ), date = (""+(el.data("date")||el.parent().data("date"))).match(/([0-9]{4})([0-9]{2})([0-9]{1,2})/) || ["","","",""], href = engine.href .replace( "MONKEY_ID", MONKEY_ID ) .replace( "MONKEY_N_REGEXP", MONKEY_N_REGEXP ) .replace( "MONKEY_REGEXP", MONKEY_REGEXP ) .replace( "MONKEY_N", MONKEY_N ) .replace( "MONKEY", MONKEY ) .replace( "{YEAR}", date[1] ) .replace( "{MONTH}", date[2] ) .replace( "{DAY}", date[3] ) .replace( "{WIKI_TITLE}", WIKI_TITLE ); if (regexp.length && engine.href.indexOf("MONKEY_N_REGEXP") == -1 && engine.href.indexOf("MONKEY_REGEXP") == -1) { for(let i = 0; i < regexp.length; i++) { href = href.replace(regexp[i][0], regexp[i][1]); } } return { href: fixLink(href, engine), title: title, MONKEY: MONKEY, MONKEY_N: MONKEY_N, MONKEY_ID: MONKEY_ID, MONKEY_REGEXP: MONKEY_REGEXP, MONKEY_N_REGEXP: MONKEY_N_REGEXP, WIKI_TITLE: WIKI_TITLE }; }//parseLink() $("body").on("mousedown", "div.date,div.title", middleClick); let _markSearchResults = markSearchResults; window.markSearchResults = function markSearchResults() { if (showMyShows.box || showMyHidden.box) return; let searchResults = $("#searchResults"), entries = searchResults.find("div.entry"); entries.each(watched.attach); setTimeout(function() { $("div.day").each(collapseMulti); }); let li = searchResults.find("li[data-series-id]"); function wikiTitle(node, wiki) { let text = node.text(); node.html('' + text + ''); } li.each(function() { let id = this.getAttribute("data-series-id"), wiki = DB.info[id] ? DB.info[id][1] : $('div.entry[data-series-id="' + id + '"]').attr("data-series-source"), title = $(this).find(".description > b:first-child"); if (wiki) { wikiTitle(title, wiki); } else { let obj = $("
"); DB.infoAdd(id); if (id > customShows.id) { DB.infoAdd(id); if (DB.info[id] && DB.info[id][1]) wikiTitle(title, DB.info[id][1]); return; } obj.load("/s?"+$.param({q:"info:" + id}), function(e, t, r) { if (t == "error") return; wiki = obj.find(".entry").attr("data-series-source"); if (wiki) wikiTitle(title, wiki); }); } }); if (entries.length) { let reverseOrder = function (entries, desc) { if (!entries.length) return; let before = entries[entries.length-1].nextSibling, order = reverseOrder.order(entries); if (typeof(desc) != "undefined" && ((desc && order == 1) || (!desc && order == -1))) return; for(let i = entries.length-1; i > -1; i--) entries[i].parentNode.insertBefore(entries[i], before); return; }; reverseOrder.order = function(entries) { return entries[0].innerText.toLowerCase().localeCompare(entries[entries.length-1].innerText.toLowerCase()); }; searchResults.prepend('
').find("span.button").click(function(e) { if (!e.isTrigger) { Settings.prefs.searchOrder = Settings.prefs.searchOrder ? 0 : 1; Settings.save(); } reverseOrder(searchResults.toggleClass("desc", Settings.prefs.searchOrder ? true : false).find("div.entry"), Settings.prefs.searchOrder); this.innerHTML = Settings.prefs.searchOrder ? "▼" : "▲"; }).trigger("click"); } return _markSearchResults(); };//markSearchResults() $("body").on("click", 'div.entry div.title>input[type="checkbox"]', function(e) { e.stopPropagation(); hidePopups(); }); //sanitizing engine links setTimeout(function() { var prevOpened = null, prevParentOpened = null, prevParentOpenTimer = null; $("body").off("click", "div.entry div.title"); $("body").on("click", "div.entry div.title", entryOpen);//$("body").on("click", "div.entry div.title", function(e) }); let aniSpeed = (device.tablet() || device.mobile())? 0 : 100; function getRegexp(reg, repl, type) { let regexp = [], lines = [], _repl = []; if (typeof(reg) == "string") { lines = reg.trim().replace(/\r/g, "\n").replace(/\n+/g, "\n").split("\n"); } else if (reg) { for(let i = 0; i < reg.length; i++) { lines[i] = reg[i][0]; _repl[i] = reg[i][1]; } } repl = typeof(repl) == "string" ? repl.replace(/\r/g, "\n").replace(/\n+/g, "\n").split("\n") : _repl; for(let i = 0; i < lines.length; i++) { let txt = lines[i]; try { let reg = /^\/(.*)\/([gimuy]*)$/i, parts = txt.match(reg) || (txt = "/" + txt + "/").match(reg); try { let r = new RegExp(parts[1], parts[2]); if (!type) r = r.toString(); if (r.toString().match(reg)[1] == parts[1]) regexp[regexp.length] = [r, repl[i] || ""]; } catch(er){log(er);} } catch(er){} } if (regexp.length != lines.length) return []; return regexp; } function entryOpen(ev, _engs) { if (!ev.target) return; if (!$(ev.target).hasClass("title")) { return entryOpen({target: ev.target.parentNode}); } force = false; let obj = ev.target, $entry = $(obj).parent(), details = $entry.find(".details"); // $entry.attr("color", $entry.css("color") == "rgb(0, 0, 0)" ? "black" : "white"); if (!details.length ) { if( $entry.children( "div.details" ).length == 0 ) { var engs = _engs || window.engines, inited = false; if (!_engs) { if($entry.attr("id") == "engine-hidden" || $entry.parents(".calendar").get().length>0) engs = engs.concat([{name: "Show all episodes", host: "airdates.tv", href: "javascript:search('info:MONKEY_ID');"}]); else engs = engs.concat([{name: "Show in calendar", host: "airdates.tv", href: "MONKEY_ARCHIVELINK", cls:"archive-link"}]); } var e = $( $.parseHTML($( "#detailsTemplate" ).html()) ).appendTo( $entry ); let _MONKEY = $entry.children("div.title").text().trim().replace(/^[0-9]{4}-[0-9]{2}-[0-9]{2}/, "").trim(), _MONKEY_N = _MONKEY.replace( /(S[0-9]+)?E[0-9]+$/g, '' ), _WIKI_TITLE = $entry.data("series-source"), _MONKEY_ID = $entry.data("series-id"); var MONKEY = encodeURIComponent( _MONKEY ); //.replace( /[^A-Za-z0-9 -]/g, '' ) ); var MONKEY_N = encodeURIComponent( _MONKEY_N ); var MONKEY_ID = encodeURIComponent( _MONKEY_ID ); var WIKI_TITLE = encodeURIComponent( _WIKI_TITLE ); $.each( engs, function( i, engine ){ let regexp = getRegexp(engine.regexp, undefined, true), MONKEY_REGEXP = _MONKEY, MONKEY_N_REGEXP = _MONKEY_N; if (regexp.length) { for(let i = 0; i < regexp.length; i++) { MONKEY_REGEXP = MONKEY_REGEXP.replace(regexp[i][0], regexp[i][1]); MONKEY_N_REGEXP = MONKEY_N_REGEXP.replace(regexp[i][0], regexp[i][1]); } } MONKEY_REGEXP = encodeURIComponent(MONKEY_REGEXP); MONKEY_N_REGEXP = encodeURIComponent(MONKEY_N_REGEXP); let eng = $( "#engineTemplate" ).children().clone().appendTo( e.find( ".engines" ) ), a = eng.filter("a.link"), img = eng.filter("img.icon"), br = eng.filter("br"), checkbox = document.createElement("input"), id = "engine_" + cleanName(engine.host), domain = getHost(engine.href), date = (""+$entry.closest("[data-date]").data("date")).match(/([0-9]{4})([0-9]{2})([0-9]{1,2})/) || ["","","",""], href = engine.href .replace("MONKEY_ARCHIVELINK", (""+$entry.closest("[data-date]").data("date")).replace(/([0-9]{4})([0-9]{2})([0-9]{1,2})/,"/archive/$1-$2#$3")) .replace( "MONKEY_ID", MONKEY_ID ) .replace( "MONKEY_N_REGEXP", MONKEY_N_REGEXP ) .replace( "MONKEY_REGEXP", MONKEY_REGEXP ) .replace( "MONKEY_N", MONKEY_N ) .replace( "MONKEY", MONKEY ) .replace( "{YEAR}", date[1] ) .replace( "{MONTH}", date[2] ) .replace( "{DAY}", date[3] ) .replace( "{WIKI_TITLE}", WIKI_TITLE ); if (regexp.length && engine.href.indexOf("MONKEY_N_REGEXP") == -1 && engine.href.indexOf("MONKEY_REGEXP") == -1) { for(let i = 0; i < regexp.length; i++) { href = href.replace(regexp[i][0], regexp[i][1]); } } a.attr( "href", href ) .addClass(engine.cls||"") .text( engine.name ); a[0].insertBefore(img[0], a[0].firstChild); eng.css( "display", "" ); if(engine.host == "airdates.tv") { a.attr("target",""); domain = "airdates.tv"; } img.attr("src", engine.icon ? engine.icon : "https://www.google.com/s2/favicons?domain=" + (domain || null)); img.toggleClass(id, true); a.toggleClass(id, true); br.toggleClass(id, true); if (a.hasClass("archive-link") && (showMyShows.box || showMyHidden.box)) { a.toggleClass("archive-link", false); a[0].textContent = "Show all episodes"; a[0].href = "javascript:search('info:" + MONKEY_ID + "');"; } a[0].href = fixLink(a[0].href, engine); if (_engs) { br.remove(); return; } if (engine.host == "airdates.tv") { let div = document.createElement("div"); div.className = "tools"; a[0].parentNode.appendChild(div); div.appendChild(a[0]); br.remove(); return; } $(checkbox).toggleClass(id, true); checkbox.engine = engine.host; checkbox.type = "checkbox"; checkbox.title = "Open with middle click on title"; checkbox.checked = enginesCheck(engine.host) != -1; img[0].parentNode.insertBefore(checkbox, img[0]); a.on("click", function(e) { if (e.target === this) return; let c = checkbox.checked; e.preventDefault(); if (c) enginesAdd(checkbox.engine); else enginesRemove(checkbox.engine); $("input." + id).prop("checked", c); setTimeout(function() { checkbox.checked = c; }); }); } ); inited = true; } //if( $entry.children( "div.details" ).length == 0 ) if (_engs) return; let showHideBox = document.createElement("div"), showHideObj = document.createElement("a"), entry = obj.parentNode, showId = entry.getAttribute("data-series-id"), show = document.createElement("span"), hide = document.createElement("span"); show.innerHTML = SVG.show + 'Show'; show.className = "showhide0"; hide.innerHTML = SVG.hide + 'Hide'; hide.className = "showhide1"; showHideObj.appendChild(show); showHideObj.appendChild(hide); showHideObj.appendChild(document.createTextNode(" this show")); showHideObj.className = "showhide"; showHideObj.href = "#"; showHideObj.addEventListener("click", function(e) { e.stopPropagation(); e.preventDefault(); showHide(parseInt(showId), 2); }, false); showHideBox.appendChild(showHideObj); $entry.find(".engines > .tools").last().append(showHideBox); let epNumFixBox = document.createElement("div"), epNumFixInputSeason = document.createElement("input"), epNumFixInputEpisode = document.createElement("input"), _title = obj.parentNode._title || {_titleDefault: $entry.children("div.title").text()}, title = _title._titleDefault; let data = episodeNumberFix.Get(showId, title, false, false); if (data) { epNumFixBox.className = "epNumFix"; epNumFixInputEpisode.value = data.episodeOffset; epNumFixInputEpisode.type = "number"; epNumFixInputEpisode.min = -999; epNumFixInputEpisode.max = 999; epNumFixInputSeason.value = data.seasonOffset; epNumFixInputSeason.type = "number"; epNumFixInputSeason.min = -999; epNumFixInputSeason.max = 999; let epNumFixEvt = function (evt) { try { let s = this.selectionStart, e = this.selectionEnd, num = Math.min(1000, Math.max(-1000, Number(this.value.replace(/[^0-9\-]/g, "")))); this.value = num; if (e !== null) this.selectionEnd = e; if (s !== null) this.selectionStart = s; if (!evt.isTrigger) { epNumFixSave(); } // Settings.pref("timeOffset", timeOffset); // if (!evt.isTrigger) // todayChange(timeOffset); } catch(er){console.error(er);} }; let epNumFixSave = function () { episodeNumberFix.Set(showId, title, Number(epNumFixInputSeason.value), Number(epNumFixInputEpisode.value)); episodeNumberFix.save(); // log(episodeNumberFix.list[showId]); let days = {}; $('div.entry[data-series-id="' + showId + '"]:not(.colorbox)').each(function(i, entry) { /* if (!entry._title) { entry._title = $(entry).find(".title").children("span").contents().filter(function() {return this.nodeType === 3})[0]; entry._title._titleDefault = entry._title.textContent; } */ let title = entry._title; title.textContent = episodeNumberFix(entry.getAttribute("data-series-id"), title._titleDefault); title._titleOrig = title.textContent || ""; entry.setAttribute("title", title.textContent); if (!entry._title) { //entry.lastChild.textContent = title.textContent; } if (entry.hasAttribute("opened")) { $.each( engs, function( i, engine ) { let id = "engine_" + cleanName(engine.host); $(entry).find("." + id).filter("a.link").attr("href", parseLink(entry, engine).href).contents().filter(function() { if (this.nodeType === 3) this.href = engine.href; }); }); } else { $(entry).find("div.details").remove(); } const day = entry.parentNode.getAttribute("data-date"); if (day) days[day] = entry.parentNode; }); for(let i in days) { collapseMulti(i, days[i], true); } }; $(epNumFixInputSeason).on("input", epNumFixEvt); $(epNumFixInputEpisode).on("input", epNumFixEvt) .trigger("input"); let txt = document.createElement("div"); txt.textContent = "Episode # offset"; epNumFixBox.appendChild(txt); let box = document.createElement("div"); box.className = "input"; box.appendChild(document.createTextNode("S")); box.appendChild(epNumFixInputSeason); box.appendChild(document.createTextNode("E")); box.appendChild(epNumFixInputEpisode); epNumFixBox.appendChild(box); showHideBox.parentNode.insertBefore(epNumFixBox, showHideBox.nextSibling); } let epDateFixBox = document.createElement("div"), epDateFixInput = document.createElement("input"); epDateFixBox.className = "epDateFix"; epDateFixInput.value = 999; epDateFixInput.type = "number"; epDateFixInput.min = -999; epDateFixInput.max = 999; let epDateFixEvt = function (evt) { try { let s = this.selectionStart, e = this.selectionEnd, num = Math.min(1000, Math.max(-1000, Number(this.value.replace(/[^0-9\-]/g, "")))); this.value = num; if (e !== null) this.selectionEnd = e; if (s !== null) this.selectionStart = s; if (!evt.isTrigger) { epDateFixSave(); } // Settings.pref("timeOffset", timeOffset); // if (!evt.isTrigger) // todayChange(timeOffset); } catch(er){log(er);} }; epDateFixInput._epDateFixTitle = function (id, list) { let last = list[list.length - 1]; if (list.length) { list.sort().forEach(function(val, i) { list[i] = episodeTools.full(val); }); return epDateFixBox.title = "Inherited from " + list.join(">"); } return epDateFixBox.removeAttribute("title"); }; let epDateFixSave = function () { let data = epDateFix.check(showId, entry._episodeID), offset = ~~epDateFixInput.value; // epDateFix.move(entry, entry._episodeID, offset); offset = offset - data.offsetPrev; epDateFix.update(showId, entry._episodeID, offset); epDateFixInput._epDateFixTitle(entry._episodeID, epDateFix.check(showId, entry._episodeID).parentList); let days = epDateFix(); epDateFix.save(); for (let i = 0; i < days.length; i++) { sortMyShows($(days[i]).find(".entry")); } epDateFixInput.focus(); }; $(epDateFixInput).on("input", epDateFixEvt) .trigger("input"); let txt = document.createElement("div"); txt.innerHTML = "Date offset (in days) *"; epDateFixBox.appendChild(txt); let box = document.createElement("div"); box.className = "input"; box.appendChild(epDateFixInput); epDateFixBox.appendChild(box); showHideBox.parentNode.insertBefore(epDateFixBox, showHideBox.nextSibling); let editBox = document.createElement("div"), editObj = document.createElement("a"), editIcon = document.createElement("span"); editIcon.innerHTML = SVG.edit + 'Edit'; editObj.appendChild(editIcon); editBox.appendChild(editObj); editBox.className = "edit"; editObj.href = "#"; editObj.addEventListener("click", function(e) { e.stopPropagation(); e.preventDefault(); let data = entry._cushowId; if (!data) { try { data = JSON.parse(entry.getAttribute("data-data")); }catch(er){console.error(er);} } customShows.show(showId, data); }, false); showHideBox.parentNode.insertBefore(editBox, showHideBox.nextSibling); }//if (!details.length ) if (_engs) return; details = $entry.find( ".details" ); let parent = $entry.parent(), speed = Settings.pref("animSpeed") * aniSpeed, open = details.is( ":visible" ); function callbackClose(obj) { let entry = $(obj).parent(), parent = entry.parent(); if (!open && $(obj).is(details)) return; entry.removeAttr("opened"); parent.removeAttr("opened"); parent.toggleClass("opened", false); if (parent[0]) collapseMulti.setTitle(parent[0].list, Settings.prefs.collapseMulti && !parent.hasClass("expand")? "_titleCollapsed" : "_titleOrig"); } $( "div.entry" ).filter("[opened]").find("div.details").slideUp(speed, function() { callbackClose(this); }); if( !open ) { let entry = obj.parentNode, epFixData = epDateFix.check(entry.dataset.seriesId, entry._episodeID), epFixParent = epFixData.parentList[epFixData.parentList.length - 1], input = entry.querySelector("div.epDateFix > .input > input"); input.value = epFixData.offset || 0; input._epDateFixTitle(entry._episodeID, epFixData.parentList); let callbackOpen = function() { $entry.attr("opened", ""); parent.attr("opened", ""); parent.toggleClass("opened", true); if (parent[0]) collapseMulti.setTitle(parent[0].list, "_titleOrig"); }; details.slideDown(speed, callbackOpen); $entry.attr("opened", ""); parent.attr("opened", ""); if (parent[0]) collapseMulti.setTitle(parent[0].list, "_titleOrig"); } }//entryOpen() function fixLink(link, engine) { link = link.replace("%3F", "").replace(/( |%20)E[0-9]+/, ""); if (engine.name == "Piratebay") link = link.replace(/['"`!]/g, ''); if (engine.host.indexOf("magnetdl.com") != -1) { /* link = link.toLowerCase().replace(/%20/g, "-").replace(/%[a-z0-9]{2}/g, "").replace(/\/[a-z]\/\/?([^\/]*\/?)$/, function(a, b) { return "/" + b[0] + "/" + b; }); */ link = link.replace(/\/[a-z]\/\/?([^\/]*)\/?$/, "/search/?q=$1&m=1&x=0&y=0"); } return link; } function showHideLoad() { if (showHideLoad.inited) return; $(".days").before(createCheckbox("showHidden", "Hidden shows", Settings.prefs.showHidden ? true : false, Settings.callback)); $(".days").before(createCheckbox("collapseMulti", "Collapse multiple", Settings.prefs.collapseMulti ? true : false, collapseMulti.onOff)); $(".days").before(createCheckbox("showWatched", "Watched shows", Settings.prefs.showWatched ? true : false, Settings.callback)); for(let i = 0; i < _hidden.length; i++) { showHide(_hidden[i], 1); } showHideLoad.inited = true; let clearColors = $(".clearColors"), clearHidden = clearColors.first().clone(false), clearWatched = clearHidden.clone(false); clearHidden.removeClass(); clearHidden.addClass("clearHidden"); clearHidden.html("Clear hidden"); clearWatched.removeClass(); clearWatched.addClass("clearWatched"); clearWatched.html("Clear watched"); clearWatched.insertAfter(clearColors); clearHidden.insertAfter(clearColors); $(".clearColors").after(" | "); $(".clearHidden").after(" | "); $("body").off("click", ".exportColors"); $("body").on( "click", ".exportColors", function(e) { e.stopImmediatePropagation(); let str = exportGetColors(); if (str) _prompt({ callback: function(){}, text: "This is the crazy text. \nYou can save it in a normal textfile and import it to another computer/browser.", value: str, file: "Airdates.tv_colors_" + (DB.username ? DB.username.replace(/[\/\\?%*:|"<>]/g, "_") + "_" : "") + dateTimestamp() + ".txt", ext: ".txt", }); else alert("Nothing to export"); return false; }); $("body").off("click", ".importColors"); $("body").on( "click", ".importColors", function(e) { e.stopImmediatePropagation(); _prompt({ callback: function(str) { if( str ) { let num = 0; $.each( str.split( ";" ), function( i, e ){ let arg = e.split("=").concat([true] ); if (arg.length == 3 && String(Number(arg[0])) === arg[0] && arg[1].match(/^#[a-fA-F0-9]{6}/)) { arg[1] = arg[1].trim(); assignColor.apply( null, arg ); num++; } } ); setTimeout(function() { alert( "kk, imported " + num + " colors" ); }); } }, text: "Please enter the crazy text!", ext: ".txt" }); return false; }); } //showHideLoad() //BEGIN custom shows function customShows() { if (!customShows.inited) customShows.init(); let list = customShows.listDate, days = document.querySelector(".days"), entry = document.createElement("div"), title = document.createElement("div"); entry.className = "entry custom"; title.className = "title"; entry.appendChild(title); //adding title attribute so we can avoid duplicate entries with custom names let i = -1, _entries = document.querySelectorAll(".days > .day > .entry"); while(++i < _entries.length) { if (!_entries[i]._title) _entries[i].setAttribute("data-title", _entries[i].textContent.trim()); } for(let i in list) { let day = days ? days.querySelector('[data-date="' + i + '"]') : null; //log(day); if (!day) continue; let added = false; loopData: for(let n = 0; n < list[i].length; n++) { let data = list[i][n], id = data.id - customShows.id, episode = (data.season ? "S" + pad(data.season) : "") + "E" + pad(data.episode); data.name = customShows._list.l[id][0]; data.wiki = customShows._list.l[id][2]; let name = data.name + " " + episode, // _entries = day.querySelectorAll('[data-series-id="' + data.id + '"]'), _entries = day.querySelectorAll('[data-title="' + name + '"], [data-series-id="' + data.id + '"]'), _entry = null, titleDiv = null; for(let e = 0; e < _entries.length; e++) { // if (_entries[e]._title && _entries[e]._title._titleDefault == name) if (_entries[e].getAttribute("data-series-id") != data.id || (_entries[e]._title && _entries[e]._title._titleDefault == name)) { _entry = _entries[e]; continue loopData; } titleDiv = _entries[e].querySelector('div.title'); if (titleDiv && titleDiv.innerText.trim() == name) { if (_entries[e].getAttribute("data-series-id") != data.id) //will never be true _entries[e].parentNode.removeChild(_entries[e]); else continue loopData; } } entry = entry.cloneNode(true); title = entry.firstChild; title.innerText = name; entry.setAttribute("data-series-id", data.id); // entry.setAttribute("color", $(entry).css("color") == "rgb(0, 0, 0)" ? "black" : "white"); entry.setAttribute("data-series-source", data.wiki || ""); entry.classList.toggle("season-premiere", data.episode == 1 && data.season > 1); entry.classList.toggle("series-premiere", data.season == 1 && data.episode == 1); entry._cushowId = data.d; entry._episode = episode; entry._episodeID = episodeTools.id(episode); entry._episodeDate = i; day.appendChild(entry); added = true; } //no longer needed as it's going to be sorted later /* if (added) { //sort by name; Array.prototype.slice .call(day.querySelectorAll(".entry")) .map(function (a) { return day.removeChild(a); }) .sort(function (a, b) { log([a, a.dataset.title, a.children[0].innerText]) return a.children[0].innerText.toLowerCase().localeCompare(b.children[0].innerText.toLowerCase()); }) .forEach(function (a) { day.appendChild(a); }); } */ } }//customShows() customShows.d2y = function(date) { return "" + ~~(date/10000); }; customShows.d2m = function(date) { return ("0" + ~~((date / 100) % 100)).slice(-2); }; customShows.d2d = function(date) { return ("0" + ~~(date % 100)).slice(-2); }; /* customShows.__list = { i: 4, //next ID l: { 1: [ "a Test", // name [ [ 1, // season 1, //episode 20181101, // start date 2, // total number of episodes 7, // interval in days between episodes ], [ 2, // season 1, //episode 20181101, // start date 2, // total number of episodes 7, // interval in days between episodes ] ], "" //wiki ], 2: [ "Test2", // name [ [ 1, // season 1, //episode 20181116, // start date 4, // total number of episodes 0, // interval in days between episodes ] ], "" //wiki ], 3: [ "bBad Blood", // name [ [ 2, // season 1, //episode 20181101, // start date 2, // total number of episodes 0, // interval in days between episodes ], [ 2, // season 3, //episode 20181108, // start date 2, // total number of episodes 7, // interval in days between episodes ] ], "test blod" //wiki ], } }; */ customShows.id = 1000000;//000000; customShows.init = function(_list) { customShows._list = _list || ls("customShows") || {i:1,l:{}}; customShows.list = {}; customShows.listDate = {}; customShows.listNames = {}; let list = customShows._list.l, upgraded = false; for(let i in list) { let name = list[i][0], id = ~~i, data = list[i][1], wiki = list[i][2]; for(let n = 0; n < data.length; n++) { if (data[n].length < 5) //old version { let epArray = /(s([0-9]+))?e([0-9]+)/gi.exec(data[n][0]), season = ~~epArray[2], episode = ~~epArray[3]; data[n].splice(0, 0, season); data[n][1] = episode; upgraded = true; } let season = data[n][0], episode = data[n][1], date = data[n][2], num = data[n][3], days = data[n][4], weekDays = "" + (data[n][6] || 1234567), perDay = data[n][5] || 1, _date = new _Date(0), newId = id + customShows.id; weekDays = weekDays.replace("7", "0"); _date.setFullYear(this.d2y(date), this.d2m(date)-1, this.d2d(date)); _date.setHours(0); for (let e = 0; e < num; e++) { let i = 7; while(weekDays.indexOf(_date.getDay()) == -1 && i--) { _date = new _Date(_date.getTime() + 86400000); } let newDate = "" + _date.getFullYear() + pad(_date.getMonth()+1) + pad(_date.getDate()); for (let p = 0; p < perDay && p + e <= num ; p++) { if (!customShows.list[newId]) customShows.list[newId] = []; customShows.list[newId][customShows.list[newId].length] = { date: newDate, season: season, episode: episode, d: data[n] }; if (!customShows.listDate[newDate]) customShows.listDate[newDate] = []; customShows.listDate[newDate][customShows.listDate[newDate].length] = { id: newId, season: season, episode: episode, d: data[n] }; episode++; if (p) e++; } _date.setDate(_date.getDate() + days); } } customShows.listNames[name.toLowerCase()] = i; } customShows.inited = true; if (upgraded) customShows.save(); };//customShows.init() customShows.save = function(list) { ls("customShows", list || customShows._list); }; customShows.remove = function(id) { delete customShows._list.l[id]; $('[data-series-id="' + (id + customShows.id) + '"]').each(function() { if (this.hasAttribute("opened")) this.parentNode.classList.toggle("opened", false); }).remove(); let obj = $('#cush_' + id); if (obj.hasClass("opened")) obj.parent().toggleClass("opened", false); obj.remove(); assignColor(id + customShows.id, "FFFFFF", true); showHide(id + customShows.id, 0); customShows.save(); customShows.init(customShows._list); if ($("#searchbar").hasClass("active")) { let s = $("#searchBecauseNoOneChecks"), v = s.val(); s.val("").trigger("change").val(v).trigger("change"); } };//customShows.remove() customShows.search = function(_id, name) { let searchResults = $("#searchResults"); if (name) { let html = ""; name = ("" + name).toLowerCase(); for(let i in customShows._list.l) { let data = customShows._list.l[i], id = ~~i + customShows.id; if (data[0].toLowerCase().indexOf(name) == -1) continue; let ep = {}, today = new Date(), last = null, next = null; today = today.getFullYear() * 10000 + (today.getMonth() + 1) * 100 + today.getDate(); for(let n = 0; n < customShows.list[id].length; n++) { ep = customShows.list[id][n]; let date = ~~ep.date; if (date <= today) { last = date; } else if (date > today) { next = date; break; } } html += '
  • ' + ' ' + '' + data[0] + '
    ' + (last ? "Last aired" : "Next show") + ': ' + customShows.d2y(ep.date) + "-" + customShows.d2m(ep.date) + "-" + customShows.d2d(ep.date) + "
    " + 'Indexed: ' + customShows.list[id].length + ' episode' + (customShows.list[id].length > 1 ? "s" : "") + '
    ' + '
  • '; } if (html) { //sort by name; let p = document.getElementById("resultsBecauseNoOneChecks"); if (p.innerText.indexOf("No results") != -1) p.innerHTML = ""; p.innerHTML += html; let changed = false, parnt = $(p), entries = parnt.children(); entries.sort(function(a, b) { let r = a.innerText.toLowerCase().localeCompare(b.innerText.toLowerCase()); if (r) changed = true; return r; }); /* if (Settings.prefs.myShowsTop) { entries.sort(function(a, b) { let r = (b.dataset.seriesId in DB.savedColors) - (a.dataset.seriesId in DB.savedColors); if (r) changed = true; return r; }); } */ if (changed); parnt.append(entries); /* Array.prototype.slice .call(p.children) .map(function (a) { return p.removeChild(a); }) .sort(function (a, b) { return a.innerText.toLowerCase().trim().localeCompare(b.innerText.toLowerCase().trim()); }) .forEach(function (a) { p.appendChild(a); }); */ } return; } let id = ~~_id - customShows.id, data = customShows.list[_id]; searchResults.html(""); if (!data) return searchResults.html("Show doesn't exist"); data.name = customShows._list.l[id][0]; data.wiki = customShows._list.l[id][2]; $('' + data.name + ' (all episodes)
    ').appendTo(searchResults); for(let i = 0; i < data.length; i++) { $('
    ' + customShows.d2y(data[i].date) + "-" + customShows.d2m(data[i].date) + "-" + customShows.d2d(data[i].date) + '
    ' + data.name + " " + (data[i].season ? "S" + pad(data[i].season) : "" ) + "E" + pad(data[i].episode) + '
    ') .appendTo(searchResults)[0]._cushowId = data[i].d; } $("
    Your added custom show

    ").appendTo(searchResults); markSearchResults(); };//customShow.search() customShows.show = function(id, dataId) { if (!customShows.div) customShows.manager(); let div = $(customShows.div); hidePopups(); div.show(); setPopup(true); if (id) { let obj = $("#cush_" + (~~id - customShows.id)); obj.trigger("click"); scrollIntoView(obj[0], obj[0].parentElement.parentElement, 5, 5); customShows.div.scrollIntoView(false); let _data = $("#cushows-data"), data = _data[0]._data; if (dataId && data) { for (let i = 0; i < data.length; i++) { if (isEqual(data[i], dataId)) { let t = _data[0], fullText = t.value, val = fullText.split("\n"), s = val.slice(0, i).join("\n").length + (i ? 1 : 0), e = val.slice(i, i+1).join("\n").length + 1; t.focus(); t.scrollTop = 0; t.value = fullText.substring(0, s+e); t.scrollTop = t.scrollHeight; t.value = fullText; t.setSelectionRange(s, s+e); break; } } } } };//customShows.show() function scrollIntoView(el, p, offsetTop, offsetBot) { let pRect = p.getBoundingClientRect(), elRect = el.getBoundingClientRect(); offsetTop = ~~offsetTop; offsetBot = ~~offsetBot; if (pRect.bottom < elRect.bottom) { p.scrollTop = p.scrollTop + (elRect.top - pRect.bottom) + elRect.height + offsetBot; } if (elRect.top < pRect.top) { p.scrollTop = p.scrollTop + (elRect.bottom - pRect.top) - elRect.height - offsetTop; } } customShows.hide = function() { $(customShows.div).hide(); setPopup(false); }; customShows.manager = function customShowsManager(callback) { if (customShows.div) return callback ? callback() : true; let html = multiline(function(){/* */});//html let popup = $(html).appendTo("#content"); customShows.div = popup[0]; $(popup).find("[id^=account]").each(function() { this.id = this.id.replace("account", "manage-cushows"); }); let content = $(popup).find(".content").html(""); html = multiline(function(){/*
    Separate entries with a new line. ▲ More info▼ Less info
    S0E0 | YYYYMMDD | n | i | p | 1234567
    = Season + Episode number
    = Date the episode starts (can be YYYY-MM-DD)
    = Number of episodes (1+)
    = Interval between episodes (in days) (0+)
    = (optional) number of episodes per day
    = (optional) day of the week,
       where 1 = Monday and 7 = Sunday (this setting will superseed the interval between episodes)
    Any non-numerical characters (space, coma, slash, letters, etc) can be used as fields separator
    */});//html $(html).appendTo(content.parent()); let cushName = $("#cushows-name"), cushWiki = $("#cushows-wiki"), cushData = $("#cushows-data"), cushForm = $("#cushows-form"), cushSubmit = $("#cushows-submit"), cushSubmitUpdate = $("#cushows-submitupdate"), cushReset = $("#cushows-reset"), editId = null, _today = new Date(), cushBox = document.createElement("div"), // dataRegex = /^([^0-9]*([0-9]+)[^0-9]+([0-9]+))[^0-9]+((([0-9]{4})[^0-9]+([0-9]{1,2})[^0-9]+([0-9]{1,2}))|(([0-9]{4})[^0-9]*([0-9]{2})[^0-9]*([0-9]{2}))|(([0-9]{4})[^0-9]*([0-9]{1,2})[^0-9]+([0-9]{1,2})))[^0-9]+([0-9]+)[^0-9]+([0-9]+)[^0-9]*([0-9]+)?[^0-9]*$/, dataRegex = /^([^0-9]*([0-9]+)|([^0-9]*([0-9]+)[^0-9]+([0-9]+)))[^0-9]+((([0-9]{4})[^0-9]+([0-9]{1,2})[^0-9]+([0-9]{1,2}))|(([0-9]{4})[^0-9]*([0-9]{2})[^0-9]*([0-9]{2}))|(([0-9]{4})[^0-9]*([0-9]{1,2})[^0-9]+([0-9]{1,2})))[^0-9]+([0-9]+)[^0-9]+([0-9]+)[^0-9]*(([0-9]+)?[^0-9]*)?(([1-7]+)?[^0-9]*)?$/, dr = function(d) { let r = d.match(dataRegex); if (!r) return r; return { s: typeof(r[4]) != "undefined" ? ~~r[4] : null, e: typeof(r[5]) != "undefined" ? ~~r[5] : ~~r[2], y: ~~(r[8] || r[12] || r[16]), m: ~~(r[9] || r[13] || r[17]), d: ~~(r[10] || r[14] || r[18]), n: ~~r[19], i: ~~r[20], p: ~~r[22] || null, w: r[23] || null }; }; cushBox.id = "cushows-list"; cushBox.setAttribute("tabindex", 0); cushBox.addEventListener("keypress", function(e) { let obj = null; if (e.code == "ArrowUp") { e.preventDefault(); e.stopPropagation(); obj = $(cushBox).find(".edit").prev(); } else if (e.code == "ArrowDown") { e.preventDefault(); e.stopPropagation(); obj = $(cushBox).find(".edit").next(); } else if (e.code == "ArrowLeft") { e.preventDefault(); e.stopPropagation(); obj = $(cushBox).find(".edit").parent().children().first(); } else if (e.code == "ArrowRight") { e.preventDefault(); e.stopPropagation(); obj = $(cushBox).find(".edit").parent().children().last(); } if (obj && obj[0]) { obj.click(); scrollIntoView(obj[0], obj[0].parentElement.parentElement, 5, 5); } }, true); today = today.getFullYear() * 10000 + (today.getMonth() + 1) * 100 + today.getDate(); $("#cushows-edit").toggleClass("help", Settings.prefs.cushowsHelp); $("#cushows-help").click(function(e) { Settings.pref("cushowsHelp", !Settings.pref("cushowsHelp") ? 1 : 0); $("#cushows-edit").toggleClass("help", Settings.prefs.cushowsHelp); }); $("#cushows-example").click(function(e) { let t = new Date(), sel, range, el = this.nextSibling, n = rand(1, 7), i = rand(0, 2) ? 7 : 1, p = rand(0, 5), remDup = function(a) { let b = {}; for(let i = 0; i < a.length; i++) { b[a[i]] = ""; } return Object.keys(b); }, w = remDup((Array(n+1).join((Math.random().toString(7)+'0000000').slice(2, 18)).slice(0, n)).replace(/[0]/g, 7).split("")).sort(), tooltip = [], perDay = 1, days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]; for(let c = 0; c < w.length; c++) { tooltip[tooltip.length] = days[w[c]-1]; } tooltip = tooltip.join("\n"); w = w.join(""); t = new Date(t.getTime() - (86400000 * rand(-2, 2))); if (!p && w && i == 1) p = 1; el.innerHTML = 'S' + pad(rand(0, 15)) + "" + 'E' + pad(rand(0, 22)) + " " + '| ' + t.getFullYear() + "-" + pad(t.getMonth() + 1) + "-" + pad(t.getDate()) + " " + '| ' + rand(1, 22) + " " + '| ' + i + " " + (p ? '| ' + p + " " : "") + (w && i == 1 ? '| ' + w + " ": ""); if (e.isTrigger) return; try { sel = window.getSelection(); if (sel.toString() == '') { window.setTimeout(function() { range = document.createRange(); //range object range.selectNodeContents(el); //sets Range sel.removeAllRanges(); //remove all ranges from selection sel.addRange(range);//add Range to a Selection. }, 1); } } catch(er){console.error(er);} }).trigger("click"); function change(e) { clearTimeout(change.timer); change.timer = setTimeout(function() { let error = false, name = cushName.val().trim(), data = cushData.val().trim(); if (data.length) { data = data.split("\n"); for(let i = 0; i < data.length; i++) { data[i] = data[i].trim(); // let d = data[i].match(dataRegex); // if (data[i].length && (!d || ~~d[17] < 1 || (d[19] && (d[19].match(/[^1-7]/) || d[19].length > 7)))) let d = dr(data[i]); if (data[i].length && (!d || d.n < 1 || (d.w && d.w.length > 7))) { error = true; break; } } } cushName.toggleClass("error", !name.length && data.length ? true : false); cushData.toggleClass("error", error || (name.length && !data.length) ? true : false); buttonsUpdate(); }, 0); }//change() function buttonsUpdate() { let name = cushName.val().trim().toLowerCase(), add = customShows.listNames[name] || !name || !cushData.val().trim() || cushData.hasClass("error"), update = (!editId && !customShows.listNames[name]) || !name || !cushData.val().trim() || cushData.hasClass("error"), merge = customShows.listNames[name] && customShows.listNames[name] != editId; //if (editId && customShows.listNames[name]) edit(customShows.listNames[name] || editId, true, "selected"); edit(merge ? editId : -1, false, "delete"); cushSubmitUpdate.val( merge ? "Merge" : "Update"); cushSubmit.prop("disabled", add); cushSubmitUpdate.prop("disabled", update); cushReset.prop("disabled", !(name + cushData.val() + cushWiki.val())); if (add && !update) cushSubmit.hide(); else cushSubmit.show(); if (update) cushSubmitUpdate.hide(); else cushSubmitUpdate.show(); } function sortShows() { let changed = false, p = $(cushBox), entries = p.children(); entries.sort(function(a, b) { let r = a.innerText.toLowerCase().localeCompare(b.innerText.toLowerCase()); if (r) changed = true; return r; }); if (changed); p.append(entries); /* Array.prototype.slice .call(cushBox.children) .map(function (a) { return cushBox.removeChild(a); }) .sort(function (a, b) { return a.innerText.toLowerCase().trim().localeCompare(b.innerText.toLowerCase().trim()); }) .forEach(function (a) { cushBox.appendChild(a); }); */ } cushName.on("input change", change); cushWiki.on("input change", change); cushData.on("input change", change); cushReset.click(function(e) { clearTimeout(change.timer); editId = null; cushName.toggleClass("error", false); cushData.toggleClass("error", false); edit(); setTimeout(buttonsUpdate); }); buttonsUpdate(); function flash(obj, color, scroll) { if (!obj[0].parentElement) return; if (typeof(scroll) == "undefined") scroll = true; if (scroll) { scrollIntoView(obj[0], obj[0].parentElement.parentElement, 3, 6); } obj.toggleClass("update", false); obj.css("background-color", color ? color : "#90FF90"); setTimeout(function() { obj.toggleClass("update", true); setTimeout(function() { obj.toggleClass("update", false); }, 1000); obj.removeAttr("style"); }, 100); } cushForm.on("submit", function(e) { e.preventDefault(); if (editId && document.activeElement == cushSubmit[0]) editId = null; let data = cushData.val().trim().split("\n"), ep = [], wiki = cushWiki.val().trim(); for(let i = 0; i < data.length; i++) { /* let a = [], r = data[i].match(dataRegex); if (!r) return; a[0] = ~~r[2]; a[1] = ~~r[3]; let y = r[6] || r[10] || r[14], m = r[7] || r[11] || r[15], d = r[8] || r[12] || r[16]; a[2] = y ? y + pad(m) + pad(d) : r[4]; a[2] = ~~a[2]; a[3] = ~~r[17]; a[4] = ~~r[18]; if (r[19]) a[5] = ~~r[19]; */ let a = [], r = dr(data[i]); if (!r) return; a[0] = r.s === null ? "" : r.s; a[1] = r.e; a[2] = r.y + pad(r.m) + pad(r.d); a[2] = ~~a[2]; a[3] = ~~r.n; a[4] = ~~r.i; if (r.p) a[5] = ~~r.p; if (r.w) a[6] = ~~Array.from(new Set(r.w.split("").sort())).join("");//remove duplicates if (a[3] < 1) return; ep[ep.length] = a; } wiki = wiki.replace(new RegExp("\/*?(#.*)?$", ""), "").split("/"); wiki = wiki[wiki.length-1]; data = [ cushName.val().trim(), ep, wiki || "", ]; let oldEditId = editId, name = data[0].toLowerCase(); if (name in customShows.listNames && editId != customShows.listNames[name]) { editId = customShows.listNames[name]; data[1] = [].concat(customShows._list.l[editId][1], data[1]); if (!data[2]) data[2] = customShows._list.l[editId][2]; if (oldEditId != editId) customShows.remove(oldEditId); } let isEdit = (editId), id = editId || customShows._list.i++, seen = {}; //remove duplicates data[1] = data[1].sort().filter(function(item) { var k = JSON.stringify(item); return k in seen ? false : (seen[k] = true); }); let cache = {}, array = []; for(let i = 0; i < data[1].length; i++) { let str = JSON.stringify(data[1][i]); if (!cache[str]) array[array.length] = data[1][i]; cache[str] = true; } data[1] = array; if (DB.info[id + customShows.id]) { DB.info[id + customShows.id][0] = data[0]; DB.info[id + customShows.id][1] = data[2]; DB.infoSave(); } customShows._list.l[id] = data; let obj = null, type = "new"; if (editId) { obj = $("#cush_" + id); obj.children(".name").text(data[0]); type = "updated"; } else { obj = customShowsCreate(id, callback); cushBox.appendChild(obj); obj = $(obj); } $("#" + cushBox.id).children().toggleClass("new updated", false); obj.toggleClass(type, true); obj.attr("title", data[0]); sortShows(); flash(obj, "yellow", true); if (isEdit) { $('[data-series-id="' + (id + customShows.id) + '"]:not(.colorbox)').each(function() { if (this.hasAttribute("opened")) this.parentNode.classList.toggle("opened", false); }).remove(); } customShows.init(customShows._list); customShows.save(); $('div[data-series-id="' + (id + customShows.id) + '"]').each(function() { delete this.parentNode.list; }); showPast(function() { customShows(); epDateFix(); let obj = $('div[data-series-id="' + (id + customShows.id) + '"]'); if (obj.parent().attr("id") == "searchResults") return; //adding watched checkboxes obj.each(watched.attach); //collapse multiple entries of the same series in one day obj.parent().each(function(i, e) { if (e.classList.contains("day")) sortMyShows($(e).find("div.entry")); collapseMulti(i, this, true); }); }); showHideLoad(); if ($("#searchbar").hasClass("active")) { let s = $("#searchBecauseNoOneChecks"), v = s.val(); s.val("").trigger("change").val(v).trigger("change"); } obj.trigger("click"); // cushReset.trigger("click"); });//cushForm.submit() function edit(id, scroll, className) { id = id || editId; className = className || "edit"; for(let i = 0; i < cushBox.children.length; i++) cushBox.children[i].classList.toggle(className, (cushBox.children[i].id == "cush_" + id)); if (scroll) { let obj = document.getElementById("cush_" + id); if (obj) scrollIntoView(obj, obj.parentElement.parentElement, 3, 6); } } let colorBox = $( "#detailsTemplate" ).find(".colors").first().clone()[0]; function customShowsCreate(id, callback) { let data = { get name() { return customShows._list.l[id][0]; }, get l() { return customShows._list.l[id][1]; }, get wiki() { return customShows._list.l[id][2]; } }, entry = document.createElement("li"), editBox = document.createElement("span"), colorPicker = document.createElement("div"), nameBox = document.createElement("span"); nameBox.className = "name"; nameBox.textContent = data.name; colorPicker.className = "color entry colorbox"; colorPicker.setAttribute("data-series-id", id + customShows.id); colorPicker.title = "Set Color"; entry.title = data.name; entry.appendChild(colorPicker); entry.appendChild(nameBox); entry.appendChild(editBox); editBox.className = "editBox"; //EDIT // $('').appendTo(editBox).click(function(e) $(entry).click(function(e) { if (e.target.classList.contains("colorbox") || (entry.classList.contains("opened") && !$(e.target).parents('.colorbox').get().length)) { colorPicker.appendChild(colorBox); $(cushBox).find(':not([id="cush_' + id +'"]).opened').toggleClass("opened", false); e.target.parentNode.classList.toggle("opened"); let opened = e.target.parentNode.classList.contains("opened"); document.body.classList.toggle("colorbox", opened); e.target.parentNode.parentNode.classList.toggle("opened", opened); if (opened) { document.getElementById("manage-cushows-css").innerHTML = '#cushows-list.opened>li.opened{margin-bottom:' + (~~window.getComputedStyle(e.target.firstChild).height.replace("px", "") / ~~window.getComputedStyle(document.body).fontSize.replace("px", "") + 1) + 'em}'; scrollIntoView(e.target.firstChild, e.target.parentElement.parentElement.parentElement, 0, 1); } e.stopPropagation(); e.preventDefault(); return; } if (document.body.classList.contains("colorbox")) return; e.stopPropagation(); e.preventDefault(); editId = id; edit(id); cushName.val(data.name); cushWiki.val(data.wiki); let d = [], len = [], _data = cloneObj(data.l).sort(function(a,b) { let r = 0; for(let i = 0; i < a.length; i++) { if (a[i] != b[i]) return a[i] - b[i]; } return r; }); cushData[0]._data = cloneObj(_data); for(let i = 0; i < _data.length; i++) { _data[i] = cloneObj(_data[i]); _data[i][0] = _data[i][0] == "" ? "" : "S" + _data[i][0]; _data[i][1] = "E" + _data[i][1]; _data[i][2] = ("" + _data[i][2]).replace(/([0-9]{4})([0-9]{2})([0-9]{2})/, "$1-$2-$3"); for(let n = 0; n < _data[i].length; n++) { len[n] = Math.max(~~len[n], ("" + _data[i][n]).length); } } for(let i = 0; i < _data.length; i++) { for(let n = 0; n < _data[i].length; n++) { if (("" + _data[i][n]).length < len[n]) { if (n < 3) { _data[i][n] = _data[i][n] + pad(" ", " ", len[n] - _data[i][n].length); } else _data[i][n] = pad(_data[i][n], " ", len[n]); } } _data[i][0] += (_data[i][0] === "" ? "" : " ") + _data[i].splice(1,1); d[d.length] = _data[i].join(" ¦ "); } cushData.val(d.join("\n") + "\n"); cushName.trigger("change"); }); //SEARCH $('' + SVG.search + '').appendTo(editBox).click(function(e) { if (cushBox.classList.contains("opened")) return; e.stopPropagation(); e.preventDefault(); search("info:" + (id + customShows.id)); }); //DELETE $('' + SVG.del + '').appendTo(editBox).click(function(e) { if (cushBox.classList.contains("opened")) return; e.stopPropagation(); e.preventDefault(); if (cushReset.prop("disabled")) $("#cush_" + id).trigger("click"); customShows.remove(id); if (editId == id) editId = null; edit(); }); entry.id = "cush_" + id; let d = []; for(let i = 0; i < data.l.length; i++) { d[d.length] = data.l[i].join("|"); } // dataInput.value = d.join("\n"); if (callback) { callback(); } return entry; }//customShowsCreate(); let list = customShows._list.l, n = Object.keys(list).length; function finished() { if (!--n) callback(); } content.append(cushBox); for(let i in list) { cushBox.appendChild(customShowsCreate(~~i, callback ? finished : null)); } if (!n) callback(); sortShows(); // setTimeout(enginesRestore,100); };//customShows.manager() //END custom shows DB.viewing = DB.username != DB.loggedInUsername; disqusMessageCount.el = $("#account-overview").parent().append('').find("span").last()[0]; function disqusMessageNotifLoaded(loading) { if (typeof(loading) == "undefined") loading = false; if (loading) disqusMessageCount.el.classList.toggle("loading", true); clearTimeout(disqusMessageNotifLoaded.timer); disqusMessageNotifLoaded.loop(disqusMessageNotifLoaded.iframe, 1000); } disqusMessageNotifLoaded.loaded = function loaded() { disqusMessageCount.el.classList.toggle("loading", false); }; disqusMessageNotifLoaded.loop = function loop(iframe, i) { if (!(i--)) return setTimeout(disqusMessageNotifLoaded.loaded, 1000); if (iframe) { if (iframe.style.visibility != "hidden") { return disqusMessageNotifLoaded.loaded(); } } else { let iframes = document.body.getElementsByTagName("iframe"); for (let i = 0; i < iframes.length; i++) { if (iframes[i].src.match(/\/home\/(inbox|preload)\//) && document.body === iframes[i].parentNode) { disqusMessageNotifLoaded.iframe = iframes[i]; return loop(iframes[i], 1000); } } } disqusMessageNotifLoaded.timer = setTimeout(function() { loop(iframe, i); }, 100); }; if (disqusMessageCount.el) { disqusMessageCount.el.addEventListener("click", function(e) { disqusMessageNotifLoaded(true); disqusMessageCount.el.removeAttribute("unread"); $("#disqus_thread").find("iframe").each(function() { try { this.contentWindow.postMessage({id: "ade", func: "disqusNotifClick", args: null, return: null}, "https://disqus.com"); } catch(er){} }); }, false); } //fix when removing color it still saves it in database as #FFFFFF window.DB._setColor = window.DB.setColor; window.DB.setColor = function setColor(id, c) { if (c == "#FFFFFF") c = ""; if (c) DB.infoAdd(id); else if (_hidden.indexOf(id) == -1) DB.infoRemove(id); this._setColor(id, c); if (!document.getElementById("searchResults").hasAttribute("opened")) { if (showMyShows.box) showMyShows(); else if (showMyHidden.box) showMyHidden(); } }; //hiding old combined checkboxes $( "#nu-showing" ).toggle(false); $( "#nu-hidden" ).toggle(false); //add new separate checkboxes createCheckbox("showNew", "New shows", Settings.prefs.showNew ? true : false, Settings.callback); createCheckbox("showReturn", "Returning shows", Settings.prefs.showReturn ? true : false, Settings.callback); //replacing existing "my shows" checkboxes with ours let _toggleSelectedOnly = window.toggleSelectedOnly, _updateSelectedOnly = window.updateSelectedOnly; window.toggleSelectedOnly = function(){}; window.updateSelectedOnly = function(){}; $("#selected-only-showing").toggle(false); $("#selected-only-hidden").toggle(false); createCheckbox("activeOnly", (DB.viewing ? DB.username + " user's" : "My") + " shows", "s", function(e, id, checked){}, [$("#selected-only-hidden").prop("title")]); //fix auto clear search field on click setTimeout(function() { $(document).off("click", ".onX, .x").on('touchstart click', '.onX', function( ev ) { ev.preventDefault(); ev.stopPropagation(); ev.stopImmediatePropagation(); $(this).removeClass('x onX').val('').change(); if (window.hashChanged.hashSearch && location.href.match("#")) removeHash(); }); //fix no X button after page refresh and browser auto fill search bar with previous text $('input.clearable').trigger("input"); }); /* //injecting userscript function execution showPast(function() { //adding watched checkboxes $("div.day > div.entry").each(watched.attach); //collapse multiple entries of the same series in one day $("div.day").each(collapseMulti); }); */ customShows(); showHideLoad(); //list of user's shows DB.infoNameClean = function(entry) { let title = entry._title && entry._title._titleOrig ? entry._title._titleOrig : $(entry).find("div.title").text(); return title.substring(0, title.lastIndexOf(" ")); }; DB.infoSave = function() { ls("info", DB.info); ls("infoChecked", DB.infoChecked); }; DB.infoAdd = function(id, name, nosave) { if (typeof(name) == "undefined") { return DB.infoAdd(id, DB.infoGet(id), nosave); } else if (!name) { setTimeout(function() { DB.infoLoad(id); }, rand(100, 2000)); return; } DB.info[id] = name; delete DB.infoChecked[id]; if (!nosave) DB.infoSave(); }; DB.infoRemove = function(id) { delete DB.info[id]; DB.infoSave(); }; DB.infoGet = function(id) { if (id > customShows.id) { id = id - customShows.id; if (!(id in customShows._list.l)) return null; return [customShows._list.l[id][0], customShows._list.l[id][2]]; } let entry = $('div.days div[data-series-id="' + id + '"]').first()[0]; if (entry) return [DB.infoNameClean(entry), entry.getAttribute("data-series-source")]; return null; }; DB.infoLoad = function(id, deleteOnError, callback) { let obj = document.createElement("div"); if (DB.infoChecked[id] && Date.now() - 3600000 < DB.infoChecked[id][0]) //1 hour return; if (id > customShows.id) return DB.infoAdd(id); $(obj).load("/s?"+$.param({q:"info:" + id}), function(e, t, r) { if (t == "error" || r.responseText === "") { //log([e,t,r]); log("Show with ID: " + id + " not found (" + r.status + " " + r.statusText + ")"); let now = Date.now(), save = false; if (!DB.infoChecked[id]) DB.infoChecked[id] = [now, now, 4]; //4 weeks if (now - 604800000 > DB.infoChecked[id][1]) //7 days { DB.infoChecked[id][2]--; DB.infoChecked[id][1] = now; } if (r.status == 500 || r.responseText === "") { DB.infoChecked[id][0] = now; save = true; } if (deleteOnError || DB.infoChecked[id][2] < 1) //delete if failed find name after 4 weeks { log("Show with ID: " + id + " was removed after unseccessfull attempt retreive it's name in last 4 weeks"); // DB.infoChecked[id][2] = 0; delete DB.infoChecked[id]; delete DB.info[id]; assignColor(id, "#FFFFFF", true); save = true; } if (save) { clearTimeout(DB.timer); DB.timer = setTimeout(DB.infoSave, 100); } return; } let title = $(obj).find("b").first().text(); title = title.substring(0, title.lastIndexOf("(") - 1); if (title) DB.infoAdd(id, [title, $(obj).find(".entry").attr("data-series-source")]); }); };//DB.infoLoad() function showMyShows(e) { if (!DB.infoLoaded) return setTimeout(showMyShows, 100); $(".entry").removeClass("searchResult"); $("#searchStatus").css("visibility","hidden"); let list = [], info = {}; for (let i in DB.savedColors) { /* if (!DB.info[i]) continue; */ info[i] = DB.info[i] || ["ZZZZZZZZZZZZZ",""]; //http://runtime-era.blogspot.com/2011/11/grouping-html-hex-colors-by-hue-in.html /* Get the hex value without hash symbol. */ let hex = DB.savedColors[i].substring(1); /* Get the RGB values to calculate the Hue. */ let r = parseInt(hex.substring(0,2),16)/255, g = parseInt(hex.substring(2,4),16)/255, b = parseInt(hex.substring(4,6),16)/255; /* Getting the Max and Min values for Chroma. */ let max = Math.max.apply(Math, [r,g,b]), min = Math.min.apply(Math, [r,g,b]); /* Variables for HSV value of hex color. */ let chr = max-min, hue = 0, val = max, sat = 0; if (val > 0) { /* Calculate Saturation only if Value isn't 0. */ sat = chr/val; if (sat > 0) { if (r == max) { hue = 60 * (((g - min) - (b - min)) / chr); if (hue < 0) hue += 360; } else if (g == max) { hue = 120 + 60 * (((b - min) - (r - min)) / chr); } else if (b == max) { hue = 240 + 60 * (((r - min) - (g - min)) / chr); } } } /* Modifies existing objects by adding HSV values. */ list[list.length] = { id: i, hex: hex, hue: hue, sat: sat, val: val, lum: (r * 299 + g * 587 + b * 114) / 1000 }; } (function display() { if (Settings.prefs.sortBy == Settings.SORT_COLOR) { list = list.sort(function(a,b) { let r = b.hue - a.hue; if (!r) r = b.val - a.val; if (!r) r = b.sat - a.sat; if (!r) r = info[a.id][0].toLowerCase().localeCompare(info[b.id][0].toLowerCase()); return r; }); } else { list = list.sort(function(a, b) { return info[a.id][0].toLowerCase().localeCompare(info[b.id][0].toLowerCase()); }); } $(showMyShows.box).find("span.button").off("click"); showMyShows.box = document.createElement("div"); let entry = document.createElement("div"), title = document.createElement("div"), count = 0; entry.appendChild(title); entry.className = "entry"; title.className = "title"; for(let i = 0; i < list.length; i++) { let id = list[i].id; count++; entry = entry.cloneNode(true); title = entry.firstChild; entry.setAttribute("data-series-id", id); // entry.setAttribute("color", $(entry).css("color") == "rgb(0, 0, 0)" ? "black" : "white"); entry.setAttribute("data-series-source", info[id][1]); entry.classList.toggle("custom", (~~id > customShows.id && info[id][0] !== "ZZZZZZZZZZZZZ")); title.textContent = info[id][0]; if (title.textContent === "ZZZZZZZZZZZZZ") { title.classList.toggle("unknown", true); title.textContent = "n/a"; } showMyShows.box.appendChild(entry); } let text = "You don't have any shows"; if (count) { let getSortName = function () { let a = ["Name", "Color"]; return a[Settings.prefs.sortBy + 1] || a[0]; }; text = (DB.viewing ? DB.username + " has " : "You have ") + count + " show" + (count > 1 ? "s" : "") + '. Sort by ' + getSortName() + ""; } $(showMyShows.box).prepend('
    ' + text + '
    '); $("#searchResults").html(showMyShows.box.innerHTML).find("span.button").click(function(e) { if (++Settings.prefs.sortBy > 1) Settings.prefs.sortBy = 0; Settings.save(); display(); }); })(); } function showMyHidden(e) { if (!DB.infoLoaded) { setTimeout(showMyHidden, 100); return; } $(".entry").removeClass("searchResult"); $("#searchStatus").css("visibility","hidden"); showMyHidden.box = document.createElement("div"); let entry = document.createElement("div"), title = document.createElement("div"); entry.appendChild(title); entry.className = "entry"; title.className = "title"; let list = [], count = 0; for(let i = 0; i < _hidden.length; i++) { list[list.length] = _hidden[i]; } list.sort(function(a, b) { return !DB.info[a] || !DB.info[b] ? -1 : DB.info[a][0].toLowerCase().localeCompare(DB.info[b][0].toLowerCase()); }); for(let i = 0; i < list.length; i++) { let id = list[i]; if (!DB.info[id]) continue; count++; entry = entry.cloneNode(true); title = entry.firstChild; entry.setAttribute("data-series-id", id); // entry.setAttribute("color", $(entry).css("color") == "rgb(0, 0, 0)" ? "black" : "white"); entry.setAttribute("data-series-source", DB.info[id][1]); title.textContent = DB.info[id][0]; showMyHidden.box.appendChild(entry); } let text = "There are no hidden shows"; if (count) { text = "There are " + count + " hidden show" + (count > 1 ? "s" : "") + ":"; } $(showMyHidden.box).prepend('' + text + '
    '); $("#searchResults").html(showMyHidden.box.innerHTML); } $(document).ready(function() { function hideNode(id) { $("." + id).each(function(i, e) { let prev = e.previousSibling; if (prev.nodeType == prev.TEXT_NODE) { let span = document.createElement("span"); prev.parentNode.insertBefore(span, prev); span.appendChild(prev); prev = span; } $(prev).toggleClass(id + "Icon", true); }); } let accountLoop = 50; $("#account-popup").attr("hidden", ""); let accountOverview = $("#account-overview"), accountPopup = $("#account-popup"); accountPopup.toggleClass("popup", true); accountOverview.click(function(e) { if (e.isTrigger) return; Settings.hide(); customLinks.hide(); customShows.hide(); changesLog.hide(); setPopup(accountPopup.is( ":visible" ), true); }) .click(function loop(e) { accountPopup.removeAttr("hidden"); let as = $("#account-popup-content .content a"); if( !accountPopup.hasClass("loaded") || (!as.length && accountLoop--)) return setTimeout(function() { loop(e); }, 100); if (!as.length) return; let header = $("#account-popup-content").find("div.header"); //account reset password if (DB.loggedInUsername) { let div = $("
    ").html(header.html().replace(/(\s)+/g, "$1")), // a = $('Reset password'); a = $('Reset password'); header.html("").append(div); div.find("a").after(a).after(" | "); } else { //some browsers don't have proper icon in the font let span = document.createElement("span"); span.innerHTML = header[0].firstChild.textContent.replace("Temporary", "Guest").replace("🍪", '' + SVG.guest + ''); header[0].replaceChild(span, header[0].firstChild); } let content = $("#account-popup-content").find("div.content"); //account overview neat icons content.contents().filter(function() { if (this.tagName == "BR") this.parentNode.removeChild(this); if (this.nodeType != Node.TEXT_NODE || !this.textContent.trim()) return; let span = document.createElement("span"), div = document.createElement("div"); div.appendChild(span); div.appendChild(this.nextSibling); span.textContent = this.textContent.trim(); this.parentNode.replaceChild(div, this); }); accountOverview.unbind("click", loop); content.find("div:first-of-type > span").html(SVG.link); hideNode("importColors"); let a = document.createElement("a"), i = document.createElement("span"), span = document.createElement("div"), h = document.createElement("h4"), item = span, parent = as[as.length-1].parentNode.parentNode; h.textContent = adeName + " v" + adeVersion; parent.appendChild(h); span.appendChild(i); span.appendChild(a); span = span.cloneNode(true); a = span.lastChild; i = span.firstChild; span.className = "search"; a.className = ""; a.id = ""; delete a.className; delete a.id; i.innerHTML = SVG.search; a.href = '#myshows'; a.addEventListener("click", function(e) { e.preventDefault(); search("info:myshows"); $("#account-popup").toggle(false); setPopup(false); }, false); a.textContent = (DB.viewing ? DB.username + " user's" : "My") + " shows"; parent.appendChild(span); span = span.cloneNode(true); a = span.lastChild; i = span.firstChild; i.innerHTML = SVG.search; a.href = '#hidden'; span.className = "search"; a.addEventListener("click", function(e) { e.preventDefault(); search("info:hidden"); $("#account-popup").toggle(false); setPopup(false); }, false); a.textContent = "Hidden shows"; parent.appendChild(span); span = span.cloneNode(true); span.className = ""; delete span.className; a = span.lastChild; i = span.firstChild; i.innerHTML = SVG.customlinks; a.href = '#'; a.id = "manage-links-open"; a.addEventListener("click", function(e) { e.preventDefault(); customLinks.manager(function() { customLinks.show(); $("#account-popup").toggle(false); }); }, false); a.textContent = "Links manager"; parent.appendChild(span); span = span.cloneNode(true); span.className = "myCustomShows"; delete span.className; a = span.lastChild; i = span.firstChild; i.innerHTML = SVG.customshows; a.href = '#'; a.id = "manage-cushows-open"; a.addEventListener("click", function(e) { e.preventDefault(); customShows.manager(function() { customShows.show(); $("#account-popup").toggle(false); }); }, false); a.textContent = "Custom shows"; parent.appendChild(span); span = span.cloneNode(true); span.className = ""; a = span.lastChild; i = span.firstChild; i.innerHTML = SVG.settings; a.href = '#'; a.id = "settings-open"; a.addEventListener("click", function(e) { e.preventDefault(); Settings.show(); $("#account-popup").toggle(false); }, false); a.textContent = "Options"; parent.appendChild(span); span = document.createElement("span"); a = document.createElement("a"); a.href = "https://github.com/vanowm/airdates.tv_enhancer/issues"; a.target = "_blank"; a.textContent = "Support"; span.className = "parentheses support"; span.appendChild(a); span.appendChild(document.createTextNode(" | ")); a = document.createElement("a"); a.href = "#changes"; a.textContent = "Changes"; a.id = "changesLog-open"; a.addEventListener("click", function(e) { e.preventDefault(); changesLog.show(); $("#account-popup").toggle(false); if (window.hashChanged.hashSearch && location.hash == "#changes") removeHash(); }, false); span.appendChild(a); parent.insertBefore(span, h.nextSibling); $("#account-popup-content > .header").append($("div.close")[0].cloneNode(true)); }) .attr("title", "Main menu") .html((accountOverview.html() || "").replace(/Account/, '')) .prepend(SVG.menu);//account-overview accountOverview.parent().parent().prepend(accountOverview.parent()); let ul = $("#menu").find("ul"), li = ul.find("li"); accountOverview.parent().parent().append('
  • ' + SVG.search + 'Search
  • ').find("li:last-child").click(function(e) { e.originalEvent.preventDefault(); $("#searchBecauseNoOneChecks").focus(); var dur = 250, arrow = $("#arrow"), searchbar = $("#searchbar"), left = searchbar.offset().left - 300; /* right = this.____right || $("#searchbar").offset().left - arrow.show().offset().left + arrow.width(); this.____right = right; let searchbar = $("#searchbar"); searchbar.animate({left:$(this).offset().left}, 200).animate({left:searchbar.offset().left}, 300, function(e){this.style.left = ""; this.style.right = "";}); */ arrow.css({left:left + 200, 'opacity':0}).show() .animate({left:left,opacity:1},dur).animate({left:left + 200},dur) .animate({left:left},dur).animate({left:left + 200},dur) .animate({left:left},dur).animate({left:left + 200},dur) .animate({left:left},dur).animate({left:left + 200,opacity:0},dur).hide(1); }); li.contents().filter(function(){return this.nodeType == 3;}).each(function(i,e) { e.parentNode.removeChild(e); //remove white spaces }); if (DB.viewing) { // ul.children("li:last-child").css("margin-right", "1.5em"); let li = $(multiline(function(){/*
  • Viewing as {SVG-VIEWAS} {SVG-CLOSEHOVER} {SVG-CLOSE}
  • */})).appendTo(ul); li.find("span.nu").text(DB.username); //fix auto wrap on small screen setTimeout(function() { let width = (ul.width() + $("body #menu + h1 > img").width()/2 + ul.offset().left ) * 2; $("head").append('*/})); }); } else { setTimeout(function() { let width = (ul.width() + $("body #menu + h1 > img").width()/2 + ul.offset().left ) * 2; $("head").append('*/})); }); } if (!DB.loggedInUsername) { //monkey let monkey = accountOverview.find("span.nu")[0]; if (monkey) { monkey.title = "Colors saved locally in browser's cookies"; //cookies svg // monkey.innerHTML = ''; monkey.innerHTML = SVG.guest + '(Guest)'; } } let list = ls("info") || {}, userCookie = readCookieRaw("adsc_SESSION"), isUser = userCookie && userCookie.indexOf("username=") > 0, update = false; DB.info = {}; DB.infoLoaded = false; DB.infoChecked = ls("infoChecked") || {}; // load colors right away. DB.getColors().done( function(data){ for (var i = 0; i < data.length; i++) { var series = data[i]; assignColor(series.id, series.color, false ); } updateSelectedOnly(); }).fail(function(){ alert("Not allowed? No internet? It's hard to tell, but what's important is that the colors were not loaded."); }).always(function() { //to avoid hit a ceiling of max data allowed store in local storage, we only save names of user's current shows, nothing else. let added = false; for(let id in DB.savedColors) { DB.loaded = true; let col = new Colors().setColor(DB.savedColors[id] || "FFFFFF"); //there is a bug in original ADT that store show's color as "FFFFFF" (which is "delete" show color) if (col.HEX == "FFFFFF" || col.HEX.match(/[^0-9a-fA-F]/)) { log("Removed show with id " + id + " due to invalid color: " + DB.savedColors[id]); assignColor(id, DB.savedColors[id], true); } if (id in list) { DB.info[id] = list[id]; continue; } DB.infoAdd(id); added = true; } for(let i = 0; i < _hidden.length; i++) { let id = _hidden[i]; if (id in list) { DB.info[id] = list[id]; continue; } added = true; DB.infoAdd(id); } DB.infoLoaded = true; if (added) DB.infoSave(); sortMyShows(); });//DB.getColors if (DB.loggedInUsername) { let span = accountOverview.find("span.nu")[0]; if (span) { span.title = "Colors saved remotely on server"; //cloud svg span.innerHTML = SVG.user + span.innerHTML; } } //fix paste via right click: adding input event /* $( "#searchBecauseNoOneChecks" ).on( "input", function(e) { }).trigger("change"); */ let searchBecauseNoOneChecks = $( "#searchBecauseNoOneChecks" ); if (searchBecauseNoOneChecks.length) { let lastQ = "", searchTimer = null, events = ["change", "search", "keyup", "input"], origFunc = jQuery._data(searchBecauseNoOneChecks[0]).events.change[0].handler, string = origFunc.toString(), line = "$('html, body').animate({ scrollTop: 0 }, 500);", index = string.indexOf(line), newFuncString, //will fallback to this original function, if modification failed newFunc = function(e) { var me = this; var q = this.value; if( q == lastQ ){} else if( q.length > 2 ){ $(me).addClass("x"); $(" #searchStatus").css("visibility","visible"); if( searchTimer ) window.clearTimeout(searchTimer); searchTimer = window.setTimeout(function(){ var q = me.value; if (isCustomSearch(e,q)) return; $("#searchResults").load("/s?"+$.param({q:q}), function(){ customShows.search("", q); lastQ = q; $(" #searchStatus").css("visibility","hidden"); $(me).change(); if(q.substr(0,5)!="info:") loadArchiveFromPathname(undefined, ".entry.searchResult:eq(0)"); else { markSearchResults(); } $(".calendar").addClass("searching"); }); },300); $("#searchResults").show(); $( "#searchbar" ).addClass( "active" ); } else{ lastQ = ""; $( "#searchbar").removeClass("active"); $( "#searchResults").hide().html(""); $( " #searchStatus").css("visibility","hidden"); $( ".calendar").removeClass("searching"); $( ".entry").removeClass("searchResult"); if (Settings.pref("searchScroll")) { $('html, body').animate({ scrollTop: 0 }, 500); } } }, isCustomSearch = function(e, val) { let q = val.trim(), r = false, id = q.match(/^info:([0-9]+)$/); id = id ? id[1] : 0; if (id > customShows.id || q == "info:myshows" || q.match(/^info:([a-zA-Z]+|$)/)) { lastQ = q; e.preventDefault(); e.stopPropagation(); if (q == "info:hidden") { showMyHidden(e); lastQ = null; } else if (q == "info:myshows") { showMyShows(e); lastQ = null; } else if (id > customShows.id) { showMyShows.box = null; showMyHidden.box = null; customShows.search(id); } else { showMyShows.box = showMyHidden.box = document.createElement("div"); $("#searchResults").html('
    • No results :(
    Search took 0.000 seconds'); } r = true; $(".calendar").addClass("searching"); } else { showMyShows.box = null; showMyHidden.box = null; } //fix paste via right click /* if (e.type == "input") { if (!Settings.pref("searchScroll")) { //an ugly hack without recreating entire search handling function. let i = new Date(+new Date()+3000); (function loop() { if (new Date() > i) return; $('html, body').stop(true); setTimeout(loop); })(); } $(this).trigger("change"); } */ if (r) { $("#searchResults").show(); $( "#searchbar" ).addClass( "active" ); $(" #searchStatus").css("visibility","hidden"); } return r; };//isCustomSearch() if (index != -1) { newFuncString = string.substr(0, index) + 'if (Settings.pref("searchScroll")){' + string.substr(index, line.length) + '}' + string.substr(index + line.length); string = newFuncString; } line = '$("#searchResults").load'; index = string.indexOf(line); if (index != -1) { newFuncString = string.substr(0, index) + 'if (isCustomSearch(e,q)) return;\n' + string.substr(index); string = newFuncString; } line = "lastQ = q;"; index = string.indexOf(line); if (index != -1) { newFuncString = string.substr(0, index) + 'customShows.search("", q);\n' + string.substr(index); string = newFuncString; } if (newFuncString) { eval("newFunc = " + newFuncString.replace(/^function\s?\(\)\{/, "function(e){")); } // for (let i = 0; i < events.length; i++) // jQuery._data($( "#searchBecauseNoOneChecks" )[0]).events[events[i]][0].handler = newFunc; searchBecauseNoOneChecks.off("keyup change search input"); $( "#searchBecauseNoOneChecks" ).on("keyup change search input", newFunc); }//if (searchBecauseNoOneChecks.length) //log(jQuery._data($( "#searchBecauseNoOneChecks" )[0]).events.input[0].handler.toString()); let Backup = function Backup(id, val) { clearTimeout(this.timer[id]); if (typeof(this[id]) == "function") return this[id](val); else return this[id]; }.bind( { data: {}, last: [], timer: {}, undoObj: {}, clone: function(obj) { return Object.assign(Array.isArray(obj) ? [] : {}, obj); }, colors: function(restore) { if (restore) { if (!this.data.colors) return; $.each(this.data.colors, function(i, c) { assignColor( i, c, true ); }); this.undoHide("colors"); } else { if (!this.data.colors) this.data.colors = this.clone(DB.savedColors); this.undoShow("colors"); } }, hidden: function(restore) { if (restore) { if (!this.data.hidden) return; let data = this.data.hidden; for(let i = 0; i < data.length; i++) showHide(data[i], 1); this.undoHide("hidden"); } else { if (!this.data.hidden) this.data.hidden = this.clone(_hidden); this.undoShow("hidden"); } }, watched: function(restore) { if (restore) { if (!this.data.watched) return; let data = this.data.watched; for(let id in data) { for(let i = 0; i < data[id].length; i++) { let ep = data[id][i]; watched.add(id, ep); $('div.entry[data-series-id="' + id + '"]').each(function(n, entry) { if (episodeTools.short(entry) == ep) watched.update(entry, true); }); } } watched.save(true); this.undoHide("watched"); } else { if (!this.data.watched) this.data.watched = this.clone(watched._list); this.undoShow("watched"); } }, undoHide: function(id) { let obj = this.undoObj[id]; obj.fadeOut(100); setTimeout(function() { obj.removeAttr("id"); }); delete this.data[id]; let i = this.last.indexOf(id); if (i != -1) this.last.splice(i, 1); }, undoShow: function(id) { let that = self; if (!this.undoObj[id]) { this.undoObj[id] = $('