Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
fixing crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbuechele committed May 18, 2015
1 parent 991f17b commit 99a8a8b
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 25 deletions.
4 changes: 4 additions & 0 deletions Goofy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
33942FB81A2AE8AA00E6D361 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33942FB71A2AE8AA00E6D361 /* WebKit.framework */; };
33B93A6B1AD68BE2003EBDDE /* MenuHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33B93A6A1AD68BE2003EBDDE /* MenuHandler.swift */; };
33C741E01A2B02840072D81E /* NotificationScriptMessageHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33C741DF1A2B02840072D81E /* NotificationScriptMessageHandler.swift */; };
33D6DF8D1B09F8E300B0CC9B /* GoofyWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33D6DF8C1B09F8E300B0CC9B /* GoofyWindow.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -57,6 +58,7 @@
33942FB71A2AE8AA00E6D361 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
33B93A6A1AD68BE2003EBDDE /* MenuHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuHandler.swift; sourceTree = "<group>"; };
33C741DF1A2B02840072D81E /* NotificationScriptMessageHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationScriptMessageHandler.swift; sourceTree = "<group>"; };
33D6DF8C1B09F8E300B0CC9B /* GoofyWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GoofyWindow.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -111,6 +113,7 @@
33942F9E1A2AE7F700E6D361 /* Images.xcassets */,
33942FA01A2AE7F700E6D361 /* MainMenu.xib */,
33942F9A1A2AE7F700E6D361 /* Supporting Files */,
33D6DF8C1B09F8E300B0CC9B /* GoofyWindow.swift */,
);
path = Goofy;
sourceTree = "<group>";
Expand Down Expand Up @@ -258,6 +261,7 @@
33C741E01A2B02840072D81E /* NotificationScriptMessageHandler.swift in Sources */,
338FDBB61AD91FAD00164747 /* TitleLabel.swift in Sources */,
33B93A6B1AD68BE2003EBDDE /* MenuHandler.swift in Sources */,
33D6DF8D1B09F8E300B0CC9B /* GoofyWindow.swift in Sources */,
33942F9D1A2AE7F700E6D361 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
5 changes: 5 additions & 0 deletions Goofy/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, WKNavigationDelegate, WKUIDe
//webView.configuration.preferences.enableDevExtras();
webView.navigationDelegate = self
webView.UIDelegate = self
webView.setValue(true, forKey: "drawsTransparentBackground")


// Layout
view.addSubview(webView, positioned: NSWindowOrderingMode.Below, relativeTo: view);
Expand Down Expand Up @@ -140,8 +142,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, WKNavigationDelegate, WKUIDe
toolbarTrenner.view?.frame = CGRectMake(0, 0, 1, 100)
toolbarTrenner.view?.layer?.backgroundColor = NSColor(white: 0.9, alpha: 1.0).CGColor


toolbarSpacing.minSize = NSSize(width: 157, height: 100)
toolbarSpacing.maxSize = NSSize(width: 157, height: 100)
toolbarSpacing.view = NSView(frame: CGRectMake(0, 0, 157, 100))
} else {
toolbarTrenner.view?.layer?.backgroundColor = NSColor(white: 1.0, alpha: 0.0).CGColor

Expand Down Expand Up @@ -335,4 +339,5 @@ class AppDelegate: NSObject, NSApplicationDelegate, WKNavigationDelegate, WKUIDe
let previewItemTitle: String = "Image"

}

}
4 changes: 2 additions & 2 deletions Goofy/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,10 @@
<nil key="toolTip"/>
<size key="minSize" width="48" height="48"/>
<size key="maxSize" width="153" height="48"/>
<imageView key="view" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="i1V-4R-UDb">
<imageView key="view" hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="i1V-4R-UDb">
<rect key="frame" x="0.0" y="0.0" width="48" height="48"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="Oug-5w-R08"/>
<imageCell key="cell" enabled="NO" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="Oug-5w-R08"/>
</imageView>
</toolbarItem>
<toolbarItem implicitItemIdentifier="1FE8986D-A30E-452D-A8F9-93F20DB87F58" label="" paletteLabel="" id="MEh-6L-h4y">
Expand Down
4 changes: 2 additions & 2 deletions Goofy/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.1.1</string>
<string>2.1.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>617</string>
<string>633</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.social-networking</string>
<key>LSMinimumSystemVersion</key>
Expand Down
31 changes: 15 additions & 16 deletions server/src/fb.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var lastNotification;
var lastNotificationTime;
var dockCounter = "";
var ignoreNotification = false;

