Sha256: 518784c2fd51bee88f8871fc81b8b09e8922afaf945651d53af3261140476d6a
Contents?: true
Size: 1.47 KB
Versions: 43
Compression:
Stored size: 1.47 KB
Contents
var Ruby = { code: function() { var scripts = document.getElementsByTagName("script"); var rubyCode = ''; for (var i = 0; i < scripts.length; i++) { var script = scripts[i]; if ( (script.getAttribute("type") == "text/ruby") || (script.getAttribute("type") == "text/x-ruby") ) { rubyCode += script.innerHTML; } } return rubyCode; }, init: function(callback) { Ruby.applet(); Ruby.evalScript(callback); }, evalScript: function(callback) { if (document.RubyApplet.evalRuby && document.RubyApplet.hasStarted()) { callback(Ruby.eval(Ruby.code())); } else { setTimeout(function() { Ruby.evalScript(callback); }, 500); } }, eval: function(code) { return document.RubyApplet.evalRuby(code); }, applet: function() { var applet = document.createElement('applet'); // applet.setAttribute("archive", "http://ruby-in-browser.googlecode.com/svn/trunk/lib/jruby.jar,http://ruby-in-browser.googlecode.com/svn/trunk/lib/asm.jar,http://ruby-in-browser.googlecode.com/svn/trunk/lib/backport-util-concurrent.jar"); applet.setAttribute("archive", "/java/jruby.jar,/java/bsf.jar"); applet.setAttribute("code", "RubyApplet"); applet.setAttribute("codebase", "http://ruby-in-browser.googlecode.com/svn/trunk/classes"); applet.setAttribute("name", "RubyApplet"); applet.setAttribute("width", "1"); applet.setAttribute("height", "1"); document.body.appendChild(applet); } };
Version data entries
43 entries across 43 versions & 1 rubygems