2 <html lang=
"en" dir=
"ltr">
6 The jquery.confirmable module uses some additional modules and files
7 for internationalization support. These are omitted here for simplicity.
9 <script type=
"text/javascript" src=
"../../resources/lib/jquery/jquery.js"></script>
10 <link rel=
"stylesheet" href=
"../../resources/src/jquery/jquery.confirmable.css">
11 <script type=
"text/javascript" src=
"../../resources/src/jquery/jquery.confirmable.js"></script>
14 font: small sans-serif;
18 .mw-thanks-thank-link a {
26 <p>The jquery.confirmable module provides a simple inline confirmation script for potentially destructive or uncancellable actions.
</p>
28 <p>Possible uses include confirmable
"rollback" links in histories, confirmable
"unwatch" links on watchlists, or confirmable
"thanks" links (provided by the Echo extension).
</p>
30 <p>Shown below is a demo of how each of those could work on history and watchlist entries, in an LTR and RTL language. The enhanced links are highlighted in blue.
</p>
34 <h3>LTR (English)
</h3>
38 <ul lang=
"en" dir=
"ltr">
39 <li class=
"mw-line-even mw-changeslist-line-not-watched">
40 (
<a href=
"#">diff
</a> |
<a href=
"#">hist
</a>)
41 <span class=
"mw-changeslist-separator">. .
</span>
42 <span class=
"mw-title"><a href=
"#" class=
"mw-changeslist-title">Example page
</a></span>;
<span class=
"mw-changeslist-date">13:
38</span>
43 <span class=
"mw-changeslist-separator">. .
</span>
44 <span class=
"mw-plusminus-neg">(-
130)
</span>
45 <span class=
"mw-changeslist-separator">. .
</span>
46 <a href=
"#" class=
"mw-userlink">Example user
</a>
47 <span class=
"mw-usertoollinks">(
<a href=
"#">Talk
</a> |
<a href=
"#">contribs
</a> |
<a href=
"#">block
</a>)
</span>
48 <span class=
"comment">(example edit)
</span>
49 <span class=
"mw-rollback-link">[
<a href=
"https://www.mediawiki.org/wiki/Random_ideas_for_rollback_to_be_shelved_and_forgotten_about">rollback
</a>]
</span>
50 (
<span class=
"mw-unwatch-link"><a href=
"#">unwatch
</a></span>)
56 <ul lang=
"en" dir=
"ltr">
58 <span class=
"mw-history-histlinks">(cur |
<a href=
"#">prev
</a>)
</span>
59 <input type=
"radio" style=
"visibility: hidden;" /><input type=
"radio" checked
/>
60 <a href=
"#" class=
"mw-changeslist-date">13:
38,
28 October
2013</a>
61 <span class='history-user'
>
62 <a href=
"#" class=
"mw-userlink">Example user
</a>
63 <span class=
"mw-usertoollinks">(
<a href=
"#">Talk
</a> |
<a href=
"#">contribs
</a> |
<a href=
"#">block
</a>)
</span>
65 <span class=
"mw-changeslist-separator">. .
</span>
66 <span class=
"history-size">(
1,
654 bytes)
</span>
67 <span class=
"mw-plusminus-neg">(-
130)
</span>
68 <span class=
"mw-changeslist-separator">. .
</span>
69 <span class=
"comment">(example edit)
</span>
70 (
<span class=
"mw-rollback-link"><a href=
"https://www.mediawiki.org/wiki/Random_ideas_for_rollback_to_be_shelved_and_forgotten_about">rollback
1 edit
</a></span> |
<span class=
"mw-history-undo"><a href=
"#">undo
</a></span> |
<span class=
"mw-thanks-thank-link"><a href=
"#">thank
</a></span>)
74 <script type=
"text/javascript">
75 $( 'ul[lang="en"] .mw-rollback-link a' )
76 .confirmable({ i18n
: { confirm
: 'Are you sure you want to rollback?' } });
77 $( 'ul[lang="en"] .mw-unwatch-link a' )
78 .confirmable({ handler: function(){ alert('Unwatched!') } });
79 $( 'ul[lang="en"] .mw-thanks-thank-link a' )
80 .confirmable({ handler: function(){ alert('Thanked!') } });
84 <!-- All of the Hebrew text below has been basically pulled out of my hat. -->
88 <ul lang=
"he" dir=
"rtl">
89 <li class=
"mw-line-even mw-changeslist-line-not-watched">
90 (
<a href=
"#">הבדל
</a> |
<a href=
"#">היסטוריה
</a>)
91 <span class=
"mw-changeslist-separator">. .
</span>
92 <span class=
"mw-title"><a href=
"#" class=
"mw-changeslist-title">דף דוגמה
</a></span>;
<span class=
"mw-changeslist-date">13:
38</span>
93 <span class=
"mw-changeslist-separator">. .
</span>
94 <span class=
"mw-plusminus-neg">(-
57)
</span>
95 <span class=
"mw-changeslist-separator">. .
</span>
96 <a href=
"#" class=
"mw-userlink">דוגמא אדם
</a>
97 <span class=
"mw-usertoollinks">(
<a href=
"#">שיחה
</a> |
<a href=
"#">תרומות
</a> |
<a href=
"#">חסימה
</a>)
</span>
98 <span class=
"comment">(עריכה לדוגמה)
</span>
99 <span class=
"mw-rollback-link">[
<a href=
"https://www.mediawiki.org/wiki/Random_ideas_for_rollback_to_be_shelved_and_forgotten_about">שחזור
</a>]
</span>
100 (
<span class=
"mw-unwatch-link"><a href=
"#">הפסקת מעקב
</a></span>)
106 <ul lang=
"he" dir=
"rtl">
108 <span class=
"mw-history-histlinks">(נוכחית |
<a href=
"#">קודמת
</a>)
</span>
109 <input type=
"radio" style=
"visibility: hidden;" /><input type=
"radio" checked
/>
110 <a href=
"#" class=
"mw-changeslist-date">23:
41,
12 במאי
2012</a>
111 <span class='history-user'
>
112 <a href=
"#" class=
"mw-userlink">דוגמא אדם
</a>
113 <span class=
"mw-usertoollinks">(
<a href=
"#">שיחה
</a> |
<a href=
"#">תרומות
</a> |
<a href=
"#">חסימה
</a>)
</span>
115 <span class=
"mw-changeslist-separator">. .
</span>
116 <span class=
"history-size">(
1,
762 בתים)
</span>
117 <span class=
"mw-plusminus-neg">(-
57)
</span>
118 <span class=
"mw-changeslist-separator">. .
</span>
119 <span class=
"comment">(עריכה לדוגמה)
</span>
120 (
<span class=
"mw-rollback-link"><a href=
"https://www.mediawiki.org/wiki/Random_ideas_for_rollback_to_be_shelved_and_forgotten_about">שחזור עריכה אחת
</a></span> |
<span class=
"mw-history-undo"><a href=
"#">ביטול
</a></span> |
<span class=
"mw-thanks-thank-link"><a href=
"#">תודה
</a></span>)
124 <script type=
"text/javascript">
126 confirm
: 'האם ברצונך להמשיך?',
131 $( 'ul[lang="he"] .mw-rollback-link a' )
132 .confirmable({ i18n
: $.extend( {}, hebrewI18n
, { confirm
: 'האם ברצונך לשחזר?' } ) });
133 $( 'ul[lang="he"] .mw-unwatch-link a' )
134 .confirmable({ i18n
: hebrewI18n
, handler: function(){ alert('Unwatched!') } });
135 $( 'ul[lang="he"] .mw-thanks-thank-link a' )
136 .confirmable({ i18n
: hebrewI18n
, handler: function(){ alert('Thanked!') } });
138 <style type=
"text/css">
139 /* This is normally handled by CSSJanus. */
140 ul
[dir
=rtl
] .jquery-confirmable-button
{