Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

web: add debug function. closes #21

  • Loading branch information...
commit ec5734de60227dc1df032ca376792533637d25a2 1 parent f3f9219
@billiob billiob authored
View
10 amsn2/ui/front_ends/web/static/amsn2.css
@@ -480,3 +480,13 @@ input.stdButton {
border: 2px red solid;
text-align: left;
}
+#debug {
+ width: 100%;
+ background-color: #aff;
+ opacity: 0.8;
+}
+.debug-msg {
+ color: #000;
+ border: 2px blue solid;
+ text-align: left;
+}
View
1  amsn2/ui/front_ends/web/static/amsn2.html
@@ -12,6 +12,7 @@
<body>
<div id="info"></div>
<div id="error"></div>
+ <div id="debug"></div>
<div id="login" style="display:none">
<form id="signin" action="/signin">
Username:<input name="username" type="text" /> <br/>
View
24 amsn2/ui/front_ends/web/static/js/amsn2.js
@@ -1,9 +1,12 @@
-// TODO: have info/debug/err functions
var g_loop = null;
// Utils {{{
+function debug(s) {
+ // TODO
+}
+
var g_t_info = 0;
function info(s) {
var inf = $('info');
@@ -41,6 +44,25 @@ function error(e) {
}
err.insert(msg);
}
+
+function debug(d) {
+ var dbg = $('debug');
+ var msg = new Element('div', {class: 'debug-msg'});
+ var children = dbg.childElements();
+ var a = new Element('a', {class: 'debug-close'});
+ var s = new Element('span');
+
+ s.update(d);
+ a.update('[X] ');
+ a.observe('click', function(event) {
+ elt = Event.findElement(event, 'div');
+ elt.remove();
+ });
+
+ msg.insert(a);
+ msg.insert(s);
+ dbg.insert(msg);
+}
//}}}
// Contact List {{{
var g_cl = null;
Please sign in to comment.
Something went wrong with that request. Please try again.