author | victorp@symbian.org |
Thu, 06 May 2010 13:01:45 +0100 | |
changeset 44 | 48bcd0bbc1ab |
parent 42 | 20be4dd42b12 |
permissions | -rwxr-xr-x |
42 | 1 |
var BuildpageAjax = null; |
2 |
var startbuild = "<!-- production Builds -->"; |
|
3 |
var endbuild = "<!--START of footer-->"; |
|
4 |
var buildtitle = null; |
|
5 |
var builddescription = null; |
|
6 |
||
7 |
function buildview (aParent) { |
|
8 |
||
9 |
this.previousView = aParent; |
|
10 |
this.setupSoftKeys(); |
|
11 |
||
12 |
||
13 |
buildtitle = new Label ("title_build","Latest Build Status:",null); |
|
14 |
this.addControl (buildtitle); |
|
15 |
builddescription = new Label ("description_build"); |
|
16 |
this.addControl (builddescription); |
|
17 |
this.show(); |
|
18 |
this.update(true); |
|
19 |
} |
|
20 |
||
21 |
buildview.prototype = new ListView("buildview","<img src=logo.png>"); |
|
22 |
||
23 |
buildview.prototype.update = function(myflag){ |
|
24 |
if (myflag) { |
|
25 |
var mybuf = "<div class=\"FeedItemLink\">"; |
|
26 |
mybuf += "<a href=\"JavaScript:void(0)\" onclick=\"openURL('" + buildresultsUrl + Packageid + "'); return false;\">"; |
|
27 |
mybuf += "(Click here for more details...)"; |
|
28 |
mybuf += "</a>"; |
|
29 |
mybuf += "</div>"; |
|
30 |
if(!Packageid){return;} |
|
31 |
buildtitle.setText(Packageid + " " + mybuf); |
|
32 |
builddescription.setText(""); |
|
33 |
this.loadbuild(buildresultsUrl + Packageid); |
|
34 |
} |
|
35 |
||
36 |
} |
|
37 |
buildview.prototype.loadbuild =function (url) { |
|
38 |
uiManager.showNotification(-1, "wait", "Please wait...", -1); |
|
39 |
BuildpageAjax = new Ajax(); |
|
40 |
BuildpageAjax.onreadystatechange = this.muchbuild; |
|
41 |
BuildpageAjax.open('GET', nocache(url), true); |
|
42 |
BuildpageAjax.send(null); |
|
43 |
} |
|
44 |
||
45 |
buildview.prototype.setlabels = function(aTitle, aDescription){ |
|
46 |
this.title.setText(aTitle); |
|
47 |
this.description.setText(aDescription); |
|
48 |
||
49 |
} |
|
50 |
||
51 |
buildview.prototype.muchbuild =function () { |
|
52 |
if (BuildpageAjax.readyState == 4) { |
|
53 |
||
54 |
var content = BuildpageAjax.responseText; |
|
55 |
var ind = content.indexOf(startbuild); |
|
56 |
if (ind == -1) { |
|
44
48bcd0bbc1ab
My package wiki v0.3 - http://developer.symbian.org/wiki/index.php/My_Package_Widget#Current_version
victorp@symbian.org
parents:
42
diff
changeset
|
57 |
uiManager.showNotification(3000, "Warning", "Build Results - Package Not Found"); |
48bcd0bbc1ab
My package wiki v0.3 - http://developer.symbian.org/wiki/index.php/My_Package_Widget#Current_version
victorp@symbian.org
parents:
42
diff
changeset
|
58 |
debuglog.debug("Build package page with wrong format"); |
42 | 59 |
return; |
60 |
} |
|
61 |
||
62 |
ind += startbuild.length; |
|
63 |
var ind2 = content.indexOf(endbuild); |
|
64 |
content = content.substring(ind, ind2-1); |
|
65 |
||
66 |
ind2 = content.indexOf("<h4"); |
|
67 |
var ind3 = content.indexOf("</h4>",ind2); |
|
68 |
while (ind2!= -1){ |
|
69 |
builddescription.setText(builddescription.getText() + content.substring(ind2, ind3)+ ":"); |
|
70 |
//find the first RAG |
|
71 |
ind2=content.indexOf("<tr>",ind3); |
|
72 |
ind3=content.indexOf("<tr>",ind2); |
|
73 |
ind2=content.indexOf("<td>",ind3); |
|
74 |
ind3=content.indexOf("<td>",ind2+4); |
|
75 |
ind2=content.indexOf("<td>",ind3+4); |
|
76 |
ind3=content.indexOf("<td>",ind2+4); |
|
77 |
ind2=content.indexOf("</td>",ind3+4); |
|
78 |
builddescription.setText(builddescription.getText() + content.substring(ind3+4, ind2)); |
|
79 |
||
80 |
ind2 = content.indexOf("<h4",ind3); |
|
81 |
ind3 = content.indexOf("</h4>",ind2); |
|
82 |
} |
|
83 |
||
44
48bcd0bbc1ab
My package wiki v0.3 - http://developer.symbian.org/wiki/index.php/My_Package_Widget#Current_version
victorp@symbian.org
parents:
42
diff
changeset
|
84 |
//uiManager.hideNotification(); |
42 | 85 |
|
86 |
} |
|
87 |
||
88 |
} |