This commit is contained in:
g7sim 2021-09-08 19:52:21 +02:00
commit 28e2772c13
1840 changed files with 377531 additions and 0 deletions

17
.easymin/ignore_prefixes Normal file
View File

@ -0,0 +1,17 @@
x_
X_
--
data/_
data/index.html
.git
xx_
XX_
.easymin
Boxfile
phpunit
phpunit.xml
.travis.yml
codecov.yml
composer.json
composer.lock
vendor/

5
.easymin/ignore_types Normal file
View File

@ -0,0 +1,5 @@
.svn
.psd
.xcf
.exe
.pxm

2
.easymin/noshrink_paths Normal file
View File

@ -0,0 +1,2 @@
/include/thirdparty/ckeditor
/include/thirdparty/elFinder

8
.editorconfig Normal file
View File

@ -0,0 +1,8 @@
# http://editorconfig.org
root = true
[*]
indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
x_*
X_*
data/_*
xx_*
lock_admin
coverage.xml
composer.lock
/vendor/*

5
.htaccess Normal file
View File

@ -0,0 +1,5 @@
AddType application/x-javascript .js
AddType text/css .css
AddType text/xml .xml
AcceptPathInfo On

28
.travis.yml Normal file
View File

@ -0,0 +1,28 @@
language: php
jobs:
include:
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: 7.2
env: gp_data_type=.json
# phpunit 8 will result in an error
# https://www.reddit.com/r/PHPhelp/comments/apipqs/travis_specifying_phpunit_version/
before_script:
- composer init -n
- composer require phpunit/phpunit "<8 >=4"
- composer require symfony/process
- composer require guzzlehttp/guzzle
- composer require phpunit/php-code-coverage "<7" # for phpunit compat
#- phpenv config-add phpunit/phpconfig.ini
script:
- vendor/bin/phpunit
- php phpunit/ServerCombineCoverage.php
- bash <(curl -s https://codecov.io/bash) -s ./x_coverage # Submit coverage report to https://codecov.io

5
Addon.ini Normal file
View File

@ -0,0 +1,5 @@
Addon_Name = 'Typesetter Core'
Addon_Unique_ID = 40
Addon_Version = 5.2-rc

53
README.md Normal file
View File

@ -0,0 +1,53 @@
<p align="center"><img src="/include/imgs/typesetter/ts-logo-color-100x100px-min.png?raw=true"/></p>
<h1 align="center">Typesetter CMS </h1>
<p align="center">Open source CMS written in PHP focused on ease of use with true WYSIWYG editing and flat-file storage.<br/><br/></p>
* [Typesetter Home](https://www.typesettercms.com)
* [Typesetter Download](https://www.typesettercms.com/Download)
* [Typesetter Demo](https://www.typesettercms.com/Demo)
* [Typesetter Documentation](https://www.typesettercms.com/Docs)
* [Typesetter Forum](https://www.typesettercms.com/Forum)
* [Typesetter Wiki](https://github.com/gtbu/Typesetter5.2/wiki) with more detailed instructions !
## Requirements ##
* PHP 7.3+ (this fork only)
## Installation ##
1. Download the latest stable release of Typesetter from TypesetterCMS.com
2. Upload the extracted contents to your server
3. Using your web browser, navigate to the folder you just uploaded the unzipped contents to
4. Complete the installation form and submit
You can find more detailed installation information on [TypesetterCMS.com](https://www.typesettercms.com/Docs/Installation)
## Contribute ##
Submitting bug fixes and enhancements is easy:
1. Log in to GitHub
2. Fork the Typesetter Repository
* https://github.com/Typesetter/Typesetter
* Click "Fork" and you'll have your very own copy of the Typesetter source code at https://github.com/{your-username}/Typesetter
3. Edit files within your fork.
This can be done directly on GitHub.com at https://github.com/{your-username}/Typesetter
4. Submit a Pull Request (tell Typesetter about your changes)
* Click "Pull Request"
* Enter a Message that will go with your commit to be reviewed by core committers
* Click “Send Pull Request”
### Multiple Pull Requests and Edits ###
When submitting pull requests, it is extremely helpful to isolate the changes you want included from other unrelated changes you may have made to your fork of Typesetter. The easiest way to accomplish this is to use a different branch for each pull request. There are a number of ways to create branches within your fork, but GitHub makes the process very easy:
1. Start by finding the file you want to edit in Typesetter's code repository at https://github.com/Typesetter/Typesetter.
2. Once you have located the file, navigate to the code view and click "Edit". For example, if you want to change the /include/common.php file, the "Edit" button would appear on this page: https://github.com/Typesetter/Typesetter/blob/master/include/common.php
3. Now, edit the file as you like then click "Propose File Change"

View File

@ -0,0 +1,34 @@
;Addon_Name
Addon_Name = 'Anti Spam Math'
;Addon_Unique_ID
Addon_Unique_ID = 125
;Addon_Version
Addon_Version = 1.2
;min_gpeasy_version
min_gpeasy_version = 2.3.3
;A description about your addon,
; may contain some html: <div>,<p>,<a>,<b>,<br/>,<span>,<tt>,<em>,<i>,<b>,<sup>,<sub>,<strong>,<u>
About = 'Display a simple math equation on forms to verify submitters are humans and not spam bots.';
;file containing a list of the editable text
editable_text = 'Text.php'
; Hook for form display
[AntiSpam_Form]
script = 'AntiSpamMath.php'
class = 'AntiSpamMath'
method = 'Form'
; Hook for verification of form
[AntiSpam_Check]
script = 'AntiSpamMath.php'
class = 'AntiSpamMath'
method = 'Check'

View File

@ -0,0 +1,82 @@
<?php
defined('is_running') or die('Not an entry point...');
class AntiSpamMath{
var $operators = array(1=>'plus',2=>'minus',3=>'divided by',4=>'times');
function Form($html){
$operator_key = array_rand($this->operators);
$operator = $this->operators[$operator_key];
$asm_1 = rand(1,10);
$asm_3 = rand(1,10);
if ($operator_key == 3) $asm_1 = $asm_1 * $asm_3;
$inputs = array();
$inputs[] = ' <input type="hidden" name="asm_1" value="'.$asm_1.'" /> ';
$inputs[] = ' <input type="hidden" name="asm_2" value="'.$operator_key.'" /> ';
$inputs[] = ' <input type="hidden" name="asm_3" value="'.$asm_3.'" /> ';
shuffle($inputs);
ob_start();
echo implode('',$inputs);
echo '<span class="anti_spam_math">';
echo $asm_1;
echo ' ';
echo gpOutput::GetAddonText($operator);
echo ' ';
echo $asm_3;
echo ' ';
echo gpOutput::GetAddonText('equals');
echo ' <input type="text" name="asm_4" value="" size="4" maxlength="6" /> ';
echo '</span>';
$html .= ob_get_clean();
return $html;
}
function Check($passed){
$message = gpOutput::SelectText('Sorry, your answer to the verification challenge was incorrect. Please try again.');
if( empty($_POST['asm_1']) || empty($_POST['asm_2']) || empty($_POST['asm_3']) ){
message($message.' (1)');
return false;
}
$operator_key = $_POST['asm_2'];
if( !isset($this->operators[$operator_key]) ){
message($message.' (2)');
return false;
}
switch($operator_key){
case 1:
$result = $_POST['asm_1'] + $_POST['asm_3'];
break;
case 2:
$result = $_POST['asm_1'] - $_POST['asm_3'];
break;
case 3:
$result = $_POST['asm_1'] / $_POST['asm_3'];
break;
case 4:
$result = $_POST['asm_1'] * $_POST['asm_3'];
break;
}
$compare = $_POST['asm_4'];
//message('result: '.$result.' vs submitted: '.$compare);
if( $compare != $result ){
message($message.' (3)');
return false;
}
//message('passed');
return $passed;
}
}

View File

@ -0,0 +1,20 @@
<?php
defined('is_running') or die('Not an entry point...');
/*
* Install_Check() can be used to check the destination server for required features
* This can be helpful for addons that require PEAR support or extra PHP Extensions
* Install_Check() is called from step1 of the install/upgrade process
*/
function Install_Check(){
/*
if( check_for_feature ){
echo '<p style="color:red">Cannot install this addon, missing feature.</p>';
return false;
}
*/
return true;
}

View File

@ -0,0 +1,13 @@
<?php
defined('is_running') or die('Not an entry point...');
$texts = array();
$texts[] = 'plus';
$texts[] = 'minus';
$texts[] = 'divided by';
$texts[] = 'times';
$texts[] = 'equals';

View File

@ -0,0 +1,19 @@
Addon_Name = 'Available Classes Example'
;Addon_Unique_ID = 999
Addon_Version = 1.0
min_gpeasy_version = 5.1.1-b1
About = 'Example plugin to illustrate the use of the new <em>AvailableClasses</em> filter hook. See the code comments.';
;New hook for filtering of Availabe Classes
[AvailableClasses]
script = AvailableClasses.php
method = AvailableClassesExample::AvailableClasses
;Hook for adding CSS, JS or meta tags to the page
[GetHead]
script = AvailableClasses.php
method = AvailableClassesExample::GetHead

View File

@ -0,0 +1,8 @@
.plugin-example-toggle {
background: black;
color: white;
}
.plugin-example-option-1 { color: red; }
.plugin-example-option-2 { color: green; }
.plugin-example-option-3 { color: blue; }

View File

@ -0,0 +1,135 @@
<?php
defined('is_running') or die('Not an entry point...');
class AvailableClassesExample{
/**
*
* New Typesetter filter hook (as of ver 5.1.1-b1)
*
* can be used in plugins and themes as well
* to replace or extend the list managed via Settings -> Configuration -> Classes
*
*/
static function AvailableClasses($classes){
// ONLY FOR USE IN A THEME
// exits if the page does not use this theme
/*
if( self::IsCurrentTheme == false ){
return $classes;
}
*/
// REPLACE ALL
// not recommended because it renders the Available Classes system settings useless
/*
$classes = array(
array(
'names' => 'plugin-example-toggle',
'desc' => 'A single CSS class entry defined via plugin filter hook',
),
array(
'names' => 'plugin-example-option-1 example-option-3 example-option-3',
'desc' => 'A list of selectable classes entry defined via plugin filter hook',
)
);
*/
// APPEND SINGLE ENTRY
// will add one definition at the end of the defined list
/*
$classes[] = array(
'names' => 'plugin-example-toggle',
'desc' => 'A single CSS class appended entry to preset classes via plugin filter hook',
);
*/
// APPEND MULTIPLE ENTRIES
// will add multiple definitions at the end of the defined list
/*
$append_these = array(
array(
'names' => 'plugin-example-toggle',
'desc' => 'A single CSS class entry appended via plugin filter hook',
),
array(
'names' => 'plugin-example-option-1 example-option-3 example-option-3',
'desc' => 'A list of selectable classes appended via plugin filter hook',
)
);
$classes = array_merge($classes, $append_these);
*/
// PREPEND SINGLE ENTRY
// will add one definition at the start of the defined list
/*
$append_this = array(
'names' => 'plugin-example-toggle',
'desc' => 'A single CSS class entry appended to preset classes via plugin filter hook',
);
array_unshift($classes, $append_this);
*/
// PREPEND MULTIPLE ENTRIES
// will add one (or more) definitions at the beginning of the defined list
// probably the most likely useful variant in plugins or themes
//*
$prepend_these = array(
array(
'names' => 'plugin-example-toggle',
'desc' => 'A single CSS class entry prepended via plugin filter hook',
),
array(
'names' => 'plugin-example-option-1 plugin-example-option-3 plugin-example-option-3',
'desc' => 'A list of selectable classes entry prepended via plugin filter hook',
)
);
$classes = array_merge($prepend_these, $classes);
// */
// MANDATORY
return $classes;
}
/**
*
* Typesetter action hook
*
* when AvailaleClasses hook is used in a plugin, like right here, you might want to
* load the stylesheet(s) containing rules for your classname entries
*
*/
static function GetHead(){
global $page, $addonRelativeCode, $addon_current_id, $addon_current_version;
// \gp\tool\Plugins::css('AvailableClasses.css'); // the stylesheet will be combined with other CSS (if 'combine CSS' is active in configuration)
\gp\tool\Plugins::css('AvailableClasses.css', false); // the stylesheet will NOT be combined with other CSS
}
/**
*
* Custom method to check if current page uses our theme
*
* obviously only useful when AvailaleClasses hook is used
* in the context of a theme
*
* returns true or false
*
*/
static function IsCurrentTheme(){
global $page, $gpLayouts, $config, $addonFolderName;
$theme_name = $config['addons'][$addonFolderName]['name'];
$layout = isset($page->TitleInfo['gpLayout']) ? $page->TitleInfo['gpLayout'] : 'default';
$default_layout = $config['gpLayout'];
$current_theme_name = $layout == 'default' ? $gpLayouts[$default_layout]['name'] : $gpLayouts[$layout]['name'];
$is_current_theme = ($current_theme_name == $theme_name);
return $is_current_theme;
}
}

View File

@ -0,0 +1,20 @@
<?php
defined('is_running') or die('Not an entry point...');
/*
* Install_Check() can be used to check the destination server for required features
* This can be helpful for addons that require PEAR support or extra PHP Extensions
* Install_Check() is called from step1 of the install/upgrade process
*/
function Install_Check(){
/*
if( check_for_feature ){
echo '<p style="color:red">Cannot install this addon, missing feature.</p>';
return false;
}
*/
return true;
}

View File

@ -0,0 +1,10 @@
Addon_Name = 'Child Thumbnails'
Addon_Unique_ID = 238
Addon_Version = 1.1
min_gpeasy_version = 4.0
About = 'Display a list of icons for each child page';
[Gadget:Child_Thumbnails]
script = 'Child_Thumbnails.php'
class = 'Child_Thumbnails'

View File

@ -0,0 +1,126 @@
<?php
defined('is_running') or die('Not an entry point...');
includeFile('tool/SectionContent.php');
class Child_Thumbnails{
function __construct(){
global $page, $gp_index, $gp_titles, $gp_menu;
if( !isset($gp_menu[$page->gp_index]) ){
return;
}
$titles = common::Descendants($page->gp_index, $gp_menu);
$level = $gp_menu[$page->gp_index]['level'];
echo '<ul class="child_thumbnails">';
foreach( $titles as $index ){
//only show children
$child_level = $gp_menu[$index]['level'];
if( $child_level != $level+1 ){
continue;
}
$title = array_search($index, $gp_index);
//don't show if external link
if( !$title ){
continue;
}
if( !isset($gp_titles[$index]['vis']) ){
$this->Child($title);
}
}
echo '</ul>';
}
/**
* Get The Image
*
*/
public function Child($title){
global $dirPrefix, $addonRelativeCode, $addonPathCode;
$content = $this->TitleContent($title);
$img_pos = strpos($content,'<img');
if( $img_pos !== false ){
$src_pos = strpos($content, 'src=', $img_pos);
if( $src_pos !== false ){
$src = substr($content, $src_pos+4);
$quote = $src[0];
if( $quote == '"' || $quote == "'" ){
$src_pos = strpos($src, $quote,1);
$src = substr($src, 1, $src_pos-1);
// check for resized image, get original source if img is resized
if( strpos($src,'image.php') !== false && strpos($src,'img=') !== false ){
$src = $dirPrefix . '/data/_uploaded/' . urldecode(substr($src,strpos($src,'img=')+4));
}
$thumb_path = common::ThumbnailPath($src);
}
}
}else{
// uncomment tne next line if you don't want pages w/o images listed using the default thumbnail.
// return;
$thumb_path = $dirPrefix . '/include/imgs/default_thumb.jpg';
}
$url = common::GetURL($title);
$label = common::GetLabel($title);
echo '<li>';
echo '<a href="' . $url . '">';
echo '<img alt="' . $label .'" src="' . $thumb_path . '"/>';
echo '<span>' . $label . '</span>';
echo '</a>';
echo '</li>';
}
/**
* Return the formatted content of the title
*
*/
public function TitleContent($title){
$file = gpFiles::PageFile($title);
$file_sections = $file_stats = array();
ob_start();
require($file);
ob_get_clean();
if( !is_array($file_sections) ){
return '';
}
//prevent infinite loops
foreach($file_sections as $key=>$val){
if( $val['type'] == 'include' ){
//dummy section instead of include
$file_sections[$key] = array (
'type' => 'text',
'content' => '<div><p>Lorem ipsum </p></div>',
'attributes' => array (),
);
}
}
if( !$file_sections ){
return '';
}
$file_sections = array_values($file_sections);
return section_content::Render($file_sections,$title,$file_stats);
}
}

View File

@ -0,0 +1,63 @@
;Addon_Name
Addon_Name = 'Easy Comments'
;Addon_Unique_ID
Addon_Unique_ID = 114
;Addon_Version
Addon_Version = 1.2.0
;min_gpeasy_version
; needs 2.2.0.3 for fixes to ajax responses in gpEasy
min_gpeasy_version = 4.3.5
;A description about your addon,
; may contain some html: <div>,<p>,<a>,<b>,<br/>,<span>,<tt>,<em>,<i>,<b>,<sup>,<sub>,<strong>,<u>
About = '<p>Add comments to any Typesetter page</p>';
;file containing a list of the editable text
editable_text = 'Text.php'
; Theme Gadget (Optional)
; Define scripts that can output content to
[Gadget:Easy_Comments]
;optional, relative to the addon directory
script = 'EasyComments_Gadget.php'
;optional, relative to the plugin's data directory
;data = 'Gadget_Data.php'
; optional
class = 'EasyComments_Gadget'
;Admin_links (Optional)
;Define scripts that are only accessible to administrators with appropriate permissions
[Admin_Link:Recent_Comments]
;required
label = 'Recent Comments'
;required relative to the addon directory
script = 'EasyComments_Admin.php'
; optional
class = 'EasyComments_Admin'
;Admin_links (Optional)
;Define scripts that are only accessible to administrators with appropriate permissions
[Admin_Link:Comments_Config]
;required
label = 'Configuration'
;required relative to the addon directory
script = 'EasyComments_Config.php'
; optional
class = 'EasyComments_Config'

View File

@ -0,0 +1,236 @@
<?php
defined('is_running') or die('Not an entry point...');
/**
* @todo
*
* What happens when a page is deleted
* Email to owner on comment
* Option to hide comment till approved
*
*/
class EasyComments{
/*
* Information about the current page
*
*/
var $current_index = false;
var $current_title = false;
/*
* Easy Comments configuration
*
*/
var $config_file;
var $config = [];
/*
* comment_data is unique for each page being viewed/commented on
*
*/
var $comment_folder;
var $comment_data_file;
var $comment_data = [];
/*
* the index file keeps track of which titles have had the most recent comments
*
*/
var $index_file;
var $index = [];
public function __construct(){
global $page, $addonPathData, $addonFolderName;
$this->current_title = $page->title;
$page->ajaxReplace = [];
$this->config_file = $addonPathData.'/config.php';
$this->GetConfig();
// index is not required for all page displays
$this->index_file = $addonPathData.'/index.php';
//only available for pages with a gp_index
if( empty($page->gp_index) ){
return;
}
$this->InitPage($page->gp_index);
}
/**
* Initialize page specific variables
*
*/
public function InitPage($index){
global $gp_titles,$addonPathData;
if( !isset($gp_titles[$index]) ){
return;
}
$this->current_index = $index;
$this->comment_folder = $addonPathData.'/comments';
$this->comment_data_file = $this->comment_folder.'/'.$this->current_index.'.gpjson';
if( file_exists($this->comment_data_file) ){
$content = file_get_contents($this->comment_data_file);
$this->comment_data = json_decode($content,true);
return;
}
// get data saved before v1.2
//$this->comment_data_file = $this->comment_folder.'/'.$this->current_index.'.txt';
$data_file = $this->comment_folder.'/'.$this->current_index.'.txt';
if( file_exists($data_file) ){
$content = file_get_contents($data_file);
$this->comment_data = unserialize($content);
}
}
/**
* Add Comment to index file
*
*/
public function UpdateIndex($rm_key=false){
$this->GetIndex();
//update the information for the $current_index
unset($this->index['pages'][$this->current_index]);
if( count($this->comment_data) > 0){
$temp = end($this->comment_data);
$last_key = key($this->comment_data);
reset($this->comment_data);
$last_comment = array();
$last_comment['abbr'] = substr($temp['comment'],0,100);
$last_comment['time'] = $temp['time'];
$last_comment['count'] = count($this->comment_data);
$last_comment['key'] = $last_key;
$last_comment['page'] = $this->current_index;
$last_comment['name'] = $temp['name'];
if( isset($temp['website']) ){
$last_comment['website'] = $temp['website'];
}
$this->index['pages'][$this->current_index] = $last_comment;
//if it's a new comment
if( $rm_key === false ){
$this->index['recent'][] = $last_comment;
}
}
//remove from the recent comments base on current_index and comment time
if( $rm_key !== false ){
foreach($this->index['recent'] as $i => $recent){
if( ($recent['page'] == $this->current_index) && ($recent['key'] == $rm_key) ){
unset($this->index['recent'][$i]);
}
}
}
//only keep the 20 most recent comments
while( count($this->index['recent']) > 20 ){
array_shift($this->index['recent']);
}
return $this->SaveIndex();
}
public function SaveIndex(){
return \gp\tool\Files::SaveData($this->index_file, 'index', $this->index);
}
public function GetIndex(){
if( file_exists($this->index_file) ){
$index = \gp\tool\Files::Get($this->index_file, 'index');
}
if( !isset($index['pages']) ){
$index['pages'] = array();
}
if( !isset($index['recent']) ){
$index['recent'] = array();
}
$this->index = $index;
return $index;
}
/**
* Save the comment data
*
*/
public function SaveCommentData(){
global $langmessage;
$text = json_encode($this->comment_data);
if( !\gp\tool\Files::Save($this->comment_data_file,$text) ){
return false;
}
return true;
}
/**
* Get the current configuration for Easy Comments
*
*/
public function GetConfig(){
$config = array();
if( file_exists($this->config_file) ){
require($this->config_file);
}
$this->config = $config + $this->Defaults();
}
/**
* Return Easy Comments configuration defaults
*
*/
public function Defaults(){
return array(
'date_format'=>'n/j/Y',
'commenter_website'=>'',
'comment_captcha'=>false,
'email'=>false
);
}
}

View File

@ -0,0 +1,195 @@
<?php
defined('is_running') or die('Not an entry point...');
require_once('EasyComments.php');
class EasyComments_Admin extends EasyComments{
var $index;
var $ajax_delete = false;
public function __construct(){
parent::__construct();
$this->GetIndex();
$cmd = \gp\tool::GetCommand();
if( isset($_REQUEST['pg']) ){
$this->InitPage($_REQUEST['pg']);
switch($cmd){
case 'easy_comment_rm':
$this->CommentRm();
return;
}
}
$this->ShowAdmin();
}
/**
* Show the default admin window that display recent comments
*
*/
public function ShowAdmin(){
global $page;
echo '<h3>Most Recent Comments</h3>';
if( count($this->index['recent']) > 0 ){
echo '<table class="bordered" style="width:100%">';
echo '<tr><th>Page</th><th>Comment Time</th><th>Commenter</th><th>Comment</th><th>Options</th></tr>';
$recent = array_reverse($this->index['recent']);
foreach($recent as $comment){
$this->CommentRow($comment['page'],$comment);
}
echo '</table>';
}else{
echo 'No comments to display';
}
echo '<br/>';
echo '<h3>Recently Commented Pages</h3>';
if( count($this->index['pages']) > 0 ){
echo '<table class="bordered" style="width:100%">';
echo '<tr><th>Page</th><th>Comment Time</th><th>Commenter</th><th>Comment</th><th>Options</th></tr>';
$pages = array_reverse($this->index['pages'],true);
foreach($pages as $page_key => $comment){
$this->CommentRow($page_key,$comment);
}
echo '</table>';
}else{
echo '<p>';
echo 'No comments to display';
echo '</p>';
}
}
public function CommentRow($page_index,$comment){
global $gp_index, $gp_titles, $langmessage;
$key =& $comment['key'];
echo '<tr class="easy_comment_'.$page_index.'_'.$key.'">';
echo '<td>';
$title = \gp\tool::IndexToTitle($page_index);
if( $title === false ){
echo 'Deleted page';
}else{
$label = \gp\tool::GetLabelIndex($page_index);
echo \gp\tool::Link($title,$label);
}
echo '</td><td>';
echo date('D, j M Y H:i',$comment['time']);
echo '</td><td>';
if( !empty($comment['website']) ){
echo '<b><a href="'.$comment['website'].'">'.$comment['name'].'</a></b>';
}else{
echo 'no website';
echo $comment['name'];
}
echo '</td><td>';
echo $comment['abbr'];
echo '</td><td>';
echo \gp\tool::Link('Admin_Recent_Comments',$langmessage['delete'],'cmd=easy_comment_rm&pg='.$page_index.'&i='.$key,' data-cmd="gpajax"');
echo '</td></tr>';
}
/**
* Prompt the administrator if they really want to remove the comment
*
*/
public function CommentRm(){
global $page, $langmessage;
$page->ajaxReplace = [];
if( !isset($_REQUEST['i']) ){
msg($langmessage['OOPS'].' (Invalid Request)');
return false;
}
if( !isset($this->comment_data[$_REQUEST['i']]) ){
msg($langmessage['OOPS'].' (Invalid Request)');
return false;
}
$comment_key = $_REQUEST['i'];
$nonce_str = 'easy_comment_rm:'.count($this->comment_data).':'.$comment_key;
//prompt for confirmation first
if( !isset($_POST['confirmed']) ){
$this->CommentRm_Prompt();
return true;
}
if( !\gp\tool::verify_nonce($nonce_str,$_POST['nonce']) ){
msg($langmessage['OOPS'].' (Invalid Nonce)');
return false;
}
//remove from this page's comment data
unset($this->comment_data[$comment_key]);
if( !$this->SaveCommentData() ){
msg($langmessage['OOPS'].' (Not Saved)');
return false;
}
//update the index file
$this->UpdateIndex($comment_key);
$class = '.easy_comment_'.$this->current_index.'_'.$comment_key;
$page->ajaxReplace[] = array('detach',$class);
$page->ajaxReplace[] = array('detach','.messages');
return true;
}
public function CommentRm_Prompt(){
global $page, $langmessage;
$page->ajaxReplace = array();
$del_comment = \gp\tool\Output::SelectText('Delete Comment');
$nonce_str = 'easy_comment_rm:'.count($this->comment_data).':'.$_REQUEST['i'];
ob_start();
echo '<form method="post" action="'.\gp\tool::GetUrl('Admin_Recent_Comments').'">';
echo '<div>';
echo '<input type="hidden" name="nonce" value="'.htmlspecialchars(\gp\tool::new_nonce($nonce_str)).'" />';
echo \gp\tool\Output::SelectText('Are you sure you want to remove this comment?');
echo ' <input type="hidden" name="i" value="'.htmlspecialchars($_REQUEST['i']).'" />';
echo ' <input type="hidden" name="cmd" value="easy_comment_rm" />';
echo ' <input type="hidden" name="confirmed" value="confirmed" />';
echo ' <input type="hidden" name="pg" value="'.htmlspecialchars($this->current_index).'" />';
echo ' <input type="submit" name="" value="'.htmlspecialchars($del_comment).'" class="gpajax" />';
echo '</div>';
echo '</form>';
$message = ob_get_clean();
msg($message);
}
}

View File

@ -0,0 +1,142 @@
<?php
defined('is_running') or die('Not an entry point...');
require_once('EasyComments.php');
class EasyComments_Config extends EasyComments{
public function __construct(){
parent::__construct();
$cmd = \gp\tool::GetCommand();
switch($cmd){
case 'save_config':
$this->SaveConfig();
default:
$this->ShowConfig();
break;
}
}
/**
* Save posted configuration options
*
*/
public function SaveConfig(){
global $langmessage;
$format = htmlspecialchars($_POST['date_format']);
if( @date($format) ){
$this->config['date_format'] = $format;
}
$this->config['commenter_website'] = (string)$_POST['commenter_website'];
if( isset($_POST['comment_captcha']) ){
$this->config['comment_captcha'] = true;
}else{
$this->config['comment_captcha'] = false;
}
if( !\gp\tool\Files::SaveData($this->config_file, 'config', $this->config) ){
message($langmessage['OOPS']);
return false;
}
message($langmessage['SAVED']);
return true;
}
/**
* Show EasyComments configuration options
*
*/
public function ShowConfig(){
global $langmessage;
$defaults = $this->Defaults();
$array = $_POST + $this->config;
echo '<h2>Easy Comments Configuration</h2>';
echo '<form class="renameform" action="'.\gp\tool::GetUrl('Admin_Comments_Config').'" method="post">';
echo '<table style="width:100%" class="bordered">';
echo '<tr><th>';
echo 'Option';
echo '</th><th>';
echo 'Value';
echo '</th><th>';
echo 'Default';
echo '</th></tr>';
echo '<tr><td>';
echo 'Date Format';
echo ' (<a href="http://php.net/manual/en/function.date.php" target="_blank">About</a>)';
echo '</td><td>';
echo '<input type="text" name="date_format" size="30" value="'.htmlspecialchars($array['date_format']).'" />';
echo '</td><td>';
echo $defaults['date_format'];
echo '</td></tr>';
echo '<tr><td>';
echo 'Commenter Website';
echo '</td><td>';
echo '<select name="commenter_website">';
if( $array['commenter_website'] == 'nofollow' ){
echo '<option value="">Hide</option>';
echo '<option value="nofollow" selected="selected">Nofollow Link</option>';
echo '<option value="link">Follow Link</option>';
}elseif( $array['commenter_website'] == 'link' ){
echo '<option value="">Hide</option>';
echo '<option value="nofollow" selected="selected">Nofollow Link</option>';
echo '<option value="link" selected="selected">Follow Link</option>';
}else{
echo '<option value="">Hide</option>';
echo '<option value="nofollow">Nofollow Link</option>';
echo '<option value="link">Follow Link</option>';
}
echo '</select>';
echo '</td><td>';
echo 'Hide';
echo '</td></tr>';
echo '<tr><td>';
echo 'reCaptcha';
echo '</td><td>';
if( !\gp\tool\Recaptcha::isActive() ){
$disabled = ' disabled="disabled" ';
}else{
$disabled = '';
}
if( $array['comment_captcha'] ){
echo '<input type="checkbox" name="comment_captcha" value="allow" checked="checked" '.$disabled.'/>';
}else{
echo '<input type="checkbox" name="comment_captcha" value="allow" '.$disabled.'/>';
}
echo '</td><td>';
echo '';
echo '</td></tr>';
echo '<tr><td>';
echo '</td><td>';
echo '<input type="hidden" name="cmd" value="save_config" />';
echo '<input type="submit" name="" value="'.$langmessage['save'].'" /> ';
echo '<input type="submit" name="cmd" value="'.$langmessage['cancel'].'" /> ';
echo '</td><td>';
echo '</td></tr>';
echo '</table>';
}
}

View File

@ -0,0 +1,266 @@
<?php
defined('is_running') or die('Not an entry point...');
require_once('EasyComments.php');
class EasyComments_Gadget extends EasyComments{
public function __construct(){
parent::__construct();
echo '<div class="easy_comments_wrap">';
echo '<h2>Comments</h2>';
if( !$this->current_index ){
echo '<p>Comments are not available for this page</p>';
echo '</div>';
return;
}
$cmd = \gp\tool::GetCommand();
$comment_added = false;
switch($cmd){
case 'easy_comment_add':
$comment_added = $this->CommentAdd();
break;
}
$this->ShowComments();
if( !$comment_added ){
$this->CommentForm();
}
echo '</div>';
}
/**
* Save a user submitted comment
*
*/
public function CommentAdd(){
global $langmessage;
// check the nonce
// includes the comment count so resubmissions won't work
if( !\gp\tool::verify_nonce('easy_comments:'.count($this->comment_data),$_POST['nonce'],true) ){
$message = \gp\tool\Output::GetAddonText('Sorry, your comment was not saved.');
msg($message);
return false;
}
//check captcha
if( $this->config['comment_captcha'] && \gp\tool\Recaptcha::isActive() ){
if( !\gp\tool\Recaptcha::Check() ){
//recaptcha::check adds message on failure
return false;
}
}
if( empty($_POST['name']) ){
$field = \gp\tool\Output::SelectText('Name');
msg($langmessage['OOPS_REQUIRED'],$field);
return false;
}
if( empty($_POST['comment']) ){
$field = \gp\tool\Output::SelectText('Comment');
msg($langmessage['OOPS_REQUIRED'],$field);
return false;
}
$temp = array();
$temp['name'] = htmlspecialchars($_POST['name']);
$temp['comment'] = nl2br(strip_tags($_POST['comment']));
$temp['time'] = time();
if( !empty($_POST['website']) && ($_POST['website'] !== 'http://') ){
$website = $_POST['website'];
if( strpos($website,'://') === false ){
$website = false;
}
if( $website ){
$temp['website'] = $website;
}
}
$index = $this->NewIndex();
$this->comment_data[$index] = $temp;
//save to index file first
if( !$this->UpdateIndex() ){
$message = \gp\tool\Output::GetAddonText('Sorry, your comment was not saved.');
msg($message);
return false;
}
//then save actual comment
if( $this->SaveCommentData() ){
$message = \gp\tool\Output::GetAddonText('Your comment has been saved.');
msg($message);
return true;
}else{
$message = \gp\tool\Output::GetAddonText('Sorry, your comment was not saved.');
msg($message);
return false;
}
}
/**
* Show the comments for the current page
*
*/
public function ShowComments( ){
global $langmessage;
echo '<div class="easy_comments_comments">';
foreach($this->comment_data as $key => $comment){
echo '<div class="comment_area easy_comment_'.$this->current_index.'_'.$key.'">';
echo '<p class="name">';
if( ($this->config['commenter_website'] == 'nofollow') && !empty($comment['website']) ){
echo '<b><a href="'.$comment['website'].'" rel="nofollow">'.$comment['name'].'</a></b>';
}elseif( ($this->config['commenter_website'] == 'link') && !empty($comment['website']) ){
echo '<b><a href="'.$comment['website'].'">'.$comment['name'].'</a></b>';
}else{
echo '<b>'.$comment['name'].'</b>';
}
echo ' &nbsp; ';
echo '<span>';
echo date($this->config['date_format'],$comment['time']);
echo '</span>';
if( \gp\tool::LoggedIn() ){
echo ' &nbsp; ';
echo \gp\tool::Link('Admin_Recent_Comments',$langmessage['delete'],'cmd=easy_comment_rm&i='.$key.'&pg='.$this->current_index,' data-cmd="gpajax"');
}
echo '</p>';
echo '<p class="comment">';
echo $comment['comment'];
echo '</p>';
echo '</div>';
}
echo '</div>';
}
/**
* Generate a new comment index
* skip indexes that are just numeric
*
*/
public function NewIndex(){
$num_index = 0;
/* prevent reusing old indexes */
if( count($this->comment_data) > 0 ){
end($this->comment_data);
$last_index = key($this->comment_data);
reset($this->comment_data);
$num_index = base_convert($last_index,36,10);
$num_index++;
}
do{
$index = base_convert($num_index,10,36);
$num_index++;
}while( is_numeric($index) || isset($this->comment_data[$index]) );
return $index;
}
/**
* Show the comment form
*
*/
public function CommentForm(){
$_POST += array('name'=>'','website'=>'http://','comment'=>'');
echo '<div class="easy_comment_form">';
echo '<h3>';
echo \gp\tool\Output::GetAddonText('Leave Comment');
echo '</h3>';
echo '<form method="post" action="'.\gp\tool::GetUrl($this->current_title).'">';
echo '<table>';
echo '<tr>';
echo '<td>';
echo '<div>';
echo \gp\tool\Output::GetAddonText('Name');
echo '</div>';
echo '<input type="text" name="name" class="text" value="'.htmlspecialchars($_POST['name']).'" />';
echo '</td>';
echo '</tr>';
if( !empty($this->config['commenter_website']) ){
echo '<tr>';
echo '<td>';
echo '<div>';
echo \gp\tool\Output::GetAddonText('Website');
echo '</div>';
echo '<input type="text" name="website" class="text" value="'.htmlspecialchars($_POST['website']).'" />';
echo '</td>';
echo '</tr>';
}
echo '<tr>';
echo '<td>';
echo '<div>';
echo \gp\tool\Output::GetAddonText('Comment');
echo '</div>';
echo '<textarea name="comment" cols="30" rows="7" >';
echo htmlspecialchars($_POST['comment']);
echo '</textarea>';
echo '</td>';
echo '</tr>';
if( $this->config['comment_captcha'] && \gp\tool\Recaptcha::isActive() ){
echo '<tr>';
echo '<td>';
echo '<div>';
echo \gp\tool\Output::GetAddonText('captcha');
echo '</div>';
\gp\tool\Recaptcha::Form();
echo '</td></tr>';
}
echo '<tr>';
echo '<td>';
echo '<input type="hidden" name="nonce" value="'.htmlspecialchars(\gp\tool::new_nonce('easy_comments:'.count($this->comment_data),true)).'" />';
echo '<input type="hidden" name="cmd" value="easy_comment_add" />';
$html = '<input type="submit" name="" class="submit" value="%s" />';
echo \gp\tool\Output::GetAddonText('Add Comment',$html);
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</form>';
echo '</div>';
}
}

View File

@ -0,0 +1,20 @@
<?php
defined('is_running') or die('Not an entry point...');
/*
* Install_Check() can be used to check the destination server for required features
* This can be helpful for addons that require PEAR support or extra PHP Extensions
* Install_Check() is called from step1 of the install/upgrade process
*/
function Install_Check(){
/*
if( check_for_feature ){
echo '<p style="color:red">Cannot install this addon, missing feature.</p>';
return false;
}
*/
return true;
}

View File

@ -0,0 +1,16 @@
<?php
defined('is_running') or die('Not an entry point...');
$texts = array();
$texts[] = 'Sorry, your comment was not saved.';
$texts[] = 'Your comment has been saved.';
$texts[] = 'Leave Comment';
$texts[] = 'Name';
$texts[] = 'Website';
$texts[] = 'Delete Comment';
$texts[] = 'Are you sure you want to remove this comment?';
$texts[] = 'Comment';
$texts[] = 'captcha';
$texts[] = 'Add Comment';

View File

@ -0,0 +1,8 @@
Addon_Name = 'Hightlight Search Results'
Addon_Version = 1.0
min_gpeasy_version = 5.1-b1
About = 'Higlights the search results on pages found with Typesetter&rsquo;s built-in search.';
[GetHead]
script = Highlight.php
method = HighlightSearchResults::GetHead

View File

@ -0,0 +1,7 @@
#gpx_content .text-highlighted {
background-color: rgba(240,255,64,0.667);
padding-left: 0.2em;
padding-right: 0.2em;
border-radius: 2px;
font-weight: bold;
}

View File

@ -0,0 +1,38 @@
$(function(){
// find search queries
var search = document.location.search.substr(1);
search = search.length ? search.split('&') : false;
// console.log("search = ", search);
if( !search ){
return;
}
var queries = {};
$.each(search, function(c, q){
var i = q.split('=');
queries[i[0].toString()] = i[1].toString();
});
// console.log("queries = ", queries);
if( !'highlight' in queries ){
return;
}
// highlight
$('#gpx_content')
.highlight(decodeURIComponent(queries.highlight), {
element : 'span', // default = 'span'
className : 'text-highlighted', // default = 'text-highlighted'
caseSensitive : false, // default = false
wordsOnly : false // default = false
});
// unhighlight for editing
if( gpadmin ){
$(document).on('editor_area:loaded', function(){
$('#gpx_content').unhighlight();
});
}
});

View File

@ -0,0 +1,16 @@
<?php
defined('is_running') or die('Not an entry point...');
class HighlightSearchResults {
static function GetHead() {
global $page, $addonRelativeCode;
$page_type = $page->pagetype;
if( $page_type != 'admin_display' ){
$page->head_js[] = $addonRelativeCode . '/jquery-highlight/jquery.highlight.min.js';
$page->css_user[] = $addonRelativeCode . '/Highlight.css';
$page->head_js[] = $addonRelativeCode . '/Highlight.js';
}
}
}

View File

@ -0,0 +1,109 @@
/*
* jQuery Highlight plugin 3.4.0
*
* https://www.npmjs.com/package/jquery-highlight#api
*
* Based on highlight v3 by Johann Burkard
* http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html
*
* Code a little bit refactored and cleaned (in my humble opinion).
* Most important changes:
* - has an option to highlight only entire words (wordsOnly - false by default),
* - has an option to be case sensitive (caseSensitive - false by default)
* - highlight element tag and class names can be specified in options
*
* Usage:
* // wrap every occurrance of text 'lorem' in content
* // with <span class='highlight'> (default options)
* $('#content').highlight('lorem');
*
* // search for and highlight more terms at once
* // so you can save some time on traversing DOM
* $('#content').highlight(['lorem', 'ipsum']);
* $('#content').highlight('lorem ipsum');
*
* // search only for entire word 'lorem'
* $('#content').highlight('lorem', { wordsOnly: true });
*
* // don't ignore case during search of term 'lorem'
* $('#content').highlight('lorem', { caseSensitive: true });
*
* // wrap every occurrance of term 'ipsum' in content
* // with <em class='important'>
* $('#content').highlight('ipsum', { element: 'em', className: 'important' });
*
* // remove default highlight
* $('#content').unhighlight();
*
* // remove custom highlight
* $('#content').unhighlight({ element: 'em', className: 'important' });
*
*
* Copyright (c) 2009 Bartek Szopka
*
* Licensed under MIT license.
*
*/
jQuery.extend({
highlight: function (node, re, nodeName, className) {
if (node.nodeType === 3) {
var match = node.data.match(re);
if (match) {
var highlight = document.createElement(nodeName || 'span');
highlight.className = className || 'highlight';
var wordNode = node.splitText(match.index);
wordNode.splitText(match[0].length);
var wordClone = wordNode.cloneNode(true);
highlight.appendChild(wordClone);
wordNode.parentNode.replaceChild(highlight, wordNode);
return 1; //skip added node in parent
}
} else if ((node.nodeType === 1 && node.childNodes) && // only element nodes that have children
!/(script|style)/i.test(node.tagName) && // ignore script and style nodes
!(node.tagName === nodeName.toUpperCase() && node.className === className)) { // skip if already highlighted
for (var i = 0; i < node.childNodes.length; i++) {
i += jQuery.highlight(node.childNodes[i], re, nodeName, className);
}
}
return 0;
}
});
jQuery.fn.unhighlight = function (options) {
var settings = { className: 'highlight', element: 'span' };
jQuery.extend(settings, options);
return this.find(settings.element + "." + settings.className).each(function () {
var parent = this.parentNode;
parent.replaceChild(this.firstChild, this);
parent.normalize();
}).end();
};
jQuery.fn.highlight = function (words, options) {
var settings = { className: 'highlight', element: 'span', caseSensitive: false, wordsOnly: false };
jQuery.extend(settings, options);
if (words.constructor === String) {
words = [words];
}
words = jQuery.grep(words, function(word, i){
return word != '';
});
words = jQuery.map(words, function(word, i) {
return word.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
});
if (words.length == 0) { return this; };
var flag = settings.caseSensitive ? "" : "i";
var pattern = "(" + words.join("|") + ")";
if (settings.wordsOnly) {
pattern = "\\b" + pattern + "\\b";
}
var re = new RegExp(pattern, flag);
return this.each(function () {
jQuery.highlight(this, re, settings.element, settings.className);
});
};

View File

