cheditor4 first commit

This commit is contained in:
kagla
2021-06-25 11:26:13 +00:00
parent f27e4c3c0c
commit b3b92d4e1c
200 changed files with 16174 additions and 1 deletions

2
.gitignore vendored
View File

@ -9,7 +9,7 @@ test.php
log
g5_tree
cheditor5.*/
ckeditor*/
!ckeditor*/
log/
g5_tree/
.vscode/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,39 @@
CKEditor 4
==========
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
http://ckeditor.com - See LICENSE.md for license information.
CKEditor is a text editor to be used inside web pages. It's not a replacement
for desktop text editors like Word or OpenOffice, but a component to be used as
part of web applications and websites.
## Documentation
The full editor documentation is available online at the following address:
https://ckeditor.com/docs/ckeditor4/latest/
## Installation
Installing CKEditor is an easy task. Just follow these simple steps:
1. **Download** the latest version from the CKEditor website:
http://ckeditor.com. You should have already completed this step, but be
sure you have the very latest version.
2. **Extract** (decompress) the downloaded file into the root of your website.
**Note:** CKEditor is by default installed in the `ckeditor` folder. You can
place the files in whichever you want though.
## Checking Your Installation
The editor comes with a few sample pages that can be used to verify that
installation proceeded properly. Take a look at the `samples` directory.
To test your installation, just call the following page at your website:
http://<your site>/<CKEditor installation path>/samples/index.html
For example:
http://www.example.com/ckeditor/samples/index.html

View File

@ -0,0 +1,10 @@
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
(function(a){if("undefined"==typeof a)throw Error("jQuery should be loaded before CKEditor jQuery adapter.");if("undefined"==typeof CKEDITOR)throw Error("CKEditor should be loaded before CKEditor jQuery adapter.");CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},
ckeditor:function(g,d){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g)){var m=d;d=g;g=m}var k=[];d=d||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(arguments.callee,100)},0)},
null,null,9999);else{if(d.autoUpdateElement||"undefined"==typeof d.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)d.autoUpdateElementJquery=!0;d.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",!0);c=a(this).is("textarea")?CKEDITOR.replace(h,d):CKEDITOR.inline(h,d);b.data("ckeditorInstance",c);c.on("instanceReady",function(d){var e=d.editor;setTimeout(function(){if(e.element){d.removeListener();e.on("dataReady",function(){b.trigger("dataReady.ckeditor",[e])});e.on("setData",function(a){b.trigger("setData.ckeditor",
[e,a.data])});e.on("getData",function(a){b.trigger("getData.ckeditor",[e,a.data])},999);e.on("destroy",function(){b.trigger("destroy.ckeditor",[e])});e.on("save",function(){a(h.form).submit();return!1},null,null,20);if(e.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){e.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",
c)})}e.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[e]);g&&g.apply(e,[h]);l.resolve()}else setTimeout(arguments.callee,100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,k).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}});CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(d){if(arguments.length){var m=
this,k=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(d,function(){f.resolve()});k.push(f.promise());return!0}return g.call(b,d)});if(k.length){var b=new a.Deferred;a.when.apply(this,k).done(function(){b.resolveWith(m)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}}))})(window.jQuery);

View File

@ -0,0 +1,96 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
/**
* This file was added automatically by CKEditor builder.
* You may re-use it at any time to build CKEditor again.
*
* If you would like to build CKEditor online again
* (for example to upgrade), visit one the following links:
*
* (1) http://ckeditor.com/builder
* Visit online builder to build CKEditor from scratch.
*
* (2) http://ckeditor.com/builder/cd112ec67b59a67f8332bedaf04833cd
* Visit online builder to build CKEditor, starting with the same setup as before.
*
* (3) http://ckeditor.com/builder/download/cd112ec67b59a67f8332bedaf04833cd
* Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
*
* NOTE:
* This file is not used by CKEditor, you may remove it.
* Changing this file will not change your CKEditor configuration.
*/
var CKBUILDER_CONFIG = {
skin: 'office2013',
preset: 'full',
ignore: [
'.DS_Store',
'.bender',
'.editorconfig',
'.gitattributes',
'.gitignore',
'.idea',
'.jscsrc',
'.jshintignore',
'.jshintrc',
'.mailmap',
'.npm',
'.travis.yml',
'bender-err.log',
'bender-out.log',
'bender.ci.js',
'bender.js',
'dev',
'gruntfile.js',
'less',
'node_modules',
'package.json',
'tests'
],
plugins : {
'about' : 1,
'basicstyles' : 1,
'blockquote' : 1,
'clipboard' : 1,
'colorbutton' : 1,
'contextmenu' : 1,
'elementspath' : 1,
'enterkey' : 1,
'entities' : 1,
'filebrowser' : 1,
'floatingspace' : 1,
'font' : 1,
'htmlwriter' : 1,
'image' : 1,
'indentlist' : 1,
'justify' : 1,
'link' : 1,
'list' : 1,
'magicline' : 1,
'maximize' : 1,
'notificationaggregator' : 1,
'removeformat' : 1,
'resize' : 1,
'showblocks' : 1,
'showborders' : 1,
'sourcearea' : 1,
'tab' : 1,
'table' : 1,
'tableselection' : 1,
'tabletools' : 1,
'toolbar' : 1,
'undo' : 1,
'widget' : 1,
'wysiwygarea' : 1
},
languages : {
'en' : 1,
'ja' : 1,
'ko' : 1,
'zh-cn' : 1
}
};

1178
plugin/editor/ckeditor4/ckeditor.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,91 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see https://ckeditor.com/legal/ckeditor-oss-license
*/
// 모바일 체크
if(typeof(g5_is_mobile) == "undefined") g5_is_mobile = false;
CKEDITOR.editorConfig = function( config ) {
// 에디터 높이 설정
if(typeof(editor_height) != "undefined") {
config.height = editor_height+"px";
}
// 언어 설정
config.language = 'ko';
// 글꼴관련
config.font_names = '맑은 고딕;굴림;굴림체;궁서;궁서체;돋움;돋움체;바탕;바탕체;'; // + CKEDITOR.config.font_names;
config.font_defaultLabel = '맑은 고딕';
//config.font_defaultLabel = 'Malgun Gothic';
// 글자크기 출력
config.fontSize_sizes = '8pt;9pt;10pt;11pt;12pt;14pt;16pt;20pt;24pt;30pt;48pt;60pt;72pt;';
// 툴바 기능버튼 순서
config.toolbarGroups = [
{ name: '1', groups: [ 'styles', 'align', 'basicstyles', 'cleanup' ] },
{ name: '2', groups: [ 'insertImg', 'insert', 'colors', 'list', 'blocks', 'links', 'mode', 'tools', 'about' ] }
];
// 미노출 기능버튼
if(g5_is_mobile) {
//--- 모바일 ---//
config.removeButtons = 'Print,Cut,Copy,Paste,Subscript,Superscript,Anchor,Unlink,ShowBlocks,Undo,Redo,Smiley,Font';
} else {
//--- PC ---//
config.removeButtons = 'Print,Cut,Copy,Paste,Subscript,Superscript,Anchor,Unlink,ShowBlocks,Undo,Redo,Smiley';
}
/* 이미지 업로드 관련 소스 */
var up_url = "/upload.php?type=Images";
if( typeof(g5_editor_url) != "undefined" ) {
up_url = g5_editor_url + up_url;
} else {
up_url = "/plugin/editor/ckeditor4" + up_url;
}
// 에디터 구분
if(typeof(editor_id) != "undefined" && editor_id != "") {
up_url += "&editor_id="+editor_id;
}
// 업로드 경로 - editor_uri
if(typeof(editor_uri) != "undefined" && editor_uri != "") {
up_url += "&editor_uri="+editor_uri;
}
// 업로드 이미지용 토큰
if( typeof(editor_form_name) != "undefined" && editor_form_name != "") {
up_url += "&editor_form_name="+editor_form_name;
}
// 업로드 페이지 URL 선언
config.filebrowserImageUploadUrl = up_url;
// 이미지 다이얼로그 수정
CKEDITOR.on('dialogDefinition', function (ev) {
var dialogName = ev.data.name;
var dialog = ev.data.definition.dialog;
var dialogDefinition = ev.data.definition;
if (dialogName == 'image') {
dialog.on('show', function (obj) {
//this.selectPage('Upload'); //업로드텝으로 시작
});
dialogDefinition.removeContents('advanced'); // 자세히탭 제거
dialogDefinition.removeContents('Link'); // 링크탭 제거
var infoTab = dialogDefinition.getContents('info');
infoTab.remove('txtHSpace');
infoTab.remove('txtVSpace');
infoTab.remove('htmlPreview'); // 미리보기 제거
}
});
// 사용할 플러그인 추가
config.extraPlugins = 'uploadwidget,uploadimage';
// 본문내용 불러들일때 속성유지
config.allowedContent = true;
// iOS만 적용
if(/iPhone|iPad|iPod/i.test(navigator.userAgent) ) {
// 한글 입력 관련 줄바꿈 과정에서 문제발생하여 적용
config.removePlugins = 'enterkey';
}
};

View File

@ -0,0 +1,237 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
body
{
/* Font */
font-family: Arial,"돋움",Dotum;
/* Text color */
color: #333;
/* Remove the background color to make it transparent */
background-color: #fff;
margin: 20px;
}
@media all and (min-width:701px) {
body {
font-size: 0.875em;
}
}
@media all and (max-width:700px) {
body {
font-size: 1em
}
}
.cke_editable
{
/*
font-size: 13px;
line-height: 1.6;
*/
/* Fix for missing scrollbars with RTL texts. (#10488) */
font-family: "Malgun Gothic", "맑은 고딕";
/*font-size: 11pt;*/
line-height: 1.8;
word-wrap: break-word;
}
blockquote
{
/*font-style: italic;*/
/*font-family: Georgia, Times, "Times New Roman", serif;*/
padding: 2px 0;
border-style: solid;
border-color: #000;
border-width: 0;
margin:0;
}
.cke_contents_ltr blockquote
{
padding-left: 10px;
padding-right: 8px;
border-left-width: 3px;
}
.cke_contents_rtl blockquote
{
padding-left: 8px;
padding-right: 10px;
border-right-width: 3px;
}
p
{
margin:0;
padding:0;
}
a
{
color: #0782C1;
}
ol,ul,dl
{
/* IE7: reset rtl list margin. (#7334) */
*margin-right: 0px;
/* preserved spaces for list items with text direction other than the list. (#6249,#8049)*/
padding: 0 40px;
}
h1,h2,h6
{
font-weight: normal;
line-height: 1.2;
}
hr
{
border: 0px;
border-top: 1px solid #ccc;
}
p img
{
vertical-align:middle;
}
img.right
{
border: 1px solid #ccc;
float: right;
margin-left: 15px;
padding: 5px;
}
img.left
{
border: 1px solid #ccc;
float: left;
margin-right: 15px;
padding: 5px;
}
pre
{
white-space: pre-wrap; /* CSS 2.1 */
word-wrap: break-word; /* IE7 */
-moz-tab-size: 4;
tab-size: 4;
}
.marker
{
background-color: Yellow;
}
span[lang]
{
font-style: italic;
}
figure
{
text-align: center;
border: solid 1px #ccc;
border-radius: 2px;
background: rgba(0,0,0,0.05);
padding: 10px;
margin: 10px 20px;
display: inline-block;
}
figure > figcaption
{
text-align: center;
display: block; /* For IE8 */
}
a > img {
padding: 1px;
margin: 1px;
border: none;
outline: 1px solid #0782C1;
}
/* Widget Styles */
.code-featured
{
border: 5px solid red;
}
.math-featured
{
padding: 20px;
box-shadow: 0 0 2px rgba(200, 0, 0, 1);
background-color: rgba(255, 0, 0, 0.05);
margin: 10px;
}
.image-clean
{
border: 0;
background: none;
padding: 0;
}
.image-clean > figcaption
{
font-size: .9em;
text-align: right;
}
.image-grayscale
{
background-color: white;
color: #666;
}
.image-grayscale img, img.image-grayscale
{
filter: grayscale(100%);
}
.embed-240p
{
max-width: 426px;
max-height: 240px;
margin:0 auto;
}
.embed-360p
{
max-width: 640px;
max-height: 360px;
margin:0 auto;
}
.embed-480p
{
max-width: 854px;
max-height: 480px;
margin:0 auto;
}
.embed-720p
{
max-width: 1280px;
max-height: 720px;
margin:0 auto;
}
.embed-1080p
{
max-width: 1920px;
max-height: 1080px;
margin:0 auto;
}

View File

