Bene has uploaded a new change for review. https://gerrit.wikimedia.org/r/89874
Change subject: (bug 55731) escaped HTML-chars in wbclient-linkItem-goButton
label
......................................................................
(bug 55731) escaped HTML-chars in wbclient-linkItem-goButton label
also tidied up the styles a bit
Change-Id: I6a9581749a070b1f3285cf275d1a07baeb831c92
---
M client/resources/jquery.wikibase/jquery.wikibase.linkitem.css
M client/resources/jquery.wikibase/jquery.wikibase.linkitem.js
2 files changed, 90 insertions(+), 72 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/74/89874/1
diff --git a/client/resources/jquery.wikibase/jquery.wikibase.linkitem.css
b/client/resources/jquery.wikibase/jquery.wikibase.linkitem.css
index fc2b35b..b902f1d 100644
--- a/client/resources/jquery.wikibase/jquery.wikibase.linkitem.css
+++ b/client/resources/jquery.wikibase/jquery.wikibase.linkitem.css
@@ -20,5 +20,5 @@
color: #0645AD;
}
.wbclient-linkItem-Input {
- margin: 20px;
+ margin: 5px;
}
diff --git a/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js
b/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js
index 27f5e8a..6796c71 100644
--- a/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js
+++ b/client/resources/jquery.wikibase/jquery.wikibase.linkitem.js
@@ -127,11 +127,11 @@
this.$dialog = $( '<div>' )
.attr( 'id', 'wbclient-linkItem-dialog' )
.dialog( {
- title: mw.message( 'wikibase-linkitem-title'
).escaped(),
+ title: mw.message( 'wikibase-linkitem-title' ),
width: 500,
resizable: false,
buttons: [ {
- text: mw.message(
'wikibase-linkitem-linkpage' ).escaped(),
+ text: mw.message(
'wikibase-linkitem-linkpage' ),
id: 'wbclient-linkItem-goButton',
disabled: 'disabled',
click: $.proxy( this._onSecondStep,
this )
@@ -142,7 +142,7 @@
.on( 'dialogclose', $.proxy( this._onDialogClose, this
) )
.append(
$( '<p>' )
- .text( mw.message(
'wikibase-linkitem-selectlink' ).escaped() )
+ .text( mw.message(
'wikibase-linkitem-selectlink' ) )
)
.append( this._getSiteLinkForm() );
@@ -200,76 +200,94 @@
name: 'wikibase-linkItem-form'
} )
.append(
- $( '<label>' )
- .attr( {
- 'for': 'wbclient-linkItem-Site'
- } )
- .text( mw.message(
'wikibase-linkitem-input-site' ) )
- )
- .append(
- $( '<input />' )
- .attr( {
- name: 'wbclient-linkItem-Site',
- id: 'wbclient-linkItem-Site',
- 'class':
'wbclient-linkItem-Input'
- } )
- .siteselector( {
- resultSet:
this._getLinkableSites()
- } )
- .on( 'siteselectoropen
siteselectorclose siteselectorautocomplete blur', $.proxy( function() {
- var apiUrl;
+ $( '<table>' )
+ .append(
+ $( '<tr>' )
+ .append(
+ $( '<td>' )
+ .append(
+
$( '<label>' )
+
.attr( {
+
'for': 'wbclient-linkItem-Site'
+
} )
+
.text( mw.message( 'wikibase-linkitem-input-site' ) )
+ )
+ )
+ .append(
+ $( '<td>' )
+ .append(
+
$( '<input />' )
+
.attr( {
+
name: 'wbclient-linkItem-Site',
+
id: 'wbclient-linkItem-Site',
+
'class': 'wbclient-linkItem-Input'
+
} )
+
.siteselector( {
+
resultSet: this._getLinkableSites()
+
} )
+
.on( 'siteselectoropen siteselectorclose siteselectorautocomplete
blur', $.proxy( function() {
+
var apiUrl;
- $( '#wbclient-linkItem-page' )
- .val( '' );
+
$( '#wbclient-linkItem-page' )
+
.val( '' );
- try {
- apiUrl = $(
'#wbclient-linkItem-Site' ).siteselector( 'getSelectedSite' ).getApi();
- } catch( e ) {
- // Invalid input
(likely incomplete). Disable the page input an re-disable to button
- $(
'#wbclient-linkItem-page' )
- .attr(
'disabled', 'disabled' );
- this.$goButton.button(
'disable' );
- return;
- }
- // If the language gets changed
the yet selected page is no longer available so we clear the input element.
- // Furthermore we remove the
old suggestor (if there's one) and create a new one working on the right wiki
- $( '#wbclient-linkItem-page' )
- .removeAttr( 'disabled'
)
- .suggester( {
- ajax: {
- url:
apiUrl,
- params:
{
-
action: 'opensearch',
-
namespace: mw.config.get( 'wgNamespaceNumber' )
- }
- }
- } );
- }, this ) )
- )
- .append(
- $( '<br />' )
- )
- .append(
- $( '<label>' )
- .attr( {
- 'for': 'wbclient-linkItem-Site'
- } )
- .text( mw.msg(
'wikibase-linkitem-input-page' ) )
- )
- .append(
- $( '<input />' )
- .attr( {
- name: 'wbclient-linkItem-page',
- id: 'wbclient-linkItem-page',
- disabled: 'disabled',
- 'class' :
'wbclient-linkItem-Input'
- } )
- .on(
- 'focus',
- $.proxy( function () {
- // Enable the button by
the time the user uses this field
- this.$goButton.button(
'enable' );
- }, this )
+
try {
+
apiUrl = $( '#wbclient-linkItem-Site' ).siteselector(
'getSelectedSite' ).getApi();
+
} catch( e ) {
+
// Invalid input (likely incomplete). Disable the page
input an re-disable to button
+
$( '#wbclient-linkItem-page' )
+
.attr( 'disabled', 'disabled' );
+
this.$goButton.button( 'disable' );
+
return;
+
}
+
// If the language gets changed the yet selected page is no
longer available so we clear the input element.
+
// Furthermore we remove the old suggestor (if there's one) and
create a new one working on the right wiki
+
$( '#wbclient-linkItem-page' )
+
.removeAttr( 'disabled' )
+
.suggester( {
+
ajax: {
+
url: apiUrl,
+
params: {
+
action: 'opensearch',
+
namespace: mw.config.get(
'wgNamespaceNumber' )
+
}
+
}
+
} );
+
}, this ) )
+ )
+ )
+ )
+ .append(
+ $( '<tr>' )
+ .append(
+ $( '<td>' )
+ .append(
+
$( '<label>' )
+
.attr( {
+
'for': 'wbclient-linkItem-Site'
+
} )
+
.text( mw.msg( 'wikibase-linkitem-input-page' ) )
+ )
+ )
+ .append(
+ $( '<td>' )
+ .append(
+
$( '<input />' )
+
.attr( {
+
name: 'wbclient-linkItem-page',
+
id: 'wbclient-linkItem-page',
+
disabled: 'disabled',
+
'class' : 'wbclient-linkItem-Input'
+
} )
+
.on(
+
'focus',
+
$.proxy( function () {
+
// Enable the button by the time the user uses this
field
+
this.$goButton.button( 'enable' );
+
}, this )
+
)
+ )
+ )
)
);
},
--
To view, visit https://gerrit.wikimedia.org/r/89874
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a9581749a070b1f3285cf275d1a07baeb831c92
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Bene <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
