Skip to content

Commit

Permalink
Merge pull request #10 from SlayterDev/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
SlayterDev authored Nov 2, 2017
2 parents 8e2ec3d + c766886 commit dfcfa38
Show file tree
Hide file tree
Showing 21 changed files with 1,630 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: objective-c
xcode_workspace: RadiumBrowser.xcworkspace # path to your xcodeproj folder
xcode_scheme: RadiumBrowser
2 changes: 2 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def all_pods
pod 'Highlightr', :git => 'https://github.com/raspu/Highlightr.git'
# Event based actions
pod 'WaitForIt'
pod 'LUAutocompleteView'
pod 'GCDWebServer', '~> 3.0'

project 'RadiumBrowser.xcodeproj'

Expand Down
10 changes: 9 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
PODS:
- BSColorUtils (1.0.2)
- GCDWebServer (3.4.1):
- GCDWebServer/Core (= 3.4.1)
- GCDWebServer/Core (3.4.1)
- Highlightr (1.1.0)
- LUAutocompleteView (1.0.1)
- Realm (2.10.0):
- Realm/Headers (= 2.10.0)
- Realm/Headers (2.10.0)
Expand All @@ -15,7 +19,9 @@ PODS:

DEPENDENCIES:
- BSColorUtils (from `https://github.com/SlayterDev/BSColorUtils`)
- GCDWebServer (~> 3.0)
- Highlightr (from `https://github.com/raspu/Highlightr.git`)
- LUAutocompleteView
- RealmSwift (<= 2.10.0)
- SDWebImage (~> 3.8)
- SnapKit (<= 3.2.0)
Expand All @@ -38,14 +44,16 @@ CHECKOUT OPTIONS:

SPEC CHECKSUMS:
BSColorUtils: af322f5fae883bf102fcdf04afc26e56496e2829
GCDWebServer: 1db60034fe0e78a4a8524bd6c7cd97cd3c589870
Highlightr: 70c4df19e4aa55aa1b4387fb98182abce1dec9da
LUAutocompleteView: 1f2de4cac956348c30ad85c63f7b79bf3fa29915
Realm: 98b3a25643cf6b3e07d2b99fb43fe0eb9c801dec
RealmSwift: 34073ad3a31232bbaf7c0db898c037940284cba2
SDWebImage: 098e97e6176540799c27e804c96653ee0833d13c
SnapKit: 1ca44df72cfa543218d177cb8aab029d10d86ea7
Then: 823f9813e1d4d0a814a5ba15e9c9d33ec7aca631
WaitForIt: 5f85af0fece69b5f5a12df4de550cf7eb22664f1

PODFILE CHECKSUM: 8adcac7d12f713226e60db0678acc2e76e8f7271
PODFILE CHECKSUM: 670af733f592d98c8616649e48dde87f28ee55f5

COCOAPODS: 1.4.0.beta.1
36 changes: 36 additions & 0 deletions RadiumBrowser.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
41F8F7561E43CB4B00029B56 /* ExtensionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41F8F7551E43CB4B00029B56 /* ExtensionModel.swift */; };
D348888C4000EEE5E21DA85C /* Pods_RadiumBrowser.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A7223C7ED4906D838E566912 /* Pods_RadiumBrowser.framework */; };
E60641F31F7BDDFE00100DF1 /* AppReviewScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = E60641F21F7BDDFE00100DF1 /* AppReviewScenario.swift */; };
E60D52851FAA293B005AC5D1 /* OrderedSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = E60D52841FAA293B005AC5D1 /* OrderedSet.swift */; };
E60D52871FAA2CB8005AC5D1 /* AutocompleteTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E60D52861FAA2CB8005AC5D1 /* AutocompleteTableViewCell.swift */; };
E60D528B1FAA4F0B005AC5D1 /* WebServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = E60D528A1FAA4F0B005AC5D1 /* WebServer.swift */; };
E60D528F1FAB4984005AC5D1 /* SettingsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E60D528E1FAB4984005AC5D1 /* SettingsTableViewController.swift */; };
E635B6D41FAA026F004C27C0 /* topdomains.txt in Resources */ = {isa = PBXBuildFile; fileRef = E635B6D31FAA026F004C27C0 /* topdomains.txt */; };
E635B6D61FAA02C0004C27C0 /* SuggestionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E635B6D51FAA02C0004C27C0 /* SuggestionManager.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -109,6 +115,12 @@
A7223C7ED4906D838E566912 /* Pods_RadiumBrowser.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RadiumBrowser.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D65B6B0A501710052BE8EF87 /* Pods_RadiumBrowserTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RadiumBrowserTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E60641F21F7BDDFE00100DF1 /* AppReviewScenario.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppReviewScenario.swift; sourceTree = "<group>"; };
E60D52841FAA293B005AC5D1 /* OrderedSet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderedSet.swift; sourceTree = "<group>"; };
E60D52861FAA2CB8005AC5D1 /* AutocompleteTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutocompleteTableViewCell.swift; sourceTree = "<group>"; };
E60D528A1FAA4F0B005AC5D1 /* WebServer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebServer.swift; sourceTree = "<group>"; };
E60D528E1FAB4984005AC5D1 /* SettingsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsTableViewController.swift; sourceTree = "<group>"; };
E635B6D31FAA026F004C27C0 /* topdomains.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = topdomains.txt; sourceTree = "<group>"; };
E635B6D51FAA02C0004C27C0 /* SuggestionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionManager.swift; sourceTree = "<group>"; };
FB664E8EC27919571578F55A /* Pods_RadiumBrowserUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RadiumBrowserUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -143,6 +155,8 @@
children = (
02DF6C561E47AADA0088BDEB /* MigrationManager.swift */,
02DF6C591E47C15B0088BDEB /* WebViewManager.swift */,
E635B6D51FAA02C0004C27C0 /* SuggestionManager.swift */,
E60D528A1FAA4F0B005AC5D1 /* WebServer.swift */,
);
name = Singletons;
sourceTree = "<group>";
Expand Down Expand Up @@ -196,6 +210,7 @@
41F8F7571E48C3A400029B56 /* RadiumBrowser-Bridging-Header.h */,
41A567F21E40CB3B00470017 /* AppDelegate.swift */,
41DBC5F21E411C7A00913FAA /* SharedConfig.swift */,
E635B6D21FAA0245004C27C0 /* Assets */,
4163EDF61E4BB9AD00E02E65 /* Javascript Files */,
41F8F7541E43CB3500029B56 /* Models */,
4163EDF31E4BB89F00E02E65 /* Builtin Browser Extensions */,
Expand Down Expand Up @@ -235,6 +250,7 @@
02DF6C5F1E495CFB0088BDEB /* HistoryTableViewController.swift */,
02DF6C611E4BE83C0088BDEB /* BookmarkCollectionViewController.swift */,
4163EDFB1E4CA40E00E02E65 /* AddBookmarkTableViewController.swift */,
E60D528E1FAB4984005AC5D1 /* SettingsTableViewController.swift */,
);
name = Controllers;
sourceTree = "<group>";
Expand All @@ -258,6 +274,7 @@
023BB5871E42D3E0001498FA /* SharedDropdownMenu.swift */,
02DF6C631E4BEA820088BDEB /* BookmarkCollectionViewCell.swift */,
4163EDFD1E4CA48600E02E65 /* BookmarkTableViewCell.swift */,
E60D52861FAA2CB8005AC5D1 /* AutocompleteTableViewCell.swift */,
);
name = "Shared UI";
sourceTree = "<group>";
Expand All @@ -268,6 +285,7 @@
41DBC5FD1E412F0A00913FAA /* UIViewExtensions.swift */,
02A5CBE51E417F6400269FE6 /* StringExtensions.swift */,
02A5CBE71E41820000269FE6 /* UIImageExtensions.swift */,
E60D52841FAA293B005AC5D1 /* OrderedSet.swift */,
);
name = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -303,6 +321,14 @@
name = Pods;
sourceTree = "<group>";
};
E635B6D21FAA0245004C27C0 /* Assets */ = {
isa = PBXGroup;
children = (
E635B6D31FAA026F004C27C0 /* topdomains.txt */,
);
name = Assets;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -417,6 +443,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E635B6D41FAA026F004C27C0 /* topdomains.txt in Resources */,
02DF6C551E4795180088BDEB /* Main.storyboard in Resources */,
41A567FD1E40CB3B00470017 /* LaunchScreen.storyboard in Resources */,
41A567FA1E40CB3B00470017 /* Assets.xcassets in Resources */,
Expand Down Expand Up @@ -495,7 +522,9 @@
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-RadiumBrowser/Pods-RadiumBrowser-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/BSColorUtils/BSColorUtils.framework",
"${BUILT_PRODUCTS_DIR}/GCDWebServer/GCDWebServer.framework",
"${BUILT_PRODUCTS_DIR}/Highlightr/Highlightr.framework",
"${BUILT_PRODUCTS_DIR}/LUAutocompleteView/LUAutocompleteView.framework",
"${BUILT_PRODUCTS_DIR}/Realm/Realm.framework",
"${BUILT_PRODUCTS_DIR}/RealmSwift/RealmSwift.framework",
"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
Expand All @@ -506,7 +535,9 @@
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BSColorUtils.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GCDWebServer.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Highlightr.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LUAutocompleteView.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RealmSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
Expand All @@ -529,8 +560,11 @@
023BB5881E42D3E0001498FA /* SharedDropdownMenu.swift in Sources */,
41DBC5FA1E412C8400913FAA /* TabContainerView.swift in Sources */,
02DF6C641E4BEA820088BDEB /* BookmarkCollectionViewCell.swift in Sources */,
E635B6D61FAA02C0004C27C0 /* SuggestionManager.swift in Sources */,
02A5CBE81E41820000269FE6 /* UIImageExtensions.swift in Sources */,
41DBC5F51E41204300913FAA /* SharedTextField.swift in Sources */,
E60D528F1FAB4984005AC5D1 /* SettingsTableViewController.swift in Sources */,
E60D52851FAA293B005AC5D1 /* OrderedSet.swift in Sources */,
02A5CBE61E417F6400269FE6 /* StringExtensions.swift in Sources */,
02DF6C5E1E495C4E0088BDEB /* Bookmark.swift in Sources */,
4163EDFC1E4CA40E00E02E65 /* AddBookmarkTableViewController.swift in Sources */,
Expand All @@ -539,6 +573,7 @@
41DBC5FE1E412F0A00913FAA /* UIViewExtensions.swift in Sources */,
02DF6C601E495CFB0088BDEB /* HistoryTableViewController.swift in Sources */,
4163EDFE1E4CA48600E02E65 /* BookmarkTableViewCell.swift in Sources */,
E60D52871FAA2CB8005AC5D1 /* AutocompleteTableViewCell.swift in Sources */,
02A5CBE41E41652000269FE6 /* WebContainer.swift in Sources */,
02DF6C5C1E47CAC80088BDEB /* HistoryEntry.swift in Sources */,
02DF6C621E4BE83C0088BDEB /* BookmarkCollectionViewController.swift in Sources */,
Expand All @@ -555,6 +590,7 @@
41DBC5F31E411C7A00913FAA /* SharedConfig.swift in Sources */,
4163EDF51E4BB8F600E02E65 /* BuiltinExtension.swift in Sources */,
02DF6C531E478FE30088BDEB /* BrowsingSession.swift in Sources */,
E60D528B1FAA4F0B005AC5D1 /* WebServer.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
113 changes: 113 additions & 0 deletions RadiumBrowser.xcodeproj/xcshareddata/xcschemes/RadiumBrowser.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "41A567EE1E40CB3B00470017"
BuildableName = "RadiumBrowser.app"
BlueprintName = "RadiumBrowser"
ReferencedContainer = "container:RadiumBrowser.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "41A568021E40CB3B00470017"
BuildableName = "RadiumBrowserTests.xctest"
BlueprintName = "RadiumBrowserTests"
ReferencedContainer = "container:RadiumBrowser.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "41A5680D1E40CB3B00470017"
BuildableName = "RadiumBrowserUITests.xctest"
BlueprintName = "RadiumBrowserUITests"
ReferencedContainer = "container:RadiumBrowser.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "41A567EE1E40CB3B00470017"
BuildableName = "RadiumBrowser.app"
BlueprintName = "RadiumBrowser"
ReferencedContainer = "container:RadiumBrowser.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "41A567EE1E40CB3B00470017"
BuildableName = "RadiumBrowser.app"
BlueprintName = "RadiumBrowser"
ReferencedContainer = "container:RadiumBrowser.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "41A567EE1E40CB3B00470017"
BuildableName = "RadiumBrowser.app"
BlueprintName = "RadiumBrowser"
ReferencedContainer = "container:RadiumBrowser.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
8 changes: 8 additions & 0 deletions RadiumBrowser/AddressBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class AddressBar: UIView, UITextFieldDelegate {

if !addressField!.isFirstResponder {
addressField?.text = text
checkForLocalhost()
}
}

Expand All @@ -133,9 +134,16 @@ class AddressBar: UIView, UITextFieldDelegate {

if !addressField!.isFirstResponder {
addressField?.attributedText = text
checkForLocalhost()
}
}

func checkForLocalhost() {
if let address = addressField?.text, address.contains("localhost") {
addressField?.text = ""
}
}

// MARK: - Textfield Delegate

func textFieldShouldReturn(_ textField: UITextField) -> Bool {
Expand Down
12 changes: 12 additions & 0 deletions RadiumBrowser/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

MigrationManager.shared.attemptMigration()

WebServer.shared.startServer()

let defaults = UserDefaults.standard
if !defaults.bool(forKey: SettingsKeys.firstRun) {
defaults.set(true, forKey: SettingsKeys.firstRun)
performFirstRunTasks()
}

mainController = MainViewController()
self.window?.rootViewController = mainController
self.window?.makeKeyAndVisible()
Expand All @@ -45,6 +53,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return true
}

func performFirstRunTasks() {
UserDefaults.standard.set(true, forKey: SettingsKeys.trackHistory)
}

func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions
// (such as an incoming phone call or SMS message) or when the user quits the application and it begins the
Expand Down
33 changes: 33 additions & 0 deletions RadiumBrowser/AutocompleteTableViewCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// AutocompleteTableViewCell.swift
// RadiumBrowser
//
// Created by Bradley Slayter on 11/1/17.
// Copyright © 2017 bslayter. All rights reserved.
//

import UIKit
import LUAutocompleteView

class AutocompleteTableViewCell: LUAutocompleteTableViewCell {

override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: .subtitle, reuseIdentifier: reuseIdentifier)

detailTextLabel?.textColor = .gray
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func set(text: String) {
textLabel?.text = text
DispatchQueue.global().async {
let pageTitle = SuggestionManager.shared.pageTitle(forURLSring: text)
DispatchQueue.main.async {
self.detailTextLabel?.text = pageTitle
}
}
}
}
Loading

0 comments on commit dfcfa38

Please sign in to comment.