@ -0,0 +1 @@
.cke_editable {background:#161b22;color:#ddd}

View File

@ -0,0 +1,121 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
function editor_html($id, $content, $is_dhtml_editor=true)
{
global $g5, $config, $is_mobile, $w, $board, $write;
static $js = true;
if(
$is_dhtml_editor && $content &&
(
(!$w && (isset($board['bo_insert_content']) && !empty($board['bo_insert_content'])))
|| ($w == 'u' && isset($write['wr_option']) && strpos($write['wr_option'], 'html') === false )
)
){ //글쓰기 기본 내용 처리
if( preg_match('/\r|\n/', $content) && $content === strip_tags($content, '<a><strong><b>') ) { //textarea로 작성되고, html 내용이 없다면
$content = nl2br($content);
}
}
$editor_url = G5_EDITOR_URL.'/'.$config['cf_editor'];
$html = "";
$html .= "<span class=\"sound_only\">웹에디터 시작</span>";
if (!$is_mobile && $is_dhtml_editor) {
$html .= '<script>document.write("<div class=\'cke_sc\'><!--<button type=\'button\' class=\'btn_cke_sc\'>단축키 일람</button>--></div>");</script>';
}
if ($is_dhtml_editor && $js) {
switch($id) {
case "wr_content": $editor_height = 350; break;
default : $editor_height = 200; break;
}
$html .= "\n".'<script src="'.$editor_url.'/ckeditor.js?v=210624"></script>';
$html .= "\n".'<script>var g5_editor_url = "'.$editor_url.'";</script>';
$html .= "\n".'<script src="'.$editor_url.'/config.js?v=210624"></script>';
$html .= "\n<script>";
$html .= '
var editor_id = "'.$id.'", // 에디터 구분
editor_height = '.$editor_height.', // 에디터 높이
editor_chk_upload = true, // 업로드 상태
editor_uri = "'.urlencode($_SERVER['REQUEST_URI']).'"; // 업로드 경로
$(function(){
$(".btn_cke_sc").click(function(){
if ($(this).next("div.cke_sc_def").length) {
$(this).next("div.cke_sc_def").remove();
$(this).text("단축키 일람");
} else {
$(this).after("<div class=\'cke_sc_def\' />").next("div.cke_sc_def").load("'.$editor_url.'/shortcut.html");
$(this).text("단축키 일람 닫기");
}
});
$(".btn_cke_sc_close").live("click",function(){
$(this).parent("div.cke_sc_def").remove();
});
});';
$html .= "\n</script>";
$js = false;
}
// 로딩상태 띄우기 (에디터 사용상태일때만)
if($is_dhtml_editor) {
// 에디터 사용상태일때 textarea 숨기기
$editor_taDisplay = "border:none;";
$html .= "
<style>
.editor_loading { position: absolute; left: 50%; top: 50%; z-index: 1; margin: -25px 0 0 -25px; border: 5px solid #f3f3f3; border-radius: 50%; border-top: 5px solid #3498db; width: 30px; height: 30px; -webkit-animation: spin 2s linear infinite; animation: spin 2s linear infinite; }
@-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
</style>
";
$html .= "<div class=\"editor_loading\"></div>".PHP_EOL; // 로딩이미지 출력 부
$html .= "
<script>
CKEDITOR.on( 'instanceLoaded', function (e) {
var loader = $(\"div.editor_loading\").css(\"display\",\"none\");
});
</script>
";
}
$ckeditor_class = $is_dhtml_editor ? "ckeditor" : "";
$html .= "\n<textarea id=\"$id\" name=\"$id\" class=\"$ckeditor_class\" maxlength=\"65536\" style=\"height:{$editor_height}px; {$editor_taDisplay}\">$content</textarea>";
$html .= "\n<span class=\"sound_only\">웹 에디터 끝</span>";
// 현재 폼이름 GET
$html .= "<script> var editor_form_name = document.getElementById('{$id}').form.name; </script>";
return $html;
}
// textarea 로 값을 넘긴다. javascript 반드시 필요
function get_editor_js($id, $is_dhtml_editor=true)
{
$print_js = "";
if ($is_dhtml_editor) {
$print_js .= "var {$id}_editor_data = CKEDITOR.instances.{$id}.getData();\n";
} else {
$print_js .= "var {$id}_editor = document.getElementById('{$id}');\n";
}
return $print_js;
}
// textarea 의 값이 비어 있는지 검사
function chk_editor_js($id, $is_dhtml_editor=true)
{
$print_js = "";
if ($is_dhtml_editor) {
$print_js .= "if (!{$id}_editor_data) { alert(\"내용을 입력해 주십시오.\"); CKEDITOR.instances.{$id}.focus(); return false; }\n";
$print_js .= "if (typeof(f.{$id})!=\"undefined\") f.{$id}.value = {$id}_editor_data;\n";
// 썸네일 이미지경로 원본파일로 변경
$print_js .= "
var temp_data = {$id}_editor_data.replace(/thumb\-([_\d\.]+)_\d+x\d+/gim, function(res1, res2) { return res2; });
CKEDITOR.instances.wr_content.setData(temp_data);".PHP_EOL;
} else {
$print_js .= "if (!{$id}_editor.value) { alert(\"내용을 입력해 주십시오.\"); {$id}_editor.focus(); return false; }\n";
}
$print_js .= "if(typeof(editor_chk_upload) != \"undefined\" && !editor_chk_upload) { alert(\"이미지가 업로드 중 입니다.\"); return false; }\n";
return $print_js;
}
?>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,8 @@
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.dialog.add("about",function(a){a=a.lang.about;var b=CKEDITOR.getUrl(CKEDITOR.plugins.get("about").path+"dialogs/"+(CKEDITOR.env.hidpi?"hidpi/":"")+"logo_ckeditor.png");return{title:a.dlgTitle,minWidth:390,minHeight:210,contents:[{id:"tab1",label:"",title:"",expand:!0,padding:0,elements:[{type:"html",html:'\x3cstyle type\x3d"text/css"\x3e.cke_about_container{color:#000 !important;padding:10px 10px 0;margin-top:5px}.cke_about_container p{margin: 0 0 10px;}.cke_about_container .cke_about_logo{height:81px;background-color:#fff;background-image:url('+
b+");"+(CKEDITOR.env.hidpi?"background-size:194px 58px;":"")+'background-position:center; background-repeat:no-repeat;margin-bottom:10px;}.cke_about_container a{cursor:pointer !important;color:#00B2CE !important;text-decoration:underline !important;}.cke_about_container \x3e p,.cke_rtl .cke_about_container \x3e p{text-align:center;}\x3c/style\x3e\x3cdiv class\x3d"cke_about_container"\x3e\x3cdiv class\x3d"cke_about_logo"\x3e\x3c/div\x3e\x3cp\x3eCKEditor '+CKEDITOR.version+" (revision "+CKEDITOR.revision+
')\x3cbr\x3e\x3ca target\x3d"_blank" rel\x3d"noopener noreferrer" href\x3d"https://ckeditor.com/"\x3ehttps://ckeditor.com\x3c/a\x3e\x3c/p\x3e\x3cp\x3e'+a.moreInfo+'\x3cbr\x3e\x3ca target\x3d"_blank" rel\x3d"noopener noreferrer" href\x3d"https://ckeditor.com/legal/ckeditor-oss-license/"\x3ehttps://ckeditor.com/legal/ckeditor-oss-license/\x3c/a\x3e\x3c/p\x3e\x3cp\x3e'+a.copy.replace("$1",'\x3ca target\x3d"_blank" rel\x3d"noopener noreferrer" href\x3d"https://cksource.com/"\x3eCKSource\x3c/a\x3e - Frederico Knabben')+
"\x3c/p\x3e\x3c/div\x3e"}]}],buttons:[CKEDITOR.dialog.cancelButton]}});

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -0,0 +1,11 @@
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.dialog.add("paste",function(c){function k(a){var b=new CKEDITOR.dom.document(a.document),g=b.getBody(),d=b.getById("cke_actscrpt");d&&d.remove();g.setAttribute("contenteditable",!0);g.on(e.mainPasteEvent,function(a){a=e.initPasteDataTransfer(a);f?a!=f&&(f=e.initPasteDataTransfer()):f=a});if(CKEDITOR.env.ie&&8>CKEDITOR.env.version)b.getWindow().on("blur",function(){b.$.selection.empty()});b.on("keydown",function(a){a=a.data;var b;switch(a.getKeystroke()){case 27:this.hide();b=1;break;case 9:case CKEDITOR.SHIFT+
9:this.changeFocus(1),b=1}b&&a.preventDefault()},this);c.fire("ariaWidget",new CKEDITOR.dom.element(a.frameElement));b.getWindow().getFrame().removeCustomData("pendingFocus")&&g.focus()}var h=c.lang.clipboard,e=CKEDITOR.plugins.clipboard,f;c.on("pasteDialogCommit",function(a){a.data&&c.fire("paste",{type:"auto",dataValue:a.data.dataValue,method:"paste",dataTransfer:a.data.dataTransfer||e.initPasteDataTransfer()})},null,null,1E3);return{title:h.paste,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?370:
350,minHeight:CKEDITOR.env.quirks?250:245,onShow:function(){this.parts.dialog.$.offsetHeight;this.setupContent();this._.committed=!1},onLoad:function(){(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&"rtl"==c.lang.dir&&this.parts.contents.setStyle("overflow","hidden")},onOk:function(){this.commitContent()},contents:[{id:"general",label:c.lang.common.generalTab,elements:[{type:"html",id:"pasteMsg",html:'\x3cdiv style\x3d"white-space:normal;width:340px"\x3e'+h.pasteMsg+"\x3c/div\x3e"},{type:"html",
id:"editing_area",style:"width:100%;height:100%",html:"",focus:function(){var a=this.getInputElement(),b=a.getFrameDocument().getBody();!b||b.isReadOnly()?a.setCustomData("pendingFocus",1):b.focus()},setup:function(){var a=this.getDialog(),b='\x3chtml dir\x3d"'+c.config.contentsLangDirection+'" lang\x3d"'+(c.config.contentsLanguage||c.langCode)+'"\x3e\x3chead\x3e\x3cstyle\x3ebody{margin:3px;height:95%;word-break:break-all;}\x3c/style\x3e\x3c/head\x3e\x3cbody\x3e\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"\x3ewindow.parent.CKEDITOR.tools.callFunction('+
CKEDITOR.tools.addFunction(k,a)+",this);\x3c/script\x3e\x3c/body\x3e\x3c/html\x3e",g=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+'})())"':"",d=CKEDITOR.dom.element.createFromHtml('\x3ciframe class\x3d"cke_pasteframe" frameborder\x3d"0" allowTransparency\x3d"true" src\x3d"'+g+'" aria-label\x3d"'+h.pasteArea+'" aria-describedby\x3d"'+a.getContentElement("general",
"pasteMsg").domId+'"\x3e\x3c/iframe\x3e');f=null;d.on("load",function(a){a.removeListener();a=d.getFrameDocument();a.write(b);c.focusManager.add(a.getBody());CKEDITOR.env.air&&k.call(this,a.getWindow().$)},a);d.setCustomData("dialog",a);a=this.getElement();a.setHtml("");a.append(d);if(CKEDITOR.env.ie&&!CKEDITOR.env.edge){var e=CKEDITOR.dom.element.createFromHtml('\x3cspan tabindex\x3d"-1" style\x3d"position:absolute" role\x3d"presentation"\x3e\x3c/span\x3e');e.on("focus",function(){setTimeout(function(){d.$.contentWindow.focus()})});
a.append(e);this.focus=function(){e.focus();this.fire("focus")}}this.getInputElement=function(){return d};CKEDITOR.env.ie&&(a.setStyle("display","block"),a.setStyle("height",d.$.offsetHeight+2+"px"))},commit:function(){var a=this.getDialog().getParentEditor(),b=this.getInputElement().getFrameDocument().getBody(),c=b.getBogus();c&&c.remove();b=b.getHtml();this.getDialog()._.committed=!0;a.fire("pasteDialogCommit",{dataValue:b,dataTransfer:f||e.initPasteDataTransfer()})}}]}]}});

View File

@ -0,0 +1,4 @@
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,44 @@
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
(function(){var u=function(d,k){function u(){var a=arguments,b=this.getContentElement("advanced","txtdlgGenStyle");b&&b.commit.apply(b,a);this.foreach(function(b){b.commit&&"txtdlgGenStyle"!=b.id&&b.commit.apply(b,a)})}function g(a){if(!v){v=1;var b=this.getDialog(),c=b.imageElement;if(c){this.commit(1,c);a=[].concat(a);for(var d=a.length,h,e=0;e<d;e++)(h=b.getContentElement.apply(b,a[e].split(":")))&&h.setup(1,c)}v=0}}var l=/^\s*(\d+)((px)|\%)?\s*$/i,y=/(^\s*(\d+)((px)|\%)?\s*$)|^$/i,q=/^\d+px$/,
z=function(){var a=this.getValue(),b=this.getDialog(),c=a.match(l);c&&("%"==c[2]&&m(b,!1),a=c[1]);b.lockRatio&&(c=b.originalElement,"true"==c.getCustomData("isReady")&&("txtHeight"==this.id?(a&&"0"!=a&&(a=Math.round(a/c.$.height*c.$.width)),isNaN(a)||b.setValueOf("info","txtWidth",a)):(a&&"0"!=a&&(a=Math.round(a/c.$.width*c.$.height)),isNaN(a)||b.setValueOf("info","txtHeight",a))));e(b)},e=function(a){if(!a.originalElement||!a.preview)return 1;a.commitContent(4,a.preview);return 0},v,m=function(a,
b){if(!a.getContentElement("info","ratioLock"))return null;var c=a.originalElement;if(!c)return null;if("check"==b){if(!a.userlockRatio&&"true"==c.getCustomData("isReady")){var d=a.getValueOf("info","txtWidth"),h=a.getValueOf("info","txtHeight"),c=c.$.width/c.$.height,e=d/h;a.lockRatio=!1;d||h?1==Math.round(c/e*100)/100&&(a.lockRatio=!0):a.lockRatio=!0}}else void 0!==b?a.lockRatio=b:(a.userlockRatio=1,a.lockRatio=!a.lockRatio);d=CKEDITOR.document.getById(r);a.lockRatio?d.removeClass("cke_btn_unlocked"):
d.addClass("cke_btn_unlocked");d.setAttribute("aria-checked",a.lockRatio);CKEDITOR.env.hc&&d.getChild(0).setHtml(a.lockRatio?CKEDITOR.env.ie?"■":"▣":CKEDITOR.env.ie?"□":"▢");return a.lockRatio},A=function(a,b){var c=a.originalElement;if("true"==c.getCustomData("isReady")){var d=a.getContentElement("info","txtWidth"),h=a.getContentElement("info","txtHeight"),f;b?c=f=0:(f=c.$.width,c=c.$.height);d&&d.setValue(f);h&&h.setValue(c)}e(a)},B=function(a,b){function c(a,b){var c=a.match(l);return c?("%"==
c[2]&&(c[1]+="%",m(d,!1)),c[1]):b}if(1==a){var d=this.getDialog(),e="",f="txtWidth"==this.id?"width":"height",g=b.getAttribute(f);g&&(e=c(g,e));e=c(b.getStyle(f),e);this.setValue(e)}},w,t=function(){var a=this.originalElement,b=CKEDITOR.document.getById(n);a.setCustomData("isReady","true");a.removeListener("load",t);a.removeListener("error",f);a.removeListener("abort",f);b&&b.setStyle("display","none");this.dontResetSize||A(this,!1===d.config.image_prefillDimensions);this.firstLoad&&CKEDITOR.tools.setTimeout(function(){m(this,
"check")},0,this);this.dontResetSize=this.firstLoad=!1;e(this)},f=function(){var a=this.originalElement,b=CKEDITOR.document.getById(n);a.removeListener("load",t);a.removeListener("error",f);a.removeListener("abort",f);a=CKEDITOR.getUrl(CKEDITOR.plugins.get("image").path+"images/noimage.png");this.preview&&this.preview.setAttribute("src",a);b&&b.setStyle("display","none");m(this,!1)},p=function(a){return CKEDITOR.tools.getNextId()+"_"+a},r=p("btnLockSizes"),x=p("btnResetSize"),n=p("ImagePreviewLoader"),
D=p("previewLink"),C=p("previewImage");return{title:d.lang.image["image"==k?"title":"titleButton"],minWidth:"moono-lisa"==(CKEDITOR.skinName||d.config.skin)?500:420,minHeight:360,onShow:function(){this.linkEditMode=this.imageEditMode=this.linkElement=this.imageElement=!1;this.lockRatio=!0;this.userlockRatio=0;this.dontResetSize=!1;this.firstLoad=!0;this.addLink=!1;var a=this.getParentEditor(),b=a.getSelection(),c=(b=b&&b.getSelectedElement())&&a.elementPath(b).contains("a",1),d=CKEDITOR.document.getById(n);
d&&d.setStyle("display","none");w=new CKEDITOR.dom.element("img",a.document);this.preview=CKEDITOR.document.getById(C);this.originalElement=a.document.createElement("img");this.originalElement.setAttribute("alt","");this.originalElement.setCustomData("isReady","false");c&&(this.linkElement=c,this.addLink=this.linkEditMode=!0,a=c.getChildren(),1==a.count()&&(d=a.getItem(0),d.type==CKEDITOR.NODE_ELEMENT&&(d.is("img")||d.is("input"))&&(this.imageElement=a.getItem(0),this.imageElement.is("img")?this.imageEditMode=
"img":this.imageElement.is("input")&&(this.imageEditMode="input"))),"image"==k&&this.setupContent(2,c));if(this.customImageElement)this.imageEditMode="img",this.imageElement=this.customImageElement,delete this.customImageElement;else if(b&&"img"==b.getName()&&!b.data("cke-realelement")||b&&"input"==b.getName()&&"image"==b.getAttribute("type"))this.imageEditMode=b.getName(),this.imageElement=b;this.imageEditMode&&(this.cleanImageElement=this.imageElement,this.imageElement=this.cleanImageElement.clone(!0,
!0),this.setupContent(1,this.imageElement));m(this,!0);CKEDITOR.tools.trim(this.getValueOf("info","txtUrl"))||(this.preview.removeAttribute("src"),this.preview.setStyle("display","none"))},onOk:function(){if(this.imageEditMode){var a=this.imageEditMode;"image"==k&&"input"==a&&confirm(d.lang.image.button2Img)?(this.imageElement=d.document.createElement("img"),this.imageElement.setAttribute("alt",""),d.insertElement(this.imageElement)):"image"!=k&&"img"==a&&confirm(d.lang.image.img2Button)?(this.imageElement=
d.document.createElement("input"),this.imageElement.setAttributes({type:"image",alt:""}),d.insertElement(this.imageElement)):(this.imageElement=this.cleanImageElement,delete this.cleanImageElement)}else"image"==k?this.imageElement=d.document.createElement("img"):(this.imageElement=d.document.createElement("input"),this.imageElement.setAttribute("type","image")),this.imageElement.setAttribute("alt","");this.linkEditMode||(this.linkElement=d.document.createElement("a"));this.commitContent(1,this.imageElement);
this.commitContent(2,this.linkElement);this.imageElement.getAttribute("style")||this.imageElement.removeAttribute("style");this.imageEditMode?!this.linkEditMode&&this.addLink?(d.insertElement(this.linkElement),this.imageElement.appendTo(this.linkElement)):this.linkEditMode&&!this.addLink&&(d.getSelection().selectElement(this.linkElement),d.insertElement(this.imageElement)):this.addLink?this.linkEditMode?this.linkElement.equals(d.getSelection().getSelectedElement())?(this.linkElement.setHtml(""),this.linkElement.append(this.imageElement,
!1)):d.insertElement(this.imageElement):(d.insertElement(this.linkElement),this.linkElement.append(this.imageElement,!1)):d.insertElement(this.imageElement)},onLoad:function(){"image"!=k&&this.hidePage("Link");var a=this._.element.getDocument();this.getContentElement("info","ratioLock")&&(this.addFocusable(a.getById(x),5),this.addFocusable(a.getById(r),5));this.commitContent=u},onHide:function(){this.preview&&this.commitContent(8,this.preview);this.originalElement&&(this.originalElement.removeListener("load",
t),this.originalElement.removeListener("error",f),this.originalElement.removeListener("abort",f),this.originalElement.remove(),this.originalElement=!1);delete this.imageElement},contents:[{id:"info",label:d.lang.image.infoTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["280px","110px"],align:"right",className:"cke_dialog_image_url",children:[{id:"txtUrl",type:"text",label:d.lang.common.url,required:!0,onChange:function(){var a=this.getDialog(),b=this.getValue();if(0<
b.length){var a=this.getDialog(),c=a.originalElement;a.preview&&a.preview.removeStyle("display");c.setCustomData("isReady","false");var d=CKEDITOR.document.getById(n);d&&d.setStyle("display","");c.on("load",t,a);c.on("error",f,a);c.on("abort",f,a);c.setAttribute("src",b);a.preview&&(w.setAttribute("src",b),a.preview.setAttribute("src",w.$.src),e(a))}else a.preview&&(a.preview.removeAttribute("src"),a.preview.setStyle("display","none"))},setup:function(a,b){if(1==a){var c=b.data("cke-saved-src")||
b.getAttribute("src");this.getDialog().dontResetSize=!0;this.setValue(c);this.setInitValue()}},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())?(b.data("cke-saved-src",this.getValue()),b.setAttribute("src",this.getValue())):8==a&&(b.setAttribute("src",""),b.removeAttribute("src"))},validate:CKEDITOR.dialog.validate.notEmpty(d.lang.image.urlMissing)},{type:"button",id:"browse",style:"display:inline-block;margin-top:14px;",align:"center",label:d.lang.common.browseServer,hidden:!0,filebrowser:"info:txtUrl"}]}]},
{id:"txtAlt",type:"text",label:d.lang.image.alt,accessKey:"T","default":"",onChange:function(){e(this.getDialog())},setup:function(a,b){1==a&&this.setValue(b.getAttribute("alt"))},commit:function(a,b){1==a?(this.getValue()||this.isChanged())&&b.setAttribute("alt",this.getValue()):4==a?b.setAttribute("alt",this.getValue()):8==a&&b.removeAttribute("alt")}},{type:"hbox",children:[{id:"basic",type:"vbox",children:[{type:"hbox",requiredContent:"img{width,height}",widths:["50%","50%"],children:[{type:"vbox",
padding:1,children:[{type:"text",width:"45px",id:"txtWidth",label:d.lang.common.width,onKeyUp:z,onChange:function(){g.call(this,"advanced:txtdlgGenStyle")},validate:function(){var a=this.getValue().match(y);(a=!(!a||0===parseInt(a[1],10)))||alert(d.lang.common.invalidLength.replace("%1",d.lang.common.width).replace("%2","px, %"));return a},setup:B,commit:function(a,b){var c=this.getValue();1==a?(c&&d.activeFilter.check("img{width,height}")?b.setStyle("width",CKEDITOR.tools.cssLength(c)):b.removeStyle("width"),
b.removeAttribute("width")):4==a?c.match(l)?b.setStyle("width",CKEDITOR.tools.cssLength(c)):(c=this.getDialog().originalElement,"true"==c.getCustomData("isReady")&&b.setStyle("width",c.$.width+"px")):8==a&&(b.removeAttribute("width"),b.removeStyle("width"))}},{type:"text",id:"txtHeight",width:"45px",label:d.lang.common.height,onKeyUp:z,onChange:function(){g.call(this,"advanced:txtdlgGenStyle")},validate:function(){var a=this.getValue().match(y);(a=!(!a||0===parseInt(a[1],10)))||alert(d.lang.common.invalidLength.replace("%1",
d.lang.common.height).replace("%2","px, %"));return a},setup:B,commit:function(a,b){var c=this.getValue();1==a?(c&&d.activeFilter.check("img{width,height}")?b.setStyle("height",CKEDITOR.tools.cssLength(c)):b.removeStyle("height"),b.removeAttribute("height")):4==a?c.match(l)?b.setStyle("height",CKEDITOR.tools.cssLength(c)):(c=this.getDialog().originalElement,"true"==c.getCustomData("isReady")&&b.setStyle("height",c.$.height+"px")):8==a&&(b.removeAttribute("height"),b.removeStyle("height"))}}]},{id:"ratioLock",
type:"html",className:"cke_dialog_image_ratiolock",style:"margin-top:30px;width:40px;height:40px;",onLoad:function(){var a=CKEDITOR.document.getById(x),b=CKEDITOR.document.getById(r);a&&(a.on("click",function(a){A(this);a.data&&a.data.preventDefault()},this.getDialog()),a.on("mouseover",function(){this.addClass("cke_btn_over")},a),a.on("mouseout",function(){this.removeClass("cke_btn_over")},a));b&&(b.on("click",function(a){m(this);var b=this.originalElement,d=this.getValueOf("info","txtWidth");"true"==
b.getCustomData("isReady")&&d&&(b=b.$.height/b.$.width*d,isNaN(b)||(this.setValueOf("info","txtHeight",Math.round(b)),e(this)));a.data&&a.data.preventDefault()},this.getDialog()),b.on("mouseover",function(){this.addClass("cke_btn_over")},b),b.on("mouseout",function(){this.removeClass("cke_btn_over")},b))},html:'\x3cdiv\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"'+d.lang.image.lockRatio+'" class\x3d"cke_btn_locked" id\x3d"'+r+'" role\x3d"checkbox"\x3e\x3cspan class\x3d"cke_icon"\x3e\x3c/span\x3e\x3cspan class\x3d"cke_label"\x3e'+
d.lang.image.lockRatio+'\x3c/span\x3e\x3c/a\x3e\x3ca href\x3d"javascript:void(0)" tabindex\x3d"-1" title\x3d"'+d.lang.image.resetSize+'" class\x3d"cke_btn_reset" id\x3d"'+x+'" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3e'+d.lang.image.resetSize+"\x3c/span\x3e\x3c/a\x3e\x3c/div\x3e"}]},{type:"vbox",padding:1,children:[{type:"text",id:"txtBorder",requiredContent:"img{border-width}",width:"60px",label:d.lang.image.border,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){g.call(this,
"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateBorder),setup:function(a,b){if(1==a){var c;c=(c=(c=b.getStyle("border-width"))&&c.match(/^(\d+px)(?: \1 \1 \1)?$/))&&parseInt(c[1],10);isNaN(parseInt(c,10))&&(c=b.getAttribute("border"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&b.removeStyle("border"):(b.setStyle("border-width",CKEDITOR.tools.cssLength(c)),b.setStyle("border-style",
"solid")),1==a&&b.removeAttribute("border")):8==a&&(b.removeAttribute("border"),b.removeStyle("border-width"),b.removeStyle("border-style"),b.removeStyle("border-color"))}},{type:"text",id:"txtHSpace",requiredContent:"img{margin-left,margin-right}",width:"60px",label:d.lang.image.hSpace,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){g.call(this,"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateHSpace),setup:function(a,b){if(1==a){var c,
d;c=b.getStyle("margin-left");d=b.getStyle("margin-right");c=c&&c.match(q);d=d&&d.match(q);c=parseInt(c,10);d=parseInt(d,10);c=c==d&&c;isNaN(parseInt(c,10))&&(c=b.getAttribute("hspace"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&(b.removeStyle("margin-left"),b.removeStyle("margin-right")):(b.setStyle("margin-left",CKEDITOR.tools.cssLength(c)),b.setStyle("margin-right",CKEDITOR.tools.cssLength(c))),1==a&&b.removeAttribute("hspace")):
8==a&&(b.removeAttribute("hspace"),b.removeStyle("margin-left"),b.removeStyle("margin-right"))}},{type:"text",id:"txtVSpace",requiredContent:"img{margin-top,margin-bottom}",width:"60px",label:d.lang.image.vSpace,"default":"",onKeyUp:function(){e(this.getDialog())},onChange:function(){g.call(this,"advanced:txtdlgGenStyle")},validate:CKEDITOR.dialog.validate.integer(d.lang.image.validateVSpace),setup:function(a,b){if(1==a){var c,d;c=b.getStyle("margin-top");d=b.getStyle("margin-bottom");c=c&&c.match(q);
d=d&&d.match(q);c=parseInt(c,10);d=parseInt(d,10);c=c==d&&c;isNaN(parseInt(c,10))&&(c=b.getAttribute("vspace"));this.setValue(c)}},commit:function(a,b){var c=parseInt(this.getValue(),10);1==a||4==a?(isNaN(c)?!c&&this.isChanged()&&(b.removeStyle("margin-top"),b.removeStyle("margin-bottom")):(b.setStyle("margin-top",CKEDITOR.tools.cssLength(c)),b.setStyle("margin-bottom",CKEDITOR.tools.cssLength(c))),1==a&&b.removeAttribute("vspace")):8==a&&(b.removeAttribute("vspace"),b.removeStyle("margin-top"),b.removeStyle("margin-bottom"))}},
{id:"cmbAlign",requiredContent:"img{float}",type:"select",widths:["35%","65%"],style:"width:90px",label:d.lang.common.align,"default":"",items:[[d.lang.common.notSet,""],[d.lang.common.left,"left"],[d.lang.common.right,"right"]],onChange:function(){e(this.getDialog());g.call(this,"advanced:txtdlgGenStyle")},setup:function(a,b){if(1==a){var c=b.getStyle("float");switch(c){case "inherit":case "none":c=""}!c&&(c=(b.getAttribute("align")||"").toLowerCase());this.setValue(c)}},commit:function(a,b){var c=
this.getValue();if(1==a||4==a){if(c?b.setStyle("float",c):b.removeStyle("float"),1==a)switch(c=(b.getAttribute("align")||"").toLowerCase(),c){case "left":case "right":b.removeAttribute("align")}}else 8==a&&b.removeStyle("float")}}]}]},{type:"vbox",height:"250px",children:[{type:"html",id:"htmlPreview",style:"width:95%;",html:"\x3cdiv\x3e"+CKEDITOR.tools.htmlEncode(d.lang.common.preview)+'\x3cbr\x3e\x3cdiv id\x3d"'+n+'" class\x3d"ImagePreviewLoader" style\x3d"display:none"\x3e\x3cdiv class\x3d"loading"\x3e\x26nbsp;\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"ImagePreviewBox"\x3e\x3ctable\x3e\x3ctr\x3e\x3ctd\x3e\x3ca href\x3d"javascript:void(0)" target\x3d"_blank" onclick\x3d"return false;" id\x3d"'+
D+'"\x3e\x3cimg id\x3d"'+C+'" alt\x3d"" /\x3e\x3c/a\x3e'+(d.config.image_previewText||"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.")+
"\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/div\x3e"}]}]}]},{id:"Link",requiredContent:"a[href]",label:d.lang.image.linkTab,padding:0,elements:[{id:"txtUrl",type:"text",label:d.lang.common.url,style:"width: 100%","default":"",setup:function(a,b){if(2==a){var c=b.data("cke-saved-href");c||(c=b.getAttribute("href"));this.setValue(c)}},commit:function(a,b){if(2==a&&(this.getValue()||this.isChanged())){var c=this.getValue();b.data("cke-saved-href",c);b.setAttribute("href",c);this.getValue()||
!d.config.image_removeLinkByEmptyURL?this.getDialog().addLink=!0:this.getDialog().addLink=!1}}},{type:"button",id:"browse",className:"cke_dialog_image_browse",filebrowser:{action:"Browse",target:"Link:txtUrl",url:d.config.filebrowserImageBrowseLinkUrl},style:"float:right",hidden:!0,label:d.lang.common.browseServer},{id:"cmbTarget",type:"select",requiredContent:"a[target]",label:d.lang.common.target,"default":"",items:[[d.lang.common.notSet,""],[d.lang.common.targetNew,"_blank"],[d.lang.common.targetTop,
"_top"],[d.lang.common.targetSelf,"_self"],[d.lang.common.targetParent,"_parent"]],setup:function(a,b){2==a&&this.setValue(b.getAttribute("target")||"")},commit:function(a,b){2==a&&(this.getValue()||this.isChanged())&&b.setAttribute("target",this.getValue())}}]},{id:"Upload",hidden:!0,filebrowser:"uploadButton",label:d.lang.image.upload,elements:[{type:"file",id:"upload",label:d.lang.image.btnUpload,style:"height:40px",size:38},{type:"fileButton",id:"uploadButton",filebrowser:"info:txtUrl",label:d.lang.image.btnUpload,
"for":["Upload","upload"]}]},{id:"advanced",label:d.lang.common.advancedTab,elements:[{type:"hbox",widths:["50%","25%","25%"],children:[{type:"text",id:"linkId",requiredContent:"img[id]",label:d.lang.common.id,setup:function(a,b){1==a&&this.setValue(b.getAttribute("id"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("id",this.getValue())}},{id:"cmbLangDir",type:"select",requiredContent:"img[dir]",style:"width : 100px;",label:d.lang.common.langDir,"default":"",items:[[d.lang.common.notSet,
""],[d.lang.common.langDirLtr,"ltr"],[d.lang.common.langDirRtl,"rtl"]],setup:function(a,b){1==a&&this.setValue(b.getAttribute("dir"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("dir",this.getValue())}},{type:"text",id:"txtLangCode",requiredContent:"img[lang]",label:d.lang.common.langCode,"default":"",setup:function(a,b){1==a&&this.setValue(b.getAttribute("lang"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("lang",this.getValue())}}]},
{type:"text",id:"txtGenLongDescr",requiredContent:"img[longdesc]",label:d.lang.common.longDescr,setup:function(a,b){1==a&&this.setValue(b.getAttribute("longDesc"))},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("longDesc",this.getValue())}},{type:"hbox",widths:["50%","50%"],children:[{type:"text",id:"txtGenClass",requiredContent:"img(cke-xyz)",label:d.lang.common.cssClass,"default":"",setup:function(a,b){1==a&&this.setValue(b.getAttribute("class"))},commit:function(a,
b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("class",this.getValue())}},{type:"text",id:"txtGenTitle",requiredContent:"img[title]",label:d.lang.common.advisoryTitle,"default":"",onChange:function(){e(this.getDialog())},setup:function(a,b){1==a&&this.setValue(b.getAttribute("title"))},commit:function(a,b){1==a?(this.getValue()||this.isChanged())&&b.setAttribute("title",this.getValue()):4==a?b.setAttribute("title",this.getValue()):8==a&&b.removeAttribute("title")}}]},{type:"text",id:"txtdlgGenStyle",
requiredContent:"img{cke-xyz}",label:d.lang.common.cssStyle,validate:CKEDITOR.dialog.validate.inlineStyle(d.lang.common.invalidInlineStyle),"default":"",setup:function(a,b){if(1==a){var c=b.getAttribute("style");!c&&b.$.style.cssText&&(c=b.$.style.cssText);this.setValue(c);var d=b.$.style.height,c=b.$.style.width,d=(d?d:"").match(l),c=(c?c:"").match(l);this.attributesInStyle={height:!!d,width:!!c}}},onChange:function(){g.call(this,"info:cmbFloat info:cmbAlign info:txtVSpace info:txtHSpace info:txtBorder info:txtWidth info:txtHeight".split(" "));
e(this)},commit:function(a,b){1==a&&(this.getValue()||this.isChanged())&&b.setAttribute("style",this.getValue())}}]}]}};CKEDITOR.dialog.add("image",function(d){return u(d,"image")});CKEDITOR.dialog.add("imagebutton",function(d){return u(d,"imagebutton")})})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,8 @@
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.dialog.add("anchor",function(c){function e(b,a){return b.createFakeElement(b.document.createElement("a",{attributes:a}),"cke_anchor","anchor")}return{title:c.lang.link.anchor.title,minWidth:300,minHeight:60,onOk:function(){var b=CKEDITOR.tools.trim(this.getValueOf("info","txtName")),a={id:b,name:b,"data-cke-saved-name":b};this._.selectedElement?this._.selectedElement.data("cke-realelement")?(b=e(c,a),b.replace(this._.selectedElement),CKEDITOR.env.ie&&c.getSelection().selectElement(b)):this._.selectedElement.setAttributes(a):
(b=(b=c.getSelection())&&b.getRanges()[0],b.collapsed?(a=e(c,a),b.insertNode(a)):(CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(a["class"]="cke_anchor"),a=new CKEDITOR.style({element:"a",attributes:a}),a.type=CKEDITOR.STYLE_INLINE,a.applyToRange(b)))},onHide:function(){delete this._.selectedElement},onShow:function(){var b=c.getSelection(),a;a=b.getRanges()[0];var d=b.getSelectedElement();a.shrink(CKEDITOR.SHRINK_ELEMENT);a=(d=a.getEnclosedNode())&&d.type===CKEDITOR.NODE_ELEMENT&&("anchor"===d.data("cke-real-element-type")||
d.is("a"))?d:void 0;var f=(d=a&&a.data("cke-realelement"))?CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,a):CKEDITOR.plugins.link.getSelectedLink(c);if(f){this._.selectedElement=f;var e=f.data("cke-saved-name");this.setValueOf("info","txtName",e||"");!d&&b.selectElement(f);a&&(this._.selectedElement=a)}this.getContentElement("info","txtName").focus()},contents:[{id:"info",label:c.lang.link.anchor.title,accessKey:"I",elements:[{type:"text",id:"txtName",label:c.lang.link.anchor.name,required:!0,validate:function(){return this.getValue()?
!0:(alert(c.lang.link.anchor.errorName),!1)}}]}]}});

