1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-23 16:52:54 +02:00

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
This commit is contained in:
Joas Schilling
2014-04-14 12:33:33 +02:00
19 changed files with 73 additions and 148 deletions

View File

@@ -91,23 +91,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
*/

View File

@@ -34,7 +34,7 @@
function change_palette()
{
dE('colour_palette');
phpbb.toggleDisplay('colour_palette');
e = document.getElementById('colour_palette');
if (e.style.display == 'block')

View File

@@ -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);
}
}

View File

@@ -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>