print
"<input type='button' onclick='loadFile()' value='reload file' class='stdbutton'>";
print
-"<input type='button' onclick='deleteFile()' value='delete file' class='stdbutton'>";
+"<input type='button' onclick='deleteFile(selectedConfigFile());loadFile()' value='delete file' class='stdbutton'>";
print "</p>";
print_specSelector();
print "</td><td>";
print
-"<input type='button' onclick='createFile()' value='create file' class='stdbutton'>";
+"<input type='button' onclick='createFile(selectedSpecFile(),newFileName());reloadFileSelection(newFileName());loadFile()' value='create file' class='stdbutton'>";
print "</td></tr></table>";
print "</p>";
if ( $xmlfile eq $configFile ) { # we are printing the Specifications Tree
print <<EOF;
-<td class='button_move' onclick='deleteSettings("$registerName","");'> X </td>
+<td class='button_move' onclick='deleteSettings(selectedConfigFile(),"$registerName","");reloadSetTree()'> X </td>
EOF
}
if ( $xmlfile eq $specFile ) { # we are printing the Settings Tree
print <<EOF;
-<td class='button_move' onclick='copyDefaultRegister("$registerName");'> → </td>
+<td class='button_move' onclick='copyDefaultRegister(selectedConfigFile(),"$registerName");reloadSetTree()'> → </td>
EOF
}
else {
print <<EOF;
<td align='right'>
-<input type='text' align='right' value='$fieldValue' onchange='saveSettings("$registerName","$fieldName",this.value)' >
+<input type='text' align='right' value='$fieldValue' onchange='saveSettings(selectedConfigFile(),"$registerName","$fieldName",this.value);reloadSetTree()' >
</td>
EOF
print '</td>';
if ( $xmlfile eq $specFile ) { # we are printing the Specifications tree
print <<EOF;
-<td class='button_move' onclick='saveSettings("$registerName","$fieldName","$fieldValue");'> → </td>
+<td class='button_move' onclick='saveSettings(selectedConfigFile(),"$registerName","$fieldName","$fieldValue");'> → </td>
EOF
}
if ( $xmlfile eq $configFile ) { # we are printing the Settings Tree
if ( $isHeritageFrom eq "" )
{ # these are actual settings, not inherited!
print <<EOF;
-<td class='button_move' onclick='deleteSettings("$registerName","$fieldName");'> X </td>
+<td class='button_move' onclick='deleteSettings(selectedConfigFile(),"$registerName","$fieldName");reloadSetTree()'> X </td>
EOF
}
else {
. getFileLevel($ancestor) . "\",this.checked)'></td>";
if ( getFileLevel($ancestor) eq "1" ) {
print <<EOF;
-<td class='button_move' title='unlink includes' onclick='changeAncestor("")'> X </td>
+<td class='button_move' title='unlink includes' onclick='changeAncestor(selectedConfigFile(),"");reloadSetTree()'> X </td>
EOF
}
else { # print an ancestor selector!
print "include settings from:<br>";
print_fileSelector( "", "ancestorSelector",
- "changeAncestor(this.options[this.selectedIndex].text)" );
+ "changeAncestor(selectedConfigFile(),this.options[this.selectedIndex].text);reloadSetTree()" );
}
printJavaScripts();
print <<EOF;
</HEAD>
-<BODY onload='reloadFileSelection()'>
+<BODY onload='reloadFileSelection(selectedConfigFile())'>
<h2>JTAG Configuration File Editor</h2>
<div id="debug">
debug text
####### javascript function land ################
print <<EOF ;
-
+<script language="javascript" src="xmlOperations.js"></script>
<script language="javascript">
-function changeAncestor(newAncestor){
- var file_ = encodeURIComponent(selectedConfigFile());
- var newAncestor_ = encodeURIComponent(newAncestor);
- getdata('xmlOperation.pl?action=changeAncestor&configFile='+file_+'&newAncestor='+newAncestor_,false);
- reloadSetTree();
-}
-function deleteFile(){
- var file_ = encodeURIComponent(selectedConfigFile());
- getdata('xmlOperation.pl?action=deleteFile&configFile='+file_,false);
- loadFile();
-}
function selectedConfigFile(){
visHash = new Object();
reloadSpecTree();
reloadSetTree();
-reloadFileSelection();
+reloadFileSelection(selectedConfigFile());
}
+/*
+
+these should be now implemented in xmlOperations.js
+
+function changeAncestor(newAncestor){
+ var file_ = encodeURIComponent(selectedConfigFile());
+ var newAncestor_ = encodeURIComponent(newAncestor);
+ getdata('xmlOperation.pl?action=changeAncestor&configFile='+file_+'&newAncestor='+newAncestor_,false);
+ reloadSetTree();
+}
+
+function deleteFile(){
+ var file_ = encodeURIComponent(selectedConfigFile());
+ getdata('xmlOperation.pl?action=deleteFile&configFile='+file_,false);
+ loadFile();
+}
+
function createFile(){
debugOutput("NewFileName: "+newFileName());
var configFile_ = encodeURIComponent(newFileName());
}
-function reloadFileSelection(){
-var file_ = encodeURIComponent(selectedConfigFile());
-getdata('$me?print=fileSelection&configFile='+file_,'fileSelection',false);
-}
+
function saveSettings(register,field,value){
var file_ = encodeURIComponent(selectedConfigFile());
reloadSetTree();
}
+*/
+
+
function debugOutput(input){
getdata("$me?debuginput="+encodeURIComponent(input),"debug",true);
}
}
+function reloadFileSelection(configFile){
+var file_ = encodeURIComponent(configFile);
+getdata('$me?print=fileSelection&configFile='+file_,'fileSelection',false);
+}
function toggleVis(elementId,t) {
if(document.getElementById(elementId)){
--- /dev/null
+
+function changeAncestor(configFile,newAncestor){
+ var file_ = encodeURIComponent(selectedConfigFile());
+ var configFile_ = encodeURIComponent(configFile);
+ var newAncestor_ = encodeURIComponent(newAncestor);
+ getdata('xmlOperation.pl?action=changeAncestor&configFile='+file_+'&newAncestor='+newAncestor_,false);
+// reloadSetTree();
+}
+
+
+function deleteFile(file){
+ var file_ = encodeURIComponent(file);
+ getdata('xmlOperation.pl?action=deleteFile&configFile='+file_,false);
+// loadFile();
+}
+
+
+function createFile(specFile,newFileName){
+// debugOutput("NewFileName: "+newFileName());
+ var configFile_ = encodeURIComponent(newFileName);
+ var specFile_ = encodeURIComponent(specFile);
+ getdata("xmlOperation.pl?action=createFile&configFile="+configFile_+"&specFile="+specFile_,"debug",false);
+ getdata('$me?print=fileSelection&configFile='+configFile_,'fileSelection',false);
+// loadFile();
+
+}
+
+function saveSettings(configFile,register,field,value){
+var file_ = encodeURIComponent(configFile);
+var register_ = encodeURIComponent(register);
+var field_ = encodeURIComponent(field);
+var value_ = encodeURIComponent(value);
+
+getdata("xmlOperation.pl?action=save&configFile="+file_+"®ister="+register_+"&field="+field_+"&value="+value_,"debug",false);
+// reloadSetTree();
+}
+
+function deleteSettings(configFile,register,field){
+var file_ = encodeURIComponent(configFile);
+var register_ = encodeURIComponent(register);
+var field_ = encodeURIComponent(field);
+
+getdata("xmlOperation.pl?action=delete&configFile="+file_+"®ister="+register_+"&field="+field_,"debug",false);
+// reloadSetTree();
+}
+
+
+function copyDefaultRegister(configFile,register){
+var register_ = encodeURIComponent(register);
+var file_ =encodeURIComponent(configFile);
+getdata("xmlOperation.pl?action=copyDefaultRegister®ister="+register_+'&configFile='+file_,"debug",false);
+// reloadSetTree();
+}
+