[MediaWiki-commits] [Gerrit] largestImageWithURL convenience method on MWKArticleStore - change (apps...wikipedia)

2014-12-05 Thread Mhurd (Code Review)
Mhurd has submitted this change and it was merged.

Change subject: largestImageWithURL convenience method on MWKArticleStore
..


largestImageWithURL convenience method on MWKArticleStore

routes the input URL through the image list's largestVariant checker
so if we have a bigger image you can get it by feeding in your small
thumbnail gotten from other APIs

Change-Id: I53b0b423a357d5d4a7a81b4d0bdbb8eb75c1815e
---
M MediaWikiKit/MediaWikiKit/MWKArticleStore.h
M MediaWikiKit/MediaWikiKit/MWKArticleStore.m
M wikipedia/assets/preview.css
3 files changed, 8 insertions(+), 2 deletions(-)

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



diff --git a/MediaWikiKit/MediaWikiKit/MWKArticleStore.h 
b/MediaWikiKit/MediaWikiKit/MWKArticleStore.h
index 335a281..bf97b95 100644
--- a/MediaWikiKit/MediaWikiKit/MWKArticleStore.h
+++ b/MediaWikiKit/MediaWikiKit/MWKArticleStore.h
@@ -32,6 +32,8 @@
 
 @property (readonly) MWKImageList *imageList;
 -(MWKImage *)imageWithURL:(NSString *)url;
+-(MWKImage *)largestImageWithURL:(NSString *)url;
+
 -(NSData *)imageDataWithImage:(MWKImage *)image;
 -(UIImage *)UIImageWithImage:(MWKImage *)image;
 
diff --git a/MediaWikiKit/MediaWikiKit/MWKArticleStore.m 
b/MediaWikiKit/MediaWikiKit/MWKArticleStore.m
index dc3b598..b57b5ae 100644
--- a/MediaWikiKit/MediaWikiKit/MWKArticleStore.m
+++ b/MediaWikiKit/MediaWikiKit/MWKArticleStore.m
@@ -153,6 +153,11 @@
 return [self.dataStore imageWithURL:url title:self.title];
 }
 
+-(MWKImage *)largestImageWithURL:(NSString *)url
+{
+return [self.dataStore imageWithURL:[self.imageList 
largestImageVariant:url] title:self.title];
+}
+
 -(MWKImage *)importImageURL:(NSString *)url sectionId:(int)sectionId
 {
 [self.imageList addImageURL:url sectionId:sectionId];
diff --git a/wikipedia/assets/preview.css b/wikipedia/assets/preview.css
index 9b41fea..62aad36 100644
--- a/wikipedia/assets/preview.css
+++ b/wikipedia/assets/preview.css
@@ -1,2 +1 @@
-html,body,div,span,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,ins,em,img,small,strike,strong,sub,sup,tt,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,input,textarea,button,select,table,caption,tbody,tfoot,thead,tr,th,td,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;background:none;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}div#centralNotice{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}button{border:none;background-color:transparent}body{line-height:1;-webkit-tap-highlight-color:transparent}input{line-height:normal}ol,ul{list-style:none}table{border-collapse:collapse}html{-webkit-text-size-adjust:none;font-size:100%}body{font-family:Helvetica
 Neue,Helvetica,Nimbus Sans L,Arial,Liberation 
Sans,sans-serif;line-height:1.4;color:#252525;background:#fff}.content{line-height:1.65;margin:.8em
 16px 0;word-wrap:break-word}@media all and 
