Changeset 191 for Dev/trunk/js/sequencerScripts.js
- Timestamp:
- 12/21/11 17:52:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/js/sequencerScripts.js
r188 r191 73 73 // settings fields first 74 74 initSequencer(); 75 75 debugger; 76 76 switch (sequencer.settings.content.contentType.toLowerCase()) { 77 77 case "session": … … 230 230 requestString = "args="+JSON.stringify(args); 231 231 newAjaxRequest(requestString, "returnObjectDisplay.php", function(result){ 232 console.log(result.responseText); 232 233 insertNewObjects(result.responseText, needsUpdating); 233 234 }, true); … … 290 291 291 292 // This means that one or more steps are being added, not an entire pipeline's worth of them 292 debugger;293 293 needsUpdating = new Array(); 294 294 args = []; … … 305 305 requestString = "args="+JSON.stringify(args); 306 306 newAjaxRequest(requestString, "returnObjectDisplay.php", function(result){ 307 //console.log(result.responseText); 307 308 insertNewObjects(result.responseText, needsUpdating); 308 309 }, true); … … 388 389 389 390 function insertNewObjects(responseText, needsUpdating) { 391 //console.log(responseText); 390 392 // Container function that calls different insertNewX() functions depending on content type. Called from updateSequencer(). 391 393 var response = JSON.parse(responseText); … … 520 522 // Loop through returned question objects 521 523 for (var i = 0; i < response.length; i++) { 524 525 /* 526 * The following block of code defines the layout and composition of the question display 527 */ 528 522 529 // Define the outer frame 523 530 var frameDiv = ce("div"); … … 570 577 frameDiv.appendChild(controlsDiv); 571 578 579 /* 580 * This is where the layout code ends 581 * We proceed to insertion of the created DIV into the document 582 */ 583 572 584 // We now have a full question display DIV contained in the frameDiv variable. We should now add this to the sequencer content. 573 debugger;574 585 for (var j = needsUpdating.length - 1; j >= 0; j--) { 575 586 if (needsUpdating[j][1] != response[i].uid) continue; … … 587 598 588 599 sequencer.state.updating = false; //re-enable user commands 600 } 601 602 function saveSurvey(confirmSave) { 603 // Sends an AJAX request to the PHP server that saves the current object. 604 var answer = (confirmSave == true) ? confirm("Save changes?") : true; 605 if (answer == false) return; 606 607 // Check for object type being edited, adjust requestString and target URL to this information. 608 var request = new Object(), url, requestString; 609 switch (sequencer.settings.content.contentType.toLowerCase()) { 610 case "survey": 611 url = "saveSurvey.php"; 612 request.title = sequencer.survey.title; 613 request.uid = sequencer.survey.uid; 614 request.description = sequencer.survey.description; 615 request.questions = new Object(); 616 request.questions.uids = sequencer.survey.questions.uids; 617 requestString = "args="+JSON.stringify(request); 618 console.log(request); 619 newAjaxRequest(requestString, url, function(result){ 620 console.log(result.responseText); 621 }, true); 622 break; 623 case "blaaaat": 624 url = "savesession.php"; 625 request.pipeline.uids = sequencer.session.pipeline.uids; 626 request.pipeline.types = sequencer.session.pipeline.types; 627 break; 628 } 589 629 } 590 630 … … 648 688 } 649 689 650 function ajaxInfoRequest(uid, el, type) { 651 // Info panel update. 652 653 var c = "uid="+uid; 654 c += "&type="+type; 655 var u = "getInfo.php"; 656 newAjaxRequest(c, u, function(result) { 657 el.innerHTML = result.responseText; 658 }, true); 659 } 690 660 691 661 692 function savePipeline (confirmSave) { … … 784 815 785 816 // Temp function that creates a dummy question to test the insertNewQuestions function. 817 // NOTE: CAN BE REMOVED! 786 818 function debug_addQuestion() { 787 819 // Derp, natuurlijk werkt de addQuestion call niet twee keer. Hij creeert twee keer exact hetzelfde object. Bottom line: het werkt. Nu de editing code voor deze questions gaan schrijven! … … 803 835 804 836 // Temp function that articially switches content type when the page is already loaded, to easily test layout changes and content flow. 837 // NOTE: CAN BE REMOVED! 805 838 function debug_switchType() { 806 839 var content = ge("seqContent");
Note: See TracChangeset
for help on using the changeset viewer.