Matmarex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/74485


Change subject: ext.centralauth.centralautologin.css: Use transition instead of 
animation
......................................................................

ext.centralauth.centralautologin.css: Use transition instead of animation

Works the same, and less code is better.

Change-Id: If4191e76c153bcbcf62a14dd0986232255cff34a
---
M modules/ext.centralauth.centralautologin.css
M specials/SpecialCentralAutoLogin.php
2 files changed, 15 insertions(+), 80 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/85/74485/1

diff --git a/modules/ext.centralauth.centralautologin.css 
b/modules/ext.centralauth.centralautologin.css
index b90dcff..83057be 100644
--- a/modules/ext.centralauth.centralautologin.css
+++ b/modules/ext.centralauth.centralautologin.css
@@ -1,80 +1,14 @@
-/* CSS code adapted from https://github.com/daneden/animate.css:
- *
- * Animate.css - http://daneden.me/animate
- * Licensed under the MIT license
- *
- * Copyright (c) 2013 Daniel Eden
- *
- * Permission is hereby granted, free of charge, to any person obtaining a 
copy of this software and associated documentation files (the "Software"), to 
deal in the Software without restriction, including without limitation the 
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 
sell copies of the Software, and to permit persons to whom the Software is 
furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in 
all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
- */
-
-body { /* Addresses a small issue in webkit: http://bit.ly/NEdoDq */
-       -webkit-backface-visibility: hidden;
+#p-personal.centralAuthPPersonal {
+       opacity: 0;
+       margin-top: -20px;
 }
 
-@-webkit-keyframes centralAuthPPersonalAnimation {
-       0% {
-               opacity: 0;
-               -webkit-transform: translateY(-20px);
-       }
-
-       100% {
-               opacity: 1;
-               -webkit-transform: translateY(0);
-       }
-}
-
-@-moz-keyframes centralAuthPPersonalAnimation {
-       0% {
-               opacity: 0;
-               -moz-transform: translateY(-20px);
-       }
-
-       100% {
-               opacity: 1;
-               -moz-transform: translateY(0);
-       }
-}
-
-@-o-keyframes centralAuthPPersonalAnimation {
-       0% {
-               opacity: 0;
-               -o-transform: translateY(-20px);
-       }
-
-       100% {
-               opacity: 1;
-               -o-transform: translateY(0);
-       }
-}
-
-@keyframes centralAuthPPersonalAnimation {
-       0% {
-               opacity: 0;
-               transform: translateY(-20px);
-       }
-
-       100% {
-               opacity: 1;
-               transform: translateY(0);
-       }
-}
-
-.centralAuthPPersonalAnimation {
-       -webkit-animation-duration: 1s;
-       -moz-animation-duration: 1s;
-       -o-animation-duration: 1s;
-       animation-duration: 1s;
-       -webkit-animation-fill-mode: both;
-       -moz-animation-fill-mode: both;
-       -o-animation-fill-mode: both;
-       animation-fill-mode: both;
-       -webkit-animation-name: centralAuthPPersonalAnimation;
-       -moz-animation-name: centralAuthPPersonalAnimation;
-       -o-animation-name: centralAuthPPersonalAnimation;
-       animation-name: centralAuthPPersonalAnimation;
+#p-personal.centralAuthPPersonalLoggedin {
+       opacity: 1;
+       margin-top: 0;
+       -webkit-transition: opacity 1s, margin-top 1s;
+       -moz-transition: opacity 1s, margin-top 1s;
+       -ms-transition: opacity 1s, margin-top 1s;
+       -o-transition: opacity 1s, margin-top 1s;
+       transition: opacity 1s, margin-top 1s;
 }
diff --git a/specials/SpecialCentralAutoLogin.php 
b/specials/SpecialCentralAutoLogin.php
index 39e9e7d..fc3fec8 100644
--- a/specials/SpecialCentralAutoLogin.php
+++ b/specials/SpecialCentralAutoLogin.php
@@ -282,12 +282,13 @@
 
                        // This is also hacky.
                        $script .= Xml::encodeJsCall(
-                               "jQuery( '#p-personal ul' ).html",
+                               "jQuery( '#p-personal' ).addClass( 
'centralAuthPPersonal' )
+                                       .find( 'ul' ).html",
                                array( $html )
                        );
 
-                       // Sigh.
-                       $script .= "jQuery( '#p-personal' ).addClass( 
'centralAuthPPersonalAnimation' );";
+                       // Trigger the animation
+                       $script .= "jQuery( '#p-personal' ).addClass( 
'centralAuthPPersonalLoggedin' );";
 
                        // Fire a hook for other extensions to listen for
                        $script .= "mediaWiki.hook( 
'centralauth-p-personal-reset' ).fire();";

-- 
To view, visit https://gerrit.wikimedia.org/r/74485
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4191e76c153bcbcf62a14dd0986232255cff34a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Matmarex <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to