Explorar el Código

Add 1 second wait before performing web search

Just to make it look like processing is happening.
Weiyi Lou hace 10 años
padre
commit
cda1aa0d85
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  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...'
       }
     },