Index: www.reactos.org/drupal/sites/all/modules/reactos/getbuilds/getbuilds.css =================================================================== --- www.reactos.org/drupal/sites/all/modules/reactos/getbuilds/getbuilds.css (Revision 849) +++ www.reactos.org/drupal/sites/all/modules/reactos/getbuilds/getbuilds.css (Arbeitskopie) @@ -4,110 +4,28 @@ FILE: web/reactos.org/htdocs/getbuilds/getbuilds.css PURPOSE: Easily download prebuilt ReactOS Revisions COPYRIGHT: Copyright 2007-2009 Colin Finck - Copyright 2013 ReactOS Project + Copyright 2013 The ReactOS Project */ - - -ul.web { - list-style-type: none !important; - margin-top: 0; - margin-bottom: 1em; -} - -ul.web li { - vertical-align: top; - margin-top: 5px; -} -ul.web li:before{ - background: url("./images/web.png") no-repeat; - content: " "; - height: 16px; - width: 20px; - display:block; - float:left; -} - #js_stuff { /* Will be shown by the JavaScript */ display: none; } -#showrev td { - vertical-align: top; +#showrev td{vertical-align:top;padding:10px;} +#revcontrols img{vertical-align:middle;cursor:pointer;} +#revcontrols input{vertical-align:middle;} +#info-wrapper{margin: 20px 5px 7px 5px; color: #888;} +#infobox{float:left; } +#pagesbox{font-weight:700;text-align:right; float:right;} +.datatable img{border:0;vertical-align:top;padding:1px;} +.blue_area{background-color:#E1EAFB;padding:10px;} +.grey_area{background:#f8f8f8;background-position:5px center;border:1px solid #ccc;border-radius:4px;margin-bottom:20px;margin-top:10px;padding:10px;} +.datatable tr td:first-child{ +background-image: url(/sites/all/modules/reactos/getbuilds/images/cd.png); +background-repeat:no-repeat; +background-position:5px center; +padding-left: 30px; } - -#revcontrols img { - vertical-align: middle; - cursor: pointer; -} - -#revcontrols input { - vertical-align: middle; -} - -#ajax_loading { - font-weight: bold; - margin-left: 20px; -} - -#infotable -{ - margin-top: 2em; - width: 100%; -} - -#pagesbox { - font-weight: bold; - text-align: right; -} - -.datatable { - cursor: pointer; - width: 100%; -} - -.datatable tr.head th.fname { - width: 50%; - border-radius: 2px 0 0 0; -} - -.datatable tr.head th.fsize, -.datatable tr.head th.fdate { - width: 25%; -} -.datatable tr.head th.fdate{ - border-radius: 0 2px 0 0; -} - -.datatable tr.odd td a, -.datatable tr.even td a { - color: #000000 !important; - display: block; - text-decoration: none; -} - -.datatable img { - border: 0; - padding: 1px; - vertical-align: top; -} - -.round_corners{ - background-color :#C9DAFF; - border: 1px solid #ccc; - border-radius: 3px; - box-shadow: 0 0 5px #fff inset; - padding: 10px; -} -.round_corners_grey{ - background-color :#eee; - border: 2px solid #ccc; - border-radius: 3px; - margin: 0 0 10px 0; - padding: 10px; -} - -#showrev td -{ - padding:10px; -} +#no_script{color: red;} +/*hide Drupal's language switcher, because it has no effect on this page */ +#block-locale-language{display:none;} \ No newline at end of file Index: www.reactos.org/drupal/sites/all/modules/reactos/getbuilds/getbuilds.js.php =================================================================== --- www.reactos.org/drupal/sites/all/modules/reactos/getbuilds/getbuilds.js.php (Revision 849) +++ www.reactos.org/drupal/sites/all/modules/reactos/getbuilds/getbuilds.js.php (Arbeitskopie) @@ -5,196 +5,124 @@ PURPOSE: Easily download prebuilt ReactOS Revisions COPYRIGHT: Copyright 2007-2009 Colin Finck */ + require_once("./config.inc.php"); + require_once("./languages.inc.php"); + $lang = get_language(); + require_once("./lang/$lang.inc.php"); ?> +var $ = jQuery.noConflict(); var data = new Array(); -var CurrentPage; -var FileCount; -var FullRange; -var inputbox_startrev; -var inputbox_endrev; -var PageCount; +var FileCount, inputbox_startrev, inputbox_endrev, current_rev; -var REQUESTTYPE_FULLLOAD = 1; -var REQUESTTYPE_ADDPAGE = 2; -var REQUESTTYPE_PAGESWITCH = 3; - -function SetLoading(value) +function PrepareParameters(data) { - document.getElementById("ajax_loading").style.visibility = (value ? "visible" : "hidden"); + var parameters = ""; + + for(var elem in data) + parameters += elem + "=" + encodeURIComponent(data[elem]) + "&"; + parameters = parameters.substr(0, parameters.length-1); + return parameters; } -function AjaxCall() +function FilesCallback(results) { - SetLoading(true); - AjaxGet("/sites/all/modules/reactos/getbuilds/ajax-getfiles.php", "GetFilesCallback", data); -} - -function GetFilesCallback(HttpRequest) -{ - // Check for an error - if(HttpRequest.responseXML.getElementsByTagName("error").length > 0) - { - // For some errors, we show a localized error message - if(HttpRequest.responseXML.getElementsByTagName("message")[0].firstChild.data == "LIMIT") - alert(''); +if($(results).find("error").length > 0){ + if($(results).find("error").text() == "LIMIT") + alert('' + $(results).find("limit").text()); else - alert(HttpRequest.responseXML.getElementsByTagName("message")[0].firstChild.data); - - return; + alert($(results).find("message").text()); + return 0; } + var html = ""; - var html = ""; - if(data["filelist"]) { // Build a new infobox - html += '
'; + html += '
'; - if(data["requesttype"] == REQUESTTYPE_FULLLOAD) - { - FileCount = parseInt(HttpRequest.responseXML.getElementsByTagName("filecount")[0].firstChild.data); - html += '' + FileCount + '<\/span>"); ?>'; - } - else - { - html += document.getElementById("infobox").innerHTML; - } + FileCount = parseInt($(results).find("filecount").text()); + html += ' ' + FileCount + '<\/span>"); ?>'; - html += '<\/td>'; + html += '<\/div>'; - // Page number boxes - html += '
'; + html += '
'; html += '‹ '; - html += "   "; + html += " - "; html += ' ›'; - html += '<\/td><\/tr><\/table>'; + html += '<\/div> <\/div>
'; // File table - html += ''; - html += '
<\/th><\/th><\/th><\/tr><\/thead>'; + html += ''; + html += ''; - var files = HttpRequest.responseXML.getElementsByTagName("file"); + var files = $(results).find("file"); if(!files.length) { - html += ''; - html += ''; + html += '
<\/th><\/th><\/th><\/tr>'; html += '
<\/td> <\/td> <\/td><\/tr>'; + html += '
<\/td> <\/td> <\/td><\/tr>'; } else { - var oddeven = false; - - for(var i = 0; i < files.length; i++) - { - var fname = files[i].getElementsByTagName("name")[0].firstChild.data; - var fsize = files[i].getElementsByTagName("size")[0].firstChild.data; - var fdate = files[i].getElementsByTagName("date")[0].firstChild.data; - var flink = ''; - - html += '
' + flink + ' ' + fname + '<\/a><\/td>'; - html += '' + flink + fsize + '<\/a><\/td>'; - html += '' + flink + fdate + '<\/a><\/td>'; - html += '<\/tr>'; - - oddeven = !oddeven; - } + var fname,fsize,fdate,flink; + $(files).each(function(){ + fname = $(this).find("name").text(); + fsize = $(this).find("size").text(); + fdate = $(this).find("date").text(); + flink = ''; + html += '
' + flink + fname + '<\/a><\/td>' + flink + fsize + '<\/a><\/td>' + flink + fdate + '<\/a><\/td>'; + html += '<\/tr>'; + }); } - html += '<\/tbody><\/table>'; - document.getElementById("filetable").innerHTML = html; - - if(data["requesttype"] == REQUESTTYPE_PAGESWITCH) - { - // Switch the selected page in the Page ComboBox - document.getElementById("pagesel").getElementsByTagName("option")[CurrentPage - 1].selected = true; - } - } - else - { - // Just add a new page to the Page combo box and the information for it - PageCount++; - FileCount += parseInt(HttpRequest.responseXML.getElementsByTagName("filecount")[0].firstChild.data); - - document.getElementById("filecount").firstChild.data = FileCount; - - // As always, we have to work around an IE bug - // If I use "innerHTML" here, the first