View File

@ -0,0 +1,30 @@
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
(function(){function u(){var c=this.getDialog(),p=c._.editor,n=p.config.linkPhoneRegExp,q=p.config.linkPhoneMsg,p=CKEDITOR.dialog.validate.notEmpty(p.lang.link.noTel).apply(this);if(!c.getContentElement("info","linkType")||"tel"!=c.getValueOf("info","linkType"))return!0;if(!0!==p)return p;if(n)return CKEDITOR.dialog.validate.regex(n,q).call(this)}CKEDITOR.dialog.add("link",function(c){function p(a,b){var c=a.createRange();c.setStartBefore(b);c.setEndAfter(b);return c}var n=CKEDITOR.plugins.link,q,
t=function(){var a=this.getDialog(),b=a.getContentElement("target","popupFeatures"),a=a.getContentElement("target","linkTargetName"),r=this.getValue();if(b&&a)switch(b=b.getElement(),b.hide(),a.setValue(""),r){case "frame":a.setLabel(c.lang.link.targetFrameName);a.getElement().show();break;case "popup":b.show();a.setLabel(c.lang.link.targetPopupName);a.getElement().show();break;default:a.setValue(r),a.getElement().hide()}},l=function(a){a.target&&this.setValue(a.target[this.id]||"")},e=function(a){a.advanced&&
this.setValue(a.advanced[this.id]||"")},k=function(a){a.target||(a.target={});a.target[this.id]=this.getValue()||""},m=function(a){a.advanced||(a.advanced={});a.advanced[this.id]=this.getValue()||""},g=c.lang.common,b=c.lang.link,d;return{title:b.title,minWidth:"moono-lisa"==(CKEDITOR.skinName||c.config.skin)?450:350,minHeight:240,contents:[{id:"info",label:b.info,title:b.info,elements:[{type:"text",id:"linkDisplayText",label:b.displayText,setup:function(){this.enable();this.setValue(c.getSelection().getSelectedText());
q=this.getValue()},commit:function(a){a.linkText=this.isEnabled()?this.getValue():""}},{id:"linkType",type:"select",label:b.type,"default":"url",items:[[b.toUrl,"url"],[b.toAnchor,"anchor"],[b.toEmail,"email"],[b.toPhone,"tel"]],onChange:function(){var a=this.getDialog(),b=["urlOptions","anchorOptions","emailOptions","telOptions"],r=this.getValue(),f=a.definition.getContents("upload"),f=f&&f.hidden;"url"==r?(c.config.linkShowTargetTab&&a.showPage("target"),f||a.showPage("upload")):(a.hidePage("target"),
f||a.hidePage("upload"));for(f=0;f<b.length;f++){var h=a.getContentElement("info",b[f]);h&&(h=h.getElement().getParent().getParent(),b[f]==r+"Options"?h.show():h.hide())}a.layout()},setup:function(a){this.setValue(a.type||"url")},commit:function(a){a.type=this.getValue()}},{type:"vbox",id:"urlOptions",children:[{type:"hbox",widths:["25%","75%"],children:[{id:"protocol",type:"select",label:g.protocol,"default":"http://",items:[["http://","http://"],["https://","https://"],["ftp://","ftp://"],["news://",
"news://"],[b.other,""]],setup:function(a){a.url&&this.setValue(a.url.protocol||"")},commit:function(a){a.url||(a.url={});a.url.protocol=this.getValue()}},{type:"text",id:"url",label:g.url,required:!0,onLoad:function(){this.allowOnChange=!0},onKeyUp:function(){this.allowOnChange=!1;var a=this.getDialog().getContentElement("info","protocol"),b=this.getValue(),c=/^((javascript:)|[#\/\.\?])/i,f=/^(http|https|ftp|news):\/\/(?=.)/i.exec(b);f?(this.setValue(b.substr(f[0].length)),a.setValue(f[0].toLowerCase())):
c.test(b)&&a.setValue("");this.allowOnChange=!0},onChange:function(){if(this.allowOnChange)this.onKeyUp()},validate:function(){var a=this.getDialog();return a.getContentElement("info","linkType")&&"url"!=a.getValueOf("info","linkType")?!0:!c.config.linkJavaScriptLinksAllowed&&/javascript\:/.test(this.getValue())?(alert(g.invalidValue),!1):this.getDialog().fakeObj?!0:CKEDITOR.dialog.validate.notEmpty(b.noUrl).apply(this)},setup:function(a){this.allowOnChange=!1;a.url&&this.setValue(a.url.url);this.allowOnChange=
!0},commit:function(a){this.onChange();a.url||(a.url={});a.url.url=this.getValue();this.allowOnChange=!1}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().show()}},{type:"button",id:"browse",hidden:"true",filebrowser:"info:url",label:g.browseServer}]},{type:"vbox",id:"anchorOptions",width:260,align:"center",padding:0,children:[{type:"fieldset",id:"selectAnchorText",label:b.selectAnchor,setup:function(){d=n.getEditorAnchors(c);this.getElement()[d&&d.length?
"show":"hide"]()},children:[{type:"hbox",id:"selectAnchor",children:[{type:"select",id:"anchorName","default":"",label:b.anchorName,style:"width: 100%;",items:[[""]],setup:function(a){this.clear();this.add("");if(d)for(var b=0;b<d.length;b++)d[b].name&&this.add(d[b].name);a.anchor&&this.setValue(a.anchor.name);(a=this.getDialog().getContentElement("info","linkType"))&&"email"==a.getValue()&&this.focus()},commit:function(a){a.anchor||(a.anchor={});a.anchor.name=this.getValue()}},{type:"select",id:"anchorId",
"default":"",label:b.anchorId,style:"width: 100%;",items:[[""]],setup:function(a){this.clear();this.add("");if(d)for(var b=0;b<d.length;b++)d[b].id&&this.add(d[b].id);a.anchor&&this.setValue(a.anchor.id)},commit:function(a){a.anchor||(a.anchor={});a.anchor.id=this.getValue()}}],setup:function(){this.getElement()[d&&d.length?"show":"hide"]()}}]},{type:"html",id:"noAnchors",style:"text-align: center;",html:'\x3cdiv role\x3d"note" tabIndex\x3d"-1"\x3e'+CKEDITOR.tools.htmlEncode(b.noAnchors)+"\x3c/div\x3e",
focus:!0,setup:function(){this.getElement()[d&&d.length?"hide":"show"]()}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().hide()}},{type:"vbox",id:"emailOptions",padding:1,children:[{type:"text",id:"emailAddress",label:b.emailAddress,required:!0,validate:function(){var a=this.getDialog();return a.getContentElement("info","linkType")&&"email"==a.getValueOf("info","linkType")?CKEDITOR.dialog.validate.notEmpty(b.noEmail).apply(this):!0},setup:function(a){a.email&&
this.setValue(a.email.address);(a=this.getDialog().getContentElement("info","linkType"))&&"email"==a.getValue()&&this.select()},commit:function(a){a.email||(a.email={});a.email.address=this.getValue()}},{type:"text",id:"emailSubject",label:b.emailSubject,setup:function(a){a.email&&this.setValue(a.email.subject)},commit:function(a){a.email||(a.email={});a.email.subject=this.getValue()}},{type:"textarea",id:"emailBody",label:b.emailBody,rows:3,"default":"",setup:function(a){a.email&&this.setValue(a.email.body)},
commit:function(a){a.email||(a.email={});a.email.body=this.getValue()}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().hide()}},{type:"vbox",id:"telOptions",padding:1,children:[{type:"tel",id:"telNumber",label:b.phoneNumber,required:!0,validate:u,setup:function(a){a.tel&&this.setValue(a.tel);(a=this.getDialog().getContentElement("info","linkType"))&&"tel"==a.getValue()&&this.select()},commit:function(a){a.tel=this.getValue()}}],setup:function(){this.getDialog().getContentElement("info",
"linkType")||this.getElement().hide()}}]},{id:"target",requiredContent:"a[target]",label:b.target,title:b.target,elements:[{type:"hbox",widths:["50%","50%"],children:[{type:"select",id:"linkTargetType",label:g.target,"default":"notSet",style:"width : 100%;",items:[[g.notSet,"notSet"],[b.targetFrame,"frame"],[b.targetPopup,"popup"],[g.targetNew,"_blank"],[g.targetTop,"_top"],[g.targetSelf,"_self"],[g.targetParent,"_parent"]],onChange:t,setup:function(a){a.target&&this.setValue(a.target.type||"notSet");
t.call(this)},commit:function(a){a.target||(a.target={});a.target.type=this.getValue()}},{type:"text",id:"linkTargetName",label:b.targetFrameName,"default":"",setup:function(a){a.target&&this.setValue(a.target.name)},commit:function(a){a.target||(a.target={});a.target.name=this.getValue().replace(/([^\x00-\x7F]|\s)/gi,"")}}]},{type:"vbox",width:"100%",align:"center",padding:2,id:"popupFeatures",children:[{type:"fieldset",label:b.popupFeatures,children:[{type:"hbox",children:[{type:"checkbox",id:"resizable",
label:b.popupResizable,setup:l,commit:k},{type:"checkbox",id:"status",label:b.popupStatusBar,setup:l,commit:k}]},{type:"hbox",children:[{type:"checkbox",id:"location",label:b.popupLocationBar,setup:l,commit:k},{type:"checkbox",id:"toolbar",label:b.popupToolbar,setup:l,commit:k}]},{type:"hbox",children:[{type:"checkbox",id:"menubar",label:b.popupMenuBar,setup:l,commit:k},{type:"checkbox",id:"fullscreen",label:b.popupFullScreen,setup:l,commit:k}]},{type:"hbox",children:[{type:"checkbox",id:"scrollbars",
label:b.popupScrollBars,setup:l,commit:k},{type:"checkbox",id:"dependent",label:b.popupDependent,setup:l,commit:k}]},{type:"hbox",children:[{type:"text",widths:["50%","50%"],labelLayout:"horizontal",label:g.width,id:"width",setup:l,commit:k},{type:"text",labelLayout:"horizontal",widths:["50%","50%"],label:b.popupLeft,id:"left",setup:l,commit:k}]},{type:"hbox",children:[{type:"text",labelLayout:"horizontal",widths:["50%","50%"],label:g.height,id:"height",setup:l,commit:k},{type:"text",labelLayout:"horizontal",
label:b.popupTop,widths:["50%","50%"],id:"top",setup:l,commit:k}]}]}]}]},{id:"upload",label:b.upload,title:b.upload,hidden:!0,filebrowser:"uploadButton",elements:[{type:"file",id:"upload",label:g.upload,style:"height:40px",size:29},{type:"fileButton",id:"uploadButton",label:g.uploadSubmit,filebrowser:"info:url","for":["upload","upload"]}]},{id:"advanced",label:b.advanced,title:b.advanced,elements:[{type:"vbox",padding:1,children:[{type:"hbox",widths:["45%","35%","20%"],children:[{type:"text",id:"advId",
requiredContent:"a[id]",label:b.id,setup:e,commit:m},{type:"select",id:"advLangDir",requiredContent:"a[dir]",label:b.langDir,"default":"",style:"width:110px",items:[[g.notSet,""],[b.langDirLTR,"ltr"],[b.langDirRTL,"rtl"]],setup:e,commit:m},{type:"text",id:"advAccessKey",requiredContent:"a[accesskey]",width:"80px",label:b.acccessKey,maxLength:1,setup:e,commit:m}]},{type:"hbox",widths:["45%","35%","20%"],children:[{type:"text",label:b.name,id:"advName",requiredContent:"a[name]",setup:e,commit:m},{type:"text",
label:b.langCode,id:"advLangCode",requiredContent:"a[lang]",width:"110px","default":"",setup:e,commit:m},{type:"text",label:b.tabIndex,id:"advTabIndex",requiredContent:"a[tabindex]",width:"80px",maxLength:5,setup:e,commit:m}]}]},{type:"vbox",padding:1,children:[{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:b.advisoryTitle,requiredContent:"a[title]","default":"",id:"advTitle",setup:e,commit:m},{type:"text",label:b.advisoryContentType,requiredContent:"a[type]","default":"",id:"advContentType",
setup:e,commit:m}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:b.cssClasses,requiredContent:"a(cke-xyz)","default":"",id:"advCSSClasses",setup:e,commit:m},{type:"text",label:b.charset,requiredContent:"a[charset]","default":"",id:"advCharset",setup:e,commit:m}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:b.rel,requiredContent:"a[rel]","default":"",id:"advRel",setup:e,commit:m},{type:"text",label:b.styles,requiredContent:"a{cke-xyz}","default":"",id:"advStyles",
validate:CKEDITOR.dialog.validate.inlineStyle(c.lang.common.invalidInlineStyle),setup:e,commit:m}]},{type:"hbox",widths:["45%","55%"],children:[{type:"checkbox",id:"download",requiredContent:"a[download]",label:b.download,setup:function(a){void 0!==a.download&&this.setValue("checked","checked")},commit:function(a){this.getValue()&&(a.download=this.getValue())}}]}]}]}],onShow:function(){var a=this.getParentEditor(),b=a.getSelection(),c=this.getContentElement("info","linkDisplayText").getElement().getParent().getParent(),
f=n.getSelectedLink(a,!0),h=f[0]||null;h&&h.hasAttribute("href")&&(b.getSelectedElement()||b.isInTable()||b.selectElement(h));b=n.parseLinkAttributes(a,h);1>=f.length&&n.showDisplayTextForElement(h,a)?c.show():c.hide();this._.selectedElements=f;this.setupContent(b)},onOk:function(){var a={};this.commitContent(a);if(this._.selectedElements.length){var b=this._.selectedElements,g=n.getLinkAttributes(c,a),f=[],h,d,l,e,k;for(k=0;k<b.length;k++){h=b[k];d=h.data("cke-saved-href");l=h.getHtml();h.setAttributes(g.set);
h.removeAttributes(g.removed);if(a.linkText&&q!=a.linkText)e=a.linkText;else if(d==l||"email"==a.type&&-1!=l.indexOf("@"))e="email"==a.type?a.email.address:g.set["data-cke-saved-href"];e&&h.setText(e);f.push(p(c,h))}c.getSelection().selectRanges(f);delete this._.selectedElements}else{b=n.getLinkAttributes(c,a);g=c.getSelection().getRanges();f=new CKEDITOR.style({element:"a",attributes:b.set});h=[];f.type=CKEDITOR.STYLE_INLINE;for(l=0;l<g.length;l++){d=g[l];d.collapsed?(e=new CKEDITOR.dom.text(a.linkText||
("email"==a.type?a.email.address:b.set["data-cke-saved-href"]),c.document),d.insertNode(e),d.selectNodeContents(e)):q!==a.linkText&&(e=new CKEDITOR.dom.text(a.linkText,c.document),d.shrink(CKEDITOR.SHRINK_TEXT),c.editable().extractHtmlFromRange(d),d.insertNode(e));e=d._find("a");for(k=0;k<e.length;k++)e[k].remove(!0);f.applyToRange(d,c);h.push(d)}c.getSelection().selectRanges(h)}},onLoad:function(){c.config.linkShowAdvancedTab||this.hidePage("advanced");c.config.linkShowTargetTab||this.hidePage("target")},
onFocus:function(){var a=this.getContentElement("info","linkType");a&&"url"==a.getValue()&&(a=this.getContentElement("info","url"),a.select())}}})})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

View File

@ -0,0 +1,21 @@
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
(function(){function v(a){for(var f=0,n=0,l=0,p,e=a.$.rows.length;l<e;l++){p=a.$.rows[l];for(var d=f=0,b,c=p.cells.length;d<c;d++)b=p.cells[d],f+=b.colSpan;f>n&&(n=f)}return n}function r(a){return function(){var f=this.getValue(),f=!!(CKEDITOR.dialog.validate.integer()(f)&&0<f);f||(alert(a),this.select());return f}}function q(a,f){var n=function(e){return new CKEDITOR.dom.element(e,a.document)},q=a.editable(),p=a.plugins.dialogadvtab;return{title:a.lang.table.title,minWidth:310,minHeight:CKEDITOR.env.ie?
310:280,onLoad:function(){var e=this,a=e.getContentElement("advanced","advStyles");if(a)a.on("change",function(){var a=this.getStyle("width",""),c=e.getContentElement("info","txtWidth");c&&c.setValue(a,!0);a=this.getStyle("height","");(c=e.getContentElement("info","txtHeight"))&&c.setValue(a,!0)})},onShow:function(){var e=a.getSelection(),d=e.getRanges(),b,c=this.getContentElement("info","txtRows"),g=this.getContentElement("info","txtCols"),t=this.getContentElement("info","txtWidth"),m=this.getContentElement("info",
"txtHeight");"tableProperties"==f&&((e=e.getSelectedElement())&&e.is("table")?b=e:0<d.length&&(CKEDITOR.env.webkit&&d[0].shrink(CKEDITOR.NODE_ELEMENT),b=a.elementPath(d[0].getCommonAncestor(!0)).contains("table",1)),this._.selectedElement=b);b?(this.setupContent(b),c&&c.disable(),g&&g.disable()):(c&&c.enable(),g&&g.enable());t&&t.onChange();m&&m.onChange()},onOk:function(){var e=a.getSelection(),d=this._.selectedElement&&e.createBookmarks(),b=this._.selectedElement||n("table"),c={};this.commitContent(c,
b);if(c.info){c=c.info;if(!this._.selectedElement)for(var g=b.append(n("tbody")),f=parseInt(c.txtRows,10)||0,m=parseInt(c.txtCols,10)||0,k=0;k<f;k++)for(var h=g.append(n("tr")),l=0;l<m;l++)h.append(n("td")).appendBogus();f=c.selHeaders;if(!b.$.tHead&&("row"==f||"both"==f)){h=b.getElementsByTag("thead").getItem(0);g=b.getElementsByTag("tbody").getItem(0);m=g.getElementsByTag("tr").getItem(0);h||(h=new CKEDITOR.dom.element("thead"),h.insertBefore(g));for(k=0;k<m.getChildCount();k++)g=m.getChild(k),
g.type!=CKEDITOR.NODE_ELEMENT||g.data("cke-bookmark")||(g.renameNode("th"),g.setAttribute("scope","col"));h.append(m.remove())}if(null!==b.$.tHead&&"row"!=f&&"both"!=f){h=new CKEDITOR.dom.element(b.$.tHead);g=b.getElementsByTag("tbody").getItem(0);for(l=g.getFirst();0<h.getChildCount();){m=h.getFirst();for(k=0;k<m.getChildCount();k++)g=m.getChild(k),g.type==CKEDITOR.NODE_ELEMENT&&(g.renameNode("td"),g.removeAttribute("scope"));m.insertBefore(l)}h.remove()}if(!this.hasColumnHeaders&&("col"==f||"both"==
f))for(h=0;h<b.$.rows.length;h++)g=new CKEDITOR.dom.element(b.$.rows[h].cells[0]),g.renameNode("th"),g.setAttribute("scope","row");if(this.hasColumnHeaders&&"col"!=f&&"both"!=f)for(k=0;k<b.$.rows.length;k++)h=new CKEDITOR.dom.element(b.$.rows[k]),"tbody"==h.getParent().getName()&&(g=new CKEDITOR.dom.element(h.$.cells[0]),g.renameNode("td"),g.removeAttribute("scope"));c.txtHeight?b.setStyle("height",c.txtHeight):b.removeStyle("height");c.txtWidth?b.setStyle("width",c.txtWidth):b.removeStyle("width");
b.getAttribute("style")||b.removeAttribute("style")}if(this._.selectedElement)try{e.selectBookmarks(d)}catch(p){}else a.insertElement(b),setTimeout(function(){var e=new CKEDITOR.dom.element(b.$.rows[0].cells[0]),c=a.createRange();c.moveToPosition(e,CKEDITOR.POSITION_AFTER_START);c.select()},0)},contents:[{id:"info",label:a.lang.table.title,elements:[{type:"hbox",widths:[null,null],styles:["vertical-align:top"],children:[{type:"vbox",padding:0,children:[{type:"text",id:"txtRows","default":3,label:a.lang.table.rows,
required:!0,controlStyle:"width:5em",validate:r(a.lang.table.invalidRows),setup:function(e){this.setValue(e.$.rows.length)},commit:l},{type:"text",id:"txtCols","default":2,label:a.lang.table.columns,required:!0,controlStyle:"width:5em",validate:r(a.lang.table.invalidCols),setup:function(e){this.setValue(v(e))},commit:l},{type:"html",html:"\x26nbsp;"},{type:"select",id:"selHeaders",requiredContent:"th","default":"",label:a.lang.table.headers,items:[[a.lang.table.headersNone,""],[a.lang.table.headersRow,
"row"],[a.lang.table.headersColumn,"col"],[a.lang.table.headersBoth,"both"]],setup:function(e){var a=this.getDialog();a.hasColumnHeaders=!0;for(var b=0;b<e.$.rows.length;b++){var c=e.$.rows[b].cells[0];if(c&&"th"!=c.nodeName.toLowerCase()){a.hasColumnHeaders=!1;break}}null!==e.$.tHead?this.setValue(a.hasColumnHeaders?"both":"row"):this.setValue(a.hasColumnHeaders?"col":"")},commit:l},{type:"text",id:"txtBorder",requiredContent:"table[border]","default":a.filter.check("table[border]")?1:0,label:a.lang.table.border,
controlStyle:"width:3em",validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidBorder),setup:function(a){this.setValue(a.getAttribute("border")||"")},commit:function(a,d){this.getValue()?d.setAttribute("border",this.getValue()):d.removeAttribute("border")}},{id:"cmbAlign",type:"select",requiredContent:"table[align]","default":"",label:a.lang.common.align,items:[[a.lang.common.notSet,""],[a.lang.common.left,"left"],[a.lang.common.center,"center"],[a.lang.common.right,"right"]],setup:function(a){this.setValue(a.getAttribute("align")||
"")},commit:function(a,d){this.getValue()?d.setAttribute("align",this.getValue()):d.removeAttribute("align")}}]},{type:"vbox",padding:0,children:[{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtWidth",requiredContent:"table{width}",controlStyle:"width:5em",label:a.lang.common.width,title:a.lang.common.cssLengthTooltip,"default":a.filter.check("table{width}")?500>q.getSize("width")?"100%":500:0,getValue:u,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",
a.lang.common.width)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&&a.updateStyle("width",this.getValue())},setup:function(a){a=a.getStyle("width");this.setValue(a)},commit:l}]},{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtHeight",requiredContent:"table{height}",controlStyle:"width:5em",label:a.lang.common.height,title:a.lang.common.cssLengthTooltip,"default":"",getValue:u,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",
a.lang.common.height)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&&a.updateStyle("height",this.getValue())},setup:function(a){(a=a.getStyle("height"))&&this.setValue(a)},commit:l}]},{type:"html",html:"\x26nbsp;"},{type:"text",id:"txtCellSpace",requiredContent:"table[cellspacing]",controlStyle:"width:3em",label:a.lang.table.cellSpace,"default":a.filter.check("table[cellspacing]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellSpacing),
setup:function(a){this.setValue(a.getAttribute("cellSpacing")||"")},commit:function(a,d){this.getValue()?d.setAttribute("cellSpacing",this.getValue()):d.removeAttribute("cellSpacing")}},{type:"text",id:"txtCellPad",requiredContent:"table[cellpadding]",controlStyle:"width:3em",label:a.lang.table.cellPad,"default":a.filter.check("table[cellpadding]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellPadding),setup:function(a){this.setValue(a.getAttribute("cellPadding")||"")},commit:function(a,
d){this.getValue()?d.setAttribute("cellPadding",this.getValue()):d.removeAttribute("cellPadding")}}]}]},{type:"html",align:"right",html:""},{type:"vbox",padding:0,children:[{type:"text",id:"txtCaption",requiredContent:"caption",label:a.lang.table.caption,setup:function(a){this.enable();a=a.getElementsByTag("caption");if(0<a.count()){a=a.getItem(0);var d=a.getFirst(CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT));d&&!d.equals(a.getBogus())?(this.disable(),this.setValue(a.getText())):(a=CKEDITOR.tools.trim(a.getText()),
this.setValue(a))}},commit:function(e,d){if(this.isEnabled()){var b=this.getValue(),c=d.getElementsByTag("caption");if(b)0<c.count()?(c=c.getItem(0),c.setHtml("")):(c=new CKEDITOR.dom.element("caption",a.document),d.append(c,!0)),c.append(new CKEDITOR.dom.text(b,a.document));else if(0<c.count())for(b=c.count()-1;0<=b;b--)c.getItem(b).remove()}}},{type:"text",id:"txtSummary",bidi:!0,requiredContent:"table[summary]",label:a.lang.table.summary,setup:function(a){this.setValue(a.getAttribute("summary")||
"")},commit:function(a,d){this.getValue()?d.setAttribute("summary",this.getValue()):d.removeAttribute("summary")}}]}]},p&&p.createAdvancedTab(a,null,"table")]}}var u=CKEDITOR.tools.cssLength,l=function(a){var f=this.id;a.info||(a.info={});a.info[f]=this.getValue()};CKEDITOR.dialog.add("table",function(a){return q(a,"table")});CKEDITOR.dialog.add("tableProperties",function(a){return q(a,"tableProperties")})})();

