Refactor javascript
move repeating javascript code to scripts.js file
This commit is contained in:
@@ -20,6 +20,34 @@ function clearDefaultContent(element, text) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* It returns the value of the element with id "processors".
|
||||
*
|
||||
* @function
|
||||
* @name getProcessor
|
||||
* @kind function
|
||||
* @returns {any}
|
||||
*/
|
||||
function getProcessor() {
|
||||
return document.getElementById("processors").value;
|
||||
}
|
||||
|
||||
/**
|
||||
* It returns version of XSLT.
|
||||
*
|
||||
* @function
|
||||
* @name getVersion
|
||||
* @kind function
|
||||
* @returns {"1.0" | "3.0"}
|
||||
*/
|
||||
function getVersion() {
|
||||
if (getProcessor() == "xalan") {
|
||||
return "1.0";
|
||||
} else {
|
||||
return "3.0";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* It clears all data fields.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user