ajaxorg / ace

Ace (Ajax.org Cloud9 Editor)
https://ace.c9.io
Other
26.73k stars 5.28k forks source link

IOS compatibility #37

Closed Gozala closed 4 years ago

Gozala commented 13 years ago

Ace could be a ideal editor on IOS devices (iPad, iPhone) if you just could type, but unfortunately virtual keyboard never shows up with ACE, also I believe someone had a patch for bespin to make that work. @gissues:{"order":96.27329192546586,"status":"backlog"}

sergi commented 13 years ago

We know, and it will be taken care of soon. Thanks for the suggestion!

fjakobs commented 13 years ago

could you lookup the patch for us?

glaforge commented 13 years ago

I'm also interested in iOS (and particularly iPad) support. Looking forward to hearing about your progress on that front.

fjakobs commented 13 years ago

You can checkout the ipad branch. It is not perfect yet but at least typing works. Use two fingers to scroll.

glaforge commented 13 years ago

Excellent, I hadn't noticed the ipad branch. Thanks, I'll have a look at it!

SunboX commented 13 years ago

The keyboard didn´t show using the ipad branch. Using the master branch it shows, but there´s a bug with the cursor positioning. :/

SunboX commented 13 years ago

Forget what I've said! It's cool that the keyboard didn't show up! You could write your own keyboard, much friendlier for programmers and less space consuming. :o)

bvibber commented 13 years ago

Testing on iPad running iOS 4.3; current master fails to show keyboard or insertion point, and doesn't scroll vertically (I can scroll horizontally with two fingers, if the text is wider than the available area).

iPad branch hasn't been updated since February 3... testing it, I see that vertical scrolling works with two fingers (yay!) but is very slow. I can put focus into the editor and pop up the on-screen keyboard, but the insertion point ends up flying off away from the editor when the window scrolls up to fit the keyboard.

Trying to tap around the editor seems problematic; I can sorta tap within the line being edited, but tapping other lines above seems to lose focus and closes the keyboard. I can only reliably put focus at the end of the document.

While scrolling vertically, the insertion point seems to jump up/down a line at a time, but when I start typing, it jumps back to the end of the document to add new chars.

bvibber commented 13 years ago

(iPad branch on regular Firefox 4 also has issues -- it seems to make assumptions about the window's scroll position, and clicking in the editor ends up placing the caret at wrong position if I've scrolled the window down to fit the editor in the visible space.)

dmmalam commented 13 years ago

any updates on the ipad branch?

fjakobs commented 13 years ago

Unfortunately not. This branch is currently not under active development. We plan to resurrect it but we have no estimated time when.

andrewheiss commented 12 years ago

Sorry to resurrect a dead thread, but has there been any progress on the iOS front?

levous commented 12 years ago

Obviously, there is massive interest in this. Ill take a look and see if I can help

hjwp commented 12 years ago

+1

matthew-dean commented 12 years ago

A web-based component that doesn't support the iPad can no longer be rightfully called a web-based component, IMO.

abacon commented 12 years ago

I second this. I'm writing on an iPad right now, wishing that I were using ACE to be programming instead...

velniukas commented 12 years ago

+1 need this pretty urgently too on iPad

cranic commented 12 years ago

+1 to the urgency

PlayMyCode commented 12 years ago

I would also like iOS support too, and very soon. If I can find the time, I'd be happy to sit down and do this myself. So if there are any pointers on where I should get started in the code, and details on how it's going wrong, it would be appreciated.

velniukas commented 12 years ago

Agreed - I would contribute to a kickstarter fund to complete this if need be

On Sat, Apr 7, 2012 at 2:53 PM, Joe reply@reply.github.com wrote:

I would also like iOS support too, and very soon. If I can find the time, I'd be happy to sit down and do this myself. So if there are any pointers on where I should get started in the code, and details on how it's going wrong, it would be appreciated.


Reply to this email directly or view it on GitHub: https://github.com/ajaxorg/ace/issues/37#issuecomment-5006423

cranic commented 12 years ago

There's no way of bringing that damn keyboard up with javascript, thumbs up for a custom keyboard.

PlayMyCode commented 12 years ago

Not true. Assign an element as content editable and them give it focus, and the keyboard should appear. You could also do tricks with textsreas and text inputs to get it working.

The keyboard also comes up with the version of Ace I'm using on my site, it's just not usable.

cranic commented 12 years ago

