From dd5cc8feb2d0cb89cf02b0c96a25d1773b425d8b Mon Sep 17 00:00:00 2001 From: josdion Date: Thu, 30 Jul 2020 21:54:47 +0300 Subject: [PATCH] add subzero color mod --- views/settingssubtitles.html | 61 +++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/views/settingssubtitles.html b/views/settingssubtitles.html index 3be79ba49..36020f942 100644 --- a/views/settingssubtitles.html +++ b/views/settingssubtitles.html @@ -318,6 +318,45 @@ +
+
+ Color +
+
+ + +
+
+
+
+
+ Color Name +
+
+ +
+
+
Reverse RTL @@ -577,6 +616,14 @@ } }); + $('#subzero_color').on('change', function () { + if ($(this).prop('checked')) { + $('#subzero_color_div').show(); + } else { + $('#subzero_color_div').hide(); + } + }); + $('#settings-general-chmod_enabled').on('change', function () { if ($(this).prop('checked')) { $('#chmod_div').show(); @@ -626,6 +673,14 @@ $('.subzero_mods').prop('checked', false).trigger('change'); {% if settings.general.subzero_mods %} $('{{settings.general.subzero_mods}}'.split(',')).each( function(i, item) { + if (item.startsWith('color')) + { + var color_name = 'white'; + var m = item.match(/color\(name=(.*)\)/); + if (m != null && m.length > 1) color_name = m[1]; + $('#subzero_color_name').val(color_name).trigger('change'); + item = 'subzero_color'; + } $("[id=" + item + "]").prop('checked', true).trigger('change'); }) {% endif %} @@ -635,7 +690,11 @@ var enabled_subzero_mods = $(".subzero_mods").map(function () { if ($(this).prop('checked')) { - return $(this).attr('id'); + if ($(this).attr('id') == 'subzero_color') + { + return 'color(name=' + $('#subzero_color_name').val() + ')'; + } + else return $(this).attr('id'); } }).get().join(','); formdata.append('settings-general-subzero_mods', enabled_subzero_mods)