From ad98a070c37a66f773851851888f7e98dc447d92 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 7 Apr 2014 20:43:32 +0200 Subject: [ticket/12372] Unify definition of function dE() across all files PHPBB3-12372 --- phpBB/adm/style/install_header.html | 22 ++++++++++++---------- phpBB/adm/style/overall_header.html | 22 ++++++++++++---------- phpBB/adm/style/simple_header.html | 22 ++++++++++++---------- 3 files changed, 36 insertions(+), 30 deletions(-) (limited to 'phpBB/adm') diff --git a/phpBB/adm/style/install_header.html b/phpBB/adm/style/install_header.html index 99b98ef068..4980fd36fb 100644 --- a/phpBB/adm/style/install_header.html +++ b/phpBB/adm/style/install_header.html @@ -13,21 +13,23 @@ /** * Set display of page element -* s[-1,0,1] = hide,toggle display,show +* +* @param string id The ID of the element to change +* @param int action Set to 0 if element display should be toggled, -1 for +* hiding the element, and 1 for showing it. +* @param string type Display type that should be used, e.g. inline, block or +* other CSS "display" types */ -function dE(n, s, type) -{ - if (!type) - { +function dE(id, action, type) { + if (!type) { type = 'block'; } - var e = document.getElementById(n); - if (!s) - { - s = (e.style.display == '' || e.style.display == 'block') ? -1 : 1; + var display = jQuery('#' + id).css('display'); + if (!action) { + action = (display === '' || display === type) ? -1 : 1; } - e.style.display = (s == 1) ? type : 'none'; + jQuery('#' + id).css('display', ((action === 1) ? type : 'none')); } // ]]> diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index 7e7f0cecee..668c0f4e92 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -37,21 +37,23 @@ function jumpto() /** * Set display of page element -* s[-1,0,1] = hide,toggle display,show +* +* @param string id The ID of the element to change +* @param int action Set to 0 if element display should be toggled, -1 for +* hiding the element, and 1 for showing it. +* @param string type Display type that should be used, e.g. inline, block or +* other CSS "display" types */ -function dE(n, s, type) -{ - if (!type) - { +function dE(id, action, type) { + if (!type) { type = 'block'; } - var e = document.getElementById(n); - if (!s) - { - s = (e.style.display == '') ? -1 : 1; + var display = jQuery('#' + id).css('display'); + if (!action) { + action = (display === '' || display === type) ? -1 : 1; } - e.style.display = (s == 1) ? type : 'none'; + jQuery('#' + id).css('display', ((action === 1) ? type : 'none')); } /** diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html index 770b7da8a6..01757f1032 100644 --- a/phpBB/adm/style/simple_header.html +++ b/phpBB/adm/style/simple_header.html @@ -50,21 +50,23 @@ function jumpto() /** * Set display of page element -* s[-1,0,1] = hide,toggle display,show +* +* @param string id The ID of the element to change +* @param int action Set to 0 if element display should be toggled, -1 for +* hiding the element, and 1 for showing it. +* @param string type Display type that should be used, e.g. inline, block or +* other CSS "display" types */ -function dE(n, s, type) -{ - if (!type) - { +function dE(id, action, type) { + if (!type) { type = 'block'; } - var e = document.getElementById(n); - if (!s) - { - s = (e.style.display == '') ? -1 : 1; + var display = jQuery('#' + id).css('display'); + if (!action) { + action = (display === '' || display === type) ? -1 : 1; } - e.style.display = (s == 1) ? type : 'none'; + jQuery('#' + id).css('display', ((action === 1) ? type : 'none')); } /** -- cgit v1.2.1 From 966a2b4892762f3a1f032089d0b01c97a1d1c2e1 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 7 Apr 2014 21:27:48 +0200 Subject: [ticket/12372] Move dE() function core.js PHPBB3-12372 --- phpBB/adm/style/install_header.html | 28 ---------------------------- phpBB/adm/style/overall_header.html | 21 --------------------- phpBB/adm/style/simple_footer.html | 2 ++ phpBB/adm/style/simple_header.html | 21 --------------------- 4 files changed, 2 insertions(+), 70 deletions(-) (limited to 'phpBB/adm') diff --git a/phpBB/adm/style/install_header.html b/phpBB/adm/style/install_header.html index 4980fd36fb..a8f7009e4b 100644 --- a/phpBB/adm/style/install_header.html +++ b/phpBB/adm/style/install_header.html @@ -7,34 +7,6 @@ {PAGE_TITLE} - - - diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index 668c0f4e92..774df48917 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -35,27 +35,6 @@ function jumpto() } } -/** -* Set display of page element -* -* @param string id The ID of the element to change -* @param int action Set to 0 if element display should be toggled, -1 for -* hiding the element, and 1 for showing it. -* @param string type Display type that should be used, e.g. inline, block or -* other CSS "display" types -*/ -function dE(id, action, type) { - if (!type) { - type = 'block'; - } - - var display = jQuery('#' + id).css('display'); - if (!action) { - action = (display === '' || display === type) ? -1 : 1; - } - jQuery('#' + id).css('display', ((action === 1) ? type : 'none')); -} - /** * Mark/unmark checkboxes * id = ID of parent container, name = name prefix, state = state [true/false] diff --git a/phpBB/adm/style/simple_footer.html b/phpBB/adm/style/simple_footer.html index a559b25b72..c549a2df4e 100644 --- a/phpBB/adm/style/simple_footer.html +++ b/phpBB/adm/style/simple_footer.html @@ -18,6 +18,8 @@ + + diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html index 01757f1032..8950c4c394 100644 --- a/phpBB/adm/style/simple_header.html +++ b/phpBB/adm/style/simple_header.html @@ -48,27 +48,6 @@ function jumpto() } } -/** -* Set display of page element -* -* @param string id The ID of the element to change -* @param int action Set to 0 if element display should be toggled, -1 for -* hiding the element, and 1 for showing it. -* @param string type Display type that should be used, e.g. inline, block or -* other CSS "display" types -*/ -function dE(id, action, type) { - if (!type) { - type = 'block'; - } - - var display = jQuery('#' + id).css('display'); - if (!action) { - action = (display === '' || display === type) ? -1 : 1; - } - jQuery('#' + id).css('display', ((action === 1) ? type : 'none')); -} - /** * Mark/unmark checkboxes * id = ID of parent container, name = name prefix, state = state [true/false] -- cgit v1.2.1 From 91a1c3af901f51d79751b733e48e8bcddc81d263 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 7 Apr 2014 21:42:30 +0200 Subject: [ticket/12372] Rename JS function dE() to phpbb.toggleDisplay() PHPBB3-12372 --- phpBB/adm/style/acp_forums.html | 44 ++++++++++++++++---------------- phpBB/adm/style/acp_modules.html | 4 +-- phpBB/adm/style/acp_ranks.html | 4 +-- phpBB/adm/style/acp_send_statistics.html | 12 ++++----- phpBB/adm/style/acp_users_overview.html | 4 +-- phpBB/adm/style/acp_users_prefs.html | 2 +- phpBB/adm/style/install_update.html | 2 +- phpBB/adm/style/permissions.js | 12 ++++----- 8 files changed, 42 insertions(+), 42 deletions(-) (limited to 'phpBB/adm') diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 0bb5e10f57..822d1c5f35 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -14,45 +14,45 @@ if (value == {FORUM_POST}) { - dE('type_actions', -1); + phpbb.toggleDisplay('type_actions', -1); } else { - dE('type_actions', 1); + phpbb.toggleDisplay('type_actions', 1); } if (value == {FORUM_LINK}) { - dE('cat_to_link_actions', 1); + phpbb.toggleDisplay('cat_to_link_actions', 1); } else { - dE('cat_to_link_actions', -1); + phpbb.toggleDisplay('cat_to_link_actions', -1); } if (value == {FORUM_POST}) { - dE('forum_post_options', 1); - dE('forum_link_options', -1); - dE('forum_rules_options', 1); - dE('forum_cat_options', -1); + phpbb.toggleDisplay('forum_post_options', 1); + phpbb.toggleDisplay('forum_link_options', -1); + phpbb.toggleDisplay('forum_rules_options', 1); + phpbb.toggleDisplay('forum_cat_options', -1); } else if (value == {FORUM_LINK}) { - dE('forum_post_options', -1); - dE('forum_link_options', 1); - dE('forum_rules_options', -1); - dE('forum_cat_options', -1); + phpbb.toggleDisplay('forum_post_options', -1); + phpbb.toggleDisplay('forum_link_options', 1); + phpbb.toggleDisplay('forum_rules_options', -1); + phpbb.toggleDisplay('forum_cat_options', -1); } else if (value == {FORUM_CAT}) { - dE('forum_post_options', -1); - dE('forum_link_options', -1); - dE('forum_rules_options', 1); - dE('forum_cat_options', 1); + phpbb.toggleDisplay('forum_post_options', -1); + phpbb.toggleDisplay('forum_link_options', -1); + phpbb.toggleDisplay('forum_rules_options', 1); + phpbb.toggleDisplay('forum_cat_options', 1); } } @@ -64,30 +64,30 @@ { - dE('type_actions', -1); + phpbb.toggleDisplay('type_actions', -1); - dE('cat_to_link_actions', -1); + phpbb.toggleDisplay('cat_to_link_actions', -1); - dE('forum_post_options', -1); + phpbb.toggleDisplay('forum_post_options', -1); - dE('forum_cat_options', -1); + phpbb.toggleDisplay('forum_cat_options', -1); - dE('forum_link_options', -1); + phpbb.toggleDisplay('forum_link_options', -1); - dE('forum_rules_options', -1); + phpbb.toggleDisplay('forum_rules_options', -1); } diff --git a/phpBB/adm/style/acp_modules.html b/phpBB/adm/style/acp_modules.html index c7688a610c..3c97706e6a 100644 --- a/phpBB/adm/style/acp_modules.html +++ b/phpBB/adm/style/acp_modules.html @@ -10,11 +10,11 @@ { if (value == 'category') { - dE('modoptions', -1); + phpbb.toggleDisplay('modoptions', -1); } else { - dE('modoptions', 1); + phpbb.toggleDisplay('modoptions', 1); } } diff --git a/phpBB/adm/style/acp_ranks.html b/phpBB/adm/style/acp_ranks.html index be68dda695..dd2d07a837 100644 --- a/phpBB/adm/style/acp_ranks.html +++ b/phpBB/adm/style/acp_ranks.html @@ -35,8 +35,8 @@
-
-
+
+