Skip to content

Commit

Permalink
fix(ShortURL): class for link icon (#1640)
Browse files Browse the repository at this point in the history
* fix(ShortURL): class for link icon
  • Loading branch information
WaitSpringQW authored Jan 7, 2025
1 parent 6456d86 commit acd9e1b
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 29 deletions.
19 changes: 9 additions & 10 deletions dist/ShortURL-pagestyles/ShortURL-pagestyles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions dist/ShortURL/ShortURL.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/definition.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* ScrollUpButton[ResourceLoader|default|dependencies=ext.gadget.i18n,ext.gadget.React,ext.gadget.Tippy,ext.gadget.Util|peers=ScrollUpButton-pagestyles|requiresES6]|ScrollUpButton.js
* ScrollUpButton-pagestyles[ResourceLoader|hidden|requiresES6]|ScrollUpButton-pagestyles.css
* SearchShortcuts[ResourceLoader|dependencies=ext.gadget.Util|requiresES6]|SearchShortcuts.js
* ShortURL[ResourceLoader|dependencies=ext.gadget.Clipboard,ext.gadget.i18n,ext.gadget.React,ext.gadget.Tippy,ext.gadget.Toastify,ext.gadget.Util,mediawiki.api,mediawiki.util,mediawiki.widgets,oojs-ui-windows|peers=ShortURL-pagestyles|requiresES6]|ShortURL.js
* ShortURL[ResourceLoader|dependencies=ext.gadget.Clipboard,ext.gadget.i18n,ext.gadget.React,ext.gadget.Tippy,ext.gadget.Toastify,ext.gadget.Util,mediawiki.api,mediawiki.util,mediawiki.widgets,oojs-ui-windows,oojs-ui.styles.icons-editing-core|peers=ShortURL-pagestyles|requiresES6]|ShortURL.js
* ShortURL-pagestyles[ResourceLoader|hidden|requiresES6]|ShortURL-pagestyles.css
* SmoothTOC[ResourceLoader|default|dependencies=ext.gadget.Util|skins=gongbi,vector,vector-2022|requiresES6]|SmoothTOC.js
* TextSpacing[ResourceLoader|dependencies=ext.gadget.Util|requiresES6]|TextSpacing.js|TextSpacing.css
Expand Down
21 changes: 9 additions & 12 deletions src/ShortURL-pagestyles/ShortURL-pagestyles.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@
text-indent: -9999px;
user-select: none;

.skin-gongbi & {
vertical-align: sub;
}

.citizen-body-header--sticky &,
.ve-init-mw-desktopArticleTarget-originalContent & {
display: none;
}
}

.gadget-short-link__icon,
.mw-ui-icon-wikimedia-shortlink {
&::before {
background-image: data-uri('./images/link.svg');
background-image: linear-gradient(transparent, transparent), data-uri('./images/link.svg');
Expand All @@ -32,4 +20,13 @@
content: '';
opacity: 0.6;
}

.skin-gongbi & {
vertical-align: sub;
}

.citizen-body-header--sticky &,
.ve-init-mw-desktopArticleTarget-originalContent & {
display: none;
}
}
3 changes: 2 additions & 1 deletion src/ShortURL/definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"mediawiki.api",
"mediawiki.util",
"mediawiki.widgets",
"oojs-ui-windows"
"oojs-ui-windows",
"oojs-ui.styles.icons-editing-core"
],
"peers": ["ShortURL-pagestyles"]
}
9 changes: 7 additions & 2 deletions src/ShortURL/modules/addLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,15 @@ const addLink = (link: string, permaLink: string): void => {
});

const isCitizen: boolean = skin === 'citizen';
if (isCitizen && !$(portletLink).find('.mw-ui-icon-wikimedia-shortlink').length) {
if (isCitizen && !$(portletLink).find('#mw-ui-icon-wikimedia-shortlink').length) {
$(portletLink)
.find('a')
.prepend(<span class="citizen-ui-icon mw-ui-icon-wikimedia-shortlink" />);
.prepend(
<span
id="mw-ui-icon-wikimedia-shortlink"
className={['citizen-ui-icon', 'mw-ui-icon-link', 'mw-ui-icon-wikimedia-link']}
/>
);
}
}

Expand Down

0 comments on commit acd9e1b

Please sign in to comment.