Kji has submitted this change and it was merged.

Change subject: Resolved poor titleicon resolution and size issues.
......................................................................


Resolved poor titleicon resolution and size issues.

Titleicons can now be scaled beyond dimensions of 15x15 up to the original
icon dimensions without loss resolution.

Multiple titleicons will now all be rendered with the same dimensions.

Change-Id: I401f34d5f66539122c300976acc5479dbe88cfa0
---
M HierarchyBuilder.class.php
M HierarchyBuilder.php
M editHierarchy.js
3 files changed, 16 insertions(+), 17 deletions(-)

Approvals:
  Kji: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/HierarchyBuilder.class.php b/HierarchyBuilder.class.php
index c885ed5..f78683e 100644
--- a/HierarchyBuilder.class.php
+++ b/HierarchyBuilder.class.php
@@ -1021,7 +1021,7 @@
         * @return string: The html for rendering all of the titleicons.
         */
        public static function getIconHTML( $icons ) {
-               $iconhtml = "";
+               $iconhtmls = array();
                foreach ( $icons as $iconinfo ) {
 
                        $page = $iconinfo["page"];
@@ -1038,26 +1038,26 @@
                                //$frameParams['link-title'] = $page;
                                $frameParams['alt'] = $tooltip;
                                $frameParams['title'] = $tooltip;
-                               $handlerParams = array(
-                                       'width' => '15',
-                                       'height' => '15'
-                               );
+                               $handlerParams = array(); // this is where we 
might specify default height and width but that's not helping us
 
-                               $iconhtml .= Linker::makeImageLink( 
$GLOBALS['wgParser'],
-                                       $filetitle, $imagefile, $frameParams, 
$handlerParams ) .
-                                       " ";
+                               $iconhtmls[] = Linker::makeImageLink( 
$GLOBALS['wgParser'],
+                                       $filetitle, $imagefile, $frameParams, 
$handlerParams );
                        }
 
                }
 
-               //extract just the guts of just the img part of the html
-               $imgpattern = '/\<img (.*) \/\>/';
-               $numMatches = preg_match_all( $imgpattern, $iconhtml, $matches 
);
-               
-               // build the new image html thing
-               $iconhtml = '<img class=\"hierarchy_row_titleicon\" ' . 
$matches[1][0] . '/>';
+               $finaliconshtml = '';
+               foreach ( $iconhtmls as $iconhtml ){
+                       //extract just the guts of just the img part of the html
+                       $imgpattern = '/\<img (.*) \/\>/';
+                       $numMatches = preg_match_all( $imgpattern, $iconhtml, 
$matches );
+                       
+                       // build the new image html thing
+                       $finaliconshtml .= '<img 
class=\"hierarchy_row_titleicon\" ' . $matches[1][0] . '/>';
 
-               return $iconhtml;
+               }
+               
+               return $finaliconshtml;
        }
 
        /**
diff --git a/HierarchyBuilder.php b/HierarchyBuilder.php
index 192b05c..fbc7f6c 100644
--- a/HierarchyBuilder.php
+++ b/HierarchyBuilder.php
@@ -46,7 +46,7 @@
 $wgExtensionCredits['parserhook'][] = array (
        'path' => __FILE__,
        'name' => 'HierarchyBuilder',
-       'version' => '1.9.1',
+       'version' => '1.9.2',
        'author' => array(
                '[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy 
Cicalese]',
                '[https://www.mediawiki.org/wiki/User:Kevin.ji Kevin Ji]'
diff --git a/editHierarchy.js b/editHierarchy.js
index dcc3325..888827e 100644
--- a/editHierarchy.js
+++ b/editHierarchy.js
@@ -125,7 +125,6 @@
                                        return;
                                }
                                if ( params.hideinfo == "true" ) {
-                                       console.log("[editHierarchy.js][init] " 
+ "I'm here!");
                                        var button = $("#showinfo")[0];
                                        button.onclick = function() { 
                                                /*if (button.text == "Show 
Info") {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I401f34d5f66539122c300976acc5479dbe88cfa0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/HierarchyBuilder
Gerrit-Branch: master
Gerrit-Owner: Kji <[email protected]>
Gerrit-Reviewer: Kji <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to