基于 Web 的終端控制臺的 jQuery 插件:jquery-console

jopen 10年前發布 | 55K 次閱讀 jQuery插件 jquery-console

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.baiduhome.net/lib/view/home/1387942512656

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!