Changeset 13678 for trunk/FACT++
- Timestamp:
- 05/12/12 18:42:11 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/index.js
r13665 r13678 279 279 280 280 281 function submit(script) 282 { 283 var inputs = document.getElementsByTagName("input"); 284 285 var args = "start="+script; 286 for (var i=0; i<inputs.length; i++) 287 args += "&"+inputs[i].name+"="+inputs[i].value; 288 289 alert(args); 290 291 sendCommand(args); 292 293 } 294 281 295 function buildPage(name, text, oldz, dz) 282 296 { … … 292 306 return; 293 307 } 308 309 if (lines[0].length==0) 310 { 311 alert("buildPage - title missing"); 312 return; 313 } 314 315 var title = lines[0].split('/'); 294 316 295 317 var table = $("table"+z); … … 301 323 table.id = "table"+z; 302 324 table.border = 0; 303 table.cell spacing = 0;304 table.cell padding = "6px";325 table.cellSpacing = 0; 326 table.cellPadding = "0px"; 305 327 table.width = "100%"; 306 table.setAttribute("style", 328 table.setAttribute("style", "overflow:hidden;position:fixed;top:0px;left:"+window.innerWidth+"px;"); 307 329 308 330 // ----------------------------------------------------- … … 346 368 hhtr.appendChild(htd2); 347 369 348 var div0 = document.createElement("div");349 370 var div1 = document.createElement("div"); 350 371 var div2 = document.createElement("div"); 351 372 var div3 = document.createElement("div"); 352 div0.setAttribute("style", "font-size:x-large;");353 373 div2.setAttribute("class", "icon_white"); 354 div 2.setAttribute("onclick","this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage('"+fname+"',"+z+","+(-dz)+");");374 div3.setAttribute("class", "icon_white"); 355 375 div2.setAttribute("style", "background-position:-396px 50%;"); 356 div3.setAttribute("class", "icon_white");357 div3.setAttribute("onclick","this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage('fact',"+z+","+(-z)+");");358 376 div3.setAttribute("style", "background-position:-575px 50%;"); 377 div3.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage('fact', z, -z); } 378 div2.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage(fname, z, -dz); } 359 379 360 380 var sp0 = document.createElement("span"); … … 364 384 sp1.id = "title"+z; 365 385 sp2.id = "rdot" +z; 386 sp1.setAttribute("style", "font-size:large;"); 366 387 sp0.setAttribute("data-color", "3"); 367 388 sp2.setAttribute("data-color", "3"); 368 389 sp0.appendChild(document.createTextNode(" \u2022 ")); 369 sp1.appendChild(document.createTextNode( lines[0]));390 sp1.appendChild(document.createTextNode(title[0])); 370 391 sp2.appendChild(document.createTextNode(" \u2022 ")); 371 372 div0.appendChild(sp0); 373 div0.appendChild(sp1); 374 div0.appendChild(sp2); 392 if (title[1]!=undefined) 393 sp1.onclick = function() { submit(title[1]); } 375 394 376 395 div1.setAttribute("style", "font-size:small;"); … … 378 397 div1.appendChild(document.createTextNode("---")); 379 398 380 htd0.appendChild(div0); 399 htd0.appendChild(sp0); 400 htd0.appendChild(sp1); 401 htd0.appendChild(sp2); 402 381 403 htd1.appendChild(div1); 382 404 if (dz!=0/* && z+dz!=0*/) … … 417 439 ftab.appendChild(ftd1); 418 440 419 var fdiv0 = document.createElement(" div");420 var fdiv1 = document.createElement(" div");421 422 fdiv0.setAttribute("style", "font-size: x-large;");441 var fdiv0 = document.createElement("span"); 442 var fdiv1 = document.createElement("span"); 443 444 fdiv0.setAttribute("style", "font-size:large;"); 423 445 fdiv1.setAttribute("style", "font-size:small;"); 424 446 fdiv1.id = "localtime"+z; … … 487 509 tr.setAttribute("class", "row"); 488 510 if (valid(cols[0])) 489 tr.setAttribute("onclick", "this.style.background='#ccb'; loadPage('"+cols[0]+"', "+z+",-1);");511 tr.setAttribute("onclick", "this.style.background='#ccb'; loadPage('"+cols[0]+"', "+z+", -1);"); 490 512 if (valid(cols[3])) 491 tr.setAttribute("onclick", "this.style.background='#ccb'; loadPage('"+cols[3]+"',"+z+",+1);"); 492 //tr.setAttribute("id", cols[0]+"_row"); 513 tr.setAttribute("onclick", "this.style.background='#ccb'; loadPage('"+cols[3]+"', "+z+", +1);"); 493 514 494 515 var td0 = document.createElement("td"); … … 529 550 var cell1 = document.createElement("td"); 530 551 cell1.setAttribute("class", "tcell1"); 531 //cell1.setAttribute("id", cols[0]+"_title");532 cell1.appendChild(document.createTextNode(cols[1]));533 552 534 553 var cell2 = document.createElement("td"); 535 cell2.id = "data"+counter;536 554 cell2.setAttribute("class", "tcell2"); 537 cell2.setAttribute("data-form", cols[2]); 538 cell2.appendChild(document.createTextNode("---")); 555 556 if (check.length==0 || check[0]!="input") 557 { 558 cell1.appendChild(document.createTextNode(cols[1])); 559 560 if (cols.length>2 && cols[2].length>0) 561 { 562 cell2.id = "data"+counter; 563 cell2.setAttribute("data-form", cols[2]); 564 cell2.appendChild(document.createTextNode("---")); 565 counter++; 566 } 567 else 568 cell1.setAttribute("class", "description"); 569 } 570 else 571 { 572 var opt = check[1].split('/'); 573 574 if (opt.length<2) 575 alert("Argument name missing for'"+check[1]+"'"); 576 577 cell1.appendChild(document.createTextNode(opt[0])); 578 579 var input = document.createElement("input"); 580 input.name = opt[1]; 581 input.type = "text"; 582 input.maxlength = 80; 583 if (opt.length>2) 584 input.value=opt[2]; 585 586 cell2.appendChild(input); 587 } 539 588 540 589 innertr.appendChild(cell1); … … 542 591 543 592 tbody.appendChild(tr); 544 545 counter++; 546 } 547 593 } 594 /* 595 if (true) 596 { 597 tr = document.createElement("tr"); 598 tr.setAttribute("class", "row"); 599 600 td = document.createElement("td"); 601 td.colSpan = "3"; 602 tr.appendChild(td); 603 604 var sp = document.createElement("div"); 605 sp.setAttribute("class", "icon_color"); 606 sp.setAttribute("style", "background-position: -144px -14px;"); 607 td.appendChild(sp); 608 609 sp = document.createElement("div"); 610 sp.setAttribute("class", "icon_color"); 611 sp.setAttribute("style", "background-position: -56px -14px;"); 612 td.appendChild(sp); 613 614 tr.appendChild(td); 615 616 tbody.appendChild(tr); 617 } 618 */ 548 619 // --------------------------------------- 549 620 if (debug == true) … … 829 900 { 830 901 if (tokens[line].length==0) 902 continue; 903 904 if (tbody.rows[line-1]==undefined) 831 905 continue; 832 906
Note:
See TracChangeset
for help on using the changeset viewer.