- Timestamp:
- 2010-11-08T17:31:20+13:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js
r23276 r23298 44 44 }); 45 45 }); */ 46 46 /* 47 function loadXMLDoc() 48 { 49 if (window.XMLHttpRequest) 50 {// code for IE7+, Firefox, Chrome, Opera, Safari 51 xmlhttp=new XMLHttpRequest(); 52 } 53 else 54 {// code for IE6, IE5 55 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 56 } 57 58 xmlhttp.onreadystatechange=function() 59 { 60 console.log("state changed to " + xmlhttp.readyState); 61 console.log("status is " + xmlhttp.status); 62 if (xmlhttp.readyState==4 && xmlhttp.status==200) 63 { 64 console.log("get code"); 65 console.log(xmlhttp.responseText); 66 document.getElementById("gs_content").innerHTML=xmlhttp.responseText; 67 } 68 } 69 70 xmlhttp.open("GET","http://localhost:8080/greenstone3/format?a=b&rt=s&s=ClassifierBrowse&c=simpleht&cl=CL1&excerptid=gs_content",true); 71 //xmlhttp.open("GET","http://www.cs.waikato.ac.nz",true); 72 //xmlhttp.open("GET","http://wand.net.nz/~sjb48/index.html",true); 73 xmlhttp.send(); 74 } 75 */ 47 76 $(document).ready(function(){ 48 77 … … 51 80 var CURRENT_SELECT_VALUE = ""; 52 81 53 /*54 82 var iframe = document.getElementById('iframe'); 55 83 var iframe_document = iframe.document; … … 65 93 console.log("Chose content window"); 66 94 } 95 96 // Edit the hrefs in preview_html - search for <a href="format?a=b&rt=r&s=ClassifierBrowse&c=simpleht&cl=CL1.2"> 97 var start_index = 0; 98 var end_index = 0; 99 while(start_index != -1) 100 { 101 start_index = preview_html.indexOf("href=\"format", start_index); 102 console.log("start index = " + start_index); 103 if(start_index != -1) 104 { 105 end_index = preview_html.indexOf("\">", start_index); 106 console.log("end_index = " + end_index); 107 a = preview_html.substring(0,end_index); 108 b = preview_html.substring(end_index); 109 preview_html = a.concat("&excerptid=gs_content", b); 110 console.log(preview_html); 111 start_index = end_index + "&excerptid=gs_content\">".length; 112 } 113 } 114 67 115 // Put the content in the iframe 68 116 if(initialised_iframe == "false") 69 117 { 70 118 console.log("Initialised iframe with preview html"); 119 console.log(preview_html); 71 120 iframe_document.open(); 72 121 iframe_document.writeln(preview_html); //.concat("&excerptid=gs_content")); … … 74 123 initialised_iframe = "true"; 75 124 } 76 125 126 /* 77 127 $(iframe_document.documentElement.innerHTML).find('a').each(function() { 78 128 console.log("data "+$(this).data('href')); … … 132 182 }) 133 183 134 $(".draggable_ text").draggable({135 cursor: 'crosshair', 136 connectToSortable: '. gsf_otherwise, .gsf_link, .gsf_choose, .gsf_when',184 $(".draggable_gsf_text").draggable({ 185 cursor: 'crosshair', 186 connectToSortable: '.td-div, .gsf_when, .gsf_otherwise, .gsf_link, .gsf_choose_metadata, .gsf_default', 137 187 helper: 'clone', 138 188 revert: 'invalid' … … 185 235 $(".draggable_gsf_icon").draggable({ 186 236 cursor: 'crosshair', 187 connectToSortable: '. gsf_link',237 connectToSortable: '.td-div, .gsf_link, .gsf_choose, .gsf_when, .gsf_otherwise', 188 238 helper: 'clone', 189 239 revert: 'invalid'
Note:
See TracChangeset
for help on using the changeset viewer.