Well - I've created my own beta version of a Developer Enviroment, using Codepress - im using ASP as serverside component for reading/writing/file-listing - and are using the file extension to guess the format:
function GuessExtension(fname)
ext = right(fname,3)
if ext = ".cs" then
GuessExtension = "csharp"
elseif ext = "css" then
GuessExtension = "css"
elseif ext = "htm" or ext = "tml" or ext = "xml" or ext = "xsl" or ext = "xsc" then
GuessExtension = "html"
elseif ext = "ava" then
GuessExtension = "java"
elseif ext = ".js" then
GuessExtension = "javascript"
elseif ext = "txt" then
GuessExtension = "text"
elseif ext = "sql" then
GuessExtension = "sql"
elseif ext = "asp" then
GuessExtension = "vbscript"
else
GuessExtension = "generic"
end if
end function
--------
i have then created a AJAX module that takes 3 parameters :
1. An URL that locates the file
2. An Action => "openfile", "save", "saveas", "loadlist"
3. Multiple-Use Parameter => being either the Language of file or the Code to save
in order to fix any mistaken language, ive created a <select> to shift language:
Logged In: NO
do you mean some kind of parsing ?!?
Logged In: YES
user_id=1871003
Originator: YES
it should detect <script> tags, <? tags and <style> tags - and highlight the content accordingly.
Logged In: YES
user_id=577658
Originator: NO
Well - I've created my own beta version of a Developer Enviroment, using Codepress - im using ASP as serverside component for reading/writing/file-listing - and are using the file extension to guess the format:
function GuessExtension(fname)
ext = right(fname,3)
if ext = ".cs" then
GuessExtension = "csharp"
elseif ext = "css" then
GuessExtension = "css"
elseif ext = "htm" or ext = "tml" or ext = "xml" or ext = "xsl" or ext = "xsc" then
GuessExtension = "html"
elseif ext = "ava" then
GuessExtension = "java"
elseif ext = ".js" then
GuessExtension = "javascript"
elseif ext = "txt" then
GuessExtension = "text"
elseif ext = "sql" then
GuessExtension = "sql"
elseif ext = "asp" then
GuessExtension = "vbscript"
else
GuessExtension = "generic"
end if
end function
--------
i have then created a AJAX module that takes 3 parameters :
1. An URL that locates the file
2. An Action => "openfile", "save", "saveas", "loadlist"
3. Multiple-Use Parameter => being either the Language of file or the Code to save
in order to fix any mistaken language, ive created a <select> to shift language:
<select id="Lang" onchange="change()">
<option value="csharp">C#</option>
<option value="css">CSS</option>
<option value="generic">Generic</option>
<option selected="selected" value="html">HTML</option>
<option value="java">Java</option>
<option value="javascript">JavaScript</option>
<option value="perl">Perl</option>
<option value="ruby">Ruby</option>
<option value="php">PHP</option>
<option value="text">Text</option>
<option value="sql">SQL</option>
<option value="vbscript">VBScript</option>
</select>
and a function for doing it:
function change(){
var lang = byid("Lang").value;
myCpWindow.edit( myCpWindow.getCode(), lang );
}
i hope this inspires you :)
Logged In: YES
user_id=1695796
Originator: NO
looks really hard.
Logged In: YES
user_id=577658
Originator: NO
Try it out, at www.mdk-photo.com/Trial