Initial commit
25
api.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once 'core.php';
|
||||||
|
|
||||||
|
header('Content-type: application/json');
|
||||||
|
|
||||||
|
$blog = new blog();
|
||||||
|
$entries = array();
|
||||||
|
|
||||||
|
if ($blog->entries)
|
||||||
|
{
|
||||||
|
while ($data = $blog->entries())
|
||||||
|
array_push($entries, array('entryTitle'=>$data['entryTitle'], 'entrySlug'=>$data['entrySlug'], 'entryPublished'=>show_date($data['entryPublished']), 'entryContent'=>entry_show_init($data['entryContent'], $data['entrySlug'], true)));
|
||||||
|
/*echo "<article>
|
||||||
|
<header>
|
||||||
|
<h2><a href='".get_entry_link($data['entrySlug'])."'>$data[entryTitle]</a></h2>
|
||||||
|
<p class='meta'><time class='date' title='{locale:published_on}'>".show_date($data['entryPublished'])."</time><a href='".get_profile_link($data['userName'])."' class='by' title='{locale:entry_by}'>$data[publicName]</a>".get_entry_admin($data)."</p>
|
||||||
|
</header>
|
||||||
|
<div class='content'>".entry_show_init($data['entryContent'], $data['entrySlug'])."</div>
|
||||||
|
</article>\n";*/
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode($entries);
|
||||||
|
|
||||||
|
?>
|
11
config.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
//error_reporting(E_ALL);
|
||||||
|
|
||||||
|
define('DBHOST', 'localhost');
|
||||||
|
define('DBNAME', 'blog');
|
||||||
|
define('DBUSER', 'blog');
|
||||||
|
define('DBPASS', '');
|
||||||
|
define('DBCHAR', 'utf8');
|
||||||
|
|
||||||
|
define('DATE_FORMAT_DEFAULT', 'm/d/y H:i');
|
305
core.php
Normal file
@ -0,0 +1,305 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// Start session
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
// REALLY NICE ERROR PAGE KINDA THING
|
||||||
|
function nice_error($err, $errstr = false)
|
||||||
|
{
|
||||||
|
if ($errstr) { $errno = $err; $err = $errstr; }
|
||||||
|
if (($errstr && $errno != 2048) || !$errstr)
|
||||||
|
die('<!doctype html><html><head><title>Insanely</title><meta charset="utf-8" /></head><body><h1>So bad...</h1><p><img style="width: 260px" src="/data/imgs/coding_in_progress.jpg" alt=""/></p><p>'.$err.(isset($errno) ? ' ('.$errno.')' : '').'</p></body></html>');
|
||||||
|
}
|
||||||
|
set_error_handler('nice_error');
|
||||||
|
|
||||||
|
// LOAD CONFIG
|
||||||
|
require_once 'config.php';
|
||||||
|
|
||||||
|
// FEEDBACK
|
||||||
|
$info = array();
|
||||||
|
$error = array();
|
||||||
|
|
||||||
|
// SEO
|
||||||
|
if (isset($_GET['pathsec']))
|
||||||
|
{
|
||||||
|
$seo = explode('/', $_GET['pathsec']);
|
||||||
|
foreach ($seo AS $a=>$b)
|
||||||
|
$seo[$a] = htmlspecialchars($b);
|
||||||
|
} else
|
||||||
|
$seo = array('');
|
||||||
|
|
||||||
|
// DATABASE
|
||||||
|
$_sql = new mysqli(DBHOST, DBUSER, DBPASS, DBNAME) or nice_error('Sorry, but we cant connect to the database server right now.');
|
||||||
|
$_sql->query("SET NAMES ".DBCHAR);
|
||||||
|
$_sql->query("SET CHARACTER SET ".DBCHAR);
|
||||||
|
|
||||||
|
// LANGUAGE
|
||||||
|
$_locale = (array)json_decode(file_get_contents('includes/locale/hu_HU.lng'));
|
||||||
|
|
||||||
|
// OTHER CLEVER STUFFS
|
||||||
|
function clear_cache() { header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); }
|
||||||
|
|
||||||
|
function redirect($url = '/', $status = false) { header('Location: '.$url.($status ? '?status='.$status : '')); exit; }
|
||||||
|
function isnum($in) { return is_numeric($in); }
|
||||||
|
function sqlprot($in) { global $_sql; return $_sql->real_escape_string($in); }
|
||||||
|
|
||||||
|
function trimlink($in, $length = 140) { $in = html_entity_decode(strip_tags($in)); if (strlen($in) > $length) return substr($in, 0, $length-3).'...'; return $in; }
|
||||||
|
|
||||||
|
$set = $_sql->query("SELECT * FROM settings");
|
||||||
|
while ($data = $set->fetch_assoc())
|
||||||
|
$_set[$data['variable']] = $data['value'];
|
||||||
|
|
||||||
|
|
||||||
|
// CLASSES
|
||||||
|
require_once 'includes/user.class.php';
|
||||||
|
require_once 'includes/blog.class.php';
|
||||||
|
require_once 'includes/page.class.php';
|
||||||
|
require_once 'includes/check.class.php';
|
||||||
|
require_once 'includes/comment.class.php';
|
||||||
|
|
||||||
|
|
||||||
|
// FUNCTIONS
|
||||||
|
function get_page_link($slug, $p = false) { global $_set; $prefix = ($p ? $_set['url'] : ''); if ($_set['seo']) return $prefix."/$_set[subPage]/$slug"; return $prefix."/?pathsec=$_set[subPage]/$slug"; }
|
||||||
|
function get_entry_link($slug, $p = false, $admin = false) { global $_set; $prefix = ($p ? $_set['url'] : '').($admin ? '/admin' : null); if ($_set['seo']) return $prefix."/$_set[subEntry]/$slug"; return $prefix."/?pathsec=$_set[subEntry]/$slug"; }
|
||||||
|
function get_profile_link($slug = false, $p = false) { global $_set; $prefix = ($p ? $_set['url'] : ''); if (!$slug) { global $user; if (LOGGEDIN) $slug = $user['userName']; else $slug = ''; } if ($_set['seo']) return $prefix."/$_set[subProfile]/$slug"; return $prefix."/?pathsec=$_set[subProfile]/$slug"; }
|
||||||
|
function get_profile_picture($userData = false, $p = false) { global $_set; $prefix = ($p ? $_set['url'] : ''); if (!$userData) if (LOGGEDIN) { global $user; $userData = $user;} else $userData = array('userPic'=>0); return $prefix.($userData['userPic'] ? "/data/profile_pics/$userData[userId].jpg" : '/data/imgs/'.$_set['defaultProfilePic']); }
|
||||||
|
function get_current_link($p = false) { global $_set, $seo; $prefix = ($p ? $_set['url'] : ''); $link = ''; for ($i = 0; $i < sizeof($seo); $i++) $link .= '/'.$seo[$i]; return $prefix.($_set['seo'] ? $link : '/?pathsec='.$link); }
|
||||||
|
|
||||||
|
function get_theme_lib() { global $_set; if (file_exists('themes/'.$_set['mainTheme'])) return 'themes/'.$_set['mainTheme']; return false; }
|
||||||
|
function get_theme()
|
||||||
|
{
|
||||||
|
global $_set;
|
||||||
|
if (file_exists('themes/'.$_set['mainTheme'].'/template.php'))
|
||||||
|
return 'themes/'.$_set['mainTheme'].'/template.php';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function get_site_link() { global $_set; return $_set['url']; }
|
||||||
|
function get_site_body() { global $output; return output_replacer($output); }
|
||||||
|
|
||||||
|
function get_navigation($append = '')
|
||||||
|
{
|
||||||
|
global $_locale, $_sql, $seo, $_title;
|
||||||
|
$navLinks = array();
|
||||||
|
if ($seo[0] && isset($_title[0])) array_push($navLinks, array('link' => '/', 'title' => $_locale['home']));
|
||||||
|
$navQuery = $_sql->query("SELECT pageSlug, pageTitle FROM pages ORDER BY pageTitle ASC");
|
||||||
|
while ($navData = $navQuery->fetch_assoc())
|
||||||
|
array_push($navLinks, array('link' => get_page_link($navData['pageSlug']), 'title' => $navData['pageTitle']));
|
||||||
|
|
||||||
|
for ($i = 0; $i < sizeof($navLinks); $i++)
|
||||||
|
{
|
||||||
|
$link = explode('/', $navLinks[$i]['link']);
|
||||||
|
for ($b = 1; $b < sizeof($link); $b++)
|
||||||
|
{
|
||||||
|
$active = true;
|
||||||
|
if (isset($seo[$b-1]) && $seo[$b-1] == $link[$b] && $active)
|
||||||
|
$active = true; else $active = false;
|
||||||
|
}
|
||||||
|
echo "<li><a href='".$navLinks[$i]['link'].$append."'".($active ? " class='active'":'').">".$navLinks[$i]['title']."</a></li>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function get_tags($append = '')
|
||||||
|
{
|
||||||
|
global $_sql;
|
||||||
|
$tags = $_sql->query("SELECT tagId, tagName, COUNT(taggedId) AS taggedposts FROM tagged INNER JOIN tags ON tagId = taggedTag GROUP BY tagId ORDER BY tagName ASC");
|
||||||
|
if ($tags->num_rows)
|
||||||
|
{
|
||||||
|
while ($data = $tags->fetch_assoc())
|
||||||
|
echo "<li><a href='/tag/$data[tagId]$append'>$data[tagName]</a> <span>$data[taggedposts]</span></li>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_entry_admin($d)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
if (!LOGGEDIN) return '';
|
||||||
|
|
||||||
|
if ($user['userLevel'] > 3) return "<span class='admin'>".($d['entryPinned'] ? "<a href='/admin/entry/$d[entrySlug]/unpin' class='pin unpin'>{locale:unpin}</a>":"<a href='/admin/entry/$d[entrySlug]/pin' class='pin'>{locale:pin}</a>")."<a href='/admin/entry/$d[entrySlug]' class='edit'>{locale:edit}</a><a href='/admin/entry/$d[entrySlug]/delete' class='delete' onclick='return confirm(\"{locale:delete_confirm}\")'>{locale:delete}</a></span>";
|
||||||
|
if ($user['userLevel'] > 2 && $d['entryBy'] == $user['userId']) return "<span class='admin'><a href='/admin/entry/$d[entrySlug]' class='edit'>{locale:edit}</a></span>";
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_page_title()
|
||||||
|
{
|
||||||
|
global $_title, $_set;
|
||||||
|
if (!empty($_title))
|
||||||
|
{
|
||||||
|
$title2 = '';
|
||||||
|
for ($i=sizeof($_title)-1; $i>=0; $i--)
|
||||||
|
$title2 .= $_title[$i].', ';
|
||||||
|
|
||||||
|
$trepf = array('{title}', '{page}');
|
||||||
|
$trept = array($_set['title'], rtrim($title2, ', '));
|
||||||
|
echo str_replace($trepf, $trept, ($_set['titleFormat'] ? $_set['titleFormat'] : '{page} | {title}'));
|
||||||
|
} else
|
||||||
|
echo $_set['title'];
|
||||||
|
}
|
||||||
|
function get_page_extra_head()
|
||||||
|
{
|
||||||
|
global $_head, $metaimage, $_set;
|
||||||
|
if (!empty($_head))
|
||||||
|
{
|
||||||
|
for ($i=0; $i<sizeof($_head); $i++)
|
||||||
|
echo $_head[$i]."\n";
|
||||||
|
}
|
||||||
|
echo '<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="'.$_set['url'].'/rss" />'."\n";
|
||||||
|
if ($metaimage)
|
||||||
|
{
|
||||||
|
if (!strpos($metaimage, 'http')) $metaimage = $_set['url'].$metaimage;
|
||||||
|
echo '<link rel="image_src" href="'.$metaimage.'" />'."\n";
|
||||||
|
echo '<meta property="og:image" content="'.$metaimage.'" />';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_page_extra_body()
|
||||||
|
{
|
||||||
|
global $_body, $_set;
|
||||||
|
if (!empty($_body))
|
||||||
|
for ($i=0; $i<sizeof($_body); $i++)
|
||||||
|
echo $_body[$i]."\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_errors()
|
||||||
|
{
|
||||||
|
global $error;
|
||||||
|
if (!empty($error))
|
||||||
|
{
|
||||||
|
echo "<div id='errors'>";
|
||||||
|
for($i=0; $i<sizeof($error); $i++)
|
||||||
|
echo "<li>$error[$i]</li>";
|
||||||
|
echo "</ul></div>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function get_infos()
|
||||||
|
{
|
||||||
|
global $info;
|
||||||
|
if (!empty($info))
|
||||||
|
{
|
||||||
|
echo "<div id='infos'>";
|
||||||
|
for($i=0; $i<sizeof($info); $i++)
|
||||||
|
echo "<li>$info[$i]</li>";
|
||||||
|
echo "</ul></div>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_pin($pin) { global $_SESSION; $_SESSION['entry_pin'] = $pin; }
|
||||||
|
function get_pin() { global $_SESSION; return isset($_SESSION['entry_pin']) ? $_SESSION['entry_pin'] : false; }
|
||||||
|
|
||||||
|
function theme_component($comp) {
|
||||||
|
$cf = get_theme_lib().'/components/'.$comp.'.php';
|
||||||
|
if (file_exists($cf))
|
||||||
|
return $cf;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function show_date($ts) { global $_set; return (!(int)date('Hi', $ts) ? date($_set['dateformatShort'], $ts) : date($_set['dateformat'], $ts)); }
|
||||||
|
|
||||||
|
$_title = array();
|
||||||
|
function addTitle($add) { global $_title; array_push($_title, htmlentities($add)); }
|
||||||
|
|
||||||
|
$_head = array();
|
||||||
|
$head_registered = array();
|
||||||
|
function addHead($add, $register = false) { global $_head, $head_registered; if (($register && !in_array($register, $head_registered)) || !$register) array_push($_head, $add); }
|
||||||
|
|
||||||
|
$_body = array();
|
||||||
|
$body_registered = array();
|
||||||
|
function addBody($add, $register = false) { global $_body, $body_registered; if (($register && !in_array($register, $body_registered)) || !$register) array_push($_body, $add); }
|
||||||
|
|
||||||
|
$description = false;
|
||||||
|
function addDescription($add) { global $description; if (!$description) $description = ''; $description .= str_replace(array('"', '\'', "\n", "\r\n", '<', '>'), '', strip_tags($add)).' '; }
|
||||||
|
|
||||||
|
function keywords() { global $description, $_set; $keywords = explode(' ', str_replace(array(',','?','.','!'), ' ', ($description ? $description : $_set['description']))); foreach($keywords AS $a => $b) { $val = trim($b); if (strlen($val) > 3) $keywords[$a] = $val; else unset($keywords[$a]); } return implode(',', array_unique($keywords)); }
|
||||||
|
|
||||||
|
$metaimage = false;
|
||||||
|
function addImage($add) { global $metaimage; $metaimage = $add; }
|
||||||
|
|
||||||
|
$headerimg = false;
|
||||||
|
function headerImage($url) { global $headerimg; if (strlen($url) > 3) $headerimg = $url; }
|
||||||
|
|
||||||
|
/* POST FUCKER */
|
||||||
|
function entry_replacer($in)
|
||||||
|
{
|
||||||
|
global $_locale;
|
||||||
|
$pattern[] = '#\[music=(.*?)\]#';
|
||||||
|
$replace[] = '<iframe style="width: 100%; height: 10em; border: 0; padding: 0; margin: 0;" class="music" src="http://music.sandros.hu/shared/$1?volume=50"></iframe>';
|
||||||
|
|
||||||
|
$pattern[] = '#\[youtube=(.*?)\]#';
|
||||||
|
$replace[] = '<iframe style="width: 100%; height: 600px; border: 0; padding: 0; margin: 0;" class="youtube" src="http://www.youtube-nocookie.com/embed/$1"></iframe>';
|
||||||
|
|
||||||
|
$pattern[] = '#\[spoiler\](.*?)\[/spoiler\]#';
|
||||||
|
$replace[] = '<div class="spoiler"><div class="spoiler_b"><button onclick="spoilerToggle($(this))">'.$_locale['show_hidden_content'].'</button><div style="display:none" class="spoiler_c">$1</div></div>';
|
||||||
|
|
||||||
|
$pattern[] = '#\[spoiler=(.*?)\](.*?)\[/spoiler\]#';
|
||||||
|
$replace[] = '<div class="spoiler"><div class="spoiler_b"><button onclick="spoilerToggle($(this))">$1</button><div style="display:none" class="spoiler_c">$2</div></div>';
|
||||||
|
|
||||||
|
|
||||||
|
return preg_replace($pattern, $replace, $in);
|
||||||
|
}
|
||||||
|
|
||||||
|
function entry_show_init($in, $slug, $flink = false)
|
||||||
|
{
|
||||||
|
global $_locale;
|
||||||
|
|
||||||
|
$in = entry_replacer($in);
|
||||||
|
|
||||||
|
$search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript
|
||||||
|
'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
|
||||||
|
'@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA
|
||||||
|
);
|
||||||
|
$in = preg_replace($search, '', $in);
|
||||||
|
|
||||||
|
$in2 = explode('[[MORE]]', $in);
|
||||||
|
if (isset($in2[1]) && strlen(trim($in2[1])))
|
||||||
|
return $in2[0]."\n<p class='readmore'><a href='".get_entry_link($slug, $flink)."#readmore'>$_locale[entry_read_more]</a></p>\n";
|
||||||
|
return $in;
|
||||||
|
}
|
||||||
|
|
||||||
|
function entry_show_all($in) { return str_replace('[[MORE]]', '<a name="readmore"></a>', entry_replacer($in)); }
|
||||||
|
|
||||||
|
|
||||||
|
/* OUTPUT FUCKER */
|
||||||
|
function regexp_locale($a)
|
||||||
|
{
|
||||||
|
global $_locale;
|
||||||
|
if (isset($_locale[$a[1]]))
|
||||||
|
return $_locale[$a[1]];
|
||||||
|
return $a[0];
|
||||||
|
}
|
||||||
|
function output_replacer($in)
|
||||||
|
{
|
||||||
|
return preg_replace_callback('#\{locale:([a-zA-Z\-\_]+?)\}#', 'regexp_locale', $in);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* LOGIN SYSTEM */
|
||||||
|
if (isset($_COOKIE['filtr_token']))
|
||||||
|
{
|
||||||
|
require_once 'includes/filtr.class.php';
|
||||||
|
|
||||||
|
$filtr = new filtrLogin();
|
||||||
|
$filtr->cache = '/tmp/';
|
||||||
|
$filtr->setAppid($_set['filtr_appid']);
|
||||||
|
$filtr->setApptoken($_set['filtr_apptoken']);
|
||||||
|
$filtr->setToken($_COOKIE['filtr_token']);
|
||||||
|
$filtr->Login();
|
||||||
|
|
||||||
|
if ($filtr->status())
|
||||||
|
{
|
||||||
|
$filtr = $filtr->getData();
|
||||||
|
$user = new user($filtr['link'], $filtr);
|
||||||
|
if ($user)
|
||||||
|
{
|
||||||
|
$user = $user->data;
|
||||||
|
define('LOGGEDIN', true);
|
||||||
|
}
|
||||||
|
unset($filtr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_GET['logout']))
|
||||||
|
{
|
||||||
|
setcookie('filtr_token', '', null, '/');
|
||||||
|
redirect();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!defined('LOGGEDIN'))
|
||||||
|
define('LOGGEDIN', false);
|
BIN
data/.DS_Store
vendored
Normal file
69
data/imglist.json.php
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
header('Cache-Control: no-cache, must-revalidate');
|
||||||
|
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||||
|
header('Content-type: application/json');
|
||||||
|
|
||||||
|
$images = array();
|
||||||
|
|
||||||
|
|
||||||
|
function scan_dir($dir) {
|
||||||
|
$ignored = array('.', '..', '.svn', '.htaccess');
|
||||||
|
|
||||||
|
$files = array();
|
||||||
|
foreach (scandir($dir) as $file) {
|
||||||
|
if (in_array($file, $ignored)) continue;
|
||||||
|
$files[$file] = filemtime($dir . '/' . $file);
|
||||||
|
}
|
||||||
|
|
||||||
|
arsort($files);
|
||||||
|
$files = array_keys($files);
|
||||||
|
|
||||||
|
return ($files) ? $files : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function imagelist($dir)
|
||||||
|
{
|
||||||
|
global $images;
|
||||||
|
|
||||||
|
//$stuffs = scandir($dir);
|
||||||
|
|
||||||
|
$stuffs = scan_dir($dir);
|
||||||
|
|
||||||
|
for ($i = 0; $i < sizeof($stuffs); $i++)
|
||||||
|
{
|
||||||
|
$farr = explode('.', $stuffs[$i]);
|
||||||
|
if ($stuffs[$i] != '.' && $stuffs[$i] != '..' && $farr[0] != 'thumb')
|
||||||
|
if (is_dir($stuffs[$i]))
|
||||||
|
imagelist($dir.'/'.$stuffs[$i]);
|
||||||
|
elseif (in_array(end($farr), array('gif', 'png', 'jpg', 'jpeg')))
|
||||||
|
{
|
||||||
|
// PATHS
|
||||||
|
$outdir = '/data/'.ltrim($dir, './').'/';
|
||||||
|
$img = $dir.'/'.$stuffs[$i];
|
||||||
|
$thumb = $dir.'/thumb.'.$stuffs[$i];
|
||||||
|
|
||||||
|
// THUMBNAIL
|
||||||
|
if (!file_exists($thumb))
|
||||||
|
{
|
||||||
|
$cthumb = new Imagick($img);
|
||||||
|
$cthumb->cropThumbnailImage(260, 260);
|
||||||
|
$cthumb->writeImage($thumb);
|
||||||
|
$cthumb->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ADD TO LIST
|
||||||
|
array_push($images, array(
|
||||||
|
'image' => $outdir.rawurlencode($stuffs[$i]),
|
||||||
|
'thumb' => $outdir.'thumb.'.$stuffs[$i],
|
||||||
|
'folder' => ltrim($dir, './')
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
imagelist('./uploads');
|
||||||
|
foreach(glob('./uploads/*', GLOB_ONLYDIR) as $dir)
|
||||||
|
imagelist($dir);
|
||||||
|
|
||||||
|
echo str_replace('\/', '/', json_encode($images));
|
BIN
data/imgs/coding_in_progress.jpg
Normal file
After Width: | Height: | Size: 50 KiB |
0
data/imgs/index.html
Normal file
BIN
data/imgs/pixel.gif
Normal file
After Width: | Height: | Size: 67 B |
BIN
data/imgs/thumb.coding_in_progress.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
data/imgs/thumb.pixel.gif
Normal file
After Width: | Height: | Size: 185 B |
BIN
data/imgs/thumb.zuko_default.jpg
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
data/imgs/zuko_default.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
0
data/index.html
Normal file
BIN
data/profile_pics/.DS_Store
vendored
Normal file
0
data/profile_pics/index.html
Normal file
0
data/tmp/index.html
Normal file
9
data/upload.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (isset($_FILES["upload"]) && $_FILES["upload"]["error"] < 1 && in_array($_FILES["upload"]["type"], explode(',', $_set['allowedPicTypes'])))
|
||||||
|
{
|
||||||
|
if (move_uploaded_file($_FILES["upload"]["tmp_name"], 'data/uploads/'.$_FILES["upload"]["name"]))
|
||||||
|
die($_locale['upload_successful']);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $_locale['upload_failed'];
|
BIN
data/uploads/.DS_Store
vendored
Normal file
0
data/uploads/index.html
Normal file
BIN
favicon.ico
Normal file
After Width: | Height: | Size: 1.1 KiB |
7
includes/admin/dashboard.php
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<h1>{locale:dashboard}</h1>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><a href='/admin/entry'>{locale:entry_editor}</a></li>
|
||||||
|
<li><a href='/admin/plugins'>{locale:plugin_manager}</a></li>
|
||||||
|
<li><a href='/admin/page'>{locale:page_editor}</a></li>
|
||||||
|
</ul>
|
149
includes/admin/entry.php
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (isset($_GET['status']))
|
||||||
|
switch ($_GET['status'])
|
||||||
|
{
|
||||||
|
case 'added':
|
||||||
|
array_push($info, $_locale['entry_added']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'updated':
|
||||||
|
array_push($info, $_locale['entry_updated']);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_POST['entryContent']) && $user['userLevel'] > 2)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (isset($_POST['entryAdd']))
|
||||||
|
{
|
||||||
|
if (blog::add($_POST['entryHeader'], $_POST['entryTitle'], $_POST['entrySlug'], $_POST['entryContent'], $_POST['entryPublished'], (isset($_POST['entryHidden']) ? true : false), $_POST['entryPIN']))
|
||||||
|
redirect(get_entry_link($_POST['entrySlug']), 'added');
|
||||||
|
else
|
||||||
|
array_push($error, $_locale['entry_not_added']);
|
||||||
|
} elseif (isset($_POST['entryUpdate']))
|
||||||
|
{
|
||||||
|
if (blog::update($_POST['entryUpdate'], $_POST['entryHeader'], $_POST['entryTitle'], $_POST['entryContent'], $_POST['entryPublished'], (isset($_POST['entryHidden']) ? true : false), $_POST['entryPIN']))
|
||||||
|
redirect(get_current_link(), 'updated');
|
||||||
|
else
|
||||||
|
array_push($error, $_locale['entry_not_updated']);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_POST['entryTag']) && $user['userLevel'] > 2)
|
||||||
|
{
|
||||||
|
if (isset($_POST['tagIdRemove']))
|
||||||
|
{
|
||||||
|
if (blog::tagRemove($_POST['tagIdRemove'], $_POST['entryId']))
|
||||||
|
array_push($info, $_locale['entry_tag_removed']);
|
||||||
|
else
|
||||||
|
array_push($error, $_locale['entry_tag_not_removed']);
|
||||||
|
} elseif (blog::tag($_POST['tagId'], $_POST['entryId']))
|
||||||
|
array_push($info, $_locale['entry_tag_added']);
|
||||||
|
else
|
||||||
|
array_push($error, $_locale['entry_tag_not_added']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($seo[2]) && $user['userLevel'] > 2)
|
||||||
|
{
|
||||||
|
$entry = new blog($seo[2]);
|
||||||
|
if ($entry->entries)
|
||||||
|
{
|
||||||
|
$entryData = $entry->entry();
|
||||||
|
if (isset($seo[3]) && $user['userLevel'] > 3)
|
||||||
|
switch ($seo[3])
|
||||||
|
{
|
||||||
|
case 'delete':
|
||||||
|
if ($entry->delete($entryData['entryId']))
|
||||||
|
redirect('/admin/entry');
|
||||||
|
else
|
||||||
|
array_push($error, $_locale['entry_not_deleted']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'pin':
|
||||||
|
if ($entry->pin($entryData['entryId']))
|
||||||
|
redirect();
|
||||||
|
else
|
||||||
|
array_push($error, $_locale['entry_not_pinned']);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'unpin':
|
||||||
|
if ($entry->unpin($entryData['entryId']))
|
||||||
|
redirect();
|
||||||
|
else
|
||||||
|
array_push($error, $_locale['entry_not_unpinned']);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
$timedQuery = $_sql->query("SELECT entrySlug, entryTitle, entryCreated, entryPublished FROM entries WHERE entryPublished > ".time()."");
|
||||||
|
if ($timedQuery->num_rows)
|
||||||
|
{
|
||||||
|
echo "<h1>{locale:timed_entries}</h1>";
|
||||||
|
echo "<table class='designed timed'><tr><td>{locale:entry_title}</td><td>{locale:created_on}</td><td>{locale:timed_pub_date}</td></tr>";
|
||||||
|
while ($data = $timedQuery->fetch_assoc())
|
||||||
|
echo "<tr><td><a href='".get_entry_link($data['entrySlug'])."'>$data[entryTitle]</a></td><td>".show_date($data['entryCreated'])."</td><td>".show_date($data['entryPublished'])."</td></tr>";
|
||||||
|
echo "</table>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$hiddenQuery = $_sql->query("SELECT entrySlug, entryTitle, entryCreated, entryPublished FROM entries WHERE entryHidden IS NOT NULL");
|
||||||
|
if ($hiddenQuery->num_rows)
|
||||||
|
{
|
||||||
|
echo "<h1>{locale:hidden_entries}</h1>";
|
||||||
|
echo "<table class='designed timed'><tr><td>{locale:entry_title}</td><td>{locale:created_on}</td><td>{locale:timed_pub_date}</td></tr>";
|
||||||
|
while ($data = $hiddenQuery->fetch_assoc())
|
||||||
|
echo "<tr><td><a href='".get_entry_link($data['entrySlug'], null, true)."'>$data[entryTitle]</a></td><td>".show_date($data['entryCreated'])."</td><td>".show_date($data['entryPublished'])."</td></tr>";
|
||||||
|
echo "</table>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<h1>{locale:entry_editor}</h1>
|
||||||
|
<form action="<?=get_current_link()?>" method="post" name="entry-edit">
|
||||||
|
|
||||||
|
<?php if (isset($entryData)) : addTitle($entryData['entryTitle']); headerImage($entryData['entryHeader']); ?>
|
||||||
|
<input type="text" name="entryHeader" value="<?=htmlentities($entryData['entryHeader'])?>" placeholder="{locale:entry_header}" maxlength="255" />
|
||||||
|
<input type="text" name="entryTitle" value="<?=htmlentities($entryData['entryTitle'])?>" placeholder="{locale:entry_title}" maxlength="250" />
|
||||||
|
<textarea id="entry-textarea" name="entryContent" rows="30"><?=htmlspecialchars($entryData['entryContent'])?></textarea>
|
||||||
|
<input id="entry-date" type="text" name="entryPublished" value="<?=date(DATE_FORMAT_DEFAULT, $entryData['entryPublished'])?>" placeholder="{locale:entry_pub_date}" maxlength="50" />
|
||||||
|
<label><input type="checkbox" name="entryHidden" value="1" <?=($entryData['entryHidden'] ? 'checked ' : '')?> /> {locale:entry_hide}</label>
|
||||||
|
<input type="text" name="entryPIN" value="<?=htmlentities($entryData['entryPIN'])?>" placeholder="{locale:entry_pin}" maxlength="6" />
|
||||||
|
<input type="hidden" name="entryUpdate" value="<?=$entryData['entryId']?>" />
|
||||||
|
<?php else: ?>
|
||||||
|
<input type="text" name="entryHeader" id="entryHeader" placeholder="{locale:entry_header}" maxlength="255" />
|
||||||
|
<input type="text" name="entryTitle" id="entryTitle" placeholder="{locale:entry_title}" maxlength="250" />
|
||||||
|
<textarea id="entry-textarea" name="entryContent" rows="30"></textarea>
|
||||||
|
<input id="entry-date" type="text" name="entryPublished" placeholder="{locale:entry_pub_date}" maxlength="50" />
|
||||||
|
<input type="text" name="entrySlug" id="entrySlug" placeholder="{locale:entry_slug}" maxlength="100" />
|
||||||
|
<label><input type="checkbox" name="entryHidden" value="1" /> {locale:entry_hide}</label>
|
||||||
|
<input type="text" name="entryPIN" placeholder="{locale:entry_pin}" maxlength="6" />
|
||||||
|
<input type="hidden" name="entryAdd" value="true" />
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
|
<button type="submit">{locale:save}</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if (isset($entryData))
|
||||||
|
{
|
||||||
|
$tags = $_sql->query("SELECT * FROM tags");
|
||||||
|
if ($tags->num_rows)
|
||||||
|
{
|
||||||
|
echo "<h3>{locale:tags}</h3>";
|
||||||
|
echo "<table class='designed'><tr><td>{locale:tag_name}</td><td>{locale:add}</td></tr>"
|
||||||
|
."<form action='".get_current_link()."' method='post' name='tagentry'>"
|
||||||
|
."<input type='hidden' name='entryId' value='$entryData[entryId]' />"
|
||||||
|
."<input type='hidden' name='entryTag' value='true' />";
|
||||||
|
|
||||||
|
while ($tag = $tags->fetch_assoc())
|
||||||
|
echo "<tr><td>$tag[tagName]</td><td>".($_sql->query("SELECT taggedId FROM tagged WHERE taggedEntry = $entryData[entryId] AND taggedTag = $tag[tagId]")->num_rows ? "<button type='submit' name='tagIdRemove' value='$tag[tagId]'>{locale:remove}</button>":"<button type='submit' name='tagId' value='$tag[tagId]'>{locale:add}</button>")."</td></tr>";
|
||||||
|
|
||||||
|
echo "</form>"
|
||||||
|
."</table>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<script>$("#entry-date").datepicker({ minDate: 0, maxDate: "+48M" });</script>
|
36
includes/admin/main.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
addTitle($_locale['admin']);
|
||||||
|
|
||||||
|
if (!isset($seo[1])) $seo[1] = '';
|
||||||
|
|
||||||
|
switch ($seo[1])
|
||||||
|
{
|
||||||
|
|
||||||
|
case 'upload':
|
||||||
|
include 'data/upload.php';
|
||||||
|
exit;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'plugins':
|
||||||
|
if ($user['userLevel'] < 3) redirect();
|
||||||
|
addTitle($_locale['plugin_manager']);
|
||||||
|
include 'includes/admin/plugins.php';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case $_set['subEntry']:
|
||||||
|
if ($user['userLevel'] < 2) redirect();
|
||||||
|
addTitle($_locale['entry_editor']);
|
||||||
|
include 'includes/admin/entry.php';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case $_set['subPage']:
|
||||||
|
if ($user['userLevel'] < 3) redirect();
|
||||||
|
addTitle($_locale['page_editor']);
|
||||||
|
include 'includes/admin/page.php';
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
include 'includes/admin/dashboard.php';
|
||||||
|
break;
|
||||||
|
}
|
55
includes/admin/page.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (isset($_POST['pageContent']) && isset($_POST['pageSlug']) && $user['userLevel'] > 3)
|
||||||
|
{
|
||||||
|
$page = new page($_POST['pageSlug']);
|
||||||
|
if (isset($_POST['pageAdd']))
|
||||||
|
{
|
||||||
|
if ($page->create($_POST['pageTitle'], $_POST['pageContent']))
|
||||||
|
array_push($info, $_locale['page_added']);
|
||||||
|
else
|
||||||
|
array_push($error, $_locale['page_not_added']);
|
||||||
|
} elseif (isset($_POST['pageUpdate']))
|
||||||
|
{
|
||||||
|
if ($page->update($_POST['pageTitle'], $_POST['pageContent']))
|
||||||
|
array_push($info, $_locale['page_updated']);
|
||||||
|
else
|
||||||
|
array_push($error, $_locale['page_not_updated']);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($seo[2]))
|
||||||
|
$page = new page($seo[2]);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$pagesQuery = $_sql->query("SELECT pageSlug, pageTitle FROM pages");
|
||||||
|
if ($pagesQuery->num_rows)
|
||||||
|
{
|
||||||
|
echo "<h1>{locale:pages}</h1>";
|
||||||
|
echo "<table class='designed pages'><tr><td>{locale:page_title}</td></tr>";
|
||||||
|
while ($data = $pagesQuery->fetch_assoc())
|
||||||
|
echo "<tr><td><a href='/admin/page/$data[pageSlug]'>$data[pageTitle]</a></td></tr>";
|
||||||
|
echo "</table>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<h1>{locale:page_editor}</h1>
|
||||||
|
<form action="<?=get_current_link()?>" method="post" name="entry-edit">
|
||||||
|
|
||||||
|
<?php if (isset($page->data)) : addTitle($page->data['pageTitle']); ?>
|
||||||
|
<input type="text" name="pageTitle" value="<?=$page->data['pageTitle']?>" placeholder="{locale:page_title}" maxlength="250" />
|
||||||
|
<textarea name="pageContent"><?=htmlspecialchars($page->data['pageContent'])?></textarea>
|
||||||
|
<input type="hidden" name="pageSlug" value="<?=$page->data['pageSlug']?>" />
|
||||||
|
<input type="hidden" name="pageUpdate" value="true" />
|
||||||
|
<button type="button" onclick="window.location.href='/admin/page'">{locale:cancel}</button>
|
||||||
|
<?php else: ?>
|
||||||
|
<input type="text" id="pageTitle" name="pageTitle" value="" placeholder="{locale:page_title}" maxlength="250" />
|
||||||
|
<textarea name="pageContent"></textarea>
|
||||||
|
<input type="text" id="pageSlug" name="pageSlug" value="" placeholder="{locale:page_slug}" />
|
||||||
|
<input type="hidden" name="pageAdd" value="true" />
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
|
<button type="submit">{locale:save}</button>
|
||||||
|
|
||||||
|
</form>
|
51
includes/admin/plugins.php
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (isset($_POST['pluginId']) && isnum($_POST['pluginId']))
|
||||||
|
{
|
||||||
|
if ($_sql->query("UPDATE plugins SET pluginStatus = ".(isset($_POST['pluginEnable']) ? 1 : 0)." WHERE pluginId = $_POST[pluginId]"))
|
||||||
|
redirect(get_current_link());
|
||||||
|
else
|
||||||
|
array_push($error, $_locale['plugin_not_updated']);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "<h1>$_locale[plugins]</h1>";
|
||||||
|
|
||||||
|
$pluginsQuery = $_sql->query("SELECT * FROM plugins ORDER BY pluginStatus DESC");
|
||||||
|
$plugins = array();
|
||||||
|
if ($pluginsQuery->num_rows)
|
||||||
|
{
|
||||||
|
echo "<table class='designed plugins'>";
|
||||||
|
echo "<tr><td>{locale:plugin_name}</td><td>{locale:description}</td><td>{locale:scope}</td><td>{locale:status}</td></tr>";
|
||||||
|
while ($data = $pluginsQuery->fetch_assoc())
|
||||||
|
{
|
||||||
|
$pinfo = './plugins/'.$data['pluginLib'].'/info.json';
|
||||||
|
if (file_exists($pinfo))
|
||||||
|
{
|
||||||
|
$pinfo = (array)json_decode(file_get_contents($pinfo));
|
||||||
|
|
||||||
|
if ($data['pluginStatus'])
|
||||||
|
$button = "<button name='pluginDisable' class='orange'>{locale:disable}</button>";
|
||||||
|
else $button = "<button name='pluginEnable'>{locale:enable}</button>";
|
||||||
|
|
||||||
|
echo "<tr><td>$pinfo[name]</td><td>$pinfo[description]<td>$pinfo[paths]</td><td><form action='".get_current_link()."' method='post'><input type='hidden' name='pluginId' value='$data[pluginId]'/>$button</form></td></tr>";
|
||||||
|
}
|
||||||
|
array_push($plugins, $data['pluginLib']);
|
||||||
|
}
|
||||||
|
echo "</table>";
|
||||||
|
} else
|
||||||
|
echo "<p>$_locale[plugins_empty]</p>";
|
||||||
|
|
||||||
|
|
||||||
|
if ($handle = opendir('./plugins')) {
|
||||||
|
|
||||||
|
while (false !== ($entry = readdir($handle)))
|
||||||
|
{
|
||||||
|
if (!in_array($entry, $plugins) && file_exists('./plugins/'.$entry.'/info.json'))
|
||||||
|
if ($_sql->query("INSERT INTO plugins (pluginLib, pluginStatus) VALUES ('$entry', 0)"))
|
||||||
|
array_push($info, $_locale['plugin_added'].$entry);
|
||||||
|
else
|
||||||
|
array_push($error, $_locale['plugin_not_added'].$entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
closedir($handle);
|
||||||
|
}
|
0
includes/admin/tags.php
Normal file
124
includes/blog.class.php
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class blog
|
||||||
|
{
|
||||||
|
|
||||||
|
private $entry;
|
||||||
|
private $query;
|
||||||
|
|
||||||
|
public $perpage = 10;
|
||||||
|
public $entries = 0;
|
||||||
|
|
||||||
|
public function __construct($entry = false, $page = 1)
|
||||||
|
{
|
||||||
|
global $_set, $_sql;
|
||||||
|
|
||||||
|
$this->perpage = $_set['entriesPerPage'];
|
||||||
|
if ($entry)
|
||||||
|
{
|
||||||
|
$this->query = $_sql->query("SELECT entries.*, users.userName AS userName, users.userPublicName AS publicName FROM entries INNER JOIN users ON userId = entryBy WHERE entrySlug = '".sqlprot($entry)."' LIMIT 1");
|
||||||
|
if ($this->query->num_rows)
|
||||||
|
{
|
||||||
|
$this->entries = 1;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
$this->query = $_sql->query("SELECT entries.*, users.userName AS userName, users.userPublicName AS publicName FROM entries INNER JOIN users ON userId = entryBy WHERE entryHidden IS NULL AND entryPublished <= ".time()." ORDER BY entryPinned DESC, entryPublished DESC, entryId DESC LIMIT ".$this->perpage." OFFSET ".(($page-1) * $this->perpage)."");
|
||||||
|
$this->entries = $this->query->num_rows;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function entries()
|
||||||
|
{
|
||||||
|
if ($this->entries)
|
||||||
|
return $this->query->fetch_assoc();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function entry()
|
||||||
|
{
|
||||||
|
if ($this->entries == 1)
|
||||||
|
return $this->query->fetch_assoc();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function update($id, $header, $title, $text, $pub, $hidden = false, $pin = false)
|
||||||
|
{
|
||||||
|
global $_sql;
|
||||||
|
|
||||||
|
$header = sqlprot($header);
|
||||||
|
$title = sqlprot($title);
|
||||||
|
$text = sqlprot($text);
|
||||||
|
$published = strtotime($pub); if (!$published) $published = time();
|
||||||
|
|
||||||
|
if (is_numeric($id) && Check::url($header, true) && Check::title($title) && $_sql->query("UPDATE entries SET entryHeader = '$header', entryTitle = '$title', entryContent = '$text', entryPublished = $published, entryUpdated = ".time().", entryHidden = ".($hidden ? '1' : 'NULL').", entryPIN = ".($pin && is_numeric($pin) ? $pin : 'NULL')." WHERE entryId = $id"))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function add($header, $title, $slug, $text, $pub, $hidden = false, $pin = false)
|
||||||
|
{
|
||||||
|
global $_sql, $user;
|
||||||
|
|
||||||
|
$header = sqlprot($header);
|
||||||
|
$title = sqlprot($title);
|
||||||
|
$text = sqlprot($text);
|
||||||
|
$slug = sqlprot($slug);
|
||||||
|
$published = strtotime($pub); if (!$published) $published = time();
|
||||||
|
if (Check::url($header, true) && Check::title($title) && Check::slug($slug) && $_sql->query("INSERT INTO entries (entryHeader, entryTitle, entrySlug, entryContent, entryBy, entryCreated, entryPublished, entryHidden, entryPIN) VALUES ('$header', '$title', '$slug', '$text', $user[userId], ".time().", $published, ".($hidden ? '1' : 'NULL').", ".($pin && is_numeric($pin) ? $pin : 'NULL').")"))
|
||||||
|
return true;
|
||||||
|
//die($text);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function delete($id)
|
||||||
|
{
|
||||||
|
global $_sql;
|
||||||
|
|
||||||
|
if (is_numeric($id) && $_sql->query("DELETE FROM entries WHERE entryId = $id"))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function pin($id)
|
||||||
|
{
|
||||||
|
global $_sql;
|
||||||
|
|
||||||
|
if (is_numeric($id) && $_sql->query("UPDATE entries SET entryPinned = 1 WHERE entryId = $id"))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function unpin($id)
|
||||||
|
{
|
||||||
|
global $_sql;
|
||||||
|
|
||||||
|
if (is_numeric($id) && $_sql->query("UPDATE entries SET entryPinned = NULL WHERE entryId = $id"))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function tag($cid, $id)
|
||||||
|
{
|
||||||
|
if (!is_numeric($cid) || !is_numeric($id)) return false;
|
||||||
|
|
||||||
|
global $_sql;
|
||||||
|
|
||||||
|
if (!$_sql->query("SELECT * FROM tags WHERE tagId = $cid")->num_rows) return false;
|
||||||
|
if ($_sql->query("SELECT * FROM tagged WHERE taggedTag = $cid AND taggedEntry = $id")->num_rows) return false;
|
||||||
|
if ($_sql->query("INSERT INTO tagged (taggedTag, taggedEntry) VALUES ($cid, $id)")) return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function tagRemove($cid, $id)
|
||||||
|
{
|
||||||
|
if (!is_numeric($cid) || !is_numeric($id)) return false;
|
||||||
|
|
||||||
|
global $_sql;
|
||||||
|
|
||||||
|
if ($_sql->query("DELETE FROM tagged WHERE taggedTag = $cid AND taggedEntry = $id")) return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
65
includes/check.class.php
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
Class Check
|
||||||
|
{
|
||||||
|
|
||||||
|
public static function name($str) {
|
||||||
|
|
||||||
|
if(preg_match('/^[a-zA-ZÖÜÓŐÚÉÁŰÍöüóőúéáűí\.\d_\- ]{3,20}$/i', $str))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function link($str) {
|
||||||
|
|
||||||
|
if(!preg_match('/^[a-z0-9\d_\-]{3,20}$/i', $str))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function email($str) {
|
||||||
|
|
||||||
|
if(preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/',$str) && strlen($str)<51)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function password($str) {
|
||||||
|
|
||||||
|
if(strlen($str)<6 || strlen($str)>20)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function domain($str) {
|
||||||
|
|
||||||
|
if (filter_var(gethostbyname($str), FILTER_VALIDATE_IP))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function title($title) {
|
||||||
|
if (strlen($title) > 0 && strlen($title) < 250)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function slug($str) {
|
||||||
|
|
||||||
|
if(preg_match('/^[a-zA-Z\d_\- ]{1,100}$/i', $str))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function url($url, $lazy = false) {
|
||||||
|
if (($lazy && !$url) || !filter_var($url, FILTER_VALIDATE_URL) === false) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
45
includes/comment.class.php
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class comments
|
||||||
|
{
|
||||||
|
|
||||||
|
private $id;
|
||||||
|
private $comments;
|
||||||
|
private $replies;
|
||||||
|
|
||||||
|
public function __construct($id)
|
||||||
|
{
|
||||||
|
if (!isnum($id)) return false;
|
||||||
|
$this->id = $id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_comments($check = false)
|
||||||
|
{
|
||||||
|
if (!$this->comments)
|
||||||
|
{
|
||||||
|
global $_sql;
|
||||||
|
$query = $_sql->query("SELECT `comments`.*, users.userName AS bySlug, users.userPublicName AS byName, users.userPic FROM `comments` INNER JOIN users ON commentBy = userId WHERE commentEntry = ".$this->id." AND commentReply = 0 ORDER BY commentTime DESC");
|
||||||
|
if ($check)
|
||||||
|
return $query->num_rows;
|
||||||
|
else
|
||||||
|
$this->comments = $query;
|
||||||
|
}
|
||||||
|
return $this->comments->fetch_assoc();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_replies($check = false)
|
||||||
|
{
|
||||||
|
if (!$this->replies)
|
||||||
|
{
|
||||||
|
global $_sql;
|
||||||
|
$query = $_sql->query("SELECT `comments`.*, users.userName AS bySlug, users.userPublicName AS byName, users.userPic FROM `comments` INNER JOIN users ON commentBy = userId WHERE commentReply = ".$this->id." ORDER BY commentTime DESC");
|
||||||
|
if ($check)
|
||||||
|
return $query->num_rows;
|
||||||
|
$this->replies = $query;
|
||||||
|
}
|
||||||
|
return $this->replies->fetch_assoc();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
BIN
includes/css/ui-lightness/images/animated-overlay.gif
Normal file
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 418 B |
After Width: | Height: | Size: 312 B |
BIN
includes/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png
Normal file
After Width: | Height: | Size: 205 B |
After Width: | Height: | Size: 262 B |
After Width: | Height: | Size: 348 B |
BIN
includes/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
Normal file
After Width: | Height: | Size: 207 B |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 278 B |
After Width: | Height: | Size: 328 B |
BIN
includes/css/ui-lightness/images/ui-icons_222222_256x240.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
includes/css/ui-lightness/images/ui-icons_228ef1_256x240.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
includes/css/ui-lightness/images/ui-icons_ef8c08_256x240.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
includes/css/ui-lightness/images/ui-icons_ffd27a_256x240.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
includes/css/ui-lightness/images/ui-icons_ffffff_256x240.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
7
includes/css/ui-lightness/jquery-ui.custom.min.css
vendored
Normal file
173
includes/filtr.class.php
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/* ---------
|
||||||
|
Filtr. Class 4 your Entertainment
|
||||||
|
filtr.sandros.hu
|
||||||
|
Sandros Industries
|
||||||
|
2015. June 28.
|
||||||
|
|
||||||
|
Version: 2.2.1.00b <== If the last 2 numbers are equal, this version is untested!
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
- Basic
|
||||||
|
|
||||||
|
$filtr = new filtrLogin( [ CUSTOM API URL / NULL ] );
|
||||||
|
|
||||||
|
$filtr->setAppid( [ APPLICATION IDENTIFIER ] );
|
||||||
|
$filtr->setApptoken( [ APPLICATION TOKEN HASH ] );
|
||||||
|
|
||||||
|
$filtr->setToken( [ USER'S TOKEN GENERATED BY FILTR. APL.REDIRECT ] );
|
||||||
|
|
||||||
|
- Advanced
|
||||||
|
$filtr->DataStorage( [ WAT TO DO (read, write, erase) ], [ KEY (only for writing) ], [ VALUE (only for writing) ]);
|
||||||
|
$filtr->cache = '/tmp/[ YOUR PROJECTS CODENAME ]/filtrd/';
|
||||||
|
|
||||||
|
Comments:
|
||||||
|
The Filtr. API has a geniune and valid SSL certificate, but it slows down the process.
|
||||||
|
Use it only if your connection is not trusted!
|
||||||
|
We're logging EVERY requests, so you will be able to monitor every access and you will be able to limit the APP's access by IP.
|
||||||
|
|
||||||
|
Public UNAME/PASSWD authentication NEVER GONNA HAPPEN!
|
||||||
|
|
||||||
|
The specified cache must end with '/'. Automatic detection just slows down the process and generates unnecessary load.
|
||||||
|
|
||||||
|
That's it! Have fun!
|
||||||
|
Don't forget to go out and become black. This is important! And cool! You'll be less awesome, but eh.
|
||||||
|
|
||||||
|
Just do it! Tomorrow.
|
||||||
|
--------- */
|
||||||
|
|
||||||
|
|
||||||
|
class filtrLogin
|
||||||
|
{
|
||||||
|
/* User authentication */
|
||||||
|
private $token;
|
||||||
|
|
||||||
|
/* Filtr. authentication */
|
||||||
|
private $appid;
|
||||||
|
private $apptoken;
|
||||||
|
private $apiurl = 'http://filtr.sandros.hu/api.php';
|
||||||
|
|
||||||
|
/* This holds the response from Filtr. */
|
||||||
|
private $apiResponse;
|
||||||
|
|
||||||
|
// Cache
|
||||||
|
public $cache;
|
||||||
|
public $cachetimeout = 60;
|
||||||
|
|
||||||
|
/* Hey! :) */
|
||||||
|
public function __construct($apiurl = false, $cache = false) {
|
||||||
|
if ($apiurl)
|
||||||
|
$this->apiurl = $apiurl; // Override the class-default API url with the given one
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Data collectors */
|
||||||
|
public function setToken($token = 0) { $this->token = $token; }
|
||||||
|
public function setAppid($user = 0) { $this->appid = $user; }
|
||||||
|
public function setApptoken($key = 0) { $this->apptoken = $key; }
|
||||||
|
|
||||||
|
/* Data storage */
|
||||||
|
private $datastorage = array();
|
||||||
|
public function DataStorage($todo, $key = false, $value = false) {
|
||||||
|
switch($todo)
|
||||||
|
{
|
||||||
|
case 'read':
|
||||||
|
$this->datastorage = array('data_storage'=>'read');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'write':
|
||||||
|
$this->datastorage = array('data_storage'=>'write', 'data_storage_key'=>$key, 'data_storage_value'=>$value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'erase':
|
||||||
|
$this->datastorage = array('data_storage'=>'erase');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ($this->status())
|
||||||
|
{
|
||||||
|
$this->Login();
|
||||||
|
return (isset($this->apiResponse->data_storage) ? true : false);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Nasty things */
|
||||||
|
public function Login($timeout = 6) {
|
||||||
|
|
||||||
|
// Caching
|
||||||
|
if ($this->cache && file_exists($this->cache.$this->token) && filemtime($this->cache.$this->token) > time()-$this->cachetimeout)
|
||||||
|
{
|
||||||
|
$this->apiResponse = json_decode(file_get_contents($this->cache.$this->token));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Collect the auth infos
|
||||||
|
// ! This looks pretty bad. In the next release, there will be a JSON encoder.
|
||||||
|
$array = array_merge(array(
|
||||||
|
'appid' => $this->appid,
|
||||||
|
'apptoken' => $this->apptoken,
|
||||||
|
'token' => $this->token,
|
||||||
|
), $this->datastorage);
|
||||||
|
|
||||||
|
// Convert to GET like string
|
||||||
|
$fields = '';
|
||||||
|
foreach($array as $key=>$value)
|
||||||
|
$fields .= $key.'='.$value.'&';
|
||||||
|
$fields = rtrim($fields, '&');
|
||||||
|
|
||||||
|
|
||||||
|
// Connect options and set data
|
||||||
|
$ch = curl_init();
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $this->apiurl);
|
||||||
|
curl_setopt($ch, CURLOPT_POST, count($array));
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||||
|
|
||||||
|
// Free up some memory
|
||||||
|
unset($fields);
|
||||||
|
unset($array);
|
||||||
|
$this->datastorage = false;
|
||||||
|
|
||||||
|
// Do what we need to
|
||||||
|
$rawResponse = curl_exec($ch);
|
||||||
|
$this->apiResponse = json_decode($rawResponse);
|
||||||
|
|
||||||
|
// Basic cache
|
||||||
|
if ($this->cache)
|
||||||
|
{
|
||||||
|
$cache = fopen($this->cache.$this->token, 'w');
|
||||||
|
fwrite($cache, $rawResponse);
|
||||||
|
fclose($cache);
|
||||||
|
unset($cache);
|
||||||
|
}
|
||||||
|
unset($rawResponse);
|
||||||
|
|
||||||
|
// Close the connection to the login server
|
||||||
|
curl_close($ch);
|
||||||
|
unset($ch);
|
||||||
|
|
||||||
|
// '1' means the response has came from the remote server
|
||||||
|
// Not relevant for this script, but you can build an advanced cache control for better performance.
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Logged in?
|
||||||
|
public function status() {
|
||||||
|
if (isset($this->apiResponse->status) && $this->apiResponse->status == 'ok')
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return user's data
|
||||||
|
// Array mode is the default, because this could cause serious problems if someone auto-updating this script.
|
||||||
|
public function getData($array = true) {
|
||||||
|
if ($array)
|
||||||
|
return (array)$this->apiResponse;
|
||||||
|
return $this->apiResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
0
includes/index.html
Normal file
10
includes/js/functions.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
function set_comment_reply(cid)
|
||||||
|
{
|
||||||
|
$("form[name='new-comment'] input[name='entryReply']").val(cid);
|
||||||
|
$("#new-comment-reply span").html('Reply');
|
||||||
|
}
|
||||||
|
|
||||||
|
function spoilerToggle(selem)
|
||||||
|
{
|
||||||
|
selem.parent().children(".spoiler_c").stop().slideToggle();
|
||||||
|
}
|
7
includes/js/jquery-ui.custom.min.js
vendored
Normal file
9789
includes/js/jquery.js
vendored
Normal file
128
includes/locale/hu_HU.lng
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
{
|
||||||
|
"home": "Kezdőlap",
|
||||||
|
"navigation": "Navigáció",
|
||||||
|
"login": "Belépés",
|
||||||
|
"logout": "Kilépés",
|
||||||
|
|
||||||
|
"new_entry": "Új bejegyzés készítése",
|
||||||
|
"next_page": "Következő oldal",
|
||||||
|
"prev_page": "Előző oldal",
|
||||||
|
|
||||||
|
"profile_edit": "Profil szerkesztése",
|
||||||
|
"s_profile": " profilja",
|
||||||
|
"introduction": "Bemutatkozás",
|
||||||
|
"web": "Honalp",
|
||||||
|
"email": "Email",
|
||||||
|
"name": "Név",
|
||||||
|
"registration": "Regisztráció",
|
||||||
|
|
||||||
|
"username": "Felhasználónév",
|
||||||
|
"password": "Jelszó",
|
||||||
|
"password_again": "Jelszó újra",
|
||||||
|
|
||||||
|
"login_failed": "A bejelentkezés sikertelen.",
|
||||||
|
|
||||||
|
"upload_failed": "A feltöltés sikertelen.",
|
||||||
|
"upload_successful": "Sikeresen feltöltve.",
|
||||||
|
|
||||||
|
"contact": "Elérhetőség",
|
||||||
|
"public_name": "Látható név",
|
||||||
|
|
||||||
|
"edit_wrong_public_name": "Nem megfelelő a látható név.",
|
||||||
|
"edit_wrong_real_name": "Nem megfelelő a valódi név.",
|
||||||
|
"edit_wrong_email": "Nem megfelelő az email cím.",
|
||||||
|
"edit_wrong_web": "Nem megfelelő a honlap.",
|
||||||
|
"edit_wrong_introduction": "Nem megfelelő a bemutatkozás.",
|
||||||
|
|
||||||
|
"categories": "Kategóriák",
|
||||||
|
|
||||||
|
"entries": "Bejegyzések",
|
||||||
|
|
||||||
|
"entry_not_found_title": "Nahát-nahát...",
|
||||||
|
"entry_not_found": "Ez a bejegyzés elköltözhetett időközben. A helyén nincs, az biztos.",
|
||||||
|
"no_more_title": "Ez a hely aztán kong az ürességtől",
|
||||||
|
"no_more": "Valamikor talán lesz itt valami, de egyelőre még nincs. Hmm...",
|
||||||
|
|
||||||
|
"entry_read_more": "Olvasd tovább >>",
|
||||||
|
"published_on": "Publikálva",
|
||||||
|
"entry_by": "Szerző",
|
||||||
|
|
||||||
|
"entry_editor": "Bejegyzésszerkesztő",
|
||||||
|
"entry_header": "Bejegyzéshez tartozó fejléc képének elérési útvonala",
|
||||||
|
"entry_title": "Bejegyzés címe",
|
||||||
|
"entry_slug": "A bejegyzés linkje (example.org/post/ez-itt)",
|
||||||
|
"created_on": "Létrehozva",
|
||||||
|
"entry_pub_date": "Bejegyzés megjelenésének dátuma (csak késleltetés esetén)",
|
||||||
|
"timed_entries": "Időzített bejegyzések",
|
||||||
|
"timed_pub_date": "Megjelenés dátuma",
|
||||||
|
"hidden_entries": "Rejtett bejegyzések",
|
||||||
|
"entry_hide": "Bejegyzés elrejtése",
|
||||||
|
"entry_pin": "Bejegyzés megtekintéségez szükséges PIN",
|
||||||
|
|
||||||
|
"pin_protected_content": "Ez a tartom kóddal védett. A megtekintéséhez add meg a megfelelő kódot vagy keress más olvasnivalót.",
|
||||||
|
"unlock": "Feloldás",
|
||||||
|
"hidden_content": "A jelenleg megtekintett tartalom rejtett. Csak hivatkozással lehet megtalálni.",
|
||||||
|
"show_hidden_content": "Szpooooooojler",
|
||||||
|
|
||||||
|
"entry_added": "A bejegyzés mentése sikeresen megtörtént.",
|
||||||
|
"entry_not_added": "A bejegyzés nem lett mentve.",
|
||||||
|
"entry_updated": "A bejegyzés frissítve lett.",
|
||||||
|
"entry_not_updated": "A bejegyzés nem lett frissítve.",
|
||||||
|
"entry_not_deleted": "A bejegyzés nem lett törölve.",
|
||||||
|
"entry_not_pinned": "A bejegyzés nem lett kitűzve.",
|
||||||
|
"entry_not_unpinned": "A bejegyzés kitűzése nem lett törölve.",
|
||||||
|
"entry_tag_added": "A kategória sikeresen hozzárendelve.",
|
||||||
|
"entry_tag_not_added": "A kategóriát nem sikerült hozzárendelni.",
|
||||||
|
|
||||||
|
"tags": "Kategóriák",
|
||||||
|
"tag_name": "Kategória neve",
|
||||||
|
"add": "Hozzáadás",
|
||||||
|
"remove": "Eltávolítás",
|
||||||
|
|
||||||
|
"entry_tag_removed": "Eltávolítva a kategóriából.",
|
||||||
|
"entry_tag_not_removed": "Nem sikerült eltávolítani a kategóriából.",
|
||||||
|
|
||||||
|
"pages": "Oldalak",
|
||||||
|
"page_editor": "Oldal szerkesztése",
|
||||||
|
"page_title": "Az oldal címe",
|
||||||
|
"page_slug": "Az oldal linkje (example.org/page/ez-itt)",
|
||||||
|
"page_added": "Az oldal mentése sikeresen megtörtént.",
|
||||||
|
"page_not_added": "Az oldal nem lett mentve.",
|
||||||
|
"page_updated": "Az oldal frissítve lett.",
|
||||||
|
"page_not_updated": "Az oldal nem lett frissítve.",
|
||||||
|
"page_not_found": "A keresett oldal nem található.",
|
||||||
|
"page_not_found_text": "Szerintem a cica megint eldugta valahová. Ki tudja, hátha később előkerül.",
|
||||||
|
|
||||||
|
"pin": "Kitűzés",
|
||||||
|
"unpin": "Kitűzés megszüntetése",
|
||||||
|
|
||||||
|
"browse": "Tallózás",
|
||||||
|
"save": "Mentés",
|
||||||
|
"edit": "Szerkesztés",
|
||||||
|
"cancel": "Mégsem",
|
||||||
|
"delete": "Törlés",
|
||||||
|
"delete_confirm": "Biztosan törölni szeretnéd ezt a bejegyzést?",
|
||||||
|
"description": "Leírás",
|
||||||
|
|
||||||
|
|
||||||
|
"admin": "Adminisztráció",
|
||||||
|
"dashboard": "Műszerfal",
|
||||||
|
"plugin_manager": "Bővítmények",
|
||||||
|
|
||||||
|
"disable": "Letiltás",
|
||||||
|
"enable": "Engedélyezés",
|
||||||
|
"status": "Állapot",
|
||||||
|
|
||||||
|
"plugins": "Bővítmények",
|
||||||
|
"plugin_name": "Név",
|
||||||
|
"scope": "Hatáskör",
|
||||||
|
"plugins_empty": "Nincsenek elérhető bővítmények.",
|
||||||
|
"plugin_added": "Bővítmény sikeresen hozzáadva.",
|
||||||
|
"plugin_not_added": "A bővítmény nem lett hozzáadva.",
|
||||||
|
"plugin_not_updated": "A beállítást nem lehet elvégezni.",
|
||||||
|
|
||||||
|
"comments": "Hozzászólások",
|
||||||
|
"post_reply": "Válasz",
|
||||||
|
"share_impressions": "Oszd meg a véleményed...",
|
||||||
|
"reply_to": "Válasz neki: "
|
||||||
|
}
|
29
includes/main/entries.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
addTitle($_locale['entries']);
|
||||||
|
|
||||||
|
if (isset($seo[1]) && isnum($seo[1]))
|
||||||
|
$blog = new blog(null, $seo[1]);
|
||||||
|
else
|
||||||
|
$blog = new blog();
|
||||||
|
|
||||||
|
if (theme_component('entries'))
|
||||||
|
include theme_component('entries');
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (LOGGEDIN && $user['userLevel'] > 2) echo "<a href='/admin/entry'><p class='phantom'>{locale:new_entry}</p></a>";
|
||||||
|
if ($blog->entries)
|
||||||
|
{
|
||||||
|
while ($data = $blog->entries())
|
||||||
|
echo "<article>
|
||||||
|
<header>
|
||||||
|
<h2><a href='".get_entry_link($data['entrySlug'])."'>".htmlspecialchars($data['entryTitle'])."</a></h2>
|
||||||
|
<p class='meta'><time class='date' title='{locale:published_on}'>".show_date($data['entryPublished'])."</time><a href='".get_profile_link($data['userName'])."' class='by' title='{locale:entry_by}'>$data[publicName]</a>".get_entry_admin($data)."</p>
|
||||||
|
</header>
|
||||||
|
<div class='content'>".entry_show_init($data['entryContent'], $data['entrySlug'])."</div>
|
||||||
|
</article>\n";
|
||||||
|
echo "<p class='paginator'>".(isset($seo[1]) && isnum($seo[1]) ? "<a href='/p/".($seo[1]+1)."'>{locale:next_page}</a><a href='/p/".($seo[1]-1)."'>{locale:prev_page}</a>" : "<a href='/p/2'>{locale:next_page}</a>")."</p>";
|
||||||
|
} else
|
||||||
|
echo "<h1>{locale:entry_not_found_title}</h1>"
|
||||||
|
."<p>{locale:entry_not_found}</p>\n";
|
||||||
|
}
|
37
includes/main/entry.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (!isset($seo[1])) redirect();
|
||||||
|
|
||||||
|
$blog = new blog($seo[1]);
|
||||||
|
|
||||||
|
if (theme_component('entry'))
|
||||||
|
include theme_component('entry');
|
||||||
|
else
|
||||||
|
if ($blog->entries)
|
||||||
|
while ($data = $blog->entry())
|
||||||
|
{
|
||||||
|
addTitle($data['entryTitle']);
|
||||||
|
|
||||||
|
if ($data['entryHidden']) echo "<p>{locale:hidden_content}</p>";
|
||||||
|
|
||||||
|
if ($data['entryPIN'] && get_pin() != $data['entryPIN'])
|
||||||
|
echo "<p>{locale:pin_protected_content}</p>
|
||||||
|
<form action='".get_entry_link($data['entrySlug'])."' method='post' name='entry-pin-input'>
|
||||||
|
<input type='text' name='read_entry_pin' placeholder='{locale:entry_pin}' />
|
||||||
|
<button type='submit'>{locale:unlock}</button>
|
||||||
|
</form>";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addDescription(entry_show_init($data['entryContent'], $data['entrySlug']));
|
||||||
|
addImage((preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $data['entryContent'], $images) ? $images[1] : 0));
|
||||||
|
headerImage($data['entryHeader']);
|
||||||
|
echo "<article class='full'>
|
||||||
|
<h2>".htmlspecialchars($data['entryTitle'])."</h2>
|
||||||
|
<div class='content'>".entry_show_all($data['entryContent'])."</div>
|
||||||
|
<p class='meta'><time class='date' title='{locale:published_on}'>".show_date($data['entryPublished'])."</time><a href='".get_profile_link($data['userName'])."' class='by' title='{locale:entry_by}'>$data[publicName]</a>".get_entry_admin($data)."</p>
|
||||||
|
</article>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
echo "<h1>{locale:entry_not_found_title}</h1>"
|
||||||
|
."<p>{locale:entry_not_found}</p>\n";
|
38
includes/main/login.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (LOGGEDIN) redirect(get_profile_link());
|
||||||
|
|
||||||
|
addTitle($_locale['login']);
|
||||||
|
|
||||||
|
if (theme_component('login')) :
|
||||||
|
include theme_component('login');
|
||||||
|
else :
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div style="float: left; width: 48%;">
|
||||||
|
<h1>{locale:login}</h1>
|
||||||
|
<form action="<?=get_current_link()?>" method="post" name="login-form">
|
||||||
|
|
||||||
|
<input type="text" name="login_name" value="" />
|
||||||
|
<input type="password" name="login_pass" value="" />
|
||||||
|
|
||||||
|
<button type="submit">{locale:login}</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div style="float: right; width: 48%;">
|
||||||
|
<h1>{locale:registration}</h1>
|
||||||
|
<form action="<?=get_current_link()?>" method="post" name="registration-form">
|
||||||
|
|
||||||
|
<input type="text" name="reg_name" value="" placeholder="{locale:username}" autocomplete="off" />
|
||||||
|
<input type="password" name="reg_pass" value="" placeholder="{locale:password}" autocomplete="off" />
|
||||||
|
<input type="password" name="reg_pass2" value="" placeholder="{locale:password_again}" autocomplete="off" />
|
||||||
|
<input type="text" name="reg_email" value="" placeholder="{locale:email}" autocomplete="off" />
|
||||||
|
|
||||||
|
<button type="submit">{locale:registration}</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
<?php endif ?>
|
16
includes/main/page.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (!isset($seo[1])) redirect();
|
||||||
|
|
||||||
|
$page = new page($seo[1]);
|
||||||
|
|
||||||
|
if (theme_component('page'))
|
||||||
|
include theme_component('page');
|
||||||
|
else
|
||||||
|
if ($page->readable())
|
||||||
|
{
|
||||||
|
addTitle($page->data['pageTitle']);
|
||||||
|
|
||||||
|
echo "<h1>".htmlspecialchars($page->data['pageTitle'])."</h1>";
|
||||||
|
echo entry_show_all($page->data['pageContent']);
|
||||||
|
}
|
126
includes/main/profile.php
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$profile = new user($seo[1], null, null, true);
|
||||||
|
if ($profile) :
|
||||||
|
$userData = $profile->get_data();
|
||||||
|
$me = (LOGGEDIN && $user['userId'] == $userData['userId'] ? true : false);
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ($me)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (isset($_POST["userEdit"]))
|
||||||
|
{
|
||||||
|
$name = $_POST['userPublicName']; if (!Check::name($name)) array_push($error, $_locale['edit_wrong_public_name']);
|
||||||
|
$rname = $_POST['userRealName']; if (!Check::name($rname)) array_push($error, $_locale['edit_wrong_real_name']);
|
||||||
|
$email = $_POST['userEmail']; if (strlen($email) && !Check::email($email)) array_push($error, $_locale['edit_wrong_email']);
|
||||||
|
$web = $_POST['userWeb']; if (!Check::domain($web)) array_push($error, $_locale['edit_wrong_web']);
|
||||||
|
$bio = htmlspecialchars($_POST['userIntroduction']); if (strlen($bio) > 200) array_push($error, $_locale['edit_wrong_introduction']);
|
||||||
|
|
||||||
|
$bio = sqlprot($bio);
|
||||||
|
|
||||||
|
if (empty($error))
|
||||||
|
if ($_sql->query("UPDATE users SET userPublicName = '$name',userRealName = '$rname',userEmail = '$email',userWeb = '$web',userIntroduction = '$bio' WHERE userId = $user[userId]"))
|
||||||
|
redirect(get_profile_link());
|
||||||
|
else
|
||||||
|
array_push($error, $_locale['profile_not_updated']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_FILES["userPic"]))
|
||||||
|
{
|
||||||
|
$file = 'data/profile_pics/'.$user['userId'].'.jpg';
|
||||||
|
if (file_exists($file)) unlink($file);
|
||||||
|
if ($_FILES["userPic"]["error"] < 1 && in_array($_FILES["userPic"]["type"], explode(',', $_set['allowedPicTypes'])))
|
||||||
|
{
|
||||||
|
clear_cache();
|
||||||
|
|
||||||
|
$thumb = new Imagick($_FILES["userPic"]["tmp_name"]);
|
||||||
|
//$thumb->resizeImage(500, 500, Imagick::FILTER_POINT, 1, true);
|
||||||
|
$thumb->cropThumbnailImage(500, 500);
|
||||||
|
$thumb->setImageFormat('jpg');
|
||||||
|
$thumb->writeImage($file);
|
||||||
|
$thumb->destroy();
|
||||||
|
|
||||||
|
$profile->setPic(true);
|
||||||
|
|
||||||
|
redirect(get_current_link());
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
$profile->setPic(false);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
//$profile->setPic(false);
|
||||||
|
//redirect(get_current_link());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($seo[2]) && $seo[2] == 'edit')
|
||||||
|
{
|
||||||
|
addTitle($_locale['profile_edit']);
|
||||||
|
if (theme_component('profile_edit'))
|
||||||
|
include theme_component('profile_edit');
|
||||||
|
else
|
||||||
|
include 'includes/main/profile_edit.php';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addTitle($userData['userPublicName'].$_locale['s_profile']);
|
||||||
|
|
||||||
|
if (theme_component('profile')) :
|
||||||
|
include theme_component('profile');
|
||||||
|
else :
|
||||||
|
if ($profile) :
|
||||||
|
?>
|
||||||
|
<div class="profile pic">
|
||||||
|
<div id="profile_pic" style="background-image: url('<?=get_profile_picture($userData)?>')">
|
||||||
|
<?php if ($me) : ?>
|
||||||
|
<form action="<?=get_current_link()?>" method="post" name="userpic-upload" enctype="multipart/form-data">
|
||||||
|
<input type="file" name="userPic" id="userPicInput" style="display: none" />
|
||||||
|
<button type="button" onclick="$('#userPicInput').focus().click()">{locale:browse}</button><button type="submit" id="userPicSaveBtn" class="orange">{locale:delete}</button>
|
||||||
|
</form>
|
||||||
|
<script>
|
||||||
|
$("#userPicInput").change(function() {
|
||||||
|
$("#userPicSaveBtn").html('{locale:save}').removeClass('orange');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?php endif ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="profile details">
|
||||||
|
<h1><?=$userData['userPublicName'].$_locale['s_profile']?></h1>
|
||||||
|
<h3><?=$userData['userName'].($me ? ' <a href="'.get_current_link().'/edit" class="edit">{locale:profile_edit}</a>' : '')?></h3>
|
||||||
|
|
||||||
|
<?php if (LOGGEDIN) : ?>
|
||||||
|
<div class='box contact'>
|
||||||
|
<p><strong>{locale:name}:</strong> <?=$userData['userRealName']?></p>
|
||||||
|
<p><strong>{locale:email}:</strong> <?=$userData['userEmail']?></p>
|
||||||
|
<p><strong>{locale:web}:</strong> <?=$userData['userWeb']?></p>
|
||||||
|
</div>
|
||||||
|
<div class='spacer'></div>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$recent = $_sql->query("SELECT entrySlug, entryTitle FROM entries WHERE entryBy = $userData[userId] AND entryPublished <= ".time()." ORDER BY entryPublished DESC LIMIT 5");
|
||||||
|
if ($recent->num_rows) : ?>
|
||||||
|
<div class='box recent'>
|
||||||
|
<?php
|
||||||
|
while ($data = $recent->fetch_assoc())
|
||||||
|
echo "<p><a href='".get_entry_link($data['entrySlug'])."'>".trimlink($data['entryTitle'], 42)."</a></p>\n";
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<?php endif; unset($recent); ?>
|
||||||
|
|
||||||
|
<?php if ($userData['userIntroduction']) : ?>
|
||||||
|
<div class='box introduction'>
|
||||||
|
<p><?=$userData['userIntroduction']?></p>
|
||||||
|
</div>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
|
<div class="clear"></div>
|
||||||
|
</div>
|
||||||
|
<div class="clear"></div>
|
||||||
|
<?php else : ?>
|
||||||
|
<h1>{locale:profile}</h1>
|
||||||
|
<p>{locale:profile_not_found}</p>
|
||||||
|
<?php endif; endif; } ?>
|
17
includes/main/profile_edit.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<h1>{locale:profile_edit}: <?=$userData['userPublicName']?></h1>
|
||||||
|
|
||||||
|
<form action="<?=get_current_link()?>" method="post" name="edit-profile">
|
||||||
|
|
||||||
|
<h3>{locale:contact}</h3>
|
||||||
|
<input type="text" name="userPublicName" value="<?=$userData['userPublicName']?>" placeholder="{locale:public_name}" maxlength="50" />
|
||||||
|
<input type="text" name="userRealName" value="<?=$userData['userRealName']?>" placeholder="{locale:name}" maxlength="50" />
|
||||||
|
<input type="text" name="userEmail" value="<?=$userData['userEmail']?>" placeholder="{locale:email}" maxlength="50" />
|
||||||
|
<input type="text" name="userWeb" value="<?=$userData['userWeb']?>" placeholder="{locale:web}" maxlength="50" />
|
||||||
|
|
||||||
|
|
||||||
|
<h3>{locale:introduction}</h3>
|
||||||
|
<textarea name="userIntroduction" maxlength="320"><?=htmlentities($userData['userIntroduction'])?></textarea>
|
||||||
|
|
||||||
|
<button type="submit" name="userEdit">{locale:save}</button>
|
||||||
|
|
||||||
|
</form>
|
29
includes/main/tag.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (!isset($seo[1]) || !is_numeric($seo[1])) redirect();
|
||||||
|
|
||||||
|
$tagged = $_sql->query("SELECT tagName FROM tags WHERE tagId = $seo[1]");
|
||||||
|
$entries = $_sql->query("SELECT entrySlug, entryTitle, entryPublished, entryBy FROM entries INNER JOIN tagged ON taggedEntry = entryId WHERE taggedTag = $seo[1] AND entryHidden IS NULL ORDER BY entryPublished DESC");
|
||||||
|
|
||||||
|
if (theme_component('tag'))
|
||||||
|
include theme_component('tag');
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($tagged->num_rows)
|
||||||
|
{
|
||||||
|
$tag = $tagged->fetch_assoc();
|
||||||
|
addTitle($tag['tagName']);
|
||||||
|
echo "<h1>$tag[tagName]</h1>";
|
||||||
|
if ($entries->num_rows)
|
||||||
|
{
|
||||||
|
echo "<ul>";
|
||||||
|
while ($data = $entries->fetch_assoc())
|
||||||
|
echo "<li><a href='".get_entry_link($data['entrySlug'])."'>$data[entryTitle]</a></li>";
|
||||||
|
echo "</ul>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unset($tag);
|
||||||
|
unset($tagged);
|
||||||
|
unset($entries);
|
92
includes/page.class.php
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class page
|
||||||
|
{
|
||||||
|
|
||||||
|
private $query;
|
||||||
|
public $exists;
|
||||||
|
public $data;
|
||||||
|
|
||||||
|
public $slug;
|
||||||
|
|
||||||
|
public function __construct($slug = false)
|
||||||
|
{
|
||||||
|
|
||||||
|
global $_sql;
|
||||||
|
|
||||||
|
if ($slug)
|
||||||
|
{
|
||||||
|
$slug = sqlprot($slug);
|
||||||
|
$this->slug = $slug;
|
||||||
|
$this->query = $_sql->query("SELECT * FROM pages WHERE pageSlug = '$slug'");
|
||||||
|
$this->exists = ($this->query->num_rows ? true : false);
|
||||||
|
|
||||||
|
if ($this->exists)
|
||||||
|
$this->data = $this->query->fetch_assoc();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
$this->query = $_sql->query("SELECT * FROM pages".($trash ? ' WHERE pageDeleted = 1' : ''));
|
||||||
|
$this->exists = ($this->query->num_rows ? true : false);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function status()
|
||||||
|
{
|
||||||
|
if ($this->exists)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function readable()
|
||||||
|
{
|
||||||
|
if ($this->exists && !$this->data['pageDeleted'])
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_list()
|
||||||
|
{
|
||||||
|
$pages = array();
|
||||||
|
while ($data = $this->query->fetch_assoc())
|
||||||
|
array_push($pages, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update($title, $content)
|
||||||
|
{
|
||||||
|
global $_sql;
|
||||||
|
|
||||||
|
$title = sqlprot($title);
|
||||||
|
$content = sqlprot($content);
|
||||||
|
|
||||||
|
if (Check::title($title) && $this->data)
|
||||||
|
if ($_sql->query("UPDATE pages SET pageTitle = '$title', pageContent = '$content' WHERE pageSlug = '".$this->data['pageSlug']."'"))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create($title, $content)
|
||||||
|
{
|
||||||
|
global $_sql;
|
||||||
|
|
||||||
|
$slug = sqlprot($this->slug);
|
||||||
|
$title = sqlprot($title);
|
||||||
|
$content = sqlprot($content);
|
||||||
|
|
||||||
|
if (Check::title($title) && Check::slug($slug) && !$this->data)
|
||||||
|
if ($_sql->query("INSERT INTO pages (pageSlug, pageTitle, pageContent) VALUES ('$slug', '$title', '$content')"))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
global $_sql;
|
||||||
|
|
||||||
|
if ($this->data)
|
||||||
|
if ($_sql->query("UPDATE pages SET pageDeleted = 1 WHERE pageSlug = '".$this->data['pageSlug']."'"))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
28
includes/rss.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
header("Content-Type: application/xml");
|
||||||
|
echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
|
||||||
|
|
||||||
|
?>
|
||||||
|
<rss version="2.0">
|
||||||
|
<channel>
|
||||||
|
<title><?=$_set['title']?></title>
|
||||||
|
<link><?=$_set['url']?></link>
|
||||||
|
<description><?=$_set['description']?></description>
|
||||||
|
<language>hu-hu</language>
|
||||||
|
<?php
|
||||||
|
$blog = new blog();
|
||||||
|
while ($data = $blog->entries())
|
||||||
|
{
|
||||||
|
$image = preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $data['entryContent'], $images);
|
||||||
|
echo " <item>\n"
|
||||||
|
." <title>".htmlspecialchars($data['entryTitle'])."</title>\n"
|
||||||
|
." <pubDate>".show_date($data['entryPublished'])."</pubDate>\n"
|
||||||
|
." <link>".$_set['url'].get_entry_link($data['entrySlug'])."</link>\n"
|
||||||
|
." <description>".strip_tags(nl2br(explode('[[MORE]]', $data['entryContent'])[0]))."</description>\n"
|
||||||
|
.($image ? " <media:thumbnail url='".$_set['url'].$images[1]."' />\n" : null)
|
||||||
|
." </item>\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</channel>
|
||||||
|
</rss>
|
9
includes/sidebar/account.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
echo "<ul>";
|
||||||
|
echo "<li><a href='".get_profile_link()."'>$user[userName]$_locale[s_profile]</a></li>";
|
||||||
|
|
||||||
|
if ($user['userLevel'] > 1) echo "<li><a href='".get_site_link()."/admin'>$_locale[admin]</a></li>";
|
||||||
|
if ($user['userLevel'] > 2) echo "<li><a href='".get_site_link()."/admin/entry'>$_locale[new_entry]</a></li>";
|
||||||
|
|
||||||
|
echo "<li><a href='?logout'>$_locale[logout]</a></li>";
|
||||||
|
echo "</ul>";
|
29
includes/sidebar/sidebar.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (LOGGEDIN) :
|
||||||
|
echo "<li>";
|
||||||
|
echo "<h2>$user[userName]</h2>";
|
||||||
|
echo "<a href='".get_profile_link()."'><img src='".get_profile_picture()."' alt='' style='width: 120px' /></a>";
|
||||||
|
include 'includes/sidebar/account.php';
|
||||||
|
echo "</li>";
|
||||||
|
else :
|
||||||
|
?>
|
||||||
|
<li>
|
||||||
|
<h2><?=$_locale['login']?></h2>
|
||||||
|
<form action="<?=get_current_link()?>" method="post" name="login-form">
|
||||||
|
|
||||||
|
<input type="text" name="login_name" value="" placeholder="<?=$_locale['username']?>" />
|
||||||
|
<input type="password" name="login_pass" value="" placeholder="<?=$_locale['password']?>" />
|
||||||
|
|
||||||
|
<button type="submit"><?=$_locale['login']?></button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
<?php endif;
|
||||||
|
|
||||||
|
echo "<li><h2>$_locale[tags]</h2><ul class='tags'>";
|
||||||
|
get_tags();
|
||||||
|
echo "</ul></li>";
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
68
includes/user.class.php
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class user
|
||||||
|
{
|
||||||
|
|
||||||
|
private $id = 0;
|
||||||
|
private $name;
|
||||||
|
public $data;
|
||||||
|
|
||||||
|
private $udata = array();
|
||||||
|
|
||||||
|
private $counter = 0;
|
||||||
|
|
||||||
|
public function __construct($name = false, $data = false)
|
||||||
|
{
|
||||||
|
if ($this->counter > 2) return false;
|
||||||
|
$this->counter++;
|
||||||
|
|
||||||
|
global $_sql;
|
||||||
|
|
||||||
|
$query = $_sql->query("SELECT * FROM users WHERE userName = '$name'");
|
||||||
|
if ($query->num_rows)
|
||||||
|
{
|
||||||
|
$this->data = $query->fetch_assoc();
|
||||||
|
$this->id = $this->data['userId'];
|
||||||
|
return true;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
if ($data && $_sql->query("INSERT INTO users (userFiltrId, userName, userPublicName, userEmail, userRegistered, userRealName) VALUES ('$data[id]', '".$_sql->real_escape_string($name)."', '".$_sql->real_escape_string($data['name'])."', '".$_sql->real_escape_string($data['email'])."', '".time()."', '".$_sql->real_escape_string($data['name'])."')"))
|
||||||
|
return $this->__construct($name, $data);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function get_data()
|
||||||
|
{
|
||||||
|
if ($this->data)
|
||||||
|
return $this->data;
|
||||||
|
|
||||||
|
global $_sql;
|
||||||
|
$query = $_sql->query("SELECT * FROM users WHERE ".($this->name ? "userName = '".$this->name."'" : "userId = ".$this->id));
|
||||||
|
if ($query->num_rows)
|
||||||
|
return $query->fetch_assoc();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function setPic($status = false)
|
||||||
|
{
|
||||||
|
global $_sql;
|
||||||
|
$this->get_data();
|
||||||
|
if ($_sql->query("UPDATE users SET userPic = ".($status ? 1 : 0)." WHERE userId = ".$this->data['userId']))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function setData($field, $value)
|
||||||
|
{
|
||||||
|
global $_sql;
|
||||||
|
$this->get_data();
|
||||||
|
if ($_sql->query("UPDATE users SET `$field` = '".sqlprot($value)."' WHERE userId = ".$this->data['userId']))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
101
index.php
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
require_once 'core.php';
|
||||||
|
|
||||||
|
ob_start();
|
||||||
|
switch ($seo[0])
|
||||||
|
{
|
||||||
|
case 'rss':
|
||||||
|
include 'includes/rss.php';
|
||||||
|
exit;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case $_set['subEntry']:
|
||||||
|
if (isset($_POST['read_entry_pin']) && is_numeric($_POST['read_entry_pin'])) set_pin($_POST['read_entry_pin']);
|
||||||
|
include 'includes/main/entry.php';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case $_set['subPage']:
|
||||||
|
include 'includes/main/page.php';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case $_set['subProfile']:
|
||||||
|
if (!isset($seo[1])) redirect();
|
||||||
|
include 'includes/main/profile.php';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'tag':
|
||||||
|
include 'includes/main/tag.php';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'login':
|
||||||
|
include 'includes/main/login.php';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'admin':
|
||||||
|
if (LOGGEDIN && $user['userLevel'] > 1)
|
||||||
|
include 'includes/admin/main.php';
|
||||||
|
else
|
||||||
|
redirect();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'p':
|
||||||
|
include 'includes/main/entries.php';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'filtrToken':
|
||||||
|
if (isset($seo[1]))
|
||||||
|
setcookie('filtr_token', $seo[1], time()+3600*24*31, '/');
|
||||||
|
redirect();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
include 'includes/main/entries.php';
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// COLLECT OUTPUT
|
||||||
|
$output = ob_get_contents();
|
||||||
|
ob_end_clean();
|
||||||
|
|
||||||
|
// PLUGINS
|
||||||
|
$pluginsQuery = $_sql->query("SELECT pluginLib, pluginStatus FROM plugins WHERE pluginStatus = 1");
|
||||||
|
while ($data = $pluginsQuery->fetch_assoc())
|
||||||
|
{
|
||||||
|
$pinfo = 'plugins/'.$data['pluginLib'].'/info.json';
|
||||||
|
$pexec = 'plugins/'.$data['pluginLib'].'/_plugin.php';
|
||||||
|
if (file_exists($pinfo) && file_exists($pexec))
|
||||||
|
{
|
||||||
|
$pinfo = (array)json_decode(file_get_contents($pinfo));
|
||||||
|
$cpath = explode(',', $pinfo['paths']);
|
||||||
|
for ($a = 0; $a < sizeof($cpath); $a++)
|
||||||
|
{
|
||||||
|
$ppath = explode('/', ltrim($cpath[$a], '/'));
|
||||||
|
$load = true;
|
||||||
|
for ($i = 0; $i < sizeof($ppath); $i++)
|
||||||
|
if (isset($seo[$i]) && $seo[$i] == $ppath[$i] && $load)
|
||||||
|
$load = true;
|
||||||
|
else
|
||||||
|
$load = false;
|
||||||
|
if ($load)
|
||||||
|
include $pexec;
|
||||||
|
}
|
||||||
|
unset($i);
|
||||||
|
unset($a);
|
||||||
|
unset($pinfo);
|
||||||
|
unset($load);
|
||||||
|
unset($pexec);
|
||||||
|
unset($ppath);
|
||||||
|
unset($cpath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// LOAD THEME
|
||||||
|
if (get_theme())
|
||||||
|
include get_theme();
|
||||||
|
else
|
||||||
|
nice_error('The theme is not complete.');
|
||||||
|
|
||||||
|
|
BIN
plugins/.DS_Store
vendored
Normal file
5
plugins/ckeditor/_plugin.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
addHead('<script src="/plugins/ckeditor/ckeditor.js"></script>', 'ckeditor');
|
||||||
|
addHead('<script src="/plugins/ckeditor/adapters/jquery.js"></script>', 'ckeditor-adapter');
|
||||||
|
addHead('<script>$(document).ready(function() { $("#content textarea").ckeditor(); });</script>');
|
10
plugins/ckeditor/adapters/jquery.js
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
(function(a){CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;"undefined"!=typeof a&&(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 k=d,d=g,g=k;var i=[],d=d||{};this.each(function(){var b=
|
||||||
|
a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,j=new a.Deferred;i.push(j.promise());if(c&&!f)g&&g.apply(c,[this]),j.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),j.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]);j.resolve()}else setTimeout(arguments.callee,
|
||||||
|
100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,i).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 k=this,i=[],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()});i.push(f.promise());
|
||||||
|
return!0}return g.call(b,d)});if(i.length){var b=new a.Deferred;a.when.apply(this,i).done(function(){b.resolveWith(k)});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);
|
59
plugins/ckeditor/build-config.js
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2014, 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/0bef89aa099a8362a6a7ff84270ff668
|
||||||
|
* Visit online builder to build CKEditor, starting with the same setup as before.
|
||||||
|
*
|
||||||
|
* (3) http://ckeditor.com/builder/download/0bef89aa099a8362a6a7ff84270ff668
|
||||||
|
* 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: 'moono',
|
||||||
|
preset: 'basic',
|
||||||
|
ignore: [
|
||||||
|
'dev',
|
||||||
|
'.gitignore',
|
||||||
|
'.gitattributes',
|
||||||
|
'README.md',
|
||||||
|
'.mailmap'
|
||||||
|
],
|
||||||
|
plugins : {
|
||||||
|
'autogrow' : 1,
|
||||||
|
'autosave' : 1,
|
||||||
|
'basicstyles' : 1,
|
||||||
|
'blockquote' : 1,
|
||||||
|
'clipboard' : 1,
|
||||||
|
'enterkey' : 1,
|
||||||
|
'floatingspace' : 1,
|
||||||
|
'imagebrowser' : 1,
|
||||||
|
'indentlist' : 1,
|
||||||
|
'link' : 1,
|
||||||
|
'list' : 1,
|
||||||
|
'pastetext' : 1,
|
||||||
|
'removeformat' : 1,
|
||||||
|
'toolbar' : 1,
|
||||||
|
'undo' : 1,
|
||||||
|
'wysiwygarea' : 1
|
||||||
|
},
|
||||||
|
languages : {
|
||||||
|
'en' : 1,
|
||||||
|
'hu' : 1
|
||||||
|
}
|
||||||
|
};
|
733
plugins/ckeditor/ckeditor.js
vendored
Normal file
@ -0,0 +1,733 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
(function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;window.CKEDITOR||(window.CKEDITOR=function(){var a={timestamp:"E4KA",version:"4.4.1",revision:"568b5ed",rnd:Math.floor(900*Math.random())+100,_:{pending:[]},status:"unloaded",basePath:function(){var a=window.CKEDITOR_BASEPATH||"";if(!a)for(var d=document.getElementsByTagName("script"),f=0;f<d.length;f++){var b=d[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(b){a=b[1];break}}-1==a.indexOf(":/")&&"//"!=a.slice(0,2)&&(a=0===a.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+
|
||||||
|
a:location.href.match(/^[^\?]*\/(?:)/)[0]+a);if(!a)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return a}(),getUrl:function(a){-1==a.indexOf(":/")&&0!==a.indexOf("/")&&(a=this.basePath+a);this.timestamp&&("/"!=a.charAt(a.length-1)&&!/[&?]t=/.test(a))&&(a+=(0<=a.indexOf("?")?"&":"?")+"t="+this.timestamp);return a},domReady:function(){function a(){try{document.addEventListener?(document.removeEventListener("DOMContentLoaded",
|
||||||
|
a,!1),d()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",a),d())}catch(f){}}function d(){for(var a;a=f.shift();)a()}var f=[];return function(d){f.push(d);"complete"===document.readyState&&setTimeout(a,1);if(1==f.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",a,!1),window.addEventListener("load",a,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",a);window.attachEvent("onload",a);d=!1;try{d=
|
||||||
|
!window.frameElement}catch(b){}if(document.documentElement.doScroll&&d){var e=function(){try{document.documentElement.doScroll("left")}catch(d){setTimeout(e,1);return}a()};e()}}}}()},e=window.CKEDITOR_GETURL;if(e){var b=a.getUrl;a.getUrl=function(c){return e.call(a,c)||b.call(a,c)}}return a}());
|
||||||
|
CKEDITOR.event||(CKEDITOR.event=function(){},CKEDITOR.event.implementOn=function(a){var e=CKEDITOR.event.prototype,b;for(b in e)a[b]==void 0&&(a[b]=e[b])},CKEDITOR.event.prototype=function(){function a(a){var d=e(this);return d[a]||(d[a]=new b(a))}var e=function(a){a=a.getPrivate&&a.getPrivate()||a._||(a._={});return a.events||(a.events={})},b=function(a){this.name=a;this.listeners=[]};b.prototype={getListenerIndex:function(a){for(var d=0,f=this.listeners;d<f.length;d++)if(f[d].fn==a)return d;return-1}};
|
||||||
|
return{define:function(b,d){var f=a.call(this,b);CKEDITOR.tools.extend(f,d,true)},on:function(b,d,f,e,n){function i(a,o,s,r){a={name:b,sender:this,editor:a,data:o,listenerData:e,stop:s,cancel:r,removeListener:k};return d.call(f,a)===false?false:a.data}function k(){s.removeListener(b,d)}var o=a.call(this,b);if(o.getListenerIndex(d)<0){o=o.listeners;f||(f=this);isNaN(n)&&(n=10);var s=this;i.fn=d;i.priority=n;for(var r=o.length-1;r>=0;r--)if(o[r].priority<=n){o.splice(r+1,0,i);return{removeListener:k}}o.unshift(i)}return{removeListener:k}},
|
||||||
|
once:function(){var a=arguments[1];arguments[1]=function(d){d.removeListener();return a.apply(this,arguments)};return this.on.apply(this,arguments)},capture:function(){CKEDITOR.event.useCapture=1;var a=this.on.apply(this,arguments);CKEDITOR.event.useCapture=0;return a},fire:function(){var a=0,d=function(){a=1},f=0,b=function(){f=1};return function(n,i,k){var o=e(this)[n],n=a,s=f;a=f=0;if(o){var r=o.listeners;if(r.length)for(var r=r.slice(0),v,g=0;g<r.length;g++){if(o.errorProof)try{v=r[g].call(this,
|
||||||
|
k,i,d,b)}catch(p){}else v=r[g].call(this,k,i,d,b);v===false?f=1:typeof v!="undefined"&&(i=v);if(a||f)break}}i=f?false:typeof i=="undefined"?true:i;a=n;f=s;return i}}(),fireOnce:function(a,d,f){d=this.fire(a,d,f);delete e(this)[a];return d},removeListener:function(a,d){var f=e(this)[a];if(f){var b=f.getListenerIndex(d);b>=0&&f.listeners.splice(b,1)}},removeAllListeners:function(){var a=e(this),d;for(d in a)delete a[d]},hasListeners:function(a){return(a=e(this)[a])&&a.listeners.length>0}}}());
|
||||||
|
CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]);CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=function(a,e){a in{instanceReady:1,loaded:1}&&(this[a]=true);return CKEDITOR.event.prototype.fire.call(this,a,e,this)},CKEDITOR.editor.prototype.fireOnce=function(a,e){a in{instanceReady:1,loaded:1}&&(this[a]=true);return CKEDITOR.event.prototype.fireOnce.call(this,a,e,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype));
|
||||||
|
CKEDITOR.env||(CKEDITOR.env=function(){var a=navigator.userAgent.toLowerCase(),e={ie:a.indexOf("trident/")>-1,webkit:a.indexOf(" applewebkit/")>-1,air:a.indexOf(" adobeair/")>-1,mac:a.indexOf("macintosh")>-1,quirks:document.compatMode=="BackCompat"&&(!document.documentMode||document.documentMode<10),mobile:a.indexOf("mobile")>-1,iOS:/(ipad|iphone|ipod)/.test(a),isCustomDomain:function(){if(!this.ie)return false;var a=document.domain,f=window.location.hostname;return a!=f&&a!="["+f+"]"},secure:location.protocol==
|
||||||
|
"https:"};e.gecko=navigator.product=="Gecko"&&!e.webkit&&!e.ie;if(e.webkit)a.indexOf("chrome")>-1?e.chrome=true:e.safari=true;var b=0;if(e.ie){b=e.quirks||!document.documentMode?parseFloat(a.match(/msie (\d+)/)[1]):document.documentMode;e.ie9Compat=b==9;e.ie8Compat=b==8;e.ie7Compat=b==7;e.ie6Compat=b<7||e.quirks}if(e.gecko){var c=a.match(/rv:([\d\.]+)/);if(c){c=c[1].split(".");b=c[0]*1E4+(c[1]||0)*100+(c[2]||0)*1}}e.air&&(b=parseFloat(a.match(/ adobeair\/(\d+)/)[1]));e.webkit&&(b=parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));
|
||||||
|
e.version=b;e.isCompatible=e.iOS&&b>=534||!e.mobile&&(e.ie&&b>6||e.gecko&&b>=2E4||e.air&&b>=1||e.webkit&&b>=522||false);e.hidpi=window.devicePixelRatio>=2;e.needsBrFiller=e.gecko||e.webkit||e.ie&&b>10;e.needsNbspFiller=e.ie&&b<11;e.cssClass="cke_browser_"+(e.ie?"ie":e.gecko?"gecko":e.webkit?"webkit":"unknown");if(e.quirks)e.cssClass=e.cssClass+" cke_browser_quirks";if(e.ie)e.cssClass=e.cssClass+(" cke_browser_ie"+(e.quirks?"6 cke_browser_iequirks":e.version));if(e.air)e.cssClass=e.cssClass+" cke_browser_air";
|
||||||
|
if(e.iOS)e.cssClass=e.cssClass+" cke_browser_ios";if(e.hidpi)e.cssClass=e.cssClass+" cke_hidpi";return e}());
|
||||||
|
"unloaded"==CKEDITOR.status&&function(){CKEDITOR.event.implementOn(CKEDITOR);CKEDITOR.loadFullCore=function(){if(CKEDITOR.status!="basic_ready")CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var a=document.createElement("script");a.type="text/javascript";a.src=CKEDITOR.basePath+"ckeditor.js";document.getElementsByTagName("head")[0].appendChild(a)}};CKEDITOR.loadFullCoreTimeout=0;CKEDITOR.add=function(a){(this._.pending||(this._.pending=[])).push(a)};(function(){CKEDITOR.domReady(function(){var a=
|
||||||
|
CKEDITOR.loadFullCore,e=CKEDITOR.loadFullCoreTimeout;if(a){CKEDITOR.status="basic_ready";a&&a._load?a():e&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},e*1E3)}})})();CKEDITOR.status="basic_loaded"}();CKEDITOR.dom={};
|
||||||
|
(function(){var a=[],e=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",b=/&/g,c=/>/g,d=/</g,f=/"/g,h=/&/g,n=/>/g,i=/</g,k=/"/g;CKEDITOR.on("reset",function(){a=[]});CKEDITOR.tools={arrayCompare:function(a,d){if(!a&&!d)return true;if(!a||!d||a.length!=d.length)return false;for(var f=0;f<a.length;f++)if(a[f]!=d[f])return false;return true},clone:function(a){var d;if(a&&a instanceof Array){d=[];for(var f=0;f<a.length;f++)d[f]=CKEDITOR.tools.clone(a[f]);
|
||||||
|
return d}if(a===null||typeof a!="object"||a instanceof String||a instanceof Number||a instanceof Boolean||a instanceof Date||a instanceof RegExp)return a;d=new a.constructor;for(f in a)d[f]=CKEDITOR.tools.clone(a[f]);return d},capitalize:function(a,d){return a.charAt(0).toUpperCase()+(d?a.slice(1):a.slice(1).toLowerCase())},extend:function(a){var d=arguments.length,f,b;if(typeof(f=arguments[d-1])=="boolean")d--;else if(typeof(f=arguments[d-2])=="boolean"){b=arguments[d-1];d=d-2}for(var g=1;g<d;g++){var e=
|
||||||
|
arguments[g],c;for(c in e)if(f===true||a[c]==void 0)if(!b||c in b)a[c]=e[c]}return a},prototypedCopy:function(a){var d=function(){};d.prototype=a;return new d},copy:function(a){var d={},f;for(f in a)d[f]=a[f];return d},isArray:function(a){return Object.prototype.toString.call(a)=="[object Array]"},isEmpty:function(a){for(var d in a)if(a.hasOwnProperty(d))return false;return true},cssVendorPrefix:function(a,d,f){if(f)return e+a+":"+d+";"+a+":"+d;f={};f[a]=d;f[e+a]=d;return f},cssStyleToDomStyle:function(){var a=
|
||||||
|
document.createElement("div").style,d=typeof a.cssFloat!="undefined"?"cssFloat":typeof a.styleFloat!="undefined"?"styleFloat":"float";return function(a){return a=="float"?d:a.replace(/-./g,function(a){return a.substr(1).toUpperCase()})}}(),buildStyleHtml:function(a){for(var a=[].concat(a),d,f=[],b=0;b<a.length;b++)if(d=a[b])/@import|[{}]/.test(d)?f.push("<style>"+d+"</style>"):f.push('<link type="text/css" rel=stylesheet href="'+d+'">');return f.join("")},htmlEncode:function(a){return(""+a).replace(b,
|
||||||
|
"&").replace(c,">").replace(d,"<")},htmlDecode:function(a){return a.replace(h,"&").replace(n,">").replace(i,"<")},htmlEncodeAttr:function(a){return a.replace(f,""").replace(d,"<").replace(c,">")},htmlDecodeAttr:function(a){return a.replace(k,'"').replace(i,"<").replace(n,">")},getNextNumber:function(){var a=0;return function(){return++a}}(),getNextId:function(){return"cke_"+this.getNextNumber()},override:function(a,d){var f=d(a);f.prototype=a.prototype;return f},setTimeout:function(a,
|
||||||
|
d,f,b,g){g||(g=window);f||(f=g);return g.setTimeout(function(){b?a.apply(f,[].concat(b)):a.apply(f)},d||0)},trim:function(){var a=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(d){return d.replace(a,"")}}(),ltrim:function(){var a=/^[ \t\n\r]+/g;return function(d){return d.replace(a,"")}}(),rtrim:function(){var a=/[ \t\n\r]+$/g;return function(d){return d.replace(a,"")}}(),indexOf:function(a,d){if(typeof d=="function")for(var f=0,b=a.length;f<b;f++){if(d(a[f]))return f}else{if(a.indexOf)return a.indexOf(d);
|
||||||
|
f=0;for(b=a.length;f<b;f++)if(a[f]===d)return f}return-1},search:function(a,d){var f=CKEDITOR.tools.indexOf(a,d);return f>=0?a[f]:null},bind:function(a,d){return function(){return a.apply(d,arguments)}},createClass:function(a){var d=a.$,f=a.base,b=a.privates||a._,g=a.proto,a=a.statics;!d&&(d=function(){f&&this.base.apply(this,arguments)});if(b)var e=d,d=function(){var a=this._||(this._={}),d;for(d in b){var g=b[d];a[d]=typeof g=="function"?CKEDITOR.tools.bind(g,this):g}e.apply(this,arguments)};if(f){d.prototype=
|
||||||
|
this.prototypedCopy(f.prototype);d.prototype.constructor=d;d.base=f;d.baseProto=f.prototype;d.prototype.base=function(){this.base=f.prototype.base;f.apply(this,arguments);this.base=arguments.callee}}g&&this.extend(d.prototype,g,true);a&&this.extend(d,a,true);return d},addFunction:function(d,f){return a.push(function(){return d.apply(f||this,arguments)})-1},removeFunction:function(d){a[d]=null},callFunction:function(d){var f=a[d];return f&&f.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:function(){var a=
|
||||||
|
/^-?\d+\.?\d*px$/,d;return function(f){d=CKEDITOR.tools.trim(f+"")+"px";return a.test(d)?d:f||""}}(),convertToPx:function(){var a;return function(d){if(!a){a=CKEDITOR.dom.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"></div>',CKEDITOR.document);CKEDITOR.document.getBody().append(a)}if(!/%$/.test(d)){a.setStyle("width",d);return a.$.clientWidth}return d}}(),repeat:function(a,d){return Array(d+1).join(a)},tryThese:function(){for(var a,
|
||||||
|
d=0,f=arguments.length;d<f;d++){var b=arguments[d];try{a=b();break}catch(g){}}return a},genKey:function(){return Array.prototype.slice.call(arguments).join("-")},defer:function(a){return function(){var d=arguments,f=this;window.setTimeout(function(){a.apply(f,d)},0)}},normalizeCssText:function(a,d){var f=[],b,g=CKEDITOR.tools.parseCssText(a,true,d);for(b in g)f.push(b+":"+g[b]);f.sort();return f.length?f.join(";")+";":""},convertRgbToHex:function(a){return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,
|
||||||
|
function(a,d,f,g){a=[d,f,g];for(d=0;d<3;d++)a[d]=("0"+parseInt(a[d],10).toString(16)).slice(-2);return"#"+a.join("")})},parseCssText:function(a,d,f){var b={};if(f){f=new CKEDITOR.dom.element("span");f.setAttribute("style",a);a=CKEDITOR.tools.convertRgbToHex(f.getAttribute("style")||"")}if(!a||a==";")return b;a.replace(/"/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,f,o){if(d){f=f.toLowerCase();f=="font-family"&&(o=o.toLowerCase().replace(/["']/g,"").replace(/\s*,\s*/g,","));
|
||||||
|
o=CKEDITOR.tools.trim(o)}b[f]=o});return b},writeCssText:function(a,d){var f,b=[];for(f in a)b.push(f+":"+a[f]);d&&b.sort();return b.join("; ")},objectCompare:function(a,d,f){var b;if(!a&&!d)return true;if(!a||!d)return false;for(b in a)if(a[b]!=d[b])return false;if(!f)for(b in d)if(a[b]!=d[b])return false;return true},objectKeys:function(a){var d=[],f;for(f in a)d.push(f);return d},convertArrayToObject:function(a,d){var f={};arguments.length==1&&(d=true);for(var b=0,g=a.length;b<g;++b)f[a[b]]=d;
|
||||||
|
return f},fixDomain:function(){for(var a;;)try{a=window.parent.document.domain;break}catch(d){a=a?a.replace(/.+?(?:\.|$)/,""):document.domain;if(!a)break;document.domain=a}return!!a},eventsBuffer:function(a,d){function f(){g=(new Date).getTime();b=false;d()}var b,g=0;return{input:function(){if(!b){var d=(new Date).getTime()-g;d<a?b=setTimeout(f,a-d):f()}},reset:function(){b&&clearTimeout(b);b=g=0}}},enableHtml5Elements:function(a,d){for(var f=["abbr","article","aside","audio","bdi","canvas","data",
|
||||||
|
"datalist","details","figcaption","figure","footer","header","hgroup","mark","meter","nav","output","progress","section","summary","time","video"],b=f.length,g;b--;){g=a.createElement(f[b]);d&&a.appendChild(g)}},checkIfAnyArrayItemMatches:function(a,d){for(var f=0,b=a.length;f<b;++f)if(a[f].match(d))return true;return false},checkIfAnyObjectPropertyMatches:function(a,d){for(var f in a)if(f.match(d))return true;return false},transparentImageData:"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="}})();
|
||||||
|
CKEDITOR.dtd=function(){var a=CKEDITOR.tools.extend,e=function(a,d){for(var f=CKEDITOR.tools.clone(a),b=1;b<arguments.length;b++){var d=arguments[b],e;for(e in d)delete f[e]}return f},b={},c={},d={address:1,article:1,aside:1,blockquote:1,details:1,div:1,dl:1,fieldset:1,figure:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,hr:1,menu:1,nav:1,ol:1,p:1,pre:1,section:1,table:1,ul:1},f={command:1,link:1,meta:1,noscript:1,script:1,style:1},h={},n={"#":1},i={center:1,dir:1,noframes:1};
|
||||||
|
a(b,{a:1,abbr:1,area:1,audio:1,b:1,bdi:1,bdo:1,br:1,button:1,canvas:1,cite:1,code:1,command:1,datalist:1,del:1,dfn:1,em:1,embed:1,i:1,iframe:1,img:1,input:1,ins:1,kbd:1,keygen:1,label:1,map:1,mark:1,meter:1,noscript:1,object:1,output:1,progress:1,q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,"var":1,video:1,wbr:1},n,{acronym:1,applet:1,basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1});a(c,d,b,i);e={a:e(b,{a:1,button:1}),abbr:b,address:c,
|
||||||
|
area:h,article:a({style:1},c),aside:a({style:1},c),audio:a({source:1,track:1},c),b:b,base:h,bdi:b,bdo:b,blockquote:c,body:c,br:h,button:e(b,{a:1,button:1}),canvas:b,caption:c,cite:b,code:b,col:h,colgroup:{col:1},command:h,datalist:a({option:1},b),dd:c,del:b,details:a({summary:1},c),dfn:b,div:a({style:1},c),dl:{dt:1,dd:1},dt:c,em:b,embed:h,fieldset:a({legend:1},c),figcaption:c,figure:a({figcaption:1},c),footer:c,form:c,h1:b,h2:b,h3:b,h4:b,h5:b,h6:b,head:a({title:1,base:1},f),header:c,hgroup:{h1:1,
|
||||||
|
h2:1,h3:1,h4:1,h5:1,h6:1},hr:h,html:a({head:1,body:1},c,f),i:b,iframe:n,img:h,input:h,ins:b,kbd:b,keygen:h,label:b,legend:b,li:c,link:h,map:c,mark:b,menu:a({li:1},c),meta:h,meter:e(b,{meter:1}),nav:c,noscript:a({link:1,meta:1,style:1},b),object:a({param:1},b),ol:{li:1},optgroup:{option:1},option:n,output:b,p:b,param:h,pre:b,progress:e(b,{progress:1}),q:b,rp:b,rt:b,ruby:a({rp:1,rt:1},b),s:b,samp:b,script:n,section:a({style:1},c),select:{optgroup:1,option:1},small:b,source:h,span:b,strong:b,style:n,
|
||||||
|
sub:b,summary:b,sup:b,table:{caption:1,colgroup:1,thead:1,tfoot:1,tbody:1,tr:1},tbody:{tr:1},td:c,textarea:n,tfoot:{tr:1},th:c,thead:{tr:1},time:e(b,{time:1}),title:n,tr:{th:1,td:1},track:h,u:b,ul:{li:1},"var":b,video:a({source:1,track:1},c),wbr:h,acronym:b,applet:a({param:1},c),basefont:h,big:b,center:c,dialog:h,dir:{li:1},font:b,isindex:h,noframes:c,strike:b,tt:b};a(e,{$block:a({audio:1,dd:1,dt:1,figcaption:1,li:1,video:1},d,i),$blockLimit:{article:1,aside:1,audio:1,body:1,caption:1,details:1,dir:1,
|
||||||
|
div:1,dl:1,fieldset:1,figcaption:1,figure:1,footer:1,form:1,header:1,hgroup:1,menu:1,nav:1,ol:1,section:1,table:1,td:1,th:1,tr:1,ul:1,video:1},$cdata:{script:1,style:1},$editable:{address:1,article:1,aside:1,blockquote:1,body:1,details:1,div:1,fieldset:1,figcaption:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,nav:1,p:1,pre:1,section:1},$empty:{area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,
|
||||||
|
wbr:1},$inline:b,$list:{dl:1,ol:1,ul:1},$listItem:{dd:1,dt:1,li:1},$nonBodyContent:a({body:1,head:1,html:1},e.head),$nonEditable:{applet:1,audio:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,param:1,script:1,textarea:1,video:1},$object:{applet:1,audio:1,button:1,hr:1,iframe:1,img:1,input:1,object:1,select:1,table:1,textarea:1,video:1},$removeEmpty:{abbr:1,acronym:1,b:1,bdi:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,mark:1,meter:1,output:1,q:1,ruby:1,s:1,samp:1,
|
||||||
|
small:1,span:1,strike:1,strong:1,sub:1,sup:1,time:1,tt:1,u:1,"var":1},$tabIndex:{a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},$tableContent:{caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},$transparent:{a:1,audio:1,canvas:1,del:1,ins:1,map:1,noscript:1,object:1,video:1},$intermediate:{caption:1,colgroup:1,dd:1,dt:1,figcaption:1,legend:1,li:1,optgroup:1,option:1,rp:1,rt:1,summary:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1}});return e}();
|
||||||
|
CKEDITOR.dom.event=function(a){this.$=a};
|
||||||
|
CKEDITOR.dom.event.prototype={getKey:function(){return this.$.keyCode||this.$.which},getKeystroke:function(){var a=this.getKey();if(this.$.ctrlKey||this.$.metaKey)a=a+CKEDITOR.CTRL;this.$.shiftKey&&(a=a+CKEDITOR.SHIFT);this.$.altKey&&(a=a+CKEDITOR.ALT);return a},preventDefault:function(a){var e=this.$;e.preventDefault?e.preventDefault():e.returnValue=false;a&&this.stopPropagation()},stopPropagation:function(){var a=this.$;a.stopPropagation?a.stopPropagation():a.cancelBubble=true},getTarget:function(){var a=
|
||||||
|
this.$.target||this.$.srcElement;return a?new CKEDITOR.dom.node(a):null},getPhase:function(){return this.$.eventPhase||2},getPageOffset:function(){var a=this.getTarget().getDocument().$;return{x:this.$.pageX||this.$.clientX+(a.documentElement.scrollLeft||a.body.scrollLeft),y:this.$.pageY||this.$.clientY+(a.documentElement.scrollTop||a.body.scrollTop)}}};CKEDITOR.CTRL=1114112;CKEDITOR.SHIFT=2228224;CKEDITOR.ALT=4456448;CKEDITOR.EVENT_PHASE_CAPTURING=1;CKEDITOR.EVENT_PHASE_AT_TARGET=2;
|
||||||
|
CKEDITOR.EVENT_PHASE_BUBBLING=3;CKEDITOR.dom.domObject=function(a){if(a)this.$=a};
|
||||||
|
CKEDITOR.dom.domObject.prototype=function(){var a=function(a,b){return function(c){typeof CKEDITOR!="undefined"&&a.fire(b,new CKEDITOR.dom.event(c))}};return{getPrivate:function(){var a;if(!(a=this.getCustomData("_")))this.setCustomData("_",a={});return a},on:function(e){var b=this.getCustomData("_cke_nativeListeners");if(!b){b={};this.setCustomData("_cke_nativeListeners",b)}if(!b[e]){b=b[e]=a(this,e);this.$.addEventListener?this.$.addEventListener(e,b,!!CKEDITOR.event.useCapture):this.$.attachEvent&&
|
||||||
|
this.$.attachEvent("on"+e,b)}return CKEDITOR.event.prototype.on.apply(this,arguments)},removeListener:function(a){CKEDITOR.event.prototype.removeListener.apply(this,arguments);if(!this.hasListeners(a)){var b=this.getCustomData("_cke_nativeListeners"),c=b&&b[a];if(c){this.$.removeEventListener?this.$.removeEventListener(a,c,false):this.$.detachEvent&&this.$.detachEvent("on"+a,c);delete b[a]}}},removeAllListeners:function(){var a=this.getCustomData("_cke_nativeListeners"),b;for(b in a){var c=a[b];this.$.detachEvent?
|
||||||
|
this.$.detachEvent("on"+b,c):this.$.removeEventListener&&this.$.removeEventListener(b,c,false);delete a[b]}CKEDITOR.event.prototype.removeAllListeners.call(this)}}}();
|
||||||
|
(function(a){var e={};CKEDITOR.on("reset",function(){e={}});a.equals=function(a){try{return a&&a.$===this.$}catch(c){return false}};a.setCustomData=function(a,c){var d=this.getUniqueId();(e[d]||(e[d]={}))[a]=c;return this};a.getCustomData=function(a){var c=this.$["data-cke-expando"];return(c=c&&e[c])&&a in c?c[a]:null};a.removeCustomData=function(a){var c=this.$["data-cke-expando"],c=c&&e[c],d,f;if(c){d=c[a];f=a in c;delete c[a]}return f?d:null};a.clearCustomData=function(){this.removeAllListeners();
|
||||||
|
var a=this.$["data-cke-expando"];a&&delete e[a]};a.getUniqueId=function(){return this.$["data-cke-expando"]||(this.$["data-cke-expando"]=CKEDITOR.tools.getNextNumber())};CKEDITOR.event.implementOn(a)})(CKEDITOR.dom.domObject.prototype);
|
||||||
|
CKEDITOR.dom.node=function(a){return a?new CKEDITOR.dom[a.nodeType==CKEDITOR.NODE_DOCUMENT?"document":a.nodeType==CKEDITOR.NODE_ELEMENT?"element":a.nodeType==CKEDITOR.NODE_TEXT?"text":a.nodeType==CKEDITOR.NODE_COMMENT?"comment":a.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT?"documentFragment":"domObject"](a):this};CKEDITOR.dom.node.prototype=new CKEDITOR.dom.domObject;CKEDITOR.NODE_ELEMENT=1;CKEDITOR.NODE_DOCUMENT=9;CKEDITOR.NODE_TEXT=3;CKEDITOR.NODE_COMMENT=8;CKEDITOR.NODE_DOCUMENT_FRAGMENT=11;
|
||||||
|
CKEDITOR.POSITION_IDENTICAL=0;CKEDITOR.POSITION_DISCONNECTED=1;CKEDITOR.POSITION_FOLLOWING=2;CKEDITOR.POSITION_PRECEDING=4;CKEDITOR.POSITION_IS_CONTAINED=8;CKEDITOR.POSITION_CONTAINS=16;
|
||||||
|
CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype,{appendTo:function(a,e){a.append(this,e);return a},clone:function(a,e){var b=this.$.cloneNode(a),c=function(d){d["data-cke-expando"]&&(d["data-cke-expando"]=false);if(d.nodeType==CKEDITOR.NODE_ELEMENT){e||d.removeAttribute("id",false);if(a)for(var d=d.childNodes,f=0;f<d.length;f++)c(d[f])}};c(b);return new CKEDITOR.dom.node(b)},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling},insertAfter:function(a){a.$.parentNode.insertBefore(this.$,
|
||||||
|
a.$.nextSibling);return a},insertBefore:function(a){a.$.parentNode.insertBefore(this.$,a.$);return a},insertBeforeMe:function(a){this.$.parentNode.insertBefore(a.$,this.$);return a},getAddress:function(a){for(var e=[],b=this.getDocument().$.documentElement,c=this.$;c&&c!=b;){var d=c.parentNode;d&&e.unshift(this.getIndex.call({$:c},a));c=d}return e},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(a){var e=this.$,b=-1,
|
||||||
|
c;if(!this.$.parentNode)return b;do if(!a||!(e!=this.$&&e.nodeType==CKEDITOR.NODE_TEXT&&(c||!e.nodeValue))){b++;c=e.nodeType==CKEDITOR.NODE_TEXT}while(e=e.previousSibling);return b},getNextSourceNode:function(a,e,b){if(b&&!b.call)var c=b,b=function(a){return!a.equals(c)};var a=!a&&this.getFirst&&this.getFirst(),d;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&b&&b(this,true)===false)return null;a=this.getNext()}for(;!a&&(d=(d||this).getParent());){if(b&&b(d,true)===false)return null;a=d.getNext()}return!a||
|
||||||
|
b&&b(a)===false?null:e&&e!=a.type?a.getNextSourceNode(false,e,b):a},getPreviousSourceNode:function(a,e,b){if(b&&!b.call)var c=b,b=function(a){return!a.equals(c)};var a=!a&&this.getLast&&this.getLast(),d;if(!a){if(this.type==CKEDITOR.NODE_ELEMENT&&b&&b(this,true)===false)return null;a=this.getPrevious()}for(;!a&&(d=(d||this).getParent());){if(b&&b(d,true)===false)return null;a=d.getPrevious()}return!a||b&&b(a)===false?null:e&&a.type!=e?a.getPreviousSourceNode(false,e,b):a},getPrevious:function(a){var e=
|
||||||
|
this.$,b;do b=(e=e.previousSibling)&&e.nodeType!=10&&new CKEDITOR.dom.node(e);while(b&&a&&!a(b));return b},getNext:function(a){var e=this.$,b;do b=(e=e.nextSibling)&&new CKEDITOR.dom.node(e);while(b&&a&&!a(b));return b},getParent:function(a){var e=this.$.parentNode;return e&&(e.nodeType==CKEDITOR.NODE_ELEMENT||a&&e.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?new CKEDITOR.dom.node(e):null},getParents:function(a){var e=this,b=[];do b[a?"push":"unshift"](e);while(e=e.getParent());return b},getCommonAncestor:function(a){if(a.equals(this))return this;
|
||||||
|
if(a.contains&&a.contains(this))return a;var e=this.contains?this:this.getParent();do if(e.contains(a))return e;while(e=e.getParent());return null},getPosition:function(a){var e=this.$,b=a.$;if(e.compareDocumentPosition)return e.compareDocumentPosition(b);if(e==b)return CKEDITOR.POSITION_IDENTICAL;if(this.type==CKEDITOR.NODE_ELEMENT&&a.type==CKEDITOR.NODE_ELEMENT){if(e.contains){if(e.contains(b))return CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING;if(b.contains(e))return CKEDITOR.POSITION_IS_CONTAINED+
|
||||||
|
CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in e)return e.sourceIndex<0||b.sourceIndex<0?CKEDITOR.POSITION_DISCONNECTED:e.sourceIndex<b.sourceIndex?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING}for(var e=this.getAddress(),a=a.getAddress(),b=Math.min(e.length,a.length),c=0;c<=b-1;c++)if(e[c]!=a[c]){if(c<b)return e[c]<a[c]?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING;break}return e.length<a.length?CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_IS_CONTAINED+
|
||||||
|
CKEDITOR.POSITION_FOLLOWING},getAscendant:function(a,e){var b=this.$,c;if(!e)b=b.parentNode;for(;b;){if(b.nodeName&&(c=b.nodeName.toLowerCase(),typeof a=="string"?c==a:c in a))return new CKEDITOR.dom.node(b);try{b=b.parentNode}catch(d){b=null}}return null},hasAscendant:function(a,e){var b=this.$;if(!e)b=b.parentNode;for(;b;){if(b.nodeName&&b.nodeName.toLowerCase()==a)return true;b=b.parentNode}return false},move:function(a,e){a.append(this.remove(),e)},remove:function(a){var e=this.$,b=e.parentNode;
|
||||||
|
if(b){if(a)for(;a=e.firstChild;)b.insertBefore(e.removeChild(a),e);b.removeChild(e)}return this},replace:function(a){this.insertBefore(a);a.remove()},trim:function(){this.ltrim();this.rtrim()},ltrim:function(){for(var a;this.getFirst&&(a=this.getFirst());){if(a.type==CKEDITOR.NODE_TEXT){var e=CKEDITOR.tools.ltrim(a.getText()),b=a.getLength();if(e){if(e.length<b){a.split(b-e.length);this.$.removeChild(this.$.firstChild)}}else{a.remove();continue}}break}},rtrim:function(){for(var a;this.getLast&&(a=
|
||||||
|
this.getLast());){if(a.type==CKEDITOR.NODE_TEXT){var e=CKEDITOR.tools.rtrim(a.getText()),b=a.getLength();if(e){if(e.length<b){a.split(e.length);this.$.lastChild.parentNode.removeChild(this.$.lastChild)}}else{a.remove();continue}}break}if(CKEDITOR.env.needsBrFiller)(a=this.$.lastChild)&&(a.type==1&&a.nodeName.toLowerCase()=="br")&&a.parentNode.removeChild(a)},isReadOnly:function(){var a=this;this.type!=CKEDITOR.NODE_ELEMENT&&(a=this.getParent());if(a&&typeof a.$.isContentEditable!="undefined")return!(a.$.isContentEditable||
|
||||||
|
a.data("cke-editable"));for(;a;){if(a.data("cke-editable"))break;if(a.getAttribute("contentEditable")=="false")return true;if(a.getAttribute("contentEditable")=="true")break;a=a.getParent()}return!a}});CKEDITOR.dom.window=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.window.prototype=new CKEDITOR.dom.domObject;
|
||||||
|
CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype,{focus:function(){this.$.focus()},getViewPaneSize:function(){var a=this.$.document,e=a.compatMode=="CSS1Compat";return{width:(e?a.documentElement.clientWidth:a.body.clientWidth)||0,height:(e?a.documentElement.clientHeight:a.body.clientHeight)||0}},getScrollPosition:function(){var a=this.$;if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};a=a.document;return{x:a.documentElement.scrollLeft||a.body.scrollLeft||0,y:a.documentElement.scrollTop||
|
||||||
|
a.body.scrollTop||0}},getFrame:function(){var a=this.$.frameElement;return a?new CKEDITOR.dom.element.get(a):null}});CKEDITOR.dom.document=function(a){CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.document.prototype=new CKEDITOR.dom.domObject;
|
||||||
|
CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype,{type:CKEDITOR.NODE_DOCUMENT,appendStyleSheet:function(a){if(this.$.createStyleSheet)this.$.createStyleSheet(a);else{var e=new CKEDITOR.dom.element("link");e.setAttributes({rel:"stylesheet",type:"text/css",href:a});this.getHead().append(e)}},appendStyleText:function(a){if(this.$.createStyleSheet){var e=this.$.createStyleSheet("");e.cssText=a}else{var b=new CKEDITOR.dom.element("style",this);b.append(new CKEDITOR.dom.text(a,this));this.getHead().append(b)}return e||
|
||||||
|
b.$.sheet},createElement:function(a,e){var b=new CKEDITOR.dom.element(a,this);if(e){e.attributes&&b.setAttributes(e.attributes);e.styles&&b.setStyles(e.styles)}return b},createText:function(a){return new CKEDITOR.dom.text(a,this)},focus:function(){this.getWindow().focus()},getActive:function(){return new CKEDITOR.dom.element(this.$.activeElement)},getById:function(a){return(a=this.$.getElementById(a))?new CKEDITOR.dom.element(a):null},getByAddress:function(a,e){for(var b=this.$.documentElement,c=
|
||||||
|
0;b&&c<a.length;c++){var d=a[c];if(e)for(var f=-1,h=0;h<b.childNodes.length;h++){var n=b.childNodes[h];if(!(e===true&&n.nodeType==3&&n.previousSibling&&n.previousSibling.nodeType==3)){f++;if(f==d){b=n;break}}}else b=b.childNodes[d]}return b?new CKEDITOR.dom.node(b):null},getElementsByTag:function(a,e){if((!CKEDITOR.env.ie||document.documentMode>8)&&e)a=e+":"+a;return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))},getHead:function(){var a=this.$.getElementsByTagName("head")[0];return a=
|
||||||
|
a?new CKEDITOR.dom.element(a):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),true)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(a){this.$.open("text/html","replace");CKEDITOR.env.ie&&(a=a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,'$&\n<script data-cke-temp="1">('+CKEDITOR.tools.fixDomain+
|
||||||
|
")();<\/script>"));this.$.write(a);this.$.close()},find:function(a){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))},findOne:function(a){return(a=this.$.querySelector(a))?new CKEDITOR.dom.element(a):null},_getHtml5ShivFrag:function(){var a=this.getCustomData("html5ShivFrag");if(!a){a=this.$.createDocumentFragment();CKEDITOR.tools.enableHtml5Elements(a,true);this.setCustomData("html5ShivFrag",a)}return a}});CKEDITOR.dom.nodeList=function(a){this.$=a};
|
||||||
|
CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(a){if(a<0||a>=this.$.length)return null;return(a=this.$[a])?new CKEDITOR.dom.node(a):null}};CKEDITOR.dom.element=function(a,e){typeof a=="string"&&(a=(e?e.$:document).createElement(a));CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.element.get=function(a){return(a=typeof a=="string"?document.getElementById(a)||document.getElementsByName(a)[0]:a)&&(a.$?a:new CKEDITOR.dom.element(a))};
|
||||||
|
CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node;CKEDITOR.dom.element.createFromHtml=function(a,e){var b=new CKEDITOR.dom.element("div",e);b.setHtml(a);return b.getFirst().remove()};
|
||||||
|
CKEDITOR.dom.element.setMarker=function(a,e,b,c){var d=e.getCustomData("list_marker_id")||e.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),f=e.getCustomData("list_marker_names")||e.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");a[d]=e;f[b]=1;return e.setCustomData(b,c)};CKEDITOR.dom.element.clearAllMarkers=function(a){for(var e in a)CKEDITOR.dom.element.clearMarkers(a,a[e],1)};
|
||||||
|
CKEDITOR.dom.element.clearMarkers=function(a,e,b){var c=e.getCustomData("list_marker_names"),d=e.getCustomData("list_marker_id"),f;for(f in c)e.removeCustomData(f);e.removeCustomData("list_marker_names");if(b){e.removeCustomData("list_marker_id");delete a[d]}};
|
||||||
|
(function(){function a(a){var f=true;if(!a.$.id){a.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber();f=false}return function(){f||a.removeAttribute("id")}}function e(a,f){return"#"+a.$.id+" "+f.split(/,\s*/).join(", #"+a.$.id+" ")}function b(a){for(var f=0,b=0,e=c[a].length;b<e;b++)f=f+(parseInt(this.getComputedStyle(c[a][b])||0,10)||0);return f}CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:function(a){var f=this.$.className;f&&(RegExp("(?:^|\\s)"+a+"(?:\\s|$)",
|
||||||
|
"").test(f)||(f=f+(" "+a)));this.$.className=f||a;return this},removeClass:function(a){var f=this.getAttribute("class");if(f){a=RegExp("(?:^|\\s+)"+a+"(?=\\s|$)","i");if(a.test(f))(f=f.replace(a,"").replace(/^\s+/,""))?this.setAttribute("class",f):this.removeAttribute("class")}return this},hasClass:function(a){return RegExp("(?:^|\\s+)"+a+"(?=\\s|$)","").test(this.getAttribute("class"))},append:function(a,f){typeof a=="string"&&(a=this.getDocument().createElement(a));f?this.$.insertBefore(a.$,this.$.firstChild):
|
||||||
|
this.$.appendChild(a.$);return a},appendHtml:function(a){if(this.$.childNodes.length){var f=new CKEDITOR.dom.element("div",this.getDocument());f.setHtml(a);f.moveChildren(this)}else this.setHtml(a)},appendText:function(a){this.$.text!=void 0?this.$.text=this.$.text+a:this.append(new CKEDITOR.dom.text(a))},appendBogus:function(a){if(a||CKEDITOR.env.needsBrFiller){for(a=this.getLast();a&&a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(a.getText());)a=a.getPrevious();if(!a||!a.is||!a.is("br")){a=this.getDocument().createElement("br");
|
||||||
|
CKEDITOR.env.gecko&&a.setAttribute("type","_moz");this.append(a)}}},breakParent:function(a){var f=new CKEDITOR.dom.range(this.getDocument());f.setStartAfter(this);f.setEndAfter(a);a=f.extractContents();f.insertNode(this.remove());a.insertAfterNode(this)},contains:CKEDITOR.env.ie||CKEDITOR.env.webkit?function(a){var f=this.$;return a.type!=CKEDITOR.NODE_ELEMENT?f.contains(a.getParent().$):f!=a.$&&f.contains(a.$)}:function(a){return!!(this.$.compareDocumentPosition(a.$)&16)},focus:function(){function a(){try{this.$.focus()}catch(d){}}
|
||||||
|
return function(f){f?CKEDITOR.tools.setTimeout(a,100,this):a.call(this)}}(),getHtml:function(){var a=this.$.innerHTML;return CKEDITOR.env.ie?a.replace(/<\?[^>]*>/g,""):a},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var a=this.$.ownerDocument.createElement("div");a.appendChild(this.$.cloneNode(true));return a.innerHTML},getClientRect:function(){var a=CKEDITOR.tools.extend({},this.$.getBoundingClientRect());!a.width&&(a.width=a.right-a.left);!a.height&&
|
||||||
|
(a.height=a.bottom-a.top);return a},setHtml:CKEDITOR.env.ie&&CKEDITOR.env.version<9?function(a){try{var f=this.$;if(this.getParent())return f.innerHTML=a;var b=this.getDocument()._getHtml5ShivFrag();b.appendChild(f);f.innerHTML=a;b.removeChild(f);return a}catch(c){this.$.innerHTML="";f=new CKEDITOR.dom.element("body",this.getDocument());f.$.innerHTML=a;for(f=f.getChildren();f.count();)this.append(f.getItem(0));return a}}:function(a){return this.$.innerHTML=a},setText:function(a){CKEDITOR.dom.element.prototype.setText=
|
||||||
|
this.$.innerText!=void 0?function(a){return this.$.innerText=a}:function(a){return this.$.textContent=a};return this.setText(a)},getAttribute:function(){var a=function(a){return this.$.getAttribute(a,2)};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){switch(a){case "class":a="className";break;case "http-equiv":a="httpEquiv";break;case "name":return this.$.name;case "tabindex":a=this.$.getAttribute(a,2);a!==0&&this.$.tabIndex===0&&(a=null);return a;case "checked":a=
|
||||||
|
this.$.attributes.getNamedItem(a);return(a.specified?a.nodeValue:this.$.checked)?"checked":null;case "hspace":case "value":return this.$[a];case "style":return this.$.style.cssText;case "contenteditable":case "contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified?this.$.getAttribute("contentEditable"):null}return this.$.getAttribute(a,2)}:a}(),getChildren:function(){return new CKEDITOR.dom.nodeList(this.$.childNodes)},getComputedStyle:CKEDITOR.env.ie?function(a){return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)]}:
|
||||||
|
function(a){var f=this.getWindow().$.getComputedStyle(this.$,null);return f?f.getPropertyValue(a):""},getDtd:function(){var a=CKEDITOR.dtd[this.getName()];this.getDtd=function(){return a};return a},getElementsByTag:CKEDITOR.dom.document.prototype.getElementsByTag,getTabIndex:CKEDITOR.env.ie?function(){var a=this.$.tabIndex;a===0&&(!CKEDITOR.dtd.$tabIndex[this.getName()]&&parseInt(this.getAttribute("tabindex"),10)!==0)&&(a=-1);return a}:CKEDITOR.env.webkit?function(){var a=this.$.tabIndex;if(a==void 0){a=
|
||||||
|
parseInt(this.getAttribute("tabindex"),10);isNaN(a)&&(a=-1)}return a}:function(){return this.$.tabIndex},getText:function(){return this.$.textContent||this.$.innerText||""},getWindow:function(){return this.getDocument().getWindow()},getId:function(){return this.$.id||null},getNameAtt:function(){return this.$.name||null},getName:function(){var a=this.$.nodeName.toLowerCase();if(CKEDITOR.env.ie&&!(document.documentMode>8)){var f=this.$.scopeName;f!="HTML"&&(a=f.toLowerCase()+":"+a)}return(this.getName=
|
||||||
|
function(){return a})()},getValue:function(){return this.$.value},getFirst:function(a){var f=this.$.firstChild;(f=f&&new CKEDITOR.dom.node(f))&&(a&&!a(f))&&(f=f.getNext(a));return f},getLast:function(a){var f=this.$.lastChild;(f=f&&new CKEDITOR.dom.node(f))&&(a&&!a(f))&&(f=f.getPrevious(a));return f},getStyle:function(a){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]},is:function(){var a=this.getName();if(typeof arguments[0]=="object")return!!arguments[0][a];for(var f=0;f<arguments.length;f++)if(arguments[f]==
|
||||||
|
a)return true;return false},isEditable:function(a){var f=this.getName();if(this.isReadOnly()||this.getComputedStyle("display")=="none"||this.getComputedStyle("visibility")=="hidden"||CKEDITOR.dtd.$nonEditable[f]||CKEDITOR.dtd.$empty[f]||this.is("a")&&(this.data("cke-saved-name")||this.hasAttribute("name"))&&!this.getChildCount())return false;if(a!==false){a=CKEDITOR.dtd[f]||CKEDITOR.dtd.span;return!(!a||!a["#"])}return true},isIdentical:function(a){var f=this.clone(0,1),a=a.clone(0,1);f.removeAttributes(["_moz_dirty",
|
||||||
|
"data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);a.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]);if(f.$.isEqualNode){f.$.style.cssText=CKEDITOR.tools.normalizeCssText(f.$.style.cssText);a.$.style.cssText=CKEDITOR.tools.normalizeCssText(a.$.style.cssText);return f.$.isEqualNode(a.$)}f=f.getOuterHtml();a=a.getOuterHtml();if(CKEDITOR.env.ie&&CKEDITOR.env.version<9&&this.is("a")){var b=this.getParent();if(b.type==CKEDITOR.NODE_ELEMENT){b=
|
||||||
|
b.clone();b.setHtml(f);f=b.getHtml();b.setHtml(a);a=b.getHtml()}}return f==a},isVisible:function(){var a=(this.$.offsetHeight||this.$.offsetWidth)&&this.getComputedStyle("visibility")!="hidden",f,b;if(a&&CKEDITOR.env.webkit){f=this.getWindow();if(!f.equals(CKEDITOR.document.getWindow())&&(b=f.$.frameElement))a=(new CKEDITOR.dom.element(b)).isVisible()}return!!a},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return false;for(var a=this.getChildren(),f=0,b=a.count();f<
|
||||||
|
b;f++){var c=a.getItem(f);if(!(c.type==CKEDITOR.NODE_ELEMENT&&c.data("cke-bookmark"))&&(c.type==CKEDITOR.NODE_ELEMENT&&!c.isEmptyInlineRemoveable()||c.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(c.getText())))return false}return true},hasAttributes:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(){for(var a=this.$.attributes,f=0;f<a.length;f++){var b=a[f];switch(b.nodeName){case "class":if(this.getAttribute("class"))return true;case "data-cke-expando":continue;default:if(b.specified)return true}}return false}:
|
||||||
|
function(){var a=this.$.attributes,f=a.length,b={"data-cke-expando":1,_moz_dirty:1};return f>0&&(f>2||!b[a[0].nodeName]||f==2&&!b[a[1].nodeName])},hasAttribute:function(){function a(d){return(d=this.$.attributes.getNamedItem(d))?CKEDITOR.env.ie?d.specified:true:false}return CKEDITOR.env.ie&&CKEDITOR.env.version<8?function(f){return f=="name"?!!this.$.name:a.call(this,f)}:a}(),hide:function(){this.setStyle("display","none")},moveChildren:function(a,f){var b=this.$,a=a.$;if(b!=a){var c;if(f)for(;c=
|
||||||
|
b.lastChild;)a.insertBefore(b.removeChild(c),a.firstChild);else for(;c=b.firstChild;)a.appendChild(b.removeChild(c))}},mergeSiblings:function(){function a(d,b,c){if(b&&b.type==CKEDITOR.NODE_ELEMENT){for(var e=[];b.data("cke-bookmark")||b.isEmptyInlineRemoveable();){e.push(b);b=c?b.getNext():b.getPrevious();if(!b||b.type!=CKEDITOR.NODE_ELEMENT)return}if(d.isIdentical(b)){for(var k=c?d.getLast():d.getFirst();e.length;)e.shift().move(d,!c);b.moveChildren(d,!c);b.remove();k&&k.type==CKEDITOR.NODE_ELEMENT&&
|
||||||
|
k.mergeSiblings()}}}return function(f){if(f===false||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a")){a(this,this.getNext(),true);a(this,this.getPrevious())}}}(),show:function(){this.setStyles({display:"",visibility:""})},setAttribute:function(){var a=function(a,d){this.$.setAttribute(a,d);return this};return CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(f,b){f=="class"?this.$.className=b:f=="style"?this.$.style.cssText=b:f=="tabindex"?this.$.tabIndex=b:f=="checked"?
|
||||||
|
this.$.checked=b:f=="contenteditable"?a.call(this,"contentEditable",b):a.apply(this,arguments);return this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(b,c){if(b=="src"&&c.match(/^http:\/\//))try{a.apply(this,arguments)}catch(e){}else a.apply(this,arguments);return this}:a}(),setAttributes:function(a){for(var b in a)this.setAttribute(b,a[b]);return this},setValue:function(a){this.$.value=a;return this},removeAttribute:function(){var a=function(a){this.$.removeAttribute(a)};return CKEDITOR.env.ie&&
|
||||||
|
(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(a){a=="class"?a="className":a=="tabindex"?a="tabIndex":a=="contenteditable"&&(a="contentEditable");this.$.removeAttribute(a)}:a}(),removeAttributes:function(a){if(CKEDITOR.tools.isArray(a))for(var b=0;b<a.length;b++)this.removeAttribute(a[b]);else for(b in a)a.hasOwnProperty(b)&&this.removeAttribute(b)},removeStyle:function(a){var b=this.$.style;if(!b.removeProperty&&(a=="border"||a=="margin"||a=="padding")){var c=["top","left","right","bottom"],
|
||||||
|
e;a=="border"&&(e=["color","style","width"]);for(var b=[],i=0;i<c.length;i++)if(e)for(var k=0;k<e.length;k++)b.push([a,c[i],e[k]].join("-"));else b.push([a,c[i]].join("-"));for(a=0;a<b.length;a++)this.removeStyle(b[a])}else{b.removeProperty?b.removeProperty(a):b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a));this.$.style.cssText||this.removeAttribute("style")}},setStyle:function(a,b){this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]=b;return this},setStyles:function(a){for(var b in a)this.setStyle(b,
|
||||||
|
a[b]);return this},setOpacity:function(a){if(CKEDITOR.env.ie&&CKEDITOR.env.version<9){a=Math.round(a*100);this.setStyle("filter",a>=100?"":"progid:DXImageTransform.Microsoft.Alpha(opacity="+a+")")}else this.setStyle("opacity",a)},unselectable:function(){this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","none"));if(CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var a,b=this.getElementsByTag("*"),c=0,e=b.count();c<e;c++){a=b.getItem(c);a.setAttribute("unselectable","on")}}},getPositionedAncestor:function(){for(var a=
|
||||||
|
this;a.getName()!="html";){if(a.getComputedStyle("position")!="static")return a;a=a.getParent()}return null},getDocumentPosition:function(a){var b=0,c=0,e=this.getDocument(),i=e.getBody(),k=e.$.compatMode=="BackCompat";if(document.documentElement.getBoundingClientRect){var o=this.$.getBoundingClientRect(),s=e.$.documentElement,r=s.clientTop||i.$.clientTop||0,v=s.clientLeft||i.$.clientLeft||0,g=true;if(CKEDITOR.env.ie){g=e.getDocumentElement().contains(this);e=e.getBody().contains(this);g=k&&e||!k&&
|
||||||
|
g}if(g){b=o.left+(!k&&s.scrollLeft||i.$.scrollLeft);b=b-v;c=o.top+(!k&&s.scrollTop||i.$.scrollTop);c=c-r}}else{i=this;for(e=null;i&&!(i.getName()=="body"||i.getName()=="html");){b=b+(i.$.offsetLeft-i.$.scrollLeft);c=c+(i.$.offsetTop-i.$.scrollTop);if(!i.equals(this)){b=b+(i.$.clientLeft||0);c=c+(i.$.clientTop||0)}for(;e&&!e.equals(i);){b=b-e.$.scrollLeft;c=c-e.$.scrollTop;e=e.getParent()}e=i;i=(o=i.$.offsetParent)?new CKEDITOR.dom.element(o):null}}if(a){i=this.getWindow();e=a.getWindow();if(!i.equals(e)&&
|
||||||
|
i.$.frameElement){a=(new CKEDITOR.dom.element(i.$.frameElement)).getDocumentPosition(a);b=b+a.x;c=c+a.y}}if(!document.documentElement.getBoundingClientRect&&CKEDITOR.env.gecko&&!k){b=b+(this.$.clientLeft?1:0);c=c+(this.$.clientTop?1:0)}return{x:b,y:c}},scrollIntoView:function(a){var b=this.getParent();if(b){do{(b.$.clientWidth&&b.$.clientWidth<b.$.scrollWidth||b.$.clientHeight&&b.$.clientHeight<b.$.scrollHeight)&&!b.is("body")&&this.scrollIntoParent(b,a,1);if(b.is("html")){var c=b.getWindow();try{var e=
|
||||||
|
c.$.frameElement;e&&(b=new CKEDITOR.dom.element(e))}catch(i){}}}while(b=b.getParent())}},scrollIntoParent:function(a,b,c){var e,i,k,o;function s(b,g){if(/body|html/.test(a.getName()))a.getWindow().$.scrollBy(b,g);else{a.$.scrollLeft=a.$.scrollLeft+b;a.$.scrollTop=a.$.scrollTop+g}}function r(a,b){var d={x:0,y:0};if(!a.is(g?"body":"html")){var f=a.$.getBoundingClientRect();d.x=f.left;d.y=f.top}f=a.getWindow();if(!f.equals(b)){f=r(CKEDITOR.dom.element.get(f.$.frameElement),b);d.x=d.x+f.x;d.y=d.y+f.y}return d}
|
||||||
|
function v(a,b){return parseInt(a.getComputedStyle("margin-"+b)||0,10)||0}!a&&(a=this.getWindow());k=a.getDocument();var g=k.$.compatMode=="BackCompat";a instanceof CKEDITOR.dom.window&&(a=g?k.getBody():k.getDocumentElement());k=a.getWindow();i=r(this,k);var p=r(a,k),z=this.$.offsetHeight;e=this.$.offsetWidth;var A=a.$.clientHeight,l=a.$.clientWidth;k=i.x-v(this,"left")-p.x||0;o=i.y-v(this,"top")-p.y||0;e=i.x+e+v(this,"right")-(p.x+l)||0;i=i.y+z+v(this,"bottom")-(p.y+A)||0;if(o<0||i>0)s(0,b===true?
|
||||||
|
o:b===false?i:o<0?o:i);if(c&&(k<0||e>0))s(k<0?k:e,0)},setState:function(a,b,c){b=b||"cke";switch(a){case CKEDITOR.TRISTATE_ON:this.addClass(b+"_on");this.removeClass(b+"_off");this.removeClass(b+"_disabled");c&&this.setAttribute("aria-pressed",true);c&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(b+"_disabled");this.removeClass(b+"_off");this.removeClass(b+"_on");c&&this.setAttribute("aria-disabled",true);c&&this.removeAttribute("aria-pressed");break;default:this.addClass(b+
|
||||||
|
"_off");this.removeClass(b+"_on");this.removeClass(b+"_disabled");c&&this.removeAttribute("aria-pressed");c&&this.removeAttribute("aria-disabled")}},getFrameDocument:function(){var a=this.$;try{a.contentWindow.document}catch(b){a.src=a.src}return a&&new CKEDITOR.dom.document(a.contentWindow.document)},copyAttributes:function(a,b){for(var c=this.$.attributes,b=b||{},e=0;e<c.length;e++){var i=c[e],k=i.nodeName.toLowerCase(),o;if(!(k in b))if(k=="checked"&&(o=this.getAttribute(k)))a.setAttribute(k,o);
|
||||||
|
else if(!CKEDITOR.env.ie||this.hasAttribute(k)){o=this.getAttribute(k);if(o===null)o=i.nodeValue;a.setAttribute(k,o)}}if(this.$.style.cssText!=="")a.$.style.cssText=this.$.style.cssText},renameNode:function(a){if(this.getName()!=a){var b=this.getDocument(),a=new CKEDITOR.dom.element(a,b);this.copyAttributes(a);this.moveChildren(a);this.getParent()&&this.$.parentNode.replaceChild(a.$,this.$);a.$["data-cke-expando"]=this.$["data-cke-expando"];this.$=a.$;delete this.getName}},getChild:function(){function a(b,
|
||||||
|
d){var c=b.childNodes;if(d>=0&&d<c.length)return c[d]}return function(b){var c=this.$;if(b.slice)for(;b.length>0&&c;)c=a(c,b.shift());else c=a(c,b);return c?new CKEDITOR.dom.node(c):null}}(),getChildCount:function(){return this.$.childNodes.length},disableContextMenu:function(){this.on("contextmenu",function(a){a.data.getTarget().hasClass("cke_enable_context_menu")||a.data.preventDefault()})},getDirection:function(a){return a?this.getComputedStyle("direction")||this.getDirection()||this.getParent()&&
|
||||||
|
this.getParent().getDirection(1)||this.getDocument().$.dir||"ltr":this.getStyle("direction")||this.getAttribute("dir")},data:function(a,b){a="data-"+a;if(b===void 0)return this.getAttribute(a);b===false?this.removeAttribute(a):this.setAttribute(a,b);return null},getEditor:function(){var a=CKEDITOR.instances,b,c;for(b in a){c=a[b];if(c.element.equals(this)&&c.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO)return c}return null},find:function(b){var f=a(this),b=new CKEDITOR.dom.nodeList(this.$.querySelectorAll(e(this,
|
||||||
|
b)));f();return b},findOne:function(b){var f=a(this),b=this.$.querySelector(e(this,b));f();return b?new CKEDITOR.dom.element(b):null},forEach:function(a,b,c){if(!c&&(!b||this.type==b))var e=a(this);if(e!==false)for(var c=this.getChildren(),i=0;i<c.count();i++){e=c.getItem(i);e.type==CKEDITOR.NODE_ELEMENT?e.forEach(a,b):(!b||e.type==b)&&a(e)}}});var c={width:["border-left-width","border-right-width","padding-left","padding-right"],height:["border-top-width","border-bottom-width","padding-top","padding-bottom"]};
|
||||||
|
CKEDITOR.dom.element.prototype.setSize=function(a,c,e){if(typeof c=="number"){if(e&&(!CKEDITOR.env.ie||!CKEDITOR.env.quirks))c=c-b.call(this,a);this.setStyle(a,c+"px")}};CKEDITOR.dom.element.prototype.getSize=function(a,c){var e=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(a)],this.$["client"+CKEDITOR.tools.capitalize(a)])||0;c&&(e=e-b.call(this,a));return e}})();
|
||||||
|
CKEDITOR.dom.documentFragment=function(a){a=a||CKEDITOR.document;this.$=a.type==CKEDITOR.NODE_DOCUMENT?a.$.createDocumentFragment():a};
|
||||||
|
CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,insertAfterNode:function(a){a=a.$;a.parentNode.insertBefore(this.$,a.nextSibling)}},!0,{append:1,appendBogus:1,getFirst:1,getLast:1,getParent:1,getNext:1,getPrevious:1,appendTo:1,moveChildren:1,insertBefore:1,insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,getChildCount:1,getChild:1,getChildren:1});
|
||||||
|
(function(){function a(a,b){var c=this.range;if(this._.end)return null;if(!this._.start){this._.start=1;if(c.collapsed){this.end();return null}c.optimize()}var g,d=c.startContainer;g=c.endContainer;var f=c.startOffset,e=c.endOffset,o,j=this.guard,m=this.type,u=a?"getPreviousSourceNode":"getNextSourceNode";if(!a&&!this._.guardLTR){var h=g.type==CKEDITOR.NODE_ELEMENT?g:g.getParent(),q=g.type==CKEDITOR.NODE_ELEMENT?g.getChild(e):g.getNext();this._.guardLTR=function(a,b){return(!b||!h.equals(a))&&(!q||
|
||||||
|
!a.equals(q))&&(a.type!=CKEDITOR.NODE_ELEMENT||!b||!a.equals(c.root))}}if(a&&!this._.guardRTL){var i=d.type==CKEDITOR.NODE_ELEMENT?d:d.getParent(),k=d.type==CKEDITOR.NODE_ELEMENT?f?d.getChild(f-1):null:d.getPrevious();this._.guardRTL=function(a,b){return(!b||!i.equals(a))&&(!k||!a.equals(k))&&(a.type!=CKEDITOR.NODE_ELEMENT||!b||!a.equals(c.root))}}var n=a?this._.guardRTL:this._.guardLTR;o=j?function(a,b){return n(a,b)===false?false:j(a,b)}:n;if(this.current)g=this.current[u](false,m,o);else{if(a)g.type==
|
||||||
|
CKEDITOR.NODE_ELEMENT&&(g=e>0?g.getChild(e-1):o(g,true)===false?null:g.getPreviousSourceNode(true,m,o));else{g=d;if(g.type==CKEDITOR.NODE_ELEMENT&&!(g=g.getChild(f)))g=o(d,true)===false?null:d.getNextSourceNode(true,m,o)}g&&o(g)===false&&(g=null)}for(;g&&!this._.end;){this.current=g;if(!this.evaluator||this.evaluator(g)!==false){if(!b)return g}else if(b&&this.evaluator)return false;g=g[u](false,m,o)}this.end();return this.current=null}function e(b){for(var c,d=null;c=a.call(this,b);)d=c;return d}
|
||||||
|
function b(a){if(k(a))return false;if(a.type==CKEDITOR.NODE_TEXT)return true;if(a.type==CKEDITOR.NODE_ELEMENT){if(a.is(CKEDITOR.dtd.$inline)||a.is("hr")||a.getAttribute("contenteditable")=="false")return true;var b;if(b=!CKEDITOR.env.needsBrFiller)if(b=a.is(o))a:{b=0;for(var c=a.getChildCount();b<c;++b)if(!k(a.getChild(b))){b=false;break a}b=true}if(b)return true}return false}CKEDITOR.dom.walker=CKEDITOR.tools.createClass({$:function(a){this.range=a;this._={}},proto:{end:function(){this._.end=1},
|
||||||
|
next:function(){return a.call(this)},previous:function(){return a.call(this,1)},checkForward:function(){return a.call(this,0,1)!==false},checkBackward:function(){return a.call(this,1,1)!==false},lastForward:function(){return e.call(this)},lastBackward:function(){return e.call(this,1)},reset:function(){delete this.current;this._={}}}});var c={block:1,"list-item":1,table:1,"table-row-group":1,"table-header-group":1,"table-footer-group":1,"table-row":1,"table-column-group":1,"table-column":1,"table-cell":1,
|
||||||
|
"table-caption":1},d={absolute:1,fixed:1};CKEDITOR.dom.element.prototype.isBlockBoundary=function(a){return this.getComputedStyle("float")=="none"&&!(this.getComputedStyle("position")in d)&&c[this.getComputedStyle("display")]?true:!!(this.is(CKEDITOR.dtd.$block)||a&&this.is(a))};CKEDITOR.dom.walker.blockBoundary=function(a){return function(b){return!(b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary(a))}};CKEDITOR.dom.walker.listItemBoundary=function(){return this.blockBoundary({br:1})};CKEDITOR.dom.walker.bookmark=
|
||||||
|
function(a,b){function c(a){return a&&a.getName&&a.getName()=="span"&&a.data("cke-bookmark")}return function(g){var d,f;d=g&&g.type!=CKEDITOR.NODE_ELEMENT&&(f=g.getParent())&&c(f);d=a?d:d||c(g);return!!(b^d)}};CKEDITOR.dom.walker.whitespaces=function(a){return function(b){var c;b&&b.type==CKEDITOR.NODE_TEXT&&(c=!CKEDITOR.tools.trim(b.getText())||CKEDITOR.env.webkit&&b.getText()=="");return!!(a^c)}};CKEDITOR.dom.walker.invisible=function(a){var b=CKEDITOR.dom.walker.whitespaces();return function(c){if(b(c))c=
|
||||||
|
1;else{c.type==CKEDITOR.NODE_TEXT&&(c=c.getParent());c=!c.$.offsetHeight}return!!(a^c)}};CKEDITOR.dom.walker.nodeType=function(a,b){return function(c){return!!(b^c.type==a)}};CKEDITOR.dom.walker.bogus=function(a){function b(a){return!h(a)&&!n(a)}return function(c){var g=CKEDITOR.env.needsBrFiller?c.is&&c.is("br"):c.getText&&f.test(c.getText());if(g){g=c.getParent();c=c.getNext(b);g=g.isBlockBoundary()&&(!c||c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary())}return!!(a^g)}};CKEDITOR.dom.walker.temp=
|
||||||
|
function(a){return function(b){b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent());b=b&&b.hasAttribute("data-cke-temp");return!!(a^b)}};var f=/^[\t\r\n ]*(?: |\xa0)$/,h=CKEDITOR.dom.walker.whitespaces(),n=CKEDITOR.dom.walker.bookmark(),i=CKEDITOR.dom.walker.temp();CKEDITOR.dom.walker.ignored=function(a){return function(b){b=h(b)||n(b)||i(b);return!!(a^b)}};var k=CKEDITOR.dom.walker.ignored(),o=function(a){var b={},c;for(c in a)CKEDITOR.dtd[c]["#"]&&(b[c]=1);return b}(CKEDITOR.dtd.$block);CKEDITOR.dom.walker.editable=
|
||||||
|
function(a){return function(c){return!!(a^b(c))}};CKEDITOR.dom.element.prototype.getBogus=function(){var a=this;do a=a.getPreviousSourceNode();while(n(a)||h(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$inline)&&!a.is(CKEDITOR.dtd.$empty));return a&&(CKEDITOR.env.needsBrFiller?a.is&&a.is("br"):a.getText&&f.test(a.getText()))?a:false}})();
|
||||||
|
CKEDITOR.dom.range=function(a){this.endOffset=this.endContainer=this.startOffset=this.startContainer=null;this.collapsed=true;var e=a instanceof CKEDITOR.dom.document;this.document=e?a:a.getDocument();this.root=e?a.getBody():a};
|
||||||
|
(function(){function a(){var a=false,b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(true),d=CKEDITOR.dom.walker.bogus();return function(g){if(c(g)||b(g))return true;if(d(g)&&!a)return a=true;return g.type==CKEDITOR.NODE_TEXT&&(g.hasAscendant("pre")||CKEDITOR.tools.trim(g.getText()).length)||g.type==CKEDITOR.NODE_ELEMENT&&!g.is(f)?false:true}}function e(a){var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(1);return function(d){return c(d)||b(d)?true:!a&&h(d)||
|
||||||
|
d.type==CKEDITOR.NODE_ELEMENT&&d.is(CKEDITOR.dtd.$removeEmpty)}}function b(a){return function(){var b;return this[a?"getPreviousNode":"getNextNode"](function(a){!b&&k(a)&&(b=a);return i(a)&&!(h(a)&&a.equals(b))})}}var c=function(a){a.collapsed=a.startContainer&&a.endContainer&&a.startContainer.equals(a.endContainer)&&a.startOffset==a.endOffset},d=function(a,b,c,d){a.optimizeBookmark();var g=a.startContainer,f=a.endContainer,e=a.startOffset,h=a.endOffset,l,j;if(f.type==CKEDITOR.NODE_TEXT)f=f.split(h);
|
||||||
|
else if(f.getChildCount()>0)if(h>=f.getChildCount()){f=f.append(a.document.createText(""));j=true}else f=f.getChild(h);if(g.type==CKEDITOR.NODE_TEXT){g.split(e);g.equals(f)&&(f=g.getNext())}else if(e)if(e>=g.getChildCount()){g=g.append(a.document.createText(""));l=true}else g=g.getChild(e).getPrevious();else{g=g.append(a.document.createText(""),1);l=true}var e=g.getParents(),h=f.getParents(),m,u,i;for(m=0;m<e.length;m++){u=e[m];i=h[m];if(!u.equals(i))break}for(var q=c,k,H,n,C=m;C<e.length;C++){k=
|
||||||
|
e[C];q&&!k.equals(g)&&(H=q.append(k.clone()));for(k=k.getNext();k;){if(k.equals(h[C])||k.equals(f))break;n=k.getNext();if(b==2)q.append(k.clone(true));else{k.remove();b==1&&q.append(k)}k=n}q&&(q=H)}q=c;for(c=m;c<h.length;c++){k=h[c];b>0&&!k.equals(f)&&(H=q.append(k.clone()));if(!e[c]||k.$.parentNode!=e[c].$.parentNode)for(k=k.getPrevious();k;){if(k.equals(e[c])||k.equals(g))break;n=k.getPrevious();if(b==2)q.$.insertBefore(k.$.cloneNode(true),q.$.firstChild);else{k.remove();b==1&&q.$.insertBefore(k.$,
|
||||||
|
q.$.firstChild)}k=n}q&&(q=H)}if(b==2){u=a.startContainer;if(u.type==CKEDITOR.NODE_TEXT){u.$.data=u.$.data+u.$.nextSibling.data;u.$.parentNode.removeChild(u.$.nextSibling)}a=a.endContainer;if(a.type==CKEDITOR.NODE_TEXT&&a.$.nextSibling){a.$.data=a.$.data+a.$.nextSibling.data;a.$.parentNode.removeChild(a.$.nextSibling)}}else{if(u&&i&&(g.$.parentNode!=u.$.parentNode||f.$.parentNode!=i.$.parentNode)){b=i.getIndex();l&&i.$.parentNode==g.$.parentNode&&b--;if(d&&u.type==CKEDITOR.NODE_ELEMENT){d=CKEDITOR.dom.element.createFromHtml('<span data-cke-bookmark="1" style="display:none"> </span>',
|
||||||
|
a.document);d.insertAfter(u);u.mergeSiblings(false);a.moveToBookmark({startNode:d})}else a.setStart(i.getParent(),b)}a.collapse(true)}l&&g.remove();j&&f.$.parentNode&&f.remove()},f={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},h=CKEDITOR.dom.walker.bogus(),n=/^[\t\r\n ]*(?: |\xa0)$/,i=CKEDITOR.dom.walker.editable(),k=CKEDITOR.dom.walker.ignored(true);CKEDITOR.dom.range.prototype=
|
||||||
|
{clone:function(){var a=new CKEDITOR.dom.range(this.root);a.startContainer=this.startContainer;a.startOffset=this.startOffset;a.endContainer=this.endContainer;a.endOffset=this.endOffset;a.collapsed=this.collapsed;return a},collapse:function(a){if(a){this.endContainer=this.startContainer;this.endOffset=this.startOffset}else{this.startContainer=this.endContainer;this.startOffset=this.endOffset}this.collapsed=true},cloneContents:function(){var a=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||
|
||||||
|
d(this,2,a);return a},deleteContents:function(a){this.collapsed||d(this,0,null,a)},extractContents:function(a){var b=new CKEDITOR.dom.documentFragment(this.document);this.collapsed||d(this,1,b,a);return b},createBookmark:function(a){var b,c,d,g,f=this.collapsed;b=this.document.createElement("span");b.data("cke-bookmark",1);b.setStyle("display","none");b.setHtml(" ");if(a){d="cke_bm_"+CKEDITOR.tools.getNextNumber();b.setAttribute("id",d+(f?"C":"S"))}if(!f){c=b.clone();c.setHtml(" ");a&&c.setAttribute("id",
|
||||||
|
d+"E");g=this.clone();g.collapse();g.insertNode(c)}g=this.clone();g.collapse(true);g.insertNode(b);if(c){this.setStartAfter(b);this.setEndBefore(c)}else this.moveToPosition(b,CKEDITOR.POSITION_AFTER_END);return{startNode:a?d+(f?"C":"S"):b,endNode:a?d+"E":c,serializable:a,collapsed:f}},createBookmark2:function(){function a(b){var c=b.container,d=b.offset,g;g=c;var f=d;g=g.type!=CKEDITOR.NODE_ELEMENT||f===0||f==g.getChildCount()?0:g.getChild(f-1).type==CKEDITOR.NODE_TEXT&&g.getChild(f).type==CKEDITOR.NODE_TEXT;
|
||||||
|
if(g){c=c.getChild(d-1);d=c.getLength()}c.type==CKEDITOR.NODE_ELEMENT&&d>1&&(d=c.getChild(d-1).getIndex(true)+1);if(c.type==CKEDITOR.NODE_TEXT){g=c;for(f=0;(g=g.getPrevious())&&g.type==CKEDITOR.NODE_TEXT;)f=f+g.getLength();d=d+f}b.container=c;b.offset=d}return function(b){var c=this.collapsed,d={container:this.startContainer,offset:this.startOffset},g={container:this.endContainer,offset:this.endOffset};if(b){a(d);c||a(g)}return{start:d.container.getAddress(b),end:c?null:g.container.getAddress(b),
|
||||||
|
startOffset:d.offset,endOffset:g.offset,normalized:b,collapsed:c,is2:true}}}(),moveToBookmark:function(a){if(a.is2){var b=this.document.getByAddress(a.start,a.normalized),c=a.startOffset,d=a.end&&this.document.getByAddress(a.end,a.normalized),a=a.endOffset;this.setStart(b,c);d?this.setEnd(d,a):this.collapse(true)}else{b=(c=a.serializable)?this.document.getById(a.startNode):a.startNode;a=c?this.document.getById(a.endNode):a.endNode;this.setStartBefore(b);b.remove();if(a){this.setEndBefore(a);a.remove()}else this.collapse(true)}},
|
||||||
|
getBoundaryNodes:function(){var a=this.startContainer,b=this.endContainer,c=this.startOffset,d=this.endOffset,g;if(a.type==CKEDITOR.NODE_ELEMENT){g=a.getChildCount();if(g>c)a=a.getChild(c);else if(g<1)a=a.getPreviousSourceNode();else{for(a=a.$;a.lastChild;)a=a.lastChild;a=new CKEDITOR.dom.node(a);a=a.getNextSourceNode()||a}}if(b.type==CKEDITOR.NODE_ELEMENT){g=b.getChildCount();if(g>d)b=b.getChild(d).getPreviousSourceNode(true);else if(g<1)b=b.getPreviousSourceNode();else{for(b=b.$;b.lastChild;)b=
|
||||||
|
b.lastChild;b=new CKEDITOR.dom.node(b)}}a.getPosition(b)&CKEDITOR.POSITION_FOLLOWING&&(a=b);return{startNode:a,endNode:b}},getCommonAncestor:function(a,b){var c=this.startContainer,d=this.endContainer,c=c.equals(d)?a&&c.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?c.getChild(this.startOffset):c:c.getCommonAncestor(d);return b&&!c.is?c.getParent():c},optimize:function(){var a=this.startContainer,b=this.startOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setStartAfter(a):
|
||||||
|
this.setStartBefore(a));a=this.endContainer;b=this.endOffset;a.type!=CKEDITOR.NODE_ELEMENT&&(b?b>=a.getLength()&&this.setEndAfter(a):this.setEndBefore(a))},optimizeBookmark:function(){var a=this.startContainer,b=this.endContainer;a.is&&(a.is("span")&&a.data("cke-bookmark"))&&this.setStartAt(a,CKEDITOR.POSITION_BEFORE_START);b&&(b.is&&b.is("span")&&b.data("cke-bookmark"))&&this.setEndAt(b,CKEDITOR.POSITION_AFTER_END)},trim:function(a,b){var c=this.startContainer,d=this.startOffset,g=this.collapsed;
|
||||||
|
if((!a||g)&&c&&c.type==CKEDITOR.NODE_TEXT){if(d)if(d>=c.getLength()){d=c.getIndex()+1;c=c.getParent()}else{var f=c.split(d),d=c.getIndex()+1,c=c.getParent();if(this.startContainer.equals(this.endContainer))this.setEnd(f,this.endOffset-this.startOffset);else if(c.equals(this.endContainer))this.endOffset=this.endOffset+1}else{d=c.getIndex();c=c.getParent()}this.setStart(c,d);if(g){this.collapse(true);return}}c=this.endContainer;d=this.endOffset;if(!b&&!g&&c&&c.type==CKEDITOR.NODE_TEXT){if(d){d>=c.getLength()||
|
||||||
|
c.split(d);d=c.getIndex()+1}else d=c.getIndex();c=c.getParent();this.setEnd(c,d)}},enlarge:function(a,b){function c(a){return a&&a.type==CKEDITOR.NODE_ELEMENT&&a.hasAttribute("contenteditable")?null:a}var d=RegExp(/[^\s\ufeff]/);switch(a){case CKEDITOR.ENLARGE_INLINE:var g=1;case CKEDITOR.ENLARGE_ELEMENT:if(this.collapsed)break;var f=this.getCommonAncestor(),e=this.root,k,l,j,m,u,h=false,q,i;q=this.startContainer;var n=this.startOffset;if(q.type==CKEDITOR.NODE_TEXT){if(n){q=!CKEDITOR.tools.trim(q.substring(0,
|
||||||
|
n)).length&&q;h=!!q}if(q&&!(m=q.getPrevious()))j=q.getParent()}else{n&&(m=q.getChild(n-1)||q.getLast());m||(j=q)}for(j=c(j);j||m;){if(j&&!m){!u&&j.equals(f)&&(u=true);if(g?j.isBlockBoundary():!e.contains(j))break;if(!h||j.getComputedStyle("display")!="inline"){h=false;u?k=j:this.setStartBefore(j)}m=j.getPrevious()}for(;m;){q=false;if(m.type==CKEDITOR.NODE_COMMENT)m=m.getPrevious();else{if(m.type==CKEDITOR.NODE_TEXT){i=m.getText();d.test(i)&&(m=null);q=/[\s\ufeff]$/.test(i)}else if((m.$.offsetWidth>
|
||||||
|
0||b&&m.is("br"))&&!m.data("cke-bookmark"))if(h&&CKEDITOR.dtd.$removeEmpty[m.getName()]){i=m.getText();if(d.test(i))m=null;else for(var n=m.$.getElementsByTagName("*"),G=0,C;C=n[G++];)if(!CKEDITOR.dtd.$removeEmpty[C.nodeName.toLowerCase()]){m=null;break}m&&(q=!!i.length)}else m=null;q&&(h?u?k=j:j&&this.setStartBefore(j):h=true);if(m){q=m.getPrevious();if(!j&&!q){j=m;m=null;break}m=q}else j=null}}j&&(j=c(j.getParent()))}q=this.endContainer;n=this.endOffset;j=m=null;u=h=false;var J=function(a,b){var c=
|
||||||
|
new CKEDITOR.dom.range(e);c.setStart(a,b);c.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);var c=new CKEDITOR.dom.walker(c),g;for(c.guard=function(a){return!(a.type==CKEDITOR.NODE_ELEMENT&&a.isBlockBoundary())};g=c.next();){if(g.type!=CKEDITOR.NODE_TEXT)return false;i=g!=a?g.getText():g.substring(b);if(d.test(i))return false}return true};if(q.type==CKEDITOR.NODE_TEXT)if(CKEDITOR.tools.trim(q.substring(n)).length)h=true;else{h=!q.getLength();if(n==q.getLength()){if(!(m=q.getNext()))j=q.getParent()}else J(q,
|
||||||
|
n)&&(j=q.getParent())}else(m=q.getChild(n))||(j=q);for(;j||m;){if(j&&!m){!u&&j.equals(f)&&(u=true);if(g?j.isBlockBoundary():!e.contains(j))break;if(!h||j.getComputedStyle("display")!="inline"){h=false;u?l=j:j&&this.setEndAfter(j)}m=j.getNext()}for(;m;){q=false;if(m.type==CKEDITOR.NODE_TEXT){i=m.getText();J(m,0)||(m=null);q=/^[\s\ufeff]/.test(i)}else if(m.type==CKEDITOR.NODE_ELEMENT){if((m.$.offsetWidth>0||b&&m.is("br"))&&!m.data("cke-bookmark"))if(h&&CKEDITOR.dtd.$removeEmpty[m.getName()]){i=m.getText();
|
||||||
|
if(d.test(i))m=null;else{n=m.$.getElementsByTagName("*");for(G=0;C=n[G++];)if(!CKEDITOR.dtd.$removeEmpty[C.nodeName.toLowerCase()]){m=null;break}}m&&(q=!!i.length)}else m=null}else q=1;q&&h&&(u?l=j:this.setEndAfter(j));if(m){q=m.getNext();if(!j&&!q){j=m;m=null;break}m=q}else j=null}j&&(j=c(j.getParent()))}if(k&&l){f=k.contains(l)?l:k;this.setStartBefore(f);this.setEndAfter(f)}break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:j=new CKEDITOR.dom.range(this.root);e=
|
||||||
|
this.root;j.setStartAt(e,CKEDITOR.POSITION_AFTER_START);j.setEnd(this.startContainer,this.startOffset);j=new CKEDITOR.dom.walker(j);var F,t,x=CKEDITOR.dom.walker.blockBoundary(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),y=null,B=function(a){if(a.type==CKEDITOR.NODE_ELEMENT&&a.getAttribute("contenteditable")=="false")if(y){if(y.equals(a)){y=null;return}}else y=a;else if(y)return;var b=x(a);b||(F=a);return b},g=function(a){var b=B(a);!b&&(a.is&&a.is("br"))&&(t=a);return b};j.guard=B;j=j.lastBackward();
|
||||||
|
F=F||e;this.setStartAt(F,!F.is("br")&&(!j&&this.checkStartOfBlock()||j&&F.contains(j))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END);if(a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){j=this.clone();j=new CKEDITOR.dom.walker(j);var w=CKEDITOR.dom.walker.whitespaces(),N=CKEDITOR.dom.walker.bookmark();j.evaluator=function(a){return!w(a)&&!N(a)};if((j=j.previous())&&j.type==CKEDITOR.NODE_ELEMENT&&j.is("br"))break}j=this.clone();j.collapse();j.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);j=new CKEDITOR.dom.walker(j);
|
||||||
|
j.guard=a==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?g:B;F=y=t=null;j=j.lastForward();F=F||e;this.setEndAt(F,!j&&this.checkEndOfBlock()||j&&F.contains(j)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START);t&&this.setEndAfter(t)}},shrink:function(a,b,c){if(!this.collapsed){var a=a||CKEDITOR.SHRINK_TEXT,d=this.clone(),g=this.startContainer,f=this.endContainer,e=this.startOffset,h=this.endOffset,l=1,j=1;if(g&&g.type==CKEDITOR.NODE_TEXT)if(e)if(e>=g.getLength())d.setStartAfter(g);else{d.setStartBefore(g);
|
||||||
|
l=0}else d.setStartBefore(g);if(f&&f.type==CKEDITOR.NODE_TEXT)if(h)if(h>=f.getLength())d.setEndAfter(f);else{d.setEndAfter(f);j=0}else d.setEndBefore(f);var d=new CKEDITOR.dom.walker(d),m=CKEDITOR.dom.walker.bookmark();d.evaluator=function(b){return b.type==(a==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)};var u;d.guard=function(b,g){if(m(b))return true;if(a==CKEDITOR.SHRINK_ELEMENT&&b.type==CKEDITOR.NODE_TEXT||g&&b.equals(u)||c===false&&b.type==CKEDITOR.NODE_ELEMENT&&b.isBlockBoundary()||
|
||||||
|
b.type==CKEDITOR.NODE_ELEMENT&&b.hasAttribute("contenteditable"))return false;!g&&b.type==CKEDITOR.NODE_ELEMENT&&(u=b);return true};if(l)(g=d[a==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(g,b?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START);if(j){d.reset();(d=d[a==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(d,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END)}return!(!l&&!j)}},insertNode:function(a){this.optimizeBookmark();this.trim(false,
|
||||||
|
true);var b=this.startContainer,c=b.getChild(this.startOffset);c?a.insertBefore(c):b.append(a);a.getParent()&&a.getParent().equals(this.endContainer)&&this.endOffset++;this.setStartBefore(a)},moveToPosition:function(a,b){this.setStartAt(a,b);this.collapse(true)},moveToRange:function(a){this.setStart(a.startContainer,a.startOffset);this.setEnd(a.endContainer,a.endOffset)},selectNodeContents:function(a){this.setStart(a,0);this.setEnd(a,a.type==CKEDITOR.NODE_TEXT?a.getLength():a.getChildCount())},setStart:function(a,
|
||||||
|
b){if(a.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[a.getName()]){b=a.getIndex();a=a.getParent()}this.startContainer=a;this.startOffset=b;if(!this.endContainer){this.endContainer=a;this.endOffset=b}c(this)},setEnd:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[a.getName()]){b=a.getIndex()+1;a=a.getParent()}this.endContainer=a;this.endOffset=b;if(!this.startContainer){this.startContainer=a;this.startOffset=b}c(this)},setStartAfter:function(a){this.setStart(a.getParent(),a.getIndex()+
|
||||||
|
1)},setStartBefore:function(a){this.setStart(a.getParent(),a.getIndex())},setEndAfter:function(a){this.setEnd(a.getParent(),a.getIndex()+1)},setEndBefore:function(a){this.setEnd(a.getParent(),a.getIndex())},setStartAt:function(a,b){switch(b){case CKEDITOR.POSITION_AFTER_START:this.setStart(a,0);break;case CKEDITOR.POSITION_BEFORE_END:a.type==CKEDITOR.NODE_TEXT?this.setStart(a,a.getLength()):this.setStart(a,a.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(a);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(a)}c(this)},
|
||||||
|
setEndAt:function(a,b){switch(b){case CKEDITOR.POSITION_AFTER_START:this.setEnd(a,0);break;case CKEDITOR.POSITION_BEFORE_END:a.type==CKEDITOR.NODE_TEXT?this.setEnd(a,a.getLength()):this.setEnd(a,a.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(a);break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(a)}c(this)},fixBlock:function(a,b){var c=this.createBookmark(),d=this.document.createElement(b);this.collapse(a);this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);this.extractContents().appendTo(d);
|
||||||
|
d.trim();d.appendBogus();this.insertNode(d);this.moveToBookmark(c);return d},splitBlock:function(a){var b=new CKEDITOR.dom.elementPath(this.startContainer,this.root),c=new CKEDITOR.dom.elementPath(this.endContainer,this.root),d=b.block,g=c.block,f=null;if(!b.blockLimit.equals(c.blockLimit))return null;if(a!="br"){if(!d){d=this.fixBlock(true,a);g=(new CKEDITOR.dom.elementPath(this.endContainer,this.root)).block}g||(g=this.fixBlock(false,a))}a=d&&this.checkStartOfBlock();b=g&&this.checkEndOfBlock();
|
||||||
|
this.deleteContents();if(d&&d.equals(g))if(b){f=new CKEDITOR.dom.elementPath(this.startContainer,this.root);this.moveToPosition(g,CKEDITOR.POSITION_AFTER_END);g=null}else if(a){f=new CKEDITOR.dom.elementPath(this.startContainer,this.root);this.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START);d=null}else{g=this.splitElement(d);d.is("ul","ol")||d.appendBogus()}return{previousBlock:d,nextBlock:g,wasStartOfBlock:a,wasEndOfBlock:b,elementPath:f}},splitElement:function(a){if(!this.collapsed)return null;
|
||||||
|
this.setEndAt(a,CKEDITOR.POSITION_BEFORE_END);var b=this.extractContents(),c=a.clone(false);b.appendTo(c);c.insertAfter(a);this.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);return c},removeEmptyBlocksAtEnd:function(){function a(d){return function(a){return b(a)||(c(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.isEmptyInlineRemoveable())||d.is("table")&&a.is("caption")?false:true}}var b=CKEDITOR.dom.walker.whitespaces(),c=CKEDITOR.dom.walker.bookmark(false);return function(b){for(var c=this.createBookmark(),
|
||||||
|
d=this[b?"endPath":"startPath"](),f=d.block||d.blockLimit,e;f&&!f.equals(d.root)&&!f.getFirst(a(f));){e=f.getParent();this[b?"setEndAt":"setStartAt"](f,CKEDITOR.POSITION_AFTER_END);f.remove(1);f=e}this.moveToBookmark(c)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,this.root)},checkBoundaryOfElement:function(a,b){var c=b==CKEDITOR.START,d=this.clone();d.collapse(c);d[c?"setStartAt":
|
||||||
|
"setEndAt"](a,c?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END);d=new CKEDITOR.dom.walker(d);d.evaluator=e(c);return d[c?"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var b=this.startContainer,c=this.startOffset;if(CKEDITOR.env.ie&&c&&b.type==CKEDITOR.NODE_TEXT){b=CKEDITOR.tools.ltrim(b.substring(0,c));n.test(b)&&this.trim(0,1)}this.trim();b=new CKEDITOR.dom.elementPath(this.startContainer,this.root);c=this.clone();c.collapse(true);c.setStartAt(b.block||b.blockLimit,
|
||||||
|
CKEDITOR.POSITION_AFTER_START);b=new CKEDITOR.dom.walker(c);b.evaluator=a();return b.checkBackward()},checkEndOfBlock:function(){var b=this.endContainer,c=this.endOffset;if(CKEDITOR.env.ie&&b.type==CKEDITOR.NODE_TEXT){b=CKEDITOR.tools.rtrim(b.substring(c));n.test(b)&&this.trim(1,0)}this.trim();b=new CKEDITOR.dom.elementPath(this.endContainer,this.root);c=this.clone();c.collapse(false);c.setEndAt(b.block||b.blockLimit,CKEDITOR.POSITION_BEFORE_END);b=new CKEDITOR.dom.walker(c);b.evaluator=a();return b.checkForward()},
|
||||||
|
getPreviousNode:function(a,b,c){var d=this.clone();d.collapse(1);d.setStartAt(c||this.root,CKEDITOR.POSITION_AFTER_START);c=new CKEDITOR.dom.walker(d);c.evaluator=a;c.guard=b;return c.previous()},getNextNode:function(a,b,c){var d=this.clone();d.collapse();d.setEndAt(c||this.root,CKEDITOR.POSITION_BEFORE_END);c=new CKEDITOR.dom.walker(d);c.evaluator=a;c.guard=b;return c.next()},checkReadOnly:function(){function a(b,c){for(;b;){if(b.type==CKEDITOR.NODE_ELEMENT){if(b.getAttribute("contentEditable")==
|
||||||
|
"false"&&!b.data("cke-editable"))return 0;if(b.is("html")||b.getAttribute("contentEditable")=="true"&&(b.contains(c)||b.equals(c)))break}b=b.getParent()}return 1}return function(){var b=this.startContainer,c=this.endContainer;return!(a(b,c)&&a(c,b))}}(),moveToElementEditablePosition:function(a,b){if(a.type==CKEDITOR.NODE_ELEMENT&&!a.isEditable(false)){this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START);return true}for(var c=0;a;){if(a.type==CKEDITOR.NODE_TEXT){b&&this.endContainer&&
|
||||||
|
this.checkEndOfBlock()&&n.test(a.getText())?this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(a,b?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START);c=1;break}if(a.type==CKEDITOR.NODE_ELEMENT)if(a.isEditable()){this.moveToPosition(a,b?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START);c=1}else if(b&&a.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START);else if(a.getAttribute("contenteditable")=="false"&&
|
||||||
|
a.is(CKEDITOR.dtd.$block)){this.setStartBefore(a);this.setEndAfter(a);return true}var d=a,g=c,f=void 0;d.type==CKEDITOR.NODE_ELEMENT&&d.isEditable(false)&&(f=d[b?"getLast":"getFirst"](k));!g&&!f&&(f=d[b?"getPrevious":"getNext"](k));a=f}return!!c},moveToClosestEditablePosition:function(a,b){var c=new CKEDITOR.dom.range(this.root),d=0,g,f=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];c.moveToPosition(a,f[b?0:1]);if(a.is(CKEDITOR.dtd.$block)){if(g=c[b?"getNextEditableNode":"getPreviousEditableNode"]()){d=
|
||||||
|
1;if(g.type==CKEDITOR.NODE_ELEMENT&&g.is(CKEDITOR.dtd.$block)&&g.getAttribute("contenteditable")=="false"){c.setStartAt(g,CKEDITOR.POSITION_BEFORE_START);c.setEndAt(g,CKEDITOR.POSITION_AFTER_END)}else c.moveToPosition(g,f[b?1:0])}}else d=1;d&&this.moveToRange(c);return!!d},moveToElementEditStart:function(a){return this.moveToElementEditablePosition(a)},moveToElementEditEnd:function(a){return this.moveToElementEditablePosition(a,true)},getEnclosedNode:function(){var a=this.clone();a.optimize();if(a.startContainer.type!=
|
||||||
|
CKEDITOR.NODE_ELEMENT||a.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var a=new CKEDITOR.dom.walker(a),b=CKEDITOR.dom.walker.bookmark(false,true),c=CKEDITOR.dom.walker.whitespaces(true);a.evaluator=function(a){return c(a)&&b(a)};var d=a.next();a.reset();return d&&d.equals(a.previous())?d:null},getTouchedStartNode:function(){var a=this.startContainer;return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.startOffset)||a},getTouchedEndNode:function(){var a=this.endContainer;
|
||||||
|
return this.collapsed||a.type!=CKEDITOR.NODE_ELEMENT?a:a.getChild(this.endOffset-1)||a},getNextEditableNode:b(),getPreviousEditableNode:b(1),scrollIntoView:function(){var a=new CKEDITOR.dom.element.createFromHtml("<span> </span>",this.document),b,c,d,g=this.clone();g.optimize();if(d=g.startContainer.type==CKEDITOR.NODE_TEXT){c=g.startContainer.getText();b=g.startContainer.split(g.startOffset);a.insertAfter(g.startContainer)}else g.insertNode(a);a.scrollIntoView();if(d){g.startContainer.setText(c);
|
||||||
|
b.remove()}a.remove()}}})();CKEDITOR.POSITION_AFTER_START=1;CKEDITOR.POSITION_BEFORE_END=2;CKEDITOR.POSITION_BEFORE_START=3;CKEDITOR.POSITION_AFTER_END=4;CKEDITOR.ENLARGE_ELEMENT=1;CKEDITOR.ENLARGE_BLOCK_CONTENTS=2;CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS=3;CKEDITOR.ENLARGE_INLINE=4;CKEDITOR.START=1;CKEDITOR.END=2;CKEDITOR.SHRINK_ELEMENT=1;CKEDITOR.SHRINK_TEXT=2;"use strict";
|
||||||
|
(function(){function a(a){if(!(arguments.length<1)){this.range=a;this.forceBrBreak=0;this.enlargeBr=1;this.enforceRealBlocks=0;this._||(this._={})}}function e(a,b,c){for(a=a.getNextSourceNode(b,null,c);!f(a);)a=a.getNextSourceNode(b,null,c);return a}function b(a){var b=[];a.forEach(function(a){if(a.getAttribute("contenteditable")=="true"){b.push(a);return false}},CKEDITOR.NODE_ELEMENT,true);return b}function c(a,d,f,e){a:{e==void 0&&(e=b(f));for(var h;h=e.shift();)if(h.getDtd().p){e={element:h,remaining:e};
|
||||||
|
break a}e=null}if(!e)return 0;if((h=CKEDITOR.filter.instances[e.element.data("cke-filter")])&&!h.check(d))return c(a,d,f,e.remaining);d=new CKEDITOR.dom.range(e.element);d.selectNodeContents(e.element);d=d.createIterator();d.enlargeBr=a.enlargeBr;d.enforceRealBlocks=a.enforceRealBlocks;d.activeFilter=d.filter=h;a._.nestedEditable={element:e.element,container:f,remaining:e.remaining,iterator:d};return 1}var d=/^[\r\n\t ]+$/,f=CKEDITOR.dom.walker.bookmark(false,true),h=CKEDITOR.dom.walker.whitespaces(true),
|
||||||
|
n=function(a){return f(a)&&h(a)};a.prototype={getNextParagraph:function(a){var b,h,s,r,v,a=a||"p";if(this._.nestedEditable){if(b=this._.nestedEditable.iterator.getNextParagraph(a)){this.activeFilter=this._.nestedEditable.iterator.activeFilter;return b}this.activeFilter=this.filter;if(c(this,a,this._.nestedEditable.container,this._.nestedEditable.remaining)){this.activeFilter=this._.nestedEditable.iterator.activeFilter;return this._.nestedEditable.iterator.getNextParagraph(a)}this._.nestedEditable=
|
||||||
|
null}if(!this.range.root.getDtd()[a])return null;if(!this._.started){var g=this.range.clone();g.shrink(CKEDITOR.SHRINK_ELEMENT,true);h=g.endContainer.hasAscendant("pre",true)||g.startContainer.hasAscendant("pre",true);g.enlarge(this.forceBrBreak&&!h||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS);if(!g.collapsed){h=new CKEDITOR.dom.walker(g.clone());var p=CKEDITOR.dom.walker.bookmark(true,true);h.evaluator=p;this._.nextNode=h.next();h=new CKEDITOR.dom.walker(g.clone());
|
||||||
|
h.evaluator=p;h=h.previous();this._.lastNode=h.getNextSourceNode(true);if(this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()){p=this.range.clone();p.moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END);if(p.checkEndOfBlock()){p=new CKEDITOR.dom.elementPath(p.endContainer,p.root);this._.lastNode=(p.block||p.blockLimit).getNextSourceNode(true)}}if(!this._.lastNode||!g.root.contains(this._.lastNode)){this._.lastNode=
|
||||||
|
this._.docEndMarker=g.document.createText("");this._.lastNode.insertAfter(h)}g=null}this._.started=1;h=g}p=this._.nextNode;g=this._.lastNode;for(this._.nextNode=null;p;){var z=0,A=p.hasAscendant("pre"),l=p.type!=CKEDITOR.NODE_ELEMENT,j=0;if(l)p.type==CKEDITOR.NODE_TEXT&&d.test(p.getText())&&(l=0);else{var m=p.getName();if(CKEDITOR.dtd.$block[m]&&p.getAttribute("contenteditable")=="false"){b=p;c(this,a,b);break}else if(p.isBlockBoundary(this.forceBrBreak&&!A&&{br:1})){if(m=="br")l=1;else if(!h&&!p.getChildCount()&&
|
||||||
|
m!="hr"){b=p;s=p.equals(g);break}if(h){h.setEndAt(p,CKEDITOR.POSITION_BEFORE_START);if(m!="br")this._.nextNode=p}z=1}else{if(p.getFirst()){if(!h){h=this.range.clone();h.setStartAt(p,CKEDITOR.POSITION_BEFORE_START)}p=p.getFirst();continue}l=1}}if(l&&!h){h=this.range.clone();h.setStartAt(p,CKEDITOR.POSITION_BEFORE_START)}s=(!z||l)&&p.equals(g);if(h&&!z)for(;!p.getNext(n)&&!s;){m=p.getParent();if(m.isBlockBoundary(this.forceBrBreak&&!A&&{br:1})){z=1;l=0;s||m.equals(g);h.setEndAt(m,CKEDITOR.POSITION_BEFORE_END);
|
||||||
|
break}p=m;l=1;s=p.equals(g);j=1}l&&h.setEndAt(p,CKEDITOR.POSITION_AFTER_END);p=e(p,j,g);if((s=!p)||z&&h)break}if(!b){if(!h){this._.docEndMarker&&this._.docEndMarker.remove();return this._.nextNode=null}b=new CKEDITOR.dom.elementPath(h.startContainer,h.root);p=b.blockLimit;z={div:1,th:1,td:1};b=b.block;if(!b&&p&&!this.enforceRealBlocks&&z[p.getName()]&&h.checkStartOfBlock()&&h.checkEndOfBlock()&&!p.equals(h.root))b=p;else if(!b||this.enforceRealBlocks&&b.getName()=="li"){b=this.range.document.createElement(a);
|
||||||
|
h.extractContents().appendTo(b);b.trim();h.insertNode(b);r=v=true}else if(b.getName()!="li"){if(!h.checkStartOfBlock()||!h.checkEndOfBlock()){b=b.clone(false);h.extractContents().appendTo(b);b.trim();v=h.splitBlock();r=!v.wasStartOfBlock;v=!v.wasEndOfBlock;h.insertNode(b)}}else if(!s)this._.nextNode=b.equals(g)?null:e(h.getBoundaryNodes().endNode,1,g)}if(r)(r=b.getPrevious())&&r.type==CKEDITOR.NODE_ELEMENT&&(r.getName()=="br"?r.remove():r.getLast()&&r.getLast().$.nodeName.toLowerCase()=="br"&&r.getLast().remove());
|
||||||
|
if(v)(r=b.getLast())&&r.type==CKEDITOR.NODE_ELEMENT&&r.getName()=="br"&&(!CKEDITOR.env.needsBrFiller||r.getPrevious(f)||r.getNext(f))&&r.remove();if(!this._.nextNode)this._.nextNode=s||b.equals(g)||!g?null:e(b,1,g);return b}};CKEDITOR.dom.range.prototype.createIterator=function(){return new a(this)}})();
|
||||||
|
CKEDITOR.command=function(a,e){this.uiItems=[];this.exec=function(b){if(this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed())return false;this.editorFocus&&a.focus();return this.fire("exec")===false?true:e.exec.call(this,a,b)!==false};this.refresh=function(a,b){if(!this.readOnly&&a.readOnly)return true;if(this.context&&!b.isContextFor(this.context)){this.disable();return true}if(!this.checkAllowed(true)){this.disable();return true}this.startDisabled||this.enable();this.modes&&!this.modes[a.mode]&&
|
||||||
|
this.disable();return this.fire("refresh",{editor:a,path:b})===false?true:e.refresh&&e.refresh.apply(this,arguments)!==false};var b;this.checkAllowed=function(c){return!c&&typeof b=="boolean"?b:b=a.activeFilter.checkFeature(this)};CKEDITOR.tools.extend(this,e,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!e.context,state:CKEDITOR.TRISTATE_DISABLED});CKEDITOR.event.call(this)};
|
||||||
|
CKEDITOR.command.prototype={enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(!this.preserveState||typeof this.previousState=="undefined"?CKEDITOR.TRISTATE_OFF:this.previousState)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(a){if(this.state==a||a!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())return false;this.previousState=this.state;this.state=a;this.fire("state");return true},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?
|
||||||
|
this.setState(CKEDITOR.TRISTATE_ON):this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.event.implementOn(CKEDITOR.command.prototype);CKEDITOR.ENTER_P=1;CKEDITOR.ENTER_BR=2;CKEDITOR.ENTER_DIV=3;
|
||||||
|
CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"<!DOCTYPE html>",bodyId:"",bodyClass:"",fullPage:!1,height:200,extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:1E4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]};
|
||||||
|
(function(){function a(a,b,c,d,g){var f,e,a=[];for(f in b){e=b[f];e=typeof e=="boolean"?{}:typeof e=="function"?{match:e}:J(e);if(f.charAt(0)!="$")e.elements=f;if(c)e.featureName=c.toLowerCase();var j=e;j.elements=h(j.elements,/\s+/)||null;j.propertiesOnly=j.propertiesOnly||j.elements===true;var l=/\s*,\s*/,p=void 0;for(p in y){j[p]=h(j[p],l)||null;var m=j,q=B[p],w=h(j[B[p]],l),u=j[p],t=[],i=true,k=void 0;w?i=false:w={};for(k in u)if(k.charAt(0)=="!"){k=k.slice(1);t.push(k);w[k]=true;i=false}for(;k=
|
||||||
|
t.pop();){u[k]=u["!"+k];delete u["!"+k]}m[q]=(i?false:w)||null}j.match=j.match||null;d.push(e);a.push(e)}for(var b=g.elements,g=g.generic,z,c=0,d=a.length;c<d;++c){f=J(a[c]);e=f.classes===true||f.styles===true||f.attributes===true;j=f;p=q=l=void 0;for(l in y)j[l]=A(j[l]);m=true;for(p in B){l=B[p];q=j[l];w=[];u=void 0;for(u in q)u.indexOf("*")>-1?w.push(RegExp("^"+u.replace(/\*/g,".*")+"$")):w.push(u);q=w;if(q.length){j[l]=q;m=false}}j.nothingRequired=m;j.noProperties=!(j.attributes||j.classes||j.styles);
|
||||||
|
if(f.elements===true||f.elements===null)g[e?"unshift":"push"](f);else{j=f.elements;delete f.elements;for(z in j)if(b[z])b[z][e?"unshift":"push"](f);else b[z]=[f]}}}function e(a,c,d,g){if(!a.match||a.match(c))if(g||n(a,c)){if(!a.propertiesOnly)d.valid=true;if(!d.allAttributes)d.allAttributes=b(a.attributes,c.attributes,d.validAttributes);if(!d.allStyles)d.allStyles=b(a.styles,c.styles,d.validStyles);if(!d.allClasses){a=a.classes;c=c.classes;g=d.validClasses;if(a)if(a===true)a=true;else{for(var f=0,
|
||||||
|
e=c.length,j;f<e;++f){j=c[f];g[j]||(g[j]=a(j))}a=false}else a=false;d.allClasses=a}}}function b(a,b,c){if(!a)return false;if(a===true)return true;for(var d in b)c[d]||(c[d]=a(d));return false}function c(a,b,c){if(!a.match||a.match(b)){if(a.noProperties)return false;c.hadInvalidAttribute=d(a.attributes,b.attributes)||c.hadInvalidAttribute;c.hadInvalidStyle=d(a.styles,b.styles)||c.hadInvalidStyle;a=a.classes;b=b.classes;if(a){for(var g=false,f=a===true,e=b.length;e--;)if(f||a(b[e])){b.splice(e,1);g=
|
||||||
|
true}a=g}else a=false;c.hadInvalidClass=a||c.hadInvalidClass}}function d(a,b){if(!a)return false;var c=false,d=a===true,g;for(g in b)if(d||a(g)){delete b[g];c=true}return c}function f(a,b,c){if(a.disabled||a.customConfig&&!c||!b)return false;a._.cachedChecks={};return true}function h(a,b){if(!a)return false;if(a===true)return a;if(typeof a=="string"){a=F(a);return a=="*"?true:CKEDITOR.tools.convertArrayToObject(a.split(b))}if(CKEDITOR.tools.isArray(a))return a.length?CKEDITOR.tools.convertArrayToObject(a):
|
||||||
|
false;var c={},d=0,g;for(g in a){c[g]=a[g];d++}return d?c:false}function n(a,b){if(a.nothingRequired)return true;var c,d,g,f;if(g=a.requiredClasses){f=b.classes;for(c=0;c<g.length;++c){d=g[c];if(typeof d=="string"){if(CKEDITOR.tools.indexOf(f,d)==-1)return false}else if(!CKEDITOR.tools.checkIfAnyArrayItemMatches(f,d))return false}}return i(b.styles,a.requiredStyles)&&i(b.attributes,a.requiredAttributes)}function i(a,b){if(!b)return true;for(var c=0,d;c<b.length;++c){d=b[c];if(typeof d=="string"){if(!(d in
|
||||||
|
a))return false}else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a,d))return false}return true}function k(a){if(!a)return{};for(var a=a.split(/\s*,\s*/).sort(),b={};a.length;)b[a.shift()]=t;return b}function o(a){for(var b,c,d,g,f={},e=1,a=F(a);b=a.match(w);){if(c=b[2]){d=s(c,"styles");g=s(c,"attrs");c=s(c,"classes")}else d=g=c=null;f["$"+e++]={elements:b[1],classes:c,styles:d,attributes:g};a=a.slice(b[0].length)}return f}function s(a,b){var c=a.match(N[b]);return c?F(c[1]):null}function r(a){var b=
|
||||||
|
a.styleBackup=a.attributes.style,c=a.classBackup=a.attributes["class"];if(!a.styles)a.styles=CKEDITOR.tools.parseCssText(b||"",1);if(!a.classes)a.classes=c?c.split(/\s+/):[]}function v(a,b,d,g){var f=0,j;if(g.toHtml)b.name=b.name.replace(M,"$1");if(g.doCallbacks&&a.elementCallbacks){a:for(var l=a.elementCallbacks,m=0,h=l.length,q;m<h;++m)if(q=l[m](b)){j=q;break a}if(j)return j}if(g.doTransform)if(j=a._.transformations[b.name]){r(b);for(l=0;l<j.length;++l)u(a,b,j[l]);p(b)}if(g.doFilter){a:{l=b.name;
|
||||||
|
m=a._;a=m.allowedRules.elements[l];j=m.allowedRules.generic;l=m.disallowedRules.elements[l];m=m.disallowedRules.generic;h=g.skipRequired;q={valid:false,validAttributes:{},validClasses:{},validStyles:{},allAttributes:false,allClasses:false,allStyles:false,hadInvalidAttribute:false,hadInvalidClass:false,hadInvalidStyle:false};var w,t;if(!a&&!j)a=null;else{r(b);if(l){w=0;for(t=l.length;w<t;++w)if(c(l[w],b,q)===false){a=null;break a}}if(m){w=0;for(t=m.length;w<t;++w)c(m[w],b,q)}if(a){w=0;for(t=a.length;w<
|
||||||
|
t;++w)e(a[w],b,q,h)}if(j){w=0;for(t=j.length;w<t;++w)e(j[w],b,q,h)}a=q}}if(!a){d.push(b);return C}if(!a.valid){d.push(b);return C}t=a.validAttributes;var i=a.validStyles;j=a.validClasses;var l=b.attributes,k=b.styles,m=b.classes,h=b.classBackup,B=b.styleBackup,y,x,N=[];q=[];var n=/^data-cke-/;w=false;delete l.style;delete l["class"];delete b.classBackup;delete b.styleBackup;if(!a.allAttributes)for(y in l)if(!t[y])if(n.test(y)){if(y!=(x=y.replace(/^data-cke-saved-/,""))&&!t[x]){delete l[y];w=true}}else{delete l[y];
|
||||||
|
w=true}if(!a.allStyles||a.hadInvalidStyle){for(y in k)a.allStyles||i[y]?N.push(y+":"+k[y]):w=true;if(N.length)l.style=N.sort().join("; ")}else if(B)l.style=B;if(!a.allClasses||a.hadInvalidClass){for(y=0;y<m.length;++y)(a.allClasses||j[m[y]])&&q.push(m[y]);q.length&&(l["class"]=q.sort().join(" "));h&&q.length<h.split(/\s+/).length&&(w=true)}else h&&(l["class"]=h);w&&(f=C);if(!g.skipFinalValidation&&!z(b)){d.push(b);return C}}if(g.toHtml)b.name=b.name.replace(D,"cke:$1");return f}function g(a){var b=
|
||||||
|
[],c;for(c in a)c.indexOf("*")>-1&&b.push(c.replace(/\*/g,".*"));return b.length?RegExp("^(?:"+b.join("|")+")$"):null}function p(a){var b=a.attributes,c;delete b.style;delete b["class"];if(c=CKEDITOR.tools.writeCssText(a.styles,true))b.style=c;a.classes.length&&(b["class"]=a.classes.sort().join(" "))}function z(a){switch(a.name){case "a":if(!a.children.length&&!a.attributes.name)return false;break;case "img":if(!a.attributes.src)return false}return true}function A(a){if(!a)return false;if(a===true)return true;
|
||||||
|
var b=g(a);return function(c){return c in a||b&&c.match(b)}}function l(){return new CKEDITOR.htmlParser.element("br")}function j(a){return a.type==CKEDITOR.NODE_ELEMENT&&(a.name=="br"||G.$block[a.name])}function m(a,b,c){var d=a.name;if(G.$empty[d]||!a.children.length)if(d=="hr"&&b=="br")a.replaceWith(l());else{a.parent&&c.push({check:"it",el:a.parent});a.remove()}else if(G.$block[d]||d=="tr")if(b=="br"){if(a.previous&&!j(a.previous)){b=l();b.insertBefore(a)}if(a.next&&!j(a.next)){b=l();b.insertAfter(a)}a.replaceWithChildren()}else{var d=
|
||||||
|
a.children,g;b:{g=G[b];for(var f=0,e=d.length,m;f<e;++f){m=d[f];if(m.type==CKEDITOR.NODE_ELEMENT&&!g[m.name]){g=false;break b}}g=true}if(g){a.name=b;a.attributes={};c.push({check:"parent-down",el:a})}else{g=a.parent;for(var f=g.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||g.name=="body",p,e=d.length;e>0;){m=d[--e];if(f&&(m.type==CKEDITOR.NODE_TEXT||m.type==CKEDITOR.NODE_ELEMENT&&G.$inline[m.name])){if(!p){p=new CKEDITOR.htmlParser.element(b);p.insertAfter(a);c.push({check:"parent-down",el:p})}p.add(m,0)}else{p=
|
||||||
|
null;m.insertAfter(a);g.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(m.type==CKEDITOR.NODE_ELEMENT&&!G[g.name][m.name])&&c.push({check:"el-up",el:m})}}a.remove()}}else if(d=="style")a.remove();else{a.parent&&c.push({check:"it",el:a.parent});a.replaceWithChildren()}}function u(a,b,c){var d,g;for(d=0;d<c.length;++d){g=c[d];if((!g.check||a.check(g.check,false))&&(!g.left||g.left(b))){g.right(b,ba);break}}}function P(a,b){var c=b.getDefinition(),d=c.attributes,g=c.styles,f,e,j,l;if(a.name!=c.element)return false;
|
||||||
|
for(f in d)if(f=="class"){c=d[f].split(/\s+/);for(j=a.classes.join("|");l=c.pop();)if(j.indexOf(l)==-1)return false}else if(a.attributes[f]!=d[f])return false;for(e in g)if(a.styles[e]!=g[e])return false;return true}function q(a,b){var c,d;if(typeof a=="string")c=a;else if(a instanceof CKEDITOR.style)d=a;else{c=a[0];d=a[1]}return[{element:c,left:d,right:function(a,c){c.transform(a,b)}}]}function L(a){return function(b){return P(b,a)}}function H(a){return function(b,c){c[a](b)}}var G=CKEDITOR.dtd,
|
||||||
|
C=1,J=CKEDITOR.tools.copy,F=CKEDITOR.tools.trim,t="cke-test",x=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2;CKEDITOR.filter=function(a){this.allowedContent=[];this.disallowedContent=[];this.elementCallbacks=null;this.disabled=false;this.editor=null;this.id=CKEDITOR.tools.getNextNumber();this._={allowedRules:{elements:{},generic:[]},disallowedRules:{elements:{},generic:[]},transformations:{},cachedTests:{}};CKEDITOR.filter.instances[this.id]=this;if(a instanceof CKEDITOR.editor){a=this.editor=a;
|
||||||
|
this.customConfig=true;var b=a.config.allowedContent;if(b===true)this.disabled=true;else{if(!b)this.customConfig=false;this.allow(b,"config",1);this.allow(a.config.extraAllowedContent,"extra",1);this.allow(x[a.enterMode]+" "+x[a.shiftEnterMode],"default",1);this.disallow(a.config.disallowedContent)}}else{this.customConfig=false;this.allow(a,"default",1)}};CKEDITOR.filter.instances={};CKEDITOR.filter.prototype={allow:function(b,c,d){if(!f(this,b,d))return false;var g,e;if(typeof b=="string")b=o(b);
|
||||||
|
else if(b instanceof CKEDITOR.style){if(b.toAllowedContentRules)return this.allow(b.toAllowedContentRules(this.editor),c,d);g=b.getDefinition();b={};d=g.attributes;b[g.element]=g={styles:g.styles,requiredStyles:g.styles&&CKEDITOR.tools.objectKeys(g.styles)};if(d){d=J(d);g.classes=d["class"]?d["class"].split(/\s+/):null;g.requiredClasses=g.classes;delete d["class"];g.attributes=d;g.requiredAttributes=d&&CKEDITOR.tools.objectKeys(d)}}else if(CKEDITOR.tools.isArray(b)){for(g=0;g<b.length;++g)e=this.allow(b[g],
|
||||||
|
c,d);return e}a(this,b,c,this.allowedContent,this._.allowedRules);return true},applyTo:function(a,b,c,d){if(this.disabled)return false;var g=this,f=[],e=this.editor&&this.editor.config.protectedSource,j,l=false,p={doFilter:!c,doTransform:true,doCallbacks:true,toHtml:b};a.forEach(function(a){if(a.type==CKEDITOR.NODE_ELEMENT){if(a.attributes["data-cke-filter"]=="off")return false;if(!b||!(a.name=="span"&&~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-"))){j=v(g,a,f,p);if(j&C)l=
|
||||||
|
true;else if(j&2)return false}}else if(a.type==CKEDITOR.NODE_COMMENT&&a.value.match(/^\{cke_protected\}(?!\{C\})/)){var c;a:{var d=decodeURIComponent(a.value.replace(/^\{cke_protected\}/,""));c=[];var m,q,w;if(e)for(q=0;q<e.length;++q)if((w=d.match(e[q]))&&w[0].length==d.length){c=true;break a}d=CKEDITOR.htmlParser.fragment.fromHtml(d);d.children.length==1&&(m=d.children[0]).type==CKEDITOR.NODE_ELEMENT&&v(g,m,c,p);c=!c.length}c||f.push(a)}},null,true);f.length&&(l=true);for(var q,a=[],d=x[d||(this.editor?
|
||||||
|
this.editor.enterMode:CKEDITOR.ENTER_P)];c=f.pop();)c.type==CKEDITOR.NODE_ELEMENT?m(c,d,a):c.remove();for(;q=a.pop();){c=q.el;if(c.parent)switch(q.check){case "it":G.$removeEmpty[c.name]&&!c.children.length?m(c,d,a):z(c)||m(c,d,a);break;case "el-up":c.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!G[c.parent.name][c.name]&&m(c,d,a);break;case "parent-down":c.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT&&!G[c.parent.name][c.name]&&m(c.parent,d,a)}}return l},checkFeature:function(a){if(this.disabled||
|
||||||
|
!a)return true;a.toFeature&&(a=a.toFeature(this.editor));return!a.requiredContent||this.check(a.requiredContent)},disable:function(){this.disabled=true},disallow:function(b){if(!f(this,b,true))return false;typeof b=="string"&&(b=o(b));a(this,b,null,this.disallowedContent,this._.disallowedRules);return true},addContentForms:function(a){if(!this.disabled&&a){var b,c,d=[],g;for(b=0;b<a.length&&!g;++b){c=a[b];if((typeof c=="string"||c instanceof CKEDITOR.style)&&this.check(c))g=c}if(g){for(b=0;b<a.length;++b)d.push(q(a[b],
|
||||||
|
g));this.addTransformations(d)}}},addElementCallback:function(a){if(!this.elementCallbacks)this.elementCallbacks=[];this.elementCallbacks.push(a)},addFeature:function(a){if(this.disabled||!a)return true;a.toFeature&&(a=a.toFeature(this.editor));this.allow(a.allowedContent,a.name);this.addTransformations(a.contentTransformations);this.addContentForms(a.contentForms);return a.requiredContent&&(this.customConfig||this.disallowedContent.length)?this.check(a.requiredContent):true},addTransformations:function(a){var b,
|
||||||
|
c;if(!this.disabled&&a){var d=this._.transformations,g;for(g=0;g<a.length;++g){b=a[g];var f=void 0,e=void 0,j=void 0,l=void 0,m=void 0,p=void 0;c=[];for(e=0;e<b.length;++e){j=b[e];if(typeof j=="string"){j=j.split(/\s*:\s*/);l=j[0];m=null;p=j[1]}else{l=j.check;m=j.left;p=j.right}if(!f){f=j;f=f.element?f.element:l?l.match(/^([a-z0-9]+)/i)[0]:f.left.getDefinition().element}m instanceof CKEDITOR.style&&(m=L(m));c.push({check:l==f?null:l,left:m,right:typeof p=="string"?H(p):p})}b=f;d[b]||(d[b]=[]);d[b].push(c)}}},
|
||||||
|
check:function(a,b,c){if(this.disabled)return true;if(CKEDITOR.tools.isArray(a)){for(var d=a.length;d--;)if(this.check(a[d],b,c))return true;return false}var g,f;if(typeof a=="string"){f=a+"<"+(b===false?"0":"1")+(c?"1":"0")+">";if(f in this._.cachedChecks)return this._.cachedChecks[f];d=o(a).$1;g=d.styles;var e=d.classes;d.name=d.elements;d.classes=e=e?e.split(/\s*,\s*/):[];d.styles=k(g);d.attributes=k(d.attributes);d.children=[];e.length&&(d.attributes["class"]=e.join(" "));if(g)d.attributes.style=
|
||||||
|
CKEDITOR.tools.writeCssText(d.styles);g=d}else{d=a.getDefinition();g=d.styles;e=d.attributes||{};if(g){g=J(g);e.style=CKEDITOR.tools.writeCssText(g,true)}else g={};g={name:d.element,attributes:e,classes:e["class"]?e["class"].split(/\s+/):[],styles:g,children:[]}}var e=CKEDITOR.tools.clone(g),j=[],l;if(b!==false&&(l=this._.transformations[g.name])){for(d=0;d<l.length;++d)u(this,g,l[d]);p(g)}v(this,e,j,{doFilter:true,doTransform:b!==false,skipRequired:!c,skipFinalValidation:!c});b=j.length>0?false:
|
||||||
|
CKEDITOR.tools.objectCompare(g.attributes,e.attributes,true)?true:false;typeof a=="string"&&(this._.cachedChecks[f]=b);return b},getAllowedEnterMode:function(){var a=["p","div","br"],b={p:CKEDITOR.ENTER_P,div:CKEDITOR.ENTER_DIV,br:CKEDITOR.ENTER_BR};return function(c,d){var g=a.slice(),f;if(this.check(x[c]))return c;for(d||(g=g.reverse());f=g.pop();)if(this.check(f))return b[f];return CKEDITOR.ENTER_BR}}()};var y={styles:1,attributes:1,classes:1},B={styles:"requiredStyles",attributes:"requiredAttributes",
|
||||||
|
classes:"requiredClasses"},w=/^([a-z0-9*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,N={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},M=/^cke:(object|embed|param)$/,D=/^(object|embed|param)$/,ba=CKEDITOR.filter.transformationsTools={sizeToStyle:function(a){this.lengthToStyle(a,"width");this.lengthToStyle(a,"height")},sizeToAttribute:function(a){this.lengthToAttribute(a,"width");this.lengthToAttribute(a,"height")},lengthToStyle:function(a,
|
||||||
|
b,c){c=c||b;if(!(c in a.styles)){var d=a.attributes[b];if(d){/^\d+$/.test(d)&&(d=d+"px");a.styles[c]=d}}delete a.attributes[b]},lengthToAttribute:function(a,b,c){c=c||b;if(!(c in a.attributes)){var d=a.styles[b],g=d&&d.match(/^(\d+)(?:\.\d*)?px$/);g?a.attributes[c]=g[1]:d==t&&(a.attributes[c]=t)}delete a.styles[b]},alignmentToStyle:function(a){if(!("float"in a.styles)){var b=a.attributes.align;if(b=="left"||b=="right")a.styles["float"]=b}delete a.attributes.align},alignmentToAttribute:function(a){if(!("align"in
|
||||||
|
a.attributes)){var b=a.styles["float"];if(b=="left"||b=="right")a.attributes.align=b}delete a.styles["float"]},matchesStyle:P,transform:function(a,b){if(typeof b=="string")a.name=b;else{var c=b.getDefinition(),d=c.styles,g=c.attributes,f,e,j,l;a.name=c.element;for(f in g)if(f=="class"){c=a.classes.join("|");for(j=g[f].split(/\s+/);l=j.pop();)c.indexOf(l)==-1&&a.classes.push(l)}else a.attributes[f]=g[f];for(e in d)a.styles[e]=d[e]}}}})();
|
||||||
|
(function(){CKEDITOR.focusManager=function(a){if(a.focusManager)return a.focusManager;this.hasFocus=false;this.currentActive=null;this._={editor:a};return this};CKEDITOR.focusManager._={blurDelay:200};CKEDITOR.focusManager.prototype={focus:function(a){this._.timer&&clearTimeout(this._.timer);if(a)this.currentActive=a;if(!this.hasFocus&&!this._.locked){(a=CKEDITOR.currentInstance)&&a.focusManager.blur(1);this.hasFocus=true;(a=this._.editor.container)&&a.addClass("cke_focus");this._.editor.fire("focus")}},
|
||||||
|
lock:function(){this._.locked=1},unlock:function(){delete this._.locked},blur:function(a){function e(){if(this.hasFocus){this.hasFocus=false;var a=this._.editor.container;a&&a.removeClass("cke_focus");this._.editor.fire("blur")}}if(!this._.locked){this._.timer&&clearTimeout(this._.timer);var b=CKEDITOR.focusManager._.blurDelay;a||!b?e.call(this):this._.timer=CKEDITOR.tools.setTimeout(function(){delete this._.timer;e.call(this)},b,this)}},add:function(a,e){var b=a.getCustomData("focusmanager");if(!b||
|
||||||
|
b!=this){b&&b.remove(a);var b="focus",c="blur";if(e)if(CKEDITOR.env.ie){b="focusin";c="focusout"}else CKEDITOR.event.useCapture=1;var d={blur:function(){a.equals(this.currentActive)&&this.blur()},focus:function(){this.focus(a)}};a.on(b,d.focus,this);a.on(c,d.blur,this);if(e)CKEDITOR.event.useCapture=0;a.setCustomData("focusmanager",this);a.setCustomData("focusmanager_handlers",d)}},remove:function(a){a.removeCustomData("focusmanager");var e=a.removeCustomData("focusmanager_handlers");a.removeListener("blur",
|
||||||
|
e.blur);a.removeListener("focus",e.focus)}}})();CKEDITOR.keystrokeHandler=function(a){if(a.keystrokeHandler)return a.keystrokeHandler;this.keystrokes={};this.blockedKeystrokes={};this._={editor:a};return this};
|
||||||
|
(function(){var a,e=function(b){var b=b.data,d=b.getKeystroke(),f=this.keystrokes[d],e=this._.editor;a=e.fire("key",{keyCode:d,domEvent:b})===false;if(!a){f&&(a=e.execCommand(f,{from:"keystrokeHandler"})!==false);a||(a=!!this.blockedKeystrokes[d])}a&&b.preventDefault(true);return!a},b=function(b){if(a){a=false;b.data.preventDefault(true)}};CKEDITOR.keystrokeHandler.prototype={attach:function(a){a.on("keydown",e,this);if(CKEDITOR.env.gecko&&CKEDITOR.env.mac)a.on("keypress",b,this)}}})();
|
||||||
|
(function(){CKEDITOR.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,el:1,"en-au":1,"en-ca":1,"en-gb":1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,"fr-ca":1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,"pt-br":1,pt:1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,"sr-latn":1,sr:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,"zh-cn":1,zh:1},rtl:{ar:1,fa:1,he:1,ku:1,ug:1},load:function(a,e,b){if(!a||!CKEDITOR.lang.languages[a])a=this.detect(e,
|
||||||
|
a);var c=this,e=function(){c[a].dir=c.rtl[a]?"rtl":"ltr";b(a,c[a])};this[a]?e():CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/"+a+".js"),e,this)},detect:function(a,e){var b=this.languages,e=e||navigator.userLanguage||navigator.language||a,c=e.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),d=c[1],c=c[2];b[d+"-"+c]?d=d+"-"+c:b[d]||(d=null);CKEDITOR.lang.detect=d?function(){return d}:function(a){return a};return d||a}}})();
|
||||||
|
CKEDITOR.scriptLoader=function(){var a={},e={};return{load:function(b,c,d,f){var h=typeof b=="string";h&&(b=[b]);d||(d=CKEDITOR);var n=b.length,i=[],k=[],o=function(a){c&&(h?c.call(d,a):c.call(d,i,k))};if(n===0)o(true);else{var s=function(a,b){(b?i:k).push(a);if(--n<=0){f&&CKEDITOR.document.getDocumentElement().removeStyle("cursor");o(b)}},r=function(b,c){a[b]=1;var d=e[b];delete e[b];for(var g=0;g<d.length;g++)d[g](b,c)},v=function(b){if(a[b])s(b,true);else{var d=e[b]||(e[b]=[]);d.push(s);if(!(d.length>
|
||||||
|
1)){var g=new CKEDITOR.dom.element("script");g.setAttributes({type:"text/javascript",src:b});if(c)if(CKEDITOR.env.ie&&CKEDITOR.env.version<11)g.$.onreadystatechange=function(){if(g.$.readyState=="loaded"||g.$.readyState=="complete"){g.$.onreadystatechange=null;r(b,true)}};else{g.$.onload=function(){setTimeout(function(){r(b,true)},0)};g.$.onerror=function(){r(b,false)}}g.appendTo(CKEDITOR.document.getHead())}}};f&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var g=0;g<n;g++)v(b[g])}},
|
||||||
|
queue:function(){function a(){var b;(b=c[0])&&this.load(b.scriptUrl,b.callback,CKEDITOR,0)}var c=[];return function(d,f){var e=this;c.push({scriptUrl:d,callback:function(){f&&f.apply(this,arguments);c.shift();a.call(e)}});c.length==1&&a.call(this)}}()}}();CKEDITOR.resourceManager=function(a,e){this.basePath=a;this.fileName=e;this.registered={};this.loaded={};this.externals={};this._={waitingList:{}}};
|
||||||
|
CKEDITOR.resourceManager.prototype={add:function(a,e){if(this.registered[a])throw'[CKEDITOR.resourceManager.add] The resource name "'+a+'" is already registered.';var b=this.registered[a]=e||{};b.name=a;b.path=this.getPath(a);CKEDITOR.fire(a+CKEDITOR.tools.capitalize(this.fileName)+"Ready",b);return this.get(a)},get:function(a){return this.registered[a]||null},getPath:function(a){var e=this.externals[a];return CKEDITOR.getUrl(e&&e.dir||this.basePath+a+"/")},getFilePath:function(a){var e=this.externals[a];
|
||||||
|
return CKEDITOR.getUrl(this.getPath(a)+(e?e.file:this.fileName+".js"))},addExternal:function(a,e,b){for(var a=a.split(","),c=0;c<a.length;c++){var d=a[c];b||(e=e.replace(/[^\/]+$/,function(a){b=a;return""}));this.externals[d]={dir:e,file:b||this.fileName+".js"}}},load:function(a,e,b){CKEDITOR.tools.isArray(a)||(a=a?[a]:[]);for(var c=this.loaded,d=this.registered,f=[],h={},n={},i=0;i<a.length;i++){var k=a[i];if(k)if(!c[k]&&!d[k]){var o=this.getFilePath(k);f.push(o);o in h||(h[o]=[]);h[o].push(k)}else n[k]=
|
||||||
|
this.get(k)}CKEDITOR.scriptLoader.load(f,function(a,d){if(d.length)throw'[CKEDITOR.resourceManager.load] Resource name "'+h[d[0]].join(",")+'" was not found at "'+d[0]+'".';for(var f=0;f<a.length;f++)for(var g=h[a[f]],p=0;p<g.length;p++){var i=g[p];n[i]=this.get(i);c[i]=1}e.call(b,n)},this)}};CKEDITOR.plugins=new CKEDITOR.resourceManager("plugins/","plugin");
|
||||||
|
CKEDITOR.plugins.load=CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){var e={};return function(b,c,d){var f={},h=function(b){a.call(this,b,function(a){CKEDITOR.tools.extend(f,a);var b=[],n;for(n in a){var s=a[n],r=s&&s.requires;if(!e[n]){if(s.icons)for(var v=s.icons.split(","),g=v.length;g--;)CKEDITOR.skin.addIcon(v[g],s.path+"icons/"+(CKEDITOR.env.hidpi&&s.hidpi?"hidpi/":"")+v[g]+".png");e[n]=1}if(r){r.split&&(r=r.split(","));for(s=0;s<r.length;s++)f[r[s]]||b.push(r[s])}}if(b.length)h.call(this,
|
||||||
|
b);else{for(n in f){s=f[n];if(s.onLoad&&!s.onLoad._called){s.onLoad()===false&&delete f[n];s.onLoad._called=1}}c&&c.call(d||window,f)}},this)};h.call(this,b)}});CKEDITOR.plugins.setLang=function(a,e,b){var c=this.get(a),a=c.langEntries||(c.langEntries={}),c=c.lang||(c.lang=[]);c.split&&(c=c.split(","));CKEDITOR.tools.indexOf(c,e)==-1&&c.push(e);a[e]=b};CKEDITOR.ui=function(a){if(a.ui)return a.ui;this.items={};this.instances={};this.editor=a;this._={handlers:{}};return this};
|
||||||
|
CKEDITOR.ui.prototype={add:function(a,e,b){b.name=a.toLowerCase();var c=this.items[a]={type:e,command:b.command||null,args:Array.prototype.slice.call(arguments,2)};CKEDITOR.tools.extend(c,b)},get:function(a){return this.instances[a]},create:function(a){var e=this.items[a],b=e&&this._.handlers[e.type],c=e&&e.command&&this.editor.getCommand(e.command),b=b&&b.create.apply(this,e.args);this.instances[a]=b;c&&c.uiItems.push(b);if(b&&!b.type)b.type=e.type;return b},addHandler:function(a,e){this._.handlers[a]=
|
||||||
|
e},space:function(a){return CKEDITOR.document.getById(this.spaceId(a))},spaceId:function(a){return this.editor.id+"_"+a}};CKEDITOR.event.implementOn(CKEDITOR.ui);
|
||||||
|
(function(){function a(a,c,f){CKEDITOR.event.call(this);a=a&&CKEDITOR.tools.clone(a);if(c!==void 0){if(c instanceof CKEDITOR.dom.element){if(!f)throw Error("One of the element modes must be specified.");}else throw Error("Expect element of type CKEDITOR.dom.element.");if(CKEDITOR.env.ie&&CKEDITOR.env.quirks&&f==CKEDITOR.ELEMENT_MODE_INLINE)throw Error("Inline element mode is not supported on IE quirks.");if(!(f==CKEDITOR.ELEMENT_MODE_INLINE?c.is(CKEDITOR.dtd.$editable)||c.is("textarea"):f==CKEDITOR.ELEMENT_MODE_REPLACE?
|
||||||
|
!c.is(CKEDITOR.dtd.$nonBodyContent):1))throw Error('The specified element mode is not supported on element: "'+c.getName()+'".');this.element=c;this.elementMode=f;this.name=this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO&&(c.getId()||c.getNameAtt())}else this.elementMode=CKEDITOR.ELEMENT_MODE_NONE;this._={};this.commands={};this.templates={};this.name=this.name||e();this.id=CKEDITOR.tools.getNextId();this.status="unloaded";this.config=CKEDITOR.tools.prototypedCopy(CKEDITOR.config);this.ui=new CKEDITOR.ui(this);
|
||||||
|
this.focusManager=new CKEDITOR.focusManager(this);this.keystrokeHandler=new CKEDITOR.keystrokeHandler(this);this.on("readOnly",b);this.on("selectionChange",function(a){d(this,a.data.path)});this.on("activeFilterChange",function(){d(this,this.elementPath(),true)});this.on("mode",b);this.on("instanceReady",function(){this.config.startupFocus&&this.focus()});CKEDITOR.fire("instanceCreated",null,this);CKEDITOR.add(this);CKEDITOR.tools.setTimeout(function(){h(this,a)},0,this)}function e(){do var a="editor"+
|
||||||
|
++r;while(CKEDITOR.instances[a]);return a}function b(){var a=this.commands,b;for(b in a)c(this,a[b])}function c(a,b){b[b.startDisabled?"disable":a.readOnly&&!b.readOnly?"disable":b.modes[a.mode]?"enable":"disable"]()}function d(a,b,c){if(b){var d,f,e=a.commands;for(f in e){d=e[f];(c||d.contextSensitive)&&d.refresh(a,b)}}}function f(a){var b=a.config.customConfig;if(!b)return false;var b=CKEDITOR.getUrl(b),c=v[b]||(v[b]={});if(c.fn){c.fn.call(a,a.config);(CKEDITOR.getUrl(a.config.customConfig)==b||
|
||||||
|
!f(a))&&a.fireOnce("customConfigLoaded")}else CKEDITOR.scriptLoader.queue(b,function(){c.fn=CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){};f(a)});return true}function h(a,b){a.on("customConfigLoaded",function(){if(b){if(b.on)for(var c in b.on)a.on(c,b.on[c]);CKEDITOR.tools.extend(a.config,b,true);delete a.config.on}c=a.config;a.readOnly=!(!c.readOnly&&!(a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.is("textarea")?a.element.hasAttribute("disabled"):a.element.isReadOnly():a.elementMode==
|
||||||
|
CKEDITOR.ELEMENT_MODE_REPLACE&&a.element.hasAttribute("disabled")));a.blockless=a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?!(a.element.is("textarea")||CKEDITOR.dtd[a.element.getName()].p):false;a.tabIndex=c.tabIndex||a.element&&a.element.getAttribute("tabindex")||0;a.activeEnterMode=a.enterMode=a.blockless?CKEDITOR.ENTER_BR:c.enterMode;a.activeShiftEnterMode=a.shiftEnterMode=a.blockless?CKEDITOR.ENTER_BR:c.shiftEnterMode;if(c.skin)CKEDITOR.skinName=c.skin;a.fireOnce("configLoaded");a.dataProcessor=
|
||||||
|
new CKEDITOR.htmlDataProcessor(a);a.filter=a.activeFilter=new CKEDITOR.filter(a);n(a)});if(b&&b.customConfig!=void 0)a.config.customConfig=b.customConfig;f(a)||a.fireOnce("customConfigLoaded")}function n(a){CKEDITOR.skin.loadPart("editor",function(){i(a)})}function i(a){CKEDITOR.lang.load(a.config.language,a.config.defaultLanguage,function(b,c){var d=a.config.title;a.langCode=b;a.lang=CKEDITOR.tools.prototypedCopy(c);a.title=typeof d=="string"||d===false?d:[a.lang.editor,a.name].join(", ");if(!a.config.contentsLangDirection)a.config.contentsLangDirection=
|
||||||
|
a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?a.element.getDirection(1):a.lang.dir;a.fire("langLoaded");k(a)})}function k(a){a.getStylesSet(function(b){a.once("loaded",function(){a.fire("stylesSet",{styles:b})},null,null,1);o(a)})}function o(a){var b=a.config,c=b.plugins,d=b.extraPlugins,f=b.removePlugins;if(d)var e=RegExp("(?:^|,)(?:"+d.replace(/\s*,\s*/g,"|")+")(?=,|$)","g"),c=c.replace(e,""),c=c+(","+d);if(f)var m=RegExp("(?:^|,)(?:"+f.replace(/\s*,\s*/g,"|")+")(?=,|$)","g"),c=c.replace(m,"");CKEDITOR.env.air&&
|
||||||
|
(c=c+",adobeair");CKEDITOR.plugins.load(c.split(","),function(c){var d=[],f=[],e=[];a.plugins=c;for(var j in c){var l=c[j],h=l.lang,i=null,k=l.requires,t;CKEDITOR.tools.isArray(k)&&(k=k.join(","));if(k&&(t=k.match(m)))for(;k=t.pop();)CKEDITOR.tools.setTimeout(function(a,b){throw Error('Plugin "'+a.replace(",","")+'" cannot be removed from the plugins list, because it\'s required by "'+b+'" plugin.');},0,null,[k,j]);if(h&&!a.lang[j]){h.split&&(h=h.split(","));if(CKEDITOR.tools.indexOf(h,a.langCode)>=
|
||||||
|
0)i=a.langCode;else{i=a.langCode.replace(/-.*/,"");i=i!=a.langCode&&CKEDITOR.tools.indexOf(h,i)>=0?i:CKEDITOR.tools.indexOf(h,"en")>=0?"en":h[0]}if(!l.langEntries||!l.langEntries[i])e.push(CKEDITOR.getUrl(l.path+"lang/"+i+".js"));else{a.lang[j]=l.langEntries[i];i=null}}f.push(i);d.push(l)}CKEDITOR.scriptLoader.load(e,function(){for(var c=["beforeInit","init","afterInit"],e=0;e<c.length;e++)for(var j=0;j<d.length;j++){var l=d[j];e===0&&(f[j]&&l.lang&&l.langEntries)&&(a.lang[l.name]=l.langEntries[f[j]]);
|
||||||
|
if(l[c[e]])l[c[e]](a)}a.fireOnce("pluginsLoaded");b.keystrokes&&a.setKeystroke(a.config.keystrokes);for(j=0;j<a.config.blockedKeystrokes.length;j++)a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[j]]=1;a.status="loaded";a.fireOnce("loaded");CKEDITOR.fire("instanceLoaded",null,a)})})}function s(){var a=this.element;if(a&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var b=this.getData();this.config.htmlEncodeOutput&&(b=CKEDITOR.tools.htmlEncode(b));a.is("textarea")?a.setValue(b):
|
||||||
|
a.setHtml(b);return true}return false}a.prototype=CKEDITOR.editor.prototype;CKEDITOR.editor=a;var r=0,v={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{addCommand:function(a,b){b.name=a.toLowerCase();var d=new CKEDITOR.command(this,b);this.mode&&c(this,d);return this.commands[a]=d},_attachToForm:function(){var a=this,b=a.element,c=new CKEDITOR.dom.element(b.$.form);if(b.is("textarea")&&c){var d=function(c){a.updateElement();a._.required&&(!b.getValue()&&a.fire("required")===false)&&c.data.preventDefault()};
|
||||||
|
c.on("submit",d);if(c.$.submit&&c.$.submit.call&&c.$.submit.apply)c.$.submit=CKEDITOR.tools.override(c.$.submit,function(a){return function(){d();a.apply?a.apply(this):a()}});a.on("destroy",function(){c.removeListener("submit",d)})}},destroy:function(a){this.fire("beforeDestroy");!a&&s.call(this);this.editable(null);this.status="destroyed";this.fire("destroy");this.removeAllListeners();CKEDITOR.remove(this);CKEDITOR.fire("instanceDestroyed",null,this)},elementPath:function(a){if(!a){a=this.getSelection();
|
||||||
|
if(!a)return null;a=a.getStartElement()}return a?new CKEDITOR.dom.elementPath(a,this.editable()):null},createRange:function(){var a=this.editable();return a?new CKEDITOR.dom.range(a):null},execCommand:function(a,b){var c=this.getCommand(a),d={name:a,commandData:b,command:c};if(c&&c.state!=CKEDITOR.TRISTATE_DISABLED&&this.fire("beforeCommandExec",d)!==false){d.returnValue=c.exec(d.commandData);if(!c.async&&this.fire("afterCommandExec",d)!==false)return d.returnValue}return false},getCommand:function(a){return this.commands[a]},
|
||||||
|
getData:function(a){!a&&this.fire("beforeGetData");var b=this._.data;if(typeof b!="string")b=(b=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?b.is("textarea")?b.getValue():b.getHtml():"";b={dataValue:b};!a&&this.fire("getData",b);return b.dataValue},getSnapshot:function(){var a=this.fire("getSnapshot");if(typeof a!="string"){var b=this.element;b&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(a=b.is("textarea")?b.getValue():b.getHtml())}return a},loadSnapshot:function(a){this.fire("loadSnapshot",
|
||||||
|
a)},setData:function(a,b,c){!c&&this.fire("saveSnapshot");if(b||!c)this.once("dataReady",function(a){c||this.fire("saveSnapshot");b&&b.call(a.editor)});a={dataValue:a};!c&&this.fire("setData",a);this._.data=a.dataValue;!c&&this.fire("afterSetData",a)},setReadOnly:function(a){a=a==void 0||a;if(this.readOnly!=a){this.readOnly=a;this.keystrokeHandler.blockedKeystrokes[8]=+a;this.editable().setReadOnly(a);this.fire("readOnly")}},insertHtml:function(a,b){this.fire("insertHtml",{dataValue:a,mode:b})},insertText:function(a){this.fire("insertText",
|
||||||
|
a)},insertElement:function(a){this.fire("insertElement",a)},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return this.status=="ready"&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return s.call(this)},setKeystroke:function(){for(var a=this.keystrokeHandler.keystrokes,b=CKEDITOR.tools.isArray(arguments[0])?arguments[0]:[[].slice.call(arguments,0)],c,d,f=b.length;f--;){c=b[f];d=0;if(CKEDITOR.tools.isArray(c)){d=
|
||||||
|
c[1];c=c[0]}d?a[c]=d:delete a[c]}},addFeature:function(a){return this.filter.addFeature(a)},setActiveFilter:function(a){if(!a)a=this.filter;if(this.activeFilter!==a){this.activeFilter=a;this.fire("activeFilterChange");a===this.filter?this.setActiveEnterMode(null,null):this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode),a.getAllowedEnterMode(this.shiftEnterMode,true))}},setActiveEnterMode:function(a,b){a=a?this.blockless?CKEDITOR.ENTER_BR:a:this.enterMode;b=b?this.blockless?CKEDITOR.ENTER_BR:
|
||||||
|
b:this.shiftEnterMode;if(this.activeEnterMode!=a||this.activeShiftEnterMode!=b){this.activeEnterMode=a;this.activeShiftEnterMode=b;this.fire("activeEnterModeChange")}}})})();CKEDITOR.ELEMENT_MODE_NONE=0;CKEDITOR.ELEMENT_MODE_REPLACE=1;CKEDITOR.ELEMENT_MODE_APPENDTO=2;CKEDITOR.ELEMENT_MODE_INLINE=3;CKEDITOR.htmlParser=function(){this._={htmlPartsRegex:RegExp("<(?:(?:\\/([^>]+)>)|(?:!--([\\S|\\s]*?)--\>)|(?:([^\\s>]+)\\s*((?:(?:\"[^\"]*\")|(?:'[^']*')|[^\"'>])*)\\/?>))","g")}};
|
||||||
|
(function(){var a=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,e={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(b){for(var c,d,f=0,h;c=this._.htmlPartsRegex.exec(b);){d=c.index;if(d>f){f=b.substring(f,d);if(h)h.push(f);else this.onText(f)}f=
|
||||||
|
this._.htmlPartsRegex.lastIndex;if(d=c[1]){d=d.toLowerCase();if(h&&CKEDITOR.dtd.$cdata[d]){this.onCDATA(h.join(""));h=null}if(!h){this.onTagClose(d);continue}}if(h)h.push(c[0]);else if(d=c[3]){d=d.toLowerCase();if(!/="/.test(d)){var n={},i;c=c[4];var k=!!(c&&c.charAt(c.length-1)=="/");if(c)for(;i=a.exec(c);){var o=i[1].toLowerCase();i=i[2]||i[3]||i[4]||"";n[o]=!i&&e[o]?o:CKEDITOR.tools.htmlDecodeAttr(i)}this.onTagOpen(d,n,k);!h&&CKEDITOR.dtd.$cdata[d]&&(h=[])}}else if(d=c[2])this.onComment(d)}if(b.length>
|
||||||
|
f)this.onText(b.substring(f,b.length))}}})();
|
||||||
|
CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},proto:{openTag:function(a){this._.output.push("<",a)},openTagClose:function(a,e){e?this._.output.push(" />"):this._.output.push(">")},attribute:function(a,e){typeof e=="string"&&(e=CKEDITOR.tools.htmlEncodeAttr(e));this._.output.push(" ",a,'="',e,'"')},closeTag:function(a){this._.output.push("</",a,">")},text:function(a){this._.output.push(a)},comment:function(a){this._.output.push("<\!--",a,"--\>")},write:function(a){this._.output.push(a)},
|
||||||
|
reset:function(){this._.output=[];this._.indent=false},getHtml:function(a){var e=this._.output.join("");a&&this.reset();return e}}});"use strict";
|
||||||
|
(function(){CKEDITOR.htmlParser.node=function(){};CKEDITOR.htmlParser.node.prototype={remove:function(){var a=this.parent.children,e=CKEDITOR.tools.indexOf(a,this),b=this.previous,c=this.next;b&&(b.next=c);c&&(c.previous=b);a.splice(e,1);this.parent=null},replaceWith:function(a){var e=this.parent.children,b=CKEDITOR.tools.indexOf(e,this),c=a.previous=this.previous,d=a.next=this.next;c&&(c.next=a);d&&(d.previous=a);e[b]=a;a.parent=this.parent;this.parent=null},insertAfter:function(a){var e=a.parent.children,
|
||||||
|
b=CKEDITOR.tools.indexOf(e,a),c=a.next;e.splice(b+1,0,this);this.next=a.next;this.previous=a;a.next=this;c&&(c.previous=this);this.parent=a.parent},insertBefore:function(a){var e=a.parent.children,b=CKEDITOR.tools.indexOf(e,a);e.splice(b,0,this);this.next=a;(this.previous=a.previous)&&(a.previous.next=this);a.previous=this;this.parent=a.parent},getAscendant:function(a){var e=typeof a=="function"?a:typeof a=="string"?function(b){return b.name==a}:function(b){return b.name in a},b=this.parent;for(;b&&
|
||||||
|
b.type==CKEDITOR.NODE_ELEMENT;){if(e(b))return b;b=b.parent}return null},wrapWith:function(a){this.replaceWith(a);a.add(this);return a},getIndex:function(){return CKEDITOR.tools.indexOf(this.parent.children,this)},getFilterContext:function(a){return a||{}}}})();"use strict";CKEDITOR.htmlParser.comment=function(a){this.value=a;this._={isBlockLike:false}};
|
||||||
|
CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_COMMENT,filter:function(a,e){var b=this.value;if(!(b=a.onComment(e,b,this))){this.remove();return false}if(typeof b!="string"){this.replaceWith(b);return false}this.value=b;return true},writeHtml:function(a,e){e&&this.filter(e);a.comment(this.value)}});"use strict";
|
||||||
|
(function(){CKEDITOR.htmlParser.text=function(a){this.value=a;this._={isBlockLike:false}};CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(a,e){if(!(this.value=a.onText(e,this.value,this))){this.remove();return false}},writeHtml:function(a,e){e&&this.filter(e);a.text(this.value)}})})();"use strict";
|
||||||
|
(function(){CKEDITOR.htmlParser.cdata=function(a){this.value=a};CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(a){a.write(this.value)}})})();"use strict";CKEDITOR.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:true,hasInlineStarted:false}};
|
||||||
|
(function(){function a(a){return a.attributes["data-cke-survive"]?false:a.name=="a"&&a.attributes.href||CKEDITOR.dtd.$removeEmpty[a.name]}var e=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),b={ol:1,ul:1},c=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),d={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=
|
||||||
|
function(f,h,n){function i(a){var b;if(z.length>0)for(var c=0;c<z.length;c++){var d=z[c],f=d.name,e=CKEDITOR.dtd[f],g=l.name&&CKEDITOR.dtd[l.name];if((!g||g[f])&&(!a||!e||e[a]||!CKEDITOR.dtd[a])){if(!b){k();b=1}d=d.clone();d.parent=l;l=d;z.splice(c,1);c--}else if(f==l.name){s(l,l.parent,1);c--}}}function k(){for(;A.length;)s(A.shift(),l)}function o(a){if(a._.isBlockLike&&a.name!="pre"&&a.name!="textarea"){var b=a.children.length,c=a.children[b-1],d;if(c&&c.type==CKEDITOR.NODE_TEXT)(d=CKEDITOR.tools.rtrim(c.value))?
|
||||||
|
c.value=d:a.children.length=b-1}}function s(b,c,d){var c=c||l||p,f=l;if(b.previous===void 0){if(r(c,b)){l=c;g.onTagOpen(n,{});b.returnPoint=c=l}o(b);(!a(b)||b.children.length)&&c.add(b);b.name=="pre"&&(m=false);b.name=="textarea"&&(j=false)}if(b.returnPoint){l=b.returnPoint;delete b.returnPoint}else l=d?c:f}function r(a,b){if((a==p||a.name=="body")&&n&&(!a.name||CKEDITOR.dtd[a.name][n])){var c,d;return(c=b.attributes&&(d=b.attributes["data-cke-real-element-type"])?d:b.name)&&c in CKEDITOR.dtd.$inline&&
|
||||||
|
!(c in CKEDITOR.dtd.head)&&!b.isOrphan||b.type==CKEDITOR.NODE_TEXT}}function v(a,b){return a in CKEDITOR.dtd.$listItem||a in CKEDITOR.dtd.$tableContent?a==b||a=="dt"&&b=="dd"||a=="dd"&&b=="dt":false}var g=new CKEDITOR.htmlParser,p=h instanceof CKEDITOR.htmlParser.element?h:typeof h=="string"?new CKEDITOR.htmlParser.element(h):new CKEDITOR.htmlParser.fragment,z=[],A=[],l=p,j=p.name=="textarea",m=p.name=="pre";g.onTagOpen=function(d,f,h,p){f=new CKEDITOR.htmlParser.element(d,f);if(f.isUnknown&&h)f.isEmpty=
|
||||||
|
true;f.isOptionalClose=p;if(a(f))z.push(f);else{if(d=="pre")m=true;else{if(d=="br"&&m){l.add(new CKEDITOR.htmlParser.text("\n"));return}d=="textarea"&&(j=true)}if(d=="br")A.push(f);else{for(;;){p=(h=l.name)?CKEDITOR.dtd[h]||(l._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):c;if(!f.isUnknown&&!l.isUnknown&&!p[d])if(l.isOptionalClose)g.onTagClose(h);else if(d in b&&h in b){h=l.children;(h=h[h.length-1])&&h.name=="li"||s(h=new CKEDITOR.htmlParser.element("li"),l);!f.returnPoint&&(f.returnPoint=l);
|
||||||
|
l=h}else if(d in CKEDITOR.dtd.$listItem&&!v(d,h))g.onTagOpen(d=="li"?"ul":"dl",{},0,1);else if(h in e&&!v(d,h)){!f.returnPoint&&(f.returnPoint=l);l=l.parent}else{h in CKEDITOR.dtd.$inline&&z.unshift(l);if(l.parent)s(l,l.parent,1);else{f.isOrphan=1;break}}else break}i(d);k();f.parent=l;f.isEmpty?s(f):l=f}}};g.onTagClose=function(a){for(var b=z.length-1;b>=0;b--)if(a==z[b].name){z.splice(b,1);return}for(var c=[],d=[],f=l;f!=p&&f.name!=a;){f._.isBlockLike||d.unshift(f);c.push(f);f=f.returnPoint||f.parent}if(f!=
|
||||||
|
p){for(b=0;b<c.length;b++){var e=c[b];s(e,e.parent)}l=f;f._.isBlockLike&&k();s(f,f.parent);if(f==l)l=l.parent;z=z.concat(d)}a=="body"&&(n=false)};g.onText=function(a){if((!l._.hasInlineStarted||A.length)&&!m&&!j){a=CKEDITOR.tools.ltrim(a);if(a.length===0)return}var b=l.name,f=b?CKEDITOR.dtd[b]||(l._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):c;if(!j&&!f["#"]&&b in e){g.onTagOpen(d[b]||"");g.onText(a)}else{k();i();!m&&!j&&(a=a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," "));a=new CKEDITOR.htmlParser.text(a);
|
||||||
|
if(r(l,a))this.onTagOpen(n,{},0,1);l.add(a)}};g.onCDATA=function(a){l.add(new CKEDITOR.htmlParser.cdata(a))};g.onComment=function(a){k();i();l.add(new CKEDITOR.htmlParser.comment(a))};g.parse(f);for(k();l!=p;)s(l,l.parent,1);o(p);return p};CKEDITOR.htmlParser.fragment.prototype={type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,add:function(a,b){isNaN(b)&&(b=this.children.length);var c=b>0?this.children[b-1]:null;if(c){if(a._.isBlockLike&&c.type==CKEDITOR.NODE_TEXT){c.value=CKEDITOR.tools.rtrim(c.value);if(c.value.length===
|
||||||
|
0){this.children.pop();this.add(a);return}}c.next=a}a.previous=c;a.parent=this;this.children.splice(b,0,a);if(!this._.hasInlineStarted)this._.hasInlineStarted=a.type==CKEDITOR.NODE_TEXT||a.type==CKEDITOR.NODE_ELEMENT&&!a._.isBlockLike},filter:function(a,b){b=this.getFilterContext(b);a.onRoot(b,this);this.filterChildren(a,false,b)},filterChildren:function(a,b,c){if(this.childrenFilteredBy!=a.id){c=this.getFilterContext(c);if(b&&!this.parent)a.onRoot(c,this);this.childrenFilteredBy=a.id;for(b=0;b<this.children.length;b++)this.children[b].filter(a,
|
||||||
|
c)===false&&b--}},writeHtml:function(a,b){b&&this.filter(b);this.writeChildrenHtml(a)},writeChildrenHtml:function(a,b,c){var d=this.getFilterContext();if(c&&!this.parent&&b)b.onRoot(d,this);b&&this.filterChildren(b,false,d);b=0;c=this.children;for(d=c.length;b<d;b++)c[b].writeHtml(a)},forEach:function(a,b,c){if(!c&&(!b||this.type==b))var d=a(this);if(d!==false)for(var c=this.children,e=0;e<c.length;e++){d=c[e];d.type==CKEDITOR.NODE_ELEMENT?d.forEach(a,b):(!b||d.type==b)&&a(d)}},getFilterContext:function(a){return a||
|
||||||
|
{}}}})();"use strict";
|
||||||
|
(function(){function a(){this.rules=[]}function e(b,c,d,f){var e,n;for(e in c){(n=b[e])||(n=b[e]=new a);n.add(c[e],d,f)}}CKEDITOR.htmlParser.filter=CKEDITOR.tools.createClass({$:function(b){this.id=CKEDITOR.tools.getNextNumber();this.elementNameRules=new a;this.attributeNameRules=new a;this.elementsRules={};this.attributesRules={};this.textRules=new a;this.commentRules=new a;this.rootRules=new a;b&&this.addRules(b,10)},proto:{addRules:function(a,c){var d;if(typeof c=="number")d=c;else if(c&&"priority"in
|
||||||
|
c)d=c.priority;typeof d!="number"&&(d=10);typeof c!="object"&&(c={});a.elementNames&&this.elementNameRules.addMany(a.elementNames,d,c);a.attributeNames&&this.attributeNameRules.addMany(a.attributeNames,d,c);a.elements&&e(this.elementsRules,a.elements,d,c);a.attributes&&e(this.attributesRules,a.attributes,d,c);a.text&&this.textRules.add(a.text,d,c);a.comment&&this.commentRules.add(a.comment,d,c);a.root&&this.rootRules.add(a.root,d,c)},applyTo:function(a){a.filter(this)},onElementName:function(a,c){return this.elementNameRules.execOnName(a,
|
||||||
|
c)},onAttributeName:function(a,c){return this.attributeNameRules.execOnName(a,c)},onText:function(a,c,d){return this.textRules.exec(a,c,d)},onComment:function(a,c,d){return this.commentRules.exec(a,c,d)},onRoot:function(a,c){return this.rootRules.exec(a,c)},onElement:function(a,c){for(var d=[this.elementsRules["^"],this.elementsRules[c.name],this.elementsRules.$],f,e=0;e<3;e++)if(f=d[e]){f=f.exec(a,c,this);if(f===false)return null;if(f&&f!=c)return this.onNode(a,f);if(c.parent&&!c.name)break}return c},
|
||||||
|
onNode:function(a,c){var d=c.type;return d==CKEDITOR.NODE_ELEMENT?this.onElement(a,c):d==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(a,c.value)):d==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(a,c.value)):null},onAttribute:function(a,c,d,f){return(d=this.attributesRules[d])?d.exec(a,f,c,this):f}}});CKEDITOR.htmlParser.filterRulesGroup=a;a.prototype={add:function(a,c,d){this.rules.splice(this.findIndex(c),0,{value:a,priority:c,options:d})},addMany:function(a,
|
||||||
|
c,d){for(var f=[this.findIndex(c),0],e=0,n=a.length;e<n;e++)f.push({value:a[e],priority:c,options:d});this.rules.splice.apply(this.rules,f)},findIndex:function(a){for(var c=this.rules,d=c.length-1;d>=0&&a<c[d].priority;)d--;return d+1},exec:function(a,c){var d=c instanceof CKEDITOR.htmlParser.node||c instanceof CKEDITOR.htmlParser.fragment,f=Array.prototype.slice.call(arguments,1),e=this.rules,n=e.length,i,k,o,s;for(s=0;s<n;s++){if(d){i=c.type;k=c.name}o=e[s];if(!(a.nonEditable&&!o.options.applyToAll||
|
||||||
|
a.nestedEditable&&o.options.excludeNestedEditable)){o=o.value.apply(null,f);if(o===false||d&&o&&(o.name!=k||o.type!=i))return o;o!=void 0&&(f[0]=c=o)}}return c},execOnName:function(a,c){for(var d=0,f=this.rules,e=f.length,n;c&&d<e;d++){n=f[d];!(a.nonEditable&&!n.options.applyToAll||a.nestedEditable&&n.options.excludeNestedEditable)&&(c=c.replace(n.value[0],n.value[1]))}return c}}})();
|
||||||
|
(function(){function a(a,e){function g(a){return a||CKEDITOR.env.needsNbspFiller?new CKEDITOR.htmlParser.text(" "):new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function j(a,d){return function(e){if(e.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var j=[],l=b(e),m,w;if(l)for(t(l,1)&&j.push(l);l;){if(f(l)&&(m=c(l))&&t(m))if((w=c(m))&&!f(w))j.push(m);else{g(p).insertAfter(m);m.remove()}l=l.previous}for(l=0;l<j.length;l++)j[l].remove();if(j=typeof d=="function"?d(e)!==false:d)if(!p&&!CKEDITOR.env.needsBrFiller&&
|
||||||
|
e.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)j=false;else if(!p&&!CKEDITOR.env.needsBrFiller&&(document.documentMode>7||e.name in CKEDITOR.dtd.tr||e.name in CKEDITOR.dtd.$listItem))j=false;else{j=b(e);j=!j||e.name=="form"&&j.name=="input"}j&&e.add(g(a))}}}function t(a,b){if((!p||CKEDITOR.env.needsBrFiller)&&a.type==CKEDITOR.NODE_ELEMENT&&a.name=="br"&&!a.attributes["data-cke-eol"])return true;var c;if(a.type==CKEDITOR.NODE_TEXT&&(c=a.value.match(z))){if(c.index){(new CKEDITOR.htmlParser.text(a.value.substring(0,
|
||||||
|
c.index))).insertBefore(a);a.value=c[0]}if(!CKEDITOR.env.needsBrFiller&&p&&(!b||a.parent.name in i))return true;if(!p)if((c=a.previous)&&c.name=="br"||!c||f(c))return true}return false}var q={elements:{}},p=e=="html",i=CKEDITOR.tools.extend({},m),u;for(u in i)"#"in l[u]||delete i[u];for(u in i)q.elements[u]=j(p,a.config.fillEmptyBlocks!==false);q.root=j(p);q.elements.br=function(a){return function(b){if(b.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var e=b.attributes;if("data-cke-bogus"in e||"data-cke-eol"in
|
||||||
|
e)delete e["data-cke-bogus"];else{for(e=b.next;e&&d(e);)e=e.next;var j=c(b);!e&&f(b.parent)?h(b.parent,g(a)):f(e)&&(j&&!f(j))&&g(a).insertBefore(e)}}}}(p);return q}function e(a,b){return a!=CKEDITOR.ENTER_BR&&b!==false?a==CKEDITOR.ENTER_DIV?"div":"p":false}function b(a){for(a=a.children[a.children.length-1];a&&d(a);)a=a.previous;return a}function c(a){for(a=a.previous;a&&d(a);)a=a.previous;return a}function d(a){return a.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(a.value)||a.type==CKEDITOR.NODE_ELEMENT&&
|
||||||
|
a.attributes["data-cke-bookmark"]}function f(a){return a&&(a.type==CKEDITOR.NODE_ELEMENT&&a.name in m||a.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function h(a,b){var c=a.children[a.children.length-1];a.children.push(b);b.parent=a;if(c){c.next=b;b.previous=c}}function n(a){a=a.attributes;a.contenteditable!="false"&&(a["data-cke-editable"]=a.contenteditable?"true":1);a.contenteditable="false"}function i(a){a=a.attributes;switch(a["data-cke-editable"]){case "true":a.contenteditable="true";break;case "1":delete a.contenteditable}}
|
||||||
|
function k(a){return a.replace(H,function(a,b,c){return"<"+b+c.replace(G,function(a,b){return C.test(b)&&c.indexOf("data-cke-saved-"+b)==-1?" data-cke-saved-"+a+" data-cke-"+CKEDITOR.rnd+"-"+a:a})+">"})}function o(a,b){return a.replace(b,function(a,b,c){a.indexOf("<textarea")===0&&(a=b+v(c).replace(/</g,"<").replace(/>/g,">")+"</textarea>");return"<cke:encoded>"+encodeURIComponent(a)+"</cke:encoded>"})}function s(a){return a.replace(t,function(a,b){return decodeURIComponent(b)})}function r(a){return a.replace(/<\!--(?!{cke_protected})[\s\S]+?--\>/g,
|
||||||
|
function(a){return"<\!--"+A+"{C}"+encodeURIComponent(a).replace(/--/g,"%2D%2D")+"--\>"})}function v(a){return a.replace(/<\!--\{cke_protected\}\{C\}([\s\S]+?)--\>/g,function(a,b){return decodeURIComponent(b)})}function g(a,b){var c=b._.dataStore;return a.replace(/<\!--\{cke_protected\}([\s\S]+?)--\>/g,function(a,b){return decodeURIComponent(b)}).replace(/\{cke_protected_(\d+)\}/g,function(a,b){return c&&c[b]||""})}function p(a,b){for(var c=[],d=b.config.protectedSource,f=b._.dataStore||(b._.dataStore=
|
||||||
|
{id:1}),e=/<\!--\{cke_temp(comment)?\}(\d*?)--\>/g,d=[/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi].concat(d),a=a.replace(/<\!--[\s\S]*?--\>/g,function(a){return"<\!--{cke_tempcomment}"+(c.push(a)-1)+"--\>"}),j=0;j<d.length;j++)a=a.replace(d[j],function(a){a=a.replace(e,function(a,b,d){return c[d]});return/cke_temp(comment)?/.test(a)?a:"<\!--{cke_temp}"+(c.push(a)-1)+"--\>"});a=a.replace(e,function(a,b,d){return"<\!--"+A+(b?"{C}":"")+encodeURIComponent(c[d]).replace(/--/g,"%2D%2D")+
|
||||||
|
"--\>"});a=a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=>]+))+\s*>/g,function(a){return a.replace(/<\!--\{cke_protected\}([^>]*)--\>/g,function(a,b){f[f.id]=decodeURIComponent(b);return"{cke_protected_"+f.id++ +"}"})});return a=a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(a,c,d,f){return"<"+c+d+">"+g(v(f),b)+"</"+c+">"})}CKEDITOR.htmlDataProcessor=function(b){var c,d,f=this;this.editor=b;this.dataFilter=c=new CKEDITOR.htmlParser.filter;this.htmlFilter=
|
||||||
|
d=new CKEDITOR.htmlParser.filter;this.writer=new CKEDITOR.htmlParser.basicWriter;c.addRules(u);c.addRules(P,{applyToAll:true});c.addRules(a(b,"data"),{applyToAll:true});d.addRules(q);d.addRules(L,{applyToAll:true});d.addRules(a(b,"html"),{applyToAll:true});b.on("toHtml",function(a){var a=a.data,c=a.dataValue,c=p(c,b),c=o(c,F),c=k(c),c=o(c,J),c=c.replace(x,"$1cke:$2"),c=c.replace(B,"<cke:$1$2></cke:$1>"),c=c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g,"$1$2$2"),c=c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,
|
||||||
|
"$1data-cke-"+CKEDITOR.rnd+"-$2"),d=a.context||b.editable().getName(),f;if(CKEDITOR.env.ie&&CKEDITOR.env.version<9&&d=="pre"){d="div";c="<pre>"+c+"</pre>";f=1}d=b.document.createElement(d);d.setHtml("a"+c);c=d.getHtml().substr(1);c=c.replace(RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),"");f&&(c=c.replace(/^<pre>|<\/pre>$/gi,""));c=c.replace(y,"$1$2");c=s(c);c=v(c);a.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.context,a.fixForBody===false?false:e(a.enterMode,b.config.autoParagraph))},null,null,
|
||||||
|
5);b.on("toHtml",function(a){a.data.filter.applyTo(a.data.dataValue,true,a.data.dontFilter,a.data.enterMode)&&b.fire("dataFiltered")},null,null,6);b.on("toHtml",function(a){a.data.dataValue.filterChildren(f.dataFilter,true)},null,null,10);b.on("toHtml",function(a){var a=a.data,b=a.dataValue,c=new CKEDITOR.htmlParser.basicWriter;b.writeChildrenHtml(c);b=c.getHtml(true);a.dataValue=r(b)},null,null,15);b.on("toDataFormat",function(a){var c=a.data.dataValue;a.data.enterMode!=CKEDITOR.ENTER_BR&&(c=c.replace(/^<br *\/?>/i,
|
||||||
|
""));a.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(c,a.data.context,e(a.data.enterMode,b.config.autoParagraph))},null,null,5);b.on("toDataFormat",function(a){a.data.dataValue.filterChildren(f.htmlFilter,true)},null,null,10);b.on("toDataFormat",function(a){a.data.filter.applyTo(a.data.dataValue,false,true)},null,null,11);b.on("toDataFormat",function(a){var c=a.data.dataValue,d=f.writer;d.reset();c.writeChildrenHtml(d);c=d.getHtml(true);c=v(c);c=g(c,b);a.data.dataValue=c},null,null,15)};CKEDITOR.htmlDataProcessor.prototype=
|
||||||
|
{toHtml:function(a,b,c,d){var f=this.editor,e,g,j;if(b&&typeof b=="object"){e=b.context;c=b.fixForBody;d=b.dontFilter;g=b.filter;j=b.enterMode}else e=b;!e&&e!==null&&(e=f.editable().getName());return f.fire("toHtml",{dataValue:a,context:e,fixForBody:c,dontFilter:d,filter:g||f.filter,enterMode:j||f.enterMode}).dataValue},toDataFormat:function(a,b){var c,d,f;if(b){c=b.context;d=b.filter;f=b.enterMode}!c&&c!==null&&(c=this.editor.editable().getName());return this.editor.fire("toDataFormat",{dataValue:a,
|
||||||
|
filter:d||this.editor.filter,context:c,enterMode:f||this.editor.enterMode}).dataValue}};var z=/(?: |\xa0)$/,A="{cke_protected}",l=CKEDITOR.dtd,j=["caption","colgroup","col","thead","tfoot","tbody"],m=CKEDITOR.tools.extend({},l.$blockLimit,l.$block),u={elements:{input:n,textarea:n}},P={attributeNames:[[/^on/,"data-cke-pa-on"],[/^data-cke-expando$/,""]]},q={elements:{embed:function(a){var b=a.parent;if(b&&b.name=="object"){var c=b.attributes.width,b=b.attributes.height;if(c)a.attributes.width=
|
||||||
|
c;if(b)a.attributes.height=b}},a:function(a){if(!a.children.length&&!a.attributes.name&&!a.attributes["data-cke-saved-name"])return false}}},L={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(a){var b=a.attributes;if(b){if(b["data-cke-temp"])return false;for(var c=["name","href","src"],d,f=0;f<c.length;f++){d="data-cke-saved-"+c[f];d in b&&delete b[c[f]]}}return a},table:function(a){a.children.slice(0).sort(function(a,
|
||||||
|
b){var c,d;if(a.type==CKEDITOR.NODE_ELEMENT&&b.type==a.type){c=CKEDITOR.tools.indexOf(j,a.name);d=CKEDITOR.tools.indexOf(j,b.name)}if(!(c>-1&&d>-1&&c!=d)){c=a.parent?a.getIndex():-1;d=b.parent?b.getIndex():-1}return c>d?1:-1})},param:function(a){a.children=[];a.isEmpty=true;return a},span:function(a){a.attributes["class"]=="Apple-style-span"&&delete a.name},html:function(a){delete a.attributes.contenteditable;delete a.attributes["class"]},body:function(a){delete a.attributes.spellcheck;delete a.attributes.contenteditable},
|
||||||
|
style:function(a){var b=a.children[0];if(b&&b.value)b.value=CKEDITOR.tools.trim(b.value);if(!a.attributes.type)a.attributes.type="text/css"},title:function(a){var b=a.children[0];!b&&h(a,b=new CKEDITOR.htmlParser.text);b.value=a.attributes["data-cke-title"]||""},input:i,textarea:i},attributes:{"class":function(a){return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g,""))||false}}};if(CKEDITOR.env.ie)L.attributes.style=function(a){return a.replace(/(^|;)([^\:]+)/g,function(a){return a.toLowerCase()})};
|
||||||
|
var H=/<(a|area|img|input|source)\b([^>]*)>/gi,G=/([\w-]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,C=/^(href|src|name)$/i,J=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,F=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,t=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,x=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,y=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,B=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi})();"use strict";
|
||||||
|
CKEDITOR.htmlParser.element=function(a,e){this.name=a;this.attributes=e||{};this.children=[];var b=a||"",c=b.match(/^cke:(.*)/);c&&(b=c[1]);b=!(!CKEDITOR.dtd.$nonBodyContent[b]&&!CKEDITOR.dtd.$block[b]&&!CKEDITOR.dtd.$listItem[b]&&!CKEDITOR.dtd.$tableContent[b]&&!(CKEDITOR.dtd.$nonEditable[b]||b=="br"));this.isEmpty=!!CKEDITOR.dtd.$empty[a];this.isUnknown=!CKEDITOR.dtd[a];this._={isBlockLike:b,hasInlineStarted:this.isEmpty||!b}};
|
||||||
|
CKEDITOR.htmlParser.cssStyle=function(a){var e={};((a instanceof CKEDITOR.htmlParser.element?a.attributes.style:a)||"").replace(/"/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(a,c,d){c=="font-family"&&(d=d.replace(/["']/g,""));e[c.toLowerCase()]=d});return{rules:e,populate:function(a){var c=this.toString();if(c)a instanceof CKEDITOR.dom.element?a.setAttribute("style",c):a instanceof CKEDITOR.htmlParser.element?a.attributes.style=c:a.style=c},toString:function(){var a=[],c;
|
||||||
|
for(c in e)e[c]&&a.push(c,":",e[c],";");return a.join("")}}};
|
||||||
|
(function(){function a(a){return function(b){return b.type==CKEDITOR.NODE_ELEMENT&&(typeof a=="string"?b.name==a:b.name in a)}}var e=function(a,b){a=a[0];b=b[0];return a<b?-1:a>b?1:0},b=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:b.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(a,b){var f=this,e,n,b=f.getFilterContext(b);if(b.off)return true;
|
||||||
|
if(!f.parent)a.onRoot(b,f);for(;;){e=f.name;if(!(n=a.onElementName(b,e))){this.remove();return false}f.name=n;if(!(f=a.onElement(b,f))){this.remove();return false}if(f!==this){this.replaceWith(f);return false}if(f.name==e)break;if(f.type!=CKEDITOR.NODE_ELEMENT){this.replaceWith(f);return false}if(!f.name){this.replaceWithChildren();return false}}e=f.attributes;var i,k;for(i in e){k=i;for(n=e[i];;)if(k=a.onAttributeName(b,i))if(k!=i){delete e[i];i=k}else break;else{delete e[i];break}k&&((n=a.onAttribute(b,
|
||||||
|
f,k,n))===false?delete e[k]:e[k]=n)}f.isEmpty||this.filterChildren(a,false,b);return true},filterChildren:b.filterChildren,writeHtml:function(a,b){b&&this.filter(b);var f=this.name,h=[],n=this.attributes,i,k;a.openTag(f,n);for(i in n)h.push([i,n[i]]);a.sortAttributes&&h.sort(e);i=0;for(k=h.length;i<k;i++){n=h[i];a.attribute(n[0],n[1])}a.openTagClose(f,this.isEmpty);this.writeChildrenHtml(a);this.isEmpty||a.closeTag(f)},writeChildrenHtml:b.writeChildrenHtml,replaceWithChildren:function(){for(var a=
|
||||||
|
this.children,b=a.length;b;)a[--b].insertAfter(this);this.remove()},forEach:b.forEach,getFirst:function(b){if(!b)return this.children.length?this.children[0]:null;typeof b!="function"&&(b=a(b));for(var d=0,f=this.children.length;d<f;++d)if(b(this.children[d]))return this.children[d];return null},getHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;this.writeChildrenHtml(a);return a.getHtml()},setHtml:function(a){for(var a=this.children=CKEDITOR.htmlParser.fragment.fromHtml(a).children,b=0,
|
||||||
|
f=a.length;b<f;++b)a[b].parent=this},getOuterHtml:function(){var a=new CKEDITOR.htmlParser.basicWriter;this.writeHtml(a);return a.getHtml()},split:function(a){for(var b=this.children.splice(a,this.children.length-a),f=this.clone(),e=0;e<b.length;++e)b[e].parent=f;f.children=b;if(b[0])b[0].previous=null;if(a>0)this.children[a-1].next=null;this.parent.add(f,this.getIndex()+1);return f},addClass:function(a){if(!this.hasClass(a)){var b=this.attributes["class"]||"";this.attributes["class"]=b+(b?" ":"")+
|
||||||
|
a}},removeClass:function(a){var b=this.attributes["class"];if(b)(b=CKEDITOR.tools.trim(b.replace(RegExp("(?:\\s+|^)"+a+"(?:\\s+|$)")," ")))?this.attributes["class"]=b:delete this.attributes["class"]},hasClass:function(a){var b=this.attributes["class"];return!b?false:RegExp("(?:^|\\s)"+a+"(?=\\s|$)").test(b)},getFilterContext:function(a){var b=[];a||(a={off:false,nonEditable:false,nestedEditable:false});!a.off&&this.attributes["data-cke-processor"]=="off"&&b.push("off",true);!a.nonEditable&&this.attributes.contenteditable==
|
||||||
|
"false"?b.push("nonEditable",true):a.nonEditable&&(!a.nestedEditable&&this.attributes.contenteditable=="true")&&b.push("nestedEditable",true);if(b.length)for(var a=CKEDITOR.tools.copy(a),f=0;f<b.length;f=f+2)a[b[f]]=b[f+1];return a}},true)})();
|
||||||
|
(function(){var a={},e=/{([^}]+)}/g,b=/([\\'])/g,c=/\n/g,d=/\r/g;CKEDITOR.template=function(f){if(a[f])this.output=a[f];else{var h=f.replace(b,"\\$1").replace(c,"\\n").replace(d,"\\r").replace(e,function(a,b){return"',data['"+b+"']==undefined?'{"+b+"}':data['"+b+"'],'"});this.output=a[f]=Function("data","buffer","return buffer?buffer.push('"+h+"'):['"+h+"'].join('');")}}})();delete CKEDITOR.loadFullCore;CKEDITOR.instances={};CKEDITOR.document=new CKEDITOR.dom.document(document);
|
||||||
|
CKEDITOR.add=function(a){CKEDITOR.instances[a.name]=a;a.on("focus",function(){if(CKEDITOR.currentInstance!=a){CKEDITOR.currentInstance=a;CKEDITOR.fire("currentInstance")}});a.on("blur",function(){if(CKEDITOR.currentInstance==a){CKEDITOR.currentInstance=null;CKEDITOR.fire("currentInstance")}});CKEDITOR.fire("instance",null,a)};CKEDITOR.remove=function(a){delete CKEDITOR.instances[a.name]};
|
||||||
|
(function(){var a={};CKEDITOR.addTemplate=function(e,b){var c=a[e];if(c)return c;c={name:e,source:b};CKEDITOR.fire("template",c);return a[e]=new CKEDITOR.template(c.source)};CKEDITOR.getTemplate=function(e){return a[e]}})();(function(){var a=[];CKEDITOR.addCss=function(e){a.push(e)};CKEDITOR.getCss=function(){return a.join("\n")}})();CKEDITOR.on("instanceDestroyed",function(){CKEDITOR.tools.isEmpty(this.instances)&&CKEDITOR.fire("reset")});CKEDITOR.TRISTATE_ON=1;CKEDITOR.TRISTATE_OFF=2;
|
||||||
|
CKEDITOR.TRISTATE_DISABLED=0;
|
||||||
|
(function(){CKEDITOR.inline=function(a,e){if(!CKEDITOR.env.isCompatible)return null;a=CKEDITOR.dom.element.get(a);if(a.getEditor())throw'The editor instance "'+a.getEditor().name+'" is already attached to the provided element.';var b=new CKEDITOR.editor(e,a,CKEDITOR.ELEMENT_MODE_INLINE),c=a.is("textarea")?a:null;if(c){b.setData(c.getValue(),null,true);a=CKEDITOR.dom.element.createFromHtml('<div contenteditable="'+!!b.readOnly+'" class="cke_textarea_inline">'+c.getValue()+"</div>",CKEDITOR.document);
|
||||||
|
a.insertAfter(c);c.hide();c.$.form&&b._attachToForm()}else b.setData(a.getHtml(),null,true);b.on("loaded",function(){b.fire("uiReady");b.editable(a);b.container=a;b.setData(b.getData(1));b.resetDirty();b.fire("contentDom");b.mode="wysiwyg";b.fire("mode");b.status="ready";b.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,b)},null,null,1E4);b.on("destroy",function(){if(c){b.container.clearCustomData();b.container.remove();c.show()}b.element.clearCustomData();delete b.element});return b};
|
||||||
|
CKEDITOR.inlineAll=function(){var a,e,b;for(b in CKEDITOR.dtd.$editable)for(var c=CKEDITOR.document.getElementsByTag(b),d=0,f=c.count();d<f;d++){a=c.getItem(d);if(a.getAttribute("contenteditable")=="true"){e={element:a,config:{}};CKEDITOR.fire("inline",e)!==false&&CKEDITOR.inline(a,e.config)}}};CKEDITOR.domReady(function(){!CKEDITOR.disableAutoInline&&CKEDITOR.inlineAll()})})();CKEDITOR.replaceClass="ckeditor";
|
||||||
|
(function(){function a(a,c,h,n){if(!CKEDITOR.env.isCompatible)return null;a=CKEDITOR.dom.element.get(a);if(a.getEditor())throw'The editor instance "'+a.getEditor().name+'" is already attached to the provided element.';var i=new CKEDITOR.editor(c,a,n);if(n==CKEDITOR.ELEMENT_MODE_REPLACE){a.setStyle("visibility","hidden");i._.required=a.hasAttribute("required");a.removeAttribute("required")}h&&i.setData(h,null,true);i.on("loaded",function(){b(i);n==CKEDITOR.ELEMENT_MODE_REPLACE&&(i.config.autoUpdateElement&&
|
||||||
|
a.$.form)&&i._attachToForm();i.setMode(i.config.startupMode,function(){i.resetDirty();i.status="ready";i.fireOnce("instanceReady");CKEDITOR.fire("instanceReady",null,i)})});i.on("destroy",e);return i}function e(){var a=this.container,b=this.element;if(a){a.clearCustomData();a.remove()}if(b){b.clearCustomData();if(this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE){b.show();this._.required&&b.setAttribute("required","required")}delete this.element}}function b(a){var b=a.name,e=a.element,n=a.elementMode,
|
||||||
|
i=a.fire("uiSpace",{space:"top",html:""}).html,k=a.fire("uiSpace",{space:"bottom",html:""}).html;c||(c=CKEDITOR.addTemplate("maincontainer",'<{outerEl} id="cke_{name}" class="{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} '+CKEDITOR.env.cssClass+'" dir="{langDir}" lang="{langCode}" role="application" aria-labelledby="cke_{name}_arialbl"><span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span><{outerEl} class="cke_inner cke_reset" role="presentation">{topHtml}<{outerEl} id="{contentId}" class="cke_contents cke_reset" role="presentation"></{outerEl}>{bottomHtml}</{outerEl}></{outerEl}>'));
|
||||||
|
b=CKEDITOR.dom.element.createFromHtml(c.output({id:a.id,name:b,langDir:a.lang.dir,langCode:a.langCode,voiceLabel:[a.lang.editor,a.name].join(", "),topHtml:i?'<span id="'+a.ui.spaceId("top")+'" class="cke_top cke_reset_all" role="presentation" style="height:auto">'+i+"</span>":"",contentId:a.ui.spaceId("contents"),bottomHtml:k?'<span id="'+a.ui.spaceId("bottom")+'" class="cke_bottom cke_reset_all" role="presentation">'+k+"</span>":"",outerEl:CKEDITOR.env.ie?"span":"div"}));if(n==CKEDITOR.ELEMENT_MODE_REPLACE){e.hide();
|
||||||
|
b.insertAfter(e)}else e.append(b);a.container=b;i&&a.ui.space("top").unselectable();k&&a.ui.space("bottom").unselectable();e=a.config.width;n=a.config.height;e&&b.setStyle("width",CKEDITOR.tools.cssLength(e));n&&a.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(n));b.disableContextMenu();CKEDITOR.env.webkit&&b.on("focus",function(){a.focus()});a.fireOnce("uiReady")}CKEDITOR.replace=function(b,c){return a(b,c,null,CKEDITOR.ELEMENT_MODE_REPLACE)};CKEDITOR.appendTo=function(b,c,e){return a(b,
|
||||||
|
c,e,CKEDITOR.ELEMENT_MODE_APPENDTO)};CKEDITOR.replaceAll=function(){for(var a=document.getElementsByTagName("textarea"),b=0;b<a.length;b++){var c=null,e=a[b];if(e.name||e.id){if(typeof arguments[0]=="string"){if(!RegExp("(?:^|\\s)"+arguments[0]+"(?:$|\\s)").test(e.className))continue}else if(typeof arguments[0]=="function"){c={};if(arguments[0](e,c)===false)continue}this.replace(e,c)}}};CKEDITOR.editor.prototype.addMode=function(a,b){(this._.modes||(this._.modes={}))[a]=b};CKEDITOR.editor.prototype.setMode=
|
||||||
|
function(a,b){var c=this,e=this._.modes;if(!(a==c.mode||!e||!e[a])){c.fire("beforeSetMode",a);if(c.mode){var i=c.checkDirty(),e=c._.previousModeData,k,o=0;c.fire("beforeModeUnload");c.editable(0);c._.previousMode=c.mode;c._.previousModeData=k=c.getData(1);if(c.mode=="source"&&e==k){c.fire("lockSnapshot",{forceUpdate:true});o=1}c.ui.space("contents").setHtml("");c.mode=""}else c._.previousModeData=c.getData(1);this._.modes[a](function(){c.mode=a;i!==void 0&&!i&&c.resetDirty();o?c.fire("unlockSnapshot"):
|
||||||
|
a=="wysiwyg"&&c.fire("saveSnapshot");setTimeout(function(){c.fire("mode");b&&b.call(c)},0)})}};CKEDITOR.editor.prototype.resize=function(a,b,c,e){var i=this.container,k=this.ui.space("contents"),o=CKEDITOR.env.webkit&&this.document&&this.document.getWindow().$.frameElement,e=e?i.getChild(1):i;e.setSize("width",a,true);o&&(o.style.width="1%");k.setStyle("height",Math.max(b-(c?0:(e.$.offsetHeight||0)-(k.$.clientHeight||0)),0)+"px");o&&(o.style.width="100%");this.fire("resize")};CKEDITOR.editor.prototype.getResizable=
|
||||||
|
function(a){return a?this.ui.space("contents"):this.container};var c;CKEDITOR.domReady(function(){CKEDITOR.replaceClass&&CKEDITOR.replaceAll(CKEDITOR.replaceClass)})})();CKEDITOR.config.startupMode="wysiwyg";
|
||||||
|
(function(){function a(a){var b=a.editor,d=a.data.path,f=d.blockLimit,l=a.data.selection,j=l.getRanges()[0],m;if(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)if(l=e(l,d)){l.appendBogus();m=CKEDITOR.env.ie}if(b.config.autoParagraph!==false&&b.activeEnterMode!=CKEDITOR.ENTER_BR&&b.editable().equals(f)&&!d.block&&j.collapsed&&!j.getCommonAncestor().isReadOnly()){d=j.clone();d.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);f=new CKEDITOR.dom.walker(d);f.guard=function(a){return!c(a)||a.type==
|
||||||
|
CKEDITOR.NODE_COMMENT||a.isReadOnly()};if(!f.checkForward()||d.checkStartOfBlock()&&d.checkEndOfBlock()){b=j.fixBlock(true,b.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p");if(!CKEDITOR.env.needsBrFiller)(b=b.getFirst(c))&&(b.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(b.getText()).match(/^(?: |\xa0)$/))&&b.remove();m=1;a.cancel()}}m&&j.select()}function e(a,b){if(a.isFake)return 0;var d=b.block||b.blockLimit,e=d&&d.getLast(c);if(d&&d.isBlockBoundary()&&(!e||!(e.type==CKEDITOR.NODE_ELEMENT&&
|
||||||
|
e.isBlockBoundary()))&&!d.is("pre")&&!d.getBogus())return d}function b(a){var b=a.data.getTarget();if(b.is("input")){b=b.getAttribute("type");(b=="submit"||b=="reset")&&a.data.preventDefault()}}function c(a){return o(a)&&s(a)}function d(a,b){return function(c){var d=CKEDITOR.dom.element.get(c.data.$.toElement||c.data.$.fromElement||c.data.$.relatedTarget);(!d||!b.equals(d)&&!b.contains(d))&&a.call(this,c)}}function f(a){var b,d=a.getRanges()[0],e=a.root,f={table:1,ul:1,ol:1,dl:1};if(d.startPath().contains(f)){var a=
|
||||||
|
function(a){return function(d,e){e&&(d.type==CKEDITOR.NODE_ELEMENT&&d.is(f))&&(b=d);if(!e&&c(d)&&(!a||!i(d)))return false}},j=d.clone();j.collapse(1);j.setStartAt(e,CKEDITOR.POSITION_AFTER_START);e=new CKEDITOR.dom.walker(j);e.guard=a();e.checkBackward();if(b){j=d.clone();j.collapse();j.setEndAt(b,CKEDITOR.POSITION_AFTER_END);e=new CKEDITOR.dom.walker(j);e.guard=a(true);b=false;e.checkForward();return b}}return null}function h(a){a.editor.focus();a.editor.fire("saveSnapshot")}function n(a){var b=
|
||||||
|
a.editor;b.getSelection().scrollIntoView();setTimeout(function(){b.fire("saveSnapshot")},0)}CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,$:function(a,b){this.base(b.$||b);this.editor=a;this.status="unloaded";this.hasFocus=false;this.setup()},proto:{focus:function(){var a;if(CKEDITOR.env.webkit&&!this.hasFocus){a=this.editor._.previousActive||this.getDocument().getActive();if(this.contains(a)){a.focus();return}}try{this.$[CKEDITOR.env.ie&&this.getDocument().equals(CKEDITOR.document)?
|
||||||
|
"setActive":"focus"]()}catch(b){if(!CKEDITOR.env.ie)throw b;}if(CKEDITOR.env.safari&&!this.isInline()){a=CKEDITOR.document.getActive();a.equals(this.getWindow().getFrame())||this.getWindow().focus()}},on:function(a,b){var c=Array.prototype.slice.call(arguments,0);if(CKEDITOR.env.ie&&/^focus|blur$/.exec(a)){a=a=="focus"?"focusin":"focusout";b=d(b,this);c[0]=a;c[1]=b}return CKEDITOR.dom.element.prototype.on.apply(this,c)},attachListener:function(a,b,c,d,e,f){!this._.listeners&&(this._.listeners=[]);
|
||||||
|
var m=Array.prototype.slice.call(arguments,1),m=a.on.apply(a,m);this._.listeners.push(m);return m},clearListeners:function(){var a=this._.listeners;try{for(;a.length;)a.pop().removeListener()}catch(b){}},restoreAttrs:function(){var a=this._.attrChanges,b,c;for(c in a)if(a.hasOwnProperty(c)){b=a[c];b!==null?this.setAttribute(c,b):this.removeAttribute(c)}},attachClass:function(a){var b=this.getCustomData("classes");if(!this.hasClass(a)){!b&&(b=[]);b.push(a);this.setCustomData("classes",b);this.addClass(a)}},
|
||||||
|
changeAttr:function(a,b){var c=this.getAttribute(a);if(b!==c){!this._.attrChanges&&(this._.attrChanges={});a in this._.attrChanges||(this._.attrChanges[a]=c);this.setAttribute(a,b)}},insertHtml:function(a,b){h(this);r(this,b||"html",a)},insertText:function(a){h(this);var b=this.editor,c=b.getSelection().getStartElement().hasAscendant("pre",true)?CKEDITOR.ENTER_BR:b.activeEnterMode,b=c==CKEDITOR.ENTER_BR,d=CKEDITOR.tools,a=d.htmlEncode(a.replace(/\r\n/g,"\n")),a=a.replace(/\t/g," "),
|
||||||
|
c=c==CKEDITOR.ENTER_P?"p":"div";if(!b){var e=/\n{2}/g;if(e.test(a))var f="<"+c+">",m="</"+c+">",a=f+a.replace(e,function(){return m+f})+m}a=a.replace(/\n/g,"<br>");b||(a=a.replace(RegExp("<br>(?=</"+c+">)"),function(a){return d.repeat(a,2)}));a=a.replace(/^ | $/g," ");a=a.replace(/(>|\s) /g,function(a,b){return b+" "}).replace(/ (?=<)/g," ");r(this,"text",a)},insertElement:function(a,b){b?this.insertElementIntoRange(a,b):this.insertElementIntoSelection(a)},insertElementIntoRange:function(a,
|
||||||
|
b){var c=this.editor,d=c.config.enterMode,e=a.getName(),f=CKEDITOR.dtd.$block[e];if(b.checkReadOnly())return false;b.deleteContents(1);b.startContainer.type==CKEDITOR.NODE_ELEMENT&&b.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})&&v(b);var m,h;if(f)for(;(m=b.getCommonAncestor(0,1))&&(h=CKEDITOR.dtd[m.getName()])&&(!h||!h[e]);)if(m.getName()in CKEDITOR.dtd.span)b.splitElement(m);else if(b.checkStartOfBlock()&&b.checkEndOfBlock()){b.setStartBefore(m);b.collapse(true);m.remove()}else b.splitBlock(d==
|
||||||
|
CKEDITOR.ENTER_DIV?"div":"p",c.editable());b.insertNode(a);return true},insertElementIntoSelection:function(a){h(this);var b=this.editor,d=b.activeEnterMode,b=b.getSelection(),e=b.getRanges()[0],f=a.getName(),f=CKEDITOR.dtd.$block[f];if(this.insertElementIntoRange(a,e)){e.moveToPosition(a,CKEDITOR.POSITION_AFTER_END);if(f)if((f=a.getNext(function(a){return c(a)&&!i(a)}))&&f.type==CKEDITOR.NODE_ELEMENT&&f.is(CKEDITOR.dtd.$block))f.getDtd()["#"]?e.moveToElementEditStart(f):e.moveToElementEditEnd(a);
|
||||||
|
else if(!f&&d!=CKEDITOR.ENTER_BR){f=e.fixBlock(true,d==CKEDITOR.ENTER_DIV?"div":"p");e.moveToElementEditStart(f)}}b.selectRanges([e]);n(this)},setData:function(a,b){b||(a=this.editor.dataProcessor.toHtml(a));this.setHtml(a);if(this.status=="unloaded")this.status="ready";this.editor.fire("dataReady")},getData:function(a){var b=this.getHtml();a||(b=this.editor.dataProcessor.toDataFormat(b));return b},setReadOnly:function(a){this.setAttribute("contenteditable",!a)},detach:function(){this.removeClass("cke_editable");
|
||||||
|
this.status="detached";var a=this.editor;this._.detach();delete a.document;delete a.window},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},setup:function(){var a=this.editor;this.attachListener(a,"beforeGetData",function(){var b=this.getData();this.is("textarea")||a.config.ignoreEmptyParagraph!==false&&(b=b.replace(k,function(a,b){return b}));a.setData(b,null,1)},this);this.attachListener(a,"getSnapshot",function(a){a.data=this.getData(1)},this);this.attachListener(a,"afterSetData",
|
||||||
|
function(){this.setData(a.getData(1))},this);this.attachListener(a,"loadSnapshot",function(a){this.setData(a.data,1)},this);this.attachListener(a,"beforeFocus",function(){var b=a.getSelection();(b=b&&b.getNative())&&b.type=="Control"||this.focus()},this);this.attachListener(a,"insertHtml",function(a){this.insertHtml(a.data.dataValue,a.data.mode)},this);this.attachListener(a,"insertElement",function(a){this.insertElement(a.data)},this);this.attachListener(a,"insertText",function(a){this.insertText(a.data)},
|
||||||
|
this);this.setReadOnly(a.readOnly);this.attachClass("cke_editable");this.attachClass(a.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"cke_editable_inline":a.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE||a.elementMode==CKEDITOR.ELEMENT_MODE_APPENDTO?"cke_editable_themed":"");this.attachClass("cke_contents_"+a.config.contentsLangDirection);a.keystrokeHandler.blockedKeystrokes[8]=+a.readOnly;a.keystrokeHandler.attach(this);this.on("blur",function(){this.hasFocus=false},null,null,-1);this.on("focus",function(){this.hasFocus=
|
||||||
|
true},null,null,-1);a.focusManager.add(this);if(this.equals(CKEDITOR.document.getActive())){this.hasFocus=true;a.once("contentDom",function(){a.focusManager.focus()})}this.isInline()&&this.changeAttr("tabindex",a.tabIndex);if(!this.is("textarea")){a.document=this.getDocument();a.window=this.getWindow();var d=a.document;this.changeAttr("spellcheck",!a.config.disableNativeSpellChecker);var e=a.config.contentsLangDirection;this.getDirection(1)!=e&&this.changeAttr("dir",e);var h=CKEDITOR.getCss();if(h){e=
|
||||||
|
d.getHead();if(!e.getCustomData("stylesheet")){h=d.appendStyleText(h);h=new CKEDITOR.dom.element(h.ownerNode||h.owningElement);e.setCustomData("stylesheet",h);h.data("cke-temp",1)}}e=d.getCustomData("stylesheet_ref")||0;d.setCustomData("stylesheet_ref",e+1);this.setCustomData("cke_includeReadonly",!a.config.disableReadonlyStyling);this.attachListener(this,"click",function(a){var a=a.data,b=(new CKEDITOR.dom.elementPath(a.getTarget(),this)).contains("a");b&&(a.$.button!=2&&b.isReadOnly())&&a.preventDefault()});
|
||||||
|
var l={8:1,46:1};this.attachListener(a,"key",function(b){if(a.readOnly)return true;var c=b.data.domEvent.getKey(),d;if(c in l){var b=a.getSelection(),e,q=b.getRanges()[0],h=q.startPath(),i,k,p,c=c==8;if(CKEDITOR.env.ie&&CKEDITOR.env.version<11&&(e=b.getSelectedElement())||(e=f(b))){a.fire("saveSnapshot");q.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);e.remove();q.select();a.fire("saveSnapshot");d=1}else if(q.collapsed)if((i=h.block)&&(p=i[c?"getPrevious":"getNext"](o))&&p.type==CKEDITOR.NODE_ELEMENT&&
|
||||||
|
p.is("table")&&q[c?"checkStartOfBlock":"checkEndOfBlock"]()){a.fire("saveSnapshot");q[c?"checkEndOfBlock":"checkStartOfBlock"]()&&i.remove();q["moveToElementEdit"+(c?"End":"Start")](p);q.select();a.fire("saveSnapshot");d=1}else if(h.blockLimit&&h.blockLimit.is("td")&&(k=h.blockLimit.getAscendant("table"))&&q.checkBoundaryOfElement(k,c?CKEDITOR.START:CKEDITOR.END)&&(p=k[c?"getPrevious":"getNext"](o))){a.fire("saveSnapshot");q["moveToElementEdit"+(c?"End":"Start")](p);q.checkStartOfBlock()&&q.checkEndOfBlock()?
|
||||||
|
p.remove():q.select();a.fire("saveSnapshot");d=1}else if((k=h.contains(["td","th","caption"]))&&q.checkBoundaryOfElement(k,c?CKEDITOR.START:CKEDITOR.END))d=1}return!d});a.blockless&&(CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)&&this.attachListener(this,"keyup",function(b){if(b.data.getKeystroke()in l&&!this.getFirst(c)){this.appendBogus();b=a.createRange();b.moveToPosition(this,CKEDITOR.POSITION_AFTER_START);b.select()}});this.attachListener(this,"dblclick",function(b){if(a.readOnly)return false;
|
||||||
|
b={element:b.data.getTarget()};a.fire("doubleclick",b)});CKEDITOR.env.ie&&this.attachListener(this,"click",b);CKEDITOR.env.ie||this.attachListener(this,"mousedown",function(b){var c=b.data.getTarget();if(c.is("img","hr","input","textarea","select")&&!c.isReadOnly()){a.getSelection().selectElement(c);c.is("input","textarea","select")&&b.data.preventDefault()}});CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(b){if(b.data.$.button==2){b=b.data.getTarget();if(!b.getOuterHtml().replace(k,
|
||||||
|
"")){var c=a.createRange();c.moveToElementEditStart(b);c.select(true)}}});if(CKEDITOR.env.webkit){this.attachListener(this,"click",function(a){a.data.getTarget().is("input","select")&&a.data.preventDefault()});this.attachListener(this,"mouseup",function(a){a.data.getTarget().is("input","textarea")&&a.data.preventDefault()})}CKEDITOR.env.webkit&&this.attachListener(a,"key",function(b){b=b.data.domEvent.getKey();if(b in l){var b=b==8,c=a.getSelection(),d=c.getRanges()[0],e=d.startPath(),f=e.block;if(d.collapsed&&
|
||||||
|
f&&d[b?"checkStartOfBlock":"checkEndOfBlock"]()&&d.moveToClosestEditablePosition(f,!b)&&d.collapsed){if(d.startContainer.type==CKEDITOR.NODE_ELEMENT){var h=d.startContainer.getChild(d.startOffset-(b?1:0));if(h&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("hr")){a.fire("saveSnapshot");h.remove();a.fire("saveSnapshot");return false}}if((d=d.startPath().block)&&(!d||!d.contains(f))){a.fire("saveSnapshot");for(var i=f.getCommonAncestor(d),k=b?f:d,h=k;(k=k.getParent())&&!i.equals(k)&&k.getChildCount()==1;)h=k;
|
||||||
|
var p;(p=(b?d:f).getBogus())&&p.remove();p=c.createBookmarks();(b?f:d).moveChildren(b?d:f,false);e.lastElement.mergeSiblings();h.remove();c.selectBookmarks(p);a.fire("saveSnapshot");return false}}}},this,null,100)}}},_:{detach:function(){this.editor.setData(this.editor.getData(),0,1);this.clearListeners();this.restoreAttrs();var a;if(a=this.removeCustomData("classes"))for(;a.length;)this.removeClass(a.pop());if(!this.is("textarea")){a=this.getDocument();var b=a.getHead();if(b.getCustomData("stylesheet")){var c=
|
||||||
|
a.getCustomData("stylesheet_ref");if(--c)a.setCustomData("stylesheet_ref",c);else{a.removeCustomData("stylesheet_ref");b.removeCustomData("stylesheet").remove()}}}this.editor.fire("contentDomUnload");delete this.editor}}});CKEDITOR.editor.prototype.editable=function(a){var b=this._.editable;if(b&&a)return 0;if(arguments.length)b=this._.editable=a?a instanceof CKEDITOR.editable?a:new CKEDITOR.editable(this,a):(b&&b.detach(),null);return b};var i=CKEDITOR.dom.walker.bogus(),k=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,
|
||||||
|
o=CKEDITOR.dom.walker.whitespaces(true),s=CKEDITOR.dom.walker.bookmark(false,true);CKEDITOR.on("instanceLoaded",function(b){var c=b.editor;c.on("insertElement",function(a){a=a.data;if(a.type==CKEDITOR.NODE_ELEMENT&&(a.is("input")||a.is("textarea"))){a.getAttribute("contentEditable")!="false"&&a.data("cke-editable",a.hasAttribute("contenteditable")?"true":"1");a.setAttribute("contentEditable",false)}});c.on("selectionChange",function(b){if(!c.readOnly){var d=c.getSelection();if(d&&!d.isLocked){d=c.checkDirty();
|
||||||
|
c.fire("lockSnapshot");a(b);c.fire("unlockSnapshot");!d&&c.resetDirty()}}})});CKEDITOR.on("instanceCreated",function(a){var b=a.editor;b.on("mode",function(){var a=b.editable();if(a&&a.isInline()){var c=b.title;a.changeAttr("role","textbox");a.changeAttr("aria-label",c);c&&a.changeAttr("title",c);if(c=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents")){var d=CKEDITOR.tools.getNextId(),e=CKEDITOR.dom.element.createFromHtml('<span id="'+d+'" class="cke_voice_label">'+this.lang.common.editorHelp+
|
||||||
|
"</span>");c.append(e);a.changeAttr("aria-describedby",d)}}})});CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");var r=function(){function a(b){return b.type==CKEDITOR.NODE_ELEMENT}function b(c,d){var e,f,j,l,t=[],q=d.range.startContainer;e=d.range.startPath();for(var q=m[q.getName()],h=0,k=c.getChildren(),i=k.count(),u=-1,o=-1,n=0,s=e.contains(m.$list);h<i;++h){e=k.getItem(h);if(a(e)){j=e.getName();if(s&&j in CKEDITOR.dtd.$list)t=
|
||||||
|
t.concat(b(e,d));else{l=!!q[j];if(j=="br"&&e.data("cke-eol")&&(!h||h==i-1)){n=(f=h?t[h-1].node:k.getItem(h+1))&&(!a(f)||!f.is("br"));f=f&&a(f)&&m.$block[f.getName()]}u==-1&&!l&&(u=h);l||(o=h);t.push({isElement:1,isLineBreak:n,isBlock:e.isBlockBoundary(),hasBlockSibling:f,node:e,name:j,allowed:l});f=n=0}}else t.push({isElement:0,node:e,allowed:1})}if(u>-1)t[u].firstNotAllowed=1;if(o>-1)t[o].lastNotAllowed=1;return t}function d(b,c){var e=[],f=b.getChildren(),j=f.count(),l,t=0,q=m[c],h=!b.is(m.$inline)||
|
||||||
|
b.is("br");for(h&&e.push(" ");t<j;t++){l=f.getItem(t);a(l)&&!l.is(q)?e=e.concat(d(l,c)):e.push(l)}h&&e.push(" ");return e}function e(b){return b&&a(b)&&(b.is(m.$removeEmpty)||b.is("a")&&!b.isBlockBoundary())}function f(b,c,d,e){var j=b.clone(),m,t;j.setEndAt(c,CKEDITOR.POSITION_BEFORE_END);if((m=(new CKEDITOR.dom.walker(j)).next())&&a(m)&&h[m.getName()]&&(t=m.getPrevious())&&a(t)&&!t.getParent().equals(b.startContainer)&&d.contains(t)&&e.contains(m)&&m.isIdentical(t)){m.moveChildren(t);m.remove();
|
||||||
|
f(b,c,d,e)}}function j(b,c){function d(b,c){if(c.isBlock&&c.isElement&&!c.node.is("br")&&a(b)&&b.is("br")){b.remove();return 1}}var e=c.endContainer.getChild(c.endOffset),f=c.endContainer.getChild(c.endOffset-1);e&&d(e,b[b.length-1]);if(f&&d(f,b[0])){c.setEnd(c.endContainer,c.endOffset-1);c.collapse()}}var m=CKEDITOR.dtd,h={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},k={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},q=CKEDITOR.tools.extend({},m.$inline);delete q.br;return function(h,
|
||||||
|
i,u){var o=h.editor;h.getDocument();var s=o.getSelection().getRanges()[0],r=false;if(i=="unfiltered_html"){i="html";r=true}if(!s.checkReadOnly()){var t=(new CKEDITOR.dom.elementPath(s.startContainer,s.root)).blockLimit||s.root,i={type:i,dontFilter:r,editable:h,editor:o,range:s,blockLimit:t,mergeCandidates:[],zombies:[]},o=i.range,r=i.mergeCandidates,x,y,B,w;if(i.type=="text"&&o.shrink(CKEDITOR.SHRINK_ELEMENT,true,false)){x=CKEDITOR.dom.element.createFromHtml("<span> </span>",o.document);o.insertNode(x);
|
||||||
|
o.setStartAfter(x)}y=new CKEDITOR.dom.elementPath(o.startContainer);i.endPath=B=new CKEDITOR.dom.elementPath(o.endContainer);if(!o.collapsed){var t=B.block||B.blockLimit,N=o.getCommonAncestor();t&&(!t.equals(N)&&!t.contains(N)&&o.checkEndOfBlock())&&i.zombies.push(t);o.deleteContents()}for(;(w=a(o.startContainer)&&o.startContainer.getChild(o.startOffset-1))&&a(w)&&w.isBlockBoundary()&&y.contains(w);)o.moveToPosition(w,CKEDITOR.POSITION_BEFORE_END);f(o,i.blockLimit,y,B);if(x){o.setEndBefore(x);o.collapse();
|
||||||
|
x.remove()}x=o.startPath();if(t=x.contains(e,false,1)){o.splitElement(t);i.inlineStylesRoot=t;i.inlineStylesPeak=x.lastElement}x=o.createBookmark();(t=x.startNode.getPrevious(c))&&a(t)&&e(t)&&r.push(t);(t=x.startNode.getNext(c))&&a(t)&&e(t)&&r.push(t);for(t=x.startNode;(t=t.getParent())&&e(t);)r.push(t);o.moveToBookmark(x);if(x=u){x=i.range;if(i.type=="text"&&i.inlineStylesRoot){w=i.inlineStylesPeak;o=w.getDocument().createText("{cke-peak}");for(r=i.inlineStylesRoot.getParent();!w.equals(r);){o=o.appendTo(w.clone());
|
||||||
|
w=w.getParent()}u=o.getOuterHtml().split("{cke-peak}").join(u)}w=i.blockLimit.getName();if(/^\s+|\s+$/.test(u)&&"span"in CKEDITOR.dtd[w])var M='<span data-cke-marker="1"> </span>',u=M+u+M;u=i.editor.dataProcessor.toHtml(u,{context:null,fixForBody:false,dontFilter:i.dontFilter,filter:i.editor.activeFilter,enterMode:i.editor.activeEnterMode});w=x.document.createElement("body");w.setHtml(u);if(M){w.getFirst().remove();w.getLast().remove()}if((M=x.startPath().block)&&!(M.getChildCount()==1&&M.getBogus()))a:{var D;
|
||||||
|
if(w.getChildCount()==1&&a(D=w.getFirst())&&D.is(k)){M=D.getElementsByTag("*");x=0;for(r=M.count();x<r;x++){o=M.getItem(x);if(!o.is(q))break a}D.moveChildren(D.getParent(1));D.remove()}}i.dataWrapper=w;x=u}if(x){D=i.range;var M=D.document,v,u=i.blockLimit;x=0;var I;w=[];var E,Q,r=o=0,K,S;y=D.startContainer;var t=i.endPath.elements[0],T;B=t.getPosition(y);N=!!t.getCommonAncestor(y)&&B!=CKEDITOR.POSITION_IDENTICAL&&!(B&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED);y=b(i.dataWrapper,i);
|
||||||
|
for(j(y,D);x<y.length;x++){B=y[x];if(v=B.isLineBreak){v=D;K=u;var O=void 0,W=void 0;if(B.hasBlockSibling)v=1;else{O=v.startContainer.getAscendant(m.$block,1);if(!O||!O.is({div:1,p:1}))v=0;else{W=O.getPosition(K);if(W==CKEDITOR.POSITION_IDENTICAL||W==CKEDITOR.POSITION_CONTAINS)v=0;else{K=v.splitElement(O);v.moveToPosition(K,CKEDITOR.POSITION_AFTER_START);v=1}}}}if(v)r=x>0;else{v=D.startPath();if(!B.isBlock&&i.editor.config.autoParagraph!==false&&(i.editor.activeEnterMode!=CKEDITOR.ENTER_BR&&i.editor.editable().equals(v.blockLimit)&&
|
||||||
|
!v.block)&&(Q=i.editor.activeEnterMode!=CKEDITOR.ENTER_BR&&i.editor.config.autoParagraph!==false?i.editor.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p":false)){Q=M.createElement(Q);Q.appendBogus();D.insertNode(Q);CKEDITOR.env.needsBrFiller&&(I=Q.getBogus())&&I.remove();D.moveToPosition(Q,CKEDITOR.POSITION_BEFORE_END)}if((v=D.startPath().block)&&!v.equals(E)){if(I=v.getBogus()){I.remove();w.push(v)}E=v}B.firstNotAllowed&&(o=1);if(o&&B.isElement){v=D.startContainer;for(K=null;v&&!m[v.getName()][B.name];){if(v.equals(u)){v=
|
||||||
|
null;break}K=v;v=v.getParent()}if(v){if(K){S=D.splitElement(K);i.zombies.push(S);i.zombies.push(K)}}else{K=u.getName();T=!x;v=x==y.length-1;K=d(B.node,K);for(var O=[],W=K.length,X=0,Z=void 0,$=0,aa=-1;X<W;X++){Z=K[X];if(Z==" "){if(!$&&(!T||X)){O.push(new CKEDITOR.dom.text(" "));aa=O.length}$=1}else{O.push(Z);$=0}}v&&aa==O.length&&O.pop();T=O}}if(T){for(;v=T.pop();)D.insertNode(v);T=0}else D.insertNode(B.node);if(B.lastNotAllowed&&x<y.length-1){(S=N?t:S)&&D.setEndAt(S,CKEDITOR.POSITION_AFTER_START);
|
||||||
|
o=0}D.collapse()}}i.dontMoveCaret=r;i.bogusNeededBlocks=w}I=i.range;var U;S=i.bogusNeededBlocks;for(T=I.createBookmark();E=i.zombies.pop();)if(E.getParent()){Q=I.clone();Q.moveToElementEditStart(E);Q.removeEmptyBlocksAtEnd()}if(S)for(;E=S.pop();)CKEDITOR.env.needsBrFiller?E.appendBogus():E.append(I.document.createText(" "));for(;E=i.mergeCandidates.pop();)E.mergeSiblings();I.moveToBookmark(T);if(!i.dontMoveCaret){for(E=a(I.startContainer)&&I.startContainer.getChild(I.startOffset-1);E&&a(E)&&!E.is(m.$empty);){if(E.isBlockBoundary())I.moveToPosition(E,
|
||||||
|
CKEDITOR.POSITION_BEFORE_END);else{if(e(E)&&E.getHtml().match(/(\s| )$/g)){U=null;break}U=I.clone();U.moveToPosition(E,CKEDITOR.POSITION_BEFORE_END)}E=E.getLast(c)}U&&I.moveToRange(U)}s.select();n(h)}}}(),v=function(){function a(b){b=new CKEDITOR.dom.walker(b);b.guard=function(a,b){if(b)return false;if(a.type==CKEDITOR.NODE_ELEMENT)return a.is(CKEDITOR.dtd.$tableContent)};b.evaluator=function(a){return a.type==CKEDITOR.NODE_ELEMENT};return b}function b(a,c,d){c=a.getDocument().createElement(c);
|
||||||
|
a.append(c,d);return c}function c(a){var b=a.count(),d;for(b;b-- >0;){d=a.getItem(b);if(!CKEDITOR.tools.trim(d.getHtml())){d.appendBogus();CKEDITOR.env.ie&&(CKEDITOR.env.version<9&&d.getChildCount())&&d.getFirst().remove()}}}return function(d){var e=d.startContainer,f=e.getAscendant("table",1),m=false;c(f.getElementsByTag("td"));c(f.getElementsByTag("th"));f=d.clone();f.setStart(e,0);f=a(f).lastBackward();if(!f){f=d.clone();f.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);f=a(f).lastForward();m=true}f||
|
||||||
|
(f=e);if(f.is("table")){d.setStartAt(f,CKEDITOR.POSITION_BEFORE_START);d.collapse(true);f.remove()}else{f.is({tbody:1,thead:1,tfoot:1})&&(f=b(f,"tr",m));f.is("tr")&&(f=b(f,f.getParent().is("thead")?"th":"td",m));(e=f.getBogus())&&e.remove();d.moveToPosition(f,m?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END)}}}()})();
|
||||||
|
(function(){function a(){var a=this._.fakeSelection,b;if(a){b=this.getSelection(1);if(!b||!b.isHidden()){a.reset();a=0}}if(!a){a=b||this.getSelection(1);if(!a||a.getType()==CKEDITOR.SELECTION_NONE)return}this.fire("selectionCheck",a);b=this.elementPath();if(!b.compare(this._.selectionPreviousPath)){if(CKEDITOR.env.webkit)this._.previousActive=this.document.getActive();this._.selectionPreviousPath=b;this.fire("selectionChange",{selection:a,path:b})}}function e(){r=true;if(!s){b.call(this);s=CKEDITOR.tools.setTimeout(b,
|
||||||
|
200,this)}}function b(){s=null;if(r){CKEDITOR.tools.setTimeout(a,0,this);r=false}}function c(a){function b(c,d){return!c||c.type==CKEDITOR.NODE_TEXT?false:a.clone()["moveToElementEdit"+(d?"End":"Start")](c)}if(!(a.root instanceof CKEDITOR.editable))return false;var c=a.startContainer,d=a.getPreviousNode(v,null,c),e=a.getNextNode(v,null,c);return b(d)||b(e,1)||!d&&!e&&!(c.type==CKEDITOR.NODE_ELEMENT&&c.isBlockBoundary()&&c.getBogus())?true:false}function d(a){return a.getCustomData("cke-fillingChar")}
|
||||||
|
function f(a,b){var c=a&&a.removeCustomData("cke-fillingChar");if(c){if(b!==false){var d,e=a.getDocument().getSelection().getNative(),f=e&&e.type!="None"&&e.getRangeAt(0);if(c.getLength()>1&&f&&f.intersectsNode(c.$)){d=[e.anchorOffset,e.focusOffset];f=e.focusNode==c.$&&e.focusOffset>0;e.anchorNode==c.$&&e.anchorOffset>0&&d[0]--;f&&d[1]--;var g;f=e;if(!f.isCollapsed){g=f.getRangeAt(0);g.setStart(f.anchorNode,f.anchorOffset);g.setEnd(f.focusNode,f.focusOffset);g=g.collapsed}g&&d.unshift(d.pop())}}c.setText(h(c.getText()));
|
||||||
|
if(d){c=e.getRangeAt(0);c.setStart(c.startContainer,d[0]);c.setEnd(c.startContainer,d[1]);e.removeAllRanges();e.addRange(c)}}}function h(a){return a.replace(/\u200B( )?/g,function(a){return a[1]?" ":""})}function n(a,b,c){var d=a.on("focus",function(a){a.cancel()},null,null,-100);if(CKEDITOR.env.ie)var e=a.getDocument().on("selectionchange",function(a){a.cancel()},null,null,-100);else{var f=new CKEDITOR.dom.range(a);f.moveToElementEditStart(a);var g=a.getDocument().$.createRange();g.setStart(f.startContainer.$,
|
||||||
|
f.startOffset);g.collapse(1);b.removeAllRanges();b.addRange(g)}c&&a.focus();d.removeListener();e&&e.removeListener()}function i(a){var b=CKEDITOR.dom.element.createFromHtml('<div data-cke-hidden-sel="1" data-cke-temp="1" style="'+(CKEDITOR.env.ie?"display:none":"position:fixed;top:0;left:-1000px")+'"> </div>',a.document);a.fire("lockSnapshot");a.editable().append(b);var c=a.getSelection(1),d=a.createRange(),e=c.root.on("selectionchange",function(a){a.cancel()},null,null,0);d.setStartAt(b,CKEDITOR.POSITION_AFTER_START);
|
||||||
|
d.setEndAt(b,CKEDITOR.POSITION_BEFORE_END);c.selectRanges([d]);e.removeListener();a.fire("unlockSnapshot");a._.hiddenSelectionContainer=b}function k(a){var b={37:1,39:1,8:1,46:1};return function(c){var d=c.data.getKeystroke();if(b[d]){var e=a.getSelection().getRanges(),f=e[0];if(e.length==1&&f.collapsed)if((d=f[d<38?"getPreviousEditableNode":"getNextEditableNode"]())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getAttribute("contenteditable")=="false"){a.getSelection().fake(d);c.data.preventDefault();c.cancel()}}}}
|
||||||
|
function o(a){for(var b=0;b<a.length;b++){var c=a[b];c.getCommonAncestor().isReadOnly()&&a.splice(b,1);if(!c.collapsed){if(c.startContainer.isReadOnly())for(var d=c.startContainer,e;d;){if((e=d.type==CKEDITOR.NODE_ELEMENT)&&d.is("body")||!d.isReadOnly())break;e&&d.getAttribute("contentEditable")=="false"&&c.setStartAfter(d);d=d.getParent()}d=c.startContainer;e=c.endContainer;var f=c.startOffset,g=c.endOffset,h=c.clone();d&&d.type==CKEDITOR.NODE_TEXT&&(f>=d.getLength()?h.setStartAfter(d):h.setStartBefore(d));
|
||||||
|
e&&e.type==CKEDITOR.NODE_TEXT&&(g?h.setEndAfter(e):h.setEndBefore(e));d=new CKEDITOR.dom.walker(h);d.evaluator=function(d){if(d.type==CKEDITOR.NODE_ELEMENT&&d.isReadOnly()){var e=c.clone();c.setEndBefore(d);c.collapsed&&a.splice(b--,1);if(!(d.getPosition(h.endContainer)&CKEDITOR.POSITION_CONTAINS)){e.setStartAfter(d);e.collapsed||a.splice(b+1,0,e)}return true}return false};d.next()}}return a}var s,r,v=CKEDITOR.dom.walker.invisible(1),g=function(){function a(b){return function(a){var c=a.editor.createRange();
|
||||||
|
c.moveToClosestEditablePosition(a.selected,b)&&a.editor.getSelection().selectRanges([c]);return false}}function b(a){return function(b){var c=b.editor,d=c.createRange(),e;if(!(e=d.moveToClosestEditablePosition(b.selected,a)))e=d.moveToClosestEditablePosition(b.selected,!a);e&&c.getSelection().selectRanges([d]);c.fire("saveSnapshot");b.selected.remove();if(!e){d.moveToElementEditablePosition(c.editable());c.getSelection().selectRanges([d])}c.fire("saveSnapshot");return false}}var c=a(),d=a(1);return{37:c,
|
||||||
|
38:c,39:d,40:d,8:b(),46:b(1)}}();CKEDITOR.on("instanceCreated",function(b){function c(){var a=d.getSelection();a&&a.removeAllRanges()}var d=b.editor;d.on("contentDom",function(){var b=d.document,c=CKEDITOR.document,g=d.editable(),j=b.getBody(),l=b.getDocumentElement(),h=g.isInline(),i,o;CKEDITOR.env.gecko&&g.attachListener(g,"focus",function(a){a.removeListener();if(i!==0)if((a=d.getSelection().getNative())&&a.isCollapsed&&a.anchorNode==g.$){a=d.createRange();a.moveToElementEditStart(g);a.select()}},
|
||||||
|
null,null,-2);g.attachListener(g,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){i&&CKEDITOR.env.webkit&&(i=d._.previousActive&&d._.previousActive.equals(b.getActive()));d.unlockSelection(i);i=0},null,null,-1);g.attachListener(g,"mousedown",function(){i=0});if(CKEDITOR.env.ie||h){var n=function(){o=new CKEDITOR.dom.selection(d.getSelection());o.lock()};p?g.attachListener(g,"beforedeactivate",n,null,null,-1):g.attachListener(d,"selectionCheck",n,null,null,-1);g.attachListener(g,CKEDITOR.env.webkit?
|
||||||
|
"DOMFocusOut":"blur",function(){d.lockSelection(o);i=1},null,null,-1);g.attachListener(g,"mousedown",function(){i=0})}if(CKEDITOR.env.ie&&!h){var t;g.attachListener(g,"mousedown",function(a){if(a.data.$.button==2){a=d.document.getSelection();if(!a||a.getType()==CKEDITOR.SELECTION_NONE)t=d.window.getScrollPosition()}});g.attachListener(g,"mouseup",function(a){if(a.data.$.button==2&&t){d.document.$.documentElement.scrollLeft=t.x;d.document.$.documentElement.scrollTop=t.y}t=null});if(b.$.compatMode!=
|
||||||
|
"BackCompat"){if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)l.on("mousedown",function(a){function b(a){a=a.data.$;if(e){var c=j.$.createTextRange();try{c.moveToPoint(a.x,a.y)}catch(d){}e.setEndPoint(g.compareEndPoints("StartToStart",c)<0?"EndToEnd":"StartToStart",c);e.select()}}function d(){l.removeListener("mousemove",b);c.removeListener("mouseup",d);l.removeListener("mouseup",d);e.select()}a=a.data;if(a.getTarget().is("html")&&a.$.y<l.$.clientHeight&&a.$.x<l.$.clientWidth){var e=j.$.createTextRange();
|
||||||
|
try{e.moveToPoint(a.$.x,a.$.y)}catch(f){}var g=e.duplicate();l.on("mousemove",b);c.on("mouseup",d);l.on("mouseup",d)}});if(CKEDITOR.env.version>7&&CKEDITOR.env.version<11){l.on("mousedown",function(a){if(a.data.getTarget().is("html")){c.on("mouseup",x);l.on("mouseup",x)}});var x=function(){c.removeListener("mouseup",x);l.removeListener("mouseup",x);var a=CKEDITOR.document.$.selection,d=a.createRange();a.type!="None"&&d.parentElement().ownerDocument==b.$&&d.select()}}}}g.attachListener(g,"selectionchange",
|
||||||
|
a,d);g.attachListener(g,"keyup",e,d);g.attachListener(g,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){d.forceNextSelectionCheck();d.selectionChange(1)});if(h&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko)){var y;g.attachListener(g,"mousedown",function(){y=1});g.attachListener(b.getDocumentElement(),"mouseup",function(){y&&e.call(d);y=0})}else g.attachListener(CKEDITOR.env.ie?g:b.getDocumentElement(),"mouseup",e,d);CKEDITOR.env.webkit&&g.attachListener(b,"keydown",function(a){switch(a.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:f(g)}},
|
||||||
|
null,null,-1);g.attachListener(g,"keydown",k(d),null,null,-1)});d.on("setData",function(){d.unlockSelection();CKEDITOR.env.webkit&&c()});d.on("contentDomUnload",function(){d.unlockSelection()});if(CKEDITOR.env.ie9Compat)d.on("beforeDestroy",c,null,null,9);d.on("dataReady",function(){delete d._.fakeSelection;delete d._.hiddenSelectionContainer;d.selectionChange(1)});d.on("loadSnapshot",function(){var a=d.editable().getLast(function(a){return a.type==CKEDITOR.NODE_ELEMENT});a&&a.hasAttribute("data-cke-hidden-sel")&&
|
||||||
|
a.remove()},null,null,100);d.on("key",function(a){if(d.mode=="wysiwyg"){var b=d.getSelection();if(b.isFake){var c=g[a.data.keyCode];if(c)return c({editor:d,selected:b.getSelectedElement(),selection:b,keyEvent:a})}}})});CKEDITOR.on("instanceReady",function(a){var b=a.editor;if(CKEDITOR.env.webkit){b.on("selectionChange",function(){var a=b.editable(),c=d(a);c&&(c.getCustomData("ready")?f(a):c.setCustomData("ready",1))},null,null,-1);b.on("beforeSetMode",function(){f(b.editable())},null,null,-1);var c,
|
||||||
|
e,a=function(){var a=b.editable();if(a)if(a=d(a)){var f=b.document.$.defaultView.getSelection();f.type=="Caret"&&f.anchorNode==a.$&&(e=1);c=a.getText();a.setText(h(c))}},g=function(){var a=b.editable();if(a)if(a=d(a)){a.setText(c);if(e){b.document.$.defaultView.getSelection().setPosition(a.$,a.getLength());e=0}}};b.on("beforeUndoImage",a);b.on("afterUndoImage",g);b.on("beforeGetData",a,null,null,0);b.on("getData",g)}});CKEDITOR.editor.prototype.selectionChange=function(b){(b?a:e).call(this)};CKEDITOR.editor.prototype.getSelection=
|
||||||
|
function(a){if((this._.savedSelection||this._.fakeSelection)&&!a)return this._.savedSelection||this._.fakeSelection;return(a=this.editable())&&this.mode=="wysiwyg"?new CKEDITOR.dom.selection(a):null};CKEDITOR.editor.prototype.lockSelection=function(a){a=a||this.getSelection(1);if(a.getType()!=CKEDITOR.SELECTION_NONE){!a.isLocked&&a.lock();this._.savedSelection=a;return true}return false};CKEDITOR.editor.prototype.unlockSelection=function(a){var b=this._.savedSelection;if(b){b.unlock(a);delete this._.savedSelection;
|
||||||
|
return true}return false};CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath};CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)};CKEDITOR.dom.range.prototype.select=function(){var a=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);a.selectRanges([this]);return a};CKEDITOR.SELECTION_NONE=1;CKEDITOR.SELECTION_TEXT=2;CKEDITOR.SELECTION_ELEMENT=3;var p=
|
||||||
|
typeof window.getSelection!="function",z=1;CKEDITOR.dom.selection=function(a){if(a instanceof CKEDITOR.dom.selection)var b=a,a=a.root;var c=a instanceof CKEDITOR.dom.element;this.rev=b?b.rev:z++;this.document=a instanceof CKEDITOR.dom.document?a:a.getDocument();this.root=a=c?a:this.document.getBody();this.isLocked=0;this._={cache:{}};if(b){CKEDITOR.tools.extend(this._.cache,b._.cache);this.isFake=b.isFake;this.isLocked=b.isLocked;return this}b=p?this.document.$.selection:this.document.getWindow().$.getSelection();
|
||||||
|
if(CKEDITOR.env.webkit)(b.type=="None"&&this.document.getActive().equals(a)||b.type=="Caret"&&b.anchorNode.nodeType==CKEDITOR.NODE_DOCUMENT)&&n(a,b);else if(CKEDITOR.env.gecko)b&&(this.document.getActive().equals(a)&&b.anchorNode&&b.anchorNode.nodeType==CKEDITOR.NODE_DOCUMENT)&&n(a,b,true);else if(CKEDITOR.env.ie){var d;try{d=this.document.getActive()}catch(e){}if(p)b.type=="None"&&(d&&d.equals(this.document.getDocumentElement()))&&n(a,null,true);else{(b=b&&b.anchorNode)&&(b=new CKEDITOR.dom.node(b));
|
||||||
|
d&&(d.equals(this.document.getDocumentElement())&&b&&(a.equals(b)||a.contains(b)))&&n(a,null,true)}}d=this.getNative();var f,g;if(d)if(d.getRangeAt)f=(g=d.rangeCount&&d.getRangeAt(0))&&new CKEDITOR.dom.node(g.commonAncestorContainer);else{try{g=d.createRange()}catch(h){}f=g&&CKEDITOR.dom.element.get(g.item&&g.item(0)||g.parentElement())}if(!f||!(f.type==CKEDITOR.NODE_ELEMENT||f.type==CKEDITOR.NODE_TEXT)||!this.root.equals(f)&&!this.root.contains(f)){this._.cache.type=CKEDITOR.SELECTION_NONE;this._.cache.startElement=
|
||||||
|
null;this._.cache.selectedElement=null;this._.cache.selectedText="";this._.cache.ranges=new CKEDITOR.dom.rangeList}return this};var A={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.dom.selection.prototype={getNative:function(){return this._.cache.nativeSel!==void 0?this._.cache.nativeSel:this._.cache.nativeSel=p?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:p?function(){var a=
|
||||||
|
this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_NONE;try{var c=this.getNative(),d=c.type;if(d=="Text")b=CKEDITOR.SELECTION_TEXT;if(d=="Control")b=CKEDITOR.SELECTION_ELEMENT;if(c.createRange().parentElement())b=CKEDITOR.SELECTION_TEXT}catch(e){}return a.type=b}:function(){var a=this._.cache;if(a.type)return a.type;var b=CKEDITOR.SELECTION_TEXT,c=this.getNative();if(!c||!c.rangeCount)b=CKEDITOR.SELECTION_NONE;else if(c.rangeCount==1){var c=c.getRangeAt(0),d=c.startContainer;if(d==c.endContainer&&
|
||||||
|
d.nodeType==1&&c.endOffset-c.startOffset==1&&A[d.childNodes[c.startOffset].nodeName.toLowerCase()])b=CKEDITOR.SELECTION_ELEMENT}return a.type=b},getRanges:function(){var a=p?function(){function a(b){return(new CKEDITOR.dom.node(b)).getIndex()}var b=function(b,c){b=b.duplicate();b.collapse(c);var d=b.parentElement();if(!d.hasChildNodes())return{container:d,offset:0};for(var e=d.children,f,g,h=b.duplicate(),i=0,l=e.length-1,t=-1,m,k;i<=l;){t=Math.floor((i+l)/2);f=e[t];h.moveToElementText(f);m=h.compareEndPoints("StartToStart",
|
||||||
|
b);if(m>0)l=t-1;else if(m<0)i=t+1;else return{container:d,offset:a(f)}}if(t==-1||t==e.length-1&&m<0){h.moveToElementText(d);h.setEndPoint("StartToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;e=d.childNodes;if(!h){f=e[e.length-1];return f.nodeType!=CKEDITOR.NODE_TEXT?{container:d,offset:e.length}:{container:f,offset:f.nodeValue.length}}for(d=e.length;h>0&&d>0;){g=e[--d];if(g.nodeType==CKEDITOR.NODE_TEXT){k=g;h=h-g.nodeValue.length}}return{container:k,offset:-h}}h.collapse(m>0?true:false);h.setEndPoint(m>
|
||||||
|
0?"StartToStart":"EndToStart",b);h=h.text.replace(/(\r\n|\r)/g,"\n").length;if(!h)return{container:d,offset:a(f)+(m>0?0:1)};for(;h>0;)try{g=f[m>0?"previousSibling":"nextSibling"];if(g.nodeType==CKEDITOR.NODE_TEXT){h=h-g.nodeValue.length;k=g}f=g}catch(o){return{container:d,offset:a(f)}}return{container:k,offset:m>0?-h:k.nodeValue.length+h}};return function(){var a=this.getNative(),c=a&&a.createRange(),d=this.getType();if(!a)return[];if(d==CKEDITOR.SELECTION_TEXT){a=new CKEDITOR.dom.range(this.root);
|
||||||
|
d=b(c,true);a.setStart(new CKEDITOR.dom.node(d.container),d.offset);d=b(c);a.setEnd(new CKEDITOR.dom.node(d.container),d.offset);a.endContainer.getPosition(a.startContainer)&CKEDITOR.POSITION_PRECEDING&&a.endOffset<=a.startContainer.getIndex()&&a.collapse();return[a]}if(d==CKEDITOR.SELECTION_ELEMENT){for(var d=[],e=0;e<c.length;e++){for(var f=c.item(e),g=f.parentNode,j=0,a=new CKEDITOR.dom.range(this.root);j<g.childNodes.length&&g.childNodes[j]!=f;j++);a.setStart(new CKEDITOR.dom.node(g),j);a.setEnd(new CKEDITOR.dom.node(g),
|
||||||
|
j+1);d.push(a)}return d}return[]}}():function(){var a=[],b,c=this.getNative();if(!c)return a;for(var d=0;d<c.rangeCount;d++){var e=c.getRangeAt(d);b=new CKEDITOR.dom.range(this.root);b.setStart(new CKEDITOR.dom.node(e.startContainer),e.startOffset);b.setEnd(new CKEDITOR.dom.node(e.endContainer),e.endOffset);a.push(b)}return a};return function(b){var c=this._.cache,d=c.ranges;if(!d)c.ranges=d=new CKEDITOR.dom.rangeList(a.call(this));return!b?d:o(new CKEDITOR.dom.rangeList(d.slice()))}}(),getStartElement:function(){var a=
|
||||||
|
this._.cache;if(a.startElement!==void 0)return a.startElement;var b;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var c=this.getRanges()[0];if(c){if(c.collapsed){b=c.startContainer;b.type!=CKEDITOR.NODE_ELEMENT&&(b=b.getParent())}else{for(c.optimize();;){b=c.startContainer;if(c.startOffset==(b.getChildCount?b.getChildCount():b.getLength())&&!b.isBlockBoundary())c.setStartAfter(b);else break}b=c.startContainer;if(b.type!=CKEDITOR.NODE_ELEMENT)return b.getParent();
|
||||||
|
b=b.getChild(c.startOffset);if(!b||b.type!=CKEDITOR.NODE_ELEMENT)b=c.startContainer;else for(c=b.getFirst();c&&c.type==CKEDITOR.NODE_ELEMENT;){b=c;c=c.getFirst()}}b=b.$}}return a.startElement=b?new CKEDITOR.dom.element(b):null},getSelectedElement:function(){var a=this._.cache;if(a.selectedElement!==void 0)return a.selectedElement;var b=this,c=CKEDITOR.tools.tryThese(function(){return b.getNative().createRange().item(0)},function(){for(var a=b.getRanges()[0].clone(),c,d,e=2;e&&(!(c=a.getEnclosedNode())||
|
||||||
|
!(c.type==CKEDITOR.NODE_ELEMENT&&A[c.getName()]&&(d=c)));e--)a.shrink(CKEDITOR.SHRINK_ELEMENT);return d&&d.$});return a.selectedElement=c?new CKEDITOR.dom.element(c):null},getSelectedText:function(){var a=this._.cache;if(a.selectedText!==void 0)return a.selectedText;var b=this.getNative(),b=p?b.type=="Control"?"":b.createRange().text:b.toString();return a.selectedText=b},lock:function(){this.getRanges();this.getStartElement();this.getSelectedElement();this.getSelectedText();this._.cache.nativeSel=
|
||||||
|
null;this.isLocked=1},unlock:function(a){if(this.isLocked){if(a)var b=this.getSelectedElement(),c=!b&&this.getRanges(),d=this.isFake;this.isLocked=0;this.reset();if(a)(a=b||c[0]&&c[0].getCommonAncestor())&&a.getAscendant("body",1)&&(d?this.fake(b):b?this.selectElement(b):this.selectRanges(c))}},reset:function(){this._.cache={};this.isFake=0;var a=this.root.editor;if(a&&a._.fakeSelection&&this.rev==a._.fakeSelection.rev){delete a._.fakeSelection;var b=a._.hiddenSelectionContainer;if(b){a.fire("lockSnapshot");
|
||||||
|
b.remove();a.fire("unlockSnapshot")}delete a._.hiddenSelectionContainer}this.rev=z++},selectElement:function(a){var b=new CKEDITOR.dom.range(this.root);b.setStartBefore(a);b.setEndAfter(a);this.selectRanges([b])},selectRanges:function(a){var b=this.root.editor,b=b&&b._.hiddenSelectionContainer;this.reset();if(b)for(var b=this.root,d,e=0;e<a.length;++e){d=a[e];if(d.endContainer.equals(b))d.endOffset=Math.min(d.endOffset,b.getChildCount())}if(a.length)if(this.isLocked){var g=CKEDITOR.document.getActive();
|
||||||
|
this.unlock();this.selectRanges(a);this.lock();!g.equals(this.root)&&g.focus()}else{var h;a:{var i,k;if(a.length==1&&!(k=a[0]).collapsed&&(h=k.getEnclosedNode())&&h.type==CKEDITOR.NODE_ELEMENT){k=k.clone();k.shrink(CKEDITOR.SHRINK_ELEMENT,true);if((i=k.getEnclosedNode())&&i.type==CKEDITOR.NODE_ELEMENT)h=i;if(h.getAttribute("contenteditable")=="false")break a}h=void 0}if(h)this.fake(h);else{if(p){k=CKEDITOR.dom.walker.whitespaces(true);i=/\ufeff|\u00a0/;b={table:1,tbody:1,tr:1};if(a.length>1){h=a[a.length-
|
||||||
|
1];a[0].setEnd(h.endContainer,h.endOffset)}h=a[0];var a=h.collapsed,o,n,r;if((d=h.getEnclosedNode())&&d.type==CKEDITOR.NODE_ELEMENT&&d.getName()in A&&(!d.is("a")||!d.getText()))try{r=d.$.createControlRange();r.addElement(d.$);r.select();return}catch(s){}(h.startContainer.type==CKEDITOR.NODE_ELEMENT&&h.startContainer.getName()in b||h.endContainer.type==CKEDITOR.NODE_ELEMENT&&h.endContainer.getName()in b)&&h.shrink(CKEDITOR.NODE_ELEMENT,true);r=h.createBookmark();b=r.startNode;if(!a)g=r.endNode;r=h.document.$.body.createTextRange();
|
||||||
|
r.moveToElementText(b.$);r.moveStart("character",1);if(g){i=h.document.$.body.createTextRange();i.moveToElementText(g.$);r.setEndPoint("EndToEnd",i);r.moveEnd("character",-1)}else{o=b.getNext(k);n=b.hasAscendant("pre");o=!(o&&o.getText&&o.getText().match(i))&&(n||!b.hasPrevious()||b.getPrevious().is&&b.getPrevious().is("br"));n=h.document.createElement("span");n.setHtml("");n.insertBefore(b);o&&h.document.createText("").insertBefore(b)}h.setStartBefore(b);b.remove();if(a){if(o){r.moveStart("character",
|
||||||
|
-1);r.select();h.document.$.selection.clear()}else r.select();h.moveToPosition(n,CKEDITOR.POSITION_BEFORE_START);n.remove()}else{h.setEndBefore(g);g.remove();r.select()}}else{g=this.getNative();if(!g)return;this.removeAllRanges();for(r=0;r<a.length;r++){if(r<a.length-1){o=a[r];n=a[r+1];i=o.clone();i.setStart(o.endContainer,o.endOffset);i.setEnd(n.startContainer,n.startOffset);if(!i.collapsed){i.shrink(CKEDITOR.NODE_ELEMENT,true);h=i.getCommonAncestor();i=i.getEnclosedNode();if(h.isReadOnly()||i&&
|
||||||
|
i.isReadOnly()){n.setStart(o.startContainer,o.startOffset);a.splice(r--,1);continue}}}h=a[r];n=this.document.$.createRange();if(h.collapsed&&CKEDITOR.env.webkit&&c(h)){o=this.root;f(o,false);i=o.getDocument().createText("");o.setCustomData("cke-fillingChar",i);h.insertNode(i);if((o=i.getNext())&&!i.getPrevious()&&o.type==CKEDITOR.NODE_ELEMENT&&o.getName()=="br"){f(this.root);h.moveToPosition(o,CKEDITOR.POSITION_BEFORE_START)}else h.moveToPosition(i,CKEDITOR.POSITION_AFTER_END)}n.setStart(h.startContainer.$,
|
||||||
|
h.startOffset);try{n.setEnd(h.endContainer.$,h.endOffset)}catch(t){if(t.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")>=0){h.collapse(1);n.setEnd(h.endContainer.$,h.endOffset)}else throw t;}g.addRange(n)}}this.reset();this.root.fire("selectionchange")}}},fake:function(a){var b=this.root.editor;this.reset();i(b);var c=this._.cache,d=new CKEDITOR.dom.range(this.root);d.setStartBefore(a);d.setEndAfter(a);c.ranges=new CKEDITOR.dom.rangeList(d);c.selectedElement=c.startElement=a;c.type=CKEDITOR.SELECTION_ELEMENT;
|
||||||
|
c.selectedText=c.nativeSel=null;this.isFake=1;this.rev=z++;b._.fakeSelection=this;this.root.fire("selectionchange")},isHidden:function(){var a=this.getCommonAncestor();a&&a.type==CKEDITOR.NODE_TEXT&&(a=a.getParent());return!(!a||!a.data("cke-hidden-sel"))},createBookmarks:function(a){a=this.getRanges().createBookmarks(a);this.isFake&&(a.isFake=1);return a},createBookmarks2:function(a){a=this.getRanges().createBookmarks2(a);this.isFake&&(a.isFake=1);return a},selectBookmarks:function(a){for(var b=
|
||||||
|
[],c=0;c<a.length;c++){var d=new CKEDITOR.dom.range(this.root);d.moveToBookmark(a[c]);b.push(d)}a.isFake?this.fake(b[0].getEnclosedNode()):this.selectRanges(b);return this},getCommonAncestor:function(){var a=this.getRanges();return!a.length?null:a[0].startContainer.getCommonAncestor(a[a.length-1].endContainer)},scrollIntoView:function(){this.type!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var a=this.getNative();
|
||||||
|
try{a&&a[p?"empty":"removeAllRanges"]()}catch(b){}this.reset()}}}})();"use strict";CKEDITOR.STYLE_BLOCK=1;CKEDITOR.STYLE_INLINE=2;CKEDITOR.STYLE_OBJECT=3;
|
||||||
|
(function(){function a(a,b){for(var c,d;a=a.getParent();){if(a.equals(b))break;if(a.getAttribute("data-nostyle"))c=a;else if(!d){var e=a.getAttribute("contentEditable");e=="false"?c=a:e=="true"&&(d=1)}}return c}function e(b){var d=b.document;if(b.collapsed){d=z(this,d);b.insertNode(d);b.moveToPosition(d,CKEDITOR.POSITION_BEFORE_END)}else{var f=this.element,g=this._.definition,h,i=g.ignoreReadonly,k=i||g.includeReadonly;k==void 0&&(k=b.root.getCustomData("cke_includeReadonly"));var j=CKEDITOR.dtd[f];
|
||||||
|
if(!j){h=true;j=CKEDITOR.dtd.span}b.enlarge(CKEDITOR.ENLARGE_INLINE,1);b.trim();var o=b.createBookmark(),m=o.startNode,l=o.endNode,n=m,p;if(!i){var r=b.getCommonAncestor(),i=a(m,r),r=a(l,r);i&&(n=i.getNextSourceNode(true));r&&(l=r)}for(n.getPosition(l)==CKEDITOR.POSITION_FOLLOWING&&(n=0);n;){i=false;if(n.equals(l)){n=null;i=true}else{var q=n.type==CKEDITOR.NODE_ELEMENT?n.getName():null,r=q&&n.getAttribute("contentEditable")=="false",s=q&&n.getAttribute("data-nostyle");if(q&&n.data("cke-bookmark")){n=
|
||||||
|
n.getNextSourceNode(true);continue}if(r&&k&&CKEDITOR.dtd.$block[q])for(var u=n,A=c(u),C=void 0,H=A.length,P=0,u=H&&new CKEDITOR.dom.range(u.getDocument());P<H;++P){var C=A[P],U=CKEDITOR.filter.instances[C.data("cke-filter")];if(U?U.check(this):1){u.selectNodeContents(C);e.call(this,u)}}A=q?!j[q]||s?0:r&&!k?0:(n.getPosition(l)|J)==J&&(!g.childRule||g.childRule(n)):1;if(A)if((A=n.getParent())&&((A.getDtd()||CKEDITOR.dtd.span)[f]||h)&&(!g.parentRule||g.parentRule(A))){if(!p&&(!q||!CKEDITOR.dtd.$removeEmpty[q]||
|
||||||
|
(n.getPosition(l)|J)==J)){p=b.clone();p.setStartBefore(n)}q=n.type;if(q==CKEDITOR.NODE_TEXT||r||q==CKEDITOR.NODE_ELEMENT&&!n.getChildCount()){for(var q=n,L;(i=!q.getNext(G))&&(L=q.getParent(),j[L.getName()])&&(L.getPosition(m)|F)==F&&(!g.childRule||g.childRule(L));)q=L;p.setEndAfter(q)}}else i=true;else i=true;n=n.getNextSourceNode(s||r)}if(i&&p&&!p.collapsed){for(var i=z(this,d),r=i.hasAttributes(),s=p.getCommonAncestor(),q={},A={},C={},H={},V,R,Y;i&&s;){if(s.getName()==f){for(V in g.attributes)if(!H[V]&&
|
||||||
|
(Y=s.getAttribute(R)))i.getAttribute(V)==Y?A[V]=1:H[V]=1;for(R in g.styles)if(!C[R]&&(Y=s.getStyle(R)))i.getStyle(R)==Y?q[R]=1:C[R]=1}s=s.getParent()}for(V in A)i.removeAttribute(V);for(R in q)i.removeStyle(R);r&&!i.hasAttributes()&&(i=null);if(i){p.extractContents().appendTo(i);p.insertNode(i);v.call(this,i);i.mergeSiblings();CKEDITOR.env.ie||i.$.normalize()}else{i=new CKEDITOR.dom.element("span");p.extractContents().appendTo(i);p.insertNode(i);v.call(this,i);i.remove(true)}p=null}}b.moveToBookmark(o);
|
||||||
|
b.shrink(CKEDITOR.SHRINK_TEXT);b.shrink(CKEDITOR.NODE_ELEMENT,true)}}function b(a){function b(){for(var a=new CKEDITOR.dom.elementPath(d.getParent()),c=new CKEDITOR.dom.elementPath(o.getParent()),e=null,f=null,g=0;g<a.elements.length;g++){var h=a.elements[g];if(h==a.block||h==a.blockLimit)break;l.checkElementRemovable(h)&&(e=h)}for(g=0;g<c.elements.length;g++){h=c.elements[g];if(h==c.block||h==c.blockLimit)break;l.checkElementRemovable(h)&&(f=h)}f&&o.breakParent(f);e&&d.breakParent(e)}a.enlarge(CKEDITOR.ENLARGE_INLINE,
|
||||||
|
1);var c=a.createBookmark(),d=c.startNode;if(a.collapsed){for(var e=new CKEDITOR.dom.elementPath(d.getParent(),a.root),f,h=0,i;h<e.elements.length&&(i=e.elements[h]);h++){if(i==e.block||i==e.blockLimit)break;if(this.checkElementRemovable(i)){var k;if(a.collapsed&&(a.checkBoundaryOfElement(i,CKEDITOR.END)||(k=a.checkBoundaryOfElement(i,CKEDITOR.START)))){f=i;f.match=k?"start":"end"}else{i.mergeSiblings();i.is(this.element)?r.call(this,i):g(i,j(this)[i.getName()])}}}if(f){i=d;for(h=0;;h++){k=e.elements[h];
|
||||||
|
if(k.equals(f))break;else if(k.match)continue;else k=k.clone();k.append(i);i=k}i[f.match=="start"?"insertBefore":"insertAfter"](f)}}else{var o=c.endNode,l=this;b();for(e=d;!e.equals(o);){f=e.getNextSourceNode();if(e.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(e)){e.getName()==this.element?r.call(this,e):g(e,j(this)[e.getName()]);if(f.type==CKEDITOR.NODE_ELEMENT&&f.contains(d)){b();f=d.getNext()}}e=f}}a.moveToBookmark(c);a.shrink(CKEDITOR.NODE_ELEMENT,true)}function c(a){var b=[];a.forEach(function(a){if(a.getAttribute("contenteditable")==
|
||||||
|
"true"){b.push(a);return false}},CKEDITOR.NODE_ELEMENT,true);return b}function d(a){var b=a.getEnclosedNode()||a.getCommonAncestor(false,true);(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1))&&!a.isReadOnly()&&A(a,this)}function f(a){var b=a.getCommonAncestor(true,true);if(a=(new CKEDITOR.dom.elementPath(b,a.root)).contains(this.element,1)){var b=this._.definition,c=b.attributes;if(c)for(var d in c)a.removeAttribute(d,c[d]);if(b.styles)for(var e in b.styles)b.styles.hasOwnProperty(e)&&
|
||||||
|
a.removeStyle(e)}}function h(a){var b=a.createBookmark(true),c=a.createIterator();c.enforceRealBlocks=true;if(this._.enterMode)c.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var d,e=a.document,f;d=c.getNextParagraph();)if(!d.isReadOnly()&&(c.activeFilter?c.activeFilter.check(this):1)){f=z(this,e,d);i(d,f)}a.moveToBookmark(b)}function n(a){var b=a.createBookmark(1),c=a.createIterator();c.enforceRealBlocks=true;c.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;for(var d,e;d=c.getNextParagraph();)if(this.checkElementRemovable(d))if(d.is("pre")){(e=
|
||||||
|
this._.enterMode==CKEDITOR.ENTER_BR?null:a.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&d.copyAttributes(e);i(d,e)}else r.call(this,d);a.moveToBookmark(b)}function i(a,b){var c=!b;if(c){b=a.getDocument().createElement("div");a.copyAttributes(b)}var d=b&&b.is("pre"),e=a.is("pre"),f=!d&&e;if(d&&!e){e=b;(f=a.getBogus())&&f.remove();f=a.getHtml();f=o(f,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"");f=f.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1");f=f.replace(/([ \t\n\r]+| )/g,
|
||||||
|
" ");f=f.replace(/<br\b[^>]*>/gi,"\n");if(CKEDITOR.env.ie){var g=a.getDocument().createElement("div");g.append(e);e.$.outerHTML="<pre>"+f+"</pre>";e.copyAttributes(g.getFirst());e=g.getFirst().remove()}else e.setHtml(f);b=e}else f?b=s(c?[a.getHtml()]:k(a),b):a.moveChildren(b);b.replace(a);if(d){var c=b,h;if((h=c.getPrevious(C))&&h.type==CKEDITOR.NODE_ELEMENT&&h.is("pre")){d=o(h.getHtml(),/\n$/,"")+"\n\n"+o(c.getHtml(),/^\n/,"");CKEDITOR.env.ie?c.$.outerHTML="<pre>"+d+"</pre>":c.setHtml(d);h.remove()}}else c&&
|
||||||
|
p(b)}function k(a){a.getName();var b=[];o(a.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(a,b,c){return b+"</pre>"+c+"<pre>"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(a,c){b.push(c)});return b}function o(a,b,c){var d="",e="",a=a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,function(a,b,c){b&&(d=b);c&&(e=c);return""});return d+a.replace(b,c)+e}function s(a,b){var c;a.length>1&&(c=new CKEDITOR.dom.documentFragment(b.getDocument()));
|
||||||
|
for(var d=0;d<a.length;d++){var e=a[d],e=e.replace(/(\r\n|\r)/g,"\n"),e=o(e,/^[ \t]*\n/,""),e=o(e,/\n$/,""),e=o(e,/^[ \t]+|[ \t]+$/g,function(a,b){return a.length==1?" ":b?" "+CKEDITOR.tools.repeat(" ",a.length-1):CKEDITOR.tools.repeat(" ",a.length-1)+" "}),e=e.replace(/\n/g,"<br>"),e=e.replace(/[ \t]{2,}/g,function(a){return CKEDITOR.tools.repeat(" ",a.length-1)+" "});if(c){var f=b.clone();f.setHtml(e);c.append(f)}else b.setHtml(e)}return c||b}function r(a,b){var c=this._.definition,
|
||||||
|
d=c.attributes,c=c.styles,e=j(this)[a.getName()],f=CKEDITOR.tools.isEmpty(d)&&CKEDITOR.tools.isEmpty(c),h;for(h in d)if(!((h=="class"||this._.definition.fullMatch)&&a.getAttribute(h)!=m(h,d[h]))&&!(b&&h.slice(0,5)=="data-")){f=a.hasAttribute(h);a.removeAttribute(h)}for(var i in c)if(!(this._.definition.fullMatch&&a.getStyle(i)!=m(i,c[i],true))){f=f||!!a.getStyle(i);a.removeStyle(i)}g(a,e,P[a.getName()]);f&&(this._.definition.alwaysRemoveElement?p(a,1):!CKEDITOR.dtd.$block[a.getName()]||this._.enterMode==
|
||||||
|
CKEDITOR.ENTER_BR&&!a.hasAttributes()?p(a):a.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function v(a){for(var b=j(this),c=a.getElementsByTag(this.element),d,e=c.count();--e>=0;){d=c.getItem(e);d.isReadOnly()||r.call(this,d,true)}for(var f in b)if(f!=this.element){c=a.getElementsByTag(f);for(e=c.count()-1;e>=0;e--){d=c.getItem(e);d.isReadOnly()||g(d,b[f])}}}function g(a,b,c){if(b=b&&b.attributes)for(var d=0;d<b.length;d++){var e=b[d][0],f;if(f=a.getAttribute(e)){var g=b[d][1];(g===null||
|
||||||
|
g.test&&g.test(f)||typeof g=="string"&&f==g)&&a.removeAttribute(e)}}c||p(a)}function p(a,b){if(!a.hasAttributes()||b)if(CKEDITOR.dtd.$block[a.getName()]){var c=a.getPrevious(C),d=a.getNext(C);c&&(c.type==CKEDITOR.NODE_TEXT||!c.isBlockBoundary({br:1}))&&a.append("br",1);d&&(d.type==CKEDITOR.NODE_TEXT||!d.isBlockBoundary({br:1}))&&a.append("br");a.remove(true)}else{c=a.getFirst();d=a.getLast();a.remove(true);if(c){c.type==CKEDITOR.NODE_ELEMENT&&c.mergeSiblings();d&&(!c.equals(d)&&d.type==CKEDITOR.NODE_ELEMENT)&&
|
||||||
|
d.mergeSiblings()}}}function z(a,b,c){var d;d=a.element;d=="*"&&(d="span");d=new CKEDITOR.dom.element(d,b);c&&c.copyAttributes(d);d=A(d,a);b.getCustomData("doc_processing_style")&&d.hasAttribute("id")?d.removeAttribute("id"):b.setCustomData("doc_processing_style",1);return d}function A(a,b){var c=b._.definition,d=c.attributes,c=CKEDITOR.style.getStyleText(c);if(d)for(var e in d)a.setAttribute(e,d[e]);c&&a.setAttribute("style",c);return a}function l(a,b){for(var c in a)a[c]=a[c].replace(H,function(a,
|
||||||
|
c){return b[c]})}function j(a){if(a._.overrides)return a._.overrides;var b=a._.overrides={},c=a._.definition.overrides;if(c){CKEDITOR.tools.isArray(c)||(c=[c]);for(var d=0;d<c.length;d++){var e=c[d],f,g;if(typeof e=="string")f=e.toLowerCase();else{f=e.element?e.element.toLowerCase():a.element;g=e.attributes}e=b[f]||(b[f]={});if(g){var e=e.attributes=e.attributes||[],h;for(h in g)e.push([h.toLowerCase(),g[h]])}}}return b}function m(a,b,c){var d=new CKEDITOR.dom.element("span");d[c?"setStyle":"setAttribute"](a,
|
||||||
|
b);return d[c?"getStyle":"getAttribute"](a)}function u(a,b,c){for(var d=a.document,e=a.getRanges(),b=b?this.removeFromRange:this.applyToRange,f,g=e.createIterator();f=g.getNextRange();)b.call(this,f,c);a.selectRanges(e);d.removeCustomData("doc_processing_style")}var P={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},q=
|
||||||
|
{a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},L=/\s*(?:;\s*|$)/,H=/#\((.+?)\)/g,G=CKEDITOR.dom.walker.bookmark(0,1),C=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(a,b){if(typeof a.type=="string")return new CKEDITOR.style.customHandlers[a.type](a);var c=a.attributes;if(c&&c.style){a.styles=CKEDITOR.tools.extend({},a.styles,CKEDITOR.tools.parseCssText(c.style));delete c.style}if(b){a=CKEDITOR.tools.clone(a);l(a.attributes,
|
||||||
|
b);l(a.styles,b)}c=this.element=a.element?typeof a.element=="string"?a.element.toLowerCase():a.element:"*";this.type=a.type||(P[c]?CKEDITOR.STYLE_BLOCK:q[c]?CKEDITOR.STYLE_OBJECT:CKEDITOR.STYLE_INLINE);if(typeof this.element=="object")this.type=CKEDITOR.STYLE_OBJECT;this._={definition:a}};CKEDITOR.style.prototype={apply:function(a){if(a instanceof CKEDITOR.dom.document)return u.call(this,a.getSelection());if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;if(!b)this._.enterMode=a.activeEnterMode;
|
||||||
|
u.call(this,a.getSelection(),0,a);this._.enterMode=b}},remove:function(a){if(a instanceof CKEDITOR.dom.document)return u.call(this,a.getSelection(),1);if(this.checkApplicable(a.elementPath(),a)){var b=this._.enterMode;if(!b)this._.enterMode=a.activeEnterMode;u.call(this,a.getSelection(),1,a);this._.enterMode=b}},applyToRange:function(a){this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?e:this.type==CKEDITOR.STYLE_BLOCK?h:this.type==CKEDITOR.STYLE_OBJECT?d:null;return this.applyToRange(a)},removeFromRange:function(a){this.removeFromRange=
|
||||||
|
this.type==CKEDITOR.STYLE_INLINE?b:this.type==CKEDITOR.STYLE_BLOCK?n:this.type==CKEDITOR.STYLE_OBJECT?f:null;return this.removeFromRange(a)},applyToObject:function(a){A(a,this)},checkActive:function(a,b){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(a.block||a.blockLimit,true,b);case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for(var c=a.elements,d=0,e;d<c.length;d++){e=c[d];if(!(this.type==CKEDITOR.STYLE_INLINE&&(e==a.block||e==a.blockLimit))){if(this.type==
|
||||||
|
CKEDITOR.STYLE_OBJECT){var f=e.getName();if(!(typeof this.element=="string"?f==this.element:f in this.element))continue}if(this.checkElementRemovable(e,true,b))return true}}}return false},checkApplicable:function(a,b,c){b&&b instanceof CKEDITOR.filter&&(c=b);if(c&&!c.check(this))return false;switch(this.type){case CKEDITOR.STYLE_OBJECT:return!!a.contains(this.element);case CKEDITOR.STYLE_BLOCK:return!!a.blockLimit.getDtd()[this.element]}return true},checkElementMatch:function(a,b){var c=this._.definition;
|
||||||
|
if(!a||!c.ignoreReadonly&&a.isReadOnly())return false;var d=a.getName();if(typeof this.element=="string"?d==this.element:d in this.element){if(!b&&!a.hasAttributes())return true;if(d=c._AC)c=d;else{var d={},e=0,f=c.attributes;if(f)for(var g in f){e++;d[g]=f[g]}if(g=CKEDITOR.style.getStyleText(c)){d.style||e++;d.style=g}d._length=e;c=c._AC=d}if(c._length){for(var h in c)if(h!="_length"){e=a.getAttribute(h)||"";if(h=="style")a:{d=c[h];typeof d=="string"&&(d=CKEDITOR.tools.parseCssText(d));typeof e==
|
||||||
|
"string"&&(e=CKEDITOR.tools.parseCssText(e,true));g=void 0;for(g in d)if(!(g in e&&(e[g]==d[g]||d[g]=="inherit"||e[g]=="inherit"))){d=false;break a}d=true}else d=c[h]==e;if(d){if(!b)return true}else if(b)return false}if(b)return true}else return true}return false},checkElementRemovable:function(a,b,c){if(this.checkElementMatch(a,b,c))return true;if(b=j(this)[a.getName()]){var d;if(!(b=b.attributes))return true;for(c=0;c<b.length;c++){d=b[c][0];if(d=a.getAttribute(d)){var e=b[c][1];if(e===null||typeof e==
|
||||||
|
"string"&&d==e||e.test(d))return true}}}return false},buildPreview:function(a){var b=this._.definition,c=[],d=b.element;d=="bdo"&&(d="span");var c=["<",d],e=b.attributes;if(e)for(var f in e)c.push(" ",f,'="',e[f],'"');(e=CKEDITOR.style.getStyleText(b))&&c.push(' style="',e,'"');c.push(">",a||b.name,"</",d,">");return c.join("")},getDefinition:function(){return this._.definition}};CKEDITOR.style.getStyleText=function(a){var b=a._ST;if(b)return b;var b=a.styles,c=a.attributes&&a.attributes.style||"",
|
||||||
|
d="";c.length&&(c=c.replace(L,";"));for(var e in b){var f=b[e],g=(e+":"+f).replace(L,";");f=="inherit"?d=d+g:c=c+g}c.length&&(c=CKEDITOR.tools.normalizeCssText(c,true));return a._ST=c+d};CKEDITOR.style.customHandlers={};CKEDITOR.style.addCustomHandler=function(a){var b=function(a){this._={definition:a};this.setup&&this.setup(a)};b.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),{assignedTo:CKEDITOR.STYLE_OBJECT},a,true);return this.customHandlers[a.type]=b};
|
||||||
|
var J=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,F=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED})();CKEDITOR.styleCommand=function(a,e){this.requiredContent=this.allowedContent=this.style=a;CKEDITOR.tools.extend(this,e,true)};CKEDITOR.styleCommand.prototype.exec=function(a){a.focus();this.state==CKEDITOR.TRISTATE_OFF?a.applyStyle(this.style):this.state==CKEDITOR.TRISTATE_ON&&a.removeStyle(this.style)};
|
||||||
|
CKEDITOR.stylesSet=new CKEDITOR.resourceManager("","stylesSet");CKEDITOR.addStylesSet=CKEDITOR.tools.bind(CKEDITOR.stylesSet.add,CKEDITOR.stylesSet);CKEDITOR.loadStylesSet=function(a,e,b){CKEDITOR.stylesSet.addExternal(a,e,"");CKEDITOR.stylesSet.load(a,b)};
|
||||||
|
CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{attachStyleStateChange:function(a,e){var b=this._.styleStateChangeCallbacks;if(!b){b=this._.styleStateChangeCallbacks=[];this.on("selectionChange",function(a){for(var d=0;d<b.length;d++){var e=b[d],h=e.style.checkActive(a.data.path,this)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;e.fn.call(this,h)}})}b.push({style:a,fn:e})},applyStyle:function(a){a.apply(this)},removeStyle:function(a){a.remove(this)},getStylesSet:function(a){if(this._.stylesDefinitions)a(this._.stylesDefinitions);
|
||||||
|
else{var e=this,b=e.config.stylesCombo_stylesSet||e.config.stylesSet;if(b===false)a(null);else if(b instanceof Array){e._.stylesDefinitions=b;a(b)}else{b||(b="default");var b=b.split(":"),c=b[0];CKEDITOR.stylesSet.addExternal(c,b[1]?b.slice(1).join(":"):CKEDITOR.getUrl("styles.js"),"");CKEDITOR.stylesSet.load(c,function(b){e._.stylesDefinitions=b[c];a(e._.stylesDefinitions)})}}}});
|
||||||
|
CKEDITOR.dom.comment=function(a,e){typeof a=="string"&&(a=(e?e.$:document).createComment(a));CKEDITOR.dom.domObject.call(this,a)};CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node;CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return"<\!--"+this.$.nodeValue+"--\>"}});"use strict";
|
||||||
|
(function(){var a={},e={},b;for(b in CKEDITOR.dtd.$blockLimit)b in CKEDITOR.dtd.$list||(a[b]=1);for(b in CKEDITOR.dtd.$block)b in CKEDITOR.dtd.$blockLimit||b in CKEDITOR.dtd.$empty||(e[b]=1);CKEDITOR.dom.elementPath=function(b,d){var f=null,h=null,n=[],i=b,k,d=d||b.getDocument().getBody();do if(i.type==CKEDITOR.NODE_ELEMENT){n.push(i);if(!this.lastElement){this.lastElement=i;if(i.is(CKEDITOR.dtd.$object)||i.getAttribute("contenteditable")=="false")continue}if(i.equals(d))break;if(!h){k=i.getName();
|
||||||
|
i.getAttribute("contenteditable")=="true"?h=i:!f&&e[k]&&(f=i);if(a[k]){var o;if(o=!f){if(k=k=="div"){a:{k=i.getChildren();o=0;for(var s=k.count();o<s;o++){var r=k.getItem(o);if(r.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[r.getName()]){k=true;break a}}k=false}k=!k}o=k}o?f=i:h=i}}}while(i=i.getParent());h||(h=d);this.block=f;this.blockLimit=h;this.root=d;this.elements=n}})();
|
||||||
|
CKEDITOR.dom.elementPath.prototype={compare:function(a){var e=this.elements,a=a&&a.elements;if(!a||e.length!=a.length)return false;for(var b=0;b<e.length;b++)if(!e[b].equals(a[b]))return false;return true},contains:function(a,e,b){var c;typeof a=="string"&&(c=function(b){return b.getName()==a});a instanceof CKEDITOR.dom.element?c=function(b){return b.equals(a)}:CKEDITOR.tools.isArray(a)?c=function(b){return CKEDITOR.tools.indexOf(a,b.getName())>-1}:typeof a=="function"?c=a:typeof a=="object"&&(c=
|
||||||
|
function(b){return b.getName()in a});var d=this.elements,f=d.length;e&&f--;if(b){d=Array.prototype.slice.call(d,0);d.reverse()}for(e=0;e<f;e++)if(c(d[e]))return d[e];return null},isContextFor:function(a){var e;if(a in CKEDITOR.dtd.$block){e=this.contains(CKEDITOR.dtd.$intermediate)||this.root.equals(this.block)&&this.block||this.blockLimit;return!!e.getDtd()[a]}return true},direction:function(){return(this.block||this.blockLimit||this.root).getDirection(1)}};
|
||||||
|
CKEDITOR.dom.text=function(a,e){typeof a=="string"&&(a=(e?e.$:document).createTextNode(a));this.$=a};CKEDITOR.dom.text.prototype=new CKEDITOR.dom.node;
|
||||||
|
CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype,{type:CKEDITOR.NODE_TEXT,getLength:function(){return this.$.nodeValue.length},getText:function(){return this.$.nodeValue},setText:function(a){this.$.nodeValue=a},split:function(a){var e=this.$.parentNode,b=e.childNodes.length,c=this.getLength(),d=this.getDocument(),f=new CKEDITOR.dom.text(this.$.splitText(a),d);if(e.childNodes.length==b)if(a>=c){f=d.createText("");f.insertAfter(this)}else{a=d.createText("");a.insertAfter(f);a.remove()}return f},substring:function(a,
|
||||||
|
e){return typeof e!="number"?this.$.nodeValue.substr(a):this.$.nodeValue.substring(a,e)}});
|
||||||
|
(function(){function a(a,c,d){var e=a.serializable,h=c[d?"endContainer":"startContainer"],n=d?"endOffset":"startOffset",i=e?c.document.getById(a.startNode):a.startNode,a=e?c.document.getById(a.endNode):a.endNode;if(h.equals(i.getPrevious())){c.startOffset=c.startOffset-h.getLength()-a.getPrevious().getLength();h=a.getNext()}else if(h.equals(a.getPrevious())){c.startOffset=c.startOffset-h.getLength();h=a.getNext()}h.equals(i.getParent())&&c[n]++;h.equals(a.getParent())&&c[n]++;c[d?"endContainer":"startContainer"]=
|
||||||
|
h;return c}CKEDITOR.dom.rangeList=function(a){if(a instanceof CKEDITOR.dom.rangeList)return a;a?a instanceof CKEDITOR.dom.range&&(a=[a]):a=[];return CKEDITOR.tools.extend(a,e)};var e={createIterator:function(){var a=this,c=CKEDITOR.dom.walker.bookmark(),d=[],e;return{getNextRange:function(h){e=e==void 0?0:e+1;var n=a[e];if(n&&a.length>1){if(!e)for(var i=a.length-1;i>=0;i--)d.unshift(a[i].createBookmark(true));if(h)for(var k=0;a[e+k+1];){for(var o=n.document,h=0,i=o.getById(d[k].endNode),o=o.getById(d[k+
|
||||||
|
1].startNode);;){i=i.getNextSourceNode(false);if(o.equals(i))h=1;else if(c(i)||i.type==CKEDITOR.NODE_ELEMENT&&i.isBlockBoundary())continue;break}if(!h)break;k++}for(n.moveToBookmark(d.shift());k--;){i=a[++e];i.moveToBookmark(d.shift());n.setEnd(i.endContainer,i.endOffset)}}return n}}},createBookmarks:function(b){for(var c=[],d,e=0;e<this.length;e++){c.push(d=this[e].createBookmark(b,true));for(var h=e+1;h<this.length;h++){this[h]=a(d,this[h]);this[h]=a(d,this[h],true)}}return c},createBookmarks2:function(a){for(var c=
|
||||||
|
[],d=0;d<this.length;d++)c.push(this[d].createBookmark2(a));return c},moveToBookmarks:function(a){for(var c=0;c<this.length;c++)this[c].moveToBookmark(a[c])}}})();
|
||||||
|
(function(){function a(){return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1]||"skins/"+CKEDITOR.skinName.split(",")[0]+"/")}function e(b){var c=CKEDITOR.skin["ua_"+b],d=CKEDITOR.env;if(c)for(var c=c.split(",").sort(function(a,b){return a>b?-1:1}),e=0,f;e<c.length;e++){f=c[e];if(d.ie&&(f.replace(/^ie/,"")==d.version||d.quirks&&f=="iequirks"))f="ie";if(d[f]){b=b+("_"+c[e]);break}}return CKEDITOR.getUrl(a()+b+".css")}function b(a,b){if(!f[a]){CKEDITOR.document.appendStyleSheet(e(a));f[a]=1}b&&b()}
|
||||||
|
function c(a){var b=a.getById(h);if(!b){b=a.getHead().append("style");b.setAttribute("id",h);b.setAttribute("type","text/css")}return b}function d(a,b,c){var d,e,f;if(CKEDITOR.env.webkit){b=b.split("}").slice(0,-1);for(e=0;e<b.length;e++)b[e]=b[e].split("{")}for(var h=0;h<a.length;h++)if(CKEDITOR.env.webkit)for(e=0;e<b.length;e++){f=b[e][1];for(d=0;d<c.length;d++)f=f.replace(c[d][0],c[d][1]);a[h].$.sheet.addRule(b[e][0],f)}else{f=b;for(d=0;d<c.length;d++)f=f.replace(c[d][0],c[d][1]);CKEDITOR.env.ie&&
|
||||||
|
CKEDITOR.env.version<11?a[h].$.styleSheet.cssText=a[h].$.styleSheet.cssText+f:a[h].$.innerHTML=a[h].$.innerHTML+f}}var f={};CKEDITOR.skin={path:a,loadPart:function(c,d){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a()+"skin.js"),function(){b(c,d)}):b(c,d)},getPath:function(a){return CKEDITOR.getUrl(e(a))},icons:{},addIcon:function(a,b,c,d){a=a.toLowerCase();this.icons[a]||(this.icons[a]={path:b,offset:c||0,bgsize:d||"16px"})},getIconStyle:function(a,
|
||||||
|
b,c,d,e){var f;if(a){a=a.toLowerCase();b&&(f=this.icons[a+"-rtl"]);f||(f=this.icons[a])}a=c||f&&f.path||"";d=d||f&&f.offset;e=e||f&&f.bgsize||"16px";return a&&"background-image:url("+CKEDITOR.getUrl(a)+");background-position:0 "+d+"px;background-size:"+e+";"}};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{getUiColor:function(){return this.uiColor},setUiColor:function(a){var b=c(CKEDITOR.document);return(this.setUiColor=function(a){var c=CKEDITOR.skin.chameleon,e=[[i,a]];this.uiColor=a;d([b],c(this,
|
||||||
|
"editor"),e);d(n,c(this,"panel"),e)}).call(this,a)}});var h="cke_ui_color",n=[],i=/\$color/g;CKEDITOR.on("instanceLoaded",function(a){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var b=a.editor,a=function(a){a=(a.data[0]||a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();if(!a.getById("cke_ui_color")){a=c(a);n.push(a);var e=b.getUiColor();e&&d([a],CKEDITOR.skin.chameleon(b,"panel"),[[i,e]])}};b.on("panelShow",a);b.on("menuShow",a);b.config.uiColor&&b.setUiColor(b.config.uiColor)}})})();
|
||||||
|
(function(){if(CKEDITOR.env.webkit)CKEDITOR.env.hc=false;else{var a=CKEDITOR.dom.element.createFromHtml('<div style="width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"></div>',CKEDITOR.document);a.appendTo(CKEDITOR.document.getHead());try{var e=a.getComputedStyle("border-top-color"),b=a.getComputedStyle("border-right-color");CKEDITOR.env.hc=!!(e&&e==b)}catch(c){CKEDITOR.env.hc=false}a.remove()}if(CKEDITOR.env.hc)CKEDITOR.env.cssClass=CKEDITOR.env.cssClass+" cke_hc";
|
||||||
|
CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");CKEDITOR.status="loaded";CKEDITOR.fireOnce("loaded");if(a=CKEDITOR._.pending){delete CKEDITOR._.pending;for(e=0;e<a.length;e++){CKEDITOR.editor.prototype.constructor.apply(a[e][0],a[e][1]);CKEDITOR.add(a[e][0])}}})();/*
|
||||||
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
CKEDITOR.skin.name="moono";CKEDITOR.skin.ua_editor="ie,iequirks,ie7,ie8,gecko";CKEDITOR.skin.ua_dialog="ie,iequirks,ie7,ie8";
|
||||||
|
CKEDITOR.skin.chameleon=function(){var b=function(){return function(b,e){for(var a=b.match(/[^#]./g),c=0;3>c;c++){var f=a,h=c,d;d=parseInt(a[c],16);d=("0"+(0>e?0|d*(1+e):0|d+(255-d)*e).toString(16)).slice(-2);f[h]=d}return"#"+a.join("")}}(),c=function(){var b=new CKEDITOR.template("background:#{to};background-image:-webkit-gradient(linear,lefttop,leftbottom,from({from}),to({to}));background-image:-moz-linear-gradient(top,{from},{to});background-image:-webkit-linear-gradient(top,{from},{to});background-image:-o-linear-gradient(top,{from},{to});background-image:-ms-linear-gradient(top,{from},{to});background-image:linear-gradient(top,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0,startColorstr='{from}',endColorstr='{to}');");return function(c,
|
||||||
|
a){return b.output({from:c,to:a})}}(),f={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),
|
||||||
|
panel:new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")};
|
||||||
|
return function(g,e){var a=g.uiColor,a={id:"."+g.id,defaultBorder:b(a,-0.1),defaultGradient:c(b(a,0.9),a),lightGradient:c(b(a,1),b(a,0.7)),mediumGradient:c(b(a,0.8),b(a,0.5)),ckeButtonOn:c(b(a,0.6),b(a,0.7)),ckeResizer:b(a,-0.4),ckeToolbarSeparator:b(a,0.5),ckeColorauto:b(a,0.8),dialogBody:b(a,0.7),dialogTabSelected:c("#FFFFFF","#FFFFFF"),dialogTabSelectedBorder:"#FFF",elementsPathColor:b(a,-0.6),elementsPathBg:a,menubuttonIcon:b(a,0.5),menubuttonIconHover:b(a,0.3)};return f[e].output(a).replace(/\[/g,
|
||||||
|
"{").replace(/\]/g,"}")}}();CKEDITOR.plugins.add("basicstyles",{init:function(c){var e=0,d=function(g,d,b,a){if(a){var a=new CKEDITOR.style(a),f=h[b];f.unshift(a);c.attachStyleStateChange(a,function(a){!c.readOnly&&c.getCommand(b).setState(a)});c.addCommand(b,new CKEDITOR.styleCommand(a,{contentForms:f}));c.ui.addButton&&c.ui.addButton(g,{label:d,command:b,toolbar:"basicstyles,"+(e+=10)})}},h={bold:["strong","b",["span",function(a){a=a.styles["font-weight"];return"bold"==a||700<=+a}]],italic:["em","i",["span",function(a){return"italic"==
|
||||||
|
a.styles["font-style"]}]],underline:["u",["span",function(a){return"underline"==a.styles["text-decoration"]}]],strike:["s","strike",["span",function(a){return"line-through"==a.styles["text-decoration"]}]],subscript:["sub"],superscript:["sup"]},b=c.config,a=c.lang.basicstyles;d("Bold",a.bold,"bold",b.coreStyles_bold);d("Italic",a.italic,"italic",b.coreStyles_italic);d("Underline",a.underline,"underline",b.coreStyles_underline);d("Strike",a.strike,"strike",b.coreStyles_strike);d("Subscript",a.subscript,
|
||||||
|
"subscript",b.coreStyles_subscript);d("Superscript",a.superscript,"superscript",b.coreStyles_superscript);c.setKeystroke([[CKEDITOR.CTRL+66,"bold"],[CKEDITOR.CTRL+73,"italic"],[CKEDITOR.CTRL+85,"underline"]])}});CKEDITOR.config.coreStyles_bold={element:"strong",overrides:"b"};CKEDITOR.config.coreStyles_italic={element:"em",overrides:"i"};CKEDITOR.config.coreStyles_underline={element:"u"};CKEDITOR.config.coreStyles_strike={element:"s",overrides:"strike"};CKEDITOR.config.coreStyles_subscript={element:"sub"};
|
||||||
|
CKEDITOR.config.coreStyles_superscript={element:"sup"};CKEDITOR.plugins.add("dialogui",{onLoad:function(){var i=function(b){this._||(this._={});this._["default"]=this._.initValue=b["default"]||"";this._.required=b.required||!1;for(var a=[this._],d=1;d<arguments.length;d++)a.push(arguments[d]);a.push(!0);CKEDITOR.tools.extend.apply(CKEDITOR.tools,a);return this._},r={build:function(b,a,d){return new CKEDITOR.ui.dialog.textInput(b,a,d)}},l={build:function(b,a,d){return new CKEDITOR.ui.dialog[a.type](b,a,d)}},n={isChanged:function(){return this.getValue()!=
|
||||||
|
this.getInitValue()},reset:function(b){this.setValue(this.getInitValue(),b)},setInitValue:function(){this._.initValue=this.getValue()},resetInitValue:function(){this._.initValue=this._["default"]},getInitValue:function(){return this._.initValue}},o=CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onChange:function(b,a){this._.domOnChangeRegistered||(b.on("load",function(){this.getInputElement().on("change",function(){b.parts.dialog.isVisible()&&this.fire("change",{value:this.getValue()})},
|
||||||
|
this)},this),this._.domOnChangeRegistered=!0);this.on("change",a)}},!0),s=/^on([A-Z]\w+)/,p=function(b){for(var a in b)(s.test(a)||"title"==a||"type"==a)&&delete b[a];return b};CKEDITOR.tools.extend(CKEDITOR.ui.dialog,{labeledElement:function(b,a,d,e){if(!(4>arguments.length)){var c=i.call(this,a);c.labelId=CKEDITOR.tools.getNextId()+"_label";this._.children=[];CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"div",null,{role:"presentation"},function(){var f=[],d=a.required?" cke_required":"";"horizontal"!=
|
||||||
|
a.labelLayout?f.push('<label class="cke_dialog_ui_labeled_label'+d+'" ',' id="'+c.labelId+'"',c.inputId?' for="'+c.inputId+'"':"",(a.labelStyle?' style="'+a.labelStyle+'"':"")+">",a.label,"</label>",'<div class="cke_dialog_ui_labeled_content"',a.controlStyle?' style="'+a.controlStyle+'"':"",' role="radiogroup" aria-labelledby="'+c.labelId+'">',e.call(this,b,a),"</div>"):(d={type:"hbox",widths:a.widths,padding:0,children:[{type:"html",html:'<label class="cke_dialog_ui_labeled_label'+d+'" id="'+c.labelId+
|
||||||
|
'" for="'+c.inputId+'"'+(a.labelStyle?' style="'+a.labelStyle+'"':"")+">"+CKEDITOR.tools.htmlEncode(a.label)+"</span>"},{type:"html",html:'<span class="cke_dialog_ui_labeled_content"'+(a.controlStyle?' style="'+a.controlStyle+'"':"")+">"+e.call(this,b,a)+"</span>"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(b,d,f));return f.join("")})}},textInput:function(b,a,d){if(!(3>arguments.length)){i.call(this,a);var e=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",c={"class":"cke_dialog_ui_input_"+
|
||||||
|
a.type,id:e,type:a.type};a.validate&&(this.validate=a.validate);a.maxLength&&(c.maxlength=a.maxLength);a.size&&(c.size=a.size);a.inputStyle&&(c.style=a.inputStyle);var f=this,h=!1;b.on("load",function(){f.getInputElement().on("keydown",function(a){a.data.getKeystroke()==13&&(h=true)});f.getInputElement().on("keyup",function(a){if(a.data.getKeystroke()==13&&h){b.getButton("ok")&&setTimeout(function(){b.getButton("ok").click()},0);h=false}},null,null,1E3)});CKEDITOR.ui.dialog.labeledElement.call(this,
|
||||||
|
b,a,d,function(){var b=['<div class="cke_dialog_ui_input_',a.type,'" role="presentation"'];a.width&&b.push('style="width:'+a.width+'" ');b.push("><input ");c["aria-labelledby"]=this._.labelId;this._.required&&(c["aria-required"]=this._.required);for(var d in c)b.push(d+'="'+c[d]+'" ');b.push(" /></div>");return b.join("")})}},textarea:function(b,a,d){if(!(3>arguments.length)){i.call(this,a);var e=this,c=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",f={};a.validate&&(this.validate=a.validate);
|
||||||
|
f.rows=a.rows||5;f.cols=a.cols||20;f["class"]="cke_dialog_ui_input_textarea "+(a["class"]||"");"undefined"!=typeof a.inputStyle&&(f.style=a.inputStyle);a.dir&&(f.dir=a.dir);CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){f["aria-labelledby"]=this._.labelId;this._.required&&(f["aria-required"]=this._.required);var a=['<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea id="',c,'" '],b;for(b in f)a.push(b+'="'+CKEDITOR.tools.htmlEncode(f[b])+'" ');a.push(">",CKEDITOR.tools.htmlEncode(e._["default"]),
|
||||||
|
"</textarea></div>");return a.join("")})}},checkbox:function(b,a,d){if(!(3>arguments.length)){var e=i.call(this,a,{"default":!!a["default"]});a.validate&&(this.validate=a.validate);CKEDITOR.ui.dialog.uiElement.call(this,b,a,d,"span",null,null,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},true),d=[],h=CKEDITOR.tools.getNextId()+"_label",g={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":h};p(c);if(a["default"])g.checked=
|
||||||
|
"checked";if(typeof c.inputStyle!="undefined")c.style=c.inputStyle;e.checkbox=new CKEDITOR.ui.dialog.uiElement(b,c,d,"input",null,g);d.push(' <label id="',h,'" for="',g.id,'"'+(a.labelStyle?' style="'+a.labelStyle+'"':"")+">",CKEDITOR.tools.htmlEncode(a.label),"</label>");return d.join("")})}},radio:function(b,a,d){if(!(3>arguments.length)){i.call(this,a);this._["default"]||(this._["default"]=this._.initValue=a.items[0][1]);a.validate&&(this.validate=a.valdiate);var e=[],c=this;CKEDITOR.ui.dialog.labeledElement.call(this,
|
||||||
|
b,a,d,function(){for(var d=[],h=[],g=(a.id?a.id:CKEDITOR.tools.getNextId())+"_radio",k=0;k<a.items.length;k++){var j=a.items[k],i=j[2]!==void 0?j[2]:j[0],l=j[1]!==void 0?j[1]:j[0],m=CKEDITOR.tools.getNextId()+"_radio_input",n=m+"_label",m=CKEDITOR.tools.extend({},a,{id:m,title:null,type:null},true),i=CKEDITOR.tools.extend({},m,{title:i},true),o={type:"radio","class":"cke_dialog_ui_radio_input",name:g,value:l,"aria-labelledby":n},q=[];if(c._["default"]==l)o.checked="checked";p(m);p(i);if(typeof m.inputStyle!=
|
||||||
|
"undefined")m.style=m.inputStyle;m.keyboardFocusable=true;e.push(new CKEDITOR.ui.dialog.uiElement(b,m,q,"input",null,o));q.push(" ");new CKEDITOR.ui.dialog.uiElement(b,i,q,"label",null,{id:n,"for":o.id},j[0]);d.push(q.join(""))}new CKEDITOR.ui.dialog.hbox(b,e,d,h);return h.join("")});this._.children=e}},button:function(b,a,d){if(arguments.length){"function"==typeof a&&(a=a(b.getParentEditor()));i.call(this,a,{disabled:a.disabled||!1});CKEDITOR.event.implementOn(this);var e=this;b.on("load",function(){var a=
|
||||||
|
this.getElement();(function(){a.on("click",function(a){e.click();a.data.preventDefault()});a.on("keydown",function(a){a.data.getKeystroke()in{32:1}&&(e.click(),a.data.preventDefault())})})();a.unselectable()},this);var c=CKEDITOR.tools.extend({},a);delete c.style;var f=CKEDITOR.tools.getNextId()+"_label";CKEDITOR.ui.dialog.uiElement.call(this,b,c,d,"a",null,{style:a.style,href:"javascript:void(0)",title:a.label,hidefocus:"true","class":a["class"],role:"button","aria-labelledby":f},'<span id="'+f+
|
||||||
|
'" class="cke_dialog_ui_button">'+CKEDITOR.tools.htmlEncode(a.label)+"</span>")}},select:function(b,a,d){if(!(3>arguments.length)){var e=i.call(this,a);a.validate&&(this.validate=a.validate);e.inputId=CKEDITOR.tools.getNextId()+"_select";CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){var c=CKEDITOR.tools.extend({},a,{id:a.id?a.id+"_select":CKEDITOR.tools.getNextId()+"_select"},true),d=[],h=[],g={id:e.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};d.push('<div class="cke_dialog_ui_input_',
|
||||||
|
a.type,'" role="presentation"');a.width&&d.push('style="width:'+a.width+'" ');d.push(">");if(a.size!=void 0)g.size=a.size;if(a.multiple!=void 0)g.multiple=a.multiple;p(c);for(var k=0,j;k<a.items.length&&(j=a.items[k]);k++)h.push('<option value="',CKEDITOR.tools.htmlEncode(j[1]!==void 0?j[1]:j[0]).replace(/"/g,"""),'" /> ',CKEDITOR.tools.htmlEncode(j[0]));if(typeof c.inputStyle!="undefined")c.style=c.inputStyle;e.select=new CKEDITOR.ui.dialog.uiElement(b,c,d,"select",null,g,h.join(""));d.push("</div>");
|
||||||
|
return d.join("")})}},file:function(b,a,d){if(!(3>arguments.length)){void 0===a["default"]&&(a["default"]="");var e=CKEDITOR.tools.extend(i.call(this,a),{definition:a,buttons:[]});a.validate&&(this.validate=a.validate);b.on("load",function(){CKEDITOR.document.getById(e.frameId).getParent().addClass("cke_dialog_ui_input_file")});CKEDITOR.ui.dialog.labeledElement.call(this,b,a,d,function(){e.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var b=['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" role="presentation" id="',
|
||||||
|
e.frameId,'" title="',a.label,'" src="javascript:void('];b.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0");b.push(')"></iframe>');return b.join("")})}},fileButton:function(b,a,d){if(!(3>arguments.length)){i.call(this,a);var e=this;a.validate&&(this.validate=a.validate);var c=CKEDITOR.tools.extend({},a),f=c.onClick;c.className=(c.className?c.className+" ":"")+"cke_dialog_ui_button";c.onClick=function(c){var d=
|
||||||
|
a["for"];if(!f||f.call(this,c)!==false){b.getContentElement(d[0],d[1]).submit();this.disable()}};b.on("load",function(){b.getContentElement(a["for"][0],a["for"][1])._.buttons.push(e)});CKEDITOR.ui.dialog.button.call(this,b,c,d)}},html:function(){var b=/^\s*<[\w:]+\s+([^>]*)?>/,a=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,d=/\/$/;return function(e,c,f){if(!(3>arguments.length)){var h=[],g=c.html;"<"!=g.charAt(0)&&(g="<span>"+g+"</span>");var k=c.focus;if(k){var j=this.focus;this.focus=function(){("function"==
|
||||||
|
typeof k?k:j).call(this);this.fire("focus")};c.isFocusable&&(this.isFocusable=this.isFocusable);this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,e,c,h,"span",null,null,"");h=h.join("").match(b);g=g.match(a)||["","",""];d.test(g[1])&&(g[1]=g[1].slice(0,-1),g[2]="/"+g[2]);f.push([g[1]," ",h[1]||"",g[2]].join(""))}}}(),fieldset:function(b,a,d,e,c){var f=c.label;this._={children:a};CKEDITOR.ui.dialog.uiElement.call(this,b,c,e,"fieldset",null,null,function(){var a=[];f&&a.push("<legend"+
|
||||||
|
(c.labelStyle?' style="'+c.labelStyle+'"':"")+">"+f+"</legend>");for(var b=0;b<d.length;b++)a.push(d[b]);return a.join("")})}},!0);CKEDITOR.ui.dialog.html.prototype=new CKEDITOR.ui.dialog.uiElement;CKEDITOR.ui.dialog.labeledElement.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setLabel:function(b){var a=CKEDITOR.document.getById(this._.labelId);1>a.getChildCount()?(new CKEDITOR.dom.text(b,CKEDITOR.document)).appendTo(a):a.getChild(0).$.nodeValue=b;return this},getLabel:function(){var b=
|
||||||
|
CKEDITOR.document.getById(this._.labelId);return!b||1>b.getChildCount()?"":b.getChild(0).getText()},eventProcessors:o},!0);CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return!this._.disabled?this.fire("click",{dialog:this._.dialog}):!1},enable:function(){this._.disabled=!1;var b=this.getElement();b&&b.removeClass("cke_disabled")},disable:function(){this._.disabled=!0;this.getElement().addClass("cke_disabled")},isVisible:function(){return this.getElement().getFirst().isVisible()},
|
||||||
|
isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(b,a){this.on("click",function(){a.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)},
|
||||||
|
focus:function(){var b=this.selectParentTab();setTimeout(function(){var a=b.getInputElement();a&&a.$.focus()},0)},select:function(){var b=this.selectParentTab();setTimeout(function(){var a=b.getInputElement();a&&(a.$.focus(),a.$.select())},0)},accessKeyUp:function(){this.select()},setValue:function(b){!b&&(b="");return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)},keyboardFocusable:!0},n,!0);CKEDITOR.ui.dialog.textarea.prototype=new CKEDITOR.ui.dialog.textInput;CKEDITOR.ui.dialog.select.prototype=
|
||||||
|
CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(b,a,d){var e=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document),c=this.getInputElement().$;e.$.text=b;e.$.value=void 0===a||null===a?b:a;void 0===d||null===d?CKEDITOR.env.ie?c.add(e.$):c.add(e.$,null):c.add(e.$,d);return this},remove:function(b){this.getInputElement().$.remove(b);return this},clear:function(){for(var b=this.getInputElement().$;0<
|
||||||
|
b.length;)b.remove(0);return this},keyboardFocusable:!0},n,!0);CKEDITOR.ui.dialog.checkbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getInputElement:function(){return this._.checkbox.getElement()},setValue:function(b,a){this.getInputElement().$.checked=b;!a&&this.fire("change",{value:b})},getValue:function(){return this.getInputElement().$.checked},accessKeyUp:function(){this.setValue(!this.getValue())},eventProcessors:{onChange:function(b,a){if(!CKEDITOR.env.ie||8<CKEDITOR.env.version)return o.onChange.apply(this,
|
||||||
|
arguments);b.on("load",function(){var a=this._.checkbox.getElement();a.on("propertychange",function(b){b=b.data.$;"checked"==b.propertyName&&this.fire("change",{value:a.$.checked})},this)},this);this.on("change",a);return null}},keyboardFocusable:!0},n,!0);CKEDITOR.ui.dialog.radio.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setValue:function(b,a){for(var d=this._.children,e,c=0;c<d.length&&(e=d[c]);c++)e.getElement().$.checked=e.getValue()==b;!a&&this.fire("change",{value:b})},
|
||||||
|
getValue:function(){for(var b=this._.children,a=0;a<b.length;a++)if(b[a].getElement().$.checked)return b[a].getValue();return null},accessKeyUp:function(){var b=this._.children,a;for(a=0;a<b.length;a++)if(b[a].getElement().$.checked){b[a].getElement().focus();return}b[0].getElement().focus()},eventProcessors:{onChange:function(b,a){if(CKEDITOR.env.ie)b.on("load",function(){for(var a=this._.children,b=this,c=0;c<a.length;c++)a[c].getElement().on("propertychange",function(a){a=a.data.$;"checked"==a.propertyName&&
|
||||||
|
this.$.checked&&b.fire("change",{value:this.getAttribute("value")})})},this),this.on("change",a);else return o.onChange.apply(this,arguments);return null}}},n,!0);CKEDITOR.ui.dialog.file.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,n,{getInputElement:function(){var b=CKEDITOR.document.getById(this._.frameId).getFrameDocument();return 0<b.$.forms.length?new CKEDITOR.dom.element(b.$.forms[0].elements[0]):this.getElement()},submit:function(){this.getInputElement().getParent().$.submit();
|
||||||
|
return this},getAction:function(){return this.getInputElement().getParent().$.action},registerEvents:function(b){var a=/^on([A-Z]\w+)/,d,e=function(a,b,c,d){a.on("formLoaded",function(){a.getInputElement().on(c,d,a)})},c;for(c in b)if(d=c.match(a))this.eventProcessors[c]?this.eventProcessors[c].call(this,this._.dialog,b[c]):e(this,this._.dialog,d[1].toLowerCase(),b[c]);return this},reset:function(){function b(){d.$.open();var b="";e.size&&(b=e.size-(CKEDITOR.env.ie?7:0));var i=a.frameId+"_input";
|
||||||
|
d.$.write(['<html dir="'+g+'" lang="'+k+'"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">','<form enctype="multipart/form-data" method="POST" dir="'+g+'" lang="'+k+'" action="',CKEDITOR.tools.htmlEncode(e.action),'"><label id="',a.labelId,'" for="',i,'" style="display:none">',CKEDITOR.tools.htmlEncode(e.label),'</label><input style="width:100%" id="',i,'" aria-labelledby="',a.labelId,'" type="file" name="',CKEDITOR.tools.htmlEncode(e.id||"cke_upload"),
|
||||||
|
'" size="',CKEDITOR.tools.htmlEncode(0<b?b:""),'" /></form></body></html><script>',CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"","window.parent.CKEDITOR.tools.callFunction("+f+");","window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction("+h+")}","<\/script>"].join(""));d.$.close();for(b=0;b<c.length;b++)c[b].enable()}var a=this._,d=CKEDITOR.document.getById(a.frameId).getFrameDocument(),e=a.definition,c=a.buttons,f=this.formLoadedNumber,h=this.formUnloadNumber,g=a.dialog._.editor.lang.dir,
|
||||||
|
k=a.dialog._.editor.langCode;f||(f=this.formLoadedNumber=CKEDITOR.tools.addFunction(function(){this.fire("formLoaded")},this),h=this.formUnloadNumber=CKEDITOR.tools.addFunction(function(){this.getInputElement().clearCustomData()},this),this.getDialog()._.editor.on("destroy",function(){CKEDITOR.tools.removeFunction(f);CKEDITOR.tools.removeFunction(h)}));CKEDITOR.env.gecko?setTimeout(b,500):b()},getValue:function(){return this.getInputElement().$.value||""},setInitValue:function(){this._.initValue=
|
||||||
|
""},eventProcessors:{onChange:function(b,a){this._.domOnChangeRegistered||(this.on("formLoaded",function(){this.getInputElement().on("change",function(){this.fire("change",{value:this.getValue()})},this)},this),this._.domOnChangeRegistered=!0);this.on("change",a)}},keyboardFocusable:!0},!0);CKEDITOR.ui.dialog.fileButton.prototype=new CKEDITOR.ui.dialog.button;CKEDITOR.ui.dialog.fieldset.prototype=CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);CKEDITOR.dialog.addUIElement("text",r);CKEDITOR.dialog.addUIElement("password",
|
||||||
|
r);CKEDITOR.dialog.addUIElement("textarea",l);CKEDITOR.dialog.addUIElement("checkbox",l);CKEDITOR.dialog.addUIElement("radio",l);CKEDITOR.dialog.addUIElement("button",l);CKEDITOR.dialog.addUIElement("select",l);CKEDITOR.dialog.addUIElement("file",l);CKEDITOR.dialog.addUIElement("fileButton",l);CKEDITOR.dialog.addUIElement("html",l);CKEDITOR.dialog.addUIElement("fieldset",{build:function(b,a,d){for(var e=a.children,c,f=[],h=[],g=0;g<e.length&&(c=e[g]);g++){var i=[];f.push(i);h.push(CKEDITOR.dialog._.uiElementBuilders[c.type].build(b,
|
||||||
|
c,i))}return new CKEDITOR.ui.dialog[a.type](b,h,f,d,a)}})}});CKEDITOR.DIALOG_RESIZE_NONE=0;CKEDITOR.DIALOG_RESIZE_WIDTH=1;CKEDITOR.DIALOG_RESIZE_HEIGHT=2;CKEDITOR.DIALOG_RESIZE_BOTH=3;
|
||||||
|
(function(){function t(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId)+a,c=b-1;c>b-a;c--)if(this._.tabs[this._.tabIdList[c%a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function u(){for(var a=this._.tabIdList.length,b=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),c=b+1;c<b+a;c++)if(this._.tabs[this._.tabIdList[c%a]][0].$.offsetHeight)return this._.tabIdList[c%a];return null}function G(a,b){for(var c=a.$.getElementsByTagName("input"),
|
||||||
|
e=0,d=c.length;e<d;e++){var g=new CKEDITOR.dom.element(c[e]);"text"==g.getAttribute("type").toLowerCase()&&(b?(g.setAttribute("value",g.getCustomData("fake_value")||""),g.removeCustomData("fake_value")):(g.setCustomData("fake_value",g.getAttribute("value")),g.setAttribute("value","")))}}function P(a,b){var c=this.getInputElement();c&&(a?c.removeAttribute("aria-invalid"):c.setAttribute("aria-invalid",!0));a||(this.select?this.select():this.focus());b&&alert(b);this.fire("validated",{valid:a,msg:b})}
|
||||||
|
function Q(){var a=this.getInputElement();a&&a.removeAttribute("aria-invalid")}function R(a){var a=CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",S).output({id:CKEDITOR.tools.getNextNumber(),editorId:a.id,langDir:a.lang.dir,langCode:a.langCode,editorDialogClass:"cke_editor_"+a.name.replace(/\./g,"\\.")+"_dialog",closeTitle:a.lang.common.close,hidpi:CKEDITOR.env.hidpi?"cke_hidpi":""})),b=a.getChild([0,0,0,0,0]),c=b.getChild(0),e=b.getChild(1);if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var d=
|
||||||
|
"javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())";CKEDITOR.dom.element.createFromHtml('<iframe frameBorder="0" class="cke_iframe_shim" src="'+d+'" tabIndex="-1"></iframe>').appendTo(b.getParent())}c.unselectable();e.unselectable();return{element:a,parts:{dialog:a.getChild(0),title:c,close:e,tabs:b.getChild(2),contents:b.getChild([3,0,0,0]),footer:b.getChild([3,0,1,0])}}}function H(a,b,c){this.element=b;this.focusIndex=c;this.tabIndex=
|
||||||
|
0;this.isFocusable=function(){return!b.getAttribute("disabled")&&b.isVisible()};this.focus=function(){a._.currentFocusIndex=this.focusIndex;this.element.focus()};b.on("keydown",function(a){a.data.getKeystroke()in{32:1,13:1}&&this.fire("click")});b.on("focus",function(){this.fire("mouseover")});b.on("blur",function(){this.fire("mouseout")})}function T(a){function b(){a.layout()}var c=CKEDITOR.document.getWindow();c.on("resize",b);a.on("hide",function(){c.removeListener("resize",b)})}function I(a,b){this._=
|
||||||
|
{dialog:a};CKEDITOR.tools.extend(this,b)}function U(a){function b(b){var c=a.getSize(),i=CKEDITOR.document.getWindow().getViewPaneSize(),o=b.data.$.screenX,j=b.data.$.screenY,n=o-e.x,l=j-e.y;e={x:o,y:j};d.x+=n;d.y+=l;a.move(d.x+h[3]<f?-h[3]:d.x-h[1]>i.width-c.width-f?i.width-c.width+("rtl"==g.lang.dir?0:h[1]):d.x,d.y+h[0]<f?-h[0]:d.y-h[2]>i.height-c.height-f?i.height-c.height+h[2]:d.y,1);b.data.preventDefault()}function c(){CKEDITOR.document.removeListener("mousemove",b);CKEDITOR.document.removeListener("mouseup",
|
||||||
|
c);if(CKEDITOR.env.ie6Compat){var a=q.getChild(0).getFrameDocument();a.removeListener("mousemove",b);a.removeListener("mouseup",c)}}var e=null,d=null;a.getElement().getFirst();var g=a.getParentEditor(),f=g.config.dialog_magnetDistance,h=CKEDITOR.skin.margins||[0,0,0,0];"undefined"==typeof f&&(f=20);a.parts.title.on("mousedown",function(f){e={x:f.data.$.screenX,y:f.data.$.screenY};CKEDITOR.document.on("mousemove",b);CKEDITOR.document.on("mouseup",c);d=a.getPosition();if(CKEDITOR.env.ie6Compat){var h=
|
||||||
|
q.getChild(0).getFrameDocument();h.on("mousemove",b);h.on("mouseup",c)}f.data.preventDefault()},a)}function V(a){var b,c;function e(d){var e="rtl"==h.lang.dir,j=o.width,C=o.height,D=j+(d.data.$.screenX-b)*(e?-1:1)*(a._.moved?1:2),n=C+(d.data.$.screenY-c)*(a._.moved?1:2),x=a._.element.getFirst(),x=e&&x.getComputedStyle("right"),y=a.getPosition();y.y+n>i.height&&(n=i.height-y.y);if((e?x:y.x)+D>i.width)D=i.width-(e?x:y.x);if(f==CKEDITOR.DIALOG_RESIZE_WIDTH||f==CKEDITOR.DIALOG_RESIZE_BOTH)j=Math.max(g.minWidth||
|
||||||
|
0,D-m);if(f==CKEDITOR.DIALOG_RESIZE_HEIGHT||f==CKEDITOR.DIALOG_RESIZE_BOTH)C=Math.max(g.minHeight||0,n-k);a.resize(j,C);a._.moved||a.layout();d.data.preventDefault()}function d(){CKEDITOR.document.removeListener("mouseup",d);CKEDITOR.document.removeListener("mousemove",e);j&&(j.remove(),j=null);if(CKEDITOR.env.ie6Compat){var a=q.getChild(0).getFrameDocument();a.removeListener("mouseup",d);a.removeListener("mousemove",e)}}var g=a.definition,f=g.resizable;if(f!=CKEDITOR.DIALOG_RESIZE_NONE){var h=a.getParentEditor(),
|
||||||
|
m,k,i,o,j,n=CKEDITOR.tools.addFunction(function(f){o=a.getSize();var h=a.parts.contents;h.$.getElementsByTagName("iframe").length&&(j=CKEDITOR.dom.element.createFromHtml('<div class="cke_dialog_resize_cover" style="height: 100%; position: absolute; width: 100%;"></div>'),h.append(j));k=o.height-a.parts.contents.getSize("height",!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks));m=o.width-a.parts.contents.getSize("width",1);b=f.screenX;c=f.screenY;i=CKEDITOR.document.getWindow().getViewPaneSize();
|
||||||
|
CKEDITOR.document.on("mousemove",e);CKEDITOR.document.on("mouseup",d);CKEDITOR.env.ie6Compat&&(h=q.getChild(0).getFrameDocument(),h.on("mousemove",e),h.on("mouseup",d));f.preventDefault&&f.preventDefault()});a.on("load",function(){var b="";f==CKEDITOR.DIALOG_RESIZE_WIDTH?b=" cke_resizer_horizontal":f==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(b=" cke_resizer_vertical");b=CKEDITOR.dom.element.createFromHtml('<div class="cke_resizer'+b+" cke_resizer_"+h.lang.dir+'" title="'+CKEDITOR.tools.htmlEncode(h.lang.common.resize)+
|
||||||
|
'" onmousedown="CKEDITOR.tools.callFunction('+n+', event )">'+("ltr"==h.lang.dir?"◢":"◣")+"</div>");a.parts.footer.append(b,1)});h.on("destroy",function(){CKEDITOR.tools.removeFunction(n)})}}function E(a){a.data.preventDefault(1)}function J(a){var b=CKEDITOR.document.getWindow(),c=a.config,e=c.dialog_backgroundCoverColor||"white",d=c.dialog_backgroundCoverOpacity,g=c.baseFloatZIndex,c=CKEDITOR.tools.genKey(e,d,g),f=w[c];f?f.show():(g=['<div tabIndex="-1" style="position: ',CKEDITOR.env.ie6Compat?
|
||||||
|
"absolute":"fixed","; z-index: ",g,"; top: 0px; left: 0px; ",!CKEDITOR.env.ie6Compat?"background-color: "+e:"",'" class="cke_dialog_background_cover">'],CKEDITOR.env.ie6Compat&&(e="<html><body style=\\'background-color:"+e+";\\'></body></html>",g.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:'),g.push("void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.write( '"+e+"' );document.close();")+"})())"),g.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>')),
|
||||||
|
g.push("</div>"),f=CKEDITOR.dom.element.createFromHtml(g.join("")),f.setOpacity(void 0!=d?d:0.5),f.on("keydown",E),f.on("keypress",E),f.on("keyup",E),f.appendTo(CKEDITOR.document.getBody()),w[c]=f);a.focusManager.add(f);q=f;var a=function(){var a=b.getViewPaneSize();f.setStyles({width:a.width+"px",height:a.height+"px"})},h=function(){var a=b.getScrollPosition(),c=CKEDITOR.dialog._.currentTop;f.setStyles({left:a.x+"px",top:a.y+"px"});if(c){do{a=c.getPosition();c.move(a.x,a.y)}while(c=c._.parentDialog)
|
||||||
|
}};F=a;b.on("resize",a);a();(!CKEDITOR.env.mac||!CKEDITOR.env.webkit)&&f.focus();if(CKEDITOR.env.ie6Compat){var m=function(){h();arguments.callee.prevScrollHandler.apply(this,arguments)};b.$.setTimeout(function(){m.prevScrollHandler=window.onscroll||function(){};window.onscroll=m},0);h()}}function K(a){q&&(a.focusManager.remove(q),a=CKEDITOR.document.getWindow(),q.hide(),a.removeListener("resize",F),CKEDITOR.env.ie6Compat&&a.$.setTimeout(function(){window.onscroll=window.onscroll&&window.onscroll.prevScrollHandler||
|
||||||
|
null},0),F=null)}var r=CKEDITOR.tools.cssLength,S='<div class="cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir="{langDir}" lang="{langCode}" role="dialog" aria-labelledby="cke_dialog_title_{id}"><table class="cke_dialog '+CKEDITOR.env.cssClass+' cke_{langDir}" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="cke_dialog_body" role="presentation"><div id="cke_dialog_title_{id}" class="cke_dialog_title" role="presentation"></div><a id="cke_dialog_close_button_{id}" class="cke_dialog_close_button" href="javascript:void(0)" title="{closeTitle}" role="button"><span class="cke_label">X</span></a><div id="cke_dialog_tabs_{id}" class="cke_dialog_tabs" role="tablist"></div><table class="cke_dialog_contents" role="presentation"><tr><td id="cke_dialog_contents_{id}" class="cke_dialog_contents_body" role="presentation"></td></tr><tr><td id="cke_dialog_footer_{id}" class="cke_dialog_footer" role="presentation"></td></tr></table></div></td></tr></table></div>';
|
||||||
|
CKEDITOR.dialog=function(a,b){function c(){var a=l._.focusList;a.sort(function(a,b){return a.tabIndex!=b.tabIndex?b.tabIndex-a.tabIndex:a.focusIndex-b.focusIndex});for(var b=a.length,c=0;c<b;c++)a[c].focusIndex=c}function e(a){var b=l._.focusList,a=a||0;if(!(1>b.length)){var c=l._.currentFocusIndex;try{b[c].getInputElement().$.blur()}catch(f){}for(var d=c=(c+a+b.length)%b.length;a&&!b[d].isFocusable()&&!(d=(d+a+b.length)%b.length,d==c););b[d].focus();"text"==b[d].type&&b[d].select()}}function d(b){if(l==
|
||||||
|
CKEDITOR.dialog._.currentTop){var c=b.data.getKeystroke(),d="rtl"==a.lang.dir;o=j=0;if(9==c||c==CKEDITOR.SHIFT+9)c=c==CKEDITOR.SHIFT+9,l._.tabBarMode?(c=c?t.call(l):u.call(l),l.selectPage(c),l._.tabs[c][0].focus()):e(c?-1:1),o=1;else if(c==CKEDITOR.ALT+121&&!l._.tabBarMode&&1<l.getPageCount())l._.tabBarMode=!0,l._.tabs[l._.currentTabId][0].focus(),o=1;else if((37==c||39==c)&&l._.tabBarMode)c=c==(d?39:37)?t.call(l):u.call(l),l.selectPage(c),l._.tabs[c][0].focus(),o=1;else if((13==c||32==c)&&l._.tabBarMode)this.selectPage(this._.currentTabId),
|
||||||
|
this._.tabBarMode=!1,this._.currentFocusIndex=-1,e(1),o=1;else if(13==c){c=b.data.getTarget();if(!c.is("a","button","select","textarea")&&(!c.is("input")||"button"!=c.$.type))(c=this.getButton("ok"))&&CKEDITOR.tools.setTimeout(c.click,0,c),o=1;j=1}else if(27==c)(c=this.getButton("cancel"))?CKEDITOR.tools.setTimeout(c.click,0,c):!1!==this.fire("cancel",{hide:!0}).hide&&this.hide(),j=1;else return;g(b)}}function g(a){o?a.data.preventDefault(1):j&&a.data.stopPropagation()}var f=CKEDITOR.dialog._.dialogDefinitions[b],
|
||||||
|
h=CKEDITOR.tools.clone(W),m=a.config.dialog_buttonsOrder||"OS",k=a.lang.dir,i={},o,j;("OS"==m&&CKEDITOR.env.mac||"rtl"==m&&"ltr"==k||"ltr"==m&&"rtl"==k)&&h.buttons.reverse();f=CKEDITOR.tools.extend(f(a),h);f=CKEDITOR.tools.clone(f);f=new L(this,f);h=R(a);this._={editor:a,element:h.element,name:b,contentSize:{width:0,height:0},size:{width:0,height:0},contents:{},buttons:{},accessKeyMap:{},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:!1,focusList:[],
|
||||||
|
currentFocusIndex:0,hasFocus:!1};this.parts=h.parts;CKEDITOR.tools.setTimeout(function(){a.fire("ariaWidget",this.parts.contents)},0,this);h={position:CKEDITOR.env.ie6Compat?"absolute":"fixed",top:0,visibility:"hidden"};h["rtl"==k?"right":"left"]=0;this.parts.dialog.setStyles(h);CKEDITOR.event.call(this);this.definition=f=CKEDITOR.fire("dialogDefinition",{name:b,definition:f},a).definition;if(!("removeDialogTabs"in a._)&&a.config.removeDialogTabs){h=a.config.removeDialogTabs.split(";");for(k=0;k<
|
||||||
|
h.length;k++)if(m=h[k].split(":"),2==m.length){var n=m[0];i[n]||(i[n]=[]);i[n].push(m[1])}a._.removeDialogTabs=i}if(a._.removeDialogTabs&&(i=a._.removeDialogTabs[b]))for(k=0;k<i.length;k++)f.removeContents(i[k]);if(f.onLoad)this.on("load",f.onLoad);if(f.onShow)this.on("show",f.onShow);if(f.onHide)this.on("hide",f.onHide);if(f.onOk)this.on("ok",function(b){a.fire("saveSnapshot");setTimeout(function(){a.fire("saveSnapshot")},0);!1===f.onOk.call(this,b)&&(b.data.hide=!1)});if(f.onCancel)this.on("cancel",
|
||||||
|
function(a){!1===f.onCancel.call(this,a)&&(a.data.hide=!1)});var l=this,p=function(a){var b=l._.contents,c=!1,d;for(d in b)for(var f in b[d])if(c=a.call(this,b[d][f]))return};this.on("ok",function(a){p(function(b){if(b.validate){var c=b.validate(this),d="string"==typeof c||!1===c;d&&(a.data.hide=!1,a.stop());P.call(b,!d,"string"==typeof c?c:void 0);return d}})},this,null,0);this.on("cancel",function(b){p(function(c){if(c.isChanged())return!a.config.dialog_noConfirmCancel&&!confirm(a.lang.common.confirmCancel)&&
|
||||||
|
(b.data.hide=!1),!0})},this,null,0);this.parts.close.on("click",function(a){!1!==this.fire("cancel",{hide:!0}).hide&&this.hide();a.data.preventDefault()},this);this.changeFocus=e;var v=this._.element;a.focusManager.add(v,1);this.on("show",function(){v.on("keydown",d,this);if(CKEDITOR.env.gecko)v.on("keypress",g,this)});this.on("hide",function(){v.removeListener("keydown",d);CKEDITOR.env.gecko&&v.removeListener("keypress",g);p(function(a){Q.apply(a)})});this.on("iframeAdded",function(a){(new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown",
|
||||||
|
d,this,null,0)});this.on("show",function(){c();if(a.config.dialog_startupFocusTab&&1<l._.pageCount)l._.tabBarMode=!0,l._.tabs[l._.currentTabId][0].focus();else if(!this._.hasFocus)if(this._.currentFocusIndex=-1,f.onFocus){var b=f.onFocus.call(this);b&&b.focus()}else e(1)},this,null,4294967295);if(CKEDITOR.env.ie6Compat)this.on("load",function(){var a=this.getElement(),b=a.getFirst();b.remove();b.appendTo(a)},this);U(this);V(this);(new CKEDITOR.dom.text(f.title,CKEDITOR.document)).appendTo(this.parts.title);
|
||||||
|
for(k=0;k<f.contents.length;k++)(i=f.contents[k])&&this.addPage(i);this.parts.tabs.on("click",function(a){var b=a.data.getTarget();b.hasClass("cke_dialog_tab")&&(b=b.$.id,this.selectPage(b.substring(4,b.lastIndexOf("_"))),this._.tabBarMode&&(this._.tabBarMode=!1,this._.currentFocusIndex=-1,e(1)),a.data.preventDefault())},this);k=[];i=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:f.buttons},k).getChild();this.parts.footer.setHtml(k.join(""));
|
||||||
|
for(k=0;k<i.length;k++)this._.buttons[i[k].id]=i[k]};CKEDITOR.dialog.prototype={destroy:function(){this.hide();this._.element.remove()},resize:function(){return function(a,b){if(!this._.contentSize||!(this._.contentSize.width==a&&this._.contentSize.height==b))CKEDITOR.dialog.fire("resize",{dialog:this,width:a,height:b},this._.editor),this.fire("resize",{width:a,height:b},this._.editor),this.parts.contents.setStyles({width:a+"px",height:b+"px"}),"rtl"==this._.editor.lang.dir&&this._.position&&(this._.position.x=
|
||||||
|
CKEDITOR.document.getWindow().getViewPaneSize().width-this._.contentSize.width-parseInt(this._.element.getFirst().getStyle("right"),10)),this._.contentSize={width:a,height:b}}}(),getSize:function(){var a=this._.element.getFirst();return{width:a.$.offsetWidth||0,height:a.$.offsetHeight||0}},move:function(a,b,c){var e=this._.element.getFirst(),d="rtl"==this._.editor.lang.dir,g="fixed"==e.getComputedStyle("position");CKEDITOR.env.ie&&e.setStyle("zoom","100%");if(!g||!this._.position||!(this._.position.x==
|
||||||
|
a&&this._.position.y==b))this._.position={x:a,y:b},g||(g=CKEDITOR.document.getWindow().getScrollPosition(),a+=g.x,b+=g.y),d&&(g=this.getSize(),a=CKEDITOR.document.getWindow().getViewPaneSize().width-g.width-a),b={top:(0<b?b:0)+"px"},b[d?"right":"left"]=(0<a?a:0)+"px",e.setStyles(b),c&&(this._.moved=1)},getPosition:function(){return CKEDITOR.tools.extend({},this._.position)},show:function(){var a=this._.element,b=this.definition;!a.getParent()||!a.getParent().equals(CKEDITOR.document.getBody())?a.appendTo(CKEDITOR.document.getBody()):
|
||||||
|
a.setStyle("display","block");this.resize(this._.contentSize&&this._.contentSize.width||b.width||b.minWidth,this._.contentSize&&this._.contentSize.height||b.height||b.minHeight);this.reset();this.selectPage(this.definition.contents[0].id);null===CKEDITOR.dialog._.currentZIndex&&(CKEDITOR.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex);this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex+=10);null===CKEDITOR.dialog._.currentTop?(CKEDITOR.dialog._.currentTop=this,
|
||||||
|
this._.parentDialog=null,J(this._.editor)):(this._.parentDialog=CKEDITOR.dialog._.currentTop,this._.parentDialog.getElement().getFirst().$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2),CKEDITOR.dialog._.currentTop=this);a.on("keydown",M);a.on("keyup",N);this._.hasFocus=!1;for(var c in b.contents)if(b.contents[c]){var a=b.contents[c],e=this._.tabs[a.id],d=a.requiredContent,g=0;if(e){for(var f in this._.contents[a.id]){var h=this._.contents[a.id][f];"hbox"==h.type||("vbox"==h.type||
|
||||||
|
!h.getInputElement())||(h.requiredContent&&!this._.editor.activeFilter.check(h.requiredContent)?h.disable():(h.enable(),g++))}!g||d&&!this._.editor.activeFilter.check(d)?e[0].addClass("cke_dialog_tab_disabled"):e[0].removeClass("cke_dialog_tab_disabled")}}CKEDITOR.tools.setTimeout(function(){this.layout();T(this);this.parts.dialog.setStyle("visibility","");this.fireOnce("load",{});CKEDITOR.ui.fire("ready",this);this.fire("show",{});this._.editor.fire("dialogShow",this);this._.parentDialog||this._.editor.focusManager.lock();
|
||||||
|
this.foreach(function(a){a.setInitValue&&a.setInitValue()})},100,this)},layout:function(){var a=this.parts.dialog,b=this.getSize(),c=CKEDITOR.document.getWindow().getViewPaneSize(),e=(c.width-b.width)/2,d=(c.height-b.height)/2;CKEDITOR.env.ie6Compat||(b.height+(0<d?d:0)>c.height||b.width+(0<e?e:0)>c.width?a.setStyle("position","absolute"):a.setStyle("position","fixed"));this.move(this._.moved?this._.position.x:e,this._.moved?this._.position.y:d)},foreach:function(a){for(var b in this._.contents)for(var c in this._.contents[b])a.call(this,
|
||||||
|
this._.contents[b][c]);return this},reset:function(){var a=function(a){a.reset&&a.reset(1)};return function(){this.foreach(a);return this}}(),setupContent:function(){var a=arguments;this.foreach(function(b){b.setup&&b.setup.apply(b,a)})},commitContent:function(){var a=arguments;this.foreach(function(b){CKEDITOR.env.ie&&this._.currentFocusIndex==b.focusIndex&&b.getInputElement().$.blur();b.commit&&b.commit.apply(b,a)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{});this._.editor.fire("dialogHide",
|
||||||
|
this);this.selectPage(this._.tabIdList[0]);var a=this._.element;a.setStyle("display","none");this.parts.dialog.setStyle("visibility","hidden");for(X(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var b=this._.parentDialog.getElement().getFirst();b.setStyle("z-index",parseInt(b.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else K(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex-=
|
||||||
|
10;else{CKEDITOR.dialog._.currentZIndex=null;a.removeListener("keydown",M);a.removeListener("keyup",N);var c=this._.editor;c.focus();setTimeout(function(){c.focusManager.unlock()},0)}delete this._.parentDialog;this.foreach(function(a){a.resetInitValue&&a.resetInitValue()})}},addPage:function(a){if(!a.requiredContent||this._.editor.filter.check(a.requiredContent)){for(var b=[],c=a.label?' title="'+CKEDITOR.tools.htmlEncode(a.label)+'"':"",e=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",
|
||||||
|
className:"cke_dialog_page_contents",children:a.elements,expand:!!a.expand,padding:a.padding,style:a.style||"width: 100%;"},b),d=this._.contents[a.id]={},g=e.getChild(),f=0;e=g.shift();)!e.notAllowed&&("hbox"!=e.type&&"vbox"!=e.type)&&f++,d[e.id]=e,"function"==typeof e.getChild&&g.push.apply(g,e.getChild());f||(a.hidden=!0);b=CKEDITOR.dom.element.createFromHtml(b.join(""));b.setAttribute("role","tabpanel");e=CKEDITOR.env;d="cke_"+a.id+"_"+CKEDITOR.tools.getNextNumber();c=CKEDITOR.dom.element.createFromHtml(['<a class="cke_dialog_tab"',
|
||||||
|
0<this._.pageCount?" cke_last":"cke_first",c,a.hidden?' style="display:none"':"",' id="',d,'"',e.gecko&&!e.hc?"":' href="javascript:void(0)"',' tabIndex="-1" hidefocus="true" role="tab">',a.label,"</a>"].join(""));b.setAttribute("aria-labelledby",d);this._.tabs[a.id]=[c,b];this._.tabIdList.push(a.id);!a.hidden&&this._.pageCount++;this._.lastTab=c;this.updateStyle();b.setAttribute("name",a.id);b.appendTo(this.parts.contents);c.unselectable();this.parts.tabs.append(c);a.accessKey&&(O(this,this,"CTRL+"+
|
||||||
|
a.accessKey,Y,Z),this._.accessKeyMap["CTRL+"+a.accessKey]=a.id)}},selectPage:function(a){if(this._.currentTabId!=a&&!this._.tabs[a][0].hasClass("cke_dialog_tab_disabled")&&!1!==this.fire("selectPage",{page:a,currentPage:this._.currentTabId})){for(var b in this._.tabs){var c=this._.tabs[b][0],e=this._.tabs[b][1];b!=a&&(c.removeClass("cke_dialog_tab_selected"),e.hide());e.setAttribute("aria-hidden",b!=a)}var d=this._.tabs[a];d[0].addClass("cke_dialog_tab_selected");CKEDITOR.env.ie6Compat||CKEDITOR.env.ie7Compat?
|
||||||
|
(G(d[1]),d[1].show(),setTimeout(function(){G(d[1],1)},0)):d[1].show();this._.currentTabId=a;this._.currentTabIndex=CKEDITOR.tools.indexOf(this._.tabIdList,a)}},updateStyle:function(){this.parts.dialog[(1===this._.pageCount?"add":"remove")+"Class"]("cke_single_page")},hidePage:function(a){var b=this._.tabs[a]&&this._.tabs[a][0];b&&(1!=this._.pageCount&&b.isVisible())&&(a==this._.currentTabId&&this.selectPage(t.call(this)),b.hide(),this._.pageCount--,this.updateStyle())},showPage:function(a){if(a=this._.tabs[a]&&
|
||||||
|
this._.tabs[a][0])a.show(),this._.pageCount++,this.updateStyle()},getElement:function(){return this._.element},getName:function(){return this._.name},getContentElement:function(a,b){var c=this._.contents[a];return c&&c[b]},getValueOf:function(a,b){return this.getContentElement(a,b).getValue()},setValueOf:function(a,b,c){return this.getContentElement(a,b).setValue(c)},getButton:function(a){return this._.buttons[a]},click:function(a){return this._.buttons[a].click()},disableButton:function(a){return this._.buttons[a].disable()},
|
||||||
|
enableButton:function(a){return this._.buttons[a].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()},addFocusable:function(a,b){if("undefined"==typeof b)b=this._.focusList.length,this._.focusList.push(new H(this,a,b));else{this._.focusList.splice(b,0,new H(this,a,b));for(var c=b+1;c<this._.focusList.length;c++)this._.focusList[c].focusIndex++}}};
|
||||||
|
CKEDITOR.tools.extend(CKEDITOR.dialog,{add:function(a,b){if(!this._.dialogDefinitions[a]||"function"==typeof b)this._.dialogDefinitions[a]=b},exists:function(a){return!!this._.dialogDefinitions[a]},getCurrent:function(){return CKEDITOR.dialog._.currentTop},isTabEnabled:function(a,b,c){a=a.config.removeDialogTabs;return!(a&&a.match(RegExp("(?:^|;)"+b+":"+c+"(?:$|;)","i")))},okButton:function(){var a=function(a,c){c=c||{};return CKEDITOR.tools.extend({id:"ok",type:"button",label:a.lang.common.ok,"class":"cke_dialog_ui_button_ok",
|
||||||
|
onClick:function(a){a=a.data.dialog;!1!==a.fire("ok",{hide:!0}).hide&&a.hide()}},c,!0)};a.type="button";a.override=function(b){return CKEDITOR.tools.extend(function(c){return a(c,b)},{type:"button"},!0)};return a}(),cancelButton:function(){var a=function(a,c){c=c||{};return CKEDITOR.tools.extend({id:"cancel",type:"button",label:a.lang.common.cancel,"class":"cke_dialog_ui_button_cancel",onClick:function(a){a=a.data.dialog;!1!==a.fire("cancel",{hide:!0}).hide&&a.hide()}},c,!0)};a.type="button";a.override=
|
||||||
|
function(b){return CKEDITOR.tools.extend(function(c){return a(c,b)},{type:"button"},!0)};return a}(),addUIElement:function(a,b){this._.uiElementBuilders[a]=b}});CKEDITOR.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null};CKEDITOR.event.implementOn(CKEDITOR.dialog);CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);var W={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]},z=function(a,
|
||||||
|
b,c){for(var e=0,d;d=a[e];e++)if(d.id==b||c&&d[c]&&(d=z(d[c],b,c)))return d;return null},A=function(a,b,c,e,d){if(c){for(var g=0,f;f=a[g];g++){if(f.id==c)return a.splice(g,0,b),b;if(e&&f[e]&&(f=A(f[e],b,c,e,!0)))return f}if(d)return null}a.push(b);return b},B=function(a,b,c){for(var e=0,d;d=a[e];e++){if(d.id==b)return a.splice(e,1);if(c&&d[c]&&(d=B(d[c],b,c)))return d}return null},L=function(a,b){this.dialog=a;for(var c=b.contents,e=0,d;d=c[e];e++)c[e]=d&&new I(a,d);CKEDITOR.tools.extend(this,b)};
|
||||||
|
L.prototype={getContents:function(a){return z(this.contents,a)},getButton:function(a){return z(this.buttons,a)},addContents:function(a,b){return A(this.contents,a,b)},addButton:function(a,b){return A(this.buttons,a,b)},removeContents:function(a){B(this.contents,a)},removeButton:function(a){B(this.buttons,a)}};I.prototype={get:function(a){return z(this.elements,a,"children")},add:function(a,b){return A(this.elements,a,b,"children")},remove:function(a){B(this.elements,a,"children")}};var F,w={},q,s=
|
||||||
|
{},M=function(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,e=a.data.$.shiftKey,d=String.fromCharCode(a.data.$.keyCode);if((b=s[(b?"CTRL+":"")+(c?"ALT+":"")+(e?"SHIFT+":"")+d])&&b.length)b=b[b.length-1],b.keydown&&b.keydown.call(b.uiElement,b.dialog,b.key),a.data.preventDefault()},N=function(a){var b=a.data.$.ctrlKey||a.data.$.metaKey,c=a.data.$.altKey,e=a.data.$.shiftKey,d=String.fromCharCode(a.data.$.keyCode);if((b=s[(b?"CTRL+":"")+(c?"ALT+":"")+(e?"SHIFT+":"")+d])&&b.length)b=b[b.length-
|
||||||
|
1],b.keyup&&(b.keyup.call(b.uiElement,b.dialog,b.key),a.data.preventDefault())},O=function(a,b,c,e,d){(s[c]||(s[c]=[])).push({uiElement:a,dialog:b,key:c,keyup:d||a.accessKeyUp,keydown:e||a.accessKeyDown})},X=function(a){for(var b in s){for(var c=s[b],e=c.length-1;0<=e;e--)(c[e].dialog==a||c[e].uiElement==a)&&c.splice(e,1);0===c.length&&delete s[b]}},Z=function(a,b){a._.accessKeyMap[b]&&a.selectPage(a._.accessKeyMap[b])},Y=function(){};(function(){CKEDITOR.ui.dialog={uiElement:function(a,b,c,e,d,g,
|
||||||
|
f){if(!(4>arguments.length)){var h=(e.call?e(b):e)||"div",m=["<",h," "],k=(d&&d.call?d(b):d)||{},i=(g&&g.call?g(b):g)||{},o=(f&&f.call?f.call(this,a,b):f)||"",j=this.domId=i.id||CKEDITOR.tools.getNextId()+"_uiElement";this.id=b.id;b.requiredContent&&!a.getParentEditor().filter.check(b.requiredContent)&&(k.display="none",this.notAllowed=!0);i.id=j;var n={};b.type&&(n["cke_dialog_ui_"+b.type]=1);b.className&&(n[b.className]=1);b.disabled&&(n.cke_disabled=1);for(var l=i["class"]&&i["class"].split?i["class"].split(" "):
|
||||||
|
[],j=0;j<l.length;j++)l[j]&&(n[l[j]]=1);l=[];for(j in n)l.push(j);i["class"]=l.join(" ");b.title&&(i.title=b.title);n=(b.style||"").split(";");b.align&&(l=b.align,k["margin-left"]="left"==l?0:"auto",k["margin-right"]="right"==l?0:"auto");for(j in k)n.push(j+":"+k[j]);b.hidden&&n.push("display:none");for(j=n.length-1;0<=j;j--)""===n[j]&&n.splice(j,1);0<n.length&&(i.style=(i.style?i.style+"; ":"")+n.join("; "));for(j in i)m.push(j+'="'+CKEDITOR.tools.htmlEncode(i[j])+'" ');m.push(">",o,"</",h,">");
|
||||||
|
c.push(m.join(""));(this._||(this._={})).dialog=a;"boolean"==typeof b.isChanged&&(this.isChanged=function(){return b.isChanged});"function"==typeof b.isChanged&&(this.isChanged=b.isChanged);"function"==typeof b.setValue&&(this.setValue=CKEDITOR.tools.override(this.setValue,function(a){return function(c){a.call(this,b.setValue.call(this,c))}}));"function"==typeof b.getValue&&(this.getValue=CKEDITOR.tools.override(this.getValue,function(a){return function(){return b.getValue.call(this,a.call(this))}}));
|
||||||
|
CKEDITOR.event.implementOn(this);this.registerEvents(b);this.accessKeyUp&&(this.accessKeyDown&&b.accessKey)&&O(this,a,"CTRL+"+b.accessKey);var p=this;a.on("load",function(){var b=p.getInputElement();if(b){var c=p.type in{checkbox:1,ratio:1}&&CKEDITOR.env.ie&&CKEDITOR.env.version<8?"cke_dialog_ui_focused":"";b.on("focus",function(){a._.tabBarMode=false;a._.hasFocus=true;p.fire("focus");c&&this.addClass(c)});b.on("blur",function(){p.fire("blur");c&&this.removeClass(c)})}});CKEDITOR.tools.extend(this,
|
||||||
|
b);this.keyboardFocusable&&(this.tabIndex=b.tabIndex||0,this.focusIndex=a._.focusList.push(this)-1,this.on("focus",function(){a._.currentFocusIndex=p.focusIndex}))}},hbox:function(a,b,c,e,d){if(!(4>arguments.length)){this._||(this._={});var g=this._.children=b,f=d&&d.widths||null,h=d&&d.height||null,m,k={role:"presentation"};d&&d.align&&(k.align=d.align);CKEDITOR.ui.dialog.uiElement.call(this,a,d||{type:"hbox"},e,"table",{},k,function(){var a=['<tbody><tr class="cke_dialog_ui_hbox">'];for(m=0;m<c.length;m++){var b=
|
||||||
|
"cke_dialog_ui_hbox_child",e=[];0===m&&(b="cke_dialog_ui_hbox_first");m==c.length-1&&(b="cke_dialog_ui_hbox_last");a.push('<td class="',b,'" role="presentation" ');f?f[m]&&e.push("width:"+r(f[m])):e.push("width:"+Math.floor(100/c.length)+"%");h&&e.push("height:"+r(h));d&&void 0!=d.padding&&e.push("padding:"+r(d.padding));CKEDITOR.env.ie&&(CKEDITOR.env.quirks&&g[m].align)&&e.push("text-align:"+g[m].align);0<e.length&&a.push('style="'+e.join("; ")+'" ');a.push(">",c[m],"</td>")}a.push("</tr></tbody>");
|
||||||
|
return a.join("")})}},vbox:function(a,b,c,e,d){if(!(3>arguments.length)){this._||(this._={});var g=this._.children=b,f=d&&d.width||null,h=d&&d.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,a,d||{type:"vbox"},e,"div",null,{role:"presentation"},function(){var b=['<table role="presentation" cellspacing="0" border="0" '];b.push('style="');d&&d.expand&&b.push("height:100%;");b.push("width:"+r(f||"100%"),";");CKEDITOR.env.webkit&&b.push("float:none;");b.push('"');b.push('align="',CKEDITOR.tools.htmlEncode(d&&
|
||||||
|
d.align||("ltr"==a.getParentEditor().lang.dir?"left":"right")),'" ');b.push("><tbody>");for(var e=0;e<c.length;e++){var i=[];b.push('<tr><td role="presentation" ');f&&i.push("width:"+r(f||"100%"));h?i.push("height:"+r(h[e])):d&&d.expand&&i.push("height:"+Math.floor(100/c.length)+"%");d&&void 0!=d.padding&&i.push("padding:"+r(d.padding));CKEDITOR.env.ie&&(CKEDITOR.env.quirks&&g[e].align)&&i.push("text-align:"+g[e].align);0<i.length&&b.push('style="',i.join("; "),'" ');b.push(' class="cke_dialog_ui_vbox_child">',
|
||||||
|
c[e],"</td></tr>")}b.push("</tbody></table>");return b.join("")})}}}})();CKEDITOR.ui.dialog.uiElement.prototype={getElement:function(){return CKEDITOR.document.getById(this.domId)},getInputElement:function(){return this.getElement()},getDialog:function(){return this._.dialog},setValue:function(a,b){this.getInputElement().setValue(a);!b&&this.fire("change",{value:a});return this},getValue:function(){return this.getInputElement().getValue()},isChanged:function(){return!1},selectParentTab:function(){for(var a=
|
||||||
|
this.getInputElement();(a=a.getParent())&&-1==a.$.className.search("cke_dialog_page_contents"););if(!a)return this;a=a.getAttribute("name");this._.dialog._.currentTabId!=a&&this._.dialog.selectPage(a);return this},focus:function(){this.selectParentTab().getInputElement().focus();return this},registerEvents:function(a){var b=/^on([A-Z]\w+)/,c,e=function(a,b,c,d){b.on("load",function(){a.getInputElement().on(c,d,a)})},d;for(d in a)if(c=d.match(b))this.eventProcessors[d]?this.eventProcessors[d].call(this,
|
||||||
|
this._.dialog,a[d]):e(this,this._.dialog,c[1].toLowerCase(),a[d]);return this},eventProcessors:{onLoad:function(a,b){a.on("load",b,this)},onShow:function(a,b){a.on("show",b,this)},onHide:function(a,b){a.on("hide",b,this)}},accessKeyDown:function(){this.focus()},accessKeyUp:function(){},disable:function(){var a=this.getElement();this.getInputElement().setAttribute("disabled","true");a.addClass("cke_disabled")},enable:function(){var a=this.getElement();this.getInputElement().removeAttribute("disabled");
|
||||||
|
a.removeClass("cke_disabled")},isEnabled:function(){return!this.getElement().hasClass("cke_disabled")},isVisible:function(){return this.getInputElement().isVisible()},isFocusable:function(){return!this.isEnabled()||!this.isVisible()?!1:!0}};CKEDITOR.ui.dialog.hbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getChild:function(a){if(1>arguments.length)return this._.children.concat();a.splice||(a=[a]);return 2>a.length?this._.children[a[0]]:this._.children[a[0]]&&this._.children[a[0]].getChild?
|
||||||
|
this._.children[a[0]].getChild(a.slice(1,a.length)):null}},!0);CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox;(function(){var a={build:function(a,c,e){for(var d=c.children,g,f=[],h=[],m=0;m<d.length&&(g=d[m]);m++){var k=[];f.push(k);h.push(CKEDITOR.dialog._.uiElementBuilders[g.type].build(a,g,k))}return new CKEDITOR.ui.dialog[c.type](a,h,f,e,c)}};CKEDITOR.dialog.addUIElement("hbox",a);CKEDITOR.dialog.addUIElement("vbox",a)})();CKEDITOR.dialogCommand=function(a,b){this.dialogName=a;
|
||||||
|
CKEDITOR.tools.extend(this,b,!0)};CKEDITOR.dialogCommand.prototype={exec:function(a){a.openDialog(this.dialogName)},canUndo:!1,editorFocus:1};(function(){var a=/^([a]|[^a])+$/,b=/^\d*$/,c=/^\d*(?:\.\d+)?$/,e=/^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,d=/^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,g=/^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;CKEDITOR.VALIDATE_OR=1;CKEDITOR.VALIDATE_AND=2;CKEDITOR.dialog.validate={functions:function(){var a=arguments;return function(){var b=this&&this.getValue?this.getValue():
|
||||||
|
a[0],c=void 0,d=CKEDITOR.VALIDATE_AND,e=[],g;for(g=0;g<a.length;g++)if("function"==typeof a[g])e.push(a[g]);else break;g<a.length&&"string"==typeof a[g]&&(c=a[g],g++);g<a.length&&"number"==typeof a[g]&&(d=a[g]);var j=d==CKEDITOR.VALIDATE_AND?!0:!1;for(g=0;g<e.length;g++)j=d==CKEDITOR.VALIDATE_AND?j&&e[g](b):j||e[g](b);return!j?c:!0}},regex:function(a,b){return function(c){c=this&&this.getValue?this.getValue():c;return!a.test(c)?b:!0}},notEmpty:function(b){return this.regex(a,b)},integer:function(a){return this.regex(b,
|
||||||
|
a)},number:function(a){return this.regex(c,a)},cssLength:function(a){return this.functions(function(a){return d.test(CKEDITOR.tools.trim(a))},a)},htmlLength:function(a){return this.functions(function(a){return e.test(CKEDITOR.tools.trim(a))},a)},inlineStyle:function(a){return this.functions(function(a){return g.test(CKEDITOR.tools.trim(a))},a)},equals:function(a,b){return this.functions(function(b){return b==a},b)},notEqual:function(a,b){return this.functions(function(b){return b!=a},b)}};CKEDITOR.on("instanceDestroyed",
|
||||||
|
function(a){if(CKEDITOR.tools.isEmpty(CKEDITOR.instances)){for(var b;b=CKEDITOR.dialog._.currentTop;)b.hide();for(var c in w)w[c].remove();w={}}var a=a.editor._.storedDialogs,d;for(d in a)a[d].destroy()})})();CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{openDialog:function(a,b){var c=null,e=CKEDITOR.dialog._.dialogDefinitions[a];null===CKEDITOR.dialog._.currentTop&&J(this);if("function"==typeof e)c=this._.storedDialogs||(this._.storedDialogs={}),c=c[a]||(c[a]=new CKEDITOR.dialog(this,a)),b&&b.call(c,
|
||||||
|
c),c.show();else{if("failed"==e)throw K(this),Error('[CKEDITOR.dialog.openDialog] Dialog "'+a+'" failed when loading definition.');"string"==typeof e&&CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e),function(){"function"!=typeof CKEDITOR.dialog._.dialogDefinitions[a]&&(CKEDITOR.dialog._.dialogDefinitions[a]="failed");this.openDialog(a,b)},this,0,1)}CKEDITOR.skin.loadPart("dialog");return c}})})();
|
||||||
|
CKEDITOR.plugins.add("dialog",{requires:"dialogui",init:function(t){t.on("doubleclick",function(u){u.data.dialog&&t.openDialog(u.data.dialog)},null,null,999)}});(function(){function v(b){function a(){var e=b.editable();e.on(p,function(b){(!CKEDITOR.env.ie||!n)&&u(b)});CKEDITOR.env.ie&&e.on("paste",function(e){q||(g(),e.data.preventDefault(),u(e),h("paste")||b.openDialog("paste"))});CKEDITOR.env.ie&&(e.on("contextmenu",i,null,null,0),e.on("beforepaste",function(b){b.data&&!b.data.$.ctrlKey&&i()},null,null,0));e.on("beforecut",function(){!n&&j(b)});var a;e.attachListener(CKEDITOR.env.ie?e:b.document.getDocumentElement(),"mouseup",function(){a=setTimeout(function(){r()},
|
||||||
|
0)});b.on("destroy",function(){clearTimeout(a)});e.on("keyup",r)}function c(e){return{type:e,canUndo:"cut"==e,startDisabled:!0,exec:function(){"cut"==this.type&&j();var e;var a=this.type;if(CKEDITOR.env.ie)e=h(a);else try{e=b.document.$.execCommand(a,!1,null)}catch(d){e=!1}e||alert(b.lang.clipboard[this.type+"Error"]);return e}}}function d(){return{canUndo:!1,async:!0,exec:function(b,a){var d=function(a,d){a&&f(a.type,a.dataValue,!!d);b.fire("afterCommandExec",{name:"paste",command:c,returnValue:!!a})},
|
||||||
|
c=this;"string"==typeof a?d({type:"auto",dataValue:a},1):b.getClipboardData(d)}}}function g(){q=1;setTimeout(function(){q=0},100)}function i(){n=1;setTimeout(function(){n=0},10)}function h(e){var a=b.document,d=a.getBody(),c=!1,j=function(){c=!0};d.on(e,j);(7<CKEDITOR.env.version?a.$:a.$.selection.createRange()).execCommand(e);d.removeListener(e,j);return c}function f(e,a,d){e={type:e};if(d&&!1===b.fire("beforePaste",e)||!a)return!1;e.dataValue=a;return b.fire("paste",e)}function j(){if(CKEDITOR.env.ie&&
|
||||||
|
!CKEDITOR.env.quirks){var e=b.getSelection(),a,d,c;if(e.getType()==CKEDITOR.SELECTION_ELEMENT&&(a=e.getSelectedElement()))d=e.getRanges()[0],c=b.document.createText(""),c.insertBefore(a),d.setStartBefore(c),d.setEndAfter(a),e.selectRanges([d]),setTimeout(function(){a.getParent()&&(c.remove(),e.selectElement(a))},0)}}function l(a,d){var c=b.document,j=b.editable(),l=function(b){b.cancel()},g;if(!c.getById("cke_pastebin")){var i=b.getSelection(),s=i.createBookmarks(),k=new CKEDITOR.dom.element((CKEDITOR.env.webkit||
|
||||||
|
j.is("body"))&&!CKEDITOR.env.ie?"body":"div",c);k.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var f=0,c=c.getWindow();CKEDITOR.env.webkit?(j.append(k),k.addClass("cke_editable"),j.is("body")||(f="static"!=j.getComputedStyle("position")?j:CKEDITOR.dom.element.get(j.$.offsetParent),f=f.getDocumentPosition().y)):j.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(k);k.setStyles({position:"absolute",top:c.getScrollPosition().y-f+10+"px",width:"1px",height:Math.max(1,c.getViewPaneSize().height-
|
||||||
|
20)+"px",overflow:"hidden",margin:0,padding:0});(f=k.getParent().isReadOnly())?(k.setOpacity(0),k.setAttribute("contenteditable",!0)):k.setStyle("ltr"==b.config.contentsLangDirection?"left":"right","-1000px");b.on("selectionChange",l,null,null,0);if(CKEDITOR.env.webkit||CKEDITOR.env.gecko)g=j.once("blur",l,null,null,-100);f&&k.focus();f=new CKEDITOR.dom.range(k);f.selectNodeContents(k);var h=f.select();CKEDITOR.env.ie&&(g=j.once("blur",function(){b.lockSelection(h)}));var m=CKEDITOR.document.getWindow().getScrollPosition().y;
|
||||||
|
setTimeout(function(){if(CKEDITOR.env.webkit)CKEDITOR.document.getBody().$.scrollTop=m;g&&g.removeListener();CKEDITOR.env.ie&&j.focus();i.selectBookmarks(s);k.remove();var a;if(CKEDITOR.env.webkit&&(a=k.getFirst())&&a.is&&a.hasClass("Apple-style-span"))k=a;b.removeListener("selectionChange",l);d(k.getHtml())},0)}}function s(){if(CKEDITOR.env.ie){b.focus();g();var a=b.focusManager;a.lock();if(b.editable().fire(p)&&!h("paste"))return a.unlock(),!1;a.unlock()}else try{if(b.editable().fire(p)&&!b.document.$.execCommand("Paste",
|
||||||
|
!1,null))throw 0;}catch(d){return!1}return!0}function o(a){if("wysiwyg"==b.mode)switch(a.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:a=b.editable();g();!CKEDITOR.env.ie&&a.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:b.fire("saveSnapshot"),setTimeout(function(){b.fire("saveSnapshot")},50)}}function u(a){var d={type:"auto"},c=b.fire("beforePaste",d);l(a,function(b){b=b.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,"");c&&f(d.type,b,0,1)})}function r(){if("wysiwyg"==
|
||||||
|
b.mode){var a=m("paste");b.getCommand("cut").setState(m("cut"));b.getCommand("copy").setState(m("copy"));b.getCommand("paste").setState(a);b.fire("pasteState",a)}}function m(a){if(t&&a in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==a)return CKEDITOR.TRISTATE_OFF;var a=b.getSelection(),d=a.getRanges();return a.getType()==CKEDITOR.SELECTION_NONE||1==d.length&&d[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var n=0,q=0,t=0,p=CKEDITOR.env.ie?"beforepaste":"paste";(function(){b.on("key",
|
||||||
|
o);b.on("contentDom",a);b.on("selectionChange",function(b){t=b.data.selection.getRanges()[0].checkReadOnly();r()});b.contextMenu&&b.contextMenu.addListener(function(b,a){t=a.getRanges()[0].checkReadOnly();return{cut:m("cut"),copy:m("copy"),paste:m("paste")}})})();(function(){function a(d,c,j,e,l){var g=b.lang.clipboard[c];b.addCommand(c,j);b.ui.addButton&&b.ui.addButton(d,{label:g,command:c,toolbar:"clipboard,"+e});b.addMenuItems&&b.addMenuItem(c,{label:g,command:c,group:"clipboard",order:l})}a("Cut",
|
||||||
|
"cut",c("cut"),10,1);a("Copy","copy",c("copy"),20,4);a("Paste","paste",d(),30,8)})();b.getClipboardData=function(a,d){function c(a){a.removeListener();a.cancel();d(a.data)}function j(a){a.removeListener();a.cancel();i=!0;d({type:f,dataValue:a.data})}function l(){this.customTitle=a&&a.title}var g=!1,f="auto",i=!1;d||(d=a,a=null);b.on("paste",c,null,null,0);b.on("beforePaste",function(a){a.removeListener();g=true;f=a.data.type},null,null,1E3);!1===s()&&(b.removeListener("paste",c),g&&b.fire("pasteDialog",
|
||||||
|
l)?(b.on("pasteDialogCommit",j),b.on("dialogHide",function(a){a.removeListener();a.data.removeListener("pasteDialogCommit",j);setTimeout(function(){i||d(null)},10)})):d(null))}}function w(b){if(CKEDITOR.env.webkit){if(!b.match(/^[^<]*$/g)&&!b.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!b.match(/^([^<]|<br( ?\/)?>)*$/gi)&&!b.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi))return"html"}else if(CKEDITOR.env.gecko){if(!b.match(/^([^<]|<br( ?\/)?>)*$/gi))return"html"}else return"html";
|
||||||
|
return"htmlifiedtext"}function x(b,a){function c(a){return CKEDITOR.tools.repeat("</p><p>",~~(a/2))+(1==a%2?"<br>":"")}a=a.replace(/\s+/g," ").replace(/> +</g,"><").replace(/<br ?\/>/gi,"<br>");a=a.replace(/<\/?[A-Z]+>/g,function(a){return a.toLowerCase()});if(a.match(/^[^<]$/))return a;CKEDITOR.env.webkit&&-1<a.indexOf("<div>")&&(a=a.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g,"<br>").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g,"<div></div>"),a.match(/<div>(<br>|)<\/div>/)&&(a="<p>"+
|
||||||
|
a.replace(/(<div>(<br>|)<\/div>)+/g,function(a){return c(a.split("</div><div>").length+1)})+"</p>"),a=a.replace(/<\/div><div>/g,"<br>"),a=a.replace(/<\/?div>/g,""));CKEDITOR.env.gecko&&b.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(a=a.replace(/^<br><br>$/,"<br>")),-1<a.indexOf("<br><br>")&&(a="<p>"+a.replace(/(<br>){2,}/g,function(a){return c(a.length/4)})+"</p>"));return o(b,a)}function y(){var b=new CKEDITOR.htmlParser.filter,a={blockquote:1,dl:1,fieldset:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,
|
||||||
|
ol:1,p:1,table:1,ul:1},c=CKEDITOR.tools.extend({br:0},CKEDITOR.dtd.$inline),d={p:1,br:1,"cke:br":1},g=CKEDITOR.dtd,i=CKEDITOR.tools.extend({area:1,basefont:1,embed:1,iframe:1,map:1,object:1,param:1},CKEDITOR.dtd.$nonBodyContent,CKEDITOR.dtd.$cdata),h=function(a){delete a.name;a.add(new CKEDITOR.htmlParser.text(" "))},f=function(a){for(var b=a,c;(b=b.next)&&b.name&&b.name.match(/^h\d$/);){c=new CKEDITOR.htmlParser.element("cke:br");c.isEmpty=!0;for(a.add(c);c=b.children.shift();)a.add(c)}};b.addRules({elements:{h1:f,
|
||||||
|
h2:f,h3:f,h4:f,h5:f,h6:f,img:function(a){var a=CKEDITOR.tools.trim(a.attributes.alt||""),b=" ";a&&!a.match(/(^http|\.(jpe?g|gif|png))/i)&&(b=" ["+a+"] ");return new CKEDITOR.htmlParser.text(b)},td:h,th:h,$:function(b){var f=b.name,h;if(i[f])return!1;b.attributes={};if("br"==f)return b;if(a[f])b.name="p";else if(c[f])delete b.name;else if(g[f]){h=new CKEDITOR.htmlParser.element("cke:br");h.isEmpty=!0;if(CKEDITOR.dtd.$empty[f])return h;b.add(h,0);h=h.clone();h.isEmpty=!0;b.add(h);delete b.name}d[b.name]||
|
||||||
|
delete b.name;return b}}},{applyToAll:!0});return b}function z(b,a,c){var a=new CKEDITOR.htmlParser.fragment.fromHtml(a),d=new CKEDITOR.htmlParser.basicWriter;a.writeHtml(d,c);var a=d.getHtml(),a=a.replace(/\s*(<\/?[a-z:]+ ?\/?>)\s*/g,"$1").replace(/(<cke:br \/>){2,}/g,"<cke:br />").replace(/(<cke:br \/>)(<\/?p>|<br \/>)/g,"$2").replace(/(<\/?p>|<br \/>)(<cke:br \/>)/g,"$1").replace(/<(cke:)?br( \/)?>/g,"<br>").replace(/<p><\/p>/g,""),g=0,a=a.replace(/<\/?p>/g,function(a){if("<p>"==a){if(1<++g)return"</p><p>"}else if(0<
|
||||||
|
--g)return"</p><p>";return a}).replace(/<p><\/p>/g,"");return o(b,a)}function o(b,a){b.enterMode==CKEDITOR.ENTER_BR?a=a.replace(/(<\/p><p>)+/g,function(a){return CKEDITOR.tools.repeat("<br>",2*(a.length/7))}).replace(/<\/?p>/g,""):b.enterMode==CKEDITOR.ENTER_DIV&&(a=a.replace(/<(\/)?p>/g,"<$1div>"));return a}CKEDITOR.plugins.add("clipboard",{requires:"dialog",init:function(b){var a;v(b);CKEDITOR.dialog.add("paste",CKEDITOR.getUrl(this.path+"dialogs/paste.js"));b.on("paste",function(a){var b=a.data.dataValue,
|
||||||
|
g=CKEDITOR.dtd.$block;-1<b.indexOf("Apple-")&&(b=b.replace(/<span class="Apple-converted-space"> <\/span>/gi," "),"html"!=a.data.type&&(b=b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi,function(a,b){return b.replace(/\t/g," ")})),-1<b.indexOf('<br class="Apple-interchange-newline">')&&(a.data.startsWithEOL=1,a.data.preSniffing="html",b=b.replace(/<br class="Apple-interchange-newline">/,"")),b=b.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1"));if(b.match(/^<[^<]+cke_(editable|contents)/i)){var i,
|
||||||
|
h,f=new CKEDITOR.dom.element("div");for(f.setHtml(b);1==f.getChildCount()&&(i=f.getFirst())&&i.type==CKEDITOR.NODE_ELEMENT&&(i.hasClass("cke_editable")||i.hasClass("cke_contents"));)f=h=i;h&&(b=h.getHtml().replace(/<br>$/i,""))}CKEDITOR.env.ie?b=b.replace(/^ (?: |\r\n)?<(\w+)/g,function(b,d){if(d.toLowerCase()in g){a.data.preSniffing="html";return"<"+d}return b}):CKEDITOR.env.webkit?b=b.replace(/<\/(\w+)><div><br><\/div>$/,function(b,d){if(d in g){a.data.endsWithEOL=1;return"</"+d+">"}return b}):
|
||||||
|
CKEDITOR.env.gecko&&(b=b.replace(/(\s)<br>$/,"$1"));a.data.dataValue=b},null,null,3);b.on("paste",function(c){var c=c.data,d=c.type,g=c.dataValue,i,h=b.config.clipboard_defaultContentType||"html";i="html"==d||"html"==c.preSniffing?"html":w(g);"htmlifiedtext"==i?g=x(b.config,g):"text"==d&&"html"==i&&(g=z(b.config,g,a||(a=y(b))));c.startsWithEOL&&(g='<br data-cke-eol="1">'+g);c.endsWithEOL&&(g+='<br data-cke-eol="1">');"auto"==d&&(d="html"==i||"html"==h?"html":"text");c.type=d;c.dataValue=g;delete c.preSniffing;
|
||||||
|
delete c.startsWithEOL;delete c.endsWithEOL},null,null,6);b.on("paste",function(a){a=a.data;b.insertHtml(a.dataValue,a.type);setTimeout(function(){b.fire("afterPaste")},0)},null,null,1E3);b.on("pasteDialog",function(a){setTimeout(function(){b.openDialog("paste",a.data)},0)})}})})();(function(){var c='<a id="{id}" class="cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href=\"javascript:void('{titleJs}')\"")+' title="{title}" tabindex="-1" hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="{hasArrow}" aria-disabled="{ariaDisabled}"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(c+=' onkeypress="return false;"');CKEDITOR.env.gecko&&(c+=' onblur="this.style.cssText = this.style.cssText;"');var c=c+(' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" '+
|
||||||
|
(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span class="cke_button_icon cke_button__{iconName}_icon" style="{style}"'),c=c+'> </span><span id="{id}_label" class="cke_button_label cke_button__{name}_label" aria-hidden="false">{label}</span>{arrowHtml}</a>',m=CKEDITOR.addTemplate("buttonArrow",'<span class="cke_button_arrow">'+(CKEDITOR.env.hc?"▼":"")+"</span>"),n=CKEDITOR.addTemplate("button",c);CKEDITOR.plugins.add("button",
|
||||||
|
{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_BUTTON,CKEDITOR.ui.button.handler)}});CKEDITOR.UI_BUTTON="button";CKEDITOR.ui.button=function(a){CKEDITOR.tools.extend(this,a,{title:a.label,click:a.click||function(b){b.execCommand(a.command)}});this._={}};CKEDITOR.ui.button.handler={create:function(a){return new CKEDITOR.ui.button(a)}};CKEDITOR.ui.button.prototype={render:function(a,b){var c=CKEDITOR.env,i=this._.id=CKEDITOR.tools.getNextId(),f="",e=this.command,k;this._.editor=a;var d={id:i,button:this,
|
||||||
|
editor:a,focus:function(){CKEDITOR.document.getById(i).focus()},execute:function(){this.button.click(a)},attach:function(a){this.button.attach(a)}},o=CKEDITOR.tools.addFunction(function(a){if(d.onkey)return a=new CKEDITOR.dom.event(a),!1!==d.onkey(d,a.getKeystroke())}),p=CKEDITOR.tools.addFunction(function(a){var b;d.onfocus&&(b=!1!==d.onfocus(d,new CKEDITOR.dom.event(a)));return b}),l=0;d.clickFn=k=CKEDITOR.tools.addFunction(function(){l&&(a.unlockSelection(1),l=0);d.execute()});if(this.modes){var j=
|
||||||
|
{},g=function(){var b=a.mode;b&&(b=this.modes[b]?void 0!=j[b]?j[b]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,b=a.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:b,this.setState(b),this.refresh&&this.refresh())};a.on("beforeModeUnload",function(){a.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(j[a.mode]=this._.state)},this);a.on("activeFilterChange",g,this);a.on("mode",g,this);!this.readOnly&&a.on("readOnly",g,this)}else if(e&&(e=a.getCommand(e)))e.on("state",function(){this.setState(e.state)},
|
||||||
|
this),f+=e.state==CKEDITOR.TRISTATE_ON?"on":e.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off";if(this.directional)a.on("contentDirChanged",function(b){var c=CKEDITOR.document.getById(this._.id),d=c.getFirst(),b=b.data;b!=a.lang.dir?c.addClass("cke_"+b):c.removeClass("cke_ltr").removeClass("cke_rtl");d.setAttribute("style",CKEDITOR.skin.getIconStyle(h,"rtl"==b,this.icon,this.iconOffset))},this);e||(f+="off");var h=g=this.name||this.command;this.icon&&!/\./.test(this.icon)&&(h=this.icon,this.icon=
|
||||||
|
null);c={id:i,name:g,iconName:h,label:this.label,cls:this.className||"",state:f,ariaDisabled:"disabled"==f?"true":"false",title:this.title,titleJs:c.gecko&&!c.hc?"":(this.title||"").replace("'",""),hasArrow:this.hasArrow?"true":"false",keydownFn:o,focusFn:p,clickFn:k,style:CKEDITOR.skin.getIconStyle(h,"rtl"==a.lang.dir,this.icon,this.iconOffset),arrowHtml:this.hasArrow?m.output():""};n.output(c,b);if(this.onRender)this.onRender();return d},setState:function(a){if(this._.state==a)return!1;this._.state=
|
||||||
|
a;var b=CKEDITOR.document.getById(this._.id);return b?(b.setState(a,"cke_button"),a==CKEDITOR.TRISTATE_DISABLED?b.setAttribute("aria-disabled",!0):b.removeAttribute("aria-disabled"),this.hasArrow?(a=a==CKEDITOR.TRISTATE_ON?this._.editor.lang.button.selectedLabel.replace(/%1/g,this.label):this.label,CKEDITOR.document.getById(this._.id+"_label").setText(a)):a==CKEDITOR.TRISTATE_ON?b.setAttribute("aria-pressed",!0):b.removeAttribute("aria-pressed"),!0):!1},getState:function(){return this._.state},toFeature:function(a){if(this._.feature)return this._.feature;
|
||||||
|
var b=this;!this.allowedContent&&(!this.requiredContent&&this.command)&&(b=a.getCommand(this.command)||b);return this._.feature=b}};CKEDITOR.ui.prototype.addButton=function(a,b){this.add(a,CKEDITOR.UI_BUTTON,b)}})();(function(){function w(a){function d(){for(var b=g(),e=CKEDITOR.tools.clone(a.config.toolbarGroups)||n(a),f=0;f<e.length;f++){var k=e[f];if("/"!=k){"string"==typeof k&&(k=e[f]={name:k});var i,d=k.groups;if(d)for(var h=0;h<d.length;h++)i=d[h],(i=b[i])&&c(k,i);(i=b[k.name])&&c(k,i)}}return e}function g(){var b={},c,f,e;for(c in a.ui.items)f=a.ui.items[c],e=f.toolbar||"others",e=e.split(","),f=e[0],e=parseInt(e[1]||-1,10),b[f]||(b[f]=[]),b[f].push({name:c,order:e});for(f in b)b[f]=b[f].sort(function(b,
|
||||||
|
a){return b.order==a.order?0:0>a.order?-1:0>b.order?1:b.order<a.order?-1:1});return b}function c(c,e){if(e.length){c.items?c.items.push(a.ui.create("-")):c.items=[];for(var f;f=e.shift();)if(f="string"==typeof f?f:f.name,!b||-1==CKEDITOR.tools.indexOf(b,f))(f=a.ui.create(f))&&a.addFeature(f)&&c.items.push(f)}}function h(b){var a=[],e,d,h;for(e=0;e<b.length;++e)d=b[e],h={},"/"==d?a.push(d):CKEDITOR.tools.isArray(d)?(c(h,CKEDITOR.tools.clone(d)),a.push(h)):d.items&&(c(h,CKEDITOR.tools.clone(d.items)),
|
||||||
|
h.name=d.name,a.push(h));return a}var b=a.config.removeButtons,b=b&&b.split(","),e=a.config.toolbar;"string"==typeof e&&(e=a.config["toolbar_"+e]);return a.toolbar=e?h(e):d()}function n(a){return a._.toolbarGroups||(a._.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"forms"},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list",
|
||||||
|
"indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var u=function(){this.toolbars=[];this.focusCommandExecuted=!1};u.prototype.focus=function(){for(var a=0,d;d=this.toolbars[a++];)for(var g=0,c;c=d.items[g++];)if(c.focus){c.focus();return}};var x={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(a){a.toolbox&&(a.toolbox.focusCommandExecuted=!0,CKEDITOR.env.ie||CKEDITOR.env.air?setTimeout(function(){a.toolbox.focus()},
|
||||||
|
100):a.toolbox.focus())}};CKEDITOR.plugins.add("toolbar",{requires:"button",init:function(a){var d,g=function(c,h){var b,e="rtl"==a.lang.dir,j=a.config.toolbarGroupCycling,o=e?37:39,e=e?39:37,j=void 0===j||j;switch(h){case 9:case CKEDITOR.SHIFT+9:for(;!b||!b.items.length;)if(b=9==h?(b?b.next:c.toolbar.next)||a.toolbox.toolbars[0]:(b?b.previous:c.toolbar.previous)||a.toolbox.toolbars[a.toolbox.toolbars.length-1],b.items.length)for(c=b.items[d?b.items.length-1:0];c&&!c.focus;)(c=d?c.previous:c.next)||
|
||||||
|
(b=0);c&&c.focus();return!1;case o:b=c;do b=b.next,!b&&j&&(b=c.toolbar.items[0]);while(b&&!b.focus);b?b.focus():g(c,9);return!1;case 40:return c.button&&c.button.hasArrow?(a.once("panelShow",function(b){b.data._.panel._.currentBlock.onKeyDown(40)}),c.execute()):g(c,40==h?o:e),!1;case e:case 38:b=c;do b=b.previous,!b&&j&&(b=c.toolbar.items[c.toolbar.items.length-1]);while(b&&!b.focus);b?b.focus():(d=1,g(c,CKEDITOR.SHIFT+9),d=0);return!1;case 27:return a.focus(),!1;case 13:case 32:return c.execute(),
|
||||||
|
!1}return!0};a.on("uiSpace",function(c){if(c.data.space==a.config.toolbarLocation){c.removeListener();a.toolbox=new u;var d=CKEDITOR.tools.getNextId(),b=['<span id="',d,'" class="cke_voice_label">',a.lang.toolbar.toolbars,"</span>",'<span id="'+a.ui.spaceId("toolbox")+'" class="cke_toolbox" role="group" aria-labelledby="',d,'" onmousedown="return false;">'],d=!1!==a.config.toolbarStartupExpanded,e,j;a.config.toolbarCanCollapse&&a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&b.push('<span class="cke_toolbox_main"'+
|
||||||
|
(d?">":' style="display:none">'));for(var o=a.toolbox.toolbars,f=w(a),k=0;k<f.length;k++){var i,l=0,r,m=f[k],s;if(m)if(e&&(b.push("</span>"),j=e=0),"/"===m)b.push('<span class="cke_toolbar_break"></span>');else{s=m.items||m;for(var t=0;t<s.length;t++){var p=s[t],n;if(p)if(p.type==CKEDITOR.UI_SEPARATOR)j=e&&p;else{n=!1!==p.canGroup;if(!l){i=CKEDITOR.tools.getNextId();l={id:i,items:[]};r=m.name&&(a.lang.toolbar.toolbarGroups[m.name]||m.name);b.push('<span id="',i,'" class="cke_toolbar"',r?' aria-labelledby="'+
|
||||||
|
i+'_label"':"",' role="toolbar">');r&&b.push('<span id="',i,'_label" class="cke_voice_label">',r,"</span>");b.push('<span class="cke_toolbar_start"></span>');var q=o.push(l)-1;0<q&&(l.previous=o[q-1],l.previous.next=l)}n?e||(b.push('<span class="cke_toolgroup" role="presentation">'),e=1):e&&(b.push("</span>"),e=0);i=function(c){c=c.render(a,b);q=l.items.push(c)-1;if(q>0){c.previous=l.items[q-1];c.previous.next=c}c.toolbar=l;c.onkey=g;c.onfocus=function(){a.toolbox.focusCommandExecuted||a.focus()}};
|
||||||
|
j&&(i(j),j=0);i(p)}}e&&(b.push("</span>"),j=e=0);l&&b.push('<span class="cke_toolbar_end"></span></span>')}}a.config.toolbarCanCollapse&&b.push("</span>");if(a.config.toolbarCanCollapse&&a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var v=CKEDITOR.tools.addFunction(function(){a.execCommand("toolbarCollapse")});a.on("destroy",function(){CKEDITOR.tools.removeFunction(v)});a.addCommand("toolbarCollapse",{readOnly:1,exec:function(b){var a=b.ui.space("toolbar_collapser"),c=a.getPrevious(),e=b.ui.space("contents"),
|
||||||
|
d=c.getParent(),f=parseInt(e.$.style.height,10),h=d.$.offsetHeight,g=a.hasClass("cke_toolbox_collapser_min");g?(c.show(),a.removeClass("cke_toolbox_collapser_min"),a.setAttribute("title",b.lang.toolbar.toolbarCollapse)):(c.hide(),a.addClass("cke_toolbox_collapser_min"),a.setAttribute("title",b.lang.toolbar.toolbarExpand));a.getFirst().setText(g?"▲":"◀");e.setStyle("height",f-(d.$.offsetHeight-h)+"px");b.fire("resize")},modes:{wysiwyg:1,source:1}});a.setKeystroke(CKEDITOR.ALT+(CKEDITOR.env.ie||CKEDITOR.env.webkit?
|
||||||
|
189:109),"toolbarCollapse");b.push('<a title="'+(d?a.lang.toolbar.toolbarCollapse:a.lang.toolbar.toolbarExpand)+'" id="'+a.ui.spaceId("toolbar_collapser")+'" tabIndex="-1" class="cke_toolbox_collapser');d||b.push(" cke_toolbox_collapser_min");b.push('" onclick="CKEDITOR.tools.callFunction('+v+')">','<span class="cke_arrow">▲</span>',"</a>")}b.push("</span>");c.data.html+=b.join("")}});a.on("destroy",function(){if(this.toolbox){var a,d=0,b,e,g;for(a=this.toolbox.toolbars;d<a.length;d++){e=a[d].items;
|
||||||
|
for(b=0;b<e.length;b++)g=e[b],g.clickFn&&CKEDITOR.tools.removeFunction(g.clickFn),g.keyDownFn&&CKEDITOR.tools.removeFunction(g.keyDownFn)}}});a.on("uiReady",function(){var c=a.ui.space("toolbox");c&&a.focusManager.add(c,1)});a.addCommand("toolbarFocus",x);a.setKeystroke(CKEDITOR.ALT+121,"toolbarFocus");a.ui.add("-",CKEDITOR.UI_SEPARATOR,{});a.ui.addHandler(CKEDITOR.UI_SEPARATOR,{create:function(){return{render:function(a,d){d.push('<span class="cke_toolbar_separator" role="separator"></span>');return{}}}}})}});
|
||||||
|
CKEDITOR.ui.prototype.addToolbarGroup=function(a,d,g){var c=n(this.editor),h=0===d,b={name:a};if(g){if(g=CKEDITOR.tools.search(c,function(a){return a.name==g})){!g.groups&&(g.groups=[]);if(d&&(d=CKEDITOR.tools.indexOf(g.groups,d),0<=d)){g.groups.splice(d+1,0,a);return}h?g.groups.splice(0,0,a):g.groups.push(a);return}d=null}d&&(d=CKEDITOR.tools.indexOf(c,function(a){return a.name==d}));h?c.splice(0,0,a):"number"==typeof d?c.splice(d+1,0,b):c.push(a)}})();CKEDITOR.UI_SEPARATOR="separator";
|
||||||
|
CKEDITOR.config.toolbarLocation="top";(function(){function l(e,c,b){b=e.config.forceEnterMode||b;"wysiwyg"==e.mode&&(c||(c=e.activeEnterMode),e.elementPath().isContextFor("p")||(c=CKEDITOR.ENTER_BR,b=1),e.fire("saveSnapshot"),c==CKEDITOR.ENTER_BR?o(e,c,null,b):p(e,c,null,b),e.fire("saveSnapshot"))}function q(e){for(var e=e.getSelection().getRanges(!0),c=e.length-1;0<c;c--)e[c].deleteContents();return e[0]}CKEDITOR.plugins.add("enterkey",{init:function(e){e.addCommand("enter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(c){l(c)}});
|
||||||
|
e.addCommand("shiftEnter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(c){l(c,c.activeShiftEnterMode,1)}});e.setKeystroke([[13,"enter"],[CKEDITOR.SHIFT+13,"shiftEnter"]])}});var t=CKEDITOR.dom.walker.whitespaces(),u=CKEDITOR.dom.walker.bookmark();CKEDITOR.plugins.enterkey={enterBlock:function(e,c,b,i){if(b=b||q(e)){var f=b.document,j=b.checkStartOfBlock(),h=b.checkEndOfBlock(),a=e.elementPath(b.startContainer).block,k=c==CKEDITOR.ENTER_DIV?"div":"p",d;if(j&&h){if(a&&(a.is("li")||a.getParent().is("li"))){b=
|
||||||
|
a.getParent();d=b.getParent();var i=!a.hasPrevious(),m=!a.hasNext(),k=e.getSelection(),g=k.createBookmarks(),j=a.getDirection(1),h=a.getAttribute("class"),n=a.getAttribute("style"),l=d.getDirection(1)!=j,e=e.enterMode!=CKEDITOR.ENTER_BR||l||n||h;if(d.is("li"))if(i||m)a[i?"insertBefore":"insertAfter"](d);else a.breakParent(d);else{if(e)if(d=f.createElement(c==CKEDITOR.ENTER_P?"p":"div"),l&&d.setAttribute("dir",j),n&&d.setAttribute("style",n),h&&d.setAttribute("class",h),a.moveChildren(d),i||m)d[i?
|
||||||
|
"insertBefore":"insertAfter"](b);else a.breakParent(b),d.insertAfter(b);else if(a.appendBogus(!0),i||m)for(;f=a[i?"getFirst":"getLast"]();)f[i?"insertBefore":"insertAfter"](b);else for(a.breakParent(b);f=a.getLast();)f.insertAfter(b);a.remove()}k.selectBookmarks(g);return}if(a&&a.getParent().is("blockquote")){a.breakParent(a.getParent());a.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1))||a.getPrevious().remove();a.getNext().getFirst(CKEDITOR.dom.walker.invisible(1))||a.getNext().remove();
|
||||||
|
b.moveToElementEditStart(a);b.select();return}}else if(a&&a.is("pre")&&!h){o(e,c,b,i);return}if(h=b.splitBlock(k)){c=h.previousBlock;a=h.nextBlock;e=h.wasStartOfBlock;j=h.wasEndOfBlock;if(a)g=a.getParent(),g.is("li")&&(a.breakParent(g),a.move(a.getNext(),1));else if(c&&(g=c.getParent())&&g.is("li"))c.breakParent(g),g=c.getNext(),b.moveToElementEditStart(g),c.move(c.getPrevious());if(!e&&!j)a.is("li")&&(d=b.clone(),d.selectNodeContents(a),d=new CKEDITOR.dom.walker(d),d.evaluator=function(a){return!(u(a)||
|
||||||
|
t(a)||a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in CKEDITOR.dtd.$inline&&!(a.getName()in CKEDITOR.dtd.$empty))},(g=d.next())&&(g.type==CKEDITOR.NODE_ELEMENT&&g.is("ul","ol"))&&(CKEDITOR.env.needsBrFiller?f.createElement("br"):f.createText(" ")).insertBefore(g)),a&&b.moveToElementEditStart(a);else{if(c){if(c.is("li")||!r.test(c.getName())&&!c.is("pre"))d=c.clone()}else a&&(d=a.clone());d?i&&!d.is("li")&&d.renameNode(k):g&&g.is("li")?d=g:(d=f.createElement(k),c&&(m=c.getDirection())&&d.setAttribute("dir",
|
||||||
|
m));if(f=h.elementPath){i=0;for(k=f.elements.length;i<k;i++){g=f.elements[i];if(g.equals(f.block)||g.equals(f.blockLimit))break;CKEDITOR.dtd.$removeEmpty[g.getName()]&&(g=g.clone(),d.moveChildren(g),d.append(g))}}d.appendBogus();d.getParent()||b.insertNode(d);d.is("li")&&d.removeAttribute("value");if(CKEDITOR.env.ie&&e&&(!j||!c.getChildCount()))b.moveToElementEditStart(j?c:d),b.select();b.moveToElementEditStart(e&&!j?a:d)}b.select();b.scrollIntoView()}}},enterBr:function(e,c,b,i){if(b=b||q(e)){var f=
|
||||||
|
b.document,j=b.checkEndOfBlock(),h=new CKEDITOR.dom.elementPath(e.getSelection().getStartElement()),a=h.block,h=a&&h.block.getName();!i&&"li"==h?p(e,c,b,i):(!i&&j&&r.test(h)?(j=a.getDirection())?(f=f.createElement("div"),f.setAttribute("dir",j),f.insertAfter(a),b.setStart(f,0)):(f.createElement("br").insertAfter(a),CKEDITOR.env.gecko&&f.createText("").insertAfter(a),b.setStartAt(a.getNext(),CKEDITOR.env.ie?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_START)):(a="pre"==h&&CKEDITOR.env.ie&&
|
||||||
|
8>CKEDITOR.env.version?f.createText("\r"):f.createElement("br"),b.deleteContents(),b.insertNode(a),CKEDITOR.env.needsBrFiller?(f.createText("").insertAfter(a),j&&a.getParent().appendBogus(),a.getNext().$.nodeValue="",b.setStartAt(a.getNext(),CKEDITOR.POSITION_AFTER_START)):b.setStartAt(a,CKEDITOR.POSITION_AFTER_END)),b.collapse(!0),b.select(),b.scrollIntoView())}}};var s=CKEDITOR.plugins.enterkey,o=s.enterBr,p=s.enterBlock,r=/^h[1-6]$/})();(function(){function q(a){var i=a.config,l=a.fire("uiSpace",{space:"top",html:""}).html,o=function(){function f(a,c,e){b.setStyle(c,t(e));b.setStyle("position",a)}function e(a){var b=r.getDocumentPosition();switch(a){case "top":f("absolute","top",b.y-m-n);break;case "pin":f("fixed","top",q);break;case "bottom":f("absolute","top",b.y+(c.height||c.bottom-c.top)+n)}j=a}var j,r,k,c,h,m,s,l=i.floatSpaceDockedOffsetX||0,n=i.floatSpaceDockedOffsetY||0,p=i.floatSpacePinnedOffsetX||0,q=i.floatSpacePinnedOffsetY||
|
||||||
|
0;return function(d){if(r=a.editable())if(d&&"focus"==d.name&&b.show(),b.removeStyle("left"),b.removeStyle("right"),k=b.getClientRect(),c=r.getClientRect(),h=g.getViewPaneSize(),m=k.height,s="pageXOffset"in g.$?g.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft,j){m+n<=c.top?e("top"):m+n>h.height-c.bottom?e("pin"):e("bottom");var d=h.width/2,d=0<c.left&&c.right<h.width&&c.width>k.width?"rtl"==a.config.contentsLangDirection?"right":"left":d-c.left>c.right-d?"left":"right",f;k.width>h.width?
|
||||||
|
(d="left",f=0):(f="left"==d?0<c.left?c.left:0:c.right<h.width?h.width-c.right:0,f+k.width>h.width&&(d="left"==d?"right":"left",f=0));b.setStyle(d,t(("pin"==j?p:l)+f+("pin"==j?0:"left"==d?s:-s)))}else j="pin",e("pin"),o(d)}}();if(l){var b=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(u.output({content:l,id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(i.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.lang.editorPanel+", "+
|
||||||
|
a.name}))),p=CKEDITOR.tools.eventsBuffer(500,o),e=CKEDITOR.tools.eventsBuffer(100,o);b.unselectable();b.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(b){o(b);a.on("change",p.input);g.on("scroll",e.input);g.on("resize",e.input)});a.on("blur",function(){b.hide();a.removeListener("change",p.input);g.removeListener("scroll",e.input);g.removeListener("resize",e.input)});a.on("destroy",function(){g.removeListener("scroll",e.input);g.removeListener("resize",
|
||||||
|
e.input);b.clearCustomData();b.remove()});a.focusManager.hasFocus&&b.show();a.focusManager.add(b,1)}}var u=CKEDITOR.addTemplate("floatcontainer",'<div id="cke_{name}" class="cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir="{langDir}" title="'+(CKEDITOR.env.gecko?" ":"")+'" lang="{langCode}" role="application" style="{style}" aria-labelledby="cke_{name}_arialbl"><span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span><div class="cke_inner"><div id="{topId}" class="cke_top" role="presentation">{content}</div></div></div>'),
|
||||||
|
g=CKEDITOR.document.getWindow(),t=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(a){a.on("loaded",function(){q(this)},null,null,20)}})})();(function(){function k(a){var d=this.editor,b=a.document,c=b.body,e=b.getElementById("cke_actscrpt");e&&e.parentNode.removeChild(e);(e=b.getElementById("cke_shimscrpt"))&&e.parentNode.removeChild(e);CKEDITOR.env.gecko&&(c.contentEditable=!1,2E4>CKEDITOR.env.version&&(c.innerHTML=c.innerHTML.replace(/^.*<\!-- cke-content-start --\>/,""),setTimeout(function(){var a=new CKEDITOR.dom.range(new CKEDITOR.dom.document(b));a.setStart(new CKEDITOR.dom.node(c),0);d.getSelection().selectRanges([a])},0)));c.contentEditable=
|
||||||
|
!0;CKEDITOR.env.ie&&(c.hideFocus=!0,c.disabled=!0,c.removeAttribute("disabled"));delete this._.isLoadingData;this.$=c;b=new CKEDITOR.dom.document(b);this.setup();CKEDITOR.env.ie&&(b.getDocumentElement().addClass(b.$.compatMode),d.config.enterMode!=CKEDITOR.ENTER_P&&this.attachListener(b,"selectionchange",function(){var a=b.getBody(),c=d.getSelection(),e=c&&c.getRanges()[0];e&&(a.getHtml().match(/^<p>(?: |<br>)<\/p>$/i)&&e.startContainer.equals(a))&&setTimeout(function(){e=d.getSelection().getRanges()[0];
|
||||||
|
if(!e.startContainer.equals("body")){a.getFirst().remove(1);e.moveToElementEditEnd(a);e.select()}},0)}));if(CKEDITOR.env.webkit||CKEDITOR.env.ie&&10<CKEDITOR.env.version)b.getDocumentElement().on("mousedown",function(a){a.data.getTarget().is("html")&&setTimeout(function(){d.editable().focus()})});try{d.document.$.execCommand("2D-position",!1,!0)}catch(g){}try{d.document.$.execCommand("enableInlineTableEditing",!1,!d.config.disableNativeTableHandles)}catch(f){}if(d.config.disableObjectResizing)try{this.getDocument().$.execCommand("enableObjectResizing",
|
||||||
|
!1,!1)}catch(h){this.attachListener(this,CKEDITOR.env.ie?"resizestart":"resize",function(a){a.data.preventDefault()})}(CKEDITOR.env.gecko||CKEDITOR.env.ie&&"CSS1Compat"==d.document.$.compatMode)&&this.attachListener(this,"keydown",function(a){var b=a.data.getKeystroke();if(b==33||b==34)if(CKEDITOR.env.ie)setTimeout(function(){d.getSelection().scrollIntoView()},0);else if(d.window.$.innerHeight>this.$.offsetHeight){var c=d.createRange();c[b==33?"moveToElementEditStart":"moveToElementEditEnd"](this);
|
||||||
|
c.select();a.data.preventDefault()}});CKEDITOR.env.ie&&this.attachListener(b,"blur",function(){try{b.$.selection.empty()}catch(a){}});CKEDITOR.env.iOS&&this.attachListener(b,"touchend",function(){a.focus()});d.document.getElementsByTag("title").getItem(0).data("cke-title",d.document.$.title);CKEDITOR.env.ie&&(d.document.$.title=this._.docTitle);CKEDITOR.tools.setTimeout(function(){if(this.status=="unloaded")this.status="ready";d.fire("contentDom");if(this._.isPendingFocus){d.focus();this._.isPendingFocus=
|
||||||
|
false}setTimeout(function(){d.fire("dataReady")},0);CKEDITOR.env.ie&&setTimeout(function(){if(d.document){var a=d.document.$.body;a.runtimeStyle.marginBottom="0px";a.runtimeStyle.marginBottom=""}},1E3)},0,this)}function l(){var a=[];if(8<=CKEDITOR.document.$.documentMode){a.push("html.CSS1Compat [contenteditable=false]{min-height:0 !important}");var d=[],b;for(b in CKEDITOR.dtd.$removeEmpty)d.push("html.CSS1Compat "+b+"[contenteditable=false]");a.push(d.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&
|
||||||
|
(a.push("html{height:100% !important}"),a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));a.push("html{cursor:text;*cursor:auto}");a.push("img,input,textarea{cursor:default}");return a.join("\n")}CKEDITOR.plugins.add("wysiwygarea",{init:function(a){a.config.fullPage&&a.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",requiredContent:"body"});a.addMode("wysiwyg",function(d){function b(b){b&&b.removeListener();a.editable(new j(a,
|
||||||
|
e.$.contentWindow.document.body));a.setData(a.getData(1),d)}var c="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",c=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie?"javascript:void(function(){"+encodeURIComponent(c)+"}())":"",e=CKEDITOR.dom.element.createFromHtml('<iframe src="'+c+'" frameBorder="0"></iframe>');e.setStyles({width:"100%",height:"100%"});e.addClass("cke_wysiwyg_frame cke_reset");var g=a.ui.space("contents");g.append(e);if(c=CKEDITOR.env.ie||
|
||||||
|
CKEDITOR.env.gecko)e.on("load",b);var f=a.title,h=a.lang.common.editorHelp;f&&(CKEDITOR.env.ie&&(f+=", "+h),e.setAttribute("title",f));var f=CKEDITOR.tools.getNextId(),i=CKEDITOR.dom.element.createFromHtml('<span id="'+f+'" class="cke_voice_label">'+h+"</span>");g.append(i,1);a.on("beforeModeUnload",function(a){a.removeListener();i.remove()});e.setAttributes({"aria-describedby":f,tabIndex:a.tabIndex,allowTransparency:"true"});!c&&b();CKEDITOR.env.webkit&&(c=function(){g.setStyle("width","100%");e.hide();
|
||||||
|
e.setSize("width",g.getSize("width"));g.removeStyle("width");e.show()},e.setCustomData("onResize",c),CKEDITOR.document.getWindow().on("resize",c));a.fire("ariaWidget",e)})}});CKEDITOR.editor.prototype.addContentsCss=function(a){var d=this.config,b=d.contentsCss;CKEDITOR.tools.isArray(b)||(d.contentsCss=b?[b]:[]);d.contentsCss.push(a)};var j=CKEDITOR.tools.createClass({$:function(a){this.base.apply(this,arguments);this._.frameLoadedHandler=CKEDITOR.tools.addFunction(function(a){CKEDITOR.tools.setTimeout(k,
|
||||||
|
0,this,a)},this);this._.docTitle=this.getWindow().getFrame().getAttribute("title")},base:CKEDITOR.editable,proto:{setData:function(a,d){var b=this.editor;if(d)this.setHtml(a),b.fire("dataReady");else{this._.isLoadingData=!0;b._.dataStore={id:1};var c=b.config,e=c.fullPage,g=c.docType,f=CKEDITOR.tools.buildStyleHtml(l()).replace(/<style>/,'<style data-cke-temp="1">');e||(f+=CKEDITOR.tools.buildStyleHtml(b.config.contentsCss));var h=c.baseHref?'<base href="'+c.baseHref+'" data-cke-temp="1" />':"";e&&
|
||||||
|
(a=a.replace(/<!DOCTYPE[^>]*>/i,function(a){b.docType=g=a;return""}).replace(/<\?xml\s[^\?]*\?>/i,function(a){b.xmlDeclaration=a;return""}));a=b.dataProcessor.toHtml(a);e?(/<body[\s|>]/.test(a)||(a="<body>"+a),/<html[\s|>]/.test(a)||(a="<html>"+a+"</html>"),/<head[\s|>]/.test(a)?/<title[\s|>]/.test(a)||(a=a.replace(/<head[^>]*>/,"$&<title></title>")):a=a.replace(/<html[^>]*>/,"$&<head><title></title></head>"),h&&(a=a.replace(/<head>/,"$&"+h)),a=a.replace(/<\/head\s*>/,f+"$&"),a=g+a):a=c.docType+'<html dir="'+
|
||||||
|
c.contentsLangDirection+'" lang="'+(c.contentsLanguage||b.langCode)+'"><head><title>'+this._.docTitle+"</title>"+h+f+"</head><body"+(c.bodyId?' id="'+c.bodyId+'"':"")+(c.bodyClass?' class="'+c.bodyClass+'"':"")+">"+a+"</body></html>";CKEDITOR.env.gecko&&(a=a.replace(/<body/,'<body contenteditable="true" '),2E4>CKEDITOR.env.version&&(a=a.replace(/<body[^>]*>/,"$&<\!-- cke-content-start --\>")));c='<script id="cke_actscrpt" type="text/javascript"'+(CKEDITOR.env.ie?' defer="defer" ':"")+">var wasLoaded=0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction("+
|
||||||
|
this._.frameLoadedHandler+",window);wasLoaded=1;}"+(CKEDITOR.env.ie?"onload();":'document.addEventListener("DOMContentLoaded", onload, false );')+"<\/script>";CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(c+='<script id="cke_shimscrpt">window.parent.CKEDITOR.tools.enableHtml5Elements(document)<\/script>');a=a.replace(/(?=\s*<\/(:?head)>)/,c);this.clearCustomData();this.clearListeners();b.fire("contentDomUnload");var i=this.getDocument();try{i.write(a)}catch(j){setTimeout(function(){i.write(a)},0)}}},
|
||||||
|
getData:function(a){if(a)return this.getHtml();var a=this.editor,d=a.config,b=d.fullPage,c=b&&a.docType,e=b&&a.xmlDeclaration,g=this.getDocument(),b=b?g.getDocumentElement().getOuterHtml():g.getBody().getHtml();CKEDITOR.env.gecko&&d.enterMode!=CKEDITOR.ENTER_BR&&(b=b.replace(/<br>(?=\s*(:?$|<\/body>))/,""));b=a.dataProcessor.toDataFormat(b);e&&(b=e+"\n"+b);c&&(b=c+"\n"+b);return b},focus:function(){this._.isLoadingData?this._.isPendingFocus=!0:j.baseProto.focus.call(this)},detach:function(){var a=
|
||||||
|
this.editor,d=a.document,a=a.window.getFrame();j.baseProto.detach.call(this);this.clearCustomData();d.getDocumentElement().clearCustomData();a.clearCustomData();CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);(d=a.removeCustomData("onResize"))&&d.removeListener();a.remove()}}})})();CKEDITOR.config.disableObjectResizing=!1;CKEDITOR.config.disableNativeTableHandles=!0;CKEDITOR.config.disableNativeSpellChecker=!0;CKEDITOR.config.contentsCss=CKEDITOR.getUrl("contents.css");(function(){function k(a,b){var e,f;b.on("refresh",function(a){var b=[i],c;for(c in a.data.states)b.push(a.data.states[c]);this.setState(CKEDITOR.tools.search(b,m)?m:i)},b,null,100);b.on("exec",function(b){e=a.getSelection();f=e.createBookmarks(1);b.data||(b.data={});b.data.done=!1},b,null,0);b.on("exec",function(){a.forceNextSelectionCheck();e.selectBookmarks(f)},b,null,100)}var i=CKEDITOR.TRISTATE_DISABLED,m=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indent",{init:function(a){var b=CKEDITOR.plugins.indent.genericDefinition;
|
||||||
|
k(a,a.addCommand("indent",new b(!0)));k(a,a.addCommand("outdent",new b));a.ui.addButton&&(a.ui.addButton("Indent",{label:a.lang.indent.indent,command:"indent",directional:!0,toolbar:"indent,20"}),a.ui.addButton("Outdent",{label:a.lang.indent.outdent,command:"outdent",directional:!0,toolbar:"indent,10"}));a.on("dirChanged",function(b){var f=a.createRange(),j=b.data.node;f.setStartBefore(j);f.setEndAfter(j);for(var l=new CKEDITOR.dom.walker(f),c;c=l.next();)if(c.type==CKEDITOR.NODE_ELEMENT)if(!c.equals(j)&&
|
||||||
|
c.getDirection()){f.setStartAfter(c);l=new CKEDITOR.dom.walker(f)}else{var d=a.config.indentClasses;if(d)for(var g=b.data.dir=="ltr"?["_rtl",""]:["","_rtl"],h=0;h<d.length;h++)if(c.hasClass(d[h]+g[0])){c.removeClass(d[h]+g[0]);c.addClass(d[h]+g[1])}d=c.getStyle("margin-right");g=c.getStyle("margin-left");d?c.setStyle("margin-left",d):c.removeStyle("margin-left");g?c.setStyle("margin-right",g):c.removeStyle("margin-right")}})}});CKEDITOR.plugins.indent={genericDefinition:function(a){this.isIndent=
|
||||||
|
!!a;this.startDisabled=!this.isIndent},specificDefinition:function(a,b,e){this.name=b;this.editor=a;this.jobs={};this.enterBr=a.config.enterMode==CKEDITOR.ENTER_BR;this.isIndent=!!e;this.relatedGlobal=e?"indent":"outdent";this.indentKey=e?9:CKEDITOR.SHIFT+9;this.database={}},registerCommands:function(a,b){a.on("pluginsLoaded",function(){for(var a in b)(function(a,b){var e=a.getCommand(b.relatedGlobal),c;for(c in b.jobs)e.on("exec",function(d){d.data.done||(a.fire("lockSnapshot"),b.execJob(a,c)&&(d.data.done=
|
||||||
|
!0),a.fire("unlockSnapshot"),CKEDITOR.dom.element.clearAllMarkers(b.database))},this,null,c),e.on("refresh",function(d){d.data.states||(d.data.states={});d.data.states[b.name+"@"+c]=b.refreshJob(a,c,d.data.path)},this,null,c);a.addFeature(b)})(this,b[a])})}};CKEDITOR.plugins.indent.genericDefinition.prototype={context:"p",exec:function(){}};CKEDITOR.plugins.indent.specificDefinition.prototype={execJob:function(a,b){var e=this.jobs[b];if(e.state!=i)return e.exec.call(this,a)},refreshJob:function(a,
|
||||||
|
b,e){b=this.jobs[b];b.state=a.activeFilter.checkFeature(this)?b.refresh.call(this,a,e):i;return b.state},getContext:function(a){return a.contains(this.context)}}})();(function(){function s(e){function g(b){for(var f=d.startContainer,a=d.endContainer;f&&!f.getParent().equals(b);)f=f.getParent();for(;a&&!a.getParent().equals(b);)a=a.getParent();if(!f||!a)return!1;for(var h=f,f=[],c=!1;!c;)h.equals(a)&&(c=!0),f.push(h),h=h.getNext();if(1>f.length)return!1;h=b.getParents(!0);for(a=0;a<h.length;a++)if(h[a].getName&&k[h[a].getName()]){b=h[a];break}for(var h=n.isIndent?1:-1,a=f[0],f=f[f.length-1],c=CKEDITOR.plugins.list.listToArray(b,o),g=c[f.getCustomData("listarray_index")].indent,
|
||||||
|
a=a.getCustomData("listarray_index");a<=f.getCustomData("listarray_index");a++)if(c[a].indent+=h,0<h){var l=c[a].parent;c[a].parent=new CKEDITOR.dom.element(l.getName(),l.getDocument())}for(a=f.getCustomData("listarray_index")+1;a<c.length&&c[a].indent>g;a++)c[a].indent+=h;f=CKEDITOR.plugins.list.arrayToList(c,o,null,e.config.enterMode,b.getDirection());if(!n.isIndent){var i;if((i=b.getParent())&&i.is("li"))for(var h=f.listNode.getChildren(),m=[],j,a=h.count()-1;0<=a;a--)(j=h.getItem(a))&&(j.is&&
|
||||||
|
j.is("li"))&&m.push(j)}f&&f.listNode.replace(b);if(m&&m.length)for(a=0;a<m.length;a++){for(j=b=m[a];(j=j.getNext())&&j.is&&j.getName()in k;)CKEDITOR.env.needsNbspFiller&&!b.getFirst(t)&&b.append(d.document.createText(" ")),b.append(j);b.insertAfter(i)}f&&e.fire("contentDomInvalidated");return!0}for(var n=this,o=this.database,k=this.context,l=e.getSelection(),l=(l&&l.getRanges()).createIterator(),d;d=l.getNextRange();){for(var b=d.getCommonAncestor();b&&!(b.type==CKEDITOR.NODE_ELEMENT&&k[b.getName()]);)b=
|
||||||
|
b.getParent();b||(b=d.startPath().contains(k))&&d.setEndAt(b,CKEDITOR.POSITION_BEFORE_END);if(!b){var c=d.getEnclosedNode();c&&(c.type==CKEDITOR.NODE_ELEMENT&&c.getName()in k)&&(d.setStartAt(c,CKEDITOR.POSITION_AFTER_START),d.setEndAt(c,CKEDITOR.POSITION_BEFORE_END),b=c)}b&&(d.startContainer.type==CKEDITOR.NODE_ELEMENT&&d.startContainer.getName()in k)&&(c=new CKEDITOR.dom.walker(d),c.evaluator=i,d.startContainer=c.next());b&&(d.endContainer.type==CKEDITOR.NODE_ELEMENT&&d.endContainer.getName()in k)&&
|
||||||
|
(c=new CKEDITOR.dom.walker(d),c.evaluator=i,d.endContainer=c.previous());if(b)return g(b)}return 0}function p(e,g){g||(g=e.contains(this.context));return g&&e.block&&e.block.equals(g.getFirst(i))}function i(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.is("li")}function t(e){return u(e)&&v(e)}var u=CKEDITOR.dom.walker.whitespaces(!0),v=CKEDITOR.dom.walker.bookmark(!1,!0),q=CKEDITOR.TRISTATE_DISABLED,r=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(e){function g(e,
|
||||||
|
g){i.specificDefinition.apply(this,arguments);this.requiredContent=["ul","ol"];e.on("key",function(g){if("wysiwyg"==e.mode&&g.data.keyCode==this.indentKey){var d=this.getContext(e.elementPath());if(d&&(!this.isIndent||!p.call(this,e.elementPath(),d)))e.execCommand(this.relatedGlobal),g.cancel()}},this);this.jobs[this.isIndent?10:30]={refresh:this.isIndent?function(e,d){var b=this.getContext(d),c=p.call(this,d,b);return!b||!this.isIndent||c?q:r}:function(e,d){return!this.getContext(d)||this.isIndent?
|
||||||
|
q:r},exec:CKEDITOR.tools.bind(s,this)}}var i=CKEDITOR.plugins.indent;i.registerCommands(e,{indentlist:new g(e,"indentlist",!0),outdentlist:new g(e,"outdentlist")});CKEDITOR.tools.extend(g.prototype,i.specificDefinition.prototype,{context:{ol:1,ul:1}})}})})();(function(){function g(a,b){var c=j.exec(a),d=j.exec(b);if(c){if(!c[2]&&"px"==d[2])return d[1];if("px"==c[2]&&!d[2])return d[1]+"px"}return b}var i=CKEDITOR.htmlParser.cssStyle,h=CKEDITOR.tools.cssLength,j=/^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,k={elements:{$:function(a){var b=a.attributes;if((b=(b=(b=b&&b["data-cke-realelement"])&&new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(b)))&&b.children[0])&&a.attributes["data-cke-resizable"]){var c=(new i(a)).rules,a=b.attributes,d=c.width,c=
|
||||||
|
c.height;d&&(a.width=g(a.width,d));c&&(a.height=g(a.height,c))}return b}}};CKEDITOR.plugins.add("fakeobjects",{init:function(a){a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}","fakeobjects")},afterInit:function(a){(a=(a=a.dataProcessor)&&a.htmlFilter)&&a.addRules(k,{applyToAll:!0})}});CKEDITOR.editor.prototype.createFakeElement=function(a,b,c,d){var e=this.lang.fakeobjects,e=e[c]||e.unknown,b={"class":b,"data-cke-realelement":encodeURIComponent(a.getOuterHtml()),"data-cke-real-node-type":a.type,
|
||||||
|
alt:e,title:e,align:a.getAttribute("align")||""};CKEDITOR.env.hc||(b.src=CKEDITOR.tools.transparentImageData);c&&(b["data-cke-real-element-type"]=c);d&&(b["data-cke-resizable"]=d,c=new i,d=a.getAttribute("width"),a=a.getAttribute("height"),d&&(c.rules.width=h(d)),a&&(c.rules.height=h(a)),c.populate(b));return this.document.createElement("img",{attributes:b})};CKEDITOR.editor.prototype.createFakeParserElement=function(a,b,c,d){var e=this.lang.fakeobjects,e=e[c]||e.unknown,f;f=new CKEDITOR.htmlParser.basicWriter;
|
||||||
|
a.writeHtml(f);f=f.getHtml();b={"class":b,"data-cke-realelement":encodeURIComponent(f),"data-cke-real-node-type":a.type,alt:e,title:e,align:a.attributes.align||""};CKEDITOR.env.hc||(b.src=CKEDITOR.tools.transparentImageData);c&&(b["data-cke-real-element-type"]=c);d&&(b["data-cke-resizable"]=d,d=a.attributes,a=new i,c=d.width,d=d.height,void 0!=c&&(a.rules.width=h(c)),void 0!=d&&(a.rules.height=h(d)),a.populate(b));return new CKEDITOR.htmlParser.element("img",b)};CKEDITOR.editor.prototype.restoreRealElement=
|
||||||
|
function(a){if(a.data("cke-real-node-type")!=CKEDITOR.NODE_ELEMENT)return null;var b=CKEDITOR.dom.element.createFromHtml(decodeURIComponent(a.data("cke-realelement")),this.document);if(a.data("cke-resizable")){var c=a.getStyle("width"),a=a.getStyle("height");c&&b.setAttribute("width",g(b.getAttribute("width"),c));a&&b.setAttribute("height",g(b.getAttribute("height"),a))}return b}})();(function(){function m(c){return c.replace(/'/g,"\\$&")}function n(c){for(var b,a=c.length,f=[],e=0;e<a;e++)b=c.charCodeAt(e),f.push(b);return"String.fromCharCode("+f.join(",")+")"}function o(c,b){var a=c.plugins.link,f=a.compiledProtectionFunction.params,e,d;d=[a.compiledProtectionFunction.name,"("];for(var g=0;g<f.length;g++)a=f[g].toLowerCase(),e=b[a],0<g&&d.push(","),d.push("'",e?m(encodeURIComponent(b[a])):"","'");d.push(")");return d.join("")}function l(c){var c=c.config.emailProtection||"",
|
||||||
|
b;c&&"encode"!=c&&(b={},c.replace(/^([^(]+)\(([^)]+)\)$/,function(a,c,e){b.name=c;b.params=[];e.replace(/[^,\s]+/g,function(a){b.params.push(a)})}));return b}CKEDITOR.plugins.add("link",{requires:"dialog,fakeobjects",onLoad:function(){function c(b){return a.replace(/%1/g,"rtl"==b?"right":"left").replace(/%2/g,"cke_contents_"+b)}var b="background:url("+CKEDITOR.getUrl(this.path+"images"+(CKEDITOR.env.hidpi?"/hidpi":"")+"/anchor.png")+") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",
|
||||||
|
a=".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{"+b+"padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{"+b+"width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";CKEDITOR.addCss(c("ltr")+c("rtl"))},init:function(c){var b="a[!href]";CKEDITOR.dialog.isTabEnabled(c,"link","advanced")&&(b=b.replace("]",",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type]{*}(*)"));CKEDITOR.dialog.isTabEnabled(c,"link","target")&&(b=b.replace("]",
|
||||||
|
",target,onclick]"));c.addCommand("link",new CKEDITOR.dialogCommand("link",{allowedContent:b,requiredContent:"a[href]"}));c.addCommand("anchor",new CKEDITOR.dialogCommand("anchor",{allowedContent:"a[!name,id]",requiredContent:"a[name]"}));c.addCommand("unlink",new CKEDITOR.unlinkCommand);c.addCommand("removeAnchor",new CKEDITOR.removeAnchorCommand);c.setKeystroke(CKEDITOR.CTRL+76,"link");c.ui.addButton&&(c.ui.addButton("Link",{label:c.lang.link.toolbar,command:"link",toolbar:"links,10"}),c.ui.addButton("Unlink",
|
||||||
|
{label:c.lang.link.unlink,command:"unlink",toolbar:"links,20"}),c.ui.addButton("Anchor",{label:c.lang.link.anchor.toolbar,command:"anchor",toolbar:"links,30"}));CKEDITOR.dialog.add("link",this.path+"dialogs/link.js");CKEDITOR.dialog.add("anchor",this.path+"dialogs/anchor.js");c.on("doubleclick",function(a){var b=CKEDITOR.plugins.link.getSelectedLink(c)||a.data.element;if(!b.isReadOnly())if(b.is("a")){a.data.dialog=b.getAttribute("name")&&(!b.getAttribute("href")||!b.getChildCount())?"anchor":"link";
|
||||||
|
a.data.link=b}else if(CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,b))a.data.dialog="anchor"},null,null,0);c.on("doubleclick",function(a){a.data.link&&c.getSelection().selectElement(a.data.link)},null,null,20);c.addMenuItems&&c.addMenuItems({anchor:{label:c.lang.link.anchor.menu,command:"anchor",group:"anchor",order:1},removeAnchor:{label:c.lang.link.anchor.remove,command:"removeAnchor",group:"anchor",order:5},link:{label:c.lang.link.menu,command:"link",group:"link",order:1},unlink:{label:c.lang.link.unlink,
|
||||||
|
command:"unlink",group:"link",order:5}});c.contextMenu&&c.contextMenu.addListener(function(a){if(!a||a.isReadOnly())return null;a=CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,a);if(!a&&!(a=CKEDITOR.plugins.link.getSelectedLink(c)))return null;var b={};a.getAttribute("href")&&a.getChildCount()&&(b={link:CKEDITOR.TRISTATE_OFF,unlink:CKEDITOR.TRISTATE_OFF});if(a&&a.hasAttribute("name"))b.anchor=b.removeAnchor=CKEDITOR.TRISTATE_OFF;return b});this.compiledProtectionFunction=l(c)},afterInit:function(c){c.dataProcessor.dataFilter.addRules({elements:{a:function(a){return!a.attributes.name?
|
||||||
|
null:!a.children.length?c.createFakeParserElement(a,"cke_anchor","anchor"):null}}});var b=c._.elementsPath&&c._.elementsPath.filters;b&&b.push(function(a,b){if("a"==b&&(CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,a)||a.getAttribute("name")&&(!a.getAttribute("href")||!a.getChildCount())))return"anchor"})}});var p=/^javascript:/,q=/^mailto:([^?]+)(?:\?(.+))?$/,r=/subject=([^;?:@&=$,\/]*)/,s=/body=([^;?:@&=$,\/]*)/,t=/^#(.*)$/,u=/^((?:http|https|ftp|news):\/\/)?(.*)$/,v=/^(_(?:self|top|parent|blank))$/,
|
||||||
|
w=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,x=/^javascript:([^(]+)\(([^)]+)\)$/,y=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,z=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,j={id:"advId",dir:"advLangDir",accessKey:"advAccessKey",name:"advName",lang:"advLangCode",tabindex:"advTabIndex",title:"advTitle",type:"advContentType","class":"advCSSClasses",charset:"advCharset",style:"advStyles",rel:"advRel"};
|
||||||
|
CKEDITOR.plugins.link={getSelectedLink:function(c){var b=c.getSelection(),a=b.getSelectedElement();return a&&a.is("a")?a:(b=b.getRanges()[0])?(b.shrink(CKEDITOR.SHRINK_TEXT),c.elementPath(b.getCommonAncestor()).contains("a",1)):null},getEditorAnchors:function(c){for(var b=c.editable(),a=b.isInline()&&!c.plugins.divarea?c.document:b,b=a.getElementsByTag("a"),a=a.getElementsByTag("img"),f=[],e=0,d;d=b.getItem(e++);)if(d.data("cke-saved-name")||d.hasAttribute("name"))f.push({name:d.data("cke-saved-name")||
|
||||||
|
d.getAttribute("name"),id:d.getAttribute("id")});for(e=0;d=a.getItem(e++);)(d=this.tryRestoreFakeAnchor(c,d))&&f.push({name:d.getAttribute("name"),id:d.getAttribute("id")});return f},fakeAnchor:!0,tryRestoreFakeAnchor:function(c,b){if(b&&b.data("cke-real-element-type")&&"anchor"==b.data("cke-real-element-type")){var a=c.restoreRealElement(b);if(a.data("cke-saved-name"))return a}},parseLinkAttributes:function(c,b){var a=b&&(b.data("cke-saved-href")||b.getAttribute("href"))||"",f=c.plugins.link.compiledProtectionFunction,
|
||||||
|
e=c.config.emailProtection,d,g={};a.match(p)&&("encode"==e?a=a.replace(w,function(a,b,c){return"mailto:"+String.fromCharCode.apply(String,b.split(","))+(c&&c.replace(/\\'/g,"'"))}):e&&a.replace(x,function(a,b,c){if(b==f.name){g.type="email";for(var a=g.email={},b=/(^')|('$)/g,c=c.match(/[^,\s]+/g),d=c.length,e,h,i=0;i<d;i++)e=decodeURIComponent,h=c[i].replace(b,"").replace(/\\'/g,"'"),h=e(h),e=f.params[i].toLowerCase(),a[e]=h;a.address=[a.name,a.domain].join("@")}}));if(!g.type)if(e=a.match(t))g.type=
|
||||||
|
"anchor",g.anchor={},g.anchor.name=g.anchor.id=e[1];else if(e=a.match(q)){d=a.match(r);a=a.match(s);g.type="email";var i=g.email={};i.address=e[1];d&&(i.subject=decodeURIComponent(d[1]));a&&(i.body=decodeURIComponent(a[1]))}else if(a&&(d=a.match(u)))g.type="url",g.url={},g.url.protocol=d[1],g.url.url=d[2];if(b){if(a=b.getAttribute("target"))g.target={type:a.match(v)?a:"frame",name:a};else if(a=(a=b.data("cke-pa-onclick")||b.getAttribute("onclick"))&&a.match(y))for(g.target={type:"popup",name:a[1]};e=
|
||||||
|
z.exec(a[2]);)("yes"==e[2]||"1"==e[2])&&!(e[1]in{height:1,width:1,top:1,left:1})?g.target[e[1]]=!0:isFinite(e[2])&&(g.target[e[1]]=e[2]);var a={},h;for(h in j)(e=b.getAttribute(h))&&(a[j[h]]=e);if(h=b.data("cke-saved-name")||a.advName)a.advName=h;CKEDITOR.tools.isEmpty(a)||(g.advanced=a)}return g},getLinkAttributes:function(c,b){var a=c.config.emailProtection||"",f={};switch(b.type){case "url":var a=b.url&&void 0!=b.url.protocol?b.url.protocol:"http://",e=b.url&&CKEDITOR.tools.trim(b.url.url)||"";
|
||||||
|
f["data-cke-saved-href"]=0===e.indexOf("/")?e:a+e;break;case "anchor":a=b.anchor&&b.anchor.id;f["data-cke-saved-href"]="#"+(b.anchor&&b.anchor.name||a||"");break;case "email":var d=b.email,e=d.address;switch(a){case "":case "encode":var g=encodeURIComponent(d.subject||""),i=encodeURIComponent(d.body||""),d=[];g&&d.push("subject="+g);i&&d.push("body="+i);d=d.length?"?"+d.join("&"):"";"encode"==a?(a=["javascript:void(location.href='mailto:'+",n(e)],d&&a.push("+'",m(d),"'"),a.push(")")):a=["mailto:",
|
||||||
|
e,d];break;default:a=e.split("@",2),d.name=a[0],d.domain=a[1],a=["javascript:",o(c,d)]}f["data-cke-saved-href"]=a.join("")}if(b.target)if("popup"==b.target.type){for(var a=["window.open(this.href, '",b.target.name||"","', '"],h="resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "),e=h.length,g=function(a){b.target[a]&&h.push(a+"="+b.target[a])},d=0;d<e;d++)h[d]+=b.target[h[d]]?"=yes":"=no";g("width");g("left");g("height");g("top");a.push(h.join(","),"'); return false;");
|
||||||
|
f["data-cke-pa-onclick"]=a.join("")}else"notSet"!=b.target.type&&b.target.name&&(f.target=b.target.name);if(b.advanced){for(var k in j)(a=b.advanced[j[k]])&&(f[k]=a);f.name&&(f["data-cke-saved-name"]=f.name)}f["data-cke-saved-href"]&&(f.href=f["data-cke-saved-href"]);k=CKEDITOR.tools.extend({target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1},j);for(var l in f)delete k[l];return{set:f,removed:CKEDITOR.tools.objectKeys(k)}}};CKEDITOR.unlinkCommand=function(){};CKEDITOR.unlinkCommand.prototype=
|
||||||
|
{exec:function(c){var b=new CKEDITOR.style({element:"a",type:CKEDITOR.STYLE_INLINE,alwaysRemoveElement:1});c.removeStyle(b)},refresh:function(c,b){var a=b.lastElement&&b.lastElement.getAscendant("a",!0);a&&"a"==a.getName()&&a.getAttribute("href")&&a.getChildCount()?this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)},contextSensitive:1,startDisabled:1,requiredContent:"a[href]"};CKEDITOR.removeAnchorCommand=function(){};CKEDITOR.removeAnchorCommand.prototype={exec:function(c){var b=
|
||||||
|
c.getSelection(),a=b.createBookmarks(),f;if(b&&(f=b.getSelectedElement())&&(!f.getChildCount()?CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,f):f.is("a")))f.remove(1);else if(f=CKEDITOR.plugins.link.getSelectedLink(c))f.hasAttribute("href")?(f.removeAttributes({name:1,"data-cke-saved-name":1}),f.removeClass("cke_anchor")):f.remove(1);b.selectBookmarks(a)},requiredContent:"a[name]"};CKEDITOR.tools.extend(CKEDITOR.config,{linkShowAdvancedTab:!0,linkShowTargetTab:!0})})();(function(){function E(c,j,e){function b(b){if((d=a[b?"getFirst":"getLast"]())&&(!d.is||!d.isBlockBoundary())&&(m=j.root[b?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(!0)))&&(!m.is||!m.isBlockBoundary({br:1})))c.document.createElement("br")[b?"insertBefore":"insertAfter"](d)}for(var k=CKEDITOR.plugins.list.listToArray(j.root,e),g=[],h=0;h<j.contents.length;h++){var f=j.contents[h];if((f=f.getAscendant("li",!0))&&!f.getCustomData("list_item_processed"))g.push(f),CKEDITOR.dom.element.setMarker(e,
|
||||||
|
f,"list_item_processed",!0)}f=null;for(h=0;h<g.length;h++)f=g[h].getCustomData("listarray_index"),k[f].indent=-1;for(h=f+1;h<k.length;h++)if(k[h].indent>k[h-1].indent+1){g=k[h-1].indent+1-k[h].indent;for(f=k[h].indent;k[h]&&k[h].indent>=f;)k[h].indent+=g,h++;h--}var a=CKEDITOR.plugins.list.arrayToList(k,e,null,c.config.enterMode,j.root.getAttribute("dir")).listNode,d,m;b(!0);b();a.replace(j.root);c.fire("contentDomInvalidated")}function x(c,j){this.name=c;this.context=this.type=j;this.allowedContent=
|
||||||
|
j+" li";this.requiredContent=j}function A(c,j,e,b){for(var k,g;k=c[b?"getLast":"getFirst"](F);)(g=k.getDirection(1))!==j.getDirection(1)&&k.setAttribute("dir",g),k.remove(),e?k[b?"insertBefore":"insertAfter"](e):j.append(k,b)}function B(c){var j;(j=function(e){var b=c[e?"getPrevious":"getNext"](q);b&&(b.type==CKEDITOR.NODE_ELEMENT&&b.is(c.getName()))&&(A(c,b,null,!e),c.remove(),c=b)})();j(1)}function C(c){return c.type==CKEDITOR.NODE_ELEMENT&&(c.getName()in CKEDITOR.dtd.$block||c.getName()in CKEDITOR.dtd.$listItem)&&
|
||||||
|
CKEDITOR.dtd[c.getName()]["#"]}function y(c,j,e){c.fire("saveSnapshot");e.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var b=e.extractContents();j.trim(!1,!0);var k=j.createBookmark(),g=new CKEDITOR.dom.elementPath(j.startContainer),h=g.block,g=g.lastElement.getAscendant("li",1)||h,f=new CKEDITOR.dom.elementPath(e.startContainer),a=f.contains(CKEDITOR.dtd.$listItem),f=f.contains(CKEDITOR.dtd.$list);h?(h=h.getBogus())&&h.remove():f&&(h=f.getPrevious(q))&&v(h)&&h.remove();(h=b.getLast())&&(h.type==
|
||||||
|
CKEDITOR.NODE_ELEMENT&&h.is("br"))&&h.remove();(h=j.startContainer.getChild(j.startOffset))?b.insertBefore(h):j.startContainer.append(b);if(a&&(b=w(a)))g.contains(a)?(A(b,a.getParent(),a),b.remove()):g.append(b);for(;e.checkStartOfBlock()&&e.checkEndOfBlock();){f=e.startPath();b=f.block;if(!b)break;b.is("li")&&(g=b.getParent(),b.equals(g.getLast(q))&&b.equals(g.getFirst(q))&&(b=g));e.moveToPosition(b,CKEDITOR.POSITION_BEFORE_START);b.remove()}e=e.clone();b=c.editable();e.setEndAt(b,CKEDITOR.POSITION_BEFORE_END);
|
||||||
|
e=new CKEDITOR.dom.walker(e);e.evaluator=function(a){return q(a)&&!v(a)};(e=e.next())&&(e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in CKEDITOR.dtd.$list)&&B(e);j.moveToBookmark(k);j.select();c.fire("saveSnapshot")}function w(c){return(c=c.getLast(q))&&c.type==CKEDITOR.NODE_ELEMENT&&c.getName()in r?c:null}var r={ol:1,ul:1},G=CKEDITOR.dom.walker.whitespaces(),D=CKEDITOR.dom.walker.bookmark(),q=function(c){return!(G(c)||D(c))},v=CKEDITOR.dom.walker.bogus();CKEDITOR.plugins.list={listToArray:function(c,
|
||||||
|
j,e,b,k){if(!r[c.getName()])return[];b||(b=0);e||(e=[]);for(var g=0,h=c.getChildCount();g<h;g++){var f=c.getChild(g);f.type==CKEDITOR.NODE_ELEMENT&&f.getName()in CKEDITOR.dtd.$list&&CKEDITOR.plugins.list.listToArray(f,j,e,b+1);if("li"==f.$.nodeName.toLowerCase()){var a={parent:c,indent:b,element:f,contents:[]};k?a.grandparent=k:(a.grandparent=c.getParent(),a.grandparent&&"li"==a.grandparent.$.nodeName.toLowerCase()&&(a.grandparent=a.grandparent.getParent()));j&&CKEDITOR.dom.element.setMarker(j,f,
|
||||||
|
"listarray_index",e.length);e.push(a);for(var d=0,m=f.getChildCount(),i;d<m;d++)i=f.getChild(d),i.type==CKEDITOR.NODE_ELEMENT&&r[i.getName()]?CKEDITOR.plugins.list.listToArray(i,j,e,b+1,a.grandparent):a.contents.push(i)}}return e},arrayToList:function(c,j,e,b,k){e||(e=0);if(!c||c.length<e+1)return null;for(var g,h=c[e].parent.getDocument(),f=new CKEDITOR.dom.documentFragment(h),a=null,d=e,m=Math.max(c[e].indent,0),i=null,n,l,p=b==CKEDITOR.ENTER_P?"p":"div";;){var o=c[d];g=o.grandparent;n=o.element.getDirection(1);
|
||||||
|
if(o.indent==m){if(!a||c[d].parent.getName()!=a.getName())a=c[d].parent.clone(!1,1),k&&a.setAttribute("dir",k),f.append(a);i=a.append(o.element.clone(0,1));n!=a.getDirection(1)&&i.setAttribute("dir",n);for(g=0;g<o.contents.length;g++)i.append(o.contents[g].clone(1,1));d++}else if(o.indent==Math.max(m,0)+1)o=c[d-1].element.getDirection(1),d=CKEDITOR.plugins.list.arrayToList(c,null,d,b,o!=n?n:null),!i.getChildCount()&&(CKEDITOR.env.needsNbspFiller&&!(7<h.$.documentMode))&&i.append(h.createText(" ")),
|
||||||
|
i.append(d.listNode),d=d.nextIndex;else if(-1==o.indent&&!e&&g){r[g.getName()]?(i=o.element.clone(!1,!0),n!=g.getDirection(1)&&i.setAttribute("dir",n)):i=new CKEDITOR.dom.documentFragment(h);var a=g.getDirection(1)!=n,u=o.element,z=u.getAttribute("class"),v=u.getAttribute("style"),w=i.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(b!=CKEDITOR.ENTER_BR||a||v||z),s,x=o.contents.length,t;for(g=0;g<x;g++)if(s=o.contents[g],D(s)&&1<x)w?t=s.clone(1,1):i.append(s.clone(1,1));else if(s.type==CKEDITOR.NODE_ELEMENT&&
|
||||||
|
s.isBlockBoundary()){a&&!s.getDirection()&&s.setAttribute("dir",n);l=s;var y=u.getAttribute("style");y&&l.setAttribute("style",y.replace(/([^;])$/,"$1;")+(l.getAttribute("style")||""));z&&s.addClass(z);l=null;t&&(i.append(t),t=null);i.append(s.clone(1,1))}else w?(l||(l=h.createElement(p),i.append(l),a&&l.setAttribute("dir",n)),v&&l.setAttribute("style",v),z&&l.setAttribute("class",z),t&&(l.append(t),t=null),l.append(s.clone(1,1))):i.append(s.clone(1,1));t&&((l||i).append(t),t=null);i.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&
|
||||||
|
d!=c.length-1&&(CKEDITOR.env.needsBrFiller&&(n=i.getLast())&&(n.type==CKEDITOR.NODE_ELEMENT&&n.is("br"))&&n.remove(),n=i.getLast(q),(!n||!(n.type==CKEDITOR.NODE_ELEMENT&&n.is(CKEDITOR.dtd.$block)))&&i.append(h.createElement("br")));n=i.$.nodeName.toLowerCase();("div"==n||"p"==n)&&i.appendBogus();f.append(i);a=null;d++}else return null;l=null;if(c.length<=d||Math.max(c[d].indent,0)<m)break}if(j)for(c=f.getFirst();c;){if(c.type==CKEDITOR.NODE_ELEMENT&&(CKEDITOR.dom.element.clearMarkers(j,c),c.getName()in
|
||||||
|
CKEDITOR.dtd.$listItem&&(e=c,h=k=b=void 0,b=e.getDirection()))){for(k=e.getParent();k&&!(h=k.getDirection());)k=k.getParent();b==h&&e.removeAttribute("dir")}c=c.getNextSourceNode()}return{listNode:f,nextIndex:d}}};var H=/^h[1-6]$/,F=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);x.prototype={exec:function(c){this.refresh(c,c.elementPath());var j=c.config,e=c.getSelection(),b=e&&e.getRanges();if(this.state==CKEDITOR.TRISTATE_OFF){var k=c.editable();if(k.getFirst(q)){var g=1==b.length&&b[0];(j=
|
||||||
|
g&&g.getEnclosedNode())&&(j.is&&this.type==j.getName())&&this.setState(CKEDITOR.TRISTATE_ON)}else j.enterMode==CKEDITOR.ENTER_BR?k.appendBogus():b[0].fixBlock(1,j.enterMode==CKEDITOR.ENTER_P?"p":"div"),e.selectRanges(b)}for(var j=e.createBookmarks(!0),k=[],h={},b=b.createIterator(),f=0;(g=b.getNextRange())&&++f;){var a=g.getBoundaryNodes(),d=a.startNode,m=a.endNode;d.type==CKEDITOR.NODE_ELEMENT&&"td"==d.getName()&&g.setStartAt(a.startNode,CKEDITOR.POSITION_AFTER_START);m.type==CKEDITOR.NODE_ELEMENT&&
|
||||||
|
"td"==m.getName()&&g.setEndAt(a.endNode,CKEDITOR.POSITION_BEFORE_END);g=g.createIterator();for(g.forceBrBreak=this.state==CKEDITOR.TRISTATE_OFF;a=g.getNextParagraph();)if(!a.getCustomData("list_block")){CKEDITOR.dom.element.setMarker(h,a,"list_block",1);for(var i=c.elementPath(a),d=i.elements,m=0,i=i.blockLimit,n,l=d.length-1;0<=l&&(n=d[l]);l--)if(r[n.getName()]&&i.contains(n)){i.removeCustomData("list_group_object_"+f);(d=n.getCustomData("list_group_object"))?d.contents.push(a):(d={root:n,contents:[a]},
|
||||||
|
k.push(d),CKEDITOR.dom.element.setMarker(h,n,"list_group_object",d));m=1;break}m||(m=i,m.getCustomData("list_group_object_"+f)?m.getCustomData("list_group_object_"+f).contents.push(a):(d={root:m,contents:[a]},CKEDITOR.dom.element.setMarker(h,m,"list_group_object_"+f,d),k.push(d)))}}for(n=[];0<k.length;)if(d=k.shift(),this.state==CKEDITOR.TRISTATE_OFF)if(r[d.root.getName()]){b=c;f=d;d=h;g=n;m=CKEDITOR.plugins.list.listToArray(f.root,d);i=[];for(a=0;a<f.contents.length;a++)if(l=f.contents[a],(l=l.getAscendant("li",
|
||||||
|
!0))&&!l.getCustomData("list_item_processed"))i.push(l),CKEDITOR.dom.element.setMarker(d,l,"list_item_processed",!0);for(var l=f.root.getDocument(),p=void 0,o=void 0,a=0;a<i.length;a++){var u=i[a].getCustomData("listarray_index"),p=m[u].parent;p.is(this.type)||(o=l.createElement(this.type),p.copyAttributes(o,{start:1,type:1}),o.removeStyle("list-style-type"),m[u].parent=o)}d=CKEDITOR.plugins.list.arrayToList(m,d,null,b.config.enterMode);m=void 0;i=d.listNode.getChildCount();for(a=0;a<i&&(m=d.listNode.getChild(a));a++)m.getName()==
|
||||||
|
this.type&&g.push(m);d.listNode.replace(f.root);b.fire("contentDomInvalidated")}else{m=c;a=d;g=n;i=a.contents;b=a.root.getDocument();f=[];1==i.length&&i[0].equals(a.root)&&(d=b.createElement("div"),i[0].moveChildren&&i[0].moveChildren(d),i[0].append(d),i[0]=d);a=a.contents[0].getParent();for(l=0;l<i.length;l++)a=a.getCommonAncestor(i[l].getParent());p=m.config.useComputedState;m=d=void 0;p=void 0===p||p;for(l=0;l<i.length;l++)for(o=i[l];u=o.getParent();){if(u.equals(a)){f.push(o);!m&&o.getDirection()&&
|
||||||
|
(m=1);o=o.getDirection(p);null!==d&&(d=d&&d!=o?null:o);break}o=u}if(!(1>f.length)){i=f[f.length-1].getNext();l=b.createElement(this.type);g.push(l);for(p=g=void 0;f.length;)g=f.shift(),p=b.createElement("li"),g.is("pre")||H.test(g.getName())||"false"==g.getAttribute("contenteditable")?g.appendTo(p):(g.copyAttributes(p),d&&g.getDirection()&&(p.removeStyle("direction"),p.removeAttribute("dir")),g.moveChildren(p),g.remove()),p.appendTo(l);d&&m&&l.setAttribute("dir",d);i?l.insertBefore(i):l.appendTo(a)}}else this.state==
|
||||||
|
CKEDITOR.TRISTATE_ON&&r[d.root.getName()]&&E.call(this,c,d,h);for(l=0;l<n.length;l++)B(n[l]);CKEDITOR.dom.element.clearAllMarkers(h);e.selectBookmarks(j);c.focus()},refresh:function(c,j){var e=j.contains(r,1),b=j.blockLimit||j.root;e&&b.contains(e)?this.setState(e.is(this.type)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_OFF)}};CKEDITOR.plugins.add("list",{requires:"indentlist",init:function(c){c.blockless||(c.addCommand("numberedlist",new x("numberedlist","ol")),c.addCommand("bulletedlist",
|
||||||
|
new x("bulletedlist","ul")),c.ui.addButton&&(c.ui.addButton("NumberedList",{label:c.lang.list.numberedlist,command:"numberedlist",directional:!0,toolbar:"list,10"}),c.ui.addButton("BulletedList",{label:c.lang.list.bulletedlist,command:"bulletedlist",directional:!0,toolbar:"list,20"})),c.on("key",function(j){var e=j.data.domEvent.getKey();if(c.mode=="wysiwyg"&&e in{8:1,46:1}){var b=c.getSelection().getRanges()[0],k=b&&b.startPath();if(b&&b.collapsed){var g=e==8,h=c.editable(),f=new CKEDITOR.dom.walker(b.clone());
|
||||||
|
f.evaluator=function(a){return q(a)&&!v(a)};f.guard=function(a,b){return!(b&&a.type==CKEDITOR.NODE_ELEMENT&&a.is("table"))};e=b.clone();if(g){var a,d;if((a=k.contains(r))&&b.checkBoundaryOfElement(a,CKEDITOR.START)&&(a=a.getParent())&&a.is("li")&&(a=w(a))){d=a;a=a.getPrevious(q);e.moveToPosition(a&&v(a)?a:d,CKEDITOR.POSITION_BEFORE_START)}else{f.range.setStartAt(h,CKEDITOR.POSITION_AFTER_START);f.range.setEnd(b.startContainer,b.startOffset);if((a=f.previous())&&a.type==CKEDITOR.NODE_ELEMENT&&(a.getName()in
|
||||||
|
r||a.is("li"))){if(!a.is("li")){f.range.selectNodeContents(a);f.reset();f.evaluator=C;a=f.previous()}d=a;e.moveToElementEditEnd(d)}}if(d){y(c,e,b);j.cancel()}else if((e=k.contains(r))&&b.checkBoundaryOfElement(e,CKEDITOR.START)){d=e.getFirst(q);if(b.checkBoundaryOfElement(d,CKEDITOR.START)){a=e.getPrevious(q);if(w(d)){if(a){b.moveToElementEditEnd(a);b.select()}}else c.execCommand("outdent");j.cancel()}}}else if(d=k.contains("li")){f.range.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);h=(k=d.getLast(q))&&
|
||||||
|
C(k)?k:d;d=0;if((a=f.next())&&a.type==CKEDITOR.NODE_ELEMENT&&a.getName()in r&&a.equals(k)){d=1;a=f.next()}else b.checkBoundaryOfElement(h,CKEDITOR.END)&&(d=1);if(d&&a){b=b.clone();b.moveToElementEditStart(a);y(c,e,b);j.cancel()}}else{f.range.setEndAt(h,CKEDITOR.POSITION_BEFORE_END);if((a=f.next())&&a.type==CKEDITOR.NODE_ELEMENT&&a.is(r)){a=a.getFirst(q);if(k.block&&b.checkStartOfBlock()&&b.checkEndOfBlock()){k.block.remove();b.moveToElementEditStart(a);b.select()}else if(w(a)){b.moveToElementEditStart(a);
|
||||||
|
b.select()}else{b=b.clone();b.moveToElementEditStart(a);y(c,e,b)}j.cancel()}}setTimeout(function(){c.selectionChange(1)})}}}))}})})();(function(){function g(a){this.editor=a;this.reset()}CKEDITOR.plugins.add("undo",{init:function(a){function c(a){b.enabled&&!1!==a.data.command.canUndo&&b.save()}function d(){b.enabled=a.readOnly?!1:"wysiwyg"==a.mode;b.onChange()}var b=a.undoManager=new g(a),e=a.addCommand("undo",{exec:function(){b.undo()&&(a.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),f=a.addCommand("redo",{exec:function(){b.redo()&&(a.selectionChange(),this.fire("afterRedo"))},startDisabled:!0,canUndo:!1}),
|
||||||
|
h=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90];a.setKeystroke([[h[0],"undo"],[h[1],"redo"],[h[2],"redo"]]);a.on("contentDom",function(){var b=a.editable();b.attachListener(b,"keydown",function(a){-1<CKEDITOR.tools.indexOf(h,a.data.getKeystroke())&&a.data.preventDefault()})});b.onChange=function(){e.setState(b.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);f.setState(b.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)};a.on("beforeCommandExec",c);a.on("afterCommandExec",
|
||||||
|
c);a.on("saveSnapshot",function(a){b.save(a.data&&a.data.contentOnly)});a.on("contentDom",function(){a.editable().on("keydown",function(a){a=a.data.getKey();(8==a||46==a)&&b.type(a,0)});a.editable().on("keypress",function(a){b.type(a.data.getKey(),1)})});a.on("beforeModeUnload",function(){"wysiwyg"==a.mode&&b.save(!0)});a.on("mode",d);a.on("readOnly",d);a.ui.addButton&&(a.ui.addButton("Undo",{label:a.lang.undo.undo,command:"undo",toolbar:"undo,10"}),a.ui.addButton("Redo",{label:a.lang.undo.redo,command:"redo",
|
||||||
|
toolbar:"undo,20"}));a.resetUndo=function(){b.reset();a.fire("saveSnapshot")};a.on("updateSnapshot",function(){b.currentImage&&b.update()});a.on("lockSnapshot",function(a){a=a.data;b.lock(a&&a.dontUpdate,a&&a.forceUpdate)});a.on("unlockSnapshot",b.unlock,b)}});CKEDITOR.plugins.undo={};var f=CKEDITOR.plugins.undo.Image=function(a,c){this.editor=a;a.fire("beforeUndoImage");var d=a.getSnapshot();CKEDITOR.env.ie&&d&&(d=d.replace(/\s+data-cke-expando=".*?"/g,""));this.contents=d;c||(this.bookmarks=(d=
|
||||||
|
d&&a.getSelection())&&d.createBookmarks2(!0));a.fire("afterUndoImage")},i=/\b(?:href|src|name)="[^"]*?"/gi;f.prototype={equalsContent:function(a){var c=this.contents,a=a.contents;if(CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks))c=c.replace(i,""),a=a.replace(i,"");return c!=a?!1:!0},equalsSelection:function(a){var c=this.bookmarks,a=a.bookmarks;if(c||a){if(!c||!a||c.length!=a.length)return!1;for(var d=0;d<c.length;d++){var b=c[d],e=a[d];if(b.startOffset!=e.startOffset||b.endOffset!=
|
||||||
|
e.endOffset||!CKEDITOR.tools.arrayCompare(b.start,e.start)||!CKEDITOR.tools.arrayCompare(b.end,e.end))return!1}}return!0}};g.prototype={type:function(a,c){var d=!c&&a!=this.lastKeystroke,b=this.editor;if(!this.typing||c&&!this.wasCharacter||d){var e=new f(b),g=this.snapshots.length;CKEDITOR.tools.setTimeout(function(){var a=b.getSnapshot();CKEDITOR.env.ie&&(a=a.replace(/\s+data-cke-expando=".*?"/g,""));e.contents!=a&&g==this.snapshots.length&&(this.typing=!0,this.save(!1,e,!1)||this.snapshots.splice(this.index+
|
||||||
|
1,this.snapshots.length-this.index-1),this.hasUndo=!0,this.hasRedo=!1,this.modifiersCount=this.typesCount=1,this.onChange())},0,this)}this.lastKeystroke=a;(this.wasCharacter=c)?(this.modifiersCount=0,this.typesCount++,25<this.typesCount?(this.save(!1,null,!1),this.typesCount=1):setTimeout(function(){b.fire("change")},0)):(this.typesCount=0,this.modifiersCount++,25<this.modifiersCount?(this.save(!1,null,!1),this.modifiersCount=1):setTimeout(function(){b.fire("change")},0))},reset:function(){this.lastKeystroke=
|
||||||
|
0;this.snapshots=[];this.index=-1;this.limit=this.editor.config.undoStackSize||20;this.currentImage=null;this.hasRedo=this.hasUndo=!1;this.locked=null;this.resetType()},resetType:function(){this.typing=!1;delete this.lastKeystroke;this.modifiersCount=this.typesCount=0},fireChange:function(){this.hasUndo=!!this.getNextImage(!0);this.hasRedo=!!this.getNextImage(!1);this.resetType();this.onChange()},save:function(a,c,d){var b=this.editor;if(this.locked||"ready"!=b.status||"wysiwyg"!=b.mode)return!1;
|
||||||
|
var e=b.editable();if(!e||"ready"!=e.status)return!1;e=this.snapshots;c||(c=new f(b));if(!1===c.contents)return!1;if(this.currentImage)if(c.equalsContent(this.currentImage)){if(a||c.equalsSelection(this.currentImage))return!1}else b.fire("change");e.splice(this.index+1,e.length-this.index-1);e.length==this.limit&&e.shift();this.index=e.push(c)-1;this.currentImage=c;!1!==d&&this.fireChange();return!0},restoreImage:function(a){var c=this.editor,d;a.bookmarks&&(c.focus(),d=c.getSelection());this.locked=
|
||||||
|
1;this.editor.loadSnapshot(a.contents);a.bookmarks?d.selectBookmarks(a.bookmarks):CKEDITOR.env.ie&&(d=this.editor.document.getBody().$.createTextRange(),d.collapse(!0),d.select());this.locked=0;this.index=a.index;this.currentImage=this.snapshots[this.index];this.update();this.fireChange();c.fire("change")},getNextImage:function(a){var c=this.snapshots,d=this.currentImage,b;if(d)if(a)for(b=this.index-1;0<=b;b--){if(a=c[b],!d.equalsContent(a))return a.index=b,a}else for(b=this.index+1;b<c.length;b++)if(a=
|
||||||
|
c[b],!d.equalsContent(a))return a.index=b,a;return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo},undo:function(){if(this.undoable()){this.save(!0);var a=this.getNextImage(!0);if(a)return this.restoreImage(a),!0}return!1},redo:function(){if(this.redoable()&&(this.save(!0),this.redoable())){var a=this.getNextImage(!1);if(a)return this.restoreImage(a),!0}return!1},update:function(a){if(!this.locked){a||(a=new f(this.editor));for(var c=
|
||||||
|
this.index,d=this.snapshots;0<c&&this.currentImage.equalsContent(d[c-1]);)c-=1;d.splice(c,this.index-c+1,a);this.index=c;this.currentImage=a}},lock:function(a,c){if(this.locked)this.locked.level++;else if(a)this.locked={level:1};else{var d=null;if(c)d=!0;else{var b=new f(this.editor,!0);this.currentImage&&this.currentImage.equalsContent(b)&&(d=b)}this.locked={update:d,level:1}}},unlock:function(){if(this.locked&&!--this.locked.level){var a=this.locked.update;this.locked=null;if(!0===a)this.update();
|
||||||
|
else if(a){var c=new f(this.editor,!0);a.equalsContent(c)||this.update()}}}}})();(function(){function h(a){function k(){d=a.document;l=d[CKEDITOR.env.ie?"getBody":"getDocumentElement"]();c=CKEDITOR.env.quirks?d.getBody():d.getDocumentElement();e=CKEDITOR.dom.element.createFromHtml('<span style="margin:0;padding:0;border:0;clear:both;width:1px;height:1px;display:block;">'+(CKEDITOR.env.webkit?" ":"")+"</span>",d)}function f(){i&&c.setStyle("overflow-y","hidden");var g=a.window.getViewPaneSize().height,b;l.append(e);b=e.getDocumentPosition(d).y+e.$.offsetHeight;e.remove();
|
||||||
|
b+=h;b=Math.max(b,o);b=Math.min(b,m);b!=g&&j!=b&&(b=a.fire("autoGrow",{currentHeight:g,newHeight:b}).newHeight,a.resize(a.container.getStyle("width"),b,!0),j=b);i||(b<m&&c.$.scrollHeight>c.$.clientHeight?c.setStyle("overflow-y","hidden"):c.removeStyle("overflow-y"))}var j,d,l,c,e,h=a.config.autoGrow_bottomSpace||0,o=void 0!=a.config.autoGrow_minHeight?a.config.autoGrow_minHeight:200,m=a.config.autoGrow_maxHeight||Infinity,i=!a.config.autoGrow_maxHeight;a.addCommand("autogrow",{exec:f,modes:{wysiwyg:1},
|
||||||
|
readOnly:1,canUndo:!1,editorFocus:!1});var p={contentDom:1,key:1,selectionChange:1,insertElement:1,mode:1},n;for(n in p)a.on(n,function(g){"wysiwyg"==g.editor.mode&&setTimeout(function(){var b=a.getCommand("maximize");!a.window||b&&b.state==CKEDITOR.TRISTATE_ON?j=null:(f(),i||f())},100)});a.on("afterCommandExec",function(a){"maximize"==a.data.name&&"wysiwyg"==a.editor.mode&&(a.data.command.state==CKEDITOR.TRISTATE_ON?c.removeStyle("overflow-y"):f())});a.on("contentDom",k);k();a.config.autoGrow_onStartup&&
|
||||||
|
a.execCommand("autogrow")}CKEDITOR.plugins.add("autogrow",{init:function(a){if(a.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE)a.on("instanceReady",function(){a.editable().isInline()?a.ui.space("contents").setStyle("height","auto"):h(a)})}})})();(function(){function i(a,b){CKEDITOR.dialog.add("autosaveDialog",function(){return{title:a.lang.autosave.title,minHeight:155,height:300,width:750,onShow:function(){j(this,a,b)},onOk:function(){var c=f(b);a.setData(c.data);localStorage.removeItem(b)},onCancel:function(){localStorage.removeItem(b)},contents:[{label:"",id:"general",elements:[{type:"radio",id:"diffType",label:a.lang.autosave.diffType,items:[[a.lang.autosave.sideBySide,"sideBySide"],[a.lang.autosave.inline,"inline"]],"default":"sideBySide",
|
||||||
|
onClick:function(){j(this._.dialog,a,b)}},{type:"html",id:"diffContent",html:""}]}],buttons:[{id:"ok",type:"button",label:a.lang.autosave.ok,"class":"cke_dialog_ui_button_ok",onClick:function(a){a=a.data.dialog;!1!==a.fire("ok",{hide:!0}).hide&&a.hide()}},{id:"cancel",type:"button",label:a.lang.autosave.no,"class":"cke_dialog_ui_button_cancel",onClick:function(a){a=a.data.dialog;!1!==a.fire("cancel",{hide:!0}).hide&&a.hide()}}]}})}function k(a,b,c){if(localStorage.getItem(b)){var d=f(b),e=d.data,
|
||||||
|
d=d.saveTime;a.getData()==e?localStorage.removeItem(b):moment(new Date).diff(d,"minutes")>c?localStorage.removeItem(b):(c=a.lang.autosave.loadSavedContent.replace("{0}",moment(d).lang(a.config.language).format("LLL")),confirm(c)?a.openDialog("autosaveDialog"):localStorage.removeItem(b))}}function f(a){a=LZString.decompressFromUTF16(localStorage.getItem(a));return JSON.parse(a)}function l(a,b){var c=LZString.compressToUTF16(JSON.stringify({data:b.getData(),saveTime:new Date}));localStorage.setItem(a,
|
||||||
|
c);var d=document.getElementById("cke_autoSaveMessage_"+b.name);d&&(d.className="show",setTimeout(function(){d.className="hidden"},2E3))}function j(a,b,c){var c=f(c),d=difflib.stringAsLines(b.getData()),e=difflib.stringAsLines(c.data),n=(new difflib.SequenceMatcher(d,e)).get_opcodes();a.getContentElement("general","diffContent").getElement().setHtml('<div class="diffContent">'+diffview.buildView({baseTextLines:d,newTextLines:e,opcodes:n,baseTextName:b.lang.autosave.loadedContent,newTextName:b.lang.autosave.autoSavedContent+
|
||||||
|
moment(c.saveTime).lang(b.config.language).format("LLL")+"'",contextSize:3,viewType:"inline"==a.getContentElement("general","diffType").getValue()?1:0}).outerHTML+"</div>")}if("undefined"!==typeof Storage){CKEDITOR.plugins.add("autosave",{version:0.09,init:function(a){var b=null!=a.config.autosave_SaveKey?a.config.autosave_SaveKey:"autosave_"+window.location,c=null!=a.config.autosave_NotOlderThan?a.autosave_NotOlderThan:1440,d=null!=a.config.autosave_saveOnDestroy?a.autosave_saveOnDestroy:!1,e=null!=
|
||||||
|
a.config.autosave_saveDetectionSelectors?a.autosave_saveDetectionSelectors:"a[href^='javascript:__doPostBack'][id*='Save'],a[id*='Cancel']";CKEDITOR.document.appendStyleSheet(this.path+"css/autosave.min.css");"undefined"===typeof jQuery?CKEDITOR.scriptLoader.load("//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js",function(){jQuery.noConflict();CKEDITOR.scriptLoader.load(this.path+"js/extensions.min.js",function(){i(a,b);k(a,b,c)})}):CKEDITOR.scriptLoader.load(this.path+"js/extensions.min.js",
|
||||||
|
function(){i(a,b);k(a,b,c)});$(e).click(function(){localStorage.removeItem(b)});a.on("key",m);a.on("destroy",function(){d&&l(b,a)});a.on("uiSpace",function(a){"bottom"==a.data.space&&(a.data.html+='<div class="autoSaveMessage" unselectable="on"><div unselectable="on" id="cke_autoSaveMessage_'+a.editor.name+'"class="hidden">'+a.editor.lang.autosave.autoSaveMessage+"</div></div>")},a,null,100)}});var g=0,h=!1,m=function(a){g&&clearTimeout(g);g=setTimeout(o,1E3*(null!=CKEDITOR.config.autosave_delay?
|
||||||
|
CKEDITOR.config.autosave_delay:10),a)},o=function(a){if(h)m(a);else if(a.editor.checkDirty()||a.editor.plugins.bbcode)h=!0,a=a.editor,l(null!=a.config.autosave_SaveKey?a.config.autosave_SaveKey:"autosave_"+window.location,a),h=!1}}})();(function(){var k={exec:function(g){var a=g.getCommand("blockquote").state,i=g.getSelection(),c=i&&i.getRanges()[0];if(c){var h=i.createBookmarks();if(CKEDITOR.env.ie){var e=h[0].startNode,b=h[0].endNode,d;if(e&&"blockquote"==e.getParent().getName())for(d=e;d=d.getNext();)if(d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()){e.move(d,!0);break}if(b&&"blockquote"==b.getParent().getName())for(d=b;d=d.getPrevious();)if(d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()){b.move(d);break}}var f=c.createIterator();
|
||||||
|
f.enlargeBr=g.config.enterMode!=CKEDITOR.ENTER_BR;if(a==CKEDITOR.TRISTATE_OFF){for(e=[];a=f.getNextParagraph();)e.push(a);1>e.length&&(a=g.document.createElement(g.config.enterMode==CKEDITOR.ENTER_P?"p":"div"),b=h.shift(),c.insertNode(a),a.append(new CKEDITOR.dom.text("",g.document)),c.moveToBookmark(b),c.selectNodeContents(a),c.collapse(!0),b=c.createBookmark(),e.push(a),h.unshift(b));d=e[0].getParent();c=[];for(b=0;b<e.length;b++)a=e[b],d=d.getCommonAncestor(a.getParent());for(a={table:1,tbody:1,
|
||||||
|
tr:1,ol:1,ul:1};a[d.getName()];)d=d.getParent();for(b=null;0<e.length;){for(a=e.shift();!a.getParent().equals(d);)a=a.getParent();a.equals(b)||c.push(a);b=a}for(;0<c.length;)if(a=c.shift(),"blockquote"==a.getName()){for(b=new CKEDITOR.dom.documentFragment(g.document);a.getFirst();)b.append(a.getFirst().remove()),e.push(b.getLast());b.replace(a)}else e.push(a);c=g.document.createElement("blockquote");for(c.insertBefore(e[0]);0<e.length;)a=e.shift(),c.append(a)}else if(a==CKEDITOR.TRISTATE_ON){b=[];
|
||||||
|
for(d={};a=f.getNextParagraph();){for(e=c=null;a.getParent();){if("blockquote"==a.getParent().getName()){c=a.getParent();e=a;break}a=a.getParent()}c&&(e&&!e.getCustomData("blockquote_moveout"))&&(b.push(e),CKEDITOR.dom.element.setMarker(d,e,"blockquote_moveout",!0))}CKEDITOR.dom.element.clearAllMarkers(d);a=[];e=[];for(d={};0<b.length;)f=b.shift(),c=f.getParent(),f.getPrevious()?f.getNext()?(f.breakParent(f.getParent()),e.push(f.getNext())):f.remove().insertAfter(c):f.remove().insertBefore(c),c.getCustomData("blockquote_processed")||
|
||||||
|
(e.push(c),CKEDITOR.dom.element.setMarker(d,c,"blockquote_processed",!0)),a.push(f);CKEDITOR.dom.element.clearAllMarkers(d);for(b=e.length-1;0<=b;b--){c=e[b];a:{d=c;for(var f=0,k=d.getChildCount(),j=void 0;f<k&&(j=d.getChild(f));f++)if(j.type==CKEDITOR.NODE_ELEMENT&&j.isBlockBoundary()){d=!1;break a}d=!0}d&&c.remove()}if(g.config.enterMode==CKEDITOR.ENTER_BR)for(c=!0;a.length;)if(f=a.shift(),"div"==f.getName()){b=new CKEDITOR.dom.documentFragment(g.document);c&&(f.getPrevious()&&!(f.getPrevious().type==
|
||||||
|
CKEDITOR.NODE_ELEMENT&&f.getPrevious().isBlockBoundary()))&&b.append(g.document.createElement("br"));for(c=f.getNext()&&!(f.getNext().type==CKEDITOR.NODE_ELEMENT&&f.getNext().isBlockBoundary());f.getFirst();)f.getFirst().remove().appendTo(b);c&&b.append(g.document.createElement("br"));b.replace(f);c=!1}}i.selectBookmarks(h);g.focus()}},refresh:function(g,a){this.setState(g.elementPath(a.block||a.blockLimit).contains("blockquote",1)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)},context:"blockquote",
|
||||||
|
allowedContent:"blockquote",requiredContent:"blockquote"};CKEDITOR.plugins.add("blockquote",{init:function(g){g.blockless||(g.addCommand("blockquote",k),g.ui.addButton&&g.ui.addButton("Blockquote",{label:g.lang.blockquote.toolbar,command:"blockquote",toolbar:"blocks,10"}))}})})();CKEDITOR.plugins.add("imagebrowser",{init:function(a){if(!("undefined"===typeof a.config.imageBrowser_listUrl||null===a.config.imageBrowser_listUrl)){var b=a.plugins.imagebrowser.path+"browser/browser.html?listUrl="+encodeURIComponent(a.config.imageBrowser_listUrl);a.config.baseHref&&(b+="&baseHref="+encodeURIComponent(a.config.baseHref));a.config.filebrowserImageBrowseUrl=b}}});(function(){var c={canUndo:!1,async:!0,exec:function(a){a.getClipboardData({title:a.lang.pastetext.title},function(b){b&&a.fire("paste",{type:"text",dataValue:b.dataValue});a.fire("afterCommandExec",{name:"pastetext",command:c,returnValue:!!b})})}};CKEDITOR.plugins.add("pastetext",{requires:"clipboard",init:function(a){a.addCommand("pastetext",c);a.ui.addButton&&a.ui.addButton("PasteText",{label:a.lang.pastetext.button,command:"pastetext",toolbar:"clipboard,40"});if(a.config.forcePasteAsPlainText)a.on("beforePaste",
|
||||||
|
function(a){"html"!=a.data.type&&(a.data.type="text")});a.on("pasteState",function(b){a.getCommand("pastetext").setState(b.data)})}})})();CKEDITOR.plugins.add("removeformat",{init:function(a){a.addCommand("removeFormat",CKEDITOR.plugins.removeformat.commands.removeformat);a.ui.addButton&&a.ui.addButton("RemoveFormat",{label:a.lang.removeformat.toolbar,command:"removeFormat",toolbar:"cleanup,10"})}});
|
||||||
|
CKEDITOR.plugins.removeformat={commands:{removeformat:{exec:function(a){for(var h=a._.removeFormatRegex||(a._.removeFormatRegex=RegExp("^(?:"+a.config.removeFormatTags.replace(/,/g,"|")+")$","i")),e=a._.removeAttributes||(a._.removeAttributes=a.config.removeFormatAttributes.split(",")),f=CKEDITOR.plugins.removeformat.filter,k=a.getSelection().getRanges(1),l=k.createIterator(),c;c=l.getNextRange();){c.collapsed||c.enlarge(CKEDITOR.ENLARGE_ELEMENT);var i=c.createBookmark(),b=i.startNode,j=i.endNode,
|
||||||
|
d=function(b){for(var c=a.elementPath(b),e=c.elements,d=1,g;(g=e[d])&&!g.equals(c.block)&&!g.equals(c.blockLimit);d++)h.test(g.getName())&&f(a,g)&&b.breakParent(g)};d(b);if(j){d(j);for(b=b.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT);b&&!b.equals(j);)d=b.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT),!("img"==b.getName()&&b.data("cke-realelement"))&&f(a,b)&&(h.test(b.getName())?b.remove(1):(b.removeAttributes(e),a.fire("removeFormatCleanup",b))),b=d}c.moveToBookmark(i)}a.forceNextSelectionCheck();a.getSelection().selectRanges(k)}}},
|
||||||
|
filter:function(a,h){for(var e=a._.removeFormatFilters||[],f=0;f<e.length;f++)if(!1===e[f](h))return!1;return!0}};CKEDITOR.editor.prototype.addRemoveFormatFilter=function(a){this._.removeFormatFilters||(this._.removeFormatFilters=[]);this._.removeFormatFilters.push(a)};CKEDITOR.config.removeFormatTags="b,big,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var";CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign";CKEDITOR.config.plugins='basicstyles,dialogui,dialog,clipboard,button,toolbar,enterkey,floatingspace,wysiwygarea,indent,indentlist,fakeobjects,link,list,undo,autogrow,autosave,blockquote,imagebrowser,pastetext,removeformat';CKEDITOR.config.skin='moono';(function() {var setIcons = function(icons, strip) {var path = CKEDITOR.getUrl( 'plugins/' + strip );icons = icons.split( ',' );for ( var i = 0; i < icons.length; i++ )CKEDITOR.skin.icons[ icons[ i ] ] = { path: path, offset: -icons[ ++i ], bgsize : icons[ ++i ] };};if (CKEDITOR.env.hidpi) setIcons('bold,0,,italic,24,,strike,48,,subscript,72,,superscript,96,,underline,120,,copy-rtl,144,,copy,168,,cut-rtl,192,,cut,216,,paste-rtl,240,,paste,264,,indent-rtl,288,,indent,312,,outdent-rtl,336,,outdent,360,,anchor-rtl,384,,anchor,408,,link,432,,unlink,456,,bulletedlist-rtl,480,,bulletedlist,504,,numberedlist-rtl,528,,numberedlist,552,,redo-rtl,576,,redo,600,,undo-rtl,624,,undo,648,,blockquote,672,,pastetext-rtl,696,,pastetext,720,,removeformat,744,','icons_hidpi.png');else setIcons('bold,0,auto,italic,24,auto,strike,48,auto,subscript,72,auto,superscript,96,auto,underline,120,auto,copy-rtl,144,auto,copy,168,auto,cut-rtl,192,auto,cut,216,auto,paste-rtl,240,auto,paste,264,auto,indent-rtl,288,auto,indent,312,auto,outdent-rtl,336,auto,outdent,360,auto,anchor-rtl,384,auto,anchor,408,auto,link,432,auto,unlink,456,auto,bulletedlist-rtl,480,auto,bulletedlist,504,auto,numberedlist-rtl,528,auto,numberedlist,552,auto,redo-rtl,576,auto,redo,600,auto,undo-rtl,624,auto,undo,648,auto,blockquote,672,auto,pastetext-rtl,696,auto,pastetext,720,auto,removeformat,744,auto','icons.png');})();CKEDITOR.lang.languages={"en":1,"hu":1};}());
|
44
plugins/ckeditor/config.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
|
||||||
|
CKEDITOR.editorConfig = function( config ) {
|
||||||
|
// Define changes to default configuration here.
|
||||||
|
// For complete reference see:
|
||||||
|
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
|
||||||
|
|
||||||
|
// The toolbar groups arrangement, optimized for a single toolbar row.
|
||||||
|
config.toolbarGroups = [
|
||||||
|
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
|
||||||
|
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
|
||||||
|
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
|
||||||
|
{ name: 'forms' },
|
||||||
|
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
|
||||||
|
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
|
||||||
|
{ name: 'links' },
|
||||||
|
{ name: 'insert' },
|
||||||
|
{ name: 'styles' },
|
||||||
|
{ name: 'colors' },
|
||||||
|
{ name: 'tools' },
|
||||||
|
{ name: 'others' },
|
||||||
|
{ name: 'about' }
|
||||||
|
];
|
||||||
|
|
||||||
|
// The default plugins included in the basic setup define some buttons that
|
||||||
|
// are not needed in a basic editor. They are removed here.
|
||||||
|
//config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript';
|
||||||
|
config.removeButtons = 'Anchor,Subscript,Superscript';
|
||||||
|
|
||||||
|
// Dialog windows are also simplified.
|
||||||
|
config.removeDialogTabs = 'link:advanced';
|
||||||
|
|
||||||
|
config.skin = 'office2013';
|
||||||
|
config.autoGrow_onStartup = true;
|
||||||
|
//config.extraPlugins = 'justify,autosave,imagebrowser,image,filebrowser,popup,readmorebtn,table';
|
||||||
|
config.extraPlugins = 'sourcedialog,panel,button,listblock,floatpanel,richcombo,format,justify,imagebrowser,image,filebrowser,popup,readmorebtn,table';
|
||||||
|
config.imageBrowser_listUrl = '/data/imglist.json.php';
|
||||||
|
config.filebrowserBrowseUrl = '/data/uploads';
|
||||||
|
config.filebrowserUploadUrl = '/admin/upload';
|
||||||
|
config.format_tags = 'p;h2;h3;h4;pre';
|
||||||
|
};
|
38
plugins/ckeditor/config.old.js
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.html or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
|
||||||
|
CKEDITOR.editorConfig = function( config ) {
|
||||||
|
// Define changes to default configuration here.
|
||||||
|
// For complete reference see:
|
||||||
|
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
|
||||||
|
|
||||||
|
// The toolbar groups arrangement, optimized for a single toolbar row.
|
||||||
|
config.toolbarGroups = [
|
||||||
|
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
|
||||||
|
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
|
||||||
|
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
|
||||||
|
{ name: 'forms' },
|
||||||
|
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
|
||||||
|
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
|
||||||
|
{ name: 'links' },
|
||||||
|
{ name: 'insert' },
|
||||||
|
{ name: 'styles' },
|
||||||
|
{ name: 'colors' },
|
||||||
|
{ name: 'tools' },
|
||||||
|
{ name: 'others' },
|
||||||
|
{ name: 'about' }
|
||||||
|
];
|
||||||
|
|
||||||
|
// The default plugins included in the basic setup define some buttons that
|
||||||
|
// are not needed in a basic editor. They are removed here.
|
||||||
|
config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript';
|
||||||
|
|
||||||
|
// Dialog windows are also simplified.
|
||||||
|
config.removeDialogTabs = 'link:advanced';
|
||||||
|
|
||||||
|
config.autoGrow_onStartup = true;
|
||||||
|
config.extraPlugins = 'autosave,imagebrowser,imageresize';
|
||||||
|
config.imageBrowser_listUrl = '/data/imglist.json.php';
|
||||||
|
};
|
134
plugins/ckeditor/contents.css
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
|
||||||
|
body
|
||||||
|
{
|
||||||
|
/* Font */
|
||||||
|
font-family: sans-serif, Arial, Verdana, "Trebuchet MS";
|
||||||
|
font-size: 12px;
|
||||||
|
|
||||||
|
/* Text color */
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
/* Remove the background color to make it transparent */
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cke_editable
|
||||||
|
{
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote
|
||||||
|
{
|
||||||
|
font-style: italic;
|
||||||
|
font-family: Georgia, Times, "Times New Roman", serif;
|
||||||
|
padding: 2px 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #ccc;
|
||||||
|
border-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cke_contents_ltr blockquote
|
||||||
|
{
|
||||||
|
padding-left: 20px;
|
||||||
|
padding-right: 8px;
|
||||||
|
border-left-width: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cke_contents_rtl blockquote
|
||||||
|
{
|
||||||
|
padding-left: 8px;
|
||||||
|
padding-right: 20px;
|
||||||
|
border-right-width: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
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,h3,h4,h5,h6
|
||||||
|
{
|
||||||
|
font-weight: normal;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
hr
|
||||||
|
{
|
||||||
|
border: 0px;
|
||||||
|
border-top: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
-o-tab-size: 4;
|
||||||
|
-webkit-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;
|
||||||
|
}
|
5
plugins/ckeditor/info.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"name": "CKeditor",
|
||||||
|
"description": "A really good text editor.",
|
||||||
|
"paths": "/admin/entry,/admin/page"
|
||||||
|
}
|
5
plugins/ckeditor/lang/en.js
Normal file
5
plugins/ckeditor/lang/hu.js
Normal file
1
plugins/ckeditor/plugins/autosave/css/autosave.min.css
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.diffContent{height:300px;overflow:auto}.diff *{white-space:pre-wrap !important}table.diff{border-collapse:collapse;border:1px solid darkgray}table.diff tbody{font-family:Courier,monospace}table.diff tbody th{font-family:verdana,arial,'Bitstream Vera Sans',helvetica,sans-serif;background:#EED;font-size:11px;font-weight:normal;border:1px solid #BBC;color:#886;padding:.3em .5em .1em 2em;text-align:right;vertical-align:top}table.diff thead{border-bottom:1px solid #BBC;background:#efefef;font-family:Verdana}table.diff thead th.texttitle{text-align:left}table.diff tbody td{padding:0 .4em;vertical-align:top}table.diff .empty{background-color:#DDD}table.diff .replace{background-color:#FFC}table.diff .delete{background-color:#FCC}table.diff .skip{background-color:#efefef;border:1px solid #AAA;border-right:1px solid #BBC}table.diff .insert{background-color:#CFC}table.diff th.author{text-align:right;border-top:1px solid #BBC;background:#efefef}del{background-color:#e99 !important;text-decoration:underline !important}ins{background-color:#9e9 !important;text-decoration:underline !important}div.autoSaveMessage div{left:42%;position:absolute;padding:2px;top:4px;font-weight:bold}.hidden{opacity:0;visibility:hidden}.show{opacity:1;visibility:visible;-webkit-transition:visibility .2s linear,opacity .2s linear;-moz-transition:visibility .2s linear,opacity .2s linear;-o-transition:visibility .2s linear,opacity .2s linear;transition:visibility .2s linear,opacity .2s linear}
|
213
plugins/ckeditor/plugins/autosave/js/extensions.min.js
vendored
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
__whitespace={" ":!0,"\t":!0,"\n":!0,"":!0,"\r":!0};
|
||||||
|
difflib={defaultJunkFunction:function(e){return e in __whitespace},stripLinebreaks:function(e){return e.replace(/^[\n\r]*|[\n\r]*$/g,"")},stringAsLines:function(e){for(var b=e.indexOf("\n"),d=e.indexOf("\r"),e=e.split(-1<b&&-1<d||0>d?"\n":"\r"),b=0;b<e.length;b++)e[b]=difflib.stripLinebreaks(e[b]);return e},__reduce:function(e,b,d){if(null!=d)var h=0;else if(b)d=b[0],h=1;else return null;for(;h<b.length;h++)d=e(d,b[h]);return d},__ntuplecomp:function(e,b){for(var d=Math.max(e.length,b.length),h=0;h<
|
||||||
|
d;h++){if(e[h]<b[h])return-1;if(e[h]>b[h])return 1}return e.length==b.length?0:e.length<b.length?-1:1},__calculate_ratio:function(e,b){return b?2*e/b:1},__isindict:function(e){return function(b){return b in e}},__dictget:function(e,b,d){return b in e?e[b]:d},SequenceMatcher:function(e,b,d){this.set_seqs=function(b,f){this.set_seq1(b);this.set_seq2(f)};this.set_seq1=function(b){b!=this.a&&(this.a=b,this.matching_blocks=this.opcodes=null)};this.set_seq2=function(b){b!=this.b&&(this.b=b,this.matching_blocks=
|
||||||
|
this.opcodes=this.fullbcount=null,this.__chain_b())};this.__chain_b=function(){for(var b=this.b,f=b.length,d=this.b2j={},l={},e=0;e<b.length;e++){var j=b[e];if(j in d){var s=d[j];200<=f&&100*s.length>f?(l[j]=1,delete d[j]):s.push(e)}else d[j]=[e]}for(j in l)delete d[j];b=this.isjunk;f={};if(b){for(j in l)b(j)&&(f[j]=1,delete l[j]);for(j in d)b(j)&&(f[j]=1,delete d[j])}this.isbjunk=difflib.__isindict(f);this.isbpopular=difflib.__isindict(l)};this.find_longest_match=function(b,f,d,e){for(var p=this.a,
|
||||||
|
j=this.b,s=this.b2j,o=this.isbjunk,q=b,n=d,m=0,t=null,u={},z=[],v=b;v<f;v++){var y={},A=difflib.__dictget(s,p[v],z),B;for(B in A)if(t=A[B],!(t<d)){if(t>=e)break;y[t]=k=difflib.__dictget(u,t-1,0)+1;k>m&&(q=v-k+1,n=t-k+1,m=k)}u=y}for(;q>b&&n>d&&!o(j[n-1])&&p[q-1]==j[n-1];)q--,n--,m++;for(;q+m<f&&n+m<e&&!o(j[n+m])&&p[q+m]==j[n+m];)m++;for(;q>b&&n>d&&o(j[n-1])&&p[q-1]==j[n-1];)q--,n--,m++;for(;q+m<f&&n+m<e&&o(j[n+m])&&p[q+m]==j[n+m];)m++;return[q,n,m]};this.get_matching_blocks=function(){if(null!=this.matching_blocks)return this.matching_blocks;
|
||||||
|
for(var b=this.a.length,f=this.b.length,d=[[0,b,0,f]],e=[],p,j,s,o,q,n,m,t;d.length;)if(o=d.pop(),p=o[0],j=o[1],s=o[2],o=o[3],t=this.find_longest_match(p,j,s,o),q=t[0],n=t[1],m=t[2])e.push(t),p<q&&s<n&&d.push([p,q,s,n]),q+m<j&&n+m<o&&d.push([q+m,j,n+m,o]);e.sort(difflib.__ntuplecomp);d=j1=k1=block=0;p=[];for(var u in e)block=e[u],i2=block[0],j2=block[1],k2=block[2],d+k1==i2&&j1+k1==j2?k1+=k2:(k1&&p.push([d,j1,k1]),d=i2,j1=j2,k1=k2);k1&&p.push([d,j1,k1]);p.push([b,f,0]);return this.matching_blocks=
|
||||||
|
p};this.get_opcodes=function(){if(null!=this.opcodes)return this.opcodes;var b=0,f=0,d=[];this.opcodes=d;var e,p,j,s,o=this.get_matching_blocks(),q;for(q in o)e=o[q],p=e[0],j=e[1],e=e[2],s="",b<p&&f<j?s="replace":b<p?s="delete":f<j&&(s="insert"),s&&d.push([s,b,p,f,j]),b=p+e,f=j+e,e&&d.push(["equal",p,b,j,f]);return d};this.get_grouped_opcodes=function(b){b||(b=3);var f=this.get_opcodes();f||(f=[["equal",0,1,0,1]]);var d,e,p,j,s;"equal"==f[0][0]&&(d=f[0],e=d[0],p=d[1],j=d[2],s=d[3],d=d[4],f[0]=[e,
|
||||||
|
Math.max(p,j-b),j,Math.max(s,d-b),d]);"equal"==f[f.length-1][0]&&(d=f[f.length-1],e=d[0],p=d[1],j=d[2],s=d[3],d=d[4],f[f.length-1]=[e,p,Math.min(j,p+b),s,Math.min(d,s+b)]);var o=b+b,q=[],n;for(n in f)d=f[n],e=d[0],p=d[1],j=d[2],s=d[3],d=d[4],"equal"==e&&j-p>o&&(q.push([e,p,Math.min(j,p+b),s,Math.min(d,s+b)]),p=Math.max(p,j-b),s=Math.max(s,d-b)),q.push([e,p,j,s,d]);q&&"equal"==q[q.length-1][0]&&q.pop();return q};this.ratio=function(){matches=difflib.__reduce(function(b,d){return b+d[d.length-1]},this.get_matching_blocks(),
|
||||||
|
0);return difflib.__calculate_ratio(matches,this.a.length+this.b.length)};this.quick_ratio=function(){var b,d;if(null==this.fullbcount){this.fullbcount=b={};for(var e=0;e<this.b.length;e++)d=this.b[e],b[d]=difflib.__dictget(b,d,0)+1}b=this.fullbcount;for(var l={},p=difflib.__isindict(l),j=numb=0,e=0;e<this.a.length;e++)d=this.a[e],numb=p(d)?l[d]:difflib.__dictget(b,d,0),l[d]=numb-1,0<numb&&j++;return difflib.__calculate_ratio(j,this.a.length+this.b.length)};this.real_quick_ratio=function(){var b=
|
||||||
|
this.a.length,d=this.b.length;return _calculate_ratio(Math.min(b,d),b+d)};this.isjunk=d?d:difflib.defaultJunkFunction;this.a=this.b=null;this.set_seqs(e,b)}};
|
||||||
|
diffview={buildView:function(e){function b(b,d){var e=document.createElement(b);e.className=d;return e}function d(b,d){var e=document.createElement(b);e.appendChild(document.createTextNode(d));return e}function h(b,d,e){b=document.createElement(b);b.className=d;b.innerHTML=e;return b}function f(e,f,j,i,l){if(f<j)return e.appendChild(d("th",(f+1).toString())),e.appendChild(h("td",l,i[f].replace(/\t/g," "))),f+1;e.appendChild(document.createElement("th"));e.appendChild(b("td","empty"));return f}
|
||||||
|
function r(b,e,f,i,j){b.appendChild(d("th",null==e?"":(e+1).toString()));b.appendChild(d("th",null==f?"":(f+1).toString()));b.appendChild(h("td",j,i[null!=e?e:f].replace(/\t/g," ")))}var l=e.baseTextLines,p=e.newTextLines,j=e.opcodes,s=e.baseTextName?e.baseTextName:"Base Text",o=e.newTextName?e.newTextName:"New Text",q=e.contextSize,e=0==e.viewType||1==e.viewType?e.viewType:0;if(null==l)throw"Cannot build diff view; baseTextLines is not defined.";if(null==p)throw"Cannot build diff view; newTextLines is not defined.";
|
||||||
|
if(!j)throw"Canno build diff view; opcodes is not defined.";var n=document.createElement("thead"),m=document.createElement("tr");n.appendChild(m);e?(m.appendChild(document.createElement("th")),m.appendChild(document.createElement("th")),m.appendChild(h("th","texttitle",s+" vs. "+o))):(m.appendChild(document.createElement("th")),m.appendChild(h("th","texttitle",s)),m.appendChild(document.createElement("th")),m.appendChild(h("th","texttitle",o)));for(var n=[n],s=[],t,o=0;o<j.length;o++){code=j[o];change=
|
||||||
|
code[0];for(var u=code[1],z=code[2],v=code[3],y=code[4],A=Math.max(z-u,y-v),B=[],D=[],x=0;x<A;x++){if(q&&1<j.length&&(0<o&&x==q||0==o&&0==x)&&"equal"==change)if(t=A-(0==o?1:2)*q,1<t)if(B.push(m=document.createElement("tr")),u+=t,v+=t,x+=t-1,m.appendChild(d("th","...")),e||m.appendChild(h("td","skip","")),m.appendChild(d("th","...")),m.appendChild(h("td","skip","")),o+1==j.length)break;else continue;B.push(m=document.createElement("tr"));e?"insert"==change?r(m,null,v++,p,change):"replace"==change?
|
||||||
|
(D.push(t=document.createElement("tr")),u<z&&r(m,u++,null,l,"delete"),v<y&&r(t,null,v++,p,"insert")):"delete"==change?r(m,u++,null,l,change):r(m,u++,v++,l,change):(t=diffString2(u<z?l[u]:"",v<y?p[v]:""),u<z&&(l[u]=t.o),v<y&&(p[v]=t.n),u=f(m,u,z,l,"replace"==change?"delete":change),v=f(m,v,y,p,"replace"==change?"insert":change))}for(x=0;x<B.length;x++)s.push(B[x]);for(x=0;x<D.length;x++)s.push(D[x])}s.push(m=h("th","author","combined <a href='http://snowtide.com/jsdifflib'>jsdifflib</a> and John Resig's <a href='http://ejohn.org/projects/javascript-diff-algorithm/'>diff</a> by <a href='http://richardbondi.net'>Richard Bondi</a>"));
|
||||||
|
m.setAttribute("colspan",e?3:4);n.push(m=document.createElement("tbody"));for(o=0;o<s.length;o++)m.appendChild(s[o]);m=b("table","diff"+(e?" inlinediff":""));for(o=0;o<n.length;o++)m.appendChild(n[o]);return m}};function escape(e){e=e.replace(/&/g,"&");e=e.replace(/</g,"<");e=e.replace(/>/g,">");return e=e.replace(/"/g,""")}
|
||||||
|
function diffString(e,b){var e=e.replace(/\s+$/,""),b=b.replace(/\s+$/,""),d=diff(""==e?[]:e.split(/\s+/),""==b?[]:b.split(/\s+/)),h="",f=e.match(/\s+/g);null==f?f=["\n"]:f.push("\n");var r=b.match(/\s+/g);null==r?r=["\n"]:r.push("\n");if(0==d.n.length)for(var l=0;l<d.o.length;l++)h+="<del>"+escape(d.o[l])+f[l]+"</del>";else{if(null==d.n[0].text)for(b=0;b<d.o.length&&null==d.o[b].text;b++)h+="<del>"+escape(d.o[b])+f[b]+"</del>";for(l=0;l<d.n.length;l++)if(null==d.n[l].text)h+="<ins>"+escape(d.n[l])+
|
||||||
|
r[l]+"</ins>";else{for(var p="",b=d.n[l].row+1;b<d.o.length&&null==d.o[b].text;b++)p+="<del>"+escape(d.o[b])+f[b]+"</del>";h+=" "+d.n[l].text+r[l]+p}}return h}function randomColor(){return"rgb("+100*Math.random()+"%, "+100*Math.random()+"%, "+100*Math.random()+"%)"}
|
||||||
|
function diffString2(e,b){var e=e.replace(/\s+$/,""),b=b.replace(/\s+$/,""),d=diff(""==e?[]:e.split(/\s+/),""==b?[]:b.split(/\s+/)),h=e.match(/\s+/g);null==h?h=["\n"]:h.push("\n");var f=b.match(/\s+/g);null==f?f=["\n"]:f.push("\n");for(var r="",l=0;l<d.o.length;l++)randomColor(),r=null!=d.o[l].text?r+(escape(d.o[l].text)+h[l]):r+("<del>"+escape(d.o[l])+h[l]+"</del>");h="";for(l=0;l<d.n.length;l++)h=null!=d.n[l].text?h+(escape(d.n[l].text)+f[l]):h+("<ins>"+escape(d.n[l])+f[l]+"</ins>");return{o:r,
|
||||||
|
n:h}}
|
||||||
|
function diff(e,b){for(var d={},h={},f=0;f<b.length;f++)null==d[b[f]]&&(d[b[f]]={rows:[],o:null}),d[b[f]].rows.push(f);for(f=0;f<e.length;f++)null==h[e[f]]&&(h[e[f]]={rows:[],n:null}),h[e[f]].rows.push(f);for(f in d)1==d[f].rows.length&&("undefined"!=typeof h[f]&&1==h[f].rows.length)&&(b[d[f].rows[0]]={text:b[d[f].rows[0]],row:h[f].rows[0]},e[h[f].rows[0]]={text:e[h[f].rows[0]],row:d[f].rows[0]});for(f=0;f<b.length-1;f++)null!=b[f].text&&(null==b[f+1].text&&b[f].row+1<e.length&&null==e[b[f].row+1].text&&
|
||||||
|
b[f+1]==e[b[f].row+1])&&(b[f+1]={text:b[f+1],row:b[f].row+1},e[b[f].row+1]={text:e[b[f].row+1],row:f+1});for(f=b.length-1;0<f;f--)null!=b[f].text&&(null==b[f-1].text&&0<b[f].row&&null==e[b[f].row-1].text&&b[f-1]==e[b[f].row-1])&&(b[f-1]={text:b[f-1],row:b[f].row-1},e[b[f].row-1]={text:e[b[f].row-1],row:f-1});return{o:e,n:b}}
|
||||||
|
(function(e){function b(a,c){return function(g){return j(a.call(this,g),c)}}function d(a,c){return function(g){return this.lang().ordinal(a.call(this,g),c)}}function h(){}function f(a){l(this,a)}function r(a){var c=a.years||a.year||a.y||0,g=a.months||a.month||a.M||0,b=a.weeks||a.week||a.w||0,d=a.days||a.day||a.d||0,e=a.hours||a.hour||a.h||0,f=a.minutes||a.minute||a.m||0,h=a.seconds||a.second||a.s||0,i=a.milliseconds||a.millisecond||a.ms||0;this._input=a;this._milliseconds=+i+1E3*h+6E4*f+36E5*e;this._days=
|
||||||
|
+d+7*b;this._months=+g+12*c;this._data={};this._bubble()}function l(a,c){for(var g in c)c.hasOwnProperty(g)&&(a[g]=c[g]);return a}function p(a){return 0>a?Math.ceil(a):Math.floor(a)}function j(a,c){for(var g=a+"";g.length<c;)g="0"+g;return g}function s(a,c,g,b){var d=c._milliseconds,e=c._days,c=c._months,f,h;d&&a._d.setTime(+a._d+d*g);if(e||c)f=a.minute(),h=a.hour();e&&a.date(a.date()+e*g);c&&a.month(a.month()+c*g);d&&!b&&i.updateOffset(a);if(e||c)a.minute(f),a.hour(h)}function o(a,c){var g=Math.min(a.length,
|
||||||
|
c.length),b=Math.abs(a.length-c.length),d=0,e;for(e=0;e<g;e++)~~a[e]!==~~c[e]&&d++;return d+b}function q(a){return a?T[a]||a.toLowerCase().replace(/(.)s$/,"$1"):a}function n(a){if(!a)return i.fn._lang;if(!F[a]&&N)try{require("./lang/"+a)}catch(c){return i.fn._lang}return F[a]||i.fn._lang}function m(a){var c=a.match(O),g,b;g=0;for(b=c.length;g<b;g++)c[g]=C[c[g]]?C[c[g]]:c[g].match(/\[.*\]/)?c[g].replace(/^\[|\]$/g,""):c[g].replace(/\\/g,"");return function(d){var e="";for(g=0;g<b;g++)e+=c[g]instanceof
|
||||||
|
Function?c[g].call(d,a):c[g];return e}}function t(a,c){c=u(c,a.lang());G[c]||(G[c]=m(c));return G[c](a)}function u(a,c){function g(a){return c.longDateFormat(a)||a}for(var b=5;b--&&(H.lastIndex=0,H.test(a));)a=a.replace(H,g);return a}function z(a,c){switch(a){case "DDDD":return U;case "YYYY":return V;case "YYYYY":return W;case "S":case "SS":case "SSS":case "DDD":return X;case "MMM":case "MMMM":case "dd":case "ddd":case "dddd":return Y;case "a":case "A":return n(c._l)._meridiemParse;case "X":return Z;
|
||||||
|
case "Z":case "ZZ":return I;case "T":return $;case "MM":case "DD":case "YY":case "HH":case "hh":case "mm":case "ss":case "M":case "D":case "d":case "H":case "h":case "m":case "s":return aa;default:return RegExp(a.replace("\\",""))}}function v(a){var a=((I.exec(a)||[])[0]+"").match(ba)||["-",0,0],c=+(60*a[1])+~~a[2];return"+"===a[0]?-c:c}function y(a){var c,g=[],b;if(!a._d){c=new Date;b=a._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()];for(c=0;3>
|
||||||
|
c&&null==a._a[c];++c)a._a[c]=g[c]=b[c];for(;7>c;c++)a._a[c]=g[c]=null==a._a[c]?2===c?1:0:a._a[c];g[3]+=~~((a._tzm||0)/60);g[4]+=~~((a._tzm||0)%60);c=new Date(0);a._useUTC?(c.setUTCFullYear(g[0],g[1],g[2]),c.setUTCHours(g[3],g[4],g[5],g[6])):(c.setFullYear(g[0],g[1],g[2]),c.setHours(g[3],g[4],g[5],g[6]));a._d=c}}function A(a){var c=n(a._l),g=""+a._i,b,d;d=u(a._f,c).match(O);a._a=[];for(c=0;c<d.length;c++)if((b=(z(d[c],a).exec(g)||[])[0])&&(g=g.slice(g.indexOf(b)+b.length)),C[d[c]]){var e=a,f=void 0,
|
||||||
|
h=e._a;switch(d[c]){case "M":case "MM":null!=b&&(h[1]=~~b-1);break;case "MMM":case "MMMM":f=n(e._l).monthsParse(b);null!=f?h[1]=f:e._isValid=!1;break;case "D":case "DD":null!=b&&(h[2]=~~b);break;case "DDD":case "DDDD":null!=b&&(h[1]=0,h[2]=~~b);break;case "YY":h[0]=~~b+(68<~~b?1900:2E3);break;case "YYYY":case "YYYYY":h[0]=~~b;break;case "a":case "A":e._isPm=n(e._l).isPM(b);break;case "H":case "HH":case "h":case "hh":h[3]=~~b;break;case "m":case "mm":h[4]=~~b;break;case "s":case "ss":h[5]=~~b;break;
|
||||||
|
case "S":case "SS":case "SSS":h[6]=~~(1E3*("0."+b));break;case "X":e._d=new Date(1E3*parseFloat(b));break;case "Z":case "ZZ":e._useUTC=!0,e._tzm=v(b)}null==b&&(e._isValid=!1)}g&&(a._il=g);a._isPm&&12>a._a[3]&&(a._a[3]+=12);!1===a._isPm&&12===a._a[3]&&(a._a[3]=0);y(a)}function B(a,c,g,b,d){return d.relativeTime(c||1,!!g,a,b)}function D(a,c,g){c=g-c;g-=a.day();g>c&&(g-=7);g<c-7&&(g+=7);a=i(a).add("d",g);return{week:Math.ceil(a.dayOfYear()/7),year:a.year()}}function x(a){var c=a._i,g=a._f;if(null===
|
||||||
|
c||""===c)return null;"string"===typeof c&&(a._i=c=n().preparse(c));if(i.isMoment(c))a=l({},c),a._d=new Date(+c._d);else if(g)if("[object Array]"===Object.prototype.toString.call(g)){var c=a,b,d,h=99,j;for(j=0;j<c._f.length;j++)b=l({},c),b._f=c._f[j],A(b),g=new f(b),b=o(b._a,g.toArray()),g._il&&(b+=g._il.length),b<h&&(h=b,d=g);l(c,d)}else A(a);else if(d=a,c=d._i,g=ca.exec(c),c===e)d._d=new Date;else if(g)d._d=new Date(+g[1]);else if("string"===typeof c)if(c=d._i,g=da.exec(c)){d._f="YYYY-MM-DD"+(g[2]||
|
||||||
|
" ");for(g=0;4>g;g++)if(P[g][1].exec(c)){d._f+=P[g][0];break}I.exec(c)&&(d._f+=" Z");A(d)}else d._d=new Date(c);else"[object Array]"===Object.prototype.toString.call(c)?(d._a=c.slice(0),y(d)):c instanceof Date?d._d=new Date(+c):"object"===typeof c?(c=d._i,d._d||(d._a=[c.years||c.year||c.y,c.months||c.month||c.M,c.days||c.day||c.d,c.hours||c.hour||c.h,c.minutes||c.minute||c.m,c.seconds||c.second||c.s,c.milliseconds||c.millisecond||c.ms],y(d))):d._d=new Date(c);return new f(a)}function L(a,c){i.fn[a]=
|
||||||
|
i.fn[a+"s"]=function(a){var b=this._isUTC?"UTC":"";return null!=a?(this._d["set"+b+c](a),i.updateOffset(this),this):this._d["get"+b+c]()}}function S(a){i.duration.fn[a]=function(){return this._data[a]}}function M(a,c){i.duration.fn["as"+a]=function(){return+this/c}}for(var i,E=Math.round,w,F={},N="undefined"!==typeof module&&module.exports,ca=/^\/?Date\((\-?\d+)/i,ea=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)\:(\d+)\.?(\d{3})?/,O=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,
|
||||||
|
H=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,aa=/\d\d?/,X=/\d{1,3}/,U=/\d{3}/,V=/\d{1,4}/,W=/[+\-]?\d{1,6}/,Y=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,I=/Z|[\+\-]\d\d:?\d\d/i,$=/T/i,Z=/[\+\-]?\d+(\.\d{1,3})?/,da=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,P=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],ba=
|
||||||
|
/([\+\-]|\d\d)/gi,J=["Date","Hours","Minutes","Seconds","Milliseconds"],K={Milliseconds:1,Seconds:1E3,Minutes:6E4,Hours:36E5,Days:864E5,Months:2592E6,Years:31536E6},T={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",w:"week",W:"isoweek",M:"month",y:"year"},G={},Q="DDD w W M D d".split(" "),R="MDHhmswW".split(""),C={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},
|
||||||
|
DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return j(this.year()%100,2)},YYYY:function(){return j(this.year(),4)},YYYYY:function(){return j(this.year(),5)},gg:function(){return j(this.weekYear()%100,2)},gggg:function(){return this.weekYear()},
|
||||||
|
ggggg:function(){return j(this.weekYear(),5)},GG:function(){return j(this.isoWeekYear()%100,2)},GGGG:function(){return this.isoWeekYear()},GGGGG:function(){return j(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},
|
||||||
|
s:function(){return this.seconds()},S:function(){return~~(this.milliseconds()/100)},SS:function(){return j(~~(this.milliseconds()/10),2)},SSS:function(){return j(this.milliseconds(),3)},Z:function(){var a=-this.zone(),c="+";0>a&&(a=-a,c="-");return c+j(~~(a/60),2)+":"+j(~~a%60,2)},ZZ:function(){var a=-this.zone(),c="+";0>a&&(a=-a,c="-");return c+j(~~(10*a/6),4)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()}};Q.length;)w=Q.pop(),C[w+"o"]=
|
||||||
|
d(C[w],w);for(;R.length;)w=R.pop(),C[w+w]=b(C[w],2);C.DDDD=b(C.DDD,3);l(h.prototype,{set:function(a){var c,g;for(g in a)c=a[g],"function"===typeof c?this[g]=c:this["_"+g]=c},_months:"January February March April May June July August September October November December".split(" "),months:function(a){return this._months[a.month()]},_monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var c,g;this._monthsParse||
|
||||||
|
(this._monthsParse=[]);for(c=0;12>c;c++)if(this._monthsParse[c]||(g=i.utc([2E3,c]),g="^"+this.months(g,"")+"|^"+this.monthsShort(g,""),this._monthsParse[c]=RegExp(g.replace(".",""),"i")),this._monthsParse[c].test(a))return c},_weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su Mo Tu We Th Fr Sa".split(" "),
|
||||||
|
weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var c,g;this._weekdaysParse||(this._weekdaysParse=[]);for(c=0;7>c;c++)if(this._weekdaysParse[c]||(g=i([2E3,1]).day(c),g="^"+this.weekdays(g,"")+"|^"+this.weekdaysShort(g,"")+"|^"+this.weekdaysMin(g,""),this._weekdaysParse[c]=RegExp(g.replace(".",""),"i")),this._weekdaysParse[c].test(a))return c},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var c=
|
||||||
|
this._longDateFormat[a];!c&&this._longDateFormat[a.toUpperCase()]&&(c=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=c);return c},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,c,g){return 11<a?g?"pm":"PM":g?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",
|
||||||
|
sameElse:"L"},calendar:function(a,c){var g=this._calendar[a];return"function"===typeof g?g.apply(c):g},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,c,g,b){var d=this._relativeTime[g];return"function"===typeof d?d(a,c,g,b):d.replace(/%d/i,a)},pastFuture:function(a,c){var g=this._relativeTime[0<a?"future":"past"];return"function"===
|
||||||
|
typeof g?g(c):g.replace(/%s/i,c)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return D(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6}});i=function(a,c,g){return x({_i:a,_f:c,_l:g,_isUTC:!1})};i.utc=function(a,c,g){return x({_useUTC:!0,_isUTC:!0,_l:g,_i:a,_f:c}).utc()};i.unix=function(a){return i(1E3*a)};i.duration=function(a,c){var g=i.isDuration(a),b="number"===typeof a,d=g?a._input:
|
||||||
|
b?{}:a,e=ea.exec(a);b?c?d[c]=a:d.milliseconds=a:e&&(b="-"===e[1]?-1:1,d={y:0,d:~~e[2]*b,h:~~e[3]*b,m:~~e[4]*b,s:~~e[5]*b,ms:~~e[6]*b});e=new r(d);g&&a.hasOwnProperty("_lang")&&(e._lang=a._lang);return e};i.version="2.2.1";i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";i.updateOffset=function(){};i.lang=function(a,c){if(!a)return i.fn._lang._abbr;a=a.toLowerCase();a=a.replace("_","-");if(c){var g=a;c.abbr=g;F[g]||(F[g]=new h);F[g].set(c)}else null===c?(delete F[a],a="en"):F[a]||n(a);i.duration.fn._lang=i.fn._lang=
|
||||||
|
n(a)};i.langData=function(a){a&&(a._lang&&a._lang._abbr)&&(a=a._lang._abbr);return n(a)};i.isMoment=function(a){return a instanceof f};i.isDuration=function(a){return a instanceof r};l(i.fn=f.prototype,{clone:function(){return i(this)},valueOf:function(){return+this._d+6E4*(this._offset||0)},unix:function(){return Math.floor(+this/1E3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){return t(i(this).utc(),
|
||||||
|
"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){return[this.year(),this.month(),this.date(),this.hours(),this.minutes(),this.seconds(),this.milliseconds()]},isValid:function(){null==this._isValid&&(this._isValid=this._a?!o(this._a,(this._isUTC?i.utc(this._a):i(this._a)).toArray()):!isNaN(this._d.getTime()));return!!this._isValid},invalidAt:function(){var a,c=this._a,g=(this._isUTC?i.utc(this._a):i(this._a)).toArray();for(a=6;0<=a&&c[a]===g[a];--a);return a},utc:function(){return this.zone(0)},
|
||||||
|
local:function(){this.zone(0);this._isUTC=!1;return this},format:function(a){a=t(this,a||i.defaultFormat);return this.lang().postformat(a)},add:function(a,c){var g;g="string"===typeof a?i.duration(+c,a):i.duration(a,c);s(this,g,1);return this},subtract:function(a,c){var g;g="string"===typeof a?i.duration(+c,a):i.duration(a,c);s(this,g,-1);return this},diff:function(a,c,g){var a=this._isUTC?i(a).zone(this._offset||0):i(a).local(),b=6E4*(this.zone()-a.zone()),d,c=q(c);"year"===c||"month"===c?(d=432E5*
|
||||||
|
(this.daysInMonth()+a.daysInMonth()),b=12*(this.year()-a.year())+(this.month()-a.month()),b+=(this-i(this).startOf("month")-(a-i(a).startOf("month")))/d,b-=6E4*(this.zone()-i(this).startOf("month").zone()-(a.zone()-i(a).startOf("month").zone()))/d,"year"===c&&(b/=12)):(d=this-a,b="second"===c?d/1E3:"minute"===c?d/6E4:"hour"===c?d/36E5:"day"===c?(d-b)/864E5:"week"===c?(d-b)/6048E5:d);return g?b:p(b)},from:function(a,c){return i.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!c)},fromNow:function(a){return this.from(i(),
|
||||||
|
a)},calendar:function(){var a=this.diff(i().zone(this.zone()).startOf("day"),"days",!0);return this.format(this.lang().calendar(-6>a?"sameElse":-1>a?"lastWeek":0>a?"lastDay":1>a?"sameDay":2>a?"nextDay":7>a?"nextWeek":"sameElse",this))},isLeapYear:function(){var a=this.year();return 0===a%4&&0!==a%100||0===a%400},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var c=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=
|
||||||
|
a?"string"===typeof a&&(a=this.lang().weekdaysParse(a),"number"!==typeof a)?this:this.add({d:a-c}):c},month:function(a){var c=this._isUTC?"UTC":"",g;if(null!=a){if("string"===typeof a&&(a=this.lang().monthsParse(a),"number"!==typeof a))return this;g=this.date();this.date(1);this._d["set"+c+"Month"](a);this.date(Math.min(g,this.daysInMonth()));i.updateOffset(this);return this}return this._d["get"+c+"Month"]()},startOf:function(a){a=q(a);switch(a){case "year":this.month(0);case "month":this.date(1);
|
||||||
|
case "week":case "isoweek":case "day":this.hours(0);case "hour":this.minutes(0);case "minute":this.seconds(0);case "second":this.milliseconds(0)}"week"===a?this.weekday(0):"isoweek"===a&&this.isoWeekday(1);return this},endOf:function(a){a=q(a);return this.startOf(a).add("isoweek"===a?"week":a,1).subtract("ms",1)},isAfter:function(a,c){c="undefined"!==typeof c?c:"millisecond";return+this.clone().startOf(c)>+i(a).startOf(c)},isBefore:function(a,c){c="undefined"!==typeof c?c:"millisecond";return+this.clone().startOf(c)<
|
||||||
|
+i(a).startOf(c)},isSame:function(a,c){c="undefined"!==typeof c?c:"millisecond";return+this.clone().startOf(c)===+i(a).startOf(c)},min:function(a){a=i.apply(null,arguments);return a<this?this:a},max:function(a){a=i.apply(null,arguments);return a>this?this:a},zone:function(a){var c=this._offset||0;if(null!=a)"string"===typeof a&&(a=v(a)),16>Math.abs(a)&&(a*=60),this._offset=a,this._isUTC=!0,c!==a&&s(this,i.duration(c-a,"m"),1,!0);else return this._isUTC?c:this._d.getTimezoneOffset();return this},zoneAbbr:function(){return this._isUTC?
|
||||||
|
"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},hasAlignedHourOffset:function(a){a=a?i(a).zone():0;return 0===(this.zone()-a)%60},daysInMonth:function(){return i.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(a){var c=E((i(this).startOf("day")-i(this).startOf("year"))/864E5)+1;return null==a?c:this.add("d",a-c)},weekYear:function(a){var c=D(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a?c:this.add("y",a-c)},isoWeekYear:function(a){var c=
|
||||||
|
D(this,1,4).year;return null==a?c:this.add("y",a-c)},week:function(a){var c=this.lang().week(this);return null==a?c:this.add("d",7*(a-c))},isoWeek:function(a){var c=D(this,1,4).week;return null==a?c:this.add("d",7*(a-c))},weekday:function(a){var c=(this._d.getDay()+7-this.lang()._week.dow)%7;return null==a?c:this.add("d",a-c)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},get:function(a){a=q(a);return this[a.toLowerCase()]()},set:function(a,c){a=q(a);this[a.toLowerCase()](c)},
|
||||||
|
lang:function(a){if(a===e)return this._lang;this._lang=n(a);return this}});for(w=0;w<J.length;w++)L(J[w].toLowerCase().replace(/s$/,""),J[w]);L("year","FullYear");i.fn.days=i.fn.day;i.fn.months=i.fn.month;i.fn.weeks=i.fn.week;i.fn.isoWeeks=i.fn.isoWeek;i.fn.toJSON=i.fn.toISOString;l(i.duration.fn=r.prototype,{_bubble:function(){var a=this._milliseconds,c=this._days,g=this._months,b=this._data;b.milliseconds=a%1E3;a=p(a/1E3);b.seconds=a%60;a=p(a/60);b.minutes=a%60;a=p(a/60);b.hours=a%24;c+=p(a/24);
|
||||||
|
b.days=c%30;g+=p(c/30);b.months=g%12;c=p(g/12);b.years=c},weeks:function(){return p(this.days()/7)},valueOf:function(){return this._milliseconds+864E5*this._days+2592E6*(this._months%12)+31536E6*~~(this._months/12)},humanize:function(a){var c=+this,b;b=!a;var d=this.lang(),e=E(Math.abs(c)/1E3),f=E(e/60),h=E(f/60),i=E(h/24),j=E(i/365),e=45>e&&["s",e]||1===f&&["m"]||45>f&&["mm",f]||1===h&&["h"]||22>h&&["hh",h]||1===i&&["d"]||25>=i&&["dd",i]||45>=i&&["M"]||345>i&&["MM",E(i/30)]||1===j&&["y"]||["yy",
|
||||||
|
j];e[2]=b;e[3]=0<c;e[4]=d;b=B.apply({},e);a&&(b=this.lang().pastFuture(c,b));return this.lang().postformat(b)},add:function(a,c){var b=i.duration(a,c);this._milliseconds+=b._milliseconds;this._days+=b._days;this._months+=b._months;this._bubble();return this},subtract:function(a,c){var b=i.duration(a,c);this._milliseconds-=b._milliseconds;this._days-=b._days;this._months-=b._months;this._bubble();return this},get:function(a){a=q(a);return this[a.toLowerCase()+"s"]()},as:function(a){a=q(a);return this["as"+
|
||||||
|
a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},lang:i.fn.lang});for(w in K)K.hasOwnProperty(w)&&(M(w,K[w]),S(w.toLowerCase()));M("Weeks",6048E5);i.duration.fn.asMonths=function(){return(+this-31536E6*this.years())/2592E6+12*this.years()};i.lang("en",{ordinal:function(a){var c=a%10;return a+(1===~~(a%100/10)?"th":1===c?"st":2===c?"nd":3===c?"rd":"th")}});(function(a){a(i)})(function(a){a.lang("ar-ma",{months:"يناير Ùبراير مارس أبريل ماي يونيو يوليوز غشت شتنبر أكتوبر نونبر دجنبر".split(" "),
|
||||||
|
monthsShort:"يناير Ùبراير مارس أبريل ماي يونيو يوليوز غشت شتنبر أكتوبر نونبر دجنبر".split(" "),weekdays:"الأØد الإتنين الثلاثاء الأربعاء الخميس الجمعة السبت".split(" "),weekdaysShort:"اØد اتنين ثلاثاء اربعاء خميس جمعة سبت".split(" "),weekdaysMin:"Ø Ù† Ø« ر Ø® ج س".split(" "),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},
|
||||||
|
calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"ÙÙŠ %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}})});(function(a){a(i)})(function(a){a.lang("ar",
|
||||||
|
{months:"يناير/ كانون الثاني;Ùبراير/ شباط;مارس/ آذار;أبريل/ نيسان;مايو/ أيار;يونيو/ Øزيران;يوليو/ تموز;أغسطس/ آب;سبتمبر/ أيلول;أكتوبر/ تشرين الأول;نوÙمبر/ تشرين الثاني;ديسمبر/ كانون الأول".split(";"),monthsShort:"يناير/ كانون الثاني;Ùبراير/ شباط;مارس/ آذار;أبريل/ نيسان;مايو/ أيار;يونيو/ Øزيران;يوليو/ تموز;أغسطس/ آب;سبتمبر/ أيلول;أكتوبر/ تشرين الأول;نوÙمبر/ تشرين الثاني;ديسمبر/ كانون الأول".split(";"),
|
||||||
|
weekdays:"الأØد الإثنين الثلاثاء الأربعاء الخميس الجمعة السبت".split(" "),weekdaysShort:"الأØد الإثنين الثلاثاء الأربعاء الخميس الجمعة السبت".split(" "),weekdaysMin:"Ø Ù† Ø« ر Ø® ج س".split(" "),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",
|
||||||
|
lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"ÙÙŠ %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}})});(function(a){a(i)})(function(a){a.lang("bg",{months:"Ñнуари февруари март април май юни юли авгуÑÑ‚ Ñептември октомври ноември декември".split(" "),
|
||||||
|
monthsShort:"Ñнр фев мар апр май юни юли авг Ñеп окт ное дек".split(" "),weekdays:"Ð½ÐµÐ´ÐµÐ»Ñ Ð¿Ð¾Ð½ÐµÐ´ÐµÐ»Ð½Ð¸Ðº вторник ÑÑ€Ñда четвъртък петък Ñъбота".split(" "),weekdaysShort:"нед пон вто ÑÑ€Ñ Ñ‡ÐµÑ‚ пет Ñъб".split(" "),weekdaysMin:"нд пн вт ÑÑ€ чт пт Ñб".split(" "),longDateFormat:{LT:"h:mm",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Ð”Ð½ÐµÑ Ð²] LT",
|
||||||
|
nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Ð’ изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Ð’ изминалиÑ] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"Ñлед %s",past:"преди %s",s:"нÑколко Ñекунди",m:"минута",mm:"%d минути",h:"чаÑ",hh:"%d чаÑа",d:"ден",dd:"%d дни",M:"меÑец",MM:"%d меÑеца",y:"година",
|
||||||
|
yy:"%d години"},ordinal:function(a){var b=a%10,d=a%100;return 0===a?a+"-ев":0===d?a+"-ен":10<d&&20>d?a+"-ти":1===b?a+"-ви":2===b?a+"-ри":7===b||8===b?a+"-ми":a+"-ти"},week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){function c(a,c,b){c=a+" ";b={mm:"munutenn",MM:"miz",dd:"devezh"}[b];2===a?(a={m:"v",b:"v",d:"z"},a=a[b.charAt(0)]===e?b:a[b.charAt(0)]+b.substring(1)):a=b;return c+a}function b(a){return 9<a?b(a%10):a}a.lang("br",{months:"Genver C'hwevrer Meurzh Ebrel Mae Mezheven Gouere Eost Gwengolo Here Du Kerzu".split(" "),
|
||||||
|
monthsShort:"Gen C'hwe Meu Ebr Mae Eve Gou Eos Gwe Her Du Ker".split(" "),weekdays:"Sul Lun Meurzh Merc'her Yaou Gwener Sadorn".split(" "),weekdaysShort:"Sul Lun Meu Mer Yao Gwe Sad".split(" "),weekdaysMin:"Su Lu Me Mer Ya Gw Sa".split(" "),longDateFormat:{LT:"h[e]mm A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY LT",LLLL:"dddd, D [a viz] MMMM YYYY LT"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",
|
||||||
|
sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:c,h:"un eur",hh:"%d eur",d:"un devezh",dd:c,M:"ur miz",MM:c,y:"ur bloaz",yy:function(a){switch(b(a)){case 1:case 3:case 4:case 5:case 9:return a+" bloaz";default:return a+" vloaz"}}},ordinal:function(a){return a+(1===a?"añ":"vet")},week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("ca",{months:"Gener Febrer Març Abril Maig Juny Juliol Agost Setembre Octubre Novembre Desembre".split(" "),
|
||||||
|
monthsShort:"Gen. Febr. Mar. Abr. Mai. Jun. Jul. Ag. Set. Oct. Nov. Des.".split(" "),weekdays:"Diumenge Dilluns Dimarts Dimecres Dijous Divendres Dissabte".split(" "),weekdaysShort:"Dg. Dl. Dt. Dc. Dj. Dv. Ds.".split(" "),weekdaysMin:"Dg Dl Dt Dc Dj Dv Ds".split(" "),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==
|
||||||
|
this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:"%dº",week:{dow:1,doy:4}})});
|
||||||
|
(function(a){a(i)})(function(a){function c(a){return 1<a&&5>a&&1!==~~(a/10)}function b(a,g,d,e){var f=a+" ";switch(d){case "s":return g||e?"pár vteÅ™in":"pár vteÅ™inami";case "m":return g?"minuta":e?"minutu":"minutou";case "mm":return g||e?f+(c(a)?"minuty":"minut"):f+"minutami";case "h":return g?"hodina":e?"hodinu":"hodinou";case "hh":return g||e?f+(c(a)?"hodiny":"hodin"):f+"hodinami";case "d":return g||e?"den":"dnem";case "dd":return g||e?f+(c(a)?"dny":"dnÃ"):f+"dny";case "M":return g||e?"mÄ›sÃc":
|
||||||
|
"mÄ›sÃcem";case "MM":return g||e?f+(c(a)?"mÄ›sÃce":"mÄ›sÃců"):f+"mÄ›sÃci";case "y":return g||e?"rok":"rokem";case "yy":return g||e?f+(c(a)?"roky":"let"):f+"lety"}}var d="leden únor bÅ™ezen duben kvÄ›ten Äerven Äervenec srpen zářà řÃjen listopad prosinec".split(" "),e="led úno bÅ™e dub kvÄ› Ävn Ävc srp zář Å™Ãj lis pro".split(" ");a.lang("cs",{months:d,monthsShort:e,monthsParse:function(a,c){var b,g=[];for(b=0;12>b;b++)g[b]=RegExp("^"+a[b]+"$|^"+c[b]+"$","i");return g}(d,e),weekdays:"nedÄ›le pondÄ›là úterý stÅ™eda Ätvrtek pátek sobota".split(" "),
|
||||||
|
weekdaysShort:"ne po út st Ät pá so".split(" "),weekdaysMin:"ne po út st Ät pá so".split(" "),longDateFormat:{LT:"H:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd D. MMMM YYYY LT"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zÃtra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedÄ›li v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve stÅ™edu v] LT";case 4:return"[ve Ätvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},
|
||||||
|
lastDay:"[vÄera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou nedÄ›li v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou stÅ™edu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pÅ™ed %s",s:b,m:b,mm:b,h:b,hh:b,d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("cv",{months:"кăрлач Ð½Ð°Ñ€ÄƒÑ Ð¿ÑƒÑˆ ака май çĕртме утă çурла авăн юпа чӳк раштав".split(" "),
|
||||||
|
monthsShort:"кăр нар пуш ака май çĕр утă çур ав юпа чӳк раш".split(" "),weekdays:"вырÑарникун тунтикун ытларикун юнкун кĕçнерникун Ñрнекун шăматкун".split(" "),weekdaysShort:"выр тун ытл юн кĕç Ñрн шăм".split(" "),weekdaysMin:"вр тн Ñ‹Ñ‚ юн кç ÑÑ€ шм".split(" "),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ]",LLL:"YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT",
|
||||||
|
LLLL:"dddd, YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT"},calendar:{sameDay:"[ПаÑн] LT [Ñехетре]",nextDay:"[Ыран] LT [Ñехетре]",lastDay:"[Ĕнер] LT [Ñехетре]",nextWeek:"[ÇитеÑ] dddd LT [Ñехетре]",lastWeek:"[Иртнĕ] dddd LT [Ñехетре]",sameElse:"L"},relativeTime:{future:function(a){var b=/Ñехет$/i.exec(a)?"рен":/çул$/i.exec(a)?"тан":"ран";return a+b},past:"%s каÑлла",s:"пĕр-ик çеккунт",m:"пĕр минут",
|
||||||
|
mm:"%d минут",h:"пĕр Ñехет",hh:"%d Ñехет",d:"пĕр кун",dd:"%d кун",M:"пĕр уйăх",MM:"%d уйăх",y:"пĕр çул",yy:"%d çул"},ordinal:"%d-мĕш",week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){a.lang("da",{months:"januar februar marts april maj juni juli august september oktober november december".split(" "),monthsShort:"jan feb mar apr maj jun jul aug sep okt nov dec".split(" "),weekdays:"søndag mandag tirsdag onsdag torsdag fredag lørdag".split(" "),
|
||||||
|
weekdaysShort:"søn man tir ons tor fre lør".split(" "),weekdaysMin:"sø ma ti on to fr lø".split(" "),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D. MMMM, YYYY LT"},calendar:{sameDay:"[I dag kl.] LT",nextDay:"[I morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[I går kl.] LT",lastWeek:"[sidste] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",
|
||||||
|
dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},ordinal:"%d.",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){function c(a,c,b){a={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[a+" Tage",a+" Tagen"],M:["ein Monat","einem Monat"],MM:[a+" Monate",a+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[a+" Jahre",a+" Jahren"]};return c?a[b][0]:a[b][1]}a.lang("de",{months:"Januar Februar März April Mai Juni Juli August September Oktober November Dezember".split(" "),
|
||||||
|
monthsShort:"Jan. Febr. Mrz. Apr. Mai Jun. Jul. Aug. Sept. Okt. Nov. Dez.".split(" "),weekdays:"Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag".split(" "),weekdaysShort:"So. Mo. Di. Mi. Do. Fr. Sa.".split(" "),weekdaysMin:"So Mo Di Mi Do Fr Sa".split(" "),longDateFormat:{LT:"H:mm [Uhr]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Heute um] LT",sameElse:"L",nextDay:"[Morgen um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gestern um] LT",
|
||||||
|
lastWeek:"[letzten] dddd [um] LT"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:c,mm:"%d Minuten",h:c,hh:"%d Stunden",d:c,dd:c,M:c,MM:c,y:c,yy:c},ordinal:"%d.",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("el",{monthsNominativeEl:"ΙανουάÏιος ΦεβÏουάÏιος ΜάÏτιος ΑπÏίλιος Μάιος ΙοÏνιος ΙοÏλιος ΑÏγουστος ΣεπτÎμβÏιος ΟκτώβÏιος ÎοÎμβÏιος ΔεκÎμβÏιος".split(" "),monthsGenitiveEl:"ΙανουαÏίου ΦεβÏουαÏίου ΜαÏτίου ΑπÏιλίου ΜαÎου Ιουνίου Ιουλίου ΑυγοÏστου ΣεπτεμβÏίου ΟκτωβÏίου ÎοεμβÏίου ΔεκεμβÏίου".split(" "),
|
||||||
|
months:function(a,b){return/D/.test(b.substring(0,b.indexOf("MMMM")))?this._monthsGenitiveEl[a.month()]:this._monthsNominativeEl[a.month()]},monthsShort:"Ιαν Φεβ ÎœÎ±Ï Î‘Ï€Ï ÎœÎ±ÏŠ Ιουν Ιουλ Αυγ Σεπ Οκτ Îοε Δεκ".split(" "),weekdays:"ΚυÏιακή;ΔευτÎÏα;ΤÏίτη;ΤετάÏτη;Î Îμπτη;ΠαÏασκευή;Σάββατο".split(";"),weekdaysShort:"ΚυÏ;Δευ;ΤÏι;Τετ;Πεμ;ΠαÏ;Σαβ".split(";"),weekdaysMin:"Κυ;Δε;ΤÏ;Τε;Πε;Πα;Σα".split(";"),
|
||||||
|
meridiem:function(a,b,d){return 11<a?d?"μμ":"ΜΜ":d?"πμ":"Î Îœ"},longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendarEl:{sameDay:"[ΣήμεÏα {}] LT",nextDay:"[ΑÏÏιο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:"[την Ï€ÏοηγοÏμενη] dddd [{}] LT",sameElse:"L"},calendar:function(a,b){var d=this._calendarEl[a],e=b&&b.hours();return d.replace("{}",1===e%12?"στη":"στις")},relativeTime:{future:"σε %s",
|
||||||
|
past:"%s Ï€Ïιν",s:"δευτεÏόλεπτα",m:"Îνα λεπτό",mm:"%d λεπτά",h:"μία ÏŽÏα",hh:"%d ÏŽÏες",d:"μία μÎÏα",dd:"%d μÎÏες",M:"Îνας μήνας",MM:"%d μήνες",y:"Îνας χÏόνος",yy:"%d χÏόνια"},ordinal:function(a){return a+"η"},week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("en-ca",{months:"January February March April May June July August September October November December".split(" "),monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),
|
||||||
|
weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),weekdaysShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),weekdaysMin:"Su Mo Tu We Th Fr Sa".split(" "),longDateFormat:{LT:"h:mm A",L:"YYYY-MM-DD",LL:"D MMMM, YYYY",LLL:"D MMMM, YYYY LT",LLLL:"dddd, D MMMM, YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",
|
||||||
|
m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return a+(1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th")}})});(function(a){a(i)})(function(a){a.lang("en-gb",{months:"January February March April May June July August September October November December".split(" "),monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
|
||||||
|
weekdaysShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),weekdaysMin:"Su Mo Tu We Th Fr Sa".split(" "),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",
|
||||||
|
M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return a+(1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th")},week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("eo",{months:"januaro februaro marto aprilo majo junio julio aÅgusto septembro oktobro novembro decembro".split(" "),monthsShort:"jan feb mar apr maj jun jul aÅg sep okt nov dec".split(" "),weekdays:"Dimanĉo Lundo Mardo Merkredo Ä´aÅdo Vendredo Sabato".split(" "),weekdaysShort:"Dim Lun Mard Merk Ä´aÅ Ven Sab".split(" "),
|
||||||
|
weekdaysMin:"Di Lu Ma Me Ä´a Ve Sa".split(" "),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D[-an de] MMMM, YYYY",LLL:"D[-an de] MMMM, YYYY LT",LLLL:"dddd, [la] D[-an de] MMMM, YYYY LT"},meridiem:function(a,b,d){return 11<a?d?"p.t.m.":"P.T.M.":d?"a.t.m.":"A.T.M."},calendar:{sameDay:"[HodiaÅ je] LT",nextDay:"[MorgaÅ je] LT",nextWeek:"dddd [je] LT",lastDay:"[HieraÅ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"je %s",past:"antaÅ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",
|
||||||
|
h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},ordinal:"%da",week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){a.lang("es",{months:"enero febrero marzo abril mayo junio julio agosto septiembre octubre noviembre diciembre".split(" "),monthsShort:"ene. feb. mar. abr. may. jun. jul. ago. sep. oct. nov. dic.".split(" "),weekdays:"domingo lunes martes miércoles jueves viernes sábado".split(" "),weekdaysShort:"dom. lun. mar. mié. jue. vie. sáb.".split(" "),
|
||||||
|
weekdaysMin:"Do Lu Ma Mi Ju Vi Sá".split(" "),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY LT",LLLL:"dddd, D [de] MMMM [de] YYYY LT"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+
|
||||||
|
(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un dÃa",dd:"%d dÃas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:"%dº",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("et",{months:"jaanuar veebruar märts aprill mai juuni juuli august september oktoober november detsember".split(" "),monthsShort:"jaan veebr märts apr mai juuni juuli aug sept okt nov dets".split(" "),
|
||||||
|
weekdays:"pühapäev esmaspäev teisipäev kolmapäev neljapäev reede laupäev".split(" "),weekdaysShort:"PETKNRL".split(""),weekdaysMin:"PETKNRL".split(""),longDateFormat:{LT:"H:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:function(a,b,d,e){return e||b?
|
||||||
|
"paari sekundi":"paar sekundit"},m:"minut",mm:"%d minutit",h:"tund",hh:"%d tundi",d:"päev",dd:"%d päeva",M:"kuu",MM:"%d kuud",y:"aasta",yy:"%d aastat"},ordinal:"%d.",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("eu",{months:"urtarrila otsaila martxoa apirila maiatza ekaina uztaila abuztua iraila urria azaroa abendua".split(" "),monthsShort:"urt. ots. mar. api. mai. eka. uzt. abu. ira. urr. aza. abe.".split(" "),weekdays:"igandea astelehena asteartea asteazkena osteguna ostirala larunbata".split(" "),
|
||||||
|
weekdaysShort:"ig. al. ar. az. og. ol. lr.".split(" "),weekdaysMin:"ig al ar az og ol lr".split(" "),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] LT",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] LT",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] LT",llll:"ddd, YYYY[ko] MMM D[a] LT"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},
|
||||||
|
relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},ordinal:"%d.",week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){var c={1:"Û±",2:"Û²",3:"Û³",4:"Û´",5:"Ûµ",6:"Û¶",7:"Û·",8:"Û¸",9:"Û¹","0":"Û°"},b={"Û±":"1","Û²":"2","Û³":"3","Û´":"4","Ûµ":"5","Û¶":"6","Û·":"7","Û¸":"8","Û¹":"9","Û°":"0"};a.lang("fa",{months:"ژانویه Ùوریه مارس آوریل مه ژوئن ژوئیه اوت سپتامبر اکتبر نوامبر دسامبر".split(" "),
|
||||||
|
monthsShort:"ژانویه Ùوریه مارس آوریل مه ژوئن ژوئیه اوت سپتامبر اکتبر نوامبر دسامبر".split(" "),weekdays:"یکشنبه دوشنبه سهشنبه چهارشنبه پنجشنبه جمعه شنبه".split(" "),weekdaysShort:"یکشنبه دوشنبه سهشنبه چهارشنبه پنجشنبه جمعه شنبه".split(" "),weekdaysMin:"ÛŒ د س Ú† Ù¾ ج Ø´".split(" "),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",
|
||||||
|
LLLL:"dddd, D MMMM YYYY LT"},meridiem:function(a){return 12>a?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[Ùردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چندین ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",
|
||||||
|
y:"یک سال",yy:"%d سال"},preparse:function(a){return a.replace(/[۰-۹]/g,function(a){return b[a]}).replace(/،/g,",")},postformat:function(a){return a.replace(/\d/g,function(a){return c[a]}).replace(/,/g,"،")},ordinal:"%dم",week:{dow:6,doy:12}})});(function(a){a(i)})(function(a){function c(a,c,e,f){c="";switch(e){case "s":return f?"muutaman sekunnin":"muutama sekunti";case "m":return f?"minuutin":"minuutti";case "mm":c=f?"minuutin":"minuuttia";break;case "h":return f?"tunnin":"tunti";case "hh":c=
|
||||||
|
f?"tunnin":"tuntia";break;case "d":return f?"päivän":"päivä";case "dd":c=f?"päivän":"päivää";break;case "M":return f?"kuukauden":"kuukausi";case "MM":c=f?"kuukauden":"kuukautta";break;case "y":return f?"vuoden":"vuosi";case "yy":c=f?"vuoden":"vuotta"}return c=(10>a?f?d[a]:b[a]:a)+" "+c}var b="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),d=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",b[7],b[8],b[9]];a.lang("fi",{months:"tammikuu helmikuu maaliskuu huhtikuu toukokuu kesäkuu heinäkuu elokuu syyskuu lokakuu marraskuu joulukuu".split(" "),
|
||||||
|
monthsShort:"tammi helmi maalis huhti touko kesä heinä elo syys loka marras joulu".split(" "),weekdays:"sunnuntai maanantai tiistai keskiviikko torstai perjantai lauantai".split(" "),weekdaysShort:"su ma ti ke to pe la".split(" "),weekdaysMin:"su ma ti ke to pe la".split(" "),longDateFormat:{LT:"HH.mm",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] LT",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] LT",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] LT",llll:"ddd, Do MMM YYYY, [klo] LT"},
|
||||||
|
calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:c,m:c,mm:c,h:c,hh:c,d:c,dd:c,M:c,MM:c,y:c,yy:c},ordinal:"%d.",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("fr-ca",{months:"janvier février mars avril mai juin juillet août septembre octobre novembre décembre".split(" "),monthsShort:"janv. févr. mars avr. mai juin juil. août sept. oct. nov. déc.".split(" "),
|
||||||
|
weekdays:"dimanche lundi mardi mercredi jeudi vendredi samedi".split(" "),weekdaysShort:"dim. lun. mar. mer. jeu. ven. sam.".split(" "),weekdaysMin:"Di Lu Ma Me Je Ve Sa".split(" "),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Aujourd'hui à ] LT",nextDay:"[Demain à ] LT",nextWeek:"dddd [à ] LT",lastDay:"[Hier à ] LT",lastWeek:"dddd [dernier à ] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",
|
||||||
|
m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(a){return a+(1===a?"er":"")}})});(function(a){a(i)})(function(a){a.lang("fr",{months:"janvier février mars avril mai juin juillet août septembre octobre novembre décembre".split(" "),monthsShort:"janv. févr. mars avr. mai juin juil. août sept. oct. nov. déc.".split(" "),weekdays:"dimanche lundi mardi mercredi jeudi vendredi samedi".split(" "),
|
||||||
|
weekdaysShort:"dim. lun. mar. mer. jeu. ven. sam.".split(" "),weekdaysMin:"Di Lu Ma Me Je Ve Sa".split(" "),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Aujourd'hui à ] LT",nextDay:"[Demain à ] LT",nextWeek:"dddd [à ] LT",lastDay:"[Hier à ] LT",lastWeek:"dddd [dernier à ] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",
|
||||||
|
d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(a){return a+(1===a?"er":"")},week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("gl",{months:"Xaneiro Febreiro Marzo Abril Maio Xuño Xullo Agosto Setembro Outubro Novembro Decembro".split(" "),monthsShort:"Xan. Feb. Mar. Abr. Mai. Xuñ. Xul. Ago. Set. Out. Nov. Dec.".split(" "),weekdays:"Domingo Luns Martes Mércores Xoves Venres Sábado".split(" "),weekdaysShort:"Dom. Lun. Mar. Mér. Xov. Ven. Sáb.".split(" "),
|
||||||
|
weekdaysMin:"Do Lu Ma Mé Xo Ve Sá".split(" "),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==
|
||||||
|
this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(a){return"uns segundos"===a?"nuns segundos":"en "+a},past:"hai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un dÃa",dd:"%d dÃas",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},ordinal:"%dº",week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){a.lang("he",{months:"×™× ×•×ר;פברו×ר;מרץ;×פריל;מ××™;×™×•× ×™;יולי;×וגוסט;ספטמבר;×וקטובר;× ×•×‘×ž×‘×¨;דצמבר".split(";"),
|
||||||
|
monthsShort:"×™× ×•×³;פבר׳;מרץ;×פר׳;מ××™;×™×•× ×™;יולי;×וג׳;ספט׳;×וק׳;× ×•×‘×³;דצמ׳".split(";"),weekdays:"ר×שון;×©× ×™;שלישי;רביעי;חמישי;שישי;שבת".split(";"),weekdaysShort:"×׳ ב׳ ג׳ ד׳ ה׳ ו׳ ש׳".split(" "),weekdaysMin:"× ×‘ ×’ ד ×” ו ש".split(" "),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY LT",LLLL:"dddd, D [ב]MMMM YYYY LT",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY LT",llll:"ddd, D MMM YYYY LT"},
|
||||||
|
calendar:{sameDay:"[×”×™×•× ×‘Ö¾]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[×תמול ב־]LT",lastWeek:"[ביו×] dddd [×”×חרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"×œ×¤× ×™ %s",s:"מספר ×©× ×™×•×ª",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(a){return 2===a?"שעתיי×":a+" שעות"},d:"יו×",dd:function(a){return 2===a?"יומיי×":a+" ימי×"},M:"חודש",MM:function(a){return 2===a?"חודשיי×":a+" חודשי×"},
|
||||||
|
y:"×©× ×”",yy:function(a){return 2===a?"×©× ×ª×™×™×":a+" ×©× ×™×"}}})});(function(a){a(i)})(function(a){var c={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"à¥",8:"८",9:"९","0":"०"},b={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","à¥":"7","८":"8","९":"9","०":"0"};a.lang("hi",{months:"जनवरी फ़रवरी मारà¥à¤š अपà¥à¤°à¥ˆà¤² मई जून जà¥à¤²à¤¾à¤ˆ अगसà¥à¤¤ सितमà¥à¤¬à¤° अकà¥à¤Ÿà¥‚बर नवमà¥à¤¬à¤° दिसमà¥à¤¬à¤°".split(" "),
|
||||||
|
monthsShort:"जन. फ़र. मारà¥à¤š अपà¥à¤°à¥ˆ. मई जून जà¥à¤². अग. सित. अकà¥à¤Ÿà¥‚. नव. दिस.".split(" "),weekdays:"रविवार सोमवार मंगलवार बà¥à¤§à¤µà¤¾à¤° गà¥à¤°à¥‚वार शà¥à¤•à¥à¤°à¤µà¤¾à¤° शनिवार".split(" "),weekdaysShort:"रवि सोम मंगल बà¥à¤§ गà¥à¤°à¥‚ शà¥à¤•à¥à¤° शनि".split(" "),weekdaysMin:"र सो मं बॠगॠशॠश".split(" "),
|
||||||
|
longDateFormat:{LT:"A h:mm बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कà¥à¤› ही कà¥à¤·à¤£",m:"à¤à¤• मिनट",mm:"%d मिनट",h:"à¤à¤• घंटा",hh:"%d घंटे",d:"à¤à¤• दिन",dd:"%d दिन",M:"à¤à¤• महीने",
|
||||||
|
MM:"%d महीने",y:"à¤à¤• वरà¥à¤·",yy:"%d वरà¥à¤·"},preparse:function(a){return a.replace(/[१२३४५६à¥à¥®à¥¯à¥¦]/g,function(a){return b[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return c[a]})},meridiem:function(a){return 4>a?"रात":10>a?"सà¥à¤¬à¤¹":17>a?"दोपहर":20>a?"शाम":"रात"},week:{dow:0,doy:6}})});(function(a){a(i)})(function(a){function c(a,c,b){var d=a+" ";switch(b){case "m":return c?"jedna minuta":"jedne minute";
|
||||||
|
case "mm":return 1===a?d+"minuta":2===a||3===a||4===a?d+"minute":d+"minuta";case "h":return c?"jedan sat":"jednog sata";case "hh":return 1===a?d+"sat":2===a||3===a||4===a?d+"sata":d+"sati";case "dd":return 1===a?d+"dan":d+"dana";case "MM":return 1===a?d+"mjesec":2===a||3===a||4===a?d+"mjeseca":d+"mjeseci";case "yy":return 1===a?d+"godina":2===a||3===a||4===a?d+"godine":d+"godina"}}a.lang("hr",{months:"sjeÄanj veljaÄa ožujak travanj svibanj lipanj srpanj kolovoz rujan listopad studeni prosinac".split(" "),
|
||||||
|
monthsShort:"sje. vel. ožu. tra. svi. lip. srp. kol. ruj. lis. stu. pro.".split(" "),weekdays:"nedjelja ponedjeljak utorak srijeda Äetvrtak petak subota".split(" "),weekdaysShort:"ned. pon. uto. sri. Äet. pet. sub.".split(" "),weekdaysMin:"ne po ut sr Äe pe su".split(" "),longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";
|
||||||
|
case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juÄer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[proÅ¡lu] dddd [u] LT";case 6:return"[proÅ¡le] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[proÅ¡li] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",m:c,mm:c,h:c,hh:c,d:"dan",dd:c,M:"mjesec",MM:c,y:"godinu",yy:c},ordinal:"%d.",week:{dow:1,doy:7}})});
|
||||||
|
(function(a){a(i)})(function(a){function c(a,c,b,d){switch(b){case "s":return d||c?"néhány másodperc":"néhány másodperce";case "m":return"egy"+(d||c?" perc":" perce");case "mm":return a+(d||c?" perc":" perce");case "h":return"egy"+(d||c?" óra":" órája");case "hh":return a+(d||c?" óra":" órája");case "d":return"egy"+(d||c?" nap":" napja");case "dd":return a+(d||c?" nap":" napja");case "M":return"egy"+(d||c?" hónap":" hónapja");case "MM":return a+(d||c?" hónap":" hónapja");case "y":return"egy"+
|
||||||
|
(d||c?" év":" éve");case "yy":return a+(d||c?" év":" éve")}return""}function b(a){return(a?"":"[múlt] ")+"["+d[this.day()]+"] LT[-kor]"}var d="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");a.lang("hu",{months:"január február március április május június július augusztus szeptember október november december".split(" "),monthsShort:"jan feb márc ápr máj jún júl aug szept okt nov dec".split(" "),weekdays:"vasárnap hétfő kedd szerda csütörtök péntek szombat".split(" "),
|
||||||
|
weekdaysShort:"v h k sze cs p szo".split(" "),longDateFormat:{LT:"H:mm",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D., LT",LLLL:"YYYY. MMMM D., dddd LT"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return b.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return b.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:c,m:c,mm:c,h:c,hh:c,d:c,dd:c,M:c,MM:c,y:c,yy:c},ordinal:"%d.",week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){a.lang("id",
|
||||||
|
{months:"Januari Februari Maret April Mei Juni Juli Agustus September Oktober November Desember".split(" "),monthsShort:"Jan Feb Mar Apr Mei Jun Jul Ags Sep Okt Nov Des".split(" "),weekdays:"Minggu Senin Selasa Rabu Kamis Jumat Sabtu".split(" "),weekdaysShort:"Min Sen Sel Rab Kam Jum Sab".split(" "),weekdaysMin:"Mg Sn Sl Rb Km Jm Sb".split(" "),longDateFormat:{LT:"HH.mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] LT",LLLL:"dddd, D MMMM YYYY [pukul] LT"},meridiem:function(a){return 11>
|
||||||
|
a?"pagi":15>a?"siang":19>a?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){function c(a){return 11!==a%100&&1===a%
|
||||||
|
10?!1:!0}function b(a,d,g,e){var f=a+" ";switch(g){case "s":return d||e?"nokkrar sekúndur":"nokkrum sekúndum";case "m":return d?"mÃnúta":"mÃnútu";case "mm":return c(a)?f+(d||e?"mÃnútur":"mÃnútum"):d?f+"mÃnúta":f+"mÃnútu";case "hh":return c(a)?f+(d||e?"klukkustundir":"klukkustundum"):f+"klukkustund";case "d":return d?"dagur":e?"dag":"degi";case "dd":return c(a)?d?f+"dagar":f+(e?"daga":"dögum"):d?f+"dagur":f+(e?"dag":"degi");case "M":return d?"mánuður":e?"mánuð":"mánuði";case "MM":return c(a)?
|
||||||
|
d?f+"mánuðir":f+(e?"mánuði":"mánuðum"):d?f+"mánuður":f+(e?"mánuð":"mánuði");case "y":return d||e?"ár":"ári";case "yy":return c(a)?f+(d||e?"ár":"árum"):f+(d||e?"ár":"ári")}}a.lang("is",{months:"janúar febrúar mars aprÃl maà júnà júlà ágúst september október nóvember desember".split(" "),monthsShort:"jan feb mar apr maà jún júl ágú sep okt nóv des".split(" "),weekdays:"sunnudagur mánudagur þriðjudagur miðvikudagur fimmtudagur föstudagur laugardagur".split(" "),weekdaysShort:"sun mán þri mið fim fös lau".split(" "),
|
||||||
|
weekdaysMin:"Su Má Þr Mi Fi Fö La".split(" "),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] LT",LLLL:"dddd, D. MMMM YYYY [kl.] LT"},calendar:{sameDay:"[à dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[à gær kl.] LT",lastWeek:"[sÃðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s sÃðan",s:b,m:b,mm:b,h:"klukkustund",hh:b,d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("it",
|
||||||
|
{months:"Gennaio Febbraio Marzo Aprile Maggio Giugno Luglio Agosto Settembre Ottobre Novembre Dicembre".split(" "),monthsShort:"Gen Feb Mar Apr Mag Giu Lug Ago Set Ott Nov Dic".split(" "),weekdays:"Domenica Lunedì Martedì Mercoledì Giovedì Venerdì Sabato".split(" "),weekdaysShort:"Dom Lun Mar Mer Gio Ven Sab".split(" "),weekdaysMin:"D L Ma Me G V S".split(" "),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Oggi alle] LT",
|
||||||
|
nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:"[lo scorso] dddd [alle] LT",sameElse:"L"},relativeTime:{future:function(a){return(/^[0-9].+$/.test(a)?"tra":"in")+" "+a},past:"%s fa",s:"secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:"%dº",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("ja",{months:"1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月".split(" "),
|
||||||
|
monthsShort:"1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月".split(" "),weekdays:"日曜日 月曜日 ç«æ›œæ—¥ 水曜日 木曜日 金曜日 土曜日".split(" "),weekdaysShort:"æ—¥ 月 ç« æ°´ 木 金 土".split(" "),weekdaysMin:"æ—¥ 月 ç« æ°´ 木 金 土".split(" "),longDateFormat:{LT:"Ah時m分",L:"YYYY/MM/DD",LL:"YYYYå¹´M月Dæ—¥",LLL:"YYYYå¹´M月Dæ—¥LT",LLLL:"YYYYå¹´M月Dæ—¥LT dddd"},meridiem:function(a){return 12>a?"åˆå‰":"åˆå¾Œ"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",
|
||||||
|
nextWeek:"[æ¥é€±]dddd LT",lastDay:"[昨日] LT",lastWeek:"[å‰é€±]dddd LT",sameElse:"L"},relativeTime:{future:"%s後",past:"%så‰",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1æ—¥",dd:"%dæ—¥",M:"1ヶ月",MM:"%dヶ月",y:"1å¹´",yy:"%då¹´"}})});(function(a){a(i)})(function(a){a.lang("ka",{months:function(a,b){return{nominative:"იáƒáƒœáƒ•áƒáƒ ი;თებერვáƒáƒšáƒ˜;მáƒáƒ ტი;áƒáƒžáƒ ილი;მáƒáƒ˜áƒ¡áƒ˜;ივნისი;ივლისი;áƒáƒ’ვისტáƒ;სექტემბერი;áƒáƒ¥áƒ¢áƒáƒ›áƒ‘ერი;ნáƒáƒ”მბერი;დეკემბერი".split(";"),
|
||||||
|
accusative:"იáƒáƒœáƒ•áƒáƒ ს;თებერვáƒáƒšáƒ¡;მáƒáƒ ტს;áƒáƒžáƒ ილის;მáƒáƒ˜áƒ¡áƒ¡;ივნისს;ივლისს;áƒáƒ’ვისტს;სექტემბერს;áƒáƒ¥áƒ¢áƒáƒ›áƒ‘ერს;ნáƒáƒ”მბერს;დეკემბერს".split(";")}[/D[oD] *MMMM?/.test(b)?"accusative":"nominative"][a.month()]},monthsShort:"იáƒáƒœ;თებ;მáƒáƒ ;áƒáƒžáƒ ;მáƒáƒ˜;ივნ;ივლ;áƒáƒ’ვ;სექ;áƒáƒ¥áƒ¢;ნáƒáƒ”;დეკ".split(";"),
|
||||||
|
weekdays:function(a,b){return{nominative:"კვირáƒ;áƒáƒ შáƒáƒ‘áƒáƒ—ი;სáƒáƒ›áƒ¨áƒáƒ‘áƒáƒ—ი;áƒáƒ—ხშáƒáƒ‘áƒáƒ—ი;ხუთშáƒáƒ‘áƒáƒ—ი;პáƒáƒ áƒáƒ¡áƒ™áƒ”ვი;შáƒáƒ‘áƒáƒ—ი".split(";"),accusative:"კვირáƒáƒ¡;áƒáƒ შáƒáƒ‘áƒáƒ—ს;სáƒáƒ›áƒ¨áƒáƒ‘áƒáƒ—ს;áƒáƒ—ხშáƒáƒ‘áƒáƒ—ს;ხუთშáƒáƒ‘áƒáƒ—ს;პáƒáƒ áƒáƒ¡áƒ™áƒ”ვს;შáƒáƒ‘áƒáƒ—ს".split(";")}[/(წინáƒ|შემდეგ)/.test(b)?"accusative":"nominative"][a.day()]},
|
||||||
|
weekdaysShort:"კვი;áƒáƒ შ;სáƒáƒ›;áƒáƒ—ხ;ხუთ;პáƒáƒ ;შáƒáƒ‘".split(";"),weekdaysMin:"კვ;áƒáƒ ;სáƒ;áƒáƒ—;ხუ;პáƒ;შáƒ".split(";"),longDateFormat:{LT:"h:mm A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვáƒáƒš] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინáƒ] dddd LT-ზე",sameElse:"L"},
|
||||||
|
relativeTime:{future:function(a){return/(წáƒáƒ›áƒ˜|წუთი|სáƒáƒáƒ—ი|წელი)/.test(a)?a.replace(/ი$/,"ში"):a+"ში"},past:function(a){if(/(წáƒáƒ›áƒ˜|წუთი|სáƒáƒáƒ—ი|დღე|თვე)/.test(a))return a.replace(/(ი|ე)$/,"ის წინ");if(/წელი/.test(a))return a.replace(/წელი$/,"წლის წინ")},s:"რáƒáƒ›áƒ“ენიმე წáƒáƒ›áƒ˜",m:"წუთი",mm:"%d წუთი",h:"სáƒáƒáƒ—ი",hh:"%d სáƒáƒáƒ—ი",
|
||||||
|
d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},ordinal:function(a){return 0===a?a:1===a?a+"-ლი":20>a||100>=a&&0===a%20||0===a%100?"მე-"+a:a+"-ე"},week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){a.lang("ko",{months:"1ì›” 2ì›” 3ì›” 4ì›” 5ì›” 6ì›” 7ì›” 8ì›” 9ì›” 10ì›” 11ì›” 12ì›”".split(" "),monthsShort:"1ì›” 2ì›” 3ì›” 4ì›” 5ì›” 6ì›” 7ì›” 8ì›” 9ì›” 10ì›” 11ì›” 12ì›”".split(" "),weekdays:"ì¼ìš”ì¼;월요ì¼;화요ì¼;수요ì¼;목요ì¼;금요ì¼;í† ìš”ì¼".split(";"),
|
||||||
|
weekdaysShort:"ì¼;ì›”;í™”;수;목;금;í† ".split(";"),weekdaysMin:"ì¼;ì›”;í™”;수;목;금;í† ".split(";"),longDateFormat:{LT:"A hì‹œ mm분",L:"YYYY.MM.DD",LL:"YYYYë…„ MMMM Dì¼",LLL:"YYYYë…„ MMMM Dì¼ LT",LLLL:"YYYYë…„ MMMM Dì¼ dddd LT"},meridiem:function(a){return 12>a?"ì˜¤ì „":"오후"},calendar:{sameDay:"오늘 LT",nextDay:"ë‚´ì¼ LT",nextWeek:"dddd LT",lastDay:"ì–´ì œ LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s ì „",s:"몇초",ss:"%dì´ˆ",m:"ì¼ë¶„",
|
||||||
|
mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%dì¼",M:"한달",MM:"%d달",y:"ì¼ë…„",yy:"%dë…„"},ordinal:"%dì¼"})});(function(a){a(i)})(function(a){function c(a,c,d){var e=a+" ";d=b[d].split("_");a=c?1===a%10&&11!==a?d[2]:d[3]:1===a%10&&11!==a?d[0]:d[1];return e+a}var b={mm:"minÅ«ti_minÅ«tes_minÅ«te_minÅ«tes",hh:"stundu_stundas_stunda_stundas",dd:"dienu_dienas_diena_dienas",MM:"mÄ“nesi_mÄ“neÅ¡us_mÄ“nesis_mÄ“neÅ¡i",yy:"gadu_gadus_gads_gadi"};a.lang("lv",{months:"janvÄris februÄris marts aprÄ«lis maijs jÅ«nijs jÅ«lijs augusts septembris oktobris novembris decembris".split(" "),
|
||||||
|
monthsShort:"jan feb mar apr mai jūn jūl aug sep okt nov dec".split(" "),weekdays:"svētdiena pirmdiena otrdiena trešdiena ceturtdiena piektdiena sestdiena".split(" "),weekdaysShort:"Sv P O T C Pk S".split(" "),weekdaysMin:"Sv P O T C Pk S".split(" "),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, LT",LLLL:"YYYY. [gada] D. MMMM, dddd, LT"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",
|
||||||
|
lastWeek:"[PagÄjuÅ¡Ä] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"%s vÄ“lÄk",past:"%s agrÄk",s:"dažas sekundes",m:"minÅ«ti",mm:c,h:"stundu",hh:c,d:"dienu",dd:c,M:"mÄ“nesi",MM:c,y:"gadu",yy:c},ordinal:"%d.",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("ml",{months:"ജനàµà´µà´°à´¿ ഫെബàµà´°àµà´µà´°à´¿ മാർചàµà´šàµ à´à´ªàµà´°à´¿àµ½ മേയൠജൂൺ ജൂലൈ à´“à´—à´¸àµà´±àµà´±àµ സെപàµà´±àµà´±à´‚ബർ à´’à´•àµà´Ÿàµ‹à´¬àµ¼ നവംബർ ഡിസംബർ".split(" "),
|
||||||
|
monthsShort:"ജനàµ. ഫെബàµà´°àµ. മാർ. à´à´ªàµà´°à´¿. മേയൠജൂൺ ജൂലൈ. à´“à´—. സെപàµà´±àµà´±. à´’à´•àµà´Ÿàµ‹. നവം. ഡിസം.".split(" "),weekdays:"ഞായറാഴàµà´š തിങàµà´•à´³à´¾à´´àµà´š ചൊവàµà´µà´¾à´´àµà´š à´¬àµà´§à´¨à´¾à´´àµà´š à´µàµà´¯à´¾à´´à´¾à´´àµà´š വെളàµà´³à´¿à´¯à´¾à´´àµà´š ശനിയാഴàµà´š".split(" "),weekdaysShort:"ഞായർ തിങàµà´•àµ¾ ചൊവàµà´µ à´¬àµà´§àµ» à´µàµà´¯à´¾à´´à´‚ വെളàµà´³à´¿ ശനി".split(" "),
|
||||||
|
weekdaysMin:"à´žà´¾ തി ചൊ ബൠവàµà´¯à´¾ വെ à´¶".split(" "),longDateFormat:{LT:"A h:mm -à´¨àµ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[ഇനàµà´¨àµ] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇനàµà´¨à´²àµ†] LT",lastWeek:"[à´•à´´à´¿à´žàµà´ž] dddd, LT",sameElse:"L"},relativeTime:{future:"%s à´•à´´à´¿à´žàµà´žàµ",past:"%s à´®àµàµ»à´ªàµ",s:"അൽപ നിമിഷങàµà´™àµ¾",m:"ഒരൠമിനിറàµà´±àµ",
|
||||||
|
mm:"%d മിനിറàµà´±àµ",h:"ഒരൠമണികàµà´•àµ‚ർ",hh:"%d മണികàµà´•àµ‚ർ",d:"ഒരൠദിവസം",dd:"%d ദിവസം",M:"ഒരൠമാസം",MM:"%d മാസം",y:"ഒരൠവർഷം",yy:"%d വർഷം"},meridiem:function(a){return 4>a?"രാതàµà´°à´¿":12>a?"രാവിലെ":17>a?"ഉചàµà´š à´•à´´à´¿à´žàµà´žàµ":20>a?"വൈകàµà´¨àµà´¨àµ‡à´°à´‚":"രാതàµà´°à´¿"}})});(function(a){a(i)})(function(a){var c={1:"१",2:"२",3:"३",
|
||||||
|
4:"४",5:"५",6:"६",7:"à¥",8:"८",9:"९","0":"०"},b={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","à¥":"7","८":"8","९":"9","०":"0"};a.lang("mr",{months:"जानेवारी फेबà¥à¤°à¥à¤µà¤¾à¤°à¥€ मारà¥à¤š à¤à¤ªà¥à¤°à¤¿à¤² मे जून जà¥à¤²à¥ˆ ऑगसà¥à¤Ÿ सपà¥à¤Ÿà¥‡à¤‚बर ऑकà¥à¤Ÿà¥‹à¤¬à¤° नोवà¥à¤¹à¥‡à¤‚बर डिसेंबर".split(" "),monthsShort:"जाने. फेबà¥à¤°à¥. मारà¥à¤š. à¤à¤ªà¥à¤°à¤¿. मे. जून. जà¥à¤²à¥ˆ. ऑग. सपà¥à¤Ÿà¥‡à¤‚. ऑकà¥à¤Ÿà¥‹. नोवà¥à¤¹à¥‡à¤‚. डिसें.".split(" "),
|
||||||
|
weekdays:"रविवार सोमवार मंगळवार बà¥à¤§à¤µà¤¾à¤° गà¥à¤°à¥‚वार शà¥à¤•à¥à¤°à¤µà¤¾à¤° शनिवार".split(" "),weekdaysShort:"रवि सोम मंगळ बà¥à¤§ गà¥à¤°à¥‚ शà¥à¤•à¥à¤° शनि".split(" "),weekdaysMin:"र सो मं बॠगॠशॠश".split(" "),longDateFormat:{LT:"A h:mm वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},calendar:{sameDay:"[आज] LT",
|
||||||
|
nextDay:"[उदà¥à¤¯à¤¾] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%s नंतर",past:"%s पूरà¥à¤µà¥€",s:"सेकंद",m:"à¤à¤• मिनिट",mm:"%d मिनिटे",h:"à¤à¤• तास",hh:"%d तास",d:"à¤à¤• दिवस",dd:"%d दिवस",M:"à¤à¤• महिना",MM:"%d महिने",y:"à¤à¤• वरà¥à¤·",yy:"%d वरà¥à¤·à¥‡"},preparse:function(a){return a.replace(/[१२३४५६à¥à¥®à¥¯à¥¦]/g,
|
||||||
|
function(a){return b[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return c[a]})},meridiem:function(a){return 4>a?"रातà¥à¤°à¥€":10>a?"सकाळी":17>a?"दà¥à¤ªà¤¾à¤°à¥€":20>a?"सायंकाळी":"रातà¥à¤°à¥€"},week:{dow:0,doy:6}})});(function(a){a(i)})(function(a){a.lang("ms-my",{months:"Januari Februari Mac April Mei Jun Julai Ogos September Oktober November Disember".split(" "),monthsShort:"Jan Feb Mac Apr Mei Jun Jul Ogs Sep Okt Nov Dis".split(" "),
|
||||||
|
weekdays:"Ahad Isnin Selasa Rabu Khamis Jumaat Sabtu".split(" "),weekdaysShort:"Ahd Isn Sel Rab Kha Jum Sab".split(" "),weekdaysMin:"Ah Is Sl Rb Km Jm Sb".split(" "),longDateFormat:{LT:"HH.mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] LT",LLLL:"dddd, D MMMM YYYY [pukul] LT"},meridiem:function(a){return 11>a?"pagi":15>a?"tengahari":19>a?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",
|
||||||
|
sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){a.lang("nb",{months:"januar februar mars april mai juni juli august september oktober november desember".split(" "),monthsShort:"jan. feb. mars april mai juni juli aug. sep. okt. nov. des.".split(" "),weekdays:"søndag mandag tirsdag onsdag torsdag fredag lørdag".split(" "),
|
||||||
|
weekdaysShort:"sø. ma. ti. on. to. fr. lø.".split(" "),weekdaysMin:"sø ma ti on to fr lø".split(" "),longDateFormat:{LT:"H.mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] LT",LLLL:"dddd D. MMMM YYYY [kl.] LT"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",
|
||||||
|
hh:"%d timer",d:"en dag",dd:"%d dager",M:"en mÃ¥ned",MM:"%d mÃ¥neder",y:"ett Ã¥r",yy:"%d Ã¥r"},ordinal:"%d.",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){var b={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"à¥",8:"८",9:"९","0":"०"},d={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","à¥":"7","८":"8","९":"9","०":"0"};a.lang("ne",{months:"जनवरी फेबà¥à¤°à¥à¤µà¤°à¥€ मारà¥à¤š अपà¥à¤°à¤¿à¤² मई जà¥à¤¨ जà¥à¤²à¤¾à¤ˆ अगषà¥à¤Ÿ सेपà¥à¤Ÿà¥‡à¤®à¥à¤¬à¤° अकà¥à¤Ÿà¥‹à¤¬à¤° नोà¤à¥‡à¤®à¥à¤¬à¤° डिसेमà¥à¤¬à¤°".split(" "),
|
||||||
|
monthsShort:"जन. फेबà¥à¤°à¥. मारà¥à¤š अपà¥à¤°à¤¿. मई जà¥à¤¨ जà¥à¤²à¤¾à¤ˆ. अग. सेपà¥à¤Ÿ. अकà¥à¤Ÿà¥‹. नोà¤à¥‡. डिसे.".split(" "),weekdays:"आइतबार सोमबार मङà¥à¤—लबार बà¥à¤§à¤¬à¤¾à¤° बिहिबार शà¥à¤•à¥à¤°à¤¬à¤¾à¤° शनिबार".split(" "),weekdaysShort:"आइत. सोम. मङà¥à¤—ल. बà¥à¤§. बिहि. शà¥à¤•à¥à¤°. शनि.".split(" "),weekdaysMin:"आइ. सो. मङॠबà¥. बि. शà¥. श.".split(" "),
|
||||||
|
longDateFormat:{LT:"Aको h:mm बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, LT",LLLL:"dddd, D MMMM YYYY, LT"},preparse:function(a){return a.replace(/[१२३४५६à¥à¥®à¥¯à¥¦]/g,function(a){return d[a]})},postformat:function(a){return a.replace(/\d/g,function(a){return b[a]})},meridiem:function(a){return 3>a?"राती":10>a?"बिहान":15>a?"दिउà¤à¤¸à¥‹":18>a?"बेलà¥à¤•à¤¾":20>a?"साà¤à¤":"राती"},calendar:{sameDay:"[आज] LT",nextDay:"[à¤à¥‹à¤²à¥€] LT",
|
||||||
|
nextWeek:"[आउà¤à¤¦à¥‹] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गà¤à¤•à¥‹] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडी",s:"केही समय",m:"à¤à¤• मिनेट",mm:"%d मिनेट",h:"à¤à¤• घणà¥à¤Ÿà¤¾",hh:"%d घणà¥à¤Ÿà¤¾",d:"à¤à¤• दिन",dd:"%d दिन",M:"à¤à¤• महिना",MM:"%d महिना",y:"à¤à¤• बरà¥à¤·",yy:"%d बरà¥à¤·"},week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){var b=
|
||||||
|
"jan. feb. mrt. apr. mei jun. jul. aug. sep. okt. nov. dec.".split(" "),d="jan feb mrt apr mei jun jul aug sep okt nov dec".split(" ");a.lang("nl",{months:"januari februari maart april mei juni juli augustus september oktober november december".split(" "),monthsShort:function(a,e){return/-MMM-/.test(e)?d[a.month()]:b[a.month()]},weekdays:"zondag maandag dinsdag woensdag donderdag vrijdag zaterdag".split(" "),weekdaysShort:"zo. ma. di. wo. do. vr. za.".split(" "),weekdaysMin:"Zo Ma Di Wo Do Vr Za".split(" "),
|
||||||
|
longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Vandaag om] LT",nextDay:"[Morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinal:function(a){return a+
|
||||||
|
(1===a||8===a||20<=a?"ste":"de")},week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("nn",{months:"januar februar mars april mai juni juli august september oktober november desember".split(" "),monthsShort:"jan feb mar apr mai jun jul aug sep okt nov des".split(" "),weekdays:"sundag måndag tysdag onsdag torsdag fredag laurdag".split(" "),weekdaysShort:"sun mån tys ons tor fre lau".split(" "),weekdaysMin:"su må ty on to fr lø".split(" "),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",
|
||||||
|
LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregående] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"for %s siden",s:"noen sekund",m:"ett minutt",mm:"%d minutt",h:"en time",hh:"%d timar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinal:"%d.",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){function b(a){return 5>
|
||||||
|
a%10&&1<a%10&&1!==~~(a/10)}function d(a,e,g){var f=a+" ";switch(g){case "m":return e?"minuta":"minutę";case "mm":return f+(b(a)?"minuty":"minut");case "h":return e?"godzina":"godzinę";case "hh":return f+(b(a)?"godziny":"godzin");case "MM":return f+(b(a)?"miesiące":"miesięcy");case "yy":return f+(b(a)?"lata":"lat")}}var e="styczeń luty marzec kwiecień maj czerwiec lipiec sierpień wrzesień październik listopad grudzień".split(" "),f="stycznia lutego marca kwietnia maja czerwca lipca sierpnia września października listopada grudnia".split(" ");
|
||||||
|
a.lang("pl",{months:function(a,b){return/D MMMM/.test(b)?f[a.month()]:e[a.month()]},monthsShort:"sty lut mar kwi maj cze lip sie wrz paź lis gru".split(" "),weekdays:"niedziela poniedziałek wtorek środa czwartek piątek sobota".split(" "),weekdaysShort:"nie pon wt śr czw pt sb".split(" "),weekdaysMin:"N Pn Wt Śr Cz Pt So".split(" "),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",
|
||||||
|
nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:d,mm:d,h:d,hh:d,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:d,y:"rok",yy:d},ordinal:"%d.",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("pt-br",{months:"Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro".split(" "),
|
||||||
|
monthsShort:"Jan Fev Mar Abr Mai Jun Jul Ago Set Out Nov Dez".split(" "),weekdays:"Domingo Segunda-feira Terça-feira Quarta-feira Quinta-feira Sexta-feira Sábado".split(" "),weekdaysShort:"Dom Seg Ter Qua Qui Sex Sáb".split(" "),weekdaysMin:"Dom 2ª 3ª 4ª 5ª 6ª Sáb".split(" "),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY LT",LLLL:"dddd, D [de] MMMM [de] YYYY LT"},calendar:{sameDay:"[Hoje à s] LT",nextDay:"[Amanhã à s] LT",nextWeek:"dddd [à s] LT",
|
||||||
|
lastDay:"[Ontem à s] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [à s] LT":"[Última] dddd [à s] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:"%dº"})});(function(a){a(i)})(function(a){a.lang("pt",{months:"Janeiro Fevereiro Março Abril Maio Junho Julho Agosto Setembro Outubro Novembro Dezembro".split(" "),
|
||||||
|
monthsShort:"Jan Fev Mar Abr Mai Jun Jul Ago Set Out Nov Dez".split(" "),weekdays:"Domingo Segunda-feira Terça-feira Quarta-feira Quinta-feira Sexta-feira Sábado".split(" "),weekdaysShort:"Dom Seg Ter Qua Qui Sex Sáb".split(" "),weekdaysMin:"Dom 2ª 3ª 4ª 5ª 6ª Sáb".split(" "),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY LT",LLLL:"dddd, D [de] MMMM [de] YYYY LT"},calendar:{sameDay:"[Hoje à s] LT",nextDay:"[Amanhã à s] LT",nextWeek:"dddd [à s] LT",
|
||||||
|
lastDay:"[Ontem à s] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [à s] LT":"[Última] dddd [à s] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinal:"%dº",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("ro",{months:"Ianuarie Februarie Martie Aprilie Mai Iunie Iulie August Septembrie Octombrie Noiembrie Decembrie".split(" "),
|
||||||
|
monthsShort:"Ian Feb Mar Apr Mai Iun Iul Aug Sep Oct Noi Dec".split(" "),weekdays:"Duminică Luni Marţi Miercuri Joi Vineri Sâmbătă".split(" "),weekdaysShort:"Dum Lun Mar Mie Joi Vin Sâm".split(" "),weekdaysMin:"Du Lu Ma Mi Jo Vi Sâ".split(" "),longDateFormat:{LT:"H:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},
|
||||||
|
relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",m:"un minut",mm:"%d minute",h:"o oră",hh:"%d ore",d:"o zi",dd:"%d zile",M:"o lună",MM:"%d luni",y:"un an",yy:"%d ani"},week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){function b(a,c,d){if("m"===d)return c?"минута":"минуту";c=a+" ";a=+a;d={mm:"минута_минуты_минут",hh:"чаÑ_чаÑа_чаÑов",dd:"день_днÑ_дней",MM:"меÑÑц_меÑÑца_меÑÑцев",yy:"год_года_лет"}[d].split("_");
|
||||||
|
return c+(1===a%10&&11!==a%100?d[0]:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?d[1]:d[2])}a.lang("ru",{months:function(a,b){return{nominative:"Ñнварь февраль март апрель май июнь июль авгуÑÑ‚ ÑентÑбрь октÑбрь ноÑбрь декабрь".split(" "),accusative:"ÑÐ½Ð²Ð°Ñ€Ñ Ñ„ÐµÐ²Ñ€Ð°Ð»Ñ Ð¼Ð°Ñ€Ñ‚Ð° Ð°Ð¿Ñ€ÐµÐ»Ñ Ð¼Ð°Ñ Ð¸ÑŽÐ½Ñ Ð¸ÑŽÐ»Ñ Ð°Ð²Ð³ÑƒÑта ÑентÑÐ±Ñ€Ñ Ð¾ÐºÑ‚ÑÐ±Ñ€Ñ Ð½Ð¾ÑÐ±Ñ€Ñ Ð´ÐµÐºÐ°Ð±Ñ€Ñ".split(" ")}[/D[oD]? *MMMM?/.test(b)?
|
||||||
|
"accusative":"nominative"][a.month()]},monthsShort:function(a,b){return{nominative:"Ñнв фев мар апр май июнь июль авг Ñен окт Ð½Ð¾Ñ Ð´ÐµÐº".split(" "),accusative:"Ñнв фев мар апр Ð¼Ð°Ñ Ð¸ÑŽÐ½Ñ Ð¸ÑŽÐ»Ñ Ð°Ð²Ð³ Ñен окт Ð½Ð¾Ñ Ð´ÐµÐº".split(" ")}[/D[oD]? *MMMM?/.test(b)?"accusative":"nominative"][a.month()]},weekdays:function(a,b){return{nominative:"воÑкреÑенье понедельник вторник Ñреда четверг пÑтница Ñуббота".split(" "),
|
||||||
|
accusative:"воÑкреÑенье понедельник вторник Ñреду четверг пÑтницу Ñубботу".split(" ")}[/\[ ?[Вв] ?(?:прошлую|Ñледующую)? ?\] ?dddd/.test(b)?"accusative":"nominative"][a.day()]},weekdaysShort:"вÑк пнд втр Ñрд чтв птн Ñбт".split(" "),weekdaysMin:"Ð²Ñ Ð¿Ð½ вт ÑÑ€ чт пт Ñб".split(" "),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., LT",LLLL:"dddd, D MMMM YYYY г., LT"},
|
||||||
|
calendar:{sameDay:"[Ð¡ÐµÐ³Ð¾Ð´Ð½Ñ Ð²] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(){return 2===this.day()?"[Во] dddd [в] LT":"[Ð’] dddd [в] LT"},lastWeek:function(){switch(this.day()){case 0:return"[Ð’ прошлое] dddd [в] LT";case 1:case 2:case 4:return"[Ð’ прошлый] dddd [в] LT";case 3:case 5:case 6:return"[Ð’ прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"неÑколько Ñекунд",
|
||||||
|
m:b,mm:b,h:"чаÑ",hh:b,d:"день",dd:b,M:"меÑÑц",MM:b,y:"год",yy:b},ordinal:function(a,b){switch(b){case "M":case "d":case "DDD":return a+"-й";case "D":return a+"-го";case "w":case "W":return a+"-Ñ";default:return a}},week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){function b(a,c,d,e){var f=a+" ";switch(d){case "s":return c||e?"pár sekúnd":"pár sekundami";case "m":return c?"minúta":e?"minútu":"minútou";case "mm":return c||e?f+(1<a&&5>a?"minúty":"minút"):f+"minútami";
|
||||||
|
case "h":return c?"hodina":e?"hodinu":"hodinou";case "hh":return c||e?f+(1<a&&5>a?"hodiny":"hodÃn"):f+"hodinami";case "d":return c||e?"deň":"dňom";case "dd":return c||e?f+(1<a&&5>a?"dni":"dnÃ"):f+"dňami";case "M":return c||e?"mesiac":"mesiacom";case "MM":return c||e?f+(1<a&&5>a?"mesiace":"mesiacov"):f+"mesiacmi";case "y":return c||e?"rok":"rokom";case "yy":return c||e?f+(1<a&&5>a?"roky":"rokov"):f+"rokmi"}}var d="január február marec aprÃl máj jún júl august september október november december".split(" "),
|
||||||
|
e="jan feb mar apr máj jún júl aug sep okt nov dec".split(" ");a.lang("sk",{months:d,monthsShort:e,monthsParse:function(a,b){var c,d=[];for(c=0;12>c;c++)d[c]=RegExp("^"+a[c]+"$|^"+b[c]+"$","i");return d}(d,e),weekdays:"nedeľa pondelok utorok streda štvrtok piatok sobota".split(" "),weekdaysShort:"ne po ut st št pi so".split(" "),weekdaysMin:"ne po ut st št pi so".split(" "),longDateFormat:{LT:"H:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd D. MMMM YYYY LT"},calendar:{sameDay:"[dnes o] LT",
|
||||||
|
nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo Å¡tvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[vÄera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},
|
||||||
|
sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:b,m:b,mm:b,h:b,hh:b,d:b,dd:b,M:b,MM:b,y:b,yy:b},ordinal:"%d.",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){function b(a,c,d){var e=a+" ";switch(d){case "m":return c?"ena minuta":"eno minuto";case "mm":return 1===a?e+"minuta":2===a?e+"minuti":3===a||4===a?e+"minute":e+"minut";case "h":return c?"ena ura":"eno uro";case "hh":return 1===a?e+"ura":2===a?e+"uri":3===a||4===a?e+"ure":e+"ur";case "dd":return 1===a?e+"dan":e+"dni";case "MM":return 1===
|
||||||
|
a?e+"mesec":2===a?e+"meseca":3===a||4===a?e+"mesece":e+"mesecev";case "yy":return 1===a?e+"leto":2===a?e+"leti":3===a||4===a?e+"leta":e+"let"}}a.lang("sl",{months:"januar februar marec april maj junij julij avgust september oktober november december".split(" "),monthsShort:"jan. feb. mar. apr. maj. jun. jul. avg. sep. okt. nov. dec.".split(" "),weekdays:"nedelja ponedeljek torek sreda Äetrtek petek sobota".split(" "),weekdaysShort:"ned. pon. tor. sre. Äet. pet. sob.".split(" "),weekdaysMin:"ne po to sr Äe pe so".split(" "),
|
||||||
|
longDateFormat:{LT:"H:mm",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY LT",LLLL:"dddd, D. MMMM YYYY LT"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[vÄeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[prejÅ¡nja] dddd [ob] LT";case 1:case 2:case 4:case 5:return"[prejÅ¡nji] dddd [ob] LT"}},
|
||||||
|
sameElse:"L"},relativeTime:{future:"Äez %s",past:"%s nazaj",s:"nekaj sekund",m:b,mm:b,h:b,hh:b,d:"en dan",dd:b,M:"en mesec",MM:b,y:"eno leto",yy:b},ordinal:"%d.",week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){a.lang("sq",{months:"Janar Shkurt Mars Prill Maj Qershor Korrik Gusht Shtator Tetor Nëntor Dhjetor".split(" "),monthsShort:"Jan Shk Mar Pri Maj Qer Kor Gus Sht Tet Nën Dhj".split(" "),weekdays:"E Diel;E Hënë;E Marte;E Mërkure;E Enjte;E Premte;E Shtunë".split(";"),weekdaysShort:"Die Hën Mar Mër Enj Pre Sht".split(" "),
|
||||||
|
weekdaysMin:"D H Ma Më E P Sh".split(" "),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Neser në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s me parë",s:"disa seconda",m:"një minut",mm:"%d minutea",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},
|
||||||
|
ordinal:"%d.",week:{dow:1,doy:4}})});(function(a){a(i)})(function(a){a.lang("sv",{months:"januari februari mars april maj juni juli augusti september oktober november december".split(" "),monthsShort:"jan feb mar apr maj jun jul aug sep okt nov dec".split(" "),weekdays:"söndag måndag tisdag onsdag torsdag fredag lördag".split(" "),weekdaysShort:"sön mån tis ons tor fre lör".split(" "),weekdaysMin:"sö må ti on to fr lö".split(" "),longDateFormat:{LT:"HH:mm",L:"YYYY-MM-DD",LL:"D MMMM YYYY",
|
||||||
|
LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"dddd LT",lastWeek:"[Förra] dddd[en] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinal:function(a){var b=a%10;return a+(1===~~(a%100/10)?"e":1===b?"a":2===b?"a":"e")},week:{dow:1,doy:4}})});
|
||||||
|
(function(a){a(i)})(function(a){a.lang("th",{months:"มà¸à¸£à¸²à¸„ม;à¸à¸¸à¸¡à¸ าพันธ์;มีนาคม;เมษายน;พฤษภาคม;มิถุนายน;à¸à¸£à¸à¸Žà¸²à¸„ม;สิงหาคม;à¸à¸±à¸™à¸¢à¸²à¸¢à¸™;ตุลาคม;พฤศจิà¸à¸²à¸¢à¸™;ธันวาคม".split(";"),monthsShort:"มà¸à¸£à¸²;à¸à¸¸à¸¡à¸ า;มีนา;เมษา;พฤษภา;มิถุนา;à¸à¸£à¸à¸Žà¸²;สิงหา;à¸à¸±à¸™à¸¢à¸²;ตุลา;พฤศจิà¸à¸²;ธันวา".split(";"),
|
||||||
|
weekdays:"à¸à¸²à¸—ิตย์ จันทร์ à¸à¸±à¸‡à¸„าร พุธ พฤหัสบดี ศุà¸à¸£à¹Œ เสาร์".split(" "),weekdaysShort:"à¸à¸²à¸—ิตย์ จันทร์ à¸à¸±à¸‡à¸„าร พุธ พฤหัส ศุà¸à¸£à¹Œ เสาร์".split(" "),weekdaysMin:"à¸à¸². จ. à¸. พ. พฤ. ศ. ส.".split(" "),longDateFormat:{LT:"H นาฬิà¸à¸² m นาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา LT",LLLL:"วันddddที่ D MMMM YYYY เวลา LT"},
|
||||||
|
meridiem:function(a){return 12>a?"à¸à¹ˆà¸à¸™à¹€à¸—ี่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่à¸à¸§à¸²à¸™à¸™à¸µà¹‰ เวลา] LT",lastWeek:"[วัน]dddd[ที่à¹à¸¥à¹‰à¸§ เวลา] LT",sameElse:"L"},relativeTime:{future:"à¸à¸µà¸ %s",past:"%sที่à¹à¸¥à¹‰à¸§",s:"ไม่à¸à¸µà¹ˆà¸§à¸´à¸™à¸²à¸—ี",
|
||||||
|
m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดืà¸à¸™",MM:"%d เดืà¸à¸™",y:"1 ปี",yy:"%d ปี"}})});(function(a){a(i)})(function(a){var b={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};a.lang("tr",{months:"Ocak Åžubat Mart Nisan Mayıs Haziran Temmuz AÄŸustos Eylül Ekim Kasım Aralık".split(" "),
|
||||||
|
monthsShort:"Oca Şub Mar Nis May Haz Tem Ağu Eyl Eki Kas Ara".split(" "),weekdays:"Pazar Pazartesi Salı Çarşamba Perşembe Cuma Cumartesi".split(" "),weekdaysShort:"Paz Pts Sal Çar Per Cum Cts".split(" "),weekdaysMin:"Pz Pt Sa Ça Pe Cu Ct".split(" "),longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd, D MMMM YYYY LT"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",
|
||||||
|
sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(a){if(0===a)return a+"'ıncı";var d=a%10;return a+(b[d]||b[a%100-d]||b[100<=a?100:null])},week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){a.lang("tzm-la",{months:"innayr brˤayrˤ marˤsˤ ibrir mayyw ywnyw ywlywz ɣwšt šwtanbir ktˤwbrˤ nwwanbir dwjnbir".split(" "),
|
||||||
|
monthsShort:"innayr brˤayrˤ marˤsˤ ibrir mayyw ywnyw ywlywz É£wÅ¡t Å¡wtanbir ktˤwbrˤ nwwanbir dwjnbir".split(" "),weekdays:"asamas aynas asinas akras akwas asimwas asiá¸yas".split(" "),weekdaysShort:"asamas aynas asinas akras akwas asimwas asiá¸yas".split(" "),weekdaysMin:"asamas aynas asinas akras akwas asimwas asiá¸yas".split(" "),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",
|
||||||
|
nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuá¸",mm:"%d minuá¸",h:"saÉ›a",hh:"%d tassaÉ›in",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})});(function(a){a(i)})(function(a){a.lang("tzm",{months:"ⵉâµâµâ´°âµ¢âµ” ⴱⵕⴰⵢⵕ ⵎⴰⵕⵚ ⵉⴱⵔⵉⵔ ⵎⴰⵢⵢⵓ ⵢⵓâµâµ¢âµ“ ⵢⵓâµâµ¢âµ“âµ£ ⵖⵓⵛⵜ ⵛⵓⵜⴰâµâ´±âµ‰âµ” ⴽⵟⵓⴱⵕ âµâµ“ⵡⴰâµâ´±âµ‰âµ” ⴷⵓⵊâµâ´±âµ‰âµ”".split(" "),
|
||||||
|
monthsShort:"ⵉâµâµâ´°âµ¢âµ” ⴱⵕⴰⵢⵕ ⵎⴰⵕⵚ ⵉⴱⵔⵉⵔ ⵎⴰⵢⵢⵓ ⵢⵓâµâµ¢âµ“ ⵢⵓâµâµ¢âµ“âµ£ ⵖⵓⵛⵜ ⵛⵓⵜⴰâµâ´±âµ‰âµ” ⴽⵟⵓⴱⵕ âµâµ“ⵡⴰâµâ´±âµ‰âµ” ⴷⵓⵊâµâ´±âµ‰âµ”".split(" "),weekdays:"ⴰⵙⴰⵎⴰⵙ â´°âµ¢âµâ´°âµ™ ⴰⵙⵉâµâ´°âµ™ ⴰⴽⵔⴰⵙ ⴰⴽⵡⴰⵙ ⴰⵙⵉⵎⵡⴰⵙ ⴰⵙⵉⴹⵢⴰⵙ".split(" "),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ â´°âµ¢âµâ´°âµ™ ⴰⵙⵉâµâ´°âµ™ ⴰⴽⵔⴰⵙ ⴰⴽⵡⴰⵙ ⴰⵙⵉⵎⵡⴰⵙ ⴰⵙⵉⴹⵢⴰⵙ".split(" "),
|
||||||
|
weekdaysMin:"ⴰⵙⴰⵎⴰⵙ â´°âµ¢âµâ´°âµ™ ⴰⵙⵉâµâ´°âµ™ ⴰⴽⵔⴰⵙ ⴰⴽⵡⴰⵙ ⴰⵙⵉⵎⵡⴰⵙ ⴰⵙⵉⴹⵢⴰⵙ".split(" "),longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[ⴰⵙⴷⵅ â´´] LT",nextDay:"[ⴰⵙⴽⴰ â´´] LT",nextWeek:"dddd [â´´] LT",lastDay:"[ⴰⵚⴰâµâµœ â´´] LT",lastWeek:"dddd [â´´] LT",sameElse:"L"},relativeTime:{future:"â´·â´°â´·âµ… âµ™ ⵢⴰⵠ%s",past:"ⵢⴰⵠ%s",
|
||||||
|
s:"ⵉⵎⵉⴽ",m:"ⵎⵉâµâµ“â´º",mm:"%d ⵎⵉâµâµ“â´º",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉâµ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰâµ",M:"â´°âµ¢oⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔâµ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙâµ"},week:{dow:6,doy:12}})});(function(a){a(i)})(function(a){function b(a,c,d){if("m"===d)return c?"хвилина":"хвилину";if("h"===d)return c?"година":"годину";c=a+" ";a=+a;d={mm:"хвилина_хвилини_хвилин",hh:"година_години_годин",
|
||||||
|
dd:"день_дні_днів",MM:"міÑÑць_міÑÑці_міÑÑців",yy:"рік_роки_років"}[d].split("_");return c+(1===a%10&&11!==a%100?d[0]:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?d[1]:d[2])}function d(a){return function(){return a+"о"+(11===this.hours()?"б":"")+"] LT"}}a.lang("uk",{months:function(a,b){return{nominative:"Ñічень лютий березень квітень травень червень липень Ñерпень вереÑень жовтень лиÑтопад грудень".split(" "),
|
||||||
|
accusative:"ÑÑ–Ñ‡Ð½Ñ Ð»ÑŽÑ‚Ð¾Ð³Ð¾ Ð±ÐµÑ€ÐµÐ·Ð½Ñ ÐºÐ²Ñ–Ñ‚Ð½Ñ Ñ‚Ñ€Ð°Ð²Ð½Ñ Ñ‡ÐµÑ€Ð²Ð½Ñ Ð»Ð¸Ð¿Ð½Ñ ÑÐµÑ€Ð¿Ð½Ñ Ð²ÐµÑ€ÐµÑÐ½Ñ Ð¶Ð¾Ð²Ñ‚Ð½Ñ Ð»Ð¸Ñтопада груднÑ".split(" ")}[/D[oD]? *MMMM?/.test(b)?"accusative":"nominative"][a.month()]},monthsShort:"Ñіч лют бер квіт трав черв лип Ñерп вер жовт лиÑÑ‚ груд".split(" "),weekdays:function(a,b){return{nominative:"Ð½ÐµÐ´Ñ–Ð»Ñ Ð¿Ð¾Ð½ÐµÐ´Ñ–Ð»Ð¾Ðº вівторок Ñереда четвер п’ÑÑ‚Ð½Ð¸Ñ†Ñ Ñубота".split(" "),
|
||||||
|
accusative:"неділю понеділок вівторок Ñереду четвер п’Ñтницю Ñуботу".split(" "),genitive:"неділі понеділка вівторка Ñереди четверга п’Ñтниці Ñуботи".split(" ")}[/(\[[ВвУу]\]) ?dddd/.test(b)?"accusative":/\[?(?:минулої|наÑтупної)? ?\] ?dddd/.test(b)?"genitive":"nominative"][a.day()]},weekdaysShort:"нед пон вів Ñер чет п’ÑÑ‚ Ñуб".split(" "),weekdaysMin:"нд пн вт ÑÑ€ чт пт Ñб".split(" "),
|
||||||
|
longDateFormat:{LT:"HH:mm",L:"DD.MM.YYYY",LL:"D MMMM YYYY Ñ€.",LLL:"D MMMM YYYY Ñ€., LT",LLLL:"dddd, D MMMM YYYY Ñ€., LT"},calendar:{sameDay:d("[Сьогодні "),nextDay:d("[Завтра "),lastDay:d("[Вчора "),nextWeek:d("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return d("[Минулої] dddd [").call(this);case 1:case 2:case 4:return d("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька Ñекунд",
|
||||||
|
m:b,mm:b,h:"годину",hh:b,d:"день",dd:b,M:"міÑÑць",MM:b,y:"рік",yy:b},ordinal:function(a,b){switch(b){case "M":case "d":case "DDD":case "w":case "W":return a+"-й";case "D":return a+"-го";default:return a}},week:{dow:1,doy:7}})});(function(a){a(i)})(function(a){a.lang("zh-cn",{months:"一月 二月 三月 四月 五月 å…月 七月 八月 ä¹æœˆ å月 å一月 å二月".split(" "),monthsShort:"1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月".split(" "),weekdays:"星期日 星期一 星期二 星期三 星期四 星期五 星期å…".split(" "),
|
||||||
|
weekdaysShort:"周日 周一 周二 周三 周四 周五 周å…".split(" "),weekdaysMin:"æ—¥ 一 二 三 å›› 五 å…".split(" "),longDateFormat:{LT:"Ah点mm",L:"YYYYå¹´MMMDæ—¥",LL:"YYYYå¹´MMMDæ—¥",LLL:"YYYYå¹´MMMDæ—¥LT",LLLL:"YYYYå¹´MMMDæ—¥ddddLT",l:"YYYYå¹´MMMDæ—¥",ll:"YYYYå¹´MMMDæ—¥",lll:"YYYYå¹´MMMDæ—¥LT",llll:"YYYYå¹´MMMDæ—¥ddddLT"},meridiem:function(a,b){return 9>a?"早上":11>a&&30>b?"上åˆ":13>a&&30>b?"ä¸åˆ":18>a?"下åˆ":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",
|
||||||
|
lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinal:function(a,b){switch(b){case "d":case "D":case "DDD":return a+"æ—¥";case "M":return a+"月";case "w":case "W":return a+"周";default:return a}},relativeTime:{future:"%s内",past:"%så‰",s:"å‡ ç§’",m:"1分钟",mm:"%d分钟",h:"1å°æ—¶",hh:"%då°æ—¶",d:"1天",dd:"%d天",M:"1个月",MM:"%d个月",y:"1å¹´",yy:"%då¹´"}})});(function(a){a(i)})(function(a){a.lang("zh-tw",{months:"一月 二月 三月 四月 五月 å…月 七月 八月 ä¹æœˆ å月 å一月 å二月".split(" "),
|
||||||
|
monthsShort:"1月 2月 3月 4月 5月 6月 7月 8月 9月 10月 11月 12月".split(" "),weekdays:"星期日 星期一 星期二 星期三 星期四 星期五 星期å…".split(" "),weekdaysShort:"週日 週一 週二 週三 週四 週五 週å…".split(" "),weekdaysMin:"æ—¥ 一 二 三 å›› 五 å…".split(" "),longDateFormat:{LT:"Ah點mm",L:"YYYYå¹´MMMDæ—¥",LL:"YYYYå¹´MMMDæ—¥",LLL:"YYYYå¹´MMMDæ—¥LT",LLLL:"YYYYå¹´MMMDæ—¥ddddLT",l:"YYYYå¹´MMMDæ—¥",ll:"YYYYå¹´MMMDæ—¥",lll:"YYYYå¹´MMMDæ—¥LT",llll:"YYYYå¹´MMMDæ—¥ddddLT"},
|
||||||
|
meridiem:function(a,b){return 9>a?"早上":11>a&&30>b?"上åˆ":13>a&&30>b?"ä¸åˆ":18>a?"下åˆ":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinal:function(a,b){switch(b){case "d":case "D":case "DDD":return a+"æ—¥";case "M":return a+"月";case "w":case "W":return a+"週";default:return a}},relativeTime:{future:"%så…§",past:"%så‰",s:"幾秒",m:"一分é˜",mm:"%d分é˜",h:"一å°æ™‚",hh:"%då°æ™‚",d:"一天",
|
||||||
|
dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}})});i.lang("en");N&&(module.exports=i);"undefined"===typeof ender&&(this.moment=i);"function"===typeof define&&define.amd&&define("moment",[],function(){return i})}).call(this);
|
||||||
|
var LZString={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_f:String.fromCharCode,compressToBase64:function(e){if(null==e)return"";for(var b="",d,h,f,r,l,p,j=0,e=this.compress(e);j<2*e.length;)0==j%2?(d=e.charCodeAt(j/2)>>8,h=e.charCodeAt(j/2)&255,f=j/2+1<e.length?e.charCodeAt(j/2+1)>>8:NaN):(d=e.charCodeAt((j-1)/2)&255,(j+1)/2<e.length?(h=e.charCodeAt((j+1)/2)>>8,f=e.charCodeAt((j+1)/2)&255):h=f=NaN),j+=3,r=d>>2,d=(d&3)<<4|h>>4,l=(h&15)<<2|f>>6,p=f&63,isNaN(h)?l=p=
|
||||||
|
64:isNaN(f)&&(p=64),b=b+this._keyStr.charAt(r)+this._keyStr.charAt(d)+this._keyStr.charAt(l)+this._keyStr.charAt(p);return b},decompressFromBase64:function(e){if(null==e)return"";for(var b="",d=0,h,f,r,l,p,j,s=0,o=this._f,e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");s<e.length;)f=this._keyStr.indexOf(e.charAt(s++)),r=this._keyStr.indexOf(e.charAt(s++)),p=this._keyStr.indexOf(e.charAt(s++)),j=this._keyStr.indexOf(e.charAt(s++)),f=f<<2|r>>4,r=(r&15)<<4|p>>2,l=(p&3)<<6|j,0==d%2?(h=f<<8,64!=p&&(b+=o(h|r)),64!=
|
||||||
|
j&&(h=l<<8)):(b+=o(h|f),64!=p&&(h=r<<8),64!=j&&(b+=o(h|l))),d+=3;return this.decompress(b)},compressToUTF16:function(e){if(null==e)return"";var b="",d,h,f,r=0,l=this._f,e=this.compress(e);for(d=0;d<e.length;d++)switch(h=e.charCodeAt(d),r++){case 0:b+=l((h>>1)+32);f=(h&1)<<14;break;case 1:b+=l(f+(h>>2)+32);f=(h&3)<<13;break;case 2:b+=l(f+(h>>3)+32);f=(h&7)<<12;break;case 3:b+=l(f+(h>>4)+32);f=(h&15)<<11;break;case 4:b+=l(f+(h>>5)+32);f=(h&31)<<10;break;case 5:b+=l(f+(h>>6)+32);f=(h&63)<<9;break;case 6:b+=
|
||||||
|
l(f+(h>>7)+32);f=(h&127)<<8;break;case 7:b+=l(f+(h>>8)+32);f=(h&255)<<7;break;case 8:b+=l(f+(h>>9)+32);f=(h&511)<<6;break;case 9:b+=l(f+(h>>10)+32);f=(h&1023)<<5;break;case 10:b+=l(f+(h>>11)+32);f=(h&2047)<<4;break;case 11:b+=l(f+(h>>12)+32);f=(h&4095)<<3;break;case 12:b+=l(f+(h>>13)+32);f=(h&8191)<<2;break;case 13:b+=l(f+(h>>14)+32);f=(h&16383)<<1;break;case 14:b+=l(f+(h>>15)+32,(h&32767)+32),r=0}return b+l(f+32)},decompressFromUTF16:function(e){if(null==e)return"";for(var b="",d,h,f=0,r=0,l=this._f;r<
|
||||||
|
e.length;){h=e.charCodeAt(r)-32;switch(f++){case 0:d=h<<1;break;case 1:b+=l(d|h>>14);d=(h&16383)<<2;break;case 2:b+=l(d|h>>13);d=(h&8191)<<3;break;case 3:b+=l(d|h>>12);d=(h&4095)<<4;break;case 4:b+=l(d|h>>11);d=(h&2047)<<5;break;case 5:b+=l(d|h>>10);d=(h&1023)<<6;break;case 6:b+=l(d|h>>9);d=(h&511)<<7;break;case 7:b+=l(d|h>>8);d=(h&255)<<8;break;case 8:b+=l(d|h>>7);d=(h&127)<<9;break;case 9:b+=l(d|h>>6);d=(h&63)<<10;break;case 10:b+=l(d|h>>5);d=(h&31)<<11;break;case 11:b+=l(d|h>>4);d=(h&15)<<12;break;
|
||||||
|
case 12:b+=l(d|h>>3);d=(h&7)<<13;break;case 13:b+=l(d|h>>2);d=(h&3)<<14;break;case 14:b+=l(d|h>>1);d=(h&1)<<15;break;case 15:b+=l(d|h),f=0}r++}return this.decompress(b)},compress:function(e){if(null==e)return"";var b,d,h={},f={},r="",l="",p="",j=2,s=3,o=2,q="",n=0,m=0,t,u=this._f;for(t=0;t<e.length;t+=1)if(r=e.charAt(t),Object.prototype.hasOwnProperty.call(h,r)||(h[r]=s++,f[r]=!0),l=p+r,Object.prototype.hasOwnProperty.call(h,l))p=l;else{if(Object.prototype.hasOwnProperty.call(f,p)){if(256>p.charCodeAt(0)){for(b=
|
||||||
|
0;b<o;b++)n<<=1,15==m?(m=0,q+=u(n),n=0):m++;d=p.charCodeAt(0);for(b=0;8>b;b++)n=n<<1|d&1,15==m?(m=0,q+=u(n),n=0):m++,d>>=1}else{d=1;for(b=0;b<o;b++)n=n<<1|d,15==m?(m=0,q+=u(n),n=0):m++,d=0;d=p.charCodeAt(0);for(b=0;16>b;b++)n=n<<1|d&1,15==m?(m=0,q+=u(n),n=0):m++,d>>=1}j--;0==j&&(j=Math.pow(2,o),o++);delete f[p]}else{d=h[p];for(b=0;b<o;b++)n=n<<1|d&1,15==m?(m=0,q+=u(n),n=0):m++,d>>=1}j--;0==j&&(j=Math.pow(2,o),o++);h[l]=s++;p=""+r}if(""!==p){if(Object.prototype.hasOwnProperty.call(f,p)){if(256>p.charCodeAt(0)){for(b=
|
||||||
|
0;b<o;b++)n<<=1,15==m?(m=0,q+=u(n),n=0):m++;d=p.charCodeAt(0);for(b=0;8>b;b++)n=n<<1|d&1,15==m?(m=0,q+=u(n),n=0):m++,d>>=1}else{d=1;for(b=0;b<o;b++)n=n<<1|d,15==m?(m=0,q+=u(n),n=0):m++,d=0;d=p.charCodeAt(0);for(b=0;16>b;b++)n=n<<1|d&1,15==m?(m=0,q+=u(n),n=0):m++,d>>=1}j--;0==j&&(j=Math.pow(2,o),o++);delete f[p]}else{d=h[p];for(b=0;b<o;b++)n=n<<1|d&1,15==m?(m=0,q+=u(n),n=0):m++,d>>=1}j--;0==j&&(Math.pow(2,o),o++)}d=2;for(b=0;b<o;b++)n=n<<1|d&1,15==m?(m=0,q+=u(n),n=0):m++,d>>=1;for(;;)if(n<<=1,15==
|
||||||
|
m){q+=u(n);break}else m++;return q},decompress:function(e){if(null==e)return"";for(var b=[],d=4,h=4,f=3,r="",l="",p,j,s,o,q,n=this._f,m=e.charCodeAt(0),t=32768,u=1,l=0;3>l;l+=1)b[l]=l;r=0;s=Math.pow(2,2);for(o=1;o!=s;)j=m&t,t>>=1,0==t&&(t=32768,m=e.charCodeAt(u++)),r|=(0<j?1:0)*o,o<<=1;switch(r){case 0:r=0;s=Math.pow(2,8);for(o=1;o!=s;)j=m&t,t>>=1,0==t&&(t=32768,m=e.charCodeAt(u++)),r|=(0<j?1:0)*o,o<<=1;q=n(r);break;case 1:r=0;s=Math.pow(2,16);for(o=1;o!=s;)j=m&t,t>>=1,0==t&&(t=32768,m=e.charCodeAt(u++)),
|
||||||
|
r|=(0<j?1:0)*o,o<<=1;q=n(r);break;case 2:return""}for(p=l=b[3]=q;;){r=0;s=Math.pow(2,f);for(o=1;o!=s;)j=m&t,t>>=1,0==t&&(t=32768,m=e.charCodeAt(u++)),r|=(0<j?1:0)*o,o<<=1;switch(q=r){case 0:r=0;s=Math.pow(2,8);for(o=1;o!=s;)j=m&t,t>>=1,0==t&&(t=32768,m=e.charCodeAt(u++)),r|=(0<j?1:0)*o,o<<=1;b[h++]=n(r);q=h-1;d--;break;case 1:r=0;s=Math.pow(2,16);for(o=1;o!=s;)j=m&t,t>>=1,0==t&&(t=32768,m=e.charCodeAt(u++)),r|=(0<j?1:0)*o,o<<=1;b[h++]=n(r);q=h-1;d--;break;case 2:return l}0==d&&(d=Math.pow(2,f),f++);
|
||||||
|
if(b[q])r=b[q];else if(q===h)r=p+p.charAt(0);else return null;l+=r;b[h++]=p+r.charAt(0);d--;p=r;0==d&&(d=Math.pow(2,f),f++)}}};
|
8
plugins/ckeditor/plugins/button/lang/en.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
|
||||||
|
CKEDITOR.plugins.setLang( 'button', 'en', {
|
||||||
|
selectedLabel: '%1 (Selected)'
|
||||||
|
} );
|
8
plugins/ckeditor/plugins/button/lang/hu.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
|
||||||
|
CKEDITOR.plugins.setLang( 'button', 'hu', {
|
||||||
|
selectedLabel: '%1 (Kiválasztva)'
|
||||||
|
} );
|
379
plugins/ckeditor/plugins/button/plugin.js
Normal file
@ -0,0 +1,379 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
|
||||||
|
( function() {
|
||||||
|
var template = '<a id="{id}"' +
|
||||||
|
' class="cke_button cke_button__{name} cke_button_{state} {cls}"' +
|
||||||
|
( CKEDITOR.env.gecko && CKEDITOR.env.version >= 10900 && !CKEDITOR.env.hc ? '' : ' href="javascript:void(\'{titleJs}\')"' ) +
|
||||||
|
' title="{title}"' +
|
||||||
|
' tabindex="-1"' +
|
||||||
|
' hidefocus="true"' +
|
||||||
|
' role="button"' +
|
||||||
|
' aria-labelledby="{id}_label"' +
|
||||||
|
' aria-haspopup="{hasArrow}"' +
|
||||||
|
' aria-disabled="{ariaDisabled}"';
|
||||||
|
|
||||||
|
// Some browsers don't cancel key events in the keydown but in the
|
||||||
|
// keypress.
|
||||||
|
// TODO: Check if really needed for Gecko+Mac.
|
||||||
|
if ( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.mac ) )
|
||||||
|
template += ' onkeypress="return false;"';
|
||||||
|
|
||||||
|
// With Firefox, we need to force the button to redraw, otherwise it
|
||||||
|
// will remain in the focus state.
|
||||||
|
if ( CKEDITOR.env.gecko )
|
||||||
|
template += ' onblur="this.style.cssText = this.style.cssText;"';
|
||||||
|
|
||||||
|
template += ' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event);"' +
|
||||||
|
' onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" ' +
|
||||||
|
' onmousedown="return CKEDITOR.tools.callFunction({mousedownFn},event);" ' +
|
||||||
|
( CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : 'onclick' ) + // #188
|
||||||
|
'="CKEDITOR.tools.callFunction({clickFn},this);return false;">' +
|
||||||
|
'<span class="cke_button_icon cke_button__{iconName}_icon" style="{style}"';
|
||||||
|
|
||||||
|
|
||||||
|
template += '> </span>' +
|
||||||
|
'<span id="{id}_label" class="cke_button_label cke_button__{name}_label" aria-hidden="false">{label}</span>' +
|
||||||
|
'{arrowHtml}' +
|
||||||
|
'</a>';
|
||||||
|
|
||||||
|
var templateArrow = '<span class="cke_button_arrow">' +
|
||||||
|
// BLACK DOWN-POINTING TRIANGLE
|
||||||
|
( CKEDITOR.env.hc ? '▼' : '' ) +
|
||||||
|
'</span>';
|
||||||
|
|
||||||
|
var btnArrowTpl = CKEDITOR.addTemplate( 'buttonArrow', templateArrow ),
|
||||||
|
btnTpl = CKEDITOR.addTemplate( 'button', template );
|
||||||
|
|
||||||
|
CKEDITOR.plugins.add( 'button', {
|
||||||
|
lang: 'ca,cs,el,en,en-gb,fa,fr,gl,hu,ja,km,nl,pl,pt,pt-br,ru,sl,sv,uk,zh-cn', // %REMOVE_LINE_CORE%
|
||||||
|
beforeInit: function( editor ) {
|
||||||
|
editor.ui.addHandler( CKEDITOR.UI_BUTTON, CKEDITOR.ui.button.handler );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Button UI element.
|
||||||
|
*
|
||||||
|
* @readonly
|
||||||
|
* @property {String} [='button']
|
||||||
|
* @member CKEDITOR
|
||||||
|
*/
|
||||||
|
CKEDITOR.UI_BUTTON = 'button';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a button UI element. This class should not be called directly. To
|
||||||
|
* create new buttons use {@link CKEDITOR.ui#addButton} instead.
|
||||||
|
*
|
||||||
|
* @class
|
||||||
|
* @constructor Creates a button class instance.
|
||||||
|
* @param {Object} definition The button definition.
|
||||||
|
*/
|
||||||
|
CKEDITOR.ui.button = function( definition ) {
|
||||||
|
CKEDITOR.tools.extend( this, definition,
|
||||||
|
// Set defaults.
|
||||||
|
{
|
||||||
|
title: definition.label,
|
||||||
|
click: definition.click ||
|
||||||
|
function( editor ) {
|
||||||
|
editor.execCommand( definition.command );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
this._ = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents button handler object.
|
||||||
|
*
|
||||||
|
* @class
|
||||||
|
* @singleton
|
||||||
|
* @extends CKEDITOR.ui.handlerDefinition
|
||||||
|
*/
|
||||||
|
CKEDITOR.ui.button.handler = {
|
||||||
|
/**
|
||||||
|
* Transforms a button definition in a {@link CKEDITOR.ui.button} instance.
|
||||||
|
*
|
||||||
|
* @member CKEDITOR.ui.button.handler
|
||||||
|
* @param {Object} definition
|
||||||
|
* @returns {CKEDITOR.ui.button}
|
||||||
|
*/
|
||||||
|
create: function( definition ) {
|
||||||
|
return new CKEDITOR.ui.button( definition );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** @class CKEDITOR.ui.button */
|
||||||
|
CKEDITOR.ui.button.prototype = {
|
||||||
|
/**
|
||||||
|
* Renders the button.
|
||||||
|
*
|
||||||
|
* @param {CKEDITOR.editor} editor The editor instance which this button is
|
||||||
|
* to be used by.
|
||||||
|
* @param {Array} output The output array to which append the HTML relative
|
||||||
|
* to this button.
|
||||||
|
*/
|
||||||
|
render: function( editor, output ) {
|
||||||
|
var env = CKEDITOR.env,
|
||||||
|
id = this._.id = CKEDITOR.tools.getNextId(),
|
||||||
|
stateName = '',
|
||||||
|
command = this.command,
|
||||||
|
// Get the command name.
|
||||||
|
clickFn;
|
||||||
|
|
||||||
|
this._.editor = editor;
|
||||||
|
|
||||||
|
var instance = {
|
||||||
|
id: id,
|
||||||
|
button: this,
|
||||||
|
editor: editor,
|
||||||
|
focus: function() {
|
||||||
|
var element = CKEDITOR.document.getById( id );
|
||||||
|
element.focus();
|
||||||
|
},
|
||||||
|
execute: function() {
|
||||||
|
this.button.click( editor );
|
||||||
|
},
|
||||||
|
attach: function( editor ) {
|
||||||
|
this.button.attach( editor );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var keydownFn = CKEDITOR.tools.addFunction( function( ev ) {
|
||||||
|
if ( instance.onkey ) {
|
||||||
|
ev = new CKEDITOR.dom.event( ev );
|
||||||
|
return ( instance.onkey( instance, ev.getKeystroke() ) !== false );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
var focusFn = CKEDITOR.tools.addFunction( function( ev ) {
|
||||||
|
var retVal;
|
||||||
|
|
||||||
|
if ( instance.onfocus )
|
||||||
|
retVal = ( instance.onfocus( instance, new CKEDITOR.dom.event( ev ) ) !== false );
|
||||||
|
|
||||||
|
// FF2: prevent focus event been bubbled up to editor container, which caused unexpected editor focus.
|
||||||
|
if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 )
|
||||||
|
ev.preventBubble();
|
||||||
|
return retVal;
|
||||||
|
} );
|
||||||
|
|
||||||
|
var selLocked = 0;
|
||||||
|
|
||||||
|
var mousedownFn = CKEDITOR.tools.addFunction( function() {
|
||||||
|
// Opera: lock to prevent loosing editable text selection when clicking on button.
|
||||||
|
if ( CKEDITOR.env.opera ) {
|
||||||
|
var edt = editor.editable();
|
||||||
|
if ( edt.isInline() && edt.hasFocus ) {
|
||||||
|
editor.lockSelection();
|
||||||
|
selLocked = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
instance.clickFn = clickFn = CKEDITOR.tools.addFunction( function() {
|
||||||
|
|
||||||
|
// Restore locked selection in Opera.
|
||||||
|
if ( selLocked ) {
|
||||||
|
editor.unlockSelection( 1 );
|
||||||
|
selLocked = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
instance.execute();
|
||||||
|
} );
|
||||||
|
|
||||||
|
|
||||||
|
// Indicate a mode sensitive button.
|
||||||
|
if ( this.modes ) {
|
||||||
|
var modeStates = {};
|
||||||
|
|
||||||
|
function updateState() {
|
||||||
|
// "this" is a CKEDITOR.ui.button instance.
|
||||||
|
|
||||||
|
var mode = editor.mode;
|
||||||
|
|
||||||
|
if ( mode ) {
|
||||||
|
// Restore saved button state.
|
||||||
|
var state = this.modes[ mode ] ? modeStates[ mode ] != undefined ? modeStates[ mode ] : CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
|
||||||
|
|
||||||
|
state = editor.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : state;
|
||||||
|
|
||||||
|
this.setState( state );
|
||||||
|
|
||||||
|
// Let plugin to disable button.
|
||||||
|
if ( this.refresh )
|
||||||
|
this.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
editor.on( 'beforeModeUnload', function() {
|
||||||
|
if ( editor.mode && this._.state != CKEDITOR.TRISTATE_DISABLED )
|
||||||
|
modeStates[ editor.mode ] = this._.state;
|
||||||
|
}, this );
|
||||||
|
|
||||||
|
// Update status when activeFilter, mode or readOnly changes.
|
||||||
|
editor.on( 'activeFilterChange', updateState, this );
|
||||||
|
editor.on( 'mode', updateState, this );
|
||||||
|
// If this button is sensitive to readOnly state, update it accordingly.
|
||||||
|
!this.readOnly && editor.on( 'readOnly', updateState, this );
|
||||||
|
|
||||||
|
} else if ( command ) {
|
||||||
|
// Get the command instance.
|
||||||
|
command = editor.getCommand( command );
|
||||||
|
|
||||||
|
if ( command ) {
|
||||||
|
command.on( 'state', function() {
|
||||||
|
this.setState( command.state );
|
||||||
|
}, this );
|
||||||
|
|
||||||
|
stateName += ( command.state == CKEDITOR.TRISTATE_ON ? 'on' : command.state == CKEDITOR.TRISTATE_DISABLED ? 'disabled' : 'off' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// For button that has text-direction awareness on selection path.
|
||||||
|
if ( this.directional ) {
|
||||||
|
editor.on( 'contentDirChanged', function( evt ) {
|
||||||
|
var el = CKEDITOR.document.getById( this._.id ),
|
||||||
|
icon = el.getFirst();
|
||||||
|
|
||||||
|
var pathDir = evt.data;
|
||||||
|
|
||||||
|
// Make a minor direction change to become style-able for the skin icon.
|
||||||
|
if ( pathDir != editor.lang.dir )
|
||||||
|
el.addClass( 'cke_' + pathDir );
|
||||||
|
else
|
||||||
|
el.removeClass( 'cke_ltr' ).removeClass( 'cke_rtl' );
|
||||||
|
|
||||||
|
// Inline style update for the plugin icon.
|
||||||
|
icon.setAttribute( 'style', CKEDITOR.skin.getIconStyle( iconName, pathDir == 'rtl', this.icon, this.iconOffset ) );
|
||||||
|
}, this );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !command )
|
||||||
|
stateName += 'off';
|
||||||
|
|
||||||
|
var name = this.name || this.command,
|
||||||
|
iconName = name;
|
||||||
|
|
||||||
|
// Check if we're pointing to an icon defined by another command. (#9555)
|
||||||
|
if ( this.icon && !( /\./ ).test( this.icon ) ) {
|
||||||
|
iconName = this.icon;
|
||||||
|
this.icon = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var params = {
|
||||||
|
id: id,
|
||||||
|
name: name,
|
||||||
|
iconName: iconName,
|
||||||
|
label: this.label,
|
||||||
|
cls: this.className || '',
|
||||||
|
state: stateName,
|
||||||
|
ariaDisabled: stateName == 'disabled' ? 'true' : 'false',
|
||||||
|
title: this.title,
|
||||||
|
titleJs: env.gecko && env.version >= 10900 && !env.hc ? '' : ( this.title || '' ).replace( "'", '' ),
|
||||||
|
hasArrow: this.hasArrow ? 'true' : 'false',
|
||||||
|
keydownFn: keydownFn,
|
||||||
|
mousedownFn: mousedownFn,
|
||||||
|
focusFn: focusFn,
|
||||||
|
clickFn: clickFn,
|
||||||
|
style: CKEDITOR.skin.getIconStyle( iconName, ( editor.lang.dir == 'rtl' ), this.icon, this.iconOffset ),
|
||||||
|
arrowHtml: this.hasArrow ? btnArrowTpl.output() : ''
|
||||||
|
};
|
||||||
|
|
||||||
|
btnTpl.output( params, output );
|
||||||
|
|
||||||
|
if ( this.onRender )
|
||||||
|
this.onRender();
|
||||||
|
|
||||||
|
return instance;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo
|
||||||
|
*/
|
||||||
|
setState: function( state ) {
|
||||||
|
if ( this._.state == state )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
this._.state = state;
|
||||||
|
|
||||||
|
var element = CKEDITOR.document.getById( this._.id );
|
||||||
|
|
||||||
|
if ( element ) {
|
||||||
|
element.setState( state, 'cke_button' );
|
||||||
|
|
||||||
|
state == CKEDITOR.TRISTATE_DISABLED ?
|
||||||
|
element.setAttribute( 'aria-disabled', true ) :
|
||||||
|
element.removeAttribute( 'aria-disabled' );
|
||||||
|
|
||||||
|
if ( !this.hasArrow ) {
|
||||||
|
// Note: aria-pressed attribute should not be added to menuButton instances. (#11331)
|
||||||
|
state == CKEDITOR.TRISTATE_ON ?
|
||||||
|
element.setAttribute( 'aria-pressed', true ) :
|
||||||
|
element.removeAttribute( 'aria-pressed' );
|
||||||
|
} else {
|
||||||
|
var newLabel = state == CKEDITOR.TRISTATE_ON ?
|
||||||
|
this._.editor.lang.button.selectedLabel.replace( /%1/g, this.label ) : this.label;
|
||||||
|
CKEDITOR.document.getById( this._.id + '_label' ).setText( newLabel );
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo
|
||||||
|
*/
|
||||||
|
getState: function( state ) {
|
||||||
|
return this._.state;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns this button's {@link CKEDITOR.feature} instance.
|
||||||
|
*
|
||||||
|
* It may be this button instance if it has at least one of
|
||||||
|
* `allowedContent` and `requiredContent` properties. Otherwise,
|
||||||
|
* if command is bound to this button by `command` property, then
|
||||||
|
* that command will be returned.
|
||||||
|
*
|
||||||
|
* This method implements {@link CKEDITOR.feature#toFeature} interface method.
|
||||||
|
*
|
||||||
|
* @since 4.1
|
||||||
|
* @param {CKEDITOR.editor} Editor instance.
|
||||||
|
* @returns {CKEDITOR.feature} The feature.
|
||||||
|
*/
|
||||||
|
toFeature: function( editor ) {
|
||||||
|
if ( this._.feature )
|
||||||
|
return this._.feature;
|
||||||
|
|
||||||
|
var feature = this;
|
||||||
|
|
||||||
|
// If button isn't a feature, return command if is bound.
|
||||||
|
if ( !this.allowedContent && !this.requiredContent && this.command )
|
||||||
|
feature = editor.getCommand( this.command ) || feature;
|
||||||
|
|
||||||
|
return this._.feature = feature;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a button definition to the UI elements list.
|
||||||
|
*
|
||||||
|
* editorInstance.ui.addButton( 'MyBold', {
|
||||||
|
* label: 'My Bold',
|
||||||
|
* command: 'bold',
|
||||||
|
* toolbar: 'basicstyles,1'
|
||||||
|
* } );
|
||||||
|
*
|
||||||
|
* @member CKEDITOR.ui
|
||||||
|
* @param {String} name The button name.
|
||||||
|
* @param {Object} definition The button definition.
|
||||||
|
*/
|
||||||
|
CKEDITOR.ui.prototype.addButton = function( name, definition ) {
|
||||||
|
this.add( name, CKEDITOR.UI_BUTTON, definition );
|
||||||
|
};
|
||||||
|
|
||||||
|
} )();
|
11
plugins/ckeditor/plugins/clipboard/dialogs/paste.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
CKEDITOR.dialog.add("paste",function(c){function h(a){var b=new CKEDITOR.dom.document(a.document),f=b.getBody(),d=b.getById("cke_actscrpt");d&&d.remove();f.setAttribute("contenteditable",!0);if(CKEDITOR.env.ie&&8>CKEDITOR.env.version)b.getWindow().on("blur",function(){b.$.selection.empty()});b.on("keydown",function(a){var a=a.data,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")&&f.focus()}var e=c.lang.clipboard;c.on("pasteDialogCommit",function(a){a.data&&c.fire("paste",{type:"auto",dataValue:a.data})},null,null,1E3);return{title:e.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?370:350,minHeight:CKEDITOR.env.quirks?250:245,onShow:function(){this.parts.dialog.$.offsetHeight;this.setupContent();this.parts.title.setHtml(this.customTitle||e.title);this.customTitle=null},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:"securityMsg",html:'<div style="white-space:normal;width:340px">'+e.securityMsg+"</div>"},{type:"html",id:"pasteMsg",html:'<div style="white-space:normal;width:340px">'+e.pasteMsg+"</div>"},{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='<html dir="'+c.config.contentsLangDirection+'" lang="'+(c.config.contentsLanguage||c.langCode)+'"><head><style>body{margin:3px;height:95%}</style></head><body><script id="cke_actscrpt" type="text/javascript">window.parent.CKEDITOR.tools.callFunction('+CKEDITOR.tools.addFunction(h,a)+",this);<\/script></body></html>",f=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie?
|
||||||
|
"javascript:void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+'})())"':"",d=CKEDITOR.dom.element.createFromHtml('<iframe class="cke_pasteframe" frameborder="0" allowTransparency="true" src="'+f+'" role="region" aria-label="'+e.pasteArea+'" aria-describedby="'+a.getContentElement("general","pasteMsg").domId+'" aria-multiple="true"></iframe>');d.on("load",function(a){a.removeListener();a=d.getFrameDocument();a.write(b);c.focusManager.add(a.getBody());
|
||||||
|
CKEDITOR.env.air&&h.call(this,a.getWindow().$)},a);d.setCustomData("dialog",a);a=this.getElement();a.setHtml("");a.append(d);if(CKEDITOR.env.ie){var g=CKEDITOR.dom.element.createFromHtml('<span tabindex="-1" style="position:absolute" role="presentation"></span>');g.on("focus",function(){setTimeout(function(){d.$.contentWindow.focus()})});a.append(g);this.focus=function(){g.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(),d;c&&c.remove();d=b.getHtml();setTimeout(function(){a.fire("pasteDialogCommit",d)},0)}}]}]}});
|
7
plugins/ckeditor/plugins/contextmenu/lang/en.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
CKEDITOR.plugins.setLang( 'contextmenu', 'en', {
|
||||||
|
options: 'Context Menu Options'
|
||||||
|
} );
|
7
plugins/ckeditor/plugins/contextmenu/lang/hu.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
CKEDITOR.plugins.setLang( 'contextmenu', 'hu', {
|
||||||
|
options: 'Helyi menü opciók'
|
||||||
|
} );
|
143
plugins/ckeditor/plugins/contextmenu/plugin.js
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
|
||||||
|
CKEDITOR.plugins.add( 'contextmenu', {
|
||||||
|
requires: 'menu',
|
||||||
|
lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE%
|
||||||
|
|
||||||
|
// Make sure the base class (CKEDITOR.menu) is loaded before it (#3318).
|
||||||
|
onLoad: function() {
|
||||||
|
/**
|
||||||
|
* Class replacing the non-configurable native context menu with configurable CKEditor's equivalent.
|
||||||
|
*
|
||||||
|
* @class
|
||||||
|
* @extends CKEDITOR.menu
|
||||||
|
*/
|
||||||
|
CKEDITOR.plugins.contextMenu = CKEDITOR.tools.createClass( {
|
||||||
|
base: CKEDITOR.menu,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the CKEDITOR.plugins.contextMenu class instance.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
* @param {CKEDITOR.editor} editor
|
||||||
|
*/
|
||||||
|
$: function( editor ) {
|
||||||
|
this.base.call( this, editor, {
|
||||||
|
panel: {
|
||||||
|
className: 'cke_menu_panel',
|
||||||
|
attributes: {
|
||||||
|
'aria-label': editor.lang.contextmenu.options
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
},
|
||||||
|
|
||||||
|
proto: {
|
||||||
|
/**
|
||||||
|
* Starts watching on native context menu triggers (option key, right click) on given element.
|
||||||
|
*
|
||||||
|
* @param {CKEDITOR.dom.element} element
|
||||||
|
* @param {Boolean} [nativeContextMenuOnCtrl] Whether to open native context menu if
|
||||||
|
* *Ctrl* key is hold on opening the context menu. See {@link CKEDITOR.config#browserContextMenuOnCtrl}.
|
||||||
|
*/
|
||||||
|
addTarget: function( element, nativeContextMenuOnCtrl ) {
|
||||||
|
element.on( 'contextmenu', function( event ) {
|
||||||
|
var domEvent = event.data,
|
||||||
|
isCtrlKeyDown =
|
||||||
|
// Safari on Windows always show 'ctrlKey' as true in 'contextmenu' event,
|
||||||
|
// which make this property unreliable. (#4826)
|
||||||
|
( CKEDITOR.env.webkit ? holdCtrlKey : ( CKEDITOR.env.mac ? domEvent.$.metaKey : domEvent.$.ctrlKey ) );
|
||||||
|
|
||||||
|
if ( nativeContextMenuOnCtrl && isCtrlKeyDown )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Cancel the browser context menu.
|
||||||
|
domEvent.preventDefault();
|
||||||
|
|
||||||
|
var doc = domEvent.getTarget().getDocument(),
|
||||||
|
offsetParent = domEvent.getTarget().getDocument().getDocumentElement(),
|
||||||
|
fromFrame = !doc.equals( CKEDITOR.document ),
|
||||||
|
scroll = doc.getWindow().getScrollPosition(),
|
||||||
|
offsetX = fromFrame ? domEvent.$.clientX : domEvent.$.pageX || scroll.x + domEvent.$.clientX,
|
||||||
|
offsetY = fromFrame ? domEvent.$.clientY : domEvent.$.pageY || scroll.y + domEvent.$.clientY;
|
||||||
|
|
||||||
|
CKEDITOR.tools.setTimeout( function() {
|
||||||
|
this.open( offsetParent, null, offsetX, offsetY );
|
||||||
|
|
||||||
|
// IE needs a short while to allow selection change before opening menu. (#7908)
|
||||||
|
}, CKEDITOR.env.ie ? 200 : 0, this );
|
||||||
|
}, this );
|
||||||
|
|
||||||
|
if ( CKEDITOR.env.webkit ) {
|
||||||
|
var holdCtrlKey,
|
||||||
|
onKeyDown = function( event ) {
|
||||||
|
holdCtrlKey = CKEDITOR.env.mac ? event.data.$.metaKey : event.data.$.ctrlKey;
|
||||||
|
},
|
||||||
|
resetOnKeyUp = function() {
|
||||||
|
holdCtrlKey = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
element.on( 'keydown', onKeyDown );
|
||||||
|
element.on( 'keyup', resetOnKeyUp );
|
||||||
|
element.on( 'contextmenu', resetOnKeyUp );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens context menu in given location. See the {@link CKEDITOR.menu#show} method.
|
||||||
|
*
|
||||||
|
* @param {CKEDITOR.dom.element} offsetParent
|
||||||
|
* @param {Number} [corner]
|
||||||
|
* @param {Number} [offsetX]
|
||||||
|
* @param {Number} [offsetY]
|
||||||
|
*/
|
||||||
|
open: function( offsetParent, corner, offsetX, offsetY ) {
|
||||||
|
this.editor.focus();
|
||||||
|
offsetParent = offsetParent || CKEDITOR.document.getDocumentElement();
|
||||||
|
|
||||||
|
// #9362: Force selection check to update commands' states in the new context.
|
||||||
|
this.editor.selectionChange( 1 );
|
||||||
|
|
||||||
|
this.show( offsetParent, corner, offsetX, offsetY );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeInit: function( editor ) {
|
||||||
|
/**
|
||||||
|
* @readonly
|
||||||
|
* @property {CKEDITOR.plugins.contextMenu} contextMenu
|
||||||
|
* @member CKEDITOR.editor
|
||||||
|
*/
|
||||||
|
var contextMenu = editor.contextMenu = new CKEDITOR.plugins.contextMenu( editor );
|
||||||
|
|
||||||
|
editor.on( 'contentDom', function() {
|
||||||
|
contextMenu.addTarget( editor.editable(), editor.config.browserContextMenuOnCtrl !== false );
|
||||||
|
} );
|
||||||
|
|
||||||
|
editor.addCommand( 'contextMenu', {
|
||||||
|
exec: function() {
|
||||||
|
editor.contextMenu.open( editor.document.getBody() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
editor.setKeystroke( CKEDITOR.SHIFT + 121 /*F10*/, 'contextMenu' );
|
||||||
|
editor.setKeystroke( CKEDITOR.CTRL + CKEDITOR.SHIFT + 121 /*F10*/, 'contextMenu' );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to show the browser native context menu when the *Ctrl* or
|
||||||
|
* *Meta* (Mac) key is pressed on opening the context menu with the
|
||||||
|
* right mouse button click or the *Menu* key.
|
||||||
|
*
|
||||||
|
* config.browserContextMenuOnCtrl = false;
|
||||||
|
*
|
||||||
|
* @since 3.0.2
|
||||||
|
* @cfg {Boolean} [browserContextMenuOnCtrl=true]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
4
plugins/ckeditor/plugins/dialog/dialogDefinition.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
501
plugins/ckeditor/plugins/filebrowser/plugin.js
Normal file
@ -0,0 +1,501 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @fileOverview The "filebrowser" plugin that adds support for file uploads and
|
||||||
|
* browsing.
|
||||||
|
*
|
||||||
|
* When a file is uploaded or selected inside the file browser, its URL is
|
||||||
|
* inserted automatically into a field defined in the <code>filebrowser</code>
|
||||||
|
* attribute. In order to specify a field that should be updated, pass the tab ID and
|
||||||
|
* the element ID, separated with a colon.<br /><br />
|
||||||
|
*
|
||||||
|
* <strong>Example 1: (Browse)</strong>
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* {
|
||||||
|
* type : 'button',
|
||||||
|
* id : 'browse',
|
||||||
|
* filebrowser : 'tabId:elementId',
|
||||||
|
* label : editor.lang.common.browseServer
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* If you set the <code>filebrowser</code> attribute for an element other than
|
||||||
|
* the <code>fileButton</code>, the <code>Browse</code> action will be triggered.<br /><br />
|
||||||
|
*
|
||||||
|
* <strong>Example 2: (Quick Upload)</strong>
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* {
|
||||||
|
* type : 'fileButton',
|
||||||
|
* id : 'uploadButton',
|
||||||
|
* filebrowser : 'tabId:elementId',
|
||||||
|
* label : editor.lang.common.uploadSubmit,
|
||||||
|
* 'for' : [ 'upload', 'upload' ]
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* If you set the <code>filebrowser</code> attribute for a <code>fileButton</code>
|
||||||
|
* element, the <code>QuickUpload</code> action will be executed.<br /><br />
|
||||||
|
*
|
||||||
|
* The filebrowser plugin also supports more advanced configuration performed through
|
||||||
|
* a JavaScript object.
|
||||||
|
*
|
||||||
|
* The following settings are supported:
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li><code>action</code> – <code>Browse</code> or <code>QuickUpload</code>.</li>
|
||||||
|
* <li><code>target</code> – the field to update in the <code><em>tabId:elementId</em></code> format.</li>
|
||||||
|
* <li><code>params</code> – additional arguments to be passed to the server connector (optional).</li>
|
||||||
|
* <li><code>onSelect</code> – a function to execute when the file is selected/uploaded (optional).</li>
|
||||||
|
* <li><code>url</code> – the URL to be called (optional).</li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* <strong>Example 3: (Quick Upload)</strong>
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* {
|
||||||
|
* type : 'fileButton',
|
||||||
|
* label : editor.lang.common.uploadSubmit,
|
||||||
|
* id : 'buttonId',
|
||||||
|
* filebrowser :
|
||||||
|
* {
|
||||||
|
* action : 'QuickUpload', // required
|
||||||
|
* target : 'tab1:elementId', // required
|
||||||
|
* params : // optional
|
||||||
|
* {
|
||||||
|
* type : 'Files',
|
||||||
|
* currentFolder : '/folder/'
|
||||||
|
* },
|
||||||
|
* onSelect : function( fileUrl, errorMessage ) // optional
|
||||||
|
* {
|
||||||
|
* // Do not call the built-in selectFuntion.
|
||||||
|
* // return false;
|
||||||
|
* }
|
||||||
|
* },
|
||||||
|
* 'for' : [ 'tab1', 'myFile' ]
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* Suppose you have a file element with an ID of <code>myFile</code>, a text
|
||||||
|
* field with an ID of <code>elementId</code> and a <code>fileButton</code>.
|
||||||
|
* If the <code>filebowser.url</code> attribute is not specified explicitly,
|
||||||
|
* the form action will be set to <code>filebrowser[<em>DialogWindowName</em>]UploadUrl</code>
|
||||||
|
* or, if not specified, to <code>filebrowserUploadUrl</code>. Additional parameters
|
||||||
|
* from the <code>params</code> object will be added to the query string. It is
|
||||||
|
* possible to create your own <code>uploadHandler</code> and cancel the built-in
|
||||||
|
* <code>updateTargetElement</code> command.<br /><br />
|
||||||
|
*
|
||||||
|
* <strong>Example 4: (Browse)</strong>
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* {
|
||||||
|
* type : 'button',
|
||||||
|
* id : 'buttonId',
|
||||||
|
* label : editor.lang.common.browseServer,
|
||||||
|
* filebrowser :
|
||||||
|
* {
|
||||||
|
* action : 'Browse',
|
||||||
|
* url : '/ckfinder/ckfinder.html&type=Images',
|
||||||
|
* target : 'tab1:elementId'
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* In this example, when the button is pressed, the file browser will be opened in a
|
||||||
|
* popup window. If you do not specify the <code>filebrowser.url</code> attribute,
|
||||||
|
* <code>filebrowser[<em>DialogName</em>]BrowseUrl</code> or
|
||||||
|
* <code>filebrowserBrowseUrl</code> will be used. After selecting a file in the file
|
||||||
|
* browser, an element with an ID of <code>elementId</code> will be updated. Just
|
||||||
|
* like in the third example, a custom <code>onSelect</code> function may be defined.
|
||||||
|
*/
|
||||||
|
|
||||||
|
( function() {
|
||||||
|
// Adds (additional) arguments to given url.
|
||||||
|
//
|
||||||
|
// @param {String}
|
||||||
|
// url The url.
|
||||||
|
// @param {Object}
|
||||||
|
// params Additional parameters.
|
||||||
|
function addQueryString( url, params ) {
|
||||||
|
var queryString = [];
|
||||||
|
|
||||||
|
if ( !params )
|
||||||
|
return url;
|
||||||
|
else {
|
||||||
|
for ( var i in params )
|
||||||
|
queryString.push( i + "=" + encodeURIComponent( params[ i ] ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
return url + ( ( url.indexOf( "?" ) != -1 ) ? "&" : "?" ) + queryString.join( "&" );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make a string's first character uppercase.
|
||||||
|
//
|
||||||
|
// @param {String}
|
||||||
|
// str String.
|
||||||
|
function ucFirst( str ) {
|
||||||
|
str += '';
|
||||||
|
var f = str.charAt( 0 ).toUpperCase();
|
||||||
|
return f + str.substr( 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
// The onlick function assigned to the 'Browse Server' button. Opens the
|
||||||
|
// file browser and updates target field when file is selected.
|
||||||
|
//
|
||||||
|
// @param {CKEDITOR.event}
|
||||||
|
// evt The event object.
|
||||||
|
function browseServer( evt ) {
|
||||||
|
var dialog = this.getDialog();
|
||||||
|
var editor = dialog.getParentEditor();
|
||||||
|
|
||||||
|
editor._.filebrowserSe = this;
|
||||||
|
|
||||||
|
var width = editor.config[ 'filebrowser' + ucFirst( dialog.getName() ) + 'WindowWidth' ] || editor.config.filebrowserWindowWidth || '80%';
|
||||||
|
var height = editor.config[ 'filebrowser' + ucFirst( dialog.getName() ) + 'WindowHeight' ] || editor.config.filebrowserWindowHeight || '70%';
|
||||||
|
|
||||||
|
var params = this.filebrowser.params || {};
|
||||||
|
params.CKEditor = editor.name;
|
||||||
|
params.CKEditorFuncNum = editor._.filebrowserFn;
|
||||||
|
if ( !params.langCode )
|
||||||
|
params.langCode = editor.langCode;
|
||||||
|
|
||||||
|
var url = addQueryString( this.filebrowser.url, params );
|
||||||
|
// TODO: V4: Remove backward compatibility (#8163).
|
||||||
|
editor.popup( url, width, height, editor.config.filebrowserWindowFeatures || editor.config.fileBrowserWindowFeatures );
|
||||||
|
}
|
||||||
|
|
||||||
|
// The onlick function assigned to the 'Upload' button. Makes the final
|
||||||
|
// decision whether form is really submitted and updates target field when
|
||||||
|
// file is uploaded.
|
||||||
|
//
|
||||||
|
// @param {CKEDITOR.event}
|
||||||
|
// evt The event object.
|
||||||
|
function uploadFile( evt ) {
|
||||||
|
var dialog = this.getDialog();
|
||||||
|
var editor = dialog.getParentEditor();
|
||||||
|
|
||||||
|
editor._.filebrowserSe = this;
|
||||||
|
|
||||||
|
// If user didn't select the file, stop the upload.
|
||||||
|
if ( !dialog.getContentElement( this[ 'for' ][ 0 ], this[ 'for' ][ 1 ] ).getInputElement().$.value )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if ( !dialog.getContentElement( this[ 'for' ][ 0 ], this[ 'for' ][ 1 ] ).getAction() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setups the file element.
|
||||||
|
//
|
||||||
|
// @param {CKEDITOR.ui.dialog.file}
|
||||||
|
// fileInput The file element used during file upload.
|
||||||
|
// @param {Object}
|
||||||
|
// filebrowser Object containing filebrowser settings assigned to
|
||||||
|
// the fileButton associated with this file element.
|
||||||
|
function setupFileElement( editor, fileInput, filebrowser ) {
|
||||||
|
var params = filebrowser.params || {};
|
||||||
|
params.CKEditor = editor.name;
|
||||||
|
params.CKEditorFuncNum = editor._.filebrowserFn;
|
||||||
|
if ( !params.langCode )
|
||||||
|
params.langCode = editor.langCode;
|
||||||
|
|
||||||
|
fileInput.action = addQueryString( filebrowser.url, params );
|
||||||
|
fileInput.filebrowser = filebrowser;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Traverse through the content definition and attach filebrowser to
|
||||||
|
// elements with 'filebrowser' attribute.
|
||||||
|
//
|
||||||
|
// @param String
|
||||||
|
// dialogName Dialog name.
|
||||||
|
// @param {CKEDITOR.dialog.definitionObject}
|
||||||
|
// definition Dialog definition.
|
||||||
|
// @param {Array}
|
||||||
|
// elements Array of {@link CKEDITOR.dialog.definition.content}
|
||||||
|
// objects.
|
||||||
|
function attachFileBrowser( editor, dialogName, definition, elements ) {
|
||||||
|
if ( !elements || !elements.length )
|
||||||
|
return;
|
||||||
|
|
||||||
|
var element, fileInput;
|
||||||
|
|
||||||
|
for ( var i = elements.length; i--; ) {
|
||||||
|
element = elements[ i ];
|
||||||
|
|
||||||
|
if ( element.type == 'hbox' || element.type == 'vbox' || element.type == 'fieldset' )
|
||||||
|
attachFileBrowser( editor, dialogName, definition, element.children );
|
||||||
|
|
||||||
|
if ( !element.filebrowser )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( typeof element.filebrowser == 'string' ) {
|
||||||
|
var fb = {
|
||||||
|
action: ( element.type == 'fileButton' ) ? 'QuickUpload' : 'Browse',
|
||||||
|
target: element.filebrowser
|
||||||
|
};
|
||||||
|
element.filebrowser = fb;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( element.filebrowser.action == 'Browse' ) {
|
||||||
|
var url = element.filebrowser.url;
|
||||||
|
if ( url === undefined ) {
|
||||||
|
url = editor.config[ 'filebrowser' + ucFirst( dialogName ) + 'BrowseUrl' ];
|
||||||
|
if ( url === undefined )
|
||||||
|
url = editor.config.filebrowserBrowseUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( url ) {
|
||||||
|
element.onClick = browseServer;
|
||||||
|
element.filebrowser.url = url;
|
||||||
|
element.hidden = false;
|
||||||
|
}
|
||||||
|
} else if ( element.filebrowser.action == 'QuickUpload' && element[ 'for' ] ) {
|
||||||
|
url = element.filebrowser.url;
|
||||||
|
if ( url === undefined ) {
|
||||||
|
url = editor.config[ 'filebrowser' + ucFirst( dialogName ) + 'UploadUrl' ];
|
||||||
|
if ( url === undefined )
|
||||||
|
url = editor.config.filebrowserUploadUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( url ) {
|
||||||
|
var onClick = element.onClick;
|
||||||
|
element.onClick = function( evt ) {
|
||||||
|
// "element" here means the definition object, so we need to find the correct
|
||||||
|
// button to scope the event call
|
||||||
|
var sender = evt.sender;
|
||||||
|
if ( onClick && onClick.call( sender, evt ) === false )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return uploadFile.call( sender, evt );
|
||||||
|
};
|
||||||
|
|
||||||
|
element.filebrowser.url = url;
|
||||||
|
element.hidden = false;
|
||||||
|
setupFileElement( editor, definition.getContents( element[ 'for' ][ 0 ] ).get( element[ 'for' ][ 1 ] ), element.filebrowser );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Updates the target element with the url of uploaded/selected file.
|
||||||
|
//
|
||||||
|
// @param {String}
|
||||||
|
// url The url of a file.
|
||||||
|
function updateTargetElement( url, sourceElement ) {
|
||||||
|
var dialog = sourceElement.getDialog();
|
||||||
|
var targetElement = sourceElement.filebrowser.target || null;
|
||||||
|
|
||||||
|
// If there is a reference to targetElement, update it.
|
||||||
|
if ( targetElement ) {
|
||||||
|
var target = targetElement.split( ':' );
|
||||||
|
var element = dialog.getContentElement( target[ 0 ], target[ 1 ] );
|
||||||
|
if ( element ) {
|
||||||
|
element.setValue( url );
|
||||||
|
dialog.selectPage( target[ 0 ] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns true if filebrowser is configured in one of the elements.
|
||||||
|
//
|
||||||
|
// @param {CKEDITOR.dialog.definitionObject}
|
||||||
|
// definition Dialog definition.
|
||||||
|
// @param String
|
||||||
|
// tabId The tab id where element(s) can be found.
|
||||||
|
// @param String
|
||||||
|
// elementId The element id (or ids, separated with a semicolon) to check.
|
||||||
|
function isConfigured( definition, tabId, elementId ) {
|
||||||
|
if ( elementId.indexOf( ";" ) !== -1 ) {
|
||||||
|
var ids = elementId.split( ";" );
|
||||||
|
for ( var i = 0; i < ids.length; i++ ) {
|
||||||
|
if ( isConfigured( definition, tabId, ids[ i ] ) )
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var elementFileBrowser = definition.getContents( tabId ).get( elementId ).filebrowser;
|
||||||
|
return ( elementFileBrowser && elementFileBrowser.url );
|
||||||
|
}
|
||||||
|
|
||||||
|
function setUrl( fileUrl, data ) {
|
||||||
|
var dialog = this._.filebrowserSe.getDialog(),
|
||||||
|
targetInput = this._.filebrowserSe[ 'for' ],
|
||||||
|
onSelect = this._.filebrowserSe.filebrowser.onSelect;
|
||||||
|
|
||||||
|
if ( targetInput )
|
||||||
|
dialog.getContentElement( targetInput[ 0 ], targetInput[ 1 ] ).reset();
|
||||||
|
|
||||||
|
if ( typeof data == 'function' && data.call( this._.filebrowserSe ) === false )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( onSelect && onSelect.call( this._.filebrowserSe, fileUrl, data ) === false )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// The "data" argument may be used to pass the error message to the editor.
|
||||||
|
if ( typeof data == 'string' && data )
|
||||||
|
alert( data );
|
||||||
|
|
||||||
|
if ( fileUrl )
|
||||||
|
updateTargetElement( fileUrl, this._.filebrowserSe );
|
||||||
|
}
|
||||||
|
|
||||||
|
CKEDITOR.plugins.add( 'filebrowser', {
|
||||||
|
requires: 'popup',
|
||||||
|
init: function( editor, pluginPath ) {
|
||||||
|
editor._.filebrowserFn = CKEDITOR.tools.addFunction( setUrl, editor );
|
||||||
|
editor.on( 'destroy', function() {
|
||||||
|
CKEDITOR.tools.removeFunction( this._.filebrowserFn );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
CKEDITOR.on( 'dialogDefinition', function( evt ) {
|
||||||
|
// We require filebrowser plugin to be loaded.
|
||||||
|
if ( !evt.editor.plugins.filebrowser )
|
||||||
|
return;
|
||||||
|
|
||||||
|
var definition = evt.data.definition,
|
||||||
|
element;
|
||||||
|
// Associate filebrowser to elements with 'filebrowser' attribute.
|
||||||
|
for ( var i = 0; i < definition.contents.length; ++i ) {
|
||||||
|
if ( ( element = definition.contents[ i ] ) ) {
|
||||||
|
attachFileBrowser( evt.editor, evt.data.name, definition, element.elements );
|
||||||
|
if ( element.hidden && element.filebrowser )
|
||||||
|
element.hidden = !isConfigured( definition, element[ 'id' ], element.filebrowser );
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
} )();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The location of an external file browser that should be launched when the **Browse Server**
|
||||||
|
* button is pressed. If configured, the **Browse Server** button will appear in the
|
||||||
|
* **Link**, **Image**, and **Flash** dialog windows.
|
||||||
|
*
|
||||||
|
* See the [File Browser/Uploader](http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_(Uploader\)) documentation.
|
||||||
|
*
|
||||||
|
* config.filebrowserBrowseUrl = '/browser/browse.php';
|
||||||
|
*
|
||||||
|
* @since 3.0
|
||||||
|
* @cfg {String} [filebrowserBrowseUrl='' (empty string = disabled)]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The location of the script that handles file uploads.
|
||||||
|
* If set, the **Upload** tab will appear in the **Link**, **Image**,
|
||||||
|
* and **Flash** dialog windows.
|
||||||
|
*
|
||||||
|
* See the [File Browser/Uploader](http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_(Uploader\)) documentation.
|
||||||
|
*
|
||||||
|
* config.filebrowserUploadUrl = '/uploader/upload.php';
|
||||||
|
*
|
||||||
|
* @since 3.0
|
||||||
|
* @cfg {String} [filebrowserUploadUrl='' (empty string = disabled)]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The location of an external file browser that should be launched when the **Browse Server**
|
||||||
|
* button is pressed in the **Image** dialog window.
|
||||||
|
*
|
||||||
|
* If not set, CKEditor will use {@link CKEDITOR.config#filebrowserBrowseUrl}.
|
||||||
|
*
|
||||||
|
* config.filebrowserImageBrowseUrl = '/browser/browse.php?type=Images';
|
||||||
|
*
|
||||||
|
* @since 3.0
|
||||||
|
* @cfg {String} [filebrowserImageBrowseUrl='' (empty string = disabled)]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The location of an external file browser that should be launched when the **Browse Server**
|
||||||
|
* button is pressed in the **Flash** dialog window.
|
||||||
|
*
|
||||||
|
* If not set, CKEditor will use {@link CKEDITOR.config#filebrowserBrowseUrl}.
|
||||||
|
*
|
||||||
|
* config.filebrowserFlashBrowseUrl = '/browser/browse.php?type=Flash';
|
||||||
|
*
|
||||||
|
* @since 3.0
|
||||||
|
* @cfg {String} [filebrowserFlashBrowseUrl='' (empty string = disabled)]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The location of the script that handles file uploads in the **Image** dialog window.
|
||||||
|
*
|
||||||
|
* If not set, CKEditor will use {@link CKEDITOR.config#filebrowserUploadUrl}.
|
||||||
|
*
|
||||||
|
* config.filebrowserImageUploadUrl = '/uploader/upload.php?type=Images';
|
||||||
|
*
|
||||||
|
* @since 3.0
|
||||||
|
* @cfg {String} [filebrowserImageUploadUrl='' (empty string = disabled)]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The location of the script that handles file uploads in the **Flash** dialog window.
|
||||||
|
*
|
||||||
|
* If not set, CKEditor will use {@link CKEDITOR.config#filebrowserUploadUrl}.
|
||||||
|
*
|
||||||
|
* config.filebrowserFlashUploadUrl = '/uploader/upload.php?type=Flash';
|
||||||
|
*
|
||||||
|
* @since 3.0
|
||||||
|
* @cfg {String} filebrowserFlashUploadUrl='' (empty string = disabled)]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The location of an external file browser that should be launched when the **Browse Server**
|
||||||
|
* button is pressed in the **Link** tab of the **Image** dialog window.
|
||||||
|
*
|
||||||
|
* If not set, CKEditor will use {@link CKEDITOR.config#filebrowserBrowseUrl}.
|
||||||
|
*
|
||||||
|
* config.filebrowserImageBrowseLinkUrl = '/browser/browse.php';
|
||||||
|
*
|
||||||
|
* @since 3.2
|
||||||
|
* @cfg {String} [filebrowserImageBrowseLinkUrl='' (empty string = disabled)]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The features to use in the file browser popup window.
|
||||||
|
*
|
||||||
|
* config.filebrowserWindowFeatures = 'resizable=yes,scrollbars=no';
|
||||||
|
*
|
||||||
|
* @since 3.4.1
|
||||||
|
* @cfg {String} [filebrowserWindowFeatures='location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes']
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The width of the file browser popup window. It can be a number denoting a value in
|
||||||
|
* pixels or a percent string.
|
||||||
|
*
|
||||||
|
* config.filebrowserWindowWidth = 750;
|
||||||
|
*
|
||||||
|
* config.filebrowserWindowWidth = '50%';
|
||||||
|
*
|
||||||
|
* @cfg {Number/String} [filebrowserWindowWidth='80%']
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The height of the file browser popup window. It can be a number denoting a value in
|
||||||
|
* pixels or a percent string.
|
||||||
|
*
|
||||||
|
* config.filebrowserWindowHeight = 580;
|
||||||
|
*
|
||||||
|
* config.filebrowserWindowHeight = '50%';
|
||||||
|
*
|
||||||
|
* @cfg {Number/String} [filebrowserWindowHeight='70%']
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
548
plugins/ckeditor/plugins/floatpanel/plugin.js
Normal file
@ -0,0 +1,548 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
|
||||||
|
CKEDITOR.plugins.add( 'floatpanel', {
|
||||||
|
requires: 'panel'
|
||||||
|
} );
|
||||||
|
|
||||||
|
( function() {
|
||||||
|
var panels = {};
|
||||||
|
|
||||||
|
function getPanel( editor, doc, parentElement, definition, level ) {
|
||||||
|
// Generates the panel key: docId-eleId-skinName-langDir[-uiColor][-CSSs][-level]
|
||||||
|
var key = CKEDITOR.tools.genKey( doc.getUniqueId(), parentElement.getUniqueId(), editor.lang.dir, editor.uiColor || '', definition.css || '', level || '' ),
|
||||||
|
panel = panels[ key ];
|
||||||
|
|
||||||
|
if ( !panel ) {
|
||||||
|
panel = panels[ key ] = new CKEDITOR.ui.panel( doc, definition );
|
||||||
|
panel.element = parentElement.append( CKEDITOR.dom.element.createFromHtml( panel.render( editor ), doc ) );
|
||||||
|
|
||||||
|
panel.element.setStyles( {
|
||||||
|
display: 'none',
|
||||||
|
position: 'absolute'
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
return panel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a floating panel UI element.
|
||||||
|
*
|
||||||
|
* It's reused by rich combos, color combos, menus, etc.
|
||||||
|
* and it renders its content using {@link CKEDITOR.ui.panel}.
|
||||||
|
*
|
||||||
|
* @class
|
||||||
|
* @todo
|
||||||
|
*/
|
||||||
|
CKEDITOR.ui.floatPanel = CKEDITOR.tools.createClass( {
|
||||||
|
/**
|
||||||
|
* Creates a floatPanel class instance.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
* @param {CKEDITOR.editor} editor
|
||||||
|
* @param {CKEDITOR.dom.element} parentElement
|
||||||
|
* @param {Object} definition Definition of the panel that will be floating.
|
||||||
|
* @param {Number} level
|
||||||
|
*/
|
||||||
|
$: function( editor, parentElement, definition, level ) {
|
||||||
|
definition.forceIFrame = 1;
|
||||||
|
|
||||||
|
// In case of editor with floating toolbar append panels that should float
|
||||||
|
// to the main UI element.
|
||||||
|
if ( definition.toolbarRelated && editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE )
|
||||||
|
parentElement = CKEDITOR.document.getById( 'cke_' + editor.name );
|
||||||
|
|
||||||
|
var doc = parentElement.getDocument(),
|
||||||
|
panel = getPanel( editor, doc, parentElement, definition, level || 0 ),
|
||||||
|
element = panel.element,
|
||||||
|
iframe = element.getFirst(),
|
||||||
|
that = this;
|
||||||
|
|
||||||
|
// Disable native browser menu. (#4825)
|
||||||
|
element.disableContextMenu();
|
||||||
|
|
||||||
|
this.element = element;
|
||||||
|
|
||||||
|
this._ = {
|
||||||
|
editor: editor,
|
||||||
|
// The panel that will be floating.
|
||||||
|
panel: panel,
|
||||||
|
parentElement: parentElement,
|
||||||
|
definition: definition,
|
||||||
|
document: doc,
|
||||||
|
iframe: iframe,
|
||||||
|
children: [],
|
||||||
|
dir: editor.lang.dir
|
||||||
|
};
|
||||||
|
|
||||||
|
editor.on( 'mode', hide );
|
||||||
|
editor.on( 'resize', hide );
|
||||||
|
// Window resize doesn't cause hide on blur. (#9800)
|
||||||
|
doc.getWindow().on( 'resize', hide );
|
||||||
|
|
||||||
|
// We need a wrapper because events implementation doesn't allow to attach
|
||||||
|
// one listener more than once for the same event on the same object.
|
||||||
|
// Remember that floatPanel#hide is shared between all instances.
|
||||||
|
function hide() {
|
||||||
|
that.hide();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
proto: {
|
||||||
|
/**
|
||||||
|
* @todo
|
||||||
|
*/
|
||||||
|
addBlock: function( name, block ) {
|
||||||
|
return this._.panel.addBlock( name, block );
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo
|
||||||
|
*/
|
||||||
|
addListBlock: function( name, multiSelect ) {
|
||||||
|
return this._.panel.addListBlock( name, multiSelect );
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo
|
||||||
|
*/
|
||||||
|
getBlock: function( name ) {
|
||||||
|
return this._.panel.getBlock( name );
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows panel block.
|
||||||
|
*
|
||||||
|
* @param {String} name
|
||||||
|
* @param {CKEDITOR.dom.element} offsetParent Positioned parent.
|
||||||
|
* @param {Number} corner
|
||||||
|
*
|
||||||
|
* * For LTR (left to right) oriented editor:
|
||||||
|
* * `1` = top-left
|
||||||
|
* * `2` = top-right
|
||||||
|
* * `3` = bottom-right
|
||||||
|
* * `4` = bottom-left
|
||||||
|
* * For RTL (right to left):
|
||||||
|
* * `1` = top-right
|
||||||
|
* * `2` = top-left
|
||||||
|
* * `3` = bottom-left
|
||||||
|
* * `4` = bottom-right
|
||||||
|
*
|
||||||
|
* @param {Number} [offsetX=0]
|
||||||
|
* @param {Number} [offsetY=0]
|
||||||
|
* @param {Function} [callback] A callback function executed when block positioning is done.
|
||||||
|
* @todo what do exactly these params mean (especially corner)?
|
||||||
|
*/
|
||||||
|
showBlock: function( name, offsetParent, corner, offsetX, offsetY, callback ) {
|
||||||
|
var panel = this._.panel,
|
||||||
|
block = panel.showBlock( name );
|
||||||
|
|
||||||
|
this.allowBlur( false );
|
||||||
|
|
||||||
|
// Record from where the focus is when open panel.
|
||||||
|
var editable = this._.editor.editable();
|
||||||
|
this._.returnFocus = editable.hasFocus ? editable : new CKEDITOR.dom.element( CKEDITOR.document.$.activeElement );
|
||||||
|
|
||||||
|
var element = this.element,
|
||||||
|
iframe = this._.iframe,
|
||||||
|
// Non IE prefer the event into a window object.
|
||||||
|
focused = CKEDITOR.env.ie ? iframe : new CKEDITOR.dom.window( iframe.$.contentWindow ),
|
||||||
|
doc = element.getDocument(),
|
||||||
|
positionedAncestor = this._.parentElement.getPositionedAncestor(),
|
||||||
|
position = offsetParent.getDocumentPosition( doc ),
|
||||||
|
positionedAncestorPosition = positionedAncestor ? positionedAncestor.getDocumentPosition( doc ) : { x: 0, y: 0 },
|
||||||
|
rtl = this._.dir == 'rtl',
|
||||||
|
left = position.x + ( offsetX || 0 ) - positionedAncestorPosition.x,
|
||||||
|
top = position.y + ( offsetY || 0 ) - positionedAncestorPosition.y;
|
||||||
|
|
||||||
|
// Floating panels are off by (-1px, 0px) in RTL mode. (#3438)
|
||||||
|
if ( rtl && ( corner == 1 || corner == 4 ) )
|
||||||
|
left += offsetParent.$.offsetWidth;
|
||||||
|
else if ( !rtl && ( corner == 2 || corner == 3 ) )
|
||||||
|
left += offsetParent.$.offsetWidth - 1;
|
||||||
|
|
||||||
|
if ( corner == 3 || corner == 4 )
|
||||||
|
top += offsetParent.$.offsetHeight - 1;
|
||||||
|
|
||||||
|
// Memorize offsetParent by it's ID.
|
||||||
|
this._.panel._.offsetParentId = offsetParent.getId();
|
||||||
|
|
||||||
|
element.setStyles( {
|
||||||
|
top: top + 'px',
|
||||||
|
left: 0,
|
||||||
|
display: ''
|
||||||
|
} );
|
||||||
|
|
||||||
|
// Don't use display or visibility style because we need to
|
||||||
|
// calculate the rendering layout later and focus the element.
|
||||||
|
element.setOpacity( 0 );
|
||||||
|
|
||||||
|
// To allow the context menu to decrease back their width
|
||||||
|
element.getFirst().removeStyle( 'width' );
|
||||||
|
|
||||||
|
// Report to focus manager.
|
||||||
|
this._.editor.focusManager.add( focused );
|
||||||
|
|
||||||
|
// Configure the IFrame blur event. Do that only once.
|
||||||
|
if ( !this._.blurSet ) {
|
||||||
|
|
||||||
|
// With addEventListener compatible browsers, we must
|
||||||
|
// useCapture when registering the focus/blur events to
|
||||||
|
// guarantee they will be firing in all situations. (#3068, #3222 )
|
||||||
|
CKEDITOR.event.useCapture = true;
|
||||||
|
|
||||||
|
focused.on( 'blur', function( ev ) {
|
||||||
|
|
||||||
|
// As we are using capture to register the listener,
|
||||||
|
// the blur event may get fired even when focusing
|
||||||
|
// inside the window itself, so we must ensure the
|
||||||
|
// target is out of it.
|
||||||
|
if ( !this.allowBlur() || ev.data.getPhase() != CKEDITOR.EVENT_PHASE_AT_TARGET )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( this.visible && !this._.activeChild ) {
|
||||||
|
// Panel close is caused by user's navigating away the focus, e.g. click outside the panel.
|
||||||
|
// DO NOT restore focus in this case.
|
||||||
|
delete this._.returnFocus;
|
||||||
|
this.hide();
|
||||||
|
}
|
||||||
|
}, this );
|
||||||
|
|
||||||
|
focused.on( 'focus', function() {
|
||||||
|
this._.focused = true;
|
||||||
|
this.hideChild();
|
||||||
|
this.allowBlur( true );
|
||||||
|
}, this );
|
||||||
|
|
||||||
|
CKEDITOR.event.useCapture = false;
|
||||||
|
|
||||||
|
this._.blurSet = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
panel.onEscape = CKEDITOR.tools.bind( function( keystroke ) {
|
||||||
|
if ( this.onEscape && this.onEscape( keystroke ) === false )
|
||||||
|
return false;
|
||||||
|
}, this );
|
||||||
|
|
||||||
|
CKEDITOR.tools.setTimeout( function() {
|
||||||
|
var panelLoad = CKEDITOR.tools.bind( function() {
|
||||||
|
var target = element;
|
||||||
|
|
||||||
|
// Reset panel width as the new content can be narrower
|
||||||
|
// than the old one. (#9355)
|
||||||
|
target.removeStyle( 'width' );
|
||||||
|
|
||||||
|
if ( block.autoSize ) {
|
||||||
|
var panelDoc = block.element.getDocument();
|
||||||
|
var width = ( CKEDITOR.env.webkit? block.element : panelDoc.getBody() )[ '$' ].scrollWidth;
|
||||||
|
|
||||||
|
// Account for extra height needed due to IE quirks box model bug:
|
||||||
|
// http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug
|
||||||
|
// (#3426)
|
||||||
|
if ( CKEDITOR.env.ie && CKEDITOR.env.quirks && width > 0 )
|
||||||
|
width += ( target.$.offsetWidth || 0 ) - ( target.$.clientWidth || 0 ) + 3;
|
||||||
|
|
||||||
|
// Add some extra pixels to improve the appearance.
|
||||||
|
width += 10;
|
||||||
|
|
||||||
|
target.setStyle( 'width', width + 'px' );
|
||||||
|
|
||||||
|
var height = block.element.$.scrollHeight;
|
||||||
|
|
||||||
|
// Account for extra height needed due to IE quirks box model bug:
|
||||||
|
// http://en.wikipedia.org/wiki/Internet_Explorer_box_model_bug
|
||||||
|
// (#3426)
|
||||||
|
if ( CKEDITOR.env.ie && CKEDITOR.env.quirks && height > 0 )
|
||||||
|
height += ( target.$.offsetHeight || 0 ) - ( target.$.clientHeight || 0 ) + 3;
|
||||||
|
|
||||||
|
target.setStyle( 'height', height + 'px' );
|
||||||
|
|
||||||
|
// Fix IE < 8 visibility.
|
||||||
|
panel._.currentBlock.element.setStyle( 'display', 'none' ).removeStyle( 'display' );
|
||||||
|
} else
|
||||||
|
target.removeStyle( 'height' );
|
||||||
|
|
||||||
|
// Flip panel layout horizontally in RTL with known width.
|
||||||
|
if ( rtl )
|
||||||
|
left -= element.$.offsetWidth;
|
||||||
|
|
||||||
|
// Pop the style now for measurement.
|
||||||
|
element.setStyle( 'left', left + 'px' );
|
||||||
|
|
||||||
|
/* panel layout smartly fit the viewport size. */
|
||||||
|
var panelElement = panel.element,
|
||||||
|
panelWindow = panelElement.getWindow(),
|
||||||
|
rect = element.$.getBoundingClientRect(),
|
||||||
|
viewportSize = panelWindow.getViewPaneSize();
|
||||||
|
|
||||||
|
// Compensation for browsers that dont support "width" and "height".
|
||||||
|
var rectWidth = rect.width || rect.right - rect.left,
|
||||||
|
rectHeight = rect.height || rect.bottom - rect.top;
|
||||||
|
|
||||||
|
// Check if default horizontal layout is impossible.
|
||||||
|
var spaceAfter = rtl ? rect.right : viewportSize.width - rect.left,
|
||||||
|
spaceBefore = rtl ? viewportSize.width - rect.right : rect.left;
|
||||||
|
|
||||||
|
if ( rtl ) {
|
||||||
|
if ( spaceAfter < rectWidth ) {
|
||||||
|
// Flip to show on right.
|
||||||
|
if ( spaceBefore > rectWidth )
|
||||||
|
left += rectWidth;
|
||||||
|
// Align to window left.
|
||||||
|
else if ( viewportSize.width > rectWidth )
|
||||||
|
left = left - rect.left;
|
||||||
|
// Align to window right, never cutting the panel at right.
|
||||||
|
else
|
||||||
|
left = left - rect.right + viewportSize.width;
|
||||||
|
}
|
||||||
|
} else if ( spaceAfter < rectWidth ) {
|
||||||
|
// Flip to show on left.
|
||||||
|
if ( spaceBefore > rectWidth )
|
||||||
|
left -= rectWidth;
|
||||||
|
// Align to window right.
|
||||||
|
else if ( viewportSize.width > rectWidth )
|
||||||
|
left = left - rect.right + viewportSize.width;
|
||||||
|
// Align to window left, never cutting the panel at left.
|
||||||
|
else
|
||||||
|
left = left - rect.left;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Check if the default vertical layout is possible.
|
||||||
|
var spaceBelow = viewportSize.height - rect.top,
|
||||||
|
spaceAbove = rect.top;
|
||||||
|
|
||||||
|
if ( spaceBelow < rectHeight ) {
|
||||||
|
// Flip to show above.
|
||||||
|
if ( spaceAbove > rectHeight )
|
||||||
|
top -= rectHeight;
|
||||||
|
// Align to window bottom.
|
||||||
|
else if ( viewportSize.height > rectHeight )
|
||||||
|
top = top - rect.bottom + viewportSize.height;
|
||||||
|
// Align to top, never cutting the panel at top.
|
||||||
|
else
|
||||||
|
top = top - rect.top;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If IE is in RTL, we have troubles with absolute
|
||||||
|
// position and horizontal scrolls. Here we have a
|
||||||
|
// series of hacks to workaround it. (#6146)
|
||||||
|
if ( CKEDITOR.env.ie ) {
|
||||||
|
var offsetParent = new CKEDITOR.dom.element( element.$.offsetParent ),
|
||||||
|
scrollParent = offsetParent;
|
||||||
|
|
||||||
|
// Quirks returns <body>, but standards returns <html>.
|
||||||
|
if ( scrollParent.getName() == 'html' )
|
||||||
|
scrollParent = scrollParent.getDocument().getBody();
|
||||||
|
|
||||||
|
if ( scrollParent.getComputedStyle( 'direction' ) == 'rtl' ) {
|
||||||
|
// For IE8, there is not much logic on this, but it works.
|
||||||
|
if ( CKEDITOR.env.ie8Compat )
|
||||||
|
left -= element.getDocument().getDocumentElement().$.scrollLeft * 2;
|
||||||
|
else
|
||||||
|
left -= ( offsetParent.$.scrollWidth - offsetParent.$.clientWidth );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trigger the onHide event of the previously active panel to prevent
|
||||||
|
// incorrect styles from being applied (#6170)
|
||||||
|
var innerElement = element.getFirst(),
|
||||||
|
activePanel;
|
||||||
|
if ( ( activePanel = innerElement.getCustomData( 'activePanel' ) ) )
|
||||||
|
activePanel.onHide && activePanel.onHide.call( this, 1 );
|
||||||
|
innerElement.setCustomData( 'activePanel', this );
|
||||||
|
|
||||||
|
element.setStyles( {
|
||||||
|
top: top + 'px',
|
||||||
|
left: left + 'px'
|
||||||
|
} );
|
||||||
|
element.setOpacity( 1 );
|
||||||
|
|
||||||
|
callback && callback();
|
||||||
|
}, this );
|
||||||
|
|
||||||
|
panel.isLoaded ? panelLoad() : panel.onLoad = panelLoad;
|
||||||
|
|
||||||
|
CKEDITOR.tools.setTimeout( function() {
|
||||||
|
var scrollTop = CKEDITOR.env.webkit && CKEDITOR.document.getWindow().getScrollPosition().y;
|
||||||
|
|
||||||
|
// Focus the panel frame first, so blur gets fired.
|
||||||
|
this.focus();
|
||||||
|
|
||||||
|
// Focus the block now.
|
||||||
|
block.element.focus();
|
||||||
|
|
||||||
|
// #10623, #10951 - restore the viewport's scroll position after focusing list element.
|
||||||
|
if ( CKEDITOR.env.webkit )
|
||||||
|
CKEDITOR.document.getBody().$.scrollTop = scrollTop;
|
||||||
|
|
||||||
|
// We need this get fired manually because of unfired focus() function.
|
||||||
|
this.allowBlur( true );
|
||||||
|
this._.editor.fire( 'panelShow', this );
|
||||||
|
}, 0, this );
|
||||||
|
}, CKEDITOR.env.air ? 200 : 0, this );
|
||||||
|
this.visible = 1;
|
||||||
|
|
||||||
|
if ( this.onShow )
|
||||||
|
this.onShow.call( this );
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restores last focused element or simply focus panel window.
|
||||||
|
*/
|
||||||
|
focus: function() {
|
||||||
|
// Webkit requires to blur any previous focused page element, in
|
||||||
|
// order to properly fire the "focus" event.
|
||||||
|
if ( CKEDITOR.env.webkit ) {
|
||||||
|
var active = CKEDITOR.document.getActive();
|
||||||
|
!active.equals( this._.iframe ) && active.$.blur();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Restore last focused element or simply focus panel window.
|
||||||
|
var focus = this._.lastFocused || this._.iframe.getFrameDocument().getWindow();
|
||||||
|
focus.focus();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo
|
||||||
|
*/
|
||||||
|
blur: function() {
|
||||||
|
var doc = this._.iframe.getFrameDocument(),
|
||||||
|
active = doc.getActive();
|
||||||
|
|
||||||
|
active.is( 'a' ) && ( this._.lastFocused = active );
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hides panel.
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
*/
|
||||||
|
hide: function( returnFocus ) {
|
||||||
|
if ( this.visible && ( !this.onHide || this.onHide.call( this ) !== true ) ) {
|
||||||
|
this.hideChild();
|
||||||
|
// Blur previously focused element. (#6671)
|
||||||
|
CKEDITOR.env.gecko && this._.iframe.getFrameDocument().$.activeElement.blur();
|
||||||
|
this.element.setStyle( 'display', 'none' );
|
||||||
|
this.visible = 0;
|
||||||
|
this.element.getFirst().removeCustomData( 'activePanel' );
|
||||||
|
|
||||||
|
// Return focus properly. (#6247)
|
||||||
|
var focusReturn = returnFocus && this._.returnFocus;
|
||||||
|
if ( focusReturn ) {
|
||||||
|
// Webkit requires focus moved out panel iframe first.
|
||||||
|
if ( CKEDITOR.env.webkit && focusReturn.type )
|
||||||
|
focusReturn.getWindow().$.focus();
|
||||||
|
|
||||||
|
focusReturn.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
delete this._.lastFocused;
|
||||||
|
|
||||||
|
this._.editor.fire( 'panelHide', this );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo
|
||||||
|
*/
|
||||||
|
allowBlur: function( allow ) // Prevent editor from hiding the panel. #3222.
|
||||||
|
{
|
||||||
|
var panel = this._.panel;
|
||||||
|
if ( allow != undefined )
|
||||||
|
panel.allowBlur = allow;
|
||||||
|
|
||||||
|
return panel.allowBlur;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows specified panel as a child of one block of this one.
|
||||||
|
*
|
||||||
|
* @param {CKEDITOR.ui.floatPanel} panel
|
||||||
|
* @param {String} blockName
|
||||||
|
* @param {CKEDITOR.dom.element} offsetParent Positioned parent.
|
||||||
|
* @param {Number} corner
|
||||||
|
*
|
||||||
|
* * For LTR (left to right) oriented editor:
|
||||||
|
* * `1` = top-left
|
||||||
|
* * `2` = top-right
|
||||||
|
* * `3` = bottom-right
|
||||||
|
* * `4` = bottom-left
|
||||||
|
* * For RTL (right to left):
|
||||||
|
* * `1` = top-right
|
||||||
|
* * `2` = top-left
|
||||||
|
* * `3` = bottom-left
|
||||||
|
* * `4` = bottom-right
|
||||||
|
*
|
||||||
|
* @param {Number} [offsetX=0]
|
||||||
|
* @param {Number} [offsetY=0]
|
||||||
|
* @todo
|
||||||
|
*/
|
||||||
|
showAsChild: function( panel, blockName, offsetParent, corner, offsetX, offsetY ) {
|
||||||
|
// Skip reshowing of child which is already visible.
|
||||||
|
if ( this._.activeChild == panel && panel._.panel._.offsetParentId == offsetParent.getId() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.hideChild();
|
||||||
|
|
||||||
|
panel.onHide = CKEDITOR.tools.bind( function() {
|
||||||
|
// Use a timeout, so we give time for this menu to get
|
||||||
|
// potentially focused.
|
||||||
|
CKEDITOR.tools.setTimeout( function() {
|
||||||
|
if ( !this._.focused )
|
||||||
|
this.hide();
|
||||||
|
}, 0, this );
|
||||||
|
}, this );
|
||||||
|
|
||||||
|
this._.activeChild = panel;
|
||||||
|
this._.focused = false;
|
||||||
|
|
||||||
|
panel.showBlock( blockName, offsetParent, corner, offsetX, offsetY );
|
||||||
|
this.blur();
|
||||||
|
|
||||||
|
/* #3767 IE: Second level menu may not have borders */
|
||||||
|
if ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) {
|
||||||
|
setTimeout( function() {
|
||||||
|
panel.element.getChild( 0 ).$.style.cssText += '';
|
||||||
|
}, 100 );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo
|
||||||
|
*/
|
||||||
|
hideChild: function( restoreFocus ) {
|
||||||
|
var activeChild = this._.activeChild;
|
||||||
|
|
||||||
|
if ( activeChild ) {
|
||||||
|
delete activeChild.onHide;
|
||||||
|
delete this._.activeChild;
|
||||||
|
activeChild.hide();
|
||||||
|
|
||||||
|
// At this point focus should be moved back to parent panel.
|
||||||
|
restoreFocus && this.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
CKEDITOR.on( 'instanceDestroyed', function() {
|
||||||
|
var isLastInstance = CKEDITOR.tools.isEmpty( CKEDITOR.instances );
|
||||||
|
|
||||||
|
for ( var i in panels ) {
|
||||||
|
var panel = panels[ i ];
|
||||||
|
// Safe to destroy it since there're no more instances.(#4241)
|
||||||
|
if ( isLastInstance )
|
||||||
|
panel.destroy();
|
||||||
|
// Panel might be used by other instances, just hide them.(#4552)
|
||||||
|
else
|
||||||
|
panel.element.hide();
|
||||||
|
}
|
||||||
|
// Remove the registration.
|
||||||
|
isLastInstance && ( panels = {} );
|
||||||
|
|
||||||
|
} );
|
||||||
|
} )();
|
18
plugins/ckeditor/plugins/format/lang/en.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
CKEDITOR.plugins.setLang( 'format', 'en', {
|
||||||
|
label: 'Format',
|
||||||
|
panelTitle: 'Paragraph Format',
|
||||||
|
tag_address: 'Address',
|
||||||
|
tag_div: 'Normal (DIV)',
|
||||||
|
tag_h1: 'Heading 1',
|
||||||
|
tag_h2: 'Heading 2',
|
||||||
|
tag_h3: 'Heading 3',
|
||||||
|
tag_h4: 'Heading 4',
|
||||||
|
tag_h5: 'Heading 5',
|
||||||
|
tag_h6: 'Heading 6',
|
||||||
|
tag_p: 'Normal',
|
||||||
|
tag_pre: 'Formatted'
|
||||||
|
} );
|
18
plugins/ckeditor/plugins/format/lang/hu.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
CKEDITOR.plugins.setLang( 'format', 'hu', {
|
||||||
|
label: 'Formátum',
|
||||||
|
panelTitle: 'Formátum',
|
||||||
|
tag_address: 'Címsor',
|
||||||
|
tag_div: 'Bekezdés (DIV)',
|
||||||
|
tag_h1: 'Fejléc 1',
|
||||||
|
tag_h2: 'Fejléc 2',
|
||||||
|
tag_h3: 'Fejléc 3',
|
||||||
|
tag_h4: 'Fejléc 4',
|
||||||
|
tag_h5: 'Fejléc 5',
|
||||||
|
tag_h6: 'Fejléc 6',
|
||||||
|
tag_p: 'Normál',
|
||||||
|
tag_pre: 'Formázott'
|
||||||
|
} );
|
244
plugins/ckeditor/plugins/format/plugin.js
Normal file
@ -0,0 +1,244 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
|
||||||
|
CKEDITOR.plugins.add( 'format', {
|
||||||
|
requires: 'richcombo',
|
||||||
|
lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE%
|
||||||
|
init: function( editor ) {
|
||||||
|
if ( editor.blockless )
|
||||||
|
return;
|
||||||
|
|
||||||
|
var config = editor.config,
|
||||||
|
lang = editor.lang.format;
|
||||||
|
|
||||||
|
// Gets the list of tags from the settings.
|
||||||
|
var tags = config.format_tags.split( ';' );
|
||||||
|
|
||||||
|
// Create style objects for all defined styles.
|
||||||
|
var styles = {},
|
||||||
|
stylesCount = 0,
|
||||||
|
allowedContent = [];
|
||||||
|
for ( var i = 0; i < tags.length; i++ ) {
|
||||||
|
var tag = tags[ i ];
|
||||||
|
var style = new CKEDITOR.style( config[ 'format_' + tag ] );
|
||||||
|
if ( !editor.filter.customConfig || editor.filter.check( style ) ) {
|
||||||
|
stylesCount++;
|
||||||
|
styles[ tag ] = style;
|
||||||
|
styles[ tag ]._.enterMode = editor.config.enterMode;
|
||||||
|
allowedContent.push( style );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide entire combo when all formats are rejected.
|
||||||
|
if ( stylesCount === 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
editor.ui.addRichCombo( 'Format', {
|
||||||
|
label: lang.label,
|
||||||
|
title: lang.panelTitle,
|
||||||
|
toolbar: 'styles,20',
|
||||||
|
allowedContent: allowedContent,
|
||||||
|
|
||||||
|
panel: {
|
||||||
|
css: [ CKEDITOR.skin.getPath( 'editor' ) ].concat( config.contentsCss ),
|
||||||
|
multiSelect: false,
|
||||||
|
attributes: { 'aria-label': lang.panelTitle }
|
||||||
|
},
|
||||||
|
|
||||||
|
init: function() {
|
||||||
|
this.startGroup( lang.panelTitle );
|
||||||
|
|
||||||
|
for ( var tag in styles ) {
|
||||||
|
var label = lang[ 'tag_' + tag ];
|
||||||
|
|
||||||
|
// Add the tag entry to the panel list.
|
||||||
|
this.add( tag, styles[ tag ].buildPreview( label ), label );
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onClick: function( value ) {
|
||||||
|
editor.focus();
|
||||||
|
editor.fire( 'saveSnapshot' );
|
||||||
|
|
||||||
|
var style = styles[ value ],
|
||||||
|
elementPath = editor.elementPath();
|
||||||
|
|
||||||
|
editor[ style.checkActive( elementPath ) ? 'removeStyle' : 'applyStyle' ]( style );
|
||||||
|
|
||||||
|
// Save the undo snapshot after all changes are affected. (#4899)
|
||||||
|
setTimeout( function() {
|
||||||
|
editor.fire( 'saveSnapshot' );
|
||||||
|
}, 0 );
|
||||||
|
},
|
||||||
|
|
||||||
|
onRender: function() {
|
||||||
|
editor.on( 'selectionChange', function( ev ) {
|
||||||
|
var currentTag = this.getValue(),
|
||||||
|
elementPath = ev.data.path;
|
||||||
|
|
||||||
|
this.refresh();
|
||||||
|
|
||||||
|
for ( var tag in styles ) {
|
||||||
|
if ( styles[ tag ].checkActive( elementPath ) ) {
|
||||||
|
if ( tag != currentTag )
|
||||||
|
this.setValue( tag, editor.lang.format[ 'tag_' + tag ] );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If no styles match, just empty it.
|
||||||
|
this.setValue( '' );
|
||||||
|
|
||||||
|
}, this );
|
||||||
|
},
|
||||||
|
|
||||||
|
onOpen: function() {
|
||||||
|
this.showAll();
|
||||||
|
for ( var name in styles ) {
|
||||||
|
var style = styles[ name ];
|
||||||
|
|
||||||
|
// Check if that style is enabled in activeFilter.
|
||||||
|
if ( !editor.activeFilter.check( style ) )
|
||||||
|
this.hideItem( name );
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
refresh: function() {
|
||||||
|
var elementPath = editor.elementPath();
|
||||||
|
|
||||||
|
if ( !elementPath )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Check if element path contains 'p' element.
|
||||||
|
if ( !elementPath.isContextFor( 'p' ) ) {
|
||||||
|
this.setState( CKEDITOR.TRISTATE_DISABLED );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if there is any available style.
|
||||||
|
for ( var name in styles ) {
|
||||||
|
if ( editor.activeFilter.check( styles[ name ] ) )
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setState( CKEDITOR.TRISTATE_DISABLED );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A list of semi colon separated style names (by default tags) representing
|
||||||
|
* the style definition for each entry to be displayed in the Format combo in
|
||||||
|
* the toolbar. Each entry must have its relative definition configuration in a
|
||||||
|
* setting named `'format_(tagName)'`. For example, the `'p'` entry has its
|
||||||
|
* definition taken from `config.format_p`.
|
||||||
|
*
|
||||||
|
* config.format_tags = 'p;h2;h3;pre';
|
||||||
|
*
|
||||||
|
* @cfg {String} [format_tags='p;h1;h2;h3;h4;h5;h6;pre;address;div']
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
CKEDITOR.config.format_tags = 'p;h1;h2;h3;h4;h5;h6;pre;address;div';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The style definition to be used to apply the `'Normal'` format.
|
||||||
|
*
|
||||||
|
* config.format_p = { element: 'p', attributes: { 'class': 'normalPara' } };
|
||||||
|
*
|
||||||
|
* @cfg {Object} [format_p={ element: 'p' }]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
CKEDITOR.config.format_p = { element: 'p' };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The style definition to be used to apply the `'Normal (DIV)'` format.
|
||||||
|
*
|
||||||
|
* config.format_div = { element: 'div', attributes: { 'class': 'normalDiv' } };
|
||||||
|
*
|
||||||
|
* @cfg {Object} [format_div={ element: 'div' }]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
CKEDITOR.config.format_div = { element: 'div' };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The style definition to be used to apply the `'Formatted'` format.
|
||||||
|
*
|
||||||
|
* config.format_pre = { element: 'pre', attributes: { 'class': 'code' } };
|
||||||
|
*
|
||||||
|
* @cfg {Object} [format_pre={ element: 'pre' }]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
CKEDITOR.config.format_pre = { element: 'pre' };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The style definition to be used to apply the `'Address'` format.
|
||||||
|
*
|
||||||
|
* config.format_address = { element: 'address', attributes: { 'class': 'styledAddress' } };
|
||||||
|
*
|
||||||
|
* @cfg {Object} [format_address={ element: 'address' }]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
CKEDITOR.config.format_address = { element: 'address' };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The style definition to be used to apply the `'Heading 1'` format.
|
||||||
|
*
|
||||||
|
* config.format_h1 = { element: 'h1', attributes: { 'class': 'contentTitle1' } };
|
||||||
|
*
|
||||||
|
* @cfg {Object} [format_h1={ element: 'h1' }]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
CKEDITOR.config.format_h1 = { element: 'h1' };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The style definition to be used to apply the `'Heading 2'` format.
|
||||||
|
*
|
||||||
|
* config.format_h2 = { element: 'h2', attributes: { 'class': 'contentTitle2' } };
|
||||||
|
*
|
||||||
|
* @cfg {Object} [format_h2={ element: 'h2' }]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
CKEDITOR.config.format_h2 = { element: 'h2' };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The style definition to be used to apply the `'Heading 3'` format.
|
||||||
|
*
|
||||||
|
* config.format_h3 = { element: 'h3', attributes: { 'class': 'contentTitle3' } };
|
||||||
|
*
|
||||||
|
* @cfg {Object} [format_h3={ element: 'h3' }]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
CKEDITOR.config.format_h3 = { element: 'h3' };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The style definition to be used to apply the `'Heading 4'` format.
|
||||||
|
*
|
||||||
|
* config.format_h4 = { element: 'h4', attributes: { 'class': 'contentTitle4' } };
|
||||||
|
*
|
||||||
|
* @cfg {Object} [format_h4={ element: 'h4' }]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
CKEDITOR.config.format_h4 = { element: 'h4' };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The style definition to be used to apply the `'Heading 5'` format.
|
||||||
|
*
|
||||||
|
* config.format_h5 = { element: 'h5', attributes: { 'class': 'contentTitle5' } };
|
||||||
|
*
|
||||||
|
* @cfg {Object} [format_h5={ element: 'h5' }]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
CKEDITOR.config.format_h5 = { element: 'h5' };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The style definition to be used to apply the `'Heading 6'` format.
|
||||||
|
*
|
||||||
|
* config.format_h6 = { element: 'h6', attributes: { 'class': 'contentTitle6' } };
|
||||||
|
*
|
||||||
|
* @cfg {Object} [format_h6={ element: 'h6' }]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
CKEDITOR.config.format_h6 = { element: 'h6' };
|
BIN
plugins/ckeditor/plugins/htmlbuttons/icon1.png
Normal file
After Width: | Height: | Size: 827 B |
BIN
plugins/ckeditor/plugins/htmlbuttons/icon2.png
Normal file
After Width: | Height: | Size: 767 B |
BIN
plugins/ckeditor/plugins/htmlbuttons/icon3.png
Normal file
After Width: | Height: | Size: 819 B |
71
plugins/ckeditor/plugins/htmlbuttons/plugin.js
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* @file HTML Buttons plugin for CKEditor
|
||||||
|
* Copyright (C) 2012 Alfonso Martínez de Lizarrondo
|
||||||
|
* A simple plugin to help create custom buttons to insert HTML blocks
|
||||||
|
*/
|
||||||
|
|
||||||
|
CKEDITOR.plugins.add( 'htmlbuttons',
|
||||||
|
{
|
||||||
|
init : function( editor )
|
||||||
|
{
|
||||||
|
var buttonsConfig = editor.config.htmlbuttons;
|
||||||
|
if (!buttonsConfig)
|
||||||
|
return;
|
||||||
|
|
||||||
|
function createCommand( definition )
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
exec: function( editor ) {
|
||||||
|
editor.insertHtml( definition.html );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the command for each button
|
||||||
|
for(var i=0; i<buttonsConfig.length; i++)
|
||||||
|
{
|
||||||
|
var button = buttonsConfig[ i ];
|
||||||
|
var commandName = button.name;
|
||||||
|
editor.addCommand( commandName, createCommand(button, editor) );
|
||||||
|
|
||||||
|
editor.ui.addButton( commandName,
|
||||||
|
{
|
||||||
|
label : button.title,
|
||||||
|
command : commandName,
|
||||||
|
icon : this.path + button.icon
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} //Init
|
||||||
|
|
||||||
|
} );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An array of buttons to add to the toolbar.
|
||||||
|
* Each button is an object with these properties:
|
||||||
|
* name: The name of the command and the button (the one to use in the toolbar configuration)
|
||||||
|
* icon: The icon to use. Place them in the plugin folder
|
||||||
|
* html: The HTML to insert when the user clicks the button
|
||||||
|
* title: Title that appears while hovering the button
|
||||||
|
*
|
||||||
|
* Default configuration with some sample buttons:
|
||||||
|
*/
|
||||||
|
CKEDITOR.config.htmlbuttons = [
|
||||||
|
{
|
||||||
|
name:'button1',
|
||||||
|
icon:'icon1.png',
|
||||||
|
html:'<a href="http://www.google.com">Search something</a>',
|
||||||
|
title:'A link to Google'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:'button2',
|
||||||
|
icon:'icon2.png',
|
||||||
|
html:'<table style="min-width:200px"><tr><td> </td><td> </td></tr><tr><td> </td><td> </td></tr></table>',
|
||||||
|
title:'A simple table'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:'button3',
|
||||||
|
icon:'icon3.png',
|
||||||
|
html:'<ol><li>Item 1 <ol><li>Sub item 1</li><li>Sub item 2</li></ol></li></ol>',
|
||||||
|
title:'A nested list'
|
||||||
|
}
|
||||||
|
];
|
359
plugins/ckeditor/plugins/htmlwriter/plugin.js
Normal file
@ -0,0 +1,359 @@
|
|||||||
|
/**
|
||||||
|
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
* For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
*/
|
||||||
|
|
||||||
|
CKEDITOR.plugins.add( 'htmlwriter', {
|
||||||
|
init: function( editor ) {
|
||||||
|
var writer = new CKEDITOR.htmlWriter();
|
||||||
|
|
||||||
|
writer.forceSimpleAmpersand = editor.config.forceSimpleAmpersand;
|
||||||
|
writer.indentationChars = editor.config.dataIndentationChars || '\t';
|
||||||
|
|
||||||
|
// Overwrite default basicWriter initialized in hmtlDataProcessor constructor.
|
||||||
|
editor.dataProcessor.writer = writer;
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class used to write HTML data.
|
||||||
|
*
|
||||||
|
* var writer = new CKEDITOR.htmlWriter();
|
||||||
|
* writer.openTag( 'p' );
|
||||||
|
* writer.attribute( 'class', 'MyClass' );
|
||||||
|
* writer.openTagClose( 'p' );
|
||||||
|
* writer.text( 'Hello' );
|
||||||
|
* writer.closeTag( 'p' );
|
||||||
|
* alert( writer.getHtml() ); // '<p class="MyClass">Hello</p>'
|
||||||
|
*
|
||||||
|
* @class
|
||||||
|
* @extends CKEDITOR.htmlParser.basicWriter
|
||||||
|
*/
|
||||||
|
CKEDITOR.htmlWriter = CKEDITOR.tools.createClass( {
|
||||||
|
base: CKEDITOR.htmlParser.basicWriter,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a htmlWriter class instance.
|
||||||
|
*
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
$: function() {
|
||||||
|
// Call the base contructor.
|
||||||
|
this.base();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The characters to be used for each identation step.
|
||||||
|
*
|
||||||
|
* // Use tab for indentation.
|
||||||
|
* editorInstance.dataProcessor.writer.indentationChars = '\t';
|
||||||
|
*/
|
||||||
|
this.indentationChars = '\t';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The characters to be used to close "self-closing" elements, like `<br>` or `<img>`.
|
||||||
|
*
|
||||||
|
* // Use HTML4 notation for self-closing elements.
|
||||||
|
* editorInstance.dataProcessor.writer.selfClosingEnd = '>';
|
||||||
|
*/
|
||||||
|
this.selfClosingEnd = ' />';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The characters to be used for line breaks.
|
||||||
|
*
|
||||||
|
* // Use CRLF for line breaks.
|
||||||
|
* editorInstance.dataProcessor.writer.lineBreakChars = '\r\n';
|
||||||
|
*/
|
||||||
|
this.lineBreakChars = '\n';
|
||||||
|
|
||||||
|
this.sortAttributes = 1;
|
||||||
|
|
||||||
|
this._.indent = 0;
|
||||||
|
this._.indentation = '';
|
||||||
|
// Indicate preformatted block context status. (#5789)
|
||||||
|
this._.inPre = 0;
|
||||||
|
this._.rules = {};
|
||||||
|
|
||||||
|
var dtd = CKEDITOR.dtd;
|
||||||
|
|
||||||
|
for ( var e in CKEDITOR.tools.extend( {}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent ) ) {
|
||||||
|
this.setRules( e, {
|
||||||
|
indent: !dtd[ e ][ '#' ],
|
||||||
|
breakBeforeOpen: 1,
|
||||||
|
breakBeforeClose: !dtd[ e ][ '#' ],
|
||||||
|
breakAfterClose: 1,
|
||||||
|
needsSpace: ( e in dtd.$block ) && !( e in { li: 1, dt: 1, dd: 1 } )
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setRules( 'br', { breakAfterOpen: 1 } );
|
||||||
|
|
||||||
|
this.setRules( 'title', {
|
||||||
|
indent: 0,
|
||||||
|
breakAfterOpen: 0
|
||||||
|
} );
|
||||||
|
|
||||||
|
this.setRules( 'style', {
|
||||||
|
indent: 0,
|
||||||
|
breakBeforeClose: 1
|
||||||
|
} );
|
||||||
|
|
||||||
|
this.setRules( 'pre', {
|
||||||
|
breakAfterOpen: 1, // Keep line break after the opening tag
|
||||||
|
indent: 0 // Disable indentation on <pre>.
|
||||||
|
} );
|
||||||
|
},
|
||||||
|
|
||||||
|
proto: {
|
||||||
|
/**
|
||||||
|
* Writes the tag opening part for a opener tag.
|
||||||
|
*
|
||||||
|
* // Writes '<p'.
|
||||||
|
* writer.openTag( 'p', { class : 'MyClass', id : 'MyId' } );
|
||||||
|
*
|
||||||
|
* @param {String} tagName The element name for this tag.
|
||||||
|
* @param {Object} attributes The attributes defined for this tag. The
|
||||||
|
* attributes could be used to inspect the tag.
|
||||||
|
*/
|
||||||
|
openTag: function( tagName, attributes ) {
|
||||||
|
var rules = this._.rules[ tagName ];
|
||||||
|
|
||||||
|
if ( this._.afterCloser && rules && rules.needsSpace && this._.needsSpace )
|
||||||
|
this._.output.push( '\n' );
|
||||||
|
|
||||||
|
if ( this._.indent )
|
||||||
|
this.indentation();
|
||||||
|
// Do not break if indenting.
|
||||||
|
else if ( rules && rules.breakBeforeOpen ) {
|
||||||
|
this.lineBreak();
|
||||||
|
this.indentation();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._.output.push( '<', tagName );
|
||||||
|
|
||||||
|
this._.afterCloser = 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes the tag closing part for a opener tag.
|
||||||
|
*
|
||||||
|
* // Writes '>'.
|
||||||
|
* writer.openTagClose( 'p', false );
|
||||||
|
*
|
||||||
|
* // Writes ' />'.
|
||||||
|
* writer.openTagClose( 'br', true );
|
||||||
|
*
|
||||||
|
* @param {String} tagName The element name for this tag.
|
||||||
|
* @param {Boolean} isSelfClose Indicates that this is a self-closing tag,
|
||||||
|
* like `<br>` or `<img>`.
|
||||||
|
*/
|
||||||
|
openTagClose: function( tagName, isSelfClose ) {
|
||||||
|
var rules = this._.rules[ tagName ];
|
||||||
|
|
||||||
|
if ( isSelfClose ) {
|
||||||
|
this._.output.push( this.selfClosingEnd );
|
||||||
|
|
||||||
|
if ( rules && rules.breakAfterClose )
|
||||||
|
this._.needsSpace = rules.needsSpace;
|
||||||
|
} else {
|
||||||
|
this._.output.push( '>' );
|
||||||
|
|
||||||
|
if ( rules && rules.indent )
|
||||||
|
this._.indentation += this.indentationChars;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( rules && rules.breakAfterOpen )
|
||||||
|
this.lineBreak();
|
||||||
|
tagName == 'pre' && ( this._.inPre = 1 );
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes an attribute. This function should be called after opening the
|
||||||
|
* tag with {@link #openTagClose}.
|
||||||
|
*
|
||||||
|
* // Writes ' class="MyClass"'.
|
||||||
|
* writer.attribute( 'class', 'MyClass' );
|
||||||
|
*
|
||||||
|
* @param {String} attName The attribute name.
|
||||||
|
* @param {String} attValue The attribute value.
|
||||||
|
*/
|
||||||
|
attribute: function( attName, attValue ) {
|
||||||
|
|
||||||
|
if ( typeof attValue == 'string' ) {
|
||||||
|
this.forceSimpleAmpersand && ( attValue = attValue.replace( /&/g, '&' ) );
|
||||||
|
// Browsers don't always escape special character in attribute values. (#4683, #4719).
|
||||||
|
attValue = CKEDITOR.tools.htmlEncodeAttr( attValue );
|
||||||
|
}
|
||||||
|
|
||||||
|
this._.output.push( ' ', attName, '="', attValue, '"' );
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes a closer tag.
|
||||||
|
*
|
||||||
|
* // Writes '</p>'.
|
||||||
|
* writer.closeTag( 'p' );
|
||||||
|
*
|
||||||
|
* @param {String} tagName The element name for this tag.
|
||||||
|
*/
|
||||||
|
closeTag: function( tagName ) {
|
||||||
|
var rules = this._.rules[ tagName ];
|
||||||
|
|
||||||
|
if ( rules && rules.indent )
|
||||||
|
this._.indentation = this._.indentation.substr( this.indentationChars.length );
|
||||||
|
|
||||||
|
if ( this._.indent )
|
||||||
|
this.indentation();
|
||||||
|
// Do not break if indenting.
|
||||||
|
else if ( rules && rules.breakBeforeClose ) {
|
||||||
|
this.lineBreak();
|
||||||
|
this.indentation();
|
||||||
|
}
|
||||||
|
|
||||||
|
this._.output.push( '</', tagName, '>' );
|
||||||
|
tagName == 'pre' && ( this._.inPre = 0 );
|
||||||
|
|
||||||
|
if ( rules && rules.breakAfterClose ) {
|
||||||
|
this.lineBreak();
|
||||||
|
this._.needsSpace = rules.needsSpace;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._.afterCloser = 1;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes text.
|
||||||
|
*
|
||||||
|
* // Writes 'Hello Word'.
|
||||||
|
* writer.text( 'Hello Word' );
|
||||||
|
*
|
||||||
|
* @param {String} text The text value
|
||||||
|
*/
|
||||||
|
text: function( text ) {
|
||||||
|
if ( this._.indent ) {
|
||||||
|
this.indentation();
|
||||||
|
!this._.inPre && ( text = CKEDITOR.tools.ltrim( text ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
this._.output.push( text );
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes a comment.
|
||||||
|
*
|
||||||
|
* // Writes "<!-- My comment -->".
|
||||||
|
* writer.comment( ' My comment ' );
|
||||||
|
*
|
||||||
|
* @param {String} comment The comment text.
|
||||||
|
*/
|
||||||
|
comment: function( comment ) {
|
||||||
|
if ( this._.indent )
|
||||||
|
this.indentation();
|
||||||
|
|
||||||
|
this._.output.push( '<!--', comment, '-->' );
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes a line break. It uses the {@link #lineBreakChars} property for it.
|
||||||
|
*
|
||||||
|
* // Writes '\n' (e.g.).
|
||||||
|
* writer.lineBreak();
|
||||||
|
*/
|
||||||
|
lineBreak: function() {
|
||||||
|
if ( !this._.inPre && this._.output.length > 0 )
|
||||||
|
this._.output.push( this.lineBreakChars );
|
||||||
|
this._.indent = 1;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes the current indentation chars. It uses the {@link #indentationChars}
|
||||||
|
* property, repeating it for the current indentation steps.
|
||||||
|
*
|
||||||
|
* // Writes '\t' (e.g.).
|
||||||
|
* writer.indentation();
|
||||||
|
*/
|
||||||
|
indentation: function() {
|
||||||
|
if ( !this._.inPre && this._.indentation )
|
||||||
|
this._.output.push( this._.indentation );
|
||||||
|
this._.indent = 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Empties the current output buffer. It also brings back the default
|
||||||
|
* values of the writer flags.
|
||||||
|
*
|
||||||
|
* writer.reset();
|
||||||
|
*/
|
||||||
|
reset: function() {
|
||||||
|
this._.output = [];
|
||||||
|
this._.indent = 0;
|
||||||
|
this._.indentation = '';
|
||||||
|
this._.afterCloser = 0;
|
||||||
|
this._.inPre = 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets formatting rules for a give element. The possible rules are:
|
||||||
|
*
|
||||||
|
* * `indent`: indent the element contents.
|
||||||
|
* * `breakBeforeOpen`: break line before the opener tag for this element.
|
||||||
|
* * `breakAfterOpen`: break line after the opener tag for this element.
|
||||||
|
* * `breakBeforeClose`: break line before the closer tag for this element.
|
||||||
|
* * `breakAfterClose`: break line after the closer tag for this element.
|
||||||
|
*
|
||||||
|
* All rules default to `false`. Each call to the function overrides
|
||||||
|
* already present rules, leaving the undefined untouched.
|
||||||
|
*
|
||||||
|
* By default, all elements available in the {@link CKEDITOR.dtd#$block},
|
||||||
|
* {@link CKEDITOR.dtd#$listItem} and {@link CKEDITOR.dtd#$tableContent}
|
||||||
|
* lists have all the above rules set to `true`. Additionaly, the `<br>`
|
||||||
|
* element has the `breakAfterOpen` set to `true`.
|
||||||
|
*
|
||||||
|
* // Break line before and after "img" tags.
|
||||||
|
* writer.setRules( 'img', {
|
||||||
|
* breakBeforeOpen: true
|
||||||
|
* breakAfterOpen: true
|
||||||
|
* } );
|
||||||
|
*
|
||||||
|
* // Reset the rules for the "h1" tag.
|
||||||
|
* writer.setRules( 'h1', {} );
|
||||||
|
*
|
||||||
|
* @param {String} tagName The element name to which set the rules.
|
||||||
|
* @param {Object} rules An object containing the element rules.
|
||||||
|
*/
|
||||||
|
setRules: function( tagName, rules ) {
|
||||||
|
var currentRules = this._.rules[ tagName ];
|
||||||
|
|
||||||
|
if ( currentRules )
|
||||||
|
CKEDITOR.tools.extend( currentRules, rules, true );
|
||||||
|
else
|
||||||
|
this._.rules[ tagName ] = rules;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to force using `'&'` instead of `'&'` in elements attributes
|
||||||
|
* values, it's not recommended to change this setting for compliance with the
|
||||||
|
* W3C XHTML 1.0 standards ([C.12, XHTML 1.0](http://www.w3.org/TR/xhtml1/#C_12)).
|
||||||
|
*
|
||||||
|
* // Use `'&'` instead of `'&'`
|
||||||
|
* CKEDITOR.config.forceSimpleAmpersand = true;
|
||||||
|
*
|
||||||
|
* @cfg {Boolean} [forceSimpleAmpersand=false]
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The characters to be used for indenting the HTML produced by the editor.
|
||||||
|
* Using characters different than `' '` (space) and `'\t'` (tab) is definitely
|
||||||
|
* a bad idea as it'll mess the code.
|
||||||
|
*
|
||||||
|
* // No indentation.
|
||||||
|
* CKEDITOR.config.dataIndentationChars = '';
|
||||||
|
*
|
||||||
|
* // Use two spaces for indentation.
|
||||||
|
* CKEDITOR.config.dataIndentationChars = ' ';
|
||||||
|
*
|
||||||
|
* @cfg {String} [dataIndentationChars='\t']
|
||||||
|
* @member CKEDITOR.config
|
||||||
|
*/
|
280
plugins/ckeditor/plugins/htmlwriter/samples/outputforflash.html
Normal file
@ -0,0 +1,280 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<!--
|
||||||
|
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||||
|
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||||
|
-->
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Output for Flash — CKEditor Sample</title>
|
||||||
|
<script src="../../../ckeditor.js"></script>
|
||||||
|
<script src="../../../samples/sample.js"></script>
|
||||||
|
<script src="assets/outputforflash/swfobject.js"></script>
|
||||||
|
<link href="../../../samples/sample.css" rel="stylesheet">
|
||||||
|
<meta name="ckeditor-sample-required-plugins" content="sourcearea">
|
||||||
|
<meta name="ckeditor-sample-name" content="Output for Flash">
|
||||||
|
<meta name="ckeditor-sample-group" content="Advanced Samples">
|
||||||
|
<meta name="ckeditor-sample-description" content="Configuring CKEditor to produce HTML code that can be used with Adobe Flash.">
|
||||||
|
<style>
|
||||||
|
|
||||||
|
.alert
|
||||||
|
{
|
||||||
|
background: #ffa84c;
|
||||||
|
padding: 10px 15px;
|
||||||
|
font-weight: bold;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1 class="samples">
|
||||||
|
<a href="../../../samples/index.html">CKEditor Samples</a> » Producing Flash Compliant HTML Output
|
||||||
|
</h1>
|
||||||
|
<div class="description">
|
||||||
|
<p>
|
||||||
|
This sample shows how to configure CKEditor to output
|
||||||
|
HTML code that can be used with
|
||||||
|
<a class="samples" href="http://www.adobe.com/livedocs/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000922.html">
|
||||||
|
Adobe Flash</a>.
|
||||||
|
The code will contain a subset of standard HTML elements like <code><b></code>,
|
||||||
|
<code><i></code>, and <code><p></code> as well as HTML attributes.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
To add a CKEditor instance outputting Flash compliant HTML code, load the editor using a standard
|
||||||
|
JavaScript call, and define CKEditor features to use HTML elements and attributes.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
For details on how to create this setup check the source code of this sample page.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
To see how it works, create some content in the editing area of CKEditor on the left
|
||||||
|
and send it to the Flash object on the right side of the page by using the
|
||||||
|
<strong>Send to Flash</strong> button.
|
||||||
|
</p>
|
||||||
|
<table style="width: 100%; border-spacing: 0; border-collapse:collapse;">
|
||||||
|
<tr>
|
||||||
|
<td style="width: 100%">
|
||||||
|
<textarea cols="80" id="editor1" name="editor1" rows="10"><p><b><font size="18" style="font-size:18px;">Flash and HTML</font></b></p><p>&nbsp;</p><p>It is possible to have <a href="http://ckeditor.com">CKEditor</a> creating content that will be later loaded inside <b>Flash</b> objects and animations.</p><p>&nbsp;</p><p>Flash has a few limitations when dealing with HTML:</p><p>&nbsp;</p><ul><li>It has limited support on tags.</li><li>There is no margin between block elements, like paragraphs.</li></ul></textarea>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
if ( document.location.protocol == 'file:' )
|
||||||
|
alert( 'Warning: This samples does not work when loaded from local filesystem' +
|
||||||
|
'due to security restrictions implemented in Flash.' +
|
||||||
|
'\n\nPlease load the sample from a web server instead.' );
|
||||||
|
|
||||||
|
var editor = CKEDITOR.replace( 'editor1', {
|
||||||
|
/*
|
||||||
|
* Ensure that htmlwriter plugin, which is required for this sample, is loaded.
|
||||||
|
*/
|
||||||
|
extraPlugins: 'htmlwriter',
|
||||||
|
|
||||||
|
height: 290,
|
||||||
|
width: '100%',
|
||||||
|
toolbar: [
|
||||||
|
[ 'Source', '-', 'Bold', 'Italic', 'Underline', '-', 'BulletedList', '-', 'Link', 'Unlink' ],
|
||||||
|
[ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ],
|
||||||
|
'/',
|
||||||
|
[ 'Font', 'FontSize' ],
|
||||||
|
[ 'TextColor', '-', 'About' ]
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Style sheet for the contents
|
||||||
|
*/
|
||||||
|
contentsCss: 'body {color:#000; background-color#FFF; font-family: Arial; font-size:80%;} p, ol, ul {margin-top: 0px; margin-bottom: 0px;}',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Quirks doctype
|
||||||
|
*/
|
||||||
|
docType: '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Core styles.
|
||||||
|
*/
|
||||||
|
coreStyles_bold: { element: 'b' },
|
||||||
|
coreStyles_italic: { element: 'i' },
|
||||||
|
coreStyles_underline: { element: 'u' },
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Font face.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Define the way font elements will be applied to the document. The "font"
|
||||||
|
// element will be used.
|
||||||
|
font_style: {
|
||||||
|
element: 'font',
|
||||||
|
attributes: { 'face': '#(family)' }
|
||||||
|
},
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Font sizes.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// The CSS part of the font sizes isn't used by Flash, it is there to get the
|
||||||
|
// font rendered correctly in CKEditor.
|
||||||
|
fontSize_sizes: '8px/8;9px/9;10px/10;11px/11;12px/12;14px/14;16px/16;18px/18;20px/20;22px/22;24px/24;26px/26;28px/28;36px/36;48px/48;72px/72',
|
||||||
|
fontSize_style: {
|
||||||
|
element: 'font',
|
||||||
|
attributes: { 'size': '#(size)' },
|
||||||
|
styles: { 'font-size': '#(size)px' }
|
||||||
|
} ,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Font colors.
|
||||||
|
*/
|
||||||
|
colorButton_enableMore: true,
|
||||||
|
|
||||||
|
colorButton_foreStyle: {
|
||||||
|
element: 'font',
|
||||||
|
attributes: { 'color': '#(color)' }
|
||||||
|
},
|
||||||
|
|
||||||
|
colorButton_backStyle: {
|
||||||
|
element: 'font',
|
||||||
|
styles: { 'background-color': '#(color)' }
|
||||||
|
},
|
||||||
|
|
||||||
|
on: { 'instanceReady': configureFlashOutput }
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Adjust the behavior of the dataProcessor to match the
|
||||||
|
* requirements of Flash
|
||||||
|
*/
|
||||||
|
function configureFlashOutput( ev ) {
|
||||||
|
var editor = ev.editor,
|
||||||
|
dataProcessor = editor.dataProcessor,
|
||||||
|
htmlFilter = dataProcessor && dataProcessor.htmlFilter;
|
||||||
|
|
||||||
|
// Out self closing tags the HTML4 way, like <br>.
|
||||||
|
dataProcessor.writer.selfClosingEnd = '>';
|
||||||
|
|
||||||
|
// Make output formatting match Flash expectations
|
||||||
|
var dtd = CKEDITOR.dtd;
|
||||||
|
for ( var e in CKEDITOR.tools.extend( {}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent ) ) {
|
||||||
|
dataProcessor.writer.setRules( e, {
|
||||||
|
indent: false,
|
||||||
|
breakBeforeOpen: false,
|
||||||
|
breakAfterOpen: false,
|
||||||
|
breakBeforeClose: false,
|
||||||
|
breakAfterClose: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
dataProcessor.writer.setRules( 'br', {
|
||||||
|
indent: false,
|
||||||
|
breakBeforeOpen: false,
|
||||||
|
breakAfterOpen: false,
|
||||||
|
breakBeforeClose: false,
|
||||||
|
breakAfterClose: false
|
||||||
|
});
|
||||||
|
|
||||||
|
// Output properties as attributes, not styles.
|
||||||
|
htmlFilter.addRules( {
|
||||||
|
elements: {
|
||||||
|
$: function( element ) {
|
||||||
|
var style, match, width, height, align;
|
||||||
|
|
||||||
|
// Output dimensions of images as width and height
|
||||||
|
if ( element.name == 'img' ) {
|
||||||
|
style = element.attributes.style;
|
||||||
|
|
||||||
|
if ( style ) {
|
||||||
|
// Get the width from the style.
|
||||||
|
match = ( /(?:^|\s)width\s*:\s*(\d+)px/i ).exec( style );
|
||||||
|
width = match && match[1];
|
||||||
|
|
||||||
|
// Get the height from the style.
|
||||||
|
match = ( /(?:^|\s)height\s*:\s*(\d+)px/i ).exec( style );
|
||||||
|
height = match && match[1];
|
||||||
|
|
||||||
|
if ( width ) {
|
||||||
|
element.attributes.style = element.attributes.style.replace( /(?:^|\s)width\s*:\s*(\d+)px;?/i , '' );
|
||||||
|
element.attributes.width = width;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( height ) {
|
||||||
|
element.attributes.style = element.attributes.style.replace( /(?:^|\s)height\s*:\s*(\d+)px;?/i , '' );
|
||||||
|
element.attributes.height = height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Output alignment of paragraphs using align
|
||||||
|
if ( element.name == 'p' ) {
|
||||||
|
style = element.attributes.style;
|
||||||
|
|
||||||
|
if ( style ) {
|
||||||
|
// Get the align from the style.
|
||||||
|
match = ( /(?:^|\s)text-align\s*:\s*(\w*);?/i ).exec( style );
|
||||||
|
align = match && match[1];
|
||||||
|
|
||||||
|
if ( align ) {
|
||||||
|
element.attributes.style = element.attributes.style.replace( /(?:^|\s)text-align\s*:\s*(\w*);?/i , '' );
|
||||||
|
element.attributes.align = align;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( element.attributes.style === '' )
|
||||||
|
delete element.attributes.style;
|
||||||
|
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function sendToFlash() {
|
||||||
|
var html = CKEDITOR.instances.editor1.getData() ;
|
||||||
|
|
||||||
|
// Quick fix for link color.
|
||||||
|
html = html.replace( /<a /g, '<font color="#0000FF"><u><a ' )
|
||||||
|
html = html.replace( /<\/a>/g, '</a></u></font>' )
|
||||||
|
|
||||||
|
var flash = document.getElementById( 'ckFlashContainer' ) ;
|
||||||
|
flash.setData( html ) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
CKEDITOR.domReady( function() {
|
||||||
|
if ( !swfobject.hasFlashPlayerVersion( '8' ) ) {
|
||||||
|
CKEDITOR.dom.element.createFromHtml( '<span class="alert">' +
|
||||||
|
'At least Adobe Flash Player 8 is required to run this sample. ' +
|
||||||
|
'You can download it from <a href="http://get.adobe.com/flashplayer">Adobe\'s website</a>.' +
|
||||||
|
'</span>' ).insertBefore( editor.element );
|
||||||
|
}
|
||||||
|
|
||||||
|
swfobject.embedSWF(
|
||||||
|
'assets/outputforflash/outputforflash.swf',
|
||||||
|
'ckFlashContainer',
|
||||||
|
'550',
|
||||||
|
'400',
|
||||||
|
'8',
|
||||||
|
{ wmode: 'transparent' }
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<p>
|
||||||
|
<input type="button" value="Send to Flash" onclick="sendToFlash();">
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
<td style="vertical-align: top; padding-left: 20px">
|
||||||
|
<div id="ckFlashContainer"></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div id="footer">
|
||||||
|
<hr>
|
||||||
|
<p>
|
||||||
|
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
|
||||||
|
</p>
|
||||||
|
<p id="copy">
|
||||||
|
Copyright © 2003-2014, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
|
||||||
|
Knabben. All rights reserved.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|