Advertisement
DoctorWhoDoctorWho

Untitled

Sep 14th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.21 KB | None | 0 0
  1. //// Google Analytics
  2. //var _gaq = _gaq || [];
  3. //_gaq.push(['_setAccount', 'UA-55249638-2']);
  4. //_gaq.push(['_trackPageview']);
  5. ///*(function() {
  6. // var ga = document.createElement('script');
  7. // ga.type = 'text/javascript'; ga.async = true;
  8. // ga.src = 'https://ssl.google-analytics.com/ga.js';
  9. // var s = document.getElementsByTagName('script')[0];
  10. // s.parentNode.insertBefore(ga, s);
  11. //})();*/
  12. //function trackButtonClick(e) {
  13. // _gaq.push(['_trackEvent', e.target.id, 'clicked']);
  14. //};
  15. //var buttons = document.querySelectorAll('button');
  16. //for( var i = 0; i < buttons.length; i++ ) {
  17. // buttons[i].addEventListener('click', trackButtonClick);
  18. //}
  19.  
  20. // Theme
  21. var formalyseThemeHead = localStorage["formalyseThemeHead"]; // darkkhaki
  22. var formalyseThemeAction = localStorage["formalyseThemeAction"]; // khaki
  23. var formalyseThemeMain = localStorage["formalyseThemeMain"]; // palegoldenrod
  24. function getTheme() {
  25. // valid colors are darkkhaki, blue and red
  26. if( formalyseThemeHead != undefined && (formalyseThemeHead == "darkkhaki" || formalyseThemeHead == "cornflowerblue" || formalyseThemeHead == "#f70000") ) {
  27. document.getElementById("formalyseDefaultThemeHead").value = formalyseThemeHead;
  28. document.getElementById("formalyseDefaultThemeAction").value = formalyseThemeAction;
  29. document.getElementById("formalyseDefaultThemeMain").value = formalyseThemeMain;
  30. }
  31. }
  32.  
  33. document.addEventListener(
  34. 'DOMContentLoaded', function() {
  35. var checkPageButton = document.getElementById('formalyseStart');
  36. var infoText = document.getElementById('formalyseInfo');
  37. var disableButtons = document.getElementById('formalyseButtons');
  38. var setGoldButton = document.getElementById('setGold');
  39. var setBlueButton = document.getElementById('setBlue');
  40. var setRedButton = document.getElementById('setRed');
  41. var result;
  42. var lockPath = chrome.extension.getURL('lock_icon.gif');
  43. var showHidden = chrome.extension.getURL('eye.png');
  44. var showHiddenRed = chrome.extension.getURL('eye_red.png');
  45. var optionUncheck = chrome.extension.getURL('option_uncheck.png');
  46. var postGetSwitch = chrome.extension.getURL('post_get.png');
  47.  
  48. // disable extension on "chrome://"-sites
  49. chrome.tabs.getSelected(null, function(tab){
  50. var str = tab.url, n = 0, m = 0, o = 0;
  51. n = str.search("chrome.google.com/");
  52. m = str.search("chrome://");
  53. o = str.search("chrome-extension://");
  54. if( n > -1 || m > -1 || o > -1 ) {
  55. disableButtons.style.display = "none";
  56. infoText.style.display = "block";
  57. }
  58. // console.log(tab);
  59. });
  60.  
  61. setGoldButton.addEventListener('click', function() {
  62. document.getElementById("formalyseDefaultThemeHead").value = localStorage["formalyseThemeHead"] = "darkkhaki";
  63. document.getElementById("formalyseDefaultThemeAction").value = localStorage["formalyseThemeAction"] = "khaki";
  64. document.getElementById("formalyseDefaultThemeMain").value = localStorage["formalyseThemeMain"] = "palegoldenrod";
  65. // alert("gold");
  66. }, false);
  67. setBlueButton.addEventListener('click', function() {
  68. document.getElementById("formalyseDefaultThemeHead").value = localStorage["formalyseThemeHead"] = "cornflowerblue";
  69. document.getElementById("formalyseDefaultThemeAction").value = localStorage["formalyseThemeAction"] = "#bddbff";
  70. document.getElementById("formalyseDefaultThemeMain").value = localStorage["formalyseThemeMain"] = "#e7f4ff";
  71. // alert("blue");
  72. }, false);
  73. setRedButton.addEventListener('click', function() {
  74. document.getElementById("formalyseDefaultThemeHead").value = localStorage["formalyseThemeHead"] = "#f70000";
  75. document.getElementById("formalyseDefaultThemeAction").value = localStorage["formalyseThemeAction"] = "#f5b5b5";
  76. document.getElementById("formalyseDefaultThemeMain").value = localStorage["formalyseThemeMain"] = "#fddede";
  77. // alert("red");
  78. }, false);
  79.  
  80. checkPageButton.addEventListener('click', function() {
  81. chrome.tabs.query({
  82. currentWindow: true,
  83. active: true
  84. },
  85. function(tabs) {
  86. formalyseThemeHead = document.getElementById("formalyseDefaultThemeHead").value;
  87. formalyseThemeAction = document.getElementById("formalyseDefaultThemeAction").value;
  88. formalyseThemeMain = document.getElementById("formalyseDefaultThemeMain").value;
  89. chrome.tabs.executeScript(
  90. {code: '\n\
  91. if( formInfoApp ) {\n\
  92. formInfoApp.close();\n\
  93. }\n\
  94. var centerTop = 100;//parseInt((window.screen.availHeight - 700) / 2);\n\
  95. var centerLeft = 100;//parseInt((window.screen.availWidth - 800) / 2);\n\
  96. var formInfoApp = window.open("", "formInfoApp", "width=800,height=700,top="+centerTop+",left="+centerLeft+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no");\n\
  97. counter = 1;\n\
  98. formInfoApp.document.write("<html><head><title>Formalyse</title>");\n\
  99. formInfoApp.document.writeln("<script>");\n\
  100. formInfoApp.document.writeln("var blinkAllowed = 1;");\n\
  101. // isFrame=boolean, h=frameNr, i=formularNr, j=elementNr, k=ImageElementNr \n\
  102. formInfoApp.document.writeln("function blinkElement( isFrame, h, i, j, k ) {");\n\
  103. formInfoApp.document.writeln(" var timer = 0;");\n\
  104. formInfoApp.document.writeln(" if( blinkAllowed ) {");\n\
  105. formInfoApp.document.writeln(" blinkAllowed = 0;");\n\
  106. // formInfoApp.document.writeln(" alert(isFrame+\\"-\\"+h+\\"-\\"+i+\\"-\\"+j+\\"-\\"+k);");\n\
  107. formInfoApp.document.writeln(" if( isFrame == 0 ) {");\n\
  108. formInfoApp.document.writeln(" domPath = window.opener.document.forms;");\n\
  109. formInfoApp.document.writeln(" } else {");\n\
  110. formInfoApp.document.writeln(" domPath = window.opener.window.frames[h].document.forms;");\n\
  111. formInfoApp.document.writeln(" }");\n\
  112. formInfoApp.document.writeln(" if( k > 0 ) {");\n\
  113. // formInfoApp.document.writeln(" alert(isFrame+\\"-\\"+h+\\"-\\"+i+\\"-\\"+j+\\"-\\"+k);");\n\
  114. formInfoApp.document.writeln(" var inputs = domPath[i].getElementsByTagName(\\"input\\");");\n\
  115. formInfoApp.document.writeln(" var elementStyle1 = inputs[k].style;");\n\
  116. formInfoApp.document.writeln(" oldVisibility = elementStyle1.visibility;");\n\
  117. formInfoApp.document.writeln(" for(var x=0; x<3; x++) {");\n\
  118. formInfoApp.document.writeln(" setTimeout(function() {elementStyle1.visibility=\'hidden\';}, timer+=100);");\n\
  119. formInfoApp.document.writeln(" setTimeout(function() {elementStyle1.visibility=oldVisibility;}, timer+=100);");\n\
  120. formInfoApp.document.writeln(" }");\n\
  121. formInfoApp.document.writeln(" elementStyle1.visibility=oldVisibility;");\n\
  122. formInfoApp.document.writeln(" } else {");\n\
  123. formInfoApp.document.writeln(" oldVisibility = domPath[i][j].style.visibility;");\n\
  124. formInfoApp.document.writeln(" oldColor = domPath[i][j].style.backgroundColor;");\n\
  125. formInfoApp.document.writeln(" domPath[i][j].style.backgroundColor = \\"#de010a\\";");\n\
  126. formInfoApp.document.writeln(" for(var x=0; x<3; x++) {");\n\
  127. formInfoApp.document.writeln(" setTimeout(function() {domPath[i][j].style.visibility=\'hidden\';}, timer+=100);");\n\
  128. formInfoApp.document.writeln(" setTimeout(function() {domPath[i][j].style.visibility=oldVisibility;}, timer+=100);");\n\
  129. formInfoApp.document.writeln(" }");\n\
  130. formInfoApp.document.writeln(" setTimeout(function() {domPath[i][j].style.backgroundColor=oldColor;}, timer+=100);");\n\
  131. formInfoApp.document.writeln(" }");\n\
  132. formInfoApp.document.writeln(" setTimeout(\\"blinkAllowed = 1;\\", timer+=100);");\n\
  133. formInfoApp.document.writeln(" }");\n\
  134. formInfoApp.document.writeln("}");\n\
  135. \n\
  136. formInfoApp.document.writeln("function formOverlayShow(form) {");\n\
  137. formInfoApp.document.writeln(" form.style.position = \\"relative\\";");\n\
  138. formInfoApp.document.writeln(" var formComputed=getComputedStyle(form);");\n\
  139. // height\n\
  140. formInfoApp.document.writeln(" var height = formComputed.height;");\n\
  141. formInfoApp.document.writeln(" var heightOff = form.offsetHeight;");\n\
  142. formInfoApp.document.writeln(" if( height == \\"auto\\" ) {");\n\
  143. formInfoApp.document.writeln(" if( Number.isInteger(heightOff) ) {");\n\
  144. formInfoApp.document.writeln(" if( heightOff > 15 ) {");\n\
  145. formInfoApp.document.writeln(" height = heightOff;");\n\
  146. formInfoApp.document.writeln(" } else {");\n\
  147. formInfoApp.document.writeln(" height = 15;");\n\
  148. formInfoApp.document.writeln(" }");\n\
  149. formInfoApp.document.writeln(" } else {");\n\
  150. formInfoApp.document.writeln(" height = heightInt;");\n\
  151. formInfoApp.document.writeln(" }");\n\
  152. formInfoApp.document.writeln(" } else {");\n\
  153. formInfoApp.document.writeln(" var heightInt = parseInt(height);");\n\
  154. formInfoApp.document.writeln(" if( heightInt < 15 ) heightInt = 15;");\n\
  155. formInfoApp.document.writeln(" height = heightInt;");\n\
  156. formInfoApp.document.writeln(" }");\n\
  157. // width\n\
  158. formInfoApp.document.writeln(" var width = formComputed.width;");\n\
  159. formInfoApp.document.writeln(" var widthOff = form.offsetWidth;");\n\
  160. formInfoApp.document.writeln(" if( width == \\"auto\\" ) {");\n\
  161. formInfoApp.document.writeln(" if( Number.isInteger(widthOff) ) {");\n\
  162. formInfoApp.document.writeln(" width = widthOff;");\n\
  163. formInfoApp.document.writeln(" if( widthOff < 25 ) {width = 25;}");\n\
  164. formInfoApp.document.writeln(" } else {");\n\
  165. formInfoApp.document.writeln(" width = 25;");\n\
  166. formInfoApp.document.writeln(" }");\n\
  167. formInfoApp.document.writeln(" } else {");\n\
  168. formInfoApp.document.writeln(" var widthInt = parseInt(width);");\n\
  169. formInfoApp.document.writeln(" if( widthInt < 25 ) {widthInt = 25;}");\n\
  170. formInfoApp.document.writeln(" width = widthInt;");\n\
  171. formInfoApp.document.writeln(" }");\n\
  172. // top/left\n\
  173. formInfoApp.document.writeln(" var formalyseDivOver2 = \\"<div name=\'formalyseDivOver\' style=\'background-color:green;width:\\"+width+\\"px;height:\\"+height+\\"px;left: 0;top: 0;position:absolute;opacity:0.5;z-index: 9999;\'>&nbsp;</div>\\"");\n\
  174. formInfoApp.document.writeln(" form.insertAdjacentHTML(\\"afterbegin\\", formalyseDivOver2);");\n\
  175. formInfoApp.document.writeln("}");\n\
  176. \n\
  177. formInfoApp.document.writeln("function formOverlayHide(frame, form) {");\n\
  178. formInfoApp.document.writeln(" form.style.position = \\"\\";");\n\
  179. formInfoApp.document.writeln(" var elements = frame.getElementsByName(\\"formalyseDivOver\\");");\n\
  180. formInfoApp.document.writeln(" while(elements.length > 0){");\n\
  181. formInfoApp.document.writeln(" elements[0].parentNode.removeChild(elements[0]);");\n\
  182. formInfoApp.document.writeln(" }");\n\
  183. formInfoApp.document.writeln("}");\n\
  184. // Popup Bildvorschau\n\
  185. formInfoApp.document.writeln("function formalyseWindowOpen(url, width, height) {");\n\
  186. formInfoApp.document.writeln(" width = parseInt(width);");\n\
  187. formInfoApp.document.writeln(" height = parseInt(height);");\n\
  188. formInfoApp.document.writeln(" if( width < 400 ) width = 400;");\n\
  189. formInfoApp.document.writeln(" if( height < 250 ) height = 250;");\n\
  190. formInfoApp.document.writeln(" var centerTop = 200;//parseInt((window.screen.availHeight - height) / 2);");\n\
  191. formInfoApp.document.writeln(" var centerLeft = 200;//parseInt((window.screen.availWidth - width) / 2);");\n\
  192. formInfoApp.document.writeln(" window.open(url, \\"imgWindow\\", \\"width=\\"+width+\\",height=\\"+height+\\",top=\\"+centerTop+\\",left=\\"+centerLeft+\\",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no\\");");\n\
  193. formInfoApp.document.writeln("}");\n\
  194. formInfoApp.document.writeln("</script>");\n\
  195. formInfoApp.document.write("</head><body>");\n\
  196. if( document.forms.length > 0 ) {\n\
  197. formInfoApp.document.write("<table border=1 width=\'100%\' style=\'font-family: arial;font-size: 12px;border-collapse: collapse;background-color: '+formalyseThemeMain+';table-layout: fixed;\'>");\n\
  198. formInfoApp.document.write("<colgroup><col width=\'23\'><col width=\'85\'><col width=\'165\'><col width=\'*\'></colgroup>");\n\
  199. for(var i = 0; i < document.forms.length; i++) {\n\
  200. analyseDocument(document.forms[i], 0);\n\
  201. }\n\
  202. formInfoApp.document.write("</table>");\n\
  203. }\n\
  204. if( window.frames.length > 0 ) {\n\
  205. formInfoApp.document.write("<table border=1 width=\'100%\' style=\'font-family: arial;font-size: 12px;border-collapse: collapse;background-color: '+formalyseThemeMain+';table-layout: fixed;\'>");\n\
  206. formInfoApp.document.write("<colgroup><col width=\'23\'><col width=\'85\'><col width=\'165\'><col width=\'*\'></colgroup>");\n\
  207. var frames = window.frames;\n\
  208. for(var h = 0; h < frames.length; h++) {\n\
  209. // formInfoApp.document.write("xxx-"+h+"-"+(typeof frames)+"<br>");\n\
  210. if( typeof frames === \'object\' ) {\n\
  211. for(var i = 0; i < frames[h].document.forms.length; i++) {\n\
  212. // formInfoApp.document.write("yyy-"+h+"-"+i+"<br>");\n\
  213. analyseDocument(frames[h].document.forms[i], 1, h);\n\
  214. }\n\
  215. }\n\
  216. }\n\
  217. formInfoApp.document.write("</table>");\n\
  218. }\n\
  219. if( document.forms.length <= 0 && window.frames.length <= 0 ) {\n\
  220. formInfoApp.document.write("nothing found");\n\
  221. }\n\
  222. formInfoApp.document.write("</body></html>");\n\
  223. \n\
  224. // FUNCTION: \n\
  225. function analyseDocument(documentForms, isFrame, frameNr) {\n\
  226. var regxpr = /(<([^>]+)>)/ig; /* RegExp: replace um HTML zu entfernen */\n\
  227. if( isFrame == 0 ) {\n\
  228. domPath = "window.opener.document.forms";\n\
  229. framePath = "window.opener.document";\n\
  230. rowspan = 4;\n\
  231. } else {\n\
  232. domPath = "window.opener.window.frames["+h+"].document.forms";\n\
  233. framePath = "window.opener.window.frames["+h+"].document";\n\
  234. rowspan = 5;\n\
  235. }\n\
  236. if( documentForms.name == "" ) {\n\
  237. formName = "<i>n/a</i>";\n\
  238. } else {\n\
  239. formName = documentForms.name;\n\
  240. }\n\
  241. formInfoApp.document.write("<tr style=\'background-color: '+formalyseThemeHead+';\' onMouseover=\'formOverlayShow("+domPath+"["+i+"]);\' onMouseout=\'formOverlayHide("+framePath+", "+domPath+"["+i+"]);\'><td colspan=4><h2 style=\'margin: 0;\'>Name: <u style=\'cursor: pointer;color: #224A7D;\' title=\'click to mark form in webpage\' onClick=\'"+domPath+"["+i+"].style.backgroundColor=\\"rgba(255, 255, 0, 0.2)\\";"+domPath+"["+i+"].style.border=\\"3px dotted green\\";\'>"+formName+"</u></h2></td></tr>");\n\
  242. if( documentForms.getAttribute("action") == "" ) {\n\
  243. formAction = "<i>n/a</i>";\n\
  244. } else {\n\
  245. formAction = documentForms.getAttribute("action");\n\
  246. }\n\
  247. formInfoApp.document.write("<tr><td colspan=2 style=\'background-color: '+formalyseThemeAction+';\'>&nbsp;<b>action:</b></td><td colspan=2 style=\'word-wrap: break-word;\'>"+formAction+"</td></tr>");\n\
  248. formInfoApp.document.write("<tr>");\n\
  249. formInfoApp.document.write("<td colspan=2 style=\'background-color: '+formalyseThemeAction+';\'>");\n\
  250. formInfoApp.document.write("&nbsp;<b>method:</b>");\n\
  251. formInfoApp.document.write("<img src=\''+postGetSwitch+'\' align=\'right\' style=\'vertical-align: middle;cursor: pointer;padding: 0 2px;\' title=\'click to toggle post/get\' onclick=\'document.getElementById(\\"method_"+counter+"\\").style.color=\\"blue\\";if("+domPath+"["+i+"].method==\\"post\\"){"+domPath+"["+i+"].method=\\"get\\";document.getElementById(\\"method_"+counter+"\\").innerText=\\"get\\";}else{"+domPath+"["+i+"].method=\\"post\\";document.getElementById(\\"method_"+counter+"\\").innerText=\\"post\\";}\'>");\n\
  252. formInfoApp.document.write("</td>");\n\
  253. formInfoApp.document.write("<td><span id=\'method_"+counter+"\'>"+documentForms.method+"</span> <b style=\'color: blue;float: right;\'>[initial: "+documentForms.method+"]&nbsp;</b></td>");\n\
  254. ++counter;\n\
  255. formInfoApp.document.write("<td style=\'margin: 0;padding: 0;\'>");\n\
  256. formInfoApp.document.write("<table border=0 width=\'100%\' style=\'font-family: arial;font-size: 12px;border-collapse: collapse;background-color: '+formalyseThemeMain+';table-layout: fixed;\'><tr>");\n\
  257. formInfoApp.document.write("<td style=\'background-color: '+formalyseThemeAction+';width: 110px;border-right: 1px solid black;\'><b>id:</b></td>");\n\
  258. formInfoApp.document.write("<td>"+documentForms.id+"</td>");\n\
  259. formInfoApp.document.write("</tr></table>");\n\
  260. formInfoApp.document.write("</tr>");\n\
  261. formInfoApp.document.write("<tr>");\n\
  262. formInfoApp.document.write("<td colspan=2 style=\'background-color: '+formalyseThemeAction+';\'>&nbsp;<b><i>form[n]:</i></b></td>");\n\
  263. formInfoApp.document.write("<td>"+i+"</td>");\n\
  264. formInfoApp.document.write("<td style=\'margin: 0;padding: 0;\'>");\n\
  265. formInfoApp.document.write("<table border=0 width=\'100%\' style=\'font-family: arial;font-size: 12px;border-collapse: collapse;background-color: '+formalyseThemeMain+';table-layout: fixed;\'><tr>");\n\
  266. formInfoApp.document.write("<td style=\'background-color: '+formalyseThemeAction+';width: 110px;border-right: 1px solid black;\'><b>onSubmit:</b></td>");\n\
  267. formOnSubmit = documentForms.getAttribute("onsubmit");\n\
  268. if( formOnSubmit === null ) {\n\
  269. formOnSubmit = "<i>n/a</i>";\n\
  270. }\n\
  271. formInfoApp.document.write("<td>"+formOnSubmit+"</td>");\n\
  272. formInfoApp.document.write("</tr></table>");\n\
  273. formInfoApp.document.write("</tr>");\n\
  274. if( isFrame == 1 ) {\n\
  275. formInfoApp.document.write("<tr><td colspan=2 style=\'background-color: '+formalyseThemeAction+';\'>&nbsp;<b><i>frame[n]:</i></b></td><td colspan=2>"+frameNr+"</td></tr>");\n\
  276. }\n\
  277. formInfoApp.document.write("<tr style=\'background-color: '+formalyseThemeHead+';\'><td><b style=\'font-size: 14px;\'>Ix</b></td><td><b style=\'font-size: 14px;\'>Type</b></td><td><b style=\'font-size: 14px;\'>Name</b></td><td><b style=\'font-size: 14px;\'>Value</b></td></tr>");\n\
  278. for(var j = 0; j < documentForms.length; j++) {\n\
  279. if( documentForms[j].type != "fieldset" ) {\n\
  280. inputLine = documentForms[j].outerHTML;\n\
  281. inputLine = inputLine.replace(/\"/g, \'\\"\').replace(/\'\/g, "\\"").replace(/\\t+/g, "").replace(/\\n\\t*\\n/g, "\\n").replace(/><\\/select/g, ">\\n<\\/select").replace(/><option/g, ">&#13;- <option");\n\
  282. if( frameNr == undefined ) {frameNrType = 1;} else {frameNrType = frameNr}\n\
  283. formInfoApp.document.write("<tr title=\'"+inputLine+"\' style=\'cursor: help;\'><td align=\'center\' style=\'cursor: pointer;\' title=\'click to blink element\' onClick=\'blinkElement("+isFrame+", "+h+", "+i+", "+j+", 0);\'><u style=\'cursor: pointer;color: #224A7D;\'>"+j+"</u></td><td>");\n\
  284. if( documentForms[j].type == "hidden" ) {\n\
  285. formInfoApp.document.write("<img src=\''+showHidden+'\' align=\'right\' style=\'vertical-align: middle;cursor: pointer;padding: 0 1px;\' title=\'click to toggle hidden/text\' onClick=\'document.getElementById(\\"type_"+frameNrType+"_"+i+"_"+j+"\\").style.color=\\"blue\\";"+domPath+"["+i+"]["+j+"].style.backgroundColor=\\"#f7f7c4\\";"+domPath+"["+i+"]["+j+"].style.color=\\"#ff002b\\";if("+domPath+"["+i+"]["+j+"].getAttribute(\\"type\\") == \\"text\\") {"+domPath+"["+i+"]["+j+"].setAttribute(\\"type\\", \\"hidden\\");}else{"+domPath+"["+i+"]["+j+"].setAttribute(\\"type\\", \\"text\\");}"+domPath+"["+i+"]["+j+"].setAttribute(\\"title\\", \\""+documentForms[j].name+"\\");\'>");\n\
  286. } else if( documentForms[j].type == "password" ) {\n\
  287. formInfoApp.document.write("<img src=\''+showHiddenRed+'\' align=\'right\' style=\'vertical-align: middle;cursor: pointer;padding: 0 1px;\' title=\'click to show password\' onClick=\'document.getElementById(\\"type_"+frameNrType+"_"+i+"_"+j+"\\").style.color=\\"blue\\";"+domPath+"["+i+"]["+j+"].style.backgroundColor=\\"#f7f7c4\\";"+domPath+"["+i+"]["+j+"].style.color=\\"#ff002b\\";"+domPath+"["+i+"]["+j+"].setAttribute(\\"type\\", \\"text\\");"+domPath+"["+i+"]["+j+"].setAttribute(\\"title\\", \\""+documentForms[j].name+"\\");\'>");\n\
  288. } else if( documentForms[j].type == "radio" ) {\n\
  289. formInfoApp.document.write("<img src=\''+optionUncheck+'\' align=\'right\' style=\'vertical-align: middle;cursor: pointer;padding: 0 2px;\' title=\'click to deselect radiobutton\' onClick=\'document.getElementById(\\"type_"+frameNrType+"_"+i+"_"+j+"\\").style.color=\\"blue\\";"+domPath+"["+i+"]["+j+"].checked=false;\'>");\n\
  290. }\n\
  291. if( documentForms[j].readOnly ) {\n\
  292. formInfoApp.document.write("<img src=\''+lockPath+'\' align=\'right\' style=\'vertical-align: bottom;cursor: pointer;padding: 0 1px;\' title=\'click to unlock \\"readonly\\"\' onClick=\'document.getElementById(\\"type_"+frameNrType+"_"+i+"_"+j+"\\").style.color=\\"blue\\";"+domPath+"["+i+"]["+j+"].readOnly=false;"+domPath+"["+i+"]["+j+"].disabled=false;"+domPath+"["+i+"]["+j+"].style.backgroundColor=\\"#f7f7c4\\";"+domPath+"["+i+"]["+j+"].style.color=\\"#ff002b\\";\'>");\n\
  293. }\n\
  294. formInfoApp.document.write("<span id=\'type_"+frameNrType+"_"+i+"_"+j+"\' title=\'type_"+frameNrType+"_"+i+"_"+j+"\'>"+documentForms[j].type+"</span>");\n\
  295. if( documentForms[j].name == "" ) {\n\
  296. name_1 = "<i>n/a</i>";\n\
  297. } else {\n\
  298. name_1 = documentForms[j].name;\n\
  299. }\n\
  300. formInfoApp.document.write("</td><td style=\'overflow: hidden;\'>"+name_1+"</td>");\n\
  301. if( documentForms[j].type == "select-one" || documentForms[j].type == "select-multiple" ) {\n\
  302. // Select-List? \n\
  303. formInfoApp.document.write("<td style=\'overflow: hidden;\'>");\n\
  304. for(var k = 0; k < documentForms[j].length; k++) {\n\
  305. formInfoApp.document.write("<b>&bull;</b> &quot;"+documentForms[j].options[k].text+"&quot;&emsp;&emsp;&emsp;[<b>value:</b> "+documentForms[j].options[k].value+"]");\n\
  306. if( documentForms[j].options[k].selected ) {\n\
  307. formInfoApp.document.write(" <b style=\'color: blue;\'>[selected]</b>");\n\
  308. }\n\
  309. formInfoApp.document.write("<br>");\n\
  310. }\n\
  311. formInfoApp.document.write("</td>");\n\
  312. } else if( documentForms[j].type == "radio" || documentForms[j].type == "checkbox" ) {\n\
  313. // Radio-Buttons / Checkboxes? \n\
  314. formInfoApp.document.write("<td style=\'overflow: hidden;\'>");\n\
  315. formInfoApp.document.write(""+documentForms[j].value+"");\n\
  316. if( documentForms[j].checked ) {\n\
  317. if( documentForms[j].type == "radio" ) {\n\
  318. formInfoApp.document.write(" <b style=\'color: blue;\'>[selected]</b>");\n\
  319. } else if( documentForms[j].type == "checkbox" ) {\n\
  320. formInfoApp.document.write(" <b style=\'color: blue;\'>[checked]</b>");\n\
  321. }\n\
  322. }\n\
  323. formInfoApp.document.write("</td>");\n\
  324. } else if( documentForms[j].type == "submit" || documentForms[j].type == "button" ) {\n\
  325. if( documentForms[j].value && documentForms[j].value != "" ) {\n\
  326. submitValue = "&quot;"+documentForms[j].value+"&quot;";\n\
  327. } else {\n\
  328. submitValue = "<i>n/a</i>";\n\
  329. }\n\
  330. if( documentForms[j].innerHTML ) {\n\
  331. formInfoApp.document.write("<td style=\'overflow: hidden;\'><b>value:</b> "+submitValue+"<br><b>innerHTML:</b> &quot;"+documentForms[j].innerHTML.replace(regxpr, "")+"&quot;</td>");\n\
  332. } else {\n\
  333. formInfoApp.document.write("<td style=\'overflow: hidden;\'>"+submitValue+"</td>");\n\
  334. }\n\
  335. } else if( documentForms[j].type == "textarea" ) {\n\
  336. formInfoApp.document.write("<td style=\'overflow: hidden;\'>"+documentForms[j].value.replace(/</g, \'&lt;\')+"</td>");\n\
  337. } else {\n\
  338. formInfoApp.document.write("<td style=\'overflow: hidden;\'>"+documentForms[j].value+"</td>");\n\
  339. }\n\
  340. formInfoApp.document.write("</tr>");\n\
  341. l=j;\n\
  342. }\n\
  343. }\n\
  344. // Suche: <input type="image" ...>\n\
  345. var inputs = documentForms.getElementsByTagName("input");\n\
  346. for(var k=0; k<inputs.length; k++){\n\
  347. if(inputs[k].getAttribute("type")=="image"){\n\
  348. //alert(inputs[k].getAttribute("src"));\n\
  349. inputLine = inputs[k].outerHTML;\n\
  350. inputLine = inputLine.replace(/\"/g, \'\\"\').replace(/\'\/g, "\\"").replace(/\\n/g, "").replace(/\\t/g, "").replace(/<option\/g, "\\n<option");\n\
  351. formInfoApp.document.write("<tr title=\'"+inputLine+"\' style=\'cursor: help;\'>");\n\
  352. formInfoApp.document.write(" <td align=\'center\' style=\'cursor: pointer;\' onClick=\'blinkElement("+isFrame+", "+h+", "+i+", "+j+", "+k+");\'><u style=\'cursor: pointer;color: #224A7D;\'>"+(++l)+"</u></td><td>image</td>");\n\
  353. if( typeof inputs[k].getAttribute("name") === "object" ) {\n\
  354. name_2 = "<i>n/a</i>";\n\
  355. } else {\n\
  356. name_2 = inputs[k].getAttribute("name");\n\
  357. }\n\
  358. formInfoApp.document.write(" <td>"+name_2+"</td>");\n\
  359. formInfoApp.document.write(" <td style=\'overflow: hidden;\'>");\n\
  360. if( inputs[k].getAttribute("value") && inputs[k].getAttribute("value") != "" ) {\n\
  361. formInfoApp.document.write(" <b>value: </b> "+inputs[k].getAttribute("value")+"<br>");\n\
  362. }\n\
  363. formInfoApp.document.write(" <b>src: </b> <u style=\'cursor: pointer;color: #224A7D;\' onClick=\'formalyseWindowOpen(\\""+inputs[k].getAttribute("src")+"\\", \\""+getComputedStyle(inputs[k]).width+"\\", \\""+getComputedStyle(inputs[k]).height+"\\");\'>"+inputs[k].getAttribute("src")+"</u><b style=\\"color: blue;float: right;\\">[click link to preview image]</b>");\n\
  364. formInfoApp.document.write(" </td>");\n\
  365. formInfoApp.document.write("</tr>");\n\
  366. }\n\
  367. }\n\
  368. formInfoApp.document.write("</table><br>");\n\
  369. formInfoApp.document.write("<table border=1 width=\'100%\' style=\'font-family: arial;font-size: 12px;border-collapse: collapse;background-color: '+formalyseThemeMain+';table-layout: fixed;\'>");\n\
  370. formInfoApp.document.write("<colgroup><col width=\'23\'><col width=\'85\'><col width=\'165\'><col width=\'*\'></colgroup>");\n\
  371. }\n\
  372. formInfoApp.document.close();'
  373. }
  374. );
  375. }
  376. );
  377. }, false);
  378. }, false
  379. );
  380.  
  381. getTheme();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement