changeset 297:a70284e01453

mod_admin_web: Add support for calling adhoc commands
author Florian Zeitz <florob@babelmonkeys.de>
date Sun, 26 Dec 2010 02:20:25 +0100
parents d49702971a5e
children 451e734045d4
files mod_admin_web/admin_web/get_deps.sh mod_admin_web/admin_web/www_files/index.html mod_admin_web/admin_web/www_files/js/main.js
diffstat 3 files changed, 14 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/mod_admin_web/admin_web/get_deps.sh	Fri Dec 24 02:00:50 2010 +0100
+++ b/mod_admin_web/admin_web/get_deps.sh	Sun Dec 26 02:20:25 2010 +0100
@@ -1,8 +1,7 @@
 #!/bin/sh
 cd www_files/js
-wget http://code.jquery.com/jquery-1.4.4.min.js
-git clone git://github.com/metajack/strophejs.git strophejs
-cd strophejs
-make strophe.js && cp strophe.js ../strophe.js
-cd ..
-rm -rf strophejs
+test -e jquery-1.4.4.min.js || wget http://code.jquery.com/jquery-1.4.4.min.js
+test -e adhoc.js || wget http://cgit.babelmonkeys.de/cgit.cgi/adhocweb/plain/js/adhoc.js
+test -e strophe.js || (git clone git://github.com/metajack/strophejs.git strophejs && \
+	cd strophejs && make strophe.js && cp strophe.js ../strophe.js && \
+	cd .. && rm -rf strophejs)
--- a/mod_admin_web/admin_web/www_files/index.html	Fri Dec 24 02:00:50 2010 +0100
+++ b/mod_admin_web/admin_web/www_files/index.html	Sun Dec 26 02:20:25 2010 +0100
@@ -8,10 +8,17 @@
 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
 <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
 <script type="text/javascript" src="js/strophe.js"></script>
+<script type="text/javascript" src="js/adhoc.js"></script>
 <script type="text/javascript" src="js/main.js"></script>
 </head>
 <body>
 <div id='left'>
+  <div id='menu'>
+    <ul>
+      <li id='adhocMenu'><a href="#">General</a></li>
+      <li id='serverMenu'><a href="#">Server</a></li>
+    </ul>
+  </div>
   <div id='login'>
     <form id='cred' name='cred'>
       <label for='jid'>JID:</label><br/>
@@ -23,16 +30,10 @@
       <input type='submit' id='connect' value='connect' />
     </form>
   </div>
-  <div id='menu'>
-    <ul>
-      <li id='adhocMenu'><a href="#">General</a></li>
-      <li id='serverMenu'><a href="#">Server</a></li>
-    </ul>
-  </div>
 </div>
 
 <div id='main'>
-  <div id="adhoc">More later</div>
+  <div id="adhoc"></div>
   <div id="s2sList">
     <div class="container">
       Incomming S2S connections:
--- a/mod_admin_web/admin_web/www_files/js/main.js	Fri Dec 24 02:00:50 2010 +0100
+++ b/mod_admin_web/admin_web/www_files/js/main.js	Sun Dec 26 02:20:25 2010 +0100
@@ -62,6 +62,7 @@
     } else if (status == Strophe.Status.CONNECTED) {
         log('Strophe is connected.');
         showDisconnect();
+	Adhoc.checkFeatures('#adhoc', connection.domain);
         connection.send($iq({to: pubsubHost, type: 'set', id: connection.getUniqueId()}).c('pubsub', {xmlns: Strophe.NS.PUBSUB})
                 .c('subscribe', {node: Strophe.NS.S2SPUBSUB, jid: connection.jid}));
         connection.addHandler(_cbNewS2S, Strophe.NS.PUBSUB + '#event', 'message');