Commit Graph

10 Commits

Author SHA1 Message Date
Jan Drewniak 6907c81a15 [Storybook] Fix PNG/SVG asset resolution.
Fixes the missing images in the Logo story.

The current method of downloading the images into
docs/ui/assets and treating them as static assets
(with the start-storybook -s option) could be problematic
if that directory is deleted or "cleaned" before the
storybook build.

Instead, the images are now downloaded into
./storybook/resolve-imports and imported explicitly in the
code in Logo.stories.data.js.

* ./storybook/resolve-less-imports renamed to resolve-imports
* .gitignore is updated to reflect that
* Webpack config is updated with the `resolve-imports` path
* static option (-s) is removed from npm start script
* Images are explicitly imported in Logo.stories.data.js
* Type definitions are added for .svg and .png files

Change-Id: I242d229242c86a5784d6d4611d0b9c7049712dac
2020-09-25 12:52:05 +02:00
Vas Jaremchuk 1874e40d87 Drop wgVectorResponsive support from modern Vector
Move the body of enableResponsiveMode method into the onBeforePageDisplayMobile hook.
Replace BeforePageDisplayMobile hook with BeforePageDisplay hook.

Bug: T254378
Change-Id: I63da1b67bf2b85c644e4af196bf894efc4797433
2020-07-02 22:08:37 +03:00
jdlrobson ea2bcd44f2 Add storybook to Vector
- Update package.json with the new dependencies.
- A script storybook.sh pulls down CSS and LESS imports from external
dependencies. This copies the approach taken in Popups and MobileFrontend.
- Icons from external repos are maintained within the repo in SVG-only form.
Using load.php modules is also possible, but will pull down other unnecessary icons
and break if any of these modules are changed. Decided that we should manually maintain
these for the time being given there are only 3 icons.
- Several LESS files now import the variables file. I think it's useful for stories
to only import the CSS they use as this encourages us to modularise our CSS. Before these
imports were not necessary as they inherit imports from index.less. This will have no impact
on the bundle size as the LESS compiler silently discards duplicate imports
- stories/utils.js provides a useful placeholder function for generalising our hook entry
points.

Bug: T242674
Change-Id: I722e84d2fb57653a2f96142dc3e5248043261746
2020-01-31 16:59:15 +08:00
jenkins-bot 671d14d351 Merge "Upgrade to newer phan" 2019-03-21 06:55:46 +00:00
Kunal Mehta a21735b270 Upgrade to newer phan
Change-Id: If7d8badf4f5c564b7a9d6ab3575f9307ee98e9e7
2019-03-20 19:37:59 -07:00
Ed Sanders 7e76377bf8 build: Update eslint-config-wikimedia to 0.11.0
Change-Id: Idae38d2dff51827f7aff510d40b2358bf939b5e2
2019-03-13 23:23:14 +00:00
Phantom42 0363a54bf4 Add phan configuration for static analysis
Bug: T179554
Change-Id: I587285fb3687541233156e19e24cd448e9a7976a
2018-05-02 14:16:00 -07:00
Timo Tijhof 1f26153a5d collapsibleTabs: Clean up and simplify code
* Rename 'rtl' to 'isRTL' and use DOM to compute its value.
* Document code with JSDuck similar to other extensions.
* Remove unused 'prevElement' property. Not used in Vector
  nor anywhere else in Wikimedia Git.
* Make 'boundEvent' property private. Not used anywhere in
  Wikimedia Git outside this file.

* Simplify 'instances' tracking.
  The jQuery object stored in this property wasn't used beyond
  calling each(). Convert to a plain array.
  Preserve and re-use the jQuery object first created
  by collapsibleTabs().

* Simplify calculateTabDistance() by using getElementById() and
  getBoundingClientRect(). Its support includes IE 5.
  The "new" version (since Firefox 3.5 and IE 9) also includes
  'height' and 'width' properties and is supported in all
  browsers supported by the MediaWiki 1.28 startup feature test.

  This helps avoid code in offset() and width(), which is fairly
  expensive in jQuery 1.x.

* moveToCollapsed()
  - Remove redundant jQuery object creation (only caller passes a
    jQuery object already).
  - Remove redundant re-receiving of expContainerSettings inside
    the animate() callback. Already in the main scope.
    Relates to a bunch of patches that work around a problem
    caused by use of remove() instead of detach() in an earlier
    version of the code. Which was only a problem because the
    other settings object was also not used from the main scope.
    (See pre-Gerrit commits 1f93310e and e7900807.)

Change-Id: I48d542580d767df2d17ce4c6668e9e233a0f7902
2016-11-29 02:25:00 +00:00
Antoine Musso afad49da62 git no more ignore /composer.json
Change-Id: I5cb0eefb17fc8092fc144e4d7afadcdb46689038
2015-11-23 22:35:58 +01:00
umherirrender 7f4d7f8bb6 Add .gitignore
Used a copy of .gitignore of mediawiki/core and removed some lines,
because in this extension not all the folders which are in core.

Change-Id: I37e2bb03143b3b8f388bcf44bdcd82ce2a2ac767
2014-08-08 20:11:24 +02:00