wrapperr/functions.js

195 lines
5.4 KiB
JavaScript
Raw Normal View History

Squashed commit of the following: commit 03b7ce95646b8b4452bbf56849127d52a0f98474 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Jan 11 14:32:22 2022 +0100 Custom server-wide section commit 1dce85dd0a7a7d8ad0a31eb8a11ad7fca2de4988 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Jan 4 15:29:57 2022 +0100 Link improvements - Links are deleted if made on different version - Links also carry Wrapperr settings for that link creation - Created links are shown on homepage - Links can be deleted on home page - CSS tweaks commit 3c6a7eb05e7d1a4afda2239a8a98706827bf1f96 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Jan 3 22:16:56 2022 +0100 Music is now fully custom commit edfca775004e43518d6258347a3e4c69c9e089a3 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Jan 3 12:16:53 2022 +0100 SHow buddy bug fix commit e5a739631da9c34d8a7c2262bd96430f23d2ea12 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Jan 3 12:05:35 2022 +0100 Show section is now fully custom commit 693eaec76951241a9ef0d76d8284169c87c25fdd Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 19:56:50 2022 +0100 Fixed movie completion image bug commit ef2b49969fbbb593e207fabdea42fd2f3f849f42 Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 19:45:10 2022 +0100 pop up issues on iOs commit 1515db8c1b56ec95f2455df62a82ecdb45a56fac Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 18:51:22 2022 +0100 URL commit b8add61a1652ae5d4de8527acf422ae2215adef8 Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 18:39:06 2022 +0100 CSS overhaul for admin-page commit 40e44fc5b1272d23e4fc6da3a59f9c06a339bcc7 Author: aunefyren <oystein.sverre@gmail.com> Date: Thu Dec 30 18:55:47 2021 +0100 100% custom movie section, sort buttons commit 7accc2d006088127e80beebace3c8ac8f0c14960 Author: aunefyren <oystein.sverre@gmail.com> Date: Thu Dec 23 15:59:04 2021 +0100 Added sorting by plays And custom text for movie completion commit 3f24b11fd116669e51fa0256e086f352d35c48b0 Author: aunefyren <oystein.sverre@gmail.com> Date: Wed Dec 22 14:53:56 2021 +0100 Application title CSS size commit a8f19370d2ac5723fe397e1fe106e8cec49cd174 Author: aunefyren <oystein.sverre@gmail.com> Date: Wed Dec 22 14:30:32 2021 +0100 More custom text - Lists - Server-wide options commit 847dd60483065516398e1d52fa209b54f240de01 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 14:33:27 2021 +0100 Custom language options Change certain words for alternatives, such as plays, days and so on. commit fe501ba9e3ffa6098d3c1869ef8a1580f10897be Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 13:01:15 2021 +0100 Scrambling for answers commit f99c2f2dff36a45cbe7ccf79d7a6f5ac39f21011 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 12:42:57 2021 +0100 Cookie settings commit 5efddfc9d77a69db62d8b979976c42d079c8b4a2 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 12:21:05 2021 +0100 More headers commit e1c106534cfbd2d0d62492e6c25a1efdb5a70325 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 11:52:11 2021 +0100 Trying to fix CURL origin commit f7a59ed8d21ad731913ba5f5259997361c8ffdbb Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 11:40:56 2021 +0100 Color bug and headers commit be604797524de5cb06c66eb593fecd563cbd6592 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 11:12:02 2021 +0100 Admin stuff - Added new admin menu - Admin login session - Separate config categories - Added application URL and name - Config file builds using file, then adds default for variables not found. Less config deletions. - Admin is separate config to prevent stealing unconfigured platforms. - Moved caching to admin menu. - Caching in API requires admin login. - Added robots.txt for web crawlers. - New color palette - Renamed more stuff to Wrapperr commit 5b62dbb2ef4f05d33e49f0ce7e12c147e2343f06 Merge: 84caa7b 67dcf77 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Dec 13 12:51:09 2021 +0100 Merge branch 'main' into develop commit 84caa7b85f9036c7ca4cf2535f80bdf96aa120f6 Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Dec 12 17:26:23 2021 +0100 Disable pre-made links when changing config If you disable links in the config, already made links will stop working commit 4ae03627594a821323fc20c1ad8bf1b8d5f8f1cb Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Dec 12 17:08:49 2021 +0100 Button icons and button disabling Displays that a function is working in the background by disabling the button. commit cc43d00fbc122cc681a008e6a736273540c10b3e Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Dec 12 16:43:33 2021 +0100 Added version control - Release now dynamically displayed on pages - Configs are tagged with version and deleted when not compatible commit a18c2515904a978cb0a85edbeecfb5baab81c2b6 Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 11 13:56:18 2021 +0100 Option to disable links commit d8f1b0ab09f5ed1cfbdc9a753be2bebd63c51e2c Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 11 12:49:58 2021 +0100 Plex Auth, shareable links, fancy colors v2.1.0 testing - Moved to class-system within PHP. - All wrapped requests now gathered and validated using Plex Auth #9 - Session stored as browser cookie - Button icons - Colors fade between wrapped categories - Minutes count added for music above a certain sum #7 - Ability to create shareable links valid for 7 days #14 - HTML Input placeholders removed #10 - Ability to specify Plex libraries #18 commit 23022d0090c267c46e95a818cd57639360e542bc Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 23:02:16 2021 +0100 Fixed caching Forgot to add global and variable to function commit b5765f3094206406c8d2f20ffd36b0bad5ea0200 Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 22:58:48 2021 +0100 Re-added caching mode Whops commit 20ccd23ed9a04fa4b00e2994ab89a931d79f5a78 Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 22:52:38 2021 +0100 Stats API mostly moved to new class format commit a594447ffcd917d149078dd5c57d7e3f5a88bf1a Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 16:17:48 2021 +0100 Fixed login bug on caching commit 9d303514ef080e9483f4753b7fc488da314d1b7a Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 16:06:09 2021 +0100 Added root option, fixed PHP relative folders commit 08f21ad4132f92a502cd83521ba51dd9ab9a2dfb Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 13:57:18 2021 +0100 FIxed major login issue from last commit commit 84d767ac99946016dca6ef92991f12f661de266c Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 13:12:42 2021 +0100 Made PHP classes, added client_id variable PHP now uses classes on everything but the main stat API call. This should improve error messages. Added new client_id variable for Plex Auth Tried to improve caching description Tautulli test button now alerts error messages New code has comments commit e14ad8b5ccd937eea639eb6fc8c6c7e93ee9df3a Author: aunefyren <oystein.sverre@gmail.com> Date: Fri Dec 3 17:25:00 2021 +0100 Changed UI for admin & Trying to alert permission issues
2022-01-11 13:33:30 +00:00
function set_cookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+ d.toUTCString();
2022-01-11 14:29:03 +00:00
document.cookie = cname + "=" + cvalue + ";" + expires + ";";
Squashed commit of the following: commit 03b7ce95646b8b4452bbf56849127d52a0f98474 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Jan 11 14:32:22 2022 +0100 Custom server-wide section commit 1dce85dd0a7a7d8ad0a31eb8a11ad7fca2de4988 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Jan 4 15:29:57 2022 +0100 Link improvements - Links are deleted if made on different version - Links also carry Wrapperr settings for that link creation - Created links are shown on homepage - Links can be deleted on home page - CSS tweaks commit 3c6a7eb05e7d1a4afda2239a8a98706827bf1f96 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Jan 3 22:16:56 2022 +0100 Music is now fully custom commit edfca775004e43518d6258347a3e4c69c9e089a3 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Jan 3 12:16:53 2022 +0100 SHow buddy bug fix commit e5a739631da9c34d8a7c2262bd96430f23d2ea12 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Jan 3 12:05:35 2022 +0100 Show section is now fully custom commit 693eaec76951241a9ef0d76d8284169c87c25fdd Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 19:56:50 2022 +0100 Fixed movie completion image bug commit ef2b49969fbbb593e207fabdea42fd2f3f849f42 Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 19:45:10 2022 +0100 pop up issues on iOs commit 1515db8c1b56ec95f2455df62a82ecdb45a56fac Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 18:51:22 2022 +0100 URL commit b8add61a1652ae5d4de8527acf422ae2215adef8 Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 18:39:06 2022 +0100 CSS overhaul for admin-page commit 40e44fc5b1272d23e4fc6da3a59f9c06a339bcc7 Author: aunefyren <oystein.sverre@gmail.com> Date: Thu Dec 30 18:55:47 2021 +0100 100% custom movie section, sort buttons commit 7accc2d006088127e80beebace3c8ac8f0c14960 Author: aunefyren <oystein.sverre@gmail.com> Date: Thu Dec 23 15:59:04 2021 +0100 Added sorting by plays And custom text for movie completion commit 3f24b11fd116669e51fa0256e086f352d35c48b0 Author: aunefyren <oystein.sverre@gmail.com> Date: Wed Dec 22 14:53:56 2021 +0100 Application title CSS size commit a8f19370d2ac5723fe397e1fe106e8cec49cd174 Author: aunefyren <oystein.sverre@gmail.com> Date: Wed Dec 22 14:30:32 2021 +0100 More custom text - Lists - Server-wide options commit 847dd60483065516398e1d52fa209b54f240de01 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 14:33:27 2021 +0100 Custom language options Change certain words for alternatives, such as plays, days and so on. commit fe501ba9e3ffa6098d3c1869ef8a1580f10897be Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 13:01:15 2021 +0100 Scrambling for answers commit f99c2f2dff36a45cbe7ccf79d7a6f5ac39f21011 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 12:42:57 2021 +0100 Cookie settings commit 5efddfc9d77a69db62d8b979976c42d079c8b4a2 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 12:21:05 2021 +0100 More headers commit e1c106534cfbd2d0d62492e6c25a1efdb5a70325 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 11:52:11 2021 +0100 Trying to fix CURL origin commit f7a59ed8d21ad731913ba5f5259997361c8ffdbb Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 11:40:56 2021 +0100 Color bug and headers commit be604797524de5cb06c66eb593fecd563cbd6592 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 11:12:02 2021 +0100 Admin stuff - Added new admin menu - Admin login session - Separate config categories - Added application URL and name - Config file builds using file, then adds default for variables not found. Less config deletions. - Admin is separate config to prevent stealing unconfigured platforms. - Moved caching to admin menu. - Caching in API requires admin login. - Added robots.txt for web crawlers. - New color palette - Renamed more stuff to Wrapperr commit 5b62dbb2ef4f05d33e49f0ce7e12c147e2343f06 Merge: 84caa7b 67dcf77 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Dec 13 12:51:09 2021 +0100 Merge branch 'main' into develop commit 84caa7b85f9036c7ca4cf2535f80bdf96aa120f6 Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Dec 12 17:26:23 2021 +0100 Disable pre-made links when changing config If you disable links in the config, already made links will stop working commit 4ae03627594a821323fc20c1ad8bf1b8d5f8f1cb Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Dec 12 17:08:49 2021 +0100 Button icons and button disabling Displays that a function is working in the background by disabling the button. commit cc43d00fbc122cc681a008e6a736273540c10b3e Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Dec 12 16:43:33 2021 +0100 Added version control - Release now dynamically displayed on pages - Configs are tagged with version and deleted when not compatible commit a18c2515904a978cb0a85edbeecfb5baab81c2b6 Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 11 13:56:18 2021 +0100 Option to disable links commit d8f1b0ab09f5ed1cfbdc9a753be2bebd63c51e2c Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 11 12:49:58 2021 +0100 Plex Auth, shareable links, fancy colors v2.1.0 testing - Moved to class-system within PHP. - All wrapped requests now gathered and validated using Plex Auth #9 - Session stored as browser cookie - Button icons - Colors fade between wrapped categories - Minutes count added for music above a certain sum #7 - Ability to create shareable links valid for 7 days #14 - HTML Input placeholders removed #10 - Ability to specify Plex libraries #18 commit 23022d0090c267c46e95a818cd57639360e542bc Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 23:02:16 2021 +0100 Fixed caching Forgot to add global and variable to function commit b5765f3094206406c8d2f20ffd36b0bad5ea0200 Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 22:58:48 2021 +0100 Re-added caching mode Whops commit 20ccd23ed9a04fa4b00e2994ab89a931d79f5a78 Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 22:52:38 2021 +0100 Stats API mostly moved to new class format commit a594447ffcd917d149078dd5c57d7e3f5a88bf1a Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 16:17:48 2021 +0100 Fixed login bug on caching commit 9d303514ef080e9483f4753b7fc488da314d1b7a Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 16:06:09 2021 +0100 Added root option, fixed PHP relative folders commit 08f21ad4132f92a502cd83521ba51dd9ab9a2dfb Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 13:57:18 2021 +0100 FIxed major login issue from last commit commit 84d767ac99946016dca6ef92991f12f661de266c Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 13:12:42 2021 +0100 Made PHP classes, added client_id variable PHP now uses classes on everything but the main stat API call. This should improve error messages. Added new client_id variable for Plex Auth Tried to improve caching description Tautulli test button now alerts error messages New code has comments commit e14ad8b5ccd937eea639eb6fc8c6c7e93ee9df3a Author: aunefyren <oystein.sverre@gmail.com> Date: Fri Dec 3 17:25:00 2021 +0100 Changed UI for admin & Trying to alert permission issues
2022-01-11 13:33:30 +00:00
}
function get_cookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for(var i = 0; i <ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' '){
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function makeRequest (method, url, data) {
return new Promise(function (resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open(method, url);
xhr.onload = function () {
if (this.status >= 200 && this.status < 300) {
resolve(xhr.response);
} else {
reject({
status: this.status,
statusText: xhr.statusText
});
}
};
xhr.onerror = function () {
reject({
status: this.status,
statusText: xhr.statusText
});
};
if(method=="POST" && data){
xhr.send(data);
}else{
xhr.send();
}
});
}
function seconds_to_days(seconds, comma, function_setting) {
var day = Math.floor(seconds / seconds_in_day);
var rest = Math.floor(seconds % seconds_in_day);
var hour = Math.floor(rest / seconds_in_hour);
rest = Math.floor(rest % seconds_in_hour);
var minute = Math.floor(rest / seconds_in_minute);
rest = Math.floor(rest % seconds_in_minute);
var day_string = '';
var hour_string = '';
var minute_string = '';
if(day == 1) {
day_string += day + ' ' + function_setting.wrapperr_day;
} else {
day_string += day + ' ' + function_setting.wrapperr_day_plural;
}
if(hour == 1) {
hour_string += hour + ' ' + function_setting.wrapperr_hour;
} else {
hour_string += hour + ' ' + function_setting.wrapperr_hour_plural;
}
if(minute == 1) {
minute_string += minute + ' ' + function_setting.wrapperr_minute;
} else {
minute_string += minute + ' ' + function_setting.wrapperr_minute_plural;;
}
if(hour >= 1) {
if(minute >= 1) {
if(comma) {
return day_string + ', ' + hour_string + ', ' + minute_string;
} else {
return day_string + ', ' + hour_string + ' ' + function_setting.wrapperr_and + ' ' + minute_string;
}
} else {
if(comma) {
return day_string + ', ' + hour_string;
} else {
return day_string + ' ' + function_setting.wrapperr_and + ' ' + hour_string;
}
}
} else {
return day_string;
}
}
function seconds_to_hours(seconds, comma, function_setting) {
var hour = Math.floor(seconds / seconds_in_hour);
var rest = Math.floor(seconds % seconds_in_hour);
var minute = Math.floor(rest / seconds_in_minute);
rest = Math.floor(rest % seconds_in_minute);
var hour_string = '';
var minute_string = '';
if(hour == 1) {
hour_string += hour + ' ' + function_setting.wrapperr_hour;
} else {
hour_string += hour + ' ' + function_setting.wrapperr_hour_plural;
}
if(minute == 1) {
minute_string += minute + ' ' + function_setting.wrapperr_minute;
} else {
minute_string += minute + ' ' + function_setting.wrapperr_minute_plural;
}
if(minute >= 1) {
if(comma) {
return hour_string + ', ' + minute_string;
} else {
return hour_string + ' ' + function_setting.wrapperr_and + ' ' + minute_string;
}
} else {
return hour_string;
}
}
function seconds_to_minutes(seconds, comma, function_setting) {
seconds = parseInt(seconds);
var minute = Math.floor(seconds / seconds_in_minute);
var rest = Math.floor(seconds % seconds_in_minute);
var minute_string = '';
var second_string = '';
if(minute == 1) {
minute_string += minute + ' ' + function_setting.wrapperr_minute;
} else {
minute_string += minute + ' ' + function_setting.wrapperr_minute_plural;
}
if(seconds == 1) {
second_string += rest + ' ' + function_setting.wrapperr_second;
} else {
second_string += rest + ' ' + function_setting.wrapperr_second_plural;
}
if(rest >= 1) {
if(comma) {
return minute_string + ', ' + second_string;
} else {
return minute_string + ' ' + function_setting.wrapperr_and + ' ' + second_string;
}
} else {
return minute_string;
}
}
function seconds_to_seconds(seconds, function_setting) {
var second_string = '';
if(seconds == 1) {
second_string += seconds + ' ' + function_setting.wrapperr_second;
Squashed commit of the following: commit 03b7ce95646b8b4452bbf56849127d52a0f98474 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Jan 11 14:32:22 2022 +0100 Custom server-wide section commit 1dce85dd0a7a7d8ad0a31eb8a11ad7fca2de4988 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Jan 4 15:29:57 2022 +0100 Link improvements - Links are deleted if made on different version - Links also carry Wrapperr settings for that link creation - Created links are shown on homepage - Links can be deleted on home page - CSS tweaks commit 3c6a7eb05e7d1a4afda2239a8a98706827bf1f96 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Jan 3 22:16:56 2022 +0100 Music is now fully custom commit edfca775004e43518d6258347a3e4c69c9e089a3 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Jan 3 12:16:53 2022 +0100 SHow buddy bug fix commit e5a739631da9c34d8a7c2262bd96430f23d2ea12 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Jan 3 12:05:35 2022 +0100 Show section is now fully custom commit 693eaec76951241a9ef0d76d8284169c87c25fdd Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 19:56:50 2022 +0100 Fixed movie completion image bug commit ef2b49969fbbb593e207fabdea42fd2f3f849f42 Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 19:45:10 2022 +0100 pop up issues on iOs commit 1515db8c1b56ec95f2455df62a82ecdb45a56fac Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 18:51:22 2022 +0100 URL commit b8add61a1652ae5d4de8527acf422ae2215adef8 Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 18:39:06 2022 +0100 CSS overhaul for admin-page commit 40e44fc5b1272d23e4fc6da3a59f9c06a339bcc7 Author: aunefyren <oystein.sverre@gmail.com> Date: Thu Dec 30 18:55:47 2021 +0100 100% custom movie section, sort buttons commit 7accc2d006088127e80beebace3c8ac8f0c14960 Author: aunefyren <oystein.sverre@gmail.com> Date: Thu Dec 23 15:59:04 2021 +0100 Added sorting by plays And custom text for movie completion commit 3f24b11fd116669e51fa0256e086f352d35c48b0 Author: aunefyren <oystein.sverre@gmail.com> Date: Wed Dec 22 14:53:56 2021 +0100 Application title CSS size commit a8f19370d2ac5723fe397e1fe106e8cec49cd174 Author: aunefyren <oystein.sverre@gmail.com> Date: Wed Dec 22 14:30:32 2021 +0100 More custom text - Lists - Server-wide options commit 847dd60483065516398e1d52fa209b54f240de01 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 14:33:27 2021 +0100 Custom language options Change certain words for alternatives, such as plays, days and so on. commit fe501ba9e3ffa6098d3c1869ef8a1580f10897be Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 13:01:15 2021 +0100 Scrambling for answers commit f99c2f2dff36a45cbe7ccf79d7a6f5ac39f21011 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 12:42:57 2021 +0100 Cookie settings commit 5efddfc9d77a69db62d8b979976c42d079c8b4a2 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 12:21:05 2021 +0100 More headers commit e1c106534cfbd2d0d62492e6c25a1efdb5a70325 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 11:52:11 2021 +0100 Trying to fix CURL origin commit f7a59ed8d21ad731913ba5f5259997361c8ffdbb Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 11:40:56 2021 +0100 Color bug and headers commit be604797524de5cb06c66eb593fecd563cbd6592 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 11:12:02 2021 +0100 Admin stuff - Added new admin menu - Admin login session - Separate config categories - Added application URL and name - Config file builds using file, then adds default for variables not found. Less config deletions. - Admin is separate config to prevent stealing unconfigured platforms. - Moved caching to admin menu. - Caching in API requires admin login. - Added robots.txt for web crawlers. - New color palette - Renamed more stuff to Wrapperr commit 5b62dbb2ef4f05d33e49f0ce7e12c147e2343f06 Merge: 84caa7b 67dcf77 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Dec 13 12:51:09 2021 +0100 Merge branch 'main' into develop commit 84caa7b85f9036c7ca4cf2535f80bdf96aa120f6 Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Dec 12 17:26:23 2021 +0100 Disable pre-made links when changing config If you disable links in the config, already made links will stop working commit 4ae03627594a821323fc20c1ad8bf1b8d5f8f1cb Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Dec 12 17:08:49 2021 +0100 Button icons and button disabling Displays that a function is working in the background by disabling the button. commit cc43d00fbc122cc681a008e6a736273540c10b3e Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Dec 12 16:43:33 2021 +0100 Added version control - Release now dynamically displayed on pages - Configs are tagged with version and deleted when not compatible commit a18c2515904a978cb0a85edbeecfb5baab81c2b6 Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 11 13:56:18 2021 +0100 Option to disable links commit d8f1b0ab09f5ed1cfbdc9a753be2bebd63c51e2c Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 11 12:49:58 2021 +0100 Plex Auth, shareable links, fancy colors v2.1.0 testing - Moved to class-system within PHP. - All wrapped requests now gathered and validated using Plex Auth #9 - Session stored as browser cookie - Button icons - Colors fade between wrapped categories - Minutes count added for music above a certain sum #7 - Ability to create shareable links valid for 7 days #14 - HTML Input placeholders removed #10 - Ability to specify Plex libraries #18 commit 23022d0090c267c46e95a818cd57639360e542bc Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 23:02:16 2021 +0100 Fixed caching Forgot to add global and variable to function commit b5765f3094206406c8d2f20ffd36b0bad5ea0200 Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 22:58:48 2021 +0100 Re-added caching mode Whops commit 20ccd23ed9a04fa4b00e2994ab89a931d79f5a78 Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 22:52:38 2021 +0100 Stats API mostly moved to new class format commit a594447ffcd917d149078dd5c57d7e3f5a88bf1a Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 16:17:48 2021 +0100 Fixed login bug on caching commit 9d303514ef080e9483f4753b7fc488da314d1b7a Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 16:06:09 2021 +0100 Added root option, fixed PHP relative folders commit 08f21ad4132f92a502cd83521ba51dd9ab9a2dfb Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 13:57:18 2021 +0100 FIxed major login issue from last commit commit 84d767ac99946016dca6ef92991f12f661de266c Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 13:12:42 2021 +0100 Made PHP classes, added client_id variable PHP now uses classes on everything but the main stat API call. This should improve error messages. Added new client_id variable for Plex Auth Tried to improve caching description Tautulli test button now alerts error messages New code has comments commit e14ad8b5ccd937eea639eb6fc8c6c7e93ee9df3a Author: aunefyren <oystein.sverre@gmail.com> Date: Fri Dec 3 17:25:00 2021 +0100 Changed UI for admin & Trying to alert permission issues
2022-01-11 13:33:30 +00:00
} else {
second_string += seconds + ' ' + function_setting.wrapperr_second_plural;
Squashed commit of the following: commit 03b7ce95646b8b4452bbf56849127d52a0f98474 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Jan 11 14:32:22 2022 +0100 Custom server-wide section commit 1dce85dd0a7a7d8ad0a31eb8a11ad7fca2de4988 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Jan 4 15:29:57 2022 +0100 Link improvements - Links are deleted if made on different version - Links also carry Wrapperr settings for that link creation - Created links are shown on homepage - Links can be deleted on home page - CSS tweaks commit 3c6a7eb05e7d1a4afda2239a8a98706827bf1f96 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Jan 3 22:16:56 2022 +0100 Music is now fully custom commit edfca775004e43518d6258347a3e4c69c9e089a3 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Jan 3 12:16:53 2022 +0100 SHow buddy bug fix commit e5a739631da9c34d8a7c2262bd96430f23d2ea12 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Jan 3 12:05:35 2022 +0100 Show section is now fully custom commit 693eaec76951241a9ef0d76d8284169c87c25fdd Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 19:56:50 2022 +0100 Fixed movie completion image bug commit ef2b49969fbbb593e207fabdea42fd2f3f849f42 Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 19:45:10 2022 +0100 pop up issues on iOs commit 1515db8c1b56ec95f2455df62a82ecdb45a56fac Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 18:51:22 2022 +0100 URL commit b8add61a1652ae5d4de8527acf422ae2215adef8 Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Jan 2 18:39:06 2022 +0100 CSS overhaul for admin-page commit 40e44fc5b1272d23e4fc6da3a59f9c06a339bcc7 Author: aunefyren <oystein.sverre@gmail.com> Date: Thu Dec 30 18:55:47 2021 +0100 100% custom movie section, sort buttons commit 7accc2d006088127e80beebace3c8ac8f0c14960 Author: aunefyren <oystein.sverre@gmail.com> Date: Thu Dec 23 15:59:04 2021 +0100 Added sorting by plays And custom text for movie completion commit 3f24b11fd116669e51fa0256e086f352d35c48b0 Author: aunefyren <oystein.sverre@gmail.com> Date: Wed Dec 22 14:53:56 2021 +0100 Application title CSS size commit a8f19370d2ac5723fe397e1fe106e8cec49cd174 Author: aunefyren <oystein.sverre@gmail.com> Date: Wed Dec 22 14:30:32 2021 +0100 More custom text - Lists - Server-wide options commit 847dd60483065516398e1d52fa209b54f240de01 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 14:33:27 2021 +0100 Custom language options Change certain words for alternatives, such as plays, days and so on. commit fe501ba9e3ffa6098d3c1869ef8a1580f10897be Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 13:01:15 2021 +0100 Scrambling for answers commit f99c2f2dff36a45cbe7ccf79d7a6f5ac39f21011 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 12:42:57 2021 +0100 Cookie settings commit 5efddfc9d77a69db62d8b979976c42d079c8b4a2 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 12:21:05 2021 +0100 More headers commit e1c106534cfbd2d0d62492e6c25a1efdb5a70325 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 11:52:11 2021 +0100 Trying to fix CURL origin commit f7a59ed8d21ad731913ba5f5259997361c8ffdbb Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 11:40:56 2021 +0100 Color bug and headers commit be604797524de5cb06c66eb593fecd563cbd6592 Author: aunefyren <oystein.sverre@gmail.com> Date: Tue Dec 21 11:12:02 2021 +0100 Admin stuff - Added new admin menu - Admin login session - Separate config categories - Added application URL and name - Config file builds using file, then adds default for variables not found. Less config deletions. - Admin is separate config to prevent stealing unconfigured platforms. - Moved caching to admin menu. - Caching in API requires admin login. - Added robots.txt for web crawlers. - New color palette - Renamed more stuff to Wrapperr commit 5b62dbb2ef4f05d33e49f0ce7e12c147e2343f06 Merge: 84caa7b 67dcf77 Author: aunefyren <oystein.sverre@gmail.com> Date: Mon Dec 13 12:51:09 2021 +0100 Merge branch 'main' into develop commit 84caa7b85f9036c7ca4cf2535f80bdf96aa120f6 Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Dec 12 17:26:23 2021 +0100 Disable pre-made links when changing config If you disable links in the config, already made links will stop working commit 4ae03627594a821323fc20c1ad8bf1b8d5f8f1cb Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Dec 12 17:08:49 2021 +0100 Button icons and button disabling Displays that a function is working in the background by disabling the button. commit cc43d00fbc122cc681a008e6a736273540c10b3e Author: aunefyren <oystein.sverre@gmail.com> Date: Sun Dec 12 16:43:33 2021 +0100 Added version control - Release now dynamically displayed on pages - Configs are tagged with version and deleted when not compatible commit a18c2515904a978cb0a85edbeecfb5baab81c2b6 Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 11 13:56:18 2021 +0100 Option to disable links commit d8f1b0ab09f5ed1cfbdc9a753be2bebd63c51e2c Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 11 12:49:58 2021 +0100 Plex Auth, shareable links, fancy colors v2.1.0 testing - Moved to class-system within PHP. - All wrapped requests now gathered and validated using Plex Auth #9 - Session stored as browser cookie - Button icons - Colors fade between wrapped categories - Minutes count added for music above a certain sum #7 - Ability to create shareable links valid for 7 days #14 - HTML Input placeholders removed #10 - Ability to specify Plex libraries #18 commit 23022d0090c267c46e95a818cd57639360e542bc Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 23:02:16 2021 +0100 Fixed caching Forgot to add global and variable to function commit b5765f3094206406c8d2f20ffd36b0bad5ea0200 Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 22:58:48 2021 +0100 Re-added caching mode Whops commit 20ccd23ed9a04fa4b00e2994ab89a931d79f5a78 Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 22:52:38 2021 +0100 Stats API mostly moved to new class format commit a594447ffcd917d149078dd5c57d7e3f5a88bf1a Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 16:17:48 2021 +0100 Fixed login bug on caching commit 9d303514ef080e9483f4753b7fc488da314d1b7a Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 16:06:09 2021 +0100 Added root option, fixed PHP relative folders commit 08f21ad4132f92a502cd83521ba51dd9ab9a2dfb Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 13:57:18 2021 +0100 FIxed major login issue from last commit commit 84d767ac99946016dca6ef92991f12f661de266c Author: aunefyren <oystein.sverre@gmail.com> Date: Sat Dec 4 13:12:42 2021 +0100 Made PHP classes, added client_id variable PHP now uses classes on everything but the main stat API call. This should improve error messages. Added new client_id variable for Plex Auth Tried to improve caching description Tautulli test button now alerts error messages New code has comments commit e14ad8b5ccd937eea639eb6fc8c6c7e93ee9df3a Author: aunefyren <oystein.sverre@gmail.com> Date: Fri Dec 3 17:25:00 2021 +0100 Changed UI for admin & Trying to alert permission issues
2022-01-11 13:33:30 +00:00
}
return second_string;
}
function number_with_spaces(number) {
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
}
function play_plays(plays) {
plays = parseInt(plays);
if(plays == 1) {
var play_string = number_with_spaces(plays) + ' ' + functions.wrapperr_play;
} else {
var play_string = number_with_spaces(plays) + ' ' + functions.wrapperr_play_plural;
}
return play_string;
}