From: Raymond I. <xw...@us...> - 2003-03-30 17:13:51
|
Update of /cvsroot/dynapi/dynapi3x/bin In directory sc8-pr-cvs1:/tmp/cvs-serv11568/bin Modified Files: compiler.js dcompiler.html Log Message: uploaded by raymond - includes kevin's patches Index: compiler.js =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/bin/compiler.js,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** compiler.js 10 Feb 2003 22:35:26 -0000 1.1.1.1 --- compiler.js 30 Mar 2003 17:13:15 -0000 1.2 *************** *** 19,24 **** var jsCLastCompressedSize = 0; ! //Compiles or Compresses the select dynapi source folder ! function compile() { var f=document.frmcompiler; --- 19,25 ---- var jsCLastCompressedSize = 0; ! // Compiles or Compresses the select dynapi source folder ! // When check==true compiler will check dynapi files in source folder for missing semi-colons ! function compile(check) { var f=document.frmcompiler; *************** *** 27,31 **** jsFileIndex = -1; ! jsCLevel = f.cbolevel.value; jsCDebug = f.chkdebug.checked; jsCNS4 = f.chkns4.checked; --- 28,33 ---- jsFileIndex = -1; ! jsCCheck = check; ! jsCLevel = (jsCCheck)? 'low':f.cbolevel.value; jsCDebug = f.chkdebug.checked; jsCNS4 = f.chkns4.checked; *************** *** 61,67 **** document.images['bar'].style.width="1%"; CompressNextFile(); }; - // CompressNextFile: Compresses one file at a time using the crunch() function (compressor.js) function CompressNextFile(state,strText){ --- 63,69 ---- document.images['bar'].style.width="1%"; CompressNextFile(); + showScreen(jsCCheck); }; // CompressNextFile: Compresses one file at a time using the crunch() function (compressor.js) function CompressNextFile(state,strText){ *************** *** 76,82 **** f.txtstatus.value='Compiling ['+jsCLastFileName+'] - '+strText; ! }else{ ! // Save compressed data if(state=="complete"){ if(jsCLevel!='none' && (jsCLastFileName+'').toLowerCase()=='dynapi.js') { strText='// The DynAPI Distribution is distributed under the terms of the GNU LGPL license.\n' --- 78,109 ---- f.txtstatus.value='Compiling ['+jsCLastFileName+'] - '+strText; ! } ! else{ ! if (jsCCheck && state=="complete"){ ! // Check file for semi-colon errors ! // a much better error checking system is needed here ! var t='',l,exclude='{},;'; ! var ar = strText.split('\n'); ! for(var i=0;i<ar.length;i++){ ! l=strTrim(ar[i]); ! if (l && l.length){ ! ok=false; ! ch=l.substr(l.length-1,1); ! if(ar[i]!='}' && exclude.indexOf(ch)>=0) ok=true ! if(!ok){ ! l=l.replace(/</g,'<'); ! l=l.replace(/>/g,'>'); ! t+=' Line: '+(i+1)+': '+l+'<br>' ! +' File: '+jsCLastFile+'<br><br>'; ! } ! } ! } ! if(t){ ! var dv=document.all['dvscreen']; ! dv.innerHTML=dv.innerHTML+t+"<hr>"; ! } ! } if(state=="complete"){ + // Save compressed data if(jsCLevel!='none' && (jsCLastFileName+'').toLowerCase()=='dynapi.js') { strText='// The DynAPI Distribution is distributed under the terms of the GNU LGPL license.\n' *************** *** 125,129 **** Crunch(content,jsCLevel,CompressNextFile); ! }else { // finished compressing js files --- 152,157 ---- Crunch(content,jsCLevel,CompressNextFile); ! } ! else { // finished compressing js files *************** *** 171,172 **** --- 199,228 ---- return t.join(''); } + + + // Misc functions + + function showScreen(b){ + var dv=document.all['dvscreen']; + dv.innerHTML=''; + dv=document.all['dvscreenrow']; + if(b) dv.style.display='block'; + else dv.style.display='none'; + + } + + function showHideAbout() { + var dv=document.all['dvabout']; + if(dv.style.display=='block') dv.style.display='none'; + else dv.style.display='block'; + } + + function strTrim(s,dir){ + if(!s) return; + else s+=''; // make sure s is a string + dir=(dir)? dir:'<>'; + if(dir=='<'||dir=='<>') s=s.replace(/^(\s+)/g,''); + if(dir=='>'||dir=='<>') s=s.replace(/(\s+)$/g,''); + return s; + + }; \ No newline at end of file Index: dcompiler.html =================================================================== RCS file: /cvsroot/dynapi/dynapi3x/bin/dcompiler.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** dcompiler.html 10 Feb 2003 22:35:26 -0000 1.1.1.1 --- dcompiler.html 30 Mar 2003 17:13:15 -0000 1.2 *************** *** 14,29 **** </tr> <tr> ! <td valign="top" width="100%"> ! <table border="0" width="100%" cellpadding="2" cellspacing="1"> <tr> ! <td width="25%"><font size="2" face="Arial">Compression Level:<br> ! </font><select size="1" name="cbolevel" style="width: 177; height: 23"> <option value="high" selected>High</option> <option value="low">Low</option> <option value="none">None</option> </select></td> ! <td width="36%"><font size="2" face="Arial">Source Path<br> <input type="text" name="txtsource" size="20" style="width: 100%"></font></td> ! <td width="39%"><font size="2" face="Arial">Destination Path<br> <input type="text" name="txttarget" size="20" style="width: 100%"> </font></td> --- 14,40 ---- </tr> <tr> ! <td valign="top" width="100%" align="right"> ! <table border="0" width="100%"> <tr> ! <td width="50%"><font size="2" face="Arial">Compression Level:<br> ! </font><select size="1" name="cbolevel" style="width: 98%; height: 23"> <option value="high" selected>High</option> <option value="low">Low</option> <option value="none">None</option> </select></td> ! <td width="50%"><a href="javascript:;" onclick="showHideAbout()" style="text-decoration:none;font-family: Arial"><img border="0" src="dc_icon.gif" width="32" height="32" align="absmiddle"> ! <b><font size="4" color="#000080">About DynAPI ! Compiler</font></b></a><b><font size="4" color="#000080"><a style="text-decoration: none; font-family: Arial"> </a></font></b></td> ! </tr> ! </table> ! </td> ! </tr> ! <tr> ! <td valign="top" width="100%"> ! <table border="0" width="100%" cellpadding="2" cellspacing="1"> ! <tr> ! <td width="50%"><font size="2" face="Arial">Source Path<br> <input type="text" name="txtsource" size="20" style="width: 100%"></font></td> ! <td width="50%"><font size="2" face="Arial">Destination Path<br> <input type="text" name="txttarget" size="20" style="width: 100%"> </font></td> *************** *** 85,89 **** <tr> <td width="100%" align="right"> ! <input language="javascript" type="button" value="Compile" name="cmdcompile" onclick="compile()"> </td> </tr> --- 96,101 ---- <tr> <td width="100%" align="right"> ! <input language="javascript" type="button" value="Check semi-colons" name="cmdtrace" onclick="compile(true)"> ! <input language="javascript" type="button" value="Compile" name="cmdcompile" onclick="compile()"> </td> </tr> *************** *** 94,109 **** </td> </tr> ! <tr> <td bgcolor="#D6D3CE" valign="top" width="100%"> <table border="0" style="font-family: Arial; font-size: 10pt; border-style: inset; border-width: 2" cellspacing="1" cellpadding="2"> <tr> <td bgcolor="#FFFFFF" valign="top"> - <table border="0" width="100%"> - <tr> - <td width="6%"><img border="0" src="dc_icon.gif" width="32" height="32" align="absmiddle"></td> - <td width="94%"><b><font size="4" color="#0099CC">About DynAPI - Compiler 1.0</font></b></td> - </tr> - </table> <p>The DynAPI Compiler is used to compress the DynAPI source code by removing comments, white spaces, etc from the source files. --- 106,115 ---- </td> </tr> ! <tr id="dvscreenrow" style="display:none"><td bgcolor="#FFFFFF" style="font-family: Arial; border-style: inset; border-width: 2"><div id="dvscreen"></div></td></tr> ! <tr id="dvabout" style="display:none"> <td bgcolor="#D6D3CE" valign="top" width="100%"> <table border="0" style="font-family: Arial; font-size: 10pt; border-style: inset; border-width: 2" cellspacing="1" cellpadding="2"> <tr> <td bgcolor="#FFFFFF" valign="top"> <p>The DynAPI Compiler is used to compress the DynAPI source code by removing comments, white spaces, etc from the source files. *************** *** 166,172 **** </table> </form> - <p> </p> - <p> </p> - <p> </p> - <p> </p> </body> --- 172,174 ---- |