From 56a7038aa57a1ec473196e01f68b7c8a1d0a89b6 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Tue, 15 Mar 2011 07:56:21 -0400 Subject: [feature/new-tz-handling] Removed DST options from templates. PHPBB3-9558 --- phpBB/adm/style/acp_users_prefs.html | 5 ----- 1 file changed, 5 deletions(-) (limited to 'phpBB/adm/style') diff --git a/phpBB/adm/style/acp_users_prefs.html b/phpBB/adm/style/acp_users_prefs.html index a519447b2f..90db62984e 100644 --- a/phpBB/adm/style/acp_users_prefs.html +++ b/phpBB/adm/style/acp_users_prefs.html @@ -56,11 +56,6 @@
-
-
-
-
-

{L_BOARD_DATE_FORMAT_EXPLAIN}
-- cgit v1.2.1 From 5f96e5d374d1702d3d81591b7c69ede1cafebfa7 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 12 Jun 2012 19:54:26 +0200 Subject: [feature/new-tz-handling] Fix timezone option when editing a user in the ACP PHPBB3-9558 --- phpBB/adm/style/acp_users_prefs.html | 5 +---- phpBB/adm/style/timezone.js | 29 +++++++++++++++++++++++++++++ phpBB/adm/style/timezone_option.html | 20 ++++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 phpBB/adm/style/timezone.js create mode 100644 phpBB/adm/style/timezone_option.html (limited to 'phpBB/adm/style') diff --git a/phpBB/adm/style/acp_users_prefs.html b/phpBB/adm/style/acp_users_prefs.html index 90db62984e..9439f0cf03 100644 --- a/phpBB/adm/style/acp_users_prefs.html +++ b/phpBB/adm/style/acp_users_prefs.html @@ -52,10 +52,7 @@
-
-
-
-
+

