Index: trunk/phase3/skins/common/wikibits.js |
— | — | @@ -76,88 +76,6 @@ |
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | | -function historyRadios(parent) { |
81 | | - var inputs = parent.getElementsByTagName('input'); |
82 | | - var radios = []; |
83 | | - for (var i = 0; i < inputs.length; i++) { |
84 | | - if (inputs[i].name == "diff" || inputs[i].name == "oldid") { |
85 | | - radios[radios.length] = inputs[i]; |
86 | | - } |
87 | | - } |
88 | | - return radios; |
89 | | -} |
90 | | - |
91 | | -// check selection and tweak visibility/class onclick |
92 | | -function diffcheck() { |
93 | | - var dli = false; // the li where the diff radio is checked |
94 | | - var oli = false; // the li where the oldid radio is checked |
95 | | - var hf = document.getElementById('pagehistory'); |
96 | | - if (!hf) { |
97 | | - return true; |
98 | | - } |
99 | | - var lis = hf.getElementsByTagName('li'); |
100 | | - for (var i=0;i<lis.length;i++) { |
101 | | - var inputs = historyRadios(lis[i]); |
102 | | - if (inputs[1] && inputs[0]) { |
103 | | - if (inputs[1].checked || inputs[0].checked) { // this row has a checked radio button |
104 | | - if (inputs[1].checked && inputs[0].checked && inputs[0].value == inputs[1].value) { |
105 | | - return false; |
106 | | - } |
107 | | - if (oli) { // it's the second checked radio |
108 | | - if (inputs[1].checked) { |
109 | | - oli.className = "selected"; |
110 | | - return false; |
111 | | - } |
112 | | - } else if (inputs[0].checked) { |
113 | | - return false; |
114 | | - } |
115 | | - if (inputs[0].checked) { |
116 | | - dli = lis[i]; |
117 | | - } |
118 | | - if (!oli) { |
119 | | - inputs[0].style.visibility = 'hidden'; |
120 | | - } |
121 | | - if (dli) { |
122 | | - inputs[1].style.visibility = 'hidden'; |
123 | | - } |
124 | | - lis[i].className = "selected"; |
125 | | - oli = lis[i]; |
126 | | - } else { // no radio is checked in this row |
127 | | - if (!oli) { |
128 | | - inputs[0].style.visibility = 'hidden'; |
129 | | - } else { |
130 | | - inputs[0].style.visibility = 'visible'; |
131 | | - } |
132 | | - if (dli) { |
133 | | - inputs[1].style.visibility = 'hidden'; |
134 | | - } else { |
135 | | - inputs[1].style.visibility = 'visible'; |
136 | | - } |
137 | | - lis[i].className = ""; |
138 | | - } |
139 | | - } |
140 | | - } |
141 | | - return true; |
142 | | -} |
143 | | - |
144 | | -// page history stuff |
145 | | -// attach event handlers to the input elements on history page |
146 | | -function histrowinit() { |
147 | | - var hf = document.getElementById('pagehistory'); |
148 | | - if (!hf) { |
149 | | - return; |
150 | | - } |
151 | | - var lis = hf.getElementsByTagName('li'); |
152 | | - for (var i = 0; i < lis.length; i++) { |
153 | | - var inputs = historyRadios(lis[i]); |
154 | | - if (inputs[0] && inputs[1]) { |
155 | | - inputs[0].onclick = diffcheck; |
156 | | - inputs[1].onclick = diffcheck; |
157 | | - } |
158 | | - } |
159 | | - diffcheck(); |
160 | | -} |
161 | | - |
162 | 80 | // generate toc from prefs form, fold sections |
163 | 81 | // XXX: needs testing on IE/Mac and safari |
164 | 82 | // more comments to follow |
— | — | @@ -1209,7 +1127,6 @@ |
1210 | 1128 | // might cause the function to terminate prematurely |
1211 | 1129 | doneOnloadHook = true; |
1212 | 1130 | |
1213 | | - histrowinit(); |
1214 | 1131 | unhidetzbutton(); |
1215 | 1132 | tabbedprefs(); |
1216 | 1133 | updateTooltipAccessKeys( null ); |
Index: trunk/phase3/skins/common/history.js |
— | — | @@ -0,0 +1,83 @@ |
| 2 | +function historyRadios(parent) { |
| 3 | + var inputs = parent.getElementsByTagName('input'); |
| 4 | + var radios = []; |
| 5 | + for (var i = 0; i < inputs.length; i++) { |
| 6 | + if (inputs[i].name == "diff" || inputs[i].name == "oldid") { |
| 7 | + radios[radios.length] = inputs[i]; |
| 8 | + } |
| 9 | + } |
| 10 | + return radios; |
| 11 | +} |
| 12 | + |
| 13 | +// check selection and tweak visibility/class onclick |
| 14 | +function diffcheck() { |
| 15 | + var dli = false; // the li where the diff radio is checked |
| 16 | + var oli = false; // the li where the oldid radio is checked |
| 17 | + var hf = document.getElementById('pagehistory'); |
| 18 | + if (!hf) { |
| 19 | + return true; |
| 20 | + } |
| 21 | + var lis = hf.getElementsByTagName('li'); |
| 22 | + for (var i=0;i<lis.length;i++) { |
| 23 | + var inputs = historyRadios(lis[i]); |
| 24 | + if (inputs[1] && inputs[0]) { |
| 25 | + if (inputs[1].checked || inputs[0].checked) { // this row has a checked radio button |
| 26 | + if (inputs[1].checked && inputs[0].checked && inputs[0].value == inputs[1].value) { |
| 27 | + return false; |
| 28 | + } |
| 29 | + if (oli) { // it's the second checked radio |
| 30 | + if (inputs[1].checked) { |
| 31 | + oli.className = "selected"; |
| 32 | + return false; |
| 33 | + } |
| 34 | + } else if (inputs[0].checked) { |
| 35 | + return false; |
| 36 | + } |
| 37 | + if (inputs[0].checked) { |
| 38 | + dli = lis[i]; |
| 39 | + } |
| 40 | + if (!oli) { |
| 41 | + inputs[0].style.visibility = 'hidden'; |
| 42 | + } |
| 43 | + if (dli) { |
| 44 | + inputs[1].style.visibility = 'hidden'; |
| 45 | + } |
| 46 | + lis[i].className = "selected"; |
| 47 | + oli = lis[i]; |
| 48 | + } else { // no radio is checked in this row |
| 49 | + if (!oli) { |
| 50 | + inputs[0].style.visibility = 'hidden'; |
| 51 | + } else { |
| 52 | + inputs[0].style.visibility = 'visible'; |
| 53 | + } |
| 54 | + if (dli) { |
| 55 | + inputs[1].style.visibility = 'hidden'; |
| 56 | + } else { |
| 57 | + inputs[1].style.visibility = 'visible'; |
| 58 | + } |
| 59 | + lis[i].className = ""; |
| 60 | + } |
| 61 | + } |
| 62 | + } |
| 63 | + return true; |
| 64 | +} |
| 65 | + |
| 66 | +// page history stuff |
| 67 | +// attach event handlers to the input elements on history page |
| 68 | +function histrowinit() { |
| 69 | + var hf = document.getElementById('pagehistory'); |
| 70 | + if (!hf) { |
| 71 | + return; |
| 72 | + } |
| 73 | + var lis = hf.getElementsByTagName('li'); |
| 74 | + for (var i = 0; i < lis.length; i++) { |
| 75 | + var inputs = historyRadios(lis[i]); |
| 76 | + if (inputs[0] && inputs[1]) { |
| 77 | + inputs[0].onclick = diffcheck; |
| 78 | + inputs[1].onclick = diffcheck; |
| 79 | + } |
| 80 | + } |
| 81 | + diffcheck(); |
| 82 | +} |
| 83 | + |
| 84 | +hookEvent("load", histrowinit); |
Property changes on: trunk/phase3/skins/common/history.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 85 | + native |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1347,7 +1347,7 @@ |
1348 | 1348 | * to ensure that client-side caches don't keep obsolete copies of global |
1349 | 1349 | * styles. |
1350 | 1350 | */ |
1351 | | -$wgStyleVersion = '142'; |
| 1351 | +$wgStyleVersion = '143'; |
1352 | 1352 | |
1353 | 1353 | |
1354 | 1354 | # Server-side caching: |
Index: trunk/phase3/includes/PageHistory.php |
— | — | @@ -81,6 +81,7 @@ |
82 | 82 | $wgOut->setRobotpolicy( 'noindex,nofollow' ); |
83 | 83 | $wgOut->setSyndicated( true ); |
84 | 84 | $wgOut->setFeedAppendQuery( 'action=history' ); |
| 85 | + $wgOut->addScriptFile( 'history.js' ); |
85 | 86 | |
86 | 87 | $logPage = SpecialPage::getTitleFor( 'Log' ); |
87 | 88 | $logLink = $this->mSkin->makeKnownLinkObj( $logPage, wfMsgHtml( 'viewpagelogs' ), 'page=' . $this->mTitle->getPrefixedUrl() ); |