????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.107 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/appsrv.astacus.se/apps/school/www_old/ |
Upload File : |
function SchoolFilesData()
{
this.applicationInfo = new ACFile();
this.www = new NodeWww();
}
function NodeWww()
{
this.filesArray = new Array();
this.css = new NodeCss();
this.js = new NodeJs();
this.res = new NodeRes();
this.spec = new NodeSpec();
this.html = new NodeHtml();
this.image = new NodeImage();
}
function NodeCss()
{
this.filesArray = new Array();
}
function NodeJs()
{
this.filesArray = new Array();
}
function NodeRes()
{
this.soundFilesArray = new Array();
}
function NodeSpec()
{
this.filesArray = new Array();
this.lib = new NodeLib();
}
function NodeHtml()
{
this.levelsArray = new Array();
}
function NodeImage()
{
this.gameSuccessAnimFile = new ACFile();
this.levelsArray = new Array();
}
function ACFile()
{
this.name = '';
this.version = '';
}
function NodeLib()
{
this.jasmine1_2_0 = new NodeJasmine1_2_0();
}
function NodeJasmine1_2_0()
{
this.filesArray = new Array();
}
function NodeLevel()
{
this.name = '';
this.fileCategoriesHtml = new ACFile();
this.categoriesArray = new Array();
}
function NodeCategory()
{
this.name = '';
this.lessonsArray = new Array();
this.filesArray = new Array();
}
function NodeLesson()
{
this.name = '';
this.filesArray = new Array();
}
function shared_loadXMLDoc(filename)
{
if (window.XMLHttpRequest)
{
xhttp=new XMLHttpRequest();
}
else // code for IE5 and IE6
{
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",filename,false);
xhttp.send();
return xhttp.responseXML;
}
function shared_readLocalFileVersionsInfoXML()
{
var xmlDoc = shared_loadXMLDoc("LocalFileVersionsInfo.xml");
//document.write('<input type="button" value="Reload" onClick="page_load()" />');
//document.write("<br>");
var pSchoolFilesData = new SchoolFilesData();
pSchoolFilesData.applicationInfo = getApplicationInfo(xmlDoc);
pSchoolFilesData.www = getWWWInfo(xmlDoc);
return (pSchoolFilesData);
}
function shared_readServerFileVersionsInfoXML()
{
var xmlDoc = shared_loadXMLDoc("ServerFileVersionsInfo.xml");
//document.write('<input type="button" value="Reload" onClick="page_load()" />');
//document.write("<br>");
var pSchoolFilesData = new SchoolFilesData();
pSchoolFilesData.applicationInfo = getApplicationInfo(xmlDoc);
pSchoolFilesData.www = getWWWInfo(xmlDoc);
return (pSchoolFilesData);
}
function shared_download_allFilesFromServerFileVersionsInfoXml()
{
var pArrayAllFiles = new Array();
var pSchoolFilesDataLocal = null;
var pSchoolFilesDataServer = shared_readServerFileVersionsInfoXML();
var pArrayWww = shared_compareWWWFiles(null, pSchoolFilesDataServer.www);
var pArrayCss = shared_compareCSSFiles(null, pSchoolFilesDataServer.www.css);
var pArrayJs = shared_compareJSFiles(null, pSchoolFilesDataServer.www.js);
var pArrayRes = shared_compareResFiles(null, pSchoolFilesDataServer.www.res);
var pArraySpec = shared_compareSpecFiles(null, pSchoolFilesDataServer.www.spec);
var pArrayHtml = shared_compareHtmlFiles(null, pSchoolFilesDataServer.www.html);
var pArrayImage = shared_compareImageFiles(null, pSchoolFilesDataServer.www.image);
/*writeEachObjectInArray(pArrayWww);
writeEachObjectInArray(pArrayCss);
writeEachObjectInArray(pArrayJs);
writeEachObjectInArray(pArrayRes);
writeEachObjectInArray(pArraySpec);
writeEachObjectInArray(pArrayHtml);*/
//writeEachObjectInArray(pArrayImage);
pArrayAllFiles = AddArrayFiles(pArrayWww, pArrayAllFiles);
pArrayAllFiles = AddArrayFiles(pArrayCss, pArrayAllFiles);
pArrayAllFiles = AddArrayFiles(pArrayJs, pArrayAllFiles);
pArrayAllFiles = AddArrayFiles(pArrayRes, pArrayAllFiles);
pArrayAllFiles = AddArrayFiles(pArraySpec, pArrayAllFiles);
pArrayAllFiles = AddArrayFiles(pArrayHtml, pArrayAllFiles);
pArrayAllFiles = AddArrayFiles(pArrayImage, pArrayAllFiles);
return (pArrayAllFiles);
}
function shared_download_compareLocalAndServerFileVersions()
{
var pArrayAllFiles = new Array();
var pSchoolFilesDataLocal = shared_readLocalFileVersionsInfoXML();
var pSchoolFilesDataServer = shared_readServerFileVersionsInfoXML();
if (Number(pSchoolFilesDataLocal.applicationInfo.version) < Number(pSchoolFilesDataServer.applicationInfo.version))
{
var pArrayWww = shared_compareWWWFiles(pSchoolFilesDataLocal.www, pSchoolFilesDataServer.www);
var pArrayCss = shared_compareCSSFiles(pSchoolFilesDataLocal.www.css, pSchoolFilesDataServer.www.css);
var pArrayJs = shared_compareJSFiles(pSchoolFilesDataLocal.www.js, pSchoolFilesDataServer.www.js);
var pArrayRes = shared_compareResFiles(pSchoolFilesDataLocal.www.res, pSchoolFilesDataServer.www.res);
var pArraySpec = shared_compareSpecFiles(pSchoolFilesDataLocal.www.spec, pSchoolFilesDataServer.www.spec);
var pArrayHtml = shared_compareHtmlFiles(pSchoolFilesDataLocal.www.html, pSchoolFilesDataServer.www.html);
var pArrayImage = shared_compareImageFiles(pSchoolFilesDataLocal.www.image, pSchoolFilesDataServer.www.image);
/*writeEachObjectInArray(pArrayWww);
writeEachObjectInArray(pArrayCss);
writeEachObjectInArray(pArrayJs);
writeEachObjectInArray(pArrayRes);
writeEachObjectInArray(pArraySpec);
writeEachObjectInArray(pArrayHtml);
writeEachObjectInArray(pArrayImage);*/
pArrayAllFiles = AddArrayFiles(pArrayWww, pArrayAllFiles);
pArrayAllFiles = AddArrayFiles(pArrayCss, pArrayAllFiles);
pArrayAllFiles = AddArrayFiles(pArrayJs, pArrayAllFiles);
pArrayAllFiles = AddArrayFiles(pArrayRes, pArrayAllFiles);
pArrayAllFiles = AddArrayFiles(pArraySpec, pArrayAllFiles);
pArrayAllFiles = AddArrayFiles(pArrayHtml, pArrayAllFiles);
pArrayAllFiles = AddArrayFiles(pArrayImage, pArrayAllFiles);
}
return (pArrayAllFiles);
}
function AddArrayFiles(pArray, pToArray)
{
if (pArray != null && pToArray != null)
{
for (var indexFile = 0; indexFile < pArray.length; indexFile++)
{
pToArray.push(pArray[indexFile]);
}
}
return (pToArray);
}
function shared_compareWWWFiles(pNodeWWWLocal, pNodeWWWServer)
{
var serverPath = 'www/';
var pArray = new Array();
for (var indexFile = 0; indexFile < pNodeWWWServer.filesArray.length; indexFile++)
{
var pFileServer = pNodeWWWServer.filesArray[indexFile];
if (pNodeWWWLocal != null)
{
var pFileLocal = pNodeWWWLocal.filesArray[indexFile];
var isDownload = shared_isDownloadRequired(pFileLocal, pFileServer);
if (isDownload)
{
pArray.push(serverPath + pFileServer.name);
}
}
else
{
pArray.push(serverPath + pFileServer.name);
}
}
return (pArray);
}
function shared_compareCSSFiles(pNodeCssLocal, pNodeCssServer)
{
var serverPath = 'www/css/';
var pArray = new Array();
for (var indexFile = 0; indexFile < pNodeCssServer.filesArray.length; indexFile++)
{
var pFileServer = pNodeCssServer.filesArray[indexFile];
if (pNodeCssLocal != null)
{
var pFileLocal = pNodeCssLocal.filesArray[indexFile];
var isDownload = shared_isDownloadRequired(pFileLocal, pFileServer);
if (isDownload)
{
pArray.push(serverPath + pFileServer.name);
}
}
else
{
pArray.push(serverPath + pFileServer.name);
}
}
return (pArray);
}
function shared_compareJSFiles(pNodeJsLocal, pNodeJsServer)
{
var serverPath = 'www/js/';
var pArray = new Array();
for (var indexFile = 0; indexFile < pNodeJsServer.filesArray.length; indexFile++)
{
var pFileServer = pNodeJsServer.filesArray[indexFile];
if (pNodeJsLocal != null)
{
var pFileLocal = pNodeJsLocal.filesArray[indexFile];
var isDownload = shared_isDownloadRequired(pFileLocal, pFileServer);
if (isDownload)
{
pArray.push(serverPath + pFileServer.name);
}
}
else
{
pArray.push(serverPath + pFileServer.name);
}
}
return (pArray);
}
function shared_compareResFiles(pNodeResLocal, pNodeResServer)
{
var serverPath = 'www/res/sounds/';
var pArray = new Array();
for (var indexFile = 0; indexFile < pNodeResServer.soundFilesArray.length; indexFile++)
{
var pFileServer = pNodeResServer.soundFilesArray[indexFile];
if (pNodeResLocal != null)
{
var pFileLocal = pNodeResLocal.soundFilesArray[indexFile];
var isDownload = shared_isDownloadRequired(pFileLocal, pFileServer);
if (isDownload)
{
pArray.push(serverPath + pFileServer.name);
}
}
else
{
pArray.push(serverPath + pFileServer.name);
}
}
return (pArray);
}
function shared_compareSpecFiles(pNodeSpecLocal, pNodeSpecServer)
{
var serverPathSpec = 'www/spec/';
var pArray = new Array();
for (var indexFile = 0; indexFile < pNodeSpecServer.filesArray.length; indexFile++)
{
var pFileServer = pNodeSpecServer.filesArray[indexFile];
if (pNodeSpecLocal != null)
{
var pFileLocal = pNodeSpecLocal.filesArray[indexFile];
var isDownload = shared_isDownloadRequired(pFileLocal, pFileServer);
if (isDownload)
{
pArray.push(serverPathSpec + pFileServer.name);
}
}
else
{
pArray.push(serverPathSpec + pFileServer.name);
}
}
var serverPathLibJasmine = 'www/spec/lib/jasmine-1.2.0/';
var pJasmine120Local = (pNodeSpecLocal != null) ? pNodeSpecLocal.lib.jasmine1_2_0 : null;
var pJasmine120Server = pNodeSpecServer.lib.jasmine1_2_0;
for (var indexFile = 0; indexFile < pJasmine120Server.filesArray.length; indexFile++)
{
var pFileServer = pJasmine120Server.filesArray[indexFile];
if (pNodeSpecLocal != null)
{
var pFileLocal = pJasmine120Local.filesArray[indexFile];
var isDownload = shared_isDownloadRequired(pFileLocal, pFileServer);
if (isDownload)
{
pArray.push(serverPathLibJasmine + pFileServer.name);
}
}
else
{
pArray.push(serverPathLibJasmine + pFileServer.name);
}
}
return (pArray);
}
function shared_compareHtmlFiles(pNodeHtmlLocal, pNodeHtmlServer)
{
var serverPathHtml = 'www/Html/';
var pArray = new Array();
for (var indexLevel = 0; indexLevel < pNodeHtmlServer.levelsArray.length; indexLevel++)
{
var pLevelServer = pNodeHtmlServer.levelsArray[indexLevel];
var serverPathHtmlLevel = serverPathHtml + pLevelServer.name + '/';
if (pNodeHtmlLocal != null)
{
var pLevelsLocal = pNodeHtmlLocal.levelsArray[indexLevel];
var isDownload = shared_isDownloadRequired(pLevelsLocal.fileCategoriesHtml, pLevelServer.fileCategoriesHtml);
if (isDownload)
{
pArray.push(serverPathHtmlLevel + pLevelServer.fileCategoriesHtml.name);
}
}
else
{
pArray.push(serverPathHtmlLevel + pLevelServer.fileCategoriesHtml.name);
}
for (var indexCategory = 0; indexCategory < pLevelServer.categoriesArray.length; indexCategory++)
{
var pCategoriesServer = pLevelServer.categoriesArray[indexCategory];
var serverPathHtmlLevelCategory = serverPathHtmlLevel + pCategoriesServer.name + '/';
var pCategoriesLocal = null;
if (pNodeHtmlLocal != null)
{
pCategoriesLocal = pLevelsLocal.categoriesArray[indexCategory];
}
for (var indexFile = 0; indexFile < pCategoriesServer.filesArray.length; indexFile++)
{
var pFileServer = pCategoriesServer.filesArray[indexFile];
if (pNodeHtmlLocal != null)
{
var pFileLocal = pCategoriesLocal.filesArray[indexFile];
var isDownload = shared_isDownloadRequired(pFileLocal, pFileServer);
if (isDownload)
{
pArray.push(serverPathHtmlLevelCategory + pFileServer.name);
}
}
else
{
pArray.push(serverPathHtmlLevelCategory + pFileServer.name);
}
}
}
}
return (pArray);
}
function shared_compareImageFiles(pNodeImageLocal, pNodeImageServer)
{
var serverPathImg = 'www/img/';
var pArray = new Array();
if (pNodeImageLocal != null)
{
var isDownload = shared_isDownloadRequired(pNodeImageLocal.gameSuccessAnimFile, pNodeImageServer.gameSuccessAnimFile);
if (isDownload)
{
pArray.push(serverPathImg + pNodeImageServer.gameSuccessAnimFile.name);
}
}
else
{
pArray.push(serverPathImg + pNodeImageServer.gameSuccessAnimFile.name);
}
for (var indexLevel = 0; indexLevel < pNodeImageServer.levelsArray.length; indexLevel++)
{
var pLevelServer = pNodeImageServer.levelsArray[indexLevel];
var serverPathImgLevel = serverPathImg + pLevelServer.name + '/';
var pLevelsLocal = null;
if (pNodeImageLocal != null)
{
pLevelsLocal = pNodeImageLocal.levelsArray[indexLevel];
}
for (var indexCategory = 0; indexCategory < pLevelServer.categoriesArray.length; indexCategory++)
{
var pCategoriesServer = pLevelServer.categoriesArray[indexCategory];
var serverPathImgLevelCategory = serverPathImgLevel + pCategoriesServer.name + '/';
var pCategoriesLocal = null;
if (pNodeImageLocal != null)
{
pCategoriesLocal = pLevelsLocal.categoriesArray[indexCategory];
}
for (var indexLesson = 0; indexLesson < pCategoriesServer.lessonsArray.length; indexLesson++)
{
var pLessonsServer = pCategoriesServer.lessonsArray[indexLesson];
var serverPathImgLevelCategoryLesson = serverPathImgLevelCategory + pLessonsServer.name + '/';
var pLessonsLocal = null;
if (pNodeImageLocal != null)
{
pLessonsLocal = pCategoriesLocal.lessonsArray[indexLesson];
}
for (var indexFile = 0; indexFile < pLessonsServer.filesArray.length; indexFile++)
{
var pFileServer = pLessonsServer.filesArray[indexFile];
if (pNodeImageLocal != null)
{
var pFileLocal = pLessonsLocal.filesArray[indexFile];
var isDownload = shared_isDownloadRequired(pFileLocal, pFileServer);
if (isDownload)
{
pArray.push(serverPathImgLevelCategoryLesson + pFileServer.name);
}
}
else
{
pArray.push(serverPathImgLevelCategoryLesson + pFileServer.name);
}
}
}
}
}
return (pArray);
}
function shared_isDownloadRequired(pFileLocal, pFileServer)
{
if (pFileLocal == null || pFileServer == null)
{
return (false);
}
return (Number(pFileLocal.version) < Number(pFileServer.version));
}
function getApplicationInfo(xmlDoc)
{
var eApplication = xmlDoc.getElementsByTagName('Application')[0];
var pApplication = getFileInfo(eApplication);
return (pApplication);
}
function getWWWInfo(xmlDoc)
{
var pNodeWww = new NodeWww();
var eWWW = xmlDoc.getElementsByTagName('www')[0];
for (i=0; i<3; i++)
{
var eFile = eWWW.getElementsByTagName('file')[i];
pNodeWww.filesArray.push(getFileInfo(eFile));
}
pNodeWww.css = getCSSData(eWWW);
pNodeWww.js = getJSData(eWWW);
pNodeWww.res = getResData(eWWW);
pNodeWww.spec = getSpecData(eWWW);
pNodeWww.html = getHTMlData(eWWW);
pNodeWww.image = getImagesData(eWWW);
return (pNodeWww);
}
function getCSSData(eWWW)
{
var eCSS = eWWW.getElementsByTagName('css')[0];
var pNodeCss = new NodeCss();
var nChildElements = eCSS.childElementCount;
for (i=0; i<nChildElements; i++)
{
var eFile = eCSS.getElementsByTagName('file')[i];
pNodeCss.filesArray.push(getFileInfo(eFile));
}
return (pNodeCss);
}
function getJSData(eWWW)
{
var eJS = eWWW.getElementsByTagName('js')[0];
var pNodeJs = new NodeJs();
var nChildElements = eJS.childElementCount;
for (i=0; i<nChildElements; i++)
{
var eFile = eJS.getElementsByTagName('file')[i];
pNodeJs.filesArray.push(getFileInfo(eFile));
}
return (pNodeJs);
}
function getResData(eWWW)
{
var eRes = eWWW.getElementsByTagName('res')[0];
var eSounds = eRes.getElementsByTagName('sounds')[0];
var pNodeRes = new NodeRes();
var nChildElements = eSounds.childElementCount;
for (i=0; i<nChildElements; i++)
{
var eFile = eSounds.getElementsByTagName('file')[i];
pNodeRes.soundFilesArray.push(getFileInfo(eFile));
}
return (pNodeRes);
}
function getSpecData(eWWW)
{
var pNodeSpec = new NodeSpec();
var eSpec = eWWW.getElementsByTagName('spec')[0];
for (i=0; i<2; i++)
{
var eFile = eSpec.getElementsByTagName('file')[i];
addFileInfoToArray(pNodeSpec.filesArray, eFile);
}
var eLib = eSpec.getElementsByTagName('lib')[0];
var eJasmine = eLib.getElementsByTagName('jasmine-1.2.0')[0];
var nChildElements = eJasmine.childElementCount;
for (i=0; i<nChildElements; i++)
{
var eFile = eJasmine.getElementsByTagName('file')[i];
pNodeSpec.lib.jasmine1_2_0.filesArray.push(getFileInfo(eFile));
}
return (pNodeSpec);
}
function getHTMlData(eWWW)
{
var pNodeHtml = new NodeHtml();
var eHtml = eWWW.getElementsByTagName('Html')[0];
var nChildElementsLevels = eHtml.childElementCount;
for (i=0; i<nChildElementsLevels; i++)
{
var eLevel = eHtml.getElementsByTagName('Level')[i];
var eFileCategoriesHtml = eLevel.getElementsByTagName('file')[0];
var pNodeLevel = new NodeLevel();
pNodeLevel.name = GetAttributeValue(eLevel, 'Name');
pNodeLevel.fileCategoriesHtml = getFileInfo(eFileCategoriesHtml);
var nChildElementsCategories = eLevel.childElementCount;
for (j=0; j<(nChildElementsCategories - 1); j++)
{
var eCategory = eLevel.getElementsByTagName('Category')[j];
var pNodeCategory = new NodeCategory();
pNodeCategory.name = GetAttributeValue(eCategory, 'Name');
var nChildElementsHtmlFiles = eCategory.childElementCount;
for (k=0; k<nChildElementsHtmlFiles; k++)
{
var eFile = eCategory.getElementsByTagName('file')[k];
pNodeCategory.filesArray.push(getFileInfo(eFile));
}
pNodeLevel.categoriesArray.push(pNodeCategory);
}
pNodeHtml.levelsArray.push(pNodeLevel);
}
return (pNodeHtml);
}
function getImagesData(eWWW)
{
var pNodeImage = new NodeImage();
var eImg = eWWW.getElementsByTagName('img')[0];
var eGameSuccessAnimationFile = eImg.getElementsByTagName('file')[0];
pNodeImage.gameSuccessAnimFile = getFileInfo(eGameSuccessAnimationFile);
var nChildElementsLevels = eImg.childElementCount - 1;
for (i=0; i<nChildElementsLevels; i++)
{
var eLevel = eImg.getElementsByTagName('Level')[i];
var pNodeLevel = new NodeLevel();
pNodeLevel.name = GetAttributeValue(eLevel, 'Name');
var nChildElementsCategories = eLevel.childElementCount;
for (j=0; j<nChildElementsCategories; j++)
{
var eCategory = eLevel.getElementsByTagName('Category')[j];
var pNodeCategory = new NodeCategory();
pNodeCategory.name = GetAttributeValue(eCategory, 'Name');
var nChildElementsLessons = eCategory.childElementCount;
for (k=0; k<nChildElementsLessons; k++)
{
var eLesson = eCategory.getElementsByTagName('Lesson')[k];
var pNodeLesson = new NodeLesson();
pNodeLesson.name = GetAttributeValue(eLesson, 'Name');
var nChildElementsImageFiles = eLesson.childElementCount;
for (l=0; l<nChildElementsImageFiles; l++)
{
var eImageFile = eLesson.getElementsByTagName('file')[l];
pNodeLesson.filesArray.push(getFileInfo(eImageFile));
}
pNodeCategory.lessonsArray.push(pNodeLesson);
}
pNodeLevel.categoriesArray.push(pNodeCategory);
}
pNodeImage.levelsArray.push(pNodeLevel);
}
return (pNodeImage);
}
function addFileInfoToArray(pArray, eElement)
{
if (eElement != null)
{
pArray.push(getFileInfo(eElement));
}
}
function getFileInfo(eFile)
{
var pFile = new ACFile();
pFile.name = GetAttributeValue(eFile, 'Name');
pFile.version = GetAttributeValue(eFile, 'Version');
return (pFile);
}
function GetElementValue(parentNode, elementName)
{
var eNode = parentNode.getElementsByTagName(elementName)[0];
//document.write(elementName + ' = ' + eNode.childNodes[0].nodeValue);
//document.write(", ");
//document.write("<br>");
return (eNode.childNodes[0].nodeValue);
}
function GetAttributeValue(parentNode, attributeName)
{
//document.write(attributeName + ' = ' + parentNode.attributes[attributeName].nodeValue);
//document.write(", ");
//document.write("<br>");
return (parentNode.attributes[attributeName].nodeValue);
}
function writeObject(pObject)
{
document.write("Object = " + pObject);
document.write("<br>");
}
function writeEachObjectInArray(pArray)
{
if (pArray != null)
{
for (var indexFile = 0; indexFile < pArray.length; indexFile++)
{
document.write("pArray Object = " + pArray[indexFile]);
document.write("<br>");
}
}
}