{L_BOARD_DATE_FORMAT_EXPLAIN}
diff --git a/phpBB/adm/style/timezone.js b/phpBB/adm/style/timezone.js new file mode 100644 index 0000000000..d02c965ab5 --- /dev/null +++ b/phpBB/adm/style/timezone.js @@ -0,0 +1,29 @@ +function phpbb_switch_tz_date(keep_selection) +{ + var timezone_groups = document.getElementById("timezone"); + for (var i = 0; i < timezone_groups.childElementCount; i++) { + if (timezone_groups.children[i].tagName == "OPTGROUP" && + timezone_groups.children[i].label != document.getElementById("tz_date").value) + { + timezone_groups.children[i].style.display = "none"; + } + else if (timezone_groups.children[i].tagName == "OPTGROUP") + { + // Display other options + timezone_groups.children[i].style.display = "block"; + } + } + if (typeof keep_selection !== 'undefined') + { + if (!keep_selection) + { + timezone_groups.children[0].selected = true; + } + } +} + +function phpbb_enable_tz_dates() +{ + var tz_select_date = document.getElementById("tz_select_date"); + tz_select_date.style.display = "block"; +} diff --git a/phpBB/adm/style/timezone_option.html b/phpBB/adm/style/timezone_option.html new file mode 100644 index 0000000000..12e6e3700a --- /dev/null +++ b/phpBB/adm/style/timezone_option.html @@ -0,0 +1,20 @@ +
+
+ + + +
+ + + + +
+
-- cgit v1.2.1 From 5441ee1ee489ef9ad1727f110c440dde5417cc1f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 17 Jun 2012 16:54:12 +0200 Subject: [feature/new-tz-handling] Use jQuery and INCLUDEJS for javascript PHPBB3-9558 --- phpBB/adm/style/timezone.js | 28 +++++++++++++--------------- phpBB/adm/style/timezone_option.html | 3 +-- 2 files changed, 14 insertions(+), 17 deletions(-) (limited to 'phpBB/adm/style') diff --git a/phpBB/adm/style/timezone.js b/phpBB/adm/style/timezone.js index d02c965ab5..a1ffeb17c5 100644 --- a/phpBB/adm/style/timezone.js +++ b/phpBB/adm/style/timezone.js @@ -1,29 +1,27 @@ function phpbb_switch_tz_date(keep_selection) { - var timezone_groups = document.getElementById("timezone"); - for (var i = 0; i < timezone_groups.childElementCount; i++) { - if (timezone_groups.children[i].tagName == "OPTGROUP" && - timezone_groups.children[i].label != document.getElementById("tz_date").value) - { - timezone_groups.children[i].style.display = "none"; - } - else if (timezone_groups.children[i].tagName == "OPTGROUP") - { - // Display other options - timezone_groups.children[i].style.display = "block"; - } + $('#timezone > optgroup').css("display", "none"); + $("#timezone > optgroup[label='" + $('#tz_date').val() + "']").css("display", "block"); + + if ($("#timezone > optgroup[label='" + $('#tz_date').val() + "'] > option").size() == 1) + { + // If there is only one timezone for the selected date, we just select that automatically. + $("#timezone > optgroup[label='" + $('#tz_date').val() + "'] > option:first").attr("selected", true); + keep_selection = true; } + if (typeof keep_selection !== 'undefined') { if (!keep_selection) { - timezone_groups.children[0].selected = true; + $('#timezone > option:first').attr("selected", true); } } } function phpbb_enable_tz_dates() { - var tz_select_date = document.getElementById("tz_select_date"); - tz_select_date.style.display = "block"; + $('#tz_select_date').css("display", "block"); } + +phpbb_enable_tz_dates(); diff --git a/phpBB/adm/style/timezone_option.html b/phpBB/adm/style/timezone_option.html index 12e6e3700a..e12219b1c0 100644 --- a/phpBB/adm/style/timezone_option.html +++ b/phpBB/adm/style/timezone_option.html @@ -14,7 +14,6 @@ {S_TZ_OPTIONS} - - +
-- cgit v1.2.1 From 8d65f1f7d263d9f6e76cbac2765da02a0877c87f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 18 Jun 2012 10:20:15 +0200 Subject: [feature/new-tz-handling] Add doc blocks to js functions PHPBB3-9558 --- phpBB/adm/style/timezone.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpBB/adm/style') diff --git a/phpBB/adm/style/timezone.js b/phpBB/adm/style/timezone.js index a1ffeb17c5..d1667699da 100644 --- a/phpBB/adm/style/timezone.js +++ b/phpBB/adm/style/timezone.js @@ -1,3 +1,8 @@ +/** +* Hide the optgroups that are not the selected timezone +* +* @param bool keep_selection Shall we keep the value selected, or shall the user be forced to repick one. +*/ function phpbb_switch_tz_date(keep_selection) { $('#timezone > optgroup').css("display", "none"); @@ -19,6 +24,9 @@ function phpbb_switch_tz_date(keep_selection) } } +/** +* Display the date/time select +*/ function phpbb_enable_tz_dates() { $('#tz_select_date').css("display", "block"); -- cgit v1.2.1 From dcd7d962960ade175400cbb9b8e00575e8735a22 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 19 Jun 2012 19:08:53 +0200 Subject: [feature/new-tz-handling] Use asset in acp and subsilver2 and remove duplicates PHPBB3-9558 --- phpBB/adm/style/timezone.js | 40 ++++++++---------------------------- phpBB/adm/style/timezone_option.html | 2 +- 2 files changed, 9 insertions(+), 33 deletions(-) (limited to 'phpBB/adm/style') diff --git a/phpBB/adm/style/timezone.js b/phpBB/adm/style/timezone.js index d1667699da..4556ea5f94 100644 --- a/phpBB/adm/style/timezone.js +++ b/phpBB/adm/style/timezone.js @@ -1,35 +1,11 @@ -/** -* Hide the optgroups that are not the selected timezone -* -* @param bool keep_selection Shall we keep the value selected, or shall the user be forced to repick one. -*/ -function phpbb_switch_tz_date(keep_selection) -{ - $('#timezone > optgroup').css("display", "none"); - $("#timezone > optgroup[label='" + $('#tz_date').val() + "']").css("display", "block"); +(function($) { // Avoid conflicts with other libraries - if ($("#timezone > optgroup[label='" + $('#tz_date').val() + "'] > option").size() == 1) - { - // If there is only one timezone for the selected date, we just select that automatically. - $("#timezone > optgroup[label='" + $('#tz_date').val() + "'] > option:first").attr("selected", true); - keep_selection = true; - } +$('#tz_date').change(function() { + phpbb.timezone_switch_date(false); +}); - if (typeof keep_selection !== 'undefined') - { - if (!keep_selection) - { - $('#timezone > option:first').attr("selected", true); - } - } -} +$(document).ready( + phpbb.timezone_enable_date_selection +); -/** -* Display the date/time select -*/ -function phpbb_enable_tz_dates() -{ - $('#tz_select_date').css("display", "block"); -} - -phpbb_enable_tz_dates(); +})(jQuery); // Avoid conflicts with other libraries diff --git a/phpBB/adm/style/timezone_option.html b/phpBB/adm/style/timezone_option.html index e12219b1c0..23c0ee19e9 100644 --- a/phpBB/adm/style/timezone_option.html +++ b/phpBB/adm/style/timezone_option.html @@ -2,7 +2,7 @@