View File

@ -0,0 +1,36 @@
.cke_table-faked-selection-editor *::selection, table[data-cke-table-faked-selection-table] *::selection {
background: transparent;
}
.cke_table-faked-selection {
background: darkgray !important;
color: black;
}
.cke_table-faked-selection a {
color: black;
}
.cke_editable:focus .cke_table-faked-selection {
/* We have to use !important here, as td might specify it's own background, thus table selection
would not be visible. */
background: #0076cb !important;
color: white;
}
.cke_editable:focus .cke_table-faked-selection a {
color: white;
}
.cke_table-faked-selection::-moz-selection, .cke_table-faked-selection ::-moz-selection {
background: transparent;
}
.cke_table-faked-selection::selection, .cke_table-faked-selection ::selection {
background: transparent;
}
/* Change the cursor when selecting cells (#706).
*
* This solution does not work in IE, Edge and Safari due to upstream isues:
* https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/3419602/
* https://bugs.webkit.org/show_bug.cgi?id=53341
*/
table[data-cke-table-faked-selection-table] {
cursor: cell;
}

View File

@ -0,0 +1,18 @@
/*
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.dialog.add("cellProperties",function(f){function d(a){return function(b){for(var c=a(b[0]),d=1;d<b.length;d++)if(a(b[d])!==c){c=null;break}"undefined"!=typeof c&&(this.setValue(c),CKEDITOR.env.gecko&&"select"==this.type&&!c&&(this.getInputElement().$.selectedIndex=-1))}}function l(a){if(a=n.exec(a.getStyle("width")||a.getAttribute("width")))return a[2]}var h=f.lang.table,c=h.cell,e=f.lang.common,k=CKEDITOR.dialog.validate,n=/^(\d+(?:\.\d+)?)(px|%)$/,g={type:"html",html:"\x26nbsp;"},p="rtl"==
f.lang.dir,m=f.plugins.colordialog;return{title:c.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?450:410,minHeight:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?230:220,contents:[{id:"info",label:c.title,accessKey:"I",elements:[{type:"hbox",widths:["40%","5%","40%"],children:[{type:"vbox",padding:0,children:[{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"width",width:"100px",requiredContent:"td{width,height}",label:e.width,validate:k.number(c.invalidWidth),onLoad:function(){var a=
this.getDialog().getContentElement("info","widthType").getElement(),b=this.getInputElement(),c=b.getAttribute("aria-labelledby");b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=parseInt(a.getAttribute("width"),10);a=parseInt(a.getStyle("width"),10);return isNaN(a)?isNaN(b)?"":b:a}),commit:function(a){var b=parseInt(this.getValue(),10),c=this.getDialog().getValueOf("info","widthType")||l(a);isNaN(b)?a.removeStyle("width"):a.setStyle("width",b+c);a.removeAttribute("width")},
"default":""},{type:"select",id:"widthType",requiredContent:"td{width,height}",label:f.lang.table.widthUnit,labelStyle:"visibility:hidden","default":"px",items:[[h.widthPx,"px"],[h.widthPc,"%"]],setup:d(l)}]},{type:"hbox",widths:["70%","30%"],children:[{type:"text",id:"height",requiredContent:"td{width,height}",label:e.height,width:"100px","default":"",validate:k.number(c.invalidHeight),onLoad:function(){var a=this.getDialog().getContentElement("info","htmlHeightType").getElement(),b=this.getInputElement(),
c=b.getAttribute("aria-labelledby");this.getDialog().getContentElement("info","height").isVisible()&&(a.setHtml("\x3cbr /\x3e"+h.widthPx),a.setStyle("display","block"),this.getDialog().getContentElement("info","hiddenSpacer").getElement().setStyle("display","block"));b.setAttribute("aria-labelledby",[c,a.$.id].join(" "))},setup:d(function(a){var b=parseInt(a.getAttribute("height"),10);a=parseInt(a.getStyle("height"),10);return isNaN(a)?isNaN(b)?"":b:a}),commit:function(a){var b=parseInt(this.getValue(),
10);isNaN(b)?a.removeStyle("height"):a.setStyle("height",CKEDITOR.tools.cssLength(b));a.removeAttribute("height")}},{id:"htmlHeightType",type:"html",html:"",style:"display: none"}]},{type:"html",id:"hiddenSpacer",html:"\x26nbsp;",style:"display: none"},{type:"select",id:"wordWrap",label:c.wordWrap,"default":"yes",items:[[c.yes,"yes"],[c.no,"no"]],setup:d(function(a){var b=a.getAttribute("noWrap");if("nowrap"==a.getStyle("white-space")||b)return"no"}),commit:function(a){"no"==this.getValue()?a.setStyle("white-space",
"nowrap"):a.removeStyle("white-space");a.removeAttribute("noWrap")}},g,{type:"select",id:"hAlign",label:c.hAlign,"default":"",items:[[e.notSet,""],[e.left,"left"],[e.center,"center"],[e.right,"right"],[e.justify,"justify"]],setup:d(function(a){var b=a.getAttribute("align");return a.getStyle("text-align")||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("text-align",b):a.removeStyle("text-align");a.removeAttribute("align")}},{type:"select",id:"vAlign",label:c.vAlign,"default":"",items:[[e.notSet,
""],[e.alignTop,"top"],[e.alignMiddle,"middle"],[e.alignBottom,"bottom"],[c.alignBaseline,"baseline"]],setup:d(function(a){var b=a.getAttribute("vAlign");a=a.getStyle("vertical-align");switch(a){case "top":case "middle":case "bottom":case "baseline":break;default:a=""}return a||b||""}),commit:function(a){var b=this.getValue();b?a.setStyle("vertical-align",b):a.removeStyle("vertical-align");a.removeAttribute("vAlign")}}]},g,{type:"vbox",padding:0,children:[{type:"select",id:"cellType",label:c.cellType,
"default":"td",items:[[c.data,"td"],[c.header,"th"]],setup:d(function(a){return a.getName()}),commit:function(a){a.renameNode(this.getValue())}},g,{type:"text",id:"rowSpan",label:c.rowSpan,"default":"",validate:k.integer(c.invalidRowSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("rowSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("rowSpan",this.getValue()):a.removeAttribute("rowSpan")}},{type:"text",id:"colSpan",label:c.colSpan,"default":"",
validate:k.integer(c.invalidColSpan),setup:d(function(a){if((a=parseInt(a.getAttribute("colSpan"),10))&&1!=a)return a}),commit:function(a){var b=parseInt(this.getValue(),10);b&&1!=b?a.setAttribute("colSpan",this.getValue()):a.removeAttribute("colSpan")}},g,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"bgColor",label:c.bgColor,"default":"",setup:d(function(a){var b=a.getAttribute("bgColor");return a.getStyle("background-color")||b}),commit:function(a){this.getValue()?a.setStyle("background-color",
this.getValue()):a.removeStyle("background-color");a.removeAttribute("bgColor")}},m?{type:"button",id:"bgColorChoose","class":"colorChooser",label:c.chooseColor,onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){f.getColorFromDialog(function(a){a&&this.getDialog().getContentElement("info","bgColor").setValue(a);this.focus()},this)}}:g]},g,{type:"hbox",padding:0,widths:["60%","40%"],children:[{type:"text",id:"borderColor",label:c.borderColor,"default":"",
setup:d(function(a){var b=a.getAttribute("borderColor");return a.getStyle("border-color")||b}),commit:function(a){this.getValue()?a.setStyle("border-color",this.getValue()):a.removeStyle("border-color");a.removeAttribute("borderColor")}},m?{type:"button",id:"borderColorChoose","class":"colorChooser",label:c.chooseColor,style:(p?"margin-right":"margin-left")+": 10px",onLoad:function(){this.getElement().getParent().setStyle("vertical-align","bottom")},onClick:function(){f.getColorFromDialog(function(a){a&&
this.getDialog().getContentElement("info","borderColor").setValue(a);this.focus()},this)}}:g]}]}]}]}],onShow:function(){this.cells=CKEDITOR.plugins.tabletools.getSelectedCells(this._.editor.getSelection());this.setupContent(this.cells)},onOk:function(){for(var a=this._.editor.getSelection(),b=a.createBookmarks(),c=this.cells,d=0;d<c.length;d++)this.commitContent(c[d]);this._.editor.forceNextSelectionCheck();a.selectBookmarks(b);this._.editor.selectionChange()},onLoad:function(){var a={};this.foreach(function(b){b.setup&&
b.commit&&(b.setup=CKEDITOR.tools.override(b.setup,function(c){return function(){c.apply(this,arguments);a[b.id]=b.getValue()}}),b.commit=CKEDITOR.tools.override(b.commit,function(c){return function(){a[b.id]!==b.getValue()&&c.apply(this,arguments)}}))})}}});

View File

@ -0,0 +1,203 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
'use strict';
( function() {
var uniqueNameCounter = 0,
// Black rectangle which is shown before the image is loaded.
loadingImage = 'data:image/gif;base64,R0lGODlhDgAOAIAAAAAAAP///yH5BAAAAAAALAAAAAAOAA4AAAIMhI+py+0Po5y02qsKADs=';
// Returns number as a string. If a number has 1 digit only it returns it prefixed with an extra 0.
function padNumber( input ) {
if ( input <= 9 ) {
input = '0' + input;
}
return String( input );
}
// Returns a unique image file name.
function getUniqueImageFileName( type ) {
var date = new Date(),
dateParts = [ date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds() ];
uniqueNameCounter += 1;
return 'image-' + CKEDITOR.tools.array.map( dateParts, padNumber ).join( '' ) + '-' + uniqueNameCounter + '.' + type;
}
CKEDITOR.plugins.add( 'uploadimage', {
requires: 'uploadwidget',
onLoad: function() {
CKEDITOR.addCss(
'.cke_upload_uploading img{' +
'opacity: 0.3' +
'}'
);
},
init: function( editor ) {
editor.ui.addButton( 'Image', {
label: CKEDITOR.lang[editor.config.language].common.image,
command: 'openDialog',
toolbar: 'insertImg'
});
var fileDialog = $('<input type="file">'),
uploadType = '';
editor.addCommand('openDialog', {
exec: function(editor) {
fileDialog.click();
if(typeof(uploadType) != 'undefined') uploadType = 'fileDialog';
}
});
// Do not execute this paste listener if it will not be possible to upload file.
if ( !CKEDITOR.plugins.clipboard.isFileApiSupported ) {
return;
}
var fileTools = CKEDITOR.fileTools,
uploadUrl = fileTools.getUploadUrl( editor.config, 'image' );
if ( !uploadUrl ) {
return;
}
// Handle images which are available in the dataTransfer.
fileTools.addUploadWidget( editor, 'uploadimage', {
supportedTypes: /image\/(jpeg|png|gif|bmp|webp)/,
uploadUrl: uploadUrl,
fileDialog: fileDialog,
fileToElement: function() {
var img = new CKEDITOR.dom.element( 'img' );
img.setAttribute( 'src', loadingImage );
return img;
},
parts: {
img: 'img'
},
onUploading: function( upload ) {
// Show the image during the upload.
this.parts.img.setAttribute( 'src', upload.data );
},
onUploaded: function( upload ) {
// Width and height could be returned by server (https://dev.ckeditor.com/ticket/13519).
var $img = this.parts.img.$,
width = upload.responseData.width || $img.naturalWidth,
height = upload.responseData.height || $img.naturalHeight;
// Set width and height to prevent blinking.
this.replaceWith( '<img src="' + upload.url + '" ' +
'width="' + width + '" ' +
'height="' + height + '">' );
}
} );
editor.on("fileUploadRequest", function( evt ) {
// 이미지 업로드 시작 체크
if(typeof(editor_chk_upload) != "undefined") {
editor_chk_upload = false;
}
});
editor.on("fileUploadResponse", function( evt ) {
// 파일 브라우저 사용한 경우에만
if(typeof(uploadType) != 'undefined' && uploadType == 'fileDialog') {
var fileLoader = evt.data.fileLoader,
xhr = fileLoader.xhr,
data = evt.data,
res = JSON.parse(xhr.responseText);
var img = new CKEDITOR.dom.element( 'img' );
img.setAttribute( 'src', res.url );
if(typeof(res.width) != 'undefined') img.setAttribute( 'width', res.width );
if(typeof(res.height) != 'undefined') img.setAttribute( 'height', res.height );
editor.insertElement(img);
uploadType = ''; // 구분값 초기화
// 파일폼 초기화
for( var i = 0; i < fileDialog.length; i++ ) {
fileDialog[i].value = null;
}
}
// 이미지 업로드 완료 체크
if(typeof(editor_chk_upload) != "undefined") {
editor_chk_upload = true;
}
});
// Handle images which are not available in the dataTransfer.
// This means that we need to read them from the <img src="data:..."> elements.
editor.on( 'paste', function( evt ) {
// For performance reason do not parse data if it does not contain img tag and data attribute.
if ( !evt.data.dataValue.match( /<img[\s\S]+data:/i ) ) {
return;
}
var data = evt.data,
// Prevent XSS attacks.
tempDoc = document.implementation.createHTMLDocument( '' ),
temp = new CKEDITOR.dom.element( tempDoc.body ),
imgs, img, i;
// Without this isReadOnly will not works properly.
temp.data( 'cke-editable', 1 );
temp.appendHtml( data.dataValue );
imgs = temp.find( 'img' );
for ( i = 0; i < imgs.count(); i++ ) {
img = imgs.getItem( i );
// Assign src once, as it might be a big string, so there's no point in duplicating it all over the place.
var imgSrc = img.getAttribute( 'src' ),
// Image have to contain src=data:...
isDataInSrc = imgSrc && imgSrc.substring( 0, 5 ) == 'data:',
isRealObject = img.data( 'cke-realelement' ) === null;
// We are not uploading images in non-editable blocs and fake objects (https://dev.ckeditor.com/ticket/13003).
if ( isDataInSrc && isRealObject && !img.data( 'cke-upload-id' ) && !img.isReadOnly( 1 ) ) {
// Note that normally we'd extract this logic into a separate function, but we should not duplicate this string, as it might
// be large.
var imgFormat = imgSrc.match( /image\/([a-z]+?);/i ),
loader;
imgFormat = ( imgFormat && imgFormat[ 1 ] ) || 'jpg';
loader = editor.uploadRepository.create( imgSrc, getUniqueImageFileName( imgFormat ) );
loader.upload( uploadUrl );
fileTools.markElement( img, 'uploadimage', loader.id );
fileTools.bindNotifications( editor, loader );
}
}
data.dataValue = temp.getHtml();
} );
}
} );
/**
* The URL where images should be uploaded.
*
* @since 4.5
* @cfg {String} [imageUploadUrl='' (empty string = disabled)]
* @member CKEDITOR.config
*/
} )();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,55 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
'use strict';
( function() {
CKEDITOR.plugins.add( 'filereader', {
requires: 'uploadwidget',
init: function( editor ) {
var fileTools = CKEDITOR.fileTools;
fileTools.addUploadWidget( editor, 'filereader', {
onLoaded: function( upload ) {
var data = upload.data;
if ( data && data.indexOf( ',' ) >= 0 && data.indexOf( ',' ) < data.length - 1 ) {
this.replaceWith( atob( upload.data.split( ',' )[ 1 ] ) );
} else {
editor.widgets.del( this );
}
}
} );
editor.on( 'paste', function( evt ) {
var data = evt.data,
dataTransfer = data.dataTransfer,
filesCount = dataTransfer.getFilesCount(),
file, i;
if ( data.dataValue || !filesCount ) {
return;
}
for ( i = 0; i < filesCount; i++ ) {
file = dataTransfer.getFile( i );
if ( fileTools.isTypeSupported( file, /text\/(plain|html)/ ) ) {
var el = new CKEDITOR.dom.element( 'span' ),
loader = editor.uploadRepository.create( file );
el.setText( '...' );
loader.load();
fileTools.markElement( el, 'filereader', loader.id );
fileTools.bindNotifications( editor, loader );
data.dataValue += el.getOuterHtml();
}
}
} );
}
} );
} )();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'az', {
abort: 'Serverə yükləmə istifadəçi tərəfindən dayandırılıb',
doneOne: 'Fayl müvəffəqiyyətlə yüklənib',
doneMany: '%1 fayllar müvəffəqiyyətlə yüklənib',
uploadOne: 'Faylın yüklənməsi ({percentage}%)',
uploadMany: 'Faylların yüklənməsi, {max}-dan {current} hazır ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'bg', {
abort: 'Качването е прекратено от потребителя.',
doneOne: 'Файлът е качен успешно.',
doneMany: 'Успешно са качени %1 файла.',
uploadOne: 'Качване на файл ({percentage}%)...',
uploadMany: 'Качване на файлове, {current} от {max} качени ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'ca', {
abort: 'Pujada cancel·lada per l\'usuari.',
doneOne: 'Fitxer pujat correctament.',
doneMany: '%1 fitxers pujats correctament.',
uploadOne: 'Pujant fitxer ({percentage}%)...',
uploadMany: 'Pujant fitxers, {current} de {max} finalitzats ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'cs', {
abort: 'Nahrávání zrušeno uživatelem.',
doneOne: 'Soubor úspěšně nahrán.',
doneMany: 'Úspěšně nahráno %1 souborů.',
uploadOne: 'Nahrávání souboru ({percentage}%)...',
uploadMany: 'Nahrávání souborů, {current} z {max} hotovo ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'da', {
abort: 'Upload er afbrudt af brugen.',
doneOne: 'Filen er uploadet.',
doneMany: 'Du har uploadet %1 filer.',
uploadOne: 'Uploader fil ({percentage}%)...',
uploadMany: 'Uploader filer, {current} af {max} er uploadet ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'de-ch', {
abort: 'Hochladen durch den Benutzer abgebrochen.',
doneOne: 'Datei erfolgreich hochgeladen.',
doneMany: '%1 Dateien erfolgreich hochgeladen.',
uploadOne: 'Datei wird hochgeladen ({percentage}%)...',
uploadMany: 'Dateien werden hochgeladen, {current} von {max} fertig ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'de', {
abort: 'Hochladen durch den Benutzer abgebrochen.',
doneOne: 'Datei erfolgreich hochgeladen.',
doneMany: '%1 Dateien erfolgreich hochgeladen.',
uploadOne: 'Datei wird hochgeladen ({percentage}%)...',
uploadMany: 'Dateien werden hochgeladen, {current} von {max} fertig ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'el', {
abort: 'Αποστολή ακυρώθηκε απο χρήστη.',
doneOne: 'Αρχείο εστάλη επιτυχώς.',
doneMany: 'Επιτυχής αποστολή %1 αρχείων.',
uploadOne: 'Αποστολή αρχείου ({percentage}%)…',
uploadMany: 'Αποστολή αρχείων, {current} από {max} ολοκληρωμένα ({percentage}%)…'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'en-au', {
abort: 'Upload aborted by the user.',
doneOne: 'File successfully uploaded.',
doneMany: 'Successfully uploaded %1 files.',
uploadOne: 'Uploading file ({percentage}%)...',
uploadMany: 'Uploading files, {current} of {max} done ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'en', {
abort: 'Upload aborted by the user.',
doneOne: 'File successfully uploaded.',
doneMany: 'Successfully uploaded %1 files.',
uploadOne: 'Uploading file ({percentage}%)...',
uploadMany: 'Uploading files, {current} of {max} done ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'eo', {
abort: 'Alŝuto ĉesigita de la uzanto',
doneOne: 'Dosiero sukcese alŝutita.',
doneMany: 'Sukcese alŝutitaj %1 dosieroj.',
uploadOne: 'alŝutata dosiero ({percentage}%)...',
uploadMany: 'Alŝutataj dosieroj, {current} el {max} faritaj ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'es-mx', {
abort: 'La carga ha sido abortada por el usuario.',
doneOne: 'El archivo ha sido cargado completamente.',
doneMany: '%1 archivos cargados completamente.',
uploadOne: 'Cargando archivo ({percentage}%)...',
uploadMany: 'Cargando archivos, {current} de {max} listo ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'es', {
abort: 'Carga abortada por el usuario.',
doneOne: 'Archivo cargado exitósamente.',
doneMany: '%1 archivos exitósamente cargados.',
uploadOne: 'Cargando archivo ({percentage}%)...',
uploadMany: 'Cargando archivos, {current} de {max} hecho ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'et', {
abort: 'Upload aborted by the user.', // MISSING
doneOne: 'Fail on üles laaditud.',
doneMany: 'Successfully uploaded %1 files.', // MISSING
uploadOne: 'Uploading file ({percentage}%)...', // MISSING
uploadMany: 'Uploading files, {current} of {max} done ({percentage}%)...' // MISSING
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'eu', {
abort: 'Karga erabiltzaileak bertan behera utzita.',
doneOne: 'Fitxategia behar bezala kargatu da.',
doneMany: 'Behar bezala kargatu dira %1 fitxategi.',
uploadOne: 'Fitxategia kargatzen ({percentage}%)...',
uploadMany: 'Fitxategiak kargatzen, {current} / {max} eginda ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'fa', {
abort: 'بارگذاری توسط کاربر لغو شد.',
doneOne: 'فایل با موفقیت بارگذاری شد.',
doneMany: '%1 از فایل​ها با موفقیت بارگذاری شد.',
uploadOne: 'بارگذاری فایل ({percentage}%)...',
uploadMany: 'بارگذاری فایل​ها, {current} از {max} انجام شده ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'fr', {
abort: 'Téléversement interrompu par l\'utilisateur.',
doneOne: 'Fichier téléversé avec succès.',
doneMany: '%1 fichiers téléversés avec succès.',
uploadOne: 'Téléversement du fichier en cours ({percentage}%)…',
uploadMany: 'Téléversement des fichiers en cours, {current} sur {max} effectués ({percentage}%)…'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'gl', {
abort: 'Envío interrompido polo usuario.',
doneOne: 'Ficheiro enviado satisfactoriamente.',
doneMany: '%1 ficheiros enviados satisfactoriamente.',
uploadOne: 'Enviando o ficheiro ({percentage}%)...',
uploadMany: 'Enviando ficheiros, {current} de {max} feito o ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'hr', {
abort: 'Slanje prekinuto od strane korisnika',
doneOne: 'Datoteka uspješno poslana.',
doneMany: 'Uspješno poslano %1 datoteka.',
uploadOne: 'Slanje datoteke ({percentage}%)...',
uploadMany: 'Slanje datoteka, {current} od {max} gotovo ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'hu', {
abort: 'A feltöltést a felhasználó megszakította.',
doneOne: 'A fájl sikeresen feltöltve.',
doneMany: '%1 fájl sikeresen feltöltve.',
uploadOne: 'Fájl feltöltése ({percentage}%)...',
uploadMany: 'Fájlok feltöltése, {current}/{max} kész ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'id', {
abort: 'Pengunggahan dibatalkan oleh pengguna',
doneOne: 'Berkas telah berhasil diunggah',
doneMany: 'Pengunggahan berkas %1 berhasil',
uploadOne: 'Mengunggah berkas ({percentage}%)...',
uploadMany: 'Pengunggahan berkas {current} dari {max} berhasil ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'it', {
abort: 'Caricamento interrotto dall\'utente.',
doneOne: 'Il file è stato caricato correttamente.',
doneMany: '%1 file sono stati caricati correttamente.',
uploadOne: 'Caricamento del file ({percentage}%)...',
uploadMany: 'Caricamento dei file, {current} di {max} completati ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'ja', {
abort: 'アップロードを中止しました。',
doneOne: 'ファイルのアップロードに成功しました。',
doneMany: '%1個のファイルのアップロードに成功しました。',
uploadOne: 'ファイルのアップロード中 ({percentage}%)...',
uploadMany: '{max} 個中 {current} 個のファイルをアップロードしました。 ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'km', {
abort: 'បាន​ផ្ដាច់​ការផ្ទុកឡើង​ដោយ​អ្នក​ប្រើប្រាស់។',
doneOne: 'បាន​ផ្ទុកឡើង​នូវ​ឯកសារ​ដោយ​ជោគជ័យ។',
doneMany: 'បាន​ផ្ទុក​ឡើង​នូវ​ឯកសារ %1 ដោយ​ជោគជ័យ។',
uploadOne: 'កំពុង​ផ្ទុកឡើង​ឯកសារ ({percentage}%)...',
uploadMany: 'កំពុង​ផ្ទុកឡើង​ឯកសារ, រួចរាល់ {current} នៃ {max} ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'ko', {
abort: '사용자가 업로드를 중단했습니다.',
doneOne: '파일이 성공적으로 업로드되었습니다.',
doneMany: '파일 %1개를 성공적으로 업로드하였습니다.',
uploadOne: '파일 업로드중 ({percentage}%)...',
uploadMany: '파일 {max} 개 중 {current} 번째 파일 업로드 중 ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'ku', {
abort: 'بارکردنەکە بڕدرا لەلایەن بەکارهێنەر.',
doneOne: 'پەڕگەکە بەسەرکەوتووانە بارکرا.',
doneMany: 'بەسەرکەوتووانە بارکرا %1 پەڕگە.',
uploadOne: 'پەڕگە باردەکرێت ({percentage}%)...',
uploadMany: 'پەڕگە باردەکرێت, {current} لە {max} ئەنجامدراوە ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'lv', {
abort: 'Augšupielādi atcēla lietotājs.',
doneOne: 'Fails veiksmīgi ielādēts.',
doneMany: 'Veiksmīgi ielādēts %1 fails.',
uploadOne: 'Ielādāju failu ({percentage}%)...',
uploadMany: 'Ielādēju failus, {curent} no {max} izpildīts ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'nb', {
abort: 'Opplasting ble avbrutt av brukeren.',
doneOne: 'Filen har blitt lastet opp.',
doneMany: 'Fullført opplasting av %1 filer.',
uploadOne: 'Laster opp fil ({percentage}%)...',
uploadMany: 'Laster opp filer, {current} av {max} fullført ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'nl', {
abort: 'Upload gestopt door de gebruiker.',
doneOne: 'Bestand succesvol geüpload.',
doneMany: 'Succesvol %1 bestanden geüpload.',
uploadOne: 'Uploaden bestand ({percentage}%)…',
uploadMany: 'Bestanden aan het uploaden, {current} van {max} klaar ({percentage}%)…'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'no', {
abort: 'Opplasting ble avbrutt av brukeren.',
doneOne: 'Filen har blitt lastet opp.',
doneMany: 'Fullført opplasting av %1 filer.',
uploadOne: 'Laster opp fil ({percentage}%)...',
uploadMany: 'Laster opp filer, {current} av {max} fullført ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'oc', {
abort: 'Mandadís interromput per l\'utilizaire',
doneOne: 'Fichièr mandat amb succès.',
doneMany: '%1 fichièrs mandats amb succès.',
uploadOne: 'Mandadís del fichièr en cors ({percentage}%)…',
uploadMany: 'Mandadís dels fichièrs en cors, {current} sus {max} efectuats ({percentage}%)…'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'pl', {
abort: 'Wysyłanie przerwane przez użytkownika.',
doneOne: 'Plik został pomyślnie wysłany.',
doneMany: 'Pomyślnie wysłane pliki: %1.',
uploadOne: 'Wysyłanie pliku ({percentage}%)...',
uploadMany: 'Wysyłanie plików, gotowe {current} z {max} ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'pt-br', {
abort: 'Envio cancelado pelo usuário.',
doneOne: 'Arquivo enviado com sucesso.',
doneMany: 'Enviados %1 arquivos com sucesso.',
uploadOne: 'Enviando arquivo({percentage}%)...',
uploadMany: 'Enviando arquivos, {current} de {max} completos ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'pt', {
abort: 'Carregamento cancelado pelo utilizador.',
doneOne: 'Ficheiro carregado com sucesso.',
doneMany: 'Successfully uploaded %1 files.', // MISSING
uploadOne: 'Uploading file ({percentage}%)...', // MISSING
uploadMany: 'Uploading files, {current} of {max} done ({percentage}%)...' // MISSING
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'ro', {
abort: 'Încărcare întreruptă de utilizator.',
doneOne: 'Fișier încărcat cu succes.',
doneMany: '%1 fișiere încărcate cu succes.',
uploadOne: 'Încărcare fișier ({percentage}%)...',
uploadMany: 'Încărcare fișiere, {current} din {max} realizat ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'ru', {
abort: 'Загрузка отменена пользователем',
doneOne: 'Файл успешно загружен',
doneMany: 'Успешно загружено файлов: %1',
uploadOne: 'Загрузка файла ({percentage}%)',
uploadMany: 'Загрузка файлов, {current} из {max} загружено ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'sk', {
abort: 'Nahrávanie zrušené používateľom.',
doneOne: 'Súbor úspešne nahraný.',
doneMany: 'Úspešne nahraných %1 súborov.',
uploadOne: 'Nahrávanie súboru ({percentage}%)...',
uploadMany: 'Nahrávanie súborov, {current} z {max} hotovo ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'sq', {
abort: 'Ngarkimi u ndërpre nga përdoruesi.',
doneOne: 'Skeda u ngarkua me sukses.',
doneMany: 'Me sukses u ngarkuan %1 skeda.',
uploadOne: 'Duke ngarkuar skedën ({percentage}%)...',
uploadMany: 'Duke ngarkuar skedat, {current} nga {max} , ngarkuar ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'sv', {
abort: 'Uppladdning avbruten av användaren.',
doneOne: 'Filuppladdning lyckades.',
doneMany: 'Uppladdning av %1 filer lyckades.',
uploadOne: 'Laddar upp fil ({percentage}%)...',
uploadMany: 'Laddar upp filer, {current} av {max} färdiga ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'tr', {
abort: 'Gönderme işlemi kullanıcı tarafından durduruldu.',
doneOne: 'Gönderim işlemi başarılı şekilde tamamlandı.',
doneMany: '%1 dosya başarılı şekilde gönderildi.',
uploadOne: 'Dosyanın ({percentage}%) gönderildi...',
uploadMany: 'Toplam {current} / {max} dosyanın ({percentage}%) gönderildi...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'ug', {
abort: 'يۈكلەشنى ئىشلەتكۈچى ئۈزۈۋەتتى.',
doneOne: 'ھۆججەت مۇۋەپپەقىيەتلىك يۈكلەندى.',
doneMany: 'مۇۋەپپەقىيەتلىك ھالدا %1 ھۆججەت يۈكلەندى.',
uploadOne: 'Uploading file ({percentage}%)...', // MISSING
uploadMany: 'Uploading files, {current} of {max} done ({percentage}%)...' // MISSING
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'uk', {
abort: 'Завантаження перервано користувачем.',
doneOne: 'Файл цілком завантажено.',
doneMany: 'Цілком завантажено %1 файлів.',
uploadOne: 'Завантаження файлу ({percentage}%)...',
uploadMany: 'Завантажено {current} із {max} файлів завершено на ({percentage}%)...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'zh-cn', {
abort: '上传已被用户中止',
doneOne: '文件上传成功',
doneMany: '成功上传了 %1 个文件',
uploadOne: '正在上传文件({percentage}%...',
uploadMany: '正在上传文件,{max} 中的 {current}{percentage}%...'
} );

View File

@ -0,0 +1,12 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'uploadwidget', 'zh', {
abort: '上傳由使用者放棄。',
doneOne: '檔案成功上傳。',
doneMany: '成功上傳 %1 檔案。',
uploadOne: '正在上傳檔案({percentage}%...',
uploadMany: '正在上傳檔案,{max} 中的 {current} 已完成({percentage}%...'
} );

View File

@ -0,0 +1,610 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
'use strict';
( function() {
CKEDITOR.plugins.add( 'uploadwidget', {
lang: 'az,bg,ca,cs,da,de,de-ch,el,en,en-au,eo,es,es-mx,et,eu,fa,fr,gl,hr,hu,id,it,ja,km,ko,ku,lv,nb,nl,no,oc,pl,pt,pt-br,ro,ru,sk,sq,sv,tr,ug,uk,zh,zh-cn', // %REMOVE_LINE_CORE%
requires: 'widget,clipboard,filetools,notificationaggregator',
init: function( editor ) {
// Images which should be changed into upload widget needs to be marked with `data-widget` on paste,
// because otherwise wrong widget may handle upload placeholder element (e.g. image2 plugin would handle image).
// `data-widget` attribute is allowed only in the elements which has also `data-cke-upload-id` attribute.
editor.filter.allow( '*[!data-widget,!data-cke-upload-id]' );
}
} );
/**
* This function creates an upload widget &mdash; a placeholder to show the progress of an upload. The upload widget
* is based on its {@link CKEDITOR.fileTools.uploadWidgetDefinition definition}. The `addUploadWidget` method also
* creates a `paste` event, if the {@link CKEDITOR.fileTools.uploadWidgetDefinition#fileToElement fileToElement} method
* is defined. This event helps in handling pasted files, as it will automatically check if the files were pasted and
* mark them to be uploaded.
*
* The upload widget helps to handle content that is uploaded asynchronously inside the editor. It solves issues such as:
* editing during upload, undo manager integration, getting data, removing or copying uploaded element.
*
* To create an upload widget you need to define two transformation methods:
*
* * The {@link CKEDITOR.fileTools.uploadWidgetDefinition#fileToElement fileToElement} method which will be called on
* `paste` and transform a file into a placeholder.
* * The {@link CKEDITOR.fileTools.uploadWidgetDefinition#onUploaded onUploaded} method with
* the {@link CKEDITOR.fileTools.uploadWidgetDefinition#replaceWith replaceWith} method which will be called to replace
* the upload placeholder with the final HTML when the upload is done.
* If you want to show more information about the progress you can also define
* the {@link CKEDITOR.fileTools.uploadWidgetDefinition#onLoading onLoading} and
* {@link CKEDITOR.fileTools.uploadWidgetDefinition#onUploading onUploading} methods.
*
* The simplest uploading widget which uploads a file and creates a link to it may look like this:
*
* CKEDITOR.fileTools.addUploadWidget( editor, 'uploadfile', {
* uploadUrl: CKEDITOR.fileTools.getUploadUrl( editor.config ),
*
* fileToElement: function( file ) {
* var a = new CKEDITOR.dom.element( 'a' );
* a.setText( file.name );
* a.setAttribute( 'href', '#' );
* return a;
* },
*
* onUploaded: function( upload ) {
* this.replaceWith( '<a href="' + upload.url + '" target="_blank">' + upload.fileName + '</a>' );
* }
* } );
*
* The upload widget uses {@link CKEDITOR.fileTools.fileLoader} as a helper to upload the file. A
* {@link CKEDITOR.fileTools.fileLoader} instance is created when the file is pasted and a proper method is
* called &mdash; by default it is the {@link CKEDITOR.fileTools.fileLoader#loadAndUpload} method. If you want
* to only use the `load` or `upload`, you can use the {@link CKEDITOR.fileTools.uploadWidgetDefinition#loadMethod loadMethod}
* property.
*
* Note that if you want to handle a big file, e.g. a video, you may need to use `upload` instead of
* `loadAndUpload` because the file may be too big to load it to memory at once.
*
* If you do not upload the file, you need to define {@link CKEDITOR.fileTools.uploadWidgetDefinition#onLoaded onLoaded}
* instead of {@link CKEDITOR.fileTools.uploadWidgetDefinition#onUploaded onUploaded}.
* For example, if you want to read the content of the file:
*
* CKEDITOR.fileTools.addUploadWidget( editor, 'fileReader', {
* loadMethod: 'load',
* supportedTypes: /text\/(plain|html)/,
*
* fileToElement: function( file ) {
* var el = new CKEDITOR.dom.element( 'span' );
* el.setText( '...' );
* return el;
* },
*
* onLoaded: function( loader ) {
* this.replaceWith( atob( loader.data.split( ',' )[ 1 ] ) );
* }
* } );
*
* If you need to pass additional data to the request, you can do this using the
* {@link CKEDITOR.fileTools.uploadWidgetDefinition#additionalRequestParameters additionalRequestParameters} property.
* That data is then passed to the upload method defined by {@link CKEDITOR.fileTools.uploadWidgetDefinition#loadMethod},
* and to the {@link CKEDITOR.editor#fileUploadRequest} event (as part of the `requestData` property).
* The syntax of that parameter is compatible with the {@link CKEDITOR.editor#fileUploadRequest} `requestData` property.
*
* CKEDITOR.fileTools.addUploadWidget( editor, 'uploadFile', {
* additionalRequestParameters: {
* foo: 'bar'
* },
*
* fileToElement: function( file ) {
* var el = new CKEDITOR.dom.element( 'span' );
* el.setText( '...' );
* return el;
* },
*
* onUploaded: function( upload ) {
* this.replaceWith( '<a href="' + upload.url + '" target="_blank">' + upload.fileName + '</a>' );
* }
* } );
*
* If you need custom `paste` handling, you need to mark the pasted element to be changed into an upload widget
* using {@link CKEDITOR.fileTools#markElement markElement}. For example, instead of the `fileToElement` helper from the
* example above, a `paste` listener can be created manually:
*
* editor.on( 'paste', function( evt ) {
* var file, i, el, loader;
*
* for ( i = 0; i < evt.data.dataTransfer.getFilesCount(); i++ ) {
* file = evt.data.dataTransfer.getFile( i );
*
* if ( CKEDITOR.fileTools.isTypeSupported( file, /text\/(plain|html)/ ) ) {
* el = new CKEDITOR.dom.element( 'span' ),
* loader = editor.uploadRepository.create( file );
*
* el.setText( '...' );
*
* loader.load();
*
* CKEDITOR.fileTools.markElement( el, 'filereader', loader.id );
*
* evt.data.dataValue += el.getOuterHtml();
* }
* }
* } );
*
* Note that you can bind notifications to the upload widget on paste using
* the {@link CKEDITOR.fileTools#bindNotifications} method, so notifications will automatically
* show the progress of the upload. Because this method shows notifications about upload, do not use it if you only
* {@link CKEDITOR.fileTools.fileLoader#load load} (and not upload) a file.
*
* editor.on( 'paste', function( evt ) {
* var file, i, el, loader;
*
* for ( i = 0; i < evt.data.dataTransfer.getFilesCount(); i++ ) {
* file = evt.data.dataTransfer.getFile( i );
*
* if ( CKEDITOR.fileTools.isTypeSupported( file, /text\/pdf/ ) ) {
* el = new CKEDITOR.dom.element( 'span' ),
* loader = editor.uploadRepository.create( file );
*
* el.setText( '...' );
*
* loader.upload();
*
* CKEDITOR.fileTools.markElement( el, 'pdfuploader', loader.id );
*
* CKEDITOR.fileTools.bindNotifications( editor, loader );
*
* evt.data.dataValue += el.getOuterHtml();
* }
* }
* } );
*
* @member CKEDITOR.fileTools
* @param {CKEDITOR.editor} editor The editor instance.
* @param {String} name The name of the upload widget.
* @param {CKEDITOR.fileTools.uploadWidgetDefinition} def Upload widget definition.
*/
function addUploadWidget( editor, name, def ) {
var fileTools = CKEDITOR.fileTools,
uploads = editor.uploadRepository,
// Plugins which support all file type has lower priority than plugins which support specific types.
priority = def.supportedTypes ? 10 : 20;
if ( def.fileToElement ) {
// 간편이미지 추가
def.fileDialog.on( 'change', function( evt ) {
var data = evt.data,
files = def.fileDialog[0].files,
filesCount = files.length,
loadMethod = def.loadMethod || 'loadAndUpload',
file, i;
if ( !filesCount ) {
return;
}
for ( i = 0; i < filesCount; i++ ) {
file = files[i];
// No def.supportedTypes means all types are supported.
if ( !def.supportedTypes || fileTools.isTypeSupported( file, def.supportedTypes ) ) {
var el = def.fileToElement( file ),
loader = uploads.create( file );
if ( el ) {
loader[ loadMethod ]( def.uploadUrl, def.additionalRequestParameters );
CKEDITOR.fileTools.markElement( el, name, loader.id );
if ( loadMethod == 'loadAndUpload' || loadMethod == 'upload' ) {
CKEDITOR.fileTools.bindNotifications( editor, loader );
}
}
}
}
} );
editor.on( 'paste', function( evt ) {
var data = evt.data,
// Fetch runtime widget definition as it might get changed in editor#widgetDefinition event.
def = editor.widgets.registered[ name ],
dataTransfer = data.dataTransfer,
filesCount = dataTransfer.getFilesCount(),
loadMethod = def.loadMethod || 'loadAndUpload',
file, i;
if ( data.dataValue || !filesCount ) {
return;
}
for ( i = 0; i < filesCount; i++ ) {
file = dataTransfer.getFile( i );
// No def.supportedTypes means all types are supported.
if ( !def.supportedTypes || fileTools.isTypeSupported( file, def.supportedTypes ) ) {
var el = def.fileToElement( file ),
loader = uploads.create( file, undefined, def.loaderType );
if ( el ) {
loader[ loadMethod ]( def.uploadUrl, def.additionalRequestParameters );
CKEDITOR.fileTools.markElement( el, name, loader.id );
if ( ( loadMethod == 'loadAndUpload' || loadMethod == 'upload' ) && !def.skipNotifications ) {
CKEDITOR.fileTools.bindNotifications( editor, loader );
}
data.dataValue += el.getOuterHtml();
}
}
}
}, null, null, priority );
}
/**
* This is an abstract class that describes a definition of an upload widget.
* It is a type of {@link CKEDITOR.fileTools#addUploadWidget} method's second argument.
*
* Note that because the upload widget is a type of a widget, this definition extends
* {@link CKEDITOR.plugins.widget.definition}.
* It adds several new properties and callbacks and implements the {@link CKEDITOR.plugins.widget.definition#downcast}
* and {@link CKEDITOR.plugins.widget.definition#init} callbacks. These two properties
* should not be overwritten.
*
* Also, the upload widget definition defines a few properties ({@link #fileToElement}, {@link #supportedTypes},
* {@link #loadMethod loadMethod}, {@link #uploadUrl} and {@link #additionalRequestParameters}) used in the
* {@link CKEDITOR.editor#paste} listener which is registered by {@link CKEDITOR.fileTools#addUploadWidget}
* if the upload widget definition contains the {@link #fileToElement} callback.
*
* @abstract
* @class CKEDITOR.fileTools.uploadWidgetDefinition
* @mixins CKEDITOR.plugins.widget.definition
*/
CKEDITOR.tools.extend( def, {
/**
* Upload widget definition overwrites the {@link CKEDITOR.plugins.widget.definition#downcast} property.
* This should not be changed.
*
* @property {String/Function}
*/
downcast: function() {
return new CKEDITOR.htmlParser.text( '' );
},
/**
* Upload widget definition overwrites the {@link CKEDITOR.plugins.widget.definition#init} property.
* If you want to add some code in the `init` callback remember to call the base function.
*
* @property {Function}
*/
init: function() {
var widget = this,
id = this.wrapper.findOne( '[data-cke-upload-id]' ).data( 'cke-upload-id' ),
loader = uploads.loaders[ id ],
capitalize = CKEDITOR.tools.capitalize,
oldStyle, newStyle;
loader.on( 'update', function( evt ) {
// (#1454)
if ( loader.status === 'abort' ) {
if ( typeof widget.onAbort === 'function' ) {
widget.onAbort( loader );
}
}
// Abort if widget was removed.
if ( !widget.wrapper || !widget.wrapper.getParent() ) {
// Uploading should be aborted if the editor is already destroyed (#966) or the upload widget was removed.
if ( !CKEDITOR.instances[ editor.name ] || !editor.editable().find( '[data-cke-upload-id="' + id + '"]' ).count() ) {
loader.abort();
}
evt.removeListener();
return;
}
editor.fire( 'lockSnapshot' );
// Call users method, eg. if the status is `uploaded` then
// `onUploaded` method will be called, if exists.
var methodName = 'on' + capitalize( loader.status );
if ( loader.status !== 'abort' && typeof widget[ methodName ] === 'function' ) {
if ( widget[ methodName ]( loader ) === false ) {
editor.fire( 'unlockSnapshot' );
return;
}
}
// Set style to the wrapper if it still exists.
newStyle = 'cke_upload_' + loader.status;
if ( widget.wrapper && newStyle != oldStyle ) {
oldStyle && widget.wrapper.removeClass( oldStyle );
widget.wrapper.addClass( newStyle );
oldStyle = newStyle;
}
// Remove widget on error or abort.
if ( loader.status == 'error' || loader.status == 'abort' ) {
editor.widgets.del( widget );
}
editor.fire( 'unlockSnapshot' );
} );
loader.update();
},
/**
* Replaces the upload widget with the final HTML. This method should be called when the upload is done,
* usually in the {@link #onUploaded} callback.
*
* @property {Function}
* @param {String} data HTML to replace the upload widget.
* @param {String} [mode='html'] See {@link CKEDITOR.editor#method-insertHtml}'s modes.
*/
replaceWith: function( data, mode ) {
if ( data.trim() === '' ) {
editor.widgets.del( this );
return;
}
var wasSelected = ( this == editor.widgets.focused ),
editable = editor.editable(),
range = editor.createRange(),
bookmark, bookmarks;
if ( !wasSelected ) {
bookmarks = editor.getSelection().createBookmarks();
}
range.setStartBefore( this.wrapper );
range.setEndAfter( this.wrapper );
if ( wasSelected ) {
bookmark = range.createBookmark();
}
editable.insertHtmlIntoRange( data, range, mode );
editor.widgets.checkWidgets( { initOnlyNew: true } );
// Ensure that old widgets instance will be removed.
// If replaceWith is called in init, because of paste then checkWidgets will not remove it.
editor.widgets.destroy( this, true );
if ( wasSelected ) {
range.moveToBookmark( bookmark );
range.select();
} else {
editor.getSelection().selectBookmarks( bookmarks );
}
},
/**
* @private
* @returns {CKEDITOR.fileTools.fileLoader/null} The loader associated with this widget instance or `null` if not found.
*/
_getLoader: function() {
var marker = this.wrapper.findOne( '[data-cke-upload-id]' );
return marker ? this.editor.uploadRepository.loaders[ marker.data( 'cke-upload-id' ) ] : null;
}
/**
* If this property is defined, paste listener is created to transform the pasted file into an HTML element.
* It creates an HTML element which will be then transformed into an upload widget.
* It is only called for {@link #supportedTypes supported files}.
* If multiple files were pasted, this function will be called for each file of a supported type.
*
* @property {Function} fileToElement
* @param {Blob} file A pasted file to load or upload.
* @returns {CKEDITOR.dom.element} An element which will be transformed into the upload widget.
*/
/**
* Regular expression to check if the file type is supported by this widget.
* If not defined, all files will be handled.
*
* @property {String} [supportedTypes]
*/
/**
* The URL to which the file will be uploaded. It should be taken from the configuration using
* {@link CKEDITOR.fileTools#getUploadUrl}.
*
* @property {String} [uploadUrl]
*/
/**
* Loader type that should be used for creating file tools requests.
*
* @property {Function} [loaderType]
*/
/**
* An object containing additional data that should be passed to the function defined by {@link #loadMethod}.
*
* @property {Object} [additionalRequestParameters]
*/
/**
* The type of loading operation that should be executed as a result of pasting a file. Possible options are:
*
* * `'loadAndUpload'` &ndash; Default behavior. The {@link CKEDITOR.fileTools.fileLoader#loadAndUpload} method will be
* executed, the file will be loaded first and uploaded immediately after loading is done.
* * `'load'` &ndash; The {@link CKEDITOR.fileTools.fileLoader#load} method will be executed. This loading type should
* be used if you only want to load file data without uploading it.
* * `'upload'` &ndash; The {@link CKEDITOR.fileTools.fileLoader#upload} method will be executed, the file will be uploaded
* without loading it to memory. This loading type should be used if you want to upload a big file,
* otherwise you can get an "out of memory" error.
*
* @property {String} [loadMethod=loadAndUpload]
*/
/**
* Indicates whether default notification handling should be skipped.
*
* By default upload widget will use [Notification](https://ckeditor.com/cke4/addon/notification) plugin to provide
* feedback for upload progress and eventual success / error message.
*
* @since 4.8.0
* @property {Boolean} [skipNotifications=false]
*/
/**
* A function called when the {@link CKEDITOR.fileTools.fileLoader#status status} of the upload changes to `loading`.
*
* @property {Function} [onLoading]
* @param {CKEDITOR.fileTools.fileLoader} loader Loader instance.
* @returns {Boolean}
*/
/**
* A function called when the {@link CKEDITOR.fileTools.fileLoader#status status} of the upload changes to `loaded`.
*
* @property {Function} [onLoaded]
* @param {CKEDITOR.fileTools.fileLoader} loader Loader instance.
* @returns {Boolean}
*/
/**
* A function called when the {@link CKEDITOR.fileTools.fileLoader#status status} of the upload changes to `uploading`.
*
* @property {Function} [onUploading]
* @param {CKEDITOR.fileTools.fileLoader} loader Loader instance.
* @returns {Boolean}
*/
/**
* A function called when the {@link CKEDITOR.fileTools.fileLoader#status status} of the upload changes to `uploaded`.
* At that point the upload is done and the upload widget should be replaced with the final HTML using
* the {@link #replaceWith} method.
*
* @property {Function} [onUploaded]
* @param {CKEDITOR.fileTools.fileLoader} loader Loader instance.
* @returns {Boolean}
*/
/**
* A function called when the {@link CKEDITOR.fileTools.fileLoader#status status} of the upload changes to `error`.
* The default behavior is to remove the widget and it can be canceled if this function returns `false`.
*
* @property {Function} [onError]
* @param {CKEDITOR.fileTools.fileLoader} loader Loader instance.
* @returns {Boolean} If `false`, the default behavior (remove widget) will be canceled.
*/
/**
* A function called when the {@link CKEDITOR.fileTools.fileLoader#status status} of the upload changes to `abort`.
* The default behavior is to remove the widget and it can be canceled if this function returns `false`.
*
* @property {Function} [onAbort]
* @param {CKEDITOR.fileTools.fileLoader} loader Loader instance.
* @returns {Boolean} If `false`, the default behavior (remove widget) will be canceled.
*/
} );
editor.widgets.add( name, def );
}
/**
* Marks an element which should be transformed into an upload widget.
*
* @see CKEDITOR.fileTools.addUploadWidget
*
* @member CKEDITOR.fileTools
* @param {CKEDITOR.dom.element} element Element to be marked.
* @param {String} widgetName The name of the upload widget.
* @param {Number} loaderId The ID of a related {@link CKEDITOR.fileTools.fileLoader}.
*/
function markElement( element, widgetName, loaderId ) {
element.setAttributes( {
'data-cke-upload-id': loaderId,
'data-widget': widgetName
} );
}
/**
* Binds a notification to the {@link CKEDITOR.fileTools.fileLoader file loader} so the upload widget will use
* the notification to show the status and progress.
* This function uses {@link CKEDITOR.plugins.notificationAggregator}, so even if multiple files are uploading
* only one notification is shown. Warnings are an exception, because they are shown in separate notifications.
* This notification shows only the progress of the upload, so this method should not be used if
* the {@link CKEDITOR.fileTools.fileLoader#load loader.load} method was called. It works with
* {@link CKEDITOR.fileTools.fileLoader#upload upload} and {@link CKEDITOR.fileTools.fileLoader#loadAndUpload loadAndUpload}.
*
* @member CKEDITOR.fileTools
* @param {CKEDITOR.editor} editor The editor instance.
* @param {CKEDITOR.fileTools.fileLoader} loader The file loader instance.
*/
function bindNotifications( editor, loader ) {
var aggregator,
task = null;
loader.on( 'update', function() {
// Value of uploadTotal is known after upload start. Task will be created when uploadTotal is present.
if ( !task && loader.uploadTotal ) {
createAggregator();
task = aggregator.createTask( { weight: loader.uploadTotal } );
}
if ( task && loader.status == 'uploading' ) {
task.update( loader.uploaded );
}
} );
loader.on( 'uploaded', function() {
task && task.done();
} );
loader.on( 'error', function() {
task && task.cancel();
editor.showNotification( loader.message, 'warning' );
} );
loader.on( 'abort', function() {
task && task.cancel();
// Editor could be already destroyed (#966).
if ( CKEDITOR.instances[ editor.name ] ) {
editor.showNotification( editor.lang.uploadwidget.abort, 'info' );
}
} );
function createAggregator() {
aggregator = editor._.uploadWidgetNotificaionAggregator;
// Create one notification aggregator for all types of upload widgets for the editor.
if ( !aggregator || aggregator.isFinished() ) {
aggregator = editor._.uploadWidgetNotificaionAggregator = new CKEDITOR.plugins.notificationAggregator(
editor, editor.lang.uploadwidget.uploadMany, editor.lang.uploadwidget.uploadOne );
aggregator.once( 'finished', function() {
var tasks = aggregator.getTaskCount();
if ( tasks === 0 ) {
aggregator.notification.hide();
} else {
aggregator.notification.update( {
message: tasks == 1 ?
editor.lang.uploadwidget.doneOne :
editor.lang.uploadwidget.doneMany.replace( '%1', tasks ),
type: 'success',
important: 1
} );
}
} );
}
}
}
// Two plugins extend this object.
if ( !CKEDITOR.fileTools ) {
CKEDITOR.fileTools = {};
}
CKEDITOR.tools.extend( CKEDITOR.fileTools, {
addUploadWidget: addUploadWidget,
markElement: markElement,
bindNotifications: bindNotifications
} );
} )();

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

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