diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-08-20 07:21:34 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-08-20 07:21:34 +0000 |
commit | d5231c592cade3fffb72ad7dda5a9479d7eda2be (patch) | |
tree | 22a6bcf1a68b0a2ac50d19387b63be6ac481acd7 /modules/kajax/ajax.js | |
parent | 19f4dd21d30bd5955a1a42ed662f31ed7fafefb6 (diff) | |
download | ampache-d5231c592cade3fffb72ad7dda5a9479d7eda2be.tar.gz ampache-d5231c592cade3fffb72ad7dda5a9479d7eda2be.tar.bz2 ampache-d5231c592cade3fffb72ad7dda5a9479d7eda2be.zip |
minor tweaks to playlist stuff, not finished by a longshot, added in licence to kajax js file
Diffstat (limited to 'modules/kajax/ajax.js')
-rwxr-xr-x | modules/kajax/ajax.js | 83 |
1 files changed, 48 insertions, 35 deletions
diff --git a/modules/kajax/ajax.js b/modules/kajax/ajax.js index 976808ce..1d6b57e8 100755 --- a/modules/kajax/ajax.js +++ b/modules/kajax/ajax.js @@ -1,39 +1,53 @@ - var http_request = false;
- var IE = true;
-
- // uid is an array of uids that need to be replaced
- function ajaxPut(url,source) {
+// Copyright (c) 2001 - 2007 Ampache.org
+// All rights reserved.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License v2
+// as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// uid is an array of uids that need to be replaced
+function ajaxPut(url,source) {
- if (document.getElementById(source)) {
- Event.stopObserving(source,'click',function(){ajaxPut(url,source);});
- }
+ if (document.getElementById(source)) {
+ Event.stopObserving(source,'click',function(){ajaxPut(url,source);});
+ }
- if (window.ActiveXObject) { // IE
- try {
- http_request = new ActiveXObject("Msxml2.XMLHTTP");
- }
- catch (e) {
- try {
- http_request = new ActiveXObject("Microsoft.XMLHTTP");
- }
- catch (e) {}
- }
- }
- else { // Mozilla
- IE = false;
- http_request = new XMLHttpRequest();
+ if (window.ActiveXObject) { // IE
+ try {
+ http_request = new ActiveXObject("Msxml2.XMLHTTP");
+ }
+ catch (e) {
+ try {
+ http_request = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ catch (e) {}
}
- if (!http_request) {
- return false;
- }
- http_request.onreadystatechange = function() { getContents(http_request); };
- http_request.open('GET', url, true);
- http_request.send(null);
+ }
+ else { // Mozilla
+ IE = false;
+ http_request = new XMLHttpRequest();
}
+ if (!http_request) {
+ return false;
+ }
+ http_request.onreadystatechange = function() { getContents(http_request); };
+ http_request.open('GET', url, true);
+ http_request.send(null);
+}
+
- function getContents(http_request) {
- if (http_request.readyState == 4) {
- if (http_request.status == 200) {
+function getContents(http_request) {
+ if (http_request.readyState == 4) {
+ if (http_request.status == 200) {
var data = http_request.responseXML;
var newContent = http_request.responseXML.getElementsByTagName('content');
@@ -47,9 +61,9 @@ }
}
- }
+}
- function ajaxPost(url,input,source) {
+function ajaxPost(url,input,source) {
if (document.getElementById(source)) {
Event.stopObserving(source,'click',function(){ajaxPost(url,input,source);});
@@ -91,6 +105,5 @@ http_request.setRequestHeader("Connection", "close");
http_request.send(post_data);
-
- }
+}
|