Solved issue#19, added default XML
This commit is contained in:
		
							
								
								
									
										33
									
								
								Frontend/assets/samples/sampleXml.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								Frontend/assets/samples/sampleXml.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
				
			|||||||
 | 
					<?xml version="1.0" encoding="utf-8"?>
 | 
				
			||||||
 | 
					<l:library xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.release11.com" xmlns:l="http://www.release11.com/library" xmlns:p="http://www.release11.com/person" xmlns:b="http://www.release11.com/book">
 | 
				
			||||||
 | 
					    <l:libraryName>City library</l:libraryName>
 | 
				
			||||||
 | 
					    <l:libraryID>345123</l:libraryID>
 | 
				
			||||||
 | 
					    <l:readerList>
 | 
				
			||||||
 | 
					        <p:person>
 | 
				
			||||||
 | 
					            <p:readerID>7321</p:readerID>
 | 
				
			||||||
 | 
					            <p:name>Adam</p:name>
 | 
				
			||||||
 | 
					            <p:surname>Choke</p:surname>
 | 
				
			||||||
 | 
					        </p:person>
 | 
				
			||||||
 | 
					        <p:person>
 | 
				
			||||||
 | 
					            <p:readerID>5123</p:readerID>
 | 
				
			||||||
 | 
					            <p:name>Lauren</p:name>
 | 
				
			||||||
 | 
					            <p:surname>Wong</p:surname>
 | 
				
			||||||
 | 
					        </p:person>
 | 
				
			||||||
 | 
					    </l:readerList>
 | 
				
			||||||
 | 
					    <l:bookList>
 | 
				
			||||||
 | 
					        <b:book>
 | 
				
			||||||
 | 
					            <b:bookID>6422</b:bookID>
 | 
				
			||||||
 | 
					            <b:title>Harry Potter</b:title>
 | 
				
			||||||
 | 
					            <p:readerID>7542</p:readerID>
 | 
				
			||||||
 | 
					        </b:book>
 | 
				
			||||||
 | 
					        <b:book>
 | 
				
			||||||
 | 
					            <b:bookID>1234</b:bookID>
 | 
				
			||||||
 | 
					            <b:title>Macbeth</b:title>
 | 
				
			||||||
 | 
					            <p:readerID>5123</p:readerID>
 | 
				
			||||||
 | 
					        </b:book>
 | 
				
			||||||
 | 
					        <b:book>
 | 
				
			||||||
 | 
					            <b:bookID>9556</b:bookID>
 | 
				
			||||||
 | 
					            <b:title>Romeo and Juliet</b:title>
 | 
				
			||||||
 | 
					        </b:book>
 | 
				
			||||||
 | 
					    </l:bookList>
 | 
				
			||||||
 | 
					</l:library>
 | 
				
			||||||
@@ -11,6 +11,18 @@ function clearDefaultContent(element, text) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function fillDefaultXML(element) {
 | 
				
			||||||
 | 
					    if(element.classList.contains("active")){
 | 
				
			||||||
 | 
					        const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086";
 | 
				
			||||||
 | 
					        clearDefaultContent(document.getElementById("xmlArea"), "Insert XML here");
 | 
				
			||||||
 | 
					        fetch(serverAddress + "/assets/samples/sampleXml.xml")
 | 
				
			||||||
 | 
					            .then(response => response.text())
 | 
				
			||||||
 | 
					            .then((exampleData) => {
 | 
				
			||||||
 | 
					                document.getElementById("xmlArea").value = exampleData;
 | 
				
			||||||
 | 
					            })
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//Set default text in grey
 | 
					//Set default text in grey
 | 
				
			||||||
function setDefaultContent(element, text) {
 | 
					function setDefaultContent(element, text) {
 | 
				
			||||||
    if (element.value == "") {
 | 
					    if (element.value == "") {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3184,18 +3184,7 @@
 | 
				
			|||||||
    </script>
 | 
					    </script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <script>
 | 
					    <script>
 | 
				
			||||||
        function fillDefaultXML(element) {
 | 
					 | 
				
			||||||
            if (element.classList.contains("active")) {
 | 
					 | 
				
			||||||
                // document.getElementById("defaultXMLButton").classList.toggle("active", false);
 | 
					 | 
				
			||||||
                clearDefaultContent(document.getElementById("xmlArea"), "Insert XML here");
 | 
					 | 
				
			||||||
                fetch('http://gordon.zipper.release11.com:8086/Frontend/sample_data/sample_xml.xml')
 | 
					 | 
				
			||||||
                    .then(response => response.text())
 | 
					 | 
				
			||||||
                    .then((data) => {
 | 
					 | 
				
			||||||
                        document.getElementById("xmlArea").value = data;
 | 
					 | 
				
			||||||
                    })
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    </script>
 | 
					    </script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <script>
 | 
					    <script>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user