Index: trunk/extensions/WikiLove/modules/ext.wikiLove/ext.wikiLove.core.js |
— | — | @@ -45,9 +45,18 @@ |
46 | 46 | $typeList.append( $( '<li tabindex="0"></li>' ).append( $button ) ); |
47 | 47 | } |
48 | 48 | |
49 | | - var $termsLink = $( '<a> ') |
50 | | - .attr( 'href', mw.msg( 'wikilove-commons-url' ) ) |
51 | | - .text( mw.msg( 'wikilove-commons-link' ) ); |
| 49 | + var commonsLink = $( '<a>' ) |
| 50 | + .attr( 'href', mw.msg( 'wikilove-commons-url' ) ) |
| 51 | + .text( mw.msg( 'wikilove-commons-link' ) ) |
| 52 | + .wrap( '<div>' ) // or .html() will only return the link text |
| 53 | + .parent() |
| 54 | + .html(); |
| 55 | + termsLink = $( '<a> ') |
| 56 | + .attr( 'href', mw.msg( 'wikilove-terms-url' ) ) |
| 57 | + .text( mw.msg( 'wikilove-terms-link' ) ) |
| 58 | + .wrap( '<div>' ) |
| 59 | + .parent() |
| 60 | + .html(); |
52 | 61 | |
53 | 62 | $dialog = $( '\ |
54 | 63 | <div id="mw-wikilove-dialog">\ |
— | — | @@ -96,7 +105,7 @@ |
97 | 106 | <span class="mw-wikilove-note" id="mw-wikilove-image-note"><html:msg key="wikilove-image-example"/></span>\ |
98 | 107 | <input type="text" class="text" id="mw-wikilove-image"/>\ |
99 | 108 | <div id="mw-wikilove-commons-text">\ |
100 | | - ' + mw.msg( 'wikilove-commons-text', $termsLink.html() ) + '\ |
| 109 | + ' + mw.html.escape( mw.msg( 'wikilove-commons-text' ) ).replace( /\$1/, commonsLink ) + '\ |
101 | 110 | </div>\ |
102 | 111 | <label for="mw-wikilove-message" id="mw-wikilove-message-label"><html:msg key="wikilove-enter-message"/></label>\ |
103 | 112 | <span class="mw-wikilove-note" id="mw-wikilove-message-note"><html:msg key="wikilove-omit-sig"/></span>\ |
— | — | @@ -114,7 +123,7 @@ |
115 | 124 | <h3><html:msg key="wikilove-preview"/></h3>\ |
116 | 125 | <div id="mw-wikilove-preview-area"></div>\ |
117 | 126 | <div id="mw-wikilove-terms">\ |
118 | | - ' + mw.msg( 'wikilove-terms', '<a href="' + mw.msg( 'wikilove-terms-url' ) + '" target="_blank">' + mw.msg( 'wikilove-terms-link' ) +'</a>' ) + '\ |
| 127 | + ' + mw.html.escape( mw.msg( 'wikilove-terms' ) ).replace( /\$1/, termsLink ) + '\ |
119 | 128 | </div>\ |
120 | 129 | <form id="mw-wikilove-send-form">\ |
121 | 130 | <button class="submit" id="mw-wikilove-button-send" type="submit"></button>\ |