1 | var hubber = $.connection.progressHub;
|
---|
2 |
|
---|
3 | $(function () {
|
---|
4 | $.connection.hub.logging = true;
|
---|
5 | $.connection.hub.start().done(function () {
|
---|
6 | $("#progress").css("width", 0 + '%');
|
---|
7 | $('#progress').attr('aria-valuenow', 0);
|
---|
8 | hubber.server.handleMessage("Looking for connection...");
|
---|
9 |
|
---|
10 | });
|
---|
11 | hubber.client.processMessage = function (message, value) {
|
---|
12 | /* if(value > 0){
|
---|
13 | $("#progress").css("width", value + '%');
|
---|
14 | $('#progress').attr('aria-valuenow', value);
|
---|
15 | }
|
---|
16 | else {
|
---|
17 | var v = $('#progress').attr('aria-valuenow') + (-value);
|
---|
18 | $("#progress").css("width", v + '%');
|
---|
19 | $('#progress').attr('aria-valuenow', v);
|
---|
20 | }*/
|
---|
21 | if (value > $('#progress').attr('aria-valuenow')) {
|
---|
22 | $("#progress").css("width", value + '%');
|
---|
23 | $('#progress').attr('aria-valuenow', value);
|
---|
24 | $("#progress").html(value + '%');
|
---|
25 | $("#result").html(message);
|
---|
26 | }
|
---|
27 | };
|
---|
28 | });
|
---|
29 |
|
---|
30 | function addtoHive() {
|
---|
31 |
|
---|
32 | var jobname = prompt("Please enter a job name", "Job");
|
---|
33 | if (jobname != "") {
|
---|
34 | hubber.server.changeName(jobname);
|
---|
35 | document.getElementById("fakehiveadd").style.display = "none";
|
---|
36 | document.getElementById("progdiv").style.display = "";
|
---|
37 | document.getElementById("result").style.display = "";
|
---|
38 | document.getElementById("realhiveadd").click();
|
---|
39 | }
|
---|
40 | }
|
---|
41 | function toggleChild(arr, idchilds) {
|
---|
42 | console.log(arr);
|
---|
43 | hubber.server.toggleChild(arr);
|
---|
44 | if ($("#childs" + idchilds).css("display") == "none")
|
---|
45 | $("#childs" + idchilds).css("display", "");
|
---|
46 | else
|
---|
47 | $("#childs" + idchilds).css("display", "none");
|
---|
48 | } |
---|