Commit graph

11 commits

Author SHA1 Message Date
Umherirrender
aed646001c htmlform: Add missing documentation to class properties
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.

Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.

Change-Id: I1f306a3925d6768209a06e70082598b2f70cd319
2024-09-14 11:49:05 +00:00
Dogu
bbc74d93b0 Refactor widget classes to use cleaner namespacing
This patch refactors various widget classes in the includes/widget
directory to use cleaner namespacing. The patches remove redundant backslash
prefixes in class extending statements and add use statements for OOUI classes
and other MediaWiki-specific classes. This patch improves readability and
maintainability of the code by following the MediaWiki coding conventions and
leverages the benefits of PHP's namespacing system.

List of affected classes:
- CheckMatrixWidget
- DateInputWidget
- DateTimeInputWidget
- NamespaceInputWidget
- SearchInputWidget
- SelectWithInputWidget
- SizeFilterWidget
- SpinnerWidget
- TagMultiselectWidget
- TitleInputWidget
- UserInputWidget

Additionally, the code now correctly documents exceptions thrown by
constructors where missing, enforcing clearer developer expectations.

Change-Id: I0fdaf68a412a1c3b7049a79222f4dbeaa95a6bbc
2024-01-02 23:24:56 +00:00
tacsipacsi
ce8e8894bd Allow setting min/max on DateInputWidget
This is required for HTMLDateTimeField to be compatible it:
HTMLDateTimeField filters out mustBeAfter/mustBeBefore, while
DateInputWidget didn’t understand min/max until now. Since moment.js
(used by the JavaScript side of the widget) seems to better like the
mustBeAfter/mustBeBefore semantics (strictly larger/smaller than) than
the min/max one (larger/smaller than or equal to), I decided to
internally keep mustBeAfter/mustBeBefore.

Bug: T219633
Change-Id: I487363e40d1e4f74780ed7146c8a6770bfc61fae
2022-10-21 17:51:59 +00:00
Matěj Suchánek
51642e0aae Replace tabs with spaces
Change-Id: Id034c34a294585f58dba58c26db466e0e39cb557
2020-09-04 18:04:07 +02:00
Kunal Mehta
0535765366 widget: Fix changes of copyright year
Fixes up e8b10f6804.

Change-Id: I474e508a2bd4d783272eda87c1cc91f5597bc1b1
2018-01-24 12:07:34 -08:00
Thiemo Mättig
e8b10f6804 Simplify documentation headers of includes/widgets/…Widget.php files
Most notably: The documentation header repeats the file name. This
appears to be fully automatically generated, but does not add helpful
information.

Change-Id: I9edf15dd25ef6cc52fe931fffde69f0bd9042474
2018-01-10 13:44:05 +01:00
Umherirrender
23ef520a1c Improve some parameter docs
Change-Id: I31e983d7ac287158101b18ad95779d83537302a2
2018-01-07 11:39:08 +01:00
Bartosz Dziewoński
a0d6118af7 Put menus/popups of infused PHP widgets into the default overlay
With some special tweaks:
* Remove weird custom overlay handling in DateInputWidget that nobody
  actually used. I think if you need something special like that, you
  can just write two lines of JS code to attach the dropdown elsewhere.
* Also handle the CapsuleMultiselectWidget produced by HTMLForm's
  'multiselect' field in the same way.

Bug: T183069
Change-Id: I693f406194aeb826a3ab5bc78c97015b0b8a7fdb
2018-01-02 23:40:02 +01:00
Thiemo Mättig
544122a6c2 Remove self-explaining "section heading" comments from classes
I can see that "parent::__construct" literally calls the parent
constructor. I can see that stuff preceeded by the keyword "protected"
is protected. I really (really) don't need comments explaining such.

Change-Id: I7458e714976a6acd3ba6a7c93fdc27d03903df83
2017-12-28 16:12:08 +01:00
Geoffrey Mon
9ce66e5b67 Option for DateInputWidget to display full month and day names
Add a "longDisplayFormat" config option to DateInputWidget to show
full month and day names when using the default locale-specific
display format.

Bug: T120733
Change-Id: I2db6892720abf86dfc9655291b1070aa7f7bf77b
2017-01-31 14:20:02 +00:00
Geoffrey Mon
fbc80326a6 Add PHP DateInputWidget
Bug: T120733
Change-Id: I8f80e27304a916bba16ed255c8e78073f9da3813
2016-11-01 17:37:52 -04:00