r79587 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79586‎ | r79587 | r79588 >
Date:18:06, 4 January 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
Followup r79522: bugfix, improved datetimepicker
Modified paths:
  • /trunk/extensions/SemanticFormsInputs/SFI_Inputs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticFormsInputs/SFI_Inputs.php
@@ -908,11 +908,22 @@
909909 // insert the code of the JS init function into the pages code
910910 $wgOut->addScript('<script type="text/javascript">' . $jstext . '</script>');
911911
 912+ // find allowed values and keep only the date portion
 913+ if ( array_key_exists( 'possible_values', $other_args ) &&
 914+ count( $other_args[ 'possible_values' ] ) ) {
 915+
 916+ $other_args[ 'possible_values' ] = preg_replace(
 917+ '/^\s*(\d{4}\/\d{2}\/\d{2}).*/',
 918+ '$1',
 919+ $other_args[ 'possible_values' ]
 920+ );
 921+ }
 922+
912923 $separator = strpos($cur_value, " ");
913924
914925 $html = '<span class="inputSpan' . ($is_mandatory ? ' mandatoryFieldSpan' : '') . '">' .
915 - self::jqDatePickerHTML(substr($cur_value, 0, $separator), $input_name, $is_mandatory, $is_disabled, $other_args) . " " .
916 - self::timepickerHTML(substr($cur_value, $separator + 1), $input_name, $is_mandatory, $is_disabled, $other_args) .
 926+ self::jqDatePickerHTML(substr($cur_value + " ", 0, $separator), $input_name, $is_mandatory, $is_disabled, $other_args) . " " .
 927+ self::timepickerHTML(substr($cur_value + " ", $separator + 1), $input_name, $is_mandatory, $is_disabled, $other_args) .
917928 Xml::element("input",
918929 array(
919930 "id" => "input_{$sfgFieldNum}",
@@ -1059,7 +1070,7 @@
10601071 'class' => 'createboxInput ' . $userClasses,
10611072 'name' => "button",
10621073 ) )
1063 - . "onclick=\"document.getElementById(this.id.replace('_button','_tp_show')).focus();\""
 1074+ . " onclick=\"document.getElementById(this.id.replace('_button','_tp_show')).focus();\""
10641075 . ">"
10651076
10661077 . Xml::element(
@@ -1104,7 +1115,7 @@
11051116 'class' => 'createboxInput ' . $userClasses,
11061117 'name' => "resetbutton",
11071118 ) )
1108 - . "onclick=\"document.getElementById(this.id.replace('_resetbutton','')).value='';"
 1119+ . " onclick=\"document.getElementById(this.id.replace('_resetbutton','')).value='';"
11091120 . "document.getElementById(this.id.replace('_resetbutton','_tp_show')).value='';\""
11101121 . ">"
11111122

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r79522new input type datetimepickerfoxtrott20:18, 3 January 2011

Status & tagging log