Permalink
Browse files

yet more cleanup

  • Loading branch information...
Carlos Scheidegger
Carlos Scheidegger committed Mar 20, 2013
1 parent a793edc commit 253ff8d36ca0683f53f0e7fa8aecbb8043322f0b
Showing with 6 additions and 33 deletions.
  1. +0 −33 htdocs/main.js
  2. +6 −0 htdocs/shell_tab.js
View
@@ -1,36 +1,3 @@
-var interpreter = {
- 'plot': function(cmd) {
- rclient.capture_answers(cmd.ps.length, function(result) {
- rclient.post_div(create_scatterplot.apply(result));
- });
- for (var i=0; i<cmd.ps.length; ++i) {
- rclient.send(cmd.ps[i], rclient.wrap_command);
- }
- },
- 'logout': function(cmd) {
- $.cookies.set('user', null);
- $.cookies.set('sessid', null);
- window.location.href = '/login.html';
- }
-};
-
-function interpret_command(command)
-{
- if (command[0] === '@') {
- var cmd = parser.parse(command);
- interpreter[cmd.id](cmd);
- } else {
- // rclient.log(command);
- rclient.send(command, rclient.markdown_wrap_command);
- }
-}
-
-function transpose(ar) {
- return _.map(_.range(ar[0].length), function(i) {
- return _.map(ar, function(lst) { return lst[i]; });
- });
-}
-
function main_init() {
rclient = RClient.create({
debug: false,
View
@@ -29,6 +29,12 @@ var shell = (function() {
function handle_scatterplot(data) {
+ function transpose(ar) {
+ return _.map(_.range(ar[0].length), function(i) {
+ return _.map(ar, function(lst) { return lst[i]; });
+ });
+ }
+
var opts = {
x: function(d) { return d[0]; },
y: function(d) { return d[1]; }

0 comments on commit 253ff8d

Please sign in to comment.