home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / chip_04_2004.iso / shop / text.js < prev    next >
Text File  |  2003-12-10  |  7KB  |  29 lines

  1. function entfernen_font_2(t){erste_anders_1=t.search(/size="1"/i);erste_anders_3=t.search(/size="3"/i);erste_anders_4=t.search(/size="4"/i);bis=t.length;if (erste_anders_1 != -1) {if (erste_anders_1 < bis) {bis=erste_anders_1}}
  2. if (erste_anders_3 != -1) {if (erste_anders_3 < bis) {bis=erste_anders_3}}if (erste_anders_4 != -1) {if (erste_anders_4 < bis) {bis=erste_anders_4}}p=t.search(/<font  size="2">/i);while ((p > -1) && (p<bis))
  3. {p=t.search(/<font  size="2">/i);if ((p>-1) && (p<bis)){t1=t.slice(0,p);t2=t.slice(p+16,t.length);p1=t2.search(/<\/font>/i);t=t1+t2.slice(0,p1)+t2.slice(p1+7);}}return(t);}function entfernen_farbe_sw(t)
  4. {p=t.search(/<font  size="2" color="#/i);while ((p > -1)){p=t.search(/<font  size="2" color="#/i);if (p > -1){t1=t.substr(p+24,6);if (t1 == "000000"){t1=t.slice(0,p);t2=t.slice(p+32,t.length);p1=t2.search(/<\/font>/i);
  5. t=t1+t2.slice(0,p1)+t2.slice(p1+7);}else { return(t); }}}return(t);}function text_ausgabe_neu(text){if (text.substr(0,3)=="<P>") text = text.substr(3,text.length-3);box = text.search(/<box>/i);if (box > -1) {text = text.replace(/<box>/gi,"");}
  6. aufzaehlung_1 = text.search(/<ul1>/i);if (aufzaehlung_1 > -1) {text = text.replace(/<ul1>/gi,"");}aufzaehlung_2 = text.search(/<ul2>/i);if (aufzaehlung_2 > -1) {text = text.replace(/<ul2>/gi,"");}aufzaehlung_3 = text.search(/<ul3>/i);
  7. if (aufzaehlung_3 > -1) {text = text.replace(/<ul3>/gi,"");}text = text.replace(/face="ms sans serif"/gi,"");text = text.replace(/face="verdana"/gi,"");text = text.replace(/face="arial"/gi,"");text = text.replace(/face="times new roman"/gi,"");
  8. text = text.replace(/face=/gi,"");text = text.replace(/li> <li/gi,"li><li");text = text.replace(/<br><\/li><li>/gi,"</li><li>");text = text.replace(/<\/li><li><\/font>/gi,"</font></li><li>");text = text.replace(/<\/li><li> <\/font>/gi,"</font></li><li>");
  9. text = text.replace(/<font *size="."><\/font>/gi,"");text = text.replace(/<ul> <li>/gi,"<ul><li>");text = text.replace(/<font *size="."> <\/font>/gi," ");text = text.replace(/<\/font><font  size="2"><\/b>/gi,"</b></font><font  size=\"2\">");
  10. text = text.replace(/<br><\/li> <\/ul><p><\/font>/gi,"</li></font></ul><p>");text = text.replace(/<ul><li><\/font>/gi,"</font><ul><li>");text = text.replace(/<font  size="2" color="#000000"><\/b>/gi,"</b><font  size=\"2\" color=\"#000000\">");
  11. text = text.replace(/<font *size="."><br><\/li><\/font>/gi,"</li>");text = text.replace(/<font *size="."><br><p><\/font>/gi,"<br><p>");text = text.replace(/<font *size="."><br><\/font>/gi,"<br>");text = text.replace(/<font *size="."><br><br><\/font>/gi,"<br><br>");
  12. text = text.replace(/<br><p>/gi,"<p>");text = text.replace(/<font *size="." color="#......"><p><\/font>/gi,"<p>");text = text.replace(/<\/font><\/b>/gi,"</b></font>");text = text.replace(/<p><ul>/gi,"<ul>");
  13. text = text.replace(/<\/font><font  size="1"><\/b>/gi,"</b></font><font  size=\"1\">");text = text.replace(/<p><\/font>/gi,"</font><p>");text = text.replace(/<font *size="."><\/li><\/font>/gi,"</li>");
  14. text = text.replace(/<font *size="."><\/font>/gi,"");text = text.replace(/<font *size="." *color="#......"> <\/font>/gi,"");text = text.replace(/<font *size="." *color="#......"><\/font>/gi,"");text = entfernen_font_2(text);
  15. text = entfernen_farbe_sw(text);text = text.replace(/<ul><\/1>/gi,"</1><ul>");text = text.replace(/<p><\/1>/gi,"</1><p>");text=text.replace(/<\/1><br><\/li><\/ul>/gi,"</li></ul></1>");if (box > -1){if (parent.shop.objAgent.bIE4)
  16. {text = text.replace(/<1>/gi,"<span style=\"background-color:red; color:yellow; width:100%; float:left; padding-top:5px; padding-bottom:5px; padding-right:10px; padding-left:10px;\" >");text = text.replace(/<2>/gi,"<span style=\"background-color:yellow; width:100%; float:left;  padding-top:5px; padding-bottom:5px; padding-right:10px; padding-left:10px; \" >");
  17. text = text.replace(/<3>/gi,"<span style=\"background-color:yellow; color:red; width:100%;float:left; padding-top:5px; padding-bottom:5px; padding-right:10px; padding-left:10px;\" >");text = text.replace(/<4>/gi,"<span style=\"background-color:#6AD500; width:100%; float:left;  padding-top:5px; padding-bottom:5px; padding-right:10px; padding-left:10px; \" >");
  18. text = text.replace(/<5>/gi,"<span style=\"background-color:red; width:100%; float:left;  padding-top:5px; padding-bottom:5px; padding-right:10px; padding-left:10px; \" >");} else{text = text.replace(/<1>/gi,"<span style=\"background-color:red;  width:100%; float:none; padding-top:1px; padding-bottom:1px; padding-right:10px; padding-left:10px;\" >");
  19. text = text.replace(/<2>/gi,"<span style=\"background-color:yellow; width:100%; float:none;  padding-top:1px; padding-bottom:1px; padding-right:10px; padding-left:10px; \" >");text = text.replace(/<3>/gi,"<span style=\"background-color:yellow; width:100%; float:none; padding-top:1px; padding-bottom:1px; padding-right:10px; padding-left:10px;\" >");
  20. text = text.replace(/<4>/gi,"<span style=\"background-color:#6AD500; width:100%; float:none;  padding-top:1px; padding-bottom:1px; padding-right:10px; padding-left:10px; \" >");text = text.replace(/<5>/gi,"<span style=\"background-color:red; width:100%; float:none;  padding-top:1px; padding-bottom:1px; padding-right:10px; padding-left:10px; \" >");
  21. }}else{text = text.replace(/<1>/gi,"<span style=\"background-color:red; color:yellow; float:left; padding-top:1px; padding-bottom:1px; padding-right:10px; padding-left:10px;\" >");text = text.replace(/<2>/gi,"<span style=\"background-color:yellow; float:left; padding-top:1px; padding-bottom:1px; padding-right:10px; padding-left:10px; \" >");
  22. text = text.replace(/<3>/gi,"<span style=\"background-color:yellow; float:left; color:red; padding-top:1px; padding-bottom:1px; padding-right:10px; padding-left:10px;\" >");text = text.replace(/<4>/gi,"<span style=\"background-color:#6AD500; float:left; padding-top:1px; padding-bottom:1px; padding-right:10px; padding-left:10px; \" >");
  23. text = text.replace(/<5>/gi,"<span style=\"background-color:red; float:left; padding-top:1px; padding-bottom:1px; padding-right:10px; padding-left:10px; \" >");}if (parent.shop.objAgent.bIE4){} else{text = text.replace(/<li>/gi,"<li><font size=\"2\">");
  24. text = text.replace(/<\/li>/gi,"</font></li>");}text = text.replace(/<\/1>/gi,"</span>");text = text.replace(/<cd>/gi,"<img src=\"images/cd_silber_20.gif\" style=\"filter:Chroma(color=#ffffff)\" align=\"absmiddle\"> ");
  25. text = text.replace(/<dvd>/gi,"<img src=\"images/dvd_silber_20.gif\" style=\"filter:Chroma(color=#ffffff)\" align=\"absmiddle\"> ");if (aufzaehlung_1 > -1){text = text.replace(/<ul>/gi,"<ul  style=\"list-style-image:url(images/black01_next.gif)\">");
  26. }if (aufzaehlung_2 > -1){text = text.replace(/<ul>/gi,"<ul style=\"list-style-image:url(images/red03_next.gif)\" >");}if (aufzaehlung_3 > -1){text = text.replace(/<ul>/gi,"<ul style=\"list-style-image:url(images/blackbox_next.gif)\" >");
  27. }text = text.replace(/<p>/gi,"<p style=\"font-family:Verdana,Arial,sans-serif; font-size:x-small; color:black;\">");document.write('<div font-family:Verdana,Arial,sans-serif; font-size:x-small; color:black;>');
  28. document.write('<font face="Verdana, Arial" size="2">');document.writeln(text);document.write('</font></div>');}
  29.