r22861 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22860‎ | r22861 | r22862 >
Date:06:05, 9 June 2007
Author:david
Status:old
Tags:
Comment:
JS now correctly handles the relationship between the filter-by-dates radio and the date ranges.
Modified paths:
  • /branches/liquidthreads/extensions/LqtExtension.php (modified) (history)
  • /branches/liquidthreads/skins/common/lqt.js (modified) (history)

Diff [purge]

Index: branches/liquidthreads/skins/common/lqt.js
@@ -45,22 +45,22 @@
4646
4747 function lqt_on_load() {
4848 if(!document.getElementById) return;
49 -
50 - // Hide the Go button and turn on automatic submission on the archive browser.
51 - /*
52 - var dropdown = document.getElementById('lqt_archive_month');
53 - var success = lqt_add_event(dropdown, 'change', function(){
54 - document.getElementById('lqt_archive_browser_form').submit();
55 - });
56 - if (success) {
57 - document.getElementById('lqt_archive_go_button').className = "lqt_hidden";
58 - }*/
5949
60 -
6150 var searchform = document.getElementById("lqt_archive_search_form");
6251 if ( searchform ) {
63 - new LqtDateRangeRectifier( document.getElementById("lqt_archive_start"),
64 - document.getElementById("lqt_archive_end"));
 52+ var start = document.getElementById("lqt_archive_start");
 53+ var end = document.getElementById("lqt_archive_end");
 54+
 55+ new LqtDateRangeRectifier( start, end );
 56+
 57+ var filter = document.getElementById("lqt_archive_filter_by_date_yes");
 58+ function set_date_filter_radio(e) { filter.checked = true; }
 59+ lqt_add_event(start, 'change', set_date_filter_radio);
 60+ lqt_add_event(end, 'change', set_date_filter_radio);
 61+ if ( !filter.checked ) {
 62+ start.selectedIndex = end.selectedIndex = 0;
 63+ }
 64+
6565 }
6666 }
6767
Index: branches/liquidthreads/extensions/LqtExtension.php
@@ -731,9 +731,9 @@
732732 <form id="lqt_archive_search_form" action="{$this->title->getLocalURL()}">
733733 <input type="hidden" name="lqt_show_archive" value="1">
734734 <input type="hidden" name="title" value="{$this->title->getPrefixedURL()}"
735 - <input type="radio" name="lqt_archive_filter_by_date" value="0" {$any_date_check}>
 735+ <input type="radio" id="lqt_archive_filter_by_date_no" name="lqt_archive_filter_by_date" value="0" {$any_date_check}>
736736 <label for="lqt_archive_filter_by_date_no">Any date</label> <br>
737 - <input type="radio" name="lqt_archive_filter_by_date" value="1" {$these_dates_check}>
 737+ <input type="radio" id="lqt_archive_filter_by_date_yes" name="lqt_archive_filter_by_date" value="1" {$these_dates_check}>
738738 <label for="lqt_archive_filter_by_date_yes">Only these dates:</label> <br>
739739
740740 <label for="lqt_archive_start">Start</label>

Status & tagging log