aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-07-13 10:49:04 -0700
committerNathan Guse <nathaniel.guse@gmail.com>2013-07-13 10:49:04 -0700
commit9d86385a362868bcd82901e1c7df18ba80eda945 (patch)
tree5e4f36284d314362665523df1584afddcc6cdea6 /phpBB
parente10cbbf023aa6d0633d17804b3668a0ff09d96c7 (diff)
parent1d9794559354d7c52da7751e5d1fdcb17fe949e5 (diff)
downloadforums-9d86385a362868bcd82901e1c7df18ba80eda945.tar
forums-9d86385a362868bcd82901e1c7df18ba80eda945.tar.gz
forums-9d86385a362868bcd82901e1c7df18ba80eda945.tar.bz2
forums-9d86385a362868bcd82901e1c7df18ba80eda945.tar.xz
forums-9d86385a362868bcd82901e1c7df18ba80eda945.zip
Merge pull request #1436 from cyberalien/ticket/11563
Fix subPanels() in forum_fn.js
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/styles/prosilver/template/forum_fn.js59
-rw-r--r--phpBB/styles/prosilver/template/mcp_topic.html23
-rw-r--r--phpBB/styles/prosilver/template/posting_buttons.html3
-rw-r--r--phpBB/styles/prosilver/template/posting_editor.html8
-rw-r--r--phpBB/styles/prosilver/template/posting_layout.html7
5 files changed, 50 insertions, 50 deletions
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js
index bb29f00490..1ab1387d10 100644
--- a/phpBB/styles/prosilver/template/forum_fn.js
+++ b/phpBB/styles/prosilver/template/forum_fn.js
@@ -106,32 +106,51 @@ function dE(n, s, type) {
/**
* Alternate display of subPanels
*/
-function subPanels(p) {
- var i, e, t;
+jQuery(document).ready(function() {
+ jQuery('.sub-panels').each(function() {
+
+ var panels = [],
+ childNodes = jQuery('a[data-subpanel]', this).each(function() {
+ panels.push(this.getAttribute('data-subpanel'));
+ }),
+ show_panel = this.getAttribute('data-show-panel');
+
+ if (panels.length) {
+ subPanels(show_panel);
+ childNodes.click(function () {
+ subPanels(this.getAttribute('data-subpanel'));
+ return false;
+ });
+ }
- if (typeof(p) === 'string') {
- show_panel = p;
- }
+ function subPanels(p) {
+ var i, e, t;
- for (i = 0; i < panels.length; i++) {
- e = document.getElementById(panels[i]);
- t = document.getElementById(panels[i] + '-tab');
+ if (typeof(p) === 'string') {
+ show_panel = p;
+ }
- if (e) {
- if (panels[i] === show_panel) {
- e.style.display = 'block';
- if (t) {
- t.className = 'activetab';
- }
- } else {
- e.style.display = 'none';
- if (t) {
- t.className = '';
+ for (i = 0; i < panels.length; i++) {
+ e = document.getElementById(panels[i]);
+ t = document.getElementById(panels[i] + '-tab');
+
+ if (e) {
+ if (panels[i] === show_panel) {
+ e.style.display = 'block';
+ if (t) {
+ t.className = 'activetab';
+ }
+ } else {
+ e.style.display = 'none';
+ if (t) {
+ t.className = '';
+ }
+ }
}
}
}
- }
-}
+ });
+});
/**
* Call print preview
diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html
index 3975b6e513..0fd5a9455f 100644
--- a/phpBB/styles/prosilver/template/mcp_topic.html
+++ b/phpBB/styles/prosilver/template/mcp_topic.html
@@ -3,33 +3,24 @@
<div class="tabs-container">
<h2><a href="{U_VIEW_TOPIC}">{L_TOPIC}{L_COLON} {TOPIC_TITLE}</a></h2>
-<script type="text/javascript">
-// <![CDATA[
-var panels = new Array('display-panel', 'split-panel', 'merge-panel');
-
<!-- IF S_MERGE_VIEW -->
- var show_panel = 'merge-panel';
+ <!-- DEFINE $SHOW_PANEL = 'merge-panel' -->
<!-- ELSEIF S_SPLIT_VIEW -->
- var show_panel = 'split-panel';
+ <!-- DEFINE $SHOW_PANEL = 'split-panel' -->
<!-- ELSE -->
- var show_panel = 'display-panel';
+ <!-- DEFINE $SHOW_PANEL = 'display-panel' -->
<!-- ENDIF -->
-onload_functions.push('subPanels()');
-
-// ]]>
-</script>
-
-<div id="minitabs">
+<div id="minitabs" class="sub-panels" data-show-panel="{$SHOW_PANEL}">
<ul>
<li id="display-panel-tab"<!-- IF not S_MERGE_VIEW --> class="activetab"<!-- ENDIF -->>
- <a href="#minitabs" onclick="subPanels('display-panel'); return false;"><span>{L_DISPLAY_OPTIONS}</span></a>
+ <a href="#minitabs" data-subpanel="display-panel"><span>{L_DISPLAY_OPTIONS}</span></a>
</li>
<li id="split-panel-tab">
- <a href="#minitabs" onclick="subPanels('split-panel'); return false;"><span>{L_SPLIT_TOPIC}</span></a>
+ <a href="#minitabs" data-subpanel="split-panel"><span>{L_SPLIT_TOPIC}</span></a>
</li>
<li id="merge-panel-tab"<!-- IF S_MERGE_VIEW --> class="activetab"<!-- ENDIF -->>
- <a href="#minitabs" onclick="subPanels('merge-panel'); return false;"><span>{L_MERGE_POSTS}</span></a>
+ <a href="#minitabs" data-subpanel="merge-panel"><span>{L_MERGE_POSTS}</span></a>
</li>
</ul>
</div>
diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html
index 8a153a5ee8..798faa2ff7 100644
--- a/phpBB/styles/prosilver/template/posting_buttons.html
+++ b/phpBB/styles/prosilver/template/posting_buttons.html
@@ -32,9 +32,6 @@
<!-- END custom_tags -->
}
- var panels = new Array('options-panel', 'attach-panel', 'poll-panel');
- var show_panel = 'options-panel';
-
function change_palette()
{
dE('colour_palette');
diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html
index 1907d0660f..62e64a821e 100644
--- a/phpBB/styles/prosilver/template/posting_editor.html
+++ b/phpBB/styles/prosilver/template/posting_editor.html
@@ -185,11 +185,11 @@
<!-- ENDIF -->
<!-- IF not S_PRIVMSGS and not S_SHOW_DRAFTS and not $SIG_EDIT eq 1 -->
- <div id="tabs">
+ <div id="tabs" class="sub-panels" data-show-panel="options-panel">
<ul>
- <li id="options-panel-tab" class="activetab"><a href="#tabs" onclick="subPanels('options-panel'); return false;"><span>{L_OPTIONS}</span></a></li>
- <!-- IF S_SHOW_ATTACH_BOX --><li id="attach-panel-tab"><a href="#tabs" onclick="subPanels('attach-panel'); return false;"><span>{L_ADD_ATTACHMENT}</span></a></li><!-- ENDIF -->
- <!-- IF S_SHOW_POLL_BOX || S_POLL_DELETE --><li id="poll-panel-tab"><a href="#tabs" onclick="subPanels('poll-panel'); return false;"><span>{L_ADD_POLL}</span></a></li><!-- ENDIF -->
+ <li id="options-panel-tab" class="activetab"><a href="#tabs" data-subpanel="options-panel"><span>{L_OPTIONS}</span></a></li>
+ <!-- IF S_SHOW_ATTACH_BOX --><li id="attach-panel-tab"><a href="#tabs" data-subpanel="attach-panel"><span>{L_ADD_ATTACHMENT}</span></a></li><!-- ENDIF -->
+ <!-- IF S_SHOW_POLL_BOX || S_POLL_DELETE --><li id="poll-panel-tab"><a href="#tabs" data-subpanel="poll-panel"><span>{L_ADD_POLL}</span></a></li><!-- ENDIF -->
</ul>
</div>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/posting_layout.html b/phpBB/styles/prosilver/template/posting_layout.html
index 4e9954ef81..c0bd0225de 100644
--- a/phpBB/styles/prosilver/template/posting_layout.html
+++ b/phpBB/styles/prosilver/template/posting_layout.html
@@ -79,12 +79,5 @@
<!-- IF S_DISPLAY_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF -->
</form>
-<!-- IF not S_PRIVMSGS -->
-<script type="text/javascript">
-// <![CDATA[
- subPanels(show_panel);
-// ]]>
-</script>
-<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->