1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
/*
* Special:Invesitgate guided tour
*/
( function ( gt ) {
var tour;
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) !== 'Investigate' ) {
return;
}
if ( $( '.ext-checkuser-investigate-table-compare' ).length === 0 ) {
return;
}
tour = new gt.TourBuilder( {
name: 'checkuserinvestigate',
shouldLog: true,
isSinglePage: false
} );
tour.firstStep( {
name: 'useragents',
titlemsg: 'checkuser-investigate-tour-useragents-title',
descriptionmsg: 'checkuser-investigate-tour-useragents-desc',
attachTo: '.ext-checkuser-compare-table-cell-user-agent',
position: 'left',
closeOnClickOutside: false,
overlay: true,
onShow: function () {
$( this.attachTo ).first().trigger( 'mouseover' );
},
onHide: function () {
$( this.attachTo ).first().trigger( 'mouseout' );
// Api.saveOption will save a string instead of a bool. :(
( new mw.Api() ).saveOption( 'checkuser-investigate-tour-seen', 1 );
}
} )
.next( 'addusertargets' );
function handleIpTargetOnShow() {
var $cell = $( '.ext-checkuser-compare-table-cell-ip-target' ).first();
$cell.trigger( 'mouseover' );
$cell.addClass( 'ext-checkuser-investigate-active' );
// @TODO This causes a flicker between steps, maybe there is a way to force it to stay open?
$( '.ext-checkuser-investigate-table-select .oo-ui-buttonElement-button', $cell ).first().trigger(
$.Event( 'click', { which: OO.ui.MouseButtons.LEFT } )
);
}
function handleIpTargetOnHide() {
$( '.ext-checkuser-compare-table-cell-ip-target' ).first().trigger( 'mouseout' );
$( '.ext-checkuser-compare-table-cell-ip-target' ).first().removeClass( 'ext-checkuser-investigate-active' );
}
tour.step( {
name: 'addusertargets',
titlemsg: 'checkuser-investigate-tour-addusertargets-title',
descriptionmsg: 'checkuser-investigate-tour-addusertargets-desc',
attachTo: '.ext-checkuser-investigate-button-add-user-targets',
position: 'right',
closeOnClickOutside: false,
autoFocus: false,
overlay: true,
onShow: handleIpTargetOnShow,
onHide: handleIpTargetOnHide
} )
.back( 'useragents' )
.next( 'filterip' );
tour.step( {
name: 'filterip',
titlemsg: 'checkuser-investigate-tour-filterip-title',
descriptionmsg: 'checkuser-investigate-tour-filterip-desc',
attachTo: '.ext-checkuser-investigate-button-filter-ip',
position: 'right',
closeOnClickOutside: false,
autoFocus: false,
overlay: true,
onShow: handleIpTargetOnShow,
onHide: handleIpTargetOnHide
} )
.back( 'addusertargets' )
.next( 'block' );
tour.step( {
name: 'block',
titlemsg: 'checkuser-investigate-tour-block-title',
descriptionmsg: 'checkuser-investigate-tour-block-desc',
attachTo: '.ext-checkuser-investigate-subtitle-block-button',
position: 'bottomLeft',
closeOnClickOutside: false,
overlay: true,
buttons: [
{
action: 'back'
},
{
// If the copy button is not present, end the tour.
action: $( '.ext-checkuser-investigate-copy-button' ).length ? 'next' : 'end'
}
]
} )
.back( 'filterip' )
.next( 'copywikitext' );
tour.step( {
name: 'copywikitext',
titlemsg: 'checkuser-investigate-tour-copywikitext-title',
descriptionmsg: 'checkuser-investigate-tour-copywikitext-desc',
attachTo: '.ext-checkuser-investigate-copy-button',
position: 'topLeft',
closeOnClickOutside: false,
overlay: true,
buttons: [
{
action: 'back'
},
{
action: 'end'
}
]
} )
.back( 'block' );
}( mw.guidedTour ) );
|