@PlayMyCode If I can't call someting like ios.showKeyboard() than it's true that I can't bring it up whit javascript, this what you said are all quick fixes...

PlayMyCode commented 12 years ago

It just doesn't work like that.

If the content isn't editable, or if it's not a text input, why would the keyboard be displayed? The characters won't go anywhere, you will not receive input from the keyboard.

The keys have to go somewhere for the keyboard to be displayed. If they don't have anywhere to go, then it doesn't appear. If they do have somewhere to go, it will appear. That's not a hack, it's just how text entry works.

hjwp commented 12 years ago

@PlayMyCode - characters don't necessarily need a textinput to go to, they could just "go" to javascript -- if you had a set of keypress listeners, you'd be able to get the characters and put them wherever you wanted...

PlayMyCode commented 12 years ago

@hjwp your right, but again it's not that simple. I believe the elements must be able to obtain focus, or the browser will not send the event to the element, and many elements cannot receive focus. For example the canvas will only listen to key events if you add a tab index (or at least I am finding this just now in Chrome). iOS also only brings up the keyboard for canvas if you set content editable.

Either was this is an academic argument. iOS support is what is important, and it shouldn't be sidelined simply because a solution looks too much like a hack (unless of course there is a better alternative).

SunboX commented 12 years ago

How about putting the focus on an hidden text input and clearing this on keypress?

matthew-dean commented 12 years ago

Yep, that's how many WYSIWYGs work.

On 2012-04-09, at 4:56 AM, "André Fiedler" reply@reply.github.com wrote:

How about putting the focus on an hidden text input and clearing this on keypress?


Reply to this email directly or view it on GitHub: https://github.com/ajaxorg/ace/issues/37#issuecomment-5024068

matthew-dean commented 12 years ago

Wasn't older versions of Ace positioning a textarea or input element under entry, originally? That approach will bring up the keyboard.

nightwing commented 12 years ago

Wasn't older versions of Ace positioning a textarea or input element under entry, originally

new versions of ace do the same. textarea goes out of sync with cursor while scrolling but that's easy to fix i haven't seen ace on the ipad but on android typing and moving cursor around works, only there's no way select text. but more importantly

SunboX commented 12 years ago

custom keyboard sounds nice!

PlayMyCode commented 12 years ago

I'm skeptical about a custom keyboard. Building a good, polished keyboard is not trivial, and is worthy of being a large project in its own right. I would also expect a pure HTML keyboard will be slower then the inbuilt one.

It would also need to work well on different screen sizes and different layout orientations. For example I wouldn't want to use the iPad keyboard on the iPhone, and its not nice using the iPhone keyboard on the iPad. They have different keyboards for a reason. Most of all it means everything on the iPad and iPhone uses one keyboard, except Ace. In short, users already have a keyboard they expect, and in many cases it's customized (like setup as a split keyboard).

My recommendation would be to just get the keyboard working, as I'd expect this would be less work then building a custom keyboard. Then worry about building a custom keyboard in the future as a seperate issue. It would also allow you to optionally fall back onto the OS keyboard as an alternative to a custom one, such as if it didn't work well on a particular device.

PlayMyCode commented 12 years ago

This site also says you can turn auto complete and auto capitalisation off on particular inputs: http://davidbcalhoun.com/tag/javascript

PlayMyCode commented 12 years ago

A custom keyboard will also be unable to use the full screen width if Ace is placed within an iframe.

This might sound like a corner case, but both JSFiddle and JS.do.it allow you to embed editors within iframes on other sites, and it's something I'd like to do myself.

matthew-dean commented 12 years ago

@PlayMyCode - Seconded: a custom keyboard would be an extremely bad idea for many of the reasons you mentioned and more.

au-phiware commented 12 years ago

@PlayMyCode - I agree, custom keyboard sounds perilous. I also suspect that those who have suggested it have little to no experience working with iOS APIs. But I could be wrong, im just going by what @cranic said about ios.showKeyboard(), the native APIs don't have anything equivalent to that... The closest would be calling becomeFirstResponder on a UITextInput control ...but I digress.

This should be entirely doable, probably with little effort. I'm guessing that it's along the lines of giving focus to an element that has contenteditable set. From iOS 5.0, contenteditable is supported, see the very end of Creating Compatible Web Content

bertoltmeyer commented 12 years ago

There is a JavaScript for editing code inside a browser that fires up a keyboard on iOS: CodeMirror, see e.g. http://codemirror.net/mode/r/index.html for a demo (works on the iPhone) and codemirror.net for general. So maybe there is something in their code that could help iOS support in ace?

