Is there a way to focus a popover for a Safari extension? - safari

Just wanted to know if anyone knew how to put the focus on a popover for a Safari extension. Currently, the popover acts as if the window is inactive. This prevents any mouseover events from working and trying to type in any input field is difficult because there is no flashing cursor.

According to a post on the Safari developer forums, this is a known issue with Lion and they are looking into it.

Related

Cocoa Webview - Camouflage webview as native control

OK, I'm doing some experiments with WebView-based native OSX apps, and I'm wondering:
Which are the necessary steps in order to fully camouflage it? (So, that the user - ok, a non-technical user, actually) cannot possibly understand it's a webview.
How can we eliminate the right-click menu (including the "Reload" item)?
Last but not least:
If the actual webpage content is loaded on startup (in awakeFromNib), even for a simple webpage, it takes 1-or-2 seconds before the actual content shows up. During this time, a white/empty background shows where the webview/page should be. What could I do about that? Perhaps a "loading" indicator?
Any help will be appreciated! :-)
To eliminate the right click menu implement the webView(_:contextMenuItemsForElement:defaultMenuItems:) method of WebUIDelegate protocol.

maintaining wikitext and richtext editing modes in iPad app

I am designing an iPad app in which I have a textView apart from other things. In that textView I am currently rendering wikitext. I have implemented basic functionalities like bold, italic etc. in the editor using accessory view.
Now, I want to provide the user an another mode to edit in rich text as well. The rich text editing will be done in the web View (not implemented yet). The problem I am facing is that I don't know a way to keep the text in both the modes in sync so that when a user jumps from one to another he is able to see the changes made in the other mode instantly.
Can someone suggest some clue regarding this? Thanks.
It's no problem to sync from the UITextView to the UIWebView using UITextViewDelegate to fire events as soon as the User types into the TextView. The bigger problem is the UIWebView you'd need to check its source-code to check changes and then sync them to the UITextView.
The next best possibility would be to wait on iOS 6 which provides styled text, but iOS 6 is still under NDA, so nobody will provide you help.

Bug in Cocoa document-based app with the window's document icon popup menu

I have a document-based app that supports Versions and Autosave. When you click the proxy icon, a popup menu appears like in any other document app, too:
You notice this weird NSMenuItem item? It's not supposed to look like that. In Quartz Composer for example it looks like this:
I don't know why this happens, as I'm not doing anything with the window title or icon. There isn't even an API to customize this popup menu.
It would be great if somebody could help me to get this fixed or at least an idea of what could be the cause of this behavior.
Kind regards,
Fabian
Found a blog post with the solution. This worked for me:
Versions, validateMenuItem: and NSMenuItem

WebView (webkit) "Look Up In Dictionary" UI Bug - Mac App

I've found a bug with WebView that is easy to recreate but hard to solve and am looking for suggestions and preferably answers.
The bug is when you use Apple's built in dictionary "look up" command by any means, contextual menu, multi touch gesture (3 finger double tap), or the standard global hot key "cmd ctrl d". After invoking the dictionary look up command, a popover will appear with the definition of the word you highlighted. However, text on the page sometimes gets blurred and forms/fields no longer respond properly to input events like mouseDown.
Like I said earlier, it is pretty easy to duplicate. I've uploaded a sample project to GitHub.
https://github.com/ChimpStudios/WebView-DictionaryBug
Safari doesn't have this bug, so somehow Apple fixed it, but it still exists in the WebView object.
Calling -[WebPreferences setPreferencesIdentifier:] so that your WebView gets its own WebPreferences copy appears to be an effective workaround.

Best way to create floating notification iOS

I've got a tabbed iPad application with just about each tab running a UIWebView. I'm getting all sorts of callbacks, like when a user tries to leave the corporate site (which only displays the company site to users). In this case, I pop up a "toast" style window that tells them to click a button to open the page in Safari. I also pop it up with a spinner and no text to indicate that a page is loading. The approximate look that I'm going for is used in lots of applications, but you can see it best when changing the volume on the iPhone or iPad. It's just a translucent rounded square that fades in and out.
Right now I've got it implemented on one of my tabs, and I did it by creating the objects (a spinner, a label, and a UIImage with the square) and then programmatically hiding and showing them using [UIView beginAnimations] and changing the label's text. It works perfectly but I've got these nagging things hovering over my interface in Xcode, and it takes a lot of setup to accomplish if I wanted it to be in another tab, which I do. I can't help but think that there's a better way to accomplish this. I thought about making and adding a subview, but that would leave a white background to the toast. What I'm thinking is creating some sort of object that I can allocate in a tab's view controller whenever it's needed.
What are your guys ideas, or have you done this in the past? I see it in a lot of prominent applications, like Reeder, so I'm sure it's been done more eloquently than I have done it.
Matt Gallagher has a great class called LoadingView here Showing message over iPhone Keyboard. I use it.
MBProgressHUD is a popular library for this, as well.