Alien-CodePress
view release on metacpan or search on metacpan
cp/codepress/languages/asp.js view on Meta::CPAN
{ input : /(<!--.*?-->.)/g, output : '<big>$1</big>' }
]
Language.Functions = [
// Output at index 0, must be the desired tagname surrounding a $1
// Name is the index from the regex that marks the functionname
{input : /(function|sub)([ ]*?)(\w+)([ ]*?\()/gi , output : '<ins>$1</ins>', name : '$3'}
]
Language.snippets = [
//Conditional
{ input : 'if', output : 'If $0 Then\n\t\nEnd If' },
{ input : 'ifelse', output : 'If $0 Then\n\t\n\nElse\n\t\nEnd If' },
{ input : 'case', output : 'Select Case $0\n\tCase ?\n\tCase Else\nEnd Select'},
//Response
{ input : 'rw', output : 'Response.Write( $0 )' },
{ input : 'resc', output : 'Response.Cookies( $0 )' },
{ input : 'resb', output : 'Response.Buffer'},
{ input : 'resflu', output : 'Response.Flush()'},
{ input : 'resend', output : 'Response.End'},
//Request
{ input : 'reqc', output : 'Request.Cookies( $0 )' },
{ input : 'rq', output : 'Request.Querystring("$0")' },
{ input : 'rf', output : 'Request.Form("$0")' },
//FSO
{ input : 'fso', output : 'Set fso = Server.CreateObject("Scripting.FileSystemObject")\n$0' },
{ input : 'setfo', output : 'Set fo = fso.getFolder($0)' },
{ input : 'setfi', output : 'Set fi = fso.getFile($0)' },
{ input : 'twr', output : 'Set f = fso.CreateTextFile($0,true)\'overwrite\nf.WriteLine()\nf.Close'},
{ input : 'tre', output : 'Set f = fso.OpenTextFile($0, 1)\nf.ReadAll\nf.Close'},
//Server
{ input : 'mapp', output : 'Server.Mappath($0)' },
//Loops
{ input : 'foreach', output : 'For Each $0 in ?\n\t\nNext' },
{ input : 'for', output : 'For $0 to ? step ?\n\t\nNext' },
{ input : 'do', output : 'Do While($0)\n\t\nLoop' },
{ input : 'untilrs', output : 'do until rs.eof\n\t\nrs.movenext\nloop' },
//ADO
{ input : 'adorec', output : 'Set rs = Server.CreateObject("ADODB.Recordset")' },
{ input : 'adocon', output : 'Set Conn = Server.CreateObject("ADODB.Connection")' },
{ input : 'adostr', output : 'Set oStr = Server.CreateObject("ADODB.Stream")' },
//Http Request
{ input : 'xmlhttp', output : 'Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")\nxmlHttp.open("GET", $0, false)\nxmlHttp.send()\n?=xmlHttp.responseText' },
{ input : 'xmldoc', output : 'Set xmldoc = Server.CreateObject("Microsoft.XMLDOM")\nxmldoc.async=false\nxmldoc.load(request)'},
//Functions
{ input : 'func', output : 'Function $0()\n\t\n\nEnd Function'},
{ input : 'sub', output : 'Sub $0()\n\t\nEnd Sub'}
]
Language.complete = [
//{ input : '\'', output : '\'$0\'' },
{ input : '"', output : '"$0"' },
{ input : '(', output : '\($0\)' },
{ input : '[', output : '\[$0\]' },
{ input : '{', output : '{\n\t$0\n}' }
]
Language.shortcuts = [
{ input : '[space]', output : ' ' },
{ input : '[enter]', output : '<br />' } ,
{ input : '[j]', output : 'testing' },
{ input : '[7]', output : '&' }
]
( run in 0.476 second using v1.01-cache-2.11-cpan-df04353d9ac )