-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the right one Selecting multiple sessions now displays a different context menu, with the ability to merge those sessions
- Loading branch information
1 parent
bd0dcae
commit 7a08173
Showing
11 changed files
with
105 additions
and
19 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
Sessions Extension/Images/Media.xcassets/icons8-merge.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "icons8-merge-2.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "icons8-merge-1.png", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "icons8-merge.png", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+403 Bytes
Sessions Extension/Images/Media.xcassets/icons8-merge.imageset/icons8-merge-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+908 Bytes
Sessions Extension/Images/Media.xcassets/icons8-merge.imageset/icons8-merge-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+500 Bytes
Sessions Extension/Images/Media.xcassets/icons8-merge.imageset/icons8-merge.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
Sessions Extension/SafariExtensionViewController/SafariExtensionViewControllerMerge.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// SafariExtensionViewControllerMerge.swift | ||
// Sessions Extension | ||
// | ||
// Created by Alex Perathoner on 28/02/2021. | ||
// Copyright © 2021 Alex Perathoner. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
extension SafariExtensionViewController { | ||
|
||
func merge(s: [Session]) -> Session { | ||
var sessions = s | ||
let firstSess = sessions.removeFirst() | ||
var urls: [URL] = [] | ||
for page in firstSess.pages { | ||
urls.append(page.url) | ||
} | ||
for item in sessions { | ||
for page in item.pages { | ||
if(!urls.contains(page.url)) { | ||
firstSess.pages.append(page) | ||
} | ||
} | ||
} | ||
return firstSess | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters