Added syntax highlighting for XML Tools (#156)
Syntax highlight now should work on all tools apart from Mock Services. Co-authored-by: Adam Bem <adam.bem@zoho.eu> Reviewed-on: #156 Reviewed-by: Mikolaj Widla <widlam@noreply.example.com>
This commit is contained in:
		| @@ -2,10 +2,13 @@ | ||||
| <html> | ||||
|  | ||||
| <head> | ||||
|     <!-- <link rel="stylesheet" href="../common.css"> --> | ||||
|     <!-- <link rel="stylesheet" href="styles.css"> --> | ||||
|     <link rel="stylesheet" href="../assets/css/tools/r11form.css"> | ||||
|     <script src="../assets/scripts/tools/scripts.js"> </script> | ||||
|     <link rel="stylesheet" href="../assets/css/highlight.css"> | ||||
|     <script src="../assets/scripts/common/hljs.min.js"></script> | ||||
|     <script src="../assets/scripts/tools/scripts.js"></script> | ||||
|     <script src="../assets/scripts/tools/highlight.js"></script> | ||||
|     <script>hljs.highlightAll();</script> | ||||
|      | ||||
|     <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||||
|     <meta charset="utf-8" /> | ||||
| </head> | ||||
| @@ -46,24 +49,17 @@ | ||||
|                 </div> | ||||
|                 <br> | ||||
|                 <label for="xmlArea"><b>Insert your XML:</b></label> | ||||
|                 <textarea id="xmlArea" name="xmlArea" rows="15" | ||||
|                     class="textarea-300 bordered-field vertically-resizeable max-width" | ||||
|                     onblur="setDefaultContent(this, 'Insert XML here');" | ||||
|                     onfocus="clearDefaultContent(this, 'Insert XML here');"></textarea> | ||||
|                 <br><br> | ||||
|                 <pre><code class="language-xml bordered-field textarea-300" id="xmlArea" contenteditable="True"></code></pre> | ||||
|                 <br> | ||||
|                 <label for="transformArea"><b>Insert your XPath:</b></label> | ||||
|                 <textarea id="transformArea" name="transformArea" class="bordered-field vertically-resizeable max-width" | ||||
|                     rows="4" onblur="setDefaultContent(this, 'Insert XPath expression here');" | ||||
|                     onfocus="clearDefaultContent(this,  'Insert XPath expression here');"></textarea> | ||||
|                 <pre><code class="language-xml bordered-field" id="transformArea" contenteditable="True"></code></pre> | ||||
|                 <br> | ||||
|                 <button id="requestButton" class="max-width block-label action-button active" | ||||
|                     onclick="performRequest('xpath', false, true)">Execute XPath | ||||
|                     expression</button> | ||||
|                 <br><br> | ||||
|                 <br> | ||||
|                 <label for="resultArea"><b>Transform result:<span id="procinfo"></span></b></label> | ||||
|                 <textarea disabled id="resultArea" name="resultArea" | ||||
|                     class="textarea-300 bordered-field vertically-resizeable max-width" style="margin-bottom: 50px;" | ||||
|                     rows="10" cols="100"></textarea> | ||||
|                 <pre><code class="language-xml bordered-field textarea-300" id="resultArea"></code></pre> | ||||
|  | ||||
|             </div> | ||||
|         </div> | ||||
| @@ -17223,6 +17219,10 @@ | ||||
|         } | ||||
|  | ||||
|         function init() { | ||||
|             // Make sure that only plain text is pasted | ||||
|             configurePastingInElement("xmlArea"); | ||||
|             configurePastingInElement("transformArea"); | ||||
|  | ||||
|             //Handle clicks in whole form and set info in tooltip | ||||
|             setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here'); | ||||
|             setDefaultContent(document.getElementById("transformArea"), 'Insert XPath expression here'); | ||||
| @@ -17261,6 +17261,8 @@ | ||||
|             }) | ||||
|         } | ||||
|  | ||||
|          | ||||
|      | ||||
|     </script> | ||||
|  | ||||
| </body> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user