Changeset 7652:45f4b870f75e
- Timestamp:
- 11/08/07 18:49:11 (6 years ago)
- Branch:
- default
- Location:
- sage/dsage/web
- Files:
-
- 1 added
- 2 edited
-
index.html (modified) (1 diff)
-
static/dsage_web.js (modified) (3 diffs)
-
static/jquery.history.js (added)
Legend:
- Unmodified
- Added
- Removed
-
sage/dsage/web/index.html
r7651 r7652 11 11 <script src='static/jquery-latest.js' type='text/javascript'></script> 12 12 <script src='static/jquery.tablesorter.pack.js' type='text/javascript'></script> 13 <script src='static/jquery.history.js' type='text/javascript'></script> 14 13 15 <script src='static/dsage_web.js' type='text/javascript'></script> 14 16 </head> -
sage/dsage/web/static/dsage_web.js
r7649 r7652 10 10 $('#job_details').hide(); 11 11 $('#help').hide(); 12 $('#navigator').hide(); 12 13 $('#server_details').show(); 13 $('#navigator').hide();14 14 } 15 15 function getJobs (c) { … … 30 30 $('#help').hide(); 31 31 $('#jobs_table').show(); 32 $('#navigator').show(); 32 33 } 33 34 … … 59 60 } 60 61 62 // PageLoad function 63 // This function is called when: 64 // 1. after calling $.historyInit(); 65 // 2. after calling $.historyLoad(); 66 // 3. after pushing "Go Back" button of a browser 67 function pageload(hash) { 68 // hash doesn't contain the first # character. 69 if(hash) { 70 // restore ajax loaded state 71 if (hash=='jobs') { 72 showJobs() 73 } 74 else if (hash=='server') { 75 getServerDetails() 76 } 77 else if (hash=='help') { 78 getHelp() 79 } 80 } 81 else { 82 // start page 83 showJobs() 84 } 85 } 86 87 function gethash (that) { 88 var hash = that.href; 89 hash = hash.replace(/^.*#/, ''); 90 // moves to a new page. 91 // pageload is called at once. 92 $.historyLoad(hash); 93 return false; 94 } 95 61 96 $(document).ready(function() 62 97 { 98 // Initialize history plugin. 99 // The callback is called at once by present location.hash. 100 $.historyInit(pageload); 101 console.log('historyInit') 102 // set onlick event for buttons 103 $("a[@rel='history']").click(function() {gethash(this); }); 104 console.log('setonclick') 63 105 getJobs(count) // Run it the first time 64 showJobs() // Show jobs106 // showJobs() // Show jobs 65 107 // setInterval('getJobs(count)', 5000); // Update it every 5 seconds. 66 108 }
Note: See TracChangeset
for help on using the changeset viewer.
