Skip to content

Commit

Permalink
Merge pull request #95 from wallabag/2.1-dev
Browse files Browse the repository at this point in the history
2.1 release
  • Loading branch information
bourvill authored Jun 21, 2017
2 parents e698b05 + 069b415 commit dedc67f
Show file tree
Hide file tree
Showing 52 changed files with 893 additions and 121 deletions.
9 changes: 4 additions & 5 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
excluded:
- Pods
- wallabag/Model/Server.swift
- wallabag/Lib/CoreData.swift
- wallabag/Entr*.swift
- wallabag/Entry+CoreDataProperties.swift
- wallabag/Entry+CoreDataClass.swift
- wallabag/Lib/CoreData.swift
- wallabag/Entity/Entry+CoreDataProperties.swift
- wallabag/Entity/Entry+CoreDataClass.swift
line_length: 300
variable_name:
identifier_name:
excluded:
- id
- to
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ matrix:
- osx_image: xcode8.3
env: SDK="iphonesimulator10.3" DESTINATION="name=iPhone 6s,OS=9.0"
- osx_image: xcode8.3
env: SDK="iphonesimulator10.3" DESTINATION="name=iPhone 6s,OS=10.3"
env: SDK="iphonesimulator10.3" DESTINATION="name=iPhone 6s,OS=10.3.1"
env:
global:
- WORKSPACE=wallabag.xcworkspace
Expand Down
4 changes: 2 additions & 2 deletions bagit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>2.0.0</string>
<string>2.1.0</string>
<key>CFBundleVersion</key>
<string>54</string>
<string>57</string>
<key>ITSEncryptionExportComplianceCode</key>
<string></string>
<key>NSAppTransportSecurity</key>
Expand Down
5 changes: 5 additions & 0 deletions fastlane/metadata/de-DE/description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
wallabag, eine selbst-gehostete Anwendung für das Speichern von Webseiten

Im Vergleich zu anderen Diensten ist wallabag frei (wie in Freiheit) und Open-Source.

Damit diese App genutzt werden kann, benötigst du eine gehostete wallabag-Instanz. Du kannst wallabag entweder auf deinem Server installieren oder dich auf wallabag.it oder framabag.org registrieren.
1 change: 1 addition & 0 deletions fastlane/metadata/de-DE/keywords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wallabag, pocket, poche, später lesen, späterlesen, open-source
1 change: 1 addition & 0 deletions fastlane/metadata/de-DE/marketing_url.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions fastlane/metadata/de-DE/name.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wallabag 2 (offiziell)
1 change: 1 addition & 0 deletions fastlane/metadata/de-DE/privacy_url.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions fastlane/metadata/de-DE/promotional_text.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

9 changes: 9 additions & 0 deletions fastlane/metadata/de-DE/release_notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Hallo wallabag-Nutzer!
In diesem Update haben wir neue coole Features hinzugefügt:
- Leseposition zum Artikel wird gespeichert
- Artikel können direkt aus der Leseansicht hinzugefügt werden
- Oberes Menü kann beim Lesen versteckt werden
- Verzögerte Anmelde-Anforderung während der App-Konfiguration
- Französische und deutsche Übersetzung hinzugefügt

Nun kannst du auch den Entwickler belohnen, wann immer du möchtest.
1 change: 1 addition & 0 deletions fastlane/metadata/de-DE/support_url.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/wallabag/ios-app/issues
1 change: 1 addition & 0 deletions fastlane/metadata/en-US/promotional_text.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

12 changes: 8 additions & 4 deletions fastlane/metadata/en-US/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Welcome to the v2 version!
This release brings the offline mode.
And you can now look for articles into the application and from spotlight.
Hello wallabag user!
In this release we add some cool features:
- Save read position on an article
- You can now add an article from reading article page
- Hide top menu when you read an article
- We defer the request authorization for notification when your app is configured
- French and german translation

No more changes, but in this release, we cleaned lots of technical stuff.
Now you can reward the developer when ever you want.
1 change: 1 addition & 0 deletions fastlane/metadata/fr-FR/promotional_text.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

12 changes: 8 additions & 4 deletions fastlane/metadata/fr-FR/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Bienvenue en version 2.0 !
Cette version apporte le mode hors-ligne.
Et vous pouvez maintenant rechercher vos articles dans l'application et depuis spotlight.
Hello utilisateur de Wallabag!
Dans cette version, nous avons ajoutés quelques fonctionnalités intéressantes:
- Enregistrer la position de lecture sur un article
- Vous pouvez maintenant ajouter un article depuis la page de lecture
- Cacher le menu principal lorsque vous lisez un article
- Nous reportons l'autorisation de la demande pour la notification lorsque votre application est configurée
- traduction française et allemande

Cela fait peu de nouveautés, mais nous avons profité de la 2.0 pour nettoyer beaucoup de code.
Maintenant, vous pouvez récompenser le développeur quand vous voulez.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 69 additions & 20 deletions wallabag.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions wallabag/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
window?.rootViewController = window?.rootViewController?.storyboard?.instantiateViewController(withIdentifier: "home")
} else {
log.info("Wallabag api is configured")
requestBadge()
updateBadge()
}