(max-width:280px){body{font-size:.8em}.content{margin:0 
12px}}.nomobile{display:none !important}.content .thumb{margin:.6em 0}.content 
.thumb .thumbinner{margin:0 auto;max-width:100%}.content .thumb .thumbinner  
div{float:none !important;width:auto !important;clear:both !important}.content 
.thumb .noresize{width:100%;overflow-x:auto}.content .thumb .noresize 
img{max-width:none !important}.content .thumbcaption{margin:.5em 0 
0;font-size:.8em;line-height:1.5;padding:0 !important;color:#555;width:auto 
!important}.content .thumbborder{border:1px solid #CCC}.content 
img{vertical-align:middle}.content .floatright{clear:right;float:right;margin:0 
0 .6em .6em}.content .floatleft{clear:left;float:left;margin:0 .6em .6em 
0}.content a  img{max-width:100% !important;height:auto !important}.content 
div.magnify{display:none}ul.gallery{list-style:none;max-width:100%}ul.gallery 
.gallerybox{display:inline-block;vertical-align:top;max-width:100%}ul.gallery 
.gallerybox .thumb img{display:block}ul.gallery .gallerybox  
div{max-width:100%}ul.gallery .gallerybox  div  
.thumb{max-width:100%}ul.gallery .gallerybox 
.gallerytext{overflow:hidden;padding:2px 
4px;word-wrap:break-word;font-size:.8em}#section_0{line-height:1.3}.content 
h1,.content h2,.content h3,.content h4,.content h5,.content 
h6{line-height:1.3;font-family:Linux 
Libertine,Georgia,Times,serif;padding:.5em 0}.pre-content h1,.content 
h1{font-family:Linux 
Libertine,Georgia,Times,serif;font-size:1.7em}h2{font-size:1.5em}h3{font-size:1.2em;font-weight:bold}h4{font-weight:bold}blockquote{font-family:Linux
 Libertine,Georgia,Times,serif;font-size:1.1em;quotes:\201C 
\201D;padding:1em 25px 1em 
30px;position:relative;overflow:hidden}blockquote:before{content:open-quote;font-size:3em;position:absolute;left:0;top:0}blockquote:after{content:close-quote;font-size:3em;line-height:1;position:absolute;right:0;bottom:0}.content
 ol ol,.content ol ul,.content ul 

[MediaWiki-commits] [Gerrit] largestImageWithURL convenience method on MWKArticleStore - change (apps...wikipedia)

2014-12-04 Thread Brion VIBBER (Code Review)
Brion VIBBER has uploaded a new change for review.

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

Change subject: largestImageWithURL convenience method on MWKArticleStore
..

largestImageWithURL convenience method on MWKArticleStore

routes the input URL through the image list's largestVariant checker
so if we have a bigger image you can get it by feeding in your small
thumbnail gotten from other APIs

Change-Id: I53b0b423a357d5d4a7a81b4d0bdbb8eb75c1815e
---
M MediaWikiKit/MediaWikiKit/MWKArticleStore.h
M MediaWikiKit/MediaWikiKit/MWKArticleStore.m
M wikipedia/assets/preview.css
3 files changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia 
refs/changes/77/177677/1

diff --git a/MediaWikiKit/MediaWikiKit/MWKArticleStore.h 
b/MediaWikiKit/MediaWikiKit/MWKArticleStore.h
index 335a281..bf97b95 100644
--- a/MediaWikiKit/MediaWikiKit/MWKArticleStore.h
+++ b/MediaWikiKit/MediaWikiKit/MWKArticleStore.h
@@ -32,6 +32,8 @@
 
 @property (readonly) MWKImageList *imageList;
 -(MWKImage *)imageWithURL:(NSString *)url;
+-(MWKImage *)largestImageWithURL:(NSString *)url;
+
 -(NSData *)imageDataWithImage:(MWKImage *)image;
 -(UIImage *)UIImageWithImage:(MWKImage *)image;
 
diff --git a/MediaWikiKit/MediaWikiKit/MWKArticleStore.m 
b/MediaWikiKit/MediaWikiKit/MWKArticleStore.m
index dc3b598..b57b5ae 100644
--- a/MediaWikiKit/MediaWikiKit/MWKArticleStore.m
+++ b/MediaWikiKit/MediaWikiKit/MWKArticleStore.m
@@ -153,6 +153,11 @@
 return [self.dataStore imageWithURL:url title:self.title];
 }
 
+-(MWKImage *)largestImageWithURL:(NSString *)url
+{
+return [self.dataStore imageWithURL:[self.imageList 
largestImageVariant:url] title:self.title];
+}
+
 -(MWKImage *)importImageURL:(NSString *)url sectionId:(int)sectionId
 {
 [self.imageList addImageURL:url sectionId:sectionId];
diff --git a/wikipedia/assets/preview.css b/wikipedia/assets/preview.css
index 9b41fea..62aad36 100644
--- a/wikipedia/assets/preview.css
+++ b/wikipedia/assets/preview.css
@@ -1,2 +1 @@
-html,body,div,span,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,ins,em,img,small,strike,strong,sub,sup,tt,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,input,textarea,button,select,table,caption,tbody,tfoot,thead,tr,th,td,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;background:none;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}div#centralNotice{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}button{border:none;background-color:transparent}body{line-height:1;-webkit-tap-highlight-color:transparent}input{line-height:normal}ol,ul{list-style:none}table{border-collapse:collapse}html{-webkit-text-size-adjust:none;font-size:100%}body{font-family:Helvetica
 Neue,Helvetica,Nimbus Sans L,Arial,Liberation 
Sans,sans-serif;line-height:1.4;color:#252525;background:#fff}.content{line-height:1.65;margin:.8em
 16px 0;word-wrap:break-word}@media all and 
(max-width:280px){body{font-size:.8em}.content{margin:0 
12px}}.nomobile{display:none !important}.content .thumb{margin:.6em 0}.content 
.thumb .thumbinner{margin:0 auto;max-width:100%}.content .thumb .thumbinner  
div{float:none !important;width:auto !important;clear:both !important}.content 
.thumb .noresize{width:100%;overflow-x:auto}.content .thumb .noresize 
img{max-width:none !important}.content .thumbcaption{margin:.5em 0 
0;font-size:.8em;line-height:1.5;padding:0 !important;color:#555;width:auto 
!important}.content .thumbborder{border:1px solid #CCC}.content 
img{vertical-align:middle}.content .floatright{clear:right;float:right;margin:0 
0 .6em .6em}.content .floatleft{clear:left;float:left;margin:0 .6em .6em 
0}.content a  img{max-width:100% !important;height:auto !important}.content 
div.magnify{display:none}ul.gallery{list-style:none;max-width:100%}ul.gallery 
.gallerybox{display:inline-block;vertical-align:top;max-width:100%}ul.gallery 
.gallerybox .thumb img{display:block}ul.gallery .gallerybox  
div{max-width:100%}ul.gallery .gallerybox  div  
.thumb{max-width:100%}ul.gallery .gallerybox 
.gallerytext{overflow:hidden;padding:2px 
4px;word-wrap:break-word;font-size:.8em}#section_0{line-height:1.3}.content 
h1,.content h2,.content h3,.content h4,.content h5,.content 
h6{line-height:1.3;font-family:Linux 
Libertine,Georgia,Times,serif;padding:.5em 0}.pre-content h1,.content 
h1{font-family:Linux 
Libertine,Georgia,Times,serif;font-size:1.7em}h2{font-size:1.5em}h3{font-size:1.2em;font-weight:bold}h4{font-weight:bold}blockquote{font-family:Linux
 Libertine,Georgia,Times,serif;font-size:1.1em;quotes:\201C 
\201D;padding:1em 25px 1em