Sfoglia il codice sorgente

Add 1 second wait before performing web search

Just to make it look like processing is happening.
Weiyi Lou 10 anni fa
parent
commit
cda1aa0d85
1 ha cambiato i file con 7 aggiunte e 2 eliminazioni
  1. 7 2
      js/pgsh.js

+ 7 - 2
js/pgsh.js

@@ -84,8 +84,13 @@ Type "help" for list of commands\n\
     },
     'search': {
       'help': 'Search the web\nUsage: search [query]',
-      'run': function(args) {
-        window.open('https://duckduckgo.com/?q=' + args.join('+'), '_blank')
+      'run': function(args, shell, terminal) {
+        terminal.tags.commandline.hidePrompt()
+        setTimeout(function() {
+          window.open('https://duckduckgo.com/?q=' + args.join('+'), '_blank')
+          terminal.tags.commandline.showPrompt()
+          terminal.update()
+        }, 1000)
         return 'Searching for "' + args.join(' ') + '" in new window...'
       }
     },