requestBadge()
updateBadge()

NetworkActivityIndicatorManager.shared.isEnabled = true
NetworkActivityIndicatorManager.shared.startDelay = 0.1

Expand Down Expand Up @@ -109,7 +108,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
private func updateBadge() {
if WallabagApi.isConfigured() {
let sync = ArticleSync()
//sync.sync()
sync.sync()
}
log.info("Update badge")
let request = Entry.fetchEntryRequest()
Expand Down
7 changes: 7 additions & 0 deletions wallabag/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
Localizable.strings
wallabag

Created by maxime marinel on 09/06/2017.
Copyright © 2017 maxime marinel. All rights reserved.
*/
3 changes: 2 additions & 1 deletion wallabag/Cell/ArticleTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class ArticleTableViewCell: ThemedTableViewCell {
}

starred.image = entry.is_starred ? #imageLiteral(resourceName: "starred") : #imageLiteral(resourceName: "unstarred")
readingTime.text = "Reading time \(Int(entry.reading_time).readingTime)"

readingTime.text = String(format: "Reading time %@".localized, arguments: [Int(entry.reading_time).readingTime])

guard let previewPicture = entry.preview_picture,
let pictureURL = URL(string: previewPicture) else {
Expand Down
2 changes: 1 addition & 1 deletion wallabag/Cell/ThemedTableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ThemedTableViewCell: UITableViewCell {

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
NotificationCenter.default.addObserver(forName: Notification.Name.themeUpdated, object: nil, queue: nil) { object in
NotificationCenter.default.addObserver(forName: Notification.Name.themeUpdated, object: nil, queue: nil) { _ in
self.setupTheme()
}

Expand Down
2 changes: 1 addition & 1 deletion wallabag/Controller/AboutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AboutViewController: UIViewController {
let version = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as? String ?? "0"
let build = Bundle.main.infoDictionary!["CFBundleVersion"] as? String ?? "0"

versionText.text = String(format: "Version %@ build %@", arguments: [version, build])
versionText.text = String(format: "Version %@ build %@".localized, arguments: [version, build])
}

}
29 changes: 29 additions & 0 deletions wallabag/Controller/ArticleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import WallabagKit

final class ArticleViewController: UIViewController {

var lastOffsetY: CGFloat = 0
var update: Bool = true
var entry: Entry! {
didSet {
Expand All @@ -22,11 +23,16 @@ final class ArticleViewController: UIViewController {
var deleteHandler: ((_ entry: Entry) -> Void)?
var readHandler: ((_ entry: Entry) -> Void)?
var starHandler: ((_ entry: Entry) -> Void)?
var addHandler: (() -> Void)?

@IBOutlet weak var contentWeb: UIWebView!
@IBOutlet weak var readButton: UIBarButtonItem!
@IBOutlet weak var starButton: UIBarButtonItem!

@IBAction func add(_ sender: Any) {
addHandler?()
}

@IBAction func read(_ sender: Any) {
readHandler?(entry)
_ = self.navigationController?.popViewController(animated: true)
Expand Down Expand Up @@ -65,7 +71,10 @@ final class ArticleViewController: UIViewController {
navigationItem.title = entry.title
updateUi()
loadArticleContent()
contentWeb.delegate = self
contentWeb.scrollView.delegate = self
contentWeb.backgroundColor = Setting.getTheme().backgroundColor
print(entry)
}

private func loadArticleContent() {
Expand All @@ -92,3 +101,23 @@ final class ArticleViewController: UIViewController {
starButton?.image = entry.is_starred ? #imageLiteral(resourceName: "starred") : #imageLiteral(resourceName: "unstarred")
}
}

extension ArticleViewController: UIWebViewDelegate {
func webViewDidFinishLoad(_ webView: UIWebView) {
webView.scrollView.setContentOffset(CGPoint(x: 0.0, y: Double(self.entry.screen_position)), animated: true)
}
}

extension ArticleViewController: UIScrollViewDelegate {
func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
lastOffsetY = scrollView.contentOffset.y
}

func scrollViewWillBeginDecelerating(_ scrollView: UIScrollView) {
let hide = scrollView.contentOffset.y > self.lastOffsetY
self.navigationController?.setNavigationBarHidden(hide, animated: true)
entry.screen_position = Float(scrollView.contentOffset.y)

CoreData.saveContext()
}
}
55 changes: 31 additions & 24 deletions wallabag/Controller/ArticlesTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import CoreData
import CoreSpotlight

final class ArticlesTableViewController: UITableViewController {

let sync = ArticleSync()
let searchController = UISearchController(searchResultsController: nil)

var page: Int = 2
var refreshing: Bool = false
var entries: [Entry] = []
var mode: Setting.RetrieveMode = Setting.getDefaultMode()

@IBOutlet weak var menu: UIBarButtonItem!
@IBOutlet weak var add: UIBarButtonItem!

Expand All @@ -43,23 +43,7 @@ final class ArticlesTableViewController: UITableViewController {
}

@IBAction func addLink(_ sender: UIBarButtonItem) {
let alertController = UIAlertController(title: "Add link", message: nil, preferredStyle: .alert)
alertController.addTextField(configurationHandler: { textField in
textField.placeholder = "Url"
})
alertController.addAction(UIAlertAction(title: "Add", style: .default, handler: { _ in
if let textfield = alertController.textFields?.first?.text {
if let url = URL(string: textfield) {
WallabagApi.addArticle(url) { article in
self.sync.insert(article)
self.tableView.reloadData()
}
}
}
}))
alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))

present(alertController, animated: true)
addArticle(self)
}

override func restoreUserActivityState(_ activity: NSUserActivity) {
Expand Down Expand Up @@ -93,7 +77,7 @@ final class ArticlesTableViewController: UITableViewController {
let titleLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 70, height: 44))
titleLabel.isUserInteractionEnabled = true
titleLabel.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.scrollTop)))
titleLabel.text = mode.humainReadable()
titleLabel.text = mode.humainReadable().localized
titleLabel.textColor = Setting.getTheme().color
navigationItem.titleView = titleLabel

Expand Down Expand Up @@ -126,7 +110,7 @@ final class ArticlesTableViewController: UITableViewController {
}

func managedObjectContextObjectsDidChange(notification: NSNotification) {
guard let _ = notification.userInfo else { return }
if notification.userInfo == nil { return }
log.debug("managedObjectContextObjectsDidChange")
handleRefresh()
}
Expand Down Expand Up @@ -184,18 +168,18 @@ final class ArticlesTableViewController: UITableViewController {

override func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
let entry = entries[indexPath.row]
let deleteAction = UITableViewRowAction(style: .destructive, title: "Delete", handler: { _, _ in
let deleteAction = UITableViewRowAction(style: .destructive, title: "Delete".localized, handler: { _, _ in
self.delete(entry)
})
deleteAction.backgroundColor = #colorLiteral(red: 1, green: 0.231372549, blue: 0.188235294, alpha: 1)

let starAction = UITableViewRowAction(style: .default, title: entry.is_starred ? "Unstar" : "Star", handler: { _, _ in
let starAction = UITableViewRowAction(style: .default, title: entry.is_starred ? "Unstar".localized : "Star".localized, handler: { _, _ in
self.tableView.setEditing(false, animated: true)
self.star(entry)
})
starAction.backgroundColor = #colorLiteral(red: 1, green: 0.584313725, blue: 0, alpha: 1)

let readAction = UITableViewRowAction(style: .default, title: entry.is_archived ? "Unread" : "Read", handler: { _, _ in
let readAction = UITableViewRowAction(style: .default, title: entry.is_archived ? "Unread".localized : "Read".localized, handler: { _, _ in
self.tableView.setEditing(false, animated: true)
self.read(entry)
})
Expand All @@ -217,6 +201,9 @@ final class ArticlesTableViewController: UITableViewController {
controller.deleteHandler = { entry in
self.delete(entry)
}
controller.addHandler = {
self.addArticle(controller)
}

if let cell = sender as? UITableViewCell {
let indexPath = tableView.indexPath(for: cell)
Expand Down Expand Up @@ -260,6 +247,26 @@ final class ArticlesTableViewController: UITableViewController {
} catch {
}
}

private func addArticle(_ fromController: UIViewController) {
let alertController = UIAlertController(title: "Add link".localized, message: nil, preferredStyle: .alert)
alertController.addTextField(configurationHandler: { textField in
textField.placeholder = "Url".localized
})
alertController.addAction(UIAlertAction(title: "Add".localized, style: .default, handler: { _ in
if let textfield = alertController.textFields?.first?.text {
if let url = URL(string: textfield) {
WallabagApi.addArticle(url) { article in
self.sync.insert(article)
self.tableView.reloadData()
}
}
}
}))
alertController.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: nil))

fromController.present(alertController, animated: true)
}
}

extension ArticlesTableViewController: UISearchResultsUpdating {
Expand Down
4 changes: 2 additions & 2 deletions wallabag/Controller/LoginViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ final class LoginViewController: UIViewController {
if success {
self.performSegue(withIdentifier: "toArticles", sender: nil)
} else {
let alert = UIAlertController(title: "Error", message: error, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
let alert = UIAlertController(title: "Error".localized, message: error, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: nil))
self.present(alert, animated: false)
}

Expand Down
8 changes: 6 additions & 2 deletions wallabag/Controller/ServerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ final class ServerViewController: UIViewController {
return true
}

let alertController = UIAlertController(title: "Error", message: "Whoops looks like something went wrong. Check the url, don't forget http or https", preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
let alertController = UIAlertController(
title: "Error".localized,
message: "Whoops looks like something went wrong. Check the url, don't forget http or https".localized,
preferredStyle: .alert
)
alertController.addAction(UIAlertAction(title: "Cancel".localized, style: .cancel, handler: nil))

present(alertController, animated: true, completion: nil)

Expand Down
Loading

0 comments on commit dedc67f

Please sign in to comment.