Have you or any one else gotten any further with this? If anyone is serious about getting a copy and paste web-based solution, I suggest getting with the iUI folks, and possibly have the code integrated with them. This way all iPhone developers can benefit from a single iPhone javascript library with copy & paste as a feature. Hopefully, Google Gears will be able to run on the iPhone, so that we can have a persistent local storage, instead of copying text to the server and pasting it down from the server to another iUI-based app. Just my 2 cents.
On Jul 12, 12:09 pm, Diclophis <[EMAIL PROTECTED]> wrote: > Here is an update: > > I have further developed the bookmarklet to open a second window that > is actually an webpage dedicated to the "clipboard" functionality. > > What you do is, hit thecopyurl link, it will then open a new window, > and place the url in the window surrounded by a blue box (if you hitcopyurl > more than once, it will add additional entries, and you can > select which entry you want topasteby clicking on it in the > clipboard) > > Then you hit thepasteurl link, it will then parse the current dom, > and load all "text input boxes" ids into the clipboard window, you > then goto the clipboard, and select which id you want topastethe > value into. > > It works fine so far, the only problem is there is some sort of cross- > domain security check in place that prevents windows with pages that > aren't on the same domain name from accessing the the clipboard. > > My next attempt will be to use a div and possibly some server-side > magic to make thecopy/pastework. > > On Jul 11, 11:52 am, Diclophis <[EMAIL PROTECTED]> wrote: > > > Hello, > > > I would like to bounce some ideas off the group and see what would be > > the best direction to take for my "Copy/Paste" bookmarklet. > > > Currently I have developed a simple bookmarklet that is able to grab > > the current window.location, and then "saves" it to a "clipboard" (it > > actually loads it into an element in a new window). Then there is a > > second bookmarklet that can "paste" the element from the "clipboard" > > window into another current document. > > > The problem I have now is, there is no way for the DOM to tell us what > > is the currently focused element. So I need some way for the "paste" > > bookmarklet to know what input element should receive the value (right > > now, it just alert()s the value on the second window). > > > Here are my thoughts dumped out, maybe someone can help me make sense > > of them? > > > 1. Rather than just blindly grab the window.location for "copying", I > > can prompt the user for which element they want tocopy? (display a > > new window with all the text elements, with some button or something > > that says "copythis"). Or even, develop a microformat that is a > > special class that developers can use on their pages that indicates to > > the bookmarklet that this element is likely to be copied/pasted (<p > > class="iphone_copiable">...</p>), and then enumerate over those, and > > prompt the user for which one they want tocopy. > > > 2. Then for the pasting, perhaps either enumerate over all the input > > type="text" or "textareas" on the page, and prompt the user which one > > should receive the copied value, or develop some standard > > microformatesque thing like <input type="text" class="iphone_pastable"/ > > > 3. Maybe attach an event onto the onBlur for all elements, that would > > thenpastethe copied value? The problem with that is, if there are > > existing events on the element, the order of event execution could not > > be guaranteed, and therefore it would not be possible to ensure that > > the copied value was present in the element before the form was > > submitted. > > > 4. perhaps some sort of keyword you put into an element, that you want > > to overwrite when you run the "paste" bookmarklet (same problem as 3. > > though, if the form is submitted onBlur, then after putting in the > > keyword, there would be no time to run the bookmarklet and have it > > overwrite the keyword) > > > I have the current form of theCopy/Pastebookmarklets up on my site: > > >http://iphonebookmarklets.com/ > > > Please post your thoughts, and or any bookmarklets you have developed/ > > come across so I can add to my list. > > > Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en -~----------~----~----~----~------~----~------~--~---
