基于 Web 的终端控制台的 jQuery 插件:jquery-console

jopen 8年前

jquery-console 实现了简单的基于 Web 浏览器的终端控制台的 jQuery 插件。

可选设置:     autofocus              bool      Autofocus the terminal, rather than                                    having to click on it.     promptHistory          bool      Provide history support (kind of crappy,                                    needs doing properly.)     historyPreserveColumn  bool      Preserve the column you were one when                                    switching between history.     welcomeMessage         string    Just a first message to display on the                                    terminal.     promptLabel            string    Prompt string like 'JavaScript> '.     cols                   integer   the number of cols, this value is only                                    used by the command completion to format                                    the list of results.     commandValidate        function  When user hits return, validate                                    whether to trigger commandHandle and                                    re-prompt.     commandHandle          function  Handle the command line, return a                                    string, boolean, or list                                    of {msg:"foo",className:"my-css-class"}.                                    commandHandle(line,report) is                                    called. Report function is for you                                    to report a result of the command                                    asynchronously.     commandComplete        function  Handle the command completion when the                                    tab key is pressed. It returns a list                                    of string completion suffixes.     animateScroll          bool      Whether to animate the scroll to                                    top. Currently disabled.     charInsertTrigger      function  Predicate for whether to allow                                    character insertion.                                    charInsertTrigger(char,line) is called.     cancelHandle           function  Handle a user-signaled interrupt.     fadeOnReset            bool      Whether to trigger a fade in/out when                                    the console is reset.  Defaults to true.

在线演示:http://chrisdone.com/jquery-console/

基于 Web 的终端控制台的 jQuery 插件:jquery-console

项目主页:http://www.open-open.com/lib/view/home/1387942512656