css 및 js 호출순서 조정기능 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5785 201d5d3c-b55e-5fd7-737f-ddc643e51545
|
|
@ -1,13 +1,13 @@
|
|||
<!--%import("popup.js")-->
|
||||
<!--%import("../lang")-->
|
||||
|
||||
<div id="popHeadder">
|
||||
<h3>{$component_info->title} ver. {$component_info->version}</h3>
|
||||
<div id="popHeader">
|
||||
<h3 class="xeAdmin">{$component_info->title} ver. {$component_info->version}</h3>
|
||||
</div>
|
||||
|
||||
<form action="./" method="get" onSubmit="return false" id="fo">
|
||||
<div id="popBody">
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<col width="120" />
|
||||
<col />
|
||||
<tr>
|
||||
|
|
@ -34,9 +34,8 @@
|
|||
</table>
|
||||
</div>
|
||||
|
||||
<div id="popFooter" class="tCenter">
|
||||
<a href="#" onclick="insertCode()" class="button"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||
<div id="popFooter">
|
||||
<a href="#" onclick="insertCode()" class="button black strong"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="winopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
BIN
modules/editor/components/code_highlighter/code.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
|
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
/**
|
||||
* @brief Code Highlighter
|
||||
* @class code_highlighter
|
||||
**/
|
||||
|
||||
class code_highlighter extends EditorHandler {
|
||||
|
||||
// editor_sequence 는 에디터에서 필수로 달고 다녀야 함
|
||||
var $editor_sequence = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief editor_sequence과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function code_highlighter($editor_sequence, $component_path) {
|
||||
$this->editor_sequence = $editor_sequence;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다
|
||||
**/
|
||||
function getPopupContent() {
|
||||
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
||||
$tpl_path = $this->component_path.'tpl';
|
||||
$tpl_file = 'popup.html';
|
||||
|
||||
Context::set('tpl_path', $tpl_path);
|
||||
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method
|
||||
*
|
||||
* 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서
|
||||
* DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경
|
||||
**/
|
||||
function transHTML($xml_obj) {
|
||||
$code_type = $xml_obj->attrs->code_type;
|
||||
$option_file_path = $xml_obj->attrs->file_path;
|
||||
$option_description = $xml_obj->attrs->description;
|
||||
$option_first_line = $xml_obj->attrs->first_line;
|
||||
$option_collapse = $xml_obj->attrs->collapse;
|
||||
$option_nogutter = $xml_obj->attrs->nogutter;
|
||||
$option_nocontrols = $xml_obj->attrs->nocontrols;
|
||||
if($option_collapse == 'true') $option = $option.'collapse: true;';
|
||||
if($option_nogutter == 'true') $option = $option.'gutter: false;';
|
||||
if($option_nocontrols == 'true' && $option_collapse != 'true') $option = $option.'toolbar: false;';
|
||||
if($option_first_line > 1) $option = $option."first-line: ".$option_first_line.";";
|
||||
$body = $xml_obj->body;
|
||||
|
||||
|
||||
$body = preg_replace('@(<br\\s?/?>)(\n)?@i' , "\n", $body);
|
||||
$body = strip_tags($body);
|
||||
|
||||
if(!$GLOBALS['_called_editor_component_code_highlighter_']) {
|
||||
$GLOBALS['_called_editor_component_code_highlighter_'] = true;
|
||||
$js_code = <<<dpScript
|
||||
<script type="text/javascript">
|
||||
SyntaxHighlighter.config.clipboardSwf = '{$this->component_path}script/clipboard.swf';
|
||||
SyntaxHighlighter.all();
|
||||
dp.SyntaxHighlighter.HighlightAll('code');
|
||||
</script>
|
||||
dpScript;
|
||||
|
||||
Context::addHtmlFooter($js_code);
|
||||
Context::addCSSFile($this->component_path.'style/shCore.css');
|
||||
Context::addCSSFile($this->component_path.'style/shThemeDefault.css');
|
||||
Context::addJsFile($this->component_path.'script/shCore.js');
|
||||
}
|
||||
|
||||
Context::addJsFile($this->component_path.'script/shBrush'.$code_type.'.js');
|
||||
|
||||
$output = null;
|
||||
if($option_file_path != null || $option_description != null) {
|
||||
$output .= '<div class="ch_infobox">';
|
||||
if($option_file_path != null) $output .= '<span class="file_path">'.$option_file_path.'</span>';
|
||||
if($option_description != null) $output .= '<span class="description">'.$option_description.'</span>';
|
||||
$output .= '</div>';
|
||||
}
|
||||
$output .= sprintf('<pre class="brush: %s;%s">%s</pre>', strtolower($code_type), $option, $body);
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
BIN
modules/editor/components/code_highlighter/component_icon.gif
Normal file
|
After Width: | Height: | Size: 977 B |
BIN
modules/editor/components/code_highlighter/icon.gif
Normal file
|
After Width: | Height: | Size: 2 KiB |
30
modules/editor/components/code_highlighter/info.xml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component version="0.2">
|
||||
<title xml:lang="ko">Code Highlighter</title>
|
||||
<title xml:lang="jp">コードハイライト</title>
|
||||
<title xml:lang="zh-CN">代码高亮显示</title>
|
||||
<title xml:lang="en">Code Highlighter</title>
|
||||
<title xml:lang="es">Código para resaltar</title>
|
||||
<title xml:lang="ru">Подсветка кода</title>
|
||||
<title xml:lang="zh-TW">語法高亮度顯示</title>
|
||||
<description xml:lang="ko">코드를 보기 좋게 출력합니다.</description>
|
||||
<description xml:lang="jp">ソースコードを見やすく表示します。</description>
|
||||
<description xml:lang="en">It displays code in good shape.</description>
|
||||
<description xml:lang="es">Muestra el código en buena forma.</description>
|
||||
<description xml:lang="ru">Компонент служащий для подсветки кода</description>
|
||||
<description xml:lang="zh-CN">高亮显示所选代码。</description>
|
||||
<description xml:lang="zh-TW">將所選取的語法高亮度顯示。</description>
|
||||
<version>0.5</version>
|
||||
<date>2009-01-20</date>
|
||||
<license link="http://creativecommons.org/licenses/LGPL/2.1/">LGPL 2.1</license>
|
||||
|
||||
<author link="http://www.zeroboard.com/">
|
||||
<name xml:lang="ko">XE Open Source Project</name>
|
||||
<name xml:lang="jp">XE Open Source Project</name>
|
||||
<name xml:lang="en">XE Open Source Project</name>
|
||||
<name xml:lang="es">XE Open Source Project</name>
|
||||
<name xml:lang="ru">XE Open Source Project</name>
|
||||
<name xml:lang="zh-CN">XE Open Source Project</name>
|
||||
<name xml:lang="zh-TW">XE Open Source Project</name>
|
||||
</author>
|
||||
</component>
|
||||
13
modules/editor/components/code_highlighter/lang/en.lang.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @author Maslennikov Evgeny aka X-[Vr]bL1s5 | e-mail: x-bliss[a]tut.by; ICQ: 225035467;
|
||||
**/
|
||||
$lang->code_type = 'Code Type';
|
||||
|
||||
$lang->used_collapse = 'Use Folding';
|
||||
$lang->hidden_linenumber = 'Hide Line Number';
|
||||
$lang->hidden_controls = 'Hide Toolbar';
|
||||
|
||||
$lang->file_path = 'File Path';
|
||||
$lang->description = 'Description';
|
||||
$lang->first_line = 'First Line';
|
||||
13
modules/editor/components/code_highlighter/lang/es.lang.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @author Maslennikov Evgeny aka X-[Vr]bL1s5 | e-mail: x-bliss[a]tut.by; ICQ: 225035467;
|
||||
**/
|
||||
$lang->code_type = 'Código Tipo';
|
||||
|
||||
$lang->used_collapse = 'Utilice Folding';
|
||||
$lang->hidden_linenumber = 'Ocultar número de línea';
|
||||
$lang->hidden_controls = 'Ocultar barra de herramientas';
|
||||
|
||||
$lang->file_path = 'Ruta del archivo';
|
||||
$lang->description = 'Descripción';
|
||||
$lang->first_line = 'Primera Línea';
|
||||
13
modules/editor/components/code_highlighter/lang/jp.lang.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @author ミニミ
|
||||
**/
|
||||
$lang->code_type = '言語種類';
|
||||
|
||||
$lang->used_collapse = '折りたたみ機能を使う';
|
||||
$lang->hidden_linenumber = '行番号を隠す';
|
||||
$lang->hidden_controls = 'ツールバーを隠す';
|
||||
|
||||
$lang->file_path = 'ファイルパス';
|
||||
$lang->description = '説明';
|
||||
$lang->first_line = '開始する行番号';
|
||||
13
modules/editor/components/code_highlighter/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @author BNU <bnufactory@gmail.com>
|
||||
**/
|
||||
$lang->code_type = '언어 종류';
|
||||
|
||||
$lang->used_collapse = '접기 기능 사용';
|
||||
$lang->hidden_linenumber = '줄 번호 감추기';
|
||||
$lang->hidden_controls = '도구바 감추기';
|
||||
|
||||
$lang->file_path = '파일경로';
|
||||
$lang->description = '설명';
|
||||
$lang->first_line = '시작 줄 번호';
|
||||
13
modules/editor/components/code_highlighter/lang/ru.lang.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @author Maslennikov Evgeny aka X-[Vr]bL1s5 | e-mail: x-bliss[a]tut.by; ICQ: 225035467;
|
||||
**/
|
||||
$lang->code_type = 'Тип кода';
|
||||
|
||||
$lang->used_collapse = 'Использованное сокращение';
|
||||
$lang->hidden_linenumber = 'Скрытый номер строки';
|
||||
$lang->hidden_controls = 'Скрытый контрол';
|
||||
|
||||
$lang->file_path = 'Путь файла';
|
||||
$lang->description = 'Описание';
|
||||
$lang->first_line = 'Первая строка';
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* @file /modules/editor/components/code_highlighter/lang/ko.lang.php
|
||||
* @author BNU <bnufactory@gamil.com> 翻译:guny
|
||||
* @brief 编辑器(editor) 模块 > 代码高亮显示(code_highlighter)组件简体中文语言包
|
||||
**/
|
||||
$lang->code_type = '语言类型';
|
||||
|
||||
$lang->used_collapse = '使用代码折叠';
|
||||
$lang->hidden_linenumber = '隐藏行号';
|
||||
$lang->hidden_controls = '隐藏工具栏';
|
||||
|
||||
$lang->file_path = '文件路径';
|
||||
$lang->description = '说明';
|
||||
$lang->first_line = '首行行号';
|
||||
?>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @author royallin
|
||||
**/
|
||||
$lang->code_type = '語法類型';
|
||||
|
||||
$lang->used_collapse = '使用收合';
|
||||
$lang->hidden_linenumber = '隱藏行號';
|
||||
$lang->hidden_controls = '隱藏控制';
|
||||
|
||||
$lang->file_path = '檔案路徑';
|
||||
$lang->description = '說明';
|
||||
$lang->first_line = '第一行';
|
||||
BIN
modules/editor/components/code_highlighter/script/clipboard.swf
Normal file
26
modules/editor/components/code_highlighter/script/shBrushAbap.js
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
dp.sh.Brushes.Abap = function()
|
||||
{
|
||||
var datatypes =
|
||||
'ACCP CHAR CLNT CUKY CURR DATS DEC FLTP INT1 INT2 INT4 LANG LCHR LRAW NUMC PREC QUAN RAW RAWSTRING SSTRING STRING TIMS UNIT';
|
||||
|
||||
var keywords =
|
||||
'IF RETURN WHILE CASE DEFAULT DO ELSE FOR ENDIF ELSEIF EQ NOT AND DATA TYPES SELETION-SCREEN PARAMETERS ' +
|
||||
'FIELD-SYMBOLS EXTERN INLINE REPORT WRITE APPEND SELECT ENDSELECT CALL METHOD CALL FUNCTION LOOP ENDLOOP ' +
|
||||
'RAISE READ TABLE CONCATENATE SPLIT SHIFT CONDENSE DESCRIBE CLEAR ENDFUNCTION ASSIGN CREATE DATA TRANSLATE ' +
|
||||
'CONTINUE START-OF-SELECTION AT SELECTION-SCREEN MODIFY CALL SCREEN CREATE OBJECT PERFORM FORM ENDFORM ' +
|
||||
'REUSE_ALV_BLOCK_LIST_INIT ZBCIALV INCLUDE TYPE REF TO TYPE BEGIN\SOF END\SOF LIKE INTO FROM WHERE ORDER BY ' +
|
||||
'WITH KEY INTO STRING SEPARATED BY EXPORTING IMPORTING TO UPPER CASE TO EXCEPTIONS TABLES USING CHANGING';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: new RegExp('^\\*.*$', 'gm'), css: 'comment' }, // one line comments
|
||||
{ regex: new RegExp('\\".*$', 'gm'), css: 'comment' }, // one line comments
|
||||
{ regex: dp.sh.RegexLib.SingleQuotedString, css: 'string' }, // strings
|
||||
{ regex: new RegExp(this.GetKeywords(datatypes), 'gm'), css: 'datatypes' },
|
||||
{ regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' }
|
||||
];
|
||||
|
||||
this.CssClass = 'dp-abap';
|
||||
}
|
||||
|
||||
dp.sh.Brushes.Abap.prototype = new dp.sh.Highlighter();
|
||||
dp.sh.Brushes.Abap.Aliases = ['abap', 'Abap'];
|
||||
51
modules/editor/components/code_highlighter/script/shBrushBash.js
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Bash = function()
|
||||
{
|
||||
var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne gt lt ge le';
|
||||
var commands = 'alias apropos awk 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: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
|
||||
{ regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands
|
||||
];
|
||||
}
|
||||
|
||||
SyntaxHighlighter.brushes.Bash.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Bash.aliases = ['bash', 'shell'];
|
||||
|
||||
56
modules/editor/components/code_highlighter/script/shBrushCSharp.js
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.CSharp = function()
|
||||
{
|
||||
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: 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
|
||||
];
|
||||
|
||||
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.CSharp.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.CSharp.aliases = ['c#', 'c-sharp', 'csharp'];
|
||||
|
||||
91
modules/editor/components/code_highlighter/script/shBrushCpp.js
vendored
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Cpp = function()
|
||||
{
|
||||
// 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' }
|
||||
];
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Cpp.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Cpp.aliases = ['cpp', 'c'];
|
||||
85
modules/editor/components/code_highlighter/script/shBrushCss.js
vendored
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.CSS = function()
|
||||
{
|
||||
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: /(<|<)\s*style.*?(>|>)/gi,
|
||||
right: /(<|<)\/\s*style\s*(>|>)/gi
|
||||
});
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.CSS.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.CSS.aliases = ['css'];
|
||||
49
modules/editor/components/code_highlighter/script/shBrushDelphi.js
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Delphi = function()
|
||||
{
|
||||
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), 'gm'), css: 'keyword' } // keyword
|
||||
];
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Delphi.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Delphi.aliases = ['delphi', 'pascal'];
|
||||
35
modules/editor/components/code_highlighter/script/shBrushDiff.js
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Diff = function()
|
||||
{
|
||||
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' }
|
||||
];
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Diff.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Diff.aliases = ['diff', 'patch'];
|
||||
61
modules/editor/components/code_highlighter/script/shBrushGroovy.js
vendored
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Groovy = function()
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
|
||||
SyntaxHighlighter.brushes.Groovy.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Groovy.aliases = ['groovy'];
|
||||
43
modules/editor/components/code_highlighter/script/shBrushJScript.js
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.JScript = function()
|
||||
{
|
||||
var keywords = 'abstract boolean break byte case catch char class const continue debugger ' +
|
||||
'default delete do double else enum export extends false final finally float ' +
|
||||
'for function goto if implements import in instanceof int interface long native ' +
|
||||
'new null package private protected public return short static super switch ' +
|
||||
'synchronized this throw throws transient true try typeof var void volatile 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: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
|
||||
];
|
||||
|
||||
this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.JScript.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.JScript.aliases = ['js', 'jscript', 'javascript'];
|
||||
47
modules/editor/components/code_highlighter/script/shBrushJava.js
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Java = function()
|
||||
{
|
||||
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: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline 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(SyntaxHighlighter.regexLib.aspScriptTags);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Java.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Java.aliases = ['java'];
|
||||
83
modules/editor/components/code_highlighter/script/shBrushPhp.js
vendored
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Php = function()
|
||||
{
|
||||
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 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 = 'and or xor array as break case ' +
|
||||
'cfunction class const continue declare default die do else ' +
|
||||
'elseif empty enddeclare endfor endforeach endif endswitch endwhile ' +
|
||||
'extends for foreach function include include_once global if ' +
|
||||
'new old_function return static switch use require require_once ' +
|
||||
'var while abstract interface public implements extends private protected throw';
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Php.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Php.aliases = ['php'];
|
||||
27
modules/editor/components/code_highlighter/script/shBrushPlain.js
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Plain = function()
|
||||
{
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Plain.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Plain.aliases = ['text', 'plain'];
|
||||
48
modules/editor/components/code_highlighter/script/shBrushPython.js
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Python = function()
|
||||
{
|
||||
// Contributed by Gheorghe Milas
|
||||
|
||||
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 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(keywords), 'gm'), css: 'keyword' },
|
||||
{ regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' }
|
||||
];
|
||||
|
||||
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Python.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Python.aliases = ['py', 'python'];
|
||||
49
modules/editor/components/code_highlighter/script/shBrushRuby.js
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Ruby = function()
|
||||
{
|
||||
// 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);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Ruby.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Ruby.aliases = ['ruby', 'rails', 'ror'];
|
||||
46
modules/editor/components/code_highlighter/script/shBrushScala.js
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* Code Syntax Highlighter.
|
||||
* Version 1.5.2
|
||||
* Copyright (C) 2004-2008 Alex Gorbatchev
|
||||
* http://www.dreamprojections.com/syntaxhighlighter/
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** Contributed by Yegor Jbanov and David Bernard. */
|
||||
dp.sh.Brushes.Scala = function()
|
||||
{
|
||||
var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' +
|
||||
'override try lazy for var catch throw type extends class while with new final yield abstract ' +
|
||||
'else do if return protected private this package false';
|
||||
|
||||
var keyops = '[_:=><%#@]+';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: dp.sh.RegexLib.SingleLineCComments, css: 'comment' }, // one line comments
|
||||
{ regex: dp.sh.RegexLib.MultiLineCComments, css: 'comment' }, // multiline comments
|
||||
{ regex: new RegExp("(['\"]{3})([^\\1])*?\\1", 'gm'), css: 'string' }, // multi-line strings
|
||||
{ regex: new RegExp('"(?!")(?:\\.|\\\\\\"|[^\\""\\n\\r])*"', 'gm'), css: 'string' }, // double-quoted string
|
||||
{ regex: dp.sh.RegexLib.SingleQuotedString, css: 'string' }, // strings
|
||||
{ regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'number' }, // numbers
|
||||
{ regex: new RegExp(this.GetKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
|
||||
{ regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword
|
||||
];
|
||||
|
||||
this.CssClass = 'dp-j';
|
||||
this.Style = '.dp-j .annotation { color: #646464; }' +
|
||||
'.dp-j .number { color: #C00000; }';
|
||||
}
|
||||
|
||||
dp.sh.Brushes.Scala.prototype = new dp.sh.Highlighter();
|
||||
dp.sh.Brushes.Scala.Aliases = ['scala'];
|
||||
60
modules/editor/components/code_highlighter/script/shBrushSql.js
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Sql = function()
|
||||
{
|
||||
var funcs = 'abs avg case cast coalesce convert count current_timestamp ' +
|
||||
'current_user day isnull left lower month nullif replace right ' +
|
||||
'session_user space substring sum system_user upper user year';
|
||||
|
||||
var keywords = 'absolute action add after alter as asc at authorization begin bigint ' +
|
||||
'binary bit by cascade char character check checkpoint close collate ' +
|
||||
'column commit committed connect connection constraint contains continue ' +
|
||||
'create cube current current_date current_time cursor database date ' +
|
||||
'deallocate dec decimal declare default delete desc distinct double drop ' +
|
||||
'dynamic else end end-exec escape except exec execute false fetch first ' +
|
||||
'float for force foreign forward free from full function global goto grant ' +
|
||||
'group grouping having hour ignore index inner insensitive insert instead ' +
|
||||
'int integer intersect into is isolation key last level load local max min ' +
|
||||
'minute modify move name national nchar next no numeric of off on only ' +
|
||||
'open option order out output partial password precision prepare primary ' +
|
||||
'prior privileges procedure public read real references relative repeatable ' +
|
||||
'restrict return returns revoke rollback rollup rows rule schema scroll ' +
|
||||
'second section select sequence serializable set size smallint static ' +
|
||||
'statistics table temp temporary then time timestamp to top transaction ' +
|
||||
'translation trigger true truncate uncommitted union unique update values ' +
|
||||
'varchar varying view when where with work';
|
||||
|
||||
var operators = 'all and any between cross in join like not null or outer some';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
|
||||
{ regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
|
||||
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions
|
||||
{ regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
|
||||
];
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Sql.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Sql.aliases = ['sql'];
|
||||
|
||||
50
modules/editor/components/code_highlighter/script/shBrushVb.js
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Vb = function()
|
||||
{
|
||||
var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' +
|
||||
'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' +
|
||||
'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' +
|
||||
'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' +
|
||||
'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' +
|
||||
'Function Get GetType GoSub GoTo Handles If Implements Imports In ' +
|
||||
'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' +
|
||||
'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' +
|
||||
'NotInheritable NotOverridable Object On Option Optional Or OrElse ' +
|
||||
'Overloads Overridable Overrides ParamArray Preserve Private Property ' +
|
||||
'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' +
|
||||
'Return Select Set Shadows Shared Short Single Static Step Stop String ' +
|
||||
'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' +
|
||||
'Variant When While With WithEvents WriteOnly Xor';
|
||||
|
||||
this.regexList = [
|
||||
{ regex: /'.*$/gm, css: 'comments' }, // one line comments
|
||||
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
|
||||
{ regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
|
||||
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword
|
||||
];
|
||||
|
||||
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Vb.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Vb.aliases = ['vb', 'vbnet'];
|
||||
63
modules/editor/components/code_highlighter/script/shBrushXml.js
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
SyntaxHighlighter.brushes.Xml = function()
|
||||
{
|
||||
function process(match, regexInfo)
|
||||
{
|
||||
var constructor = SyntaxHighlighter.Match,
|
||||
code = match[0],
|
||||
tag = new XRegExp('(<|<)[\\s\\/\\?]*(?<name>[:\\w-\\.]+)', 'xg').exec(code),
|
||||
result = []
|
||||
;
|
||||
|
||||
if (match.attributes != null)
|
||||
{
|
||||
var attributes,
|
||||
regex = new XRegExp('(?<name> [\\w:\\-\\.]+)' +
|
||||
'\\s*=\\s*' +
|
||||
'(?<value> ".*?"|\'.*?\'|\\w+)',
|
||||
'xg');
|
||||
|
||||
while ((attributes = regex.exec(code)) != null)
|
||||
{
|
||||
result.push(new constructor(attributes.name, match.index + attributes.index, 'color1'));
|
||||
result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string'));
|
||||
}
|
||||
}
|
||||
|
||||
if (tag != null)
|
||||
result.push(
|
||||
new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword')
|
||||
);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
this.regexList = [
|
||||
{ regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // <![ ... [ ... ]]>
|
||||
{ regex: new XRegExp('(\\<|<)!--\\s*.*?\\s*--(\\>|>)', 'gm'), css: 'comments' }, // <!-- ... -->
|
||||
{ regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?<attributes>.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process }
|
||||
];
|
||||
};
|
||||
|
||||
SyntaxHighlighter.brushes.Xml.prototype = new SyntaxHighlighter.Highlighter();
|
||||
SyntaxHighlighter.brushes.Xml.aliases = ['xml', 'xhtml', 'xslt', 'html', 'xhtml'];
|
||||
22
modules/editor/components/code_highlighter/script/shCore.js
vendored
Normal file
|
|
@ -0,0 +1,310 @@
|
|||
.dp-highlighter
|
||||
{
|
||||
font-family: "Consolas", "Courier New", "Courier", "mono", "serif";
|
||||
font-size: 12px;
|
||||
background-color: #E7E5DC;
|
||||
width: 99%;
|
||||
overflow: auto;
|
||||
padding-top: 1px; /* adds a little border on top when controls are hidden */
|
||||
}
|
||||
|
||||
/* clear styles */
|
||||
.dp-highlighter ol,
|
||||
.dp-highlighter ol li,
|
||||
.dp-highlighter ol li span
|
||||
{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dp-highlighter a,
|
||||
.dp-highlighter a:hover
|
||||
{
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.dp-highlighter .bar
|
||||
{
|
||||
padding-left: 45px;
|
||||
}
|
||||
|
||||
.dp-highlighter.collapsed .bar,
|
||||
.dp-highlighter.nogutter .bar
|
||||
{
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.dp-highlighter ol
|
||||
{
|
||||
list-style: decimal; /* for ie */
|
||||
background-color: #fff;
|
||||
margin: 0px 0px 1px 45px !important; /* 1px bottom margin seems to fix occasional Firefox scrolling */
|
||||
padding: 0px;
|
||||
color: #5C5C5C;
|
||||
}
|
||||
|
||||
.dp-highlighter.nogutter ol,
|
||||
.dp-highlighter.nogutter ol li
|
||||
{
|
||||
list-style: none !important;
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
|
||||
.dp-highlighter ol li,
|
||||
.dp-highlighter .columns div
|
||||
{
|
||||
list-style: decimal; /* better look for others, override cascade from OL */
|
||||
list-style-position: outside !important;
|
||||
background-color: #F8F8F8;
|
||||
color: #5C5C5C;
|
||||
padding: 0 3px 0 10px !important;
|
||||
margin: 0 !important;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
.dp-highlighter.nogutter ol li,
|
||||
.dp-highlighter.nogutter .columns div
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.dp-highlighter .columns
|
||||
{
|
||||
background-color: #F8F8F8;
|
||||
color: gray;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dp-highlighter .columns div
|
||||
{
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.dp-highlighter ol li.alt
|
||||
{
|
||||
background-color: #FFF;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.dp-highlighter ol li span
|
||||
{
|
||||
color: black;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
/* Adjust some properties when collapsed */
|
||||
|
||||
.dp-highlighter.collapsed ol
|
||||
{
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.dp-highlighter.collapsed ol li
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Additional modifications when in print-view */
|
||||
|
||||
.dp-highlighter.printing
|
||||
{
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dp-highlighter.printing .tools
|
||||
{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.dp-highlighter.printing li
|
||||
{
|
||||
display: list-item !important;
|
||||
}
|
||||
|
||||
/* Styles for the tools */
|
||||
|
||||
.dp-highlighter .tools
|
||||
{
|
||||
padding: 3px 8px 3px 10px;
|
||||
font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
color: silver;
|
||||
background-color: #f8f8f8;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.dp-highlighter.nogutter .tools
|
||||
{
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
.dp-highlighter.collapsed .tools
|
||||
{
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.dp-highlighter .tools a
|
||||
{
|
||||
font-size: 9px;
|
||||
color: #a0a0a0;
|
||||
background-color: inherit;
|
||||
text-decoration: none;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.dp-highlighter .tools a:hover
|
||||
{
|
||||
color: red;
|
||||
background-color: inherit;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* About dialog styles */
|
||||
|
||||
.dp-about { background-color: #fff; color: #333; margin: 0px; padding: 0px; }
|
||||
.dp-about table { width: 100%; height: 100%; font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; }
|
||||
.dp-about td { padding: 10px; vertical-align: top; }
|
||||
.dp-about .copy { border-bottom: 1px solid #ACA899; height: 95%; }
|
||||
.dp-about .title { color: red; background-color: inherit; font-weight: bold; }
|
||||
.dp-about .para { margin: 0 0 4px 0; }
|
||||
.dp-about .footer { background-color: #ECEADB; color: #333; border-top: 1px solid #fff; text-align: right; }
|
||||
.dp-about .close { font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; background-color: #ECEADB; color: #333; width: 60px; height: 22px; }
|
||||
|
||||
/* Language specific styles */
|
||||
|
||||
.dp-highlighter .comment,
|
||||
.dp-highlighter .comments { color: #008200; background-color: inherit; }
|
||||
.dp-highlighter .string { color: #FF00FF; background-color: inherit; }
|
||||
.dp-highlighter .keyword { color: #0000FF; background-color: inherit; }
|
||||
.dp-highlighter .preprocessor { color: gray; background-color: inherit; }
|
||||
.dp-highlighter .func { color: #FF0000; }
|
||||
.dp-highlighter .vars { color: #008080; }
|
||||
|
||||
|
||||
/* Language specific styles */
|
||||
|
||||
.dp-c {}
|
||||
.dp-c .comment { color: green; }
|
||||
.dp-c .string { color: blue; }
|
||||
.dp-c .preprocessor { color: gray; }
|
||||
.dp-c .keyword { color: blue; }
|
||||
.dp-c .vars { color: #d00; }
|
||||
|
||||
.dp-vb {}
|
||||
.dp-vb .comment { color: green; }
|
||||
.dp-vb .string { color: blue; }
|
||||
.dp-vb .preprocessor { color: gray; }
|
||||
.dp-vb .keyword { color: blue; }
|
||||
|
||||
.dp-sql {}
|
||||
.dp-sql .comment { color: green; }
|
||||
.dp-sql .string { color: red; }
|
||||
.dp-sql .keyword { color: blue; }
|
||||
.dp-sql .func { color: #ff1493; }
|
||||
.dp-sql .op { color: #808080; }
|
||||
|
||||
.dp-xml {}
|
||||
.dp-xml .cdata { color: #ff1493; }
|
||||
.dp-xml .comments { color: green; }
|
||||
.dp-xml .tag { margin: 0; padding: 0; background: none; font-weight: bold; color: blue; }
|
||||
.dp-xml .tag-name { color: black; font-weight: bold; }
|
||||
.dp-xml .attribute { color: red; }
|
||||
.dp-xml .attribute-value { color: blue; }
|
||||
|
||||
.dp-delphi {}
|
||||
.dp-delphi .comment { color: #008200; font-style: italic; }
|
||||
.dp-delphi .string { color: blue; }
|
||||
.dp-delphi .number { color: blue; }
|
||||
.dp-delphi .directive { color: #008284; }
|
||||
.dp-delphi .keyword { font-weight: bold; color: navy; }
|
||||
.dp-delphi .vars { color: #000; }
|
||||
|
||||
.dp-py {}
|
||||
.dp-py .comment { color: green; }
|
||||
.dp-py .string { color: red; }
|
||||
.dp-py .docstring { color: green; }
|
||||
.dp-py .keyword { color: blue; font-weight: bold;}
|
||||
.dp-py .builtins { color: #ff1493; }
|
||||
.dp-py .magicmethods { color: #808080; }
|
||||
.dp-py .exceptions { color: brown; }
|
||||
.dp-py .types { color: brown; font-style: italic; }
|
||||
.dp-py .commonlibs { color: #8A2BE2; font-style: italic; }
|
||||
|
||||
.dp-rb {}
|
||||
.dp-rb .comment { color: #c00; }
|
||||
.dp-rb .string { color: #f0c; }
|
||||
.dp-rb .symbol { color: #02b902; }
|
||||
.dp-rb .keyword { color: #069; }
|
||||
.dp-rb .variable { color: #6cf; }
|
||||
|
||||
.dp-css {}
|
||||
.dp-css .comment { color: green; }
|
||||
.dp-css .string { color: red; }
|
||||
.dp-css .value { color: red; }
|
||||
.dp-css .keyword { color: blue; }
|
||||
.dp-css .colors { color: darkred; }
|
||||
.dp-css .vars { color: #d00; }
|
||||
|
||||
.dp-j {}
|
||||
.dp-j .comment { color: rgb(63,127,95); }
|
||||
.dp-j .string { color: rgb(42,0,255); }
|
||||
.dp-j .keyword { color: rgb(127,0,85); font-weight: bold }
|
||||
.dp-j .annotation { color: #646464; }
|
||||
.dp-j .number { color: #C00000; }
|
||||
|
||||
.dp-cpp {}
|
||||
.dp-cpp .comment { color: #e00; }
|
||||
.dp-cpp .string { color: red; }
|
||||
.dp-cpp .preprocessor { color: #CD00CD; font-weight: bold; }
|
||||
.dp-cpp .keyword { color: #5697D9; font-weight: bold; }
|
||||
.dp-cpp .datatypes { color: #2E8B57; font-weight: bold; }
|
||||
|
||||
.dp-php { color: #800000; }
|
||||
.dp-php .comment { color: #008000; }
|
||||
.dp-php .keyword { color: #4B00FB; }
|
||||
.dp-php .string { color: #FB00FB; }
|
||||
.dp-php .func { color: #FF0000; }
|
||||
.dp-php .vars { color: #008080; }
|
||||
.dp-php .zbxe_funcs { color: #FF6820; }
|
||||
.dp-php .zbxe_class { color: #FF6820; font-weight: bold; }
|
||||
|
||||
|
||||
.dp-abap { color: #800000; }
|
||||
.dp-abap .comment { color: #008000; }
|
||||
.dp-abap .keyword { color: #4B00FB; }
|
||||
.dp-abap .string { color: #FB00FB; }
|
||||
.dp-abap .datatypes { color: #2E8B57; font-weight: bold; }
|
||||
|
||||
|
||||
pre[name='code'] {
|
||||
max-height: 300px;
|
||||
font-size: 1.1em;
|
||||
border: #666666 dotted 1px;
|
||||
border-left: #22AAEE solid 5px;
|
||||
padding: 5px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
|
||||
.ch_infobox {
|
||||
padding: 5px 0;
|
||||
width: 99%;
|
||||
background-color: #F8F8F8;
|
||||
border-top: 1px solid #E7E5DC;
|
||||
}
|
||||
|
||||
.ch_infobox .file_path {
|
||||
font-size: 0.9em;
|
||||
font-weight: bold;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.ch_infobox .description {
|
||||
color: #AAA;
|
||||
font-size: 0.9em;
|
||||
margin-left: 10px;
|
||||
}
|
||||
BIN
modules/editor/components/code_highlighter/style/help.png
Normal file
|
After Width: | Height: | Size: 786 B |
BIN
modules/editor/components/code_highlighter/style/magnifier.png
Normal file
|
After Width: | Height: | Size: 615 B |
|
After Width: | Height: | Size: 603 B |
|
After Width: | Height: | Size: 309 B |
BIN
modules/editor/components/code_highlighter/style/printer.png
Normal file
|
After Width: | Height: | Size: 731 B |
344
modules/editor/components/code_highlighter/style/shCore.css
Normal file
|
|
@ -0,0 +1,344 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
.syntaxhighlighter,
|
||||
.syntaxhighlighter div,
|
||||
.syntaxhighlighter code,
|
||||
.syntaxhighlighter span,
|
||||
.syntaxhighlighter .bold,
|
||||
.syntaxhighlighter .italic,
|
||||
.syntaxhighlighter .line,
|
||||
.syntaxhighlighter .line .number,
|
||||
.syntaxhighlighter .line .content,
|
||||
.syntaxhighlighter .line .content .block,
|
||||
.syntaxhighlighter .line .content .spaces,
|
||||
.syntaxhighlighter .bar,
|
||||
.syntaxhighlighter .ruler,
|
||||
.syntaxhighlighter .toolbar,
|
||||
.syntaxhighlighter .toolbar a,
|
||||
.syntaxhighlighter .toolbar a:hover
|
||||
{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
background: none;
|
||||
text-align: left;
|
||||
float: none;
|
||||
vertical-align: baseline;
|
||||
position: static;
|
||||
left: auto;
|
||||
top: auto;
|
||||
right: auto;
|
||||
bottom: auto;
|
||||
height: auto;
|
||||
width: auto;
|
||||
line-height: normal;
|
||||
font-family: "Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
.syntaxhighlighter
|
||||
{
|
||||
width: 100%;
|
||||
margin: 1em 0 1em 0;
|
||||
padding: 1px; /* adds a little border on top and bottom */
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .line .number
|
||||
{
|
||||
float: left;
|
||||
width: 3em;
|
||||
padding-right: .3em;
|
||||
text-align: right;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Disable numbers when no gutter option is set */
|
||||
.syntaxhighlighter.nogutter .line .number
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .line .content
|
||||
{
|
||||
margin-left: 3.3em;
|
||||
padding-left: .5em;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .line .content .block
|
||||
{
|
||||
display: block;
|
||||
padding-left: 1.5em;
|
||||
text-indent: -1.5em;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .line .content .spaces
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Disable border and margin on the lines when no gutter option is set */
|
||||
.syntaxhighlighter.nogutter .line .content
|
||||
{
|
||||
margin-left: 0;
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .bar
|
||||
{
|
||||
}
|
||||
|
||||
.syntaxhighlighter.collapsed .bar
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
.syntaxhighlighter.nogutter .ruler
|
||||
{
|
||||
margin-left: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .ruler
|
||||
{
|
||||
padding: 0 0 .5em .5em;
|
||||
margin-left: 3.3em;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Adjust some properties when collapsed */
|
||||
|
||||
.syntaxhighlighter.collapsed .lines,
|
||||
.syntaxhighlighter.collapsed .ruler
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Styles for the toolbar */
|
||||
|
||||
.syntaxhighlighter .toolbar
|
||||
{
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
font-size: 1px;
|
||||
padding: 8px 8px 8px 0; /* in px because images don't scale with ems */
|
||||
}
|
||||
|
||||
.syntaxhighlighter.collapsed .toolbar
|
||||
{
|
||||
font-size: 80%;
|
||||
padding: .2em 0 .5em .5em;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar a.item,
|
||||
.syntaxhighlighter .toolbar .item
|
||||
{
|
||||
display: block;
|
||||
float: left;
|
||||
margin-left: 8px;
|
||||
background-repeat: no-repeat;
|
||||
overflow: hidden;
|
||||
text-indent: -5000px;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.collapsed .toolbar .item
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.collapsed .toolbar .item.expandSource
|
||||
{
|
||||
background-image: url(magnifier.png);
|
||||
display: inline;
|
||||
text-indent: 0;
|
||||
width: auto;
|
||||
float: none;
|
||||
height: 16px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar .item.viewSource
|
||||
{
|
||||
background-image: url(page_white_code.png);
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar .item.printSource
|
||||
{
|
||||
background-image: url(printer.png);
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar .item.copyToClipboard
|
||||
{
|
||||
text-indent: 0;
|
||||
background: none;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar .item.about
|
||||
{
|
||||
background-image: url(help.png);
|
||||
}
|
||||
|
||||
/**
|
||||
* Print view.
|
||||
* Colors are based on the default theme without background.
|
||||
*/
|
||||
|
||||
.syntaxhighlighter.printing,
|
||||
.syntaxhighlighter.printing .line.alt1 .content,
|
||||
.syntaxhighlighter.printing .line.alt2 .content,
|
||||
.syntaxhighlighter.printing .line.highlighted .number,
|
||||
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
|
||||
.syntaxhighlighter.printing .line.highlighted.alt2 .content,
|
||||
.syntaxhighlighter.printing .line .content .block
|
||||
{
|
||||
background: none;
|
||||
}
|
||||
|
||||
/* Gutter line numbers */
|
||||
.syntaxhighlighter.printing .line .number
|
||||
{
|
||||
color: #bbb;
|
||||
}
|
||||
|
||||
/* Add border to the lines */
|
||||
.syntaxhighlighter.printing .line .content
|
||||
{
|
||||
color: #000;
|
||||
}
|
||||
|
||||
/* Toolbar when visible */
|
||||
.syntaxhighlighter.printing .toolbar,
|
||||
.syntaxhighlighter.printing .ruler
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing a
|
||||
{
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .plain,
|
||||
.syntaxhighlighter.printing .plain a
|
||||
{
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .comments,
|
||||
.syntaxhighlighter.printing .comments a
|
||||
{
|
||||
color: #008200;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .string,
|
||||
.syntaxhighlighter.printing .string a
|
||||
{
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .keyword
|
||||
{
|
||||
color: #069;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .preprocessor
|
||||
{
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .variable
|
||||
{
|
||||
color: #a70;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .value
|
||||
{
|
||||
color: #090;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .functions
|
||||
{
|
||||
color: #ff1493;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .constants
|
||||
{
|
||||
color: #0066CC;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .script
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .color1,
|
||||
.syntaxhighlighter.printing .color1 a
|
||||
{
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .color2,
|
||||
.syntaxhighlighter.printing .color2 a
|
||||
{
|
||||
color: #ff1493;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .color3,
|
||||
.syntaxhighlighter.printing .color3 a
|
||||
{
|
||||
color: red;
|
||||
}
|
||||
|
||||
.ch_infobox {
|
||||
padding: 5px 0;
|
||||
width: 99%;
|
||||
background-color: #F8F8F8;
|
||||
border-top: 1px solid #E7E5DC;
|
||||
}
|
||||
|
||||
.ch_infobox .file_path {
|
||||
font-size: 0.9em;
|
||||
font-weight: bold;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.ch_infobox .description {
|
||||
color: #AAA;
|
||||
font-size: 0.9em;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
|
@ -0,0 +1,183 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
/************************************
|
||||
* Default Syntax Highlighter theme.
|
||||
*
|
||||
* Interface elements.
|
||||
************************************/
|
||||
|
||||
.syntaxhighlighter
|
||||
{
|
||||
background-color: #E7E5DC;
|
||||
}
|
||||
|
||||
/* Highlighed line number */
|
||||
.syntaxhighlighter .line.highlighted .number
|
||||
{
|
||||
background-color: #6CE26C;
|
||||
color: black;
|
||||
}
|
||||
|
||||
/* Highlighed line */
|
||||
.syntaxhighlighter .line.highlighted.alt1 .content,
|
||||
.syntaxhighlighter .line.highlighted.alt2 .content
|
||||
{
|
||||
background-color: #6CE26C;
|
||||
}
|
||||
|
||||
/* Gutter line numbers */
|
||||
.syntaxhighlighter .line .number
|
||||
{
|
||||
color: #5C5C5C;
|
||||
}
|
||||
|
||||
/* Add border to the lines */
|
||||
.syntaxhighlighter .line .content
|
||||
{
|
||||
border-left: 3px solid #6CE26C;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .line .content
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* First line */
|
||||
.syntaxhighlighter .line.alt1 .content
|
||||
{
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
/* Second line */
|
||||
.syntaxhighlighter .line.alt2 .content
|
||||
{
|
||||
background-color: #F8F8F8;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .line .content .block
|
||||
{
|
||||
background: url(wrapping.png) 0 1.1em no-repeat;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .ruler
|
||||
{
|
||||
color: silver;
|
||||
background-color: #F8F8F8;
|
||||
border-left: 3px solid #6CE26C;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.nogutter .ruler
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar
|
||||
{
|
||||
background-color: #F8F8F8;
|
||||
border: #E7E5DC solid 1px;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar a
|
||||
{
|
||||
color: #a0a0a0;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar a:hover
|
||||
{
|
||||
color: red;
|
||||
}
|
||||
|
||||
/************************************
|
||||
* Actual syntax highlighter colors.
|
||||
************************************/
|
||||
.syntaxhighlighter .plain,
|
||||
.syntaxhighlighter .plain a
|
||||
{
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .comments,
|
||||
.syntaxhighlighter .comments a
|
||||
{
|
||||
color: #008200;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .string,
|
||||
.syntaxhighlighter .string a
|
||||
{
|
||||
color: blue;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .keyword
|
||||
{
|
||||
color: #069;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .preprocessor
|
||||
{
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .variable
|
||||
{
|
||||
color: #a70;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .value
|
||||
{
|
||||
color: #090;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .functions
|
||||
{
|
||||
color: #ff1493;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .constants
|
||||
{
|
||||
color: #0066CC;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .script
|
||||
{
|
||||
background-color: yellow !important;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color1,
|
||||
.syntaxhighlighter .color1 a
|
||||
{
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color2,
|
||||
.syntaxhighlighter .color2 a
|
||||
{
|
||||
color: #ff1493;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color3,
|
||||
.syntaxhighlighter .color3 a
|
||||
{
|
||||
color: red;
|
||||
}
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
/**
|
||||
* Django SyntaxHighlighter theme
|
||||
*/
|
||||
|
||||
/************************************
|
||||
* Interface elements.
|
||||
************************************/
|
||||
|
||||
.syntaxhighlighter
|
||||
{
|
||||
background-color: #0B2F20;
|
||||
}
|
||||
|
||||
/* Highlighed line number */
|
||||
.syntaxhighlighter .line.highlighted .number
|
||||
{
|
||||
background-color: #336442;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Highlighed line */
|
||||
.syntaxhighlighter .line.highlighted .content
|
||||
{
|
||||
background-color: #336442 !important;
|
||||
}
|
||||
|
||||
/* Gutter line numbers */
|
||||
.syntaxhighlighter .line .number
|
||||
{
|
||||
color: #497958;
|
||||
}
|
||||
|
||||
/* Add border to the lines */
|
||||
.syntaxhighlighter .line .content
|
||||
{
|
||||
border-left: 3px solid #41A83E;
|
||||
color: #B9BDB6;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .line .content
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* First line */
|
||||
.syntaxhighlighter .line.alt1 .content
|
||||
{
|
||||
}
|
||||
|
||||
/* Second line */
|
||||
.syntaxhighlighter .line.alt2 .content
|
||||
{
|
||||
background-color: #0a2b1d;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .line .content .block
|
||||
{
|
||||
background: url(wrapping.png) 0 1.1em no-repeat;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .ruler
|
||||
{
|
||||
color: #C4B14A;
|
||||
background-color: #245032;
|
||||
border-left: 3px solid #41A83E;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.nogutter .ruler
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar
|
||||
{
|
||||
background-color: #245032;
|
||||
border: #0B2F20 solid 1px;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar a
|
||||
{
|
||||
color: #C4B14A;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar a:hover
|
||||
{
|
||||
color: #FFE862;
|
||||
}
|
||||
|
||||
/************************************
|
||||
* Actual syntax highlighter colors.
|
||||
************************************/
|
||||
.syntaxhighlighter .plain,
|
||||
.syntaxhighlighter .plain a
|
||||
{
|
||||
color: #F8F8F8;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .comments,
|
||||
.syntaxhighlighter .comments a
|
||||
{
|
||||
color: #336442;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .string,
|
||||
.syntaxhighlighter .string a
|
||||
{
|
||||
color: #9DF39F;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .keyword
|
||||
{
|
||||
color: #96DD3B;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .preprocessor
|
||||
{
|
||||
color: #91BB9E;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .variable
|
||||
{
|
||||
color: #FFAA3E;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .value
|
||||
{
|
||||
color: #F7E741;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .functions
|
||||
{
|
||||
color: #FFAA3E;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .constants
|
||||
{
|
||||
color: #E0E8FF;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .script
|
||||
{
|
||||
background-color: #497958 !important;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color1,
|
||||
.syntaxhighlighter .color1 a
|
||||
{
|
||||
color: #EB939A;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color2,
|
||||
.syntaxhighlighter .color2 a
|
||||
{
|
||||
color: #91BB9E;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color3,
|
||||
.syntaxhighlighter .color3 a
|
||||
{
|
||||
color: #EDEF7D;
|
||||
}
|
||||
|
|
@ -0,0 +1,183 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
/**
|
||||
* Emacs SyntaxHighlighter theme based on theme by Joshua Emmons
|
||||
* http://www.skia.net/
|
||||
*/
|
||||
|
||||
/************************************
|
||||
* Interface elements.
|
||||
************************************/
|
||||
|
||||
.syntaxhighlighter
|
||||
{
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
/* Highlighed line number */
|
||||
.syntaxhighlighter .line.highlighted .number
|
||||
{
|
||||
background-color: #435A5F;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Highlighed line */
|
||||
.syntaxhighlighter .line.highlighted .content
|
||||
{
|
||||
background-color: #435A5F !important;
|
||||
}
|
||||
|
||||
/* Gutter line numbers */
|
||||
.syntaxhighlighter .line .number
|
||||
{
|
||||
color: #D3D3D3;
|
||||
}
|
||||
|
||||
/* Add border to the lines */
|
||||
.syntaxhighlighter .line .content
|
||||
{
|
||||
border-left: 3px solid #990000;
|
||||
color: #B9BDB6;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .line .content
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* First line */
|
||||
.syntaxhighlighter .line.alt1 .content
|
||||
{
|
||||
}
|
||||
|
||||
/* Second line */
|
||||
.syntaxhighlighter .line.alt2 .content
|
||||
{
|
||||
background-color: #0f0f0f;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .line .content .block
|
||||
{
|
||||
background: url(wrapping.png) 0 1.1em no-repeat;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .ruler
|
||||
{
|
||||
color: silver;
|
||||
background-color: #000000;
|
||||
border-left: 3px solid #990000;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.nogutter .ruler
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar
|
||||
{
|
||||
background-color: #000000;
|
||||
border: #000000 solid 1px;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar a
|
||||
{
|
||||
color: #646763;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar a:hover
|
||||
{
|
||||
color: #9CCFF4;
|
||||
}
|
||||
|
||||
/************************************
|
||||
* Actual syntax highlighter colors.
|
||||
************************************/
|
||||
.syntaxhighlighter .plain,
|
||||
.syntaxhighlighter .plain a
|
||||
{
|
||||
color: #D3D3D3;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .comments,
|
||||
.syntaxhighlighter .comments a
|
||||
{
|
||||
color: #FF7D27;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .string,
|
||||
.syntaxhighlighter .string a
|
||||
{
|
||||
color: #FF9E7B;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .keyword
|
||||
{
|
||||
color: #00FFFF;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .preprocessor
|
||||
{
|
||||
color: #AEC4DE;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .variable
|
||||
{
|
||||
color: #FFAA3E;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .value
|
||||
{
|
||||
color: #090;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .functions
|
||||
{
|
||||
color: #81CEF9;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .constants
|
||||
{
|
||||
color: #FF9E7B;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .script
|
||||
{
|
||||
background-color: #990000 !important;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color1,
|
||||
.syntaxhighlighter .color1 a
|
||||
{
|
||||
color: #EBDB8D;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color2,
|
||||
.syntaxhighlighter .color2 a
|
||||
{
|
||||
color: #FF7D27;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color3,
|
||||
.syntaxhighlighter .color3 a
|
||||
{
|
||||
color: #AEC4DE;
|
||||
}
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
/**
|
||||
* Fade to Grey SyntaxHighlighter theme based on theme by Brasten Sager
|
||||
* http://www.ibrasten.com/
|
||||
*/
|
||||
|
||||
/************************************
|
||||
* Interface elements.
|
||||
************************************/
|
||||
|
||||
.syntaxhighlighter
|
||||
{
|
||||
background-color: #121212;
|
||||
}
|
||||
|
||||
/* Highlighed line number */
|
||||
.syntaxhighlighter .line.highlighted .number
|
||||
{
|
||||
background-color: #3A3A00;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Highlighed line */
|
||||
.syntaxhighlighter .line.highlighted .content
|
||||
{
|
||||
background-color: #3A3A00 !important;
|
||||
}
|
||||
|
||||
/* Gutter line numbers */
|
||||
.syntaxhighlighter .line .number
|
||||
{
|
||||
color: #C3C3C3;
|
||||
}
|
||||
|
||||
/* Add border to the lines */
|
||||
.syntaxhighlighter .line .content
|
||||
{
|
||||
border-left: 3px solid #3185B9;
|
||||
color: #B9BDB6;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .line .content
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* First line */
|
||||
.syntaxhighlighter .line.alt1 .content
|
||||
{
|
||||
}
|
||||
|
||||
/* Second line */
|
||||
.syntaxhighlighter .line.alt2 .content
|
||||
{
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .line .content .block
|
||||
{
|
||||
background: url(wrapping.png) 0 1.1em no-repeat;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .ruler
|
||||
{
|
||||
color: silver;
|
||||
border-left: 3px solid #3185B9;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.nogutter .ruler
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar
|
||||
{
|
||||
background-color: #000000;
|
||||
border: #000000 solid 1px;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar a
|
||||
{
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar a:hover
|
||||
{
|
||||
color: #96DAFF;
|
||||
}
|
||||
|
||||
/************************************
|
||||
* Actual syntax highlighter colors.
|
||||
************************************/
|
||||
.syntaxhighlighter .plain,
|
||||
.syntaxhighlighter .plain a
|
||||
{
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .comments,
|
||||
.syntaxhighlighter .comments a
|
||||
{
|
||||
color: #696854;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .string,
|
||||
.syntaxhighlighter .string a
|
||||
{
|
||||
color: #E3E658;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .keyword
|
||||
{
|
||||
color: #D01D33;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .preprocessor
|
||||
{
|
||||
color: #435A5F;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .variable
|
||||
{
|
||||
color: #898989;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .value
|
||||
{
|
||||
color: #090;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .functions
|
||||
{
|
||||
color: #AAAAAA;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .constants
|
||||
{
|
||||
color: #96DAFF;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .script
|
||||
{
|
||||
background-color: #C3C3C3 !important;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color1,
|
||||
.syntaxhighlighter .color1 a
|
||||
{
|
||||
color: #FFC074;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color2,
|
||||
.syntaxhighlighter .color2 a
|
||||
{
|
||||
color: #4A8CDB;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color3,
|
||||
.syntaxhighlighter .color3 a
|
||||
{
|
||||
color: #96DAFF;
|
||||
}
|
||||
|
|
@ -0,0 +1,183 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
/**
|
||||
* Midnight SyntaxHighlighter theme based on theme by J.D. Myers
|
||||
* http://webdesign.lsnjd.com/
|
||||
*/
|
||||
|
||||
/************************************
|
||||
* Interface elements.
|
||||
************************************/
|
||||
|
||||
.syntaxhighlighter
|
||||
{
|
||||
background-color: #0F192A;
|
||||
}
|
||||
|
||||
/* Highlighed line number */
|
||||
.syntaxhighlighter .line.highlighted .number
|
||||
{
|
||||
background-color: #253E5A;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Highlighed line */
|
||||
.syntaxhighlighter .line.highlighted .content
|
||||
{
|
||||
background-color: #253E5A !important;
|
||||
}
|
||||
|
||||
/* Gutter line numbers */
|
||||
.syntaxhighlighter .line .number
|
||||
{
|
||||
color: #38566F;
|
||||
}
|
||||
|
||||
/* Add border to the lines */
|
||||
.syntaxhighlighter .line .content
|
||||
{
|
||||
border-left: 3px solid #435A5F;
|
||||
color: #B9BDB6;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .line .content
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* First line */
|
||||
.syntaxhighlighter .line.alt1 .content
|
||||
{
|
||||
background-color: #0F192A;
|
||||
}
|
||||
|
||||
/* Second line */
|
||||
.syntaxhighlighter .line.alt2 .content
|
||||
{
|
||||
background-color: #0F192A;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .line .content .block
|
||||
{
|
||||
background: url(wrapping.png) 0 1.1em no-repeat;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .ruler
|
||||
{
|
||||
color: #38566F;
|
||||
background-color: #0F192A;
|
||||
border-left: 3px solid #435A5F;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.nogutter .ruler
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar
|
||||
{
|
||||
background-color: #0F192A;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar a
|
||||
{
|
||||
color: #38566F;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar a:hover
|
||||
{
|
||||
color: #8AA6C1;
|
||||
}
|
||||
|
||||
/************************************
|
||||
* Actual syntax highlighter colors.
|
||||
************************************/
|
||||
.syntaxhighlighter .plain,
|
||||
.syntaxhighlighter .plain a
|
||||
{
|
||||
color: #D1EDFF;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .comments,
|
||||
.syntaxhighlighter .comments a
|
||||
{
|
||||
color: #428BDD;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .string,
|
||||
.syntaxhighlighter .string a
|
||||
{
|
||||
color: #1DC116;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .keyword
|
||||
{
|
||||
color: #B43D3D;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .preprocessor
|
||||
{
|
||||
color: #8AA6C1;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .variable
|
||||
{
|
||||
color: #FFAA3E;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .value
|
||||
{
|
||||
color: #F7E741;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .functions
|
||||
{
|
||||
color: #FFAA3E;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .constants
|
||||
{
|
||||
color: #E0E8FF;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .script
|
||||
{
|
||||
background-color: #404040 !important;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color1,
|
||||
.syntaxhighlighter .color1 a
|
||||
{
|
||||
color: #F8BB00;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color2,
|
||||
.syntaxhighlighter .color2 a
|
||||
{
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color3,
|
||||
.syntaxhighlighter .color3 a
|
||||
{
|
||||
color: #FFAA3E;
|
||||
}
|
||||
|
|
@ -0,0 +1,183 @@
|
|||
/**
|
||||
* SyntaxHighlighter
|
||||
* http://alexgorbatchev.com/
|
||||
*
|
||||
* @version
|
||||
* 2.0.287 (February 06 2009)
|
||||
*
|
||||
* @author
|
||||
* Alex Gorbatchev
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2004-2009 Alex Gorbatchev.
|
||||
*
|
||||
* Licensed under a GNU Lesser General Public License.
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
* SyntaxHighlighter is donationware. You are allowed to download, modify and distribute
|
||||
* the source code in accordance with LGPL 2.1 license, however if you want to use
|
||||
* SyntaxHighlighter on your site or include it in your product, you must donate.
|
||||
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
|
||||
*/
|
||||
/**
|
||||
* RDark SyntaxHighlighter theme based on theme by Radu Dineiu
|
||||
* http://www.vim.org/scripts/script.php?script_id=1732
|
||||
*/
|
||||
|
||||
/************************************
|
||||
* Interface elements.
|
||||
************************************/
|
||||
|
||||
.syntaxhighlighter
|
||||
{
|
||||
background-color: #1B2426;
|
||||
}
|
||||
|
||||
/* Highlighed line number */
|
||||
.syntaxhighlighter .line.highlighted .number
|
||||
{
|
||||
background-color: #435A5F;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Highlighed line */
|
||||
.syntaxhighlighter .line.highlighted .content
|
||||
{
|
||||
background-color: #435A5F !important;
|
||||
}
|
||||
|
||||
/* Gutter line numbers */
|
||||
.syntaxhighlighter .line .number
|
||||
{
|
||||
color: #B9BDB6;
|
||||
}
|
||||
|
||||
/* Add border to the lines */
|
||||
.syntaxhighlighter .line .content
|
||||
{
|
||||
border-left: 3px solid #435A5F;
|
||||
color: #B9BDB6;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.printing .line .content
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* First line */
|
||||
.syntaxhighlighter .line.alt1 .content
|
||||
{
|
||||
background-color: #1B2426;
|
||||
}
|
||||
|
||||
/* Second line */
|
||||
.syntaxhighlighter .line.alt2 .content
|
||||
{
|
||||
background-color: #1B2426;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .line .content .block
|
||||
{
|
||||
background: url(wrapping.png) 0 1.1em no-repeat;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .ruler
|
||||
{
|
||||
color: silver;
|
||||
background-color: #1B2426;
|
||||
border-left: 3px solid #435A5F;
|
||||
}
|
||||
|
||||
.syntaxhighlighter.nogutter .ruler
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar
|
||||
{
|
||||
background-color: #1B2426;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar a
|
||||
{
|
||||
color: #646763;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .toolbar a:hover
|
||||
{
|
||||
color: #E0E8FF;
|
||||
}
|
||||
|
||||
/************************************
|
||||
* Actual syntax highlighter colors.
|
||||
************************************/
|
||||
.syntaxhighlighter .plain,
|
||||
.syntaxhighlighter .plain a
|
||||
{
|
||||
color: #B9BDB6;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .comments,
|
||||
.syntaxhighlighter .comments a
|
||||
{
|
||||
color: #878A85;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .string,
|
||||
.syntaxhighlighter .string a
|
||||
{
|
||||
color: #5CE638;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .keyword
|
||||
{
|
||||
color: #5BA1CF;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .preprocessor
|
||||
{
|
||||
color: #435A5F;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .variable
|
||||
{
|
||||
color: #FFAA3E;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .value
|
||||
{
|
||||
color: #090;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .functions
|
||||
{
|
||||
color: #FFAA3E;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .constants
|
||||
{
|
||||
color: #E0E8FF;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .script
|
||||
{
|
||||
background-color: #435A5F !important;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color1,
|
||||
.syntaxhighlighter .color1 a
|
||||
{
|
||||
color: #E0E8FF;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color2,
|
||||
.syntaxhighlighter .color2 a
|
||||
{
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.syntaxhighlighter .color3,
|
||||
.syntaxhighlighter .color3 a
|
||||
{
|
||||
color: #FFAA3E;
|
||||
}
|
||||
BIN
modules/editor/components/code_highlighter/style/wrapping.png
Normal file
|
After Width: | Height: | Size: 631 B |
BIN
modules/editor/components/code_highlighter/tpl/images/blank.gif
Normal file
|
After Width: | Height: | Size: 43 B |
|
After Width: | Height: | Size: 86 B |
|
After Width: | Height: | Size: 79 B |
|
After Width: | Height: | Size: 77 B |
|
After Width: | Height: | Size: 89 B |
24
modules/editor/components/code_highlighter/tpl/popup.css
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
@charset "utf-8";
|
||||
@import url(../../../../../modules/admin/tpl/css/admin.css);
|
||||
|
||||
#folder_area { clear:left; }
|
||||
|
||||
.border_type { float:left; margin-right:1em; width:120px; }
|
||||
|
||||
img.color_icon { width:14px; height:14px; border:1px solid #FFFFFF; }
|
||||
|
||||
img.color_icon_over { width:14px; height:14px; border:1px solid #000000; cursor:pointer; }
|
||||
|
||||
img.border_preview_color { width:30px; height:16px; border:1px solid #EEEEEE; background-color:#88EE22; }
|
||||
|
||||
img.border_preview_none_color { width:30px; height:12px; border:1px solid #EEEEEE; background-color:#FFFFFF; }
|
||||
|
||||
img.bg_preview_color { width:30px; height:16px; border:1px solid #000000; background-color:#FFFFFF; }
|
||||
|
||||
.editor_color_box { clear:both; height:65px; width:400px; border:1px solid #DDDDDD; padding:2px; }
|
||||
|
||||
.editor_link_type { float:left; margin-right:.5em; vertical-align:middle; white-space:nowrap; }
|
||||
|
||||
.editor_color_input { clear:both; }
|
||||
|
||||
li { list-style:none; float:left; margin:5px 10px 0px 0;}
|
||||
77
modules/editor/components/code_highlighter/tpl/popup.html
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<!--%import("popup.js")-->
|
||||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
|
||||
<div id="popHeader" class="wide">
|
||||
<h3 class="xeAdmin">{$component_info->title} ver. {$component_info->version}</h3>
|
||||
</div>
|
||||
|
||||
<form action="./" method="get" onSubmit="return false" id="fo">
|
||||
<div id="popBody">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<col width="150" />
|
||||
<col />
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->code_type}</div></th>
|
||||
<td>
|
||||
<select id="code_type" name="code_type">
|
||||
<option value="Php">PHP</option>
|
||||
<option value="Xml">HTML/XML</option>
|
||||
<option value="Css">CSS</option>
|
||||
<option value="JScript">Javascript</option>
|
||||
<option value="Plain">Plain Text</option>
|
||||
<option value="Diff">Diff</option>
|
||||
<option value="Cpp">C++</option>
|
||||
<option value="CSharp">C#</option>
|
||||
<option value="Vb">Visual Basic</option>
|
||||
<option value="Java">Java</option>
|
||||
<option value="Delphi">Delphi</option>
|
||||
<option value="Python">Python</option>
|
||||
<option value="Ruby">Ruby</option>
|
||||
<option value="Sql">SQL</option>
|
||||
<option value="Abap">Abap</option>
|
||||
<option value="Bash">Bash/shell</option>
|
||||
<option value="Groovy">Groovy</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->file_path}</div></th>
|
||||
<td>
|
||||
<input type="text" id="file_path" name="file_path" class="inputTypeText w400" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->description}</div></th>
|
||||
<td>
|
||||
<input type="text" id="description" name="description" class="inputTypeText w400" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->first_line}</div></th>
|
||||
<td>
|
||||
<input type="text" id="first_line" name="first_line" value="1" class="inputTypeText w40" />
|
||||
<input type="checkbox" id="nogutter" name="nogutter" value="Y" /> <label for="nogutter">{$lang->hidden_linenumber}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->used_collapse}</div></th>
|
||||
<td>
|
||||
<input type="checkbox" id="collapse" name="collapse" value="Y" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->hidden_controls}</div></th>
|
||||
<td>
|
||||
<input type="checkbox" id="nocontrols" name="nocontrols" value="Y" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="popFooter">
|
||||
<a href="#" onclick="insertCode()" class="button black strong"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="winopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
78
modules/editor/components/code_highlighter/tpl/popup.js
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
/**
|
||||
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 멀티미디어 컴포넌트 코드를 체크하여
|
||||
* 있으면 가져와서 원하는 곳에 삽입
|
||||
**/
|
||||
var selected_node = null;
|
||||
function getCode() {
|
||||
// 부모 위지윅 에디터에서 선택된 영역이 있는지 확인
|
||||
if(typeof(opener)=='undefined') return;
|
||||
|
||||
var node = opener.editorPrevNode;
|
||||
if(!node || node.nodeName != 'DIV') return;
|
||||
|
||||
selected_node = node;
|
||||
|
||||
var code_type = node.getAttribute('code_type');
|
||||
var file_path = node.getAttribute('file_path');
|
||||
var description = node.getAttribute('description');
|
||||
var first_line = node.getAttribute('first_line');
|
||||
var collapse = node.getAttribute('collapse');
|
||||
var nogutter = node.getAttribute('nogutter');
|
||||
var nocontrols = node.getAttribute('nocontrols');
|
||||
|
||||
jQuery('#code_type').val(code_type);
|
||||
jQuery('#file_path').val(file_path);
|
||||
jQuery('#description').val(description);
|
||||
if(!first_line) jQuery('#first_line').val('1');
|
||||
else jQuery('#first_line').val(first_line);
|
||||
if(collapse == 'Y' || collapse == 'true') jQuery('#collapse').attr('checked', true);
|
||||
if(nogutter == 'Y' || nogutter == 'true') jQuery('#nogutter').attr('checked', true);
|
||||
if(nocontrols == 'Y' || nocontrols == 'true') jQuery('#nocontrols').attr('checked', true);
|
||||
}
|
||||
|
||||
/* 추가 버튼 클릭시 부모창의 위지윅 에디터에 인용구 추가 */
|
||||
function insertCode() {
|
||||
if(typeof(opener)=='undefined') return;
|
||||
|
||||
var code_type = jQuery('#code_type').val();
|
||||
var file_path = jQuery('#file_path').val();
|
||||
var description = jQuery('#description').val();
|
||||
var first_line = jQuery('#first_line').val();
|
||||
var collapse = jQuery('#collapse').attr('checked');
|
||||
var nogutter = jQuery('#nogutter').attr('checked');
|
||||
var nocontrols = jQuery('#nocontrols').attr('checked');
|
||||
|
||||
var content = '';
|
||||
if(selected_node) content = jQuery(selected_node).html();
|
||||
else content = opener.editorGetSelectedHtml(opener.editorPrevSrl);
|
||||
|
||||
var style = "border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;";
|
||||
|
||||
if(!content) content = " ";
|
||||
|
||||
var text = '<div editor_component="code_highlighter" code_type="'+code_type+'" file_path="'+file_path+'" description="'+description+'" first_line="'+first_line+'" collapse="'+collapse+'" nogutter="'+nogutter+'" nocontrols="'+nocontrols+'" style="'+style+'">'+content+'</div>'+"<br />";
|
||||
|
||||
if(selected_node) {
|
||||
selected_node.setAttribute('code_type', code_type);
|
||||
selected_node.setAttribute('file_path', file_path);
|
||||
selected_node.setAttribute('description', description);
|
||||
selected_node.setAttribute('first_line', first_line);
|
||||
selected_node.setAttribute("collapse", collapse);
|
||||
selected_node.setAttribute('nogutter', nogutter);
|
||||
selected_node.setAttribute('nocontrols', nocontrols);
|
||||
selected_node.setAttribute('style', style);
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
} else {
|
||||
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
|
||||
opener.editorReplaceHTML(iframe_obj, text);
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
}
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
||||
jQuery(getCode);
|
||||
|
||||
|
|
@ -4,6 +4,6 @@
|
|||
|
||||
img.emoticon { margin:10px; cursor:pointer; }
|
||||
|
||||
.emoticonList { position:absolute; top:20px; _top:17px; right:20px; }
|
||||
*:first-child+html .emoticonList { top:15px; }
|
||||
.emoticonList { position:absolute; top:9px; right:30px; }
|
||||
*:first-child+html .emoticonList { top:9px; }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<!--%import("popup.js")-->
|
||||
<!--%import("popup.css")-->
|
||||
|
||||
<div id="popHeadder">
|
||||
<h3>
|
||||
<div id="popHeader" class="wide">
|
||||
<h3 class="xeAdmin">
|
||||
{$component_info->title} ver. {$component_info->version}
|
||||
</h3>
|
||||
</div>
|
||||
|
|
@ -21,7 +21,3 @@
|
|||
<!--@end-->
|
||||
|
||||
</div>
|
||||
|
||||
<div id="popFooter" class="tCenter">
|
||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
|
||||
<div id="popHeadder">
|
||||
<h3>{$component_info->title} ver. {$component_info->version}</h3>
|
||||
<div id="popHeader">
|
||||
<h3 class="xeAdmin">{$component_info->title} ver. {$component_info->version}</h3>
|
||||
</div>
|
||||
|
||||
<form action="./" method="get" onSubmit="return false" id="fo">
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<div id="popBody">
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<col width="120" />
|
||||
<col />
|
||||
<tr>
|
||||
|
|
@ -80,9 +80,8 @@
|
|||
</table>
|
||||
</div>
|
||||
|
||||
<div id="popFooter" class="tCenter">
|
||||
<a href="#" onclick="insertSlideShow()" class="button"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||
<div id="popFooter">
|
||||
<a href="#" onclick="insertSlideShow()" class="button black strong"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="winopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,10 @@
|
|||
$lang->image_align_middle = "居中";
|
||||
$lang->image_align_right = "内容右侧";
|
||||
$lang->image_border = "边框粗细";
|
||||
$lang->urllink_url = "URL";
|
||||
$lang->image_margin = 'Image Margin';
|
||||
$lang->image_margin = '外边距';
|
||||
|
||||
$lang->urllink_open_window = '新窗口打开';
|
||||
$lang->about_url_link_open_window = "将在新窗口中打开链接。";
|
||||
|
||||
$lang->cmd_get_scale = "获得图片大小";
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* @file /modules/editor/components/image_link/lang/zh-TW.lang.php
|
||||
* @author zero <zero@nzeo.com> 翻譯:royallin
|
||||
* @brief 網頁編輯器(editor) 模組 > 圖片連結(image_link) 組件的語言
|
||||
* @brief 網頁編輯器(editor)模組 > 圖片連結(image_link)組件語言
|
||||
**/
|
||||
|
||||
$lang->image_url = "圖片路徑";
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
$lang->image_align_right = "靠右";
|
||||
$lang->image_border = "邊框粗細";
|
||||
$lang->urllink_url = "網址";
|
||||
$lang->image_margin = 'Image Margin';
|
||||
$lang->image_margin = '圖片邊距';
|
||||
|
||||
$lang->about_url_link_open_window = "開啟連結於新視窗。";
|
||||
$lang->cmd_get_scale = "取得圖片大小";
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
|
||||
<div id="popHeadder">
|
||||
<h3>{$component_info->title} ver. {$component_info->version}</h3>
|
||||
<div id="popHeader">
|
||||
<h3 class="xeAdmin">{$component_info->title} ver. {$component_info->version}</h3>
|
||||
</div>
|
||||
|
||||
<form action="./" method="get" onSubmit="return false" id="fo">
|
||||
|
||||
<div id="popBody">
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<col width="100" />
|
||||
<col />
|
||||
|
||||
|
|
@ -86,8 +86,7 @@
|
|||
</table>
|
||||
</div>
|
||||
<div id="popFooter" class="tCenter">
|
||||
<a href="#" onclick="insertImage()" class="button"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||
<a href="#" onclick="insertImage()" class="button black strong"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="winopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
|
||||
<div id="popHeadder">
|
||||
<h3>{$component_info->title} ver. {$component_info->version}</h3>
|
||||
<div id="popHeader">
|
||||
<h3 class="xeAdmin">{$component_info->title} ver. {$component_info->version}</h3>
|
||||
</div>
|
||||
|
||||
<form action="./" method="get" onSubmit="return false" id="fo">
|
||||
<div id="popBody">
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<col width="150" />
|
||||
<col />
|
||||
<tr>
|
||||
|
|
@ -33,9 +33,8 @@
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="popFooter" class="tCenter">
|
||||
<a href="#" onclick="insertMultimedia()" class="button"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||
<div id="popFooter">
|
||||
<a href="#" onclick="insertMultimedia()" class="button black strong"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="winopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,48 +1,57 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component version="0.2">
|
||||
<title xml:lang="ko">네이버맵 연동</title>
|
||||
<title xml:lang="jp">ネイバーマップ連動</title>
|
||||
<title xml:lang="zh-CN">NAVER 地图</title>
|
||||
<title xml:lang="en">Naver Map Open Api</title>
|
||||
<title xml:lang="es">Naver mapa abierto api</title>
|
||||
<title xml:lang="ru">Открытые API карт Naver</title>
|
||||
<title xml:lang="zh-TW">NAVER 地圖 Open API</title>
|
||||
<description xml:lang="ko">네이버에서 제공하는 네이버 지도 open api를 이용하여 에디터에 원하는 곳의 지도를 추가하거나 수정할 수 있습니다.\n네이버 지도 open api키를 발급 받아서 등록을 해주셔야 정상적인 사용이 가능합니다.</description>
|
||||
<description xml:lang="jp">ネイバーから提供されるネイバーマップのOpenAPIを利用してエディターに表示したい地図を追加したり、修正したりすることができます。ネイバーマップは、OpenAPIキーを取得して登録すれば使用することができます。</description>
|
||||
<description xml:lang="zh-CN">naver提供的naver地图,利用open api在编辑器里添加或修改您所需要的地图。\n为了使用naver地图首先要取得open api key,然后登录此key才可正常使用。</description>
|
||||
<description xml:lang="en">You can add a map to the editor or modify it by using Naver Map open api provided by Naver.\nYou would be able to use it when you register Naver Map api key after you get it from http://www.naver.com.</description>
|
||||
<description xml:lang="es">Puede poner un mapa para el editor o modificarlo utilizando Naver Mapa abierta api proporcionada por Naver. \ NSe se podrá hacer uso del mismo cuando se registra Naver Mapa api clave se obtiene después de http://www.naver.com .</description>
|
||||
<description xml:lang="ru">Вы можете добавить карту в редактор или изменить ее, используя Naver Map open api, предлагаемые Naver.\nВы сможете использовать это после регистрации ключа Naver Map API, полученного с http://www.naver.com.</description>
|
||||
<description xml:lang="zh-TW">naver所提供的地圖,利用Open API在編輯器中,新增或修改成您所需要的地圖。\n使用 naver地圖要先獲得 Open API key,然後登錄 key才能正常使用。</description>
|
||||
<version>0.1</version>
|
||||
<date>2007-02-28</date>
|
||||
|
||||
<author email_address="zero@zeroboard.com" link="http://blog.nzeo.com">
|
||||
<name xml:lang="ko">zero</name>
|
||||
<name xml:lang="jp">zero</name>
|
||||
<name xml:lang="zh-CN">zero</name>
|
||||
<name xml:lang="en">zero</name>
|
||||
<name xml:lang="es">zero</name>
|
||||
<name xml:lang="ru">zero</name>
|
||||
<name xml:lang="zh-TW">zero</name>
|
||||
</author>
|
||||
|
||||
<extra_vars>
|
||||
<var name="api_key">
|
||||
<title xml:lang="ko">네이버지도 api key</title>
|
||||
<title xml:lang="jp">ネイバーマップAPIキー</title>
|
||||
<title xml:lang="zh-CN">naver地图 api key</title>
|
||||
<title xml:lang="en">Naver Map api key</title>
|
||||
<title xml:lang="es">Naver Map api key</title>
|
||||
<title xml:lang="ru">Naver Map API Ключ</title>
|
||||
<title xml:lang="zh-TW">naver地圖 API key</title>
|
||||
<description xml:lang="ko">http://www.naver.com/ 에서 네이버 지도 API key를 발급 받으신 후 입력해주세요.</description>
|
||||
<description xml:lang="jp">http://www.naver.com/ からネイバーマップのAPIキーを取得してから入力してください。</description>
|
||||
<description xml:lang="zh-CN">在http://www.naver.com/ 取得naver地图 API key后输入。</description>
|
||||
<description xml:lang="en">Please get Naver Map API key from http://www.naver.com first and then input the key.</description>
|
||||
<description xml:lang="es">Por favor Naver Mapa clave de la API de http://www.naver.com primero y luego ingrese la clave.</description>
|
||||
<description xml:lang="ru">Пожалуйста, получите ключ Naver Map API с http://www.naver.com и введите его.</description>
|
||||
<description xml:lang="zh-TW">先在 http://www.naver.com/ 網址取得 naver地圖 API key之後輸入。</description>
|
||||
</var>
|
||||
</extra_vars>
|
||||
</component>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component version="0.2">
|
||||
<title xml:lang="ko">네이버맵 연동</title>
|
||||
<title xml:lang="jp">ネイバーマップ連動</title>
|
||||
<title xml:lang="zh-CN">NAVER 地图</title>
|
||||
<title xml:lang="en">Naver Map Open Api</title>
|
||||
<title xml:lang="es">Naver mapa abierto api</title>
|
||||
<title xml:lang="ru">Открытые API карт Naver</title>
|
||||
<title xml:lang="zh-TW">NAVER 地圖 Open API</title>
|
||||
<description xml:lang="ko">네이버에서 제공하는 네이버 지도 open api를 이용하여 에디터에 원하는 곳의 지도를 추가하거나 수정할 수 있습니다.\n네이버 지도 open api키를 발급 받아서 등록을 해주셔야 정상적인 사용이 가능합니다.</description>
|
||||
<description xml:lang="jp">ネイバーから提供されるネイバーマップのOpenAPIを利用してエディターに表示したい地図を追加したり、修正したりすることができます。ネイバーマップは、OpenAPIキーを取得して登録すれば使用することができます。</description>
|
||||
<description xml:lang="zh-CN">naver提供的naver地图,利用open api在编辑器里添加或修改您所需要的地图。\n为了使用naver地图首先要取得open api key,然后登录此key才可正常使用。</description>
|
||||
<description xml:lang="en">You can add a map to the editor or modify it by using Naver Map open api provided by Naver.\nYou would be able to use it when you register Naver Map api key after you get it from http://www.naver.com.</description>
|
||||
<description xml:lang="es">Puede poner un mapa para el editor o modificarlo utilizando Naver Mapa abierta api proporcionada por Naver. \ NSe se podrá hacer uso del mismo cuando se registra Naver Mapa api clave se obtiene después de http://www.naver.com .</description>
|
||||
<description xml:lang="ru">Вы можете добавить карту в редактор или изменить ее, используя Naver Map open api, предлагаемые Naver.\nВы сможете использовать это после регистрации ключа Naver Map API, полученного с http://www.naver.com.</description>
|
||||
<description xml:lang="zh-TW">naver所提供的地圖,利用Open API在編輯器中,新增或修改成您所需要的地圖。\n使用 naver地圖要先獲得 Open API key,然後登錄 key才能正常使用。</description>
|
||||
<version>0.1</version>
|
||||
<date>2009-02-23</date>
|
||||
|
||||
<author email_address="zero@zeroboard.com" link="http://blog.nzeo.com">
|
||||
<name xml:lang="ko">zero</name>
|
||||
<name xml:lang="jp">zero</name>
|
||||
<name xml:lang="zh-CN">zero</name>
|
||||
<name xml:lang="en">zero</name>
|
||||
<name xml:lang="es">zero</name>
|
||||
<name xml:lang="ru">zero</name>
|
||||
<name xml:lang="zh-TW">zero</name>
|
||||
</author>
|
||||
<author email_address="misol221@paran.com" link="http://www.imsoo.net">
|
||||
<name xml:lang="ko">misol</name>
|
||||
<name xml:lang="jp">misol</name>
|
||||
<name xml:lang="zh-CN">misol</name>
|
||||
<name xml:lang="en">misol</name>
|
||||
<name xml:lang="es">misol</name>
|
||||
<name xml:lang="ru">misol</name>
|
||||
<name xml:lang="zh-TW">misol</name>
|
||||
</author>
|
||||
|
||||
<extra_vars>
|
||||
<var name="api_key">
|
||||
<title xml:lang="ko">네이버지도 api key</title>
|
||||
<title xml:lang="jp">ネイバーマップAPIキー</title>
|
||||
<title xml:lang="zh-CN">naver地图 api key</title>
|
||||
<title xml:lang="en">Naver Map api key</title>
|
||||
<title xml:lang="es">Naver Map api key</title>
|
||||
<title xml:lang="ru">Naver Map API Ключ</title>
|
||||
<title xml:lang="zh-TW">naver地圖 API key</title>
|
||||
<description xml:lang="ko">http://www.naver.com/ 에서 네이버 지도 API key를 발급 받으신 후 입력해주세요.</description>
|
||||
<description xml:lang="jp">http://www.naver.com/ からネイバーマップのAPIキーを取得してから入力してください。</description>
|
||||
<description xml:lang="zh-CN">在http://www.naver.com/ 取得naver地图 API key后输入。</description>
|
||||
<description xml:lang="en">Please get Naver Map API key from http://www.naver.com first and then input the key.</description>
|
||||
<description xml:lang="es">Por favor Naver Mapa clave de la API de http://www.naver.com primero y luego ingrese la clave.</description>
|
||||
<description xml:lang="ru">Пожалуйста, получите ключ Naver Map API с http://www.naver.com и введите его.</description>
|
||||
<description xml:lang="zh-TW">先在 http://www.naver.com/ 網址取得 naver地圖 API key之後輸入。</description>
|
||||
</var>
|
||||
</extra_vars>
|
||||
</component>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
function naver_map($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
$this->component_path = $component_path;
|
||||
Context::loadLang($component_path.'lang');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -48,7 +49,8 @@
|
|||
Context::loadLang($this->component_path."lang");
|
||||
|
||||
// 지정된 서버에 요청을 시도한다
|
||||
$query_string = iconv("UTF-8","EUC-KR",sprintf('/api/geocode.php?key=%s&query=%s', $this->api_key, $address));
|
||||
$address = urlencode(iconv("UTF-8","EUC-KR",$address));
|
||||
$query_string = sprintf('/api/geocode.php?key=%s&query=%s', $this->api_key, $address);
|
||||
|
||||
$fp = fsockopen('maps.naver.com', 80, $errno, $errstr);
|
||||
if(!$fp) return new Object(-1, 'msg_fail_to_socket_open');
|
||||
|
|
@ -71,6 +73,10 @@
|
|||
$oXmlParser = new XmlParser();
|
||||
$xml_doc = $oXmlParser->parse($buff);
|
||||
|
||||
//If a Naver OpenApi Error message exists.
|
||||
if($xml_doc->error->error_code->body || $xml_doc->error->message->body) return new Object(-1, 'NAVER OpenAPI Error'."\n".'Code : '.$xml_doc->error->error_code->body."\n".'Message : '.$xml_doc->error->message->body);
|
||||
|
||||
if($xml_doc->geocode->total->body == 0) return new Object(-1,'msg_no_result');
|
||||
$addrs = $xml_doc->geocode->item;
|
||||
if(!is_array($addrs)) $addrs = array($addrs);
|
||||
$addrs_count = count($addrs);
|
||||
|
|
@ -99,6 +105,7 @@
|
|||
function transHTML($xml_obj) {
|
||||
$x = $xml_obj->attrs->x;
|
||||
$y = $xml_obj->attrs->y;
|
||||
$zoom = $xml_obj->attrs->zoom;
|
||||
$marker = urlencode($xml_obj->attrs->marker);
|
||||
$style = $xml_obj->attrs->style;
|
||||
|
||||
|
|
@ -108,7 +115,7 @@
|
|||
if(!$width) $width = 400;
|
||||
if(!$height) $height = 400;
|
||||
|
||||
$body_code = sprintf('<div style="width:%dpx;height:%dpx;margin-bottom:5px;"><iframe src="%s?module=editor&act=procEditorCall&method=displayMap&component=naver_map&width=%d&height=%d&x=%f&y=%f&marker=%s" frameBorder="0" style="padding:1px; border:1px solid #AAAAAA;width:%dpx;height:%dpx;margin:0px;"></iframe></div>', $width, $height, Context::getRequestUri(), $width, $height, $x, $y, $marker, $width, $height);
|
||||
$body_code = sprintf('<div style="width:%dpx;height:%dpx;margin-bottom:5px;"><iframe src="%s?module=editor&act=procEditorCall&method=displayMap&component=naver_map&width=%d&height=%d&x=%f&y=%f&zoom=%d&marker=%s" frameBorder="0" style="padding:1px; border:1px solid #AAAAAA;width:%dpx;height:%dpx;margin:0px;"></iframe></div>', $width, $height, Context::getRequestUri(), $width, $height, $x, $y, $zoom, $marker, $width, $height);
|
||||
return $body_code;
|
||||
}
|
||||
|
||||
|
|
@ -131,17 +138,21 @@
|
|||
if(!$y) $y = 529730;
|
||||
settype($y,"int");
|
||||
|
||||
$zoom = Context::get('zoom');
|
||||
if(!$zoom) $zoom = 3;
|
||||
settype($zoom,"int");
|
||||
|
||||
$marker = Context::get('marker');
|
||||
|
||||
$html = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'.
|
||||
'<html>'.
|
||||
'<head>'.
|
||||
'<title></title>'.
|
||||
'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'.
|
||||
'<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'.
|
||||
'<script type="text/javascript" src="./common/js/x.js"></script>'.
|
||||
'<script type="text/javascript" src="http://maps.naver.com/js/naverMap.naver?key='.$this->api_key.'"></script>'.
|
||||
'<script type="text/javascript">'.
|
||||
'function moveMap(x,y,scale) {mapObj.setCenterAndZoom(new NPoint(x,y),scale);}'.
|
||||
'function moveMap(x,y,scale) { mapObj.setCenterAndZoom(new NPoint(x,y),scale); }'.
|
||||
'function createMarker(pos) { if(typeof(top.addMarker)=="function") { if(!top.addMarker(pos)) return; var iconUrl = "http://static.naver.com/local/map_img/set/icos_free_"+String.fromCharCode(96+top.marker_count-1)+".gif"; var marker = new NMark(pos,new NIcon(iconUrl,new NSize(15,14))); mapObj.addOverlay(marker); } }'.
|
||||
'</script>'.
|
||||
'</head>'.
|
||||
|
|
@ -156,9 +167,9 @@
|
|||
'var infowin = new NInfoWindow();'.
|
||||
'mapObj.addOverlay(infowin);'.
|
||||
'NEvent.addListener(mapObj,"click",createMarker);'.
|
||||
'';
|
||||
"\n";
|
||||
|
||||
if($x&&$y) $html .= 'mapObj.setCenterAndZoom(new NPoint('.$x.','.$y.'),3);';
|
||||
if($x&&$y) $html .= 'mapObj.setCenterAndZoom(new NPoint('.$x.','.$y.'),'.$zoom.');';
|
||||
|
||||
if($marker) {
|
||||
$marker_list = explode('|@|', $marker);
|
||||
|
|
@ -167,6 +178,7 @@
|
|||
$marker_list[$i] = explode(',', $marker_list[$i]);
|
||||
settype($marker_list[$i][0],"int");
|
||||
settype($marker_list[$i][1],"int");
|
||||
if(!$marker_list[$i][0] || !$marker_list[$i][1]) continue;
|
||||
$marker_list[$i] = $marker_list[$i][0].','.$marker_list[$i][1];
|
||||
$pos = trim($marker_list[$i]);
|
||||
if(!$pos) continue;
|
||||
|
|
@ -178,8 +190,6 @@
|
|||
|
||||
$html .= ''.
|
||||
//'mapObj.enableWheelZoom();'.
|
||||
'NEvent.addListener(mapObj, "click", function(pos) { if(typeof(top.mapClicked)!="undefined") top.mapClicked(pos); });'.
|
||||
'NEvent.addListener(mapObj, "mouseup", function(pos) { if(typeof(top.mapClicked)!="undefined") top.mapClicked(pos); });'.
|
||||
'</script>'.
|
||||
'</body>'.
|
||||
'</html>';
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
#address { width:100px; }
|
||||
.about_address { clear:both; color:#DDDDDD; }
|
||||
|
||||
.address_list_box { color:#AAAAAA; margin-top:1em; clear:both;}
|
||||
.address_list_box { color:#AAAAAA; margin-top:1em; clear:both; padding:5px; }
|
||||
.address_list_box a { color:#AAAAAA; }
|
||||
.address_lists { list-style:none; }
|
||||
|
||||
#display_map { width:400px; height:400px; border:0px; border:1px solid #DDDDDD; margin-left:10px; }
|
||||
#display_map { width:400px; height:300px; border:1px solid #DDDDDD; }
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
<!--%import("popup.js")-->
|
||||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
|
||||
<div id="popHeadder">
|
||||
<h3>{$component_info->title} ver. {$component_info->version}</h3>
|
||||
<div id="popHeader">
|
||||
<h3 class="xeAdmin">{$component_info->title} ver. {$component_info->version}</h3>
|
||||
</div>
|
||||
|
||||
<div id="popBody">
|
||||
|
||||
<table border="0">
|
||||
<table border="0" class="colTable">
|
||||
<col width="190" />
|
||||
<col />
|
||||
<tr valign="top">
|
||||
|
|
@ -19,21 +17,21 @@
|
|||
<input type="hidden" id="map_y" name="x" value="" />
|
||||
<input type="hidden" id="marker" name="marker_1" value="" />
|
||||
|
||||
<table border="0">
|
||||
<table border="0" class="rowTable">
|
||||
<tr>
|
||||
<td><input type="text" class="inputTypeText" id="address" value="" /></td>
|
||||
<td><span class="button"><input type="submit" value="{$lang->cmd_search}" /></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="about_address">{$lang->about_address}</div>
|
||||
<p class="summary">{$lang->about_address}</p>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="address_list_box" id="address_list">{$lang->about_address_use}</div>
|
||||
|
||||
<table cellspacing="0" class="tableType5 gap1">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->map_width}</div></th>
|
||||
<td><input type="text" class="inputTypeText" size="3" id="map_width" value="400" />px</td>
|
||||
|
|
@ -44,14 +42,13 @@
|
|||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<iframe name="display_map" id="display_map" frameBorder="0" src="./?module=editor&component=naver_map&act=procEditorCall&method=displayMap&width=400&height=400"></iframe>
|
||||
<iframe name="display_map" id="display_map" frameBorder="0" src="./?module=editor&component=naver_map&act=procEditorCall&method=displayMap&width=400&height=300"></iframe>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="popFooter" class="tCenter">
|
||||
<a href="#" onclick="insertNaverMap()" class="button"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||
<a href="#" onclick="insertNaverMap()" class="button black strong"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="winopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -14,11 +14,15 @@ function getNaverMap() {
|
|||
var width = xWidth(node);
|
||||
var height = xHeight(node);
|
||||
var address = node.getAttribute("address");
|
||||
var zoom = node.getAttribute("zoom");
|
||||
|
||||
if(x&&y) {
|
||||
xGetElementById("map_x").value = x;
|
||||
xGetElementById("map_y").value = y;
|
||||
moveMap(x,y,3);
|
||||
if(zoom) {
|
||||
moveMap(x,y,zoom);
|
||||
}
|
||||
else {
|
||||
moveMap(x,y,3);
|
||||
}
|
||||
}
|
||||
if(address) {
|
||||
xGetElementById("address").value = address;
|
||||
|
|
@ -32,15 +36,16 @@ function getNaverMap() {
|
|||
function insertNaverMap(obj) {
|
||||
if(typeof(opener)=="undefined") return;
|
||||
|
||||
var x = xGetElementById("map_x").value;
|
||||
var y = xGetElementById("map_y").value;
|
||||
var x = display_map.mapObj.getCenter().x;
|
||||
var y = display_map.mapObj.getCenter().y;
|
||||
var marker = xGetElementById("marker").value;
|
||||
var address = xGetElementById("address").value;
|
||||
var zoom = display_map.mapObj.getZoom();
|
||||
|
||||
var width = xGetElementById("map_width").value;
|
||||
var height = xGetElementById("map_height").value;
|
||||
|
||||
var text = "<img src=\"./common/tpl/images/blank.gif\" editor_component=\"naver_map\" address=\""+address+"\" x=\""+x+"\" y=\""+y+"\" width=\""+width+"\" height=\""+height+"\" style=\"width:"+width+"px;height:"+height+"px;border:2px dotted #3CBC2f;background:url(./modules/editor/components/naver_map/tpl/navermap_component.gif) no-repeat center;\" marker=\""+marker+"\" />";
|
||||
var text = "<img src=\"./common/tpl/images/blank.gif\" editor_component=\"naver_map\" address=\""+address+"\" x=\""+x+"\" y=\""+y+"\" zoom=\""+zoom+"\" width=\""+width+"\" height=\""+height+"\" style=\"width:"+width+"px;height:"+height+"px;border:2px dotted #3CBC2f;background:url(./modules/editor/components/naver_map/tpl/navermap_component.gif) no-repeat center;\" marker=\""+marker+"\" />";
|
||||
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
|
|
@ -52,8 +57,6 @@ function insertNaverMap(obj) {
|
|||
window.close();
|
||||
}
|
||||
|
||||
xAddEventListener(window, "load", getNaverMap);
|
||||
|
||||
/* 네이버의 map openapi로 주소에 따른 좌표를 요청 */
|
||||
function search_address(selected_address) {
|
||||
if(typeof(selected_address)=="undefined") selected_address = null;
|
||||
|
|
@ -73,11 +76,6 @@ function moveMap(x,y,scale) {
|
|||
display_map.moveMap(x,y,scale);
|
||||
}
|
||||
|
||||
function mapClicked(pos) {
|
||||
xGetElementById("map_x").value = pos.x;
|
||||
xGetElementById("map_y").value = pos.y;
|
||||
}
|
||||
|
||||
var naver_address_list = new Array();
|
||||
function complete_search_address(ret_obj, response_tags, selected_address) {
|
||||
var address_list = ret_obj['address_list'];
|
||||
|
|
@ -91,7 +89,7 @@ function complete_search_address(ret_obj, response_tags, selected_address) {
|
|||
var item = address_list[i].split(",");
|
||||
|
||||
naver_address_list[naver_address_list.length] = item;
|
||||
html += "<a href='#' onclick=\"moveMap('"+item[0]+"','"+item[1]+"');return false;\">"+item[2]+"</a><br />";
|
||||
html += "<li class=\"address_lists\"><a href='#' onclick=\"moveMap('"+item[0]+"','"+item[1]+"');return false;\">"+item[2]+"</a></li>";
|
||||
}
|
||||
|
||||
var list_zone = xGetElementById("address_list");
|
||||
|
|
@ -106,3 +104,4 @@ function addMarker(pos) {
|
|||
marker_count++;
|
||||
return true;
|
||||
}
|
||||
xAddEventListener(window, "load", getNaverMap);
|
||||
|
|
|
|||
|
|
@ -17,3 +17,4 @@ li a { text-decoration:none; color:#666666;}
|
|||
|
||||
#popFooter .fl { margin-left:10px; }
|
||||
#popFooter .fr { margin-right:10px; }
|
||||
.poll_box { margin-bottom:15px; }
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
var msg_poll_cannot_modify = "{$lang->msg_poll_cannot_modify}";
|
||||
</script>
|
||||
|
||||
<div id="popHeadder">
|
||||
<h3>{$component_info->title} ver. {$component_info->version}</h3>
|
||||
<div id="popHeader" class="wide">
|
||||
<h3 class="xeAdmin">{$component_info->title} ver. {$component_info->version}</h3>
|
||||
</div>
|
||||
|
||||
<form action="./" method="post" id="fo_component" onSubmit="procFilter(this, insert_poll); return false;">
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<div id="popBody">
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<col width="100" />
|
||||
<col />
|
||||
<tr>
|
||||
|
|
@ -59,12 +59,15 @@
|
|||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div><label>{$lang->poll_chk_count}</label></div></th>
|
||||
<td><input type="text" name="checkcount_tidx" value="1" size="1" class="inputTypeText" /></td>
|
||||
</table>
|
||||
|
||||
<div id="poll_source" class="clear" style="display:none">
|
||||
<div class="clear"></div>
|
||||
|
||||
<table cellspacing="0" class="adminTable gap1">
|
||||
<table cellspacing="0" class="rowTable gap1">
|
||||
<col width="100" />
|
||||
<col />
|
||||
<tr>
|
||||
|
|
@ -83,30 +86,16 @@
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="pollButton clear">
|
||||
<div class="fl">
|
||||
<label>{$lang->poll_chk_count}</label>
|
||||
<input type="text" name="checkcount_tidx" value="1" size="1" class="inputTypeText" />
|
||||
</div>
|
||||
<div class="fr">
|
||||
<a href="#" onclick="doPollDelete(this); return false;" class="delPoll">{$lang->cmd_del_poll}</a> |
|
||||
<a href="#" onclick="doPollAddItem(this); return false;">{$lang->cmd_add_item}</a>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<a href="#" onclick="doPollAddItem(this); return false;" class="button black small"><span>{$lang->cmd_add_item}</span></a>
|
||||
<a href="#" onclick="doPollDelete(this); return false;" class="button red small"><span>{$lang->cmd_del_poll}</span></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="popFooter" class="tCenter clear">
|
||||
<div class="fl">
|
||||
<a href="#" onclick="doPollAdd(); return false;" class="button"><span>{$lang->cmd_add_poll}</span></a>
|
||||
</div>
|
||||
<div class="fr">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_submit}" /></span>
|
||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||
<div id="popFooter">
|
||||
<span class="button black strong"><input type="submit" value="{$lang->cmd_submit}" /></span>
|
||||
<a href="#" onclick="doPollAdd(); return false;" class="button blue"><span>{$lang->cmd_add_poll}</span></a>
|
||||
<a href="#" onclick="winopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,8 @@ function doPollAdd() {
|
|||
* 항목 삭제
|
||||
**/
|
||||
function doPollDelete(obj) {
|
||||
var pobj = obj.parentNode.parentNode.parentNode;
|
||||
var pobj = xPrevSib(xPrevSib(obj)).lastChild.lastChild;
|
||||
if(!pobj || typeof(pobj.id)=='undefined') return;
|
||||
var tmp_arr = pobj.id.split('_');
|
||||
var index = tmp_arr[1];
|
||||
if(index==1) return;
|
||||
|
|
@ -106,7 +107,7 @@ function doPollDelete(obj) {
|
|||
* 새 항목 추가
|
||||
**/
|
||||
function doPollAddItem(obj) {
|
||||
var tbl = xPrevSib(obj.parentNode.parentNode);
|
||||
var tbl = xPrevSib(obj);
|
||||
var tbody = tbl.lastChild;
|
||||
var tmp = tbody.firstChild;
|
||||
var source = null;
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
|
||||
<div id="popHeadder">
|
||||
<h3>{$component_info->title} ver. {$component_info->version}</h3>
|
||||
<div id="popHeader">
|
||||
<h3 class="xeAdmin">{$component_info->title} ver. {$component_info->version}</h3>
|
||||
</div>
|
||||
|
||||
<form action="./" method="get" onSubmit="return false" id="fo">
|
||||
<div id="popBody">
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<col width="120" />
|
||||
<col />
|
||||
<col />
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
<input type="checkbox" id="quotation_use" value="Y" onclick="toggle_folder(this)" />
|
||||
|
||||
<div id="folder_area" style="display:none">
|
||||
<table cellspacing="0" class="adminTable gap1">
|
||||
<table cellspacing="0" class="colTable gap1">
|
||||
<col width="150" />
|
||||
<col />
|
||||
<tr>
|
||||
|
|
@ -142,9 +142,8 @@
|
|||
</table>
|
||||
</div>
|
||||
|
||||
<div id="popFooter" class="tCenter">
|
||||
<a href="#" onclick="insertQuotation()" class="button"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||
<div id="popFooter">
|
||||
<a href="#" onclick="insertQuotation()" class="button black strong"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="winopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
|
||||
<div id="popHeadder">
|
||||
<h3>{$component_info->title} ver. {$component_info->version}</h3>
|
||||
<div id="popHeader">
|
||||
<h3 class="xeAdmin">{$component_info->title} ver. {$component_info->version}</h3>
|
||||
</div>
|
||||
|
||||
<form action="./" method="get" onSubmit="return false" id="fo">
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<div id="table_attribute" style="display:none">
|
||||
<div class="" id="col_row_area" style="display:none" >
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<col width="25%" />
|
||||
<col width="25%" />
|
||||
<col width="25%" />
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
</table>
|
||||
</div>
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<col width="25%" />
|
||||
<col />
|
||||
<tr>
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
</div>
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<col width="25%" />
|
||||
<col width="25%" />
|
||||
<col width="25%" />
|
||||
|
|
@ -130,9 +130,8 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div id="popFooter" class="tCenter">
|
||||
<a href="#" onclick="insertTable()" class="button"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||
<div id="popFooter">
|
||||
<a href="#" onclick="insertTable()" class="button black strong"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="winopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
|
||||
<div id="popHeadder">
|
||||
<h3>{$component_info->title} ver. {$component_info->version}</h3>
|
||||
<div id="popHeader">
|
||||
<h3 class="xeAdmin">{$component_info->title} ver. {$component_info->version}</h3>
|
||||
</div>
|
||||
|
||||
<form action="./" method="get" id="fo_component" onSubmit="return false">
|
||||
|
||||
<div id="popBody">
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<table cellspacing="0" class="rowTable">
|
||||
<col width="100" />
|
||||
<col />
|
||||
|
||||
|
|
@ -56,9 +56,8 @@
|
|||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="popFooter" class="tCenter">
|
||||
<a href="#" onclick="setText()" class="button"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||
<div id="popFooter">
|
||||
<a href="#" onclick="setText()" class="button black strong"><span>{$lang->cmd_insert}</span></a>
|
||||
<a href="#" onclick="winopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<module>
|
||||
<grants />
|
||||
<permissions />
|
||||
<actions>
|
||||
<action name="dispEditorPopup" type="view" standalone="true" />
|
||||
<action name="dispEditorComponentInfo" type="view" standalone="true" />
|
||||
|
|
|
|||
|
|
@ -17,11 +17,18 @@
|
|||
* @brief 컴포넌트의 활성화
|
||||
**/
|
||||
function procEditorAdminEnableComponent() {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
$args->component_name = Context::get('component_name');
|
||||
$args->enabled = 'Y';
|
||||
$output = executeQuery('editor.updateComponent', $args);
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
|
||||
else $output = executeQuery('editor.updateSiteComponent', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$oEditorController = &getController('editor');
|
||||
$oEditorController->removeCache($args->site_srl);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
|
|
@ -29,11 +36,18 @@
|
|||
* @brief 컴포넌트의 비활성화
|
||||
**/
|
||||
function procEditorAdminDisableComponent() {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
$args->component_name = Context::get('component_name');
|
||||
$args->enabled = 'N';
|
||||
$output = executeQuery('editor.updateComponent', $args);
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
|
||||
else $output = executeQuery('editor.updateSiteComponent', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$oEditorController = &getController('editor');
|
||||
$oEditorController->removeCache($args->site_srl);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
|
|
@ -41,11 +55,15 @@
|
|||
* @brief 컴포넌트의 위치 변경
|
||||
**/
|
||||
function procEditorAdminMoveListOrder() {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
$args->component_name = Context::get('component_name');
|
||||
$mode = Context::get('mode');
|
||||
|
||||
// DB에서 전체 목록 가져옴
|
||||
$output = executeQuery('editor.getComponentList', $args);
|
||||
if(!$args->site_srl) $output = executeQuery('editor.getComponentList', $args);
|
||||
else $output = executeQuery('editor.getSiteComponentList', $args);
|
||||
|
||||
$db_list = $output->data;
|
||||
foreach($db_list as $key => $val) {
|
||||
if($val->component_name == $args->component_name) break;
|
||||
|
|
@ -56,23 +74,36 @@
|
|||
|
||||
$prev_args->component_name = $db_list[$key-1]->component_name;
|
||||
$prev_args->list_order = $db_list[$key]->list_order;
|
||||
executeQuery('editor.updateComponent', $prev_args);
|
||||
$prev_args->site_srl = $args->site_srl;
|
||||
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $prev_args);
|
||||
else $output = executeQuery('editor.updateSiteComponent', $prev_args);
|
||||
|
||||
$cur_args->component_name = $db_list[$key]->component_name;
|
||||
$cur_args->list_order = $db_list[$key-1]->list_order;
|
||||
executeQuery('editor.updateComponent', $cur_args);
|
||||
if($prev_args->list_order == $cur_args->list_order) $cur_args->list_order--;
|
||||
$cur_args->site_srl = $args->site_srl;
|
||||
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $cur_args);
|
||||
else $output = executeQuery('editor.updateSiteComponent', $cur_args);
|
||||
} else {
|
||||
if($key == count($db_list)-1) return new Object(-1,'msg_component_is_last_order');
|
||||
|
||||
$next_args->component_name = $db_list[$key+1]->component_name;
|
||||
$next_args->list_order = $db_list[$key]->list_order;
|
||||
executeQuery('editor.updateComponent', $next_args);
|
||||
$next_args->site_srl = $args->site_srl;
|
||||
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $next_args);
|
||||
else $output = executeQuery('editor.updateSiteComponent', $next_args);
|
||||
|
||||
$cur_args->component_name = $db_list[$key]->component_name;
|
||||
$cur_args->list_order = $db_list[$key+1]->list_order;
|
||||
executeQuery('editor.updateComponent', $cur_args);
|
||||
$cur_args->site_srl = $args->site_srl;
|
||||
if($next_args->list_order == $cur_args->list_order) $cur_args->list_order++;
|
||||
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $cur_args);
|
||||
else $output = executeQuery('editor.updateSiteComponent', $cur_args);
|
||||
}
|
||||
|
||||
$oEditorController = &getController('editor');
|
||||
$oEditorController->removeCache($args->site_srl);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
|
|
@ -80,6 +111,8 @@
|
|||
* @brief 컴포넌트 설정
|
||||
**/
|
||||
function procEditorAdminSetupComponent() {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
$component_name = Context::get('component_name');
|
||||
$extra_vars = Context::getRequestVars();
|
||||
unset($extra_vars->component_name);
|
||||
|
|
@ -92,30 +125,41 @@
|
|||
|
||||
$args->component_name = $component_name;
|
||||
$args->extra_vars = serialize($extra_vars);
|
||||
$args->site_srl = (int)$site_module_info->site_srl;
|
||||
|
||||
$output = executeQuery('editor.updateComponent', $args);
|
||||
if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
|
||||
else $output = executeQuery('editor.updateSiteComponent', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$oEditorController = &getController('editor');
|
||||
$oEditorController->removeCache($args->site_srl);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 컴포넌트를 DB에 추가
|
||||
**/
|
||||
function insertComponent($component_name, $enabled = false) {
|
||||
function insertComponent($component_name, $enabled = false, $site_srl = 0) {
|
||||
if($enabled) $enabled = 'Y';
|
||||
else $enabled = 'N';
|
||||
|
||||
$args->component_name = $component_name;
|
||||
$args->enabled = $enabled;
|
||||
$args->site_srl = $site_srl;
|
||||
|
||||
// 컴포넌트가 있는지 확인
|
||||
$output = executeQuery('editor.isComponentInserted', $args);
|
||||
if(!$site_srl) $output = executeQuery('editor.isComponentInserted', $args);
|
||||
else $output = executeQuery('editor.isSiteComponentInserted', $args);
|
||||
if($output->data->count) return new Object(-1, 'msg_component_is_not_founded');
|
||||
|
||||
// 입력
|
||||
$args->list_order = getNextSequence();
|
||||
$output = executeQuery('editor.insertComponent', $args);
|
||||
if(!$site_srl) $output = executeQuery('editor.insertComponent', $args);
|
||||
else $output = executeQuery('editor.insertSiteComponent', $args);
|
||||
|
||||
$oEditorController = &getController('editor');
|
||||
$oEditorController->removeCache($site_srl);
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,12 @@
|
|||
* 에디터 컴포넌트의 on/off 및 설정을 담당
|
||||
**/
|
||||
function dispEditorAdminIndex() {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = (int)$site_module_info->site_srl;
|
||||
|
||||
// 컴포넌트의 종류를 구해옴
|
||||
$oEditorModel = &getModel('editor');
|
||||
$component_list = $oEditorModel->getComponentList(false);
|
||||
$component_list = $oEditorModel->getComponentList(false, $site_srl);
|
||||
|
||||
Context::set('component_list', $component_list);
|
||||
|
||||
|
|
@ -32,28 +35,32 @@
|
|||
* @brief 컴퍼넌트 setup
|
||||
**/
|
||||
function dispEditorAdminSetupComponent() {
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = (int)$site_module_info->site_srl;
|
||||
|
||||
$component_name = Context::get('component_name');
|
||||
|
||||
// 에디터 컴포넌트의 정보를 구함
|
||||
$oEditorModel = &getModel('editor');
|
||||
$component = $oEditorModel->getComponent($component_name);
|
||||
$component = $oEditorModel->getComponent($component_name,$site_srl);
|
||||
Context::set('component', $component);
|
||||
|
||||
// 그룹 설정을 위한 그룹 목록을 구함
|
||||
$oMemberModel = &getModel('member');
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
$group_list = $oMemberModel->getGroups($site_srl);
|
||||
Context::set('group_list', $group_list);
|
||||
|
||||
// mid 목록을 가져옴
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
// 모듈 카테고리 목록을 구함
|
||||
$module_categories = $oModuleModel->getModuleCategories();
|
||||
|
||||
$mid_list = $oModuleModel->getMidList();
|
||||
$args->site_srl = $site_srl;
|
||||
$mid_list = $oModuleModel->getMidList($args);
|
||||
|
||||
// module_category와 module의 조합
|
||||
if($module_categories) {
|
||||
if(!$args->site_srl) {
|
||||
// 모듈 카테고리 목록을 구함
|
||||
$module_categories = $oModuleModel->getModuleCategories();
|
||||
|
||||
foreach($mid_list as $module_srl => $module) {
|
||||
$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@
|
|||
function moduleInstall() {
|
||||
// action forward에 등록 (관리자 모드에서 사용하기 위함)
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertActionForward('editor', 'view', 'dispEditorAdminIndex');
|
||||
$oModuleController->insertActionForward('editor', 'view', 'dispEditorAdminSetupComponent');
|
||||
|
||||
// 기본 에디터 컴포넌트를 추가
|
||||
$oEditorController = &getAdminController('editor');
|
||||
|
|
@ -85,39 +83,5 @@
|
|||
// 에디터 컴포넌트 캐시 파일 삭제
|
||||
FileHandler::removeFilesInDir("./files/cache/editor");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 권한 체크를 실행하는 method
|
||||
* 모듈 객체가 생성된 경우는 직접 권한을 체크하지만 기능성 모듈등 스스로 객체를 생성하지 않는 모듈들의 경우에는
|
||||
* ModuleObject에서 직접 method를 호출하여 권한을 확인함
|
||||
*
|
||||
* isAdminGrant는 관리권한 이양시에만 사용되도록 하고 기본은 false로 return 되도록 하여 잘못된 권한 취약점이 생기지 않도록 주의하여야 함
|
||||
**/
|
||||
function isAdmin() {
|
||||
// 로그인이 되어 있지 않으면 무조건 return false
|
||||
$is_logged = Context::get('is_logged');
|
||||
if(!$is_logged) return false;
|
||||
|
||||
// 사용자 아이디를 구함
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// 모듈 요청에 사용된 변수들을 가져옴
|
||||
$args = Context::getRequestVars();
|
||||
|
||||
// act의 값에 따라서 관리 권한 체크
|
||||
switch($args->act) {
|
||||
case 'procEditorAdminInsertModuleConfig' :
|
||||
if(!$args->target_module_srl) return false;
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->target_module_srl);
|
||||
if(!$module_info) return false;
|
||||
|
||||
if($oModuleModel->isModuleAdmin($module_info, $logged_info)) return true;
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -171,5 +171,134 @@
|
|||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 가상 사이트에서 사용된 에디터 컴포넌트 정보를 제거
|
||||
**/
|
||||
function removeEditorConfig($site_srl) {
|
||||
$args->site_srl = $site_srl;
|
||||
executeQuery('editor.deleteSiteComponent', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 에디터 컴포넌트 목록 캐싱 (editorModel::getComponentList)
|
||||
* 에디터 컴포넌트 목록의 경우 DB query + Xml Parsing 때문에 캐싱 파일을 이용하도록 함
|
||||
**/
|
||||
function makeCache($filter_enabled = true, $site_srl) {
|
||||
$oEditorModel = &getModel('editor');
|
||||
|
||||
if($filter_enabled) $args->enabled = "Y";
|
||||
|
||||
if($site_srl) {
|
||||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('editor.getSiteComponentList', $args);
|
||||
} else $output = executeQuery('editor.getComponentList', $args);
|
||||
$db_list = $output->data;
|
||||
|
||||
// 파일목록을 구함
|
||||
$downloaded_list = FileHandler::readDir(_XE_PATH_.'modules/editor/components');
|
||||
|
||||
// 로그인 여부 및 소속 그룹 구함
|
||||
$is_logged = Context::get('is_logged');
|
||||
if($is_logged) {
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->group_list && is_array($logged_info->group_list)) {
|
||||
$group_list = array_keys($logged_info->group_list);
|
||||
} else $group_list = array();
|
||||
}
|
||||
|
||||
// DB 목록을 loop돌면서 xml정보까지 구함
|
||||
if(!is_array($db_list)) $db_list = array($db_list);
|
||||
foreach($db_list as $component) {
|
||||
if(in_array($component->component_name, array('colorpicker_text','colorpicker_bg'))) continue;
|
||||
|
||||
$component_name = $component->component_name;
|
||||
if(!$component_name) continue;
|
||||
|
||||
if(!in_array($component_name, $downloaded_list)) continue;
|
||||
|
||||
unset($xml_info);
|
||||
$xml_info = $oEditorModel->getComponentXmlInfo($component_name);
|
||||
$xml_info->enabled = $component->enabled;
|
||||
|
||||
if($component->extra_vars) {
|
||||
$extra_vars = unserialize($component->extra_vars);
|
||||
|
||||
// 사용권한이 있으면 권한 체크
|
||||
if($extra_vars->target_group) {
|
||||
// 사용권한이 체크되어 있는데 로그인이 되어 있지 않으면 무조건 사용 중지
|
||||
if(!$is_logged) continue;
|
||||
|
||||
// 대상 그룹을 구해서 현재 로그인 사용자의 그룹과 비교
|
||||
$target_group = $extra_vars->target_group;
|
||||
unset($extra_vars->target_group);
|
||||
|
||||
$is_granted = false;
|
||||
foreach($group_list as $group_srl) {
|
||||
if(in_array($group_srl, $target_group)) {
|
||||
$is_granted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$is_granted) continue;
|
||||
}
|
||||
|
||||
// 대상 모듈이 있으면 체크
|
||||
if($extra_vars->mid_list && count($extra_vars->mid_list) && Context::get('mid')) {
|
||||
if(!in_array(Context::get('mid'), $extra_vars->mid_list)) continue;
|
||||
}
|
||||
|
||||
// 에디터 컴포넌트의 설정 정보를 체크
|
||||
if($xml_info->extra_vars) {
|
||||
foreach($xml_info->extra_vars as $key => $val) {
|
||||
$xml_info->extra_vars->{$key}->value = $extra_vars->{$key};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$component_list->{$component_name} = $xml_info;
|
||||
}
|
||||
|
||||
// enabled만 체크하도록 하였으면 그냥 return
|
||||
if($filter_enabled) {
|
||||
$cache_file = $oEditorModel->getCacheFile($filter_enabled, $site_srl);
|
||||
$buff = sprintf('<?php if(!defined("__ZBXE__")) exit(); $component_list = unserialize("%s"); ?>', str_replace('"','\\"',serialize($component_list)));
|
||||
FileHandler::writeFile($cache_file, $buff);
|
||||
return $component_list;
|
||||
}
|
||||
|
||||
// 다운로드된 목록의 xml_info를 마저 구함
|
||||
foreach($downloaded_list as $component_name) {
|
||||
if(in_array($component_name, array('colorpicker_text','colorpicker_bg'))) continue;
|
||||
|
||||
// 설정된 것이라면 패스
|
||||
if($component_list->{$component_name}) continue;
|
||||
|
||||
// DB에 입력
|
||||
$oEditorController = &getAdminController('editor');
|
||||
$oEditorController->insertComponent($component_name, false, $site_srl);
|
||||
|
||||
// component_list에 추가
|
||||
unset($xml_info);
|
||||
$xml_info = $oEditorModel->getComponentXmlInfo($component_name);
|
||||
$xml_info->enabled = 'N';
|
||||
|
||||
$component_list->{$component_name} = $xml_info;
|
||||
}
|
||||
|
||||
$cache_file = $oEditorModel->getCacheFile($filter_enabled, $site_srl);
|
||||
$buff = sprintf('<?php if(!defined("__ZBXE__")) exit(); $component_list = unserialize("%s"); ?>', str_replace('"','\\"',serialize($component_list)));
|
||||
FileHandler::writeFile($cache_file, $buff);
|
||||
|
||||
return $component_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 캐시 파일 삭제
|
||||
**/
|
||||
function removeCache($site_srl = 0) {
|
||||
$oEditorModel = &getModel('editor');
|
||||
FileHandler::removeFile($oEditorModel->getCacheFile(true, $site_srl));
|
||||
FileHandler::removeFile($oEditorModel->getCacheFile(false, $site_srl));
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -158,9 +158,11 @@
|
|||
/**
|
||||
* 에디터 컴포넌트 체크
|
||||
**/
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = (int)$site_module_info->site_srl;
|
||||
if($enable_component) {
|
||||
if(!Context::get('component_list')) {
|
||||
$component_list = $this->getComponentList();
|
||||
$component_list = $this->getComponentList(true, $site_srl);
|
||||
Context::set('component_list', $component_list);
|
||||
}
|
||||
}
|
||||
|
|
@ -345,7 +347,7 @@
|
|||
/**
|
||||
* @brief component의 객체 생성
|
||||
**/
|
||||
function getComponentObject($component, $editor_sequence = 0) {
|
||||
function getComponentObject($component, $editor_sequence = 0, $site_srl = 0) {
|
||||
if(!$this->loaded_component_list[$component][$editor_sequence]) {
|
||||
// 해당 컴포넌트의 객체를 생성해서 실행
|
||||
$class_path = sprintf('%scomponents/%s/', $this->module_path, $component);
|
||||
|
|
@ -359,7 +361,7 @@
|
|||
if(!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
|
||||
|
||||
// 설정 정보를 추가
|
||||
$component_info = $this->getComponent($component);
|
||||
$component_info = $this->getComponent($component, $site_srl);
|
||||
$oComponent->setInfo($component_info);
|
||||
$this->loaded_component_list[$component][$editor_sequence] = $oComponent;
|
||||
}
|
||||
|
|
@ -374,111 +376,47 @@
|
|||
return FileHandler::readDir('./modules/editor/skins');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 에디터 컴포넌트 목록 캐시 파일 이름 return
|
||||
**/
|
||||
function getCacheFile($filter_enabled= true, $site_srl = 0) {
|
||||
$cache_path = _XE_PATH_.'files/cache/editor/cache/';
|
||||
if(!is_dir($cache_path)) FileHandler::makeDir($cache_path);
|
||||
$cache_file = $cache_path.'component_list.';
|
||||
if($filter_enabled) $cache_file .= 'filter.';
|
||||
if($site_srl) $cache_file .= $site_srl.'.';
|
||||
$cache_file .= 'php';
|
||||
return $cache_file;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief component 목록을 return (DB정보 보함)
|
||||
**/
|
||||
function getComponentList($filter_enabled = true) {
|
||||
if($filter_enabled) $args->enabled = "Y";
|
||||
|
||||
$output = executeQuery('editor.getComponentList', $args);
|
||||
$db_list = $output->data;
|
||||
|
||||
// 파일목록을 구함
|
||||
$downloaded_list = FileHandler::readDir($this->module_path.'components');
|
||||
|
||||
// 로그인 여부 및 소속 그룹 구함
|
||||
$is_logged = Context::get('is_logged');
|
||||
if($is_logged) {
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->group_list && is_array($logged_info->group_list)) {
|
||||
$group_list = array_keys($logged_info->group_list);
|
||||
} else $group_list = array();
|
||||
function getComponentList($filter_enabled = true, $site_srl=0) {
|
||||
$cache_file = $this->getCacheFile($filter_enabled, $site_srl);
|
||||
if(!file_exists($cache_file)) {
|
||||
$oEditorController = &getController('editor');
|
||||
$oEditorController->makeCache($filter_enabled, $site_srl);
|
||||
}
|
||||
|
||||
// DB 목록을 loop돌면서 xml정보까지 구함
|
||||
if(!is_array($db_list)) $db_list = array($db_list);
|
||||
foreach($db_list as $component) {
|
||||
if(in_array($component->component_name, array('colorpicker_text','colorpicker_bg'))) continue;
|
||||
|
||||
$component_name = $component->component_name;
|
||||
if(!$component_name) continue;
|
||||
|
||||
if(!in_array($component_name, $downloaded_list)) continue;
|
||||
|
||||
unset($xml_info);
|
||||
$xml_info = $this->getComponentXmlInfo($component_name);
|
||||
$xml_info->enabled = $component->enabled;
|
||||
|
||||
if($component->extra_vars) {
|
||||
$extra_vars = unserialize($component->extra_vars);
|
||||
|
||||
// 사용권한이 있으면 권한 체크
|
||||
if($extra_vars->target_group) {
|
||||
// 사용권한이 체크되어 있는데 로그인이 되어 있지 않으면 무조건 사용 중지
|
||||
if(!$is_logged) continue;
|
||||
|
||||
// 대상 그룹을 구해서 현재 로그인 사용자의 그룹과 비교
|
||||
$target_group = $extra_vars->target_group;
|
||||
unset($extra_vars->target_group);
|
||||
|
||||
$is_granted = false;
|
||||
foreach($group_list as $group_srl) {
|
||||
if(in_array($group_srl, $target_group)) {
|
||||
$is_granted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$is_granted) continue;
|
||||
}
|
||||
|
||||
// 대상 모듈이 있으면 체크
|
||||
if($extra_vars->mid_list && count($extra_vars->mid_list) ) {
|
||||
if(!in_array(Context::get('mid'), $extra_vars->mid_list)) continue;
|
||||
}
|
||||
|
||||
// 에디터 컴포넌트의 설정 정보를 체크
|
||||
if($xml_info->extra_vars) {
|
||||
foreach($xml_info->extra_vars as $key => $val) {
|
||||
$xml_info->extra_vars->{$key}->value = $extra_vars->{$key};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$component_list->{$component_name} = $xml_info;
|
||||
}
|
||||
|
||||
// enabled만 체크하도록 하였으면 그냥 return
|
||||
if($filter_enabled) return $component_list;
|
||||
|
||||
// 다운로드된 목록의 xml_info를 마저 구함
|
||||
foreach($downloaded_list as $component_name) {
|
||||
if(in_array($component_name, array('colorpicker_text','colorpicker_bg'))) continue;
|
||||
|
||||
// 설정된 것이라면 패스
|
||||
if($component_list->{$component_name}) continue;
|
||||
|
||||
// DB에 입력
|
||||
$oEditorController = &getAdminController('editor');
|
||||
$oEditorController->insertComponent($component_name, false);
|
||||
|
||||
// component_list에 추가
|
||||
unset($xml_info);
|
||||
$xml_info = $this->getComponentXmlInfo($component_name);
|
||||
$xml_info->enabled = 'N';
|
||||
|
||||
$component_list->{$component_name} = $xml_info;
|
||||
}
|
||||
if(!file_exists($cache_file)) return;
|
||||
|
||||
@include($cache_file);
|
||||
return $component_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief compnent의 xml+db정보를 구함
|
||||
**/
|
||||
function getComponent($component_name) {
|
||||
function getComponent($component_name, $site_srl = 0) {
|
||||
$args->component_name = $component_name;
|
||||
|
||||
$output = executeQuery('editor.getComponent', $args);
|
||||
if($site_srl) {
|
||||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('editor.getSiteComponent', $args);
|
||||
} else {
|
||||
$output = executeQuery('editor.getComponent', $args);
|
||||
}
|
||||
$component = $output->data;
|
||||
|
||||
$component_name = $component->component_name;
|
||||
|
|
@ -512,7 +450,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
return $xml_info;
|
||||
}
|
||||
|
||||
|
|
@ -648,6 +585,7 @@
|
|||
|
||||
FileHandler::writeFile($cache_file, $buff, "w");
|
||||
|
||||
include($cache_file);
|
||||
return $xml_info;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,9 +24,12 @@
|
|||
$editor_sequence = Context::get('editor_sequence ');
|
||||
$component = Context::get('component');
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = (int)$site_module_info->site_srl;
|
||||
|
||||
// component 객체를 받음
|
||||
$oEditorModel = &getModel('editor');
|
||||
$oComponent = &$oEditorModel->getComponentObject($component, $editor_sequence);
|
||||
$oComponent = &$oEditorModel->getComponentObject($component, $editor_sequence, $site_srl);
|
||||
if(!$oComponent->toBool()) {
|
||||
Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component));
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
|
|
@ -52,8 +55,11 @@
|
|||
function dispEditorComponentInfo() {
|
||||
$component_name = Context::get('component_name');
|
||||
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$site_srl = (int)$site_module_info->site_srl;
|
||||
|
||||
$oEditorModel = &getModel('editor');
|
||||
$component = $oEditorModel->getComponent($component_name);
|
||||
$component = $oEditorModel->getComponent($component_name, $site_srl);
|
||||
Context::set('component', $component);
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@
|
|||
$lang->msg_component_is_first_order = '선택하신 컴포넌트는 첫번째에 위치하고 있습니다.';
|
||||
$lang->msg_component_is_last_order = '선택하신 컴포넌트는 마지막에 위치하고 있습니다.';
|
||||
$lang->msg_load_saved_doc = "자동 저장된 글이 있습니다. 복구하시겠습니까?\n글을 다 쓰신 후 저장하시면 자동 저장본은 사라집니다.";
|
||||
$lang->msg_auto_saved = "자동 저장되었습니다.";
|
||||
$lang->msg_auto_saved = '자동 저장되었습니다.';
|
||||
|
||||
$lang->cmd_disable = "비활성";
|
||||
$lang->cmd_enable = "활성";
|
||||
$lang->cmd_disable = '비활성';
|
||||
$lang->cmd_enable = '활성';
|
||||
|
||||
$lang->editor_skin = '에디터 스킨';
|
||||
$lang->upload_file_grant = '파일 첨부 권한';
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
$lang->msg_component_is_inserted = '您选择的组件已插入!';
|
||||
$lang->msg_component_is_first_order = '您选择的组件已到最上端位置!';
|
||||
$lang->msg_component_is_last_order = '您选择的组件已到最下端位置!';
|
||||
$lang->msg_load_saved_doc = "有自动保存的内容, 确定要恢复吗?\n保存内容后,自动保存的文本将会被删除。";
|
||||
$lang->msg_load_saved_doc = "有自动保存的内容, 确定要恢复吗?\n发布主题后,自动保存的文本将会被删除。";
|
||||
$lang->msg_auto_saved = '已自动保存!';
|
||||
|
||||
$lang->cmd_disable = '非激活';
|
||||
|
|
@ -52,10 +52,12 @@
|
|||
$lang->edit->fontsize = '大小';
|
||||
$lang->edit->use_paragraph = '段落功能';
|
||||
$lang->edit->fontlist = array(
|
||||
'仿宋_GB2312'=>'仿宋_GB2312',
|
||||
'黑体'=>'黑体',
|
||||
'楷体_GB2312'=>'楷体_GB2312',
|
||||
'宋体'=>'宋体',
|
||||
'黑体'=>'黑体',
|
||||
'楷体_GB2312'=>'楷体',
|
||||
'仿宋_GB2312'=>'仿宋',
|
||||
'隶书'=>'隶书',
|
||||
'幼圆'=>'幼圆',
|
||||
'Arial'=>'Arial',
|
||||
'Arial Black'=>'Arial Black',
|
||||
'Tahoma'=>'Tahoma',
|
||||
|
|
@ -79,25 +81,25 @@
|
|||
|
||||
$lang->edit->submit = '确认';
|
||||
|
||||
$lang->edit->fontcolor = 'Text Color';
|
||||
$lang->edit->fontbgcolor = 'Background Color';
|
||||
$lang->edit->bold = 'Bold';
|
||||
$lang->edit->italic = 'Italic';
|
||||
$lang->edit->underline = 'Underline';
|
||||
$lang->edit->strike = 'Strike';
|
||||
$lang->edit->sup = 'Sup';
|
||||
$lang->edit->sub = 'Sub';
|
||||
$lang->edit->redo = 'Re Do';
|
||||
$lang->edit->undo = 'Un Do';
|
||||
$lang->edit->align_left = 'Align Left';
|
||||
$lang->edit->align_center = 'Align Center';
|
||||
$lang->edit->align_right = 'Align Right';
|
||||
$lang->edit->align_justify = 'Align Justify';
|
||||
$lang->edit->add_indent = 'Indent';
|
||||
$lang->edit->remove_indent = 'Outdent';
|
||||
$lang->edit->list_number = 'Orderd List';
|
||||
$lang->edit->list_bullet = 'Unordered List';
|
||||
$lang->edit->remove_format = 'Style Remover';
|
||||
$lang->edit->fontcolor = '文本颜色';
|
||||
$lang->edit->fontbgcolor = '背景颜色';
|
||||
$lang->edit->bold = '粗体';
|
||||
$lang->edit->italic = '斜体';
|
||||
$lang->edit->underline = '下划线';
|
||||
$lang->edit->strike = '取消线';
|
||||
$lang->edit->sup = '上标';
|
||||
$lang->edit->sub = '下标';
|
||||
$lang->edit->redo = '恢复';
|
||||
$lang->edit->undo = '撤销';
|
||||
$lang->edit->align_left = '左对齐';
|
||||
$lang->edit->align_center = '居中对齐';
|
||||
$lang->edit->align_right = '右对齐';
|
||||
$lang->edit->align_justify = '两端对齐';
|
||||
$lang->edit->add_indent = '增加缩进';
|
||||
$lang->edit->remove_indent = '减少缩进';
|
||||
$lang->edit->list_number = '有序列表';
|
||||
$lang->edit->list_bullet = '无序列表';
|
||||
$lang->edit->remove_format = '删除文字格式';
|
||||
|
||||
$lang->edit->help_fontcolor = '文本颜色';
|
||||
$lang->edit->help_fontbgcolor = '背景颜色';
|
||||
|
|
@ -105,29 +107,29 @@
|
|||
$lang->edit->help_italic = '斜体';
|
||||
$lang->edit->help_underline = '下划线';
|
||||
$lang->edit->help_strike = '取消线';
|
||||
$lang->edit->help_sup = 'Sup';
|
||||
$lang->edit->help_sub = 'Sub';
|
||||
$lang->edit->help_redo = '重新操作';
|
||||
$lang->edit->help_undo = '返回操作';
|
||||
$lang->edit->help_sup = '上标';
|
||||
$lang->edit->help_sub = '下标';
|
||||
$lang->edit->help_redo = '恢复';
|
||||
$lang->edit->help_undo = '撤销';
|
||||
$lang->edit->help_align_left = '左对齐';
|
||||
$lang->edit->help_align_center = '居中对齐';
|
||||
$lang->edit->help_align_right = '右对齐';
|
||||
$lang->edit->help_add_indent = '缩进';
|
||||
$lang->edit->help_remove_indent = '清除缩进';
|
||||
$lang->edit->help_add_indent = '增加缩进';
|
||||
$lang->edit->help_remove_indent = '减少缩进';
|
||||
$lang->edit->help_list_number = '有序列表';
|
||||
$lang->edit->help_list_bullet = '无序列表';
|
||||
$lang->edit->help_use_paragraph = '分段请按 ctrl+回车. (发表主题快捷键:alt+S)';
|
||||
|
||||
$lang->edit->url = 'URL';
|
||||
$lang->edit->blockquote = 'Blockquote';
|
||||
$lang->edit->table = 'Table';
|
||||
$lang->edit->image = 'Image';
|
||||
$lang->edit->multimedia = 'Movie';
|
||||
$lang->edit->emoticon = 'Emoticon';
|
||||
$lang->edit->url = '插入链接';
|
||||
$lang->edit->blockquote = '插入注释框';
|
||||
$lang->edit->table = '表格';
|
||||
$lang->edit->image = '图片';
|
||||
$lang->edit->multimedia = '视频';
|
||||
$lang->edit->emoticon = '表情图标';
|
||||
|
||||
$lang->edit->upload = '上传';
|
||||
$lang->edit->upload_file = '上传附件';
|
||||
$lang->edit->link_file = '插入内容';
|
||||
$lang->edit->link_file = '插入附件';
|
||||
$lang->edit->delete_selected = '删除所选';
|
||||
|
||||
$lang->edit->icon_align_article = '占一个段落';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* @file modules/editor/lang/zh-TW.lang.php
|
||||
* @author zero <zero@nzeo.com> 翻譯:royallin
|
||||
* @brief 網頁編輯器(editor) 模組語言
|
||||
* @brief 網頁編輯器(editor)模組語言
|
||||
**/
|
||||
|
||||
$lang->editor = '網頁編輯器';
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
$lang->about_editor_height = '指定編輯器的預設高度。';
|
||||
$lang->about_editor_height_resizable = '允許用戶拖曳編輯器高度。';
|
||||
$lang->about_enable_html_grant = 'HTML原始碼編輯權限設置。';
|
||||
$lang->about_enable_autosave = '發表主題時,啟動內容自動儲存功能。';
|
||||
$lang->about_enable_autosave = '發表主題時,開啟內容自動儲存功能。';
|
||||
|
||||
$lang->edit->fontname = '字體';
|
||||
$lang->edit->fontsize = '大小';
|
||||
|
|
@ -78,25 +78,25 @@
|
|||
|
||||
$lang->edit->submit = '確認';
|
||||
|
||||
$lang->edit->fontcolor = 'Text Color';
|
||||
$lang->edit->fontbgcolor = 'Background Color';
|
||||
$lang->edit->bold = 'Bold';
|
||||
$lang->edit->italic = 'Italic';
|
||||
$lang->edit->underline = 'Underline';
|
||||
$lang->edit->strike = 'Strike';
|
||||
$lang->edit->sup = 'Sup';
|
||||
$lang->edit->sub = 'Sub';
|
||||
$lang->edit->redo = 'Re Do';
|
||||
$lang->edit->undo = 'Un Do';
|
||||
$lang->edit->align_left = 'Align Left';
|
||||
$lang->edit->align_center = 'Align Center';
|
||||
$lang->edit->align_right = 'Align Right';
|
||||
$lang->edit->align_justify = 'Align Justify';
|
||||
$lang->edit->add_indent = 'Indent';
|
||||
$lang->edit->remove_indent = 'Outdent';
|
||||
$lang->edit->list_number = 'Orderd List';
|
||||
$lang->edit->list_bullet = 'Unordered List';
|
||||
$lang->edit->remove_format = 'Style Remover';
|
||||
$lang->edit->fontcolor = '文字顏色';
|
||||
$lang->edit->fontbgcolor = '背景顏色';
|
||||
$lang->edit->bold = '粗體';
|
||||
$lang->edit->italic = '斜體';
|
||||
$lang->edit->underline = '底線';
|
||||
$lang->edit->strike = '虛線';
|
||||
$lang->edit->sup = '上標';
|
||||
$lang->edit->sub = '下標';
|
||||
$lang->edit->redo = '重新操作';
|
||||
$lang->edit->undo = '返回操作';
|
||||
$lang->edit->align_left = '靠左對齊';
|
||||
$lang->edit->align_center = '置中對齊';
|
||||
$lang->edit->align_right = '靠右對齊';
|
||||
$lang->edit->align_justify = '左右對齊';
|
||||
$lang->edit->add_indent = '縮排';
|
||||
$lang->edit->remove_indent = '凸排';
|
||||
$lang->edit->list_number = '編號';
|
||||
$lang->edit->list_bullet = '清單符號';
|
||||
$lang->edit->remove_format = '移除格式';
|
||||
|
||||
$lang->edit->help_remove_format = '移除格式';
|
||||
$lang->edit->help_strike_through = '文字刪除線';
|
||||
|
|
@ -108,8 +108,8 @@
|
|||
$lang->edit->help_italic = '斜體';
|
||||
$lang->edit->help_underline = '底線';
|
||||
$lang->edit->help_strike = '虛線';
|
||||
$lang->edit->help_sup = 'Sup';
|
||||
$lang->edit->help_sub = 'Sub';
|
||||
$lang->edit->help_sup = '上標';
|
||||
$lang->edit->help_sub = '下標';
|
||||
$lang->edit->help_redo = '重新操作';
|
||||
$lang->edit->help_undo = '返回操作';
|
||||
$lang->edit->help_align_left = '靠左對齊';
|
||||
|
|
@ -119,14 +119,14 @@
|
|||
$lang->edit->help_remove_indent = '凸排';
|
||||
$lang->edit->help_list_number = '編號';
|
||||
$lang->edit->help_list_bullet = '清單符號';
|
||||
$lang->edit->help_use_paragraph = '換行請按 ctrl+backspace (快速發表主題:alt+S)';
|
||||
$lang->edit->help_use_paragraph = '換行請按 Ctrl+Backspace (快速發表主題:Alt+S)';
|
||||
|
||||
$lang->edit->url = 'URL';
|
||||
$lang->edit->blockquote = 'Blockquote';
|
||||
$lang->edit->table = 'Table';
|
||||
$lang->edit->image = 'Image';
|
||||
$lang->edit->multimedia = 'Movie';
|
||||
$lang->edit->emoticon = 'Emoticon';
|
||||
$lang->edit->url = '連結';
|
||||
$lang->edit->blockquote = '引用';
|
||||
$lang->edit->table = '表格';
|
||||
$lang->edit->image = '圖片';
|
||||
$lang->edit->multimedia = '影片';
|
||||
$lang->edit->emoticon = '表情符號';
|
||||
|
||||
$lang->edit->upload = '上傳';
|
||||
$lang->edit->upload_file = '上傳附檔';
|
||||
|
|
@ -138,10 +138,10 @@
|
|||
$lang->edit->icon_align_middle = '置中';
|
||||
$lang->edit->icon_align_right = '靠右';
|
||||
|
||||
$lang->about_dblclick_in_editor = '對背景, 文字, 圖片, 引用等組件按兩下,即可對其相關組件進行詳細設置。';
|
||||
$lang->about_dblclick_in_editor = '對背景,文字,圖片,引用等組件按兩下,即可對其相關組件進行詳細設置。';
|
||||
|
||||
|
||||
$lang->edit->rich_editor = '所見即所得';
|
||||
$lang->edit->rich_editor = '所見即得';
|
||||
$lang->edit->html_editor = 'HTML';
|
||||
$lang->edit->extension ='延伸組件';
|
||||
$lang->edit->help = '使用說明';
|
||||
|
|
|
|||
8
modules/editor/queries/deleteSiteComponent.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="deleteSiteComponent" action="delete">
|
||||
<tables>
|
||||
<table name="editor_components_site" />
|
||||
</tables>
|
||||
<conditions>
|
||||
<condition operation="equal" column="site_srl" var="site_srl" filter="number" />
|
||||
</conditions>
|
||||
</query>
|
||||
12
modules/editor/queries/getSiteComponent.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<query id="getSiteComponent" action="select">
|
||||
<tables>
|
||||
<table name="editor_components_site" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="site_srl" var="site_srl" notnull="notnull"/>
|
||||
<condition operation="equal" column="component_name" var="component_name" notnull="notnull" pipe="and"/>
|
||||
</conditions>
|
||||
</query>
|
||||
15
modules/editor/queries/getSiteComponentList.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<query id="getSiteComponentList" action="select">
|
||||
<tables>
|
||||
<table name="editor_components_site" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="*" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="site_srl" var="site_srl" notnull="notnull"/>
|
||||
<condition operation="equal" column="enabled" var="enabled" pipe="and" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="list_order" order="asc" />
|
||||
</navigation>
|
||||
</query>
|
||||
11
modules/editor/queries/insertSiteComponent.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="insertSiteComponent" action="insert">
|
||||
<tables>
|
||||
<table name="editor_components_site" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="site_srl" var="site_srl" notnull="notnull" />
|
||||
<column name="component_name" var="component_name" notnull="notnull" />
|
||||
<column name="enabled" var="enabled" default="N" />
|
||||
<column name="list_order" var="list_order" default="sequence()" />
|
||||
</columns>
|
||||
</query>
|
||||
12
modules/editor/queries/isSiteComponentInserted.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<query id="isSiteComponentInserted" action="select">
|
||||
<tables>
|
||||
<table name="editor_components_site" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="count(*)" alias="count" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="site_srl" var="site_srl" notnull="notnull"/>
|
||||
<condition operation="equal" column="component_name" var="component_name" notnull="notnull" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
14
modules/editor/queries/updateSiteComponent.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<query id="updateSiteComponent" action="update">
|
||||
<tables>
|
||||
<table name="editor_components_site" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="enabled" var="enabled" />
|
||||
<column name="extra_vars" var="extra_vars" />
|
||||
<column name="list_order" var="list_order" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="site_srl" var="site_srl" notnull="notnull"/>
|
||||
<condition operation="equal" column="component_name" var="component_name" notnull="notnull" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
7
modules/editor/schemas/editor_components_site.xml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<table name="editor_components_site">
|
||||
<column name="site_srl" type="number" size="11" notnull="notnull" default="0" unique="unique_component_site" />
|
||||
<column name="component_name" type="varchar" size="250" notnull="notnull" unique="unique_component_site" />
|
||||
<column name="enabled" type="char" size="1" default="N" notnull="notnull" />
|
||||
<column name="extra_vars" type="text"/>
|
||||
<column name="list_order" type="number" size="11" notnull="notnull" index="idx_list_order" />
|
||||
</table>
|
||||
|
|
@ -46,8 +46,8 @@ a.skipToolBox:active span{ width:auto; height:auto; padding:3px 15px; font-weigh
|
|||
.toolBox:after{ content:""; display:block; clear:both;}
|
||||
.toolBox .item{ float:left; margin:0 5px 5px 0;}
|
||||
.toolBox .item li{ float:left;}
|
||||
.toolBox .item li button{ display:block; border:0; width:21px; height:21px; background-position:no-repeat; cursor:pointer;}
|
||||
.toolBox .item li button span{ position:relative; z-index:-1; font-size:0; line-height:0;}
|
||||
.toolBox .item li button{ display:block; border:0; width:21px; height:21px; background-position:no-repeat; cursor:pointer; overflow:hidden; }
|
||||
.toolBox .item li button span {position:relative !important; z-index:-1 !important; font-size:0 !important; line-height:0 !important;}
|
||||
|
||||
.toolBox .extension2{ float:left; position:relative; margin:0 5px 5px 0;}
|
||||
.toolBox .extension2 .exButton{ float:left; border:0; width:68px; height:21px; background-repeat:no-repeat; background-position:-579px 0; cursor:pointer;}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<skin version="0.2">
|
||||
<title xml:lang="ko">XE 기본 에디터</title>
|
||||
<title xml:lang="es">XE básico Editor</title>
|
||||
<title xml:lang="en">XE default Editor</title>
|
||||
<title xml:lang="zh-CN">XE编辑器默认皮肤</title>
|
||||
<title xml:lang="jp">XE基本エディター</title>
|
||||
<title xml:lang="zh-TW">XE預設編輯器面板</title>
|
||||
<description xml:lang="ko">개발 : zero (http://blog.nzeo.com)</description>
|
||||
<description xml:lang="en">Developer : zero (http://blog.nzeo.com)</description>
|
||||
<description xml:lang="es">Desarrollo : zero (http://blog.nzeo.com)</description>
|
||||
<description xml:lang="zh-CN">程序 : zero (http://blog.nzeo.com)</description>
|
||||
<description xml:lang="jp">開発 : zero (http://blog.nzeo.com)</description>
|
||||
<description xml:lang="zh-TW">開發 : zero (http://blog.nzeo.com)</description>
|
||||
|
|
@ -15,6 +19,8 @@
|
|||
<name xml:lang="ko">zero</name>
|
||||
<name xml:lang="zh-CN">Zero</name>
|
||||
<name xml:lang="jp">zero</name>
|
||||
<name xml:lang="es">zero</name>
|
||||
<name xml:lang="en">zero</name>
|
||||
<name xml:lang="zh-TW">zero</name>
|
||||
</author>
|
||||
<colorset>
|
||||
|
|
@ -40,8 +46,8 @@
|
|||
<title xml:lang="jp">白色テキストエディター(自動に改行を入れる)</title>
|
||||
<title xml:lang="en">White Text Editor(Auto Line Break)</title>
|
||||
<title xml:lang="ru">White Text Editor(Auto Line Break)</title>
|
||||
<title xml:lang="es">White Text Editor(Auto Line Break)</title>
|
||||
<title xml:lang="zh-CN">White Text Editor(Auto Line Break)</title>
|
||||
<title xml:lang="es">Editor de texto en blanco (Auto de línea)</title>
|
||||
<title xml:lang="zh-CN">白色文本编辑器(自动换行)</title>
|
||||
<title xml:lang="zh-TW">白色文字編輯器(Auto Line Break)</title>
|
||||
</color>
|
||||
<color name="black_texteditor">
|
||||
|
|
@ -49,8 +55,8 @@
|
|||
<title xml:lang="jp">黒色テキストエディター(自動に改行を入れる)</title>
|
||||
<title xml:lang="en">Black Text Editor(Auto Line Break)</title>
|
||||
<title xml:lang="ru">Black Text Editor(Auto Line Break)</title>
|
||||
<title xml:lang="es">Black Text Editor(Auto Line Break)</title>
|
||||
<title xml:lang="zh-CN">Black Text Editor(Auto Line Break)</title>
|
||||
<title xml:lang="es">Editor de texto negro (salto de línea automático)</title>
|
||||
<title xml:lang="zh-CN">黑色文本编辑器(自动换行)</title>
|
||||
<title xml:lang="zh-TW">黑色文字編輯器(Auto Line Break)</title>
|
||||
</color>
|
||||
<color name="white_text_usehtml">
|
||||
|
|
@ -58,8 +64,8 @@
|
|||
<title xml:lang="jp">白色テキストエディター(HTMLタグを使う)</title>
|
||||
<title xml:lang="en">White Text Editor(Use HTML)</title>
|
||||
<title xml:lang="ru">White Text Editor(Use HTML)</title>
|
||||
<title xml:lang="es">White Text Editor(Use HTML)</title>
|
||||
<title xml:lang="zh-CN">White Text Editor(Use HTML)</title>
|
||||
<title xml:lang="es">Editor de texto en blanco (Uso de HTML)</title>
|
||||
<title xml:lang="zh-CN">白色文本编辑器(使用HTML)</title>
|
||||
<title xml:lang="zh-TW">白色文字編輯器(Use HTML)</title>
|
||||
</color>
|
||||
<color name="black_text_usehtml">
|
||||
|
|
@ -67,8 +73,8 @@
|
|||
<title xml:lang="jp">黒色テキストエディター(HTMLタグを使う)</title>
|
||||
<title xml:lang="en">Black Text Editor(Use HTML)</title>
|
||||
<title xml:lang="ru">Black Text Editor(Use HTML)</title>
|
||||
<title xml:lang="es">Black Text Editor(Use HTML)</title>
|
||||
<title xml:lang="zh-CN">Black Text Editor(Use HTML)</title>
|
||||
<title xml:lang="es">Editor de texto negro (Uso de HTML)</title>
|
||||
<title xml:lang="zh-CN">黑色文本编辑器(使用HTML)</title>
|
||||
<title xml:lang="zh-TW">黑色文字編輯器(Use HTML)</title>
|
||||
</color>
|
||||
<color name="white_text_nohtml">
|
||||
|
|
@ -76,8 +82,8 @@
|
|||
<title xml:lang="jp">白色テキストエディター(HTMLタグを使わない)</title>
|
||||
<title xml:lang="en">White Text Editor(No HTML)</title>
|
||||
<title xml:lang="ru">White Text Editor(No HTML)</title>
|
||||
<title xml:lang="es">White Text Editor(No HTML)</title>
|
||||
<title xml:lang="zh-CN">White Text Editor(No HTML)</title>
|
||||
<title xml:lang="es">Editor de texto en blanco (no HTML)</title>
|
||||
<title xml:lang="zh-CN">白色文本编辑器(不使用HTML)</title>
|
||||
<title xml:lang="zh-TW">白色文字編輯器(No HTML)</title>
|
||||
</color>
|
||||
<color name="black_text_nohtml">
|
||||
|
|
@ -85,8 +91,8 @@
|
|||
<title xml:lang="jp">黒色テキストエディター(HTMLタグを使わない)</title>
|
||||
<title xml:lang="en">Black Text Editor(No HTML)</title>
|
||||
<title xml:lang="ru">Black Text Editor(No HTML)</title>
|
||||
<title xml:lang="es">Black Text Editor(No HTML)</title>
|
||||
<title xml:lang="zh-CN">Black Text Editor(No HTML)</title>
|
||||
<title xml:lang="es">Editor de texto negro (no HTML)</title>
|
||||
<title xml:lang="zh-CN">黑色文本编辑器(不使用HTML)</title>
|
||||
<title xml:lang="zh-TW">黑色文字編輯器(No HTML)</title>
|
||||
</color>
|
||||
</colorset>
|
||||
|
|
|
|||
99
modules/editor/skins/fckeditor/editor.html
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
<!--// 스킨 css 로드 -->
|
||||
<!--%import("../default/css/editor.css")-->
|
||||
<!--%import("../default/css/white.css")-->
|
||||
<script type="text/javascript">
|
||||
var editor_path = "{$editor_path}";
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<!--// 기본 js/언어파일 로드 -->
|
||||
<!--%import("fckeditor.js",optimized=false)-->
|
||||
<!--%import("../../tpl/js/editor_common.js",optimized=false)-->
|
||||
<!--%import("js/xe_interface.js",optimized=false)-->
|
||||
|
||||
<!-- 자동저장용 폼 -->
|
||||
<!--@if($enable_autosave)-->
|
||||
<input type="hidden" name="_saved_doc_title" value="{htmlspecialchars($saved_doc->title)}" />
|
||||
<input type="hidden" name="_saved_doc_content" value="{htmlspecialchars($saved_doc->content)}" />
|
||||
<input type="hidden" name="_saved_doc_message" value="{$lang->msg_load_saved_doc}" />
|
||||
<!--@end-->
|
||||
|
||||
<div class="xeEditor">
|
||||
<!--@if($enable_autosave)-->
|
||||
<p class="editor_autosaved_message" id="editor_autosaved_message_{$editor_sequence}"> </p>
|
||||
<!--@end-->
|
||||
<!-- 에디터 출력 -->
|
||||
<textarea id="fckeditor_{$editor_sequence}">qweqwe</textarea>
|
||||
|
||||
<!--@if($enable_component)-->
|
||||
<!-- 확장 컴포넌트 출력 -->
|
||||
<div style="display:none" id="editorExtension_{$editor_sequence}">
|
||||
<ul id="editor_component_{$editor_sequence}" class="editorComponent">
|
||||
<!--@foreach($component_list as $component_name => $component)-->
|
||||
<!--@if(!in_array($component_name,array('colorpicker_bg','colorpicker_text','emoticon','image_link','multimedia_link','quotation','table_maker','url_link')))-->
|
||||
<li><a href="#" onclick="return false;" id="component_{$editor_sequence}_{$component_name}"><img src="../../components/{$component_name}/component_icon.gif" alt="" /> {$component->title}</a></li>
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
</ul>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
var fck_{$editor_sequence};
|
||||
var auto_saved_msg = "{$lang->msg_auto_saved}";
|
||||
if(document.getElementById("comment_{$editor_sequence}") == null || document.getElementById("comment_{$editor_sequence}").style.display != 'none') {
|
||||
|
||||
fck_{$editor_sequence} = editorStart_fck(
|
||||
fck_{$editor_sequence}
|
||||
,document.getElementById("fckeditor_{$editor_sequence}")
|
||||
,{$editor_sequence}
|
||||
,"{$editor_content_key_name}"
|
||||
,"{$editor_height}px"
|
||||
,"{$editor_primary_key_name}"
|
||||
,editor_path
|
||||
);
|
||||
}
|
||||
|
||||
function getEditorExtension(editor_sequence){
|
||||
return document.getElementById('editorExtension_'+editor_sequence).innerHTML;
|
||||
};
|
||||
//]]></script>
|
||||
|
||||
|
||||
<!--@if($allow_fileupload)-->
|
||||
<!-- 첨부파일 영역 -->
|
||||
<!--%import("../../tpl/js/uploader.js",optimized=false)-->
|
||||
<!--%import("../../tpl/js/swfupload.js",optimized=false)-->
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
editorUploadInit(
|
||||
{
|
||||
"editorSequence" : {$editor_sequence},
|
||||
"sessionName" : "{session_name()}",
|
||||
"allowedFileSize" : "{$file_config->allowed_filesize}",
|
||||
"allowedFileTypes" : "{$file_config->allowed_filetypes}",
|
||||
"allowedFileTypesDescription" : "{$file_config->allowed_filetypes}",
|
||||
"insertedFiles" : {(int)$files_count},
|
||||
"replaceButtonID" : "swfUploadButton{$editor_sequence}",
|
||||
"fileListAreaID" : "uploaded_file_list_{$editor_sequence}",
|
||||
"previewAreaID" : "preview_uploaded_{$editor_sequence}",
|
||||
"uploaderStatusID" : "uploader_status_{$editor_sequence}"
|
||||
}
|
||||
);
|
||||
//]]></script>
|
||||
<!-- 파일 업로드 영역 -->
|
||||
<div id="fileUploader_{$editor_sequence}" class="fileUploader">
|
||||
<div class="preview" id="preview_uploaded_{$editor_sequence}"></div>
|
||||
<div class="fileListArea">
|
||||
<select id="uploaded_file_list_{$editor_sequence}" multiple="multiple" class="fileList" title="Attached File List"><option></option></select>
|
||||
</div>
|
||||
<div class="fileUploadControl">
|
||||
<span class="button" id="swfUploadButton{$editor_sequence}"><button type="button">{$lang->edit->upload_file}</button></span>
|
||||
<span class="button"><button type="button" onclick="removeUploadedFile('{$editor_sequence}');return false;">{$lang->edit->delete_selected}</button></span>
|
||||
<span class="button"><button type="button" onclick="insertUploadedFile('{$editor_sequence}');return false;">{$lang->edit->link_file}</button></span>
|
||||
</div>
|
||||
<div class="file_attach_info" id="uploader_status_{$editor_sequence}">{$upload_status}</div>
|
||||
</div>
|
||||
<!--@end-->
|
||||
</div>
|
||||
|
|
@ -0,0 +1,223 @@
|
|||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* FCKContextMenu Class: renders an control a context menu.
|
||||
*/
|
||||
|
||||
var FCKContextMenu = function( parentWindow, langDir )
|
||||
{
|
||||
this.CtrlDisable = false ;
|
||||
|
||||
var oPanel = this._Panel = new FCKPanel( parentWindow ) ;
|
||||
oPanel.AppendStyleSheet( FCKConfig.SkinEditorCSS ) ;
|
||||
oPanel.IsContextMenu = true ;
|
||||
|
||||
// The FCKTools.DisableSelection doesn't seems to work to avoid dragging of the icons in Mozilla
|
||||
// so we stop the start of the dragging
|
||||
if ( FCKBrowserInfo.IsGecko )
|
||||
oPanel.Document.addEventListener( 'draggesture', function(e) {e.preventDefault(); return false;}, true ) ;
|
||||
|
||||
var oMenuBlock = this._MenuBlock = new FCKMenuBlock() ;
|
||||
oMenuBlock.Panel = oPanel ;
|
||||
oMenuBlock.OnClick = FCKTools.CreateEventListener( FCKContextMenu_MenuBlock_OnClick, this ) ;
|
||||
|
||||
this._Redraw = true ;
|
||||
}
|
||||
|
||||
|
||||
FCKContextMenu.prototype.SetMouseClickWindow = function( mouseClickWindow )
|
||||
{
|
||||
if ( !FCKBrowserInfo.IsIE )
|
||||
{
|
||||
this._Document = mouseClickWindow.document ;
|
||||
if ( FCKBrowserInfo.IsOpera && !( 'oncontextmenu' in document.createElement('foo') ) )
|
||||
{
|
||||
this._Document.addEventListener( 'mousedown', FCKContextMenu_Document_OnMouseDown, false ) ;
|
||||
this._Document.addEventListener( 'mouseup', FCKContextMenu_Document_OnMouseUp, false ) ;
|
||||
}
|
||||
this._Document.addEventListener( 'contextmenu', FCKContextMenu_Document_OnContextMenu, false ) ;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
The customData parameter is just a value that will be send to the command that is executed,
|
||||
so it's possible to reuse the same command for several items just by assigning different data for each one.
|
||||
*/
|
||||
FCKContextMenu.prototype.AddItem = function( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData )
|
||||
{
|
||||
var oItem = this._MenuBlock.AddItem( name, label, iconPathOrStripInfoArrayOrIndex, isDisabled, customData ) ;
|
||||
this._Redraw = true ;
|
||||
return oItem ;
|
||||
}
|
||||
|
||||
FCKContextMenu.prototype.AddSeparator = function()
|
||||
{
|
||||
this._MenuBlock.AddSeparator() ;
|
||||
this._Redraw = true ;
|
||||
}
|
||||
|
||||
FCKContextMenu.prototype.RemoveAllItems = function()
|
||||
{
|
||||
this._MenuBlock.RemoveAllItems() ;
|
||||
this._Redraw = true ;
|
||||
}
|
||||
|
||||
FCKContextMenu.prototype.AttachToElement = function( element )
|
||||
{
|
||||
if ( FCKBrowserInfo.IsIE )
|
||||
FCKTools.AddEventListenerEx( element, 'contextmenu', FCKContextMenu_AttachedElement_OnContextMenu, this ) ;
|
||||
else
|
||||
element._FCKContextMenu = this ;
|
||||
}
|
||||
|
||||
function FCKContextMenu_Document_OnContextMenu( e )
|
||||
{
|
||||
if ( FCKConfig.BrowserContextMenu )
|
||||
return true ;
|
||||
|
||||
var el = e.target ;
|
||||
|
||||
while ( el )
|
||||
{
|
||||
if ( el._FCKContextMenu )
|
||||
{
|
||||
if ( el._FCKContextMenu.CtrlDisable && ( e.ctrlKey || e.metaKey ) )
|
||||
return true ;
|
||||
|
||||
FCKTools.CancelEvent( e ) ;
|
||||
FCKContextMenu_AttachedElement_OnContextMenu( e, el._FCKContextMenu, el ) ;
|
||||
return false ;
|
||||
}
|
||||
el = el.parentNode ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
var FCKContextMenu_OverrideButton ;
|
||||
|
||||
function FCKContextMenu_Document_OnMouseDown( e )
|
||||
{
|
||||
if( !e || e.button != 2 )
|
||||
return false ;
|
||||
|
||||
if ( FCKConfig.BrowserContextMenu )
|
||||
return true ;
|
||||
|
||||
var el = e.target ;
|
||||
|
||||
while ( el )
|
||||
{
|
||||
if ( el._FCKContextMenu )
|
||||
{
|
||||
if ( el._FCKContextMenu.CtrlDisable && ( e.ctrlKey || e.metaKey ) )
|
||||
return true ;
|
||||
|
||||
var overrideButton = FCKContextMenu_OverrideButton ;
|
||||
if( !overrideButton )
|
||||
{
|
||||
var doc = FCKTools.GetElementDocument( e.target ) ;
|
||||
overrideButton = FCKContextMenu_OverrideButton = doc.createElement('input') ;
|
||||
overrideButton.type = 'button' ;
|
||||
var buttonHolder = doc.createElement('p') ;
|
||||
doc.body.appendChild( buttonHolder ) ;
|
||||
buttonHolder.appendChild( overrideButton ) ;
|
||||
}
|
||||
|
||||
overrideButton.style.cssText = 'position:absolute;top:' + ( e.clientY - 2 ) +
|
||||
'px;left:' + ( e.clientX - 2 ) +
|
||||
'px;width:5px;height:5px;opacity:0.01' ;
|
||||
}
|
||||
el = el.parentNode ;
|
||||
}
|
||||
return false ;
|
||||
}
|
||||
|
||||
function FCKContextMenu_Document_OnMouseUp( e )
|
||||
{
|
||||
if ( FCKConfig.BrowserContextMenu )
|
||||
return true ;
|
||||
|
||||
var overrideButton = FCKContextMenu_OverrideButton ;
|
||||
|
||||
if ( overrideButton )
|
||||
{
|
||||
var parent = overrideButton.parentNode ;
|
||||
parent.parentNode.removeChild( parent ) ;
|
||||
FCKContextMenu_OverrideButton = undefined ;
|
||||
|
||||
if( e && e.button == 2 )
|
||||
{
|
||||
FCKContextMenu_Document_OnContextMenu( e ) ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
function FCKContextMenu_AttachedElement_OnContextMenu( ev, fckContextMenu, el )
|
||||
{
|
||||
if ( ( fckContextMenu.CtrlDisable && ( ev.ctrlKey || ev.metaKey ) ) || FCKConfig.BrowserContextMenu )
|
||||
return true ;
|
||||
|
||||
var eTarget = el || this ;
|
||||
|
||||
if ( fckContextMenu.OnBeforeOpen )
|
||||
fckContextMenu.OnBeforeOpen.call( fckContextMenu, eTarget ) ;
|
||||
|
||||
if ( fckContextMenu._MenuBlock.Count() == 0 )
|
||||
return false ;
|
||||
|
||||
if ( fckContextMenu._Redraw )
|
||||
{
|
||||
fckContextMenu._MenuBlock.Create( fckContextMenu._Panel.MainNode ) ;
|
||||
fckContextMenu._Redraw = false ;
|
||||
}
|
||||
|
||||
// This will avoid that the content of the context menu can be dragged in IE
|
||||
// as the content of the panel is recreated we need to do it every time
|
||||
FCKTools.DisableSelection( fckContextMenu._Panel.Document.body ) ;
|
||||
|
||||
var x = 0 ;
|
||||
var y = 0 ;
|
||||
if ( FCKBrowserInfo.IsIE )
|
||||
{
|
||||
x = ev.screenX ;
|
||||
y = ev.screenY ;
|
||||
}
|
||||
else if ( FCKBrowserInfo.IsSafari )
|
||||
{
|
||||
x = ev.clientX ;
|
||||
y = ev.clientY ;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = ev.pageX ;
|
||||
y = ev.pageY ;
|
||||
}
|
||||
fckContextMenu._Panel.Show( x, y, ev.currentTarget || null ) ;
|
||||
|
||||
return false ;
|
||||
}
|
||||
|
||||
function FCKContextMenu_MenuBlock_OnClick( menuItem, contextMenu )
|
||||
{
|
||||
contextMenu._Panel.Hide() ;
|
||||
FCKTools.RunFunction( contextMenu.OnItemClick, contextMenu, menuItem ) ;
|
||||
}
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* The Data Processor is responsible for transforming the input and output data
|
||||
* in the editor. For more info:
|
||||
* http://dev.fckeditor.net/wiki/Components/DataProcessor
|
||||
*
|
||||
* The default implementation offers the base XHTML compatibility features of
|
||||
* FCKeditor. Further Data Processors may be implemented for other purposes.
|
||||
*
|
||||
*/
|
||||
|
||||
var FCKDataProcessor = function()
|
||||
{}
|
||||
|
||||
FCKDataProcessor.prototype =
|
||||
{
|
||||
/*
|
||||
* Returns a string representing the HTML format of "data". The returned
|
||||
* value will be loaded in the editor.
|
||||
* The HTML must be from <html> to </html>, including <head>, <body> and
|
||||
* eventually the DOCTYPE.
|
||||
* Note: HTML comments may already be part of the data because of the
|
||||
* pre-processing made with ProtectedSource.
|
||||
* @param {String} data The data to be converted in the
|
||||
* DataProcessor specific format.
|
||||
*/
|
||||
ConvertToHtml : function( data )
|
||||
{
|
||||
// The default data processor must handle two different cases depending
|
||||
// on the FullPage setting. Custom Data Processors will not be
|
||||
// compatible with FullPage, much probably.
|
||||
if ( FCKConfig.FullPage )
|
||||
{
|
||||
// Save the DOCTYPE.
|
||||
FCK.DocTypeDeclaration = data.match( FCKRegexLib.DocTypeTag ) ;
|
||||
|
||||
// Check if the <body> tag is available.
|
||||
if ( !FCKRegexLib.HasBodyTag.test( data ) )
|
||||
data = '<body>' + data + '</body>' ;
|
||||
|
||||
// Check if the <html> tag is available.
|
||||
if ( !FCKRegexLib.HtmlOpener.test( data ) )
|
||||
data = '<html dir="' + FCKConfig.ContentLangDirection + '">' + data + '</html>' ;
|
||||
|
||||
// Check if the <head> tag is available.
|
||||
if ( !FCKRegexLib.HeadOpener.test( data ) )
|
||||
data = data.replace( FCKRegexLib.HtmlOpener, '$&<head><title></title></head>' ) ;
|
||||
|
||||
return data ;
|
||||
}
|
||||
else
|
||||
{
|
||||
var html =
|
||||
FCKConfig.DocType +
|
||||
'<html dir="' + FCKConfig.ContentLangDirection + '"' ;
|
||||
|
||||
// On IE, if you are using a DOCTYPE different of HTML 4 (like
|
||||
// XHTML), you must force the vertical scroll to show, otherwise
|
||||
// the horizontal one may appear when the page needs vertical scrolling.
|
||||
// TODO : Check it with IE7 and make it IE6- if it is the case.
|
||||
if ( FCKBrowserInfo.IsIE && FCKConfig.DocType.length > 0 && !FCKRegexLib.Html4DocType.test( FCKConfig.DocType ) )
|
||||
html += ' style="overflow-y: scroll"' ;
|
||||
|
||||
html += '><head><title></title></head>' +
|
||||
'<body' + FCKConfig.GetBodyAttributes() + '>' +
|
||||
data +
|
||||
'</body></html>' ;
|
||||
|
||||
return html ;
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Converts a DOM (sub-)tree to a string in the data format.
|
||||
* @param {Object} rootNode The node that contains the DOM tree to be
|
||||
* converted to the data format.
|
||||
* @param {Boolean} excludeRoot Indicates that the root node must not
|
||||
* be included in the conversion, only its children.
|
||||
* @param {Boolean} format Indicates that the data must be formatted
|
||||
* for human reading. Not all Data Processors may provide it.
|
||||
*/
|
||||
ConvertToDataFormat : function( rootNode, excludeRoot, ignoreIfEmptyParagraph, format )
|
||||
{
|
||||
var data = FCKXHtml.GetXHTML( rootNode, !excludeRoot, format ) ;
|
||||
|
||||
if ( ignoreIfEmptyParagraph && FCKRegexLib.EmptyOutParagraph.test( data ) )
|
||||
return '' ;
|
||||
|
||||
return data ;
|
||||
},
|
||||
|
||||
/*
|
||||
* Makes any necessary changes to a piece of HTML for insertion in the
|
||||
* editor selection position.
|
||||
* @param {String} html The HTML to be fixed.
|
||||
*/
|
||||
FixHtml : function( html )
|
||||
{
|
||||
return html ;
|
||||
}
|
||||
} ;
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* This is a generic Document Fragment object. It is not intended to provide
|
||||
* the W3C implementation, but is a way to fix the missing of a real Document
|
||||
* Fragment in IE (where document.createDocumentFragment() returns a normal
|
||||
* document instead), giving a standard interface for it.
|
||||
* (IE Implementation)
|
||||
*/
|
||||
|
||||
var FCKDocumentFragment = function( parentDocument, baseDocFrag )
|
||||
{
|
||||
this.RootNode = baseDocFrag || parentDocument.createDocumentFragment() ;
|
||||
}
|
||||
|
||||
FCKDocumentFragment.prototype =
|
||||
{
|
||||
|
||||
// Append the contents of this Document Fragment to another element.
|
||||
AppendTo : function( targetNode )
|
||||
{
|
||||
targetNode.appendChild( this.RootNode ) ;
|
||||
},
|
||||
|
||||
AppendHtml : function( html )
|
||||
{
|
||||
var eTmpDiv = this.RootNode.ownerDocument.createElement( 'div' ) ;
|
||||
eTmpDiv.innerHTML = html ;
|
||||
FCKDomTools.MoveChildren( eTmpDiv, this.RootNode ) ;
|
||||
},
|
||||
|
||||
InsertAfterNode : function( existingNode )
|
||||
{
|
||||
FCKDomTools.InsertAfterNode( existingNode, this.RootNode ) ;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* This is a generic Document Fragment object. It is not intended to provide
|
||||
* the W3C implementation, but is a way to fix the missing of a real Document
|
||||
* Fragment in IE (where document.createDocumentFragment() returns a normal
|
||||
* document instead), giving a standard interface for it.
|
||||
* (IE Implementation)
|
||||
*/
|
||||
|
||||
var FCKDocumentFragment = function( parentDocument )
|
||||
{
|
||||
this._Document = parentDocument ;
|
||||
this.RootNode = parentDocument.createElement( 'div' ) ;
|
||||
}
|
||||
|
||||
// Append the contents of this Document Fragment to another node.
|
||||
FCKDocumentFragment.prototype =
|
||||
{
|
||||
|
||||
AppendTo : function( targetNode )
|
||||
{
|
||||
FCKDomTools.MoveChildren( this.RootNode, targetNode ) ;
|
||||
},
|
||||
|
||||
AppendHtml : function( html )
|
||||
{
|
||||
var eTmpDiv = this._Document.createElement( 'div' ) ;
|
||||
eTmpDiv.innerHTML = html ;
|
||||
FCKDomTools.MoveChildren( eTmpDiv, this.RootNode ) ;
|
||||
},
|
||||
|
||||
InsertAfterNode : function( existingNode )
|
||||
{
|
||||
var eRoot = this.RootNode ;
|
||||
var eLast ;
|
||||
|
||||
while( ( eLast = eRoot.lastChild ) )
|
||||
FCKDomTools.InsertAfterNode( existingNode, eRoot.removeChild( eLast ) ) ;
|
||||
}
|
||||
} ;
|
||||
|
|
@ -0,0 +1,935 @@
|
|||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* Class for working with a selection range, much like the W3C DOM Range, but
|
||||
* it is not intended to be an implementation of the W3C interface.
|
||||
*/
|
||||
|
||||
var FCKDomRange = function( sourceWindow )
|
||||
{
|
||||
this.Window = sourceWindow ;
|
||||
this._Cache = {} ;
|
||||
}
|
||||
|
||||
FCKDomRange.prototype =
|
||||
{
|
||||
|
||||
_UpdateElementInfo : function()
|
||||
{
|
||||
var innerRange = this._Range ;
|
||||
|
||||
if ( !innerRange )
|
||||
this.Release( true ) ;
|
||||
else
|
||||
{
|
||||
// For text nodes, the node itself is the StartNode.
|
||||
var eStart = innerRange.startContainer ;
|
||||
|
||||
var oElementPath = new FCKElementPath( eStart ) ;
|
||||
this.StartNode = eStart.nodeType == 3 ? eStart : eStart.childNodes[ innerRange.startOffset ] ;
|
||||
this.StartContainer = eStart ;
|
||||
this.StartBlock = oElementPath.Block ;
|
||||
this.StartBlockLimit = oElementPath.BlockLimit ;
|
||||
|
||||
if ( innerRange.collapsed )
|
||||
{
|
||||
this.EndNode = this.StartNode ;
|
||||
this.EndContainer = this.StartContainer ;
|
||||
this.EndBlock = this.StartBlock ;
|
||||
this.EndBlockLimit = this.StartBlockLimit ;
|
||||
}
|
||||
else
|
||||
{
|
||||
var eEnd = innerRange.endContainer ;
|
||||
|
||||
if ( eStart != eEnd )
|
||||
oElementPath = new FCKElementPath( eEnd ) ;
|
||||
|
||||
// The innerRange.endContainer[ innerRange.endOffset ] is not
|
||||
// usually part of the range, but the marker for the range end. So,
|
||||
// let's get the previous available node as the real end.
|
||||
var eEndNode = eEnd ;
|
||||
if ( innerRange.endOffset == 0 )
|
||||
{
|
||||
while ( eEndNode && !eEndNode.previousSibling )
|
||||
eEndNode = eEndNode.parentNode ;
|
||||
|
||||
if ( eEndNode )
|
||||
eEndNode = eEndNode.previousSibling ;
|
||||
}
|
||||
else if ( eEndNode.nodeType == 1 )
|
||||
eEndNode = eEndNode.childNodes[ innerRange.endOffset - 1 ] ;
|
||||
|
||||
this.EndNode = eEndNode ;
|
||||
this.EndContainer = eEnd ;
|
||||
this.EndBlock = oElementPath.Block ;
|
||||
this.EndBlockLimit = oElementPath.BlockLimit ;
|
||||
}
|
||||
}
|
||||
|
||||
this._Cache = {} ;
|
||||
},
|
||||
|
||||
CreateRange : function()
|
||||
{
|
||||
return new FCKW3CRange( this.Window.document ) ;
|
||||
},
|
||||
|
||||
DeleteContents : function()
|
||||
{
|
||||
if ( this._Range )
|
||||
{
|
||||
this._Range.deleteContents() ;
|
||||
this._UpdateElementInfo() ;
|
||||
}
|
||||
},
|
||||
|
||||
ExtractContents : function()
|
||||
{
|
||||
if ( this._Range )
|
||||
{
|
||||
var docFrag = this._Range.extractContents() ;
|
||||
this._UpdateElementInfo() ;
|
||||
return docFrag ;
|
||||
}
|
||||
return null ;
|
||||
},
|
||||
|
||||
CheckIsCollapsed : function()
|
||||
{
|
||||
if ( this._Range )
|
||||
return this._Range.collapsed ;
|
||||
|
||||
return false ;
|
||||
},
|
||||
|
||||
Collapse : function( toStart )
|
||||
{
|
||||
if ( this._Range )
|
||||
this._Range.collapse( toStart ) ;
|
||||
|
||||
this._UpdateElementInfo() ;
|
||||
},
|
||||
|
||||
Clone : function()
|
||||
{
|
||||
var oClone = FCKTools.CloneObject( this ) ;
|
||||
|
||||
if ( this._Range )
|
||||
oClone._Range = this._Range.cloneRange() ;
|
||||
|
||||
return oClone ;
|
||||
},
|
||||
|
||||
MoveToNodeContents : function( targetNode )
|
||||
{
|
||||
if ( !this._Range )
|
||||
this._Range = this.CreateRange() ;
|
||||
|
||||
this._Range.selectNodeContents( targetNode ) ;
|
||||
|
||||
this._UpdateElementInfo() ;
|
||||
},
|
||||
|
||||
MoveToElementStart : function( targetElement )
|
||||
{
|
||||
this.SetStart(targetElement,1) ;
|
||||
this.SetEnd(targetElement,1) ;
|
||||
},
|
||||
|
||||
// Moves to the first editing point inside a element. For example, in a
|
||||
// element tree like "<p><b><i></i></b> Text</p>", the start editing point
|
||||
// is "<p><b><i>^</i></b> Text</p>" (inside <i>).
|
||||
MoveToElementEditStart : function( targetElement )
|
||||
{
|
||||
var editableElement ;
|
||||
|
||||
while ( targetElement && targetElement.nodeType == 1 )
|
||||
{
|
||||
if ( FCKDomTools.CheckIsEditable( targetElement ) )
|
||||
editableElement = targetElement ;
|
||||
else if ( editableElement )
|
||||
break ; // If we already found an editable element, stop the loop.
|
||||
|
||||
targetElement = targetElement.firstChild ;
|
||||
}
|
||||
|
||||
if ( editableElement )
|
||||
this.MoveToElementStart( editableElement ) ;
|
||||
},
|
||||
|
||||
InsertNode : function( node )
|
||||
{
|
||||
if ( this._Range )
|
||||
this._Range.insertNode( node ) ;
|
||||
},
|
||||
|
||||
CheckIsEmpty : function()
|
||||
{
|
||||
if ( this.CheckIsCollapsed() )
|
||||
return true ;
|
||||
|
||||
// Inserts the contents of the range in a div tag.
|
||||
var eToolDiv = this.Window.document.createElement( 'div' ) ;
|
||||
this._Range.cloneContents().AppendTo( eToolDiv ) ;
|
||||
|
||||
FCKDomTools.TrimNode( eToolDiv ) ;
|
||||
|
||||
return ( eToolDiv.innerHTML.length == 0 ) ;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the start boundary of the current range is "visually" (like a
|
||||
* selection caret) at the beginning of the block. It means that some
|
||||
* things could be brefore the range, like spaces or empty inline elements,
|
||||
* but it would still be considered at the beginning of the block.
|
||||
*/
|
||||
CheckStartOfBlock : function()
|
||||
{
|
||||
var cache = this._Cache ;
|
||||
var bIsStartOfBlock = cache.IsStartOfBlock ;
|
||||
|
||||
if ( bIsStartOfBlock != undefined )
|
||||
return bIsStartOfBlock ;
|
||||
|
||||
// Take the block reference.
|
||||
var block = this.StartBlock || this.StartBlockLimit ;
|
||||
|
||||
var container = this._Range.startContainer ;
|
||||
var offset = this._Range.startOffset ;
|
||||
var currentNode ;
|
||||
|
||||
if ( offset > 0 )
|
||||
{
|
||||
// First, check the start container. If it is a text node, get the
|
||||
// substring of the node value before the range offset.
|
||||
if ( container.nodeType == 3 )
|
||||
{
|
||||
var textValue = container.nodeValue.substr( 0, offset ).Trim() ;
|
||||
|
||||
// If we have some text left in the container, we are not at
|
||||
// the end for the block.
|
||||
if ( textValue.length != 0 )
|
||||
return cache.IsStartOfBlock = false ;
|
||||
}
|
||||
else
|
||||
currentNode = container.childNodes[ offset - 1 ] ;
|
||||
}
|
||||
|
||||
// We'll not have a currentNode if the container was a text node, or
|
||||
// the offset is zero.
|
||||
if ( !currentNode )
|
||||
currentNode = FCKDomTools.GetPreviousSourceNode( container, true, null, block ) ;
|
||||
|
||||
while ( currentNode )
|
||||
{
|
||||
switch ( currentNode.nodeType )
|
||||
{
|
||||
case 1 :
|
||||
// It's not an inline element.
|
||||
if ( !FCKListsLib.InlineChildReqElements[ currentNode.nodeName.toLowerCase() ] )
|
||||
return cache.IsStartOfBlock = false ;
|
||||
|
||||
break ;
|
||||
|
||||
case 3 :
|
||||
// It's a text node with real text.
|
||||
if ( currentNode.nodeValue.Trim().length > 0 )
|
||||
return cache.IsStartOfBlock = false ;
|
||||
}
|
||||
|
||||
currentNode = FCKDomTools.GetPreviousSourceNode( currentNode, false, null, block ) ;
|
||||
}
|
||||
|
||||
return cache.IsStartOfBlock = true ;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if the end boundary of the current range is "visually" (like a
|
||||
* selection caret) at the end of the block. It means that some things
|
||||
* could be after the range, like spaces, empty inline elements, or a
|
||||
* single <br>, but it would still be considered at the end of the block.
|
||||
*/
|
||||
CheckEndOfBlock : function( refreshSelection )
|
||||
{
|
||||
var isEndOfBlock = this._Cache.IsEndOfBlock ;
|
||||
|
||||
if ( isEndOfBlock != undefined )
|
||||
return isEndOfBlock ;
|
||||
|
||||
// Take the block reference.
|
||||
var block = this.EndBlock || this.EndBlockLimit ;
|
||||
|
||||
var container = this._Range.endContainer ;
|
||||
var offset = this._Range.endOffset ;
|
||||
var currentNode ;
|
||||
|
||||
// First, check the end container. If it is a text node, get the
|
||||
// substring of the node value after the range offset.
|
||||
if ( container.nodeType == 3 )
|
||||
{
|
||||
var textValue = container.nodeValue ;
|
||||
if ( offset < textValue.length )
|
||||
{
|
||||
textValue = textValue.substr( offset ) ;
|
||||
|
||||
// If we have some text left in the container, we are not at
|
||||
// the end for the block.
|
||||
if ( textValue.Trim().length != 0 )
|
||||
return this._Cache.IsEndOfBlock = false ;
|
||||
}
|
||||
}
|
||||
else
|
||||
currentNode = container.childNodes[ offset ] ;
|
||||
|
||||
// We'll not have a currentNode if the container was a text node, of
|
||||
// the offset is out the container children limits (after it probably).
|
||||
if ( !currentNode )
|
||||
currentNode = FCKDomTools.GetNextSourceNode( container, true, null, block ) ;
|
||||
|
||||
var hadBr = false ;
|
||||
|
||||
while ( currentNode )
|
||||
{
|
||||
switch ( currentNode.nodeType )
|
||||
{
|
||||
case 1 :
|
||||
var nodeName = currentNode.nodeName.toLowerCase() ;
|
||||
|
||||
// It's an inline element.
|
||||
if ( FCKListsLib.InlineChildReqElements[ nodeName ] )
|
||||
break ;
|
||||
|
||||
// It is the first <br> found.
|
||||
if ( nodeName == 'br' && !hadBr )
|
||||
{
|
||||
hadBr = true ;
|
||||
break ;
|
||||
}
|
||||
|
||||
return this._Cache.IsEndOfBlock = false ;
|
||||
|
||||
case 3 :
|
||||
// It's a text node with real text.
|
||||
if ( currentNode.nodeValue.Trim().length > 0 )
|
||||
return this._Cache.IsEndOfBlock = false ;
|
||||
}
|
||||
|
||||
currentNode = FCKDomTools.GetNextSourceNode( currentNode, false, null, block ) ;
|
||||
}
|
||||
|
||||
if ( refreshSelection )
|
||||
this.Select() ;
|
||||
|
||||
return this._Cache.IsEndOfBlock = true ;
|
||||
},
|
||||
|
||||
// This is an "intrusive" way to create a bookmark. It includes <span> tags
|
||||
// in the range boundaries. The advantage of it is that it is possible to
|
||||
// handle DOM mutations when moving back to the bookmark.
|
||||
// Attention: the inclusion of nodes in the DOM is a design choice and
|
||||
// should not be changed as there are other points in the code that may be
|
||||
// using those nodes to perform operations. See GetBookmarkNode.
|
||||
// For performance, includeNodes=true if intended to SelectBookmark.
|
||||
CreateBookmark : function( includeNodes )
|
||||
{
|
||||
// Create the bookmark info (random IDs).
|
||||
var oBookmark =
|
||||
{
|
||||
StartId : (new Date()).valueOf() + Math.floor(Math.random()*1000) + 'S',
|
||||
EndId : (new Date()).valueOf() + Math.floor(Math.random()*1000) + 'E'
|
||||
} ;
|
||||
|
||||
var oDoc = this.Window.document ;
|
||||
var eStartSpan ;
|
||||
var eEndSpan ;
|
||||
var oClone ;
|
||||
|
||||
// For collapsed ranges, add just the start marker.
|
||||
if ( !this.CheckIsCollapsed() )
|
||||
{
|
||||
eEndSpan = oDoc.createElement( 'span' ) ;
|
||||
eEndSpan.style.display = 'none' ;
|
||||
eEndSpan.id = oBookmark.EndId ;
|
||||
eEndSpan.setAttribute( '_fck_bookmark', true ) ;
|
||||
|
||||
// For IE, it must have something inside, otherwise it may be
|
||||
// removed during DOM operations.
|
||||
// if ( FCKBrowserInfo.IsIE )
|
||||
eEndSpan.innerHTML = ' ' ;
|
||||
|
||||
oClone = this.Clone() ;
|
||||
oClone.Collapse( false ) ;
|
||||
oClone.InsertNode( eEndSpan ) ;
|
||||
}
|
||||
|
||||
eStartSpan = oDoc.createElement( 'span' ) ;
|
||||
eStartSpan.style.display = 'none' ;
|
||||
eStartSpan.id = oBookmark.StartId ;
|
||||
eStartSpan.setAttribute( '_fck_bookmark', true ) ;
|
||||
|
||||
// For IE, it must have something inside, otherwise it may be removed
|
||||
// during DOM operations.
|
||||
// if ( FCKBrowserInfo.IsIE )
|
||||
eStartSpan.innerHTML = ' ' ;
|
||||
|
||||
oClone = this.Clone() ;
|
||||
oClone.Collapse( true ) ;
|
||||
oClone.InsertNode( eStartSpan ) ;
|
||||
|
||||
if ( includeNodes )
|
||||
{
|
||||
oBookmark.StartNode = eStartSpan ;
|
||||
oBookmark.EndNode = eEndSpan ;
|
||||
}
|
||||
|
||||
// Update the range position.
|
||||
if ( eEndSpan )
|
||||
{
|
||||
this.SetStart( eStartSpan, 4 ) ;
|
||||
this.SetEnd( eEndSpan, 3 ) ;
|
||||
}
|
||||
else
|
||||
this.MoveToPosition( eStartSpan, 4 ) ;
|
||||
|
||||
return oBookmark ;
|
||||
},
|
||||
|
||||
// This one should be a part of a hypothetic "bookmark" object.
|
||||
GetBookmarkNode : function( bookmark, start )
|
||||
{
|
||||
var doc = this.Window.document ;
|
||||
|
||||
if ( start )
|
||||
return bookmark.StartNode || doc.getElementById( bookmark.StartId ) ;
|
||||
else
|
||||
return bookmark.EndNode || doc.getElementById( bookmark.EndId ) ;
|
||||
},
|
||||
|
||||
MoveToBookmark : function( bookmark, preserveBookmark )
|
||||
{
|
||||
var eStartSpan = this.GetBookmarkNode( bookmark, true ) ;
|
||||
var eEndSpan = this.GetBookmarkNode( bookmark, false ) ;
|
||||
|
||||
this.SetStart( eStartSpan, 3 ) ;
|
||||
|
||||
if ( !preserveBookmark )
|
||||
FCKDomTools.RemoveNode( eStartSpan ) ;
|
||||
|
||||
// If collapsed, the end span will not be available.
|
||||
if ( eEndSpan )
|
||||
{
|
||||
this.SetEnd( eEndSpan, 3 ) ;
|
||||
|
||||
if ( !preserveBookmark )
|
||||
FCKDomTools.RemoveNode( eEndSpan ) ;
|
||||
}
|
||||
else
|
||||
this.Collapse( true ) ;
|
||||
|
||||
this._UpdateElementInfo() ;
|
||||
},
|
||||
|
||||
// Non-intrusive bookmark algorithm
|
||||
CreateBookmark2 : function()
|
||||
{
|
||||
// If there is no range then get out of here.
|
||||
// It happens on initial load in Safari #962 and if the editor it's hidden also in Firefox
|
||||
if ( ! this._Range )
|
||||
return { "Start" : 0, "End" : 0 } ;
|
||||
|
||||
// First, we record down the offset values
|
||||
var bookmark =
|
||||
{
|
||||
"Start" : [ this._Range.startOffset ],
|
||||
"End" : [ this._Range.endOffset ]
|
||||
} ;
|
||||
// Since we're treating the document tree as normalized, we need to backtrack the text lengths
|
||||
// of previous text nodes into the offset value.
|
||||
var curStart = this._Range.startContainer.previousSibling ;
|
||||
var curEnd = this._Range.endContainer.previousSibling ;
|
||||
|
||||
// Also note that the node that we use for "address base" would change during backtracking.
|
||||
var addrStart = this._Range.startContainer ;
|
||||
var addrEnd = this._Range.endContainer ;
|
||||
while ( curStart && addrStart.nodeType == 3 )
|
||||
{
|
||||
bookmark.Start[0] += curStart.length ;
|
||||
addrStart = curStart ;
|
||||
curStart = curStart.previousSibling ;
|
||||
}
|
||||
while ( curEnd && addrEnd.nodeType == 3 )
|
||||
{
|
||||
bookmark.End[0] += curEnd.length ;
|
||||
addrEnd = curEnd ;
|
||||
curEnd = curEnd.previousSibling ;
|
||||
}
|
||||
|
||||
// If the object pointed to by the startOffset and endOffset are text nodes, we need
|
||||
// to backtrack and add in the text offset to the bookmark addresses.
|
||||
if ( addrStart.nodeType == 1 && addrStart.childNodes[bookmark.Start[0]] && addrStart.childNodes[bookmark.Start[0]].nodeType == 3 )
|
||||
{
|
||||
var curNode = addrStart.childNodes[bookmark.Start[0]] ;
|
||||
var offset = 0 ;
|
||||
while ( curNode.previousSibling && curNode.previousSibling.nodeType == 3 )
|
||||
{
|
||||
curNode = curNode.previousSibling ;
|
||||
offset += curNode.length ;
|
||||
}
|
||||
addrStart = curNode ;
|
||||
bookmark.Start[0] = offset ;
|
||||
}
|
||||
if ( addrEnd.nodeType == 1 && addrEnd.childNodes[bookmark.End[0]] && addrEnd.childNodes[bookmark.End[0]].nodeType == 3 )
|
||||
{
|
||||
var curNode = addrEnd.childNodes[bookmark.End[0]] ;
|
||||
var offset = 0 ;
|
||||
while ( curNode.previousSibling && curNode.previousSibling.nodeType == 3 )
|
||||
{
|
||||
curNode = curNode.previousSibling ;
|
||||
offset += curNode.length ;
|
||||
}
|
||||
addrEnd = curNode ;
|
||||
bookmark.End[0] = offset ;
|
||||
}
|
||||
|
||||
// Then, we record down the precise position of the container nodes
|
||||
// by walking up the DOM tree and counting their childNode index
|
||||
bookmark.Start = FCKDomTools.GetNodeAddress( addrStart, true ).concat( bookmark.Start ) ;
|
||||
bookmark.End = FCKDomTools.GetNodeAddress( addrEnd, true ).concat( bookmark.End ) ;
|
||||
return bookmark;
|
||||
},
|
||||
|
||||
MoveToBookmark2 : function( bookmark )
|
||||
{
|
||||
// Reverse the childNode counting algorithm in CreateBookmark2()
|
||||
var curStart = FCKDomTools.GetNodeFromAddress( this.Window.document, bookmark.Start.slice( 0, -1 ), true ) ;
|
||||
var curEnd = FCKDomTools.GetNodeFromAddress( this.Window.document, bookmark.End.slice( 0, -1 ), true ) ;
|
||||
|
||||
// Generate the W3C Range object and update relevant data
|
||||
this.Release( true ) ;
|
||||
this._Range = new FCKW3CRange( this.Window.document ) ;
|
||||
var startOffset = bookmark.Start[ bookmark.Start.length - 1 ] ;
|
||||
var endOffset = bookmark.End[ bookmark.End.length - 1 ] ;
|
||||
while ( curStart.nodeType == 3 && startOffset > curStart.length )
|
||||
{
|
||||
if ( ! curStart.nextSibling || curStart.nextSibling.nodeType != 3 )
|
||||
break ;
|
||||
startOffset -= curStart.length ;
|
||||
curStart = curStart.nextSibling ;
|
||||
}
|
||||
while ( curEnd.nodeType == 3 && endOffset > curEnd.length )
|
||||
{
|
||||
if ( ! curEnd.nextSibling || curEnd.nextSibling.nodeType != 3 )
|
||||
break ;
|
||||
endOffset -= curEnd.length ;
|
||||
curEnd = curEnd.nextSibling ;
|
||||
}
|
||||
this._Range.setStart( curStart, startOffset ) ;
|
||||
this._Range.setEnd( curEnd, endOffset ) ;
|
||||
this._UpdateElementInfo() ;
|
||||
},
|
||||
|
||||
MoveToPosition : function( targetElement, position )
|
||||
{
|
||||
this.SetStart( targetElement, position ) ;
|
||||
this.Collapse( true ) ;
|
||||
},
|
||||
|
||||
/*
|
||||
* Moves the position of the start boundary of the range to a specific position
|
||||
* relatively to a element.
|
||||
* @position:
|
||||
* 1 = After Start <target>^contents</target>
|
||||
* 2 = Before End <target>contents^</target>
|
||||
* 3 = Before Start ^<target>contents</target>
|
||||
* 4 = After End <target>contents</target>^
|
||||
*/
|
||||
SetStart : function( targetElement, position, noInfoUpdate )
|
||||
{
|
||||
var oRange = this._Range ;
|
||||
if ( !oRange )
|
||||
oRange = this._Range = this.CreateRange() ;
|
||||
|
||||
switch( position )
|
||||
{
|
||||
case 1 : // After Start <target>^contents</target>
|
||||
oRange.setStart( targetElement, 0 ) ;
|
||||
break ;
|
||||
|
||||
case 2 : // Before End <target>contents^</target>
|
||||
oRange.setStart( targetElement, targetElement.childNodes.length ) ;
|
||||
break ;
|
||||
|
||||
case 3 : // Before Start ^<target>contents</target>
|
||||
oRange.setStartBefore( targetElement ) ;
|
||||
break ;
|
||||
|
||||
case 4 : // After End <target>contents</target>^
|
||||
oRange.setStartAfter( targetElement ) ;
|
||||
}
|
||||
|
||||
if ( !noInfoUpdate )
|
||||
this._UpdateElementInfo() ;
|
||||
},
|
||||
|
||||
/*
|
||||
* Moves the position of the start boundary of the range to a specific position
|
||||
* relatively to a element.
|
||||
* @position:
|
||||
* 1 = After Start <target>^contents</target>
|
||||
* 2 = Before End <target>contents^</target>
|
||||
* 3 = Before Start ^<target>contents</target>
|
||||
* 4 = After End <target>contents</target>^
|
||||
*/
|
||||
SetEnd : function( targetElement, position, noInfoUpdate )
|
||||
{
|
||||
var oRange = this._Range ;
|
||||
if ( !oRange )
|
||||
oRange = this._Range = this.CreateRange() ;
|
||||
|
||||
switch( position )
|
||||
{
|
||||
case 1 : // After Start <target>^contents</target>
|
||||
oRange.setEnd( targetElement, 0 ) ;
|
||||
break ;
|
||||
|
||||
case 2 : // Before End <target>contents^</target>
|
||||
oRange.setEnd( targetElement, targetElement.childNodes.length ) ;
|
||||
break ;
|
||||
|
||||
case 3 : // Before Start ^<target>contents</target>
|
||||
oRange.setEndBefore( targetElement ) ;
|
||||
break ;
|
||||
|
||||
case 4 : // After End <target>contents</target>^
|
||||
oRange.setEndAfter( targetElement ) ;
|
||||
}
|
||||
|
||||
if ( !noInfoUpdate )
|
||||
this._UpdateElementInfo() ;
|
||||
},
|
||||
|
||||
Expand : function( unit )
|
||||
{
|
||||
var oNode, oSibling ;
|
||||
|
||||
switch ( unit )
|
||||
{
|
||||
// Expand the range to include all inline parent elements if we are
|
||||
// are in their boundary limits.
|
||||
// For example (where [ ] are the range limits):
|
||||
// Before => Some <b>[<i>Some sample text]</i></b>.
|
||||
// After => Some [<b><i>Some sample text</i></b>].
|
||||
case 'inline_elements' :
|
||||
// Expand the start boundary.
|
||||
if ( this._Range.startOffset == 0 )
|
||||
{
|
||||
oNode = this._Range.startContainer ;
|
||||
|
||||
if ( oNode.nodeType != 1 )
|
||||
oNode = oNode.previousSibling ? null : oNode.parentNode ;
|
||||
|
||||
if ( oNode )
|
||||
{
|
||||
while ( FCKListsLib.InlineNonEmptyElements[ oNode.nodeName.toLowerCase() ] )
|
||||
{
|
||||
this._Range.setStartBefore( oNode ) ;
|
||||
|
||||
if ( oNode != oNode.parentNode.firstChild )
|
||||
break ;
|
||||
|
||||
oNode = oNode.parentNode ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Expand the end boundary.
|
||||
oNode = this._Range.endContainer ;
|
||||
var offset = this._Range.endOffset ;
|
||||
|
||||
if ( ( oNode.nodeType == 3 && offset >= oNode.nodeValue.length ) || ( oNode.nodeType == 1 && offset >= oNode.childNodes.length ) || ( oNode.nodeType != 1 && oNode.nodeType != 3 ) )
|
||||
{
|
||||
if ( oNode.nodeType != 1 )
|
||||
oNode = oNode.nextSibling ? null : oNode.parentNode ;
|
||||
|
||||
if ( oNode )
|
||||
{
|
||||
while ( FCKListsLib.InlineNonEmptyElements[ oNode.nodeName.toLowerCase() ] )
|
||||
{
|
||||
this._Range.setEndAfter( oNode ) ;
|
||||
|
||||
if ( oNode != oNode.parentNode.lastChild )
|
||||
break ;
|
||||
|
||||
oNode = oNode.parentNode ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break ;
|
||||
|
||||
case 'block_contents' :
|
||||
case 'list_contents' :
|
||||
var boundarySet = FCKListsLib.BlockBoundaries ;
|
||||
if ( unit == 'list_contents' || FCKConfig.EnterMode == 'br' )
|
||||
boundarySet = FCKListsLib.ListBoundaries ;
|
||||
|
||||
if ( this.StartBlock && FCKConfig.EnterMode != 'br' && unit == 'block_contents' )
|
||||
this.SetStart( this.StartBlock, 1 ) ;
|
||||
else
|
||||
{
|
||||
// Get the start node for the current range.
|
||||
oNode = this._Range.startContainer ;
|
||||
|
||||
// If it is an element, get the node right before of it (in source order).
|
||||
if ( oNode.nodeType == 1 )
|
||||
{
|
||||
var lastNode = oNode.childNodes[ this._Range.startOffset ] ;
|
||||
if ( lastNode )
|
||||
oNode = FCKDomTools.GetPreviousSourceNode( lastNode, true ) ;
|
||||
else
|
||||
oNode = oNode.lastChild || oNode ;
|
||||
}
|
||||
|
||||
// We must look for the left boundary, relative to the range
|
||||
// start, which is limited by a block element.
|
||||
while ( oNode
|
||||
&& ( oNode.nodeType != 1
|
||||
|| ( oNode != this.StartBlockLimit
|
||||
&& !boundarySet[ oNode.nodeName.toLowerCase() ] ) ) )
|
||||
{
|
||||
this._Range.setStartBefore( oNode ) ;
|
||||
oNode = oNode.previousSibling || oNode.parentNode ;
|
||||
}
|
||||
}
|
||||
|
||||
if ( this.EndBlock && FCKConfig.EnterMode != 'br' && unit == 'block_contents' && this.EndBlock.nodeName.toLowerCase() != 'li' )
|
||||
this.SetEnd( this.EndBlock, 2 ) ;
|
||||
else
|
||||
{
|
||||
oNode = this._Range.endContainer ;
|
||||
if ( oNode.nodeType == 1 )
|
||||
oNode = oNode.childNodes[ this._Range.endOffset ] || oNode.lastChild ;
|
||||
|
||||
// We must look for the right boundary, relative to the range
|
||||
// end, which is limited by a block element.
|
||||
while ( oNode
|
||||
&& ( oNode.nodeType != 1
|
||||
|| ( oNode != this.StartBlockLimit
|
||||
&& !boundarySet[ oNode.nodeName.toLowerCase() ] ) ) )
|
||||
{
|
||||
this._Range.setEndAfter( oNode ) ;
|
||||
oNode = oNode.nextSibling || oNode.parentNode ;
|
||||
}
|
||||
|
||||
// In EnterMode='br', the end <br> boundary element must
|
||||
// be included in the expanded range.
|
||||
if ( oNode && oNode.nodeName.toLowerCase() == 'br' )
|
||||
this._Range.setEndAfter( oNode ) ;
|
||||
}
|
||||
|
||||
this._UpdateElementInfo() ;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Split the block element for the current range. It deletes the contents
|
||||
* of the range and splits the block in the collapsed position, resulting
|
||||
* in two sucessive blocks. The range is then positioned in the middle of
|
||||
* them.
|
||||
*
|
||||
* It returns and object with the following properties:
|
||||
* - PreviousBlock : a reference to the block element that preceeds
|
||||
* the range after the split.
|
||||
* - NextBlock : a reference to the block element that follows the
|
||||
* range after the split.
|
||||
* - WasStartOfBlock : a boolean indicating that the range was
|
||||
* originaly at the start of the block.
|
||||
* - WasEndOfBlock : a boolean indicating that the range was originaly
|
||||
* at the end of the block.
|
||||
*
|
||||
* If the range was originaly at the start of the block, no split will happen
|
||||
* and the PreviousBlock value will be null. The same is valid for the
|
||||
* NextBlock value if the range was at the end of the block.
|
||||
*/
|
||||
SplitBlock : function( forceBlockTag )
|
||||
{
|
||||
var blockTag = forceBlockTag || FCKConfig.EnterMode ;
|
||||
|
||||
if ( !this._Range )
|
||||
this.MoveToSelection() ;
|
||||
|
||||
// The range boundaries must be in the same "block limit" element.
|
||||
if ( this.StartBlockLimit == this.EndBlockLimit )
|
||||
{
|
||||
// Get the current blocks.
|
||||
var eStartBlock = this.StartBlock ;
|
||||
var eEndBlock = this.EndBlock ;
|
||||
var oElementPath = null ;
|
||||
|
||||
if ( blockTag != 'br' )
|
||||
{
|
||||
if ( !eStartBlock )
|
||||
{
|
||||
eStartBlock = this.FixBlock( true, blockTag ) ;
|
||||
eEndBlock = this.EndBlock ; // FixBlock may have fixed the EndBlock too.
|
||||
}
|
||||
|
||||
if ( !eEndBlock )
|
||||
eEndBlock = this.FixBlock( false, blockTag ) ;
|
||||
}
|
||||
|
||||
// Get the range position.
|
||||
var bIsStartOfBlock = ( eStartBlock != null && this.CheckStartOfBlock() ) ;
|
||||
var bIsEndOfBlock = ( eEndBlock != null && this.CheckEndOfBlock() ) ;
|
||||
|
||||
// Delete the current contents.
|
||||
if ( !this.CheckIsEmpty() )
|
||||
this.DeleteContents() ;
|
||||
|
||||
if ( eStartBlock && eEndBlock && eStartBlock == eEndBlock )
|
||||
{
|
||||
if ( bIsEndOfBlock )
|
||||
{
|
||||
oElementPath = new FCKElementPath( this.StartContainer ) ;
|
||||
this.MoveToPosition( eEndBlock, 4 ) ;
|
||||
eEndBlock = null ;
|
||||
}
|
||||
else if ( bIsStartOfBlock )
|
||||
{
|
||||
oElementPath = new FCKElementPath( this.StartContainer ) ;
|
||||
this.MoveToPosition( eStartBlock, 3 ) ;
|
||||
eStartBlock = null ;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Extract the contents of the block from the selection point to the end of its contents.
|
||||
this.SetEnd( eStartBlock, 2 ) ;
|
||||
var eDocFrag = this.ExtractContents() ;
|
||||
|
||||
// Duplicate the block element after it.
|
||||
eEndBlock = eStartBlock.cloneNode( false ) ;
|
||||
eEndBlock.removeAttribute( 'id', false ) ;
|
||||
|
||||
// Place the extracted contents in the duplicated block.
|
||||
eDocFrag.AppendTo( eEndBlock ) ;
|
||||
|
||||
FCKDomTools.InsertAfterNode( eStartBlock, eEndBlock ) ;
|
||||
|
||||
this.MoveToPosition( eStartBlock, 4 ) ;
|
||||
|
||||
// In Gecko, the last child node must be a bogus <br>.
|
||||
// Note: bogus <br> added under <ul> or <ol> would cause lists to be incorrectly rendered.
|
||||
if ( FCKBrowserInfo.IsGecko &&
|
||||
! eStartBlock.nodeName.IEquals( ['ul', 'ol'] ) )
|
||||
FCKTools.AppendBogusBr( eStartBlock ) ;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
PreviousBlock : eStartBlock,
|
||||
NextBlock : eEndBlock,
|
||||
WasStartOfBlock : bIsStartOfBlock,
|
||||
WasEndOfBlock : bIsEndOfBlock,
|
||||
ElementPath : oElementPath
|
||||
} ;
|
||||
}
|
||||
|
||||
return null ;
|
||||
},
|
||||
|
||||
// Transform a block without a block tag in a valid block (orphan text in the body or td, usually).
|
||||
FixBlock : function( isStart, blockTag )
|
||||
{
|
||||
// Bookmark the range so we can restore it later.
|
||||
var oBookmark = this.CreateBookmark() ;
|
||||
|
||||
// Collapse the range to the requested ending boundary.
|
||||
this.Collapse( isStart ) ;
|
||||
|
||||
// Expands it to the block contents.
|
||||
this.Expand( 'block_contents' ) ;
|
||||
|
||||
// Create the fixed block.
|
||||
var oFixedBlock = this.Window.document.createElement( blockTag ) ;
|
||||
|
||||
// Move the contents of the temporary range to the fixed block.
|
||||
this.ExtractContents().AppendTo( oFixedBlock ) ;
|
||||
FCKDomTools.TrimNode( oFixedBlock ) ;
|
||||
|
||||
// If the fixed block is empty (not counting bookmark nodes)
|
||||
// Add a <br /> inside to expand it.
|
||||
if ( FCKDomTools.CheckIsEmptyElement(oFixedBlock, function( element ) { return element.getAttribute('_fck_bookmark') != 'true' ; } )
|
||||
&& FCKBrowserInfo.IsGeckoLike )
|
||||
FCKTools.AppendBogusBr( oFixedBlock ) ;
|
||||
|
||||
// Insert the fixed block into the DOM.
|
||||
this.InsertNode( oFixedBlock ) ;
|
||||
|
||||
// Move the range back to the bookmarked place.
|
||||
this.MoveToBookmark( oBookmark ) ;
|
||||
|
||||
return oFixedBlock ;
|
||||
},
|
||||
|
||||
Release : function( preserveWindow )
|
||||
{
|
||||
if ( !preserveWindow )
|
||||
this.Window = null ;
|
||||
|
||||
this.StartNode = null ;
|
||||
this.StartContainer = null ;
|
||||
this.StartBlock = null ;
|
||||
this.StartBlockLimit = null ;
|
||||
this.EndNode = null ;
|
||||
this.EndContainer = null ;
|
||||
this.EndBlock = null ;
|
||||
this.EndBlockLimit = null ;
|
||||
this._Range = null ;
|
||||
this._Cache = null ;
|
||||
},
|
||||
|
||||
CheckHasRange : function()
|
||||
{
|
||||
return !!this._Range ;
|
||||
},
|
||||
|
||||
GetTouchedStartNode : function()
|
||||
{
|
||||
var range = this._Range ;
|
||||
var container = range.startContainer ;
|
||||
|
||||
if ( range.collapsed || container.nodeType != 1 )
|
||||
return container ;
|
||||
|
||||
return container.childNodes[ range.startOffset ] || container ;
|
||||
},
|
||||
|
||||
GetTouchedEndNode : function()
|
||||
{
|
||||
var range = this._Range ;
|
||||
var container = range.endContainer ;
|
||||
|
||||
if ( range.collapsed || container.nodeType != 1 )
|
||||
return container ;
|
||||
|
||||
return container.childNodes[ range.endOffset - 1 ] || container ;
|
||||
}
|
||||
} ;
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* Class for working with a selection range, much like the W3C DOM Range, but
|
||||
* it is not intended to be an implementation of the W3C interface.
|
||||
* (Gecko Implementation)
|
||||
*/
|
||||
|
||||
FCKDomRange.prototype.MoveToSelection = function()
|
||||
{
|
||||
this.Release( true ) ;
|
||||
|
||||
var oSel = this.Window.getSelection() ;
|
||||
|
||||
if ( oSel && oSel.rangeCount > 0 )
|
||||
{
|
||||
this._Range = FCKW3CRange.CreateFromRange( this.Window.document, oSel.getRangeAt(0) ) ;
|
||||
this._UpdateElementInfo() ;
|
||||
}
|
||||
else
|
||||
if ( this.Window.document )
|
||||
this.MoveToElementStart( this.Window.document.body ) ;
|
||||
}
|
||||
|
||||
FCKDomRange.prototype.Select = function()
|
||||
{
|
||||
var oRange = this._Range ;
|
||||
if ( oRange )
|
||||
{
|
||||
var startContainer = oRange.startContainer ;
|
||||
|
||||
// If we have a collapsed range, inside an empty element, we must add
|
||||
// something to it, otherwise the caret will not be visible.
|
||||
if ( oRange.collapsed && startContainer.nodeType == 1 && startContainer.childNodes.length == 0 )
|
||||
startContainer.appendChild( oRange._Document.createTextNode('') ) ;
|
||||
|
||||
var oDocRange = this.Window.document.createRange() ;
|
||||
oDocRange.setStart( startContainer, oRange.startOffset ) ;
|
||||
|
||||
try
|
||||
{
|
||||
oDocRange.setEnd( oRange.endContainer, oRange.endOffset ) ;
|
||||
}
|
||||
catch ( e )
|
||||
{
|
||||
// There is a bug in Firefox implementation (it would be too easy
|
||||
// otherwise). The new start can't be after the end (W3C says it can).
|
||||
// So, let's create a new range and collapse it to the desired point.
|
||||
if ( e.toString().Contains( 'NS_ERROR_ILLEGAL_VALUE' ) )
|
||||
{
|
||||
oRange.collapse( true ) ;
|
||||
oDocRange.setEnd( oRange.endContainer, oRange.endOffset ) ;
|
||||
}
|
||||
else
|
||||
throw( e ) ;
|
||||
}
|
||||
|
||||
var oSel = this.Window.getSelection() ;
|
||||
oSel.removeAllRanges() ;
|
||||
|
||||
// We must add a clone otherwise Firefox will have rendering issues.
|
||||
oSel.addRange( oDocRange ) ;
|
||||
}
|
||||
}
|
||||
|
||||
// Not compatible with bookmark created with CreateBookmark2.
|
||||
// The bookmark nodes will be deleted from the document.
|
||||
FCKDomRange.prototype.SelectBookmark = function( bookmark )
|
||||
{
|
||||
var domRange = this.Window.document.createRange() ;
|
||||
|
||||
var startNode = this.GetBookmarkNode( bookmark, true ) ;
|
||||
var endNode = this.GetBookmarkNode( bookmark, false ) ;
|
||||
|
||||
domRange.setStart( startNode.parentNode, FCKDomTools.GetIndexOf( startNode ) ) ;
|
||||
FCKDomTools.RemoveNode( startNode ) ;
|
||||
|
||||
if ( endNode )
|
||||
{
|
||||
domRange.setEnd( endNode.parentNode, FCKDomTools.GetIndexOf( endNode ) ) ;
|
||||
FCKDomTools.RemoveNode( endNode ) ;
|
||||
}
|
||||
|
||||
var selection = this.Window.getSelection() ;
|
||||
selection.removeAllRanges() ;
|
||||
selection.addRange( domRange ) ;
|
||||
}
|
||||
|
|
@ -0,0 +1,199 @@
|
|||
/*
|
||||
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
|
||||
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
|
||||
*
|
||||
* == BEGIN LICENSE ==
|
||||
*
|
||||
* Licensed under the terms of any of the following licenses at your
|
||||
* choice:
|
||||
*
|
||||
* - GNU General Public License Version 2 or later (the "GPL")
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
|
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* - Mozilla Public License Version 1.1 or later (the "MPL")
|
||||
* http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
*
|
||||
* == END LICENSE ==
|
||||
*
|
||||
* Class for working with a selection range, much like the W3C DOM Range, but
|
||||
* it is not intended to be an implementation of the W3C interface.
|
||||
* (IE Implementation)
|
||||
*/
|
||||
|
||||
FCKDomRange.prototype.MoveToSelection = function()
|
||||
{
|
||||
this.Release( true ) ;
|
||||
|
||||
this._Range = new FCKW3CRange( this.Window.document ) ;
|
||||
|
||||
var oSel = this.Window.document.selection ;
|
||||
|
||||
if ( oSel.type != 'Control' )
|
||||
{
|
||||
var eMarkerStart = this._GetSelectionMarkerTag( true ) ;
|
||||
var eMarkerEnd = this._GetSelectionMarkerTag( false ) ;
|
||||
|
||||
if ( !eMarkerStart && !eMarkerEnd )
|
||||
{
|
||||
this._Range.setStart( this.Window.document.body, 0 ) ;
|
||||
this._UpdateElementInfo() ;
|
||||
return ;
|
||||
}
|
||||
|
||||
// Set the start boundary.
|
||||
this._Range.setStart( eMarkerStart.parentNode, FCKDomTools.GetIndexOf( eMarkerStart ) ) ;
|
||||
eMarkerStart.parentNode.removeChild( eMarkerStart ) ;
|
||||
|
||||
// Set the end boundary.
|
||||
this._Range.setEnd( eMarkerEnd.parentNode, FCKDomTools.GetIndexOf( eMarkerEnd ) ) ;
|
||||
eMarkerEnd.parentNode.removeChild( eMarkerEnd ) ;
|
||||
|
||||
this._UpdateElementInfo() ;
|
||||
}
|
||||
else
|
||||
{
|
||||
var oControl = oSel.createRange().item(0) ;
|
||||
|
||||
if ( oControl )
|
||||
{
|
||||
this._Range.setStartBefore( oControl ) ;
|
||||
this._Range.setEndAfter( oControl ) ;
|
||||
this._UpdateElementInfo() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FCKDomRange.prototype.Select = function( forceExpand )
|
||||
{
|
||||
if ( this._Range )
|
||||
this.SelectBookmark( this.CreateBookmark( true ), forceExpand ) ;
|
||||
}
|
||||
|
||||
// Not compatible with bookmark created with CreateBookmark2.
|
||||
// The bookmark nodes will be deleted from the document.
|
||||
FCKDomRange.prototype.SelectBookmark = function( bookmark, forceExpand )
|
||||
{
|
||||
var bIsCollapsed = this.CheckIsCollapsed() ;
|
||||
var bIsStartMakerAlone ;
|
||||
var dummySpan ;
|
||||
|
||||
// Create marker tags for the start and end boundaries.
|
||||
var eStartMarker = this.GetBookmarkNode( bookmark, true ) ;
|
||||
|
||||
if ( !eStartMarker )
|
||||
return ;
|
||||
|
||||
var eEndMarker ;
|
||||
if ( !bIsCollapsed )
|
||||
eEndMarker = this.GetBookmarkNode( bookmark, false ) ;
|
||||
|
||||
// Create the main range which will be used for the selection.
|
||||
var oIERange = this.Window.document.body.createTextRange() ;
|
||||
|
||||
// Position the range at the start boundary.
|
||||
oIERange.moveToElementText( eStartMarker ) ;
|
||||
oIERange.moveStart( 'character', 1 ) ;
|
||||
|
||||
if ( eEndMarker )
|
||||
{
|
||||
// Create a tool range for the end.
|
||||
var oIERangeEnd = this.Window.document.body.createTextRange() ;
|
||||
|
||||
// Position the tool range at the end.
|
||||
oIERangeEnd.moveToElementText( eEndMarker ) ;
|
||||
|
||||
// Move the end boundary of the main range to match the tool range.
|
||||
oIERange.setEndPoint( 'EndToEnd', oIERangeEnd ) ;
|
||||
oIERange.moveEnd( 'character', -1 ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
bIsStartMakerAlone = ( forceExpand || !eStartMarker.previousSibling || eStartMarker.previousSibling.nodeName.toLowerCase() == 'br' ) && !eStartMarker.nextSibing ;
|
||||
|
||||
// Append a temporary <span></span> before the selection.
|
||||
// This is needed to avoid IE destroying selections inside empty
|
||||
// inline elements, like <b></b> (#253).
|
||||
// It is also needed when placing the selection right after an inline
|
||||
// element to avoid the selection moving inside of it.
|
||||
dummySpan = this.Window.document.createElement( 'span' ) ;
|
||||
dummySpan.innerHTML = '' ; // Zero Width No-Break Space (U+FEFF). See #1359.
|
||||
eStartMarker.parentNode.insertBefore( dummySpan, eStartMarker ) ;
|
||||
|
||||
if ( bIsStartMakerAlone )
|
||||
{
|
||||
// To expand empty blocks or line spaces after <br>, we need
|
||||
// instead to have any char, which will be later deleted using the
|
||||
// selection.
|
||||
// \ufeff = Zero Width No-Break Space (U+FEFF). See #1359.
|
||||
eStartMarker.parentNode.insertBefore( this.Window.document.createTextNode( '\ufeff' ), eStartMarker ) ;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !this._Range )
|
||||
this._Range = this.CreateRange() ;
|
||||
|
||||
// Remove the markers (reset the position, because of the changes in the DOM tree).
|
||||
this._Range.setStartBefore( eStartMarker ) ;
|
||||
eStartMarker.parentNode.removeChild( eStartMarker ) ;
|
||||
|
||||
if ( bIsCollapsed )
|
||||
{
|
||||
if ( bIsStartMakerAlone )
|
||||
{
|
||||
// Move the selection start to include the temporary .
|
||||
oIERange.moveStart( 'character', -1 ) ;
|
||||
|
||||
oIERange.select() ;
|
||||
|
||||
// Remove our temporary stuff.
|
||||
this.Window.document.selection.clear() ;
|
||||
}
|
||||
else
|
||||
oIERange.select() ;
|
||||
|
||||
FCKDomTools.RemoveNode( dummySpan ) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._Range.setEndBefore( eEndMarker ) ;
|
||||
eEndMarker.parentNode.removeChild( eEndMarker ) ;
|
||||
oIERange.select() ;
|
||||
}
|
||||
}
|
||||
|
||||
FCKDomRange.prototype._GetSelectionMarkerTag = function( toStart )
|
||||
{
|
||||
var doc = this.Window.document ;
|
||||
var selection = doc.selection ;
|
||||
|
||||
// Get a range for the start boundary.
|
||||
var oRange ;
|
||||
|
||||
// IE may throw an "unspecified error" on some cases (it happened when
|
||||
// loading _samples/default.html), so try/catch.
|
||||
try
|
||||
{
|
||||
oRange = selection.createRange() ;
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
return null ;
|
||||
}
|
||||
|
||||
// IE might take the range object to the main window instead of inside the editor iframe window.
|
||||
// This is known to happen when the editor window has not been selected before (See #933).
|
||||
// We need to avoid that.
|
||||
if ( oRange.parentElement().document != doc )
|
||||
return null ;
|
||||
|
||||
oRange.collapse( toStart === true ) ;
|
||||
|
||||
// Paste a marker element at the collapsed range and get it from the DOM.
|
||||
var sMarkerId = 'fck_dom_range_temp_' + (new Date()).valueOf() + '_' + Math.floor(Math.random()*1000) ;
|
||||
oRange.pasteHTML( '<span id="' + sMarkerId + '"></span>' ) ;
|
||||
|
||||
return doc.getElementById( sMarkerId ) ;
|
||||
}
|
||||