Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4121053
special.import.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
special.import.js
View Options
/*!
* JavaScript for Special:Import
*/
$
(
()
=>
{
if
(
mw
.
config
.
get
(
'wgCanonicalSpecialPageName'
)
!==
'Import'
)
{
return
;
}
let
projectDropdownInput
,
subprojectDropdownInput
;
function
updateImportSubprojectList
()
{
const
project
=
projectDropdownInput
.
getValue
();
subprojectDropdownInput
.
dropdownWidget
.
getMenu
().
getItems
().
forEach
(
(
item
)
=>
{
item
.
toggle
(
item
.
getData
().
indexOf
(
project
+
'::'
)
===
0
);
}
);
const
firstItem
=
subprojectDropdownInput
.
dropdownWidget
.
menu
.
findFirstSelectableItem
();
subprojectDropdownInput
.
toggle
(
!!
firstItem
);
subprojectDropdownInput
.
dropdownWidget
.
menu
.
selectItem
(
firstItem
);
}
const
$subprojectInput
=
$
(
'#mw-input-subproject'
);
if
(
$subprojectInput
.
length
)
{
projectDropdownInput
=
OO
.
ui
.
infuse
(
$
(
'#mw-input-interwiki'
)
);
subprojectDropdownInput
=
OO
.
ui
.
infuse
(
$subprojectInput
);
projectDropdownInput
.
on
(
'change'
,
updateImportSubprojectList
);
updateImportSubprojectList
();
}
// HACK: Move namespace selector next to the corresponding input, between other radio inputs.
const
sources
=
[
'upload'
,
'interwiki'
];
sources
.
forEach
(
(
name
)
=>
{
// IDs: mw-import-mapping-upload, mw-import-mapping-interwiki
const
$mappingInput
=
$
(
'#mw-import-mapping-'
+
name
);
// IDs: mw-import-namespace-upload, mw-import-namespace-interwiki
const
$namespaceInput
=
$
(
'#mw-import-namespace-'
+
name
);
if
(
$mappingInput
.
length
&&
$namespaceInput
.
length
)
{
const
mappingWidget
=
OO
.
ui
.
infuse
(
$mappingInput
);
const
namespaceWidget
=
OO
.
ui
.
infuse
(
$namespaceInput
);
const
$namespaceRadio
=
mappingWidget
.
radioSelectWidget
.
findItemFromData
(
'namespace'
).
$element
;
const
$namespaceField
=
namespaceWidget
.
$element
.
closest
(
'.oo-ui-fieldLayout'
);
$namespaceRadio
.
after
(
$namespaceField
);
}
}
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 04:23 (2 d, 7 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1b/07/f4a5f3a21cc2fe16c0cc0e4437a7
Default Alt Text
special.import.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment