Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
306 changed files
with
85,914 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. | ||
For licensing, see LICENSE.md or http://ckeditor.com/license | ||
--> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Code Snippet — CKEditor Sample</title> | ||
<script src="../../../ckeditor.js"></script> | ||
<link href="../../../samples/sample.css" rel="stylesheet"> | ||
<meta name="ckeditor-sample-name" content="Code Snippet plugin"> | ||
<meta name="ckeditor-sample-group" content="Plugins"> | ||
<meta name="ckeditor-sample-description" content="View and modify code using the Code Snippet plugin."> | ||
<meta name="ckeditor-sample-isnew" content="1"> | ||
<style> | ||
|
||
#editable | ||
{ | ||
padding: 10px 20px; | ||
} | ||
pre > code { | ||
display: block; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<textarea id="editor1"> | ||
<p>JavaScript code:</p> | ||
|
||
<pre> | ||
<code class="language-javascript">function isEmpty( object ) { | ||
for ( var i in object ) { | ||
if ( object.hasOwnProperty( i ) ) | ||
return false; | ||
} | ||
return true; | ||
}</code></pre> | ||
|
||
<p>SQL query:</p> | ||
|
||
<pre> | ||
<code class="language-sql">SELECT cust.id FROM cust LEFT JOIN loc ON ( cust.loc_id = loc.id ) WHERE cust.type IN ( 1, 2 );</code></pre> | ||
|
||
<p>Unknown markup:</p> | ||
|
||
<pre> | ||
<code> ________________ | ||
/ \ | ||
| How about moo? | ^__^ | ||
\________________/ (oo)\_______ | ||
\ (__)\ )\/\ | ||
||----w | | ||
|| || | ||
</code></pre> | ||
</textarea> | ||
|
||
<h2>Inline editor</h2> | ||
|
||
<div id="editable" contenteditable="true"> | ||
|
||
<p>JavaScript code:</p> | ||
|
||
<pre><code class="language-javascript">function isEmpty( object ) { | ||
for ( var i in object ) { | ||
if ( object.hasOwnProperty( i ) ) | ||
return false; | ||
} | ||
return true; | ||
}</code></pre> | ||
|
||
<p>SQL query:</p> | ||
|
||
<pre><code class="language-sql">SELECT cust.id, cust.name, loc.city FROM cust LEFT JOIN loc ON ( cust.loc_id = loc.id ) WHERE cust.type IN ( 1, 2 );</code></pre> | ||
|
||
<p>Unknown markup:</p> | ||
|
||
<pre><code> ________________ | ||
/ \ | ||
| How about moo? | ^__^ | ||
\________________/ (oo)\_______ | ||
\ (__)\ )\/\ | ||
||----w | | ||
|| || | ||
</code></pre> | ||
</div> | ||
|
||
<script> | ||
( function() { | ||
CKEDITOR.disableAutoInline = true; | ||
|
||
var config = { | ||
extraPlugins: 'codesnippet,codesnippetgeshi', | ||
codeSnippetGeshi_url: 'plugins/codesnippetgeshi/dev/colorize.php', | ||
toolbar: [ | ||
[ 'Source', 'Sourcedialog' ], [ 'Undo', 'Redo' ], [ 'Bold', 'Italic', 'Underline' ], [ 'CodeSnippet' ] | ||
], | ||
codeSnippet_theme: 'monokai_sublime', | ||
height: 400 | ||
}; | ||
|
||
CKEDITOR.replace( 'editor1', config ); | ||
|
||
CKEDITOR.inline( 'editable', CKEDITOR.tools.extend( {}, config, { | ||
extraPlugins: 'codesnippet,codesnippetgeshi,sourcedialog' | ||
}, true ) ); | ||
}() ); | ||
</script> | ||
|
||
<div id="footer"> | ||
<hr> | ||
<p> | ||
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a> | ||
</p> | ||
<p id="copy"> | ||
Copyright © 2003-2014, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico | ||
Knabben. All rights reserved. | ||
</p> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
if ( function_exists( 'stream_resolve_include_path' ) && stream_resolve_include_path( 'geshi/geshi.php' ) === FALSE ) { | ||
die( '<pre class="html">Please install the geshi library. Refer to plugins/codesnippetgeshi/README.md for more information.</pre>' ); | ||
} | ||
|
||
include_once 'geshi/geshi.php'; | ||
|
||
$json_string = file_get_contents( 'php://input' ); | ||
$json_object = json_decode( $json_string ); | ||
|
||
$geshi = new GeSHi( $json_object->html, $json_object->lang ); | ||
|
||
echo $geshi->parse_code(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
<?php | ||
|
||
/** | ||
* Another GeSHi example script | ||
* | ||
* Configure your Apache server with 'AcceptPathInfo true' and something like | ||
* 'Alias /viewmysource /var/www/geshi/contrib/aliased.php'. Don't forget | ||
* to protect this alias as necessary. | ||
* | ||
* Usage - visit /viewmysource/file.name.ext to see that file with syntax | ||
* highlighting, where "viewmysource" is the name of the alias you set up. | ||
* You can use this without an alias too, just by visiting | ||
* aliased.php/file.name.ext. | ||
* | ||
* @author Ross Golder <ross@golder.org> | ||
* @version $Id: aliased.php 2533 2012-08-15 18:49:04Z benbe $ | ||
*/ | ||
|
||
// Your config here | ||
define("SOURCE_ROOT", "/var/www/your/source/root/"); | ||
|
||
// Assume you've put geshi in the include_path already | ||
require_once("geshi.php"); | ||
|
||
// Get path info | ||
$path = SOURCE_ROOT.$_SERVER['PATH_INFO']; | ||
|
||
// Check for dickheads trying to use '../' to get to sensitive areas | ||
$base_path_len = strlen(SOURCE_ROOT); | ||
$real_path = realpath($path); | ||
if(strncmp($real_path, SOURCE_ROOT, $base_path_len)) { | ||
exit("Access outside acceptable path."); | ||
} | ||
|
||
// Check file exists | ||
if(!file_exists($path)) { | ||
exit("File not found ($path)."); | ||
} | ||
|
||
// Prepare GeSHi instance | ||
$geshi = new GeSHi(); | ||
$geshi->set_language('text'); | ||
$geshi->load_from_file($path); | ||
$geshi->set_header_type(GESHI_HEADER_PRE); | ||
$geshi->enable_classes(); | ||
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10); | ||
$geshi->set_overall_style('color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;', true); | ||
$geshi->set_line_style('font: normal normal 95% \'Courier New\', Courier, monospace; color: #003030;', 'font-weight: bold; color: #006060;', true); | ||
$geshi->set_code_style('color: #000020;', 'color: #000020;'); | ||
$geshi->set_link_styles(GESHI_LINK, 'color: #000060;'); | ||
$geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;'); | ||
$geshi->set_header_content('Source code viewer - ' . $path . ' - ' . $geshi->get_language_name()); | ||
$geshi->set_header_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;'); | ||
$geshi->set_footer_content('Parsed in <TIME> seconds, using GeSHi <VERSION>'); | ||
$geshi->set_footer_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-top: 1px solid #d0d0d0; padding: 2px;'); | ||
|
||
?> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<title>Source code viewer - <?php echo $path; ?> - <?php $geshi->get_language_name(); ?></title> | ||
<style type="text/css"> | ||
<!-- | ||
<?php | ||
// Output the stylesheet. Note it doesn't output the <style> tag | ||
echo $geshi->get_stylesheet(); | ||
?> | ||
html { | ||
background-color: #f0f0f0; | ||
} | ||
body { | ||
font-family: Verdana, Arial, sans-serif; | ||
margin: 10px; | ||
border: 2px solid #e0e0e0; | ||
background-color: #fcfcfc; | ||
padding: 5px; | ||
} | ||
h2 { | ||
margin: .1em 0 .2em .5em; | ||
border-bottom: 1px solid #b0b0b0; | ||
color: #b0b0b0; | ||
font-weight: normal; | ||
font-size: 150%; | ||
} | ||
h3 { | ||
margin: .1em 0 .2em .5em; | ||
color: #b0b0b0; | ||
font-weight: normal; | ||
font-size: 120%; | ||
} | ||
#footer { | ||
text-align: center; | ||
font-size: 80%; | ||
color: #a9a9a9; | ||
} | ||
#footer a { | ||
color: #9999ff; | ||
} | ||
textarea { | ||
border: 1px solid #b0b0b0; | ||
font-size: 90%; | ||
color: #333; | ||
margin-left: 20px; | ||
} | ||
select, input { | ||
margin-left: 20px; | ||
} | ||
p { | ||
font-size: 90%; | ||
margin-left: .5em; | ||
} | ||
--> | ||
</style> | ||
</head> | ||
<body> | ||
<?php | ||
// The fun part :) | ||
echo $geshi->parse_code(); | ||
?> | ||
<hr/> | ||
</body> | ||
</html> |
Oops, something went wrong.