Yaron Koren has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/340750 )
Change subject: HTML and JS improvements
......................................................................
HTML and JS improvements
Change-Id: I49a58778df075a0a879745c5b34d17674dbbf890
---
M libs/PF_CreateForm.js
M libs/PF_checkboxes.js
M specials/PF_CreateForm.php
3 files changed, 5 insertions(+), 11 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms
refs/changes/50/340750/2
diff --git a/libs/PF_CreateForm.js b/libs/PF_CreateForm.js
index 9dc87db..97e3c53 100644
--- a/libs/PF_CreateForm.js
+++ b/libs/PF_CreateForm.js
@@ -4,7 +4,7 @@
url: window.location.href +
( ( window.location.href.indexOf('?') === -1 ) ? '?' :
'&' ) +
'showinputtypeoptions=' + encodeURIComponent(
this.val() ) +
- '&formfield=' + encodeURIComponent(
this.attr('formfieldid') ),
+ '&formfield=' + encodeURIComponent( this.attr(
'formfieldid' ) ),
context: document.body,
success: function ( data ){
inputParamsDiv.html( data );
@@ -20,7 +20,7 @@
if( jQuery( '#sectionname' ).val() === '' ) {
event.preventDefault();
jQuery( '#section_error' ).remove();
- jQuery( '<div/>' ).append( '<span class="error"
id="section_error">' + mediaWiki.msg( 'pf_blank_error' ) + '</span>'
).appendTo( '#sectionerror' );
+ jQuery( '<div/>' ).append( '<span class="error"
id="section_error"></span>' ).text( mediaWiki.msg( 'pf_blank_error' )
).appendTo( '#sectionerror' );
}
} );
} );
diff --git a/libs/PF_checkboxes.js b/libs/PF_checkboxes.js
index ec3447c..343d39e 100644
--- a/libs/PF_checkboxes.js
+++ b/libs/PF_checkboxes.js
@@ -12,7 +12,6 @@
$.fn.appendSelectionSwitches = function () {
function insertSwitch( switchesWrapper, label, checked ) {
-
// create a link element that will trigger the
selection of all checkboxes
var link = $( '<a href="#">' + label + '</a>' );
@@ -21,7 +20,6 @@
// attach an event handler
link.click( function ( event ) {
-
event.preventDefault();
// store checkboxes during first method call so
the DOM is not searched on every click on the link
@@ -35,16 +33,12 @@
// insert the complete switch into the DOM
switchesWrapper.append( switchWrapper );
-
}
this.each( function ( index, element ) {
-
var switchesWrapper = $( '<span
class="checkboxSwitches">' ).prependTo( element );
-
- insertSwitch( switchesWrapper, mw.message(
'pf_forminputs_checkboxes_select_all' ), true );
- insertSwitch( switchesWrapper, mw.message(
'pf_forminputs_checkboxes_select_none' ), false );
-
+ insertSwitch( switchesWrapper, mw.message(
'pf_forminputs_checkboxes_select_all' ).escaped(), true );
+ insertSwitch( switchesWrapper, mw.message(
'pf_forminputs_checkboxes_select_none' ).escaped(), false );
} );
return this;
diff --git a/specials/PF_CreateForm.php b/specials/PF_CreateForm.php
index dbaefd8..6cc4c5a 100644
--- a/specials/PF_CreateForm.php
+++ b/specials/PF_CreateForm.php
@@ -701,7 +701,7 @@
$text .= "\n<br />" . Html::rawElement( 'em', null,
$desc ) . "\n</div>\n";
if ( $i % 3 == 2 || $i == count( $params ) - 1 ) {
- $text .= "<div style=\"clear:
both\";></div></div>\n";
+ $text .= "<div style=\"clear:
both;\"></div></div>\n";
}
++$i;
}
--
To view, visit https://gerrit.wikimedia.org/r/340750
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I49a58778df075a0a879745c5b34d17674dbbf890
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits