Skip to content

Commit

Permalink
Merge branch '1.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Li committed Jul 8, 2016
2 parents f9634f6 + d0f9c27 commit 944fb8e
Show file tree
Hide file tree
Showing 112 changed files with 4,274 additions and 1,543 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

*.xcuserstate
Kiwix/libkiwix
Pods
Pods
Kiwix/libkiwix/C&C++
Kiwix/libkiwix/include
Kiwix/libkiwix/shared
Kiwix/libkiwix/static
16 changes: 16 additions & 0 deletions AppStore/ReleaseNote.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### 1.6
New

- Table of content
- Recent searches
- Search system: now fetch result from both title search and index search and use a new ranking system to sort them
- Enhanced layout javascript on iPhone
- Use SafariViewController to handle external links
- Access download.kiwix.org using https
- Enhanced Search UI on iPad and iPhone 6/6s Plus (landscape)

Fixed

- Downloading / paused book no longer got purged when they are removed from online library
- Removed code that mistakenly indicates app use Wallet
- Open main page when first book finish downloaded
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.
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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions BoostFactorTune.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
boost_factor <- function(base,m,n, x) {
return(log(m*(1-x)+n, base=base))
}

base=exp(1)

# y1 is the weight when xapian prob is 100%
y1=0.8

# X2 is the xapian prob we want the boost factor to be 1
x2=0.75

n=base^y1
m=(base^1-n)/(1-x2)
boost_factor(base, m, n, 0)

sprintf('%.10f',m)
sprintf('%.10f',n)
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## [1.6.0] - 2016-07-07
### New
- show recent search terms
- search system now fetch result from both title search and index search and use a new ranking system to sort them
- table of content
- enhanced layout javascript on iPhone
- Use SafariViewController to handle external links
- access download.kiwix.org using https
- enhanced UI when hSizeClass is regular

### Fixed
- downloading / paused book purged when they are removed from online library
- removed code that mistakenly indicates app use Wallet
- open main page when first book finish downloaded
2 changes: 1 addition & 1 deletion Kiwix-OSX/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>148</string>
<string>149</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.reference</string>
<key>LSMinimumSystemVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"idiom" : "universal",
"filename" : "wikipedia5.png",
"filename" : "success.png",
"scale" : "3x"
}
],
Expand Down
21 changes: 21 additions & 0 deletions Kiwix-iOS/Assets.xcassets/CheckBlue.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "success-1.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
21 changes: 21 additions & 0 deletions Kiwix-iOS/Assets.xcassets/CloudRound.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "cloud.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
21 changes: 21 additions & 0 deletions Kiwix-iOS/Assets.xcassets/Compass.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "compass.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
21 changes: 21 additions & 0 deletions Kiwix-iOS/Assets.xcassets/Cross.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "multiply.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
21 changes: 21 additions & 0 deletions Kiwix-iOS/Assets.xcassets/GeoPinRound.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "placeholder.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
21 changes: 21 additions & 0 deletions Kiwix-iOS/Assets.xcassets/SearchRound.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "magnifying-glass.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
21 changes: 21 additions & 0 deletions Kiwix-iOS/Assets.xcassets/TableOfContent.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "list-1.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
21 changes: 21 additions & 0 deletions Kiwix-iOS/Assets.xcassets/USBRound.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "usb-cable.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Diff not rendered.
22 changes: 0 additions & 22 deletions Kiwix-iOS/Controller/AboutVC.swift

This file was deleted.

34 changes: 17 additions & 17 deletions Kiwix-iOS/Controller/LibraryDownloadTBVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit
import CoreData
import DZNEmptyDataSet

class LibraryDownloadTBVC: UITableViewController, NSFetchedResultsControllerDelegate, BookTableCellDelegate, DownloadProgressReporting, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate {
class LibraryDownloadTBVC: UITableViewController, NSFetchedResultsControllerDelegate, TableCellDelegate, DownloadProgressReporting, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate {

// MARK: - Override

Expand Down Expand Up @@ -38,25 +38,27 @@ class LibraryDownloadTBVC: UITableViewController, NSFetchedResultsControllerDele
Network.sharedInstance.delegate = nil
}

// MARK: - BookTableCellDelegate
// MARK: - TableCellDelegate

func didTapOnAccessoryViewForCell(cell: BookTableCell) {
func didTapOnAccessoryViewForCell(cell: UITableViewCell) {
guard let indexPath = tableView.indexPathForCell(cell),
let downloadTask = fetchedResultController.objectAtIndexPath(indexPath) as? DownloadTask,
let book = downloadTask.book else {return}
switch downloadTask.state {
case .Downloading:
case .Downloading, .Queued:
Network.sharedInstance.pause(book)
case .Paused, .Error:
Network.sharedInstance.resume(book)
default:
break
}
}

// MARK: - DownloadProgressReporting

func refreshProgress(animated animated: Bool) {
func refreshProgress() {
refreshProgress(animated: true)
}

private func refreshProgress(animated animated: Bool) {
guard let downloadTasks = fetchedResultController.fetchedObjects as? [DownloadTask] else {return}
for downloadTask in downloadTasks {
guard let id = downloadTask.book?.id,
Expand Down Expand Up @@ -139,10 +141,8 @@ class LibraryDownloadTBVC: UITableViewController, NSFetchedResultsControllerDele
}

func emptyDataSetDidTapButton(scrollView: UIScrollView!) {
guard let navController = UIStoryboard.setting.instantiateViewControllerWithIdentifier("WebViewNav") as? UINavigationController,
let controller = navController.topViewController as? WebViewVC else {return}
controller.page = .DownloaderLearnMore
presentViewController(navController, animated: true, completion: nil)
let operation = ShowHelpPageOperation(type: .DownloaderLearnMore, presentationContext: self)
GlobalOperationQueue.sharedInstance.addOperation(operation)
}

// MARK: - TableView Data Source
Expand Down Expand Up @@ -229,14 +229,14 @@ class LibraryDownloadTBVC: UITableViewController, NSFetchedResultsControllerDele

override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? {
let remove = UITableViewRowAction(style: .Destructive, title: LocalizedStrings.remove) { (action, indexPath) -> Void in
guard let downloadTask = self.fetchedResultController.objectAtIndexPath(indexPath) as? DownloadTask,
let book = downloadTask.book else {return}
Network.sharedInstance.cancel(book)
book.isLocal = false
FileManager.removeResumeData(book)
guard let downloadTask = self.fetchedResultController.objectAtIndexPath(indexPath) as? DownloadTask else {return}
let context = UIApplication.appDelegate.managedObjectContext
if let book = downloadTask.book {
Network.sharedInstance.cancel(book)
FileManager.removeResumeData(book)
}
context.performBlockAndWait({ () -> Void in
book.isLocal = false
downloadTask.book?.isLocal = false
context.deleteObject(downloadTask)
})
}
Expand Down
6 changes: 3 additions & 3 deletions Kiwix-iOS/Controller/LibraryOnlineTBVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import CoreData
import DZNEmptyDataSet
import DateTools

class LibraryOnlineTBVC: UITableViewController, NSFetchedResultsControllerDelegate, BookTableCellDelegate, LTBarButtonItemDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate {
class LibraryOnlineTBVC: UITableViewController, NSFetchedResultsControllerDelegate, TableCellDelegate, LTBarButtonItemDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate {

var booksShowingDetail = Set<Book>()
var messsageLabelRefreshTimer: NSTimer?
Expand Down Expand Up @@ -44,9 +44,9 @@ class LibraryOnlineTBVC: UITableViewController, NSFetchedResultsControllerDelega
}


// MARK: - BookTableCellDelegate
// MARK: - TableCellDelegate

func didTapOnAccessoryViewForCell(cell: BookTableCell) {
func didTapOnAccessoryViewForCell(cell: UITableViewCell) {
guard let indexPath = tableView.indexPathForCell(cell),
let book = fetchedResultController.objectAtIndexPath(indexPath) as? Book else {return}
switch book.spaceState {
Expand Down
Loading

0 comments on commit 944fb8e

Please sign in to comment.