- Timestamp:
- 08/03/11 20:07:20 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/SessionCreationTool.php
r69 r70 17 17 18 18 $this->javascript(); 19 var_dump($_POST); 19 20 var_dump($session); 20 var_dump($_POST);21 21 22 ?> 22 23 … … 46 47 <script type="text/javascript"> 47 48 var pipelineCount = 0; 48 49 49 50 // ============================================================= 50 51 function addSurvey(surveyID) { 52 pipelineCount++; 53 54 var pipeline = document.getElementById("pipeline"); 51 52 function addSurvey(surveyID) { 55 53 var surveysList = document.getElementById("surveysList"); 56 57 var entry = document.createElement("option"); 58 59 if (surveyID != null) 54 55 if(surveysList.selectedIndex != -1 || surveyID != null) 60 56 { 61 entry.setAttribute("value", surveyID); 62 entry.innerHTML = pipelineCount + ". " + surveysList.options.namedItem(surveyID).innerHTML; 63 } 64 else 65 { 66 entry.setAttribute("value", surveysList.options[surveysList.selectedIndex].value); 67 68 entry.innerHTML = pipelineCount + ". " + surveysList.options[surveysList.selectedIndex].innerHTML; 69 70 } 71 entry.style.backgroundColor = "#0090ac"; 72 entry.name = pipelineCount + "s"; 73 entry.entryType = "s"; 74 75 pipeline.appendChild(entry); 76 } 77 57 var pipeline = document.getElementById("pipeline"); 58 var entry = document.createElement("option"); 59 60 if (surveyID != null) 61 { 62 pipelineCount++; 63 entry.setAttribute("value", surveyID); 64 entry.innerHTML = pipelineCount + ". " + surveysList.options.namedItem(surveyID).innerHTML; 65 } 66 else if(surveysList.selectedIndex != -1) 67 { 68 pipelineCount++; 69 entry.setAttribute("value", surveysList.options[surveysList.selectedIndex].value); 70 71 entry.innerHTML = pipelineCount + ". " + surveysList.options[surveysList.selectedIndex].innerHTML; 72 73 } 74 entry.style.backgroundColor = "#0090ac"; 75 entry.name = pipelineCount + "s"; 76 entry.entryType = "s"; 77 78 pipeline.appendChild(entry); 79 } 80 } 81 78 82 function addDashboard() { 79 83 pipelineCount++; 80 84 var pipeline = document.getElementById("pipeline"); 81 85 82 86 var entry = document.createElement("option"); 83 87 entry.setAttribute("value", "dashboard"); … … 87 91 entry.name = pipelineCount + "d"; 88 92 entry.entryType = "d"; 89 93 90 94 pipeline.appendChild(entry); 91 95 } 92 96 93 97 function removeFromPipeline() { 94 98 var pipeline = document.getElementById("pipeline"); 95 if (pipeline.selectedIndex != null)99 if (pipeline.selectedIndex != -1) 96 100 { 97 101 var index = pipeline.selectedIndex; 98 102 pipeline.remove(index); 99 103 if (pipelineCount > 1) 104 { 105 pipeline.options[index].selected = true; 106 } 107 100 108 for(var i = index; i < pipeline.length; i++) 101 102 103 104 105 106 107 109 { 110 var entry = pipeline.options[i]; 111 entry.name = "" + (i+1) + entry.entryType; 112 var htmlStr = entry.innerHTML; 113 var dotIndex = htmlStr.indexOf('.'); 114 entry.innerHTML = (i+1) + htmlStr.substr(dotIndex); 115 } 108 116 pipelineCount--; 109 117 } 110 118 } 111 119 112 120 function submitPipeline() 113 121 { 114 122 var form = document.getElementById("sessionCreationForm"); 115 123 116 124 var pipeline = document.getElementById("pipeline").options; 117 118 125 126 119 127 for (var i = 0; i < pipeline.length; i++) 120 128 { … … 123 131 pipelineElem.value = pipeline[i].value; 124 132 pipelineElem.type = "hidden"; 125 133 126 134 form.appendChild(pipelineElem); 127 135 } 128 136 129 137 var count = document.createElement("input"); 130 138 count.name = "pipelineCount"; 131 139 count.value = pipelineCount; 132 140 count.type = "hidden"; 133 141 134 142 form.appendChild(count); 135 143 }
Note: See TracChangeset
for help on using the changeset viewer.