Check-in [c1cde28b68]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Avoiden obtrusion and not losing styles
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA1:c1cde28b68daac9ce7dde6cb0e205cd3caea4b3a
User & Date: cr79387 2013-10-18 18:26:57
Context
2013-10-18
18:26
Avoiden obtrusion and not losing styles Leaf check-in: c1cde28b68 user: cr79387 tags: trunk
2013-10-17
15:45
Some syntaxis erros where fixed. check-in: 147c7e750c user: cr79387 tags: trunk
Changes

Changes to lib/preprocessorJS.js.

10
11
12
13
14
15
16







































17
18
19
20
21
22
23
24
..
41
42
43
44
45
46
47
48
49
50
51

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
 }
 
  
 //Replace tokens 
 function changeIt(){ 
 
	 var markup = document.body.innerHTML;







































	 var middleString;
	 var replacedMarkup="";
	 var iniPos = markup.indexOf(openToken); 
	 

	 replacedMarkup=markup.substring(0,iniPos+2);	 
	 while(iniPos > -1){
	   var endPos = markup.indexOf(closeToken,iniPos);
................................................................................
		    middleString = markup.substring(endPos,iniPos+2);	   	   
		 else
            middleString = markup.substring(endPos,markup.length+1);	   	   		 
	     replacedMarkup+= middleString;
	   }	        
	   
	 }
	
	 replacedMarkup = replaceAll(replacedMarkup,closeToken,"</script>");
	 replacedMarkup = replaceAll(replacedMarkup,assignamentToken,"<script type='text/javascript'>document.write"); 
	 replacedMarkup = replaceAll(replacedMarkup,openToken,"<script type='text/javascript'>");

	 
	 
	 document.body.innerHTML = ""; 
	 
	 paramsStr="var prmstr = window.location.search.substr(1);"+
	"var prmarr = prmstr.split('&');"+
	"var params = {};	"+	
	"for(var i = 0;i < prmarr.length; i++){"+
	"	var tmparr = prmarr[i].split('=');"+
	"   params[tmparr[0]] = tmparr[1];		"+
	"}"	
	 document.open("text/html");
	 document.write("<style type='text/css'> body {font-family:arial;} </style><script>"+paramsStr+";</scri"+"pt>"+replacedMarkup);
	 document.close();
 }







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|







 







|


|
>
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
..
80
81
82
83
84
85
86
87
88
89
90
91
92














 }
 
  
 //Replace tokens 
 function changeIt(){ 
 
	 var markup = document.body.innerHTML;
	 var scripts = document.getElementsByTagName("script");
	 var markupScripts="";
	 var markupStyle="";
	 var styles = document.getElementsByTagName("style");
	 
	 
	 markup = analyzeMarkup(markup); 
	
	 
	 
	 
	 
	 paramsStr="var prmstr = window.location.search.substr(1);"+
			   "var prmarr = prmstr.split('&');"+
			   "var params = {};	"+	
	           "for(var i = 0;i < prmarr.length; i++){"+
	           "	var tmparr = prmarr[i].split('=');"+
			   "   params[tmparr[0]] = tmparr[1];		"+
	           "}"	
	
     
	 for (var i=0;i<scripts.length;i++) {
	     if(scripts[i].src.indexOf("preprocessorJS.js")==-1){
		   markupScripts+=scripts[i].outerHTML;
		 }  
	 }	 
	  
	 if(typeof(styles[0]) == 'undefined')
	   markupStyle =  "";
	 else
	   markupStyle =  styles[0].outerHTML;
	 
	 document.body.innerHTML = ""; 
	 document.open("text/html");
	 document.write( markupStyle+markupScripts+"<script type='text/javascript'>"+paramsStr+";</scri"+"pt>"+markup);
	 document.close();
 }
 
 function analyzeMarkup(markup){
     var middleString;
	 var replacedMarkup="";
	 var iniPos = markup.indexOf(openToken); 
	 

	 replacedMarkup=markup.substring(0,iniPos+2);	 
	 while(iniPos > -1){
	   var endPos = markup.indexOf(closeToken,iniPos);
................................................................................
		    middleString = markup.substring(endPos,iniPos+2);	   	   
		 else
            middleString = markup.substring(endPos,markup.length+1);	   	   		 
	     replacedMarkup+= middleString;
	   }	        
	   
	 }
	 
	 replacedMarkup = replaceAll(replacedMarkup,closeToken,"</script>");
	 replacedMarkup = replaceAll(replacedMarkup,assignamentToken,"<script type='text/javascript'>document.write"); 
	 replacedMarkup = replaceAll(replacedMarkup,openToken,"<script type='text/javascript'>");     
	 return replacedMarkup;
 }