Prtksxna has uploaded a new change for review.
https://gerrit.wikimedia.org/r/126970
Change subject: DONT MERGE/REVIEW - Pref for testing on chicken
......................................................................
DONT MERGE/REVIEW - Pref for testing on chicken
Bug: 63508
Change-Id: I6fa29532c5a7e1746b0eb1da5a62d9285342df6b
---
M Popups.hooks.php
M Popups.php
M resources/ext.popups.core.js
3 files changed, 22 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups
refs/changes/70/126970/1
diff --git a/Popups.hooks.php b/Popups.hooks.php
index 2e47a60..f717c64 100644
--- a/Popups.hooks.php
+++ b/Popups.hooks.php
@@ -48,3 +48,16 @@
}
}
}
+
+
+
+function wfPrefHook( $user, &$preferences ) {
+
+ $preferences['respect'] = array(
+ 'type' => 'toggle',
+ 'label-message' => 'Respect typography?',
+ 'section' => 'rendering',
+ );
+
+ return true;
+}
\ No newline at end of file
diff --git a/Popups.php b/Popups.php
index 58666dd..8bc1808 100644
--- a/Popups.php
+++ b/Popups.php
@@ -41,6 +41,7 @@
$wgHooks['GetBetaFeaturePreferences'][] = 'PopupsHooks::getPreferences';
$wgHooks['BeforePageDisplay'][] = 'PopupsHooks::onBeforePageDisplay';
+$wgHooks['GetPreferences'][] = 'wfPrefHook';
$wgHooks[ 'ResourceLoaderRegisterModules' ][] = function ( ResourceLoader
&$resourceLoader ) {
diff --git a/resources/ext.popups.core.js b/resources/ext.popups.core.js
index 0904a26..737f55d 100644
--- a/resources/ext.popups.core.js
+++ b/resources/ext.popups.core.js
@@ -1,10 +1,17 @@
/* Code adapted from Yair Rand's NavPopupsRestyled.js
* https://en.wikipedia.org/wiki/User:Yair_rand/NavPopupsRestyled.js
*/
-
( function ( $, mw ) {
+
+
$( document ).ready( function () {
+ // Hello, I remove CSSs according to user prefs, have a good
day!
+ if (mw.user.options.get("respect")) {
+ $(".mwe-popups").css("font-size", "1em");
+ }
+
+
var closeTimer, // The timer use to delay `closeBox`
openTimer, // The timer used to delay sending the API
request/opening the popup form cache
scrolled = false, // true if user scrolled the page but
haven't moved mouse cursor
--
To view, visit https://gerrit.wikimedia.org/r/126970
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6fa29532c5a7e1746b0eb1da5a62d9285342df6b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Prtksxna <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits