Skip to content

Commit

Permalink
Factoring
Browse files Browse the repository at this point in the history
  • Loading branch information
lfaoro committed Oct 18, 2015
1 parent b25fbea commit cfb46a4
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 28 deletions.
13 changes: 11 additions & 2 deletions AppStore/AppStoreDescription
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
- Improved code base
- Added the ethical and AdFree `is.gd` URL shortener
- Added `su.pr` StumbleUpon's URL shortener
- New feature: Drag & Drop
- New feature: Options menu
- New feature: Configurable services

Cast is an agent that lives in your system's Status Menu. Its purpose is to help you share information quick & easy.
Cast seamlessly integrates with GitHub.com and allows you to create and edit gists on the fly.
Cast is also a great URL shortener.
Expand All @@ -11,10 +18,12 @@ You may access a history of all your links from the Recent Actions drop-down men
+ Notifications
Every time you perform a Share or Shorten action a convenient Notification is displayed with details about your action, directly from the notification you may open and check your shortened link.

Coming Soon:
- Multiple Services Support
+ Multiple Services Support
You may choose different service providers from the Options panel and in case we don't yet support your favorite service, send us an support request: https://github.com/lfaoro/Cast/issues/new


Coming Soon:

- Custom Hotkey
You may define a hotkey to use for Sharing and one for Shortening in the Options panel.
The default hotkeys are: Share (CMD+SHIFT+C) - Short (CMD+ALT+C)
Expand Down
1 change: 0 additions & 1 deletion Cast/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
configureStatusBarItem(statusBarItem, target: menuSendersAction)

optionsWindowController = OptionsWindowController()
app.optionsWindowController.showWindow(nil)
}

func updateMenu() -> () {
Expand Down
7 changes: 6 additions & 1 deletion Cast/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>LSUIElement</key>
<false/>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015 Leonardo Faoro. All rights reserved.</string>
<key>NSMainStoryboardFile</key>
Expand All @@ -55,5 +55,10 @@
<string>NSApplication</string>
<key>NSUserNotificationAlertStyle</key>
<string>alert</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
54 changes: 34 additions & 20 deletions Cast/OptionsWindow.xib
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<customObject id="-2" userLabel="File's Owner" customClass="OptionsWindowController" customModule="Cast" customModuleProvider="target">
<connections>
<outlet property="loginButton" destination="KMY-an-eIk" id="yn0-Iz-HHd"/>
<outlet property="window" destination="9ry-9A-XBO" id="nFN-56-NcH"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
Expand Down Expand Up @@ -52,24 +53,6 @@
</segments>
</segmentedCell>
</segmentedControl>
<segmentedControl verticalHuggingPriority="750" fixedFrame="YES" springLoaded="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VAj-zk-07S">
<rect key="frame" x="15" y="29" width="153" height="24"/>
<animations/>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="g5k-Bl-XkO">
<font key="font" metaFont="system"/>
<segments>
<segment label="Is.Gd" selected="YES"/>
<segment label="Hive" tag="1"/>
<segment label="Bitly"/>
</segments>
<connections>
<action selector="urlShorteningOptionsControl:" target="-2" id="sQt-eS-Hgw"/>
</connections>
</segmentedCell>
<connections>
<binding destination="3sE-94-RU2" name="selectedLabel" keyPath="values.shortenService" id="rxm-4j-DkK"/>
</connections>
</segmentedControl>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Xby-8D-u7U">
<rect key="frame" x="15" y="60" width="521" height="17"/>
<animations/>
Expand Down Expand Up @@ -102,6 +85,25 @@
<binding destination="3sE-94-RU2" name="enabled" keyPath="values.secretGistsAvailable" id="9y6-h4-W6L"/>
</connections>
</button>
<segmentedControl verticalHuggingPriority="750" fixedFrame="YES" springLoaded="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VAj-zk-07S">
<rect key="frame" x="15" y="29" width="233" height="24"/>
<animations/>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="g5k-Bl-XkO">
<font key="font" metaFont="system"/>
<segments>
<segment label="Is.Gd" selected="YES"/>
<segment label="Hive.am" tag="1"/>
<segment label="Bit.ly"/>
<segment label="Su.Pr" enabled="NO"/>
</segments>
<connections>
<action selector="urlShorteningOptionsControl:" target="-2" id="sQt-eS-Hgw"/>
</connections>
</segmentedCell>
<connections>
<binding destination="3sE-94-RU2" name="selectedLabel" keyPath="values.shortenService" id="rxm-4j-DkK"/>
</connections>
</segmentedControl>
</subviews>
<animations/>
</view>
Expand All @@ -112,14 +114,25 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="SZp-x4-bQk">
<rect key="frame" x="134" y="87" width="393" height="36"/>
<rect key="frame" x="175" y="97" width="195" height="29"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Made with ❤️ by Leonardo Faoro" id="x1C-9c-xS9">
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Made with ❤️ by " id="x1C-9c-xS9">
<font key="font" metaFont="system" size="24"/>
<color key="textColor" red="0.15373500000000001" green="0.158026" blue="0.134656" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" springLoaded="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ec7-9T-JSw">
<rect key="frame" x="363" y="101" width="118" height="19"/>
<animations/>
<buttonCell key="cell" type="recessed" title="@leonarth" alternateTitle="Follow @leonarth on Twitter" bezelStyle="recessed" alignment="center" borderStyle="border" sound="Tink" inset="2" id="8ZH-3r-gFJ">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="systemBold" size="21"/>
</buttonCell>
<connections>
<action selector="openTwitterProfile:" target="-2" id="Red-Tr-g1Q"/>
</connections>
</button>
</subviews>
<animations/>
</view>
Expand All @@ -135,5 +148,6 @@
</objects>
<resources>
<sound name="Purr"/>
<sound name="Tink"/>
</resources>
</document>
6 changes: 6 additions & 0 deletions Cast/OptionsWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,11 @@ class OptionsWindowController: NSWindowController {


}

@IBAction func openTwitterProfile(sender: NSButton) {

NSWorkspace.sharedWorkspace().openURL(NSURL(string: "https://twitter.com/leonarth")!)
}

}

10 changes: 7 additions & 3 deletions Cast/ShortenClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,21 @@ public class ShortenClient {
URL.absoluteString)!
responseKey = "shorturl"

case "Hive":
self.shortenURL = NSURL(string: "https://hive.am/api?api=spublic&url=\(URL.absoluteString)" +
case "Hive.am":
shortenURL = NSURL(string: "https://hive.am/api?api=spublic&url=\(URL.absoluteString)" +
"&description=cast.lfaoro.com&type=DIRECT")!
responseKey = "short"

case "Bitly":
case "Bit.ly":
let bitlyAPIurl = "https://api-ssl.bitly.com"
let bitlyAPIshorten = bitlyAPIurl + "/v3/shorten?access_token=" + bitlyOAuth2Token +
"&longUrl=" + URL.relativeString!
shortenURL = NSURL(string: bitlyAPIshorten)!

case "Su.Pr":
shortenURL = NSURL(string: "http://su.pr/api/shorten?longUrl=\(URL.absoluteString)")!
responseKey = "shortUrl"

default: shortenURL = nil
}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Cast will also help you shorten URLs very quickly using your preferred URL short
- [x] Shortens any URL and prepares a shortened link in your Pasteboard (ready to paste)
- [x] Keeps a History of all your uploads and URL shorts
- [x] Clicking a recent upload from the list, opens it in your default browser
- [x] Configure the app through the Options menu
- [ ] Recent upload links synced via iCloud across all your Macs
- [ ] Configure the app through the Options menu

## Features roadmap for v2.0

This comment has been minimized.

Copy link
@diamondgoldk

diamondgoldk Jun 1, 2016

K


Expand Down

0 comments on commit cfb46a4

Please sign in to comment.