Changeset 278 for Dev/branches/Cartis/Tiles preview/js
- Timestamp:
- 02/21/12 17:40:49 (13 years ago)
- Location:
- Dev/branches/Cartis/Tiles preview/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/Cartis/Tiles preview/js/dashboardScripts.js
r261 r278 263 263 264 264 function configureDashboard() { 265 var data = JSON.stringify(shoppingCart); 266 var form = ce("form"); 267 //changed to dashboardGraphSelection.php 268 form.action = "dashboardGraphSelection.php"; 269 form.method = "POST"; 270 var input = ce("input"); 271 input.type = "hidden"; 272 input.name = "selectedData"; 273 input.value = data; 274 form.appendChild(input); 275 form.submit(); 265 mockup.api.loadPage("graphSelection", false); 276 266 } 277 267 … … 393 383 doorstuurData.count++; 394 384 } 385 -
Dev/branches/Cartis/Tiles preview/js/nav.js
r259 r278 1 1 $(function() { 2 //Switchpage 3 2 4 3 mockup = { 5 4 api: { 6 5 clickTile: function(thisElement, url) { 7 // clear self8 while (thisElement.firstChild) {9 thisElement.removeChild(thisElement.firstChild);10 }11 6 // clear frame 12 7 $(".basePanel").children().remove(); … … 14 9 15 10 }, 16 loadPage: function(name) { 11 loadPage: function(name, conf) { 12 debugger; 13 if (conf) { 14 if (!confirm("Are you sure you want to go back? You will lose your selected data.")) { 15 return; 16 } 17 } 18 19 $(".basePanel").children().remove(); 20 17 21 $.get("pages/"+name+".html", function(responseText, textStatus, XMLHttpRequest) { 18 22 $(".basePanel").append(responseText); 19 23 $.getScript("pages/"+name+".js", function(responseText, textStatus, XMLHttpRequest){ 20 debugger;21 })24 25 }) 22 26 }); 23 24 } 27 mockup.api.breadcrumbs.navTo(name); 28 }, 29 breadcrumbs: new (function() { 30 var _crumbs = ["Home"]; 31 var _element = document.getElementById('breadcrumbs'); 32 this.init = function() { 33 updateDiv(); 34 } 35 36 this.navTo = function(name) { 37 // Check of 'name' al in crumbs staat. 38 // Als wel: navBack, delete alle crumbs na 'name', update div. 39 // Als niet: addCrumb, voeg 'name' toe aan crumbs en update de div. 40 var index = _crumbs.indexOf(name); 41 if (index != -1) { 42 navBack(name, index); 43 } 44 else { 45 addCrumb(name); 46 } 47 } 48 49 var addCrumb = function(name) { 50 _crumbs.push(name); 51 updateDiv(); 52 } 53 54 var navBack = function(name, index) { 55 var i = index; 56 _crumbs = _crumbs.slice(0, i+1); 57 updateDiv(); 58 } 59 60 var updateDiv = function() { 61 //format first 62 _element.innerHTML = null || ""; 63 for (var n=0; n < _crumbs.length; n++) { 64 if (_crumbs[n] == "Home") { 65 var word = document.createTextNode("Home"); 66 _element.appendChild(word); 67 68 } 69 else{ 70 71 var link = document.createElement('a'); 72 link.innerHTML = _crumbs[n]; 73 link.setAttribute("onclick", "mockup.api.loadPage('"+_crumbs[n]+"', true);"); 74 link.setAttribute("href","#"); 75 _element.appendChild(link); 76 } 77 78 if (n != _crumbs.length-1) { 79 _element.innerHTML += " > "; 80 } 81 else { 82 link.className = "selected"; 83 } 84 } 85 } 86 })() 25 87 26 88 }
Note: See TracChangeset
for help on using the changeset viewer.