Files
ICEcoder/snippets/snippet-display.php
Matt Pass 4797ff84d8 Quick effort at getting snippet notations working
You can now press CTRL+space to have your shorthand notation completed.
2 options for function and if setup so far.
What I've written is a pretty horrible hacky effort to get this working.
It does work but needs a LOT of refining.
2012-12-20 22:12:27 +00:00

41 lines
821 B
PHP

<?php include("lib/settings.php");?>
<!DOCTYPE html>
<html style="margin: 0">
<head>
<title>ICEcoder v <?php echo $ICEcoder["versionNo"];?> snippet display</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<style type="text/css">
body {background: #fff}
</style>
</head>
<body>
<?php
$snippets = array(
array(
"name" => "Function",
"replace" => "f ",
"with" => "function ::var::() {\\n\\t::|::\\n}"
),
array(
"name" => "If",
"replace" => "if",
"with" => "if (::|::) {\\n\\t\\n}"
)
);
?>
<?php
for ($i=0;$i<count($snippets);$i++) {
echo '<div style="cursor: pointer" onClick="top.ICEcoder.doSnippet(\''.$snippets[$i]['replace'].'\',\''.$snippets[$i]['with'].'\')">'.$snippets[$i]['name'].'</div>';
}
;?>
</script>
</body>
</html>