Open chrisjacob opened 14 years ago
There is. But until then, you use your iphone to go to http://tryruby.sophrinix.com/irb.cgi?cmd=dsfsdgdfsg where "dsfsdgdfsg" is what you what you would type in. It will remember your command history if you have cookies enabled.
I have been working on this issue for some time.
The problem is I need a mobile safari analog to this.observeKeyboard.
I need some javascript that allows me to trigger activate keyboard and respond to observe Keyboard.
If you can figure out how to make that happen, I'll put it in there
a good litmus test for iphone support is the keypress_test.html file.
If you can figure out how to make iphone respond to that file, then let me know.
This is an issue I will keep working on, but I am more focused on implementing fakefs and new lessons.
It's nice to know that this is on your mind. If I get some spare time I will certainly take a look at figuring out a solution. Thanks for the pointers to files / functions I can start on. Wish me luck! ;-)
If you can figure this out, it would be huge. I would immediately make sure that you get the credit for figuring this out and roll it into its own .js library.
This is an issue to date that no one has been able to figure out.
mobileInput.js (has a nice ring to it)
a radically simpler approach may be to pull the textbox out to somewhere that it is visible.
This at least lets you enter stuff into try ruby. The problem now becomes how to deliver a carriage return (aka return or enter)
This proof of concept shows that this is possible to do.
I might end up going with the idea of just writing a try ruby client for iPhone and call it a day.
I'm thinking that the iphone keyboard is not the best option for "code" input. Need a "coding keypad". I'm thinking of building a Javascript solution. jQTouch for it's Fast Tap feature (http://blog.jqtouch.com/post/205113875/milliseconds-responsiveness-and-the-fast-tap). Landscape mode for Keyboard Input. Portrait mode for code "viewing". Various Keyboards optimised for code input. (Even pre-defined templates like "" for HTML.
Basically need to figure out how I can fake the key input - only done some quick google but this might start the ball rolling - http://stackoverflow.com/questions/832059/definitive-way-to-trigger-keypress-events-with-jquery
I'll let you know once I've had a play around... want to do some sketches of various keyboard layouts too.
;-)
The following simulates a keypress, which is picked up by the div#terminal. Tested in firebug, FF3.5.
var event = jQuery.Event("keypress"); event.keyCode = 65; $(document).trigger(event);
// 65 outputs "A" // 13 outputs "Enter"
Now to build the keyboard ;-)
The real trick is going to be getting the iphone keyboard to activate. Also, those keycodes differ by browser.
I'm thinking of by-passing the iPhone keyboard all together... It's not really optimised for coding. Basically create a web based iPhone Keyboard, which triggers these keypress events.
that's not a bad idea. If your going to do that then is this going to be web based, or is this going to be a iphone application. If so, then I'll consider uploading my attempt at making a try ruby iphone app. Long term I plan on adding new functionality to try ruby.
Web based. Using jQTouch as the foundation. Do you have an iPhone / iPodTouch? I recently worked on http://i.woolworths.com.au/ which used jQTouch + custom 'hack's to get the job done.
Yes. I am also an app developer.
I have been learning rhomobile though as of late. It allows me to write mobile apps in ruby.
Ah cool. rhomobile looks interesting too!
I'm thinking of cheating if I want to go native... http://phonegap.com/ screenscast http://www.youtube.com/watch?v=LcES5nIbMkk
Very early mashup/prototype/proof-of-concept... what ever you want to call it, it's hacky, it's buggy, but it's some what functional ;-)
http://multimedia123.com/iide/public/
To-Do:
Let me know what you think!
this is very promising! I'll dig into the details tomorrow. I have been busy porting the sandbox to ruby 1.9 so the file stuff will finally work.
This actually opens up a whole additional world of possibilities. keep up the good work.
Is it correct to assume that all your changes have been javascript only?
That is to say you have only modified the index.html file and maybe some javascript associated with index, and not touched any ruby or cgi files.
Correct, just html, css, js. I'm going to try and build a plugin for jQtouch, that lets you build your own web-based iPhone Keyboard(s). Obviously first step is to emulate the native iPhone Keyboard, then start working on ways of letting people customise this. Might seperate it from jQTouch if it gets popular - but for now I think that's a good 'community' in which to develop this project.
To access the CGI I'm using a proxy to get the results. The rest of your files pretty much stand up on their own with a few adjustments (files paths etc). The keyboard I've taken from http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-keyboard-with-css-and-jquery/ which is good enough for the proof-of-concept. I make some tweeks to the keyboard to send out Keypress events, which in turn your irb js picks up... all came together pretty smoothly after some trial and error ;-)
Project I'm now thinking of:
pocket irb - iphone webapp that emulates irb using your existing work with Try Ruby and my keyboard... potential to convert this into native app using "phone gap" and sell it on iTunes - I know I would pay $2 for it ;-)
try ruby - on your iphone!
iIDE - a simple IDE on your iphone...
Other services... thinking about how pastie.org could use the keyboard, thier code highlighting is brilliant, thinking how that could be integrated back into iIDE...
Anyway all pipe dreams right now, first step is to get the keyboard working ;-)
I'll keep you posted!
Set myself up a nice little area to start building the HTML/CSS for the keyboard.
http://multimedia123.com/iide/webik/
Development name for this project is WebIK (Web Based iPhone Keyboard)... simple enough ;-)
Better get back to doing some PAID work :-P
More progress... got base QWERTY keys layed out - looks good in all modern browsers + Mobile Safari. :-) http://multimedia123.com/iide/webik/
More progress... http://multimedia123.com/iide/webik/
Need to add in profile orientation, key backgrounds. But for now you get the idea ;-)
Going to give keys an a:active state (well actually faking this coz iphone does not trigger a:active). This state will have the keys change to the reverse colour i.e. light goes dark, dark goes light... as on iphone when you click on the Backspace Key.
Also going to work on adding a 'sticky key' style and functionality. This will have the keys turn blue (like when you enable 'Capslock' on the Shift key on iphone). This will cause the key to trigger the keypress event every 200 milliseconds (or something like that). So instead of needing to click Backspace 20 times you enable sticky key and it will continue to trigger the event.
Thinking of having two sticky key 'enablers'. 1 - a key you manually click first, then the next key you press becomes sticky. 2 - if you click the same key 3 times, then sticky key gets automatically enabled.
Can't wait to integrating into jQTouch and get TryRuby working on my iPhone (or at least irb.cgi for some IRB fun) ... I'll keep ya posted ;-)
thanks.
is there a current git repo for this?
If not then do you mind if I launch one?
I haven't ever put a project up on git. I think I will set one up myself, just so I can learn how it's all done ;-) ... Then I can keep this conversation going over there, and stop spamming your project :-P. I will post the link when available.
Ok WebIK now has it's own official GitHub repo :-) http://github.com/chrisjacob/webik
p.s. Git and GitHub are AWESOME. I've been living in SVN land for TOO long.
yep..
hey fyi, I am moving sophrinix.com and thus tryruby.sophrinix.com over to amazon ec2 . dns might take a while to resolve, so if try ruby is in accessible thats why. I've put an announcement on the site and on my twitter.
I can't javascript very well, and I don't have an iphone, but could putting this right before </body>
trigger the Iphone keyboard and let you type stuff?
i have an iphone. I'll look at this in the morning.
I have been busy with migrating off my dedicated box and moving entirely into the cloud.
there have been some difficulties with my domain name and the registrar it is with, but these appear to be solved problems that take time.
That is on to the right track. I wonder what ever happened to the guy working on the iphone javascript keyboard.
The real solution is to just build an iphone version that uses tryruby. I'll commit to doing this after another 10 major things are accomplished first.
Hi ya, yeah I pretty much feel off the face of the earth... I'm still interested in developing the project further - particularly with more and more touch screen devices coming out (e.g. ipad). I just got swamped with work. Also trying to dig into learning Rails and move my career down that path. Probably just like you - time is the biggest issue here.
Actually I've got a lot of enthusiasm right now to start my own business that operates on a 40% Client Work, 20% Learning, 40% Personal Projects basis... 37 Signals new book REWORK fuels my fire ;-)
good to see your still around. Yeah I can relate to no time.
I am making time right now to catch up all on all the ideas I have had about try ruby for some time. i am working on launching a startup and a non profit.
Busy bee indeed ;-) I work as a Freelance Web Developer in Australia.... what's your day job? p.s. chrisjacob.work[at]hotmail.com if you're ever on MSN ;-)
... not sure if this helps, but i noticed yesterday that TryHaskell.org works great on the iPad, but TryRuby.org fails to bring up the keyboard. Perhaps you could use their code if the license is compatible.
Great suggestion aaronia
ive looked into this, this biggest thing that i dont like about tryhaskell is that the previous command/up arrow fails to work. Also, the way lessons work is different between try haskell and try ruby.
this will work when I switch to jquery console
ANy update on this? yes please maybe?
its in the updates...friday...more later
iOS (iPad, and iphone support coming very soon) see: http://twitter.com/#!/sophrinix/status/52811824835473408
This is not exactly related, but on Android platforms it would be nice for tryruby to show a message on load saying to hold down menu to activate the soft keyboard, and then it could fade out when the first keypress is detected.
I am actually planning a mobile android app after I pushed the code I have already promised to push onto this repo.
JRuby works on android, so it will be fairly straight forward to do a JRuby + TryRuby = android native app in the marketplace. I'll note your comment. I only have the android sdk (no actual android devices except my humble nook)
Android devices work nicely, except arrow keys. I also have full out irb on my phone (and a code editor), powered by jruby. I was just saying to pop up a notice in case someone without a hard keyboard doesn't know how to show the soft one.
I was considering writing a simple mobile android app for you, but it would use the web api, not jruby. It would then show all the same help and stuff as the web site version.
Not sure if it's possible, but I would love to be able to use this on my iphone - in safari. Naturally the terminal is a DIV (#terminal). Which of course does not bring up the keypad on the iphone when I click on it.
There must be something nifty you can do to force the keypad to open up and allow input... ;-)
Keep me posted!