Blame 0009-15_add-configure-file.diff-from-Debian.patch

f147723
From 28dc99ae657768f1724e0bd3a0f598acf1073407 Mon Sep 17 00:00:00 2001
f147723
From: Ruben <ruben@rubenkerkhof.com>
f147723
Date: Sun, 17 Oct 2010 17:21:19 +0200
f147723
Subject: [PATCH 09/14] 15_add-configure-file.diff from Debian
f147723
f147723
---
f147723
 ajaxterm.conf      |   13 +++++++++++++
f147723
 ajaxterm.html      |    3 ++-
f147723
 ajaxterm.js        |    8 ++++++++
f147723
 configure.makefile |    2 ++
f147723
 4 files changed, 25 insertions(+), 1 deletions(-)
f147723
 create mode 100644 ajaxterm.conf
f147723
f147723
diff --git a/ajaxterm.conf b/ajaxterm.conf
f147723
new file mode 100644
f147723
index 0000000..41bd097
f147723
--- /dev/null
f147723
+++ b/ajaxterm.conf
f147723
@@ -0,0 +1,13 @@
f147723
+// Ajaxterm configuration file
f147723
+//
f147723
+// This is a javascript snippet
f147723
+//
f147723
+// Don't forget to restart ajaxterm after editing this file
f147723
+
f147723
+
f147723
+// Sets the terminal width (default: 80)
f147723
+width=80;
f147723
+
f147723
+// Sets the terminal height (default: 25)
f147723
+height=25;
f147723
+
f147723
diff --git a/ajaxterm.html b/ajaxterm.html
f147723
index 9edf759..095e7d6 100644
f147723
--- a/ajaxterm.html
f147723
+++ b/ajaxterm.html
f147723
@@ -7,9 +7,10 @@
f147723
 	<script type="text/javascript" src="sarissa.js"></script>
f147723
 	<script type="text/javascript" src="sarissa_dhtml.js"></script>
f147723
 	<script type="text/javascript" src="ajaxterm.js"></script>
f147723
+	<script type="text/javascript" src="ajaxterm_config.js"></script>
f147723
 	<script type="text/javascript">
f147723
 	window.onload=function() {
f147723
-		t=ajaxterm.Terminal("term",80,25);
f147723
+		t=ajaxterm.Terminal("term",width,height);
f147723
 	};
f147723
 	</script>
f147723
 </head>
f147723
diff --git a/ajaxterm.js b/ajaxterm.js
f147723
index 07eca3b..74eeb39 100644
f147723
--- a/ajaxterm.js
f147723
+++ b/ajaxterm.js
f147723
@@ -4,6 +4,14 @@ ajaxterm.Terminal_ctor=function(id,width,height) {
f147723
 	if(window.ActiveXObject)
f147723
 		ie=1;
f147723
 	var sid=""+Math.round(Math.random()*1000000000);
f147723
+
f147723
+	if (width==0) {
f147723
+		width=80;
f147723
+	}
f147723
+	if (height==0) {
f147723
+		height=25;
f147723
+	}
f147723
+
f147723
 	var query0="s="+sid+"&w="+width+"&h="+height;
f147723
 	var query1=query0+"&c=1&k=";
f147723
 	var buf="";
f147723
diff --git a/configure.makefile b/configure.makefile
f147723
index b3c678f..a30dc23 100644
f147723
--- a/configure.makefile
f147723
+++ b/configure.makefile
f147723
@@ -6,7 +6,9 @@ install:
f147723
 	install -d "%(lib)s"
f147723
 	install ajaxterm.bin "%(bin)s/ajaxterm"
f147723
 	install -m 644 ajaxterm.css ajaxterm.html ajaxterm.js qweb.py sarissa.js sarissa_dhtml.js "%(lib)s"
f147723
+	install -m 644 ajaxterm.conf "%(etc)s"
f147723
 	install -m 755 ajaxterm.py "%(lib)s"
f147723
+	ln -s /etc/ajaxterm.conf "%(lib)s"/ajaxterm_config.js
f147723
 	gzip --best -c ajaxterm.1 > ajaxterm.1.gz
f147723
 	install -d "%(man)s"
f147723
 	install ajaxterm.1.gz "%(man)s"
f147723
-- 
f147723
1.7.3.1
f147723