Index: trunk/extensions/SemanticImageInput/includes/InstantImageInput.php |
— | — | @@ -104,12 +104,7 @@ |
105 | 105 | } |
106 | 106 | else { |
107 | 107 | global $wgParser; |
108 | | - |
109 | | - $html .= $wgParser->parse( |
110 | | - '[[' . $cur_value . '|' . $width . ']]', |
111 | | - Title::newFromText( self::getPage() ), |
112 | | - ( new ParserOptions() ) |
113 | | - )->getText(); |
| 108 | + $html .= $wgParser->recursiveTagParse( '[[' . $cur_value . '|' . $width . 'px ]]' ); |
114 | 109 | } |
115 | 110 | } |
116 | 111 | |
— | — | @@ -139,15 +134,8 @@ |
140 | 135 | } |
141 | 136 | |
142 | 137 | protected static function getPage() { |
143 | | - $parts = explode( '/', $GLOBALS['wgTitle']->getFullText() ); |
144 | | - |
145 | | - // TODO: this will not work for non-en. |
146 | | - if ( $parts[0] == 'Special:FormEdit' ) { |
147 | | - array_shift( $parts ); |
148 | | - array_shift( $parts ); |
149 | | - } |
150 | | - |
151 | | - return implode( '/', $parts ); |
| 138 | + global $wgParser; |
| 139 | + return $wgParser->getTitle()->getFullText(); |
152 | 140 | } |
153 | 141 | |
154 | 142 | } |
Index: trunk/extensions/SemanticImageInput/resources/jquery.instantImage.js |
— | — | @@ -154,7 +154,7 @@ |
155 | 155 | |
156 | 156 | $this.html( $( '<img />' ).attr( { |
157 | 157 | 'src': info[i].thumburl, |
158 | | - 'width': settings.imagewidth + 'px' |
| 158 | + 'width': settings.imagewidth |
159 | 159 | } ) ); |
160 | 160 | |
161 | 161 | return; |
Index: trunk/extensions/SemanticImageInput/SemanticImageInput.php |
— | — | @@ -55,10 +55,7 @@ |
56 | 56 | |
57 | 57 | $wgAutoloadClasses['InstantImageInput'] = dirname( __FILE__ ) . '/includes/InstantImageInput.php'; |
58 | 58 | |
59 | | -$wgExtensionFunctions[] = function() { |
60 | | - global $sfgFormPrinter; |
61 | | - $sfgFormPrinter->registerInputType( 'InstantImageInput' ); |
62 | | -}; |
| 59 | +$wgExtensionFunctions[] = 'efSIISetup'; |
63 | 60 | |
64 | 61 | // Resource loader modules |
65 | 62 | $moduleTemplate = array( |
— | — | @@ -76,3 +73,9 @@ |
77 | 74 | unset( $moduleTemplate ); |
78 | 75 | |
79 | 76 | $egSIISettings = array(); |
| 77 | + |
| 78 | +function efSIISetup() { |
| 79 | + |
| 80 | + global $sfgFormPrinter; |
| 81 | + $sfgFormPrinter->registerInputType( 'InstantImageInput' ); |
| 82 | +} |
\ No newline at end of file |