[MediaWiki-commits] [Gerrit] mediawiki...restbase[master]: Fix duplicate pages in some on-this-day results.
Mhurd has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/402155 ) Change subject: Fix duplicate pages in some on-this-day results. .. Fix duplicate pages in some on-this-day results. Dupe examples: onthisday/events/09/14 "Telecommunications companies MCI Communications and WorldCom complete their $37 billion merger to form MCI WorldCom." onthisday/events/09/01 "St. Petersburg, Russia, changes its name to Petrograd." Bug: T175974 Change-Id: If3a6cfc7f4460f775663f64187ec3a540ee35549 --- M v1/onthisday.js 1 file changed, 17 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/restbase refs/changes/55/402155/1 diff --git a/v1/onthisday.js b/v1/onthisday.js index 1eca0fa..f5e2c8d 100644 --- a/v1/onthisday.js +++ b/v1/onthisday.js @@ -26,7 +26,23 @@ [req.params.type]: res.body[req.params.type] }; } -return super._hydrateResponse(hyper, req, res); +let hydratedResponse = super._hydrateResponse(hyper, req, res); + +// Hydration resolves re-directs so we need to de-dupe titles here *after* hydration. +const removeDuplicateTitlesFromHydratedResponsePages = (response) => { + Object.keys(response.body).forEach(key => { +response.body[key].forEach(event => { + event.pages = event.pages.filter( +(item1, index, self) => + self.findIndex(item2 => item2.title === item1.title) === index + ) +}); + }); +}; + +return hydratedResponse +.then(removeDuplicateTitlesFromHydratedResponsePages) +.thenReturn(hydratedResponse); } _makeFeedRequests(hyper, req) { -- To view, visit https://gerrit.wikimedia.org/r/402155 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3a6cfc7f4460f775663f64187ec3a540ee35549 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/restbase Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Fix "On this day" for "selected" for first days of months.
Mhurd has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/375407 ) Change subject: Fix "On this day" for "selected" for first days of months. .. Fix "On this day" for "selected" for first days of months. Change-Id: Ibdd0f98600188fcce68175212901a40126761ea9 --- M lib/feed/on-this-day.languages.js 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/07/375407/1 diff --git a/lib/feed/on-this-day.languages.js b/lib/feed/on-this-day.languages.js index 5fa67d9..ebff00f 100644 --- a/lib/feed/on-this-day.languages.js +++ b/lib/feed/on-this-day.languages.js @@ -85,8 +85,14 @@ }, selectedPage: { // https://fr.wikipedia.org/api/rest_v1/page/html/Wikipédia:Éphéméride%2F22_mai -nameFormatter : (monthName, monthNumber, dayNumber) => -`Wikipédia:Éphéméride/${dayNumber}_${monthName}`, +nameFormatter : (monthName, monthNumber, dayNumber) => { +if (dayNumber === 1) { +if (new Set([1, 2, 3, 5, 9, 10, 11, 12]).has(monthNumber)) { +dayNumber = '1er'; +} +} +return `Wikipédia:Éphéméride/${dayNumber}_${monthName}`; +}, listElementSelector: 'body > ul li' }, yearListElementRegEx : -- To view, visit https://gerrit.wikimedia.org/r/375407 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibdd0f98600188fcce68175212901a40126761ea9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Add Russian to 'On this day' endpoint.
Mhurd has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/373748 ) Change subject: Add Russian to 'On this day' endpoint. .. Add Russian to 'On this day' endpoint. Bug: T169274 Change-Id: I047ab65683757dcc0b0fa4fb6f92d1e665ba90c1 --- M lib/feed/on-this-day.languages.js M routes/on-this-day.js 2 files changed, 41 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/48/373748/1 diff --git a/lib/feed/on-this-day.languages.js b/lib/feed/on-this-day.languages.js index 06226a9..91787e1 100644 --- a/lib/feed/on-this-day.languages.js +++ b/lib/feed/on-this-day.languages.js @@ -9,7 +9,7 @@ ], dayPage : { // https://en.wikipedia.org/wiki/May_22 -nameFormatter : (monthName, dayNumber) => `${monthName}_${dayNumber}`, +nameFormatter : (monthName, monthNumber, dayNumber) => `${monthName}_${dayNumber}`, headingIds: { births: ['Births'], deaths: ['Deaths'], @@ -19,7 +19,7 @@ }, selectedPage : { // https://en.wikipedia.org/wiki/Wikipedia:Selected_anniversaries/May_22 -nameFormatter : (monthName, dayNumber) => +nameFormatter : (monthName, monthNumber, dayNumber) => `Wikipedia:Selected_anniversaries/${monthName}_${dayNumber}`, listElementSelector: 'body > ul li' }, @@ -33,7 +33,7 @@ ], dayPage : { // https://de.wikipedia.org/wiki/22._Mai -nameFormatter : (monthName, dayNumber) => `${dayNumber}._${monthName}`, +nameFormatter : (monthName, monthNumber, dayNumber) => `${dayNumber}._${monthName}`, headingIds: { births: ['Geboren'], deaths: ['Gestorben'], @@ -47,7 +47,7 @@ }, selectedPage: { // https://de.wikipedia.org/wiki/Wikipedia:Hauptseite/Jahrestage/Mai/22 -nameFormatter : (monthName, dayNumber) => +nameFormatter : (monthName, monthNumber, dayNumber) => `Wikipedia:Hauptseite/Jahrestage/${monthName}/${dayNumber}`, listElementSelector: 'body > ul li' }, @@ -61,7 +61,7 @@ ], dayPage : { // https://fr.wikipedia.org/wiki/22_mai -nameFormatter : (monthName, dayNumber) => { +nameFormatter : (monthName, monthNumber, dayNumber) => { if (dayNumber === 1) { dayNumber = '1er'; } @@ -76,7 +76,7 @@ }, selectedPage: { // https://fr.wikipedia.org/wiki/Wikip%C3%A9dia:%C3%89ph%C3%A9m%C3%A9ride/22_mai -nameFormatter : (monthName, dayNumber) => +nameFormatter : (monthName, monthNumber, dayNumber) => `Wikipédia:Éphéméride/${dayNumber}_${monthName}`, listElementSelector: 'body > ul li' }, @@ -91,7 +91,7 @@ dayPage : { // https://sv.wikipedia.org/wiki/22_maj // https://sv.wikipedia.org/api/rest_v1/page/html/22_maj -nameFormatter : (monthName, dayNumber) => `${dayNumber}_${monthName}`, +nameFormatter : (monthName, monthNumber, dayNumber) => `${dayNumber}_${monthName}`, headingIds: { births: ['F.C3.B6dda'], // Födda deaths: ['Avlidna'], @@ -102,7 +102,7 @@ selectedPage : { // https://sv.wikipedia.org/wiki/Mall:22_maj // https://sv.wikipedia.org/api/rest_v1/page/html/Mall:22_maj -nameFormatter : (monthName, dayNumber) => `Mall:${dayNumber}_${monthName}`, +nameFormatter : (monthName, monthNumber, dayNumber) => `Mall:${dayNumber}_${monthName}`, listElementSelector: 'body > ul li' }, yearListElementRegEx : /^\s*(\d+)\s*(f\.Kr\.)?\s*–\s(.+)/i @@ -115,7 +115,7 @@ ], dayPage : { // https://pt.wikipedia.org/wiki/15_de_maio -nameFormatter : (monthName, dayNumber) => `${dayNumber}_${monthName}`, +nameFormatter : (monthName, monthNumber, dayNumber) => `${dayNumber}_${monthName}`, headingIds: { births: ['Nascimentos'], deaths: ['Mortes', 'Falecimentos'], @@ -125,11 +125,36 @@ }, selectedPage : { // https://pt.wikipedia.org/wiki/Wikipédia:Efemérides/15_de_maio -nameFormatter : (monthName, dayNumber) => +nameFormatter : (monthName, monthNumber, dayNumber) => `Wikipédia:Efemérides/${dayNumber}_${monthName}`, listElementSelector: 'body > ul li' }, yearListElementRegEx : /^\s*(\d+)\s*(a\.C\.)?\s*[\u002D\u2013\u2014\u2212]\s(.+)/i +}, + +ru: { +monthNames : [ +'января', 'февраля', 'м
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Add Portuguese to on this day endpoint.
Mhurd has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/373159 ) Change subject: Add Portuguese to on this day endpoint. .. Add Portuguese to on this day endpoint. Change-Id: Ifc3716e80f8ddb2d30a2778b84a30c9cd5672501 --- M lib/feed/on-this-day.languages.js 1 file changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/59/373159/1 diff --git a/lib/feed/on-this-day.languages.js b/lib/feed/on-this-day.languages.js index 499e506..06226a9 100644 --- a/lib/feed/on-this-day.languages.js +++ b/lib/feed/on-this-day.languages.js @@ -106,6 +106,30 @@ listElementSelector: 'body > ul li' }, yearListElementRegEx : /^\s*(\d+)\s*(f\.Kr\.)?\s*–\s(.+)/i +}, + +pt: { +monthNames : [ +'de janeiro', 'de fevereiro', 'de março', 'de abril', 'de maio', 'de junho', +'de julho', 'de agosto', 'de setembro', 'de outubro', 'de novembro', 'de dezembro' +], +dayPage : { +// https://pt.wikipedia.org/wiki/15_de_maio +nameFormatter : (monthName, dayNumber) => `${dayNumber}_${monthName}`, +headingIds: { +births: ['Nascimentos'], +deaths: ['Mortes', 'Falecimentos'], +events: ['Eventos', 'Eventos_hist.C3.B3ricos'], +holidays: ['Feriados_e_eventos_c.C3.ADclicos'] +} +}, +selectedPage : { +// https://pt.wikipedia.org/wiki/Wikipédia:Efemérides/15_de_maio +nameFormatter : (monthName, dayNumber) => +`Wikipédia:Efemérides/${dayNumber}_${monthName}`, +listElementSelector: 'body > ul li' +}, +yearListElementRegEx : /^\s*(\d+)\s*(a\.C\.)?\s*[\u002D\u2013\u2014\u2212]\s(.+)/i } }; -- To view, visit https://gerrit.wikimedia.org/r/373159 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifc3716e80f8ddb2d30a2778b84a30c9cd5672501 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Fix 'year page' identification bug.
Mhurd has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372909 ) Change subject: Fix 'year page' identification bug. .. Fix 'year page' identification bug. Fixes issue causing some events to appear without any associated pages. bug T169277 Change-Id: Ia8e824c43995ce478679ade0ee94359f48ecce3b --- M routes/on-this-day.js M test/features/onthisday/on-this-day.js 2 files changed, 47 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/09/372909/1 diff --git a/routes/on-this-day.js b/routes/on-this-day.js index 6ef9f10..99e06e3 100644 --- a/routes/on-this-day.js +++ b/routes/on-this-day.js @@ -122,6 +122,17 @@ } /** + * Determines whether anchor is for specific year page. + * @param {!AnchorElement} anchor + * @param {!Integer} year + * @param {!String} era + * @return {!boolean} + */ +function isAnchorForYear(anchor, year, era) { +return new RegExp(`^${Math.abs(year)}\\s*${era}$`, 'i').test(anchor.title); +} + +/** * Converts document list element to WMFEvent model. * A regular expression determines valid "year list elements" and separating their components. * For example:'399 BC - Death of Socrates' @@ -146,21 +157,20 @@ } let year = parseInt(match[1], 10); - -// Negate BC years so they sort correctly const isBC = (match[2] !== undefined); +let era = ''; if (isBC) { +// Negate BC years so they sort correctly year = -year; +era = match[2]; } const textAfterYear = match[3].trim(); -function isAnchorNotForYear(anchor) { -return Math.abs(parseInt(anchor.title, 10)) !== Math.abs(year); -} - const pages = Array.from(listElement.querySelectorAll('a')) -.filter(isAnchorNotForYear) +.filter((anchor) => { +return !isAnchorForYear(anchor, year, era); +}) .map(wmfPageFromAnchorElement); return new WMFEvent(textAfterYear, pages, year); @@ -539,7 +549,8 @@ eventsForYearListElements, reverseChronologicalWMFEventComparator, hydrateAllTitles, -listElementsByHeadingID +listElementsByHeadingID, +isAnchorForYear } }; }; diff --git a/test/features/onthisday/on-this-day.js b/test/features/onthisday/on-this-day.js index 5c7232d..faf4f7a 100644 --- a/test/features/onthisday/on-this-day.js +++ b/test/features/onthisday/on-this-day.js @@ -450,4 +450,32 @@ const listElements = onThisDay.testing.listElementsByHeadingID(document, ['Births']); assert.ok(listElements.length === 208); }); + +describe('isAnchorForYear', () => { +const a = domino.createDocument().createElement('A'); +it('correctly identifies anchor linking to year article', () => { +a.title = '2008'; +assert.ok(onThisDay.testing.isAnchorForYear(a, 2008, '')); +}); +it('correctly rejects anchor linking article starting with a year', () => { +a.title = '2008 Something something'; +assert.ok(!onThisDay.testing.isAnchorForYear(a, 2008, '')); +}); +it('correctly rejects anchor linking article starting with a number', () => { +a.title = '123456 Something something'; +assert.ok(!onThisDay.testing.isAnchorForYear(a, 2008, '')); +}); +it('correctly rejects anchor linking article not starting with a year', () => { +a.title = 'Something something'; +assert.ok(!onThisDay.testing.isAnchorForYear(a, 2008, '')); +}); +it('correctly identifies anchor linking to year article with an era string', () => { +a.title = '2008 BC'; +assert.ok(onThisDay.testing.isAnchorForYear(a, 2008, 'BC')); +}); +it('correctly identifies anchor linking to year article with era string w/o space', () => { +a.title = '55BC'; +assert.ok(onThisDay.testing.isAnchorForYear(a, 55, 'BC')); +}); +}); }); -- To view, visit https://gerrit.wikimedia.org/r/372909 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8e824c43995ce478679ade0ee94359f48ecce3b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Add test for HTML in certain iOS announcement fields
Mhurd has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355865 ) Change subject: Add test for HTML in certain iOS announcement fields .. Add test for HTML in certain iOS announcement fields The iOS app doesn't support HTML in certain announcement fields. Not testing for this caused some HTML to accidentally appear uninterpreted in the latest iOS announcement. This was hotfixed here: https://gerrit.wikimedia.org/r/#/c/355734/ Bug: T166356 Change-Id: I34b48f52f53d92168264011b7bf452e26c12db8e --- M test/features/announcements/announcements.js M test/utils/testUtil.js 2 files changed, 36 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/65/355865/1 diff --git a/test/features/announcements/announcements.js b/test/features/announcements/announcements.js index 483a2a5..a03d3ac 100644 --- a/test/features/announcements/announcements.js +++ b/test/features/announcements/announcements.js @@ -4,6 +4,8 @@ const assert = require('../../utils/assert.js'); const server = require('../../utils/server.js'); const headers = require('../../utils/headers.js'); +const domino = require('domino'); +const testUtil = require('../../utils/testUtil.js'); describe('announcements', function() { @@ -51,4 +53,26 @@ assert.ok(res.body.announce.length === 0); }); }); + +it('should not deliver HTML in certain iOS announcements fields', () => { +const doc = domino.createDocument(); +return preq.get({ uri: `${server.config.uri}en.wikipedia.org/v1/feed/announcements` }) +.then((res) => { +assert.status(res, 200); +const iOSAnnouncements = res.body.announce + .filter(announcement => announcement.platforms.includes('iOSApp')); +const textOnlyFields = ['text', 'action.title']; +iOSAnnouncements.forEach((iOSAnnouncement) => { +textOnlyFields.forEach((textOnlyField) => { +const deepObj = testUtil.valueByDotNotation(iOSAnnouncement, textOnlyField); +const element = doc.createElement('div'); +element.innerHTML = deepObj; +// Comparing innerHTML and textContent lengths catches even non-tag html, +// such as ' '; +assert.equal(element.innerHTML.length, element.textContent.length, + `iOS does not support HTML in the "${textOnlyField}" field`); +}); +}); +}); +}); }); diff --git a/test/utils/testUtil.js b/test/utils/testUtil.js index 71a44d2..f22ff3b 100644 --- a/test/utils/testUtil.js +++ b/test/utils/testUtil.js @@ -16,4 +16,16 @@ dateUtil.pad(dateObj.getUTCDate())}`; }; +/** + * Dot notation for accessing deep object by a string path. + * See https://stackoverflow.com/a/29576764 + * @param {!Object} object the object on which to seek a deep object + * @param {!String} path dot notation path for the sought deep object: such as 'something' or + * 'something.stuff' or 'something[0].name' + */ +testUtil.valueByDotNotation = function(object, path) { +// eslint-disable-next-line no-new-func +return new Function('_', `return _.${path}`)(object); +}; + module.exports = testUtil; -- To view, visit https://gerrit.wikimedia.org/r/355865 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I34b48f52f53d92168264011b7bf452e26c12db8e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Removed some ES6 bits incompatible with production node vers...
Mhurd has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/330828 ) Change subject: Removed some ES6 bits incompatible with production node version. .. Removed some ES6 bits incompatible with production node version. Downgraded my local node version to 4.6.1 Meant I had to remove destructuring lines. Very sad. Was so much less verbose :( Also had to use Bluebird promise instead of plain ES6 promise in one spot. After we update production node we should probably revert this commit. Change-Id: If8d50f35b37fa8f3a433104785d12a7c53b33eea --- M routes/on-this-day.js 1 file changed, 14 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/28/330828/1 diff --git a/routes/on-this-day.js b/routes/on-this-day.js index ced5ad0..272c4d1 100644 --- a/routes/on-this-day.js +++ b/routes/on-this-day.js @@ -8,6 +8,7 @@ const dateUtil = require('../lib/dateUtil'); const mUtil = require('../lib/mobile-util'); const parsoid = require('../lib/parsoid-access'); +const BBPromise = require('bluebird'); let app; @@ -376,7 +377,9 @@ */ function fetchAndRespond(req, res, uriFunction, extractionFunction) { return fetchDocAndEtagRevision(req, uriFunction) -.then(([doc, etagRevision]) => { +.then(docAndEtagRevision => { +const doc = docAndEtagRevision[0]; +const etagRevision = docAndEtagRevision[1]; const output = extractionFunction(doc); endResponseWithOutput(res, output, req.params.domain, etagRevision); }); @@ -433,11 +436,19 @@ * Example: http://localhost:6927/en.wikipedia.org/v1/onthisday/all/01/30 */ router.get('/all/:mm/:dd', (req, res) => { -return Promise.all([ +return BBPromise.all([ fetchDocAndEtagRevision(req, uriForDayPageRequest), fetchDocAndEtagRevision(req, uriForSelectedPageRequest) ]) -.then(([[dayDoc, dayEtagRevision], [selectionsDoc, selectionsEtagRevision]]) => { +.then(docsAndEtagRevisions => { +const dayDocAndEtagRevision = docsAndEtagRevisions[0]; +const dayDoc = dayDocAndEtagRevision[0]; +const dayEtagRevision = dayDocAndEtagRevision[1]; + +const selectionsDocAndEtagRevision = docsAndEtagRevisions[1]; +const selectionsDoc = selectionsDocAndEtagRevision[0]; +const selectionsEtagRevision = selectionsDocAndEtagRevision[1]; + const etag = Math.max(dayEtagRevision, selectionsEtagRevision); const output = everythingInDayAndSelectionsDocs(dayDoc, selectionsDoc); endResponseWithOutput(res, output, req.params.domain, etag); -- To view, visit https://gerrit.wikimedia.org/r/330828 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8d50f35b37fa8f3a433104785d12a7c53b33eea Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/mobileapps Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...mobileapps[master]: Enwiki "On This Day" endpoints.
Mhurd has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/330820 ) Change subject: Enwiki "On This Day" endpoints. .. Enwiki "On This Day" endpoints. T143408 Endpoints: - 'births' - 'deaths' - 'events' - 'selected' - 'holidays' - 'all' Includes: - 'title hydration' - eTags Uses Parsoid html. Background: On enwiki there are pages for each day of the year such as: https://en.m.wikipedia.org/wiki/May_20 These pages contain lists of events, births, deaths and holidays. Editors also curate a smaller list of 'selected' items: https://en.m.wikipedia.org/wiki/Wikipedia%3ASelected_anniversaries%2FMay_20 Change-Id: I21565e73269b4ed5e717f692aebe2084401673a6 --- M lib/dateUtil.js M lib/mobile-util.js A routes/on-this-day.js A test/features/onthisday/onthisday.js 4 files changed, 864 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/20/330820/1 diff --git a/lib/dateUtil.js b/lib/dateUtil.js index 6c19363..1795509 100644 --- a/lib/dateUtil.js +++ b/lib/dateUtil.js @@ -9,6 +9,8 @@ const dateUtil = {}; +dateUtil.monthNames = monthNames; + dateUtil.ONE_DAY = 8640; /** diff --git a/lib/mobile-util.js b/lib/mobile-util.js index 11daa2c..eea6c6d 100644 --- a/lib/mobile-util.js +++ b/lib/mobile-util.js @@ -14,6 +14,8 @@ announcements: { name: 'announcements', version: '0.1.0' }, +onthisday: { name: 'onthisday', version: '0.1.0' }, + unpublished: { name: 'unpublished', version: '0.0.0' } }; diff --git a/routes/on-this-day.js b/routes/on-this-day.js new file mode 100644 index 000..ced5ad0 --- /dev/null +++ b/routes/on-this-day.js @@ -0,0 +1,473 @@ + +'use strict'; + +const domino = require('domino'); +const sUtil = require('../lib/util'); +const router = sUtil.router(); +const preq = require('preq'); +const dateUtil = require('../lib/dateUtil'); +const mUtil = require('../lib/mobile-util'); +const parsoid = require('../lib/parsoid-access'); + +let app; + +/* eslint-disable arrow-parens, max-len */ + + +/** + * Gets English day page titles, which are formatted as follows: 'May_20' + * @param {String} monthNumberString String for month number ranging from '1' to '12' + * @param {String} dayNumberString String number for day of month + * @return {String} Day page title. Example, inputs ('5', '20') returns 'May_20' + */ +function titleForDayPageFromMonthDayNumberStrings(monthNumberString, dayNumberString) { +return `${dateUtil.monthNames[parseInt(monthNumberString) - 1]}_${parseInt(dayNumberString)}`; +} + + +/** + * Gets day page Parsoid URI for day pages such as https://en.m.wikipedia.org/wiki/May_20 + * @param {Request} req Request containing month (req.params.mm) and day (req.params.dd) number string params + * @return {String} Day page URI for month and day number. Example, input mm '5' dd '20 returns https://en.wikipedia.org/api/rest_v1/page/html/May_20 + */ +function uriForDayPageRequest(req) { +const date = titleForDayPageFromMonthDayNumberStrings(req.params.mm, req.params.dd); +return `https://${req.params.domain}/api/rest_v1/page/html/${date}`; +} + + +/** + * Gets selected page Parsoid URI for selected pages such as https://en.m.wikipedia.org/wiki/Wikipedia%3ASelected_anniversaries%2FMay_20 + * ( These pages are also where 'Today' page https://en.m.wikipedia.org/wiki/Wikipedia:On_this_day/Today content comes from ) + * @param {Request} req Request containing month (req.params.mm) and day (req.params.dd) number string params + * @return {String} Selected page URI for month and day number. Example, input mm '5' dd '20 returns https://en.wikipedia.org/api/rest_v1/page/html/Wikipedia%3ASelected_anniversaries%2FMay_20 + */ +function uriForSelectedPageRequest(req) { +const date = titleForDayPageFromMonthDayNumberStrings(req.params.mm, req.params.dd); +return `https://${req.params.domain}/api/rest_v1/page/html/Wikipedia%3ASelected_anniversaries%2F${date}`; +} + + +/** + * WMFPage models a link to a page + * @param {String} title Page title, i.e. 'Goat' + * @param {Boolean}isTopic Events can have multiple links to pages, if this particular link is bolded, such as those seen on https://en.m.wikipedia.org/wiki/Wikipedia:On_this_day/Today, isTopic will be true. + */ +class WMFPage { +constructor(title, isTopic) { +this.title = title; +this.isTopic = isTopic; +} +} + + +/** + * WMFEvent models an historical event + * @param {String} textEvent description + * @param {Array} pages Array of WMFPage's for the event + * @param {String} yearYear. As string because some events occured 'BC', sometimes also denoted 'BCE' - i.e. '32 BC' or '200 BCE' + */ +class WMFEvent { +constructor(text, pages, year) { +this.text = text; +this.pages = pages; +this.year = year; +} +} +
[MediaWiki-commits] [Gerrit] WIP: Inital route for getting a single "higher quality" rand... - change (mediawiki...mobileapps)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/288463 Change subject: WIP: Inital route for getting a single "higher quality" random result. .. WIP: Inital route for getting a single "higher quality" random result. More soon. Change-Id: I54f8dde6d6c6acd8b4f5b92f985a2b66e2bd61e0 --- A routes/random-card-single.js 1 file changed, 168 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps refs/changes/63/288463/1 diff --git a/routes/random-card-single.js b/routes/random-card-single.js new file mode 100644 index 000..2215fba --- /dev/null +++ b/routes/random-card-single.js @@ -0,0 +1,168 @@ +/** +* random-card-single returns information about single random article suited +* to card-type presentations. +*/ + +'use strict'; + +var BBPromise = require('bluebird'); +var mwapi = require('../lib/mwapi'); +var sUtil = require('../lib/util'); + +/** +* The main router object +*/ +var router = sUtil.router(); + +/** +* The main application object reported when this module is require()d +*/ +var app; + +var maxExtractLength = 512; + +/** +* relativeScoreForResult returns a numeric score which can be used to +* roughly determine the relative "quality" of random results. +* +* Scores are calculated as follows: +* +* 2 points for having: +* thumb url +* +* 1 point for having: +* wikidataDescription +* +* -10 point for being: +* disambiguation page +* list item page +* +* 0.0 to 1.0 point for extract length based on: +* ratio of extract chars to max possible extract chars: (ie 256 chars / 512 max chars = 0.5) +* this is used primarily as a tie-breaker as it can give a slight edge to results +* having slightly longer extracts +* +*/ +function relativeScoreForResult(result) { + var hasThumbURL = result.thumbnail ? ("source" in result.thumbnail) : false; + var hasWikidataDescription = result.terms ? ("description" in result.terms) : false; + var isDisambiguationPage = result.pageprops ? ("disambiguation" in result.pageprops) : false; + var hasExtract = ("extract" in result); + var isListItemPage = false; + + if(hasWikidataDescription){ +if(!isDisambiguationPage){ + //HAX: the "disambiguation" flag is sometimes not set, so do backup wikidata description check. enwiki specific. + if (result.terms.description[0].indexOf("disambiguation page") > -1) { +isDisambiguationPage = true; + } +} +//HAX: there is no "list item" flag, so do wikidata description check. enwiki specific. +if(result.terms.description[0].indexOf("Wikimedia list article") > -1){ + isListItemPage = true; +} + } + + var score = 0.0; + if(hasThumbURL){ +score += 2.0; + } + if(hasWikidataDescription){ +score += 1.0; + } + if(isDisambiguationPage || isListItemPage){ +score -= 10.0; + } + + if(hasExtract){ +var extractLength = result.extract.length; +if (extractLength > maxExtractLength){ + extractLength = maxExtractLength +} +score += extractLength / maxExtractLength; + } + return score; +} + +function sortResultsByScore(results) { + results.sort(function(a, b){ +return (b.score - a.score); + }); +} + +function cleanResult(result){ + delete result["score"]; + var hasWikidataDescription = result.terms ? ("description" in result.terms) : false; + if (hasWikidataDescription) { +result["description"] = result.terms.description[0]; +delete result["terms"]; + }else{ +result["description"] = ""; + } +} + +/** +* GET {domain}/v1/page/random/card/single +* Returns a single random result well suited to card-type layouts, i.e. +* one likely to have an image url, text extract and wikidata description. +* +* Multiple random items are requested, but only the result having +* the highest relative score is returned. Requesting about 12 items +* seems to consistently produce a really "good" result. +*/ + +router.get('/random/card/single', function (req, res) { + + var itemsToRequest = 12; + return mwapi.apiGet(app, req, { +"action": "query", +"format": "json", +"formatversion": 2, +"exchars": maxExtractLength, +"exintro": "1", +"exlimit": itemsToRequest, +"explaintext": "", +"generator": "random", +"grnfilterredir": "nonredirects", +"grnlimit": itemsToRequest, +"grnnamespace": "0", +"pilimit": itemsToRequest, +"piprop": "thumbnail", +"pithumbsize": "640", +"prop": "extracts|pageterms|pageimages", +"wbptterms": "description" + }).then(function (response) { +mwapi.checkResponseStatus(response); +res.status(200); + +var scoredResults = response.body.query.pages.map(function(result) { + result.score = relativeScoreForResult(result); + return result; +}); + +sortResultsByScore(scoredResults); + +console.log("\n\n"); +console.log("RESULTS - SCORED"); +console.log(scoredResults); +conso
[MediaWiki-commits] [Gerrit] WIP - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/225362 Change subject: WIP .. WIP - Makes native article view request only first section html and all section titles. - When web view is shown full article is requested ONLY if non lead sections are found to be missing (as they will be if only the first section query has happended). If all sections are found to be cached, the cached article is shown w/o making additional network requests. Change-Id: I440517cc2546bececb85a6dff0b165a7507ff4b9 --- M MediaWikiKit/MediaWikiKit/MWKArticle.m M MediaWikiKit/MediaWikiKit/MWKDataStore.m M Wikipedia/Networking/Fetchers/ArticleFetcher.h M Wikipedia/Networking/Fetchers/ArticleFetcher.m M Wikipedia/Networking/Fetchers/SavedArticlesFetcher.m M Wikipedia/UI-V5/WMFArticleFetcher.h M Wikipedia/UI-V5/WMFArticleFetcher.m M Wikipedia/UI-V5/WMFArticleViewController.m M Wikipedia/View Controllers/WebView/WebViewController.m 9 files changed, 33 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/62/225362/1 diff --git a/MediaWikiKit/MediaWikiKit/MWKArticle.m b/MediaWikiKit/MediaWikiKit/MWKArticle.m index 2a7d120..592866e 100644 --- a/MediaWikiKit/MediaWikiKit/MWKArticle.m +++ b/MediaWikiKit/MediaWikiKit/MWKArticle.m @@ -338,7 +338,15 @@ } - (BOOL)isCached { -return [self.sections count] > 0 ? YES : NO; +BOOL hasNilSection = NO; +for (MWKSection* section in self.sections) { +if (section.text == nil) { +hasNilSection = YES; +break; +} +} + +return [self.sections count] == 0 || hasNilSection ? NO : YES; } - (MWKImage*)thumbnail { diff --git a/MediaWikiKit/MediaWikiKit/MWKDataStore.m b/MediaWikiKit/MediaWikiKit/MWKDataStore.m index 60ad5c0..c8ec3a7 100644 --- a/MediaWikiKit/MediaWikiKit/MWKDataStore.m +++ b/MediaWikiKit/MediaWikiKit/MWKDataStore.m @@ -291,9 +291,7 @@ NSError* err; NSString* html = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&err]; if (err) { -@throw [NSException exceptionWithName:@"MWKDataStoreException" - reason:err.description - userInfo:@{@"filePath": filePath, @"err": err}]; +return nil; } return html; diff --git a/Wikipedia/Networking/Fetchers/ArticleFetcher.h b/Wikipedia/Networking/Fetchers/ArticleFetcher.h index a066d39..93093b8 100644 --- a/Wikipedia/Networking/Fetchers/ArticleFetcher.h +++ b/Wikipedia/Networking/Fetchers/ArticleFetcher.h @@ -10,6 +10,7 @@ - (AFHTTPRequestOperation*)fetchSectionsForTitle:(MWKTitle*)title inDataStore:(MWKDataStore*)store +fetchLeadSectionOnly:(BOOL)fetchLeadSectionOnly withManager:(AFHTTPRequestOperationManager*)manager progressBlock:(WMFProgressHandler)progress completionBlock:(WMFArticleHandler)completion diff --git a/Wikipedia/Networking/Fetchers/ArticleFetcher.m b/Wikipedia/Networking/Fetchers/ArticleFetcher.m index 2f5a529..a8af8f3 100644 --- a/Wikipedia/Networking/Fetchers/ArticleFetcher.m +++ b/Wikipedia/Networking/Fetchers/ArticleFetcher.m @@ -23,6 +23,7 @@ @interface ArticleFetcher () @property (nonatomic, assign, readwrite) BOOL sendUsageReports; +@property (nonatomic, assign, readwrite) BOOL fetchLeadSectionOnly; @end @@ -30,6 +31,7 @@ - (AFHTTPRequestOperation*)fetchSectionsForTitle:(MWKTitle*)title inDataStore:(MWKDataStore*)store +fetchLeadSectionOnly:(BOOL)fetchLeadSectionOnly withManager:(AFHTTPRequestOperationManager*)manager progressBlock:(WMFProgressHandler)progress completionBlock:(WMFArticleHandler)completion @@ -38,6 +40,7 @@ NSAssert(store != nil, @"Store nil"); NSAssert(manager != nil, @"Manager nil"); +self.fetchLeadSectionOnly = fetchLeadSectionOnly; if (!title.text) { return nil; } @@ -130,6 +133,10 @@ @"thumb", @"description", @"image"]) }.mutableCopy; +if (self.fetchLeadSectionOnly) { +params[@"sections"] = @0; +} + return params; } diff --git a/Wikipedia/Networking/Fetchers/SavedArticlesFetcher.m b/Wikipedia/Networking/Fetchers/SavedArticlesFetcher.m index 354401d..1eaa1f6 100644 --- a/Wikipedia/Networking/Fetchers/SavedArticlesFetcher.m +++ b/Wikipedia/Networking/Fetchers/SavedArticlesFetcher.m @@ -62,7 +62,7 @@ ArticleFetcher* fetcher = [[ArticleFetcher alloc] init]; self.fetchersByArticleTitle[entry.title] = fetcher; -[fetcher fetchS
[MediaWiki-commits] [Gerrit] Fix share button on web view. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/224527 Change subject: Fix share button on web view. .. Fix share button on web view. Bug: T105381 Change-Id: I2ce4b94f1b433facdf94ac266d753d739b399325 --- M Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.h M Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.m M Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.h M Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.m M Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.m M Wikipedia/View Controllers/WebView/WebViewController.m 6 files changed, 53 insertions(+), 34 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/27/224527/1 diff --git a/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.h b/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.h index 09a45d2..34f783e 100644 --- a/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.h +++ b/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.h @@ -4,5 +4,6 @@ @interface WMFShareCardImageContainer : UIView @property (strong, nonatomic) MWKImage* leadImage; +@property (strong, nonatomic) UIImage* image; @end diff --git a/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.m b/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.m index f021615..24e24b9 100644 --- a/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.m +++ b/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.m @@ -26,11 +26,11 @@ CGRect focalBounds = self.leadImage.isDownloaded ? [self getPrimaryFocalRectFromCanonicalLeadImage] : CGRectZero; -[[self.leadImage asUIImage] wmf_drawInRect:rect - focalBounds:focalBounds -focalHighlight:NO - blendMode:kCGBlendModeMultiply - alpha:1.0]; +[self.image wmf_drawInRect:rect + focalBounds:focalBounds +focalHighlight:NO + blendMode:kCGBlendModeMultiply + alpha:1.0]; } // TODO: in follow-up patch, factor drawGradientBackground from diff --git a/Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.h b/Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.h index 8a2a69a..b9b542f 100644 --- a/Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.h +++ b/Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.h @@ -10,5 +10,5 @@ @interface WMFShareCardViewController : UIViewController -- (void)fillCardWithMWKArticle:(MWKArticle*)article snippet:(NSString*)snippet; +- (void)fillCardWithMWKArticle:(MWKArticle*)article snippet:(NSString*)snippet image:(UIImage*)image; @end diff --git a/Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.m b/Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.m index df00ba5..03d55ce 100644 --- a/Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.m +++ b/Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.m @@ -39,7 +39,7 @@ [super didReceiveMemoryWarning]; } -- (void)fillCardWithMWKArticle:(MWKArticle*)article snippet:(NSString*)snippet { +- (void)fillCardWithMWKArticle:(MWKArticle*)article snippet:(NSString*)snippet image:(UIImage*)image { // The layout system will transpose the Wikipedia logo, CC-BY-SA, // title, and Wikidata description for congruence with the lead // image's title and description, which is determined by system @@ -62,6 +62,7 @@ BOOL leadImageCached = [article.image.largestCachedVariant isDownloaded]; if (leadImageCached) { // in case the image has transparency, make its container white +self.shareCardImageContainer.image = image; self.shareCardImageContainer.backgroundColor = [UIColor whiteColor]; self.shareCardImageContainer.leadImage = article.image.largestCachedVariant; } diff --git a/Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.m b/Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.m index 3504d48..2fecfe6 100644 --- a/Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.m +++ b/Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.m @@ -14,6 +14,8 @@ #import "NSString+Extras.h" #import "NSString+WMFHTMLParsing.h" #import "MWKArticle+WMFSharing.h" +#import "Wikipedia-Swift.h" +#import "PromiseKit.h" @interface WMFShareOptionsViewController () @@ -63,12 +65,10 @@ return nil; } -_delegate = delegate; -_article= article; -_shareTitle = [article.title.text copy]; - -WMFShareCardViewController* cardViewController = -[[WMFShareCa
[MediaWiki-commits] [Gerrit] WIP - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/224013 Change subject: WIP .. WIP -Removed native tracking views from bottom of web view. -Moved read-more to bottom of native article table. -Made read-more use "morelike:"! -Moved article history pencil button to web view toolbar. -Removed back and forward buttons from web view toolbar. Change-Id: I0cd269bead51e2bb685bec48abf1454793c3c8b7 --- M Wikipedia.xcodeproj/project.pbxproj M Wikipedia/UI-V5/UIButton+WMFButton.h M Wikipedia/UI-V5/UIButton+WMFButton.m A Wikipedia/UI-V5/WMFArticleReadMoreCell.h A Wikipedia/UI-V5/WMFArticleReadMoreCell.m M Wikipedia/UI-V5/WMFArticleViewController.m M Wikipedia/UI-V5/WMFArticleViewController.storyboard M Wikipedia/UI-V5/WMFSearchFetcher.h M Wikipedia/UI-V5/WMFSearchFetcher.m M Wikipedia/View Controllers/TableOfContents/TOCViewController.m D Wikipedia/View Controllers/WebView/Footer/SubFooters/Legal/WMFLegalFooterViewController.h D Wikipedia/View Controllers/WebView/Footer/SubFooters/Legal/WMFLegalFooterViewController.m D Wikipedia/View Controllers/WebView/Footer/SubFooters/Legal/WMFLegalFooterViewController.xib D Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.h D Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.m D Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.xib D Wikipedia/View Controllers/WebView/Footer/SubFooters/ReadMore/WMFReadMoreViewController.h D Wikipedia/View Controllers/WebView/Footer/SubFooters/ReadMore/WMFReadMoreViewController.m D Wikipedia/View Controllers/WebView/Footer/SubFooters/ReadMore/WMFReadMoreViewController.xib D Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.h D Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.m D Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.xib D Wikipedia/View Controllers/WebView/WMFWebViewFooterContainerView.h D Wikipedia/View Controllers/WebView/WMFWebViewFooterContainerView.m M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/View Controllers/WebView/WebViewController_Private.h 26 files changed, 227 insertions(+), 902 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/13/224013/1 diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index 02360c9..faecbe7 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -78,15 +78,6 @@ 047E74141860509000916964 /* SavedPagesResultPrototypeView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 047E74131860509000916964 /* SavedPagesResultPrototypeView.xib */; }; 047E95511996DD030046A122 /* NearbyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 047E954E1996DD030046A122 /* NearbyViewController.m */; }; 047ED63918C13E4900442BE3 /* PreviewWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 047ED63818C13E4900442BE3 /* PreviewWebView.m */; }; - 0480AE871AA4E61000A9950C /* WMFLegalFooterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0480AE7D1AA4E61000A9950C /* WMFLegalFooterViewController.m */; }; - 0480AE891AA4E61000A9950C /* WMFLegalFooterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0480AE7E1AA4E61000A9950C /* WMFLegalFooterViewController.xib */; }; - 0480AE8B1AA4E61000A9950C /* WMFOptionsFooterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0480AE811AA4E61000A9950C /* WMFOptionsFooterViewController.m */; }; - 0480AE8D1AA4E61000A9950C /* WMFOptionsFooterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0480AE821AA4E61000A9950C /* WMFOptionsFooterViewController.xib */; }; - 0480AE8F1AA4E61000A9950C /* WMFReadMoreViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0480AE851AA4E61000A9950C /* WMFReadMoreViewController.m */; }; - 0480AE911AA4E61000A9950C /* WMFReadMoreViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0480AE861AA4E61000A9950C /* WMFReadMoreViewController.xib */; }; - 0480AE961AA4E65D00A9950C /* WMFWebViewFooterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0480AE941AA4E65D00A9950C /* WMFWebViewFooterViewController.m */; }; - 0480AE981AA4E65D00A9950C /* WMFWebViewFooterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0480AE951AA4E65D00A9950C /* WMFWebViewFooterViewController.xib */; }; - 0480AE9C1AA4F01600A9950C /* WMFWebViewFooterContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0480AE9B1AA4F01600A9950C /* WMFWebViewFooterContainerView.m */; }; 0480AEA01AA4F4DA00A9950C /* WMFIntrinsicContentSizeAware
[MediaWiki-commits] [Gerrit] WIP - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/223224 Change subject: WIP .. WIP To use: - perform search - tap the heart on a search result then tap read - repeat for a dozen or so articles - restart the app - then tap on the blue border around an article to see native article view - you will have to drag this blue border to collapse the native view - will need to disable the native article view table scrolling when collapsed to fix this Todo: - some old attributed strings code was copied over from old native lead image code - will need to clean it up. - needs i18n - decide how much of first paragraph we want show... showing all right now, using share-a-fact snippet extraction code presently - other stuff Change-Id: Ibe4d4f8eca89afddb904431e5708f9b6b8823044 --- M Wikipedia.xcodeproj/project.pbxproj M Wikipedia/AppDelegate.m A Wikipedia/UI-V5/LeadImageTitleAttributedString.h A Wikipedia/UI-V5/LeadImageTitleAttributedString.m M Wikipedia/UI-V5/PageHistoryViewController.storyboard A Wikipedia/UI-V5/WMFArticleExtractCell.h A Wikipedia/UI-V5/WMFArticleExtractCell.m M Wikipedia/UI-V5/WMFArticleListCollectionViewController.m A Wikipedia/UI-V5/WMFArticleSectionCell.h A Wikipedia/UI-V5/WMFArticleSectionCell.m A Wikipedia/UI-V5/WMFArticleSectionHeaderCell.h A Wikipedia/UI-V5/WMFArticleSectionHeaderCell.m A Wikipedia/UI-V5/WMFArticleTableHeaderView.h A Wikipedia/UI-V5/WMFArticleTableHeaderView.m M Wikipedia/UI-V5/WMFArticleViewController.h M Wikipedia/UI-V5/WMFArticleViewController.m A Wikipedia/UI-V5/WMFArticleViewController.storyboard M Wikipedia/UI-V5/WMFArticleViewControllerContainerCell.m M Wikipedia/UI-V5/iPhone_Root.storyboard 19 files changed, 583 insertions(+), 164 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/24/223224/1 diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index f637d2c..c5a6de1 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -41,6 +41,8 @@ 0433263F1B0D3574009DB316 /* WMFArticleImageProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 0433263E1B0D3574009DB316 /* WMFArticleImageProtocol.m */; }; 0433542218A023FE009305F0 /* UIViewController+HideKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 0433542118A023FE009305F0 /* UIViewController+HideKeyboard.m */; }; 0433542618A093C5009305F0 /* UIView+RemoveConstraints.m in Sources */ = {isa = PBXBuildFile; fileRef = 0433542518A093C5009305F0 /* UIView+RemoveConstraints.m */; }; + 0436998E1B45B673002FD81D /* WMFArticleTableHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0436998D1B45B673002FD81D /* WMFArticleTableHeaderView.m */; }; + 043699911B45B68D002FD81D /* WMFArticleSectionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 043699901B45B68D002FD81D /* WMFArticleSectionCell.m */; }; 0439317619FB092600386E8F /* UIWebView+LoadAssetsHtml.m in Sources */ = {isa = PBXBuildFile; fileRef = 0439317519FB092600386E8F /* UIWebView+LoadAssetsHtml.m */; }; 043B6E8E1ACDE0CF0005C60B /* NSAttributedString+WMFSavedPagesAttributedStrings.m in Sources */ = {isa = PBXBuildFile; fileRef = 043B6E8D1ACDE0CF0005C60B /* NSAttributedString+WMFSavedPagesAttributedStrings.m */; }; 043B6E8F1ACDE0CF0005C60B /* NSAttributedString+WMFSavedPagesAttributedStrings.m in Sources */ = {isa = PBXBuildFile; fileRef = 043B6E8D1ACDE0CF0005C60B /* NSAttributedString+WMFSavedPagesAttributedStrings.m */; }; @@ -67,6 +69,7 @@ 04616DFC1AE706C600815BCE /* WMFLocalizationProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 04616DFB1AE706C600815BCE /* WMFLocalizationProtocol.m */; }; 0462A6D11A1FE016009412D4 /* SearchResultAttributedString.m in Sources */ = {isa = PBXBuildFile; fileRef = 0462A6D01A1FE016009412D4 /* SearchResultAttributedString.m */; }; 0463639818A844570049EE4F /* KeychainCredentials.m in Sources */ = {isa = PBXBuildFile; fileRef = 0463639718A844570049EE4F /* KeychainCredentials.m */; }; + 04661DC81B4346C90045E970 /* WMFArticleViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 04661DC71B4346C90045E970 /* WMFArticleViewController.storyboard */; }; 046A4B9D1B38DC5400440F67 /* UIView+WMFRTLMirroring.m in Sources */ = {isa = PBXBuildFile; fileRef = 046A4B9C1B38DC5400440F67 /* UIView+WMFRTLMirroring.m */; }; 046E2B6B1B31ED94008A99A6 /* UIButton+WMFButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 046E2B6A1B31ED94008A99A6 /* UIButton+WMFButton.m */; }; 046E2B6F1B3213BE008A99A6 /* UIBarButtonItem+WMFButtonConvenience.m in Sources */ = {isa = PBXBuildFile; fileRef = 046E2B6E1B3213BE008A99A6 /* UIBarButtonItem+WMFButtonConvenience.
[MediaWiki-commits] [Gerrit] WIP: Quick proof-of-concept for Read More w/o tracking nativ... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/221796 Change subject: WIP: Quick proof-of-concept for Read More w/o tracking native view. .. WIP: Quick proof-of-concept for Read More w/o tracking native view. Uses a custom nsurl protocol to add read more to bottom of article. Much less hacky than the current native tracking view, which has lots of issues. Change-Id: I13fe91495d8356739fcc9ded9732b4d31de71028 --- M Wikipedia.xcodeproj/project.pbxproj A Wikipedia/Protocols/WMFArticleReadMoreProtocol.h A Wikipedia/Protocols/WMFArticleReadMoreProtocol.m M Wikipedia/View Controllers/WebView/WebViewController.m 4 files changed, 152 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/96/221796/1 diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index 30633d4..c4eeb15 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -62,6 +62,7 @@ 0449E63518A9845C00D51524 /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0449E63418A9845C00D51524 /* LoginViewController.m */; }; 0449E63918AAA26A00D51524 /* NSHTTPCookieStorage+CloneCookie.m in Sources */ = {isa = PBXBuildFile; fileRef = 0449E63818AAA26A00D51524 /* NSHTTPCookieStorage+CloneCookie.m */; }; 044BD6B618849AD000FFE4BE /* SectionEditorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 044BD6B418849AD000FFE4BE /* SectionEditorViewController.m */; }; + 044D09A21B41FFD1003D244E /* WMFArticleReadMoreProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 044D09A11B41FFD1003D244E /* WMFArticleReadMoreProtocol.m */; }; 045AB8C31B1E15D9002839D7 /* NSURL+Extras.m in Sources */ = {isa = PBXBuildFile; fileRef = 045AB8C21B1E15D9002839D7 /* NSURL+Extras.m */; }; 045D872119FAD2FA0035C1F9 /* AboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 045D872019FAD2FA0035C1F9 /* AboutViewController.m */; }; 04616DFC1AE706C600815BCE /* WMFLocalizationProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 04616DFB1AE706C600815BCE /* WMFLocalizationProtocol.m */; }; @@ -503,6 +504,8 @@ 0449E63818AAA26A00D51524 /* NSHTTPCookieStorage+CloneCookie.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSHTTPCookieStorage+CloneCookie.m"; sourceTree = ""; }; 044BD6B318849AD000FFE4BE /* SectionEditorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SectionEditorViewController.h; sourceTree = ""; }; 044BD6B418849AD000FFE4BE /* SectionEditorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SectionEditorViewController.m; sourceTree = ""; }; + 044D09A01B41FFD1003D244E /* WMFArticleReadMoreProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WMFArticleReadMoreProtocol.h; path = Wikipedia/Protocols/WMFArticleReadMoreProtocol.h; sourceTree = SOURCE_ROOT; }; + 044D09A11B41FFD1003D244E /* WMFArticleReadMoreProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WMFArticleReadMoreProtocol.m; path = Wikipedia/Protocols/WMFArticleReadMoreProtocol.m; sourceTree = SOURCE_ROOT; }; 045AB8C11B1E15D9002839D7 /* NSURL+Extras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+Extras.h"; sourceTree = ""; }; 045AB8C21B1E15D9002839D7 /* NSURL+Extras.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+Extras.m"; sourceTree = ""; }; 045D871F19FAD2FA0035C1F9 /* AboutViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AboutViewController.h; sourceTree = ""; }; @@ -1438,6 +1441,8 @@ 0EE7687A1AF982C100A5D046 /* WMFArticleProtocol.m */, 0433263D1B0D3574009DB316 /* WMFArticleImageProtocol.h */, 0433263E1B0D3574009DB316 /* WMFArticleImageProtocol.m */, + 044D09A01B41FFD1003D244E /* WMFArticleReadMoreProtocol.h */, + 044D09A11B41FFD1003D244E /* WMFArticleReadMoreProtocol.m */, ); name = Protocols; path = wikipedia/Protocols; @@ -3251,6 +3256,7 @@ BCB66A0C1A85183000C7B1FE /* NSString+WMFHTMLParsing.m in Sources */, BCB669AF1A83F6C400C7B1FE /* MWKHistoryList.m in Sources */,
[MediaWiki-commits] [Gerrit] Removed some leftover crufty code from the WebVC. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/220827 Change subject: Removed some leftover crufty code from the WebVC. .. Removed some leftover crufty code from the WebVC. Change-Id: Ia290dee86fee816d70a437e9c7f74fcafc65a673 --- M Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.m M Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.xib M Wikipedia/View Controllers/WebView/WMFWebViewFooterContainerView.h M Wikipedia/View Controllers/WebView/WMFWebViewFooterContainerView.m M Wikipedia/View Controllers/WebView/WebViewController.h M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/View Controllers/WebView/WebViewController_Private.h 7 files changed, 22 insertions(+), 217 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/27/220827/1 diff --git a/Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.m b/Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.m index 65823e4..92595df 100644 --- a/Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.m +++ b/Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.m @@ -73,4 +73,8 @@ [super didReceiveMemoryWarning]; } +- (void)viewDidLayoutSubviews { +[[NSNotificationCenter defaultCenter] postNotificationName:@"WMFFooterViewControllerViewHeightChanged" object:self userInfo:nil]; +} + @end diff --git a/Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.xib b/Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.xib index 9ed0efb..8b210a4 100644 --- a/Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.xib +++ b/Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.xib @@ -1,8 +1,8 @@ - + - + @@ -16,11 +16,11 @@ - + - + @@ -49,7 +49,7 @@ - + @@ -64,10 +64,11 @@ + - + diff --git a/Wikipedia/View Controllers/WebView/WMFWebViewFooterContainerView.h b/Wikipedia/View Controllers/WebView/WMFWebViewFooterContainerView.h index d699c93..8c0c131 100644 --- a/Wikipedia/View Controllers/WebView/WMFWebViewFooterContainerView.h +++ b/Wikipedia/View Controllers/WebView/WMFWebViewFooterContainerView.h @@ -5,8 +5,4 @@ @interface WMFWebViewFooterContainerView : UIView -@property (nonatomic, readonly) CGFloat height; - -- (id)initWithHeight:(CGFloat)height; - @end diff --git a/Wikipedia/View Controllers/WebView/WMFWebViewFooterContainerView.m b/Wikipedia/View Controllers/WebView/WMFWebViewFooterContainerView.m index ae53d7a..162f615 100644 --- a/Wikipedia/View Controllers/WebView/WMFWebViewFooterContainerView.m +++ b/Wikipedia/View Controllers/WebView/WMFWebViewFooterContainerView.m @@ -3,25 +3,10 @@ #import "WMFWebViewFooterContainerView.h" -@interface WMFWebViewFooterContainerView () - -@property (nonatomic) CGFloat height; - -@end - @implementation WMFWebViewFooterContainerView -- (instancetype)initWithHeight:(CGFloat)height { -self = [super init]; -if (self) { -self.height = height; -self.backgroundColor = [UIColor whiteColor]; -} -return self; -} - - (CGSize)intrinsicContentSize { -return CGSizeMake(UIViewNoIntrinsicMetric, self.height); +return CGSizeMake(UIViewNoIntrinsicMetric, self.frame.size.height); } @end diff --git a/Wikipedia/View Controllers/WebView/WebViewController.h b/Wikipedia/View Controllers/WebView/WebViewController.h index b9bdc08..f55aec1 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.h +++ b/Wikipedia/View Controllers/WebView/WebViewController.h @@ -10,7 +10,6 @@ @interface WebViewController : PullToRefreshViewController @property (weak, nonatomic) IBOutlet UIWebView* webView; -@property (nonatomic) BOOL bottomMenuHidden; @property (nonatomic) BOOL referencesHidden; @property (nonatomic) BOOL scrollingToTop; diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 6815e87..f4f50bf 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -170,6 +170,10 @@ - (void)viewDidLoad { [super viewDidLoad]; +[[NSNotifi
[MediaWiki-commits] [Gerrit] For easier debugging of 5.0, show "Read" button. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/220636 Change subject: For easier debugging of 5.0, show "Read" button. .. For easier debugging of 5.0, show "Read" button. Read button calls up full article view. Search icon dismisses full article view so you can search with the new search bits. Change-Id: I7b0e085d71bd0422f83c4cec9ac8466375e7a0af --- M Wikipedia/UI-V5/WMFArticleListCollectionViewController.m M Wikipedia/UI-V5/WMFArticleViewController.m M Wikipedia/UI-V5/iPhone_Root.storyboard M Wikipedia/View Controllers/WebView/WebViewController.m 4 files changed, 21 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/36/220636/1 diff --git a/Wikipedia/UI-V5/WMFArticleListCollectionViewController.m b/Wikipedia/UI-V5/WMFArticleListCollectionViewController.m index 987fb1a..7e2df06 100644 --- a/Wikipedia/UI-V5/WMFArticleListCollectionViewController.m +++ b/Wikipedia/UI-V5/WMFArticleListCollectionViewController.m @@ -10,7 +10,6 @@ #import "WMFArticleCardTranstion.h" -#import "WebViewController.h" #import "UIViewController+WMFStoryboardUtilities.h" @interface WMFArticleListCollectionViewController () @@ -143,18 +142,6 @@ - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; - - - - - - - - - - -// Warning! remove this! debugging code for showing web view! -[[WMFArticlePresenter sharedInstance] presentCurrentArticle]; } - (void)viewDidLayoutSubviews { diff --git a/Wikipedia/UI-V5/WMFArticleViewController.m b/Wikipedia/UI-V5/WMFArticleViewController.m index eff0bdf..2e656eb 100644 --- a/Wikipedia/UI-V5/WMFArticleViewController.m +++ b/Wikipedia/UI-V5/WMFArticleViewController.m @@ -1,6 +1,7 @@ #import "WMFArticleViewController.h" #import +#import "WMFArticlePresenter.h" @interface WMFArticleViewController () @@ -11,6 +12,10 @@ @implementation WMFArticleViewController +- (IBAction)readButtonTapped:(id)sender { +[[WMFArticlePresenter sharedInstance] presentArticleWithTitle:self.article.title discoveryMethod:MWKHistoryDiscoveryMethodSearch]; +} + - (void)setContentTopInset:(CGFloat)contentTopInset { if (contentTopInset == _contentTopInset) { return; diff --git a/Wikipedia/UI-V5/iPhone_Root.storyboard b/Wikipedia/UI-V5/iPhone_Root.storyboard index 89893f5..4bc94e4 100644 --- a/Wikipedia/UI-V5/iPhone_Root.storyboard +++ b/Wikipedia/UI-V5/iPhone_Root.storyboard @@ -1,8 +1,7 @@ - + - - + @@ -225,10 +224,22 @@ + + + + + + + + + + + + diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 6f6b8e2..6815e87 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -103,8 +103,8 @@ }]; UIBarButtonItem* buttonMagnify = [UIBarButtonItem wmf_buttonType:WMF_BUTTON_MAGNIFY handler:^(id sender){ -//@strongify (self) -NSLog(@"TODO: hook this up to search somehow..."); +@strongify(self) +[self dismissViewControllerAnimated : YES completion : nil]; }]; self.navigationItem.leftBarButtonItems = @[buttonW, buttonMagnify]; -- To view, visit https://gerrit.wikimedia.org/r/220636 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7b0e085d71bd0422f83c4cec9ac8466375e7a0af Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: 5.0 Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Re-implement Storyboard strings as programmatic strings - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/220239 Change subject: Re-implement Storyboard strings as programmatic strings .. Re-implement Storyboard strings as programmatic strings Bug: T103557 Change-Id: If373510404ff8c456346c3e70ff445c5e4f30f61 --- M Wikipedia/UI-V5/AccountCreationViewController.storyboard M Wikipedia/UI-V5/CaptchaViewController.storyboard M Wikipedia/UI-V5/EditSummaryViewController.storyboard M Wikipedia/UI-V5/LoginViewController.storyboard M Wikipedia/UI-V5/OnboardingViewController.storyboard M Wikipedia/UI-V5/PrimaryMenuViewController.storyboard M Wikipedia/UI-V5/WebViewController.storyboard M Wikipedia/View Controllers/Captcha/CaptchaViewController.m M Wikipedia/View Controllers/History/HistoryViewController.m M Wikipedia/View Controllers/Languages/LanguagesViewController.storyboard M Wikipedia/View Controllers/SavedPages/SavedPagesViewController.m M Wikipedia/en.lproj/Localizable.strings M Wikipedia/qqq.lproj/Localizable.strings 13 files changed, 75 insertions(+), 34 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/39/220239/1 diff --git a/Wikipedia/UI-V5/AccountCreationViewController.storyboard b/Wikipedia/UI-V5/AccountCreationViewController.storyboard index 140e76a..47b300e 100644 --- a/Wikipedia/UI-V5/AccountCreationViewController.storyboard +++ b/Wikipedia/UI-V5/AccountCreationViewController.storyboard @@ -27,13 +27,16 @@ - + + + + - + @@ -48,7 +51,7 @@ - + @@ -63,7 +66,7 @@ - + @@ -78,7 +81,7 @@ - + @@ -93,8 +96,11 @@ - + + + + diff --git a/Wikipedia/UI-V5/CaptchaViewController.storyboard b/Wikipedia/UI-V5/CaptchaViewController.storyboard index d60470e..5bffe6f 100644 --- a/Wikipedia/UI-V5/CaptchaViewController.storyboard +++ b/Wikipedia/UI-V5/CaptchaViewController.storyboard @@ -26,11 +26,11 @@
[MediaWiki-commits] [Gerrit] Update to languages glyph from design. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/220027 Change subject: Update to languages glyph from design. .. Update to languages glyph from design. For T97780. Change-Id: I0a4f6206999725e7757bcd6c0f13f325f7b73342 --- M Wikipedia/Fonts/WikiFont-Glyphs.ttf 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/27/220027/1 diff --git a/Wikipedia/Fonts/WikiFont-Glyphs.ttf b/Wikipedia/Fonts/WikiFont-Glyphs.ttf index 6059c71..47e434d 100755 --- a/Wikipedia/Fonts/WikiFont-Glyphs.ttf +++ b/Wikipedia/Fonts/WikiFont-Glyphs.ttf Binary files differ -- To view, visit https://gerrit.wikimedia.org/r/220027 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a4f6206999725e7757bcd6c0f13f325f7b73342 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: 5.0 Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix for nav and toolbars for RTL device langs. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/219607 Change subject: Fix for nav and toolbars for RTL device langs. .. Fix for nav and toolbars for RTL device langs. Change-Id: I200eb568265f6e170b2c4c39864821cf139a6b55 --- M Wikipedia.xcodeproj/project.pbxproj M Wikipedia/UI-V5/UIButton+WMFButton.m A Wikipedia/UI-V5/UINavigationBar+WMFRTLMirror.h A Wikipedia/UI-V5/UINavigationBar+WMFRTLMirror.m A Wikipedia/UI-V5/UIToolbar+WMFRTLMirror.h A Wikipedia/UI-V5/UIToolbar+WMFRTLMirror.m A Wikipedia/UI-V5/UIView+WMFRecursivelyMirrorLabelSubviews.h A Wikipedia/UI-V5/UIView+WMFRecursivelyMirrorLabelSubviews.m M Wikipedia/View Controllers/About/AboutViewController.m M Wikipedia/View Controllers/AccountCreation/AccountCreationViewController.m M Wikipedia/View Controllers/EditSummary/EditSummaryViewController.m M Wikipedia/View Controllers/History/HistoryViewController.m M Wikipedia/View Controllers/Languages/LanguagesViewController.m M Wikipedia/View Controllers/Login/LoginViewController.m M Wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.m M Wikipedia/View Controllers/Navigation/Secondary/SecondaryMenuViewController.m M Wikipedia/View Controllers/Nearby/NearbyViewController.m M Wikipedia/View Controllers/PageHistory/PageHistoryViewController.m M Wikipedia/View Controllers/SavedPages/SavedPagesViewController.m M Wikipedia/View Controllers/WebView/WebViewController.m 20 files changed, 201 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/07/219607/1 diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index ed3b56b..71bc35d 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -67,6 +67,9 @@ 04616DFC1AE706C600815BCE /* WMFLocalizationProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 04616DFB1AE706C600815BCE /* WMFLocalizationProtocol.m */; }; 0462A6D11A1FE016009412D4 /* SearchResultAttributedString.m in Sources */ = {isa = PBXBuildFile; fileRef = 0462A6D01A1FE016009412D4 /* SearchResultAttributedString.m */; }; 0463639818A844570049EE4F /* KeychainCredentials.m in Sources */ = {isa = PBXBuildFile; fileRef = 0463639718A844570049EE4F /* KeychainCredentials.m */; }; + 046A4B941B36892600440F67 /* UIView+WMFRecursivelyMirrorLabelSubviews.m in Sources */ = {isa = PBXBuildFile; fileRef = 046A4B931B36892600440F67 /* UIView+WMFRecursivelyMirrorLabelSubviews.m */; }; + 046A4B971B36894900440F67 /* UINavigationBar+WMFRTLMirror.m in Sources */ = {isa = PBXBuildFile; fileRef = 046A4B961B36894900440F67 /* UINavigationBar+WMFRTLMirror.m */; }; + 046A4B9A1B368CFF00440F67 /* UIToolbar+WMFRTLMirror.m in Sources */ = {isa = PBXBuildFile; fileRef = 046A4B991B368CFF00440F67 /* UIToolbar+WMFRTLMirror.m */; }; 046E2B6B1B31ED94008A99A6 /* UIButton+WMFButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 046E2B6A1B31ED94008A99A6 /* UIButton+WMFButton.m */; }; 046E2B6F1B3213BE008A99A6 /* UIBarButtonItem+WMFButtonConvenience.m in Sources */ = {isa = PBXBuildFile; fileRef = 046E2B6E1B3213BE008A99A6 /* UIBarButtonItem+WMFButtonConvenience.m */; }; 0472BC18193AD88C00C40BDA /* MWKSection+DisplayHtml.m in Sources */ = {isa = PBXBuildFile; fileRef = 0472BC17193AD88C00C40BDA /* MWKSection+DisplayHtml.m */; }; @@ -505,6 +508,12 @@ 0463639618A844570049EE4F /* KeychainCredentials.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeychainCredentials.h; sourceTree = ""; }; 0463639718A844570049EE4F /* KeychainCredentials.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KeychainCredentials.m; sourceTree = ""; }; 04649CA619F72B360071E8FA /* libPods.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPods.a; path = "Pods/build/Debug-iphoneos/libPods.a"; sourceTree = ""; }; + 046A4B921B36892600440F67 /* UIView+WMFRecursivelyMirrorLabelSubviews.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+WMFRecursivelyMirrorLabelSubviews.h"; sourceTree = ""; }; + 046A4B931B36892600440F67 /* UIView+WMFRecursivelyMirrorLabelSubviews.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+WMFRecursivelyMirrorLabelSubviews.m"; sourceTree = ""; }; + 046A4B951B36894900440F67 /* UINavigationBar+WMFRTLMirror.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UINavigationBar+WMFRTLMirror.h"; sourceTree = ""; }; + 046A4B961B36894900440F67 /* UINavigationBar+WMFRTLMirror.m */ = {isa = PBXFileReferenc
[MediaWiki-commits] [Gerrit] Fix for making remaining editing vc's not use old crufty menus. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/219573 Change subject: Fix for making remaining editing vc's not use old crufty menus. .. Fix for making remaining editing vc's not use old crufty menus. Blasted all crufty menu code including the old mega storyboard! Change-Id: I21b5dce7d5cbd37e1f11850668f67fbca161515c --- M Wikipedia.xcodeproj/project.pbxproj D Wikipedia/Base.lproj/Main_iPhone.storyboard D Wikipedia/Categories/UINavigationController+SearchNavStack.h D Wikipedia/Categories/UINavigationController+SearchNavStack.m D Wikipedia/Categories/UIViewController+ModalPop.h D Wikipedia/Categories/UIViewController+ModalPop.m D Wikipedia/Categories/UIViewController+ModalPresent.h D Wikipedia/Categories/UIViewController+ModalPresent.m D Wikipedia/Categories/UIViewController+SearchChildViewControllers.h D Wikipedia/Categories/UIViewController+SearchChildViewControllers.m D Wikipedia/Categories/UIViewController+StatusBarHeight.h D Wikipedia/Categories/UIViewController+StatusBarHeight.m M Wikipedia/Defines/Defines.h M Wikipedia/Global.h M Wikipedia/Networking/Fetchers/ArticleFetcher.m M Wikipedia/Networking/Fetchers/CaptchaResetter.h M Wikipedia/Networking/Fetchers/CaptchaResetter.m A Wikipedia/UI-V5/EditSummaryViewController.storyboard A Wikipedia/UI-V5/PreviewAndSaveViewController.storyboard M Wikipedia/UI-V5/SectionEditorViewController.storyboard M Wikipedia/UI-V5/WMFArticlePresenter.h M Wikipedia/UI-V5/WMFArticlePresenter.m M Wikipedia/View Controllers/AccountCreation/AccountCreationViewController.m M Wikipedia/View Controllers/EditSummary/EditSummaryViewController.h M Wikipedia/View Controllers/EditSummary/EditSummaryViewController.m M Wikipedia/View Controllers/History/HistoryViewController.m M Wikipedia/View Controllers/Login/LoginViewController.m D Wikipedia/View Controllers/ModalOverlay/EmptySegue.h D Wikipedia/View Controllers/ModalOverlay/EmptySegue.m D Wikipedia/View Controllers/ModalOverlay/ModalContentViewController.h D Wikipedia/View Controllers/ModalOverlay/ModalContentViewController.m D Wikipedia/View Controllers/ModalOverlay/ModalMenuAndContentViewController.h D Wikipedia/View Controllers/ModalOverlay/ModalMenuAndContentViewController.m D Wikipedia/View Controllers/Navigation/Center/CenterNavController.h D Wikipedia/View Controllers/Navigation/Center/CenterNavController.m M Wikipedia/View Controllers/Navigation/Secondary/SecondaryMenuRowView.xib M Wikipedia/View Controllers/Navigation/Secondary/SecondaryMenuViewController.m D Wikipedia/View Controllers/Navigation/Top/TopMenuContainerView.h D Wikipedia/View Controllers/Navigation/Top/TopMenuContainerView.m D Wikipedia/View Controllers/Navigation/Top/TopMenuTextField.h D Wikipedia/View Controllers/Navigation/Top/TopMenuTextField.m D Wikipedia/View Controllers/Navigation/Top/TopMenuTextFieldContainer.h D Wikipedia/View Controllers/Navigation/Top/TopMenuTextFieldContainer.m D Wikipedia/View Controllers/Navigation/Top/TopMenuViewController.h D Wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m M Wikipedia/View Controllers/Nearby/NearbyViewController.h M Wikipedia/View Controllers/Nearby/NearbyViewController.m M Wikipedia/View Controllers/PageHistory/PageHistoryViewController.m M Wikipedia/View Controllers/Preview/AbuseFilterAlerts/AbuseFilterAlert.m M Wikipedia/View Controllers/Preview/PreviewAndSaveViewController.h M Wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m M Wikipedia/View Controllers/Preview/PreviewLicenseView.m M Wikipedia/View Controllers/RecentSearches/RecentSearchesViewController.m D Wikipedia/View Controllers/Root/RootViewController.h D Wikipedia/View Controllers/Root/RootViewController.m M Wikipedia/View Controllers/SavedPages/SavedPagesViewController.m M Wikipedia/View Controllers/SearchResults/SearchResultsController.m M Wikipedia/View Controllers/SectionEditor/SectionEditorViewController.m M Wikipedia/View Controllers/TableOfContents/TOCViewController.m M Wikipedia/View Controllers/WebView/WebViewController.h M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/View Controllers/WebView/WebViewController_Private.h D Wikipedia/ar.lproj/Main_iPhone.strings D Wikipedia/ast.lproj/Main_iPhone.strings D Wikipedia/av.lproj/Main_iPhone.strings D Wikipedia/az.lproj/Main_iPhone.strings D Wikipedia/bcl.lproj/Main_iPhone.strings D Wikipedia/bn.lproj/Main_iPhone.strings D Wikipedia/br.lproj/Main_iPhone.strings D Wikipedia/ca.lproj/Main_iPhone.strings D Wikipedia/ce.lproj/Main_iPhone.strings D Wikipedia/cs.lproj/Main_iPhone.strings D Wikipedia/da.lproj/Main_iPhone.strings D Wikipedia/de.lproj/Main_iPhone.strings D Wikipedia/dsb.lproj/Main_iPhone.strings D Wikipedia/en-gb.lproj/Main_iPhone.strings D Wikipedia/en.lproj/Main_iPhone.strings D Wikipedia/eo.lproj/Main_iPhone.strings D Wikipedia/es.lproj/Main_iPhone.strings D Wikipedia/fa.lproj/Main_iPhone.strings D Wikipedia/fi.lproj/Main_iPhone.stri
[MediaWiki-commits] [Gerrit] Making web view and other interfaces "presentable". - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/219288 Change subject: Making web view and other interfaces "presentable". .. Making web view and other interfaces "presentable". Creating indidual storyboards with goal of deleting the old mega board. Making interfaces use regular navigational code. Goal to be able to delete NAV and ROOT and all of the old custom menu objects. Far along. Change-Id: I52d4e34e5f34afe7fc653466fe6ba402f6f62c14 --- M Podfile M Podfile.lock A Pods/Headers/Private/libextobjc/EXTRuntimeExtensions.h A Pods/Headers/Private/libextobjc/EXTScope.h A Pods/Headers/Private/libextobjc/metamacros.h A Pods/Headers/Public/libextobjc/EXTRuntimeExtensions.h A Pods/Headers/Public/libextobjc/EXTScope.h A Pods/Headers/Public/libextobjc/metamacros.h M Pods/Manifest.lock M Pods/Pods.xcodeproj/project.pbxproj M Pods/Target Support Files/Pods-AFNetworking/Pods-AFNetworking-Private.xcconfig M Pods/Target Support Files/Pods-BlocksKit/Pods-BlocksKit-Private.xcconfig M Pods/Target Support Files/Pods-HockeySDK/Pods-HockeySDK-Private.xcconfig M Pods/Target Support Files/Pods-Masonry/Pods-Masonry-Private.xcconfig M Pods/Target Support Files/Pods-WikipediaUnitTests-AFNetworking/Pods-WikipediaUnitTests-AFNetworking-Private.xcconfig M Pods/Target Support Files/Pods-WikipediaUnitTests-BlocksKit/Pods-WikipediaUnitTests-BlocksKit-Private.xcconfig M Pods/Target Support Files/Pods-WikipediaUnitTests-HockeySDK/Pods-WikipediaUnitTests-HockeySDK-Private.xcconfig M Pods/Target Support Files/Pods-WikipediaUnitTests-Masonry/Pods-WikipediaUnitTests-Masonry-Private.xcconfig M Pods/Target Support Files/Pods-WikipediaUnitTests-OCHamcrest/Pods-WikipediaUnitTests-OCHamcrest-Private.xcconfig M Pods/Target Support Files/Pods-WikipediaUnitTests-OCMockito/Pods-WikipediaUnitTests-OCMockito-Private.xcconfig M Pods/Target Support Files/Pods-WikipediaUnitTests-hpple/Pods-WikipediaUnitTests-hpple-Private.xcconfig A Pods/Target Support Files/Pods-WikipediaUnitTests-libextobjc/Pods-WikipediaUnitTests-libextobjc-Private.xcconfig A Pods/Target Support Files/Pods-WikipediaUnitTests-libextobjc/Pods-WikipediaUnitTests-libextobjc-dummy.m A Pods/Target Support Files/Pods-WikipediaUnitTests-libextobjc/Pods-WikipediaUnitTests-libextobjc-prefix.pch A Pods/Target Support Files/Pods-WikipediaUnitTests-libextobjc/Pods-WikipediaUnitTests-libextobjc.xcconfig M Pods/Target Support Files/Pods-WikipediaUnitTests/Pods-WikipediaUnitTests-acknowledgements.markdown M Pods/Target Support Files/Pods-WikipediaUnitTests/Pods-WikipediaUnitTests-acknowledgements.plist M Pods/Target Support Files/Pods-WikipediaUnitTests/Pods-WikipediaUnitTests-environment.h M Pods/Target Support Files/Pods-WikipediaUnitTests/Pods-WikipediaUnitTests-resources.sh M Pods/Target Support Files/Pods-WikipediaUnitTests/Pods-WikipediaUnitTests.alpha.xcconfig M Pods/Target Support Files/Pods-WikipediaUnitTests/Pods-WikipediaUnitTests.beta.xcconfig M Pods/Target Support Files/Pods-WikipediaUnitTests/Pods-WikipediaUnitTests.debug.xcconfig M Pods/Target Support Files/Pods-WikipediaUnitTests/Pods-WikipediaUnitTests.release.xcconfig M Pods/Target Support Files/Pods-hpple/Pods-hpple-Private.xcconfig A Pods/Target Support Files/Pods-libextobjc/Pods-libextobjc-Private.xcconfig A Pods/Target Support Files/Pods-libextobjc/Pods-libextobjc-dummy.m A Pods/Target Support Files/Pods-libextobjc/Pods-libextobjc-prefix.pch A Pods/Target Support Files/Pods-libextobjc/Pods-libextobjc.xcconfig M Pods/Target Support Files/Pods/Pods-acknowledgements.markdown M Pods/Target Support Files/Pods/Pods-acknowledgements.plist M Pods/Target Support Files/Pods/Pods-environment.h M Pods/Target Support Files/Pods/Pods-resources.sh M Pods/Target Support Files/Pods/Pods.alpha.xcconfig M Pods/Target Support Files/Pods/Pods.beta.xcconfig M Pods/Target Support Files/Pods/Pods.debug.xcconfig M Pods/Target Support Files/Pods/Pods.release.xcconfig A Pods/libextobjc/LICENSE.md A Pods/libextobjc/README.md A Pods/libextobjc/extobjc/EXTRuntimeExtensions.h A Pods/libextobjc/extobjc/EXTRuntimeExtensions.m A Pods/libextobjc/extobjc/EXTScope.h A Pods/libextobjc/extobjc/EXTScope.m A Pods/libextobjc/extobjc/metamacros.h M Wikipedia.xcodeproj/project.pbxproj M Wikipedia/Base.lproj/Main_iPhone.storyboard M Wikipedia/Categories/Alerts/UIViewController+Alert.m M Wikipedia/Categories/UIViewController+ModalsSearch.m M Wikipedia/Global.h A Wikipedia/UI-V5/AboutViewController.storyboard A Wikipedia/UI-V5/AccountCreationViewController.storyboard A Wikipedia/UI-V5/CaptchaViewController.storyboard A Wikipedia/UI-V5/HistoryViewController.storyboard A Wikipedia/UI-V5/LoginViewController.storyboard A Wikipedia/UI-V5/NearbyViewController.storyboard A Wikipedia/UI-V5/OnboardingViewController.storyboard A Wikipedia/UI-V5/PageHistoryViewController.storyboard A Wikipedia/UI-V5/PrimaryMenuViewController.storyboard A Wikipedia/UI-V5/ReferencesVC.
[MediaWiki-commits] [Gerrit] Fix for long article title wrapping in lead image regression. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/219128 Change subject: Fix for long article title wrapping in lead image regression. .. Fix for long article title wrapping in lead image regression. Bug: T102917 Change-Id: I44316e52fe62ba521f61e9479fee6efd816ed430 --- M Wikipedia/assets/styleoverrides.css M www/less/leadImage.less 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/28/219128/1 diff --git a/Wikipedia/assets/styleoverrides.css b/Wikipedia/assets/styleoverrides.css index 99c8433..4b68ec8 100644 --- a/Wikipedia/assets/styleoverrides.css +++ b/Wikipedia/assets/styleoverrides.css @@ -1,5 +1,5 @@ .ios-disambiguation-item-anchor{display:block;padding-top:8px;padding-bottom:8px}.ios-issue-item{padding-top:8px;padding-bottom:8px}.ios-issue-item *{font-weight:normal !important}#disambig_sub_container,#issues_sub_container{background-color:#fff !important;border-bottom:1px solid #ccc;padding-top:6px;padding-bottom:12px;margin-bottom:12px}#issues_container_close_button{color:#333;display:none;font-weight:bold;padding:4px 20px 4px 20px}a.issues_button,a.disambig_button{padding:4px 0px 4px 0px !important}span.issues_separator{padding-top:4px!important;padding-bottom:4px!important}div.issues_container{margin-bottom:1.8em !important} .content table.infobox{font-size:100%;border-style:none !important}table.infobox caption{text-align:center;font-weight:bold}.app_table_container{width:100%;margin-top:14px;margin-bottom:14px;border-radius:2px;padding:1px;box-shadow:inset 0 0 1px gray}.app_table_collapsed_container{width:100%;padding-left:12px;padding-right:48px;padding-top:12px;padding-bottom:12px;line-height:120%;background-color:#f8f8f8;background-repeat:no-repeat;background-position:95% 50%;background-size:16px 16px}.app_table_collapsed_open{border-radius:2px;background-image:url(data:image/png;base64,iVBORw0KGgoNSUhEUgAAADAwCAYAAABXAvmHBGdBTUEAALGPC/xhBQlwSFlzAAAOwQAADsEBuJFr7QAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4zjOaXUoZJREFUaEPtmE1uE0EQhceEn1NwFEtwALL0CSzbe2+9QQgJAoKI8BeF8I8ImCQCIRCSxVk4QNhkxwZ4z+qOespvPNMzYxCiS/ricVVX1evpnukkWbJkyZIlS5Ys2f9ss9lsTr/fPz8ajV4Mh8Nv4Dv4OhgMLvr43wKaLkDLF3BEbdRIrT4+/wGhlxA8Br8MPxG74gf/adD7OjUYTeSYmjkmw5d18CMILoBZ37DFVw0E3lFaAqh5nROYBs5CUPC2arQCOuh1T2kQTLNer3cGF4cmIOFdEQ3bhOIfqt6CQ2qfJ7pJHJgBEt4dNgqatgXF76iegn1qZt5JgclkchqBd2ZgEdts6HOb0u12T+E52xV9FFNq9bm5Qm4Sb01CEY/YOMyvgxP/VNRfAOPehOJJrhjhAA5UBQRPmkwC+WvoxbNH1c6B7fUan2u2Ru6LhwNdgixmeA4WCpfBHPDK1SiD42SPBYeHCS5RFbQUNlC4rboX5BfiVqiwtnR6mIiVeBkWXMKe3Z+KmOcMvZ+VbVHpDGEBFOM2kU0MuTeExb2u901OEZWeL+m0xLwpwIF/R4c48ZUOTPTarfpykE4FC2JJH6uGgvfgrM/lNfjgYktBjx3kVD5jpLMItxJVD5yP4/H4HOG1iRURfUBKZwkxR/4n8Nn4JLgxD1jb9CpFOivQQdNtK6IuuCG1f7+Szop0eNeUoEi2RO3KSGcEXIn7RlAMm6JmFNIZC1birhC3FOTcUrVikc46YB+X/Ql4AsbeVDXqIJ11gbhNK1awoXLrIp1N4NYQoucgdk3lNEE6m8ItIsRfVWObIp1tANEbXjwmtLL/LUlnW3DLYAKXVawtkiVLlixZsn/Ysuw35enU+iMlJaQASUVORK5CYII=)}.app_table_collapse_close{border-radius:2px 2px 0px 0px}.app_table_collapse_icon{background-image:url(data:image/png;base64,iVBORw0KGgoNSUhEUgAAADAwCAYAAABXAvmHBGdBTUEAALGPC/xhBQlwSFlzAAAOwQAADsEBuJFr7QAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4zjOaXUoBJREFUaEPtmE1uE0EQhW3Mzyk4iiU4AFn6BJbtvbfeIIQEAUEUCEnE/58ImCQCIRCSxVk4AGyyYwN5L+qOxuXXM90zthCiS/ricXV11avunhkrrWzZsmXLlu2fttlstjJGo9GN4XB4VY0tC+lcBhC+Dv6QwWBwTcUsA+lsCgTf9uI92I3rKrYp0tkECL1jxXt4pNScJkhnXSByw4oWrKu5dZHOOuDYbAqxEh4xlaMO0pkKjsZ9JbQMHjWVKxXpTKANMQ+suAQ2RM4kpDOSNlZxW4hK5Z7IHY10RsCV3zVCaoN7Yos5TY0opLOCNgo+VEIEn8EX45NwN5nb1KpEOkN0u90zKPRYCRB8Go/HFwivzViIXdRJakI6FRSPlX8iiio+gPN+Lq/BRzdWCncXc6KbkE6LW/lnqqDgoNfrnbM56MPYoYmVcJdZ0+ZQSGcRJkLSF7ZIgOlkMjmr8hDXxL6ZE+JpTBPS6UGSDrb0lUkcYq9MvIcxiH1n5kpQ+3lVE9JJkKADXhcTlsC4jsqjcE3sFeYHwXF6ic9gbunkBHT/ppioBB6vaPEezgGNF2jBwdVB129NghBR5zQE5nfcCqvcc7gFXWhi7kvK+QSPmoj3MEfsE44La++z0wsn/r2dFCD5hVOGayL2BTn3pDv54x5vByZQgq2s/bulgpSfKPv+XZP0gkGBTVN02bCJHVVbcEjtvJGmZkCCxHdFwVXAJraUBsGUDayBXwXnAjift0ShlcLdVloKUPOaD76CL0eFQc9vjK3sfzpVoPZNajCayBE1M+Y0uN/vX3TP5O/gJ/iGoMt+/G8BTZeg5Sv4QW3USK1+PFu2bNmyZcuW7f+1VusYzYvU+uNoBCAASUVORK5CYII=)}.app_span_collapse_text{color:#808080}.app_table_collapsed_bottom{width:100%;color:#808080;padding-left:12px;padding-right:48px;padding-top:12px;padding-bottom:12px;line-height:120%;border-radius:0px 0px 2px 2px;background-color:#f8f8f8;background-repeat:no-repeat;background-position:95% 50%;background-size:16px 16px}.app_table_container,.app_table_collapsed_container,.app_table_collapse_close,.app_table_collapse_icon{box-sizing:border-box} -.content{margin-top:0px}.lead_image_div{margin-left:-16px !important;margin-right:-16px !important;z-index:1}#lead_image_none .lead_image_div{height:auto !important;background-image:none}#lead_image_none #lead_image_placeholder{display:none}#lead_image_none #lead_image_gradient{display:none}#lead_image_text_container{paddin
[MediaWiki-commits] [Gerrit] Making web view and other interfaces "presentable". - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/219081 Change subject: Making web view and other interfaces "presentable". .. Making web view and other interfaces "presentable". Creating indidual storyboards with goal of deleting the old mega board. Making interfaces use regular navigational code. Goal to be able to delete NAV and ROOT and all of the old custom menu objects. Far along. Change-Id: I52d4e34e5f34afe7fc653466fe6ba402f6f62c14 --- M Wikipedia.xcodeproj/project.pbxproj M Wikipedia/Base.lproj/Main_iPhone.storyboard M Wikipedia/Categories/Alerts/UIViewController+Alert.m M Wikipedia/Categories/UIViewController+ModalsSearch.m M Wikipedia/UI-V5/TGLStackedViewController/TGLStackedLayout.h M Wikipedia/UI-V5/TGLStackedViewController/TGLStackedLayout.m A Wikipedia/UI-V5/UIBarButtonItem+WMFButtonConvenience.h A Wikipedia/UI-V5/UIBarButtonItem+WMFButtonConvenience.m A Wikipedia/UI-V5/UIButton+WMFButton.h A Wikipedia/UI-V5/UIButton_WMFButton.m M Wikipedia/UI-V5/UICollectionView+WMFEnumeration.h M Wikipedia/UI-V5/UICollectionView+WMFEnumeration.m A Wikipedia/UI-V5/WMFArticleEditing.storyboard M Wikipedia/UI-V5/WMFArticleListCollectionViewController.m A Wikipedia/UI-V5/WMFCaptcha.storyboard A Wikipedia/UI-V5/WMFCreateAccount.storyboard M Wikipedia/UI-V5/WMFGCDHelpers.h A Wikipedia/UI-V5/WMFHistory.storyboard A Wikipedia/UI-V5/WMFLanguages.storyboard A Wikipedia/UI-V5/WMFLogin.storyboard A Wikipedia/UI-V5/WMFMainMenu.storyboard A Wikipedia/UI-V5/WMFNearby.storyboard A Wikipedia/UI-V5/WMFReferences.storyboard A Wikipedia/UI-V5/WMFSavedPages.storyboard A Wikipedia/UI-V5/WMFSearchResults.storyboard A Wikipedia/UI-V5/WMFSecondaryMenu.storyboard A Wikipedia/UI-V5/WMFWebView.storyboard M Wikipedia/View Controllers/AccountCreation/AccountCreationViewController.h M Wikipedia/View Controllers/AccountCreation/AccountCreationViewController.m M Wikipedia/View Controllers/Captcha/CaptchaViewController.h M Wikipedia/View Controllers/Captcha/CaptchaViewController.m M Wikipedia/View Controllers/History/HistoryViewController.h M Wikipedia/View Controllers/History/HistoryViewController.m M Wikipedia/View Controllers/Languages/LanguagesViewController.h M Wikipedia/View Controllers/Languages/LanguagesViewController.m M Wikipedia/View Controllers/Login/LoginViewController.h M Wikipedia/View Controllers/Login/LoginViewController.m M Wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.h M Wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m M Wikipedia/View Controllers/Navigation/Center/CenterNavController.h M Wikipedia/View Controllers/Navigation/Center/CenterNavController.m M Wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.h M Wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.m M Wikipedia/View Controllers/Navigation/Secondary/SecondaryMenuViewController.h M Wikipedia/View Controllers/Navigation/Secondary/SecondaryMenuViewController.m M Wikipedia/View Controllers/Nearby/NearbyViewController.h M Wikipedia/View Controllers/Nearby/NearbyViewController.m M Wikipedia/View Controllers/References/ReferencesVC.h M Wikipedia/View Controllers/References/ReferencesVC.m M Wikipedia/View Controllers/Root/RootViewController.h M Wikipedia/View Controllers/Root/RootViewController.m M Wikipedia/View Controllers/SavedPages/SavedPagesViewController.h M Wikipedia/View Controllers/SavedPages/SavedPagesViewController.m M Wikipedia/View Controllers/SearchResults/SearchResultsController.h M Wikipedia/View Controllers/SearchResults/SearchResultsController.m M Wikipedia/View Controllers/SectionEditor/SectionEditorViewController.h M Wikipedia/View Controllers/SectionEditor/SectionEditorViewController.m M Wikipedia/View Controllers/WebView/WebViewController.h M Wikipedia/View Controllers/WebView/WebViewController.m 59 files changed, 2,805 insertions(+), 1,068 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/81/219081/1 -- To view, visit https://gerrit.wikimedia.org/r/219081 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I52d4e34e5f34afe7fc653466fe6ba402f6f62c14 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: 5.0 Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] WIP - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/218830 Change subject: WIP .. WIP Making web view "presentable". Creating indidual storyboards with goal of deleting the old mega board. Making interfaces use regular navigational code. Goal to be able to delete NAV and ROOT and all of the old custom menu objects. Far along. Change-Id: I7f185ffdc569b75d206343431674010931fca629 --- M Wikipedia.xcodeproj/project.pbxproj M Wikipedia/Base.lproj/Main_iPhone.storyboard M Wikipedia/Categories/Alerts/UIViewController+Alert.m M Wikipedia/Categories/UIViewController+ModalsSearch.m M Wikipedia/UI-V5/TGLStackedViewController/TGLStackedLayout.h M Wikipedia/UI-V5/TGLStackedViewController/TGLStackedLayout.m M Wikipedia/UI-V5/UICollectionView+WMFEnumeration.h M Wikipedia/UI-V5/UICollectionView+WMFEnumeration.m A Wikipedia/UI-V5/WMFArticleEditing.storyboard M Wikipedia/UI-V5/WMFArticleListCollectionViewController.m A Wikipedia/UI-V5/WMFBarButtonItem.h A Wikipedia/UI-V5/WMFBarButtonItem.m A Wikipedia/UI-V5/WMFCaptcha.storyboard A Wikipedia/UI-V5/WMFCreateAccount.storyboard M Wikipedia/UI-V5/WMFGCDHelpers.h A Wikipedia/UI-V5/WMFHistory.storyboard A Wikipedia/UI-V5/WMFLanguages.storyboard A Wikipedia/UI-V5/WMFLogin.storyboard A Wikipedia/UI-V5/WMFMainMenu.storyboard A Wikipedia/UI-V5/WMFNearby.storyboard A Wikipedia/UI-V5/WMFReferences.storyboard A Wikipedia/UI-V5/WMFSavedPages.storyboard A Wikipedia/UI-V5/WMFSearchResults.storyboard A Wikipedia/UI-V5/WMFSecondaryMenu.storyboard A Wikipedia/UI-V5/WMFWebView.storyboard M Wikipedia/View Controllers/AccountCreation/AccountCreationViewController.h M Wikipedia/View Controllers/AccountCreation/AccountCreationViewController.m M Wikipedia/View Controllers/Captcha/CaptchaViewController.h M Wikipedia/View Controllers/Captcha/CaptchaViewController.m M Wikipedia/View Controllers/History/HistoryViewController.h M Wikipedia/View Controllers/History/HistoryViewController.m M Wikipedia/View Controllers/Languages/LanguagesViewController.h M Wikipedia/View Controllers/Languages/LanguagesViewController.m M Wikipedia/View Controllers/Login/LoginViewController.h M Wikipedia/View Controllers/Login/LoginViewController.m M Wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.h M Wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m M Wikipedia/View Controllers/Navigation/Center/CenterNavController.h M Wikipedia/View Controllers/Navigation/Center/CenterNavController.m M Wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.h M Wikipedia/View Controllers/Navigation/Primary/PrimaryMenuViewController.m M Wikipedia/View Controllers/Navigation/Secondary/SecondaryMenuViewController.h M Wikipedia/View Controllers/Navigation/Secondary/SecondaryMenuViewController.m M Wikipedia/View Controllers/Nearby/NearbyViewController.h M Wikipedia/View Controllers/Nearby/NearbyViewController.m M Wikipedia/View Controllers/References/ReferencesVC.h M Wikipedia/View Controllers/References/ReferencesVC.m M Wikipedia/View Controllers/Root/RootViewController.h M Wikipedia/View Controllers/Root/RootViewController.m M Wikipedia/View Controllers/SavedPages/SavedPagesViewController.h M Wikipedia/View Controllers/SavedPages/SavedPagesViewController.m M Wikipedia/View Controllers/SearchResults/SearchResultsController.h M Wikipedia/View Controllers/SearchResults/SearchResultsController.m M Wikipedia/View Controllers/SectionEditor/SectionEditorViewController.h M Wikipedia/View Controllers/SectionEditor/SectionEditorViewController.m M Wikipedia/View Controllers/WebView/WebViewController.h M Wikipedia/View Controllers/WebView/WebViewController.m 57 files changed, 2,796 insertions(+), 1,068 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/30/218830/1 -- To view, visit https://gerrit.wikimedia.org/r/218830 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7f185ffdc569b75d206343431674010931fca629 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix search sampling Bug: T102163 - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/217951 Change subject: Fix search sampling Bug: T102163 .. Fix search sampling Bug: T102163 It was sending all events instead of sampling to 1% Change-Id: I287831b426694f5c4e4d20496f5bbb7e1370d129 --- M Wikipedia/EventLogging/EventLoggingFunnel.h M Wikipedia/EventLogging/EventLoggingFunnel.m M Wikipedia/WMFSearchFunnel.m 3 files changed, 41 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/51/217951/1 diff --git a/Wikipedia/EventLogging/EventLoggingFunnel.h b/Wikipedia/EventLogging/EventLoggingFunnel.h index 2bbba9c..748b2cc 100644 --- a/Wikipedia/EventLogging/EventLoggingFunnel.h +++ b/Wikipedia/EventLogging/EventLoggingFunnel.h @@ -32,6 +32,17 @@ @property (nonatomic, assign) int revision; /** + * Sampling rate used to calculate sampling ratio. + * Rate:Ratio: Percent: + * 1 1/1 100% + * 2 1/2 50% + * 3 1/3 33% + * ... + * 100 1/100 1% + */ +@property (nonatomic, assign) NSInteger rate; + +/** * This constructor should be called internally by derived classes * to encapsulate the schema name and version. */ diff --git a/Wikipedia/EventLogging/EventLoggingFunnel.m b/Wikipedia/EventLogging/EventLoggingFunnel.m index 29dd320..4b322aa 100644 --- a/Wikipedia/EventLogging/EventLoggingFunnel.m +++ b/Wikipedia/EventLogging/EventLoggingFunnel.m @@ -17,6 +17,7 @@ if (self) { self.schema = schema; self.revision = revision; +self.rate = 1; } return self; } @@ -33,10 +34,18 @@ - (void)log:(NSDictionary*)eventData wiki:(NSString*)wiki { if ([SessionSingleton sharedInstance].shouldSendUsageReports) { -(void)[[EventLogger alloc] initAndLogEvent:[self preprocessData:eventData] - forSchema:self.schema - revision:self.revision - wiki:wiki]; +BOOL chosen = NO; +if (self.rate == 1) { +chosen = YES; +} else if (self.rate != 0) { +chosen = (self.getEventLogSamplingID % self.rate) == 0; +} +if (chosen) { +(void)[[EventLogger alloc] initAndLogEvent:[self preprocessData:eventData] + forSchema:self.schema + revision:self.revision + wiki:wiki]; +} } } @@ -55,4 +64,20 @@ return uuid; } +/** + * Persistent random integer id used for sampling. + * + * @return integer sampling id + */ +- (NSInteger)getEventLogSamplingID { +NSNumber* samplingId = [[NSUserDefaults standardUserDefaults] objectForKey:@"EventLogSamplingID"]; +if (!samplingId) { +NSInteger intId = arc4random_uniform(UINT32_MAX); +[[NSUserDefaults standardUserDefaults] setInteger:intId forKey:@"EventLogSamplingID"]; +return intId; +} else { +return samplingId.integerValue; +} +} + @end diff --git a/Wikipedia/WMFSearchFunnel.m b/Wikipedia/WMFSearchFunnel.m index da544df..5db3d8b 100644 --- a/Wikipedia/WMFSearchFunnel.m +++ b/Wikipedia/WMFSearchFunnel.m @@ -30,6 +30,7 @@ - (instancetype)init { self = [super initWithSchema:kSchemaName version:kSchemaVersion]; if (self) { +self.rate = 100; _appInstallId = [self persistentUUID:kSchemaName]; } return self; -- To view, visit https://gerrit.wikimedia.org/r/217951 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I287831b426694f5c4e4d20496f5bbb7e1370d129 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix search sampling Bug: T102163 - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/217946 Change subject: Fix search sampling Bug: T102163 .. Fix search sampling Bug: T102163 It was sending all events instead of sampling to 1% Change-Id: I776a1a99b31da2ea56eb9fc55991fb0d2fc8a66c --- M Wikipedia/EventLogging/EventLoggingFunnel.h M Wikipedia/EventLogging/EventLoggingFunnel.m M Wikipedia/WMFSearchFunnel.m 3 files changed, 41 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/46/217946/1 diff --git a/Wikipedia/EventLogging/EventLoggingFunnel.h b/Wikipedia/EventLogging/EventLoggingFunnel.h index 2bbba9c..748b2cc 100644 --- a/Wikipedia/EventLogging/EventLoggingFunnel.h +++ b/Wikipedia/EventLogging/EventLoggingFunnel.h @@ -32,6 +32,17 @@ @property (nonatomic, assign) int revision; /** + * Sampling rate used to calculate sampling ratio. + * Rate:Ratio: Percent: + * 1 1/1 100% + * 2 1/2 50% + * 3 1/3 33% + * ... + * 100 1/100 1% + */ +@property (nonatomic, assign) NSInteger rate; + +/** * This constructor should be called internally by derived classes * to encapsulate the schema name and version. */ diff --git a/Wikipedia/EventLogging/EventLoggingFunnel.m b/Wikipedia/EventLogging/EventLoggingFunnel.m index 29dd320..4b322aa 100644 --- a/Wikipedia/EventLogging/EventLoggingFunnel.m +++ b/Wikipedia/EventLogging/EventLoggingFunnel.m @@ -17,6 +17,7 @@ if (self) { self.schema = schema; self.revision = revision; +self.rate = 1; } return self; } @@ -33,10 +34,18 @@ - (void)log:(NSDictionary*)eventData wiki:(NSString*)wiki { if ([SessionSingleton sharedInstance].shouldSendUsageReports) { -(void)[[EventLogger alloc] initAndLogEvent:[self preprocessData:eventData] - forSchema:self.schema - revision:self.revision - wiki:wiki]; +BOOL chosen = NO; +if (self.rate == 1) { +chosen = YES; +} else if (self.rate != 0) { +chosen = (self.getEventLogSamplingID % self.rate) == 0; +} +if (chosen) { +(void)[[EventLogger alloc] initAndLogEvent:[self preprocessData:eventData] + forSchema:self.schema + revision:self.revision + wiki:wiki]; +} } } @@ -55,4 +64,20 @@ return uuid; } +/** + * Persistent random integer id used for sampling. + * + * @return integer sampling id + */ +- (NSInteger)getEventLogSamplingID { +NSNumber* samplingId = [[NSUserDefaults standardUserDefaults] objectForKey:@"EventLogSamplingID"]; +if (!samplingId) { +NSInteger intId = arc4random_uniform(UINT32_MAX); +[[NSUserDefaults standardUserDefaults] setInteger:intId forKey:@"EventLogSamplingID"]; +return intId; +} else { +return samplingId.integerValue; +} +} + @end diff --git a/Wikipedia/WMFSearchFunnel.m b/Wikipedia/WMFSearchFunnel.m index da544df..5db3d8b 100644 --- a/Wikipedia/WMFSearchFunnel.m +++ b/Wikipedia/WMFSearchFunnel.m @@ -30,6 +30,7 @@ - (instancetype)init { self = [super initWithSchema:kSchemaName version:kSchemaVersion]; if (self) { +self.rate = 100; _appInstallId = [self persistentUUID:kSchemaName]; } return self; -- To view, visit https://gerrit.wikimedia.org/r/217946 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I776a1a99b31da2ea56eb9fc55991fb0d2fc8a66c Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: 4.1.5 Gerrit-Owner: Mhurd Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix search sampling Bug: T102163 - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/217943 Change subject: Fix search sampling Bug: T102163 .. Fix search sampling Bug: T102163 It was sending all events instead of sampling to 1% Change-Id: I0c8b6f525a8ccb51ca1cdc20e28a805a00be6f80 --- M Wikipedia/EventLogging/EventLoggingFunnel.h M Wikipedia/EventLogging/EventLoggingFunnel.m M Wikipedia/WMFSearchFunnel.m 3 files changed, 41 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/43/217943/1 diff --git a/Wikipedia/EventLogging/EventLoggingFunnel.h b/Wikipedia/EventLogging/EventLoggingFunnel.h index 2bbba9c..748b2cc 100644 --- a/Wikipedia/EventLogging/EventLoggingFunnel.h +++ b/Wikipedia/EventLogging/EventLoggingFunnel.h @@ -32,6 +32,17 @@ @property (nonatomic, assign) int revision; /** + * Sampling rate used to calculate sampling ratio. + * Rate:Ratio: Percent: + * 1 1/1 100% + * 2 1/2 50% + * 3 1/3 33% + * ... + * 100 1/100 1% + */ +@property (nonatomic, assign) NSInteger rate; + +/** * This constructor should be called internally by derived classes * to encapsulate the schema name and version. */ diff --git a/Wikipedia/EventLogging/EventLoggingFunnel.m b/Wikipedia/EventLogging/EventLoggingFunnel.m index 29dd320..4b322aa 100644 --- a/Wikipedia/EventLogging/EventLoggingFunnel.m +++ b/Wikipedia/EventLogging/EventLoggingFunnel.m @@ -17,6 +17,7 @@ if (self) { self.schema = schema; self.revision = revision; +self.rate = 1; } return self; } @@ -33,10 +34,18 @@ - (void)log:(NSDictionary*)eventData wiki:(NSString*)wiki { if ([SessionSingleton sharedInstance].shouldSendUsageReports) { -(void)[[EventLogger alloc] initAndLogEvent:[self preprocessData:eventData] - forSchema:self.schema - revision:self.revision - wiki:wiki]; +BOOL chosen = NO; +if (self.rate == 1) { +chosen = YES; +} else if (self.rate != 0) { +chosen = (self.getEventLogSamplingID % self.rate) == 0; +} +if (chosen) { +(void)[[EventLogger alloc] initAndLogEvent:[self preprocessData:eventData] + forSchema:self.schema + revision:self.revision + wiki:wiki]; +} } } @@ -55,4 +64,20 @@ return uuid; } +/** + * Persistent random integer id used for sampling. + * + * @return integer sampling id + */ +- (NSInteger)getEventLogSamplingID { +NSNumber* samplingId = [[NSUserDefaults standardUserDefaults] objectForKey:@"EventLogSamplingID"]; +if (!samplingId) { +NSInteger intId = arc4random_uniform(UINT32_MAX); +[[NSUserDefaults standardUserDefaults] setInteger:intId forKey:@"EventLogSamplingID"]; +return intId; +} else { +return samplingId.integerValue; +} +} + @end diff --git a/Wikipedia/WMFSearchFunnel.m b/Wikipedia/WMFSearchFunnel.m index da544df..5db3d8b 100644 --- a/Wikipedia/WMFSearchFunnel.m +++ b/Wikipedia/WMFSearchFunnel.m @@ -30,6 +30,7 @@ - (instancetype)init { self = [super initWithSchema:kSchemaName version:kSchemaVersion]; if (self) { +self.rate = 100; _appInstallId = [self persistentUUID:kSchemaName]; } return self; -- To view, visit https://gerrit.wikimedia.org/r/217943 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c8b6f525a8ccb51ca1cdc20e28a805a00be6f80 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix for footer constraint bugs. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/217340 Change subject: Fix for footer constraint bugs. .. Fix for footer constraint bugs. Reverted to old xib removing the languages part. Change-Id: I562b2c56896f6a2bba7e3bc178129f4fc322ee1c --- M Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.xib 1 file changed, 10 insertions(+), 43 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/40/217340/1 diff --git a/Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.xib b/Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.xib index 65589ca..ffdee2d 100644 --- a/Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.xib +++ b/Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.xib @@ -1,8 +1,8 @@ - + - + @@ -14,11 +14,11 @@ - + - + @@ -28,20 +28,20 @@ - + - - + + - + @@ -53,63 +53,30 @@ - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + -- To view, visit https://gerrit.wikimedia.org/r/217340 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I562b2c56896f6a2bba7e3bc178129f4fc322ee1c Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert some parts of 217002 which got implicitly merged. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/217196 Change subject: Revert some parts of 217002 which got implicitly merged. .. Revert some parts of 217002 which got implicitly merged. Not sure how, but this was merged w/o review and had some changes to the bundled image protocol handler which were experimental. Change-Id: I13f4ccb15e50080923f307100c6293eb15c8e271 --- M Wikipedia/Protocols/WMFBundledImageProtocol.m M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/assets/about.html M www/about.html 4 files changed, 15 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/96/217196/1 diff --git a/Wikipedia/Protocols/WMFBundledImageProtocol.m b/Wikipedia/Protocols/WMFBundledImageProtocol.m index 6f754df..224f65b 100644 --- a/Wikipedia/Protocols/WMFBundledImageProtocol.m +++ b/Wikipedia/Protocols/WMFBundledImageProtocol.m @@ -27,19 +27,17 @@ - (void)startLoading { NSString* fileName = [self.request.URL wmf_getValue]; -UIImage* image = [UIImage imageNamed:fileName]; -if (!image) { -[[self client] URLProtocol:self didFailWithError:[NSError errorWithDomain:NSCocoaErrorDomain code:NSFileNoSuchFileError userInfo:nil]]; -return; -} - -NSData* data = UIImagePNGRepresentation(image); -NSAssert(data.length, @"Image \"%@\" is empty!", fileName); - NSURLResponse* response = [[NSURLResponse alloc] initWithURL:self.request.URL -MIMEType:@"image/png" - expectedContentLength:data.length -textEncodingName:@"binary"]; +MIMEType:[kImageSlash stringByAppendingString:[fileName pathExtension]] + expectedContentLength:-1 +textEncodingName:nil]; + +NSString* imagePath = [[NSBundle mainBundle] pathForResource:[fileName stringByDeletingPathExtension] + ofType:[fileName pathExtension]]; + +NSData* data = [NSData dataWithContentsOfFile:imagePath]; + +NSAssert(data.length, @"Image \"%@\" is empty!", fileName); [[self client] URLProtocol:self didReceiveResponse:response cacheStoragePolicy:NSURLCacheStorageNotAllowed]; [[self client] URLProtocol:self didLoadData:data]; @@ -49,4 +47,4 @@ - (void)stopLoading { } -@end +@end \ No newline at end of file diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 90c672b..9808f3f 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -1561,7 +1561,7 @@ @"%@;" "background-position: 50%% %ld%%;", article.imageURL, - [article.image isCached] ? @"" : @",url('wmf://bundledImage/lead-default')", + [article.image isCached] ? @"" : @",url('wmf://bundledImage/lead-default.png')", offsetY]; NSString* leadImageHtml = @@ -1626,7 +1626,7 @@ } + (NSString*)hidePlaceholderJS { -return @"document.getElementById('lead_image_div').style.backgroundImage = document.getElementById('lead_image_div').style.backgroundImage.replace('wmf://bundledImage/lead-default', 'wmf://bundledImage/empty');"; +return @"document.getElementById('lead_image_div').style.backgroundImage = document.getElementById('lead_image_div').style.backgroundImage.replace('wmf://bundledImage/lead-default.png', 'wmf://bundledImage/empty.png');"; } - (void)leadImageHidePlaceHolderAndCenterOnFaceIfNeeded:(CGRect)rect { diff --git a/Wikipedia/assets/about.html b/Wikipedia/assets/about.html index 52a5665..d979f2a 100644 --- a/Wikipedia/assets/about.html +++ b/Wikipedia/assets/about.html @@ -96,7 +96,7 @@ - + footer diff --git a/www/about.html b/www/about.html index 52a5665..d979f2a 100644 --- a/www/about.html +++ b/www/about.html @@ -96,7 +96,7 @@ - + footer -- To view, visit https://gerrit.wikimedia.org/r/217196 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I13f4ccb15e50080923f307100c6293eb15c8e271 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list Medi
[MediaWiki-commits] [Gerrit] Fix for lead image not fading in. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/217045 Change subject: Fix for lead image not fading in. .. Fix for lead image not fading in. Fix for landscape article title tap causing image gallery to appear. Fix for some lead image compiler warnings. Set animation duration to 0.5 seconds Bug: T101072 Change-Id: I626c100fcc49f1e9eb51e682a6b0290b85e031d9 --- M Wikipedia/Images.xcassets/lead-default.imageset/lead-default.png M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/assets/styleoverrides.css M www/less/leadImage.less 4 files changed, 74 insertions(+), 49 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/45/217045/1 diff --git a/Wikipedia/Images.xcassets/lead-default.imageset/lead-default.png b/Wikipedia/Images.xcassets/lead-default.imageset/lead-default.png index 496004f..35baa96 100644 --- a/Wikipedia/Images.xcassets/lead-default.imageset/lead-default.png +++ b/Wikipedia/Images.xcassets/lead-default.imageset/lead-default.png Binary files differ diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 28663f4..21d80b0 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -1540,8 +1540,7 @@ NSString* title = article.displaytitle; NSString* description = article.entityDescription ? [[article.entityDescription wmf_stringByRemovingHTML] wmf_stringByCapitalizingFirstCharacter] : @""; -BOOL hasImage = article.imageURL ? YES : NO; -CGFloat fontMultiplier = [self leadImageGetSizeReductionMultiplierForTitleOfLength:title.length]; +BOOL hasImage = article.imageURL != nil; // offsetY is percent to shift image vertically. 0 aligns top to top of lead_image_div, // 50 centers it vertically, and 100 aligns bottom of image to bottom of lead_image_div. @@ -1554,36 +1553,32 @@ } } -NSString* leadImageDivStyleOverrides = -!hasImage ? @"" : [NSString stringWithFormat: - @"background-image:-webkit-linear-gradient(top, rgba(0,0,0,0.0) 0%%, rgba(0,0,0,0.5) 100%%)," - @"url('%@')" - @"%@;" - "background-position: 50%% %ld%%;", - article.imageURL, - [article.image isCached] ? @"" : @",url('wmf://bundledImage/lead-default.png')", - offsetY]; +static NSString* formatString = +@"" +"" +"" +"" +"%@" +"%@" +"" +""; -NSString* leadImageHtml = -[NSString stringWithFormat: - @"" - "" - "%@" - "%@" - "" - "", - leadImageDivStyleOverrides, - [NSString stringWithFormat:@"font-size:%.02fpx;", 34.0f * fontMultiplier], +NSString* html = +[NSString stringWithFormat:formatString, + article.imageURL, + (long)offsetY, + [article.image isCached] ? @"display:none;" : @"", + 34.0f* [self leadImageGetSizeReductionMultiplierForTitleOfLength:title.length], title, - [NSString stringWithFormat:@"font-size:%.02fpx;", 17.0f], + 17.0f, description ]; if (!hasImage) { -leadImageHtml = [NSString stringWithFormat:@"%@", leadImageHtml]; +html = [NSString stringWithFormat:@"%@", html]; } -return leadImageHtml; +return html; } - (CGFloat)leadImageGetSizeReductionMultiplierForTitleOfLength:(NSUInteger)length { @@ -1621,32 +1616,20 @@ } - (NSInteger)leadImageFocalOffsetYPercentageFromTopOfRect:(CGRect)rect { -float percentFromTop = (CGRectGetMidY(rect) * 100.0f); -return @(MAX(0, MIN(100, percentFromTop))).integerValue; -} - -+ (NSString*)hidePlaceholderJS { -#warning FIXME: abstract away "get lead image div" logic -return @"document.getElementById('lead_image_div').style.backgroundImage = document.getElementById('lead_image_div').style.backgroundImage.replace('wmf://bundledImage/lead-default.png', 'wmf://bundledImage/empty.png');"; +float percentFromTop = CGRectGetMidY(rect) * 100.0f; +return (NSInteger)(MAX(0.0f, MIN(100.0f, percentFromTop))); } - (void)leadImageHidePlaceHolderAndCenterOnFaceIfNeeded:(CGRect)rect { NSString* applyFocalOffsetJS = @""; if (!CGRectEqualToRect(rect, CGRectZero)) { -#warning FIXME: abstract away "get lead image div" logic applyFocalOffsetJS = -[NSString stringWithFormat:@"document.getElementById('lead_image_div').style.backgroundPosition = '100%% %d%%';", [self leadImageFocalOffsetYPercentageFromTopOfRect:rect]]; +[NSString stringWithFormat:@"document.getElementById('lead_image_div').style.
[MediaWiki-commits] [Gerrit] Fix for lead image not fading in. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/216911 Change subject: Fix for lead image not fading in. .. Fix for lead image not fading in. Fix for landscape article title tap causing image gallery to appear. Fix for some lead image compiler warnings. Bug: T101072 Change-Id: I14ecdeb2b05107572d784ab7b74b6900837eee24 --- M Wikipedia/Images.xcassets/lead-default.imageset/lead-default.png M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/assets/styleoverrides.css M www/less/leadImage.less 4 files changed, 74 insertions(+), 43 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/11/216911/1 diff --git a/Wikipedia/Images.xcassets/lead-default.imageset/lead-default.png b/Wikipedia/Images.xcassets/lead-default.imageset/lead-default.png index 496004f..35baa96 100644 --- a/Wikipedia/Images.xcassets/lead-default.imageset/lead-default.png +++ b/Wikipedia/Images.xcassets/lead-default.imageset/lead-default.png Binary files differ diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 28663f4..363d0d6 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -1540,8 +1540,7 @@ NSString* title = article.displaytitle; NSString* description = article.entityDescription ? [[article.entityDescription wmf_stringByRemovingHTML] wmf_stringByCapitalizingFirstCharacter] : @""; -BOOL hasImage = article.imageURL ? YES : NO; -CGFloat fontMultiplier = [self leadImageGetSizeReductionMultiplierForTitleOfLength:title.length]; +BOOL hasImage = article.imageURL ? YES : NO; // offsetY is percent to shift image vertically. 0 aligns top to top of lead_image_div, // 50 centers it vertically, and 100 aligns bottom of image to bottom of lead_image_div. @@ -1554,36 +1553,35 @@ } } -NSString* leadImageDivStyleOverrides = -!hasImage ? @"" : [NSString stringWithFormat: - @"background-image:-webkit-linear-gradient(top, rgba(0,0,0,0.0) 0%%, rgba(0,0,0,0.5) 100%%)," - @"url('%@')" - @"%@;" - "background-position: 50%% %ld%%;", - article.imageURL, - [article.image isCached] ? @"" : @",url('wmf://bundledImage/lead-default.png')", - offsetY]; +static NSString* formatString = nil; +if (!formatString) { +formatString = +@"" +"" +"" +"" +"%@" +"%@" +"" +""; +} -NSString* leadImageHtml = -[NSString stringWithFormat: - @"" - "" - "%@" - "%@" - "" - "", - leadImageDivStyleOverrides, - [NSString stringWithFormat:@"font-size:%.02fpx;", 34.0f * fontMultiplier], +NSString* html = +[NSString stringWithFormat:formatString, + article.imageURL, + (long)offsetY, + [article.image isCached] ? @"display:none;" : @"", + 34.0f* [self leadImageGetSizeReductionMultiplierForTitleOfLength:title.length], title, - [NSString stringWithFormat:@"font-size:%.02fpx;", 17.0f], + 17.0f, description ]; if (!hasImage) { -leadImageHtml = [NSString stringWithFormat:@"%@", leadImageHtml]; +html = [NSString stringWithFormat:@"%@", html]; } -return leadImageHtml; +return html; } - (CGFloat)leadImageGetSizeReductionMultiplierForTitleOfLength:(NSUInteger)length { @@ -1625,28 +1623,16 @@ return @(MAX(0, MIN(100, percentFromTop))).integerValue; } -+ (NSString*)hidePlaceholderJS { -#warning FIXME: abstract away "get lead image div" logic -return @"document.getElementById('lead_image_div').style.backgroundImage = document.getElementById('lead_image_div').style.backgroundImage.replace('wmf://bundledImage/lead-default.png', 'wmf://bundledImage/empty.png');"; -} - - (void)leadImageHidePlaceHolderAndCenterOnFaceIfNeeded:(CGRect)rect { NSString* applyFocalOffsetJS = @""; if (!CGRectEqualToRect(rect, CGRectZero)) { -#warning FIXME: abstract away "get lead image div" logic applyFocalOffsetJS = -[NSString stringWithFormat:@"document.getElementById('lead_image_div').style.backgroundPosition = '100%% %d%%';", [self leadImageFocalOffsetYPercentageFromTopOfRect:rect]]; +[NSString stringWithFormat:@"document.getElementById('lead_image_div').style.backgroundPosition = '100%% %ld%%';", (long)[self leadImageFocalOffsetYPercentageFromTopOfRect:rect]]; } -static NSString* animationCss = nil; -if (!animationCss) { -#warning FI
[MediaWiki-commits] [Gerrit] Tweak to lead image height and initial vertical offset. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/216004 Change subject: Tweak to lead image height and initial vertical offset. .. Tweak to lead image height and initial vertical offset. Bug: T101464 Change-Id: I30a3916d5402b4ed1544a29c69b7eba200644adf --- M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/assets/styleoverrides.css M www/less/leadImage.less 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/04/216004/1 diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 130cd16..4dad1ff 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -1545,7 +1545,7 @@ // offsetY is percent to shift image vertically. 0 aligns top to top of lead_image_div, // 50 centers it vertically, and 100 aligns bottom of image to bottom of lead_image_div. -NSInteger offsetY = 25; +NSInteger offsetY = 50; if (hasImage) { CGRect focalRect = [article.image primaryFocalRectNormalizedToImageSize:NO]; diff --git a/Wikipedia/assets/styleoverrides.css b/Wikipedia/assets/styleoverrides.css index 2eaee49..36378bd 100644 --- a/Wikipedia/assets/styleoverrides.css +++ b/Wikipedia/assets/styleoverrides.css @@ -1,5 +1,5 @@ .ios-disambiguation-item-anchor{display:block;padding-top:8px;padding-bottom:8px}.ios-issue-item{padding-top:8px;padding-bottom:8px}.ios-issue-item *{font-weight:normal !important}#disambig_sub_container,#issues_sub_container{background-color:#fff !important;border-bottom:1px solid #ccc;padding-top:6px;padding-bottom:12px;margin-bottom:12px}#issues_container_close_button{color:#333;display:none;font-weight:bold;padding:4px 20px 4px 20px}a.issues_button,a.disambig_button{padding:4px 0px 4px 0px !important}span.issues_separator{padding-top:4px!important;padding-bottom:4px!important}div.issues_container{margin-bottom:1.8em !important} .content table.infobox{font-size:100%;border-style:none !important}table.infobox caption{text-align:center;font-weight:bold}.app_table_container{width:100%;margin-top:14px;margin-bottom:14px;border-radius:2px;padding:1px;box-shadow:inset 0 0 1px gray}.app_table_collapsed_container{width:100%;padding-left:12px;padding-right:48px;padding-top:12px;padding-bottom:12px;line-height:120%;background-color:#f8f8f8;background-repeat:no-repeat;background-position:95% 50%;background-size:16px 16px}.app_table_collapsed_open{border-radius:2px;background-image:url(data:image/png;base64,iVBORw0KGgoNSUhEUgAAADAwCAYAAABXAvmHBGdBTUEAALGPC/xhBQlwSFlzAAAOwQAADsEBuJFr7QAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4zjOaXUoZJREFUaEPtmE1uE0EQhceEn1NwFEtwALL0CSzbe2+9QQgJAoKI8BeF8I8ImCQCIRCSxVk4QNhkxwZ4z+qOespvPNMzYxCiS/ricVVX1evpnukkWbJkyZIlS5Ys2f9ss9lsTr/fPz8ajV4Mh8Nv4Dv4OhgMLvr43wKaLkDLF3BEbdRIrT4+/wGhlxA8Br8MPxG74gf/adD7OjUYTeSYmjkmw5d18CMILoBZ37DFVw0E3lFaAqh5nROYBs5CUPC2arQCOuh1T2kQTLNer3cGF4cmIOFdEQ3bhOIfqt6CQ2qfJ7pJHJgBEt4dNgqatgXF76iegn1qZt5JgclkchqBd2ZgEdts6HOb0u12T+E52xV9FFNq9bm5Qm4Sb01CEY/YOMyvgxP/VNRfAOPehOJJrhjhAA5UBQRPmkwC+WvoxbNH1c6B7fUan2u2Ru6LhwNdgixmeA4WCpfBHPDK1SiD42SPBYeHCS5RFbQUNlC4rboX5BfiVqiwtnR6mIiVeBkWXMKe3Z+KmOcMvZ+VbVHpDGEBFOM2kU0MuTeExb2u901OEZWeL+m0xLwpwIF/R4c48ZUOTPTarfpykE4FC2JJH6uGgvfgrM/lNfjgYktBjx3kVD5jpLMItxJVD5yP4/H4HOG1iRURfUBKZwkxR/4n8Nn4JLgxD1jb9CpFOivQQdNtK6IuuCG1f7+Szop0eNeUoEi2RO3KSGcEXIn7RlAMm6JmFNIZC1birhC3FOTcUrVikc46YB+X/Ql4AsbeVDXqIJ11gbhNK1awoXLrIp1N4NYQoucgdk3lNEE6m8ItIsRfVWObIp1tANEbXjwmtLL/LUlnW3DLYAKXVawtkiVLlixZsn/Ysuw35enU+iMlJaQASUVORK5CYII=)}.app_table_collapse_close{border-radius:2px 2px 0px 0px}.app_table_collapse_icon{background-image:url(data:image/png;base64,iVBORw0KGgoNSUhEUgAAADAwCAYAAABXAvmHBGdBTUEAALGPC/xhBQlwSFlzAAAOwQAADsEBuJFr7QAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4zjOaXUoBJREFUaEPtmE1uE0EQhW3Mzyk4iiU4AFn6BJbtvbfeIIQEAUEUCEnE/58ImCQCIRCSxVk4AGyyYwN5L+qOxuXXM90zthCiS/ricXV11avunhkrrWzZsmXLlu2fttlstjJGo9GN4XB4VY0tC+lcBhC+Dv6QwWBwTcUsA+lsCgTf9uI92I3rKrYp0tkECL1jxXt4pNScJkhnXSByw4oWrKu5dZHOOuDYbAqxEh4xlaMO0pkKjsZ9JbQMHjWVKxXpTKANMQ+suAQ2RM4kpDOSNlZxW4hK5Z7IHY10RsCV3zVCaoN7Yos5TY0opLOCNgo+VEIEn8EX45NwN5nb1KpEOkN0u90zKPRYCRB8Go/HFwivzViIXdRJakI6FRSPlX8iiio+gPN+Lq/BRzdWCncXc6KbkE6LW/lnqqDgoNfrnbM56MPYoYmVcJdZ0+ZQSGcRJkLSF7ZIgOlkMjmr8hDXxL6ZE+JpTBPS6UGSDrb0lUkcYq9MvIcxiH1n5kpQ+3lVE9JJkKADXhcTlsC4jsqjcE3sFeYHwXF6ic9gbunkBHT/ppioBB6vaPEezgGNF2jBwdVB129NghBR5zQE5nfcCqvcc7gFXWhi7kvK+QSPmoj3MEfsE44La++z0wsn/r2dFCD5hVOGayL2BTn3pDv54x5vByZQgq2s/bulgpSfKPv+XZP0gkGBTVN02bCJHVVbcEjtvJGmZkCCxHdFwVXAJraUBsGUDayBXwXnAjift0ShlcLdVloKUPOaD76CL0eFQc9vjK3sfzpVoPZNajCayBE1M+Y0uN/vX3TP5O/gJ/iGoMt+/G8BTZeg5Sv4QW3USK1+PFu2bNmyZcuW7f+1VusYzYvU+uNoBCAASUVORK5CYII=)}.app_span_collapse_text{color:#808080}.app_table_collapsed_bottom{width:100
[MediaWiki-commits] [Gerrit] Fix for wonky spacing around text beneath widened images. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/215827 Change subject: Fix for wonky spacing around text beneath widened images. .. Fix for wonky spacing around text beneath widened images. Bug: T101186 Change-Id: Ib476ecf4227df373617420912b993ccad42cb7d4 --- M Wikipedia/assets/styleoverrides.css M www/less/widenImages.less 2 files changed, 13 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/27/215827/1 diff --git a/Wikipedia/assets/styleoverrides.css b/Wikipedia/assets/styleoverrides.css index b3ac127..2eaee49 100644 --- a/Wikipedia/assets/styleoverrides.css +++ b/Wikipedia/assets/styleoverrides.css @@ -2,4 +2,4 @@ .content table.infobox{font-size:100%;border-style:none !important}table.infobox caption{text-align:center;font-weight:bold}.app_table_container{width:100%;margin-top:14px;margin-bottom:14px;border-radius:2px;padding:1px;box-shadow:inset 0 0 1px gray}.app_table_collapsed_container{width:100%;padding-left:12px;padding-right:48px;padding-top:12px;padding-bottom:12px;line-height:120%;background-color:#f8f8f8;background-repeat:no-repeat;background-position:95% 50%;background-size:16px 16px}.app_table_collapsed_open{border-radius:2px;background-image:url(data:image/png;base64,iVBORw0KGgoNSUhEUgAAADAwCAYAAABXAvmHBGdBTUEAALGPC/xhBQlwSFlzAAAOwQAADsEBuJFr7QAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4zjOaXUoZJREFUaEPtmE1uE0EQhceEn1NwFEtwALL0CSzbe2+9QQgJAoKI8BeF8I8ImCQCIRCSxVk4QNhkxwZ4z+qOespvPNMzYxCiS/ricVVX1evpnukkWbJkyZIlS5Ys2f9ss9lsTr/fPz8ajV4Mh8Nv4Dv4OhgMLvr43wKaLkDLF3BEbdRIrT4+/wGhlxA8Br8MPxG74gf/adD7OjUYTeSYmjkmw5d18CMILoBZ37DFVw0E3lFaAqh5nROYBs5CUPC2arQCOuh1T2kQTLNer3cGF4cmIOFdEQ3bhOIfqt6CQ2qfJ7pJHJgBEt4dNgqatgXF76iegn1qZt5JgclkchqBd2ZgEdts6HOb0u12T+E52xV9FFNq9bm5Qm4Sb01CEY/YOMyvgxP/VNRfAOPehOJJrhjhAA5UBQRPmkwC+WvoxbNH1c6B7fUan2u2Ru6LhwNdgixmeA4WCpfBHPDK1SiD42SPBYeHCS5RFbQUNlC4rboX5BfiVqiwtnR6mIiVeBkWXMKe3Z+KmOcMvZ+VbVHpDGEBFOM2kU0MuTeExb2u901OEZWeL+m0xLwpwIF/R4c48ZUOTPTarfpykE4FC2JJH6uGgvfgrM/lNfjgYktBjx3kVD5jpLMItxJVD5yP4/H4HOG1iRURfUBKZwkxR/4n8Nn4JLgxD1jb9CpFOivQQdNtK6IuuCG1f7+Szop0eNeUoEi2RO3KSGcEXIn7RlAMm6JmFNIZC1birhC3FOTcUrVikc46YB+X/Ql4AsbeVDXqIJ11gbhNK1awoXLrIp1N4NYQoucgdk3lNEE6m8ItIsRfVWObIp1tANEbXjwmtLL/LUlnW3DLYAKXVawtkiVLlixZsn/Ysuw35enU+iMlJaQASUVORK5CYII=)}.app_table_collapse_close{border-radius:2px 2px 0px 0px}.app_table_collapse_icon{background-image:url(data:image/png;base64,iVBORw0KGgoNSUhEUgAAADAwCAYAAABXAvmHBGdBTUEAALGPC/xhBQlwSFlzAAAOwQAADsEBuJFr7QAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4zjOaXUoBJREFUaEPtmE1uE0EQhW3Mzyk4iiU4AFn6BJbtvbfeIIQEAUEUCEnE/58ImCQCIRCSxVk4AGyyYwN5L+qOxuXXM90zthCiS/ricXV11avunhkrrWzZsmXLlu2fttlstjJGo9GN4XB4VY0tC+lcBhC+Dv6QwWBwTcUsA+lsCgTf9uI92I3rKrYp0tkECL1jxXt4pNScJkhnXSByw4oWrKu5dZHOOuDYbAqxEh4xlaMO0pkKjsZ9JbQMHjWVKxXpTKANMQ+suAQ2RM4kpDOSNlZxW4hK5Z7IHY10RsCV3zVCaoN7Yos5TY0opLOCNgo+VEIEn8EX45NwN5nb1KpEOkN0u90zKPRYCRB8Go/HFwivzViIXdRJakI6FRSPlX8iiio+gPN+Lq/BRzdWCncXc6KbkE6LW/lnqqDgoNfrnbM56MPYoYmVcJdZ0+ZQSGcRJkLSF7ZIgOlkMjmr8hDXxL6ZE+JpTBPS6UGSDrb0lUkcYq9MvIcxiH1n5kpQ+3lVE9JJkKADXhcTlsC4jsqjcE3sFeYHwXF6ic9gbunkBHT/ppioBB6vaPEezgGNF2jBwdVB129NghBR5zQE5nfcCqvcc7gFXWhi7kvK+QSPmoj3MEfsE44La++z0wsn/r2dFCD5hVOGayL2BTn3pDv54x5vByZQgq2s/bulgpSfKPv+XZP0gkGBTVN02bCJHVVbcEjtvJGmZkCCxHdFwVXAJraUBsGUDayBXwXnAjift0ShlcLdVloKUPOaD76CL0eFQc9vjK3sfzpVoPZNajCayBE1M+Y0uN/vX3TP5O/gJ/iGoMt+/G8BTZeg5Sv4QW3USK1+PFu2bNmyZcuW7f+1VusYzYvU+uNoBCAASUVORK5CYII=)}.app_span_collapse_text{color:#808080}.app_table_collapsed_bottom{width:100%;color:#808080;padding-left:12px;padding-right:48px;padding-top:12px;padding-bottom:12px;line-height:120%;border-radius:0px 0px 2px 2px;background-color:#f8f8f8;background-repeat:no-repeat;background-position:95% 50%;background-size:16px 16px} .content{margin-top:0px}.lead_image_div{margin-left:-16px !important;margin-right:-16px !important;transition-timing-function:ease-in-out}div#lead_image_none div.lead_image_div{height:auto !important}#lead_image_text_container{padding:16px;pointer-events:none !important}div#lead_image_none div#lead_image_text_container{position:relative !important;padding-bottom:0px !important;padding-top:0px !important}#lead_image_title,#lead_image_description{font-family:Times New Roman;pointer-events:none !important}#lead_image_title{padding-top:4px;line-height:100%;margin-top:6px;margin-bottom:6px}div#lead_image_none div#lead_image_title{color:#000 !important;text-shadow:none !important}#lead_image_description{line-height:117%}div#lead_image_none div#lead_image_description{color:#000 !important;text-shadow:none !important}@media (orientation:portrait){.lead_image_div{height:150pt;background-repeat:no-repeat;background-size:cover;color:#fff;position:relative}#lead_image_text_container{position:absolute;bottom:0px}#lead_image_title,#lead_image_description{text-shadow:0 1px .5px rgba(0,0,0,0.2
[MediaWiki-commits] [Gerrit] Move article image interception out of URLCache.m into proto... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/215812 Change subject: Move article image interception out of URLCache.m into protocol. .. Move article image interception out of URLCache.m into protocol. Fixes issue with size variants not always being routed to data store. More performant as saveImageToDataCache is now dispatched async. Fixes edge case bug with URLCache image interception which could cause images not to get routed to the data store if an article was loaded, then its data record removed (by clearing recent and saved pages) then the article was immediately reloaded. T97730 Change-Id: I1fae1ca0fc29ceb8b9aa2c4a6e6fd3a285087bcd --- M MediaWikiKit/MediaWikiKit/MWKImageList.m M Wikipedia.xcodeproj/project.pbxproj M Wikipedia/Categories/NSURL+WMFRest.h M Wikipedia/Categories/NSURL+WMFRest.m A Wikipedia/Custom Objects/WMFURLCache.h A Wikipedia/Custom Objects/WMFURLCache.m A Wikipedia/Protocols/WMFArticleImageProtocol.h A Wikipedia/Protocols/WMFArticleImageProtocol.m M Wikipedia/Session/SessionSingleton.m M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/View Controllers/WebView/WebViewController_Private.h D Wikipedia/Web Image Interception/URLCache.h D Wikipedia/Web Image Interception/URLCache.m 13 files changed, 324 insertions(+), 245 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/12/215812/1 diff --git a/MediaWikiKit/MediaWikiKit/MWKImageList.m b/MediaWikiKit/MediaWikiKit/MWKImageList.m index 05e002e..5c4d0be 100644 --- a/MediaWikiKit/MediaWikiKit/MWKImageList.m +++ b/MediaWikiKit/MediaWikiKit/MWKImageList.m @@ -142,7 +142,7 @@ }]; return arr2; } else { -NSLog(@"no variants for %@", baseName); +//NSLog(@"no variants for %@", baseName); return @[]; } } diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index e4847e2..928250b 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -40,6 +40,7 @@ 042B3996192EAEEA0066B270 /* ShareMenuSavePageActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = 042B3995192EAEEA0066B270 /* ShareMenuSavePageActivity.m */; }; 042BEAEF1A92EE66002CF320 /* UIWebView+WMFTrackingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 042BEAEE1A92EE66002CF320 /* UIWebView+WMFTrackingView.m */; }; 042E3B931AA16D6700BF8D66 /* UIViewController+WMFChildViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 042E3B921AA16D6700BF8D66 /* UIViewController+WMFChildViewController.m */; }; + 0433263F1B0D3574009DB316 /* WMFArticleImageProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 0433263E1B0D3574009DB316 /* WMFArticleImageProtocol.m */; }; 0433542218A023FE009305F0 /* UIViewController+HideKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 0433542118A023FE009305F0 /* UIViewController+HideKeyboard.m */; }; 0433542618A093C5009305F0 /* UIView+RemoveConstraints.m in Sources */ = {isa = PBXBuildFile; fileRef = 0433542518A093C5009305F0 /* UIView+RemoveConstraints.m */; }; 0439317619FB092600386E8F /* UIWebView+LoadAssetsHtml.m in Sources */ = {isa = PBXBuildFile; fileRef = 0439317519FB092600386E8F /* UIWebView+LoadAssetsHtml.m */; }; @@ -116,12 +117,12 @@ 0487049019F8262600B7D307 /* WikiTextSectionUploader.m in Sources */ = {isa = PBXBuildFile; fileRef = 0487047D19F8262600B7D307 /* WikiTextSectionUploader.m */; }; 048830D21AB775E3005BF3A1 /* UIScrollView+WMFScrollsToTop.m in Sources */ = {isa = PBXBuildFile; fileRef = 048830D11AB775E3005BF3A1 /* UIScrollView+WMFScrollsToTop.m */; }; 048830D31AB775E3005BF3A1 /* UIScrollView+WMFScrollsToTop.m in Sources */ = {isa = PBXBuildFile; fileRef = 048830D11AB775E3005BF3A1 /* UIScrollView+WMFScrollsToTop.m */; }; + 049289291B1FBC1800BE4B21 /* WMFURLCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 049289281B1FBC1800BE4B21 /* WMFURLCache.m */; }; 0493C2CC1952373100EBB973 /* DataHousekeeping.m in Sources */ = {isa = PBXBuildFile; fileRef = 0493C2CB1952373100EBB973 /* DataHousekeeping.m */; }; 0493C2D419526A0100EBB973 /* WikiFont-Glyphs.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0493C2D319526A0100EBB973 /* WikiFont-Glyphs.ttf */; }; 049566C218F5F4CB0058EA12 /* ZeroConfigState.m in Sources */ = {isa = PBXBuildFile; fileRef = 049566C118F5F4CB0058EA12 /* ZeroConfigState.m */; }; 049B2BDB1AB9016A00CE27FF /* MWKArticle+ConvenienceSpecs in Resources */ = {isa = PBXBuildFile; fileRef = 049B2BDA1AB9016A00CE27FF /* MWKArticle+ConvenienceSpecs */; }; 049B640C18AAF36200D98BD4 /* UIViewController+SearchChildViewControllers.m in Sources */ = {isa = PBXBuildF
[MediaWiki-commits] [Gerrit] Fix to makefile so it pulls same upstream css as before. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/215771 Change subject: Fix to makefile so it pulls same upstream css as before. .. Fix to makefile so it pulls same upstream css as before. The mobile app extension css handling changed: https://gerrit.wikimedia.org/r/#/c/213431 This means we needed to tweak the url the make file was using to retrieve css so we get the same css as before. Change-Id: I8c91b06cb15d69b8ff367ba84cc61ee55acd4e5e --- M Makefile M Wikipedia/assets/abusefilter.css M Wikipedia/assets/preview.css M Wikipedia/assets/styles.css 4 files changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/71/215771/1 diff --git a/Makefile b/Makefile index 8a20fb4..2caa142 100644 --- a/Makefile +++ b/Makefile @@ -113,7 +113,7 @@ web: ##Make web assets web: css grunt -CSS_ORIGIN = http://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&lang=en&only=styles&skin=vector&modules= +CSS_ORIGIN = http://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&lang=en&only=styles&skin=vector&modules=skins.minerva.base.reset|skins.minerva.content.styles| WEB_ASSETS_DIR = "Wikipedia/assets" define get_css_module diff --git a/Wikipedia/assets/abusefilter.css b/Wikipedia/assets/abusefilter.css index 5044b68..4e43e3e 100644 --- a/Wikipedia/assets/abusefilter.css +++ b/Wikipedia/assets/abusefilter.css @@ -1,2 +1,2 @@ -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,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;background:none}table,caption,tbody,tfoot,thead,tr,th,td{font-size:100%}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% !important}.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{-webkit-hyphens:auto;-moz-hyphens:auto;-ms-hyphens:auto;hyphens:auto;font-family:"Linux Libertine",Georgia,Times,serif;font-size:1.7em;-ms-word-break:normal;word-break:normal;word-wrap:break-word}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 ol,.content ul ul{margin-left:1em}.content ol li,.content ul li{margin-bottom:10px}.content ol li:last-child,.content ul li:last-child{margin-bottom:inherit}.content ul{list-style:square inside}.content ul>li>ul{list-style-type:disc}.content ul>li>ul>li>ul{list-style-type:circle}.content ol{list-style:decimal inside}dl{margin-left:1em}dl dt{font-weight:bold}.hlist > ul li,ul.hlist li{display:inline-block;margin-right:8px}a{text-decoration:none;color:#002bb8}a:visited{color:#5a3696}a:active{color:#faa700}a:hover{text-decoration
[MediaWiki-commits] [Gerrit] Fix for article not reloading from cache on app start. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/215277 Change subject: Fix for article not reloading from cache on app start. .. Fix for article not reloading from cache on app start. Also fixed issue with both article Images.plist and section Images.plist being doubled in size every time an article was refreshed. Change-Id: I8d461cb09c6b6a7381ba5ee01fc9cadcd6f49c17 --- M MediaWikiKit/MediaWikiKit/MWKImageList.m M Wikipedia/C Methods/WMFArticleParsing.m M Wikipedia/Networking/Fetchers/ArticleFetcher.m M Wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m M Wikipedia/View Controllers/WebView/WebViewController.h M Wikipedia/View Controllers/WebView/WebViewController.m 6 files changed, 34 insertions(+), 17 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/77/215277/1 diff --git a/MediaWikiKit/MediaWikiKit/MWKImageList.m b/MediaWikiKit/MediaWikiKit/MWKImageList.m index 63d5208..2203b01 100644 --- a/MediaWikiKit/MediaWikiKit/MWKImageList.m +++ b/MediaWikiKit/MediaWikiKit/MWKImageList.m @@ -88,7 +88,12 @@ } - (BOOL)hasImageURL:(NSString*)imageURL { -return [self imageWithURL:imageURL] != nil; +imageURL = [imageURL wmf_schemelessURL]; +if (imageURL && imageURL.length > 0 && [self.entries containsObject:imageURL]) { +return YES; +} else { +return NO; +} } - (MWKImage*)imageWithURL:(NSString*)imageURL { @@ -185,6 +190,7 @@ } - (BOOL)addImageURLIfAbsent:(NSString*)imageURL { +imageURL = [imageURL wmf_schemelessURL]; if (imageURL && imageURL.length > 0 && ![self.entries containsObject:imageURL]) { [self addImageURL:imageURL]; return YES; diff --git a/Wikipedia/C Methods/WMFArticleParsing.m b/Wikipedia/C Methods/WMFArticleParsing.m index bae2a5a..d2424de 100644 --- a/Wikipedia/C Methods/WMFArticleParsing.m +++ b/Wikipedia/C Methods/WMFArticleParsing.m @@ -97,20 +97,22 @@ } } -MWKImage* image = [article importImageURL:srcTagImageURL sectionId:sectionID]; +if (![article.images hasImageURL:srcTagImageURL]) { +MWKImage* image = [article importImageURL:srcTagImageURL sectionId:sectionID]; -// If img tag dimensions were extracted, save them so they don't have to be expensively determined later. -if (imgWidth && imgHeight) { -// Don't record dimensions if image file name doesn't have size prefix. -// (Sizes from the img tag don't tend to correspond closely to actual -// image binary sizes for these.) -if ([MWKImage fileSizePrefix:srcTagImageURL] != NSNotFound) { -image.width = @(imgWidth.integerValue * density); -image.height = @(imgHeight.integerValue * density); +// If img tag dimensions were extracted, save them so they don't have to be expensively determined later. +if (imgWidth && imgHeight) { +// Don't record dimensions if image file name doesn't have size prefix. +// (Sizes from the img tag don't tend to correspond closely to actual +// image binary sizes for these.) +if ([MWKImage fileSizePrefix:srcTagImageURL] != NSNotFound) { +image.width = @(imgWidth.integerValue * density); +image.height = @(imgHeight.integerValue * density); +} } -} -[image save]; +[image save]; +} } } diff --git a/Wikipedia/Networking/Fetchers/ArticleFetcher.m b/Wikipedia/Networking/Fetchers/ArticleFetcher.m index 320b68a..54ebdd8 100644 --- a/Wikipedia/Networking/Fetchers/ArticleFetcher.m +++ b/Wikipedia/Networking/Fetchers/ArticleFetcher.m @@ -224,6 +224,10 @@ if (title) { NSString* thumbURL = map[title]; if (thumbURL) { +if ([self.article.images hasImageURL:thumbURL]) { +return; +} + // Associate Search/Nearby thumb url with article.thumbnailURL. if (thumbURL) { self.article.thumbnailURL = thumbURL; diff --git a/Wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m b/Wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m index a9c61d7..3bb03cd 100644 --- a/Wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m +++ b/Wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m @@ -506,7 +506,7 @@ [self.funnel logSavedRevision:[fetchedData[@"newrevid"] intValue]]; WebViewController* webVC = [self.navigationController searchNavStackForViewControllerOfClass:[WebViewController class]]; -[webVC reloadCurrentArticle]; +[webVC reloadCurrentArticleFromNetwork]; [ROOT popToViewController:webVC animated:YES]; }
[MediaWiki-commits] [Gerrit] Fix for images sometimes not being routed to data store. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/213546 Change subject: Fix for images sometimes not being routed to data store. .. Fix for images sometimes not being routed to data store. Change-Id: Ic936ac9eb886e0710b898ba328eb31268755ea4b --- M Wikipedia/Web Image Interception/URLCache.m 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/46/213546/1 diff --git a/Wikipedia/Web Image Interception/URLCache.m b/Wikipedia/Web Image Interception/URLCache.m index c180ff0..0eb456f 100644 --- a/Wikipedia/Web Image Interception/URLCache.m +++ b/Wikipedia/Web Image Interception/URLCache.m @@ -145,7 +145,7 @@ // created when the section html was parsed to create sectionImage records, in which case // a request needs to actually be made, so set cachedResponse to nil so this happens. // URLCacheLog(@"imageFromDB.data = %@", imageFromDB.data); -if (imageFromDB && !imageFromDB.dateRetrieved) { +if (![imageFromDB isCached]) { cachedResponse = nil; } else if (imageFromDB) { NSData* imageData = [self.article.dataStore imageDataWithImage:imageFromDB]; -- To view, visit https://gerrit.wikimedia.org/r/213546 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic936ac9eb886e0710b898ba328eb31268755ea4b Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix for math symbols and other small images being incorrectl... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/212236 Change subject: Fix for math symbols and other small images being incorrectly widened. .. Fix for math symbols and other small images being incorrectly widened. Bug: T99754 Change-Id: Ia1bb7b9addd9f3afdadaae994ededd9ac1955ca4 --- M Wikipedia/assets/bundle.js M www/js/transforms/widenImages.js 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/36/212236/1 diff --git a/Wikipedia/assets/bundle.js b/Wikipedia/assets/bundle.js index 4caa142..1d71d9d 100644 --- a/Wikipedia/assets/bundle.js +++ b/Wikipedia/assets/bundle.js @@ -986,6 +986,7 @@ function shouldWidenImage(image) { if ( image.width >= 64 && +image.hasAttribute('srcset') && !image.hasAttribute('hasOverflowXContainer') && !utilities.isNestedInTable(image) ) { diff --git a/www/js/transforms/widenImages.js b/www/js/transforms/widenImages.js index 6f8c035..7c21e5a 100644 --- a/www/js/transforms/widenImages.js +++ b/www/js/transforms/widenImages.js @@ -26,6 +26,7 @@ function shouldWidenImage(image) { if ( image.width >= 64 && +image.hasAttribute('srcset') && !image.hasAttribute('hasOverflowXContainer') && !utilities.isNestedInTable(image) ) { -- To view, visit https://gerrit.wikimedia.org/r/212236 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia1bb7b9addd9f3afdadaae994ededd9ac1955ca4 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix for lead image title gradient not being hidden on landsc... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/212230 Change subject: Fix for lead image title gradient not being hidden on landscape iOS 6. .. Fix for lead image title gradient not being hidden on landscape iOS 6. Bug: T99698 Change-Id: I2c920feb470ab6c6cbcb3b5483d12151c4099725 --- M Wikipedia/assets/styleoverrides.css M www/less/leadImage.less 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/30/212230/1 diff --git a/Wikipedia/assets/styleoverrides.css b/Wikipedia/assets/styleoverrides.css index 399b030..b3ac127 100644 --- a/Wikipedia/assets/styleoverrides.css +++ b/Wikipedia/assets/styleoverrides.css @@ -1,5 +1,5 @@ .ios-disambiguation-item-anchor{display:block;padding-top:8px;padding-bottom:8px}.ios-issue-item{padding-top:8px;padding-bottom:8px}.ios-issue-item *{font-weight:normal !important}#disambig_sub_container,#issues_sub_container{background-color:#fff !important;border-bottom:1px solid #ccc;padding-top:6px;padding-bottom:12px;margin-bottom:12px}#issues_container_close_button{color:#333;display:none;font-weight:bold;padding:4px 20px 4px 20px}a.issues_button,a.disambig_button{padding:4px 0px 4px 0px !important}span.issues_separator{padding-top:4px!important;padding-bottom:4px!important}div.issues_container{margin-bottom:1.8em !important} .content table.infobox{font-size:100%;border-style:none !important}table.infobox caption{text-align:center;font-weight:bold}.app_table_container{width:100%;margin-top:14px;margin-bottom:14px;border-radius:2px;padding:1px;box-shadow:inset 0 0 1px gray}.app_table_collapsed_container{width:100%;padding-left:12px;padding-right:48px;padding-top:12px;padding-bottom:12px;line-height:120%;background-color:#f8f8f8;background-repeat:no-repeat;background-position:95% 50%;background-size:16px 16px}.app_table_collapsed_open{border-radius:2px;background-image:url(data:image/png;base64,iVBORw0KGgoNSUhEUgAAADAwCAYAAABXAvmHBGdBTUEAALGPC/xhBQlwSFlzAAAOwQAADsEBuJFr7QAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4zjOaXUoZJREFUaEPtmE1uE0EQhceEn1NwFEtwALL0CSzbe2+9QQgJAoKI8BeF8I8ImCQCIRCSxVk4QNhkxwZ4z+qOespvPNMzYxCiS/ricVVX1evpnukkWbJkyZIlS5Ys2f9ss9lsTr/fPz8ajV4Mh8Nv4Dv4OhgMLvr43wKaLkDLF3BEbdRIrT4+/wGhlxA8Br8MPxG74gf/adD7OjUYTeSYmjkmw5d18CMILoBZ37DFVw0E3lFaAqh5nROYBs5CUPC2arQCOuh1T2kQTLNer3cGF4cmIOFdEQ3bhOIfqt6CQ2qfJ7pJHJgBEt4dNgqatgXF76iegn1qZt5JgclkchqBd2ZgEdts6HOb0u12T+E52xV9FFNq9bm5Qm4Sb01CEY/YOMyvgxP/VNRfAOPehOJJrhjhAA5UBQRPmkwC+WvoxbNH1c6B7fUan2u2Ru6LhwNdgixmeA4WCpfBHPDK1SiD42SPBYeHCS5RFbQUNlC4rboX5BfiVqiwtnR6mIiVeBkWXMKe3Z+KmOcMvZ+VbVHpDGEBFOM2kU0MuTeExb2u901OEZWeL+m0xLwpwIF/R4c48ZUOTPTarfpykE4FC2JJH6uGgvfgrM/lNfjgYktBjx3kVD5jpLMItxJVD5yP4/H4HOG1iRURfUBKZwkxR/4n8Nn4JLgxD1jb9CpFOivQQdNtK6IuuCG1f7+Szop0eNeUoEi2RO3KSGcEXIn7RlAMm6JmFNIZC1birhC3FOTcUrVikc46YB+X/Ql4AsbeVDXqIJ11gbhNK1awoXLrIp1N4NYQoucgdk3lNEE6m8ItIsRfVWObIp1tANEbXjwmtLL/LUlnW3DLYAKXVawtkiVLlixZsn/Ysuw35enU+iMlJaQASUVORK5CYII=)}.app_table_collapse_close{border-radius:2px 2px 0px 0px}.app_table_collapse_icon{background-image:url(data:image/png;base64,iVBORw0KGgoNSUhEUgAAADAwCAYAAABXAvmHBGdBTUEAALGPC/xhBQlwSFlzAAAOwQAADsEBuJFr7QAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4zjOaXUoBJREFUaEPtmE1uE0EQhW3Mzyk4iiU4AFn6BJbtvbfeIIQEAUEUCEnE/58ImCQCIRCSxVk4AGyyYwN5L+qOxuXXM90zthCiS/ricXV11avunhkrrWzZsmXLlu2fttlstjJGo9GN4XB4VY0tC+lcBhC+Dv6QwWBwTcUsA+lsCgTf9uI92I3rKrYp0tkECL1jxXt4pNScJkhnXSByw4oWrKu5dZHOOuDYbAqxEh4xlaMO0pkKjsZ9JbQMHjWVKxXpTKANMQ+suAQ2RM4kpDOSNlZxW4hK5Z7IHY10RsCV3zVCaoN7Yos5TY0opLOCNgo+VEIEn8EX45NwN5nb1KpEOkN0u90zKPRYCRB8Go/HFwivzViIXdRJakI6FRSPlX8iiio+gPN+Lq/BRzdWCncXc6KbkE6LW/lnqqDgoNfrnbM56MPYoYmVcJdZ0+ZQSGcRJkLSF7ZIgOlkMjmr8hDXxL6ZE+JpTBPS6UGSDrb0lUkcYq9MvIcxiH1n5kpQ+3lVE9JJkKADXhcTlsC4jsqjcE3sFeYHwXF6ic9gbunkBHT/ppioBB6vaPEezgGNF2jBwdVB129NghBR5zQE5nfcCqvcc7gFXWhi7kvK+QSPmoj3MEfsE44La++z0wsn/r2dFCD5hVOGayL2BTn3pDv54x5vByZQgq2s/bulgpSfKPv+XZP0gkGBTVN02bCJHVVbcEjtvJGmZkCCxHdFwVXAJraUBsGUDayBXwXnAjift0ShlcLdVloKUPOaD76CL0eFQc9vjK3sfzpVoPZNajCayBE1M+Y0uN/vX3TP5O/gJ/iGoMt+/G8BTZeg5Sv4QW3USK1+PFu2bNmyZcuW7f+1VusYzYvU+uNoBCAASUVORK5CYII=)}.app_span_collapse_text{color:#808080}.app_table_collapsed_bottom{width:100%;color:#808080;padding-left:12px;padding-right:48px;padding-top:12px;padding-bottom:12px;line-height:120%;border-radius:0px 0px 2px 2px;background-color:#f8f8f8;background-repeat:no-repeat;background-position:95% 50%;background-size:16px 16px} -.content{margin-top:0px}.lead_image_div{margin-left:-16px !important;margin-right:-16px !important;transition-timing-function:ease-in-out}div#lead_image_none div.lead_image_div{height:auto !important}#lead_image_text_container{padding:16px;pointer-events:none !important}div#lead_image_none div#lead_image_text_container{position:relative !important;padding-bottom:0px !important;padding-top:0px !important}#lead_image_title,#lead
[MediaWiki-commits] [Gerrit] More warning clean up Follow on to https://gerrit.wikimedia.... - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: More warning clean up Follow on to https://gerrit.wikimedia.org/r/#/c/211730/ .. More warning clean up Follow on to https://gerrit.wikimedia.org/r/#/c/211730/ Down to 18 warnings… so close! Change-Id: I27dc7e8b0e8292028f8cfe18da9b5c0b481c9235 --- M Wikipedia/Categories/Alerts/AlertLabel.m M Wikipedia/Categories/UICollectionViewFlowLayout+AttributeUtils.m M Wikipedia/Custom Views/PaddedLabel.h M Wikipedia/View Controllers/PullToRefresh/PullToRefreshViewController.m M Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.m M Wikipedia/View Controllers/WebView/WebViewController.m 6 files changed, 12 insertions(+), 14 deletions(-) Approvals: Mhurd: Looks good to me, approved jenkins-bot: Verified diff --git a/Wikipedia/Categories/Alerts/AlertLabel.m b/Wikipedia/Categories/Alerts/AlertLabel.m index 9934961..0c3208a 100644 --- a/Wikipedia/Categories/Alerts/AlertLabel.m +++ b/Wikipedia/Categories/Alerts/AlertLabel.m @@ -8,10 +8,8 @@ @interface AlertLabel () -@property (nonatomic) CGFloat duration; -@property (nonatomic) UIEdgeInsets padding; -@property (nonatomic, strong) id text; -@property (nonatomic) AlertType type; +@property (nonatomic, assign) CGFloat duration; +@property (nonatomic, assign) AlertType type; @end diff --git a/Wikipedia/Categories/UICollectionViewFlowLayout+AttributeUtils.m b/Wikipedia/Categories/UICollectionViewFlowLayout+AttributeUtils.m index 9da..eb8cc10 100644 --- a/Wikipedia/Categories/UICollectionViewFlowLayout+AttributeUtils.m +++ b/Wikipedia/Categories/UICollectionViewFlowLayout+AttributeUtils.m @@ -18,8 +18,8 @@ - (NSArray*)wmf_sortAttributesByLeadingEdgeDistance:(NSArray*)attributes toPoint:(CGPoint)point { return [attributes sortedArrayUsingComparator:^NSComparisonResult (UICollectionViewLayoutAttributes* attr1, UICollectionViewLayoutAttributes* attr2) { -float leadingEdgeDistance1 = fabsf(point.x - attr1.frame.origin.x); -float leadingEdgeDistance2 = fabsf(point.x - attr2.frame.origin.x); +float leadingEdgeDistance1 = fabs(point.x - attr1.frame.origin.x); +float leadingEdgeDistance2 = fabs(point.x - attr2.frame.origin.x); return leadingEdgeDistance1 - leadingEdgeDistance2; }]; } diff --git a/Wikipedia/Custom Views/PaddedLabel.h b/Wikipedia/Custom Views/PaddedLabel.h index 56ce996..7c8f708 100644 --- a/Wikipedia/Custom Views/PaddedLabel.h +++ b/Wikipedia/Custom Views/PaddedLabel.h @@ -7,6 +7,6 @@ @interface PaddedLabel : UILabel -@property (nonatomic) UIEdgeInsets padding; +@property (nonatomic, assign) UIEdgeInsets padding; @end diff --git a/Wikipedia/View Controllers/PullToRefresh/PullToRefreshViewController.m b/Wikipedia/View Controllers/PullToRefresh/PullToRefreshViewController.m index 6ed92ff..8750096 100644 --- a/Wikipedia/View Controllers/PullToRefresh/PullToRefreshViewController.m +++ b/Wikipedia/View Controllers/PullToRefresh/PullToRefreshViewController.m @@ -127,7 +127,7 @@ NSString* lineTwoText = [self refreshPromptString]; // pullUnit is 0.0 to 1.0 -CGFloat pullUnit = fabsf(scrollView.contentOffset.y) / pullDistance; +CGFloat pullUnit = fabs(scrollView.contentOffset.y) / pullDistance; //NSLog(@"%f", pullUnit); if (pullUnit < 0.35) { diff --git a/Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.m b/Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.m index 8189719..035eac3 100644 --- a/Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.m +++ b/Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.m @@ -18,10 +18,10 @@ @interface WMFShareOptionsViewController () @property (strong, nonatomic, readwrite) UIView* backgroundView; -@property (strong, nonatomic, readwrite) NSString* snippet; -@property (strong, nonatomic, readwrite) NSString* snippetForTextOnlySharing; +@property (copy, nonatomic, readwrite) NSString* snippet; +@property (copy, nonatomic, readwrite) NSString* snippetForTextOnlySharing; @property (strong, nonatomic, readwrite) MWKArticle* article; -@property (nonatomic, assign, readwrite) id delegate; +@property (nonatomic, weak, readwrite) id delegate; @property (strong, nonatomic) UIView* grayOverlay; @property (strong, nonatomic) WMFShareOptionsView* shareOptions; diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 8dc8ac9..f31777c 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -606,7 +606,7 @@ if ( (angleFromHorizontalAxis < TOC_SWIPE_TRIGGER_MAX_ANGLE) && -(fabsf(panVelocity.x) > TOC_SWIPE_TRIGGER_MIN_X_VELOCITY) +(
[MediaWiki-commits] [Gerrit] Fix for face detection in lead image on iOS 6. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/212195 Change subject: Fix for face detection in lead image on iOS 6. .. Fix for face detection in lead image on iOS 6. Turns out css "calc" was used and is not supported in iOS 6's webkit. No matter however as we weren't using it to actually calc anything :) Bug: T99697 Change-Id: Ib6881bdb89e449402b6c59edd17e16faa0ce0762 --- M Wikipedia/View Controllers/WebView/WebViewController.m 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/95/212195/1 diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 2bd8058..c0e98a7 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -1556,7 +1556,7 @@ @"background-image:-webkit-linear-gradient(top, rgba(0,0,0,0.0) 0%%, rgba(0,0,0,0.5) 100%%)," @"url('%@')" @"%@;" - "background-position: calc(50%%) calc(%ld%%);", + "background-position: 50%% %ld%%;", article.imageURL, [article.image isCached] ? @"" : @",url('wmf://bundledImage/lead-default.png')", offsetY]; @@ -1639,7 +1639,7 @@ NSString* applyFocalOffsetJS = @""; if (!CGRectEqualToRect(rect, CGRectZero)) { NSInteger yFocalOffset = [self leadImageFocalOffsetYPercentageFromTopOfRect:rect]; -applyFocalOffsetJS = [NSString stringWithFormat:@"document.getElementById('lead_image_div').style.backgroundPosition = 'calc(100%%) calc(%ld%%)';", yFocalOffset]; +applyFocalOffsetJS = [NSString stringWithFormat:@"document.getElementById('lead_image_div').style.backgroundPosition = '100%% %ld%%';", yFocalOffset]; } static NSString* animationCss = nil; -- To view, visit https://gerrit.wikimedia.org/r/212195 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib6881bdb89e449402b6c59edd17e16faa0ce0762 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix memory "seepage" Bug T99260 - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Fix memory "seepage" Bug T99260 .. Fix memory "seepage" Bug T99260 Add memory semantics to property declarations in MWK model class Use properties for accessing properties Change-Id: I4938141e8cdfc76241bafd220d7362c32b55be6c --- M MediaWikiKit/MediaWikiKit/MWKArticle.h M MediaWikiKit/MediaWikiKit/MWKArticle.m M MediaWikiKit/MediaWikiKit/MWKDataStore.h M MediaWikiKit/MediaWikiKit/MWKDataStore.m M MediaWikiKit/MediaWikiKit/MWKHistoryEntry.h M MediaWikiKit/MediaWikiKit/MWKHistoryEntry.m M MediaWikiKit/MediaWikiKit/MWKHistoryList.h M MediaWikiKit/MediaWikiKit/MWKHistoryList.m M MediaWikiKit/MediaWikiKit/MWKImage.h M MediaWikiKit/MediaWikiKit/MWKImage.m M MediaWikiKit/MediaWikiKit/MWKImageInfo.h M MediaWikiKit/MediaWikiKit/MWKImageInfo.m M MediaWikiKit/MediaWikiKit/MWKImageList.h M MediaWikiKit/MediaWikiKit/MWKImageList.m M MediaWikiKit/MediaWikiKit/MWKLicense.h M MediaWikiKit/MediaWikiKit/MWKLicense.m M MediaWikiKit/MediaWikiKit/MWKProtectionStatus.m M MediaWikiKit/MediaWikiKit/MWKRecentSearchEntry.h M MediaWikiKit/MediaWikiKit/MWKRecentSearchEntry.m M MediaWikiKit/MediaWikiKit/MWKRecentSearchList.h M MediaWikiKit/MediaWikiKit/MWKRecentSearchList.m M MediaWikiKit/MediaWikiKit/MWKSavedPageEntry.h M MediaWikiKit/MediaWikiKit/MWKSavedPageEntry.m M MediaWikiKit/MediaWikiKit/MWKSavedPageList.h M MediaWikiKit/MediaWikiKit/MWKSavedPageList.m M MediaWikiKit/MediaWikiKit/MWKSection.h M MediaWikiKit/MediaWikiKit/MWKSection.m M MediaWikiKit/MediaWikiKit/MWKSectionList.h M MediaWikiKit/MediaWikiKit/MWKSectionList.m M MediaWikiKit/MediaWikiKit/MWKSite.h M MediaWikiKit/MediaWikiKit/MWKSite.m M MediaWikiKit/MediaWikiKit/MWKSiteDataObject.h M MediaWikiKit/MediaWikiKit/MWKSiteDataObject.m M MediaWikiKit/MediaWikiKit/MWKTitle.h M MediaWikiKit/MediaWikiKit/MWKTitle.m M MediaWikiKit/MediaWikiKit/MWKUser.h M MediaWikiKit/MediaWikiKit/MWKUser.m M MediaWikiKit/MediaWikiKit/MWKUserDataStore.h M MediaWikiKit/MediaWikiKit/MWKUserDataStore.m M Wikipedia/Data/SchemaConverter.h M Wikipedia/Session/SessionSingleton.m 41 files changed, 593 insertions(+), 409 deletions(-) Approvals: Mhurd: Looks good to me, approved Bgerstle: Looks good to me, but someone else must approve diff --git a/MediaWikiKit/MediaWikiKit/MWKArticle.h b/MediaWikiKit/MediaWikiKit/MWKArticle.h index 93f55de..975dc07 100644 --- a/MediaWikiKit/MediaWikiKit/MWKArticle.h +++ b/MediaWikiKit/MediaWikiKit/MWKArticle.h @@ -26,30 +26,29 @@ } // Identifiers -@property (readonly) MWKSite* site; -@property (readonly) MWKTitle* title; -@property (readonly) MWKDataStore* dataStore; +@property (readonly, strong, nonatomic) MWKTitle* title; +@property (readonly, weak, nonatomic) MWKDataStore* dataStore; // Metadata -@property (readonly) MWKTitle* redirected;// optional -@property (readonly) NSDate* lastmodified;// required -@property (readonly) MWKUser* lastmodifiedby; // required -@property (readonly) int articleId; // required; -> 'id' -@property (readonly) int languagecount; // required; int -@property (readonly) NSString* displaytitle; // optional -@property (readonly) MWKProtectionStatus* protection; // required -@property (readonly) BOOL editable; // required +@property (readonly, strong, nonatomic) MWKTitle* redirected; // optional +@property (readonly, strong, nonatomic) NSDate* lastmodified; // required +@property (readonly, strong, nonatomic) MWKUser* lastmodifiedby; // required +@property (readonly, assign, nonatomic) int articleId; // required; -> 'id' +@property (readonly, assign, nonatomic) int languagecount; // required; int +@property (readonly, copy, nonatomic) NSString* displaytitle; // optional +@property (readonly, strong, nonatomic) MWKProtectionStatus* protection; // required +@property (readonly, assign, nonatomic) BOOL editable; // required -@property (readwrite, nonatomic) NSString* thumbnailURL; // optional; pulled separately via search -@property (readwrite, nonatomic) NSString* imageURL; // optional; pulled in article request +@property (readwrite, copy, nonatomic) NSString* thumbnailURL; // optional; pulled separately via search +@property (readwrite, copy, nonatomic) NSString* imageURL; // optional; pulled in article request -@property (readonly) NSString* entityDescription;// optional; currently pulled separately via wikidata +@property (readonly, copy, nonatomic) NSString* entityDescription; // optional; currently pulled separately via wikidata -@property (readonly) MWKSectionList* sections; +@property (readonly, strong, nonatomic) MWKSectionList* sections; -@property (readonly) MWKImageList* images; -@
[MediaWiki-commits] [Gerrit] Splitting up the lanes for app store and hockey RC - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Splitting up the lanes for app store and hockey RC .. Splitting up the lanes for app store and hockey RC The resigning was causing the wrong entitlements to be set for the adhoc build. Resigning MAY work if it was 2 adhoc builds or 2 App Store builds, but my guess is that resigning works only reliably when the entitlements don't need change. Change-Id: I0f9f47fb0c660ae5682dd7b9012a7678ec306b79 --- M fastlane/Appfile M fastlane/Fastfile 2 files changed, 26 insertions(+), 18 deletions(-) Approvals: Mhurd: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/fastlane/Appfile b/fastlane/Appfile index 668b8bd..708047e 100644 --- a/fastlane/Appfile +++ b/fastlane/Appfile @@ -11,6 +11,10 @@ app_identifier "org.wikimedia.wikipedia.tfbeta" end +for_lane 'ios rc' do + app_identifier "org.wikimedia.wikipedia" +end + for_lane 'ios store' do app_identifier "org.wikimedia.wikipedia" end diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 495ace3..a85bdfe 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -90,9 +90,29 @@ deliver beta: true end - desc "Upload AppStore build to iTC & HockeyApp, plus a resigned AdHoc build to Hockey." - lane :store do + desc "Upload AdHoc build to Hockey." + lane :rc do # create app store build +sigh( + adhoc: true, + force: true, + filename: 'build/adhoc.mobileprovision' +) +ipa( + configuration: "Wikipedia", + scheme: "Wikipedia", + embed: 'build/adhoc.mobileprovision' +) +hockey( + notes: git_commit_log, + notify: '0', # Do not notify + status: '2', # Make available for download + release_type: '0' # 'beta' release type +) + end + + desc "Upload AppStore build to iTC & HockeyApp" + lane :store do sigh( adhoc: false, force: true, @@ -111,22 +131,6 @@ ) deliver( force: true -) -# resign and deliver adhoc to HA -sigh( - adhoc: true, - force: true, - filename: 'build/adhoc.mobileprovision' -) -resign( - signing_identity: 'iPhone Distribution: Wikimedia Foundation (AKK7J2GV64)', - provisioning_profile: 'build/adhoc.mobileprovision' -) -hockey( - notes: git_commit_log, - notify: '0', # Do not notify - status: '2', # Make available for download - release_type: '0' # 'beta' release type ) end -- To view, visit https://gerrit.wikimedia.org/r/211074 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0f9f47fb0c660ae5682dd7b9012a7678ec306b79 Gerrit-PatchSet: 2 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Fjalapeno Gerrit-Reviewer: Bgerstle Gerrit-Reviewer: Mhurd Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixing unit tests - sorta. - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Fixing unit tests - sorta. .. Fixing unit tests - sorta. I updated the tests for our API changes - the webVC methods that we changed. But these tests are flawed and need to be refactored. They are testing logic that loads the view and will not work in a unit test bundle. We can't/shoudn't test VC methods that load the view and depend on the window. We should only be testing model objects, otherwise view loading logic cases things to break. Basically any object that inherits from UIViewController or UIView should NOT be unit tested. If we feel we need to test some behavior that is in a UI* class, then we also need to take the time to put that functionality in a class that is testable. Until this is done, we have to comment them out as they are breaking the build. Change-Id: I599562ceed7a574e75e53fa1514214fbb3eb8eb3 --- M WikipediaUnitTests/ArticleLoadingTests.m 1 file changed, 106 insertions(+), 111 deletions(-) Approvals: Mhurd: Looks good to me, approved jenkins-bot: Verified diff --git a/WikipediaUnitTests/ArticleLoadingTests.m b/WikipediaUnitTests/ArticleLoadingTests.m index 37d2ea3..d69e863 100644 --- a/WikipediaUnitTests/ArticleLoadingTests.m +++ b/WikipediaUnitTests/ArticleLoadingTests.m @@ -40,117 +40,112 @@ [super tearDown]; } -- (void)testReloadDoesNotAffectHistory { -MWKArticle* dummyArticle = [self storeDummyArticleWithTitle:@"foo"]; -self.session.currentArticle = dummyArticle; - -[self.webVC navigateToPage:dummyArticle.title - discoveryMethod:MWKHistoryDiscoveryMethodReload - showLoadingIndicator:YES]; - -// TODO: verify that mock article fetcher gets a call to fetch article w/ mock title - -[self.webVC fetchFinished:mock([ArticleFetcher class]) - fetchedData:nil //< unused - status:FETCH_FINAL_STATUS_SUCCEEDED -error:nil]; - -assertThat(self.session.currentArticle, is(dummyArticle)); -assertThat(@(self.session.userDataStore.historyList.length), is(@0)); -} - -- (void)testSuccessfulNavigationStoredInHistory { -// should be true for every discovery method _except_ back/forward and reload -MWKHistoryDiscoveryMethod methods[5] = {MWKHistoryDiscoveryMethodLink, -MWKHistoryDiscoveryMethodRandom, -MWKHistoryDiscoveryMethodSaved, -MWKHistoryDiscoveryMethodSearch, -MWKHistoryDiscoveryMethodUnknown}; - -for (NSUInteger i = 0; i < 5; i++) { -MWKHistoryDiscoveryMethod currentMethod = methods[i]; - -MWKArticle* dummyArticle = [self storeDummyArticleWithTitle:@(i).stringValue]; -dummyArticle.needsRefresh = YES; - -[self.webVC navigateToPage:dummyArticle.title discoveryMethod:currentMethod showLoadingIndicator:YES]; - -// TODO: verify that mock article fetcher gets a call to fetch article w/ mock title - -[self.webVC fetchFinished:mock([ArticleFetcher class]) - fetchedData:nil //< unused - status:FETCH_FINAL_STATUS_SUCCEEDED -error:nil]; - -assertThat(self.session.currentArticle, is(dummyArticle)); -MWKHistoryEntry* mostRecentEntry = self.session.userDataStore.historyList.mostRecentEntry; -assertThat(mostRecentEntry.title, is(dummyArticle.title)); -assertThat(@(mostRecentEntry.discoveryMethod), is(@(currentMethod))); -assertThat(@(self.session.userDataStore.historyList.length), is(@(i + 1))); -} -} - -- (void)testSuccessfulBackForwardNavigationIsNotStoredInHistory { -MWKArticle* dummyArticle = [self storeDummyArticleWithTitle:@"No history for you!"]; -dummyArticle.needsRefresh = YES; - -[self.webVC navigateToPage:dummyArticle.title - discoveryMethod:MWKHistoryDiscoveryMethodBackForward - showLoadingIndicator:YES]; - -// TODO: verify that mock article fetcher gets a call to fetch article w/ mock title - -[self.webVC fetchFinished:mock([ArticleFetcher class]) - fetchedData:nil //< unused - status:FETCH_FINAL_STATUS_SUCCEEDED -error:nil]; - -assertThat(self.session.currentArticle, is(dummyArticle)); -assertThat(@(self.session.userDataStore.historyList.length), is(@0)); -} - -- (void)testFailedNavigationNotStoredInHistory { -MWKArticle* originalArticle = [self storeDummyArticleWithTitle:@"original"]; -originalArticle.needsRefresh = YES; - -self.session.currentArticle = originalArticle; - -// should be true for every discovery -MWKHistoryDiscoveryMethod methods[7] = {MWKHistoryDiscoveryMethodReload, -MWKHis
[MediaWiki-commits] [Gerrit] Fix crash Bug T99081 when removing an item from history. - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Fix crash Bug T99081 when removing an item from history. .. Fix crash Bug T99081 when removing an item from history. Crash was caused by querying a dictionary for a nil key (nil article title). Now checking that the title is non-nil before attempting to remove the history item. Also fixed the corollary method for adding a history item. Change-Id: I4a481780f8937f48eaae3935fde881e2f5522cd1 --- M MediaWikiKit/MediaWikiKit/MWKHistoryList.m 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Mhurd: Looks good to me, approved jenkins-bot: Verified diff --git a/MediaWikiKit/MediaWikiKit/MWKHistoryList.m b/MediaWikiKit/MediaWikiKit/MWKHistoryList.m index 7ac6d68..c2d1952 100644 --- a/MediaWikiKit/MediaWikiKit/MWKHistoryList.m +++ b/MediaWikiKit/MediaWikiKit/MWKHistoryList.m @@ -58,6 +58,9 @@ #pragma mark - update methods - (void)addEntry:(MWKHistoryEntry*)entry { +if (entry.title == nil) { +return; +} MWKHistoryEntry* oldEntry = [self entryForTitle:entry.title]; if (oldEntry) { // Replace the old entry and move to top @@ -69,6 +72,9 @@ } - (void)removeEntry:(MWKHistoryEntry*)entry { +if (entry.title == nil) { +return; +} [entries removeObject:entry]; [entriesByTitle removeObjectForKey:entry.title]; _dirty = YES; -- To view, visit https://gerrit.wikimedia.org/r/210931 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4a481780f8937f48eaae3935fde881e2f5522cd1 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Fjalapeno Gerrit-Reviewer: Bgerstle Gerrit-Reviewer: Mhurd Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Removing needsRefreshed from Article Bug T98907 Follow on re... - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Removing needsRefreshed from Article Bug T98907 Follow on refactor for T97781 .. Removing needsRefreshed from Article Bug T98907 Follow on refactor for T97781 This was being stored in the model, but was a view layer concern. Additionally this was not needed "later" needsRefresh is a "now" concern - so storage was unnecessary. Replaced with a scoped method variable where it is needed (see:WebVC line:1394). (aside: conceivably we could have a needsRefresh property on the article that marks the article as dirty and would cause the article to be downloaded in the background, but that is not the use case here) Change-Id: I732a4ae14541032d7f9d05b5c93ad362900847cd --- M MediaWikiKit/MediaWikiKit/MWKArticle.h M MediaWikiKit/MediaWikiKit/MWKArticle.m M Wikipedia/Networking/Fetchers/ArticleFetcher.m M Wikipedia/Networking/Fetchers/SavedArticlesFetcher.m M Wikipedia/View Controllers/WebView/WebViewController.m 5 files changed, 6 insertions(+), 40 deletions(-) Approvals: Mhurd: Looks good to me, approved jenkins-bot: Verified diff --git a/MediaWikiKit/MediaWikiKit/MWKArticle.h b/MediaWikiKit/MediaWikiKit/MWKArticle.h index 0c7bdd3..93f55de 100644 --- a/MediaWikiKit/MediaWikiKit/MWKArticle.h +++ b/MediaWikiKit/MediaWikiKit/MWKArticle.h @@ -51,8 +51,6 @@ @property (readonly) MWKImage* thumbnail; @property (readonly) MWKImage* image; -@property (readwrite) BOOL needsRefresh; - - (instancetype)initWithTitle:(MWKTitle*)title dataStore:(MWKDataStore*)dataStore; - (instancetype)initWithTitle:(MWKTitle*)title dataStore:(MWKDataStore*)dataStore dict:(NSDictionary*)dict; diff --git a/MediaWikiKit/MediaWikiKit/MWKArticle.m b/MediaWikiKit/MediaWikiKit/MWKArticle.m index b6355c8..c6cf2ab 100644 --- a/MediaWikiKit/MediaWikiKit/MWKArticle.m +++ b/MediaWikiKit/MediaWikiKit/MWKArticle.m @@ -166,30 +166,6 @@ } } -- (void)setNeedsRefresh:(BOOL)val { -NSString* filePath = [self.dataStore pathForArticle:self]; -NSString* fileName = [filePath stringByAppendingPathComponent:@"needsRefresh.lock"]; - -if (val) { -NSString* payload = @"needsRefresh"; - -[[NSFileManager defaultManager] createDirectoryAtPath:filePath - withIntermediateDirectories:YES - attributes:nil -error:nil]; - -[payload writeToFile:fileName atomically:YES encoding:NSUTF8StringEncoding error:nil]; -} else { -[[NSFileManager defaultManager] removeItemAtPath:fileName error:nil]; -} -} - -- (BOOL)needsRefresh { -NSString* filePath = [self.dataStore pathForArticle:self]; -NSString* fileName = [filePath stringByAppendingPathComponent:@"needsRefresh.lock"]; -return [[NSFileManager defaultManager] fileExistsAtPath:fileName isDirectory:nil]; -} - - (void)save { [self.dataStore saveArticle:self]; [self.images save]; diff --git a/Wikipedia/Networking/Fetchers/ArticleFetcher.m b/Wikipedia/Networking/Fetchers/ArticleFetcher.m index 9de9134..320b68a 100644 --- a/Wikipedia/Networking/Fetchers/ArticleFetcher.m +++ b/Wikipedia/Networking/Fetchers/ArticleFetcher.m @@ -105,12 +105,6 @@ [self associateThumbFromTempDirWithArticle]; -// Reminder: must reset "needsRefresh" to NO here! Otherwise saved articles -// (which had been refreshed at least once) won't work if you're offline -// because the system thinks a fresh is *still* needed and will try to load -// from network rather than from cache. -self.article.needsRefresh = NO; - // Update article and section image data. // Reminder: don't recall article save here as it expensively re-writes all section html. [self.article saveWithoutSavingSectionText]; diff --git a/Wikipedia/Networking/Fetchers/SavedArticlesFetcher.m b/Wikipedia/Networking/Fetchers/SavedArticlesFetcher.m index ea6f3b4..e2f4a77 100644 --- a/Wikipedia/Networking/Fetchers/SavedArticlesFetcher.m +++ b/Wikipedia/Networking/Fetchers/SavedArticlesFetcher.m @@ -63,7 +63,6 @@ for (MWKSavedPageEntry* entry in self.savedPageList) { MWKArticle* article = [self.dataStore articleWithTitle:entry.title]; -article.needsRefresh = NO; if (entry.title) { self.fetchersByArticleTitle[entry.title] = [[ArticleFetcher alloc] initAndFetchSectionsForArticle:article withManager:manager thenNotifyDelegate:self]; diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 3e9e0cb..2bd8058 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -1391,27 +1391,26 @@ session.currentArticle
[MediaWiki-commits] [Gerrit] Removes spinner and adds progress bar - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Removes spinner and adds progress bar .. Removes spinner and adds progress bar Add progress bar to Web VC Remove spinner (and trash files) Add progress reporting to article fetcher Calculates first 75% of progress from article fetcher, the last 25% is "faked" around the DOM loading notification Fix warning about subclass delegate property not synthesized (add "dynamic") Make logic for displaying progress internal to web VC (removed argument from method) Bug T97781 Change-Id: I89326831f795cdc03c12ed054b00489f255b5f0e --- M Wikipedia.xcodeproj/project.pbxproj D Wikipedia/Custom Views/WMFLoadingIndicatorOverlay.h D Wikipedia/Custom Views/WMFLoadingIndicatorOverlay.m M Wikipedia/Custom Views/WMFProgressLineView.m M Wikipedia/Networking/Fetchers/ArticleFetcher.h M Wikipedia/Networking/Fetchers/ArticleFetcher.m M Wikipedia/Networking/Fetchers/SavedArticlesFetcher.h M Wikipedia/Networking/Fetchers/SavedArticlesFetcher.m M Wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m M Wikipedia/View Controllers/Navigation/Center/CenterNavController.m M Wikipedia/View Controllers/References/ReferenceVC.m M Wikipedia/View Controllers/WebView/WebViewController.h M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/View Controllers/WebView/WebViewController_Private.h 14 files changed, 229 insertions(+), 289 deletions(-) Approvals: Mhurd: Looks good to me, approved jenkins-bot: Verified diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index 6570016..95873e5 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -74,8 +74,6 @@ 0462A6D11A1FE016009412D4 /* SearchResultAttributedString.m in Sources */ = {isa = PBXBuildFile; fileRef = 0462A6D01A1FE016009412D4 /* SearchResultAttributedString.m */; }; 0463639818A844570049EE4F /* KeychainCredentials.m in Sources */ = {isa = PBXBuildFile; fileRef = 0463639718A844570049EE4F /* KeychainCredentials.m */; }; 0472BC18193AD88C00C40BDA /* MWKSection+DisplayHtml.m in Sources */ = {isa = PBXBuildFile; fileRef = 0472BC17193AD88C00C40BDA /* MWKSection+DisplayHtml.m */; }; - 04733A041AC6123400E365E5 /* WMFLoadingIndicatorOverlay.m in Sources */ = {isa = PBXBuildFile; fileRef = 04733A031AC6123400E365E5 /* WMFLoadingIndicatorOverlay.m */; }; - 04733A051AC6123400E365E5 /* WMFLoadingIndicatorOverlay.m in Sources */ = {isa = PBXBuildFile; fileRef = 04733A031AC6123400E365E5 /* WMFLoadingIndicatorOverlay.m */; }; 047801BE18AE987900DBB747 /* UIButton+ColorMask.m in Sources */ = {isa = PBXBuildFile; fileRef = 047801BD18AE987900DBB747 /* UIButton+ColorMask.m */; }; 047E74141860509000916964 /* SavedPagesResultPrototypeView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 047E74131860509000916964 /* SavedPagesResultPrototypeView.xib */; }; 047E95511996DD030046A122 /* NearbyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 047E954E1996DD030046A122 /* NearbyViewController.m */; }; @@ -519,8 +517,6 @@ 04649CA619F72B360071E8FA /* libPods.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPods.a; path = "Pods/build/Debug-iphoneos/libPods.a"; sourceTree = ""; }; 0472BC16193AD88C00C40BDA /* MWKSection+DisplayHtml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MWKSection+DisplayHtml.h"; sourceTree = ""; }; 0472BC17193AD88C00C40BDA /* MWKSection+DisplayHtml.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MWKSection+DisplayHtml.m"; sourceTree = ""; }; - 04733A021AC6123400E365E5 /* WMFLoadingIndicatorOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMFLoadingIndicatorOverlay.h; sourceTree = ""; }; - 04733A031AC6123400E365E5 /* WMFLoadingIndicatorOverlay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WMFLoadingIndicatorOverlay.m; sourceTree = ""; }; 047528A3190F0C2900F2CDA8 /* WikiGlyph_Chars.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WikiGlyph_Chars.h; sourceTree = ""; }; 047801BC18AE987900DBB747 /* UIButton+ColorMask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+ColorMask.h"; sourceTree = ""; }; 047801BD18AE987900DBB747 /* UIButton+ColorMask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+ColorMask.m"; sourceTree = ""; }; @@ -2314,8 +2310,6 @@ 0480AE9F1AA4F4
[MediaWiki-commits] [Gerrit] Update icon. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/210607 Change subject: Update icon. .. Update icon. Used ruby script which is most easily run in ubuntu for creating various icon resolutions from icon svg. Renamed items in icon plist to use names generated by script. Bug: T97783 Change-Id: I3a69ef974b210de3698874fe40c343d3dfcde4b3 --- M Wikipedia/Images.xcassets/AppIcon.appiconset/Contents.json M Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Contents.json D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon...@2x.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon...@3x.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Icon-72.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon...@2x.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Icon-76.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon...@2x.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Icon-Small-50.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon-small...@2x.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Icon-Small.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon-sm...@3x.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Icon-Spotlight-40.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon-spotlight...@2x-1.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon-spotlight...@2x.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon-spotlight...@3x.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Icon.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/i...@2x.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_100.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_114.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_120.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_120_copy.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_144.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_152.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_180.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_29.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_29_copy.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_40.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_50.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_57.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_58.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_58_copy.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_72.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_76.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_80.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_80_copy.png A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon_87.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/ios7_app_icon_iphone.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/ios7_settings_icon.png D Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/ios7_settings_i...@2x.png D scripts/icon-svgs-to-pngs.sh A scripts/make-icons-from-svg.sh M svgs/icon-prod.svg 43 files changed, 75 insertions(+), 61 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/07/210607/1 diff --git a/Wikipedia/Images.xcassets/AppIcon.appiconset/Contents.json b/Wikipedia/Images.xcassets/AppIcon.appiconset/Contents.json index bdf34f6..ee06e88 100644 --- a/Wikipedia/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Wikipedia/Images.xcassets/AppIcon.appiconset/Contents.json @@ -3,115 +3,115 @@ { "size" : "29x29", "idiom" : "iphone", - "filename" : "ios7_settings_icon.png", + "filename" : "icon_29.png", "scale" : "1x" }, { "size" : "29x29", "idiom" : "iphone", - "filename" : "ios7_settings_i...@2x.png", + "filename" : "icon_58.png", "scale" : "2x" }, { "size" : "29x29", "idiom" : "iphone", - "filename" : "icon-sm...@3x.png", + "filename" : "icon_87.png", "scale" : "3x" }, { "size" : "40x40", "idiom" : "iphone", - "filename" : "icon-spotlight...@2x-1.png", + "filename" : "icon_80.png", "scale" : "2x" }, { "size" : "40x40", "idiom" : "iphone", - "filename" : "icon-spotlight...@3x.png", + "filename" : "icon_120.png", "scale" : "3x" }, { "size" : "57x57", "idiom" : "iphone", - "filename" : "Icon.png", + "filename" : "icon_57.png", "scale" : "1x" }, { "size" : "57x57", "idiom" : "iphone",
[MediaWiki-commits] [Gerrit] Fix for share card face detection regression. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/210195 Change subject: Fix for share card face detection regression. .. Fix for share card face detection regression. Change-Id: Ib2c12cf1a8815a12e8e05aaa9e1a1084b352923b --- M Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.h M Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.m M Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.m 3 files changed, 21 insertions(+), 25 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/95/210195/1 diff --git a/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.h b/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.h index 8745e0f..a7ae27a 100644 --- a/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.h +++ b/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.h @@ -3,6 +3,6 @@ #import @interface WMFShareCardImageContainer : UIView -@property (strong, nonatomic) UIImage* image; +@property (strong, nonatomic) MWKImage* image; @end diff --git a/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.m b/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.m index 7383981..9443f74 100644 --- a/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.m +++ b/Wikipedia/View Controllers/ShareCard/WMFShareCardImageContainer.m @@ -2,41 +2,39 @@ #import "WMFShareCardImageContainer.h" #import "UIImage+WMFFocalImageDrawing.h" -#import "WMFFaceDetector.h" +#import "WMFGeometry.h" @interface WMFShareCardImageContainer () -@property(nonatomic, strong) WMFFaceDetector* faceDetector; @property(nonatomic) CGRect faceBounds; @end @implementation WMFShareCardImageContainer -- (instancetype)initWithCoder:(NSCoder*)coder { -self = [super initWithCoder:coder]; -if (self) { -self.faceDetector = [[WMFFaceDetector alloc] init]; +- (CGRect)getPrimaryFocalRectFromCanonicalLeadImage { +// Focal rect info is parked on the article.image which is the originally retrieved lead image. +// self.image is potentially a larger variant, which is why here the focal rect unit coords are +// sought on self.image.article.image +CGRect focalBounds = CGRectZero; +NSArray* focalRects = [self.image.article.image focalRectsInUnitCoordinatesAsStrings]; +if (focalRects.count > 0) { +focalBounds = WMFRectFromUnitRectForReferenceSize(CGRectFromString([focalRects firstObject]), self.image.size); } -return self; -} - -- (void)setImage:(UIImage*)image { -_image = image; -[self.faceDetector setImageWithUIImage:image]; -[self.faceDetector detectFaces]; -self.faceBounds = [[[self.faceDetector allFaces] firstObject] bounds]; +return focalBounds; } - (void)drawRect:(CGRect)rect { [super drawRect:rect]; [self drawGradientBackground]; -[self.image wmf_drawInRect:rect - focalBounds:self.faceBounds -focalHighlight:NO - blendMode:kCGBlendModeMultiply - alpha:1.0]; +CGRect focalBounds = [self getPrimaryFocalRectFromCanonicalLeadImage]; + +[[self.image asUIImage] wmf_drawInRect:rect + focalBounds:focalBounds +focalHighlight:NO + blendMode:kCGBlendModeMultiply + alpha:1.0]; } // TODO: in follow-up patch, factor drawGradientBackground from diff --git a/Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.m b/Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.m index 862ce53..2e4e4b6 100644 --- a/Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.m +++ b/Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.m @@ -59,13 +59,11 @@ [[article.entityDescription wmf_stringByRemovingHTML] wmf_stringByCapitalizingFirstCharacter]; self.shareArticleDescription.textAlignment = subtextAlignment; -NSData* leadImageData = [article.image.largestCachedVariant asNSData]; -if (leadImageData) { +BOOL leadImageCached = [article.image.largestCachedVariant isCached]; +if (leadImageCached) { // in case the image has transparency, make its container white self.shareCardImageContainer.backgroundColor = [UIColor whiteColor]; -// Face detection is faster if the image has CIImage backing. -CIImage* ciImage = [[CIImage alloc] initWithData:leadImageData]; -self.shareCardImageContainer.image = [UIImage imageWithCIImage:ciImage]; +self.shareCardImageContainer.image = article.image.largestCachedVariant; } } -- To view, visit https://gerrit.wikimedia.org/r/210195 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib2c
[MediaWiki-commits] [Gerrit] This is a test throw-away commit. - change (labs...wikibugs2)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/209640 Change subject: This is a test throw-away commit. .. This is a test throw-away commit. We will close this PR. Change-Id: I75d40b7f0d164ab1b2845fd93c1b2fb5157ffe4a --- M channelfilter.py 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/tools/wikibugs2 refs/changes/40/209640/1 diff --git a/channelfilter.py b/channelfilter.py index 60042d1..bdd9d37 100644 --- a/channelfilter.py +++ b/channelfilter.py @@ -1,5 +1,7 @@ #!/usr/bin/env python +# This is a test edit. + import os import subprocess import time -- To view, visit https://gerrit.wikimedia.org/r/209640 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I75d40b7f0d164ab1b2845fd93c1b2fb5157ffe4a Gerrit-PatchSet: 1 Gerrit-Project: labs/tools/wikibugs2 Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix for table lead image height regression. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/209410 Change subject: Fix for table lead image height regression. .. Fix for table lead image height regression. See before/after screenshots at bottom of T97806 Change-Id: I8bdec3802cbced72adb5189179eeef31a868beff --- M Wikipedia/assets/styleoverrides.css M www/less/styleoverrides.less 2 files changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/10/209410/1 diff --git a/Wikipedia/assets/styleoverrides.css b/Wikipedia/assets/styleoverrides.css index facb053..c9c1610 100644 --- a/Wikipedia/assets/styleoverrides.css +++ b/Wikipedia/assets/styleoverrides.css @@ -1 +1 @@ -a:hover{text-decoration:none !important}.content{margin-top:0px}.lead_image_div{margin-left:-16px !important;margin-right:-16px !important;transition-timing-function:ease-in-out}div#lead_image_none div.lead_image_div{height:auto !important}#lead_image_text_container{padding:16px;pointer-events:none !important}div#lead_image_none div#lead_image_text_container{position:relative !important;padding-bottom:0px !important;padding-top:0px !important}#lead_image_title,#lead_image_description{font-family:Times New Roman;pointer-events:none !important}#lead_image_title{padding-top:4px;line-height:100%;margin-top:6px;margin-bottom:6px}div#lead_image_none div#lead_image_title{color:#000 !important;text-shadow:none !important}#lead_image_description{line-height:117%}div#lead_image_none div#lead_image_description{color:#000 !important;text-shadow:none !important}@media (orientation:portrait){.lead_image_div{height:12.6em;background-repeat:no-repeat;background-size:cover;color:#fff;position:relative}#lead_image_text_container{position:absolute;bottom:0px}#lead_image_title,#lead_image_description{text-shadow:0 1px .5px rgba(0,0,0,0.25)}}@media (orientation:landscape){.lead_image_div{background-size:0 0;height:auto;color:#000;padding-bottom:0px;padding-top:0px}#lead_image_text_container{padding-bottom:0px;padding-top:0px}}.content_block,.image_overflow_x_container{clear:both;overflow-x:auto}#edit_section_button_0{margin-top:6px}#section_heading_and_content_block_0{margin-top:13px}.ios-disambiguation-item-anchor{display:block;padding-top:8px;padding-bottom:8px}.ios-issue-item{padding-top:8px;padding-bottom:8px}.ios-issue-item *{font-weight:normal !important}#disambig_sub_container,#issues_sub_container{background-color:#fff !important;border-bottom:1px solid #ccc;padding-top:6px;padding-bottom:12px;margin-bottom:12px}#issues_container_close_button{color:#333;display:none;font-weight:bold;padding:4px 20px 4px 20px}a.issues_button,a.disambig_button{padding:4px 0px 4px 0px !important}span.issues_separator{padding-top:4px!important;padding-bottom:4px!important}div.issues_container{margin-bottom:1.8em !important}*{box-sizing:border-box} \ No newline at end of file +a:hover{text-decoration:none !important}.content{margin-top:0px}.lead_image_div{margin-left:-16px !important;margin-right:-16px !important;transition-timing-function:ease-in-out}div#lead_image_none div.lead_image_div{height:auto !important}#lead_image_text_container{padding:16px;pointer-events:none !important}div#lead_image_none div#lead_image_text_container{position:relative !important;padding-bottom:0px !important;padding-top:0px !important}#lead_image_title,#lead_image_description{font-family:Times New Roman;pointer-events:none !important}#lead_image_title{padding-top:4px;line-height:100%;margin-top:6px;margin-bottom:6px}div#lead_image_none div#lead_image_title{color:#000 !important;text-shadow:none !important}#lead_image_description{line-height:117%}div#lead_image_none div#lead_image_description{color:#000 !important;text-shadow:none !important}@media (orientation:portrait){.lead_image_div{height:150pt;background-repeat:no-repeat;background-size:cover;color:#fff;position:relative}#lead_image_text_container{position:absolute;bottom:0px}#lead_image_title,#lead_image_description{text-shadow:0 1px .5px rgba(0,0,0,0.25)}}@media (orientation:portrait) and (min-device-width:768px){.lead_image_div{height:250pt}}@media (orientation:landscape){.lead_image_div{background-size:0 0;height:auto;color:#000;padding-bottom:0px;padding-top:0px}#lead_image_text_container{padding-bottom:0px;padding-top:0px}}.content_block,.image_overflow_x_container{clear:both;overflow-x:auto}#edit_section_button_0{margin-top:6px}#section_heading_and_content_block_0{margin-top:13px}.ios-disambiguation-item-anchor{display:block;padding-top:8px;padding-bottom:8px}.ios-issue-item{padding-top:8px;padding-bottom:8px}.ios-issue-item *{font-weight:normal !important}#disambig_sub_container,#issues_sub_container{background-color:#fff !important;border-bottom:1px solid #ccc;padding-top:6px;padding-bottom:12px;margin-bottom:12px}#issues_container_close_button{color:#333;display:none;f
[MediaWiki-commits] [Gerrit] Fix for collapsed tables extending past right side of screen. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/209387 Change subject: Fix for collapsed tables extending past right side of screen. .. Fix for collapsed tables extending past right side of screen. Also removed cruft body tag css. Change-Id: I04e7e3ab509234d1225f518a3675645ebdb052f6 --- M Wikipedia/assets/index.html M Wikipedia/assets/preview.html M Wikipedia/assets/styleoverrides.css M www/index.html M www/less/styleoverrides.less M www/preview.html 6 files changed, 17 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/87/209387/1 diff --git a/Wikipedia/assets/index.html b/Wikipedia/assets/index.html index 7e7c9a3..2cdfed6 100644 --- a/Wikipedia/assets/index.html +++ b/Wikipedia/assets/index.html @@ -11,7 +11,7 @@ https://wikipedia.org";> - + %@ %@ diff --git a/Wikipedia/assets/preview.html b/Wikipedia/assets/preview.html index 2f1aad4..de241b0 100644 --- a/Wikipedia/assets/preview.html +++ b/Wikipedia/assets/preview.html @@ -10,7 +10,7 @@ https://wikipedia.org";> - + %@ diff --git a/Wikipedia/assets/styleoverrides.css b/Wikipedia/assets/styleoverrides.css index 883e447..facb053 100644 --- a/Wikipedia/assets/styleoverrides.css +++ b/Wikipedia/assets/styleoverrides.css @@ -1 +1 @@ -a:hover{text-decoration:none !important}.content{margin-top:0px}.lead_image_div{margin-left:-16px !important;margin-right:-16px !important;transition-timing-function:ease-in-out}div#lead_image_none div.lead_image_div{height:auto !important}#lead_image_text_container{padding:16px;pointer-events:none !important}div#lead_image_none div#lead_image_text_container{position:relative !important;padding-bottom:0px !important;padding-top:0px !important}#lead_image_title,#lead_image_description{font-family:Times New Roman;pointer-events:none !important}#lead_image_title{padding-top:4px;line-height:100%;margin-top:6px;margin-bottom:6px}div#lead_image_none div#lead_image_title{color:#000 !important;text-shadow:none !important}#lead_image_description{line-height:117%}div#lead_image_none div#lead_image_description{color:#000 !important;text-shadow:none !important}@media (orientation:portrait){.lead_image_div{height:12.6em;background-repeat:no-repeat;background-size:cover;color:#fff;position:relative}#lead_image_text_container{position:absolute;bottom:0px}#lead_image_title,#lead_image_description{text-shadow:0 1px .5px rgba(0,0,0,0.25)}}@media (orientation:landscape){.lead_image_div{background-size:0 0;height:auto;color:#000;padding-bottom:0px;padding-top:0px}#lead_image_text_container{padding-bottom:0px;padding-top:0px}}.content_block,.image_overflow_x_container{clear:both;overflow-x:auto}#edit_section_button_0{margin-top:6px}#section_heading_and_content_block_0{margin-top:13px}.ios-disambiguation-item-anchor{display:block;padding-top:8px;padding-bottom:8px}.ios-issue-item{padding-top:8px;padding-bottom:8px}.ios-issue-item *{font-weight:normal !important}#disambig_sub_container,#issues_sub_container{background-color:#fff !important;border-bottom:1px solid #ccc;padding-top:6px;padding-bottom:12px;margin-bottom:12px}#issues_container_close_button{color:#333;display:none;font-weight:bold;padding:4px 20px 4px 20px}a.issues_button,a.disambig_button{padding:4px 0px 4px 0px !important}span.issues_separator{padding-top:4px!important;padding-bottom:4px!important}div.issues_container{margin-bottom:1.8em !important} \ No newline at end of file +a:hover{text-decoration:none !important}.content{margin-top:0px}.lead_image_div{margin-left:-16px !important;margin-right:-16px !important;transition-timing-function:ease-in-out}div#lead_image_none div.lead_image_div{height:auto !important}#lead_image_text_container{padding:16px;pointer-events:none !important}div#lead_image_none div#lead_image_text_container{position:relative !important;padding-bottom:0px !important;padding-top:0px !important}#lead_image_title,#lead_image_description{font-family:Times New Roman;pointer-events:none !important}#lead_image_title{padding-top:4px;line-height:100%;margin-top:6px;margin-bottom:6px}div#lead_image_none div#lead_image_title{color:#000 !important;text-shadow:none !important}#lead_image_description{line-height:117%}div#lead_image_none div#lead_image_description{color:#000 !important;text-shadow:none !important}@media (orientation:portrait){.lead_image_div{height:12.6em;background-repeat:no-repeat;background-size:cover;color:#fff;position:relative}#lead_image_text_container{position:absolute;bottom:0px}#lead_image_title,#lead_image_description{text-shadow:0 1px .5px rgba(0,0,0,0.25)}}@media (orientation:landscape){.lead_image_div{background-size:0 0;height:auto;color:#000;padding-bottom:0px;padding-top:0px}#lead_image_text_container{padding-bottom:0px;pad
[MediaWiki-commits] [Gerrit] refactor & add more sanitation to article snippet heuristic - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: refactor & add more sanitation to article snippet heuristic .. refactor & add more sanitation to article snippet heuristic Weren't doing text sanitation on section text before sharing (similar to T95476). Moved share snippet generation to a category on MWKArticle. Could potentially make a "Shareable" protocol to allow sharing sections, etc. Bug: T96312 Change-Id: I56fa670f811ae46cde612da729911c17ac04ad78 --- M Wikipedia.xcodeproj/project.pbxproj A Wikipedia/Categories/MWKArticle+ShareSnippet.h A Wikipedia/Categories/MWKArticle+ShareSnippet.m M Wikipedia/View Controllers/ShareCard/WMFShareCardViewController.m M Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.h M Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.m A WikipediaUnitTests/WMFShareSnippetTests.m 7 files changed, 115 insertions(+), 28 deletions(-) Approvals: Fjalapeno: Looks good to me, but someone else must approve Mhurd: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index 1f303f8..a97cfe6 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -287,6 +287,8 @@ BCC185D81A9E5628005378F8 /* UILabel+WMFStyling.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC185D71A9E5628005378F8 /* UILabel+WMFStyling.m */; }; BCC185E01A9EC836005378F8 /* UIButton+FrameUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC185DF1A9EC836005378F8 /* UIButton+FrameUtils.m */; }; BCC185E81A9FA498005378F8 /* UICollectionViewFlowLayout+AttributeUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC185E71A9FA498005378F8 /* UICollectionViewFlowLayout+AttributeUtils.m */; }; + BCC9B2681AFA615000FF9593 /* WMFShareSnippetTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC9B2671AFA615000FF9593 /* WMFShareSnippetTests.m */; }; + BCC9B26B1AFA61DB00FF9593 /* MWKArticle+ShareSnippet.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC9B26A1AFA61DB00FF9593 /* MWKArticle+ShareSnippet.m */; }; BCCED2D01AE03BE20094EB7E /* MWKSectionListTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BCCED2CF1AE03BE20094EB7E /* MWKSectionListTests.m */; }; BCDB75C41AB0E835593F /* WMFSubstringUtilsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BCDB75C31AB0E835593F /* WMFSubstringUtilsTests.m */; }; BCE912BA1ACC5E6900B74B42 /* NSIndexSet+BKReduce.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE912B91ACC5E6900B74B42 /* NSIndexSet+BKReduce.m */; }; @@ -885,6 +887,9 @@ BCC185DF1A9EC836005378F8 /* UIButton+FrameUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+FrameUtils.m"; sourceTree = ""; }; BCC185E61A9FA498005378F8 /* UICollectionViewFlowLayout+AttributeUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UICollectionViewFlowLayout+AttributeUtils.h"; sourceTree = ""; }; BCC185E71A9FA498005378F8 /* UICollectionViewFlowLayout+AttributeUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UICollectionViewFlowLayout+AttributeUtils.m"; sourceTree = ""; }; + BCC9B2671AFA615000FF9593 /* WMFShareSnippetTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WMFShareSnippetTests.m; sourceTree = ""; }; + BCC9B2691AFA61DB00FF9593 /* MWKArticle+ShareSnippet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MWKArticle+ShareSnippet.h"; sourceTree = ""; }; + BCC9B26A1AFA61DB00FF9593 /* MWKArticle+ShareSnippet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MWKArticle+ShareSnippet.m"; sourceTree = ""; }; BCCED2CF1AE03BE20094EB7E /* MWKSectionListTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MWKSectionListTests.m; sourceTree = ""; }; BCCED2D21AE041BD0094EB7E /* MWKSectionList_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MWKSectionList_Private.h; sourceTree = ""; }; BCDB75BC1AB0D3DE0005593F /* WMFImageInfoController_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WMFImageInfoController_Private.h; path = "Image Gallery/WMFImageInfoController_Private.h"; sourceTree = ""; }; @@ -1877,6 +1882,8 @@ 04B0E3E91AE8252800379AE0 /* NSURL+WMFRest.m */, BCAC50BF1A
[MediaWiki-commits] [Gerrit] fix section share snippet XPath to only grab top-level 's - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: fix section share snippet XPath to only grab top-level 's .. fix section share snippet XPath to only grab top-level 's Refine regex as a stopgap until we can use a proper API for extracting article snippets. Also did some refactoring: - Moved snippet extraction into categories on MWKArticle & MWKSection. Main reason for this was to keep the shareSnippet logic context-specifc (i.e. a global NSString category for parsing HTML is harder to guarantee than one specific to article sections). - Created WMFSharing protocol for simplicity and potential expansion in the future (just one method atm). - Minor style/comment tweaks Bug: T95476 Change-Id: I9977feb9a0029d6515efa43dd199f370d16e82b2 --- M Wikipedia.xcodeproj/project.pbxproj M Wikipedia/Categories/MWKArticle+ShareSnippet.h M Wikipedia/Categories/MWKArticle+ShareSnippet.m A Wikipedia/Categories/MWKSection+WMFSharing.h A Wikipedia/Categories/MWKSection+WMFSharing.m M Wikipedia/Categories/NSString+WMFHTMLParsing.h M Wikipedia/Categories/NSString+WMFHTMLParsing.m M Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.h M Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.m A Wikipedia/View Controllers/ShareCard/WMFSharing.h A WikipediaUnitTests/MWKSection+WMFSharingTests.m M WikipediaUnitTests/NSString+WMFHTMLParsingTests.m 12 files changed, 167 insertions(+), 66 deletions(-) Approvals: Fjalapeno: Looks good to me, but someone else must approve Mhurd: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index a97cfe6..a46 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -227,6 +227,8 @@ BC86B93D1A929CC500B4C039 /* UICollectionViewFlowLayout+NSCopying.m in Sources */ = {isa = PBXBuildFile; fileRef = BC86B93C1A929CC500B4C039 /* UICollectionViewFlowLayout+NSCopying.m */; }; BC86B9401A929D7900B4C039 /* UICollectionViewFlowLayout+WMFItemSizeThatFits.m in Sources */ = {isa = PBXBuildFile; fileRef = BC86B93F1A929D7900B4C039 /* UICollectionViewFlowLayout+WMFItemSizeThatFits.m */; }; BC90C4BE1AC219FE009F36D2 /* UIWindow+WMFMainScreenWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = BC90C4BD1AC219FE009F36D2 /* UIWindow+WMFMainScreenWindow.m */; }; + BC92A7711AFA841C003C4212 /* MWKSection+WMFSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = BC92A7701AFA841C003C4212 /* MWKSection+WMFSharing.m */; }; + BC92A7731AFA88D3003C4212 /* MWKSection+WMFSharingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BC92A7721AFA88D3003C4212 /* MWKSection+WMFSharingTests.m */; }; BC955BC71A82BEFD000EF9E4 /* MWKImageInfoFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = BC955BC61A82BEFD000EF9E4 /* MWKImageInfoFetcher.m */; }; BC955BCF1A82C2FA000EF9E4 /* AFHTTPRequestOperationManager+WMFConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = BC955BCE1A82C2FA000EF9E4 /* AFHTTPRequestOperationManager+WMFConfig.m */; }; BCA676491AC05EDF00A16160 /* WMFRandomFileUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA676481AC05EDF00A16160 /* WMFRandomFileUtilities.m */; }; @@ -759,6 +761,10 @@ BC86B93F1A929D7900B4C039 /* UICollectionViewFlowLayout+WMFItemSizeThatFits.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UICollectionViewFlowLayout+WMFItemSizeThatFits.m"; sourceTree = ""; }; BC90C4BC1AC219FE009F36D2 /* UIWindow+WMFMainScreenWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWindow+WMFMainScreenWindow.h"; sourceTree = ""; }; BC90C4BD1AC219FE009F36D2 /* UIWindow+WMFMainScreenWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWindow+WMFMainScreenWindow.m"; sourceTree = ""; }; + BC92A76E1AFA83D2003C4212 /* WMFSharing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WMFSharing.h; path = ShareCard/WMFSharing.h; sourceTree = ""; }; + BC92A76F1AFA841C003C4212 /* MWKSection+WMFSharing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MWKSection+WMFSharing.h"; sourceTree = ""; }; + BC92A7701AFA841C003C4212 /* MWKSection+WMFSharing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MWKSection+WMFSharing.m"; sourceTree = ""; }; + BC92A7721AFA88D3003C4212 /* MWKSection+WMFSharingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MWKSection+WMFSharingTests
[MediaWiki-commits] [Gerrit] do text sanitation on selected text before sharing - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: do text sanitation on selected text before sharing .. do text sanitation on selected text before sharing We weren't doing sanitation on selected text before sharing, which was allowing things like citations to slip through. See added test case for wmf_shareSnippetFromText and its usage (as opposed to wmf_shareSnippetFromHTML). One drawback to this approach is that if a user *partially* selects a citation "like this.[1" it will still be passed through. IMO we need a more comprehensive solution for how we select text for sharing (perhaps using selectors on HTML w/ Parsoid markup?). Bug: T95476 Change-Id: Id3e0d26c697d409baf6668118a8e695ff96ab4e9 --- M Wikipedia/Categories/NSString+WMFHTMLParsing.h M Wikipedia/Categories/NSString+WMFHTMLParsing.m M Wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m M Wikipedia/View Controllers/ShareCard/WMFShareOptionsViewController.m M Wikipedia/View Controllers/WebView/WebViewController.h M Wikipedia/View Controllers/WebView/WebViewController.m M WikipediaUnitTests/NSString+WMFHTMLParsingTests.m 7 files changed, 64 insertions(+), 54 deletions(-) Approvals: Fjalapeno: Looks good to me, but someone else must approve Mhurd: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/Wikipedia/Categories/NSString+WMFHTMLParsing.h b/Wikipedia/Categories/NSString+WMFHTMLParsing.h index 94169f0..82062a8 100644 --- a/Wikipedia/Categories/NSString+WMFHTMLParsing.h +++ b/Wikipedia/Categories/NSString+WMFHTMLParsing.h @@ -25,11 +25,12 @@ /** * Parse the receiver as HTML and return a heuristically defined snippet. */ -- (NSString*)wmf_getStringSnippetWithoutHTML; +- (NSString*)wmf_shareSnippetFromHTML; + +/// @return A new string which has been sanitized to remove unnecesary characters and wiki markup. +- (NSString*)wmf_shareSnippetFromText; /** - * - * * @return Return string with internal whitespace segments reduced to single space. Accounts for end of sentence punctuation like commas, semicolons and periods. Trims leading and trailing whitespace as well. */ - (NSString*)wmf_getCollapsedWhitespaceStringAdjustedForTerminalPunctuation; diff --git a/Wikipedia/Categories/NSString+WMFHTMLParsing.m b/Wikipedia/Categories/NSString+WMFHTMLParsing.m index a89ad8f..63edc71 100644 --- a/Wikipedia/Categories/NSString+WMFHTMLParsing.m +++ b/Wikipedia/Categories/NSString+WMFHTMLParsing.m @@ -1,6 +1,7 @@ #import "NSString+WMFHTMLParsing.h" #import "WikipediaAppUtils.h" #import +#import "NSString+Extras.h" static int const kMinimumLengthForPreTransformedHTMLForSnippet = 40; static int const kHighestIndexForSubstringAfterHTMLRemoved = 350; @@ -30,46 +31,43 @@ return [[self wmf_htmlTextNodes] componentsJoinedByString:delimiter]; } -- (NSString*)wmf_getStringSnippetWithoutHTML { +- (NSString*)wmf_shareSnippetFromHTML { if (self.length < kMinimumLengthForPreTransformedHTMLForSnippet) { return nil; } -NSData* stringData = [self dataUsingEncoding:NSUTF8StringEncoding]; -TFHpple* parser = [TFHpple hppleWithHTMLData:stringData]; -NSArray* textNodes = [parser searchWithXPathQuery:@"//p[1]//text()"]; -NSMutableArray* results = @[].mutableCopy; -for (TFHppleElement* node in textNodes) { -[results addObject:node.raw]; -} -NSString* result = [results componentsJoinedByString:@""]; -result = [result substringToIndex: - MIN(kHighestIndexForSubstringAfterHTMLRemoved, result.length)]; -result = [NSString wmf_stringSnippetSimplifiedInString:result]; -return result.length >= kMinimumLengthForPreTransformedHTMLForSnippet ? - result : nil; +NSString* result = +[[TFHpple hppleWithHTMLData:[self dataUsingEncoding:NSUTF8StringEncoding]] + searchWithXPathQuery:@"//p[1]//text()"] +valueForKey:WMF_SAFE_KEYPATH([TFHppleElement new], raw)] + componentsJoinedByString:@""] + wmf_safeSubstringToIndex:kHighestIndexForSubstringAfterHTMLRemoved] + wmf_shareSnippetFromText]; +return result.length >= kMinimumLengthForPreTransformedHTMLForSnippet ? result : nil; } #pragma mark - String simplification and cleanup -+ (NSString*)wmf_stringSnippetSimplifiedInString:(NSString*)string { -NSString* result = [string stringByReplacingOccurrencesOfString:@"&" withString:@"&"]; -result = [string stringByReplacingOccurrencesOfString:@">" withString:@">"]; -result = [string stringByReplacingOccurrencesOfString:@"<" withString:@"<"]; -result = [result wmf_stringByCollapsingConsecutiveNewlines]; -result = [result wmf_stringByRecursivelyRemovingParenthesizedContent]; -result = [result wmf_stringByRemovingBracketedContent]; -result = [result wmf_stringByRemovingWhiteSpaceBeforeCommasAndSemicolons]; -result = [result wm
[MediaWiki-commits] [Gerrit] Fix for soon-to-be-deprecated query continue parameter warni... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/209149 Change subject: Fix for soon-to-be-deprecated query continue parameter warnings. .. Fix for soon-to-be-deprecated query continue parameter warnings. Change-Id: I0fe1c2f42d24e77ef7d33601a9e6526407120cb1 --- M Wikipedia/Networking/Fetchers/PageHistoryFetcher.m M Wikipedia/Networking/Fetchers/WikiTextSectionFetcher.m 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/49/209149/1 diff --git a/Wikipedia/Networking/Fetchers/PageHistoryFetcher.m b/Wikipedia/Networking/Fetchers/PageHistoryFetcher.m index 0ea6b90..f7a8422 100644 --- a/Wikipedia/Networking/Fetchers/PageHistoryFetcher.m +++ b/Wikipedia/Networking/Fetchers/PageHistoryFetcher.m @@ -75,6 +75,7 @@ @"rvlimit": @50, @"rvdir": @"older", @"titles": title.prefixedText, +@"continue": @"", @"format": @"json" //,@"rvdiffto": @(-1) // Add this to fake out "error" api response. }.mutableCopy; diff --git a/Wikipedia/Networking/Fetchers/WikiTextSectionFetcher.m b/Wikipedia/Networking/Fetchers/WikiTextSectionFetcher.m index ceb09e1..74df9bf 100644 --- a/Wikipedia/Networking/Fetchers/WikiTextSectionFetcher.m +++ b/Wikipedia/Networking/Fetchers/WikiTextSectionFetcher.m @@ -89,6 +89,7 @@ @"rvsection": self.section.index ? self.section.index : @"0", @"titles": [self.section sourceTitle].prefixedText, @"meta": @"userinfo", // we need the local user ID for event logging + @"continue": @"", @"format": @"json" }; } -- To view, visit https://gerrit.wikimedia.org/r/209149 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0fe1c2f42d24e77ef7d33601a9e6526407120cb1 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Return lead image height and font sizes to pre-refactor sett... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/208905 Change subject: Return lead image height and font sizes to pre-refactor settings. .. Return lead image height and font sizes to pre-refactor settings. I accidentally made the lead image shorter and its title and description font sizes too small in the non-native refactor. This patch tweaks those settings so they're exactly sized as they were pre-refactor. Change-Id: I0678db89db29651a026f94b020cde88cd835be34 --- M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/assets/styleoverrides.css M www/less/styleoverrides.less 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/05/208905/1 diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 2fbf833..ec06295 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -1586,9 +1586,9 @@ "" "", leadImageDivStyleOverrides, - [NSString stringWithFormat:@"font-size:%.02fpx;", 28.0f * fontMultiplier], + [NSString stringWithFormat:@"font-size:%.02fpx;", 34.0f * fontMultiplier], title, - [NSString stringWithFormat:@"font-size:%.02fpx;", 14.0f], + [NSString stringWithFormat:@"font-size:%.02fpx;", 17.0f], description ]; diff --git a/Wikipedia/assets/styleoverrides.css b/Wikipedia/assets/styleoverrides.css index 9135f07..883e447 100644 --- a/Wikipedia/assets/styleoverrides.css +++ b/Wikipedia/assets/styleoverrides.css @@ -1 +1 @@ -a:hover{text-decoration:none !important}.content{margin-top:0px}.lead_image_div{margin-left:-16px !important;margin-right:-16px !important;transition-timing-function:ease-in-out}div#lead_image_none div.lead_image_div{height:auto !important}#lead_image_text_container{padding:16px;pointer-events:none !important}div#lead_image_none div#lead_image_text_container{position:relative !important;padding-bottom:0px !important;padding-top:0px !important}#lead_image_title,#lead_image_description{font-family:Times New Roman;pointer-events:none !important}#lead_image_title{padding-top:4px;line-height:100%;margin-top:6px;margin-bottom:6px}div#lead_image_none div#lead_image_title{color:#000 !important;text-shadow:none !important}#lead_image_description{line-height:115%}div#lead_image_none div#lead_image_description{color:#000 !important;text-shadow:none !important}@media (orientation:portrait){.lead_image_div{height:11em;background-repeat:no-repeat;background-size:cover;color:#fff;position:relative}#lead_image_text_container{position:absolute;bottom:0px}#lead_image_title,#lead_image_description{text-shadow:0 1px .5px rgba(0,0,0,0.25)}}@media (orientation:landscape){.lead_image_div{background-size:0 0;height:auto;color:#000;padding-bottom:0px;padding-top:0px}#lead_image_text_container{padding-bottom:0px;padding-top:0px}}.content_block,.image_overflow_x_container{clear:both;overflow-x:auto}#edit_section_button_0{margin-top:6px}#section_heading_and_content_block_0{margin-top:13px}.ios-disambiguation-item-anchor{display:block;padding-top:8px;padding-bottom:8px}.ios-issue-item{padding-top:8px;padding-bottom:8px}.ios-issue-item *{font-weight:normal !important}#disambig_sub_container,#issues_sub_container{background-color:#fff !important;border-bottom:1px solid #ccc;padding-top:6px;padding-bottom:12px;margin-bottom:12px}#issues_container_close_button{color:#333;display:none;font-weight:bold;padding:4px 20px 4px 20px}a.issues_button,a.disambig_button{padding:4px 0px 4px 0px !important}span.issues_separator{padding-top:4px!important;padding-bottom:4px!important}div.issues_container{margin-bottom:1.8em !important} \ No newline at end of file +a:hover{text-decoration:none !important}.content{margin-top:0px}.lead_image_div{margin-left:-16px !important;margin-right:-16px !important;transition-timing-function:ease-in-out}div#lead_image_none div.lead_image_div{height:auto !important}#lead_image_text_container{padding:16px;pointer-events:none !important}div#lead_image_none div#lead_image_text_container{position:relative !important;padding-bottom:0px !important;padding-top:0px !important}#lead_image_title,#lead_image_description{font-family:Times New Roman;pointer-events:none !important}#lead_image_title{padding-top:4px;line-height:100%;margin-top:6px;margin-bottom:6px}div#lead_image_none div#lead_image_title{color:#000 !important;text-shadow:none !important}#lead_image_description{line-height:117%}div#lead_image_none div#lead_image_description{color:#000 !important;text-shadow:none !important}@media (orientation:portrait){.lead_image_div{height:12.6em;background-repeat:no-repeat;background-size:cover;color:#fff;position:relative}#lead_image_text_conta
[MediaWiki-commits] [Gerrit] Fix for landscape lead image popping into existence when TOC... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/208894 Change subject: Fix for landscape lead image popping into existence when TOC shown. .. Fix for landscape lead image popping into existence when TOC shown. Change-Id: I5c2588fd7d3b12a67deb148cec92bc5fda7347cc --- M Wikipedia/View Controllers/WebView/WebViewController.m 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/94/208894/1 diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 2fbf833..e9fd52f 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -493,9 +493,8 @@ // webViewBottomConstraint adjustment below). So here the web view's bottom // constraint is shifted down while TOC is onscreen. CGFloat webViewScale = [self tocGetWebViewScaleWhenTOCVisible]; -CGFloat f= self.webView.frame.size.height + (self.webView.frame.size.height * webViewScale); +CGFloat f= (self.webView.scrollView.bounds.size.height - (self.webView.scrollView.bounds.size.height * webViewScale)) * (1.0f / webViewScale); self.webViewBottomConstraint.constant = f; - self.unsafeToToggleTOC = YES; -- To view, visit https://gerrit.wikimedia.org/r/208894 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c2588fd7d3b12a67deb148cec92bc5fda7347cc Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix for lead image getting really tall when table of content... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/208809 Change subject: Fix for lead image getting really tall when table of contents shown. .. Fix for lead image getting really tall when table of contents shown. Change-Id: Icae325db1dccaac794fb6a892819a23008fab222 --- M Wikipedia/assets/styleoverrides.css M www/less/styleoverrides.less 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/09/208809/1 diff --git a/Wikipedia/assets/styleoverrides.css b/Wikipedia/assets/styleoverrides.css index 571c261..9135f07 100644 --- a/Wikipedia/assets/styleoverrides.css +++ b/Wikipedia/assets/styleoverrides.css @@ -1 +1 @@ -a:hover{text-decoration:none !important}.content{margin-top:0px}.lead_image_div{margin-left:-16px !important;margin-right:-16px !important;transition-timing-function:ease-in-out}div#lead_image_none div.lead_image_div{height:auto !important}#lead_image_text_container{padding:16px;pointer-events:none !important}div#lead_image_none div#lead_image_text_container{position:relative !important;padding-bottom:0px !important;padding-top:0px !important}#lead_image_title,#lead_image_description{font-family:Times New Roman;pointer-events:none !important}#lead_image_title{padding-top:4px;line-height:100%;margin-top:6px;margin-bottom:6px}div#lead_image_none div#lead_image_title{color:#000 !important;text-shadow:none !important}#lead_image_description{line-height:115%}div#lead_image_none div#lead_image_description{color:#000 !important;text-shadow:none !important}@media (orientation:portrait){.lead_image_div{height:35vh;background-repeat:no-repeat;background-size:cover;color:#fff;position:relative}#lead_image_text_container{position:absolute;bottom:0px}#lead_image_title,#lead_image_description{text-shadow:0 1px .5px rgba(0,0,0,0.25)}}@media (orientation:landscape){.lead_image_div{background-size:0 0;height:auto;color:#000;padding-bottom:0px;padding-top:0px}#lead_image_text_container{padding-bottom:0px;padding-top:0px}}.content_block,.image_overflow_x_container{clear:both;overflow-x:auto}#edit_section_button_0{margin-top:6px}#section_heading_and_content_block_0{margin-top:13px}.ios-disambiguation-item-anchor{display:block;padding-top:8px;padding-bottom:8px}.ios-issue-item{padding-top:8px;padding-bottom:8px}.ios-issue-item *{font-weight:normal !important}#disambig_sub_container,#issues_sub_container{background-color:#fff !important;border-bottom:1px solid #ccc;padding-top:6px;padding-bottom:12px;margin-bottom:12px}#issues_container_close_button{color:#333;display:none;font-weight:bold;padding:4px 20px 4px 20px}a.issues_button,a.disambig_button{padding:4px 0px 4px 0px !important}span.issues_separator{padding-top:4px!important;padding-bottom:4px!important}div.issues_container{margin-bottom:1.8em !important} \ No newline at end of file +a:hover{text-decoration:none !important}.content{margin-top:0px}.lead_image_div{margin-left:-16px !important;margin-right:-16px !important;transition-timing-function:ease-in-out}div#lead_image_none div.lead_image_div{height:auto !important}#lead_image_text_container{padding:16px;pointer-events:none !important}div#lead_image_none div#lead_image_text_container{position:relative !important;padding-bottom:0px !important;padding-top:0px !important}#lead_image_title,#lead_image_description{font-family:Times New Roman;pointer-events:none !important}#lead_image_title{padding-top:4px;line-height:100%;margin-top:6px;margin-bottom:6px}div#lead_image_none div#lead_image_title{color:#000 !important;text-shadow:none !important}#lead_image_description{line-height:115%}div#lead_image_none div#lead_image_description{color:#000 !important;text-shadow:none !important}@media (orientation:portrait){.lead_image_div{height:11em;background-repeat:no-repeat;background-size:cover;color:#fff;position:relative}#lead_image_text_container{position:absolute;bottom:0px}#lead_image_title,#lead_image_description{text-shadow:0 1px .5px rgba(0,0,0,0.25)}}@media (orientation:landscape){.lead_image_div{background-size:0 0;height:auto;color:#000;padding-bottom:0px;padding-top:0px}#lead_image_text_container{padding-bottom:0px;padding-top:0px}}.content_block,.image_overflow_x_container{clear:both;overflow-x:auto}#edit_section_button_0{margin-top:6px}#section_heading_and_content_block_0{margin-top:13px}.ios-disambiguation-item-anchor{display:block;padding-top:8px;padding-bottom:8px}.ios-issue-item{padding-top:8px;padding-bottom:8px}.ios-issue-item *{font-weight:normal !important}#disambig_sub_container,#issues_sub_container{background-color:#fff !important;border-bottom:1px solid #ccc;padding-top:6px;padding-bottom:12px;margin-bottom:12px}#issues_container_close_button{color:#333;display:none;font-weight:bold;padding:4px 20px 4px 20px}a.issues_button,a.disambig_button{padding:4px 0px 4px 0px !important}spa
[MediaWiki-commits] [Gerrit] Translatable messages tweaks - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Translatable messages tweaks .. Translatable messages tweaks * Fix capitalization of Unable. * Replace "&" with "and". Change-Id: Ia4da010821e955383535b83c0c4e54fafae16842 --- M Wikipedia/en.lproj/Localizable.strings 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Mhurd: Verified; Looks good to me, approved diff --git a/Wikipedia/en.lproj/Localizable.strings b/Wikipedia/en.lproj/Localizable.strings index b5d0aab..5a4e386 100644 --- a/Wikipedia/en.lproj/Localizable.strings +++ b/Wikipedia/en.lproj/Localizable.strings @@ -287,14 +287,14 @@ "migration-update-progress-label" = "Migrating local data"; "migration-update-progress-count-label" = "Migrating article $1 of $2"; "migration-prompt-title" = "Looks like we have a history!"; -"migration-prompt-message" = "We need to move your saved & recent pages over. This may take a minute…"; +"migration-prompt-message" = "We need to move your saved and recent pages over. This may take a minute…"; "migration-confirm-button-title" = "Move my stuff over"; "migration-skip-button-title" = "Delete it"; "image-gallery-unknown-owner" = "Uploader unknown."; "image-gallery-fetch-image-info-error-title" = "Unable to download images"; -"image-gallery-fetch-image-info-error-message" = "UNable to download the images for this article. Please refresh the article and try again."; +"image-gallery-fetch-image-info-error-message" = "Unable to download the images for this article. Please refresh the article and try again."; "image-gallery-fetch-image-info-error-ok" = "OK"; "hockeyapp-alert-question" = "Would you like to send a crash report to $1 so Wikimedia can review your crash?"; -- To view, visit https://gerrit.wikimedia.org/r/208464 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia4da010821e955383535b83c0c4e54fafae16842 Gerrit-PatchSet: 3 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Amire80 Gerrit-Reviewer: Bgerstle Gerrit-Reviewer: Fjalapeno Gerrit-Reviewer: Mhurd Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix typo. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/208673 Change subject: Fix typo. .. Fix typo. Change-Id: Id2f9cad27024f41923e28b6cf9a6410e6aa110aa --- M MediaWikiKit/MediaWikiKit/MWKImage.h M MediaWikiKit/MediaWikiKit/MWKImage.m M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/Web Image Interception/URLCache.m 4 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/73/208673/1 diff --git a/MediaWikiKit/MediaWikiKit/MWKImage.h b/MediaWikiKit/MediaWikiKit/MWKImage.h index 74d5f65..3040a63 100644 --- a/MediaWikiKit/MediaWikiKit/MWKImage.h +++ b/MediaWikiKit/MediaWikiKit/MWKImage.h @@ -56,7 +56,7 @@ * @param normalized Set YES to normalize to the image * @return The primary focal rect */ -- (CGRect)primaryFocalRectNomrmalizedToImageSize:(BOOL)normalized; +- (CGRect)primaryFocalRectNormalizedToImageSize:(BOOL)normalized; /** * Returns a rect enclosing all focal rects @@ -66,7 +66,7 @@ * @return The rect enclosing all focal rects */ -- (CGRect)rectEnclosingAllFocalRectsNomrmalizedToImageSize:(BOOL)normalized; +- (CGRect)rectEnclosingAllFocalRectsNormalizedToImageSize:(BOOL)normalized; - (void)importImageData:(NSData*)data; diff --git a/MediaWikiKit/MediaWikiKit/MWKImage.m b/MediaWikiKit/MediaWikiKit/MWKImage.m index c688925..af31202 100644 --- a/MediaWikiKit/MediaWikiKit/MWKImage.m +++ b/MediaWikiKit/MediaWikiKit/MWKImage.m @@ -74,7 +74,7 @@ return normalized; } -- (CGRect)primaryFocalRectNomrmalizedToImageSize:(BOOL)normalized { +- (CGRect)primaryFocalRectNormalizedToImageSize:(BOOL)normalized { if (self.focalRectsInUnitCoordinatesAsStrings.count == 0) { return CGRectZero; } @@ -89,7 +89,7 @@ return rect; } -- (CGRect)rectEnclosingAllFocalRectsNomrmalizedToImageSize:(BOOL)normalized { +- (CGRect)rectEnclosingAllFocalRectsNormalizedToImageSize:(BOOL)normalized { __block CGRect enclosingRect = CGRectZero; [self.focalRectsInUnitCoordinatesAsStrings enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL* stop) { diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 87b0db3..2fbf833 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -1561,7 +1561,7 @@ NSInteger offsetY = 25; if (hasImage) { -CGRect focalRect = [article.image primaryFocalRectNomrmalizedToImageSize:NO]; +CGRect focalRect = [article.image primaryFocalRectNormalizedToImageSize:NO]; if (!CGRectEqualToRect(focalRect, CGRectZero)) { offsetY = [self leadImageFocalOffsetYPercentageFromTopOfRect:focalRect]; } diff --git a/Wikipedia/Web Image Interception/URLCache.m b/Wikipedia/Web Image Interception/URLCache.m index 8e9669a..2c5579a 100644 --- a/Wikipedia/Web Image Interception/URLCache.m +++ b/Wikipedia/Web Image Interception/URLCache.m @@ -111,7 +111,7 @@ kURLCacheKeyURL: image.sourceURL, kURLCacheKeyFileNameNoSizePrefix: image.fileNameNoSizePrefix, kURLCacheKeyIsLeadImage: @([image isLeadImage]), - kURLCacheKeyPrimaryFocalUnitRectString: NSStringFromCGRect([image primaryFocalRectNomrmalizedToImageSize:NO]) + kURLCacheKeyPrimaryFocalUnitRectString: NSStringFromCGRect([image primaryFocalRectNormalizedToImageSize:NO]) }]; } -- To view, visit https://gerrit.wikimedia.org/r/208673 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id2f9cad27024f41923e28b6cf9a6410e6aa110aa Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Non-native lead image. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/208042 Change subject: Non-native lead image. .. Non-native lead image. Fixes issue where italics title was not italic in lead image overlay. Moves face detection from display time to image save time. No bridge messages. Only one non-bridged js message when face offset is calculated. When that one js message is sent the image offset is changed via css with css animation. Note this only happens the first time a lead image is retrieved. If the server could tell us the face offset we wouldn't need to animate this. Subsequently when the article is re-presented the lead image face offset is used directly (no need to animate it sliding to the proper offset for the face since we know right away from the MWKImage face offset value what it should be). Lead image, placeholder image and gradient all shown via css. Properly displays images with alpha so placeholder image does't bleed through. Landscape display (title and description text color to black, no gradient, no background image, no drop shadow around letters) all handled in css with no js. No separate mechanism for downloading lead image required, the web view requests the image in same fashion as other images. Separate mechanism no longer needed for saving lead image binary to data store. Fixes display jitters related to keeping a "spacer" div in sync with the height of a native lead image component. Change-Id: I860523e12492b6857d8246e8ee4adfcea40a5376 --- M MediaWikiKit/MediaWikiKit/MWKDataStore.m M MediaWikiKit/MediaWikiKit/MWKImage.h M MediaWikiKit/MediaWikiKit/MWKImage.m M Wikipedia.xcodeproj/project.pbxproj M Wikipedia/C Methods/WMFArticleParsing.m M Wikipedia/Categories/MWKSection+DisplayHtml.m M Wikipedia/Categories/NSURL+WMFRest.h M Wikipedia/Categories/NSURL+WMFRest.m M Wikipedia/Categories/UIWebView+LoadAssetsHtml.h M Wikipedia/Categories/UIWebView+LoadAssetsHtml.m A Wikipedia/Protocols/WMFBundledImageProtocol.h A Wikipedia/Protocols/WMFBundledImageProtocol.m M Wikipedia/Protocols/WMFLocalizationProtocol.m D Wikipedia/View Controllers/LeadImage/LeadImageContainer.h D Wikipedia/View Controllers/LeadImage/LeadImageContainer.m D Wikipedia/View Controllers/LeadImage/LeadImageContainer.xib D Wikipedia/View Controllers/LeadImage/LeadImageTitleAttributedString.h D Wikipedia/View Controllers/LeadImage/LeadImageTitleAttributedString.m D Wikipedia/View Controllers/LeadImage/LeadImageTitleLabel.h D Wikipedia/View Controllers/LeadImage/LeadImageTitleLabel.m M Wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m M Wikipedia/View Controllers/WebView/WebViewController.h M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/View Controllers/WebView/WebViewController_Private.h M Wikipedia/Web Image Interception/URLCache.h M Wikipedia/Web Image Interception/URLCache.m M Wikipedia/assets/bundle.js M Wikipedia/assets/index.html M Wikipedia/assets/preview.html M Wikipedia/assets/styleoverrides.css M Wikipedia/mw-bridge/CommunicationBridge.h M Wikipedia/mw-bridge/CommunicationBridge.m M www/index.html M www/js/listeners.js M www/less/styleoverrides.less M www/preview.html 36 files changed, 409 insertions(+), 895 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/42/208042/1 diff --git a/MediaWikiKit/MediaWikiKit/MWKDataStore.m b/MediaWikiKit/MediaWikiKit/MWKDataStore.m index f1b4ff5..cbac4ce 100644 --- a/MediaWikiKit/MediaWikiKit/MWKDataStore.m +++ b/MediaWikiKit/MediaWikiKit/MWKDataStore.m @@ -10,6 +10,7 @@ #import #import "NSString+Extras.h" +#import "WMFFaceDetector.h" NSString* const MWKDataStoreValidImageSitePrefix = @"//upload.wikimedia.org/"; NSString* MWKCreateImageURLWithPath(NSString* path) { @@ -208,6 +209,30 @@ - (void)saveImageData:(NSData*)data image:(MWKImage*)image { NSString* path = [self pathForImage:image]; NSString* filename = [@"Image" stringByAppendingPathExtension:image.extension]; + +// TODO: move this face detection to MWKImage? Is here at present so "data" can be accessed w/o +// expensively re-retrieving it. +if ([image isLeadImage]) { +// Detect face if is article main image. +// Don't run face detection needlessly if it has failed previously. +if (image.yFocalOffset.integerValue != -1) { +static WMFFaceDetector* faceDetector = nil; +if(!faceDetector) { +faceDetector = [[WMFFaceDetector alloc] init]; +} +CIImage* ciImage = [[CIImage alloc] initWithData:data]; +faceDetector.image = [UIImage imageWithCIImage:ciImage]; +CGRect faceRect = [faceDetector detectFace]; +if (CGRectEqualToRect(faceRect, CGRectZero)) { +// Record failure so we don't run face detection again needlessly. +image.yFocalOffset = @(-1); +} e
[MediaWiki-commits] [Gerrit] Fix for similar pages bug exibited on enwiki page "absidia". - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/207342 Change subject: Fix for similar pages bug exibited on enwiki page "absidia". .. Fix for similar pages bug exibited on enwiki page "absidia". Change-Id: I47894c9d67b37ff96838c40ecebf60efbed38ac9 --- M Wikipedia/assets/bundle.js M www/js/transforms/collapsePageIssuesAndDisambig.js 2 files changed, 16 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/42/207342/1 diff --git a/Wikipedia/assets/bundle.js b/Wikipedia/assets/bundle.js index a9b391f..80c2c8d 100644 --- a/Wikipedia/assets/bundle.js +++ b/Wikipedia/assets/bundle.js @@ -573,9 +573,11 @@ len = links.length; for (; i < len; i++) { // Pass the href; we'll decode it into a proper page title in Obj-C -res.push( links[i].getAttribute( 'href' ) ); +if(links[i].getAttribute( 'href' ).indexOf("redlink=1") === -1){ +res.push( links[i] ); +} } -return res.sort(); +return res; } function collectIssues( sourceNode ) { @@ -590,10 +592,9 @@ return res; } -function anchorForUrl(url) { -var titleForDisplay = decodeURIComponent(url); -titleForDisplay = (titleForDisplay.indexOf('/wiki/') === 0) ? titleForDisplay.substring(6) : titleForDisplay; -titleForDisplay = titleForDisplay.split('_').join(' '); +function anchorForAnchor(anchor) { +var url = anchor.getAttribute( 'href' ); +var titleForDisplay = anchor.text.substring(0,1).toUpperCase() + anchor.text.substring(1); return '' + titleForDisplay + ''; } @@ -668,7 +669,7 @@ var disambig = collectDisambig( sourceNode.parentNode ); var issues = collectIssues( sourceNode.parentNode.parentNode ); // not clicked node -toggleSubContainers('disambig_sub_container', 'issues_sub_container', disambig.map(anchorForUrl).join( "" )); +toggleSubContainers('disambig_sub_container', 'issues_sub_container', disambig.map(anchorForAnchor).sort().join( "" )); toggleSubContainerButtons('disambig_sub_container', 'disambig_button', 'issues_button'); return { "hatnotes": disambig, "issues": issues }; diff --git a/www/js/transforms/collapsePageIssuesAndDisambig.js b/www/js/transforms/collapsePageIssuesAndDisambig.js index 6f7667f..76ab5e7 100644 --- a/www/js/transforms/collapsePageIssuesAndDisambig.js +++ b/www/js/transforms/collapsePageIssuesAndDisambig.js @@ -73,9 +73,11 @@ len = links.length; for (; i < len; i++) { // Pass the href; we'll decode it into a proper page title in Obj-C -res.push( links[i].getAttribute( 'href' ) ); +if(links[i].getAttribute( 'href' ).indexOf("redlink=1") === -1){ +res.push( links[i] ); +} } -return res.sort(); +return res; } function collectIssues( sourceNode ) { @@ -90,10 +92,9 @@ return res; } -function anchorForUrl(url) { -var titleForDisplay = decodeURIComponent(url); -titleForDisplay = (titleForDisplay.indexOf('/wiki/') === 0) ? titleForDisplay.substring(6) : titleForDisplay; -titleForDisplay = titleForDisplay.split('_').join(' '); +function anchorForAnchor(anchor) { +var url = anchor.getAttribute( 'href' ); +var titleForDisplay = anchor.text.substring(0,1).toUpperCase() + anchor.text.substring(1); return '' + titleForDisplay + ''; } @@ -168,7 +169,7 @@ var disambig = collectDisambig( sourceNode.parentNode ); var issues = collectIssues( sourceNode.parentNode.parentNode ); // not clicked node -toggleSubContainers('disambig_sub_container', 'issues_sub_container', disambig.map(anchorForUrl).join( "" )); +toggleSubContainers('disambig_sub_container', 'issues_sub_container', disambig.map(anchorForAnchor).sort().join( "" )); toggleSubContainerButtons('disambig_sub_container', 'disambig_button', 'issues_button'); return { "hatnotes": disambig, "issues": issues }; -- To view, visit https://gerrit.wikimedia.org/r/207342 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I47894c9d67b37ff96838c40ecebf60efbed38ac9 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Bug T96605 - fixing saves of the history - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Bug T96605 - fixing saves of the history .. Bug T96605 - fixing saves of the history Another case of throwing exceptions in the data layer. This patch adds support for NSErrors in place of exceptions. To do this required changing the save method to use one that produces an error, and making changes to some method signatures to bubble the errors up. Also, changed the flow of the saves a bit, instead of passing a save block, methods just need to convert the object into NSData before writing to disk. Change-Id: I1e6fb1fad6b93277268a6c7c7df42424c80fa83d --- M MediaWikiKit/MediaWikiKit/MWKDataStore.h M MediaWikiKit/MediaWikiKit/MWKDataStore.m M MediaWikiKit/MediaWikiKit/MWKUserDataStore.h M MediaWikiKit/MediaWikiKit/MWKUserDataStore.m 4 files changed, 55 insertions(+), 50 deletions(-) Approvals: Mhurd: Looks good to me, approved Bgerstle: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/MediaWikiKit/MediaWikiKit/MWKDataStore.h b/MediaWikiKit/MediaWikiKit/MWKDataStore.h index b2192ee..8d2e8e9 100644 --- a/MediaWikiKit/MediaWikiKit/MWKDataStore.h +++ b/MediaWikiKit/MediaWikiKit/MWKDataStore.h @@ -67,7 +67,7 @@ - (void)saveSectionText:(NSString*)html section:(MWKSection*)section; - (void)saveImage:(MWKImage*)image; - (void)saveImageData:(NSData*)data image:(MWKImage*)image; -- (void)saveHistoryList:(MWKHistoryList*)list; +- (BOOL)saveHistoryList:(MWKHistoryList*)list error:(NSError**)error; - (void)saveSavedPageList:(MWKSavedPageList*)list; - (void)saveRecentSearchList:(MWKRecentSearchList*)list; - (void)saveImageList:(MWKImageList*)imageList; diff --git a/MediaWikiKit/MediaWikiKit/MWKDataStore.m b/MediaWikiKit/MediaWikiKit/MWKDataStore.m index c81901b..f1b4ff5 100644 --- a/MediaWikiKit/MediaWikiKit/MWKDataStore.m +++ b/MediaWikiKit/MediaWikiKit/MWKDataStore.m @@ -135,58 +135,51 @@ #pragma mark - save methods +- (BOOL)ensurePathExists:(NSString*)path error:(NSError**)error { +return [[NSFileManager defaultManager] createDirectoryAtPath:path + withIntermediateDirectories:YES + attributes:nil + error:error]; +} + - (void)ensurePathExists:(NSString*)path { -NSError* err; -[[NSFileManager defaultManager] createDirectoryAtPath:path - withIntermediateDirectories:YES - attributes:nil -error:&err]; -if (err) { -@throw [NSException exceptionWithName:@"MWKDataStoreException" - reason:@"path creation failure" - userInfo:@{@"path": path, @"error": err}]; -} +[self ensurePathExists:path error:NULL]; } -- (void)saveFile:(NSString*)filename atPath:(NSString*)path byPerforming:(NSError*(^)(NSString*))saveBlock { -[self ensurePathExists:path]; +- (BOOL)saveData:(NSData*)data toFile:(NSString*)filename atPath:(NSString*)path error:(NSError**)error { +[self ensurePathExists:path error:error]; NSString* absolutePath = [path stringByAppendingPathComponent:filename]; -NSError* error = saveBlock(absolutePath); -if (error) { -@throw [NSException exceptionWithName:@"MWKDataStoreException" - reason:[NSString stringWithFormat:@"Failed to save %@ in %@.", filename, path] - userInfo:NSDictionaryOfVariableBindings(error)]; -} -} - -- (void)saveArray:(NSArray*)array path:(NSString*)path name:(NSString*)name { -[self saveFile:name atPath:path byPerforming:^NSError*(NSString* absPath) { -return [array writeToFile:absPath atomically:YES] ? -nil : [NSError errorWithDomain:@"MWKDataStoreArrayWriteToFileFailedException" code:1 userInfo:nil]; -}]; -} - -- (void)saveDictionary:(NSDictionary*)dict path:(NSString*)path name:(NSString*)name { -[self saveFile:name atPath:path byPerforming:^NSError*(NSString* absPath) { -return [dict writeToFile:absPath atomically:YES] ? -nil : [NSError errorWithDomain:@"MWKDataStoreDictWriteToFileFailedException" code:1 userInfo:nil]; -}]; -} - -- (void)saveString:(NSString*)string path:(NSString*)path name:(NSString*)name { -[self saveFile:name atPath:path byPerforming:^NSError*(NSString* absPath) { -NSError* err = nil; -[string writeToFile:absPath atomically:YES encoding:NSUTF8StringEncoding error:&err]; -return err; -}]; +return [data writeToFile:absolutePath options:NSDataWritingAtomic error:error]; } - (void)saveData:(NSData*)data path:(NSString*)path name:(NSString*)name { -[self saveFile:name atPath:path byPerforming:^NSError*(NSS
[MediaWiki-commits] [Gerrit] Fix logic in testing code - wasn't using the passed in param... - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Fix logic in testing code - wasn't using the passed in parameter and the unit test was failing and broke the build .. Fix logic in testing code - wasn't using the passed in parameter and the unit test was failing and broke the build Change-Id: I854eb433ec117f3cadae1ee49e534f8f73f2f882 --- M WikipediaUnitTests/Utilities/NSBundle+TestAssets.m 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Mhurd: Looks good to me, approved jenkins-bot: Verified diff --git a/WikipediaUnitTests/Utilities/NSBundle+TestAssets.m b/WikipediaUnitTests/Utilities/NSBundle+TestAssets.m index e5d0c0a..2ef5dce 100644 --- a/WikipediaUnitTests/Utilities/NSBundle+TestAssets.m +++ b/WikipediaUnitTests/Utilities/NSBundle+TestAssets.m @@ -12,7 +12,7 @@ - (NSData*)wmf_dataFromContentsOfFile:(NSString *)filename ofType:(NSString *)type { NSError* error; -NSData* data = [NSData dataWithContentsOfFile:[self pathForResource:filename ofType:@"json"] +NSData* data = [NSData dataWithContentsOfFile:[self pathForResource:filename ofType:type] options:0 error:&error]; NSParameterAssert(!error); -- To view, visit https://gerrit.wikimedia.org/r/206472 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I854eb433ec117f3cadae1ee49e534f8f73f2f882 Gerrit-PatchSet: 2 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Fjalapeno Gerrit-Reviewer: Mhurd Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix change logs - git not using the proper path to the repo. - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Fix change logs - git not using the proper path to the repo. .. Fix change logs - git not using the proper path to the repo. Change-Id: I3e20c18a8fd38997b9e8dba14880fdfea646c741 --- M fastlane/lib/utils.rb 1 file changed, 9 insertions(+), 8 deletions(-) Approvals: Mhurd: Looks good to me, approved jenkins-bot: Verified Objections: Bgerstle: There's a problem with this change, please improve diff --git a/fastlane/lib/utils.rb b/fastlane/lib/utils.rb index 9e23a78..f9f55ed 100644 --- a/fastlane/lib/utils.rb +++ b/fastlane/lib/utils.rb @@ -50,10 +50,11 @@ # Generate a list of commit subjects from `rev` to `HEAD` # :rev: The git SHA to start the log from, defaults to `ENV[LAST_SUCCESS_REV']` -def generate_git_commit_log(rev=ENV['LAST_SUCCESS_REV']) - g = Git.open(Dir.getwd) +def generate_git_commit_log(rev=ENV['GIT_PREVIOUS_SUCCESSFUL_COMMIT']) + g = Git.open(ENV['PWD'], :log => Logger.new(STDOUT)) change_log = g.log.between(rev).map { |c| "- " + c.message.lines.first.chomp }.join "\n" "Commit Log:\n\n#{change_log}\n" + p change_log end # Memoized version of `generate_git_commit_log` which stores the result in `ENV['GIT_COMMIT_LOG']`. @@ -66,17 +67,17 @@ # Upload the DSYM to Hockey hockey({ api_token: ENV['HOCKEY_API_TOKEN'], - notes: git_commit_log, + notes: '', notify: 0, status: 1, #Means do not make available for download }) -#Set "What To Test" in iTunes Connect for Testflight builds, in the future, reference tickets instead of git commits -DELIVER_WHAT_TO_TEST.replace = git_commit_log -#Set "App Description" in iTunes Connect for Testflight builds, in the future set a better description -DELIVER_BETA_DESCRIPTION.replace = git_commit_log #Set "Feedback email" in iTunes Connect for Testflight builds -DELIVER_BETA_FEEDBACK_EMAIL.replace = 'ab...@wikimedia.org' +self.class.const_set("DELIVER_BETA_FEEDBACK_EMAIL", 'ab...@wikimedia.org') +#Set "What To Test" in iTunes Connect for Testflight builds, in the future, reference tickets instead of git commits +self.class.const_set("DELIVER_WHAT_TO_TEST", git_commit_log) +#Set "App Description" in iTunes Connect for Testflight builds, in the future set a better description +self.class.const_set("DELIVER_BETA_DESCRIPTION", git_commit_log) # Upload the IPA and DSYM to iTunes Connect deliver :testflight, :beta, :skip_deploy, :force -- To view, visit https://gerrit.wikimedia.org/r/204651 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e20c18a8fd38997b9e8dba14880fdfea646c741 Gerrit-PatchSet: 3 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Fjalapeno Gerrit-Reviewer: Bgerstle Gerrit-Reviewer: Dr0ptp4kt Gerrit-Reviewer: Fjalapeno Gerrit-Reviewer: Mhurd Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix improperly defined const - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Fix improperly defined const .. Fix improperly defined const Change-Id: I2a6846a35f87dfd1c6679972016b487de5a32e70 --- M Wikipedia/Categories/NSString+WMFHTMLParsing.m M Wikipedia/Categories/NSURL+WMFRest.h M Wikipedia/Categories/NSURL+WMFRest.m M Wikipedia/Custom Views/WMFLoadingIndicatorOverlay.m M Wikipedia/EventLogging/WMFSuggestedPagesFunnel.m M Wikipedia/Networking/Fetchers/SearchResultFetcher.h M Wikipedia/Networking/Fetchers/SearchResultFetcher.m M Wikipedia/Protocols/WMFLocalizationProtocol.m M Wikipedia/Session/SessionSingleton.h M Wikipedia/Session/SessionSingleton.m M Wikipedia/View Controllers/LeadImage/LeadImageContainer.m M Wikipedia/View Controllers/SavedPages/NSAttributedString+WMFSavedPagesAttributedStrings.m M Wikipedia/View Controllers/SavedPages/SavedPagesViewController.m M Wikipedia/View Controllers/SearchResults/SearchResultAttributedString.h M Wikipedia/View Controllers/SearchResults/SearchResultAttributedString.m M Wikipedia/View Controllers/SearchResults/SearchResultsController.m M Wikipedia/View Controllers/ShareCard/WMFShareFunnel.m M Wikipedia/View Controllers/ShareCard/WMFShareOptionsView.m M Wikipedia/View Controllers/WebView/Footer/SubFooters/Legal/WMFLegalFooterViewController.h M Wikipedia/View Controllers/WebView/Footer/SubFooters/Legal/WMFLegalFooterViewController.m M Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.m M Wikipedia/View Controllers/WebView/Footer/SubFooters/ReadMore/WMFReadMoreViewController.m M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/View Controllers/WebView/WebViewController_Private.h M Wikipedia/mw-utils/WikipediaAppUtils.m 25 files changed, 94 insertions(+), 96 deletions(-) Approvals: Mhurd: Looks good to me, approved jenkins-bot: Verified diff --git a/Wikipedia/Categories/NSString+WMFHTMLParsing.m b/Wikipedia/Categories/NSString+WMFHTMLParsing.m index f48ba4c..a89ad8f 100644 --- a/Wikipedia/Categories/NSString+WMFHTMLParsing.m +++ b/Wikipedia/Categories/NSString+WMFHTMLParsing.m @@ -2,8 +2,8 @@ #import "WikipediaAppUtils.h" #import -static const int kMinimumLengthForPreTransformedHTMLForSnippet = 40; -static const int kHighestIndexForSubstringAfterHTMLRemoved = 350; +static int const kMinimumLengthForPreTransformedHTMLForSnippet = 40; +static int const kHighestIndexForSubstringAfterHTMLRemoved = 350; @implementation NSString (WMFHTMLParsing) diff --git a/Wikipedia/Categories/NSURL+WMFRest.h b/Wikipedia/Categories/NSURL+WMFRest.h index 91c264e..85a3679 100644 --- a/Wikipedia/Categories/NSURL+WMFRest.h +++ b/Wikipedia/Categories/NSURL+WMFRest.h @@ -5,6 +5,6 @@ @interface NSURL (WMFRest) --(BOOL)wmf_conformsToScheme:(NSString *)scheme andHasKey:(NSString *)key; +- (BOOL)wmf_conformsToScheme:(NSString*)scheme andHasKey:(NSString*)key; @end diff --git a/Wikipedia/Categories/NSURL+WMFRest.m b/Wikipedia/Categories/NSURL+WMFRest.m index eed2352..4eb26ac 100644 --- a/Wikipedia/Categories/NSURL+WMFRest.m +++ b/Wikipedia/Categories/NSURL+WMFRest.m @@ -6,7 +6,7 @@ @implementation NSURL (WMFRest) --(BOOL)wmf_conformsToScheme:(NSString *)scheme andHasKey:(NSString *)key { +- (BOOL)wmf_conformsToScheme:(NSString*)scheme andHasKey:(NSString*)key { return ([[self scheme] wmf_isEqualToStringIgnoringCase:scheme] && [[self host] wmf_isEqualToStringIgnoringCase:key]); } diff --git a/Wikipedia/Custom Views/WMFLoadingIndicatorOverlay.m b/Wikipedia/Custom Views/WMFLoadingIndicatorOverlay.m index dccbe30..60f6501 100644 --- a/Wikipedia/Custom Views/WMFLoadingIndicatorOverlay.m +++ b/Wikipedia/Custom Views/WMFLoadingIndicatorOverlay.m @@ -5,11 +5,11 @@ #import "UIColor+WMFHexColor.h" #import -static const CGFloat kActivityIndicatorWidth = 100.0f; -static const CGFloat kActivityIndicatorCornerRadius = 10.0f; -static const NSInteger kActivityIndicatorBackgroundColor = 0x00; +static CGFloat const kActivityIndicatorWidth = 100.0f; +static CGFloat const kActivityIndicatorCornerRadius = 10.0f; +static NSInteger const kActivityIndicatorBackgroundColor = 0x00; -static const CGFloat kFadeAnimationDuration = 0.33f; +static CGFloat const kFadeAnimationDuration = 0.33f; @interface WMFLoadingIndicatorOverlay () diff --git a/Wikipedia/EventLogging/WMFSuggestedPagesFunnel.m b/Wikipedia/EventLogging/WMFSuggestedPagesFunnel.m index 631a896..f9f9057 100644 --- a/Wikipedia/EventLogging/WMFSuggestedPagesFunnel.m +++ b/Wikipedia/EventLogging/WMFSuggestedPagesFunnel.m @@ -9,7 +9,7 @@ #import "WMFSuggestedPagesFunnel.h" static NSString* const kSchemaName = @"MobileWikiAppArticleSuggestions"; -static const int kSchemaVersion= 10590869; +static int const kSchemaVersion= 10590869; static NSString* const kActionKey = @"action"; static NSString* const kActionShown
[MediaWiki-commits] [Gerrit] Fixing icons… again - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Fixing icons… again .. Fixing icons… again A few problems to overcome this time: Archives use symlinks for the app bundle, which can throw monkey wrenches in the process. Looks like permissions have changed on build folders - can't reliably save to the app bundle during the process. So sidestepping. New solution: No longer manipulating the build folder, doing everything in the source directory. Created a new icon set - source - which will always contain the unmolested icons. The other icon set will be overwritten at build time with the overlaid icons. If release build or if imagemagick is not installed, then the icons are just copied Also removed generated icons from source control Note: only one icons is copied to the app, the other is in the project only. Change-Id: I39285429803b72d5caeda738fb82bc3d23406317 --- M .gitignore M Wikipedia.xcodeproj/project.pbxproj M Wikipedia/Images.xcassets/AppIcon.appiconset/Contents.json A Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Contents.json R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon...@2x.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon...@3x.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Icon-72.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon...@2x.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Icon-76.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon...@2x.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Icon-Small-50.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon-small...@2x.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Icon-Small.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon-sm...@3x.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Icon-Spotlight-40.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon-spotlight...@2x-1.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon-spotlight...@2x.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/icon-spotlight...@3x.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/Icon.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/i...@2x.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/ios7_app_icon_iphone.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/ios7_settings_icon.png R Wikipedia/SourceIcons.xcassets/AppIconSource.appiconset/ios7_settings_i...@2x.png M scripts/process-icons.sh 24 files changed, 263 insertions(+), 70 deletions(-) Approvals: Mhurd: Looks good to me, approved diff --git a/.gitignore b/.gitignore index 2d2952e..6dbb5fe 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,9 @@ *.ipa *.xcuserstate +# Icons +Wikipedia/Images.xcassets/AppIcon.appiconset/*.png + # Fastlane fastlane/report.xml fastlane/Error*.png diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index feb2cbd..f302ee2 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -187,6 +187,7 @@ 04F27B7818FE0F2E00EDD838 /* PageHistoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04F27B7418FE0F2E00EDD838 /* PageHistoryViewController.m */; }; 04F39590186CF80100B0D6FC /* TOCViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 04F3958F186CF80100B0D6FC /* TOCViewController.m */; }; 08D631F71A69B1AB00D87AD0 /* WMFImageGalleryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08D631F61A69B1AB00D87AD0 /* WMFImageGalleryViewController.m */; }; + 0E36C2271AE0B59D00C58CFF /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D4991453181D51DE00E6073C /* Images.xcassets */; }; 0EA4402E1AA6281200B09DBA /* NSDateFormatter+WMFExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EA4402D1AA6281200B09DBA /* NSDateFormatter+WMFExtensions.m */; }; 0EBC56681AD3656900E82CDD /* WMFAsyncTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = BC7ACB631AB34C9C00791497 /* WMFAsyncTestCase.m */; }; 0EBC567F1AD442CC00E82CDD /* BITHockeyManager+WMFExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EBC567E1AD442CC00E82CDD /* BITHockeyManager+WMFExtensions.m */; }; @@ -325,7 +326,6 @@ D4991445181D51DE00E6073C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D4991444181D51DE00E6073C /* main.m */; }; D4991449181D51DE00E6073C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D4991448181D51DE00E6073C /* AppDelegate.m */; }; D499144C181D51DE00E6073C /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D499144A181D51DE00E6073C /* Main_iPhone.storyboard */; }; - D499145
[MediaWiki-commits] [Gerrit] Fix for read more results being bold. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/206462 Change subject: Fix for read more results being bold. .. Fix for read more results being bold. Also cleaned up the search result attributed string. Removed some items from defines file. Change-Id: I84e1798d3cee86505ee15aaeb4fa35d4fae65103 --- M Wikipedia/Defines/Defines.h M Wikipedia/View Controllers/SearchResults/SearchResultAttributedString.h M Wikipedia/View Controllers/SearchResults/SearchResultAttributedString.m M Wikipedia/View Controllers/SearchResults/SearchResultsController.m 4 files changed, 119 insertions(+), 108 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/62/206462/1 diff --git a/Wikipedia/Defines/Defines.h b/Wikipedia/Defines/Defines.h index 2a7c0b2..c9b4eee 100644 --- a/Wikipedia/Defines/Defines.h +++ b/Wikipedia/Defines/Defines.h @@ -14,27 +14,10 @@ #define SEARCH_THUMBNAIL_WIDTH (48 * 3) -#define SEARCH_RESULT_HEIGHT (74.0 * MENUS_SCALE_MULTIPLIER) #define SEARCH_MAX_RESULTS 24 #define SEARCH_TEXT_FIELD_FONT [UIFont systemFontOfSize:(14.0 * MENUS_SCALE_MULTIPLIER)] #define SEARCH_TEXT_FIELD_HIGHLIGHTED_COLOR [UIColor blackColor] - -#define SEARCH_RESULT_FONT [UIFont systemFontOfSize:(16.0 * MENUS_SCALE_MULTIPLIER)] -#define SEARCH_RESULT_FONT_COLOR [UIColor colorWithWhite:0.15 alpha:1.0] - -#define SEARCH_RESULT_DESCRIPTION_FONT [UIFont systemFontOfSize:(12.0 * MENUS_SCALE_MULTIPLIER)] -#define SEARCH_RESULT_DESCRIPTION_FONT_COLOR [UIColor colorWithWhite:0.4 alpha:1.0] - -#define SEARCH_RESULT_SNIPPET_FONT [UIFont italicSystemFontOfSize:(12.0 * MENUS_SCALE_MULTIPLIER)] -#define SEARCH_RESULT_SNIPPET_FONT_COLOR [UIColor blackColor] -#define SEARCH_RESULT_SNIPPET_HIGHLIGHT_COLOR WMF_COLOR_BLUE - -#define SEARCH_RESULT_FONT_HIGHLIGHTED [UIFont boldSystemFontOfSize:(16.0 * MENUS_SCALE_MULTIPLIER)] -#define SEARCH_RESULT_FONT_HIGHLIGHTED_COLOR [UIColor blackColor] - -#define SEARCH_RESULT_PADDING_ABOVE_DESCRIPTION 2.0f -#define SEARCH_RESULT_PADDING_ABOVE_SNIPPET 3.0f #define SEARCH_FIELD_PLACEHOLDER_TEXT_COLOR [UIColor colorWithRed:0.7 green:0.7 blue:0.7 alpha:1.0] diff --git a/Wikipedia/View Controllers/SearchResults/SearchResultAttributedString.h b/Wikipedia/View Controllers/SearchResults/SearchResultAttributedString.h index 1f94331..ea65374 100644 --- a/Wikipedia/View Controllers/SearchResults/SearchResultAttributedString.h +++ b/Wikipedia/View Controllers/SearchResults/SearchResultAttributedString.h @@ -9,12 +9,7 @@ snippet:(NSString*)snippet wikiDataDescription:(NSString*)description highlightWords:(NSArray*)wordsToHighlight -searchType:(SearchType)searchType -// Note: pointers to attributes dictionaries are passed to this method for performance/memory reasons. - attributesTitle:(NSDictionary*)attributesTitle - attributesDescription:(NSDictionary*)attributesDescription - attributesHighlight:(NSDictionary*)attributesHighlight - attributesSnippet:(NSDictionary*)attributesSnippet -attributesSnippetHighlight:(NSDictionary*)attributesSnippetHighlight; + shouldHighlightWords:(BOOL)shouldHighlightWords +searchType:(SearchType)searchType; @end diff --git a/Wikipedia/View Controllers/SearchResults/SearchResultAttributedString.m b/Wikipedia/View Controllers/SearchResults/SearchResultAttributedString.m index 7451fe3..f1bbafc 100644 --- a/Wikipedia/View Controllers/SearchResults/SearchResultAttributedString.m +++ b/Wikipedia/View Controllers/SearchResults/SearchResultAttributedString.m @@ -4,49 +4,66 @@ #import "SearchResultAttributedString.h" #import "Defines.h" #import "NSString+Extras.h" +#import "UIColor+WMFHexColor.h" + +static CGFloat const kFontSize= 16.0f; +static const NSInteger kFontColor = 0x383838; + +static CGFloat const kDescriptionFontSize= 12.0f; +static const NSInteger kDescriptionFontColor = 0x606060; + +static CGFloat const kSnippetFontSize = 12.0f; +static const NSInteger kSnippetFontColor = 0x00; +static const NSInteger kSnippetHighlightColor = 0xff; + +static CGFloat const kHighlightedFontSize= 16.0f; +static const NSInteger kHighlightedFontColor = 0x00; + +static CGFloat const kPaddingAboveDescription = 2.0f; +static CGFloat const kPaddingAboveSnippet = 3.0f; @implementation SearchResultAttributedString -+ (instancetype) initWithTitle:(NSString*)title - snippet:(NSString*)snippet - wikiDataDescription:(NSString*)description -highlightWords:(NSArray*)wordsToHighlight -searchType:(SearchType)searchType - attributesTitle:(NSDictionary*)attributesTitle - attributesDescription:(NSDictionary*)attributesDescription - attributesHighlight:(NSDictionary*)attribut
[MediaWiki-commits] [Gerrit] Fix for page history sections showing only time instead of d... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/206439 Change subject: Fix for page history sections showing only time instead of date. .. Fix for page history sections showing only time instead of date. T96268 Change-Id: I6b7cda512ad90dc40b139d85c245196bfcac91f7 --- M Wikipedia/Categories/NSDateFormatter+WMFExtensions.h M Wikipedia/Categories/NSDateFormatter+WMFExtensions.m M Wikipedia/View Controllers/PageHistory/PageHistoryViewController.m 3 files changed, 20 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/39/206439/1 diff --git a/Wikipedia/Categories/NSDateFormatter+WMFExtensions.h b/Wikipedia/Categories/NSDateFormatter+WMFExtensions.h index 7815191..31117d8 100644 --- a/Wikipedia/Categories/NSDateFormatter+WMFExtensions.h +++ b/Wikipedia/Categories/NSDateFormatter+WMFExtensions.h @@ -33,4 +33,9 @@ */ + (NSDateFormatter*)wmf_shortTimeFormatterWithLocale:(NSLocale*)locale; +/** + * Create a long style date formatter. Sample: "April 24, 2015". + */ ++ (NSDateFormatter*)wmf_longDateFormatter; + @end diff --git a/Wikipedia/Categories/NSDateFormatter+WMFExtensions.m b/Wikipedia/Categories/NSDateFormatter+WMFExtensions.m index 43e7da5..d1f8af0 100644 --- a/Wikipedia/Categories/NSDateFormatter+WMFExtensions.m +++ b/Wikipedia/Categories/NSDateFormatter+WMFExtensions.m @@ -37,4 +37,18 @@ return shortTimeFormatter; } ++ (NSDateFormatter*)wmf_longDateFormatter { +static NSDateFormatter* longDateFormatter = nil; +if (!longDateFormatter) { +// See: https://www.mediawiki.org/wiki/Manual:WfTimestamp +longDateFormatter = [[NSDateFormatter alloc] init]; +[longDateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"UTC"]]; +[longDateFormatter setDateFormat:@"'-'MM'-'dd'T'HH':'mm':'ss'Z'"]; +longDateFormatter.dateStyle = NSDateFormatterLongStyle; +longDateFormatter.timeStyle = NSDateFormatterNoStyle; +longDateFormatter.formatterBehavior = NSDateFormatterBehavior10_4; +} +return longDateFormatter; +} + @end diff --git a/Wikipedia/View Controllers/PageHistory/PageHistoryViewController.m b/Wikipedia/View Controllers/PageHistory/PageHistoryViewController.m index d2b0960..abc191b 100644 --- a/Wikipedia/View Controllers/PageHistory/PageHistoryViewController.m +++ b/Wikipedia/View Controllers/PageHistory/PageHistoryViewController.m @@ -193,8 +193,7 @@ NSNumber* daysAgo = sectionDict[@"daysAgo"]; NSDate* date = [NSDate dateWithDaysBeforeNow:daysAgo.integerValue]; - -label.text = [[NSDateFormatter wmf_shortTimeFormatter] stringFromDate:date]; +label.text = [[NSDateFormatter wmf_longDateFormatter] stringFromDate:date]; [view addSubview:label]; -- To view, visit https://gerrit.wikimedia.org/r/206439 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6b7cda512ad90dc40b139d85c245196bfcac91f7 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix for lock edit pencil showing alert twice. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/206349 Change subject: Fix for lock edit pencil showing alert twice. .. Fix for lock edit pencil showing alert twice. T96822 Change-Id: Idd157331df387c4b91356147ac13e9ede7569192 --- M Wikipedia/assets/bundle.js M www/js/bridge.js 2 files changed, 22 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/49/206349/1 diff --git a/Wikipedia/assets/bundle.js b/Wikipedia/assets/bundle.js index 4a429d4..71a91bd 100644 --- a/Wikipedia/assets/bundle.js +++ b/Wikipedia/assets/bundle.js @@ -24,16 +24,18 @@ }; Bridge.prototype.sendMessage = function( messageType, payload ) { -var messagePack = { type: messageType, payload: payload }; -var url = "x-wikipedia-bridge:" + encodeURIComponent( JSON.stringify( messagePack ) ); +setTimeout(function() { // See: https://phabricator.wikimedia.org/T96822 and http://stackoverflow.com/a/9782220/135557 +var messagePack = { type: messageType, payload: payload }; +var url = "x-wikipedia-bridge:" + encodeURIComponent( JSON.stringify( messagePack ) ); -// quick iframe version based on http://stackoverflow.com/a/6508343/82439 -// fixme can this be an XHR instead? check Cordova current state -var iframe = document.createElement('iframe'); -iframe.setAttribute("src", url); -document.documentElement.appendChild(iframe); -iframe.parentNode.removeChild(iframe); -iframe = null; +// quick iframe version based on http://stackoverflow.com/a/6508343/82439 +// fixme can this be an XHR instead? check Cordova current state +var iframe = document.createElement('iframe'); +iframe.setAttribute("src", url); +document.documentElement.appendChild(iframe); +iframe.parentNode.removeChild(iframe); +iframe = null; +}, 0); }; module.exports = new Bridge(); diff --git a/www/js/bridge.js b/www/js/bridge.js index 646d2a9..e0c44b4 100644 --- a/www/js/bridge.js +++ b/www/js/bridge.js @@ -23,16 +23,18 @@ }; Bridge.prototype.sendMessage = function( messageType, payload ) { -var messagePack = { type: messageType, payload: payload }; -var url = "x-wikipedia-bridge:" + encodeURIComponent( JSON.stringify( messagePack ) ); +setTimeout(function() { // See: https://phabricator.wikimedia.org/T96822 and http://stackoverflow.com/a/9782220/135557 +var messagePack = { type: messageType, payload: payload }; +var url = "x-wikipedia-bridge:" + encodeURIComponent( JSON.stringify( messagePack ) ); -// quick iframe version based on http://stackoverflow.com/a/6508343/82439 -// fixme can this be an XHR instead? check Cordova current state -var iframe = document.createElement('iframe'); -iframe.setAttribute("src", url); -document.documentElement.appendChild(iframe); -iframe.parentNode.removeChild(iframe); -iframe = null; +// quick iframe version based on http://stackoverflow.com/a/6508343/82439 +// fixme can this be an XHR instead? check Cordova current state +var iframe = document.createElement('iframe'); +iframe.setAttribute("src", url); +document.documentElement.appendChild(iframe); +iframe.parentNode.removeChild(iframe); +iframe = null; +}, 0); }; module.exports = new Bridge(); -- To view, visit https://gerrit.wikimedia.org/r/206349 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idd157331df387c4b91356147ac13e9ede7569192 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] test - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/206315 Change subject: test .. test Change-Id: Id49d8744b397e55fff5f3233b4d4daac04a52259 --- R Wikipedia/Categories/BITHockeyManager+WMFExtensions.h R Wikipedia/Categories/BITHockeyManager+WMFExtensions.m M Wikipedia/eo.lproj/Localizable.strings D wikipedia/eo.lproj/Localizable.strings 4 files changed, 2 insertions(+), 169 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/15/206315/1 diff --git a/wikipedia/Categories/BITHockeyManager+WMFExtensions.h b/Wikipedia/Categories/BITHockeyManager+WMFExtensions.h similarity index 100% rename from wikipedia/Categories/BITHockeyManager+WMFExtensions.h rename to Wikipedia/Categories/BITHockeyManager+WMFExtensions.h diff --git a/wikipedia/Categories/BITHockeyManager+WMFExtensions.m b/Wikipedia/Categories/BITHockeyManager+WMFExtensions.m similarity index 100% rename from wikipedia/Categories/BITHockeyManager+WMFExtensions.m rename to Wikipedia/Categories/BITHockeyManager+WMFExtensions.m diff --git a/Wikipedia/eo.lproj/Localizable.strings b/Wikipedia/eo.lproj/Localizable.strings index 17b4728..c3363d8 100644 --- a/Wikipedia/eo.lproj/Localizable.strings +++ b/Wikipedia/eo.lproj/Localizable.strings @@ -90,6 +90,7 @@ "navbar-title-mode-edit-wikitext-preview" = "Antaŭrigardi"; "navbar-title-mode-edit-wikitext-summary" = "Priskribu vian redakton"; "navbar-title-mode-edit-wikitext-save" = "Konservi"; +// Fuzzy "edit-summary-choice-linked-words" = "Aldonis ligilojn"; "edit-summary-choice-fixed-grammar" = "Ĝustigis gramatikon"; "edit-summary-choice-fixed-styling" = "Ĝustigis stilon"; @@ -98,6 +99,7 @@ "edit-summary-choice-added-missing-info" = "Aldonis mankantan informon"; "edit-summary-choice-added-clarification" = "Aldonis klarigon"; "edit-summary-choice-other" = "Alia"; +// Fuzzy "edit-summary-field-placeholder-text" = "Aliaj manieroj en kiuj vi plibonigis la artikolon"; "edit-summary-title" = "Kiel vi plibonigis la artikolon?"; "about-title" = "Pri"; diff --git a/wikipedia/eo.lproj/Localizable.strings b/wikipedia/eo.lproj/Localizable.strings deleted file mode 100644 index c3363d8..000 --- a/wikipedia/eo.lproj/Localizable.strings +++ /dev/null @@ -1,169 +0,0 @@ -// Messages for Esperanto (Esperanto) -// Exported from translatewiki.net -// Author: Fitoschido -// Author: KuboF -// Author: Remux - -"article-languages-label" = "Elekti lingvon"; -"article-languages-cancel" = "Nuligi"; -"article-languages-downloading" = "Ŝarĝante lingvojn de la artikolo..."; -"article-languages-filter-placeholder" = "Lingva filtrilo"; -"article-read-more-title" = "Legi plu"; -"info-box-title" = "Rapidaj faktoj"; -"info-box-close-text" = "Fermi"; -"language-button-text" = "Vi povas legi ĉi tiun artikolon en %d aliaj lingvoj"; -"history-label" = "Lastaj"; -"history-section-today" = "Hodiaŭ"; -"history-section-yesterday" = "Hieraŭ"; -"history-section-lastweek" = "Lasta semajno"; -"history-section-lastmonth" = "Lasta monato"; -"history-clear-cancel" = "Nuligi"; -"history-clear-delete-all" = "Forigi ĉion"; -"zero-interstitial-title" = "Forlasante Vikipedio Zero"; -"zero-interstitial-continue" = "Foriri"; -"zero-interstitial-cancel" = "Resti ĉi tie"; -"zero-learn-more-learn-more" = "Legi plu"; -"zero-learn-more-no-thanks" = "Elimini"; -"zero-wikipedia-zero-heading" = "Vikipedio Zero"; -"zero-warn-when-leaving" = "Avertu kiam forlasi Vikipedio Zero"; -"account-creation-logging-in" = "Ensalutante..."; -"account-creation-saving" = "Konservante..."; -"account-creation-login" = "Ĉu vi jam havas konton? Ensalutu."; -"account-creation-username-placeholder-text" = "Uzantnomo"; -"account-creation-password-placeholder-text" = "Pasvorto"; -"account-creation-password-confirm-placeholder-text" = "Konfirmu pasvorton"; -"account-creation-email-placeholder-text" = "Retpoŝto (Malnepra)"; -"account-creation-missing-fields" = "Vi devas enigi uzantnomon, pasvorton, kaj konfirmi vian pasvorton por krei konton."; -"login-name-not-found" = "Uzantnomo nepras por ensaluti."; -"login-name-illegal" = "Vi enigis ne-akcepteblan uzantnomon."; -"login-name-does-not-exist" = "La uzantnomo enigita ne ekzistas."; -"login-password-empty" = "Pasvorto nepras por ensaluti."; -"login-password-wrong" = "La enigita pasvorto estas malĝusta."; -"login-username-placeholder-text" = "Uzantnomo"; -"login-password-placeholder-text" = "Pasvorto"; -"wikitext-downloading" = "Ŝarĝante enhavon..."; -"wikitext-download-success" = "Enhavo ŝarĝita."; -"wikitext-upload-save" = "Konservante..."; -"wikitext-upload-save-sign-in" = "Ensaluti"; -"wikitext-upload-save-anonymously" = "Konservi anonime"; -"wikitext-upload-save-terms-name" = "Uzkondiĉoj"; -"wikitext-upload-save-license-name" = "CC BY-SA 3.0"; -"open-link-title" = "Malfermi ligilon"; -"open-link-cancel" = "Nuligi"; -"search-searching" = "Serĉante..."; -"search-loading-article-loaded" = "Artiko
[MediaWiki-commits] [Gerrit] Localisation updates from https://translatewiki.net. - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Localisation updates from https://translatewiki.net. .. Localisation updates from https://translatewiki.net. Change-Id: I9ebd5b64de47e4209743f744e69f04f00a74a6ea --- M Wikipedia/ar.lproj/Localizable.strings M Wikipedia/ast.lproj/Localizable.strings M Wikipedia/azb.lproj/Localizable.strings M Wikipedia/bn.lproj/Localizable.strings M Wikipedia/br.lproj/Localizable.strings M Wikipedia/ca.lproj/Localizable.strings M Wikipedia/cs.lproj/Localizable.strings M Wikipedia/da.lproj/Localizable.strings M Wikipedia/de.lproj/Localizable.strings M Wikipedia/eo.lproj/Localizable.strings M Wikipedia/es.lproj/Localizable.strings M Wikipedia/fa.lproj/Localizable.strings M Wikipedia/fi.lproj/Localizable.strings M Wikipedia/fr.lproj/Localizable.strings M Wikipedia/gl.lproj/Localizable.strings M Wikipedia/he.lproj/Localizable.strings M Wikipedia/id.lproj/Localizable.strings M Wikipedia/is.lproj/Localizable.strings M Wikipedia/it.lproj/Localizable.strings M Wikipedia/ja.lproj/Localizable.strings M Wikipedia/ka.lproj/Localizable.strings M Wikipedia/km.lproj/Localizable.strings M Wikipedia/ko.lproj/Localizable.strings M Wikipedia/lb.lproj/Localizable.strings M Wikipedia/lt.lproj/Localizable.strings M Wikipedia/mk.lproj/Localizable.strings M Wikipedia/ms.lproj/Localizable.strings M Wikipedia/nb.lproj/Localizable.strings M Wikipedia/nl.lproj/Localizable.strings M Wikipedia/pa.lproj/Localizable.strings M Wikipedia/pl.lproj/Localizable.strings M Wikipedia/ps.lproj/Localizable.strings M Wikipedia/pt-br.lproj/Localizable.strings M Wikipedia/pt.lproj/Localizable.strings M Wikipedia/qqq.lproj/Localizable.strings M Wikipedia/ro.lproj/Localizable.strings M Wikipedia/ru.lproj/Localizable.strings M Wikipedia/sa.lproj/Localizable.strings M Wikipedia/sk.lproj/Localizable.strings M Wikipedia/sr-ec.lproj/Localizable.strings M Wikipedia/sv.lproj/Localizable.strings M Wikipedia/tr.lproj/Localizable.strings M Wikipedia/uk.lproj/Localizable.strings M Wikipedia/uz.lproj/Localizable.strings M Wikipedia/vi.lproj/Localizable.strings M Wikipedia/zh-hans.lproj/Localizable.strings M Wikipedia/zh-hant.lproj/Localizable.strings 47 files changed, 237 insertions(+), 84 deletions(-) Approvals: Mhurd: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/Wikipedia/ar.lproj/Localizable.strings b/Wikipedia/ar.lproj/Localizable.strings index 491edc2..f4acbbe 100644 --- a/Wikipedia/ar.lproj/Localizable.strings +++ b/Wikipedia/ar.lproj/Localizable.strings @@ -4,6 +4,7 @@ // Author: Omda4wady // Author: Shbib Al-Subaie // Author: Tarawneh +// Author: محمد أحمد عبد الفتاح // Author: محمد عصام "article-languages-label" = "اختر لغة"; @@ -11,6 +12,7 @@ "article-read-more-title" = "قراءة المزيد"; "info-box-title" = "معلومات سريعة"; "info-box-close-text" = "إغلاق"; +"table-title-other" = "مزيد من المعلومات"; "history-label" = "الأخيرة"; "history-section-today" = "اليوم"; "history-section-yesterday" = "الأمس"; @@ -76,6 +78,8 @@ "saved-pages-clear-confirmation-sub-heading" = "هذا العمل لا يُمكن التراجع عنه."; "saved-pages-clear-cancel" = "إلغاء"; // Fuzzy +"saved-pages-clear-delete-all" = "حذف الكل"; +// Fuzzy "page-history-title" = "تاريخ المقالة"; // Fuzzy "page-history-downloading" = "جارٍ تحميل تاريخ المقالة..."; diff --git a/Wikipedia/ast.lproj/Localizable.strings b/Wikipedia/ast.lproj/Localizable.strings index f73c866..225a7e6 100644 --- a/Wikipedia/ast.lproj/Localizable.strings +++ b/Wikipedia/ast.lproj/Localizable.strings @@ -99,17 +99,21 @@ "main-menu-terms-of-use" = "Condiciones d'usu"; "main-menu-rate-app" = "Calificar app"; "main-menu-heading-zero" = "Wikipedia Zero"; -// Fuzzy -"main-menu-heading-legal" = "Xíriga llegal"; +"main-menu-heading-legal" = "Privacidá y Condiciones"; "main-menu-show-today" = "Güei"; +"main-menu-more" = "Más..."; +"main-menu-heading-debug" = "Depurar"; +"main-menu-debug-crash" = "Fallar"; "saved-pages-title" = "Páxines guardaes"; "saved-pages-clear-confirmation-heading" = "¿Desaniciar tolos elementos guardaos?"; "saved-pages-clear-confirmation-sub-heading" = "¡Esata aición nun pue desfacese!"; "saved-pages-clear-cancel" = "Encaboxar"; // Fuzzy -"page-history-title" = "Historial de la páxina"; -// Fuzzy -"page-history-downloading" = "Cargando l'historial de la páxina..."; +"saved-pages-clear-delete-all" = "Desaniciar too"; +"saved-pages-refresh-cancel-alert-title" = "Anovamientu encaboxáu"; +"saved-pages-refresh-cancel-alert-button" = "Entendílo"; +"page-history-title" = "Historial del artículu"; +"page-history-downloading" = "Cargando l'historial del artículu..."; "navbar-title-mode-edit-wikitext" = "Editar"; "navbar-title-mode-login" = "Aniciar sesión"; "navbar-title-mode-login-and-save" = "Aniciar sesión y guardar"; @@ -121,8 +125,7 @@ "navbar-title-mode-edit-wikitext-captcha" = "Necesítase una comprobación rápida"; "navbar-title-mode-e
[MediaWiki-commits] [Gerrit] Re-added delete all trash can to saved pages. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/206158 Change subject: Re-added delete all trash can to saved pages. .. Re-added delete all trash can to saved pages. Also made initial saved pages alert go away after 5 seconds. Change-Id: I5bfed53f3e76184d3070d7832518b52b61c590db --- M Wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m M Wikipedia/View Controllers/SavedPages/SavedPagesViewController.m M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/en.lproj/Localizable.strings M Wikipedia/qqq.lproj/Localizable.strings 5 files changed, 28 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/58/206158/1 diff --git a/Wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m b/Wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m index a7d70e1..e4f55b0 100644 --- a/Wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m +++ b/Wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m @@ -479,7 +479,7 @@ break; case NAVBAR_MODE_PAGES_SAVED: self.navBarSubViewsHorizontalVFLString = - @"H:|-(6)-[NAVBAR_BUTTON_X(50)]-(10)-[NAVBAR_LABEL]-(10)-[NAVBAR_BUTTON_RELOAD(50@250)]-(6)-|"; + @"H:|-(6)-[NAVBAR_BUTTON_X(50)]-(10)-[NAVBAR_LABEL][NAVBAR_BUTTON_TRASH(38@250)][NAVBAR_BUTTON_RELOAD(38@250)]-(6)-|"; break; case NAVBAR_MODE_X_WITH_TEXT_FIELD: self.navBarSubViewsHorizontalVFLString = diff --git a/Wikipedia/View Controllers/SavedPages/SavedPagesViewController.m b/Wikipedia/View Controllers/SavedPages/SavedPagesViewController.m index 19b326f..80f3684 100644 --- a/Wikipedia/View Controllers/SavedPages/SavedPagesViewController.m +++ b/Wikipedia/View Controllers/SavedPages/SavedPagesViewController.m @@ -113,6 +113,9 @@ case NAVBAR_BUTTON_RELOAD: [self startRefresh]; break; +case NAVBAR_BUTTON_TRASH: +[self showDeleteAllDialog]; +break; default: break; } @@ -322,6 +325,16 @@ self.progressView.alpha = 0.0; } +-(void)hideTrashButton { +MenuButton *trashButton = (MenuButton *)[self.topMenuViewController getNavBarItem:NAVBAR_BUTTON_TRASH]; +trashButton.alpha = 0.0; +} + +-(void)showTrashButton { +MenuButton *trashButton = (MenuButton *)[self.topMenuViewController getNavBarItem:NAVBAR_BUTTON_TRASH]; +trashButton.alpha = 1.0; +} + - (void)setEmptyOverlayAndTrashIconVisibility { BOOL savedPageFound = (savedPageList.length > 0); @@ -329,6 +342,12 @@ MenuButton* reloadButton = [self reloadButton]; reloadButton.alpha = savedPageFound ? 1.0 : 0.0; + +if (savedPageFound){ +[self showTrashButton]; +}else{ +[self hideTrashButton]; +} } - (void)showCancelRefreshAlertIfFirstTime { @@ -418,6 +437,7 @@ [self hideRefreshButton]; [self showProgressView]; [self showRefreshTitle]; +[self hideTrashButton]; } completion:^(BOOL finished) { [UIView animateWithDuration:0.25 animations:^{ [self showCancelButton]; @@ -433,6 +453,7 @@ [self showProgressView]; [self showCancelButton]; +[self hideTrashButton]; [self hideRefreshButton]; [self showRefreshTitle]; } @@ -450,6 +471,9 @@ } completion:^(BOOL finished) { [UIView animateWithDuration:0.25 animations:^{ [self showRefreshButton]; +if (self->savedPageList.length > 0) { +[self showTrashButton]; +} }]; self.progressView.progress = 0.0; diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 7b866bd..a7c2ede 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -978,7 +978,7 @@ //AccessSavedPagesMessageShown = NO; if (!AccessSavedPagesMessageShown) { -duration = -1; +duration = 5; [[NSUserDefaults standardUserDefaults] setObject:@YES forKey:@"AccessSavedPagesMessageShown"]; [[NSUserDefaults standardUserDefaults] synchronize]; diff --git a/Wikipedia/en.lproj/Localizable.strings b/Wikipedia/en.lproj/Localizable.strings index 30355bf..8b2f73e 100644 --- a/Wikipedia/en.lproj/Localizable.strings +++ b/Wikipedia/en.lproj/Localizable.strings @@ -135,6 +135,7 @@ "saved-pages-clear-confirmation-heading" = "Delete all saved items?"; "saved-pages-clear-confirmation-sub-heading" = "This action cannot be undone!"; "saved-pages-clear-cancel" = "Cancel"; +"saved-pages-clear-delete-all" = "Delete All"; "saved-pages-refresh-cancel-alert-title" = "Update cancelled"; "saved-pages-refresh-cancel-alert
[MediaWiki-commits] [Gerrit] Remove cruft file. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/206001 Change subject: Remove cruft file. .. Remove cruft file. Change-Id: Ifddd421f453310d12b6b3a82ecb81a6f8de4b743 --- M Wikipedia/assets/bundle.js D www/js/issuesAndDisambig.js 2 files changed, 11 insertions(+), 195 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/01/206001/1 diff --git a/Wikipedia/assets/bundle.js b/Wikipedia/assets/bundle.js index 77c7821..4a429d4 100644 --- a/Wikipedia/assets/bundle.js +++ b/Wikipedia/assets/bundle.js @@ -97,99 +97,6 @@ }; },{}],3:[function(require,module,exports){ -var bridge = require("./bridge"); - -function collectDisambig( sourceNode ) { -var res = []; -var links = sourceNode.querySelectorAll( 'div.hatnote a' ); -var i = 0, -len = links.length; -for (; i < len; i++) { -// Pass the href; we'll decode it into a proper page title in Obj-C -res.push( links[i].getAttribute( 'href' ) ); -} -return res; -} - -function collectIssues( sourceNode ) { -var res = []; -var issues = sourceNode.querySelectorAll( 'table.ambox' ); -var i = 0, -len = issues.length; -for (; i < len; i++) { -// .ambox- is used e.g. on eswiki -res.push( issues[i].querySelector( '.mbox-text, .ambox-text' ).innerHTML ); -} -return res; -} - -function anchorForUrl(url) { -var titleForDisplay = decodeURIComponent(url); -titleForDisplay = (titleForDisplay.indexOf('/wiki/') === 0) ? titleForDisplay.substring(6) : titleForDisplay; -titleForDisplay = titleForDisplay.split('_').join(' '); -return '' + titleForDisplay + ''; -} - -function insertAfter(newNode, referenceNode) { -referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); -} - -function setIsSelected(el, isSelected) { -if(isSelected){ -el.style.borderBottom = "1px dotted #ccc"; -}else{ -el.style.borderBottom = "none"; -} -} - -function toggleSubContainerButtons( activeSubContainerId, focusButtonId, blurButtonId ){ -var buttonToBlur = document.getElementById( blurButtonId ); -if(buttonToBlur) { -setIsSelected(buttonToBlur, false); -} -var buttonToActivate = document.getElementById( focusButtonId ); -var isActiveSubContainerPresent = document.getElementById( activeSubContainerId ) ? true : false; -setIsSelected(buttonToActivate, isActiveSubContainerPresent); -} - -function toggleSubContainers( activeSubContainerId, inactiveSubContainerId, activeSubContainerContents ){ -var containerToRemove = document.getElementById( inactiveSubContainerId ); -if(containerToRemove){ -containerToRemove.parentNode.removeChild(containerToRemove); -} -var containerToAddOrToggle = document.getElementById( activeSubContainerId ); -if(containerToAddOrToggle){ -containerToAddOrToggle.parentNode.removeChild(containerToAddOrToggle); -}else{ -containerToAddOrToggle = document.createElement( 'div' ); -containerToAddOrToggle.id = activeSubContainerId; -containerToAddOrToggle.innerHTML = activeSubContainerContents; -insertAfter(containerToAddOrToggle, document.getElementById('issues_container')); -} -} - -function issuesClicked( sourceNode ) { -var issues = collectIssues( sourceNode.parentNode ); -var disambig = collectDisambig( sourceNode.parentNode.parentNode ); // not clicked node -bridge.sendMessage( 'issuesClicked', { "hatnotes": disambig, "issues": issues } ); - -toggleSubContainers('issues_sub_container', 'disambig_sub_container', issues); -toggleSubContainerButtons('issues_sub_container', 'issues_button', 'disambig_button'); -} - -function disambigClicked( sourceNode ) { -var disambig = collectDisambig( sourceNode.parentNode ); -var issues = collectIssues( sourceNode.parentNode.parentNode ); // not clicked node -bridge.sendMessage( 'disambigClicked', { "hatnotes": disambig, "issues": issues } ); - -toggleSubContainers('disambig_sub_container', 'issues_sub_container', disambig.sort().map(anchorForUrl).join( "" )); -toggleSubContainerButtons('disambig_sub_container', 'disambig_button', 'issues_button'); -} - -exports.issuesClicked = issuesClicked; -exports.disambigClicked = disambigClicked; - -},{"./bridge":1}],4:[function(require,module,exports){ (function () { var bridge = require("./bridge"); var transformer = require("./transformer"); @@ -386,7 +293,7 @@ })(); -},{"./bridge":1,"./refs":6,"./transformer":7,"./transforms/collapsePageIssuesAndDisambig":10}],5:[function(require,module,exports){ +},{"./bridge":1,"./refs":5,"./transformer":6,"./transforms/collapsePageIssuesAndDisambig":9}],4:[function(require,module,exports){ var bridge = require("./bridge"); var elementLocation = require("./elementLocation"); @@ -394,7 +301,7 @@ window.bridge = bridg
[MediaWiki-commits] [Gerrit] Only collapse lead section hatnotes. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/205996 Change subject: Only collapse lead section hatnotes. .. Only collapse lead section hatnotes. T96228 Change-Id: I48467a6d40e569517fb20065f008efde00d58370 --- M Wikipedia/assets/bundle.js M www/js/listeners.js 2 files changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/96/205996/1 diff --git a/Wikipedia/assets/bundle.js b/Wikipedia/assets/bundle.js index 0b71c0d..77c7821 100644 --- a/Wikipedia/assets/bundle.js +++ b/Wikipedia/assets/bundle.js @@ -205,9 +205,8 @@ transformer.transform( "hideRedlinks", document ); transformer.transform( "disableFilePageEdit", document ); transformer.transform( "addImageOverflowXContainers", document ); - transformer.transform( "hideTables", document ); -transformer.transform( "collapsePageIssuesAndDisambig", document ); +transformer.transform( "collapsePageIssuesAndDisambig", document.getElementById( "section_heading_and_content_block_0" ) ); bridge.sendMessage( "DOMContentLoaded", {} ); }); diff --git a/www/js/listeners.js b/www/js/listeners.js index 8423109..c9d8afb 100644 --- a/www/js/listeners.js +++ b/www/js/listeners.js @@ -13,9 +13,8 @@ transformer.transform( "hideRedlinks", document ); transformer.transform( "disableFilePageEdit", document ); transformer.transform( "addImageOverflowXContainers", document ); - transformer.transform( "hideTables", document ); -transformer.transform( "collapsePageIssuesAndDisambig", document ); +transformer.transform( "collapsePageIssuesAndDisambig", document.getElementById( "section_heading_and_content_block_0" ) ); bridge.sendMessage( "DOMContentLoaded", {} ); }); -- To view, visit https://gerrit.wikimedia.org/r/205996 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I48467a6d40e569517fb20065f008efde00d58370 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] refactor MWKTestCase and fix linting errors - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: refactor MWKTestCase and fix linting errors .. refactor MWKTestCase and fix linting errors Change-Id: Ia1040459bb3051ac875af46d3a71e4d9af216cb7 --- M MediaWikiKit/MediaWikiKitTests/MWKArticleStoreTestCase.m M MediaWikiKit/MediaWikiKitTests/MWKTestCase.m M Wikipedia.xcodeproj/project.pbxproj M Wikipedia/mw-bridge/CommunicationBridge.m A WikipediaUnitTests/Utilities/WMFTestFixtureUtilities.h M WikipediaUnitTests/WMFArticleImageInjectionTests.m 6 files changed, 20 insertions(+), 19 deletions(-) Approvals: Mhurd: Looks good to me, approved jenkins-bot: Verified diff --git a/MediaWikiKit/MediaWikiKitTests/MWKArticleStoreTestCase.m b/MediaWikiKit/MediaWikiKitTests/MWKArticleStoreTestCase.m index f3c10ee..08c61a2 100644 --- a/MediaWikiKit/MediaWikiKitTests/MWKArticleStoreTestCase.m +++ b/MediaWikiKit/MediaWikiKitTests/MWKArticleStoreTestCase.m @@ -7,6 +7,7 @@ // #import "MWKArticleStoreTestCase.h" +#import "MWKDataStore+TemporaryDataStore.h" @implementation MWKArticleStoreTestCase @@ -19,17 +20,13 @@ self.json1= [self loadJSON:@"section1-end"]; self.jsonAnon = [self loadJSON:@"organization-anon"]; -NSString* documentsFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]; -self.basePath = [documentsFolder stringByAppendingPathComponent:@"unit-test-data"]; - -self.dataStore = [[MWKDataStore alloc] initWithBasePath:self.basePath]; +self.dataStore = [MWKDataStore temporaryDataStore]; self.article = [self.dataStore articleWithTitle:self.title]; } - (void)tearDown { +[self.dataStore removeFolderAtBasePath]; [super tearDown]; - -[[NSFileManager defaultManager] removeItemAtPath:self.basePath error:nil]; } @end diff --git a/MediaWikiKit/MediaWikiKitTests/MWKTestCase.m b/MediaWikiKit/MediaWikiKitTests/MWKTestCase.m index 1c23c1d..7620200 100644 --- a/MediaWikiKit/MediaWikiKitTests/MWKTestCase.m +++ b/MediaWikiKit/MediaWikiKitTests/MWKTestCase.m @@ -7,21 +7,16 @@ // #import "MWKTestCase.h" +#import "WMFTestFixtureUtilities.h" @implementation MWKTestCase - (NSData*)loadDataFile:(NSString*)name ofType:(NSString*)extension { -NSString* path = [[NSBundle bundleForClass:[self class]] pathForResource:name ofType:extension]; -return [NSData dataWithContentsOfFile:path]; +return [[self wmf_bundle] wmf_dataFromContentsOfFile:name ofType:extension]; } - (id)loadJSON:(NSString*)name { -NSData* data = [self loadDataFile:name ofType:@"json"]; -NSError* err = nil; -id dictOrArray = [NSJSONSerialization JSONObjectWithData:data options:0 error:&err]; -assert(err == nil); -assert(dictOrArray); -return dictOrArray; +return [[self wmf_bundle] wmf_jsonFromContentsOfFile:name]; } @end diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index 53cb5f6..feb2cbd 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -735,6 +735,7 @@ BC23759D1AB8928600B0BAA8 /* WMFDateFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WMFDateFormatterTests.m; sourceTree = ""; }; BC2375BA1ABB121C00B0BAA8 /* Obama.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = Obama.json; sourceTree = ""; }; BC2375C01ABB14CC00B0BAA8 /* WMFArticleImageInjectionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WMFArticleImageInjectionTests.m; sourceTree = ""; }; + BC282E271AE7FBB1005A5277 /* WMFTestFixtureUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WMFTestFixtureUtilities.h; sourceTree = ""; }; BC2CBB8C1AA10F400079A313 /* UIView+WMFFrameUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+WMFFrameUtils.h"; sourceTree = ""; }; BC2CBB8D1AA10F400079A313 /* UIView+WMFFrameUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+WMFFrameUtils.m"; sourceTree = ""; }; BC31B2511AB1D9DC008138CA /* WMFImageInfoControllerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WMFImageInfoControllerTests.m; sourceTree = ""; }; @@ -2087,6 +2088,7 @@ BCA6764F1AC05FE200A16160 /* Utilities */ = { isa = PBXGroup; children = ( + BC282E271AE7FBB1005A5277 /* WMFTestFixtureUtilities.h */, BC7ACB621AB34C9C00791497 /* WMFAsyncTestCase.h */, BC7ACB631AB34C9C00791497 /* WMFAsyncTestCas
[MediaWiki-commits] [Gerrit] Fix for article centric strings not using article lang local... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/205918 Change subject: Fix for article centric strings not using article lang localizations. .. Fix for article centric strings not using article lang localizations. Native element localization is based on the device's lang. However, there are certain localization strings which appear in the context of an article. These should always use the article lang not the device lang. Among these strings: -"Contents" at the top of the table of contents. -"Page issues" and "Similar pages" buttons at top of articles. -"Quick facts" and "Other information" collapsed table headers. -"Close" collapsed table footer. -"Read more", "Edited by...", "Other langs..." and licence article footer text. This patch uses the current article's language when retrieving these localized strings. Bug reproduction steps: -from "Read in other languages" at the bottom of an enwiki article, pick Russian. -when it loads, you'll see the strings listed above all appear in English. Since all of these strings are within the context of the Russian article, they should be in Russian too. With this patch, they are. Note: some strings may still show in English if translations have not yet been received. (presently "Page issues" and "Similar pages" strings will still be English) T96809 Change-Id: I2e6c318dd9dc18a1e623c27279ebb4df9c987046 --- M Wikipedia/Categories/MWKSection+TOC.m M Wikipedia/View Controllers/SearchResults/SearchResultsController.m M Wikipedia/View Controllers/TableOfContents/TOCViewController.m M Wikipedia/View Controllers/WebView/Footer/SubFooters/Legal/WMFLegalFooterViewController.h M Wikipedia/View Controllers/WebView/Footer/SubFooters/Legal/WMFLegalFooterViewController.m M Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.m M Wikipedia/View Controllers/WebView/Footer/SubFooters/ReadMore/WMFReadMoreViewController.m M Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.h M Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.m M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/mw-utils/WikipediaAppUtils.h M Wikipedia/mw-utils/WikipediaAppUtils.m 12 files changed, 44 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/18/205918/1 diff --git a/Wikipedia/Categories/MWKSection+TOC.m b/Wikipedia/Categories/MWKSection+TOC.m index 8929328..01325f9 100644 --- a/Wikipedia/Categories/MWKSection+TOC.m +++ b/Wikipedia/Categories/MWKSection+TOC.m @@ -35,7 +35,7 @@ NSFontAttributeName: [UIFont fontWithName:@"Times New Roman" size:24.0 * MENUS_SCALE_MULTIPLIER] }; -NSString* heading = MWLocalizedString(@"table-of-contents-heading", nil); +NSString* heading = MWCurrentArticleLanguageLocalizedString(@"table-of-contents-heading", nil); if ([[SessionSingleton sharedInstance].currentArticleSite.language isEqualToString:@"en"]) { heading = [heading uppercaseString]; diff --git a/Wikipedia/View Controllers/SearchResults/SearchResultsController.m b/Wikipedia/View Controllers/SearchResults/SearchResultsController.m index e899708..418f621 100644 --- a/Wikipedia/View Controllers/SearchResults/SearchResultsController.m +++ b/Wikipedia/View Controllers/SearchResults/SearchResultsController.m @@ -516,7 +516,7 @@ self.searchSuggestion = [searchResultFetcher.searchSuggestion copy]; } if (self.searchSuggestion) { -[self.didYouMeanButton showWithText:MWLocalizedString(@"search-did-you-mean", nil) +[self.didYouMeanButton showWithText:(self.type == WMFSearchResultsControllerTypeReadMore) ? MWCurrentArticleLanguageLocalizedString(@"search-did-you-mean", nil) : MWLocalizedString(@"search-did-you-mean", nil) term:self.searchSuggestion]; } } else if ([sender isKindOfClass:[ThumbnailFetcher class]]) { diff --git a/Wikipedia/View Controllers/TableOfContents/TOCViewController.m b/Wikipedia/View Controllers/TableOfContents/TOCViewController.m index 2c3275a..78db6b7 100644 --- a/Wikipedia/View Controllers/TableOfContents/TOCViewController.m +++ b/Wikipedia/View Controllers/TableOfContents/TOCViewController.m @@ -598,7 +598,7 @@ @"id": @(10), @"isLead": @(NO), @"level": @0, - @"title": MWLocalizedString(@"article-read-more-title", @"Read more") + @"title": MWCurrentArticleLanguageLocalizedString(@"article-read-more-title", @"Read more") }]; self.tocSectionData = allSectionData; diff --git a/Wikipedia/View Controllers/WebView/Footer/SubFooters/Legal/WMFLegalFooterViewController.h b/Wikipedia/View Controllers/WebView/Footer/SubFooters/Legal/WMFLegalFooterViewController.h index 38fca72..35f5651 100644 --- a/Wikipedia/View Controllers
[MediaWiki-commits] [Gerrit] Fix for article centric strings not using article lang local... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/205809 Change subject: Fix for article centric strings not using article lang localizations. .. Fix for article centric strings not using article lang localizations. Native element localization is based on the device's lang. However, there are certain localization strings which appear in the context of an article. These should always use the article lang not the device lang. Among these strings: -"Contents" at the top of the table of contents. -"Page issues" and "Similar pages" buttons at top of articles. -"Quick facts" and "Other information" collapsed table headers. -"Close" collapsed table footer. -"Read more", "Edited by...", "Other langs..." and licence article footer text. This patch uses the current article's language when retrieving these localized strings. Reproduction steps: from "Read in other languages" at the bottom of an enwiki article, pick Chinese. When it loads, you'll see the strings listed above all appear in English. Since all of these strings are within the context of the article, they should all share the article language. Change-Id: Ifdfdd6d0481ba18cf8a6658cb243939994b87577 --- M Wikipedia/Categories/MWKSection+TOC.m M Wikipedia/Protocols/WMFLocalizationProtocol.m M Wikipedia/View Controllers/SearchResults/SearchResultsController.m M Wikipedia/View Controllers/TableOfContents/TOCViewController.m M Wikipedia/View Controllers/WebView/Footer/SubFooters/Legal/WMFLegalFooterViewController.h M Wikipedia/View Controllers/WebView/Footer/SubFooters/Legal/WMFLegalFooterViewController.m M Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.m M Wikipedia/View Controllers/WebView/Footer/SubFooters/ReadMore/WMFReadMoreViewController.m M Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.h M Wikipedia/View Controllers/WebView/Footer/WMFWebViewFooterViewController.m M Wikipedia/View Controllers/WebView/WebViewController.m M Wikipedia/mw-utils/WikipediaAppUtils.h M Wikipedia/mw-utils/WikipediaAppUtils.m 13 files changed, 45 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/09/205809/1 diff --git a/Wikipedia/Categories/MWKSection+TOC.m b/Wikipedia/Categories/MWKSection+TOC.m index 8929328..01325f9 100644 --- a/Wikipedia/Categories/MWKSection+TOC.m +++ b/Wikipedia/Categories/MWKSection+TOC.m @@ -35,7 +35,7 @@ NSFontAttributeName: [UIFont fontWithName:@"Times New Roman" size:24.0 * MENUS_SCALE_MULTIPLIER] }; -NSString* heading = MWLocalizedString(@"table-of-contents-heading", nil); +NSString* heading = MWCurrentArticleLanguageLocalizedString(@"table-of-contents-heading", nil); if ([[SessionSingleton sharedInstance].currentArticleSite.language isEqualToString:@"en"]) { heading = [heading uppercaseString]; diff --git a/Wikipedia/Protocols/WMFLocalizationProtocol.m b/Wikipedia/Protocols/WMFLocalizationProtocol.m index 6f70573..8b089c9 100644 --- a/Wikipedia/Protocols/WMFLocalizationProtocol.m +++ b/Wikipedia/Protocols/WMFLocalizationProtocol.m @@ -46,7 +46,7 @@ -(NSString *)getTranslationForKey:(NSString *)key { if (key && (key.length > 0)) { -return MWLocalizedString(key, nil); +return MWCurrentArticleLanguageLocalizedString(key, nil); }else{ return @""; } diff --git a/Wikipedia/View Controllers/SearchResults/SearchResultsController.m b/Wikipedia/View Controllers/SearchResults/SearchResultsController.m index e899708..418f621 100644 --- a/Wikipedia/View Controllers/SearchResults/SearchResultsController.m +++ b/Wikipedia/View Controllers/SearchResults/SearchResultsController.m @@ -516,7 +516,7 @@ self.searchSuggestion = [searchResultFetcher.searchSuggestion copy]; } if (self.searchSuggestion) { -[self.didYouMeanButton showWithText:MWLocalizedString(@"search-did-you-mean", nil) +[self.didYouMeanButton showWithText:(self.type == WMFSearchResultsControllerTypeReadMore) ? MWCurrentArticleLanguageLocalizedString(@"search-did-you-mean", nil) : MWLocalizedString(@"search-did-you-mean", nil) term:self.searchSuggestion]; } } else if ([sender isKindOfClass:[ThumbnailFetcher class]]) { diff --git a/Wikipedia/View Controllers/TableOfContents/TOCViewController.m b/Wikipedia/View Controllers/TableOfContents/TOCViewController.m index 2c3275a..78db6b7 100644 --- a/Wikipedia/View Controllers/TableOfContents/TOCViewController.m +++ b/Wikipedia/View Controllers/TableOfContents/TOCViewController.m @@ -598,7 +598,7 @@ @"id": @(10), @"isLead": @(NO), @"level": @0, - @"title": MWLocalizedString(@"article-read-more-title", @"Read more") + @"title": MWCurrentArticleLanguageLocalizedString(@"article-
[MediaWiki-commits] [Gerrit] Remove run-time css sync so we have more control over css de... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/205760 Change subject: Remove run-time css sync so we have more control over css deployment. .. Remove run-time css sync so we have more control over css deployment. Change-Id: I915ff69adb6a8e45c5ab5935ddf9fabb1a497b50 --- M Wikipedia/AssetsFile/WMFAssetsFile.h M Wikipedia/AssetsFile/WMFAssetsFile.m M Wikipedia/View Controllers/WebView/WebViewController.m 3 files changed, 3 insertions(+), 37 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/60/205760/1 diff --git a/Wikipedia/AssetsFile/WMFAssetsFile.h b/Wikipedia/AssetsFile/WMFAssetsFile.h index d597a8c..cd970d6 100644 --- a/Wikipedia/AssetsFile/WMFAssetsFile.h +++ b/Wikipedia/AssetsFile/WMFAssetsFile.h @@ -5,9 +5,6 @@ WMFAssetsFileTypeConfig, WMFAssetsFileTypeLanguages, WMFAssetsFileTypeMainPages, -WMFAssetsFileTypeCSS, -WMFAssetsFileTypeCSSAbuseFilter, -WMFAssetsFileTypeCSSPreview }; @interface WMFAssetsFile : NSObject diff --git a/Wikipedia/AssetsFile/WMFAssetsFile.m b/Wikipedia/AssetsFile/WMFAssetsFile.m index 36fe30f..e1db5a1 100644 --- a/Wikipedia/AssetsFile/WMFAssetsFile.m +++ b/Wikipedia/AssetsFile/WMFAssetsFile.m @@ -77,18 +77,6 @@ return @"mainpages.json"; break; -case WMFAssetsFileTypeCSS: -return @"styles.css"; -break; - -case WMFAssetsFileTypeCSSAbuseFilter: -return @"abusefilter.css"; -break; - -case WMFAssetsFileTypeCSSPreview: -return @"preview.css"; -break; - default: return nil; break; @@ -101,18 +89,6 @@ switch (self.fileType) { case WMFAssetsFileTypeConfig: urlString = @"https://bits.wikimedia.org/static-current/extensions/MobileApp/config/ios.json";; -break; - -case WMFAssetsFileTypeCSS: -urlString = @"https://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&lang=en&modules=mobile.app.pagestyles.ios&only=styles&skin=vector";; -break; - -case WMFAssetsFileTypeCSSAbuseFilter: -urlString = @"https://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&lang=en&modules=mobile.app.pagestyles.ios&only=styles&skin=vector";; -break; - -case WMFAssetsFileTypeCSSPreview: -urlString = @"https://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&lang=en&modules=mobile.app.preview&only=styles&skin=vector";; break; default: diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index a6dc77c..b29d8fb 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -374,16 +374,9 @@ // Sync config/ios.json at most once per day. [[QueuesSingleton sharedInstance].assetsFetchManager.operationQueue cancelAllOperations]; -void (^ fetch)(WMFAssetsFileType) = ^void (WMFAssetsFileType type) { -(void)[[AssetsFileFetcher alloc] initAndFetchAssetsFileOfType:type - withManager:[QueuesSingleton sharedInstance].assetsFetchManager - maxAge:kWMFMaxAgeDefault]; -}; - -fetch(WMFAssetsFileTypeConfig); -fetch(WMFAssetsFileTypeCSS); -fetch(WMFAssetsFileTypeCSSAbuseFilter); -fetch(WMFAssetsFileTypeCSSPreview); +(void)[[AssetsFileFetcher alloc] initAndFetchAssetsFileOfType:WMFAssetsFileTypeConfig + withManager:[QueuesSingleton sharedInstance].assetsFetchManager + maxAge:kWMFMaxAgeDefault]; } #pragma mark Edit section -- To view, visit https://gerrit.wikimedia.org/r/205760 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I915ff69adb6a8e45c5ab5935ddf9fabb1a497b50 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix unit tests - 8.3 is now the current version of the SDK - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Fix unit tests - 8.3 is now the current version of the SDK .. Fix unit tests - 8.3 is now the current version of the SDK Fix produce command - work around bug Update to new report format for xctest Also Cleanup fastfile and add not test option Uncrust Change-Id: If2215902b86d7687c9f4f0129ac4963b8d374aec --- M Wikipedia/View Controllers/Login/LoginViewController.m M fastlane/Fastfile M fastlane/lib/utils.rb 3 files changed, 44 insertions(+), 39 deletions(-) Approvals: Mhurd: Looks good to me, approved Bgerstle: Looks good to me, but someone else must approve diff --git a/Wikipedia/View Controllers/Login/LoginViewController.m b/Wikipedia/View Controllers/Login/LoginViewController.m index 8ab7d5d..ec397ec 100644 --- a/Wikipedia/View Controllers/Login/LoginViewController.m +++ b/Wikipedia/View Controllers/Login/LoginViewController.m @@ -200,7 +200,7 @@ } - (void)save { -id onboardingVC = [self searchModalsForViewControllerOfClass:[OnboardingViewController class]]; +id onboardingVC = [self searchModalsForViewControllerOfClass:[OnboardingViewController class]]; MenuButton* done = (MenuButton*)[self.topMenuViewController getNavBarItem:NAVBAR_BUTTON_DONE]; done.userInteractionEnabled = NO; diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 5774519..a43ae7a 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -37,6 +37,7 @@ produce({ produce_username: 'cfl...@wikimedia.org', produce_app_identifier: 'org.wikimedia.wikipedia.tfalpha', +produce_app_identifier_suffix: '', #work around for: https://github.com/KrauseFx/produce/issues/27 produce_app_name: 'Wikipedia Alpha', produce_language: 'English', produce_version: '4.1.1', @@ -54,12 +55,8 @@ # verbose: nil, # this means 'Do Verbose'. }) - unless deploy_disabled? + deploy_testflight_build -ENV['HOCKEY_API_TOKEN'] = 'c881c19fd8d0401682c4640b7948ef5e' -deploy_testflight_build - - end end lane :beta do @@ -95,12 +92,8 @@ archive: nil }) - unless deploy_disabled? + deploy_testflight_build -ENV['HOCKEY_API_TOKEN'] = 'c881c19fd8d0401682c4640b7948ef5e' -deploy_testflight_build - - end end lane :appstore do @@ -117,4 +110,3 @@ # error do |lane, exception| # end - diff --git a/fastlane/lib/utils.rb b/fastlane/lib/utils.rb index b1289ca..9e23a78 100644 --- a/fastlane/lib/utils.rb +++ b/fastlane/lib/utils.rb @@ -2,6 +2,8 @@ require 'git' +ENV['HOCKEY_API_TOKEN'] = 'c881c19fd8d0401682c4640b7948ef5e' + # Returns true if the `NO_RESET` env var is set to 1 def reset_disabled? ENV['NO_RESET'] == '1' @@ -12,6 +14,10 @@ ENV['NO_DEPLOY'] == '1' end +# Returns true if the `NO_TEST` env var is set to 1 +def test_disabled? + ENV['NO_TEST'] == '1' +end # Runs goals from the project's Makefile, this requires going up to the project directory. # :args: Additional arguments to be passed to `make`. # Returns The result of the `make` command @@ -23,13 +29,23 @@ end def run_unit_tests - xctest({ -scheme: 'Wikipedia', -destination: "platform=iOS Simulator,name=iPhone 6,OS=8.2", -report_formats: [ "html", "junit" ], -report_path: "build/reports/iOS82/report.xml", -clean: nil - }) + + unless test_disabled? +xctest({ + scheme: 'Wikipedia', + destination: "platform=iOS Simulator,name=iPhone 6,OS=8.3", + reports: [{ +report: "html", +output: "build/reports/report.html" + }, + { +report: "junit", +output: "build/reports/report.xml" +}], +clean: nil +}) + + end end # Generate a list of commit subjects from `rev` to `HEAD` @@ -45,27 +61,24 @@ ENV['GIT_COMMIT_LOG'] || ENV['GIT_COMMIT_LOG'] = generate_git_commit_log end -def hockey_api_token - ENV['HOCKEY_API_TOKEN'] -end - def deploy_testflight_build - # Upload the DSYM to Hockey - hockey({ -api_token: hockey_api_token, -notes: git_commit_log, -notify: 0, -status: 1, #Means do not make available for download - }) + unless deploy_disabled? +# Upload the DSYM to Hockey +hockey({ + api_token: ENV['HOCKEY_API_TOKEN'], + notes: git_commit_log, + notify: 0, + status: 1, #Means do not make available for download +}) - #Set "What To Test" in iTunes Connect for Testflight builds, in the future, reference tickets instead of git commits - DELIVER_WHAT_TO_TEST.replace = git_commit_log - #Set "App Description" in iTunes Connect for Testflight builds, in the future set a better description - DELIVER_BETA_DESCRIPTION.replace = git_commit_log - #Set "Feedback email" in iTunes Connect for Testflight builds - DELIVER_BETA_FEEDBACK_EMAIL.replace = 'ab...@wikimedia.org' +#Set "What To Test" in iTunes Connect for Testflight builds, in the future, reference tickets instead of git commits +
[MediaWiki-commits] [Gerrit] Removed comma from collapsed table chrome. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/204309 Change subject: Removed comma from collapsed table chrome. .. Removed comma from collapsed table chrome. T96179 Change-Id: Ifd50207e1f82c9461c9c231ef4e5bcc61648ad3a --- M Wikipedia/assets/bundle.js M www/js/transforms.js 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/09/204309/1 diff --git a/Wikipedia/assets/bundle.js b/Wikipedia/assets/bundle.js index 23d1589..40b74b7 100644 --- a/Wikipedia/assets/bundle.js +++ b/Wikipedia/assets/bundle.js @@ -625,7 +625,7 @@ caption += ", " + headerText[1]; } if (headerText.length > 0) { -caption += ", ..."; +caption += " ..."; } caption += ""; diff --git a/www/js/transforms.js b/www/js/transforms.js index e95aafb..4b7ea63 100644 --- a/www/js/transforms.js +++ b/www/js/transforms.js @@ -178,7 +178,7 @@ caption += ", " + headerText[1]; } if (headerText.length > 0) { -caption += ", ..."; +caption += " ..."; } caption += ""; -- To view, visit https://gerrit.wikimedia.org/r/204309 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd50207e1f82c9461c9c231ef4e5bcc61648ad3a Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix for weird staged file from last incoming translation set. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/204154 Change subject: Fix for weird staged file from last incoming translation set. .. Fix for weird staged file from last incoming translation set. Change-Id: I0672305f7cd42ba6bd098734845708239f95460f --- M wikipedia/eo.lproj/Localizable.strings 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/54/204154/1 diff --git a/wikipedia/eo.lproj/Localizable.strings b/wikipedia/eo.lproj/Localizable.strings index 17b4728..c3363d8 100644 --- a/wikipedia/eo.lproj/Localizable.strings +++ b/wikipedia/eo.lproj/Localizable.strings @@ -90,6 +90,7 @@ "navbar-title-mode-edit-wikitext-preview" = "Antaŭrigardi"; "navbar-title-mode-edit-wikitext-summary" = "Priskribu vian redakton"; "navbar-title-mode-edit-wikitext-save" = "Konservi"; +// Fuzzy "edit-summary-choice-linked-words" = "Aldonis ligilojn"; "edit-summary-choice-fixed-grammar" = "Ĝustigis gramatikon"; "edit-summary-choice-fixed-styling" = "Ĝustigis stilon"; @@ -98,6 +99,7 @@ "edit-summary-choice-added-missing-info" = "Aldonis mankantan informon"; "edit-summary-choice-added-clarification" = "Aldonis klarigon"; "edit-summary-choice-other" = "Alia"; +// Fuzzy "edit-summary-field-placeholder-text" = "Aliaj manieroj en kiuj vi plibonigis la artikolon"; "edit-summary-title" = "Kiel vi plibonigis la artikolon?"; "about-title" = "Pri"; -- To view, visit https://gerrit.wikimedia.org/r/204154 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0672305f7cd42ba6bd098734845708239f95460f Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add disambig.less and issues.less to iOS css. - change (mediawiki...MobileApp)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/203997 Change subject: Add disambig.less and issues.less to iOS css. .. Add disambig.less and issues.less to iOS css. Allows the iOS app to use the same disambig/pages issues less that's presently used by the android app. Change-Id: Ic9577925253f0872ea59fc5f42c224e4e9737afa --- M MobileApp.php 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileApp refs/changes/97/203997/1 diff --git a/MobileApp.php b/MobileApp.php index ec04d5d..aa4cbfa 100644 --- a/MobileApp.php +++ b/MobileApp.php @@ -81,7 +81,9 @@ 'styles' => array_merge( $wgCommonMobileAppLESSFiles, array( 'styles/editlinks.less', - 'styles/enwiki.less' + 'styles/enwiki.less', + 'styles/issues.less', + 'styles/disambig.less' ) ) ) + $wgCommonMobileAppModuleDef; -- To view, visit https://gerrit.wikimedia.org/r/203997 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9577925253f0872ea59fc5f42c224e4e9737afa Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileApp Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Prevent adding table collapsing chrome around "mbox-small" t... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/203887 Change subject: Prevent adding table collapsing chrome around "mbox-small" tables. .. Prevent adding table collapsing chrome around "mbox-small" tables. "mbox-small" tables are never shown, so don't add table collapsing chrome around them. See enwiki "germanic peoples" > "external links" section. There are 2 tables which are hidden, and before this patch they would get wrapped in table collapsing html, so you have the collapse/expand chrome appearing around invisible tables. Change-Id: Ia2cd012e00474e7163c045ea8db67311f45a35e8 --- M Wikipedia/assets/bundle.js M www/js/transforms.js 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/87/203887/1 diff --git a/Wikipedia/assets/bundle.js b/Wikipedia/assets/bundle.js index 23d1589..2e8a9f0 100644 --- a/Wikipedia/assets/bundle.js +++ b/Wikipedia/assets/bundle.js @@ -597,7 +597,7 @@ if (findAncestor (tables[i], 'app_table_container')) continue; //is the table already hidden? if so, don't worry about it -if (tables[i].style.display === 'none' || tables[i].classList.contains( 'navbox' ) || tables[i].classList.contains( 'vertical-navbox' ) || tables[i].classList.contains( 'navbox-inner' ) || tables[i].classList.contains( 'metadata' )) { +if (tables[i].style.display === 'none' || tables[i].classList.contains( 'navbox' ) || tables[i].classList.contains( 'vertical-navbox' ) || tables[i].classList.contains( 'navbox-inner' ) || tables[i].classList.contains( 'metadata' ) || tables[i].classList.contains( 'mbox-small' )) { continue; } diff --git a/www/js/transforms.js b/www/js/transforms.js index e95aafb..7e3b991 100644 --- a/www/js/transforms.js +++ b/www/js/transforms.js @@ -150,7 +150,7 @@ if (findAncestor (tables[i], 'app_table_container')) continue; //is the table already hidden? if so, don't worry about it -if (tables[i].style.display === 'none' || tables[i].classList.contains( 'navbox' ) || tables[i].classList.contains( 'vertical-navbox' ) || tables[i].classList.contains( 'navbox-inner' ) || tables[i].classList.contains( 'metadata' )) { +if (tables[i].style.display === 'none' || tables[i].classList.contains( 'navbox' ) || tables[i].classList.contains( 'vertical-navbox' ) || tables[i].classList.contains( 'navbox-inner' ) || tables[i].classList.contains( 'metadata' ) || tables[i].classList.contains( 'mbox-small' )) { continue; } -- To view, visit https://gerrit.wikimedia.org/r/203887 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia2cd012e00474e7163c045ea8db67311f45a35e8 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adding Change log to builds - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Adding Change log to builds .. Adding Change log to builds Added 'git' gem Creating change log from git commit subjects Adding change log to hockey app and iTunes Connect You can test by following the "Debugging" instructions in docs/working-with-ruby.md Also, added an uncrustify straggler Bug: T94423 Change-Id: I5268739757067e6fce96cfe618aaba6537201d11 --- M Gemfile M Gemfile.lock M Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m M docs/working-with-ruby.md M fastlane/Fastfile A fastlane/lib/utils.rb 6 files changed, 102 insertions(+), 49 deletions(-) Approvals: Fjalapeno: Looks good to me, but someone else must approve Mhurd: Verified; Looks good to me, approved Bgerstle: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/Gemfile b/Gemfile index ed0858b..449e109 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,4 @@ gem 'cocoapods', '~> 0.36.1' gem 'fastlane', '~> 0.4.2' +gem 'git' diff --git a/Gemfile.lock b/Gemfile.lock index 48aa94b..fb09ac8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -108,6 +108,7 @@ fastlane_core (>= 0.2.0) mini_magick (~> 4.0.2) fuzzy_match (2.0.4) +git (1.2.9.1) highline (1.7.1) i18n (0.7.0) json (1.8.2) @@ -187,3 +188,4 @@ DEPENDENCIES cocoapods (~> 0.36.1) fastlane (~> 0.4.2) + git diff --git a/Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m b/Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m index 03875d8..d4c38cc 100644 --- a/Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m +++ b/Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m @@ -138,7 +138,7 @@ - (NSArray*)fetchBatchContainingIndex:(NSInteger)index withNthNeighbor:(NSUInteger)next { NSAssert(next >= 0, @"No reason to call this method with next == 0"); -NSMutableIndexSet* indexes = [NSMutableIndexSet indexSetWithIndex:index]; +NSMutableIndexSet* indexes = [NSMutableIndexSet indexSetWithIndex:index]; NSUInteger const neighborIndex = index + next; if (neighborIndex < self.uniqueArticleImages.count) { [indexes addIndex:index + next]; diff --git a/docs/working-with-ruby.md b/docs/working-with-ruby.md index 2780aec..c477417 100644 --- a/docs/working-with-ruby.md +++ b/docs/working-with-ruby.md @@ -7,3 +7,19 @@ ### Usage Invoking any of the gems installed by Bundler can be done a couple of different ways. The most reliable way is by using `bundle exec` to prefix your commands (e.g. `bundle exec pod install`). If this is too cumbersome, you can use the `Makefile` goals (e.g. `make pod` which runs `bundle exec pod install`), or configure your `PATH` to discover the local binaries installed by Bundler. + +### Debugging +The easiest way to interactively debug Ruby-related aspects of the project is to use the `bundle console` command, which starts an `irb` REPL after `require`-ing the gems in `Gemfile`. From here, you can `require_relative` the file you want to debug and tinker with it in the shell. For example: + +``` +$ bundle console +# ... +irb(main)> Git +# => Git +irb(main)> require_relative 'some/local/file.rb' +# => true +irb(main)> foo 'bar' +# => result of calling foo with 'bar' +# Type Ctrl+D to get back to the command line +``` + diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 660227d..5774519 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -2,37 +2,10 @@ # https://github.com/krausefx/fastlane#customise-the-fastfile # vim: ft=ruby -ENV['XCODE_WORKSPACE'] = 'Wikipedia.xcworkspace' +# Since this file is eval'd, we need to add this file's directory to $LOAD_PATH +$:.unshift File.dirname(__FILE__) -# Returns true if the `NO_RESET` env var is set to 1 -def reset_disabled? - ENV['NO_RESET'] == '1' -end - -# Returns true if the `NO_DEPLOY` env var is set to 1 -def deploy_disabled? - ENV['NO_DEPLOY'] == '1' -end - -# Runs goals from the project's Makefile, this requires going up to the project directory. -# :args: Additional arguments to be passed to `make`. -# Returns The result of the `make` command -def make(args) - # Maybe we should write an "uncrustify" fastlane action?... - Dir.chdir '..' do -sh 'make ' + args - end -end - -def run_unit_tests - xctest({ -scheme: 'Wikipedia', -destination: "platform=iOS Simulator,name=iPhone 6,OS=8.2", -report_formats: [ "html", "junit" ], -report_path: "build/reports/iOS82/report.xml", -clean: nil - }) -end +require 'lib/utils.rb' before_all do p ENV @@ -44,11 +17,12 @@ lane :test do make 'lint' + run_unit_tests end lane :alpha do run_unit_tests - + # Download the Certificate for signing cert @@ -81,16 +55,10 @@ }) unless deploy_disabled? -# Upload the DSYM to Hockey -hockey({ - api_token: 'c881c19fd8d0401682c4640b794
[MediaWiki-commits] [Gerrit] Fix for side to side scrolling of wide images with div overl... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/203495 Change subject: Fix for side to side scrolling of wide images with div overlays. .. Fix for side to side scrolling of wide images with div overlays. See the following enwiki articles > sections: - "Historic Counties of England" > "Southern England" - "Poland" > "Administrive Divisions" ("More information" collapsed table) Change-Id: Ic488e55b047afa549f31f2658fb51324f21c415f --- M Wikipedia/assets/bundle.js M www/js/transforms.js 2 files changed, 24 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/95/203495/1 diff --git a/Wikipedia/assets/bundle.js b/Wikipedia/assets/bundle.js index 23d1589..c492b8f 100644 --- a/Wikipedia/assets/bundle.js +++ b/Wikipedia/assets/bundle.js @@ -701,16 +701,21 @@ } } ); +function firstAncestorWithMultipleChildren (el) { +while ((el = el.parentElement) && (el.childElementCount == 1)); +return el; +} + function addImageOverflowXContainer() { var image = this; if (image.width > (window.screen.width * 0.8)){ -var div = document.createElement( 'div' ); -div.className = 'image_overflow_x_container'; -image.parentElement.insertBefore( div, image ); -// Reminder: appendChild removes "image" from its previous location -// so no need to do so explicitly. -// See: https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild -div.appendChild( image ); +var ancestor = firstAncestorWithMultipleChildren (image); +if(ancestor){ +var div = document.createElement( 'div' ); +div.className = 'image_overflow_x_container'; +ancestor.parentElement.insertBefore( div, ancestor ); +div.appendChild( ancestor ); +} } } diff --git a/www/js/transforms.js b/www/js/transforms.js index e95aafb..2c288bb 100644 --- a/www/js/transforms.js +++ b/www/js/transforms.js @@ -254,16 +254,21 @@ } } ); +function firstAncestorWithMultipleChildren (el) { +while ((el = el.parentElement) && (el.childElementCount == 1)); +return el; +} + function addImageOverflowXContainer() { var image = this; if (image.width > (window.screen.width * 0.8)){ -var div = document.createElement( 'div' ); -div.className = 'image_overflow_x_container'; -image.parentElement.insertBefore( div, image ); -// Reminder: appendChild removes "image" from its previous location -// so no need to do so explicitly. -// See: https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild -div.appendChild( image ); +var ancestor = firstAncestorWithMultipleChildren (image); +if(ancestor){ +var div = document.createElement( 'div' ); +div.className = 'image_overflow_x_container'; +ancestor.parentElement.insertBefore( div, ancestor ); +div.appendChild( ancestor ); +} } } -- To view, visit https://gerrit.wikimedia.org/r/203495 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic488e55b047afa549f31f2658fb51324f21c415f Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] import imgs into xcassets and fix wikipedia group path - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: import imgs into xcassets and fix wikipedia group path .. import imgs into xcassets and fix wikipedia group path We had images in the "Images" group which should have been consolidated into the Images.xcassets catalog. There's also a logo-placeholder.svg which wasn't being used, so I removed it. Finally, the "Wikipedia" group was pointing at the old "wikipedia" (lowercase) path, but it still worked on case-insensitive filesystems. Change-Id: Id330bda0bc0fb02b7c4d4fc45ab0b2081ef0ed9e --- M Wikipedia.xcodeproj/project.pbxproj A Wikipedia/Images.xcassets/Wikipedia_wordmark_gray.imageset/Contents.json R Wikipedia/Images.xcassets/Wikipedia_wordmark_gray.imageset/Wikipedia_wordmark_gray.png A Wikipedia/Images.xcassets/abuse-filter-disallowed.imageset/Contents.json R Wikipedia/Images.xcassets/abuse-filter-disallowed.imageset/abuse-filter-disallowed.png R Wikipedia/Images.xcassets/abuse-filter-disallowed.imageset/abuse-filter-disallo...@2x.png A Wikipedia/Images.xcassets/abuse-filter-flag-white.imageset/Contents.json R Wikipedia/Images.xcassets/abuse-filter-flag-white.imageset/abuse-filter-flag-white.png R Wikipedia/Images.xcassets/abuse-filter-flag-white.imageset/abuse-filter-flag-wh...@2x.png A Wikipedia/Images.xcassets/by_white.imageset/Contents.json R Wikipedia/Images.xcassets/by_white.imageset/by_white.png A Wikipedia/Images.xcassets/cc_white.imageset/Contents.json R Wikipedia/Images.xcassets/cc_white.imageset/cc_white.png A Wikipedia/Images.xcassets/clear.imageset/Contents.json R Wikipedia/Images.xcassets/clear.imageset/clear.png A Wikipedia/Images.xcassets/lead-default.imageset/Contents.json R Wikipedia/Images.xcassets/lead-default.imageset/lead-default.png A Wikipedia/Images.xcassets/logo-onboarding-subtitle.imageset/Contents.json R Wikipedia/Images.xcassets/logo-onboarding-subtitle.imageset/logo-onboarding-subtitle.png R Wikipedia/Images.xcassets/logo-onboarding-subtitle.imageset/logo-onboarding-subti...@2x.png A Wikipedia/Images.xcassets/logo-onboarding.imageset/Contents.json R Wikipedia/Images.xcassets/logo-onboarding.imageset/logo-onboarding.png R Wikipedia/Images.xcassets/logo-onboarding.imageset/logo-onboard...@2x.png A Wikipedia/Images.xcassets/logo-placeholder-nearby.imageset/Contents.json R Wikipedia/Images.xcassets/logo-placeholder-nearby.imageset/logo-placeholder-nearby.png R Wikipedia/Images.xcassets/logo-placeholder-nearby.imageset/logo-placeholder-nea...@2x.png A Wikipedia/Images.xcassets/logo-placeholder-saved.imageset/Contents.json R Wikipedia/Images.xcassets/logo-placeholder-saved.imageset/logo-placeholder-saved.png R Wikipedia/Images.xcassets/logo-placeholder-saved.imageset/logo-placeholder-sa...@2x.png A Wikipedia/Images.xcassets/logo-placeholder-search.imageset/Contents.json R Wikipedia/Images.xcassets/logo-placeholder-search.imageset/logo-placeholder-search.png R Wikipedia/Images.xcassets/logo-placeholder-search.imageset/logo-placeholder-sea...@2x.png A Wikipedia/Images.xcassets/sa_white.imageset/Contents.json R Wikipedia/Images.xcassets/sa_white.imageset/sa_white.png A Wikipedia/Images.xcassets/text_field_x_circle_gray.imageset/Contents.json R Wikipedia/Images.xcassets/text_field_x_circle_gray.imageset/text_field_x_circle_gray.png R Wikipedia/Images.xcassets/text_field_x_circle_gray.imageset/text_field_x_circle_g...@2x.png D Wikipedia/Images/logo-placeholder.svg 38 files changed, 223 insertions(+), 3,328 deletions(-) Approvals: Fjalapeno: Looks good to me, but someone else must approve Mhurd: Looks good to me, approved -- To view, visit https://gerrit.wikimedia.org/r/202928 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id330bda0bc0fb02b7c4d4fc45ab0b2081ef0ed9e Gerrit-PatchSet: 2 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Bgerstle Gerrit-Reviewer: Dr0ptp4kt Gerrit-Reviewer: Fjalapeno Gerrit-Reviewer: Mhurd Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix for T94534 not working on iPads - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Fix for T94534 not working on iPads .. Fix for T94534 not working on iPads Shell script was setting names based on the assets file but file names in the catalog are apparently is not uniform. The fix is using the files in the app bundle for the source. This actually simplifies the script quite a bit, so win win! Additionally had to do some dangling to loop over paths that have spaces Change-Id: Ic3f909e250b7eddfd115131c4115a7aef09b8c1b --- M scripts/process-icons.sh 1 file changed, 40 insertions(+), 59 deletions(-) Approvals: Mhurd: Looks good to me, approved Bgerstle: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/scripts/process-icons.sh b/scripts/process-icons.sh index 8e1664e..08efd2d 100755 --- a/scripts/process-icons.sh +++ b/scripts/process-icons.sh @@ -1,99 +1,76 @@ #This script will overlay version, git, and build configuration information over the icon for non-app store builds #Inspiration: http://www.merowing.info/2013/03/overlaying-application-version-on-top-of-your-icon/ -#Info to overlay on Icon -commit=`git rev-parse --short HEAD` -branch=`git rev-parse --abbrev-ref HEAD` -version=`agvtool what-marketing-version -terse1` -build=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${INFOPLIST_FILE}"` +export PATH=$PATH:/usr/local/bin -#Where to save the files -target_path="${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/" +#Don't run if imagemagick is not installed +if ! convert -version > /dev/null; then + exit 0 +fi + +#Don't do this for App Store Releases +if [ "$CONFIGURATION" == "Release" ]; then + exit 0 +fi function processIconSet() { - export PATH=$PATH:/usr/local/bin + #Get build number from info.plist + build=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${INFOPLIST_FILE}"` - #Don't do this for App Store or Instore Release - if [ "$CONFIGURATION" == "Release" ]; then - exit 0 - fi + #Get path to icons in app bundle + icon_directory_path="${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + echo "icon directory: "$icon_directory_path - #Make path to existing icons - source_icon_set=$1 - source_icon_set_folder_name=$source_icon_set".appiconset" - echo $source_icon_set_folder_name + #Set the prefix of icon files so that we can find them in the the app bundle + source_icon_set_prefix=$1 + echo "Source icon Prefix: "$source_icon_set_prefix - #Find existing icons - source_icon_set_directory=`find . -name $source_icon_set_folder_name -type d` - echo "Source icon directory: "$source_icon_set_directory + #Fine the icons in the app bundle + source_icons=`find "$icon_directory_path" -name "$source_icon_set_prefix*.png" -type f` + echo "Source icons: "$source_icons - #Make target base file name - same as asset collection name - target_base_file_name=$source_icon_set - echo "Target base file name: "$target_base_file_name + #Looping through unescaped paths is fraught with peril + #Tip found here: http://www.cyberciti.biz/tips/handling-filenames-with-spaces-in-bash.html + SAVEIFS=$IFS + IFS=$(echo -en "\n\b") + echo "Set IFS for unescaped for loop paths" #Loop through icons - for source_icon_path in $(find $source_icon_set_directory -name "*.png" -type f); do + for source_icon_path in ${source_icons}; do + + echo "Source icon path: $source_icon_path" #Image meta minimum_width="" - retina_suffix="" - width="" - height="" - icon_size_suffix="" - width_suffix="" - height_suffix="" + width=`identify -format %w "$source_icon_path"` + height=`identify -format %h "$source_icon_path"` + #Overlay Height overlay_height="" overlay_color="#0008" - #Populate the image meta based on retina and size + #Set minimum width and overlay height based on icon size if [[ $source_icon_path == *"@3x"* ]]; then - minimum_width=114 - retina_suffix="@3x" - width=`identify -format %w "$source_icon_path"` - height=`identify -format %h "$source_icon_path"` - width_suffix=$width - height_suffix=$height - let "width_suffix/=3" - let "height_suffix/=3" + minimum_width=171 overlay_height=60 elif [[ $source_icon_path == *"@2x"* ]]; then minimum_width=114 -
[MediaWiki-commits] [Gerrit] Quick follow-on optimization to image scroll transform. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/203465 Change subject: Quick follow-on optimization to image scroll transform. .. Quick follow-on optimization to image scroll transform. Change-Id: I04589cd9c67c540b630f4dfac2df2056b230c00c --- M Wikipedia/assets/bundle.js M www/js/transforms.js 2 files changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/65/203465/1 diff --git a/Wikipedia/assets/bundle.js b/Wikipedia/assets/bundle.js index d029825..23d1589 100644 --- a/Wikipedia/assets/bundle.js +++ b/Wikipedia/assets/bundle.js @@ -707,8 +707,10 @@ var div = document.createElement( 'div' ); div.className = 'image_overflow_x_container'; image.parentElement.insertBefore( div, image ); -var oldImage = image.parentElement.removeChild( image ); -div.appendChild( oldImage ); +// Reminder: appendChild removes "image" from its previous location +// so no need to do so explicitly. +// See: https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild +div.appendChild( image ); } } diff --git a/www/js/transforms.js b/www/js/transforms.js index 9de0e91..e95aafb 100644 --- a/www/js/transforms.js +++ b/www/js/transforms.js @@ -260,8 +260,10 @@ var div = document.createElement( 'div' ); div.className = 'image_overflow_x_container'; image.parentElement.insertBefore( div, image ); -var oldImage = image.parentElement.removeChild( image ); -div.appendChild( oldImage ); +// Reminder: appendChild removes "image" from its previous location +// so no need to do so explicitly. +// See: https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild +div.appendChild( image ); } } -- To view, visit https://gerrit.wikimedia.org/r/203465 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04589cd9c67c540b630f4dfac2df2056b230c00c Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix for image info pagination crash. - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/203197 Change subject: Fix for image info pagination crash. .. Fix for image info pagination crash. T95601 Change-Id: I64af332e4e150893311159100d9662cca6896631 --- M Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/97/203197/1 diff --git a/Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m b/Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m index 10b52a7..dd01da9 100644 --- a/Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m +++ b/Wikipedia/View Controllers/Image Gallery/WMFImageInfoController.m @@ -146,7 +146,9 @@ #pragma mark - Private Fetch - (NSRange)batchRangeForTargetIndex:(NSUInteger)index { -NSParameterAssert(index < self.uniqueArticleImages.count); +if (index > self.uniqueArticleImages.count) { +return WMFRangeMakeNotFound(); +} NSUInteger const start = floorf(index / (float)self.infoBatchSize) * self.infoBatchSize; NSRange const range= NSMakeRange(start, MIN(self.infoBatchSize, self.uniqueArticleImages.count - start)); NSParameterAssert(range.location <= index); -- To view, visit https://gerrit.wikimedia.org/r/203197 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64af332e4e150893311159100d9662cca6896631 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Mar follow on for T95318 - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Mar follow on for T95318 .. Mar follow on for T95318 Do not start manager if we didn't set the API Key Add unit tests Change-Id: I29a7ed05c3e8a407de0b39757954633d06656dd3 --- M Wikipedia.xcodeproj/project.pbxproj A WikipediaUnitTests/BITHockeyManagerWMFExtensionsTests.m M wikipedia/Categories/BITHockeyManager+WMFExtensions.h M wikipedia/Categories/BITHockeyManager+WMFExtensions.m 4 files changed, 51 insertions(+), 8 deletions(-) Approvals: Mhurd: Verified; Looks good to me, approved Bgerstle: Looks good to me, but someone else must approve diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index fdf2f8c..608cb84 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -206,6 +206,8 @@ 0EA4402E1AA6281200B09DBA /* NSDateFormatter+WMFExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EA4402D1AA6281200B09DBA /* NSDateFormatter+WMFExtensions.m */; }; 0EBC56681AD3656900E82CDD /* WMFAsyncTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = BC7ACB631AB34C9C00791497 /* WMFAsyncTestCase.m */; }; 0EBC567F1AD442CC00E82CDD /* BITHockeyManager+WMFExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EBC567E1AD442CC00E82CDD /* BITHockeyManager+WMFExtensions.m */; }; + 0EBC56961AD5B22800E82CDD /* BITHockeyManagerWMFExtensionsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EBC56951AD5B22800E82CDD /* BITHockeyManagerWMFExtensionsTests.m */; }; + 0EBC56971AD5B69300E82CDD /* BITHockeyManager+WMFExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EBC567E1AD442CC00E82CDD /* BITHockeyManager+WMFExtensions.m */; }; 701FF5EE601DEA3FCAB7EFD3 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D82982ED992F47428037BDF2 /* libPods.a */; }; 954BA118838BF8BA6B01C34A /* libPods-WikipediaUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CE61C6963F825760822A28A /* libPods-WikipediaUnitTests.a */; }; BC0FED621AAA0263002488D7 /* WMFCodingStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = BC6FEAE01A9B7EFD00A1D890 /* WMFCodingStyle.m */; }; @@ -757,6 +759,7 @@ 0EA4402D1AA6281200B09DBA /* NSDateFormatter+WMFExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSDateFormatter+WMFExtensions.m"; path = "Wikipedia/Categories/NSDateFormatter+WMFExtensions.m"; sourceTree = SOURCE_ROOT; }; 0EBC567D1AD442CC00E82CDD /* BITHockeyManager+WMFExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "BITHockeyManager+WMFExtensions.h"; path = "Wikipedia/Categories/BITHockeyManager+WMFExtensions.h"; sourceTree = SOURCE_ROOT; }; 0EBC567E1AD442CC00E82CDD /* BITHockeyManager+WMFExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "BITHockeyManager+WMFExtensions.m"; path = "Wikipedia/Categories/BITHockeyManager+WMFExtensions.m"; sourceTree = SOURCE_ROOT; }; + 0EBC56951AD5B22800E82CDD /* BITHockeyManagerWMFExtensionsTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BITHockeyManagerWMFExtensionsTests.m; sourceTree = ""; }; 17A2F22335C5256576CEDBDD /* Pods-WikipediaUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WikipediaUnitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-WikipediaUnitTests/Pods-WikipediaUnitTests.release.xcconfig"; sourceTree = ""; }; 1BC5FB470144D2C10C55A037 /* Pods-WikipediaUnitTests.alpha.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WikipediaUnitTests.alpha.xcconfig"; path = "Pods/Target Support Files/Pods-WikipediaUnitTests/Pods-WikipediaUnitTests.alpha.xcconfig"; sourceTree = ""; }; 357504E50DA104E39C6ACFEB /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; @@ -2105,6 +2108,7 @@ BCA9575C1ABE473800B62AE8 /* OldDataSchemaMigratorTests.m */, BC31B2511AB1D9DC008138CA /* WMFImageInfoControllerTests.m */, BCE912BC1ACC629B00B74B42 /* NSIndexSet+BKReduceTests.m */, + 0EBC56951AD5B22800E82CDD /* BITHockeyManagerWMFExtensionsTests.m */, ); path = WikipediaUnitTests; sourceTre
[MediaWiki-commits] [Gerrit] makefile & fastlane follow-on - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: makefile & fastlane follow-on .. makefile & fastlane follow-on - fix some syntax & rebase errors in the Makefile - add "make" fn to Fastfile which allows make goals to be invoked from the Fastfile - add linting to pre_check fn - DRY up the Fastfile a bit - commit some lint fixes Change-Id: Ic1ffbe0ffc1659a949a727ddd659cf0ee169054e --- M Makefile M fastlane/Fastfile 2 files changed, 59 insertions(+), 25 deletions(-) Approvals: Fjalapeno: Looks good to me, but someone else must approve Mhurd: Verified; Looks good to me, approved diff --git a/Makefile b/Makefile index 7e3862f..48f30fd 100644 --- a/Makefile +++ b/Makefile @@ -110,20 +110,34 @@ #! Web dependency management #! -CSS_ORIGIN = "http://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&lang=en&only=styles&skin=vector&modules="; +web: ##Make web assets +web: css grunt + +CSS_ORIGIN = http://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&lang=en&only=styles&skin=vector&modules= WEB_ASSETS_DIR = "Wikipedia/assets" -cd "Wikipedia/assets/" && { -curl -L -f -o 'styles.css' "${PREFIX}mobile.app.pagestyles.ios" -curl -L -f -o 'abusefilter.css' "${PREFIX}mobile.app.pagestyles.ios" -curl -L -f -o 'preview.css' "${PREFIX}mobile.app.preview" -} +define get_css_module +curl -s -L -o +endef +css: ##Download latest stylesheets + @echo "Downloading CSS assets..."; \ + mkdir -p $(WEB_ASSETS_DIR); \ + cd $(WEB_ASSETS_DIR); \ + $(get_css_module) 'styles.css' "$(CSS_ORIGIN)mobile.app.pagestyles.ios" > /dev/null; \ + $(get_css_module) 'abusefilter.css' "$(CSS_ORIGIN)mobile.app.pagestyles.ios" > /dev/null; \ + $(get_css_module) 'preview.css' "$(CSS_ORIGIN)mobile.app.preview" > /dev/null NODE_VERSION = "$(shell node -v 2>/dev/null)" NPM_VERSION = "$(shell npm -version 2>/dev/null)" -npm: ##TODO, run npm install +grunt: ##Run grunt +grunt: npm + @cd www && grunt && cd .. + +npm: ##Install Javascript dependencies +npm: node-check + @cd www && npm install && cd .. get-node: ##Install node via Homebrew brew install node diff --git a/fastlane/Fastfile b/fastlane/Fastfile index c22ed23..660227d 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -4,16 +4,27 @@ ENV['XCODE_WORKSPACE'] = 'Wikipedia.xcworkspace' -before_all do - p ENV - reset_git_repo :force unless ENV['NO_RESET'] - ensure_git_status_clean unless ENV['NO_RESET'] - cocoapods - pre_check +# Returns true if the `NO_RESET` env var is set to 1 +def reset_disabled? + ENV['NO_RESET'] == '1' end -def pre_check +# Returns true if the `NO_DEPLOY` env var is set to 1 +def deploy_disabled? + ENV['NO_DEPLOY'] == '1' +end +# Runs goals from the project's Makefile, this requires going up to the project directory. +# :args: Additional arguments to be passed to `make`. +# Returns The result of the `make` command +def make(args) + # Maybe we should write an "uncrustify" fastlane action?... + Dir.chdir '..' do +sh 'make ' + args + end +end + +def run_unit_tests xctest({ scheme: 'Wikipedia', destination: "platform=iOS Simulator,name=iPhone 6,OS=8.2", @@ -21,15 +32,23 @@ report_path: "build/reports/iOS82/report.xml", clean: nil }) +end +before_all do + p ENV + unless reset_disabled? +reset_git_repo :force +ensure_git_status_clean + end end lane :test do - + make 'lint' end lane :alpha do - + run_unit_tests + # Download the Certificate for signing cert @@ -61,7 +80,7 @@ # verbose: nil, # this means 'Do Verbose'. }) - unless ENV['NO_DEPLOY'] + unless deploy_disabled? # Upload the DSYM to Hockey hockey({ api_token: 'c881c19fd8d0401682c4640b7948ef5e', @@ -76,6 +95,8 @@ end lane :beta do + run_unit_tests + # Download the Certificate for signing cert @@ -106,7 +127,7 @@ archive: nil }) - unless ENV['NO_DEPLOY'] + unless deploy_disabled? # Upload the DSYM to Hockey hockey({ api_token: 'c881c19fd8d0401682c4640b7948ef5e', @@ -120,18 +141,17 @@ end lane :appstore do + run_unit_tests snapshot frameit - unless ENV['NO_DEPLOY'] + unless deploy_disabled? deliver :skip_deploy, :force end end -after_all do |lane| +# after_all do |lane| +# end -end +# error do |lane, exception| +# end - -error do |lane, exception| - # Something bad happened -end -- To view, visit https://gerrit.wikimedia.org/r/202649 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic1ffbe0ffc1659a949a727ddd659cf0ee169054e Gerrit-PatchSet: 3 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Bgerstle Gerrit-Reviewer: Bgerstle Gerrit-Reviewer: Dr0ptp4kt Gerrit-Reviewer: Fjalapeno Gerrit-Reviewer: Mhurd Gerrit-Reviewer: jenkins-bot <> ___
[MediaWiki-commits] [Gerrit] Enable crash reporting for Alpha builds T95318 - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Enable crash reporting for Alpha builds T95318 .. Enable crash reporting for Alpha builds T95318 Also cleanup and encapsulate crash reporting logic - boyscout rule Also edited gitignore to ignore orig files after rebasing Change-Id: I8b04ac7a1fbd64fe4067042614836e68193a834e --- M .gitignore M Wikipedia.xcodeproj/project.pbxproj M Wikipedia/AppDelegate.m M Wikipedia/mw-utils/WikipediaAppUtils.h M Wikipedia/mw-utils/WikipediaAppUtils.m A wikipedia/Categories/BITHockeyManager+WMFExtensions.h A wikipedia/Categories/BITHockeyManager+WMFExtensions.m 7 files changed, 147 insertions(+), 95 deletions(-) Approvals: Mhurd: Looks good to me, approved Bgerstle: Looks good to me, but someone else must approve diff --git a/.gitignore b/.gitignore index 0eeb4b3..2d2952e 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,6 @@ node_modules/ # TODO: remove this when assets is moved into build/ Wikipedia/assets/ + +# Git +*.orig diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index aff6b95..fdf2f8c 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -205,6 +205,7 @@ 08D631F71A69B1AB00D87AD0 /* WMFImageGalleryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08D631F61A69B1AB00D87AD0 /* WMFImageGalleryViewController.m */; }; 0EA4402E1AA6281200B09DBA /* NSDateFormatter+WMFExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EA4402D1AA6281200B09DBA /* NSDateFormatter+WMFExtensions.m */; }; 0EBC56681AD3656900E82CDD /* WMFAsyncTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = BC7ACB631AB34C9C00791497 /* WMFAsyncTestCase.m */; }; + 0EBC567F1AD442CC00E82CDD /* BITHockeyManager+WMFExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 0EBC567E1AD442CC00E82CDD /* BITHockeyManager+WMFExtensions.m */; }; 701FF5EE601DEA3FCAB7EFD3 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D82982ED992F47428037BDF2 /* libPods.a */; }; 954BA118838BF8BA6B01C34A /* libPods-WikipediaUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CE61C6963F825760822A28A /* libPods-WikipediaUnitTests.a */; }; BC0FED621AAA0263002488D7 /* WMFCodingStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = BC6FEAE01A9B7EFD00A1D890 /* WMFCodingStyle.m */; }; @@ -754,6 +755,8 @@ 08F646F7D0488CE3C6D6A763 /* Pods.beta.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.beta.xcconfig; path = "Pods/Target Support Files/Pods/Pods.beta.xcconfig"; sourceTree = ""; }; 0EA4402C1AA6281200B09DBA /* NSDateFormatter+WMFExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSDateFormatter+WMFExtensions.h"; path = "Wikipedia/Categories/NSDateFormatter+WMFExtensions.h"; sourceTree = SOURCE_ROOT; }; 0EA4402D1AA6281200B09DBA /* NSDateFormatter+WMFExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSDateFormatter+WMFExtensions.m"; path = "Wikipedia/Categories/NSDateFormatter+WMFExtensions.m"; sourceTree = SOURCE_ROOT; }; + 0EBC567D1AD442CC00E82CDD /* BITHockeyManager+WMFExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "BITHockeyManager+WMFExtensions.h"; path = "Wikipedia/Categories/BITHockeyManager+WMFExtensions.h"; sourceTree = SOURCE_ROOT; }; + 0EBC567E1AD442CC00E82CDD /* BITHockeyManager+WMFExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "BITHockeyManager+WMFExtensions.m"; path = "Wikipedia/Categories/BITHockeyManager+WMFExtensions.m"; sourceTree = SOURCE_ROOT; }; 17A2F22335C5256576CEDBDD /* Pods-WikipediaUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WikipediaUnitTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-WikipediaUnitTests/Pods-WikipediaUnitTests.release.xcconfig"; sourceTree = ""; }; 1BC5FB470144D2C10C55A037 /* Pods-WikipediaUnitTests.alpha.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WikipediaUnitTests.alpha.xcconfig"; path = "Pods/Target Support Files/Pods-WikipediaUnitTests/Pods-WikipediaUnitTests.alpha.xcconfig"; sourceTree = ""; }; 357504E50DA104E39C6ACFEB /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; @@ -1917,6 +1920,8
[MediaWiki-commits] [Gerrit] uncrust some stragglers - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: uncrust some stragglers .. uncrust some stragglers Change-Id: Idac044c2b7f40bf81a687e1bf5ad2820c276f17c --- M MediaWikiKit/MediaWikiKit/MWKImage.m M Wikipedia/C Methods/WMFArticleParsing.m M Wikipedia/main.m 3 files changed, 3 insertions(+), 0 deletions(-) Approvals: Mhurd: Looks good to me, approved Bgerstle: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/MediaWikiKit/MediaWikiKit/MWKImage.m b/MediaWikiKit/MediaWikiKit/MWKImage.m index 90b5335..96a0b49 100644 --- a/MediaWikiKit/MediaWikiKit/MWKImage.m +++ b/MediaWikiKit/MediaWikiKit/MWKImage.m @@ -206,6 +206,7 @@ - (MWKImage*)largestCachedVariant { return [self.article.images largestImageVariantForURL:self.sourceURL cachedOnly:YES]; } + - (MWKImage*)smallestCachedVariant { return [self.article.images smallestImageVariantForURL:self.sourceURL cachedOnly:YES]; } diff --git a/Wikipedia/C Methods/WMFArticleParsing.m b/Wikipedia/C Methods/WMFArticleParsing.m index 45a286f..8bee6ea 100644 --- a/Wikipedia/C Methods/WMFArticleParsing.m +++ b/Wikipedia/C Methods/WMFArticleParsing.m @@ -111,3 +111,4 @@ [image save]; } } + diff --git a/Wikipedia/main.m b/Wikipedia/main.m index bcaf60f..798ddc4 100644 --- a/Wikipedia/main.m +++ b/Wikipedia/main.m @@ -15,3 +15,4 @@ isUnitTesting ? nil : NSStringFromClass([AppDelegate class])); } } + -- To view, visit https://gerrit.wikimedia.org/r/202770 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idac044c2b7f40bf81a687e1bf5ad2820c276f17c Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Fjalapeno Gerrit-Reviewer: Bgerstle Gerrit-Reviewer: Dr0ptp4kt Gerrit-Reviewer: Mhurd Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix for missing recent thumb images. - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: Fix for missing recent thumb images. .. Fix for missing recent thumb images. Mostly happened when navigating via links. T95114 Change-Id: I7815fb2b01293fc5f05e3a84c566198e73c49c8f --- M MediaWikiKit/MediaWikiKit/MWKImage.h M MediaWikiKit/MediaWikiKit/MWKImage.m M MediaWikiKit/MediaWikiKit/MWKImageList.h M MediaWikiKit/MediaWikiKit/MWKImageList.m M Wikipedia/View Controllers/History/HistoryViewController.m M Wikipedia/View Controllers/SavedPages/SavedPagesViewController.m 6 files changed, 51 insertions(+), 34 deletions(-) Approvals: Fjalapeno: Looks good to me, but someone else must approve Mhurd: Looks good to me, approved Bgerstle: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/MediaWikiKit/MediaWikiKit/MWKImage.h b/MediaWikiKit/MediaWikiKit/MWKImage.h index c31ae02..43c81a1 100644 --- a/MediaWikiKit/MediaWikiKit/MWKImage.h +++ b/MediaWikiKit/MediaWikiKit/MWKImage.h @@ -53,6 +53,9 @@ - (MWKImage*)largestVariant; - (MWKImage*)largestCachedVariant; +- (MWKImage*)smallestVariant; +- (MWKImage*)smallestCachedVariant; + /// Return the folder containing the image file from receiver's @c sourceURL. - (NSString*)basename; diff --git a/MediaWikiKit/MediaWikiKit/MWKImage.m b/MediaWikiKit/MediaWikiKit/MWKImage.m index 77dd950..90b5335 100644 --- a/MediaWikiKit/MediaWikiKit/MWKImage.m +++ b/MediaWikiKit/MediaWikiKit/MWKImage.m @@ -198,9 +198,17 @@ return [self.article imageWithURL:largestURL]; } +- (MWKImage*)smallestVariant { +NSString* smallestURL = [self.article.images smallestImageVariant:self.sourceURL]; +return [self.article imageWithURL:smallestURL]; +} + - (MWKImage*)largestCachedVariant { return [self.article.images largestImageVariantForURL:self.sourceURL cachedOnly:YES]; } +- (MWKImage*)smallestCachedVariant { +return [self.article.images smallestImageVariantForURL:self.sourceURL cachedOnly:YES]; +} - (BOOL)isCached { NSString* fullPath = [self fullImageBinaryPath]; diff --git a/MediaWikiKit/MediaWikiKit/MWKImageList.h b/MediaWikiKit/MediaWikiKit/MWKImageList.h index aba..9cd780a 100644 --- a/MediaWikiKit/MediaWikiKit/MWKImageList.h +++ b/MediaWikiKit/MediaWikiKit/MWKImageList.h @@ -54,6 +54,7 @@ * May be nil if none found. */ - (NSString*)largestImageVariant:(NSString*)image; +- (NSString*)smallestImageVariant:(NSString*)image; /** * Searches the receiver for a cached image variant matching @c sourceURL. @@ -61,6 +62,7 @@ * @see -largestImageVariantForURL:cachedOnly: */ - (MWKImage*)largestImageVariantForURL:(NSString*)sourceURL; +- (MWKImage*)smallestImageVariantForURL:(NSString*)sourceURL; /** * Find an image with the specified URL, optionally requiring it to be stored in the cache. @@ -70,6 +72,7 @@ * be cached. Otherwise @c nil if no matching, cached (if specified) entries are found. */ - (MWKImage*)largestImageVariantForURL:(NSString*)imageURL cachedOnly:(BOOL)cachedOnly; +- (MWKImage*)smallestImageVariantForURL:(NSString*)imageURL cachedOnly:(BOOL)cachedOnly; /** * Reduce the receiver by removing all but the largest variants of the contained images, preserving order. diff --git a/MediaWikiKit/MediaWikiKit/MWKImageList.m b/MediaWikiKit/MediaWikiKit/MWKImageList.m index 69aad9e..f2ae92a 100644 --- a/MediaWikiKit/MediaWikiKit/MWKImageList.m +++ b/MediaWikiKit/MediaWikiKit/MWKImageList.m @@ -121,6 +121,10 @@ return [self largestImageVariantForURL:imageURL].sourceURL; } +- (NSString*)smallestImageVariant:(NSString*)imageURL { +return [self smallestImageVariantForURL:imageURL].sourceURL; +} + - (MWKImage*)largestImageVariantForURL:(NSString*)imageURL cachedOnly:(BOOL)cachedOnly { NSArray* arr = [self imageSizeVariants:imageURL]; for (NSString* variantURL in [arr reverseObjectEnumerator]) { @@ -132,10 +136,25 @@ return nil; } +- (MWKImage*)smallestImageVariantForURL:(NSString*)imageURL cachedOnly:(BOOL)cachedOnly { +NSArray* arr = [self imageSizeVariants:imageURL]; +for (NSString* variantURL in arr) { +MWKImage* image = [self.article imageWithURL:variantURL]; +if (!cachedOnly || image.isCached) { +return image; +} +} +return nil; +} + - (MWKImage*)largestImageVariantForURL:(NSString*)imageURL { return [self largestImageVariantForURL:imageURL cachedOnly:YES]; } +- (MWKImage*)smallestImageVariantForURL:(NSString*)imageURL { +return [self smallestImageVariantForURL:imageURL cachedOnly:YES]; +} + - (NSUInteger)indexOfImage:(MWKImage*)image { return [entries indexOfObject:image.sourceURL]; } diff --git a/Wikipedia/View Controllers/History/HistoryViewController.m b/Wikipedia/View Controllers/History/HistoryViewController.m index ea30cd2..b24e797 100644 --- a/Wikipedia/View Controllers/History/HistoryViewController.m +++ b/Wikip
[MediaWiki-commits] [Gerrit] readme: update to be more user-friendly - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: readme: update to be more user-friendly .. readme: update to be more user-friendly Lots of project dependencies were removed by prior commits. These changes reflect the new, streamlined workflow and the fact that devs should now be able to simply clone and run the project. Also, broke out lots of information to separate files in the "docs" folder to make the README leaner. Change-Id: I33df4b6b2917063e6e78b228c2f29e901eb153fa --- M Makefile M README.md A docs/cont-integration.md A docs/web-dev.md A docs/working-with-cocoapods.md A docs/working-with-ruby.md 6 files changed, 110 insertions(+), 93 deletions(-) Approvals: Mhurd: Looks good to me, approved jenkins-bot: Verified diff --git a/Makefile b/Makefile index 7d4142f..7e3862f 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,9 @@ #! get-homebrew: ##Install Homebrew using the bootstrapping script from http://brew.sh - @if [[ ! $$(brew -v 2>/dev/null) =~ "Homebrew" ]]; then \ + @if [[ $$(brew -v 2>/dev/null) =~ "Homebrew" ]]; then \ + echo "Homebrew already installed!"; \ + else \ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; \ fi @@ -108,34 +110,20 @@ #! Web dependency management #! -web: ##Make web assets -web: css grunt - -CSS_ORIGIN = http://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&lang=en&only=styles&skin=vector&modules= +CSS_ORIGIN = "http://bits.wikimedia.org/en.wikipedia.org/load.php?debug=false&lang=en&only=styles&skin=vector&modules="; WEB_ASSETS_DIR = "Wikipedia/assets" -define get_css_module -curl -s -L -o -endef +cd "Wikipedia/assets/" && { +curl -L -f -o 'styles.css' "${PREFIX}mobile.app.pagestyles.ios" +curl -L -f -o 'abusefilter.css' "${PREFIX}mobile.app.pagestyles.ios" +curl -L -f -o 'preview.css' "${PREFIX}mobile.app.preview" +} -css: ##Download latest stylesheets - @echo "Downloading CSS assets..."; \ - mkdir -p $(WEB_ASSETS_DIR); \ - cd $(WEB_ASSETS_DIR); \ - $(get_css_module) 'styles.css' "$(CSS_ORIGIN)mobile.app.pagestyles.ios" > /dev/null; \ - $(get_css_module) 'abusefilter.css' "$(CSS_ORIGIN)mobile.app.pagestyles.ios" > /dev/null; \ - $(get_css_module) 'preview.css' "$(CSS_ORIGIN)mobile.app.preview" > /dev/null NODE_VERSION = "$(shell node -v 2>/dev/null)" NPM_VERSION = "$(shell npm -version 2>/dev/null)" -grunt: ##Run grunt -grunt: npm - @cd www && grunt && cd .. - -npm: ##Install Javascript dependencies -npm: node-check - @cd www && npm install && cd .. +npm: ##TODO, run npm install get-node: ##Install node via Homebrew brew install node diff --git a/README.md b/README.md index e43452d..676aa58 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ -Wikipedia for iOS -- +# Wikipedia iOS +The official Wikipedia iOS client. -# Meta * OS target: iOS 6.0 or higher * Device target: iPhone, iPod, iPad * License: MIT-style @@ -14,88 +13,61 @@ * IRC chat: #wikimedia-mobile on irc.freenode.net * Team page: https://www.mediawiki.org/wiki/Wikimedia_Apps/Team/iOS -# Setup -Because of the nature of the project (read: lots of HTML), we have several layers of dependencies. Having said that, we have automated much of the setup so it's not too bad to set the project up and start contributing. +## Development Team +The app is primarily being developed by the Wikimedia Foundation's [Mobile Apps team](https://www.mediawiki.org/wiki/Wikimedia_Apps/Team). This README provides high-level guidelines for getting started with the project. If you have any questions, comments, or issues, the easiest way to talk to us is joining the #wikimedia-mobile channel on the freenode IRC server during Eastern and Pacific business hours. We'll also gladly accept any tickets filed against the [project in Phabricator](https://phabricator.wikimedia.org/project/profile/782/). -Specifically, many tasks have been implemented in the `Makefile`. Run `make` or `make help` to see a list of available tasks (or targets). For instance, simply run `make build-sim` to see if your machine is setup and ready to go. +## Building and Running +This project requires [Xcode 6](https://itunes.apple.com/us/app/xcode/id497799835) or higher. The easiest way to get it is from the [App Store](https://itunes.apple.com/us/app/xcode/id497799835?mt=12), but you can also download it from [developer.apple.com](https://developer.apple.com/) if you have an AppleID registered with an Apple developer account. -Read on to get started… +Once you have Xcode, you should be able to open `Wikipedia.xcworkspace` and run the app on the iOS Simulator (using the **Wikipedia** scheme and target). If you encounter any issues, please don't hesitate to let us know via a bug report or bugging us on IRC
[MediaWiki-commits] [Gerrit] makefile: add "easy button" to install dependencies - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: makefile: add "easy button" to install dependencies .. makefile: add "easy button" to install dependencies - Add "brew-install" goal which installs packages via Homebrew - Added separate "get-*" goals for installing larger items like: - Xcode CL Tools - Homebrew - Node - Ruby - Bundler - Reintroduced "get-deps" goal for devs who are starting from scratch - Bonus: added a "verify" goal which lints, analyzes, and tests Bug: T94229 Change-Id: Ib3b0b480e3b21a812dd464fc8b775b729677ca04 --- M Makefile 1 file changed, 74 insertions(+), 21 deletions(-) Approvals: Fjalapeno: Looks good to me, but someone else must approve Mhurd: Looks good to me, approved diff --git a/Makefile b/Makefile index 7714562..87df394 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ XCODE_VERSION = "$(shell xcodebuild -version 2>/dev/null)" XC_WORKSPACE = Wikipedia.xcworkspace +XC_PROJECT = Wikipedia.xcodeproj XCODEBUILD_BASE_ARGS = -workspace $(XC_WORKSPACE) XC_DEFAULT_SCHEME = Wikipedia @@ -7,52 +8,93 @@ @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' clean: ##Clean the Xcode workspace +clean: xcode-cltools-check xcodebuild clean $(XCODEBUILD_BASE_ARGS) -scheme $(XC_DEFAULT_SCHEME) build: ##Fetch code dependencies and build the app for release -build: +build: xcode-cltools-check xcodebuild build $(XCODEBUILD_BASE_ARGS) \ -scheme $(XC_DEFAULT_SCHEME) \ -sdk iphoneos \ -configuration Release build-sim: ##Fetch code dependencies and build the app for debugging in the simulator -build-sim: +build-sim: xcode-cltools-check xcodebuild build $(XCODEBUILD_BASE_ARGS) \ -scheme $(XC_DEFAULT_SCHEME) \ -sdk iphonesimulator \ -configuration Debug +# Only use the project, not workspace during analyze to prevent analysis of the Pods +analyze: ##Run static analysis +analyze: xcode-cltools-check + xcodebuild analyze -project $(XC_PROJECT) \ + -sdk iphonesimulator \ + -target Wikipedia + test: ##Fetch code dependencies and run tests -test: +test: xcode-cltools-check xcodebuild test $(XCODEBUILD_BASE_ARGS) \ -scheme $(XC_DEFAULT_SCHEME) \ -sdk iphonesimulator +verify: ##Lint, anaylze, and run tests +verify: lint analyze test + lint: ##Lint the native code, requires uncrustify +lint: @scripts/uncrustify_all.sh check-deps: ##Make sure system prerequisites are installed -check-deps: xcode-cltools exec-deps node bundler +check-deps: xcode-cltools-check exec-check node-check + +bootstrap: ##Only recommended if starting from scratch! Attempts to install all dependencies (Xcode command-line tools Homebrew, Ruby, Node, Bundler, etc...) +bootstrap: get-xcode-cltools get-homebrew get-node get-bundler brew-install bundle-install #! #! Xcode dependencies #! -xcode-cltools: ##Make sure proper Xcode & command line tools are installed +# Required so we (and other tools) can use command line tools, e.g. xcodebuild. +xcode-cltools-check: ##Make sure proper Xcode & command line tools are installed @case $(XCODE_VERSION) in \ "Xcode 6"*) echo "Xcode 6 or higher is installed with command line tools!" ;; \ *) echo "Missing Xcode 6 or higher and/or the command line tools."; exit 1;; \ esac +get-xcode-cltools: ##Install Xcode command-line tools + xcode-select --install + #! #! Executable dependencies #! -# Append additional dependencies as quoted strings (i.e. EXEC_DEPS = "dep1" "dep2" ...) -EXEC_DEPS = "uncrustify" "convert" "gs" +get-homebrew: ##Install Homebrew using the bootstrapping script from http://brew.sh + @if [[ ! $$(brew -v 2>/dev/null) =~ "Homebrew" ]]; then \ + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; \ + fi -exec-deps: ##Check that executable dependencies are installed +brew-check: ##Check that Homebrew is installed + @if [[ $$(brew -v 2>/dev/null) =~ "Homebrew" ]]; then \ + echo "Homebrew is installed!"; \ + else \ + echo "Please setup Homebrew by running `make get-homebrew` or following instructions on http://brew.sh/";; \ + exit 1; \ + fi + +# Append additional dependencies as quoted strings (i.e. BREW_FORMULAE = "f1" "f2" ...) +BREW_FORMULAE = "uncrustify" "imagemagick" "gs" "xctool" + +brew-install: ##Install executable dependencies via Homebrew +brew-install: brew-check + brew install $(BREW_FORMULAE) + +# Append additional dependencies as quoted strings (i.e. EXEC_DEPS = "dep1" "dep2" ...) +EXEC_DEPS = "uncrustify" "convert" "gs" "xctool" + +# Note: checking for specific executables i
[MediaWiki-commits] [Gerrit] commit Pods folder - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: commit Pods folder .. commit Pods folder Commits the "Pods" folder, which removes bundler & cocoapods as build dependencies. This means the "get-deps" task doesn't do anything (as we don't have any deps that we're installing—as npm/node aren't easily installable). Bug: T94039 Change-Id: I3a52b2bb4d44beaa6979e0295247c0bd31099eb7 --- M .gitignore M Makefile A Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h A Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m A Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.h A Pods/AFNetworking/AFNetworking/AFHTTPRequestOperationManager.m A Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h A Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m A Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h A Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m A Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h A Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m A Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h A Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m A Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h A Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m A Pods/AFNetworking/LICENSE A Pods/AFNetworking/README.md A Pods/BlocksKit/BlocksKit/BlocksKit.h A Pods/BlocksKit/BlocksKit/Core/BKMacros.h A Pods/BlocksKit/BlocksKit/Core/NSArray+BlocksKit.h A Pods/BlocksKit/BlocksKit/Core/NSArray+BlocksKit.m A Pods/BlocksKit/BlocksKit/Core/NSDictionary+BlocksKit.h A Pods/BlocksKit/BlocksKit/Core/NSDictionary+BlocksKit.m A Pods/BlocksKit/BlocksKit/Core/NSIndexSet+BlocksKit.h A Pods/BlocksKit/BlocksKit/Core/NSIndexSet+BlocksKit.m A Pods/BlocksKit/BlocksKit/Core/NSInvocation+BlocksKit.h A Pods/BlocksKit/BlocksKit/Core/NSInvocation+BlocksKit.m A Pods/BlocksKit/BlocksKit/Core/NSMutableArray+BlocksKit.h A Pods/BlocksKit/BlocksKit/Core/NSMutableArray+BlocksKit.m A Pods/BlocksKit/BlocksKit/Core/NSMutableDictionary+BlocksKit.h A Pods/BlocksKit/BlocksKit/Core/NSMutableDictionary+BlocksKit.m A Pods/BlocksKit/BlocksKit/Core/NSMutableIndexSet+BlocksKit.h A Pods/BlocksKit/BlocksKit/Core/NSMutableIndexSet+BlocksKit.m A Pods/BlocksKit/BlocksKit/Core/NSMutableOrderedSet+BlocksKit.h A Pods/BlocksKit/BlocksKit/Core/NSMutableOrderedSet+BlocksKit.m A Pods/BlocksKit/BlocksKit/Core/NSMutableSet+BlocksKit.h A Pods/BlocksKit/BlocksKit/Core/NSMutableSet+BlocksKit.m A Pods/BlocksKit/BlocksKit/Core/NSObject+BKAssociatedObjects.h A Pods/BlocksKit/BlocksKit/Core/NSObject+BKAssociatedObjects.m A Pods/BlocksKit/BlocksKit/Core/NSObject+BKBlockExecution.h A Pods/BlocksKit/BlocksKit/Core/NSObject+BKBlockExecution.m A Pods/BlocksKit/BlocksKit/Core/NSObject+BKBlockObservation.h A Pods/BlocksKit/BlocksKit/Core/NSObject+BKBlockObservation.m A Pods/BlocksKit/BlocksKit/Core/NSOrderedSet+BlocksKit.h A Pods/BlocksKit/BlocksKit/Core/NSOrderedSet+BlocksKit.m A Pods/BlocksKit/BlocksKit/Core/NSSet+BlocksKit.h A Pods/BlocksKit/BlocksKit/Core/NSSet+BlocksKit.m A Pods/BlocksKit/BlocksKit/Core/NSTimer+BlocksKit.h A Pods/BlocksKit/BlocksKit/Core/NSTimer+BlocksKit.m A Pods/BlocksKit/LICENSE A Pods/BlocksKit/README.md A Pods/Headers/Private/AFNetworking/AFHTTPRequestOperation.h A Pods/Headers/Private/AFNetworking/AFHTTPRequestOperationManager.h A Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h A Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h A Pods/Headers/Private/AFNetworking/AFURLConnectionOperation.h A Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h A Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h A Pods/Headers/Private/BlocksKit/BKMacros.h A Pods/Headers/Private/BlocksKit/BlocksKit.h A Pods/Headers/Private/BlocksKit/NSArray+BlocksKit.h A Pods/Headers/Private/BlocksKit/NSDictionary+BlocksKit.h A Pods/Headers/Private/BlocksKit/NSIndexSet+BlocksKit.h A Pods/Headers/Private/BlocksKit/NSInvocation+BlocksKit.h A Pods/Headers/Private/BlocksKit/NSMutableArray+BlocksKit.h A Pods/Headers/Private/BlocksKit/NSMutableDictionary+BlocksKit.h A Pods/Headers/Private/BlocksKit/NSMutableIndexSet+BlocksKit.h A Pods/Headers/Private/BlocksKit/NSMutableOrderedSet+BlocksKit.h A Pods/Headers/Private/BlocksKit/NSMutableSet+BlocksKit.h A Pods/Headers/Private/BlocksKit/NSObject+BKAssociatedObjects.h A Pods/Headers/Private/BlocksKit/NSObject+BKBlockExecution.h A Pods/Headers/Private/BlocksKit/NSObject+BKBlockObservation.h A Pods/Headers/Private/BlocksKit/NSOrderedSet+BlocksKit.h A Pods/Headers/Private/BlocksKit/NSSet+BlocksKit.h A Pods/Headers/Private/BlocksKit/NSTimer+BlocksKit.h A Pods/Headers/Private/HockeySDK/BITActivityIndicatorButton.h A Pods/Headers/Private/HockeySDK/BITAppStoreHeader.h A Pods/Headers/Private/HockeySDK/BITAppVersionMetaInfo.h A Pods/Headers/Private/HockeySDK/BITArrowImageAnnotation.h A Pods/Headers/Private/HockeySDK/BITAttributedLabel.h A Pods/Headers/Priva
[MediaWiki-commits] [Gerrit] fix pod install warnings - change (apps...wikipedia)
Mhurd has submitted this change and it was merged. Change subject: fix pod install warnings .. fix pod install warnings Running pod install was resulting in warnings about unknown UUIDs (which is usually the result of a merge conflict resolution). This should fix it w/o impacting the project. Change-Id: I1b509e647fd5651a49521de7b1d8474b7f321137 --- M Wikipedia.xcodeproj/project.pbxproj 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Fjalapeno: Looks good to me, but someone else must approve Mhurd: Looks good to me, approved jenkins-bot: Verified diff --git a/Wikipedia.xcodeproj/project.pbxproj b/Wikipedia.xcodeproj/project.pbxproj index 28ef1d6..e6f55e2 100644 --- a/Wikipedia.xcodeproj/project.pbxproj +++ b/Wikipedia.xcodeproj/project.pbxproj @@ -2993,8 +2993,8 @@ BC0FED6C1AAA0268002488D7 /* MWKImageStorageTests.m in Sources */, BC0FED721AAA026C002488D7 /* WMFErrorForApiErrorObjectTests.m in Sources */, BCA6765A1AC0600500A16160 /* MWKDataStore+TemporaryDataStore.m in Sources */, - 04D686CA1AB28FE40009B44A /* UIImage+WMFFocalImageDrawing.m in Sources */, - 04D686FF1AB2949C0009B44A /* WikiGlyphLabel.m in Sources */, + + 04F122671ACB818F002FC3B5 /* NSString+FormattedAttributedString.m in Sources */, BC0FED711AAA026C002488D7 /* WMFJoinedPropertyParametersTests.m in Sources */, BC0FED6A1AAA0268002488D7 /* MWKDataStorePathTests.m in Sources */, -- To view, visit https://gerrit.wikimedia.org/r/202037 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1b509e647fd5651a49521de7b1d8474b7f321137 Gerrit-PatchSet: 2 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Bgerstle Gerrit-Reviewer: Dr0ptp4kt Gerrit-Reviewer: Fjalapeno Gerrit-Reviewer: Mhurd Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits