Legoktm has uploaded a new change for review.

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

Change subject: [WIP] toolbar thing
......................................................................

[WIP] toolbar thing

Change-Id: Ia646c9554d2434342b414e53ab99b437002ee2e8
---
M UrlShortener.hooks.php
M UrlShortener.php
A modules/ext.urlShortener.toolbar.js
3 files changed, 29 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UrlShortener 
refs/changes/14/227414/1

diff --git a/UrlShortener.hooks.php b/UrlShortener.hooks.php
index 6e881e1..dd8cf52 100644
--- a/UrlShortener.hooks.php
+++ b/UrlShortener.hooks.php
@@ -25,6 +25,10 @@
                return true;
        }
 
+       public static function onBeforePageDisplay( OutputPage $out ) {
+               $out->addModules( 'ext.urlShortener.toolbar' );
+       }
+
        /**
         * @param $du DatabaseUpdater
         * @return bool
diff --git a/UrlShortener.php b/UrlShortener.php
index 285f931..3d4165e 100644
--- a/UrlShortener.php
+++ b/UrlShortener.php
@@ -115,6 +115,7 @@
 
 $wgHooks['LoadExtensionSchemaUpdates'][] = 
'UrlShortenerHooks::onLoadExtensionSchemaUpdates';
 $wgHooks['WebRequestPathInfoRouter'][] = 
'UrlShortenerHooks::onWebRequestPathInfoRouter';
+$wgHooks['BeforePageDisplay'][] = 'UrlShortenerHooks::onBeforePageDisplay';
 
 $wgAPIModules['shortenurl'] = 'ApiShortenUrl';
 
@@ -138,3 +139,14 @@
                'mediawiki.Uri',
        ),
 );
+
+$wgResourceModules['ext.urlShortener.toolbar'] = array(
+       'scripts' => array(
+               'modules/ext.urlShortener.toolbar.js',
+       ),
+       'dependencies' => array(
+               'oojs-ui',
+       ),
+       'localBasePath' => __DIR__,
+       'remoteExtPath' => 'UrlShortener',
+);
diff --git a/modules/ext.urlShortener.toolbar.js 
b/modules/ext.urlShortener.toolbar.js
new file mode 100644
index 0000000..8d938d4
--- /dev/null
+++ b/modules/ext.urlShortener.toolbar.js
@@ -0,0 +1,13 @@
+( function ( mw, $, OO ) {
+       $( function () {
+               var progress = new OO.ui.ProgressBarWidget(),
+                       popup = new OO.ui.PopupWidget( {
+                               $content: progress.$element,
+                               padded: true,
+                               align: 'forwards'
+                       } );
+               $( '#t-print' ).append( popup.$element );
+               popup.toggle( true );
+       } );
+
+} )( mediaWiki, jQuery, OO );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia646c9554d2434342b414e53ab99b437002ee2e8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UrlShortener
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to