Index: branches/MwEmbedStandAlone/modules/AddMedia/searchLibs/mediaWikiSearch.js |
— | — | @@ -135,16 +135,17 @@ |
136 | 136 | // Build the image request |
137 | 137 | var request = { |
138 | 138 | 'action':'query', |
139 | | - 'generator':'search', |
140 | | - 'gsrsearch': search_query , |
141 | | - 'gsrnamespace':6, // (only search the "file" namespace (audio, video, images) |
142 | | - 'gsrwhat': 'text', |
143 | | - 'gsrlimit': this.provider.limit, |
144 | | - 'gsroffset': this.provider.offset, |
145 | | - 'prop':'imageinfo|revisions|categories', |
146 | | - 'iiprop':'url|mime|size|metadata', |
147 | | - 'iiurlwidth': parseInt( this.rsd.thumb_width ), |
148 | | - 'rvprop':'content' |
| 139 | + 'generator': 'search', |
| 140 | + 'gsrsearch': search_query , |
| 141 | + 'gsrnamespace': 6, // (only search the "file" namespace (audio, video, images) |
| 142 | + 'gsrwhat': 'text', |
| 143 | + 'gsrlimit': this.provider.limit, |
| 144 | + 'gsroffset': this.provider.offset, |
| 145 | + 'prop': 'imageinfo|revisions|categories', |
| 146 | + 'iiprop': 'url|mime|size|metadata', |
| 147 | + 'iiurlwidth': parseInt( this.rsd.thumb_width ), |
| 148 | + 'rvprop': 'content', |
| 149 | + 'redirects': ''; |
149 | 150 | }; |
150 | 151 | |
151 | 152 | // Do the api request: |
— | — | @@ -184,19 +185,12 @@ |
185 | 186 | for ( var page_id in data.query.pages ) { |
186 | 187 | var page = data.query.pages[ page_id ]; |
187 | 188 | |
188 | | - // Make sure the reop is shared (don't show for now it confusing things) |
| 189 | + // Make sure the repo is shared (don't show for now it confusing things) |
189 | 190 | // @@todo support remote repository better |
190 | 191 | if ( page.imagerepository == 'shared' ) { |
191 | 192 | continue; |
192 | 193 | } |
193 | 194 | |
194 | | - // Make sure the page is not a redirect |
195 | | - if ( page.revisions && page.revisions[0] && |
196 | | - page.revisions[0]['*'] && page.revisions[0]['*'].indexOf( '#REDIRECT' ) === 0 ) { |
197 | | - // skip page is redirect |
198 | | - continue; |
199 | | - } |
200 | | - |
201 | 195 | // Skip if its an empty or missing imageinfo: |
202 | 196 | if ( !page.imageinfo ){ |
203 | 197 | continue; |