aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-04-14 12:33:33 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-04-14 12:33:33 +0200
commitaebf2cc5cd5b76b3cc42b819dc446afb7cdbbad3 (patch)
tree4bf2f4508035982faf946bb1136a76f689bc22c8 /phpBB
parent3ce479f061ce46ad8f1ac3c99a02459ff2b4b2d2 (diff)
parentfbeed2d975b4c080d3f391226b9b69b61f55aa23 (diff)
downloadforums-aebf2cc5cd5b76b3cc42b819dc446afb7cdbbad3.tar
forums-aebf2cc5cd5b76b3cc42b819dc446afb7cdbbad3.tar.gz
forums-aebf2cc5cd5b76b3cc42b819dc446afb7cdbbad3.tar.bz2
forums-aebf2cc5cd5b76b3cc42b819dc446afb7cdbbad3.tar.xz
forums-aebf2cc5cd5b76b3cc42b819dc446afb7cdbbad3.zip
Merge remote-tracking branch 'marc/ticket/12372' into develop-ascraeus
* marc/ticket/12372: [ticket/12372] Use $() instead of jQuery() in core.js for toggleDisplay [ticket/12372] Use admin.js $(document).ready for hiding questionnaire details [ticket/12372] Rename JS function dE() to phpbb.toggleDisplay() [ticket/12372] Move dE() function core.js [ticket/12372] Unify definition of function dE() across all files [ticket/12372] Use jQuery in javascript dE() function
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_forums.html44
-rw-r--r--phpBB/adm/style/acp_modules.html4
-rw-r--r--phpBB/adm/style/acp_ranks.html4
-rw-r--r--phpBB/adm/style/acp_send_statistics.html15
-rw-r--r--phpBB/adm/style/acp_users_overview.html4
-rw-r--r--phpBB/adm/style/acp_users_prefs.html2
-rw-r--r--phpBB/adm/style/admin.js4
-rw-r--r--phpBB/adm/style/install_header.html26
-rw-r--r--phpBB/adm/style/install_update.html2
-rw-r--r--phpBB/adm/style/overall_header.html19
-rw-r--r--phpBB/adm/style/permissions.js12
-rw-r--r--phpBB/adm/style/simple_footer.html2
-rw-r--r--phpBB/adm/style/simple_header.html19
-rw-r--r--phpBB/assets/javascript/core.js21
-rw-r--r--phpBB/includes/functions_posting.php2
-rw-r--r--phpBB/styles/prosilver/template/forum_fn.js17
-rw-r--r--phpBB/styles/prosilver/template/posting_buttons.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_prefs_personal.html6
-rw-r--r--phpBB/styles/subsilver2/template/ucp_prefs_personal.html16
19 files changed, 73 insertions, 148 deletions
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html
index 537fffbf65..f8ea284acb 100644
--- a/phpBB/adm/style/acp_forums.html
+++ b/phpBB/adm/style/acp_forums.html
@@ -14,45 +14,45 @@
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST -->
if (value == {FORUM_POST})
{
- dE('type_actions', -1);
+ phpbb.toggleDisplay('type_actions', -1);
}
else
{
- dE('type_actions', 1);
+ phpbb.toggleDisplay('type_actions', 1);
}
<!-- ENDIF -->
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_CAT and S_HAS_SUBFORUMS -->
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);
}
<!-- ENDIF -->
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 @@
{
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST -->
<!-- IF S_FORUM_POST -->
- dE('type_actions', -1);
+ phpbb.toggleDisplay('type_actions', -1);
<!-- ENDIF -->
<!-- ENDIF -->
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_CAT and S_HAS_SUBFORUMS -->
<!-- IF S_FORUM_CAT -->
- dE('cat_to_link_actions', -1);
+ phpbb.toggleDisplay('cat_to_link_actions', -1);
<!-- ENDIF -->
<!-- ENDIF -->
<!-- IF not S_FORUM_POST -->
- dE('forum_post_options', -1);
+ phpbb.toggleDisplay('forum_post_options', -1);
<!-- ENDIF -->
<!-- IF not S_FORUM_CAT -->
- dE('forum_cat_options', -1);
+ phpbb.toggleDisplay('forum_cat_options', -1);
<!-- ENDIF -->
<!-- IF not S_FORUM_LINK -->
- dE('forum_link_options', -1);
+ phpbb.toggleDisplay('forum_link_options', -1);
<!-- ENDIF -->
<!-- IF S_FORUM_LINK -->
- dE('forum_rules_options', -1);
+ phpbb.toggleDisplay('forum_rules_options', -1);
<!-- ENDIF -->
}
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 @@
</dl>
<dl>
<dt><label for="special_rank">{L_RANK_SPECIAL}{L_COLON}</label></dt>
- <dd><label><input onclick="dE('posts', -1)" type="radio" class="radio" name="special_rank" value="1" id="special_rank"<!-- IF S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
- <label><input onclick="dE('posts', 1)" type="radio" class="radio" name="special_rank" value="0"<!-- IF not S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+ <dd><label><input onclick="phpbb.toggleDisplay('posts', -1)" type="radio" class="radio" name="special_rank" value="1" id="special_rank"<!-- IF S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input onclick="phpbb.toggleDisplay('posts', 1)" type="radio" class="radio" name="special_rank" value="0"<!-- IF not S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<!-- IF S_SPECIAL_RANK --><div id="posts" style="display: none;"><!-- ELSE --><div id="posts"><!-- ENDIF -->
<dl>
diff --git a/phpBB/adm/style/acp_send_statistics.html b/phpBB/adm/style/acp_send_statistics.html
index 2d6c4837fd..480e438e1f 100644
--- a/phpBB/adm/style/acp_send_statistics.html
+++ b/phpBB/adm/style/acp_send_statistics.html
@@ -17,8 +17,8 @@ function iframe_updated()
return;
}
- dE('questionnaire-form', -1);
- dE('questionnaire-thanks', 1);
+ phpbb.toggleDisplay('questionnaire-form', -1);
+ phpbb.toggleDisplay('questionnaire-thanks', 1);
}
//]]>
</script>
@@ -31,10 +31,10 @@ function iframe_updated()
<p>{L_EXPLAIN_SHOW_STATISTICS}</p>
- <p id="show-button"><input type="button" class="button2" onclick="dE('configlist', 1); dE('show-button', -1);" value="{L_SHOW_STATISTICS}" /></p>
+ <p id="show-button"><input type="button" class="button2" onclick="phpbb.toggleDisplay('configlist', 1); phpbb.toggleDisplay('show-button', -1);" value="{L_SHOW_STATISTICS}" /></p>
<div id="configlist">
- <input type="button" class="button2" onclick="dE('show-button', 1); dE('configlist', -1);" value="{L_HIDE_STATISTICS}" />
+ <input type="button" class="button2" onclick="phpbb.toggleDisplay('show-button', 1); phpbb.toggleDisplay('configlist', -1);" value="{L_HIDE_STATISTICS}" />
<p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SEND_STATISTICS}" />
</p>
@@ -61,11 +61,4 @@ function iframe_updated()
<p><strong>{L_THANKS_SEND_STATISTICS}</strong><br /><br /><a href="{U_ACP_MAIN}">&laquo; {L_GO_ACP_MAIN}</a></p>
</div>
-<script type="text/javascript">
-//<![CDATA[
- dE('configlist', -1);
- dE('questionnaire-thanks', -1);
-//]]>
-</script>
-
<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html
index 013be80465..506101c3f7 100644
--- a/phpBB/adm/style/acp_users_overview.html
+++ b/phpBB/adm/style/acp_users_overview.html
@@ -86,11 +86,11 @@
{
if (option != 'banuser' && option != 'banemail' && option != 'banip')
{
- dE('reasons', -1);
+ phpbb.toggleDisplay('reasons', -1);
return;
}
- dE('reasons', 1);
+ phpbb.toggleDisplay('reasons', 1);
element = document.getElementById('user_quick_tools').ban_reason;
diff --git a/phpBB/adm/style/acp_users_prefs.html b/phpBB/adm/style/acp_users_prefs.html
index 1092b25b04..d1e389ca04 100644
--- a/phpBB/adm/style/acp_users_prefs.html
+++ b/phpBB/adm/style/acp_users_prefs.html
@@ -50,7 +50,7 @@
<!-- INCLUDE timezone_option.html -->
<dl>
<dt><label for="dateoptions">{L_BOARD_DATE_FORMAT}{L_COLON}</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt>
- <dd><select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">{S_DATEFORMAT_OPTIONS}</select></dd>
+ <dd><select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">{S_DATEFORMAT_OPTIONS}</select></dd>
<dd><div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" /></div></dd>
</dl>
</fieldset>
diff --git a/phpBB/adm/style/admin.js b/phpBB/adm/style/admin.js
index dd46124f97..7bda86e1e3 100644
--- a/phpBB/adm/style/admin.js
+++ b/phpBB/adm/style/admin.js
@@ -242,5 +242,9 @@ function parse_document(container)
});
parse_document($('body'));
+
+ // Hide configlist and success message in send statistics page
+ phpbb.toggleDisplay('configlist', -1);
+ phpbb.toggleDisplay('questionnaire-thanks', -1);
});
})(jQuery);
diff --git a/phpBB/adm/style/install_header.html b/phpBB/adm/style/install_header.html
index 99b98ef068..a8f7009e4b 100644
--- a/phpBB/adm/style/install_header.html
+++ b/phpBB/adm/style/install_header.html
@@ -7,32 +7,6 @@
<title>{PAGE_TITLE}</title>
<link href="{T_TEMPLATE_PATH}/admin.css" rel="stylesheet" type="text/css" media="screen" />
-
-<script type="text/javascript">
-// <![CDATA[
-
-/**
-* Set display of page element
-* s[-1,0,1] = hide,toggle display,show
-*/
-function dE(n, s, type)
-{
- if (!type)
- {
- type = 'block';
- }
-
- var e = document.getElementById(n);
- if (!s)
- {
- s = (e.style.display == '' || e.style.display == 'block') ? -1 : 1;
- }
- e.style.display = (s == 1) ? type : 'none';
-}
-
-// ]]>
-</script>
-
</head>
<body class="{S_CONTENT_DIRECTION} nojs">
diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html
index d746226753..f0df138641 100644
--- a/phpBB/adm/style/install_update.html
+++ b/phpBB/adm/style/install_update.html
@@ -224,7 +224,7 @@
<!-- IF .not_modified -->
<h2>{L_FILES_NOT_MODIFIED}</h2>
- <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="dE('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
<p>{L_FILES_NOT_MODIFIED_EXPLAIN}</p>
<fieldset id="not_modified" style="display: none;">
diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html
index f5d0fda88a..25a82a5faa 100644
--- a/phpBB/adm/style/overall_header.html
+++ b/phpBB/adm/style/overall_header.html
@@ -36,25 +36,6 @@ function jumpto()
}
/**
-* Set display of page element
-* s[-1,0,1] = hide,toggle display,show
-*/
-function dE(n, s, type)
-{
- if (!type)
- {
- type = 'block';
- }
-
- var e = document.getElementById(n);
- if (!s)
- {
- s = (e.style.display == '') ? -1 : 1;
- }
- e.style.display = (s == 1) ? type : 'none';
-}
-
-/**
* Mark/unmark checkboxes
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
diff --git a/phpBB/adm/style/permissions.js b/phpBB/adm/style/permissions.js
index 1c85fbd9ef..9178adab50 100644
--- a/phpBB/adm/style/permissions.js
+++ b/phpBB/adm/style/permissions.js
@@ -177,7 +177,7 @@ function swap_options(pmask, fmask, cat, adv, view) {
var adv_block = document.getElementById('advanced' + pmask + fmask);
if (adv_block.style.display === 'block' && adv === true) {
- dE('advanced' + pmask + fmask, -1);
+ phpbb.toggleDisplay('advanced' + pmask + fmask, -1);
reset_opacity(1);
display_checkboxes(false);
return;
@@ -207,11 +207,11 @@ function swap_options(pmask, fmask, cat, adv, view) {
return;
}
- dE('options' + active_option, -1);
+ phpbb.toggleDisplay('options' + active_option, -1);
//hiding and showing the checkbox
if (document.getElementById('checkbox' + active_pmask + active_fmask)) {
- dE('checkbox' + pmask + fmask, -1);
+ phpbb.toggleDisplay('checkbox' + pmask + fmask, -1);
if ((pmask + fmask) !== (active_pmask + active_fmask)) {
document.getElementById('checkbox' + active_pmask + active_fmask).style.display = 'inline';
@@ -219,13 +219,13 @@ function swap_options(pmask, fmask, cat, adv, view) {
}
if (!view) {
- dE('advanced' + active_pmask + active_fmask, -1);
+ phpbb.toggleDisplay('advanced' + active_pmask + active_fmask, -1);
}
if (!view) {
- dE('advanced' + pmask + fmask, 1);
+ phpbb.toggleDisplay('advanced' + pmask + fmask, 1);
}
- dE('options' + id, 1);
+ phpbb.toggleDisplay('options' + id, 1);
active_pmask = pmask;
active_fmask = fmask;
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 @@
<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
+<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
+
<!-- EVENT acp_simple_footer_after -->
</body>
diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html
index fd5145f0d5..ae25f28d32 100644
--- a/phpBB/adm/style/simple_header.html
+++ b/phpBB/adm/style/simple_header.html
@@ -49,25 +49,6 @@ function jumpto()
}
/**
-* Set display of page element
-* s[-1,0,1] = hide,toggle display,show
-*/
-function dE(n, s, type)
-{
- if (!type)
- {
- type = 'block';
- }
-
- var e = document.getElementById(n);
- if (!s)
- {
- s = (e.style.display == '') ? -1 : 1;
- }
- e.style.display = (s == 1) ? type : 'none';
-}
-
-/**
* Mark/unmark checkboxes
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index ca62a5f649..ac866f7c78 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -1082,6 +1082,27 @@ phpbb.registerPalette = function(el) {
}
/**
+* 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
+*/
+phpbb.toggleDisplay = function(id, action, type) {
+ if (!type) {
+ type = 'block';
+ }
+
+ var display = $('#' + id).css('display');
+ if (!action) {
+ action = (display === '' || display === type) ? -1 : 1;
+ }
+ $('#' + id).css('display', ((action === 1) ? type : 'none'));
+}
+
+/**
* Apply code editor to all textarea elements with data-bbcode attribute
*/
$(document).ready(function() {
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 79fcb892ef..51bbcb8bae 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1153,7 +1153,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
'S_FRIEND' => ($row['friend']) ? true : false,
'S_IGNORE_POST' => ($row['foe']) ? true : false,
- 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "<a href=\"{$u_show_post}\" onclick=\"dE('{$post_anchor}', 1); return false;\">", '</a>') : '',
+ 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "<a href=\"{$u_show_post}\" onclick=\"phpbb.toggleDisplay('{$post_anchor}', 1); return false;\">", '</a>') : '',
'POST_SUBJECT' => $post_subject,
'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']),
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js
index 56dfcb04c7..1594d73517 100644
--- a/phpBB/styles/prosilver/template/forum_fn.js
+++ b/phpBB/styles/prosilver/template/forum_fn.js
@@ -92,23 +92,6 @@ function viewableArea(e, itself) {
}
/**
-* Set display of page element
-* s[-1,0,1] = hide,toggle display,show
-* type = string: inline, block, inline-block or other CSS "display" type
-*/
-function dE(n, s, type) {
- if (!type) {
- type = 'block';
- }
-
- var e = document.getElementById(n);
- if (!s) {
- s = (e.style.display === '' || e.style.display === type) ? -1 : 1;
- }
- e.style.display = (s === 1) ? type : 'none';
-}
-
-/**
* Alternate display of subPanels
*/
jQuery(document).ready(function() {
diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html
index 1164b2ffbe..3dad6606bb 100644
--- a/phpBB/styles/prosilver/template/posting_buttons.html
+++ b/phpBB/styles/prosilver/template/posting_buttons.html
@@ -34,7 +34,7 @@
function change_palette()
{
- dE('colour_palette');
+ phpbb.toggleDisplay('colour_palette');
e = document.getElementById('colour_palette');
if (e.style.display == 'block')
diff --git a/phpBB/styles/prosilver/template/ucp_prefs_personal.html b/phpBB/styles/prosilver/template/ucp_prefs_personal.html
index a5b4852af8..d07aab1a89 100644
--- a/phpBB/styles/prosilver/template/ucp_prefs_personal.html
+++ b/phpBB/styles/prosilver/template/ucp_prefs_personal.html
@@ -66,7 +66,7 @@
<dl>
<dt><label for="dateformat">{L_BOARD_DATE_FORMAT}{L_COLON}</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt>
<dd>
- <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">
+ <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">
{S_DATEFORMAT_OPTIONS}
</select>
</dd>
@@ -109,11 +109,11 @@
// Show/hide custom field
if (e.selectedIndex == e.length - 1)
{
- dE('custom_date',1);
+ phpbb.toggleDisplay('custom_date',1);
}
else
{
- dE('custom_date',-1);
+ phpbb.toggleDisplay('custom_date',-1);
}
}
diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
index cd5fc9a13f..93fcfac5b1 100644
--- a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
+++ b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
@@ -2,20 +2,6 @@
<script type="text/javascript">
// <![CDATA[
- /**
- * Set display of page element
- * s[-1,0,1] = hide,toggle display,show
- */
- function dE(n,s)
- {
- var e = document.getElementById(n);
- if (!s)
- {
- s = (e.style.display == '') ? -1 : 1;
- }
- e.style.display = (s == 1) ? 'block' : 'none';
- }
-
var default_dateformat = '{A_DEFAULT_DATEFORMAT}';
// ]]>
</script>
@@ -70,7 +56,7 @@
<tr>
<td class="row1" width="50%"><b class="genmed">{L_BOARD_DATE_FORMAT}{L_COLON}</b><br /><span class="gensmall">{L_BOARD_DATE_FORMAT_EXPLAIN}</span></td>
<td class="row2">
- <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">
+ <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">
{S_DATEFORMAT_OPTIONS}
</select>
<div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" class="post" style="margin-top: 3px;" /></div>