|
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> |
|
xmlns= "http://www.w3.org/1999/xhtml" > |
|
|
|
<meta http-equiv= "content-type" Content= "text/html; charset=utf-8"/> |
|
<title> Extracting some code fields from your code </title> |
|
<style Type= "text/css" > |
|
. left_part {width:600px; float:left;} |
|
. left_part textarea {width:100%;} |
|
. right_part {float:left; width:600px; margin:0 0 0 30px; } |
|
. right_part textarea {width:100%;} |
|
</style> |
|
|
|
<body> |
|
<div Class= "left_part" > |
|
<textarea Name= "" " id="code" cols=" + " rows="40 the > paste text </textarea> |
|
<br> |
|
<br> |
|
<input Type= "button" value= " build " id= "build_btn" style = "width:100px; height:100px; font-size:20px; float:right ;" > |
|
</div> |
|
<div Class= "right_part" > |
|
<textarea Name= "" " id="build" cols=" + " rows="40 "></textarea> |
|
</div> |
|
<script> |
|
var reg = after = '; |
|
var t = document.getElementById (' code '); |
|
var B = document.getElementById (' build_btn '); |
|
var c = document.getElementById (' Build '); |
|
|
|
Reg =/\<destination\> (. *) (\.) (Shtml|html|jsp|js|css|xml) \<\/destination\>/g; |
|
after = "$1$2$3"; |
|
|
|
B.onclick = function () { |
|
var v = t.value; |
|
var sc = r = ""; |
|
var result = []; |
|
var i = 0; |
|
while ((r = reg.exec (v)) = null) { |
|
Result[i] = r[0]; |
|
i++; |
|
} |
|
for (var i = 0; i < result.length; i++) { |
|
for (var j = i + 1; j < Result.length; J + +) { |
|
if (result[i] = = Result[j]) { |
|
Result.splice (j,1); |
|
j--; |
|
} |
|
} |
|
} |
|
sc = result.join (' \ n '); |
|
sc = sc.replace (reg,after). Replace (/\\/g, '/'); |
|
C.value = SC; |
|
C.select (); |
|
} |
|
</script> |
|
</body> |
|
|
|
|
Extracting some code fields from your code