Renamed the GLFileView's +parseHTML into something more meaningful regarding what it actually does.
Also, the method might need to be moved to somewhere else...
- make sure to remove themselves from KV and notification center observers
- add the PBWebHistoryController to PBHistoryController so it can be told to close
- replaced the -removeView methods with -closeView (-removeView was not being used)
- clear any obj-c objects set in web scripting objects
This last item seems to be the reason that the web controllers and the current commit did not get collected which then held the repository document from being collected as well.
This is a convenience class to replace using NSStrings to store and compare SHAs. PBGitSHA has a much faster isEqual: function.
It is <NSCopying> compliant and implements isEqual: and hash so it can be used as a key in dictionaries.
removeObserver: removes the controller from all notifications.
The PBWebHistoryController's super class registers it for "preferencesChangedWithNotification". This stops the controller from missing that notification and allows it to respond to changes in the preferences.
André Berg pointed out that the "Open Image in New Window" and "Download Image" items from the contextual menu for images in the web view does not work and may cause crashes.
So limit the menu to either just show "Copy Image" or don't have a menu at all.
Fixes a problem when opening a number of repos at once where the commit information does not show up. Get a webKit error "TypeError: Result of expression 'commit' [undefined] is not an object."
For some reason the callWebScriptMethod:withArguments: method returns nil (even after the webView:didFinishLoadForFrame: delegate is called) when the app is busy. Seems like the web view is not really ready yet and so it never actually calls loadCommit().
If we get nil (normally should get WebUndefined) then try changeContentTo: again after a little delay. This stops the loadCommitDetails() script from running before the commit object is created.
Switch from storing both the ref and the commit to storing just one or the other as a refish.
Change action methods that receive PBRefMenuItem to support the change in functionality. In particular the removeRefSheetDidEnd:returnCode:contextInfo: method in PBRefController now looks up the commit for the ref (this was the only place that needed both the ref and the commit).
I've seen this hang or crash a few times, so I hope this works better.
Instead of running a task in a separate thread, we just let it go through
the run loop and catch it when the task is done.
This ruins the second subview in the history view, but I don't think
anybody ever used that, so I'm going to remove it.
The WebKit delegate method didStartProvisionalLoadForFrame:
is not called when reloading the frame. This caused the
webviews to appear empty.
We fix it by using a delegate method which is called each
reload, as suggested by weinig in #webkit.
This fixes Lighthouse bug #81.
That's why it's there, after all. This also makes the system
more robust and catches some more errors.
The next thing this enables is to also allow right-clicking
on refs in the commit list.
This should make the GUI more responsive by allowing the diff
to be read in the background. This assumes that
[PBGitCommit details] is threadsafe, so we should keep it that
way.
This changes the HTML part of GitX to be more consistent -- we
now use a "views" directory where every web view has it's own
directory.
Furthermore, GitX-wide Javascript is added in the "lib" directory.
The same is true for CSS in the "css" directory. Every view can
have its own custom CSS and JS, and those are put in the views
directory (without JS or CSS prefix directories).