Sha256: 633643612fbd80a13bc5a9a9f3bbd3a8444e1004e934c31a2bc8e1dc534700ba
Contents?: true
Size: 1.5 KB
Versions: 4
Compression:
Stored size: 1.5 KB
Contents
I"ó(function() { var cli_submit, focus_cli, search_history, set_input_field_width; focus_cli = function() { return $('.input_field').focus(); }; cli_submit = function() { return $('#cli').submit(function(e) { var input; input = $('#command_line').val(); if (input !== 'clear') { $('#shell-history').append("<div class=\"input\"></div>"); $('#shell-cli .prompt').clone().appendTo('#shell-history .input:last'); return $('.input').last().append(input); } }); }; set_input_field_width = function() { var body_w, prompt_w; body_w = $('body').width(); prompt_w = $('#shell-cli label').width(); return $('.input_field').width(body_w - prompt_w - 50); }; search_history = function(e) { var dir; dir = (function() { switch (e.which) { case 38: return 'up'; case 40: return 'down'; } })(); if (dir != null) { return $.post('/satellites/run.js', { command_line: 'history ' + dir }); } }; $(function() { focus_cli(); cli_submit(); set_input_field_width(); $(document).click(function() { return focus_cli(); }); return $('.command_line').keyup(function(e) { return search_history(e); }); }); $(document).ajaxComplete(function() { focus_cli(); cli_submit(); return set_input_field_width(); }); $(window).on('resize', function() { return set_input_field_width(); }); }).call(this); :ET
Version data entries
4 entries across 4 versions & 1 rubygems