changeset 1019:7cba8be42d9e

mod_admin_web: Update to new strophejs location, and jQuery 1.9.1
author Florian Zeitz <florob@babelmonkeys.de>
date Fri, 24 May 2013 15:46:05 +0200
parents 7e060edbb548
children 9839198539c8
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, 5 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mod_admin_web/admin_web/get_deps.sh	Thu May 23 13:54:08 2013 +0100
+++ b/mod_admin_web/admin_web/get_deps.sh	Fri May 24 15:46:05 2013 +0200
@@ -1,5 +1,5 @@
 #!/bin/sh
-JQUERY_VERSION="1.7.2"
+JQUERY_VERSION="1.9.1"
 STROPHE_VERSION="1.0.2"
 BOOTSTRAP_VERSION="1.4.0"
 ADHOC_COMMITISH="87bfedccdb91e2ff7cfb165e989e5259c155b513"
@@ -13,7 +13,7 @@
 wget -O adhoc.js "http://git.babelmonkeys.de/?p=adhocweb.git;a=blob_plain;f=js/adhoc.js;hb=$ADHOC_COMMITISH"
 
 rm -f strophe.min.js
-wget https://github.com/downloads/metajack/strophejs/strophejs-$STROPHE_VERSION.tar.gz && tar xzf strophejs-$STROPHE_VERSION.tar.gz strophejs-$STROPHE_VERSION/strophe.min.js --strip-components=1 && rm strophejs-$STROPHE_VERSION.tar.gz
+wget https://raw.github.com/strophe/strophe.im/gh-pages/strophejs/downloads/strophejs-$STROPHE_VERSION.tar.gz && tar xzf strophejs-$STROPHE_VERSION.tar.gz strophejs-$STROPHE_VERSION/strophe.min.js --strip-components=1 && rm strophejs-$STROPHE_VERSION.tar.gz
 
 cd ../css
 rm -f bootstrap-$BOOTSTRAP_VERSION.min.css
--- a/mod_admin_web/admin_web/www_files/index.html	Thu May 23 13:54:08 2013 +0100
+++ b/mod_admin_web/admin_web/www_files/index.html	Fri May 24 15:46:05 2013 +0200
@@ -7,7 +7,7 @@
 <link rel="stylesheet" type="text/css" href="css/bootstrap-1.4.0.min.css" />
 <link rel="stylesheet" type="text/css" href="css/style.css" />
 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
-<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
+<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
 <script type="text/javascript" src="js/strophe.min.js"></script>
 <script type="text/javascript" src="js/adhoc.js"></script>
 <script type="text/javascript" src="js/main.js"></script>
--- a/mod_admin_web/admin_web/www_files/js/main.js	Thu May 23 13:54:08 2013 +0100
+++ b/mod_admin_web/admin_web/www_files/js/main.js	Fri May 24 15:46:05 2013 +0200
@@ -115,6 +115,7 @@
         connection.sendIQ($iq({to: connection.domain, type: 'get', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB})
             .c('adminfor'), function(e) {
                 var items;
+                var domainpart = Strophe.getDomainFromJid(connection.jid);
                 items = e.getElementsByTagName('item');
                 if (items.length == 0) {
                     alert("You are not an administrator");
@@ -123,11 +124,7 @@
                 }
                 for (i = 0; i < items.length; i++) {
                     var host = $(items[i]).text();
-                    if (host == Strophe.getDomainFromJid(connection.jid)) {
-                        $('#host').append('<option selected>' + host + '</option>');
-                    } else {
-                        $('#host').append('<option>' + host + '</option>');
-                    }
+                    $('<option/>').text(host).prop('selected', host == domainpart).appendTo('#host');
                 }
                 showDisconnect();
                 adminsubHost = $(items[0]).text();