Revision: 199
http://hw4mdl.svn.sourceforge.net/hw4mdl/?rev=199&view=rev
Author: trollinger
Date: 2008-01-09 02:36:38 -0800 (Wed, 09 Jan 2008)
Log Message:
-----------
Delete an old file
Removed Paths:
-------------
trunk/moodle/mod/liveclassroom/js/Ajax.js
Deleted: trunk/moodle/mod/liveclassroom/js/Ajax.js
===================================================================
--- trunk/moodle/mod/liveclassroom/js/Ajax.js 2007-08-29 14:32:26 UTC (rev 198)
+++ trunk/moodle/mod/liveclassroom/js/Ajax.js 2008-01-09 10:36:38 UTC (rev 199)
@@ -1,464 +0,0 @@
-/******************************************************************************
- * *
- * Copyright (c) 1999-2007 Wimba, All Rights Reserved. *
- * *
- * COPYRIGHT: *
- * This software is the property of Wimba. *
- * It cannot be copied, used, or modified without obtaining an *
- * authorization from the authors or a mandated member of Wimba. *
- * If such an authorization is provided, any modified version *
- * or copy of the software has to contain this header. *
- * *
- * WARRANTIES: *
- * This software is made available by the authors in the hope *
- * that it will be useful, but without any warranty. *
- * Wimba is not liable for any consequence related to *
- * the use of the provided software. *
- * *
- * Class: ajax.js *
- * *
- * Author: Thomas Rollinger *
- * *
- * Date: May 2007 *
- * *
- ******************************************************************************/
-
-/* $Id$ */
-
-function getURLParametersTab() {
- var sURL = window.document.URL;
-
- var params = new Array();
- if (sURL.indexOf("?") > 0) {
- var arrParams = sURL.split("?");
- var arrURLParams = arrParams[1].split("&");
- var i = 0;
- for (i = 0; i < arrURLParams.length; i = i + 1) {
- var param = arrURLParams[i].split("=");
- params[param[0]] = param[1];
- }
- }
- return params;
-}
-
-
-function getURLParameters() {
- var sURL = window.document.URL.toString();
- var params = "";
- if (sURL.indexOf("?") > 0)
- {
- var arrParams = sURL.split("?");
-
- var arrURLParams = arrParams[1].split("&");
-
- var arrParamNames = new Array(arrURLParams.length);
- var arrParamValues = new Array(arrURLParams.length);
-
- var i = 0;
- for (i = 0; i < arrURLParams.length; i ++ )
- {
- var sParam = arrURLParams[i];
- arrParamNames[i] = sParam[0];
- if (sParam[1] != "")
- params += "&" + unescape(sParam);
-
- }
- params = params.substring(1, params.length)
- }
- return params;
-}
-function getSessionParameters() {
- var params = new Array();
- params["signature"] = session["signature"];
- params["enc_courseId"] = session["courseId"];
- params["enc_email"] = session["email"];
- params["enc_firstname"] = session["firstName"];
- params["enc_lastname"] = session["lastName"];
- params["enc_role"] = session["role"];
- params["time"] = session["timeOfLoad"];
- if (currentProduct != "") {
- params["product"] = currentProduct;
- }
- if (typeSelect != "") {
- params["type"] = typeSelect;
- }
- if (currentId != "") {
- params["id"] = currentId;
- }
- if (currentIdtab != "") {
- params["idtab"] = currentIdtab;
- }
- if (currentCourseTab != "") {
- params["tab"] = currentCourseTab;
- }
- params["studentView"] = studentView;
-
- return params;
-}
-
-function getUrlParameters() {
- var url = "";
- url += "signature=" + session["signature"];
- url += "&enc_courseId=" + session["courseId"];
- url += "&enc_email=" + session["email"];
- url += "&enc_firstname=" + session["firstName"];
- url += "&enc_lastname=" + session["lastName"];
- url += "&enc_role=" + session["role"];
- url += "&time=" + session["timeOfLoad"];
- if (currentProduct != "") {
- url += "&product=" + currentProduct;
- }
- if (typeSelect != "") {
- url += "&type=" + typeSelect;
- }
-
- if (currentId != "") {
- url += "&id=" + currentId;
- }
-
- if (currentIdtab != "") {
- url += "&idtab=" + currentIdtab;
- }
- if (currentCourseTab != "") {
- url += "&tab = " + currentCourseTab;
- }
- url += "&studentView=" + studentView;
-
- return url;
-}
-function DisplayFirstPage(url, div, action, nextAction) {
- if (div == "all") {
- showPopup();
- }
- if (action != null) {
- url += "?action=" + action;
- }
-
-
- transform(url,"js/xsl/wimba.xsl","first",div,nextAction)
-}
-
-function launchAjaxRequest(url, action, init, div,createWorkflow) {
- //display the loading page
- if (div == "all") {
- showPopup();
- }
- if (lcPopup != null) {
- lcPopup.close();
- }
- var parameters = "";
- if (action != "") {
- url += "?action=" + action;
- }
- if (createWorkflow != "" && action!="") {
- url += "&createWorkflow=" + createWorkflow;
- }
- isFilter = false;
- transform(url,"js/xsl/wimba.xsl","",div)
- if (init == true) {
-
- currentId = "";
- currentIdtab = "Info";
- advancedSettings = false;
- }
-
-}
-
-/*
-* Function used to dispaly the rss feed into the podcaster nugget
-*/
-function launchSimpleAjaxRequest(url, action, init, div) {
- //display the loading page
- var xml;
- var parameters = "";
- if (action != "") {
- url += "?action=" + action;
- }
-
- var xmlSource;
- dojo.io.bind({
- url:url, mimetype:"text/plain",
- load:function (type, data, evt) {
- if (data.match("error") == "error") {
- dom = xmlParse(data);
- xmlSource = dom;
- if (xslData == null) { //get the stylesheet
- dojo.io.bind({
- url:"js/xsl/wimba.xsl",
- mimetype:"application/xml",
- load:function (type, data, evt) {
- xslData = data;
- var xml = xsltProcess(xmlSource, xslData);
- hidePopup();
- document.getElementById(div).innerHTML = xml;
- },
- error:BadResult,
- content:null,
- method:"POST"});
- } else {
- transform(xml, xslData, 'all');
- }
- } else {
- displayRssFeed(data, div);
- }
- },
- error:BadResult,
- content:getSessionParameters(),
- method:"POST"});
-}
-
-function getRss(url, id, tab) {
- if(id!=""){
- document.getElementById("rss").innerHTML = document.getElementById("loadingPopup").innerHTML;
- currentId = id;
- currentCourseTab = tab;
- launchSimpleAjaxRequest(url, "getRss", true, "rss");
- }
-}
-
-function transform(urlXml, stylesheet,TypeParams, div,nextAction) {
-
- if(window.ActiveXObject){//ie
-
- if(TypeParams=="first")
- params=getURLParameters();
- else
- params=getUrlParameters();
-
- var sourceDoc = new ActiveXObject("Microsoft.XMLDOM")
- sourceDoc.async = false
- if(urlXml.substr((urlXml.length-1),urlXml.length)=="?")
- sourceDoc.load(urlXml +params)
- else if( urlXml.substr((urlXml.length-1),urlXml.length)=="&")
- sourceDoc.load(urlXml+params)
- else if( urlXml.indexOf("?") == -1)
- sourceDoc.load(urlXml+"?"+params)
- else
- sourceDoc.load(urlXml+"&"+params)
-
- if (div == "all" && sourceDoc.documentElement.getElementsByTagName("type")[0].childNodes[0].nodeValue!="error") {
- createSessionByXmlDocument(sourceDoc);
- }
-
- var xslDoc = new ActiveXObject("Microsoft.XMLDOM")
- xslDoc.async = false
- xslDoc.load("js/xsl/wimba.xsl");
-
- xsltTransformation(sourceDoc,xslDoc,div,nextAction);
-
- }else if (window.XSLTProcessor){//firefox
- if(TypeParams=="first")
- params=getURLParametersTab();
- else
- params=getSessionParameters();
-
- dojo.io.bind({url:urlXml, mimetype:"application/xml", load:function (type, data, evt) {
-
- if (div == "all" && data.documentElement.getElementsByTagName("type")[0].childNodes[0].nodeValue!="error") {
- createSessionByXmlDocument(data);
- }
-
- xmlSource = data;
- //get the stylesheet
- dojo.io.bind({
- url:stylesheet,
- mimetype:"application/xml",
- load:function (type, data, evt) {
- //do the xslt transformation
- xsltTransformation(xmlSource,data,div,nextAction)
- },
- error:BadResult,
- content:null,
- method:"GET"});
-
- },
- error:BadResult,
- content:params,
- method:"POST"});
-
- }else{
- if(TypeParams=="first")
- params=getURLParametersTab();
- else
- params=getSessionParameters();
- var xmlSource;
- dojo.io.bind({url:urlXml, mimetype:"text/plain", load:function (type, data, evt) {
- if (div == "all" && data.match("error") != "error") {
- createSession(data);
- }
- dom = xmlParse(data);
- xmlSource = dom;
-
- dojo.io.bind({
- url:"js/xsl/wimba.xsl",
- mimetype:"application/xml",
- load:function (type, data, evt) {
- //do the xslt transformatio
- xsltTransformation(xmlSource,xslData,div,nextAction)
-
- },
- error:BadResult,
- content:null,
- method:"GET"});
-
-
- },
- error:BadResult,
- content:params,
- method:"POST"});
-
- }
-
-}
-
-function xsltTransformation(xml,xsl,div,nextAction){
-
- if(window.ActiveXObject)//ie
- {
- var result = xml.transformNode(xsl);
-
- if (div == "all") {
- document.getElementById(div).innerHTML = result;
- hidePopup();
- gestionDisplay();
- }
- if (div == "dialInfo") {//click on Info Button
- document.getElementById(div).style.display = "block";
- document.getElementById(div).innerHTML = result;
- document.getElementById(div).innerHTML = document.getElementById(div).innerHTML.replace("myform", "myFormPopup");
- opendDialInformations();
- }
- if(nextAction!="")
- eval(nextAction);
- }else if (window.XSLTProcessor){//firefox
-
- var processor = new XSLTProcessor();
- processor.importStylesheet(xsl);
- document.getElementById(div).innerHTML="";
- var resultDocument = processor.transformToFragment(xml, document);
-
- if (div == "all") {
- hidePopup();
- document.getElementById(div).appendChild(resultDocument);
- gestionDisplay();
- }
- if (div == "dialInfo") {//click on Info Button
- document.getElementById(div).style.display = "block";
-
- document.getElementById(div).appendChild(resultDocument);
- document.getElementById(div).innerHTML = document.getElementById(div).innerHTML.replace("myform", "myFormPopup");
- opendDialInformations();
- }
-
- if(nextAction!="")
- eval(nextAction);
-
- }else{
-
- var xml = xsltProcess(xml, xsl);
-
- //hide the loading page
- if (div == "all") {
- hidePopup();
- document.getElementById(div).innerHTML = xml;
- }
- if (div == "dialInfo") {//click on Info Button
- document.getElementById(div).style.display = "block";
- xml = xml.replace("myform", "myFormPopup");
- document.getElementById(div).innerHTML = xml;
- opendDialInformations();
- }
- gestionDisplay();
- if(nextAction!="")
- eval(nextAction);
- }
-}
-
-
-function Management()
-{
-
-}
-
-
-function BadResult(type, error) {
-
-}
-
-function loadSettings(url, action, div) {
- launchAjaxRequest(url, action, false, div);
-}
-
-function loadNewSettings(url, action, product, type, div,createWorkflow) {
- currentProduct = product;
- typeSelect = type;
- launchAjaxRequest(url, action, false, div,createWorkflow);
-}
-
-function saveDatabase(url, title, comment) {
- var url = url + "?action=updateRecorder&title=" + title + "&comment=" + comment;
- var xml;
- dojo.io.bind({url:url, mimetype:"text/plain", load:function (type, data, evt) {
- if (data == "bad") {
- alert("problem to save");
- }
- }, error:BadResult,content:getURLParametersTab(), method:"POST"});
-
-}
-
-function showInformation(url, id, product) {
- currentId = id;
- currentProduct = product;
- displayBackground();
- launchAjaxRequest(url, "getDialInformation", "false", "dialInfo");
-}
-
-function saveSettings(url, id) {
-
- url = url + "?action=saveSettings&id=" + id;
- var returnValue = true;
- var xml;
- dojo.io.bind({url:url, mimetype:"text/plain", load:function (type, data, evt) {
- if (data == "bad") {
- alert("problem to save the new Settings");
- returnValue = false;
- }
-
- }, error:BadResult, content:getForm(window.document.myform), method:"POST"});
- return returnValue;
-}
-
-function getForm(obj) {
-
- var params = getSessionParameters();
- inputForm = obj.getElementsByTagName("input");
- var i=0;
- for (i = 0; i < inputForm.length; i++) {
- if (inputForm[i].type == "text") {
- params[inputForm[i].name] = inputForm[i].value;
- }
- if (inputForm[i].type == "checkbox") {
- if (inputForm[i].checked) {
- params[inputForm[i].name] = inputForm[i].value;
- } else {
- params[inputForm[i].name] = "false";
- }
- }
- if (inputForm[i].type == "radio") {
- if (inputForm[i].checked) {
- params[inputForm[i].name] = inputForm[i].value;
- }
- }
- }
- inputForm = obj.getElementsByTagName("select");
- for (i = 0; i < inputForm.length; i++) {
- var sel = inputForm[i];
- params[sel.name] = sel.options[sel.selectedIndex].value;
- }
- inputForm = obj.getElementsByTagName("textarea");
- for (i = 0; i < inputForm.length; i++) {
- params[inputForm[i].name] = inputForm[i].value;
- }
- return params;
-}
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|