r25470 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25469‎ | r25470 | r25471 >
Date:13:55, 4 September 2007
Author:proes
Status:old
Tags:
Comment:
* Restored previous and next functionality in suggestion drop down
* Substantially reduced edit page size by using "javascript:void(0)" as the "href" value for links that call javascript functions instead of redirecting to other pages
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/forms.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/suggest.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/forms.php
@@ -98,10 +98,10 @@
9999 '<div><table>' .
100100 '<tr>' .
101101 '<td><input type="text" id="'. $name .'-suggest-text" autocomplete="off" onkeyup="suggestTextChanged(this)" style="width: 300px"></input></td>' .
102 - '<td><a id="'. $name .'-suggest-clear" href="#'. $name . '-suggest-link" onclick="suggestClearClicked(event, this)">Clear</a></td>' .
103 - '<td style="white-space: nowrap"><a id="'. $name .'-suggest-previous" href="#'. $name .'-suggest-table" class="suggest-previous" onclick="suggestPreviousClicked(event, this)"><img src="'.$wgScriptPath.'/extensions/Wikidata/Images/ArrowLeft.png" alt="Previous"/> Previous</a></td>'.
104 - '<td style="white-space: nowrap"><a id="'. $name .'-suggest-next" href="#'. $name .'-suggest-table" class="suggest-next" onclick="suggestNextClicked(event, this)">Next <img src="'.$wgScriptPath.'/extensions/Wikidata/Images/ArrowRight.png" alt="Next"/></a></td>'.
105 - '<td><a id="'. $name .'-suggest-close" href="#'. $name . '-suggest-link" onclick="suggestCloseClicked(event, this)">[X]</a></td>' .
 102+ '<td><a id="'. $name .'-suggest-clear" href="javascript:void(0)" onclick="suggestClearClicked(event, this)">Clear</a></td>' .
 103+ '<td style="white-space: nowrap"><a id="'. $name .'-suggest-previous" href="javascript:void(0)" class="suggest-previous" onclick="suggestPreviousClicked(event, this)"><img src="'.$wgScriptPath.'/extensions/Wikidata/Images/ArrowLeft.png" alt="Previous"/> Previous</a></td>'.
 104+ '<td style="white-space: nowrap"><a id="'. $name .'-suggest-next" href="javascript:void(0)" class="suggest-next" onclick="suggestNextClicked(event, this)">Next <img src="'.$wgScriptPath.'/extensions/Wikidata/Images/ArrowRight.png" alt="Next"/></a></td>'.
 105+ '<td><a id="'. $name .'-suggest-close" href="javascript:void(0)" onclick="suggestCloseClicked(event, this)">[X]</a></td>' .
106106 '</tr>' .
107107 '</table></div>' .
108108 '<div><table id="'. $name .'-suggest-table"><tr><td></td></tr></table></div>'.
@@ -129,7 +129,7 @@
130130 '<div class="suggest-drop-down" style="position: relative"><div id="'. $name .'-suggest-div" style="position: absolute; left: 0px; top: 0px; border: 1px solid #000000; display: none; background-color: white; padding: 4px">' .
131131 '<div><table><tr><td>' .
132132 // '<input type="text" id="'. $name .'-suggest-text" autocomplete="off" onkeyup="suggestTextChanged(this)" style="width: 300px"></input>' .
133 - '</td><td><a id="'. $name .'-suggest-clear" href="#'. $name . '-suggest-link" onclick="suggestClearClicked(event, this)">Clear</a></td><td><a id="'. $name .'-suggest-close" href="#'. $name . '-suggest-link" onclick="suggestCloseClicked(event, this)">[X]</a></td></tr></table></div>' .
 133+ '</td><td><a id="'. $name .'-suggest-clear" href="javascript:void(0)" onclick="suggestClearClicked(event, this)">Clear</a></td><td><a id="'. $name .'-suggest-close" href="#'. $name . '-suggest-link" onclick="suggestCloseClicked(event, this)">[X]</a></td></tr></table></div>' .
134134 '<div>' . $suggestions .
135135 //<table id="'. $name .'-suggest-table"><tr><td></td></tr></table>
136136 '</div>'.
Index: trunk/extensions/Wikidata/OmegaWiki/suggest.js
@@ -1,4 +1,4 @@
2 -window.onload=sortAll;
 2+//window.onload=sortAll;
33
44 function getHTTPObject() {
55 var xmlhttp;
@@ -194,6 +194,7 @@
195195 var suggestPrefix = getSuggestPrefix(suggestNext, 'next');
196196 var suggestOffset = document.getElementById(suggestPrefix + 'offset');
197197 suggestOffset.value = parseInt(suggestOffset.value) + 10;
 198+ updateSuggestions(suggestPrefix);
198199 stopEventHandling(event);
199200 }
200201
@@ -201,6 +202,7 @@
202203 var suggestPrefix = getSuggestPrefix(suggestPrevious, 'previous');
203204 var suggestOffset = document.getElementById(suggestPrefix + 'offset');
204205 suggestOffset.value = Math.max(parseInt(suggestOffset.value) - 10, 0);
 206+ updateSuggestions(suggestPrefix);
205207 stopEventHandling(event);
206208 }
207209

Status & tagging log