(function(f,b){if(!b.__SV){var a,e,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config people.set people.set_once people.increment people.append people.track_charge people.clear_charges people.delete_user".split(" ");
for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=f.createElement("script");a.type="text/javascript";a.async=!0;a.src="//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";e=f.getElementsByTagName("script")[0];e.parentNode.insertBefore(a,e)}})(document,window.mixpanel||[]);
Expand Down Expand Up @@ -192,21 +194,11 @@ function preferences() {
}

function dockCount() {
if (document.querySelector('title').textContent.indexOf('Messenger')==-1) {
return;
var c = document.querySelectorAll('._1ht3').length;
if (c != dockCounter) {
window.webkit.messageHandlers.notification.postMessage({type: 'DOCK_COUNT', content: String(c)});
dockCounter = c;
}
if (document.querySelector('title').textContent == 'Messenger') {
window.webkit.messageHandlers.notification.postMessage({type: 'DOCK_COUNT', content: "0"});
return;
}
var c = /\(([^)]+)\)/.exec(document.querySelector('title').textContent);
if (c && c.length>1) {
c = c[1];
} else {
c = "0";
}

window.webkit.messageHandlers.notification.postMessage({type: 'DOCK_COUNT', content: c});

if (c > 0) {
var text = document.querySelector('._1ht3 ._1htf');
Expand All @@ -227,7 +219,14 @@ function dockCount() {

text = document.querySelector('._1ht3 ._1htf').textContent;
var id = document.querySelector('._1ht1._1ht3').getAttribute('data-reactid');
window.webkit.messageHandlers.notification.postMessage({type: 'NOTIFICATION', title: subtitle, text: text, id: id});

if (ignoreNotification) {
ignoreNotification = false;
} else {
window.webkit.messageHandlers.notification.postMessage({type: 'NOTIFICATION', title: subtitle, text: text, id: id});
window.webkit.messageHandlers.notification.postMessage({type: 'DOCK_COUNT', content: String(c)});
}

lastNotification = subtitle+text;
lastNotificationTime = new Date().getTime();
}
Expand All @@ -241,7 +240,7 @@ function replyToNotification(userid, answer) {
var textEvent = document.createEvent('TextEvent');
textEvent.initTextEvent('textInput', true, true, null, answer, 9, "en-US");
document.querySelector('._209g._2vxa').dispatchEvent(textEvent);

ignoreNotification = true;
__triggerKeyboardEvent(document.querySelector('._209g._2vxa'),13,true);
},50);
}
Expand Down
10 changes: 5 additions & 5 deletions update_feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Version 2.1.1</title>
<title>Version 2.1.2</title>
<sparkle:releaseNotesLink>
http://www.goofyapp.com/version/2.1.html
</sparkle:releaseNotesLink>
<pubDate>Fri, 8 May 2015 11:20:11 +0000</pubDate>
<pubDate>Mon, 18 May 2015 11:20:11 +0000</pubDate>
<link>http://www.goofyapp.com/version/2.1.html</link>
<enclosure url="https://github.com/danielbuechele/goofy/releases/download/v2.1.1/Goofy.app.zip"
sparkle:version="612"
sparkle:shortVersionString="2.1.1"
<enclosure url="https://github.com/danielbuechele/goofy/releases/download/v2.1.2/Goofy.app.zip"
sparkle:version="632"
sparkle:shortVersionString="2.1.2"
length="3381354"
type="application/octet-stream" />
</item>
Expand Down

0 comments on commit 99a8a8b

Please sign in to comment.