aboutsummaryrefslogtreecommitdiffstats
path: root/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js
Commit message (Collapse)AuthorAgeFilesLines
* widget: Fix infused Date(Time)InputWidget submitting twiceBartosz Dziewoński2024-12-181-1/+15
| | | | | | | Follow-up to 91751e33eaf8606f92fa37ca0a7a4da2e200ac21. Bug: T382344 Change-Id: Ib4e445777d97b6c149dc75af32afdc007bc1d292
* Remove unnecessary local context variablesEd Sanders2024-11-081-15/+13
| | | | Change-Id: I52fdc5e5bc64bbe7ea895b9d7106dd3c99b0a908
* JSDoc: fix some eslint warningsNovem Linguae2024-07-011-3/+3
| | | | | Bug: T356455 Change-Id: Id0296c6bd464a868a9dc9624a5d4b61f5372fb7b
* build: Update eslint-config-wikimedia to 0.28.1 and autofixEd Sanders2024-06-111-2/+2
| | | | | | | Also remove temporary explicit dependency on eslint-plugin-vue introduced in Ibd616750f046a. Change-Id: Ic6330fcb116e99d5827b4877e094e3073e2b7b72
* mediawiki.widgets: Remove unnecessary context variablesEd Sanders2024-06-041-4/+3
| | | | Change-Id: Id34649641263f0f29f7c594ec71bd4657fa4f1c4
* ESLint: Prefer arrow callbacks (autofix) in mediawiki.widgetsEd Sanders2024-06-041-7/+7
| | | | Change-Id: Ic07010e5219b04b3b2b156468272d8df5dce233b
* mediawiki.widgets.datetime: Switch to use let/const, not varsJames D. Forrester2024-05-071-2/+2
| | | | Change-Id: I0a70406f172d0bea3ecd11d316a0aa3b2a09f3e4
* mediawiki.widgets: Switch to use let/const, not varsJames D. Forrester2024-05-031-24/+24
| | | | | | Also a few undoing of vars-on-top as the mood took me. Change-Id: Idb16240afb9ccd9bd2923dd5eecc885d7fbddcfd
* docs: Standardize use of class descriptions in JSDocapaskulin2024-04-251-1/+2
| | | | | | | | Uses class descriptions for classes and descriptions for constructors. Bug: T357164 Change-Id: Ic4eb3f2b6d40138ce1e9d9292eb7d1d7b10aa8b0
* docs: Migrate @mixins tags to JSDocapaskulin2024-03-051-1/+1
| | | | | Bug: T357811 Change-Id: I2f7d9d79ffcb7aafbec4d9fbb0e4e2fe78d515bb
* docs: Migrate @cfg tags to JSDocapaskulin2024-03-021-12/+12
| | | | | Bug: T357169 Change-Id: I2675cd98fc397fa0cd2c3e1f222d22527c3d99c0
* docs: Convert examples to JSDocapaskulin2024-02-231-42/+42
| | | | | | | | - Remove unnecessary indentation - Add @example tags where missing Bug: T352233 Change-Id: Idc2d538f34851c17c713146cd5eb210ad720b25a
* docs: Format descriptionsapaskulin2024-02-051-1/+1
| | | | | | | | Make sure all JSDoc descriptions end with a period in order to populate the summary field in the theme. Bug: T352308 Change-Id: I787b9c8a59b5e981b78a24f2b380c190eec6a21d
* Documentation: mw.widgetJon Robson2024-01-091-1/+1
| | | | | | | | | * Add to documentations * Add full stops to sentences in summaries where missing * Correct a few instances of "set" with "get" Bug: T352308 Change-Id: I6cb00167041d6e0936730eea298daf4fc2e485b5
* mediawiki.widgets: Move var declarations inlineEd Sanders2023-11-171-18/+13
| | | | Change-Id: I9d94afe3d5f65f0f4f70484cce482d1afacb9ddd
* Fix remaining uses of 'parent'->'super'Ed Sanders2023-11-021-2/+2
| | | | | Bug: T120821 Change-Id: Ia26c1242c69cba169d3ef600fa435b7280e1fc8a
* mw.widgets.DateInputWidget: Fix selecting when typing incomplete dateBartosz Dziewoński2023-09-251-3/+3
| | | | | | | | Don't set the selected date in the calendar, since that prevents the user from selecting it later. Instead only move the view to the date. Bug: T347319 Change-Id: I083ac3791fff687f4dbdab14b9424bee5ed710d8
* DateInputWidget: add option to configure calendarChlod Alejandro2023-08-251-2/+4
| | | | | | | | | | | | | | | Adds a `calendar` config option to DateInputWidget to control specific configuration options of the underlying CalendarWidget created by this widget, particularly things like `horizontalPosition`, `verticalPosition`, or `hideWhenOutOfView`. This allows developers to configure the position where the calendar appears (namely have it show above the DateInputWidget instead of below), configure the CalendarWidget's classes, etc. See related task for more info. Bug: T344940 Change-Id: I8c7659fcdb549b92f04b90c48dd3ccb11b78686b
* Implement disabled/readonly states for DateInputWidgetSTran2021-02-031-4/+6
| | | | | | | | | | | Passing along disabled/readonly attributes to the widget did not stop access to the calendar (and therefore changes to the input value). This patch disables the calendar for both disabled and readonly states and styles the readonly state like other inputs. Bug: T273630 Change-Id: Id6ce3a0b2b97efd9f4ed891601bb98257d7c1cc6
* Use document.body instead of 'body' as jQuery selectorFomafix2019-12-131-2/+2
| | | | Change-Id: Ie8aa67bdbd34afe0930cc6b9adfd755791607031
* Docs: Standardise "messages used" commentsEd Sanders2019-08-281-1/+3
| | | | Change-Id: Ie99f8a62da734956863b1e1c41c8768f0e083fed
* build: Update eslint-config-wikimedia to 0.13.0Ed Sanders2019-07-051-0/+1
| | | | Change-Id: I7df5840bc97f8bbcd8cfc875c2b48b3061ef2c9e
* mw.widgets.DateInputWidget: Deactivate after blurring if focus was on calendarBartosz Dziewoński2019-03-271-0/+1
| | | | | Bug: T219189 Change-Id: I5f03dbd12afac31f1d72fc1aeb78125647595b5d
* Fix more jquery event shorthand usagesEd Sanders2019-01-181-5/+5
| | | | | | Not yet caught by the linter. Change-Id: I9601bff47c099c4901487e7faaf871f23e2e2d1c
* build: Update eslint-config-wikimedia to 0.10.0Ed Sanders2019-01-081-1/+0
| | | | Change-Id: I2930bcabeeb7b7b2eb36063e77b26e664a691b43
* resources: Strip '$' and 'mw' from file closuresTimo Tijhof2018-09-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follows-up Id6d13bbea6: - '$': mw.loader.implement does this already. - 'mw': Use the canonical name directly. This replaces the following patterns: File closures (common): - `( function ( $, mw ) {` => `( function () {` - `( function ( $ ) {` => `( function () {` - `( function ( mw ) {` => `( function () {` - `( function ( mw, $ ) {` => `( function () {` File closures (rare): - `( function ( mw, $, OO ) {` => `( function () {` - `( function ( mw, OO, $ ) {` => `( function () {` - `( function ( mw, document ) {` => `( function () {` Combined dom-ready and file closure (rare): - `jQuery( function ( $ ) {` => `$( function () { - `jQuery( function () {` => `$( function () { Remaining references in files without a closure, as found by the new ESLint setting (rare): - `jQuery` => `$` - `mediaWiki` => `mw` Change-Id: I7cf2426cde597259e8c6f3f6f615a1a81a0ca82b
* Put menus/popups of infused PHP widgets into the default overlayBartosz Dziewoński2018-01-021-7/+4
| | | | | | | | | | | | 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
* mw.widgets.DateInputWidget: Fix unexpected MMMMM or ddddd date formatLiangent2017-10-261-1/+2
| | | | | | | | | In some locale data in moment.js such as zh, llll date format already uses MMMM and dddd. The original attempt to expand MMM to MMMM and ddd to dddd inadvertently expands MMMM to MMMMM and dddd to ddddd, which is then interpreted as MMMM or dddd followed by an unexpected single M or d. Change-Id: I2634dfbaaf9615a13dce7b8f4ba3c3bea6863a91
* Follow-up b446a3b9: don't auto-close DateInputWidget too earlyRoan Kattouw2017-07-311-4/+4
| | | | | | | | | | Clicking on a month does not mean that the user has made a selection, it only means that if we are in { precision: 'month' } mode. In { precision: 'day' } mode, clicking a month is navigational, so don't auto-close in that case. Bug: T172041 Change-Id: I16a3e15a3b69844ff866fc09ba6a9268e85b2930
* Special:Contributions: Open "To date" widget after selecting a "From date"Roan Kattouw2017-07-171-22/+24
| | | | | | | | | | Add a 'deactivate' event to DateInputWidget, with a boolean indicating whether the deactivation occurred because the user chose a date. Also consolidate some of the code handling this case into the deactivate() method. Bug: T120733 Change-Id: Ia56cc28b400a0bc051dff79b2d3870a8954137a6
* DateInputWidget: Unbreak closing the calendar when selecting a dateRoan Kattouw2017-07-171-2/+32
| | | | | | | | | I24327e1fe broke this by reopening the calendar when the handle was focused. Bonus: also fix auto-closing in { precision: 'month' } mode. Bug: T120733 Change-Id: Ief43f10c1e01f9a6f90b098e4f8ec1f84d8038d1
* mw.widgets.DateInputWidget: Highlight widget and open calendar on focusPrateek Saxena2017-04-221-1/+2
| | | | | Bug: T159987 Change-Id: I24327e1fe4b23de1b35833d3f23634094b5a2664
* Make infused and non-infused DateInputWidget consistentGeoffrey Mon2017-03-111-8/+7
| | | | | | | | | * Infused DateInputWidget should inherit from TextInputWidget to match the non-infused version * Adjust CSS so that the non-infused version looks approx. the same Bug: T120733 Change-Id: I8625fee07385b5f9afe3e22f876e11d22832be86
* Option for DateInputWidget to display full month and day namesGeoffrey Mon2017-01-311-0/+8
| | | | | | | | | 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
* eslint: Re-enable valid-jsdoc and make a passEd Sanders2016-11-171-0/+4
| | | | Change-Id: I5c3c942d5a9c51628619227c4bbaefd1d92a842d
* build: Replace jscs+jshint with eslintEd Sanders2016-11-151-7/+10
| | | | Change-Id: Id0a23c03aabadfaf2ec705528ae4b3bd0908fa3e
* Add PHP DateInputWidgetGeoffrey Mon2016-11-011-0/+11
| | | | | Bug: T120733 Change-Id: I8f80e27304a916bba16ed255c8e78073f9da3813
* mw.widgets.DateInputWidget, CalendarWidget: Lazy-initialize calendar when ↵Bartosz Dziewoński2016-02-191-0/+1
| | | | | | | first shown Bug: T126788 Change-Id: I469cd7dd77108435459b0f1feba953febd82e91b
* mw.widgets.DateInputWidget: Don't construct moment() objects when not neededBartosz Dziewoński2016-02-191-20/+22
| | | | | | | Fixed a typo too. Bug: T126788 Change-Id: I3b2dac752a43945e5525a8ea9349a4b46a7549b2
* Avoid parsing HTML when creating <input> nodesBartosz Dziewoński2016-02-181-1/+1
| | | | | | | | | | | | | | We used to create them like $( '<input type="checkbox" />' ), which actually does HTML parsing under the hood, because on IE 8 and lower trying to change the 'type' of an <input> node throws an exception. But we dropped support for IE 8 recently and no longer need to do that. Upstream change for OOjs UI is I166f5ab0dce5ab47dc6a1f4e2e5ad012635911ed. Find: \$\( '<input type="(\w+)" ?/?>' \) Replace with: $( '<input>' ).attr( 'type', '\1' ) Change-Id: Ie86f8917e8ce100de22006516daa542ad178aab6
* mw.widgets.DateInputWidget: Make placeholder label configurablePrateek Saxena2016-01-151-9/+16
| | | | | Bug: T123692 Change-Id: I19a095ee19d60944ade975fdf3e13695642078a1
* build: Enable all remaining jsduck jsDoc rules except twoJames D. Forrester2015-11-061-3/+3
| | | | | | | | Enabling 'checkAnnotations' with a set of extra tags bespoke to this repo, and 'checkRedudantAccess' means we're pretty close to compliant in core. Leaving 'checkRedundantParams' and 'checkReturnTypes' off for now. Change-Id: I89c4d5250fee30fdfd87a68e173cf222c08cab32
* mw.widgets.DateInputWidget: Close calendar after a date is pickedPrateek Saxena2015-10-081-0/+19
| | | | | | | | | | | It guess it makes sense to do this. I can't think on any use case in which the user would want to keep clicking on random dates on an open calendar. It could be helpful if it were a filter for some visualization, but in that case we should probably have a config to keep the calendar always open. Bug: T114942 Change-Id: I1c81464a1835eb488a75920334a3cf3b92ef34fc
* mw.widgets.DateInputWidget: Actually display the indicatorBartosz Dziewoński2015-09-291-11/+18
| | | | | | We were only passing stuff around... Change-Id: I0d494cffae0c26a6b04ffe102e9e9d6f3c5f5c81
* mw.widgets.DateInputWidget: Actually enforce date requirednessBartosz Dziewoński2015-09-291-15/+15
| | | | | | | Also, never set 'invalid' flag before the user interacts with the widget. Change-Id: I1a00fcbd9d2f675487e821316a3b5ece6845e343
* mw.widgets.DateInputWidget: Implement $overlay config optionBartosz Dziewoński2015-09-291-1/+46
| | | | | | | | | Unlike in other widgets with popups, the one here (CalendarWidget) is focusable. As the text input and calendar are not in DOM order when using $overlay, we fix up focus transitions between them manually. Bug: T112676 Change-Id: I504f81f843e8328f609824d44f276296645d5dd1
* mw.widgets.DateInputWidget: Ensure newly opened calendar shows current selectionBartosz Dziewoński2015-09-161-0/+1
| | | | | | | CalendarWidget's #resetUI method was previously unused, it was clearly implemented for this purpose. Change-Id: I865a289b331d6163fb56f9e0ec3918cfd2b91343
* mw.widget.DateInputWidget: Correct docs for mustBeAfter and mustBeBeforeBartosz Dziewoński2015-09-101-2/+2
| | | | | | | I meant to comment on daeb5371dd6a1b3576f52786936e073d24ceba1d with this, but it seems I forgot to publish my draft of inline comment. Change-Id: I3d8cbc7d1d7c771b69e23938c701f47ba3a92a0c
* mw.widget.DateInputWidget: Add range validationPrateek Saxena2015-09-101-23/+118
| | | | | Bug: T111993 Change-Id: I80bfa1b225e8d6d5e5fcca5b22582cc983917c74
* mw.widgets.DateInputWidget: Add required configPrateek Saxena2015-09-071-0/+10
| | | | Change-Id: Ie3691d5239a512e1a4fa882c43c224c2de8d7598