@ -0,0 +1,2 @@
/* jQuery Highlight plugin 3.4.0 */
jQuery.extend({highlight:function(e,t,n,i){if(3===e.nodeType){var r=e.data.match(t);if(r){var a=document.createElement(n||"span");a.className=i||"highlight";var h=e.splitText(r.index);h.splitText(r[0].length);var s=h.cloneNode(!0);return a.appendChild(s),h.parentNode.replaceChild(a,h),1}}else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&(e.tagName!==n.toUpperCase()||e.className!==i))for(var l=0;l<e.childNodes.length;l++)l+=jQuery.highlight(e.childNodes[l],t,n,i);return 0}}),jQuery.fn.unhighlight=function(e){var t={className:"highlight",element:"span"};return jQuery.extend(t,e),this.find(t.element+"."+t.className).each(function(){var e=this.parentNode;e.replaceChild(this.firstChild,this),e.normalize()}).end()},jQuery.fn.highlight=function(e,t){var n={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1};if(jQuery.extend(n,t),e.constructor===String&&(e=[e]),e=jQuery.grep(e,function(e,t){return""!=e}),0==(e=jQuery.map(e,function(e,t){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")})).length)return this;var i=n.caseSensitive?"":"i",r="("+e.join("|")+")";n.wordsOnly&&(r="\\b"+r+"\\b");var a=new RegExp(r,i);return this.each(function(){jQuery.highlight(this,a,n.element,n.className)})};

View File

@ -0,0 +1,9 @@
Addon_Name = 'Notifications Example'
;Addon_Unique_ID = ???
Addon_Version = 1.0
min_gpeasy_version = 5.1.1-b1
About = 'Plugin that illustrates the use of the new Notifications plugin filter hook.'
[Notifications]
script = Notifications_Example.php
method = Notifications_Example::Notifications

View File

@ -0,0 +1,66 @@
<?php
/**
* Notifications Example plugin
* demonstrates the use of the new plugin filter hook 'Notifications'.
*
*
*/
defined('is_running') or die('Not an entry point...');
class Notifications_Example{
static function Notifications($notifications){
global $langmessage;
$items = array(
array(
'label' => 'Check back home!',
'priority' => 80, // optional: an integer > 100 will overtake working drafts notifications
'id' => 'Example Note Check back home!', // needs to be unique amongst other notes for filtering
'action' => '<a target="_blank" href="' . \CMS_DOMAIN . '">' . \CMS_READABLE_DOMAIN . '</a>',
),
array(
'label' => 'GitHub',
'priority' => 30,
'id' => 'Example Note GitHub',
'action' => '<a target="_blank" href="https://github.com/Typesetter/Typesetter/issues">View issues</a>',
),
array(
'label' => 'This Plugin',
'priority' => 110,
'id' => 'Uninstall this plugin',
'action' => \gp\tool::Link(
'Admin/Addons',
$langmessage['uninstall'],
'cmd=uninstall&addon=Notifications-Example',
array(
'data-cmd' => 'gpabox',
'title' => $langmessage['uninstall']
)
),
),
);
$notifications->Add('Plugin Example',$items,'#c594e8','#000');
/*
$notifications['example'] = array( // unique identifier string. using 'drafts', 'private_pages' or 'updates' would overwrite possible existing notes
'title' => 'Plugin Example', // required: will automatically be checked against $langmessage
'badge_bg' => '#c594e8', // optional: badge background color
'badge_color' => '#000', // optional: badge text color
),
);
*/
return $notifications;
}
}

View File

@ -0,0 +1,31 @@
<?php
defined('is_running') or die('Not an entry point...');
class Example_Map{
function Example_Map(){
global $page, $addonRelativeCode;
//add css and js to <head>
$page->head .= '<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />';
$page->head .= '<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=en"></script>';
$page->head .= '<script type="text/javascript" src="'.$addonRelativeCode.'/static/01_script.js"></script>';
//html contents of the page
echo '<h2>Display a Google Map With Directions</h2>';
echo '<div id="input">';
echo '<input id="map_address" type="textbox" value="starting point" />';
echo '<input type="button" value="calculate route" id="calc_route_button" />';
echo '</div>';
echo '<div id="directionsPanel" style="float:right;width:300px;"></div>';
echo '<div id="map_canvas" style="width:500px;height:500px;"></div>';
//plugin example navigation
gpPlugin::incl('navigation.php');
PluginExampleNavigation();
}
}

View File

@ -0,0 +1,42 @@
<?php
defined('is_running') or die('Not an entry point...');
class Example_Ajax{
function Example_Ajax(){
global $page, $addonRelativeCode;
//prepare the page
$page->head_js[] = $addonRelativeCode.'static/02_script.js';
$page->admin_js = true;
//get request parameters and execute any commands
$string = '';
if( isset($_REQUEST['string']) ){
$string = $_REQUEST['string'];
}
$cmd = common::GetCommand();
switch($cmd){
case 'randomstring':
$string = common::RandomString(10);
break;
}
//display the form
echo '<h2>Example Ajax Requests</h2>';
echo '<form method="post" action="'.$page->title.'">';
echo 'Text: <input type="text" name="string" value="'.htmlspecialchars($string).'" size="30" />';
echo ' <input type="submit" class="gpajax" value="Post Form Asynchronosly" /> ';
echo common::Link($page->title,'Get Random String','cmd=randomstring','data-cmd="gpajax"');
echo '</form>';
//output the $_REQUEST variable
echo '<h3>Request</h3>';
echo pre($_REQUEST);
//plugin example navigation
gpPlugin::incl('navigation.php');
PluginExampleNavigation();
}
}

View File

@ -0,0 +1,30 @@
;Addon_Name
Addon_Name = 'Plugin Examples'
;Addon_Unique_ID
Addon_Unique_ID = 160
;Addon_Version
Addon_Version = 1.1
;min_gpeasy_version
min_gpeasy_version = 2.3.3
;A description about your addon,
; may contain some html: <div>,<p>,<a>,<b>,<br/>,<span>,<tt>,<em>,<i>,<b>,<sup>,<sub>,<strong>,<u>
About = 'A collection of examples to demonstrate plugin functionality';
;Map Example
[Special_Link:Example_Map]
label = 'Example_Map'
script = '01_Map.php'
class = 'Example_Map'
;Ajax Example
[Special_Link:Example_Ajax]
label = 'Example_Ajax'
script = '02_Ajax.php'
class = 'Example_Ajax'

View File

@ -0,0 +1,23 @@
<?php
defined('is_running') or die('Not an entry point...');
function PluginExampleNavigation(){
global $page;
$examples = array();
$examples['special_example_map'] = 'Google Map Example with Directions';
$examples['special_example_ajax'] = 'Asynchronous Form Submission and Page Loading';
echo '<h3>All Examples</h3>';
echo '<ol>';
foreach($examples as $slug => $label){
if( $page->gp_index == $slug ){
echo '<li><b>'.$label.'</b></li>';
}else{
echo '<li>'.common::Link($slug,$label).'</li>';
}
}
echo '</ol>';
}

View File

@ -0,0 +1,40 @@
var directionDisplay;
var directionsService = new google.maps.DirectionsService();
var map;
$(function(){
directionsDisplay = new google.maps.DirectionsRenderer();
var chicago = new google.maps.LatLng(50.903315,13.67583);
var myOptions = {
zoom:17,
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: chicago
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
directionsDisplay.setMap(map);
directionsDisplay.setPanel(document.getElementById("directionsPanel"));
var chicago = new google.maps.Marker({
position: chicago,
map: map,
title:"Sportpark Dippoldiswalde",
zIndex: 1
});
$('#calc_route_button').click(calcRoute);
});
function calcRoute(){
var start = document.getElementById("map_address").value;
var request = {
origin:start,
destination:"50.903315,13.67583",
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status){
if (status == google.maps.DirectionsStatus.OK){
directionsDisplay.setDirections(response);
}
});
}

View File

@ -0,0 +1,5 @@
gplinks.refresh_content = function(rel,evt){
evt.preventDefault();
var href = jPrep(this.href)+'&cmd=refresh';
$.getJSON(href,ajaxResponse);
}

View File

@ -0,0 +1,8 @@
Addon_Name = 'Replace Content Variables'
Addon_Version = 1.0-b1
min_gpeasy_version = 5.1-b1
About = 'For Typesetter 5.1-b1+ Customize replacable variables. See <a target="_blank" href="https://github.com/Typesetter/Typesetter/blob/master/include/tool/Output/Sections.php#L184">Sections.php on Github</a>.';
[ReplaceContentVars]
script = Replace.php
method = ReplaceCVs::ReplaceContentVars

View File

@ -0,0 +1,21 @@
<?php
/**
* Customize content variables that are replaced at output. For Typesetter 5.1-b1 and newer
*/
defined('is_running') or die('Not an entry point...');
class ReplaceCVs {
static function ReplaceContentVars($vars) {
// input keys names without the leading $ but use them with it in the content
$vars['myNameIs'] = '<em>John Doe</em>'; // use $myNameIs in text content
// you may also unset or change preset variables
// $vars['fileModTime'] = '<strong>i won&rsquo;t tell!</strong>';
return $vars;
}
}

View File

@ -0,0 +1,44 @@
;Addon_Name
Addon_Name = 'Shadow Box Gallery'
;Addon_Unique_ID
Addon_Unique_ID = 231
;Addon_Version
Addon_Version = 1.1
;min_gpeasy_version
min_gpeasy_version = 4.0rc2
;A description about your addon,
; may contain some html: <div>,<p>,<a>,<b>,<br/>,<span>,<tt>,<em>,<i>,<b>,<sup>,<sub>,<strong>,<u>
About = 'A dynamic gallery for file sections and extra content'
[SectionTypes]
script = Slideshow.php
method = SlideshowB::SectionTypes
[SectionToContent]
script = Slideshow.php
method = SlideshowB::SectionToContent
[GetDefaultContent]
script = Slideshow.php
method = SlideshowB::DefaultContent
[SaveSection]
script = Slideshow.php
method = SlideshowB::SaveSection
[GenerateContent_Admin]
script = Slideshow.php
method = SlideshowB::GenerateContent_Admin
[InlineEdit_Scripts]
script = Slideshow.php
method = SlideshowB::InlineEdit_Scripts

View File

@ -0,0 +1,20 @@
<?php
defined('is_running') or die('Not an entry point...');
/*
* Install_Check() can be used to check the destination server for required features
* This can be helpful for addons that require PEAR support or extra PHP Extensions
* Install_Check() is called from step1 of the install/upgrade process
*/
function Install_Check(){
/*
if( check_for_feature ){
echo '<p style="color:red">Cannot install this addon, missing feature.</p>';
return false;
}
*/
return true;
}

View File

@ -0,0 +1,212 @@
<?php
defined('is_running') or die('Not an entry point...');
class SlideshowB{
/**
* Generate a pseudo-random key for the content key to prevent duplicates
*
*/
static function ContentKey(){
global $addonFolderName;
static $key = false;
if( $key !== false ){
return $key;
}
$key = 'slideshow_b_'.$addonFolderName;
return $key;
}
/**
* @static
*
*/
static function SectionTypes($section_types, $generated_key = false ){
$section_types[self::ContentKey()] = array('label' => 'Shadow Box Gallery');
return $section_types;
}
/**
* @static
*/
static function SectionToContent($section_data){
global $dataDir;
if( $section_data['type'] != self::ContentKey() ){
return $section_data;
}
SlideshowB::AddComponents();
return $section_data;
}
static function GenerateContent($section_data){
$section_data += array('images'=>array());
$icons = $first_image = $first_caption = '';
foreach($section_data['images'] as $i => $img){
$caption =& $section_data['captions'][$i];
$hash = $size_a = false;
$attr = '';
if( empty($first_image) ){
$hash = 1;
$first_caption = $caption;
$first_image = '<a class="slideshowb_img_'.$hash.'" data-cmd="slideshowb_next" href="'.$img.'">';
$first_image .= '<img src="'.$img.'" alt="">';
$first_image .= '</a>';
}
if( $hash ){
$attr = ' data-hash="'.$hash.'" class="slideshowb_icon_'.$hash.'"';
}
$thumb_path = common::ThumbnailPath($img);
$icons .= '<li>';
$icons .= '<a data-cmd="slideshowb_img" href="'.$img.'"'.$attr.' title="'.htmlspecialchars($caption).'">';
$icons .= '<img alt="" src="'.$thumb_path.'">';
$icons .= '</a>';
$icons .= '<div class="caption">'.$caption.'</div>';
$icons .= '</li>';
}
ob_start();
$class = 'slideshowb_wrap';
if( $section_data['auto_start'] ){
$class .= ' start';
}
$attr = ' data-speed="5000"';
if( isset($section_data['interval_speed']) && is_numeric($section_data['interval_speed']) ){
$attr = ' data-speed="'.$section_data['interval_speed'].'"';
}
echo '<div class="'.$class.'"'.$attr.'>';
echo '<div class="slideshowb_images">';
echo $first_image;
echo '</div>';
echo '<div class="slideshowb_caption prov_caption">';
echo $first_caption.'&nbsp;';
echo '</div>';
echo '<div class="slideshowb_icons prov_icons"><span></span><ul>';
echo $icons;
echo '</ul></div>';
echo '</div>';
return ob_get_clean();
}
/**
* @static
*/
static function DefaultContent($default_content,$type){
if( $type != self::ContentKey() ){
return $default_content;
}
ob_start();
echo '<div class="slideshowb_wrap">';
echo '<div class="slideshowb_images">';
//echo $images;
echo '</div>';
echo '<div class="slideshowb_caption prov_caption">';
//echo $caption.'&nbsp;';
echo '</div>';
echo '<div class="slideshowb_icons prov_icons"><span></span><ul>';
//echo $icons;
echo '</ul></div>';
echo '</div>';
return ob_get_clean();
}
/**
* @static
*/
static function SaveSection($return,$section,$type){
global $page;
if( $type != self::ContentKey() ){
return $return;
}
$_POST += array('auto_start'=>'');
$page->file_sections[$section]['auto_start'] = ($_POST['auto_start'] == 'true');
$page->file_sections[$section]['images'] = $_REQUEST['images'];
$page->file_sections[$section]['captions'] = $_REQUEST['captions'];
$page->file_sections[$section]['interval_speed'] = 5000;
if( isset($_POST['interval_speed']) && is_numeric($_POST['interval_speed']) ){
$page->file_sections[$section]['interval_speed'] = $_POST['interval_speed'];
}
$page->file_sections[$section]['content'] = self::GenerateContent($page->file_sections[$section]);
return true;
}
/**
* Make sure the .js and .css is available to admins
*
* @static
*
*/
static function GenerateContent_Admin(){
global $addonFolderName, $page, $addonRelativeCode;
$page->head_script .= "\nvar SLIDESHOW_BASE = '".$addonRelativeCode."';\n";
SlideshowB::AddComponents();
}
static function AddComponents(){
global $addonFolderName, $page, $addonRelativeCode;
static $done = false;
if( $done ) return;
$page->admin_js = true; //loads main.js
$page->head_js[] = '/data/_addoncode/'.$addonFolderName.'/slideshow.js';
$page->css_user[] = '/data/_addoncode/'.$addonFolderName.'/slideshow.css';
$done = true;
}
/**
*
*
*/
static function InlineEdit_Scripts($scripts,$type){
global $addonRelativeCode;
if( $type !== self::ContentKey() ){
return $scripts;
}
$scripts[] = '/include/js/inline_edit/inline_editing.js';
$scripts[] = '/include/js/inline_edit/image_common.js';
$scripts[] = '/include/js/inline_edit/gallery_edit_202.js';
$scripts[] = $addonRelativeCode.'/gallery_options.js';
$scripts[] = '/include/js/jquery.auto_upload.js';
return $scripts;
}
}

View File

@ -0,0 +1,39 @@
$.extend(gp_editor,{
sortable_area_sel: '.slideshowb_icons ul',
img_name: 'slideshowb_img',
img_rel: '',
auto_start: true,
intervalSpeed : function(){},
/**
* Size Changes
*
*/
heightChanged : function(){
$('.gp_editing .slideshowb_images').stop(true,true).delay(800).animate({'height':this.value,'line-height':this.value+'px'});
},
/**
* Update the caption if the current image is the active image
*
*/
updateCaption: function(current_image,text){
var $li = $(current_image);
if( $li.index() === 0 ){
$li.closest('.slideshowb_wrap').find('.slideshowb_caption').html(text+'&nbsp;');
}
},
removeImage: function(image){
var $li = $(image);
if( $li.index() === 0 ){
$li.closest('.slideshowb_wrap').find('.slideshowb_icons li').eq(1).find('a').click();
}
}
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,136 @@
/**
* Provider images
*
*/
.slideshowb_wrap{
position:relative;
border:1px solid #ddd;
border-radius:3px;
overflow:hidden;
width:85%;
margin:20px auto;
background:#f7f7f7;
background:linear-gradient(to bottom, #fcfcfc, #f5f5f5 30px);
box-shadow: -5px -5px 5px -5px #fff inset, 5px 5px 5px -5px #ddd inset;
padding:30px 0;
}
.slideshowb_images{
position:relative;
height:400px;
line-height:400px;
overflow:hidden;
white-space:nowrap;
display:block;
padding:2px;
}
.slideshowb_images a{
position:absolute;
display:block;
width:100%;
text-align:center;
white-space:nowrap;
overflow:hidden;
cursor:pointer;
/* left:100%; */
/* background: url(../imgs/loaderA64.gif) 50% 50% no-repeat; */
background: url(../../../../include/imgs/loader64.gif) 50% 50% no-repeat;
height:inherit;
line-height:inherit;
z-index:0;
outline:0 none;
vertical-align:middle;
}
.slideshowb_images a.loaded{
background:none;
}
/*
.slideshowb_images a.current{
z-index:10;
}
*/
.slideshowb_images a.first{
left:0;
}
.slideshowb_images img{
max-height:100%;
max-width:90%;
vertical-align:middle;
}
.slideshowb_icons{
position:absolute;
top:0;
bottom:0;
left:-45px;
width: 80px;
display:inline-block;
overflow:hidden;
line-height:100%;
z-index:100;
transition:left .5s linear, background .5s linear;
}
.gp_editing .slideshowb_icons,
.slideshowb_icons:hover{
left:0;
background:#fff;
background:rgba(255,255,255,0.8);
}
.slideshowb_icons ul{
position:relative;
padding:5px 0 0 0;
list-style:none;
margin:0;
}
.slideshowb_icons li{
margin:0;
padding:0;
}
.slideshowb_icons a{
display:block !important;
cursor:pointer;
outline:0 none;
padding:5px 10px;
}
.slideshowb_icons img{
margin:0;
overflow:hidden;
display:inline-block;
border-radius:30px;
box-shadow:0 0 1px #aaa;
height:60px;
width:60px;
}
.slideshowb_icons .caption{
display:none;
}
.slideshowb_caption{
position:absolute;
bottom:0;
left:0;
right:0;
line-height:30px;
height:30px;
text-align:center;
font-size:12px;
text-shadow:1px 1px 0 #fff;
color:#444;
padding:0 90px;
}
.slideshowb_icons span{
position:absolute;
top:5px;
height:68px;
width:68px;
left:5px;
border:1px solid rgba(0,0,0,0.15);
border-radius:34px;
background:#fff;
background:rgba(255,255,255,0.9);
}

View File

@ -0,0 +1,212 @@
$(function(){
$(document).on('keyup',function(evt){
switch(evt.which){
case 39:
var $slideshow = GetSlideshow();
NextImg( $slideshow );
break;
case 37:
var $slideshow = GetSlideshow();
PrevImg( $slideshow );
break;
}
});
function GetSlideshow(){
var $slideshows = $('.slideshowb_wrap');
if( $slideshows.length == 1 ){
return $slideshows.eq(0);
}
var $window = $(window);
var w_top = $window.scrollTop();
var w_bottom = $window.height() + w_top;
var max_overlap = 0, slideshow_index = 0;
$.each($slideshows,function(i,j){
var $slideshow = $(j);
var s_top = $slideshow.offset().top;
var s_bottom = $slideshow.height() + s_top;
if( s_top > w_top ){
overlap = w_bottom - s_top;
}else{
overlap = s_bottom - w_top;
}
if( overlap > max_overlap ){
max_overlap = overlap;
slideshow_index = i;
}
});
return $slideshows.eq(slideshow_index);
}
//var $images = $('.slideshowb_images');
$gp.links.slideshowb_img = function(evt){
evt.preventDefault();
var $this = $(this);
var $slideshow = $this.closest('.slideshowb_wrap');
LoadImg( $slideshow, $this, true );
}
$gp.links.slideshowb_next = function(evt){
var $slideshow = $(this).closest('.slideshowb_wrap');
evt.preventDefault();
//previous or next
var half = ($slideshow.width()/2) + $slideshow.offset().left;
if( evt.pageX > half ){
NextImg($slideshow);
}else{
PrevImg($slideshow);
}
}
function NextImg($slideshow){
var next = $slideshow.find('.slideshowb_icons li:eq(1) a');
LoadImg( $slideshow, next, true );
}
function PrevImg($slideshow){
var prev = $slideshow.find('.slideshowb_icons li:last a');
LoadImg( $slideshow, prev, false );
}
function LoadImg( $slideshow, lnk, next ){
if( !lnk.length ){
return;
}
var curr = $slideshow.find('.slideshowb_icons a:first');
var $images = $slideshow.find('.slideshowb_images');
var left = $images.outerWidth();
var hash = Hash( lnk );
if( curr.length ){
var curr_hash = Hash( curr );
if( curr_hash == hash ){
return;
}
}
var new_span = ImgSpan( $images, lnk );
var curr_span = ImgSpan( $images, curr );
//scroll current image
if( !next ){
left *= -1;
}
//new_span.css('left',left).animate({'left':0});
new_span.animate({'left':left},{duration:0}).animate({'left':0});
curr_span.animate(
{'left':-(left*2)}
);
//scroll icons
var icon = $slideshow.find('a.slideshowb_icon_'+hash).parent();
var icon_wrap = $slideshow.find('.slideshowb_icons > ul');
if( next ){
var pos = icon.position();
icon_wrap.animate(
{'top': -(pos.top)}
,{
complete: function(){
icon_wrap.animate({'top':0},{duration:0,complete:function(){
var prev = icon.prevUntil().detach().get().reverse();
$.each(prev,function(){
$(this).hide().appendTo( icon_wrap ).fadeIn();
});
}
});
}
}
);
}else{
icon.prependTo( icon_wrap );
icon_wrap.animate({'top':-80},{duration:0});
icon_wrap.animate({'top':0});
}
$slideshow.find('.slideshowb_caption').html(lnk.attr('title')+'&nbsp;');
//load next image
var next = $slideshow.find('.slideshowb_icons li:eq(1) a');
if( next.length != 0 ){
ImgSpan( $images, next );
}
}
function ImgSpan( $images, lnk ){
var hash = Hash( lnk );
var new_span = $images.find('a.slideshowb_img_'+hash);
if( new_span.length == 0 ){
var href = lnk.attr('href');
var new_span = $('<a href="'+href+'" data-cmd="slideshowb_next" class="slideshowb_img_'+hash+'" data-hash="'+hash+'">').appendTo( $images );
var $img = $('<img>').load(function(){
$(this).parent().addClass('loaded');
}).attr('src',href).appendTo(new_span);
}
return new_span;
}
function Hash( lnk ){
var hash = lnk.data('hash');
if( hash ){
return hash;
}
do{
hash = Math.round(Math.random()*100);
classname = 'slideshowb_icon_'+hash;
}while( $('.'+classname).length > 0 );
lnk.data('hash',hash);
lnk.addClass(classname);
return hash;
}
//auto start
$('.slideshowb_wrap.start').each(function(){
var $slideshow = $(this);
var speed = $slideshow.data('speed') || 5000;
window.setInterval(function(){
if( !$slideshow.hasClass('hover') ){
NextImg( $slideshow );
}
},speed);
//cancel on mouseover
$slideshow.on('mouseenter',function(){
$slideshow.addClass('hover');
}).on('mouseleave',function(){
$slideshow.removeClass('hover');
});
});
});

View File

@ -0,0 +1,9 @@
Addon_Name = 'Similar Titles Example'
;Addon_Unique_ID = ???
Addon_Version = 1.0
min_gpeasy_version = 5.1.1-b1
About = 'Plugin that illustrates the use of the SimilarTitles plugin filter hook. By removing certain pages from the passed $similar_titles array, they will be excluded from automatic redirection and will not show as suggested links on the \'Missing\' page anymore. To only prevent auto-redirection change the \'percent\' key value to be lower than the threshold value set in configuration.'
[SimilarTitles]
script = SimilarTitles_Example.php
method = SimilarTitles_Example::SimilarTitles

View File

@ -0,0 +1,78 @@
<?php
/**
* Similar Titles Example plugin
* illustrates the use of the new plugin filter hook 'SimilarTitles'
*
*/
defined('is_running') or die('Not an entry point...');
class SimilarTitles_Example{
static function SimilarTitles($similar_titles=[]){
global $gp_index, $gp_titles, $gp_menu;
// uncomment the following line for debugging
// msg('SimilarTitles Example plugin. BEFORE: $similar_titles = ' . pre($similar_titles));
$blacklist = [];
// Blacklist Example 1: remove all pages not in the Main Menu
/*/ <-- remove the * to uncomment this code block
foreach( \gp\admin\Menu\Tools::GetAvailable() as $index => $title ){
$blacklist[] = $index;
}
//*/
// Blacklist Example 2: remove arbitrary pages by their index
/*/ <-- remove the * to uncomment this code block
$blacklist = ['a', 'special_site_map'];
//*/
// Blacklist Example 3: remove all special pages
/*/ <-- remove the * to uncomment this code block
foreach( $gp_index as $title => $index ){
if( strpos($index, 'special_') === 0 ){
$blacklist[] = $index;
}
}
//*/
// Blacklist Example 4: remove all pages using the robots metatag with 'noindex'
/*/ <-- remove the * to uncomment this code block
foreach( $gp_titles as $index => $data ){
if( isset($data['rel']) && strpos($data['rel'], 'noindex') !== false ){
$blacklist[] = $index;
}
}
//*/
// Only prevent auto-redirection for a certain page
// This example changes the percent value of the Contact page (if included) to zero:
/*/ <-- remove the * to uncomment this code block
if( isset($similar_titles['special_contact']) ){
$similar_titles['special_contact']['percent'] = 0;
}
//*/
// filter(remove) blacklisted pages
foreach( $similar_titles as $index => $similar ){
if( in_array($index, $blacklist) ){
unset($similar_titles[$index]);
}
}
// uncomment the following line for debugging
// msg('SimilarTitles Example plugin. AFTER: $similar_titles = ' . pre($similar_titles));
return $similar_titles;
}
}

View File

@ -0,0 +1,42 @@
;Addon_Name
Addon_Name = 'Simple Slideshow'
;Addon_Unique_ID
Addon_Unique_ID = 87
;Addon_Version
Addon_Version = 1.3.3
;min_gpeasy_version
min_gpeasy_version = 4.0
;A description about your addon,
; may contain some html: <div>,<p>,<a>,<b>,<br/>,<span>,<tt>,<em>,<i>,<b>,<sup>,<sub>,<strong>,<u>
About = 'Simple Slideshow is an alternative to the default Gallery datatype'
[SectionTypes]
script = Slideshow.php
method = SimpleSlideshow::SectionTypes
[SectionToContent]
script = Slideshow.php
method = SimpleSlideshow::SectionToContent
[GetDefaultContent]
script = Slideshow.php
method = SimpleSlideshow::DefaultContent
[SaveSection]
script = Slideshow.php
method = SimpleSlideshow::SaveSection
[GenerateContent_Admin]
script = Slideshow.php
method = SimpleSlideshow::GenerateContent_Admin
[InlineEdit_Scripts]
script = Slideshow.php
method = SimpleSlideshow::InlineEdit_Scripts

View File

@ -0,0 +1,20 @@
<?php
defined('is_running') or die('Not an entry point...');
/*
* Install_Check() can be used to check the destination server for required features
* This can be helpful for addons that require PEAR support or extra PHP Extensions
* Install_Check() is called from step1 of the install/upgrade process
*/
function Install_Check(){
/*
if( check_for_feature ){
echo '<p style="color:red">Cannot install this addon, missing feature.</p>';
return false;
}
*/
return true;
}

View File

@ -0,0 +1,262 @@
<?php
defined('is_running') or die('Not an entry point...');
class SimpleSlideshow{
/*
* @static
*/
static function SectionTypes($section_types){
$section_types['simple_slide'] = array();
$section_types['simple_slide']['label'] = 'Simple Slideshow';
return $section_types;
}
/**
* @static
*/
static function SectionToContent($section_data){
if( $section_data['type'] != 'simple_slide' ){
return $section_data;
}
$section_data += array('inteval_speed'=>'3000');
SimpleSlideshow::AddComponents();
//gpEasy 4.0rc3+
if( isset($section_data['full_content']) ){
return $section_data;
}
//pre gpEasy 4.0rc3
//get the first image
$first_image = '';
$first_caption = '';
//we could show the first caption
// - we'd have to make sure the html is valid first
// - convert &gt; into > etc
$pattern = '#<a.*?title=[\'"]([^\'"]+)[\'"]#';
if( preg_match($pattern,$section_data['content'],$caption_match) ){
$first_caption = $caption_match[1];
}
$pattern = '#<a.*?href=[\'"]([^\'"]+)[\'"]#';
if( preg_match($pattern,$section_data['content'],$image_match) ){
$first_image = '<a href="#" name="gp_slideshow_next" class="slideshow_slide first_image" title="'.$first_caption.'">'
.'<img src="'.$image_match[1].'" alt="'.$first_caption.'" />'
.'</a>';
}
$controls = '<div class="gp_slide_cntrls"><span>'
.'<a href="#" name="gp_slideshow_prev" class="gp_slide_prev" title="Previous"></a>'
.'<a href="#" name="gp_slideshow_play" class="gp_slide_play_pause" title="Play / Pause"></a>'
.'<a href="#" name="gp_slideshow_next" class="gp_slide_next" title="Next"></a>'
.'</span></div>';
$section_data['content'] = '<div class="slideshow_area">'
.'<div class="gp_nosave">'
.'<div class="slideshow-container">'
.$controls
.'<div class="loader"></div>'
.$first_image
.'</div>'
.'<div class="caption-container caption"></div>'
.'</div>'
.$section_data['content']
.'</div>';
return $section_data;
}
/**
* @static
*/
static function DefaultContent($default_content,$type){
global $langmessage;
if( $type != 'simple_slide' ){
return $default_content;
}
$content = '<div class="gp_slide_thumbs"><ul class="gp_slideshow"><li class="gp_to_remove"><a></a></li></ul></div>';
//gpEasy 4.0rc3+
if( defined('gpversion') && version_compare(gpversion,'4.0rc3','<') ){
return $content;
}
$section = array();
$section['content'] = $content;
$section['auto_start'] = false;
$section['interval_speed'] = 3000;
return $section;
}
/**
* @static
*
*/
static function SaveSection($return,$section,$type){
global $page;
if( $type != 'simple_slide' ){
return $return;
}
if( !array_key_exists('interval_speed', $_POST) ){
$page->SaveSection_Text($section);
return true;
}
$_POST += array('auto_start'=>'','images'=>array(),'interval_speed'=>'');
if( !is_numeric($_POST['interval_speed']) ){
$_POST['interval_speed'] = '3000';
}
$page->file_sections[$section]['full_content'] = true;
$page->file_sections[$section]['interval_speed'] = $_POST['interval_speed'];
$page->file_sections[$section]['auto_start'] = ($_POST['auto_start'] == 'true');
$page->file_sections[$section]['content'] = self::FromPost();
return true;
}
//gpEasy 4.0rc3
static function FromPost(){
//each image
$indicators = $first_image = '';
foreach($_POST['images'] as $i => $img){
if( empty($img) ){
continue;
}
$caption = trim($_POST['captions'][$i]);
if( empty($first_image) ){
$first_image = '<a href="#" name="gp_slideshow_next" class="slideshow_slide first_image" title="'.htmlspecialchars($caption).'">'
.'<img src="'.$img.'" alt="'.htmlspecialchars($caption).'" />'
.'</a>';
}
//indicators
$thumb_path = common::ThumbnailPath($img);
$indicators .= '<li>'
.'<a data-cmd="gp_slideshow" href="'.$img.'" title="'.htmlspecialchars($caption).'" class="">'
.'<img alt="" src="'.$thumb_path.'"></a>'
.'<span class="caption" style="display:none">'.htmlspecialchars($caption).'</span>' //for saving/editing of captions
.'</li>';
}
ob_start();
$class = 'slideshow_area';
if( $_POST['auto_start'] == 'true' ){
$class .= ' start';
}
$attr = ' data-speed="1000"';
if( isset($_POST['interval_speed']) && is_numeric($_POST['interval_speed']) ){
$attr = ' data-speed="'.$_POST['interval_speed'].'"';
}
echo '<div class="'.$class.'"'.$attr.'>';
echo '<div class="gp_nosave">';
echo '<div class="slideshow-container loaded">';
echo '<div class="gp_slide_cntrls"><span>';
echo '<a href="#" name="gp_slideshow_prev" class="gp_slide_prev" title="Previous"></a>';
echo '<a href="#" name="gp_slideshow_play" class="gp_slide_play_pause" title="Play / Pause"></a>';
echo '<a href="#" name="gp_slideshow_next" class="gp_slide_next" title="Next"></a>';
echo '</span></div>';
echo '<div class="loader"></div>';
echo $first_image;
echo '</div>';
echo '<div class="caption-container"></div>';
echo '</div>';
echo '<div class="gp_slide_thumbs">';
echo '<ul class="gp_slideshow">';
echo $indicators;
echo '</ul>';
echo '</div>';
echo '</div>';
return ob_get_clean();
}
/**
* Make sure the .js and .css is available to admins
*
* @static
*
*/
static function GenerateContent_Admin(){
global $addonFolderName, $page, $addonRelativeCode;
$page->head_script .= "\nvar SLIDESHOW_BASE = '".$addonRelativeCode."';\n";
SimpleSlideshow::AddComponents();
}
static function AddComponents(){
global $addonFolderName, $page, $addonRelativeCode;
static $done = false;
if( $done ) return;
$page->admin_js = true; //loads main.js
$page->head_js[] = '/data/_addoncode/'.$addonFolderName.'/slideshow.js';
$page->css_user[] = '/data/_addoncode/'.$addonFolderName.'/slideshow.css';
$done = true;
}
/**
*
*
*/
static function InlineEdit_Scripts($scripts,$type){
global $addonRelativeCode;
if( $type !== 'simple_slide' ){
return $scripts;
}
$scripts[] = '/include/js/inline_edit/inline_editing.js';
$scripts[] = '/include/js/inline_edit/image_common.js';
$scripts[] = '/include/js/inline_edit/gallery_edit_202.js';
$scripts[] = $addonRelativeCode.'/gallery_options.js';
$scripts[] = '/include/js/jquery.auto_upload.js';
return $scripts;
}
}

View File

@ -0,0 +1,14 @@
$.extend(gp_editor,{
sortable_area_sel : '.gp_slideshow',
img_name : 'gp_slideshow',
img_rel : '',
auto_start : true,
intervalSpeed : function(){},
updateCaption : function(current_image, caption){
$(current_image).find('a').attr('title',caption);
}
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,196 @@
.slideshow-container{
position:relative;
display:block;
position:relative;
width:100%;
}
a.slideshow_slide{
display: block;
/* position: absolute; */
width:100%;
text-align:center;
}
a.slideshow_slide img{
position:relative;
border: 1px solid #ccc;
padding:3px;
}
* html a.slideshow_slide img{
filter:inherit;
opacity:inherit;
}
.caption-container{
text-align:center;
}
.loader{
position:absolute;
top:0;
left:0;
height:100%;
width:100%;
z-index:1;
background:url('imgs/loader64.gif') 50% 50% no-repeat;
}
.loaded .loader{
display:none;
}
.gp_slide_cntrls{
position:absolute;
top:2px;
width:100%;
z-index:2;
text-align:center;
display:none;
}
.hover .gp_slide_cntrls{
display:block;
}
.gp_slide_cntrls span{
display:inline-block;
background-color:#fff;
padding:0 9px;
height:26px;
filter:alpha(opacity=95);
-moz-opacity:0.95;
-khtml-opacity: 0.95;
opacity: 0.95;
border:1px solid #ccc;
-moz-border-radius: 7px;
-o-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.gp_slide_cntrls a{
text-decoration:none;
font-size:11px;
font-weight:bold;
padding:5px 5px;
display:inline-block;
color:#333;
height:16px;
width:16px;
}
.gp_slide_play_pause{
background:url('imgs/gtk-media-play-ltr.png') 50% 50% no-repeat;
}
.gp_slide_play{
background:url('imgs/gtk-media-pause.png') 50% 50% no-repeat;
}
.gp_slide_next{
background:url('imgs/gtk-media-next-ltr.png') 50% 50% no-repeat;
}
.gp_slide_prev{
background:url('imgs/gtk-media-next-rtl.png') 50% 50% no-repeat;
}
/* thumbnails */
/*
*/
/* thumbnails new */
.gp_slide_thumbs{
float:right;
position:relative;
left:-50%;
text-align:left;
}
.gp_slide_thumbs ul.gp_slideshow{
list-style:none;
position:relative;
left:50%;
margin: 20px 0 20px 0;
padding: 0;
}
.gp_slide_thumbs li{float:left;position:relative;}/* ie needs position:relative here*/
ul.gp_slideshow > li{
padding: 0;
margin: 5px 10px 5px 0;
list-style: none;
}
ul.gp_slideshow > li > a{
float:left;
padding: 2px;
border: 1px solid #ccc;
height:75px;
width:75px;
}
ul.gp_slideshow .caption{
display:none;
}
ul.gp_slideshow > li.current > a{
border-color: #000;
}
ul.gp_slideshow > li > a:focus {
outline: none;
}
ul.gp_slideshow > li > a img{
height:75px;
width:75px;
}
ul.gp_slideshow > li.selected > a img {
border: none;
display: block;
}
.gp_slide_thumbs .gp_drag_box{
height:75px;
width:75px;
}
/* CSS for captions above images
* the padding-top should be coordinated with the amount of area needed for the captions
*/
/*
.slideshow_area{
position:relative;
padding-top:20px;
}
.caption-container{
position:absolute;
top:0;
width:100%;
}
*/
/* for captions on the side
Widths will need to be coordinated with the theme and images used
.slideshow-container{
float:right;
width:700px;
}
.caption-container{
float:left;
width:200px;
}
*/

View File

@ -0,0 +1,217 @@
$(function(){
var gp_slideshow = {};
gp_slideshow.ImgSelect = function(a){
var container, file_container, $anchor, href;
if( !a ) return;
$anchor = $(a);
file_container = $anchor.closest('.slideshow_area');
container = file_container.find('.slideshow-container');
container.removeClass('loaded');
//change the thumbnail current class
var thumb_li = $anchor.parent();
thumb_li.siblings().removeClass('current');
thumb_li.addClass('current');
NewImg($anchor,true);
function NewImg(source_link,onload){
var img, hash;
if( !source_link.attr('href') ) return;
var hash = source_link.data('hash');
if( !hash ){
hash = Hash();
source_link.data('hash',hash);
}
var lnk = container.find('#'+hash);
//link not found, create it
if( lnk.length ){
lnk.attr('title',source_link.attr('title'));
if( onload ){
window.setTimeout(function(){
loaded(lnk);
},100);
}
return;
}
lnk = $('<a href="#" name="gp_slideshow_next" class="slideshow_slide" id="'+hash+'"/>')
.hide()
.appendTo(container)
.attr('title',source_link.attr('title'));
img = $('<img />').appendTo(lnk);
if( onload ){
img.load(function(){
//allow browser to get image size
window.setTimeout(function(){
loaded(lnk);
},100);
});
}
//setting the src value needs to be after onload function is added
img.attr('src',source_link.attr('href'));
}
function loaded(lnk){
container.addClass('loaded');
var visible = container.find('a.slideshow_slide:visible');
if( visible.attr('id') != lnk.attr('id') ){
//fade the current image
visible.stop(true,true).fadeOut();
//adjust container height
var h = lnk.outerHeight();
container.stop(true,true).animate({'height':h});
//show the new image
lnk.css({'position':'absolute'}).stop(true,true).fadeIn();
}
//always make sure the caption is correct since the caption for the first image isn't automatic
file_container.find('.caption-container').html(lnk.attr('title'));
//preload load next
var next = thumb_li.next().children(':first');
if( next.length > 0 ) NewImg(next,false);
}
}
function Hash(){
do{
var hash = Math.round(Math.random()*10000);
}while( $('#'+hash).length > 0 );
return hash;
}
$gp.links.gp_slideshow_next = function(evt){
evt.preventDefault();
Next( $(this) );
}
function Next( $this ){
var thumbs = $this.closest('.slideshow_area').find('.gp_slideshow');
if( thumbs.length == 0 ) return;
var current = thumbs.children('li.current');
var next_li = false;
if( current.length > 0 ){
next_li = current.next();
}
if( !next_li || next_li.length == 0 ){
next_li = thumbs.children(':first');
}
gp_slideshow.ImgSelect(next_li.children(':first').get(0));
}
$gp.links.gp_slideshow_prev = function(evt){
evt.preventDefault();
var thumbs = $(this).closest('.slideshow_area').find('.gp_slideshow');
if( thumbs.length == 0 ) return;
var current = thumbs.children('li.current');
var prev_li = false;
if( current.length > 0 ){
prev_li = current.prev();
}
if( !prev_li || prev_li.length == 0 ){
prev_li = thumbs.children(':last');
}
gp_slideshow.ImgSelect(prev_li.children(':first').get(0));
}
$gp.links.gp_slideshow_play = function(evt){
evt.preventDefault();
var interval = false;
var container = $(this).closest('.slideshow_area');
var play_pause = container.find('.gp_slide_play_pause');
if( play_pause.hasClass('gp_slide_play') ){
//change to pause
play_pause.removeClass('gp_slide_play');
}else{
var speed = container.data('speed') || 3000;
//change to play
play_pause.addClass('gp_slide_play');
interval = window.setInterval(function(){
PlayNext();
},speed);
}
function PlayNext(){
//no longer playing
if( !play_pause.hasClass('gp_slide_play') ){
window.clearInterval(interval);
return;
}
Next( play_pause );
}
}
$gp.links.gp_slideshow = function(evt){
evt.preventDefault();
gp_slideshow.ImgSelect(this);
}
$('ul.gp_slideshow').each(function(){
var timeout = false;
function clear(){
if( timeout )
window.clearTimeout(timeout);
}
//init containers
var container = $(this).closest('.slideshow_area');
var html = container.find('.gp_nosave');
var cntrls = html.find('.gp_slide_cntrls');
$(html).mousemove(function(){
cntrls.stop(true,true).fadeIn();
clear();
timeout = window.setTimeout(function(){
cntrls.stop(true,true).fadeOut('slow');
},1500);
}).mouseleave(function(){
cntrls.stop(true,true).fadeOut();
});
//first image
var hash = Hash();
var first_img = $(this).find('li:first > a').data('hash',hash);
container.find('.first_image').attr('id',hash);
gp_slideshow.ImgSelect(first_img.get(0));
//auto start
if( container.hasClass('start') ){
container.find('.gp_slide_play_pause').click();
}
});
});

View File

@ -0,0 +1,34 @@
;Addon_Name
Addon_Name = 'Syntax Highlighter'
;Addon_Unique_ID
Addon_Unique_ID = 227
;Addon_Version
Addon_Version = 1.0
;min_gpeasy_version
min_gpeasy_version = 3.6
;A description about your addon,
; may contain some html: <div>,<p>,<a>,<b>,<br/>,<span>,<tt>,<em>,<i>,<b>,<sup>,<sub>,<strong>,<u>
About = 'Add code syntax highlighting to any of your pages';
[CKEditorPlugins]
script = 'HighlighterPlugin.php'
method = 'HighlighterPlugin::CKEditorPlugins'
[HeadContent]
script = 'HighlighterPlugin.php'
method = 'HighlighterPlugin::CheckContent'
;Admin_links (Optional)
;Define scripts that are only accessible to administrators with appropriate permissions
[Admin_Link:Admin_HighlighterSettings]
label = 'Syntax Highlighter Settings'
script = 'Admin.php'
class = 'HighlighterSettings'

View File

@ -0,0 +1,94 @@
<?php
defined('is_running') or die('Not an entry point...');
class HighlighterSettings{
var $themes = array();
var $config = array();
function HighlighterSettings(){
$this->config = gpPlugin::GetConfig();
$this->config += array('theme'=>'default');
$this->themes = array(
'default' => 'Default',
'django' => 'Django',
'eclipse' => 'Eclipse',
'emacs' => 'Emacs',
'fadetogrey' => 'Fade to Grey',
'midnight' => 'Midnight',
'rdark' => 'RDark',
'none' => '[None]',
);
$this->themes = gpPlugin::Filter('syntaxhighlighter_themes', array( $this->themes ) );
$cmd = common::GetCommand();
switch($cmd){
case 'save';
$this->Save();
break;
}
$this->ShowForm();
}
function Save(){
global $langmessage;
$theme =& $_POST['theme'];
if( isset($this->themes[$theme]) ){
$this->config['theme'] = $theme;
}
if( gpPlugin::SaveConfig($this->config) ){
message($langmessage['SAVED']);
}else{
message($langmessage['OOPS']);
}
}
function ShowForm(){
global $langmessage;
if( count($_POST) ){
$values = $_POST;
}else{
$values = $this->config;
}
echo '<h2>Syntax Highlighter Settings</h2>';
echo '<form method="post" action="'.common::GetUrl('Admin_HighlighterSettings').'">';
echo '<table class="bordered">';
echo '<tr><th>'.$langmessage['options'].'</th><th>&nbsp;</th></tr>';
echo '<tr><td>Color Theme</td><td>';
echo '<select name="theme" id="syntaxhighlighter-theme">';
foreach( $this->themes as $theme => $name ){
$selected = '';
if( $values['theme'] == $theme ){
$selected = 'selected="selected"';
}
echo '<option value="'.htmlspecialchars($theme).'" '.$selected . '>' . htmlspecialchars( $name ) . "&nbsp;</option>\n";
}
echo '</select>';
echo '</td></tr>';
echo '<tr><td>';
echo '</td><td>';
echo '<input type="hidden" name="cmd" value="save" />';
echo '<input type="submit" name="" value="'.$langmessage['save'].'" class="gpsubmit" />';
echo '</td></tr>';
echo '</table>';
echo '</form>';
}
}

View File

@ -0,0 +1,110 @@
<?php
defined('is_running') or die('Not an entry point...');
class HighlighterPlugin{
/**
* Add the ckeditor plugin
*
*/
static function CKEditorPlugins($plugins){
global $addonRelativeCode;
trigger_error('ckeditor plugins');
$plugins['syntaxhighlight'] = $addonRelativeCode.'/syntaxhighlight/';
return $plugins;
}
/**
* Add syntax highlighting to the page
* Check for <pre class="brush:jscript;">.. php...
* Add the appropriate js and css files
*
*/
static function CheckContent(){
global $page, $addonRelativeCode;
$content = ob_get_contents();
$avail_brushes['css'] = 'shBrushCss.js';
$avail_brushes['diff'] = 'shBrushDiff.js';
$avail_brushes['ini'] = 'shBrushIni.js';
$avail_brushes['jscript'] = 'shBrushJScript.js';
$avail_brushes['php'] = 'shBrushPhp.js';
$avail_brushes['plain'] = 'shBrushPlain.js';
$avail_brushes['sql'] = 'shBrushSql.js';
$avail_brushes['xml'] = 'shBrushXml.js';
$brushes = array();
preg_match_all('#<pre[^<>]*>#',$content,$matches);
if( !count($matches) ){
return;
}
foreach($matches[0] as $match){
preg_match('#class=[\'"]([^\'"]+)[\'"]#',$match,$classes);
if( !isset($classes[1]) ){
continue;
}
preg_match('#brush:([^;\'"]+)[;"\']?#',$match,$type);
if( !isset($type[1]) ){
continue;
}
$type = strtolower(trim($type[1]));
if( !isset($avail_brushes[$type]) ){
continue;
}
$brushes[] = $avail_brushes[$type];
}
if( !count($brushes) ){
return;
}
$config = gpPlugin::GetConfig();
$theme =& $config['theme'];
$page->head .= "\n\n";
$page->head .= '<link rel="stylesheet" type="text/css" href="'.$addonRelativeCode.'/syntaxhighlighter/styles/shCore.css" />'."\n";
$css_file = 'shThemeDefault.css';
switch($theme){
case 'django':
$css_file = 'shThemeDjango.css';
break;
case 'eclipse':
$css_file = 'shThemeEclipse.css';
break;
case 'emacs':
$css_file = 'shThemeEmacs.css';
break;
case 'fadetogrey':
$css_file = 'shThemeFadeToGrey.css';
break;
case 'midnight':
$css_file = 'shThemeMidnight.css';
break;
case 'rdark':
$css_file = 'shThemeRDark.css';
break;
case 'none':
$css_file = false;
break;
}
if( $css_file ){
$page->head .= '<link rel="stylesheet" type="text/css" href="'.$addonRelativeCode.'/syntaxhighlighter/styles/'.$css_file.'" />'."\n";
}
$page->head .= '<script language="javascript" type="text/javascript" src="'.$addonRelativeCode.'/syntaxhighlighter/scripts/shCore.js"></script>'."\n";
foreach($brushes as $brush){
$page->head .= '<script language="javascript" type="text/javascript" src="'.$addonRelativeCode.'/syntaxhighlighter/scripts/'.$brush.'"></script>'."\n";
}
$page->jQueryCode .= "\nSyntaxHighlighter.all();\n";
}
}

View File

@ -0,0 +1,20 @@
<?php
defined('is_running') or die('Not an entry point...');
/*
* Install_Check() can be used to check the destination server for required features
* This can be helpful for addons that require PEAR support or extra PHP Extensions
* Install_Check() is called from step1 of the install/upgrade process
*/
function Install_Check(){
/*
if( check_for_feature ){
echo '<p style="color:red">Cannot install this addon, missing feature.</p>';
return false;
}
*/
return true;
}

View File

@ -0,0 +1,373 @@
CKEDITOR.dialog.add( 'syntaxhighlightDialog', function( editor ) {
var a=function(f) {
f=f.replace(/<br>/g,"\n");
f=f.replace(/&amp;/g,"&");
f=f.replace(/&lt;/g,"<");
f=f.replace(/&gt;/g,">");
f=f.replace(/&quot;/g,'"');
return f
};
var e=function(f) {
var f=new Object();
f.hideGutter=false;
f.hideControls=false;
f.collapse=false;
f.showColumns=false;
f.noWrap=false;
f.firstLineChecked=false;
f.firstLine=0;
f.highlightChecked=false;
f.highlight=null;
f.lang=null;
f.code='';
return f
};
var b=function(i) {
var h=e();
if(i) {
if(i.indexOf('brush')>-1) {
var g=/brush:[ ]{0,1}(\w*)/.exec(i);
if(g!=null&&g.length>0) {
h.lang=g[1].replace(/^\s+|\s+$/g,'')
}
}
if(i.indexOf('gutter')>-1) {
h.hideGutter=true
}
if(i.indexOf('toolbar')>-1) {
h.hideControls=true
}
if(i.indexOf('collapse')>-1) {
h.collapse=true
}
if(i.indexOf('first-line')>-1) {
var g=/first-line:[ ]{0,1}([0-9]{1,4})/.exec(i);
if(g!=null&&g.length>0&&g[1]>1) {
h.firstLineChecked=true;
h.firstLine=g[1]
}
}
if(i.indexOf('highlight')>-1) {
if(i.match(/highlight:[ ]{0,1}\[[0-9]+(,[0-9]+)*\]/)) {
var f=/highlight:[ ]{0,1}\[(.*)\]/.exec(i);
if(f!=null&&f.length>0) {
h.highlightChecked=true;
h.highlight=f[1]
}
}
}
if(i.indexOf('ruler')>-1) {
h.showColumns=true
}
if(i.indexOf('wrap-lines')>-1) {
h.noWrap=true
}
}
return h
};
var d=function(g) {
var f='brush:'+g.lang+';';
if(g.hideGutter) {
f+='gutter:false;'
}
if(g.hideControls) {
f+='toolbar:false;'
}
if(g.collapse) {
f+='collapse:true;'
}
if(g.showColumns) {
f+='ruler:true;'
}
if(g.noWrap) {
f+='wrap-lines:false;'
}
if(g.firstLineChecked&&g.firstLine>1) {
f+='first-line:'+g.firstLine+';'
}
if(g.highlightChecked&&g.highlight!='') {
f+='highlight: ['+g.highlight.replace(/\s/gi,'')+'];'
}
return f
};
return {
title : editor.lang.syntaxhighlight.title,
minWidth : 500,
minHeight : 400,
contents : [
{
id : 'source',
label : editor.lang.syntaxhighlight.sourceTab,
accessKey : 'S',
elements : [
{
type : 'vbox',
children : [
{
id : 'cmbLang',
type : 'select',
labelLayout : 'horizontal',
label : editor.lang.syntaxhighlight.langLbl,
'default' : 'java',
widths : ['25%','75%'],
items : [
//['Bash (Shell)','bash'],
//['C#','csharp'],
//['C++','cpp'],
['CSS','css'],
//['Delphi','delphi'],
['Diff','diff'],
//['Groovy','groovy'],
['Javascript','jscript'],
//['Java','java'],
//['Java FX','javafx'],
//['Perl','perl'],
['PHP','php'],
['Plain (Text)','plain'],
//['Python','python'],
//['Ruby','ruby'],
//['Scala','scala'],
['SQL','sql'],
//['VB','vb'],
['XML/XHTML','xml']
],
setup : function(f) {
if(f.lang) {
this.setValue(f.lang)
}
},
commit : function(f) {
f.lang=this.getValue()
}
}
]
},
{
type : 'textarea',
id : 'hl_code',
rows : 22,
style : 'width:100%',
validate: CKEDITOR.dialog.validate.notEmpty( editor.lang.syntaxhighlight.sourceTextareaEmptyError ),
setup : function(f) {
if(f.code) {
this.setValue(f.code)
}
},
commit : function(f) {
f.code=this.getValue()
}
}
]
},
{
id : 'advanced',
label : editor.lang.syntaxhighlight.advancedTab,
accessKey : 'A',
elements : [
{
type : 'vbox',
children : [
{
type : 'html',
html : '<strong>'+editor.lang.syntaxhighlight.hideGutter+'</strong>'
},
{
type : 'checkbox',
id : 'hide_gutter',
label : editor.lang.syntaxhighlight.hideGutterLbl,
setup : function(f) {
this.setValue(f.hideGutter)
},
commit : function(f) {
f.hideGutter=this.getValue()
}
},
{
type : 'html',
html : '<strong>'+editor.lang.syntaxhighlight.hideControls+'</strong>'
},
{
type : 'checkbox',
id : 'hide_controls',
label : editor.lang.syntaxhighlight.hideControlsLbl,
setup : function(f) {
this.setValue(f.hideControls)
},
commit : function(f) {
f.hideControls=this.getValue()
}
},
{
type : 'html',
html : '<strong>'+editor.lang.syntaxhighlight.collapse+'</strong>'
},
{
type : 'checkbox',
id : 'collapse',
label : editor.lang.syntaxhighlight.collapseLbl,
setup : function(f) {
this.setValue(f.collapse)
},
commit : function(f) {
f.collapse=this.getValue()
}
},
{
type : 'html',
html : '<strong>'+editor.lang.syntaxhighlight.showColumns+'</strong>'
},
{
type : 'checkbox',
id : 'show_columns',
label : editor.lang.syntaxhighlight.showColumnsLbl,
setup : function(f) {
this.setValue(f.showColumns)
},
commit : function(f) {
f.showColumns=this.getValue()
}
},
{
type : 'html',
html : '<strong>'+editor.lang.syntaxhighlight.lineWrap+'</strong>'
},
{
type : 'checkbox',
id : 'line_wrap',
label : editor.lang.syntaxhighlight.lineWrapLbl,
setup : function(f) {
this.setValue(f.noWrap)
},
commit : function(f) {
f.noWrap=this.getValue()
}
},
{
type : 'html',
html : '<strong>'+editor.lang.syntaxhighlight.lineCount+'</strong>'
},
{
type : 'hbox',
widths : ['5%','95%'],
children : [
{
type : 'checkbox',
id : 'lc_toggle',
label : '',
setup : function(f) {
this.setValue(f.firstLineChecked)
},
commit : function(f) {
f.firstLineChecked=this.getValue()
}
},
{
type : 'text',
id : 'default_lc',
style : 'width:15%;',
label : '',
setup : function(f) {
if(f.firstLine>1) {
this.setValue(f.firstLine)
}
},
commit : function(f) {
if(this.getValue()&&this.getValue()!='') {
f.firstLine=this.getValue()
}
}
}
]
},
{
type : 'html',
html : '<strong>'+editor.lang.syntaxhighlight.highlight+'</strong>'
},
{
type : 'hbox',
widths : ['5%','95%'],
children : [
{
type : 'checkbox',
id : 'hl_toggle',
label : '',
setup : function(f) {
this.setValue(f.highlightChecked)
},
commit : function(f) {
f.highlightChecked=this.getValue()
}
},
{
type : 'text',
id : 'default_hl',
style : 'width:40%;',
label : '',
setup : function(f) {
if(f.highlight!=null) {
this.setValue(f.highlight)
}
},
commit : function(f) {
if(this.getValue()&&this.getValue()!='') {
f.highlight=this.getValue()
}
}
}
]
},
{
type : 'hbox',
widths : ['5%','95%'],
children : [
{
type : 'html',
html : ''
},
{
type : 'html',
html : '<i>'+editor.lang.syntaxhighlight.highlightLbl+'</i>'
}
]
}
]
}
]
}
],
onShow : function() {
var i=this.getParentEditor();
var h=i.getSelection();
var g=h.getStartElement();
var k=g&&g.getAscendant('pre',true);
var j='';
var f=null;
if(k) {
code=a(k.getHtml());
f=b(k.getAttribute('class'));
f.code=code
} else {
f=e()
}
this.setupContent(f)
},
onOk : function() {
var h=this.getParentEditor();
var g=h.getSelection();
var f=g.getStartElement();
var k=f&&f.getAscendant('pre',true);
var i=e();
this.commitContent(i);
var j=d(i);
if(k) {
k.setAttribute('class',j);
k.setText(i.code)
} else {
var l=new CKEDITOR.dom.element('pre');
l.setAttribute('class',j);
l.setText(i.code);
h.insertElement(l)
}
}
}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

View File

@ -0,0 +1,21 @@
CKEDITOR.plugins.setLang( 'syntaxhighlight', 'de', {
title:'Einen Quelltextabschnitt einfügen oder aktualisieren',
contextTitle:'Quelltext bearbeiten',
sourceTab:'Quelltext',
langLbl:'Sprache auswählen',
sourceTextareaEmptyError:'Das Quelltext-Feld darf nicht leer sein.',
advancedTab:'Erweitert',
hideGutter:'Verstecke Seitenleiste',
hideGutterLbl:'Verstecke Seitenleiste und Zeilennummern.',
hideControls:'Verstecke Kontrollfelder',
hideControlsLbl:'Verstecke die Menüleiste über dem Quelltextblock.',
collapse:'Einklappen',
collapseLbl:'Klappe den Quelltextblock standartmäßig ein. (Kontrollfelder müssen aktiviert werden)',
showColumns:'Spalten anzeigen',
showColumnsLbl:'Zeige Spalten jeder Zeile in der Kopfzeile an.',
lineWrap:'Zeilenumbruch',
lineWrapLbl:'Deaktiviere den Zeilenumbruch.',
lineCount:'Standart Zeilenanzahl',
highlight:'Zeilen hervorheben',
highlightLbl:'Geben Sie kommasepariert die Zeilen ein, die sie hervorheben wollen, z.B. <em style="font-style:italic">3,10,15</em>.'
});

View File

@ -0,0 +1,21 @@
CKEDITOR.plugins.setLang( 'syntaxhighlight', 'en', {
title:'Add or update a code snippet',
contextTitle:'Edit source code',
sourceTab:'Source code',
langLbl:'Select language',
sourceTextareaEmptyError:'Source code mustn\'t be empty.',
advancedTab:'Advanced',
hideGutter:'Hide gutter',
hideGutterLbl:'Hide gutter & line numbers.',
hideControls:'Hide controls',
hideControlsLbl:'Hide code controls at the top of the code block.',
collapse:'Collapse',
collapseLbl:'Collapse the code block by default. (controls need to be turned on)',
showColumns:'Show columns',
showColumnsLbl:'Show row columns in the first line.',
lineWrap:'Disable line wrapping',
lineWrapLbl:'Switch off line wrapping.',
lineCount:'Default line count',
highlight:'Highlight lines',
highlightLbl:'Enter a comma seperated lines of lines you want to highlight, eg <em style="font-style:italic">3,10,15</em>.'
});

View File

@ -0,0 +1,21 @@
CKEDITOR.plugins.setLang('syntaxhighlight', 'fr', {
title:'Ajouter ou modifier un morceau de code source',
contextTitle:'&Eacute;diter le code source',
sourceTab:'Code source',
langLbl:'Sélectionnez le langage:',
sourceTextareaEmptyError:'Le code source ne doit pas être vide',
advancedTab:'Avancé',
hideGutter:'Cacher la marge',
hideGutterLbl:'Cacher la marge et les numéros de ligne.',
hideControls:'Cacher la barre d\'outils',
hideControlsLbl:'Cacher la barre d\'outils en haut du bloc de code.',
collapse:'Réduire le code',
collapseLbl:'Réduire le bloc de code par défaut. (la barre d\'outils doit être activée)',
showColumns:'Montrer les colonnes',
showColumnsLbl:'Montrer les colonnes sur la première ligne.',
lineWrap:'Désactiver le retour à la ligne automatique',
lineWrapLbl:'Désactiver le retour à la ligne automatique (ne fonctionne plus avec SyntaxHighlighter 3).',
lineCount:'Numéro de la première ligne (différent de 1)',
highlight:'Surligner les lignes',
highlightLbl:'Entrez les numéros des lignes que vous souhaitez surligner, séparés par des virgules. ex <em style="font-style:italic">3,10,15</em>.'
});

View File

@ -0,0 +1,21 @@
CKEDITOR.plugins.setLang( 'syntaxhighlight', 'ja', {
title:'コードスニペットの追加または更新',
contextTitle:'ソースコードの編集',
sourceTab:'ソースコード',
langLbl:'ソースコードの言語',
sourceTextareaEmptyError:'空のソースコードは登録できません。',
advancedTab:'詳細',
hideGutter:'行番号',
hideGutterLbl:'行番号を非表示にする',
hideControls:'codeタグ',
hideControlsLbl:'コードブロックの先頭に置かれたcodeタグを非表示にする',
collapse:'折りたたみ',
collapseLbl:'デフォルトでコードブロックを折りたたむコントロールをONにする必要があります',
showColumns:'列',
showColumnsLbl:'最初の行に行カラムを表示する',
lineWrap:'改行',
lineWrapLbl:'行が長くても改行しない',
lineCount:'デフォルトの行数',
highlight:'行のハイライト表示',
highlightLbl:'ハイライトで表示する行をカンマ区切りで指定します(例: <em style="font-style:italic">3,10,15</em>'
});

View File

@ -0,0 +1,21 @@
CKEDITOR.plugins.setLang( 'syntaxhighlight', 'uk', {
title:'Додати або оновити фрагмент коду',
contextTitle:'Редагувати вихідний код',
sourceTab:'Вихідний код',
langLbl:'Оберіть мову',
sourceTextareaEmptyError:'Вихідний код не повинен бути порожнім.',
advancedTab:'Розширені',
hideGutter:'Сховати бічну панель',
hideGutterLbl:'Сховати бічну панель та номери рядків.',
hideControls:'Сховати елементи керування',
hideControlsLbl:'Сховати елементи управління кодом у верхній частині блоку коду.',
collapse:'Згорнути',
collapseLbl:'Згорнути блок коду за замовчуванням. (елементи управління повинні бути включені)',
showColumns:'Показати стовпці',
showColumnsLbl:'Показувати стовпці кожного рядка у заголовку.',
lineWrap:'Вимкнути перенесення рядків',
lineWrapLbl:'Відключити перенесення рядків.',
lineCount:'Кількість рядків за замовчуванням',
highlight:'Виділення рядків',
highlightLbl:'Введіть через кому лінії рядків, які ви хочете виділити, наприклад <em style="font-style:italic">3,10,15</em>.'
});

View File

@ -0,0 +1,31 @@
CKEDITOR.plugins.add( 'syntaxhighlight', {
requires : 'dialog',
lang : 'en,de,fr,ja,uk', // %REMOVE_LINE_CORE%
icons : 'syntaxhighlight', // %REMOVE_LINE_CORE%
init : function( editor ) {
editor.addCommand( 'syntaxhighlightDialog', new CKEDITOR.dialogCommand( 'syntaxhighlightDialog' ) );
editor.ui.addButton && editor.ui.addButton( 'Syntaxhighlight',
{
label : editor.lang.syntaxhighlight.title,
command : 'syntaxhighlightDialog',
toolbar : 'insert,98'
} );
if ( editor.contextMenu ) {
editor.addMenuGroup( 'syntaxhighlightGroup' );
editor.addMenuItem( 'syntaxhighlightItem', {
label: editor.lang.syntaxhighlight.contextTitle,
icon: this.path + 'icons/syntaxhighlight.png',
command: 'syntaxhighlightDialog',
group: 'syntaxhighlightGroup'
});
editor.contextMenu.addListener( function( element ) {
if ( element.getAscendant( 'pre', true ) ) {
return { syntaxhighlightItem: CKEDITOR.TRISTATE_OFF };
}
});
}
CKEDITOR.dialog.add( 'syntaxhighlightDialog', this.path + 'dialogs/syntaxhighlight.js' );
}
});

View File

@ -0,0 +1,17 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2(){1 h=5;h.I=2(){2 n(c,a){4(1 d=0;d<c.9;d++)i[c[d]]=a}2 o(c){1 a=r.H("J"),d=3;a.K=c;a.M="L/t";a.G="t";a.u=a.v=2(){6(!d&&(!8.7||8.7=="F"||8.7=="z")){d=q;e[c]=q;a:{4(1 p y e)6(e[p]==3)B a;j&&5.C(k)}a.u=a.v=x;a.D.O(a)}};r.N.R(a)}1 f=Q,l=h.P(),i={},e={},j=3,k=x,b;5.T=2(c){k=c;j=q};4(b=0;b<f.9;b++){1 m=f[b].w?f[b]:f[b].S(/\\s+/),g=m.w();n(m,g)}4(b=0;b<l.9;b++)6(g=i[l[b].E.A]){e[g]=3;o(g)}}})();',56,56,'|var|function|false|for|SyntaxHighlighter|if|readyState|this|length|||||||||||||||||true|document||javascript|onload|onreadystatechange|pop|null|in|complete|brush|break|highlight|parentNode|params|loaded|language|createElement|autoloader|script|src|text|type|body|removeChild|findElements|arguments|appendChild|split|all'.split('|'),0,{}))

View File

@ -0,0 +1,59 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Created by Peter Atoria @ http://iAtoria.com
var inits = 'class interface function package';
var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' +
'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' +
'extends false final finally flash_proxy for get if implements import in include Infinity ' +
'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' +
'Null Number Object object_proxy override parseFloat parseInt private protected public ' +
'return set static String super switch this throw true try typeof uint undefined unescape ' +
'use void while with'
;
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
{ regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp('var', 'gm'), css: 'variable' }, // variable
{ regex: new RegExp('trace', 'gm'), css: 'color1' } // trace
];
this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['actionscript3', 'as3'];
SyntaxHighlighter.brushes.AS3 = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,59 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne ge le';
var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' +
'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' +
'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' +
'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' +
'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' +
'import install join kill less let ln local locate logname logout look lpc lpr lprint ' +
'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' +
'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' +
'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' +
'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' +
'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' +
'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' +
'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' +
'vi watch wc whereis which who whoami Wget xargs yes'
;
this.regexList = [
{ regex: /^#!.*$/gm, css: 'preprocessor bold' },
{ regex: /\/[\w-\/]+/gm, css: 'plain' },
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands
];
}
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['bash', 'shell'];
SyntaxHighlighter.brushes.Bash = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,65 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var keywords = 'abstract as base bool break byte case catch char checked class const ' +
'continue decimal default delegate do double else enum event explicit ' +
'extern false finally fixed float for foreach get goto if implicit in int ' +
'interface internal is lock long namespace new null object operator out ' +
'override params private protected public readonly ref return sbyte sealed set ' +
'short sizeof stackalloc static string struct switch this throw true try ' +
'typeof uint ulong unchecked unsafe ushort using virtual void while';
function fixComments(match, regexInfo)
{
var css = (match[0].indexOf("///") == 0)
? 'color1'
: 'comments'
;
return [new SyntaxHighlighter.Match(match[0], match.index, css)];
}
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword
{ regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial'
{ regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield'
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['c#', 'c-sharp', 'csharp'];
SyntaxHighlighter.brushes.CSharp = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,100 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Jen
// http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus
var funcs = 'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' +
'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' +
'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' +
'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' +
'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' +
'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' +
'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' +
'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' +
'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' +
'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' +
'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' +
'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' +
'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' +
'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' +
'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' +
'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' +
'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' +
'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' +
'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' +
'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' +
'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' +
'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' +
'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' +
'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' +
'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' +
'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' +
'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' +
'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' +
'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' +
'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' +
'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' +
'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' +
'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' +
'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' +
'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' +
'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' +
'XmlValidate Year YesNoFormat';
var keywords = 'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' +
'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' +
'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' +
'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' +
'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' +
'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' +
'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' +
'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' +
'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' +
'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' +
'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' +
'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' +
'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' +
'cfwindow cfxml cfzip cfzipparam';
var operators = 'all and any between cross in join like not null or outer some';
this.regexList = [
{ regex: new RegExp('--(.*)$', 'gm'), css: 'comments' }, // one line and multiline comments
{ regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // single quoted strings
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // functions
{ regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
];
}
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['coldfusion','cf'];
SyntaxHighlighter.brushes.ColdFusion = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,97 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Copyright 2006 Shin, YoungJin
var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' +
'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' +
'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' +
'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' +
'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' +
'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' +
'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' +
'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' +
'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' +
'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' +
'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' +
'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' +
'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' +
'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' +
'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' +
'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' +
'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' +
'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' +
'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' +
'__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' +
'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' +
'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' +
'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' +
'va_list wchar_t wctrans_t wctype_t wint_t signed';
var keywords = 'break case catch class const __finally __exception __try ' +
'const_cast continue private public protected __declspec ' +
'default delete deprecated dllexport dllimport do dynamic_cast ' +
'else enum explicit extern if for friend goto inline ' +
'mutable naked namespace new noinline noreturn nothrow ' +
'register reinterpret_cast return selectany ' +
'sizeof static static_cast struct switch template this ' +
'thread throw true false try typedef typeid typename union ' +
'using uuid virtual void volatile whcar_t while';
var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' +
'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' +
'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' +
'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' +
'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' +
'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' +
'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' +
'fwrite getc getchar gets perror printf putc putchar puts remove ' +
'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' +
'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' +
'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' +
'mbtowc qsort rand realloc srand strtod strtol strtoul system ' +
'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' +
'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' +
'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' +
'clock ctime difftime gmtime localtime mktime strftime time';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /^ *#.*/gm, css: 'preprocessor' },
{ regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' },
{ regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' }
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['cpp', 'c'];
SyntaxHighlighter.brushes.Cpp = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,91 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
function getKeywordsCSS(str)
{
return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
};
function getValuesCSS(str)
{
return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b';
};
var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' +
'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' +
'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' +
'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' +
'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' +
'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' +
'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' +
'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index';
var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+
'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+
'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+
'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+
'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+
'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+
'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+
'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+
'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+
'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow';
var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors
{ regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes
{ regex: /!important/g, css: 'color3' }, // !important
{ regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values
{ regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts
];
this.forHtmlScript({
left: /(&lt;|<)\s*style.*?(&gt;|>)/gi,
right: /(&lt;|<)\/\s*style\s*(&gt;|>)/gi
});
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['css'];
SyntaxHighlighter.brushes.CSS = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,55 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' +
'case char class comp const constructor currency destructor div do double ' +
'downto else end except exports extended false file finalization finally ' +
'for function goto if implementation in inherited int64 initialization ' +
'integer interface is label library longint longword mod nil not object ' +
'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' +
'pint64 pointer private procedure program property pshortstring pstring ' +
'pvariant pwidechar pwidestring protected public published raise real real48 ' +
'record repeat set shl shortint shortstring shr single smallint string then ' +
'threadvar to true try type unit until uses val var varirnt while widechar ' +
'widestring with word write writeln xor';
this.regexList = [
{ regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *)
{ regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { }
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags
{ regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345
{ regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['delphi', 'pascal', 'pas'];
SyntaxHighlighter.brushes.Delphi = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,41 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
this.regexList = [
{ regex: /^\+\+\+.*$/gm, css: 'color2' },
{ regex: /^\-\-\-.*$/gm, css: 'color2' },
{ regex: /^\s.*$/gm, css: 'color1' },
{ regex: /^@@.*@@$/gm, css: 'variable' },
{ regex: /^\+[^\+]{1}.*$/gm, css: 'string' },
{ regex: /^\-[^\-]{1}.*$/gm, css: 'comments' }
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['diff', 'patch'];
SyntaxHighlighter.brushes.Diff = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,52 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Jean-Lou Dupont
// http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html
// According to: http://erlang.org/doc/reference_manual/introduction.html#1.5
var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+
'case catch cond div end fun if let not of or orelse '+
'query receive rem try when xor'+
// additional
' module export import define';
this.regexList = [
{ regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' },
{ regex: new RegExp("\\%.+", 'gm'), css: 'comments' },
{ regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' },
{ regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' },
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['erl', 'erlang'];
SyntaxHighlighter.brushes.Erland = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,67 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Andres Almiray
// http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter
var keywords = 'as assert break case catch class continue def default do else extends finally ' +
'if in implements import instanceof interface new package property return switch ' +
'throw throws try while public protected private static';
var types = 'void boolean byte char short int long float double';
var constants = 'null';
var methods = 'allProperties count get size '+
'collect each eachProperty eachPropertyName eachWithIndex find findAll ' +
'findIndexOf grep inject max min reverseEach sort ' +
'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' +
'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' +
'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' +
'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' +
'transformChar transformLine withOutputStream withPrintWriter withStream ' +
'withStreams withWriter withWriterAppend write writeLine '+
'dump inspect invokeMethod print println step times upto use waitForOrKill '+
'getText';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /""".*"""/g, css: 'string' }, // GStrings
{ regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword
{ regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type
{ regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants
{ regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
}
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['groovy'];
SyntaxHighlighter.brushes.Groovy = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,67 @@
/**
* Ini brush for Code Syntax Highlighter http://alexgorbatchev.com/SyntaxHighlighter
* by Boris Guéry, http://borisguery.com
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* Version 2, December 2004
*
* Copyright (C) 2004 Sam Hocevar «sam@hocevar.net»
*
* Everyone is permitted to copy and distribute verbatim or modified
* copies of this license document, and changing it is allowed as long
* as the name is changed.
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
*
* 0. You just DO WHAT THE FUCK YOU WANT TO.
*
*/
// CommonJS
typeof (require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter
: null;
function Brush() {
var keywords = 'false true on off';
this.regexList = [
{
regex : SyntaxHighlighter.regexLib.doubleQuotedString,
css : 'string'
}, // double quoted strings
{
regex : SyntaxHighlighter.regexLib.singleQuotedString,
css : 'string'
}, // single quoted strings
{
regex : /\b[-+]?[0-9]*\.?[0-9]+\b/g,
css : 'number'
}, // numbers (int or float)
{
regex : /;.*/g,
css : 'comments'
},
{
regex : /\[[a-z0-9:\-\s]+\]/gi,
css : 'color3'
},
{
regex: /\w+(\[\])*(?=\s*=)/g,
css: 'variable'
},
{
regex: new RegExp(this.getKeywords(keywords), 'gmi'),
css: 'keyword'
}
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['ini'];
SyntaxHighlighter.brushes.Ini = Brush;
// CommonJS
typeof (exports) != 'undefined' ? exports.Brush = Brush : null;

View File

@ -0,0 +1,52 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var keywords = 'break case catch continue ' +
'default delete do else false ' +
'for function if in instanceof ' +
'new null return super switch ' +
'this throw true try typeof var while with'
;
var r = SyntaxHighlighter.regexLib;
this.regexList = [
{ regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
{ regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
{ regex: r.singleLineCComments, css: 'comments' }, // one line comments
{ regex: r.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
];
this.forHtmlScript(r.scriptScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['js', 'jscript', 'javascript'];
SyntaxHighlighter.brushes.JScript = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,57 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var keywords = 'abstract assert boolean break byte case catch char class const ' +
'continue default do double else enum extends ' +
'false final finally float for goto if implements import ' +
'instanceof int interface long native new null ' +
'package private protected public return ' +
'short static strictfp super switch synchronized this throw throws true ' +
'transient try void volatile while';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
{ regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
{ regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
{ regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
];
this.forHtmlScript({
left : /(&lt;|<)%[@!=]?/g,
right : /%(&gt;|>)/g
});
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['java'];
SyntaxHighlighter.brushes.Java = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,58 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Patrick Webster
// http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html
var datatypes = 'Boolean Byte Character Double Duration '
+ 'Float Integer Long Number Short String Void'
;
var keywords = 'abstract after and as assert at before bind bound break catch class '
+ 'continue def delete else exclusive extends false finally first for from '
+ 'function if import in indexof init insert instanceof into inverse last '
+ 'lazy mixin mod nativearray new not null on or override package postinit '
+ 'protected public public-init public-read replace return reverse sizeof '
+ 'step super then this throw true try tween typeof var where while with '
+ 'attribute let private readonly static trigger'
;
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' },
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' },
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
{ regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers
{ regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['jfx', 'javafx'];
SyntaxHighlighter.brushes.JavaFX = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,72 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by David Simmons-Duffin and Marty Kube
var funcs =
'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' +
'chroot close closedir connect cos crypt defined delete each endgrent ' +
'endhostent endnetent endprotoent endpwent endservent eof exec exists ' +
'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' +
'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' +
'getnetbyname getnetent getpeername getpgrp getppid getpriority ' +
'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' +
'getservbyname getservbyport getservent getsockname getsockopt glob ' +
'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' +
'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' +
'oct open opendir ord pack pipe pop pos print printf prototype push ' +
'quotemeta rand read readdir readline readlink readpipe recv rename ' +
'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' +
'semget semop send setgrent sethostent setnetent setpgrp setpriority ' +
'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' +
'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' +
'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' +
'system syswrite tell telldir time times tr truncate uc ucfirst umask ' +
'undef unlink unpack unshift utime values vec wait waitpid warn write';
var keywords =
'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' +
'for foreach goto if import last local my next no our package redo ref ' +
'require return sub tie tied unless untie until use wantarray while';
this.regexList = [
{ regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' },
{ regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
{ regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' },
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
];
this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
}
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['perl', 'Perl', 'pl'];
SyntaxHighlighter.brushes.Perl = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,88 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var funcs = 'abs acos acosh addcslashes addslashes ' +
'array_change_key_case array_chunk array_combine array_count_values array_diff '+
'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+
'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+
'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+
'array_push array_rand array_reduce array_reverse array_search array_shift '+
'array_slice array_splice array_sum array_udiff array_udiff_assoc '+
'array_udiff_uassoc array_uintersect array_uintersect_assoc '+
'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+
'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+
'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+
'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+
'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+
'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+
'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+
'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+
'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+
'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+
'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+
'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+
'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+
'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+
'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+
'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+
'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+
'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+
'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+
'parse_ini_file parse_str parse_url passthru pathinfo print readlink realpath rewind rewinddir rmdir '+
'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+
'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+
'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+
'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+
'strtoupper strtr strval substr substr_compare';
var keywords = 'abstract and array as break case catch cfunction class clone const continue declare default die do ' +
'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach ' +
'function include include_once global goto if implements interface instanceof namespace new ' +
'old_function or private protected public return require require_once static switch ' +
'throw try use var while xor ';
var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\$\w+/g, css: 'variable' }, // variables
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions
{ regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword
];
this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['php'];
SyntaxHighlighter.brushes.Php = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,33 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['text', 'plain'];
SyntaxHighlighter.brushes.Plain = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,74 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributes by B.v.Zanten, Getronics
// http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro
var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' +
'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' +
'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' +
'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' +
'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' +
'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' +
'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' +
'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' +
'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' +
'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' +
'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' +
'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' +
'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' +
'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' +
'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' +
'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' +
'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' +
'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' +
'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' +
'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' +
'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning';
var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' +
'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' +
'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' +
'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' +
'spps spsv sv tee cat cd cp h history kill lp ls ' +
'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' +
'erase rd ren type % \\?';
this.regexList = [
{ regex: /#.*$/gm, css: 'comments' }, // one line comments
{ regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1
{ regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' },
{ regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' }
];
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['powershell', 'ps'];
SyntaxHighlighter.brushes.PowerShell = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,64 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Gheorghe Milas and Ahmad Sherif
var keywords = 'and assert break class continue def del elif else ' +
'except exec finally for from global if import in is ' +
'lambda not or pass print raise return try yield while';
var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' +
'chr classmethod cmp coerce compile complex delattr dict dir ' +
'divmod enumerate eval execfile file filter float format frozenset ' +
'getattr globals hasattr hash help hex id input int intern ' +
'isinstance issubclass iter len list locals long map max min next ' +
'object oct open ord pow print property range raw_input reduce ' +
'reload repr reversed round set setattr slice sorted staticmethod ' +
'str sum super tuple type type unichr unicode vars xrange zip';
var special = 'None True False self cls class_';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' },
{ regex: /^\s*@\w+/gm, css: 'decorator' },
{ regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' },
{ regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' },
{ regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' },
{ regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' },
{ regex: /\b\d+\.?\w*/g, css: 'value' },
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
{ regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' }
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['py', 'python'];
SyntaxHighlighter.brushes.Python = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

View File

@ -0,0 +1,55 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
// Contributed by Erik Peterson.
var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' +
'END end ensure false for if in module new next nil not or raise redo rescue retry return ' +
'self super then throw true undef unless until when while yield';
var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' +
'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' +
'ThreadGroup Thread Time TrueClass';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants
{ regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols
{ regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['ruby', 'rails', 'ror', 'rb'];
SyntaxHighlighter.brushes.Ruby = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

Some files were not shown because too many files have changed in this diff Show More