Alien-CodePress
view release on metacpan or search on metacpan
cp/codepress/index.html view on Meta::CPAN
$language = getLanguage($file);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>CodePress - Real Time Syntax Highlighting Editor written in JavaScript</title>
<link type="text/css" href="languages/codepress-<?=$language?>.css" rel="stylesheet" id="cp-lang-style" />
<script type="text/javascript" src="codepress.js"></script>
<script type="text/javascript">
CodePress.language = '<?=$language?>';
</script>
</head>
<body id="ffedt"><pre id="ieedt"><?=$code?></pre></body>
</html>
</textarea>
<textarea id="cp-javascript" class="hidden-code">
CodePress = function(obj) {
var self = document.createElement('iframe');
self.textarea = obj;
self.textarea.disabled = true;
self.style.height = self.textarea.clientHeight +'px';
self.style.width = self.textarea.clientWidth +'px';
self.initialize = function() {
self.editor = self.contentWindow.CodePress;
self.editor.body = self.contentWindow.document.getElementsByTagName('body')[0];
self.editor.setCode(self.textarea.value);
self.editor.syntaxHighlight('init');
}
self.edit = function(id,language) {
self.language = (language) ? language : self.textarea.className.replace(/ ?codepress ?/,'');
self.src = cpPath+'modules/codepress.html?engine='+self.getEngine()+'&language='+self.language;
if(self.attachEvent) self.attachEvent('onload',self.initialize);
else self.addEventListener('load',self.initialize,false);
}
}
</textarea>
<textarea id="cp-autoit" class="hidden-code">
#include
IsNumber(15)
@Macro
;comment
$var = "string"
</textarea>
<textarea id="cp-java" class="hidden-code">
import java.io.FileFilter;
import java.io.IOException;
import java.io.PrintWriter;
/**
* Project ECCO - File manager class
* @author Fernando M.A.d.S.
*/
public class FileManager extends HttpServlet {
private static final long serialVersionUID = 1L;
private static String login = "feanndor"; // session var should come here
private static String usersPath = System.getProperty("user.dir")+File.separator+"htdocs"+File.separator+"ecco"+File.separator+"users"+File.separator;
private static File dir = new File(usersPath+login+File.separator);
static boolean existDirectories = false;
static int isDirectory = 0;
public FileFilter filterFiles(File dir) {
return (new FileFilter() {
public boolean accept(File pathname) {
return !(pathname.isDirectory());
}
});
}
}
</textarea>
<textarea id="cp-perl" class="hidden-code">
#!/usr/bin/perl
# The first line of the script envokes Perl
# Scalar variables
$var1 = "Hello World";
$var2 = 14.6;
# Array variables
@arr1 = ("zero","one","two","three","four");
# Hash variable, or associative array
%hash1 = ("one","Monday","two", "Tuesday","three", "Wednesday","four","Thursday");
# Some simple printing
print $var1;
# Subroutine
sub test() {
print "ok";
}
</textarea>
<textarea id="cp-sql" class="hidden-code">
--
-- simple select example
--
SELECT * FROM books
WHERE price > 100.00 and price < 150.00
ORDER BY title
SELECT books.title, count(*) AS Authors
FROM books
JOIN book_authors
ON books.book_number = book_authors.book_number
GROUP BY books.title
-- insert, update and delete examples
INSERT INTO my_table (field1, field2, field3) VALUES ('test', 'N', NULL);
BEGIN WORK;
UPDATE inventory SET quantity = quantity - 3 WHERE item = 'pants';
COMMIT;
</textarea>
<textarea id="cp-html" class="hidden-code">
<html>
<head>
<title>CodePress - Online Real Time Syntax Highlighting Editor</title>
<style type="text/css">
@import url(styles.css);
( run in 0.833 second using v1.01-cache-2.11-cpan-524268b4103 )