Permalink
Browse files

Allow for modal alerts, as well as popup error messages

  • Loading branch information...
1 parent 0e31079 commit 0ce82ec73898f9ce9e357cd6bb351d0282a29781 @mitotic committed Sep 11, 2012
Showing with 8 additions and 3 deletions.
  1. +1 −1 graphterm/lineterm.py
  2. +7 −2 graphterm/www/graphterm.js
View
@@ -1588,7 +1588,7 @@ def terminal(self, term_name=None, command="", height=25, width=80):
self.set_size(term_name, height, width)
if not is_executable(Gls_path) and not Exec_errmsg:
Exec_errmsg = True
- self.screen_callback(term_name, "errmsg", ["File %s is not executable. Did you 'sudo gterm_setup' after 'sudo easy_install graphterm'?" % Gls_path])
+ self.screen_callback(term_name, "alert", ["File %s is not executable. Did you 'sudo gterm_setup' after 'sudo easy_install graphterm'?" % Gls_path])
return term_name, cookie
def term_env(self, term_name, cookie, export=False):
@@ -595,9 +595,12 @@ GTWebSocket.prototype.onmessage = function(evt) {
var action = command[0];
if (action == "abort") {
- GTPopAlert(command[1]);
+ alert(command[1]);
window.location = "/";
+ } else if (action == "alert") {
+ alert(command[1]);
+
} else if (action == "authenticate") {
if (getCookie("GRAPHTERM_AUTH"))
setCookie("GRAPHTERM_AUTH", null);
@@ -734,7 +737,9 @@ GTWebSocket.prototype.onmessage = function(evt) {
openTerminal();
var cmd_type = command[1];
var cmd_arg = command[2];
- if (cmd_type == "errmsg") {
+ if (cmd_type == "alert") {
+ alert(cmd_arg[0]);
+ } else if (cmd_type == "errmsg") {
GTPopAlert("ERROR: "+cmd_arg[0]);
} else if (cmd_type == "save_status") {
GTPopAlert("File "+cmd_arg[0]+": "+(cmd_arg[1] || "saved"));

0 comments on commit 0ce82ec

Please sign in to comment.