Ben.imbushuo has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/329046 )
Change subject: Addressing the display issue of HTML CAPTCHAs.
......................................................................
Addressing the display issue of HTML CAPTCHAs.
All non-image CAPTCHAs will be treated as plain text CAPTCHAs by default
in MobileFrontend's built-in editor. This affects at least QuestyCaptcha
(it do supports HTML-based question prior to 1.26 but undocumented, the
change that altered its original behavior in 1.27 has been corrected, see
T147606). This commit addresses this issue by presenting CAPTCHAs that
have MIME-typed "text/html" directly as HTML content.
Bug: T154082
Change-Id: Ia2a5fe8ac383452a7e64e723a56faa0d384fafa5
---
M resources/mobile.editor.common/EditorOverlayBase.js
1 file changed, 11 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/46/329046/1
diff --git a/resources/mobile.editor.common/EditorOverlayBase.js
b/resources/mobile.editor.common/EditorOverlayBase.js
index 47df7db..c9d71f3 100644
--- a/resources/mobile.editor.common/EditorOverlayBase.js
+++ b/resources/mobile.editor.common/EditorOverlayBase.js
@@ -380,11 +380,18 @@
this.$( '.captcha-panel#question' ).detach();
this.$( '.captcha-panel img' ).attr( 'src',
details.url );
} else {
- // handle mime types (other than image based
ones) as plain text by default.
- // e.g. QuestyCaptcha (question - answer),
MathCaptcha (solve a math formula) or
- // SimpleCaptcha (simple math formula)
+ // not image based CAPTCHA.
this.$( '.captcha-panel #image' ).detach();
- this.$( '.captcha-panel #question' ).text(
details.question );
+ if ( details.mime.indexOf( 'text/html' ) === 0
) {
+ // handle mime type of HTML as HTML
content (display as-is).
+ // QuestyCaptcha now have default MIME
type "text/html": see T147606
+ this.$( '.captcha-panel #question'
).html( details.question );
+ } else {
+ // handle mime types (other than image
based ones and HTML based ones) as plain text by default.
+ // e.g. MathCaptcha (solve a math
formula) or
+ // SimpleCaptcha (simple math formula)
+ this.$( '.captcha-panel #question'
).text( details.question );
+ }
}
this.showHidden( '.save-header, .captcha-panel' );
--
To view, visit https://gerrit.wikimedia.org/r/329046
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2a5fe8ac383452a7e64e723a56faa0d384fafa5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Ben.imbushuo <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits