镜像自地址
https://github.com/wikimedia/mediawiki-extensions-MultimediaViewer
已同步 2024-06-02 13:50:16 +08:00
Restore success notification for copy-to-clipboard buttons
UI interactions should always provide some visual feedback, and the mw.widget version of this triggered a notification. Bug: T340258 Change-Id: I1f9850541d23e362c2cd73c3797d1f03bcfc7ca1
这个提交包含在:
父节点
c7c05eb214
当前提交
f1f9038471
|
@ -216,7 +216,8 @@
|
|||
],
|
||||
"dependencies": [
|
||||
"mmv.head",
|
||||
"mmv"
|
||||
"mmv",
|
||||
"mediawiki.notification"
|
||||
],
|
||||
"messages": [
|
||||
"multimediaviewer-copy-button",
|
||||
|
@ -235,7 +236,8 @@
|
|||
"multimediaviewer-html-embed-credit-text-bl",
|
||||
"multimediaviewer-html-embed-credit-text-b",
|
||||
"multimediaviewer-html-embed-credit-text-l",
|
||||
"multimediaviewer-html-embed-credit-link-text"
|
||||
"multimediaviewer-html-embed-credit-link-text",
|
||||
"mw-widgets-copytextlayout-copy-success"
|
||||
]
|
||||
},
|
||||
"mmv.codex": {
|
||||
|
|
|
@ -60,9 +60,13 @@ const { HtmlUtils } = require( 'mmv.bootstrap' );
|
|||
.attr( 'title', title )
|
||||
.append( $( '<span>' ).addClass( 'cdx-button__icon cdx-button__icon--copy' ).attr( 'aria-hidden', 'true' ) )
|
||||
.append( mw.message( 'multimediaviewer-copy-button' ).text() )
|
||||
// navigator.clipboard() is not supported in Safari 11.1, iOS Safari 11.3-11.4
|
||||
// eslint-disable-next-line compat/compat
|
||||
.on( 'click', () => navigator.clipboard && navigator.clipboard.writeText && navigator.clipboard.writeText( $input.val() ) );
|
||||
.on( 'click', () => {
|
||||
// navigator.clipboard() is not supported in Safari 11.1, iOS Safari 11.3-11.4
|
||||
if ( navigator.clipboard && navigator.clipboard.writeText ) {
|
||||
navigator.clipboard.writeText( $input.val() );
|
||||
mw.notify( mw.msg( 'mw-widgets-copytextlayout-copy-success' ) );
|
||||
}
|
||||
} );
|
||||
const $div = $( '<div>' )
|
||||
.addClass( 'mw-mmv-flex mw-mmv-gap-50' )
|
||||
.append(
|
||||
|
|
正在加载...
在新工单中引用
屏蔽一个用户