Permalink
Browse files

Sillyness. And stuff.

  • Loading branch information...
1 parent 9ea236f commit 9163ad8231fad96493ec497e052b4e00e8945f71 @ccgus committed Aug 12, 2010
View
BIN fogbugz-safariextension/.DS_Store
Binary file not shown.
View
1 fogbugz-safariextension/README.markdown
@@ -0,0 +1 @@
+This is a total hack, and if you want to use it, you'll need to modify the extension so it runs on your copy of fogbugz.
View
50 fogbugz-safariextension/fbhacks.safariextension/Info.plist
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Author</key>
+ <string>Gus Mueller</string>
+ <key>CFBundleDisplayName</key>
+ <string>Augie's Fogbugz Hacks</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.flyingmeat.fbhacks</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>Chrome</key>
+ <dict/>
+ <key>Content</key>
+ <dict>
+ <key>Scripts</key>
+ <dict>
+ <key>End</key>
+ <array>
+ <string>fbhacks.js</string>
+ </array>
+ </dict>
+ </dict>
+ <key>Description</key>
+ <string>A plugin for modifying FogBugz 7 behavior</string>
+ <key>ExtensionInfoDictionaryVersion</key>
+ <string>1.0</string>
+ <key>Permissions</key>
+ <dict>
+ <key>Website Access</key>
+ <dict>
+ <key>Allowed Domains</key>
+ <array>
+ <string>shapeof.com</string>
+ </array>
+ <key>Include Secure Pages</key>
+ <true/>
+ <key>Level</key>
+ <string>Some</string>
+ </dict>
+ </dict>
+ <key>Website</key>
+ <string>http://flyingmeat.com/</string>
+</dict>
+</plist>
View
5 fogbugz-safariextension/fbhacks.safariextension/Settings.plist
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<array/>
+</plist>
View
93 fogbugz-safariextension/fbhacks.safariextension/fbhacks.js
@@ -0,0 +1,93 @@
+function anythingBut(s, l) {
+ var idx = 0;
+ while (idx < s.length) {
+ if (s.charAt(idx) != l) {
+ return false;
+ }
+ idx++;
+ }
+ return true;
+}
+
+function rewrap(s, len) {
+
+ var ret = "";
+ s = s.replace("\r\n", "\n");
+ s = s.replace("\r", "\n");
+
+ var ss = s.split("\n");
+
+ for (var sidx = 0; sidx < ss.length; sidx++) {
+ var line = ss[sidx];
+
+ if (!line.length) {
+ ret = ret + "\n";
+ continue;
+ }
+
+ var idx = 0;
+ while ((idx < line.length) && (line.charAt(idx) == '>')) {
+ idx++;
+ }
+
+ var pre = "";
+ for (j = 0; j < idx; j++) {
+ pre = pre + ">";
+ }
+
+ var oldLine = line.substring(idx);
+ var newLine = pre;
+ var words = oldLine.split(String.fromCharCode(32));
+
+ for (var wordIdx = 0; wordIdx < words.length; wordIdx++) {
+
+ var word = words[wordIdx];
+
+ if (newLine.length + word.length > len) {
+ ret = ret + newLine + "\n"
+ newLine = pre;
+ }
+
+ if (word.length && !anythingBut(newLine, '>')) {
+ newLine = newLine + " ";
+ }
+
+ newLine = newLine + word;
+ }
+
+ ret = ret + newLine + "\n";
+ }
+
+ return ret;
+}
+
+function setupReply() {
+ var msg = document.getElementById("sEventReply").value;
+
+ var sigIdx = msg.indexOf("-----Original Message-----")
+ var sig = msg.substring(0, sigIdx);
+
+ var restIdx = msg.indexOf("\n\n", sigIdx);
+ var rest = msg.substring(restIdx);
+
+ rest = rest.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
+
+ var fromIdx = msg.indexOf("From: ");
+ var fromIdxs = msg.indexOf("\n", fromIdx);
+ var from = msg.substring(fromIdx + 6, fromIdxs);
+ var newMsg = from + " wrote:\n" + rest + "\n\n" + sig;
+
+ newMsg = newMsg.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
+
+ document.getElementById("sEventReply").value = rewrap(newMsg, 72);
+ document.getElementById("sEventReply").focus();
+}
+
+if (window.top === window) {
+
+ // command=reply
+ var s = window.location + "";
+ if (s.indexOf("command=reply") > 0) {
+ setupReply();
+ }
+}
View
BIN fogbugz-safariextension/fbhacks.safariextz
Binary file not shown.
View
2 proxiappwindowbringerupper/ProxiAppWindowBringerUpper.m
@@ -25,6 +25,8 @@ + (void) load
static OSStatus handleAppFrontSwitched(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) {
+ debug(@"%s:%d", __FUNCTION__, __LINE__);
+
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
NSDictionary *activeAppDict = [workspace activeApplication];
View
10 proxiappwindowbringerupper/ProxiAppWindowBringerUpper.xcodeproj/project.pbxproj
@@ -21,7 +21,7 @@
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
32DBCF630370AF2F00C91783 /* ProxiAppWindowBringerUpper_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxiAppWindowBringerUpper_Prefix.pch; sourceTree = "<group>"; };
8D5B49B6048680CD000E48DA /* ProxiAppWindowBringerUpper.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ProxiAppWindowBringerUpper.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
- 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; };
+ 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C9E67C3F0A40775F0077A2C5 /* ProxiAppWindowBringerUpper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxiAppWindowBringerUpper.h; sourceTree = "<group>"; };
C9E67C400A40775F0077A2C5 /* ProxiAppWindowBringerUpper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProxiAppWindowBringerUpper.m; sourceTree = "<group>"; };
CCEB89DF0D663426004B7321 /* ProxiLib.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ProxiLib.framework; path = /Applications/Proxi.app/Contents/Frameworks/ProxiLib.framework; sourceTree = "<absolute>"; };
@@ -249,14 +249,12 @@
1DEB914008733D840010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- ppc,
- i386,
- );
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
- SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ SDKROOT = "";
};
name = Release;
};

0 comments on commit 9163ad8

Please sign in to comment.