cranic commented 12 years ago

@bertoltmeyer, CodeMirror is based on textareas, that's why it can open the iOS keyboard, ace is a lot more complicated...

nightwing commented 12 years ago

@cranic actually Codemirror2 is very similar to ace and uses, which uses the same textareas if Codemirror2 works on ipad, fixing ace, to work the same way shouldn't be hard

bertoltmeyer commented 12 years ago

I am writing from the perspective of an R statistician who - like thousands of others - uses RStudio for coding. RStudio is the most popular IDE for R and is built on ace. If ace supported iOS, so would RStudio Server. In this ideal world, I could just access our RStudio Server from my iPad and do all my coding from there. I (and thousands of other R guys) wouldn't have to use my laptop any more. So seriously, ace's lack of support for iOS is the only reason why I am still carrying a laptop around and I am sure that there are loads of other people like me out there. So if I spoke javaScript, which I don't, I would be working on this with top priority. But since I cannot code in js, all I can really say is please please please please can someone try to fix this. Sigh. I (and others) would really support a kickstarter on this issue if necessary.

au-phiware commented 12 years ago

Hey, I've taken a quick look at the code but all I see is divs; where is the canvas?

nightwing commented 12 years ago

ace never used a canvas, it was bespin

nightwing commented 12 years ago

with 2f6a6ce7e0992a2eccbb8a517aa2d6f4954f1214 will not be scrolled out of view.

btw. one more reason to make virtual keyboard

mike-lawrence commented 12 years ago

I echo @bertoltmeyer with regards to enthusiasm for getting ace onto iOS so that RStudio can be used on an iPad.

rcarmo commented 12 years ago

I'd love to see this working on an iPad as well - it would enable a lot of functionality in downstream applications (I also came here by way of RStudio, but just realized that ACE is in use in a few other web tools I use sporadically, so for me this would solve many different problems).

velniukas commented 12 years ago

How do we raise a kickstarter of similar project for this? I'm willing to put a $100 into the pot right now On interfaces side - Prompt on iOS (a ssh client) has a great keyboard which is better suited to sysadmin/programming than the standard iOS layout.

On Thu, May 10, 2012 at 5:34 AM, Rui Carmo < reply@reply.github.com

wrote:

I'd love to see this working on an iPad as well - it would enable a lot of functionality in downstream applications (I also came here by way of RStudio, but just realized that ACE is in use in a few other web tools I use sporadically, so for me this would solve many different problems).


Reply to this email directly or view it on GitHub: https://github.com/ajaxorg/ace/issues/37#issuecomment-5612400

mike-lawrence commented 12 years ago

@velniukas Good idea with kickstarter, I wouldn't be surprised if quite a few folks (like myself) would donate to such a project.

velniukas commented 12 years ago

Unfortunately, I'm not able to commit any time to the development of a fix just now, but I'd be willing to help out setup a project like this with some collaborators.

On Thu, May 10, 2012 at 8:01 AM, Mike Lawrence < reply@reply.github.com

wrote:

@velniukas Good idea with kickstarter, I wouldn't be surprised if quite a few folks (like myself) would donate to such a project.


Reply to this email directly or view it on GitHub: https://github.com/ajaxorg/ace/issues/37#issuecomment-5615069

bertoltmeyer commented 12 years ago

I would also chip in at least 200 USD to a kickstarter project for ace iOS compatibility. I am sure that we would be able to raise quite a bit of money for this from the R community. I am unable to contribute to the coding because I don't speak enough js, but I am willing to help with the fundraising in the R community if someone gets a kickstarter going. @velniukas , would you be able to identify potential collaborators and contact them with regard to setting up such a project?

velniukas commented 12 years ago

Will do - anyone interested in helping setup a kickstarter - drop me a pm

Cheers Steve 10xEngineer.me

On Thu, May 10, 2012 at 2:59 PM, Bertolt Meyer < reply@reply.github.com

wrote:

I would also chip in at least 200 USD to a kickstarter project for ace iOS compatibility. I am sure that we would be able to raise quite a bit of money for this from the R community. I am unable to contribute to the coding because I don't speak enough js, but I am willing to help with the fundraising in the R community if someone gets a kickstarter going. @velniukas , would you be able to identify potential collaborators and contact them with regard to setting up such a project?


Reply to this email directly or view it on GitHub: https://github.com/ajaxorg/ace/issues/37#issuecomment-5619266