编辑器更新,此版本还有bug,暂不要更新使用

内核更新
This commit is contained in:
2016-10-12 15:35:02 +08:00
parent 8d1600a2eb
commit e70d287e89
103 changed files with 31476 additions and 175 deletions

View File

@@ -61,7 +61,7 @@ class Upload {
}
public function editor() {
$file = request()->file('upload_file');
$file = request()->file('upfile');
$info = $file->move(config('editor_upload.rootPath'), true, false);
if ($info) {
$data = $this->parseFile($info);

View File

@@ -16,9 +16,8 @@ class AuthGroup extends Base{
const TYPE_ADMIN = 1; // 管理员用户组类型标识
const MEMBER = 'member';
const UCENTER_MEMBER = 'ucenter_member';
const AUTH_GROUP_ACCESS = 'auth_group_access'; // 关系表表名
const AUTH_EXTEND = 'auth_extend'; // 动态权限扩展信息表
const AUTH_EXTEND = '__AUTH_EXTEND__'; // 动态权限扩展信息表
const AUTH_GROUP = 'auth_group'; // 用户组表名
const AUTH_EXTEND_CATEGORY_TYPE = 1; // 分类权限标识
const AUTH_EXTEND_MODEL_TYPE = 2; //分类权限标识

View File

@@ -1,13 +1,15 @@
<textarea name="{$field}" id="{$field}">{$value}</textarea>
<textarea name="{$field}" id="{$field}" style="width: 100%;">{$value}</textarea>
<!-- 样式文件 -->
<link rel="stylesheet" href="__PUBLIC__/plugs/umeditor/themes/default/css/umeditor.css">
<!-- 配置文件 -->
<script type="text/javascript" src="__PUBLIC__/plugs/umeditor/umeditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__PUBLIC__/plugs/umeditor/umeditor.js"></script>
<!-- 实例化编辑器代码 -->
<script type="text/javascript">
var editor = new Simditor({
textarea: $('#{$field}'),
defaultImage : '__PUBLIC__/images/wechat.jpg',
upload : {
placeholder : '欢迎使用SentCMS网站管理系统',
url: "{:url('upload/editor')}",
pasteImage:true,
fileKey: "upload_file"
}
});
$(function(){
window.um = UM.getEditor('{$field}', {
imageUrl: "{:url('upload/editor')}"
});
});
</script>

View File

@@ -83,7 +83,9 @@ class Lang
// 记录加载信息
App::$debug && Log::record('[ LANG ] ' . $_file, 'info');
$_lang = include $_file;
$lang = array_change_key_case($_lang) + $lang;
if (is_array($_lang)) {
$lang = array_change_key_case($_lang) + $lang;
}
}
}
if (!empty($lang)) {

View File

@@ -680,15 +680,13 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
$where = $this->updateWhere;
}
if (!empty($where)) {
$pk = $this->getPk();
if (is_string($pk) && isset($data[$pk])) {
if (!isset($where[$pk])) {
unset($where);
$where[$pk] = $data[$pk];
}
unset($data[$pk]);
$pk = $this->getPk();
if (is_string($pk) && isset($data[$pk])) {
if (!isset($where[$pk])) {
unset($where);
$where[$pk] = $data[$pk];
}
unset($data[$pk]);
}
$result = $this->db()->where($where)->update($data);
@@ -1146,8 +1144,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
->join($table . ' b', 'a.' . $info['localKey'] . '=b.' . $info['foreignKey'], $info['joinType'])
->group('b.' . $info['foreignKey'])
->having('count(' . $id . ')' . $operator . $count);
case Relation::HAS_MANY_THROUGH:
// TODO
case Relation::HAS_MANY_THROUGH: // TODO
default:
return $model;
}
}
@@ -1178,8 +1177,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
->field('a.*')
->join($table . ' b', 'a.' . $info['localKey'] . '=b.' . $info['foreignKey'], $info['joinType'])
->where($where);
case Relation::HAS_MANY_THROUGH:
// TODO
case Relation::HAS_MANY_THROUGH: // TODO
default:
return $model;
}
}

View File

@@ -305,7 +305,8 @@ class Route
}
$vars = self::parseVar($rule);
if (isset($name)) {
self::name($name, [$rule, $vars, self::$domain]);
$key = $group ? $group . '/' . $rule : $rule;
self::name($name, [$key, $vars, self::$domain]);
}
if ($group) {
if ('*' != $type) {
@@ -425,7 +426,7 @@ class Route
$vars = self::parseVar($key);
$item[] = ['rule' => $key, 'route' => $route, 'var' => $vars, 'option' => $options, 'pattern' => $patterns];
// 设置路由标识
self::name($route, [$key, $vars, self::$domain]);
self::name($route, [$name . '/' . $key, $vars, self::$domain]);
}
self::$rules['*'][$name] = ['rule' => $item, 'route' => '', 'var' => [], 'option' => $option, 'pattern' => $pattern];
}
@@ -798,11 +799,9 @@ class Route
public static function check($request, $url, $depr = '/', $checkDomain = false)
{
// 分隔符替换 确保路由定义使用统一的分隔符
if ('/' != $depr) {
$url = str_replace($depr, '/', $url);
}
$url = str_replace($depr, '|', $url);
if (strpos($url, '/') && isset(self::$rules['alias'][strstr($url, '/', true)])) {
if (strpos($url, '|') && isset(self::$rules['alias'][strstr($url, '|', true)])) {
// 检测路由别名
$result = self::checkRouteAlias($request, $url, $depr);
if (false !== $result) {
@@ -821,8 +820,8 @@ class Route
if (false !== $return) {
return $return;
}
if ('/' != $url) {
$url = rtrim($url, '/');
if ('|' != $url) {
$url = rtrim($url, '|');
}
if (isset($rules[$url])) {
// 静态路由规则检测
@@ -830,7 +829,7 @@ class Route
if (true === $rule) {
$rule = self::getRouteExpress($url);
}
if (!empty($rule['route']) && self::checkOption($rule['option'], $url, $request)) {
if (!empty($rule['route']) && self::checkOption($rule['option'], $request)) {
return self::parseRule($url, $rule['route'], $url, $rule['option']);
}
}
@@ -874,7 +873,7 @@ class Route
$pattern = $item['pattern'];
// 检查参数有效性
if (!self::checkOption($option, $url, $request)) {
if (!self::checkOption($option, $request)) {
continue;
}
@@ -891,7 +890,7 @@ class Route
} else {
$str = $key;
}
if (is_string($str) && $str && 0 !== strpos($url, $str)) {
if (is_string($str) && $str && 0 !== strpos(str_replace('|', '/', $url), $str)) {
continue;
}
@@ -912,7 +911,7 @@ class Route
if (isset($options['bind_model']) && isset($option['bind_model'])) {
$option['bind_model'] = array_merge($options['bind_model'], $option['bind_model']);
}
$result = self::checkRule($rule, $route, $url, $pattern, $option);
$result = self::checkRule($rule, $route, $url, $pattern, $option, $depr);
if (false !== $result) {
return $result;
}
@@ -938,27 +937,32 @@ class Route
*/
private static function checkRouteAlias($request, $url, $depr)
{
$array = explode('/', $url, 2);
$item = self::$rules['alias'][$array[0]];
$array = explode('|', $url);
$alias = array_shift($array);
$item = self::$rules['alias'][$alias];
if (is_array($item)) {
list($rule, $option) = $item;
if (isset($option['method'][$array[0]])) {
$option['method'] = $option['method'][$array[0]];
}
} else {
$rule = $item;
}
$bind = implode('|', $array);
// 参数有效性检查
if (isset($option) && !self::checkOption($option, $url, $request)) {
if (isset($option) && !self::checkOption($option, $request)) {
// 路由不匹配
return false;
} elseif (0 === strpos($rule, '\\')) {
// 路由到类
return self::bindToClass($array[1], substr($rule, 1), $depr);
return self::bindToClass($bind, substr($rule, 1), $depr);
} elseif (0 === strpos($url, '@')) {
// 路由到控制器类
return self::bindToController($array[1], substr($rule, 1), $depr);
return self::bindToController($bind, substr($rule, 1), $depr);
} else {
// 路由到模块/控制器
return self::bindToModule($array[1], $rule, $depr);
return self::bindToModule($bind, $rule, $depr);
}
}
@@ -1000,7 +1004,8 @@ class Route
*/
public static function bindToClass($url, $class, $depr = '/')
{
$array = explode($depr, $url, 2);
$url = str_replace($depr, '|', $url);
$array = explode('|', $url, 2);
$action = !empty($array[0]) ? $array[0] : Config::get('default_action');
if (!empty($array[1])) {
self::parseUrlParams($array[1]);
@@ -1018,7 +1023,8 @@ class Route
*/
public static function bindToNamespace($url, $namespace, $depr = '/')
{
$array = explode($depr, $url, 3);
$url = str_replace($depr, '|', $url);
$array = explode('|', $url, 3);
$class = !empty($array[0]) ? $array[0] : Config::get('default_controller');
$method = !empty($array[1]) ? $array[1] : Config::get('default_action');
if (!empty($array[2])) {
@@ -1037,7 +1043,8 @@ class Route
*/
public static function bindToController($url, $controller, $depr = '/')
{
$array = explode($depr, $url, 2);
$url = str_replace($depr, '|', $url);
$array = explode('|', $url, 2);
$action = !empty($array[0]) ? $array[0] : Config::get('default_action');
if (!empty($array[1])) {
self::parseUrlParams($array[1]);
@@ -1055,7 +1062,8 @@ class Route
*/
public static function bindToModule($url, $controller, $depr = '/')
{
$array = explode($depr, $url, 2);
$url = str_replace($depr, '|', $url);
$array = explode('|', $url, 2);
$action = !empty($array[0]) ? $array[0] : Config::get('default_action');
if (!empty($array[1])) {
self::parseUrlParams($array[1]);
@@ -1067,19 +1075,18 @@ class Route
* 路由参数有效性检查
* @access private
* @param array $option 路由参数
* @param string $url URL地址
* @param Request $request Request对象
* @return bool
*/
private static function checkOption($option, $url, $request)
private static function checkOption($option, $request)
{
// 请求类型检测
if ((isset($option['method']) && false === stripos($option['method'], $request->method()))
if ((isset($option['method']) && is_string($option['method']) && false === stripos($option['method'], $request->method()))
|| (isset($option['ext']) && false === stripos($option['ext'], $request->ext())) // 伪静态后缀检测
|| (isset($option['deny_ext']) && false !== stripos($option['deny_ext'], $request->ext()))
|| (isset($option['domain']) && !in_array($option['domain'], [$_SERVER['HTTP_HOST'], self::$subDomain])) // 域名检测
|| (!empty($option['https']) && !$request->isSsl()) // https检测
|| (!empty($option['before_behavior']) && false === Hook::exec($option['before_behavior'], '', $url)) // 行为检测
|| (!empty($option['before_behavior']) && false === Hook::exec($option['before_behavior'])) // 行为检测
|| (!empty($option['callback']) && is_callable($option['callback']) && false === call_user_func($option['callback'])) // 自定义检测
) {
return false;
@@ -1095,24 +1102,28 @@ class Route
* @param string $url URL地址
* @param array $pattern 变量规则
* @param array $option 路由参数
* @param string $depr URL分隔符全局
* @return array|false
*/
private static function checkRule($rule, $route, $url, $pattern, $option)
private static function checkRule($rule, $route, $url, $pattern, $option, $depr)
{
// 检查完整规则定义
if (isset($pattern['__url__']) && !preg_match('/^' . $pattern['__url__'] . '/', $url)) {
if (isset($pattern['__url__']) && !preg_match('/^' . $pattern['__url__'] . '/', str_replace('|', $depr, $url))) {
return false;
}
// 检测是否设置了参数分隔符
if ($depr = Config::get('url_params_depr')) {
$url = str_replace($depr, '/', $url);
$rule = str_replace($depr, '/', $rule);
// 检查路由的参数分隔符
if (isset($option['param_depr'])) {
$url = str_replace(['|', $option['param_depr']], [$depr, '|'], $url);
}
$len1 = substr_count($url, '/');
$len1 = substr_count($url, '|');
$len2 = substr_count($rule, '/');
// 多余参数是否合并
$merge = !empty($option['merge_extra_vars']) ? true : false;
if ($merge && $len1 > $len2) {
$url = str_replace('|', $depr, $url);
$url = implode('|', explode($depr, $url, $len2 + 1));
}
if ($len1 >= $len2 || strpos($rule, '[')) {
if (!empty($option['complete_match'])) {
@@ -1140,12 +1151,13 @@ class Route
*/
public static function parseUrl($url, $depr = '/', $autoSearch = false)
{
if (isset(self::$bind['module'])) {
// 如果有模块/控制器绑定
$url = self::$bind['module'] . '/' . ltrim($url, '/');
}
list($path, $var) = self::parseUrlPath($url, $depr);
$url = str_replace($depr, '|', $url);
list($path, $var) = self::parseUrlPath($url);
$route = [null, null, null];
if (isset($path)) {
// 解析模块
@@ -1171,7 +1183,7 @@ class Route
// 解析操作
$action = !empty($path) ? array_shift($path) : null;
// 解析额外参数
self::parseUrlParams(empty($path) ? '' : implode('/', $path));
self::parseUrlParams(empty($path) ? '' : implode('|', $path));
// 封装路由
$route = [$module, $controller, $action];
if (isset(self::$rules['name'][implode($depr, $route)])) {
@@ -1185,15 +1197,12 @@ class Route
* 解析URL的pathinfo参数和变量
* @access private
* @param string $url URL地址
* @param string $depr URL分隔符
* @return array
*/
private static function parseUrlPath($url, $depr = '/')
private static function parseUrlPath($url)
{
// 分隔符替换 确保路由定义使用统一的分隔符
if ('/' != $depr) {
$url = str_replace($depr, '/', $url);
}
$url = str_replace('|', '/', $url);
$url = trim($url, '/');
$var = [];
if (false !== strpos($url, '?')) {
@@ -1219,13 +1228,12 @@ class Route
* @param string $url URL地址
* @param string $rule 路由规则
* @param array $pattern 变量规则
* @param bool $merge 合并额外变量
* @return array|false
*/
private static function match($url, $rule, $pattern, $merge)
private static function match($url, $rule, $pattern)
{
$m2 = explode('/', $rule);
$m1 = $merge ? explode('/', $url, count($m2)) : explode('/', $url);
$m1 = explode('|', $url);
$var = [];
foreach ($m2 as $key => $val) {
@@ -1290,17 +1298,16 @@ class Route
* @param string $pathinfo URL地址
* @param array $option 路由参数
* @param array $matches 匹配的变量
* @param bool $merge 合并额外变量
* @return array
*/
private static function parseRule($rule, $route, $pathinfo, $option = [], $matches = [], $merge = false)
private static function parseRule($rule, $route, $pathinfo, $option = [], $matches = [])
{
$request = Request::instance();
// 解析路由规则
if ($rule) {
$rule = explode('/', $rule);
// 获取URL地址中的参数
$paths = $merge ? explode('/', $pathinfo, count($rule)) : explode('/', $pathinfo);
$paths = explode('|', $pathinfo);
foreach ($rule as $item) {
$fun = '';
if (0 === strpos($item, '[:')) {
@@ -1315,7 +1322,7 @@ class Route
}
}
} else {
$paths = explode('/', $pathinfo);
$paths = explode('|', $pathinfo);
}
// 获取路由地址规则
@@ -1372,7 +1379,7 @@ class Route
}
// 解析额外参数
self::parseUrlParams(empty($paths) ? '' : implode('/', $paths), $matches);
self::parseUrlParams(empty($paths) ? '' : implode('|', $paths), $matches);
// 记录匹配的路由信息
$request->routeInfo(['rule' => $rule, 'route' => $route, 'option' => $option, 'var' => $matches]);
@@ -1432,12 +1439,11 @@ class Route
* 解析URL地址为 模块/控制器/操作
* @access private
* @param string $url URL地址
* @param string $depr URL分隔符
* @return array
*/
private static function parseModule($url, $depr = '/')
private static function parseModule($url)
{
list($path, $var) = self::parseUrlPath($url, $depr);
list($path, $var) = self::parseUrlPath($url);
$action = array_pop($path);
$controller = !empty($path) ? array_pop($path) : null;
$module = Config::get('app_multi_module') && !empty($path) ? array_pop($path) : null;
@@ -1463,9 +1469,9 @@ class Route
{
if ($url) {
if (Config::get('url_param_type')) {
$var += explode('/', $url);
$var += explode('|', $url);
} else {
preg_replace_callback('/(\w+)\/([^\/]+)/', function ($match) use (&$var) {
preg_replace_callback('/(\w+)\|([^\|]+)/', function ($match) use (&$var) {
$var[$match[1]] = strip_tags($match[2]);
}, $url);
}

View File

@@ -959,78 +959,66 @@ class Template
* @param array $vars 变量数组
* @return string
*/
public function parseThinkVar(&$vars)
public function parseThinkVar($vars)
{
$vars[0] = strtoupper(trim($vars[0]));
$parseStr = '';
if (count($vars) >= 2) {
$vars[1] = trim($vars[1]);
switch ($vars[0]) {
$type = strtoupper(trim(array_shift($vars)));
$param = implode('.', $vars);
if ($vars) {
switch ($type) {
case 'SERVER':
$parseStr = '$_SERVER[\'' . strtoupper($vars[1]) . '\']';
$parseStr = '\\think\\Request::instance()->server(\'' . $param . '\')';
break;
case 'GET':
$parseStr = '$_GET[\'' . $vars[1] . '\']';
$parseStr = '\\think\\Request::instance()->get(\'' . $param . '\')';
break;
case 'POST':
$parseStr = '$_POST[\'' . $vars[1] . '\']';
$parseStr = '\\think\\Request::instance()->post(\'' . $param . '\')';
break;
case 'COOKIE':
if (isset($vars[2])) {
$parseStr = '\\think\\Cookie::get(\'' . $vars[1] . '.' . $vars[2] . '\')';
} else {
$parseStr = '\\think\\Cookie::get(\'' . $vars[1] . '\')';
}
$parseStr = '\\think\\Cookie::get(\'' . $param . '\')';
break;
case 'SESSION':
if (isset($vars[2])) {
$parseStr = '\\think\\Session::get(\'' . $vars[1] . '.' . $vars[2] . '\')';
} else {
$parseStr = '\\think\\Session::get(\'' . $vars[1] . '\')';
}
$parseStr = '\\think\\Session::get(\'' . $param . '\')';
break;
case 'ENV':
$parseStr = '$_ENV[\'' . strtoupper($vars[1]) . '\']';
$parseStr = '\\think\\Request::instance()->env(\'' . $param . '\')';
break;
case 'REQUEST':
$parseStr = '$_REQUEST[\'' . $vars[1] . '\']';
$parseStr = '\\think\\Request::instance()->request(\'' . $param . '\')';
break;
case 'CONST':
$parseStr = strtoupper($vars[1]);
$parseStr = strtoupper($param);
break;
case 'LANG':
$parseStr = '\\think\\Lang::get(\'' . $vars[1] . '\')';
$parseStr = '\\think\\Lang::get(\'' . $param . '\')';
break;
case 'CONFIG':
if (isset($vars[2])) {
$vars[1] .= '.' . $vars[2];
}
$parseStr = '\\think\\Config::get(\'' . $vars[1] . '\')';
$parseStr = '\\think\\Config::get(\'' . $param . '\')';
break;
default:
$parseStr = '\'\'';
break;
}
} else {
if (count($vars) == 1) {
switch ($vars[0]) {
case 'NOW':
$parseStr = "date('Y-m-d g:i a',time())";
break;
case 'VERSION':
$parseStr = 'THINK_VERSION';
break;
case 'LDELIM':
$parseStr = '\'' . ltrim($this->config['tpl_begin'], '\\') . '\'';
break;
case 'RDELIM':
$parseStr = '\'' . ltrim($this->config['tpl_end'], '\\') . '\'';
break;
default:
if (defined($vars[0])) {
$parseStr = $vars[0];
}
}
switch ($type) {
case 'NOW':
$parseStr = "date('Y-m-d g:i a',time())";
break;
case 'VERSION':
$parseStr = 'THINK_VERSION';
break;
case 'LDELIM':
$parseStr = '\'' . ltrim($this->config['tpl_begin'], '\\') . '\'';
break;
case 'RDELIM':
$parseStr = '\'' . ltrim($this->config['tpl_end'], '\\') . '\'';
break;
default:
if (defined($type)) {
$parseStr = $type;
} else {
$parseStr = '';
}
}
}
return $parseStr;

View File

@@ -77,6 +77,8 @@ class Url
if (!empty($rule) && $match = self::getRuleUrl($rule, $vars)) {
// 匹配路由命名标识
$url = $match[0];
// 替换可选分隔符
$url = preg_replace(['/\((\W)\?\)$/', '/\((\W)\?\)/'], ['', '\1'], $url);
if (!empty($match[1])) {
$domain = $match[1];
}

View File

@@ -180,12 +180,17 @@ abstract class Builder
protected function parseTable($tables, $options = [])
{
$item = [];
foreach ((array) $tables as $table) {
$table = $this->parseSqlTable($table);
if (isset($options['alias'][$table])) {
$item[] = $this->parseKey($table) . ' ' . $this->parseKey($options['alias'][$table]);
foreach ((array) $tables as $key => $table) {
if (!is_numeric($key)) {
$key = $this->parseSqlTable($key);
$item[] = $this->parseKey($key) . ' ' . $this->parseKey($table);
} else {
$item[] = $this->parseKey($table);
$table = $this->parseSqlTable($table);
if (isset($options['alias'][$table])) {
$item[] = $this->parseKey($table) . ' ' . $this->parseKey($options['alias'][$table]);
} else {
$item[] = $this->parseKey($table);
}
}
}
return implode(',', $item);
@@ -437,8 +442,12 @@ abstract class Builder
list($table, $type, $on) = $item;
$condition = [];
foreach ((array) $on as $val) {
list($val1, $val2) = explode('=', $val, 2);
$condition[] = $this->parseKey($val1, $options) . '=' . $this->parseKey($val2, $options);
if (strpos($val, '=')) {
list($val1, $val2) = explode('=', $val, 2);
$condition[] = $this->parseKey($val1, $options) . '=' . $this->parseKey($val2, $options);
} else {
$condition[] = $val;
}
}
$table = $this->parseTable($table, $options);

View File

@@ -377,7 +377,7 @@ class Query
*/
public function value($field, $default = null)
{
$result = null;
$result = false;
if (!empty($this->options['cache'])) {
// 判断查询缓存
$cache = $this->options['cache'];
@@ -387,7 +387,7 @@ class Query
$key = is_string($cache['key']) ? $cache['key'] : md5($field . serialize($this->options));
$result = Cache::get($key);
}
if (!$result) {
if (false === $result) {
if (isset($this->options['field'])) {
unset($this->options['field']);
}
@@ -409,7 +409,7 @@ class Query
// 清空查询条件
$this->options = [];
}
return !is_null($result) ? $result : $default;
return false !== $result ? $result : $default;
}
/**
@@ -431,7 +431,7 @@ class Query
$guid = is_string($cache['key']) ? $cache['key'] : md5($field . serialize($this->options));
$result = Cache::get($guid);
}
if (!$result) {
if (false === $result) {
if (isset($this->options['field'])) {
unset($this->options['field']);
}
@@ -663,37 +663,21 @@ class Query
}
}
} else {
$prefix = $this->prefix;
// 传入的表名为数组
if (is_array($join)) {
if (0 !== $key = key($join)) {
// 设置了键名则键名为表名,键值作为表的别名
$table = $key;
$alias = array_shift($join);
$this->alias([$table => $alias]);
$table = [$key => array_shift($join)];
$this->alias($table);
} else {
$table = array_shift($join);
}
if (count($join)) {
// 有设置第二个元素则把第二元素作为表前缀
$table = (string) current($join) . $table;
} elseif (false === strpos($table, '.')) {
// 加上默认的表前缀
$table = $prefix . $table;
}
} else {
$join = trim($join);
if (0 === strpos($join, '__')) {
$table = $this->parseSqlTable($join);
} elseif (false === strpos($join, '(') && false === strpos($join, '.') && !empty($prefix) && 0 !== strpos($join, $prefix)) {
// 传入的表名中不带有'('并且不以默认的表前缀开头时加上默认的表前缀
$table = $prefix . $join;
} else {
$table = $join;
}
if (strpos($table, ' ')) {
$table = trim($join);
if (strpos($table, ' ') && !strpos($table, ')')) {
list($table, $alias) = explode(' ', $table);
$this->alias([$table => $alias]);
$table = [$table => $alias];
$this->alias($table);
}
}
$this->options['join'][] = [$table, strtoupper($type), $condition];
@@ -1044,7 +1028,8 @@ class Query
}
} elseif (strpos($table, ' ')) {
list($table, $alias) = explode(' ', $table);
$this->alias([$table => $alias]);
$table = [$table => $alias];
$this->alias($table);
}
} else {
$tables = $table;
@@ -1054,7 +1039,7 @@ class Query
$table[] = $val;
} else {
$this->alias([$key => $val]);
$table[] = $key;
$table[$key] = $val;
}
}
}
@@ -1187,7 +1172,11 @@ class Query
$this->options['alias'][$key] = $val;
}
} else {
$table = isset($this->options['table']) ? $this->options['table'] : $this->getTable();
if (isset($this->options['table'])) {
$table = is_array($this->options['table']) ? key($this->options['table']) : $this->options['table'];
} else {
$table = $this->getTable();
}
$this->options['alias'][$table] = $alias;
}
@@ -1365,7 +1354,7 @@ class Query
/**
* 获取数据表信息
* @access public
* @param string $tableName 数据表名 留空自动获取
* @param mixed $tableName 数据表名 留空自动获取
* @param string $fetch 获取信息类型 包括 fields type bind pk
* @return mixed
*/
@@ -1575,7 +1564,7 @@ class Query
$name = Loader::parseName(basename(str_replace('\\', '/', $currentModel)));
$table = $this->getTable();
$alias = isset($info['alias'][$name]) ? $info['alias'][$name] : $name;
$this->table($table)->alias($alias);
$this->table([$table => $alias]);
if (isset($this->options['field'])) {
$field = $this->options['field'];
unset($this->options['field']);
@@ -1587,7 +1576,7 @@ class Query
// 预载入封装
$joinTable = $model->getTable();
$joinName = Loader::parseName(basename(str_replace('\\', '/', $info['model'])));
$joinAlias = isset($info['alias'][$joinName]) ? $info['alias'][$joinName] : $joinName;
$joinAlias = isset($info['alias'][$joinName]) ? $info['alias'][$joinName] : $relation;
$this->via($joinAlias);
if (Relation::HAS_ONE == $info['type']) {
@@ -1670,8 +1659,9 @@ class Query
{
$pk = $this->getPk($options);
// 获取当前数据表
if (!empty($options['alias'][$options['table']])) {
$alias = $options['alias'][$options['table']];
$table = is_array($options['table']) ? key($options['table']) : $options['table'];
if (!empty($options['alias'][$table])) {
$alias = $options['alias'][$table];
}
if (is_string($pk)) {
$key = isset($alias) ? $alias . '.' . $pk : $pk;
@@ -1983,7 +1973,7 @@ class Query
// 判断查询缓存
$cache = $options['cache'];
if (true === $cache['key'] && !is_null($data) && !is_array($data)) {
$key = 'think:' . $options['table'] . '|' . $data;
$key = 'think:' . (is_array($options['table']) ? key($options['table']) : $options['table']) . '|' . $data;
} else {
$key = is_string($cache['key']) ? $cache['key'] : md5(serialize($options));
}
@@ -2053,7 +2043,8 @@ class Query
if (!empty($this->model)) {
throw new ModelNotFoundException('model data Not Found:' . $this->model, $this->model, $options);
} else {
throw new DataNotFoundException('table data not Found:' . $options['table'], $options['table'], $options);
$table = is_array($options['table']) ? key($options['table']) : $options['table'];
throw new DataNotFoundException('table data not Found:' . $table, $table, $options);
}
}
@@ -2095,8 +2086,13 @@ class Query
*/
public function chunk($count, $callback, $column = null)
{
$options = $this->getOptions();
$column = $column ?: $this->getPk(isset($options['table']) ? $options['table'] : '');
$options = $this->getOptions();
if (isset($options['table'])) {
$table = is_array($options['table']) ? key($options['table']) : $options['table'];
} else {
$table = '';
}
$column = $column ?: $this->getPk($table);
$bind = $this->bind;
$resultSet = $this->limit($count)->order($column, 'asc')->select();

View File

@@ -27,22 +27,23 @@ class Sqlsrv extends Builder
* order分析
* @access protected
* @param mixed $order
* @param array $options
* @return string
*/
protected function parseOrder($order)
protected function parseOrder($order, $options = [])
{
if (is_array($order)) {
$array = [];
foreach ($order as $key => $val) {
if (is_numeric($key)) {
if (false === strpos($val, '(')) {
$array[] = $this->parseKey($val);
$array[] = $this->parseKey($val, $options);
} elseif ('[rand]' == $val) {
$array[] = $this->parseRand();
}
} else {
$sort = in_array(strtolower(trim($val)), ['asc', 'desc']) ? ' ' . $val : '';
$array[] = $this->parseKey($key) . ' ' . $sort;
$array[] = $this->parseKey($key, $options) . ' ' . $sort;
}
}
$order = implode(',', $array);

View File

@@ -0,0 +1,87 @@
.edui-popup-emotion .edui-emotion-jd img{
background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top;
cursor:pointer;width:35px;height:35px;display:block;
}
.edui-popup-emotion .edui-emotion-pp img{
background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top;
cursor:pointer;width:25px;height:25px;display:block;
}
.edui-popup-emotion .edui-emotion-ldw img{
background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top;
cursor:pointer;width:35px;height:35px;display:block;
}
.edui-popup-emotion .edui-emotion-tsj img{
background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top;
cursor:pointer;width:35px;height:35px;display:block;
}
.edui-popup-emotion .edui-emotion-cat img{
background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top;
cursor:pointer;width:35px;height:35px;display:block;
}
.edui-popup-emotion .edui-emotion-bb img{
background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top;
cursor:pointer;width:35px;height:35px;display:block;
}
.edui-popup-emotion .edui-emotion-youa img{
background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top;
cursor:pointer;width:35px;height:35px;display:block;
}
.edui-popup-emotion .edui-emotion-smileytable {
width: 100%;
border-spacing: 0;
border-collapse: collapse;
table-layout: fixed;
}
.edui-popup-emotion .edui-emotion-wrapper {
padding: 15px;
}
.edui-popup-emotion .edui-tab-nav{
height: auto;
*height: 31px;
}
.edui-popup-emotion .edui-emotion-tabs{
clear: both;
width: 0;
height: 0;
}
.edui-popup-emotion .edui-tab-content {
padding: 15px 0;
}
.edui-popup-emotion .edui-emotion-preview-box {
width:90px;
height:76px;
border:2px solid #9cb945;
background:#FFFFFF;
background-position:center;
background-repeat:no-repeat;
position: absolute;
top: 67px;
left: 494px;
display: none;
}
.edui-popup-emotion .edui-tab-text {
font-size: 12px;
}
.edui-popup-emotion .edui-emotion-preview-left {
left: 15px;
}
.edui-popup-emotion .edui-emotion-preview-img {
width: 100%;
height: 100%;
display: block;
background-repeat: no-repeat;
background-position: center center;
}

View File

@@ -0,0 +1,272 @@
(function(){
var editor = null;
UM.registerWidget('emotion',{
tpl: "<link type=\"text/css\" rel=\"stylesheet\" href=\"<%=emotion_url%>emotion.css\">" +
"<div class=\"edui-emotion-tab-Jpanel edui-emotion-wrapper\">" +
"<ul class=\"edui-emotion-Jtabnav edui-tab-nav\">" +
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab0\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_choice%></a></li>" +
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab1\" class=\"edui-tab-text\"><%=lang_input_Tuzki%></a></li>" +
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab2\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_lvdouwa%></a></li>" +
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab3\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_BOBO%></a></li>" +
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab4\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_babyCat%></a></li>" +
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab5\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_bubble%></a></li>" +
"<li class=\"edui-tab-item\"><a data-context=\".edui-emotion-Jtab6\" hideFocus=\"true\" class=\"edui-tab-text\"><%=lang_input_youa%></a></li>" +
"<li class=\"edui-emotion-tabs\"></li>" +
"</ul>" +
"<div class=\"edui-tab-content edui-emotion-JtabBodys\">" +
"<div class=\"edui-emotion-Jtab0 edui-tab-pane\"></div>" +
"<div class=\"edui-emotion-Jtab1 edui-tab-pane\"></div>" +
"<div class=\"edui-emotion-Jtab2 edui-tab-pane\"></div>" +
"<div class=\"edui-emotion-Jtab3 edui-tab-pane\"></div>" +
"<div class=\"edui-emotion-Jtab4 edui-tab-pane\"></div>" +
"<div class=\"edui-emotion-Jtab5 edui-tab-pane\"></div>" +
"<div class=\"edui-emotion-Jtab6 edui-tab-pane\"></div>" +
"</div>" +
"<div class=\"edui-emotion-JtabIconReview edui-emotion-preview-box\">" +
"<img src=\"<%=cover_img%>\" class=\'edui-emotion-JfaceReview edui-emotion-preview-img\'/>" +
"</div>",
sourceData: {
emotion: {
tabNum:7, //切换面板数量
SmilmgName:{ 'edui-emotion-Jtab0':['j_00', 84], 'edui-emotion-Jtab1':['t_00', 40], 'edui-emotion-Jtab2':['w_00', 52], 'edui-emotion-Jtab3':['B_00', 63], 'edui-emotion-Jtab4':['C_00', 20], 'edui-emotion-Jtab5':['i_f', 50], 'edui-emotion-Jtab6':['y_00', 40] }, //图片前缀名
imageFolders:{ 'edui-emotion-Jtab0':'jx2/', 'edui-emotion-Jtab1':'tsj/', 'edui-emotion-Jtab2':'ldw/', 'edui-emotion-Jtab3':'bobo/', 'edui-emotion-Jtab4':'babycat/', 'edui-emotion-Jtab5':'face/', 'edui-emotion-Jtab6':'youa/'}, //图片对应文件夹路径
imageCss:{'edui-emotion-Jtab0':'jd', 'edui-emotion-Jtab1':'tsj', 'edui-emotion-Jtab2':'ldw', 'edui-emotion-Jtab3':'bb', 'edui-emotion-Jtab4':'cat', 'edui-emotion-Jtab5':'pp', 'edui-emotion-Jtab6':'youa'}, //图片css类名
imageCssOffset:{'edui-emotion-Jtab0':35, 'edui-emotion-Jtab1':35, 'edui-emotion-Jtab2':35, 'edui-emotion-Jtab3':35, 'edui-emotion-Jtab4':35, 'edui-emotion-Jtab5':25, 'edui-emotion-Jtab6':35}, //图片偏移
SmileyInfor:{
'edui-emotion-Jtab0':['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '打酱油', '俯卧撑', '气愤', '?', '吻', '怒', '胜利', 'HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '微笑', '亲吻', '调皮', '惊恐', '耍酷', '发火', '害羞', '汗水', '大哭', '', '加油', '困', '你NB', '晕倒', '开心', '偷笑', '大哭', '滴汗', '叹气', '超赞', '??', '飞吻', '天使', '撒花', '生气', '被砸', '吓傻', '随意吐'],
'edui-emotion-Jtab1':['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '摊手', '睡觉', '瘫坐', '无聊', '星星闪', '旋转', '也不行', '郁闷', '正Music', '抓墙', '撞墙至死', '歪头', '戳眼', '飘过', '互相拍砖', '砍死你', '扔桌子', '少林寺', '什么?', '转头', '我爱牛奶', '我踢', '摇晃', '晕厥', '在笼子里', '震荡'],
'edui-emotion-Jtab2':['大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '我错了', 'money', '气愤', '挑逗', '吻', '怒', '胜利', '委屈', '受伤', '说啥呢?', '闭嘴', '不', '逗你玩儿', '飞吻', '眩晕', '魔法', '我来了', '睡了', '我打', '闭嘴', '打', '打晕了', '刷牙', '爆揍', '炸弹', '倒立', '刮胡子', '邪恶的笑', '不要不要', '爱恋中', '放大仔细看', '偷窥', '超高兴', '晕', '松口气', '我跑', '享受', '修养', '哭', '汗', '啊~', '热烈欢迎', '打酱油', '俯卧撑', '?'],
'edui-emotion-Jtab3':['HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '泪眼', '流泪', '生气', '吐舌', '喜欢', '旋转', '再见', '抓狂', '汗', '鄙视', '拜', '吐血', '嘘', '打人', '蹦跳', '变脸', '扯肉', '吃To', '吃花', '吹泡泡糖', '大变身', '飞天舞', '回眸', '可怜', '猛抽', '泡泡', '苹果', '亲', '', '骚舞', '烧香', '睡', '套娃娃', '捅捅', '舞倒', '西红柿', '爱慕', '摇', '摇摆', '杂耍', '招财', '被殴', '被球闷', '大惊', '理想', '欧打', '呕吐', '碎', '吐痰'],
'edui-emotion-Jtab4':['发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '顶', '幸运', '爱心', '躲', '送花', '选择'],
'edui-emotion-Jtab5':['微笑', '亲吻', '调皮', '惊讶', '耍酷', '发火', '害羞', '汗水', '大哭', '得意', '鄙视', '困', '夸奖', '晕倒', '疑问', '媒婆', '狂吐', '青蛙', '发愁', '亲吻', '', '爱心', '心碎', '玫瑰', '礼物', '哭', '奸笑', '可爱', '得意', '呲牙', '暴汗', '楚楚可怜', '困', '哭', '生气', '惊讶', '口水', '彩虹', '夜空', '太阳', '钱钱', '灯泡', '咖啡', '蛋糕', '音乐', '爱', '胜利', '赞', '鄙视', 'OK'],
'edui-emotion-Jtab6':['男兜', '女兜', '开心', '乖乖', '偷笑', '大笑', '抽泣', '大哭', '无奈', '滴汗', '叹气', '狂晕', '委屈', '超赞', '??', '疑问', '飞吻', '天使', '撒花', '生气', '被砸', '口水', '泪奔', '吓傻', '吐舌头', '点头', '随意吐', '旋转', '困困', '鄙视', '狂顶', '篮球', '再见', '欢迎光临', '恭喜发财', '稍等', '我在线', '恕不议价', '库房有货', '货在路上']
}
}
},
initContent:function( _editor, $widget ){
var me = this,
emotion = me.sourceData.emotion,
lang = _editor.getLang( 'emotion' )['static'],
emotionUrl = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/emotion/',
options = $.extend( {}, lang, {
emotion_url: emotionUrl
}),
$root = me.root();
if( me.inited ) {
me.preventDefault();
this.switchToFirst();
return;
}
me.inited = true;
editor = _editor;
this.widget = $widget;
emotion.SmileyPath = _editor.options.emotionLocalization === true ? emotionUrl + 'images/' : "http://img.baidu.com/hi/";
emotion.SmileyBox = me.createTabList( emotion.tabNum );
emotion.tabExist = me.createArr( emotion.tabNum );
options['cover_img'] = emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif' : 'default/0.gif');
$root.html( $.parseTmpl( me.tpl, options ) );
me.tabs = $.eduitab({selector:".edui-emotion-tab-Jpanel"});
//缓存预览对象
me.previewBox = $root.find(".edui-emotion-JtabIconReview");
me.previewImg = $root.find(".edui-emotion-JfaceReview");
me.initImgName();
},
initEvent:function(){
var me = this;
//防止点击过后关闭popup
me.root().on('click', function(e){
return false;
});
//移动预览
me.root().delegate( 'td', 'mouseover mouseout', function( evt ){
var $td = $( this),
url = $td.attr('data-surl') || null;
if( url ) {
me[evt.type]( this, url , $td.attr('data-posflag') );
}
return false;
} );
//点击选中
me.root().delegate( 'td', 'click', function( evt ){
var $td = $( this),
realUrl = $td.attr('data-realurl') || null;
if( realUrl ) {
me.insertSmiley( realUrl.replace( /'/g, "\\'" ), evt );
}
return false;
} );
//更新模板
me.tabs.edui().on("beforeshow", function( evt ){
var contentId = $(evt.target).attr('data-context').replace( /^.*\.(?=[^\s]*$)/, '' );
evt.stopPropagation();
me.updateTab( contentId );
});
this.switchToFirst();
},
initImgName: function() {
var emotion = this.sourceData.emotion;
for ( var pro in emotion.SmilmgName ) {
var tempName = emotion.SmilmgName[pro],
tempBox = emotion.SmileyBox[pro],
tempStr = "";
if ( tempBox.length ) return;
for ( var i = 1; i <= tempName[1]; i++ ) {
tempStr = tempName[0];
if ( i < 10 ) tempStr = tempStr + '0';
tempStr = tempStr + i + '.gif';
tempBox.push( tempStr );
}
}
},
/**
* 切换到第一个tab
*/
switchToFirst: function(){
this.root().find(".edui-emotion-Jtabnav .edui-tab-text:first").trigger('click');
},
updateTab: function( contentBoxId ) {
var me = this,
emotion = me.sourceData.emotion;
me.autoHeight( contentBoxId );
if ( !emotion.tabExist[ contentBoxId ] ) {
emotion.tabExist[ contentBoxId ] = true;
me.createTab( contentBoxId );
}
},
autoHeight: function( ) {
this.widget.height(this.root() + 2);
},
createTabList: function( tabNum ) {
var obj = {};
for ( var i = 0; i < tabNum; i++ ) {
obj["edui-emotion-Jtab" + i] = [];
}
return obj;
},
mouseover: function( td, srcPath, posFlag ) {
posFlag -= 0;
$(td).css( 'backgroundColor', '#ACCD3C' );
this.previewImg.css( "backgroundImage", "url(" + srcPath + ")" );
posFlag && this.previewBox.addClass('edui-emotion-preview-left');
this.previewBox.show();
},
mouseout: function( td ) {
$(td).css( 'backgroundColor', 'transparent' );
this.previewBox.removeClass('edui-emotion-preview-left').hide();
},
insertSmiley: function( url, evt ) {
var obj = {
src: url
};
obj._src = obj.src;
editor.execCommand( 'insertimage', obj );
if ( !evt.ctrlKey ) {
//关闭预览
this.previewBox.removeClass('edui-emotion-preview-left').hide();
this.widget.edui().hide();
}
},
createTab: function( contentBoxId ) {
var faceVersion = "?v=1.1", //版本号
me = this,
$contentBox = this.root().find("."+contentBoxId),
emotion = me.sourceData.emotion,
imagePath = emotion.SmileyPath + emotion.imageFolders[ contentBoxId ], //获取显示表情和预览表情的路径
positionLine = 11 / 2, //中间数
iWidth = iHeight = 35, //图片长宽
iColWidth = 3, //表格剩余空间的显示比例
tableCss = emotion.imageCss[ contentBoxId ],
cssOffset = emotion.imageCssOffset[ contentBoxId ],
textHTML = ['<table border="1" class="edui-emotion-smileytable">'],
i = 0, imgNum = emotion.SmileyBox[ contentBoxId ].length, imgColNum = 11, faceImage,
sUrl, realUrl, posflag, offset, infor;
for ( ; i < imgNum; ) {
textHTML.push( '<tr>' );
for ( var j = 0; j < imgColNum; j++, i++ ) {
faceImage = emotion.SmileyBox[ contentBoxId ][i];
if ( faceImage ) {
sUrl = imagePath + faceImage + faceVersion;
realUrl = imagePath + faceImage;
posflag = j < positionLine ? 0 : 1;
offset = cssOffset * i * (-1) - 1;
infor = emotion.SmileyInfor[ contentBoxId ][i];
textHTML.push( '<td class="edui-emotion-' + tableCss + '" data-surl="'+ sUrl +'" data-realurl="'+ realUrl +'" data-posflag="'+ posflag +'" align="center">' );
textHTML.push( '<span>' );
textHTML.push( '<img style="background-position:left ' + offset + 'px;" title="' + infor + '" src="' + emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif" width="' : 'default/0.gif" width="') + iWidth + '" height="' + iHeight + '"></img>' );
textHTML.push( '</span>' );
} else {
textHTML.push( '<td bgcolor="#FFFFFF">' );
}
textHTML.push( '</td>' );
}
textHTML.push( '</tr>' );
}
textHTML.push( '</table>' );
textHTML = textHTML.join( "" );
$contentBox.html( textHTML );
},
createArr: function( tabNum ) {
var arr = [];
for ( var i = 0; i < tabNum; i++ ) {
arr[i] = 0;
}
return arr;
},
width:603,
height:400
});
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1,32 @@
.edui-popup-formula .edui-formula-wrapper {
padding: 15px;
}
.edui-popup-formula .edui-formula-wrapper .edui-tab-nav{
height: auto;
*height: 31px;
}
.edui-popup-formula .edui-formula-wrapper .edui-tab-text {
font-size: 12px;
}
.edui-popup-formula .edui-formula-wrapper .edui-formula-clearboth {
clear: both;
width: 0;
height: 0;
}
.edui-popup-formula .edui-formula-wrapper .edui-tab-pane ul {
margin: 0px;
padding: 0px;
}
.edui-popup-formula .edui-formula-wrapper .edui-tab-content {
padding: 5px 0px 0px 0px;
}
.edui-popup-formula .edui-formula-wrapper .edui-tab-pane .edui-formula-latex-item {
display: block;
float: left;
margin: 0px 3px 3px 0px;
width: 30px;
height: 30px;
border:1px solid #cccccc;
background-image: url("images/formula.png");
cursor: pointer;
}

View File

@@ -0,0 +1,212 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="../../third-party/mathquill/mathquill.css"/>
<style>
html, body, .main{
margin: 0;
padding: 0;
overflow: hidden;
}
.main{
width:1024px;
height:1024px;
}
.mathquill-editable,
.mathquill-rendered-math{
border: 0px;
padding: 0px;
margin:4px;
}
</style>
</head>
<body>
<div class="main">
<div class="mathquill-editable"></div>
</div>
<div>
<input id="blurHelper" />
</div>
<script src="../../third-party/jquery.min.js"></script>
<script src="../../third-party/mathquill/mathquill.js"></script>
<script>
$(function(){
var UM = parent.UM,
$iframe = $(getSelfIframe()),
editorId = $iframe.parents('.edui-body-container').attr('id'),
editor = UM.getEditor(editorId),
timer;
/* 获得当前公式所在的iframe节点 */
function getSelfIframe(){
var iframes = parent.document.getElementsByTagName('iframe');
for (var key in iframes) {
if (iframes[key].contentWindow == window) {
return iframes[key];
}
}
return null;
}
/* 获得当前url上的hash存储的参数值 */
function getLatex() {
return $iframe.attr('data-latex') || '';
}
/* 保存场景 */
function saveScene(){
timer && clearTimeout(timer);
timer = setTimeout(function(){
editor.fireEvent('savescene');
editor.fireEvent('contentchange');
editor.fireEvent('selectionchange');
timer = null;
}, 300);
}
/* 设置编辑器可编辑 */
function enableEditor(){
if(editor.body.contentEditable == 'false') {
editor.setEnabled();
}
}
/* 设置编辑器不可编辑 */
function disableEditor(){
if(editor.body.contentEditable == 'true') {
editor.setDisabled(['undo', 'redo', 'preview', 'formula'], true);
}
}
/* 公式 */
var Formula = function(){
var _this = this,
latex = getLatex();
this.isFocus = false;
this.isDisabled = false;
/* 加载公式内容 */
this.$mathquill = $('.mathquill-editable').mathquill('latex', latex);
/* 设置活动状态的公式iframe */
this.$mathquill.on('mousedown', function(){
/* 编辑器不可用时,公式也不可用 */
if(_this.disabled) return false;
/* 第一次点击当前公式,设置公式活动 */
if(!$iframe.hasClass('edui-formula-active')) {
disableEditor();
editor.blur();
editor.$body.find('iframe').not($iframe).each(function(k, v){
v.contentWindow.formula.blur();
});
if(_this.$mathquill.find('.cursor').css('display') == 'none') {
_this.refresh();
_this.$mathquill.addClass('hasCursor');
}
}
_this.focus();
});
editor.addListener('click', function(){
_this.blur();
enableEditor();
});
/* 里面focus,编辑器也判断为focus */
editor.addListener('isFocus', function(){
return _this.isFocus;
});
/* um不可用,公式也不可编辑 */
editor.addListener('setDisabled', function(type, except){
if (!(except && except.join(' ').indexOf('formula') != -1) && _this.isDisabled != true ) {
_this.setDisabled();
}
});
editor.addListener('setEnabled', function(){
if (_this.isDisabled != false) {
_this.setEnabled();
}
});
/* 设置更新外层iframe的大小和属性 */
$(document.body).on('keydown', function(){
_this.updateIframe();
}).on('keyup', function(){
_this.updateIframe();
});
/* 清除初始化的高亮状态 */
this.$mathquill.removeClass('hasCursor');
/* 初始化后延迟刷新外层iframe大小 */
setTimeout(function(){
_this.updateIframe();
}, 300);
};
Formula.prototype = {
focus:function(){
$iframe.addClass('edui-formula-active');
this.isFocus = true;
},
blur:function(){
$iframe.removeClass('edui-formula-active');
this.removeCursor();
this.isFocus = false;
},
removeCursor: function(){
this.$mathquill.find('span.cursor').hide();
this.$mathquill.parent().find('.hasCursor').removeClass('hasCursor');
},
updateIframe: function(){
$iframe.width(this.$mathquill.width()+8).height(this.$mathquill.height()+8);
var latex = $iframe.attr('data-latex'),
newLatex = this.getLatex();
if(latex != newLatex) {
$iframe.attr('data-latex', this.getLatex());
saveScene();
}
},
insertLatex: function(latex){
this.$mathquill.mathquill('write', latex);
this.updateIframe();
this.removeCursor();
},
setLatex: function(latex){
this.$mathquill.mathquill('latex', latex);
this.updateIframe();
},
getLatex: function(){
return this.$mathquill.mathquill('latex');
},
redraw: function(){
this.$mathquill.mathquill('redraw');
},
setDisabled: function(){
this.blur();
var latex = this.getLatex();
this.$mathquill.mathquill('revert').text(latex).mathquill();
this.updateIframe();
this.isDisabled = true;
},
setEnabled: function(){
this.$mathquill.removeClass('mathquill-rendered-math');
this.refresh();
this.isDisabled = false;
},
refresh: function(){
var latex = this.getLatex();
this.$mathquill.mathquill('revert').text(latex).mathquill('editable');
this.updateIframe();
}
};
/* 绑定到window上给上级window调用 */
window.formula = new Formula();
});
</script>
</body>
</html>

View File

@@ -0,0 +1,124 @@
(function () {
var editor = null;
UM.registerWidget('formula', {
tpl: "<link type=\"text/css\" rel=\"stylesheet\" href=\"<%=formula_url%>formula.css\">" +
"<div class=\"edui-formula-wrapper\">" +
"<ul class=\"edui-tab-nav\"></ul>" +
"<div class=\"edui-tab-content\"></div>" +
"</div>",
sourceData: {
formula: {
'common': [
"{/}frac{ }{ }", "^{ }/_{ }", "x^{ }", "x_{ }", "x^{ }_{ }", "{/}bar{ }", "{/}sqrt{ }", "{/}nthroot{ }{ }",
"{/}sum^{ }_{n=}", "{/}sum", "{/}log_{ }", "{/}ln", "{/}int_{ }^{ }", "{/}oint_{ }^{ }"
],
'symbol': [
"+", "-", "{/}pm", "{/}times", "{/}ast", "{/}div", "/", "{/}bigtriangleup",
"=", "{/}ne", "{/}approx", ">", "<", "{/}ge", "{/}le", "{/}infty",
"{/}cap", "{/}cup", "{/}because", "{/}therefore", "{/}subset", "{/}supset", "{/}subseteq", "{/}supseteq",
"{/}nsubseteq", "{/}nsupseteq", "{/}in", "{/}ni", "{/}notin", "{/}mapsto", "{/}leftarrow", "{/}rightarrow",
"{/}Leftarrow", "{/}Rightarrow", "{/}leftrightarrow", "{/}Leftrightarrow"
],
'letter': [
"{/}alpha", "{/}beta", "{/}gamma", "{/}delta", "{/}varepsilon", "{/}varphi", "{/}lambda", "{/}mu",
"{/}rho", "{/}sigma", "{/}omega", "{/}Gamma", "{/}Delta", "{/}Theta", "{/}Lambda", "{/}Xi",
"{/}Pi", "{/}Sigma", "{/}Upsilon", "{/}Phi", "{/}Psi", "{/}Omega"
]
}
},
initContent: function (_editor, $widget) {
var me = this,
formula = me.sourceData.formula,
lang = _editor.getLang('formula').static,
formulaUrl = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/formula/',
options = $.extend({}, lang, { 'formula_url': formulaUrl }),
$root = me.root();
if (me.inited) {
me.preventDefault();
return;
}
me.inited = true;
editor = _editor;
me.$widget = $widget;
$root.html($.parseTmpl(me.tpl, options));
me.tabs = $.eduitab({selector: "#edui-formula-tab-Jpanel"});
/* 初始化popup的内容 */
var headHtml = [], xMax = 0, yMax = 0,
$tabContent = me.root().find('.edui-tab-content');
$.each(formula, function (k, v) {
var contentHtml = [];
$.each(v, function (i, f) {
contentHtml.push('<li class="edui-formula-latex-item" data-latex="' + f + '" style="background-position:-' + (xMax * 30) + 'px -' + (yMax * 30) + 'px"></li>');
if (++xMax >=8) {
++yMax; xMax = 0;
}
});
yMax++; xMax = 0;
$tabContent.append('<div class="edui-tab-pane"><ul>' + contentHtml.join('') + '</ul>');
headHtml.push('<li class="edui-tab-item"><a href="javascript:void(0);" class="edui-tab-text">' + lang['lang_tab_' + k] + '</a></li>');
});
headHtml.push('<li class="edui-formula-clearboth"></li>');
$root.find('.edui-tab-nav').html(headHtml.join(''));
$root.find('.edui-tab-content').append('<div class="edui-formula-clearboth"></div>');
/* 选中第一个tab */
me.switchTab(0);
},
initEvent: function () {
var me = this;
//防止点击过后关闭popup
me.root().on('click', function (e) {
return false;
});
//点击tab切换菜单
me.root().find('.edui-tab-nav').delegate('.edui-tab-item', 'click', function (evt) {
me.switchTab(this);
return false;
});
//点击选中公式
me.root().find('.edui-tab-pane').delegate('.edui-formula-latex-item', 'click', function (evt) {
var $item = $(this),
latex = $item.attr('data-latex') || '';
if (latex) {
me.insertLatex(latex.replace("{/}", "\\"));
}
me.$widget.edui().hide();
return false;
});
},
switchTab:function(index){
var me = this,
$root = me.root(),
index = $.isNumeric(index) ? index:$.inArray(index, $root.find('.edui-tab-nav .edui-tab-item'));
$root.find('.edui-tab-nav .edui-tab-item').removeClass('edui-active').eq(index).addClass('edui-active');
$root.find('.edui-tab-content .edui-tab-pane').removeClass('edui-active').eq(index).addClass('edui-active');
/* 自动长高 */
me.autoHeight(0);
},
autoHeight: function () {
this.$widget.height(this.root() + 2);
},
insertLatex: function (latex) {
editor.execCommand('formula', latex );
},
width: 350,
height: 400
});
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -0,0 +1,42 @@
.edui-dialog-image .edui-image-wrapper{font-size: 12px;margin: 15px;}
/*upload*/
.edui-dialog-image .edui-image-upload1{position: absolute;top:50%;left:50%;width:44px;height:38px;margin-top:-19px; margin-left: -22px;}
.edui-dialog-image .edui-image-upload2{position:relative;float:left;width:120px;height:120px;margin:5px 0 0 5px;}
.edui-dialog-image .edui-image-form{position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;opacity: 0;cursor: pointer;}
.edui-dialog-image .edui-image-form .edui-image-file{width: 100%;height:100%;filter: alpha(opacity=0)}
.edui-dialog-image .edui-image-upload1 .edui-image-icon{display: inline-block;width:44px;height:38px;background-image: url('images/upload1.png')}
.edui-dialog-image .edui-image-upload1 .edui-image-icon.hover{background-position: -50px 0;}
.edui-dialog-image .edui-image-upload2 .edui-image-icon{display: inline-block;width:120px;height:120px;background-image: url('images/upload2.png')}
.edui-dialog-image .edui-image-dragTip{position: absolute;display:none;top:50%;left:50%;margin-top:30px;margin-left: -60px;
color: #222;font-size:14px;text-shadow: 0px 2px 3px #555;}
.edui-dialog-image .edui-image-content{height:330px;width:100%;position: relative;}
.edui-dialog-image .edui-image-mask{display: none;position: absolute;top:0;left:0;width: 100%; height: 100%;background-color:#fff;
text-align: center;line-height:300px;color:#000;font-size:14px;font-weight:bold;opacity: 0.6;filter: alpha(opacity=60);}
.edui-dialog-image .edui-image-mask.edui-active{display: block;}
/*network*/
.edui-dialog-image .edui-image-searchBar{margin: 10px;}
.edui-dialog-image .edui-image-searchBar .edui-image-searchTxt{display: inline-block !important;*display: inline !important;*zoom:1;width:400px; border: 1px solid #c5d2ff; height: 20px; line-height: 18px; font-size: 14px; padding: 3px; margin: 0;outline:0;}
.edui-dialog-image .edui-image-searchBar .edui-image-searchAdd{display: inline-block !important;*display: inline !important;*zoom:1;
width:60px; text-align:center;height: 25px;text-align: center;line-height: 25px;
background-color: #ffffff;padding: 0; border: 1px solid #ababab;margin-left: 20px;cursor: pointer;
}
.edui-dialog-image .edui-image-searchBar .edui-image-searchAdd.hover{
background-color: #d5e1f2;
padding: 0;
border: 1px solid #a3bde3;
}
.edui-dialog-image .edui-image-searchRes{height:280px;overflow:auto;}
/*common*/
.edui-dialog-image .edui-image-item{position:relative;float:left;width:120px;height:120px;border: 1px solid #CCC;cursor: default;margin: 5px 0 0 5px;}
.edui-dialog-image .edui-image-item .edui-image-pic{position: absolute;left:-9999px;}
.edui-dialog-image .edui-image-item .edui-image-close{position:absolute;right:0;background: url('images/close.png');width:17px;height:17px;cursor:pointer;z-index:1}
.edui-dialog-image .edui-image-item.hover .edui-image-close{display: block;}

View File

@@ -0,0 +1,445 @@
(function () {
var utils = UM.utils,
browser = UM.browser,
Base = {
checkURL: function (url) {
if(!url) return false;
url = utils.trim(url);
if (url.length <= 0) {
return false;
}
if (url.search(/http:\/\/|https:\/\//) !== 0) {
url += 'http://';
}
url=url.replace(/\?[\s\S]*$/,"");
if (!/(.gif|.jpg|.jpeg|.png)$/i.test(url)) {
return false;
}
return url;
},
getAllPic: function (sel, $w, editor) {
var me = this,
arr = [],
$imgs = $(sel, $w);
$.each($imgs, function (index, node) {
$(node).removeAttr("width").removeAttr("height");
// if (node.width > editor.options.initialFrameWidth) {
// me.scale(node, editor.options.initialFrameWidth -
// parseInt($(editor.body).css("padding-left")) -
// parseInt($(editor.body).css("padding-right")));
// }
return arr.push({
_src: node.src,
src: node.src
});
});
return arr;
},
scale: function (img, max, oWidth, oHeight) {
var width = 0, height = 0, percent, ow = img.width || oWidth, oh = img.height || oHeight;
if (ow > max || oh > max) {
if (ow >= oh) {
if (width = ow - max) {
percent = (width / ow).toFixed(2);
img.height = oh - oh * percent;
img.width = max;
}
} else {
if (height = oh - max) {
percent = (height / oh).toFixed(2);
img.width = ow - ow * percent;
img.height = max;
}
}
}
return this;
},
close: function ($img) {
$img.css({
top: ($img.parent().height() - $img.height()) / 2,
left: ($img.parent().width()-$img.width())/2
}).prev().on("click",function () {
if ( $(this).parent().remove().hasClass("edui-image-upload-item") ) {
//显示图片计数-1
Upload.showCount--;
Upload.updateView();
}
});
return this;
},
createImgBase64: function (img, file, $w) {
if (browser.webkit) {
//Chrome8+
img.src = window.webkitURL.createObjectURL(file);
} else if (browser.gecko) {
//FF4+
img.src = window.URL.createObjectURL(file);
} else {
//实例化file reader对象
var reader = new FileReader();
reader.onload = function (e) {
img.src = this.result;
$w.append(img);
};
reader.readAsDataURL(file);
}
},
callback: function (editor, $w, url, state) {
if (state == "SUCCESS") {
//显示图片计数+1
Upload.showCount++;
var $img = $("<img src='" + editor.options.imagePath + url + "' class='edui-image-pic' />"),
$item = $("<div class='edui-image-item edui-image-upload-item'><div class='edui-image-close'></div></div>").append($img);
if ($(".edui-image-upload2", $w).length < 1) {
$(".edui-image-content", $w).append($item);
Upload.render(".edui-image-content", 2)
.config(".edui-image-upload2");
} else {
$(".edui-image-upload2", $w).before($item).show();
}
$img.on("load", function () {
Base.scale(this, 120);
Base.close($(this));
$(".edui-image-content", $w).focus();
});
} else {
currentDialog.showTip( state );
window.setTimeout( function () {
currentDialog.hideTip();
}, 3000 );
}
Upload.toggleMask();
}
};
/*
* 本地上传
* */
var Upload = {
showCount: 0,
uploadTpl: '<div class="edui-image-upload%%">' +
'<span class="edui-image-icon"></span>' +
'<form class="edui-image-form" method="post" enctype="multipart/form-data" target="up">' +
'<input style=\"filter: alpha(opacity=0);\" class="edui-image-file" type="file" hidefocus name="upfile" accept="image/gif,image/jpeg,image/png,image/jpg,image/bmp"/>' +
'</form>' +
'</div>',
init: function (editor, $w) {
var me = this;
me.editor = editor;
me.dialog = $w;
me.render(".edui-image-local", 1);
me.config(".edui-image-upload1");
me.submit();
me.drag();
$(".edui-image-upload1").hover(function () {
$(".edui-image-icon", this).toggleClass("hover");
});
if (!(UM.browser.ie && UM.browser.version <= 9)) {
$(".edui-image-dragTip", me.dialog).css("display", "block");
}
return me;
},
render: function (sel, t) {
var me = this;
$(sel, me.dialog).append($(me.uploadTpl.replace(/%%/g, t)));
return me;
},
config: function (sel) {
var me = this,
url=me.editor.options.imageUrl;
url=url + (url.indexOf("?") == -1 ? "?" : "&") + "editorid="+me.editor.id;//初始form提交地址;
$("form", $(sel, me.dialog)).attr("action", url);
return me;
},
uploadComplete: function(r){
var me = this;
try{
var json = eval('('+r+')');
Base.callback(me.editor, me.dialog, json.url, json.state);
}catch (e){
var lang = me.editor.getLang('image');
Base.callback(me.editor, me.dialog, '', (lang && lang.uploadError) || 'Error!');
}
},
submit: function (callback) {
var me = this,
input = $( '<input style="filter: alpha(opacity=0);" class="edui-image-file" type="file" hidefocus="" name="upfile" accept="image/gif,image/jpeg,image/png,image/jpg,image/bmp">'),
input = input[0];
$(me.dialog).delegate( ".edui-image-file", "change", function ( e ) {
if ( !this.parentNode ) {
return;
}
$('<iframe name="up" style="display: none"></iframe>').insertBefore(me.dialog).on('load', function(){
var r = this.contentWindow.document.body.innerHTML;
if(r == '')return;
me.uploadComplete(r);
$(this).unbind('load');
$(this).remove();
});
$(this).parent()[0].submit();
Upload.updateInput( input );
me.toggleMask("Loading....");
callback && callback();
});
return me;
},
//更新input
updateInput: function ( inputField ) {
$( ".edui-image-file", this.dialog ).each( function ( index, ele ) {
ele.parentNode.replaceChild( inputField.cloneNode( true ), ele );
} );
},
//更新上传框
updateView: function () {
if ( Upload.showCount !== 0 ) {
return;
}
$(".edui-image-upload2", this.dialog).hide();
$(".edui-image-dragTip", this.dialog).show();
$(".edui-image-upload1", this.dialog).show();
},
drag: function () {
var me = this;
//做拽上传的支持
if (!UM.browser.ie9below) {
me.dialog.find('.edui-image-content').on('drop',function (e) {
//获取文件列表
var fileList = e.originalEvent.dataTransfer.files;
var img = document.createElement('img');
var hasImg = false;
$.each(fileList, function (i, f) {
if (/^image/.test(f.type)) {
//创建图片的base64
Base.createImgBase64(img, f, me.dialog);
var xhr = new XMLHttpRequest();
xhr.open("post", me.editor.getOpt('imageUrl') + "?type=ajax", true);
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
//模拟数据
var fd = new FormData();
fd.append(me.editor.getOpt('imageFieldName'), f);
xhr.send(fd);
xhr.addEventListener('load', function (e) {
var r = e.target.response, json;
me.uploadComplete(r);
if (i == fileList.length - 1) {
$(img).remove()
}
});
hasImg = true;
}
});
if (hasImg) {
e.preventDefault();
me.toggleMask("Loading....");
}
}).on('dragover', function (e) {
e.preventDefault();
});
}
},
toggleMask: function (html) {
var me = this;
var $mask = $(".edui-image-mask", me.dialog);
if (html) {
if (!(UM.browser.ie && UM.browser.version <= 9)) {
$(".edui-image-dragTip", me.dialog).css( "display", "none" );
}
$(".edui-image-upload1", me.dialog).css( "display", "none" );
$mask.addClass("edui-active").html(html);
} else {
$mask.removeClass("edui-active").html();
if ( Upload.showCount > 0 ) {
return me;
}
if (!(UM.browser.ie && UM.browser.version <= 9) ){
$(".edui-image-dragTip", me.dialog).css("display", "block");
}
$(".edui-image-upload1", me.dialog).css( "display", "block" );
}
return me;
}
};
/*
* 网络图片
* */
var NetWork = {
init: function (editor, $w) {
var me = this;
me.editor = editor;
me.dialog = $w;
me.initEvt();
},
initEvt: function () {
var me = this,
url,
$ele = $(".edui-image-searchTxt", me.dialog);
$(".edui-image-searchAdd", me.dialog).on("click", function () {
url = Base.checkURL($ele.val());
if (url) {
$("<img src='" + url + "' class='edui-image-pic' />").on("load", function () {
var $item = $("<div class='edui-image-item'><div class='edui-image-close'></div></div>").append(this);
$(".edui-image-searchRes", me.dialog).append($item);
Base.scale(this, 120);
$item.width($(this).width());
Base.close($(this));
$ele.val("");
});
}
})
.hover(function () {
$(this).toggleClass("hover");
});
}
};
var $tab = null,
currentDialog = null;
UM.registerWidget('image', {
tpl: "<link rel=\"stylesheet\" type=\"text/css\" href=\"<%=image_url%>image.css\">" +
"<div class=\"edui-image-wrapper\">" +
"<ul class=\"edui-tab-nav\">" +
"<li class=\"edui-tab-item edui-active\"><a data-context=\".edui-image-local\" class=\"edui-tab-text\"><%=lang_tab_local%></a></li>" +
"<li class=\"edui-tab-item\"><a data-context=\".edui-image-JimgSearch\" class=\"edui-tab-text\"><%=lang_tab_imgSearch%></a></li>" +
"</ul>" +
"<div class=\"edui-tab-content\">" +
"<div class=\"edui-image-local edui-tab-pane edui-active\">" +
"<div class=\"edui-image-content\"></div>" +
"<div class=\"edui-image-mask\"></div>" +
"<div class=\"edui-image-dragTip\"><%=lang_input_dragTip%></div>" +
"</div>" +
"<div class=\"edui-image-JimgSearch edui-tab-pane\">" +
"<div class=\"edui-image-searchBar\">" +
"<table><tr><td><input class=\"edui-image-searchTxt\" type=\"text\"></td>" +
"<td><div class=\"edui-image-searchAdd\"><%=lang_btn_add%></div></td></tr></table>" +
"</div>" +
"<div class=\"edui-image-searchRes\"></div>" +
"</div>" +
"</div>" +
"</div>",
initContent: function (editor, $dialog) {
var lang = editor.getLang('image')["static"],
opt = $.extend({}, lang, {
image_url: UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/image/'
});
Upload.showCount = 0;
if (lang) {
var html = $.parseTmpl(this.tpl, opt);
}
currentDialog = $dialog.edui();
this.root().html(html);
},
initEvent: function (editor, $w) {
$tab = $.eduitab({selector: ".edui-image-wrapper"})
.edui().on("beforeshow", function (e) {
e.stopPropagation();
});
Upload.init(editor, $w);
NetWork.init(editor, $w);
},
buttons: {
'ok': {
exec: function (editor, $w) {
var sel = "",
index = $tab.activate();
if (index == 0) {
sel = ".edui-image-content .edui-image-pic";
} else if (index == 1) {
sel = ".edui-image-searchRes .edui-image-pic";
}
var list = Base.getAllPic(sel, $w, editor);
if (index != -1) {
editor.execCommand('insertimage', list);
}
}
},
'cancel': {}
},
width: 700,
height: 408
}, function (editor, $w, url, state) {
Base.callback(editor, $w, url, state)
})
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,73 @@
(function(){
var utils = UM.utils;
function hrefStartWith(href, arr) {
href = href.replace(/^\s+|\s+$/g, '');
for (var i = 0, ai; ai = arr[i++];) {
if (href.indexOf(ai) == 0) {
return true;
}
}
return false;
}
UM.registerWidget('link', {
tpl: "<style type=\"text/css\">" +
".edui-dialog-link .edui-link-table{font-size: 12px;margin: 10px;line-height: 30px}" +
".edui-dialog-link .edui-link-txt{width:300px;height:21px;line-height:21px;border:1px solid #d7d7d7;}" +
"</style>" +
"<table class=\"edui-link-table\">" +
"<tr>" +
"<td><label for=\"href\"><%=lang_input_url%></label></td>" +
"<td><input class=\"edui-link-txt\" id=\"edui-link-Jhref\" type=\"text\" /></td>" +
"</tr>" +
"<tr>" +
"<td><label for=\"title\"><%=lang_input_title%></label></td>" +
"<td><input class=\"edui-link-txt\" id=\"edui-link-Jtitle\" type=\"text\"/></td>" +
"</tr>" +
"<tr>" +
"<td colspan=\"2\">" +
"<label for=\"target\"><%=lang_input_target%></label>" +
"<input id=\"edui-link-Jtarget\" type=\"checkbox\"/>" +
"</td>" +
"</tr>" +
// "<tr>" +
// "<td colspan=\"2\" id=\"edui-link-Jmsg\"></td>" +
// "</tr>" +
"</table>",
initContent: function (editor) {
var lang = editor.getLang('link');
if (lang) {
var html = $.parseTmpl(this.tpl, lang.static);
}
this.root().html(html);
},
initEvent: function (editor, $w) {
var link = editor.queryCommandValue('link');
if(link){
$('#edui-link-Jhref',$w).val(utils.html($(link).attr('href')));
$('#edui-link-Jtitle',$w).val($(link).attr('title'));
$(link).attr('target') == '_blank' && $('#edui-link-Jtarget').attr('checked',true)
}
$('#edui-link-Jhref',$w).focus();
},
buttons: {
'ok': {
exec: function (editor, $w) {
var href = $('#edui-link-Jhref').val().replace(/^\s+|\s+$/g, '');
if (href) {
editor.execCommand('link', {
'href': href,
'target': $("#edui-link-Jtarget:checked").length ? "_blank" : '_self',
'title': $("#edui-link-Jtitle").val().replace(/^\s+|\s+$/g, ''),
'_href': href
});
}
}
},
'cancel':{}
},
width: 400
})
})();

View File

@@ -0,0 +1,148 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<meta name="keywords" content="百度地图,百度地图API百度地图自定义工具百度地图所见即所得工具"/>
<meta name="description" content="百度地图API自定义地图帮助用户在可视化操作下生成百度地图"/>
<title>百度地图API自定义地图</title>
<!--引用百度地图API-->
<style type="text/css">
html, body {
margin: 0;
padding: 0;
overflow: hidden;
}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=2.0&ak=6b6c1a67eaa7db1ca6d6da28e590e343&services=true"></script>
</head>
<body onload="initMap();">
<!--百度地图容器-->
<div style="width:697px;height:550px;border:#ccc solid 1px;" id="dituContent"></div>
</body>
<script type="text/javascript">
function getParam(name) {
return location.href.match(new RegExp('[?#&]' + name + '=([^?#&]+)', 'i')) ? RegExp.$1 : '';
}
var map, marker;
var centerParam = getParam('center');
var zoomParam = getParam('zoom');
var widthParam = getParam('width');
var heightParam = getParam('height');
var markersParam = getParam('markers');
var markerStylesParam = getParam('markerStyles');
var iframe = getSelfIframe();
var UM = parent.UM;
var editor = getEditor();
//创建和初始化地图函数:
function initMap() {
// [FF]切换模式后报错
if (!window.BMap) {
return;
}
var dituContent = document.getElementById('dituContent');
dituContent.style.width = widthParam + 'px';
dituContent.style.height = heightParam + 'px';
createMap();//创建地图
setMapEvent();//设置地图事件
addMapControl();//向地图添加控件
// 创建标注
var markersArr = markersParam.split(',');
var point = new BMap.Point(markersArr[0], markersArr[1]);
marker = new BMap.Marker(point);
marker.enableDragging();
map.addOverlay(marker); // 将标注添加到地图中
if(iframe && UM && editor) { //在编辑状态下
setMapListener();//地图改变修改外层的iframe标签src属性
} else {
document.focus();
}
}
//创建地图函数:
function createMap() {
map = new BMap.Map("dituContent");//在百度地图容器中创建一个地图
var centerArr = centerParam.split(',');
var point = new BMap.Point(parseFloat(centerArr[0]), parseFloat(centerArr[1]));//定义一个中心点坐标
map.centerAndZoom(point, parseInt(zoomParam));//设定地图的中心点和坐标并将地图显示在地图容器中
}
//地图事件设置函数:
function setMapEvent() {
map.enableDragging();//启用地图拖拽事件,默认启用(可不写)
map.enableScrollWheelZoom();//启用地图滚轮放大缩小
map.enableDoubleClickZoom();//启用鼠标双击放大,默认启用(可不写)
map.enableKeyboard();//启用键盘上下左右键移动地图
}
//地图控件添加函数:
function addMapControl() {
//向地图中添加缩放控件
var ctrl_nav = new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_LEFT, type: BMAP_NAVIGATION_CONTROL_LARGE});
map.addControl(ctrl_nav);
//向地图中添加缩略图控件
var ctrl_ove = new BMap.OverviewMapControl({anchor: BMAP_ANCHOR_BOTTOM_RIGHT, isOpen: 1});
map.addControl(ctrl_ove);
//向地图中添加比例尺控件
var ctrl_sca = new BMap.ScaleControl({anchor: BMAP_ANCHOR_BOTTOM_LEFT});
map.addControl(ctrl_sca);
}
function setMapListener() {
var timer;
map.addEventListener('moveend', mapListenerHandler);
map.addEventListener('zoomend', mapListenerHandler);
marker.addEventListener('dragend', mapListenerHandler);
function mapListenerHandler() {
var zoom = map.getZoom(),
center = map.getCenter(),
marker = window.marker.P;
iframe.src = iframe.src.
replace(new RegExp('([?#&])center=([^?#&]+)', 'i'), '$1center=' + center.lng + ',' + center.lat).
replace(new RegExp('([?#&])markers=([^?#&]+)', 'i'), '$1markers=' + marker.lng + ',' + marker.lat).
replace(new RegExp('([?#&])zoom=([^?#&]+)', 'i'), '$1zoom=' + zoom);
editor.fireEvent('saveScene');
saveScene(editor);
}
function saveScene(){
if(!timer) {
timer = setTimeout(function(){
editor.fireEvent('savescene');
editor.fireEvent('contentchange');
timer = null;
}, 1000);
}
}
}
function getSelfIframe(){
var iframes = parent.document.getElementsByTagName('iframe');
for (var key in iframes) {
if (iframes[key].contentWindow == window) {
return iframes[key];
}
}
return null;
}
function getEditor(){
var parentNode = iframe.parentNode;
while (parentNode && parentNode.tagName && parentNode.tagName.toLowerCase() != 'body') {
if (parentNode.className && parentNode.className.indexOf('edui-body-container')!=-1) {
return UM.getEditor(parentNode.id);
}
parentNode = parentNode.parentNode;
}
return null;
}
</script>
</html>

View File

@@ -0,0 +1,263 @@
(function () {
var widgetName = 'map';
UM.registerWidget(widgetName, {
tpl: "<style type=\"text/css\">" +
".edui-dialog-map .edui-map-content{width:530px; height: 350px;margin: 10px auto;}" +
".edui-dialog-map .edui-map-content table{width: 100%}" +
".edui-dialog-map .edui-map-content table td{vertical-align: middle;}" +
".edui-dialog-map .edui-map-button { border: 1px solid #ccc; float: left; cursor: default; height: 23px; width: 70px; cursor: pointer; margin: 0; font-size: 12px; line-height: 24px; text-align: center; }" +
".edui-dialog-map .edui-map-button:hover {background:#eee;}" +
".edui-dialog-map .edui-map-city,.edui-dialog-map .edui-map-address{height:21px;background: #FFF;border:1px solid #d7d7d7; line-height: 21px;}" +
".edui-dialog-map .edui-map-city{width:90px}" +
".edui-dialog-map .edui-map-address{width:150px}" +
".edui-dialog-map .edui-map-dynamic-label span{vertical-align:middle;margin: 3px 0px 3px 3px;}" +
".edui-dialog-map .edui-map-dynamic-label input{vertical-align:middle;margin: 3px;}" +
"</style>" +
"<div class=\"edui-map-content\">" +
"<table>" +
"<tr>" +
"<td><%=lang_city%>:</td>" +
"<td><input class=\"edui-map-city\" type=\"text\" value=\"<%=city.value%>\"/></td>" +
"<td><%=lang_address%>:</td>" +
"<td><input class=\"edui-map-address\" type=\"text\" value=\"\" /></td>" +
"<td><a class=\"edui-map-button\"><%=lang_search%></a></td>" +
"<td><label class=\"edui-map-dynamic-label\"><input class=\"edui-map-dynamic\" type=\"checkbox\" name=\"edui-map-dynamic\" /><span><%=lang_dynamicmap%></span></label></td>"+
"</tr>" +
"</table>" +
"<div style=\"width:100%;height:340px;margin:5px auto;border:1px solid gray\" class=\"edui-map-container\"></div>" +
"</div>" +
"<script class=\"edui-tpl-container\" type=\"text/plain\">" +
"<!DOCTYPE html>" +
"<html>" +
"<head>" +
"<title></title>" +
"</head>" +
"<body>" +
"<scr_ipt>" +
"window.onload = function(){" +
"var scripts = document.scripts || document.getElementsByTagName(\"script\")," +
"src = [];" +
"for( var i = 1, len = scripts.length; i<len; i++ ) {" +
"src.push( scripts[i].src );" +
"}" +
"parent.UM.getEditor(<<id>>).getWidgetData(\'map\').requestMapApi( src );" +
"};" +
"function mapReadyStateChange ( state ) { " +
" if ( state === 'complete' || state === 'loaded' ) {" +
" document.close(); " +
" } }" +
"</scr_ipt>" +
"<scr_ipt onreadystatechange='mapReadyStateChange(this.readyState);' onload='mapReadyStateChange(\"loaded\");' src=\"http://api.map.baidu.com/api?v=2.0&ak=6b6c1a67eaa7db1ca6d6da28e590e343&services=true\"></scr_ipt>" +
"</body>" +
"</html>" +
"</script>",
initContent: function (editor, $widget) {
var me = this,
lang = editor.getLang(widgetName),
theme_url = editor.options.themePath + editor.options.theme;
if( me.inited ) {
me.preventDefault();
return false;
}
me.inited = true;
me.lang = lang;
me.editor = editor;
me.root().html($.parseTmpl(me.tpl, $.extend({}, lang['static'], {
'theme_url': theme_url
})));
me.initRequestApi();
},
/**
* 初始化请求API
*/
initRequestApi: function () {
var $ifr = null;
//已经初始化过, 不用再次初始化
if (window.BMap && window.BMap.Map) {
this.initBaiduMap();
} else {
$ifr = $('<iframe style="display: none;"></iframe>');
$ifr.appendTo( this.root() );
$ifr = $ifr[ 0 ].contentWindow.document;
$ifr.open();
$ifr.write( this.root().find(".edui-tpl-container").html().replace( /scr_ipt/g, 'script').replace('<<id>>',"'" + this.editor.id + "'") );
}
},
requestMapApi: function (src) {
var me = this;
if (src.length) {
var _src = src[0];
src = src.slice(1);
if (_src) {
$.getScript(_src, function () {
me.requestMapApi(src);
});
} else {
me.requestMapApi(src);
}
} else {
me.initBaiduMap();
}
},
initBaiduMap: function () {
var $root = this.root(),
map = new BMap.Map($root.find(".edui-map-container")[0]),
me = this,
marker,
point,
imgcss,
img = $(me.editor.selection.getRange().getClosedNode());
map.enableInertialDragging();
map.enableScrollWheelZoom();
map.enableContinuousZoom();
if (img.length && /api[.]map[.]baidu[.]com/ig.test(img.attr("src"))) {
var url = img.attr("src"),
centerPos = me.getPars(url, "center").split(","),
markerPos = me.getPars(url, "markers").split(",");
point = new BMap.Point(Number(centerPos[0]), Number(centerPos[1]));
marker = new BMap.Marker(new BMap.Point(Number(markerPos[0]), Number(markerPos[1])));
map.addControl(new BMap.NavigationControl());
map.centerAndZoom(point, Number(me.getPars(url, "zoom")));
imgcss = img.attr('style');
} else {
point = new BMap.Point(116.404, 39.915); // 创建点坐标
marker = new BMap.Marker(point);
map.addControl(new BMap.NavigationControl());
map.centerAndZoom(point, 10); // 初始化地图,设置中心点坐标和地图级别。
}
marker.enableDragging();
map.addOverlay(marker);
me.map = map;
me.marker = marker;
me.imgcss = imgcss;
},
doSearch: function () {
var me = this,
city = me.root().find('.edui-map-city').val(),
address = me.root().find('.edui-map-address').val();
if (!city) {
alert(me.lang.cityMsg);
return;
}
var search = new BMap.LocalSearch(city, {
onSearchComplete: function (results) {
if (results && results.getNumPois()) {
var points = [];
for (var i = 0; i < results.getCurrentNumPois(); i++) {
points.push(results.getPoi(i).point);
}
if (points.length > 1) {
me.map.setViewport(points);
} else {
me.map.centerAndZoom(points[0], 13);
}
point = me.map.getCenter();
me.marker.setPoint(point);
} else {
alert(me.lang.errorMsg);
}
}
});
search.search(address || city);
},
getPars: function (str, par) {
var reg = new RegExp(par + "=((\\d+|[.,])*)", "g");
return reg.exec(str)[1];
},
reset: function(){
this.map && this.map.reset();
},
initEvent: function () {
var me = this,
$root = me.root();
$root.find('.edui-map-address').on('keydown', function (evt) {
evt = evt || event;
if (evt.keyCode == 13) {
me.doSearch();
return false;
}
});
$root.find(".edui-map-button").on('click', function (evt) {
me.doSearch();
});
$root.find(".edui-map-address").focus();
$root.on( "mousewheel DOMMouseScroll", function ( e ) {
return false;
} );
},
width: 580,
height: 408,
buttons: {
ok: {
exec: function (editor) {
var widget = editor.getWidgetData(widgetName),
center = widget.map.getCenter(),
zoom = widget.map.getZoom(),
size = widget.map.getSize(),
point = widget.marker.P;
if (widget.root().find(".edui-map-dynamic")[0].checked) {
var URL = editor.getOpt('UMEDITOR_HOME_URL'),
url = [URL + (/\/$/.test(URL) ? '':'/') + "dialogs/map/map.html" +
'#center=' + center.lng + ',' + center.lat,
'&zoom=' + zoom,
'&width=' + size.width,
'&height=' + size.height,
'&markers=' + point.lng + ',' + point.lat].join('');
editor.execCommand('inserthtml', '<iframe class="ueditor_baidumap" src="' + url + '" frameborder="0" width="' + (size.width+4) + '" height="' + (size.height+4) + '"></iframe>');
} else {
url = "http://api.map.baidu.com/staticimage?center=" + center.lng + ',' + center.lat +
"&zoom=" + zoom + "&width=" + size.width + '&height=' + size.height + "&markers=" + point.lng + ',' + point.lat;
editor.execCommand('inserthtml', '<img width="' + size.width + '"height="' + size.height + '" src="' + url + '"' + (widget.imgcss ? ' style="' + widget.imgcss + '"' : '') + '/>', true);
}
widget.reset();
}
},
cancel: {
exec: function(editor){
editor.getWidgetData(widgetName).reset();
}
}
}
});
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,59 @@
@charset "utf-8";
.edui-dialog-video .edui-video-wrapper{ width: 570px;_width:575px;margin: 10px auto; zoom:1;position: relative}
.edui-dialog-video .edui-video-tabbody{height:335px;}
.edui-dialog-video .edui-video-panel { position: absolute;width:100%; height:100%;background: #fff;}
.edui-dialog-video .edui-video-panel table td{vertical-align: middle;}
.edui-dialog-video #eduiVideoUrl {
width: 470px;
height: 21px;
line-height: 21px;
margin: 8px 5px;
background: #FFF;
border: 1px solid #d7d7d7;
}
.edui-dialog-video #eduiVideoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;}
.edui-dialog-video #searchList{width: 570px;overflow: auto;zoom:1;height: 270px;}
.edui-dialog-video #searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;}
.edui-dialog-video #searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/
.edui-dialog-video #searchList p{margin-left: 10px;}
.edui-dialog-video #eduiVideoType{
width: 65px;
height: 23px;
line-height: 22px;
border: 1px solid #d7d7d7;
}
.edui-dialog-video #eduiVideoSearchBtn,.edui-dialog-video #eduiVideoSearchReset{
/*width: 80px;*/
height: 25px;
line-height: 25px;
background: #eee;
border: 1px solid #d7d7d7;
cursor: pointer;
padding: 0 5px;
}
.edui-dialog-video #eduiVideoPreview{width: 420px; margin-left: 10px; _margin-left:5px; height: 280px;background-color: #ddd;float: left}
.edui-dialog-video #eduiVideoInfo {width: 120px;float: left;margin-left: 10px;_margin-left:7px;}
.edui-dialog-video .edui-video-wrapper fieldset{
border: 1px solid #ddd;
padding-left: 5px;
margin-bottom: 20px;
padding-bottom: 5px;
width: 115px;
}
.edui-dialog-video .edui-video-wrapper fieldset legend{font-weight: bold;}
.edui-dialog-video .edui-video-wrapper fieldset p{line-height: 30px;}
.edui-dialog-video .edui-video-wrapper fieldset input.edui-video-txt{
width: 65px;
height: 21px;
line-height: 21px;
margin: 8px 5px;
background: #FFF;
border: 1px solid #d7d7d7;
}
.edui-dialog-video .edui-video-wrapper label.edui-video-url{font-weight: bold;margin-left: 5px;color: #06c;}
.edui-dialog-video #eduiVideoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;}
.edui-dialog-video #eduiVideoFloat .edui-video-focus{opacity: 1;filter: alpha(opacity = 100)}
.edui-dialog-video .edui-video-wrapper span.edui-video-view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue}

View File

@@ -0,0 +1,282 @@
(function(){
var domUtils = UM.dom.domUtils;
var widgetName = 'video';
UM.registerWidget( widgetName,{
tpl: "<link rel=\"stylesheet\" type=\"text/css\" href=\"<%=video_url%>video.css\" />" +
"<div class=\"edui-video-wrapper\">" +
"<div id=\"eduiVideoTab\">" +
"<div id=\"eduiVideoTabHeads\" class=\"edui-video-tabhead\">" +
"<span tabSrc=\"video\" class=\"edui-video-focus\"><%=lang_tab_insertV%></span>" +
"</div>" +
"<div id=\"eduiVideoTabBodys\" class=\"edui-video-tabbody\">" +
"<div id=\"eduiVideoPanel\" class=\"edui-video-panel\">" +
"<table><tr><td><label for=\"eduiVideoUrl\" class=\"edui-video-url\"><%=lang_video_url%></label></td><td><input id=\"eduiVideoUrl\" type=\"text\"></td></tr></table>" +
"<div id=\"eduiVideoPreview\"></div>" +
"<div id=\"eduiVideoInfo\">" +
"<fieldset>" +
"<legend><%=lang_video_size%></legend>" +
"<table>" +
"<tr><td><label for=\"eduiVideoWidth\"><%=lang_videoW%></label></td><td><input class=\"edui-video-txt\" id=\"eduiVideoWidth\" type=\"text\"/></td></tr>" +
"<tr><td><label for=\"eduiVideoHeight\"><%=lang_videoH%></label></td><td><input class=\"edui-video-txt\" id=\"eduiVideoHeight\" type=\"text\"/></td></tr>" +
"</table>" +
"</fieldset>" +
"<fieldset>" +
"<legend><%=lang_alignment%></legend>" +
"<div id=\"eduiVideoFloat\"></div>" +
"</fieldset>" +
"</div>" +
"</div>" +
"</div>" +
"</div>" +
"</div>",
initContent:function( editor, $widget ){
var me = this,
lang = editor.getLang( widgetName),
video_url = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/video/';
me.lang = lang;
me.editor = editor;
me.$widget = $widget;
me.root().html( $.parseTmpl( me.tpl, $.extend( { video_url: video_url }, lang['static'] ) ) );
me.initController( lang );
},
initEvent:function(){
var me = this,
url = $("#eduiVideoUrl", me.$widget)[0];
if( 'oninput' in url ) {
url.oninput = function(){
me.createPreviewVideo( this.value );
};
} else {
url.onpropertychange = function () {
me.createPreviewVideo( this.value );
}
}
},
initController: function( lang ){
var me = this,
img = me.editor.selection.getRange().getClosedNode(),
url;
me.createAlignButton( ["eduiVideoFloat"] );
//编辑视频时初始化相关信息
if(img && img.className == "edui-faked-video"){
$("#eduiVideoUrl", me.$widget)[0].value = url = img.getAttribute("_url");
$("#eduiVideoWidth", me.$widget)[0].value = img.width;
$("#eduiVideoHeight", me.$widget)[0].value = img.height;
var align = domUtils.getComputedStyle(img,"float"),
parentAlign = domUtils.getComputedStyle(img.parentNode,"text-align");
me.updateAlignButton(parentAlign==="center"?"center":align);
}
me.createPreviewVideo(url);
},
/**
* 根据url生成视频预览
*/
createPreviewVideo: function(url){
if ( !url )return;
var me = this,
lang = me.lang,
conUrl = me.convert_url(url);
if(!me.endWith(conUrl,[".swf",".flv",".wmv"])){
$("#eduiVideoPreview", me.$widget).html( lang.urlError );
return;
}
$("#eduiVideoPreview", me.$widget)[0].innerHTML = '<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"' +
' src="' + url + '"' +
' width="' + 420 + '"' +
' height="' + 280 + '"' +
' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" ></embed>';
},
/**
* 将单个视频信息插入编辑器中
*/
insertSingle: function(){
var me = this,
width = $("#eduiVideoWidth", me.$widget)[0],
height = $("#eduiVideoHeight", me.$widget)[0],
url=$('#eduiVideoUrl', me.$widget)[0].value,
align = this.findFocus("eduiVideoFloat","name");
if(!url) return false;
if ( !me.checkNum( [width, height] ) ) return false;
this.editor.execCommand('insertvideo', {
url: me.convert_url(url),
width: width.value,
height: height.value,
align: align
});
},
/**
* URL转换
*/
convert_url: function(url){
if ( !url ) return '';
var matches = url.match(/youtu.be\/(\w+)$/) ||
url.match(/youtube\.com\/watch\?v=(\w+)/) ||
url.match(/youtube.com\/v\/(\w+)/),
youku = url.match(/youku\.com\/v_show\/id_(\w+)/),
youkuPlay = /player\.youku\.com/ig.test(url);
if(youkuPlay){
url = url.replace(/\?f=.*/, "");
} else if (matches){
url = "https://www.youtube.com/v/" + matches[1] + "?version=3&feature=player_embedded";
}else if(youku){
url = "http://player.youku.com/player.php/sid/"+youku[1]+"/v.swf"
} else {
url = url.replace(/http:\/\/www\.tudou\.com\/programs\/view\/([\w\-]+)\/?/i, "http://www.tudou.com/v/$1")
.replace(/http:\/\/www\.youtube\.com\/watch\?v=([\w\-]+)/i, "http://www.youtube.com/v/$1")
.replace(/http:\/\/v\.youku\.com\/v_show\/id_([\w\-=]+)\.html/i, "http://player.youku.com/player.php/sid/$1")
.replace(/http:\/\/www\.56\.com\/u\d+\/v_([\w\-]+)\.html/i, "http://player.56.com/v_$1.swf")
.replace(/http:\/\/www.56.com\/w\d+\/play_album\-aid\-\d+_vid\-([^.]+)\.html/i, "http://player.56.com/v_$1.swf")
.replace(/http:\/\/v\.ku6\.com\/.+\/([^.]+)\.html/i, "http://player.ku6.com/refer/$1/v.swf")
.replace(/\?f=.*/, "");
}
return url;
},
/**
* 检测传入的所有input框中输入的长宽是否是正数
*/
checkNum: function checkNum( nodes ) {
var me = this;
for ( var i = 0, ci; ci = nodes[i++]; ) {
var value = ci.value;
if ( !me.isNumber( value ) && value) {
alert( me.lang.numError );
ci.value = "";
ci.focus();
return false;
}
}
return true;
},
/**
* 数字判断
* @param value
*/
isNumber: function( value ) {
return /(0|^[1-9]\d*$)/.test( value );
},
updateAlignButton: function( align ) {
var aligns = $( "#eduiVideoFloat", this.$widget )[0].children;
for ( var i = 0, ci; ci = aligns[i++]; ) {
if ( ci.getAttribute( "name" ) == align ) {
if ( ci.className !="edui-video-focus" ) {
ci.className = "edui-video-focus";
}
} else {
if ( ci.className =="edui-video-focus" ) {
ci.className = "";
}
}
}
},
/**
* 创建图片浮动选择按钮
* @param ids
*/
createAlignButton: function( ids ) {
var lang = this.lang,
vidoe_home = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/video/';
for ( var i = 0, ci; ci = ids[i++]; ) {
var floatContainer = $( "#" + ci, this.$widget ) [0],
nameMaps = {"none":lang['default'], "left":lang.floatLeft, "right":lang.floatRight};
for ( var j in nameMaps ) {
var div = document.createElement( "div" );
div.setAttribute( "name", j );
if ( j == "none" ) div.className="edui-video-focus";
div.style.cssText = "background:url("+ vidoe_home +"images/" + j + "_focus.jpg);";
div.setAttribute( "title", nameMaps[j] );
floatContainer.appendChild( div );
}
this.switchSelect( ci );
}
},
/**
* 选择切换
*/
switchSelect: function( selectParentId ) {
var selects = $( "#" + selectParentId, this.$widget )[0].children;
for ( var i = 0, ci; ci = selects[i++]; ) {
$(ci).on("click", function () {
for ( var j = 0, cj; cj = selects[j++]; ) {
cj.className = "";
cj.removeAttribute && cj.removeAttribute( "class" );
}
this.className = "edui-video-focus";
} )
}
},
/**
* 找到id下具有focus类的节点并返回该节点下的某个属性
* @param id
* @param returnProperty
*/
findFocus: function( id, returnProperty ) {
var tabs = $( "#" + id , this.$widget)[0].children,
property;
for ( var i = 0, ci; ci = tabs[i++]; ) {
if ( ci.className=="edui-video-focus" ) {
property = ci.getAttribute( returnProperty );
break;
}
}
return property;
},
/**
* 末尾字符检测
*/
endWith: function(str,endStrArr){
for(var i=0,len = endStrArr.length;i<len;i++){
var tmp = endStrArr[i];
if(str.length - tmp.length<0) return false;
if(str.substring(str.length-tmp.length)==tmp){
return true;
}
}
return false;
},
width:610,
height:498,
buttons: {
ok: {
exec: function( editor, $w ){
$("#eduiVideoPreview", $w).html("");
editor.getWidgetData(widgetName).insertSingle();
}
},
cancel: {
exec: function(){
//清除视频
$("#eduiVideoPreview").html("");
}
}
}
});
})();

View File

@@ -0,0 +1,150 @@
/**
* English language package
*/
UM.I18N['en'] = {
'labelMap':{
'anchor':'Anchor', 'undo':'Undo', 'redo':'Redo', 'bold':'Bold', 'indent':'Indent', 'snapscreen':'SnapScreen',
'italic':'Italic', 'underline':'Underline', 'strikethrough':'Strikethrough', 'subscript':'SubScript','fontborder':'text border',
'superscript':'SuperScript', 'formatmatch':'Format Match', 'source':'Source', 'blockquote':'BlockQuote',
'pasteplain':'PastePlain', 'selectall':'SelectAll', 'print':'Print', 'preview':'Preview',
'horizontal':'Horizontal', 'removeformat':'RemoveFormat', 'time':'Time', 'date':'Date',
'unlink':'Unlink', 'insertrow':'InsertRow', 'insertcol':'InsertCol', 'mergeright':'MergeRight', 'mergedown':'MergeDown',
'deleterow':'DeleteRow', 'deletecol':'DeleteCol', 'splittorows':'SplitToRows','insertcode':'insert code',
'splittocols':'SplitToCols', 'splittocells':'SplitToCells','deletecaption':'DeleteCaption','inserttitle':'InsertTitle',
'mergecells':'MergeCells', 'deletetable':'DeleteTable', 'cleardoc':'Clear', 'insertparagraphbeforetable':"InsertParagraphBeforeTable",
'fontfamily':'FontFamily', 'fontsize':'FontSize', 'paragraph':'Paragraph', 'image':'Image','edittable':'Edit Table', 'edittd':'Edit Td','link':'Link',
'emotion':'Emotion', 'spechars':'Spechars', 'searchreplace':'SearchReplace', 'map':'BaiduMap', 'gmap':'GoogleMap',
'video':'Video', 'help':'Help', 'justifyleft':'JustifyLeft', 'justifyright':'JustifyRight', 'justifycenter':'JustifyCenter',
'justifyjustify':'Justify', 'forecolor':'FontColor', 'backcolor':'BackColor', 'insertorderedlist':'OL',
'insertunorderedlist':'UL', 'fullscreen':'FullScreen', 'directionalityltr':'EnterFromLeft', 'directionalityrtl':'EnterFromRight',
'rowspacingtop':'RowSpacingTop', 'rowspacingbottom':'RowSpacingBottom', 'highlightcode':'Code', 'pagebreak':'PageBreak', 'insertframe':'Iframe', 'imagenone':'Default',
'imageleft':'ImageLeft', 'imageright':'ImageRight', 'attachment':'Attachment', 'imagecenter':'ImageCenter', 'wordimage':'WordImage',
'lineheight':'LineHeight','edittip':'EditTip','customstyle':'CustomStyle', 'scrawl':'Scrawl', 'autotypeset':'AutoTypeset',
'webapp':'WebAPP', 'touppercase':'UpperCase', 'tolowercase':'LowerCase','template':'Template','background':'Background','inserttable':'InsertTable',
'drafts': 'drafts', 'formula':'formula'
},
'paragraph':{'p':'Paragraph', 'h1':'Title 1', 'h2':'Title 2', 'h3':'Title 3', 'h4':'Title 4', 'h5':'Title 5', 'h6':'Title 6'},
'fontfamily':{
'songti':'Sim sun',
'kaiti':'Sim kai',
'heiti':'Sim hei',
'lishu':'Sim li',
'yahei': 'Microsoft yahei',
'andaleMono':'Andale mono',
'arial': 'Arial',
'arialBlack':'Arial black',
'comicSansMs':'Comic sans ms',
'impact':'Impact',
'timesNewRoman':'Times new roman'
},
'ok':"OK",
'cancel':"Cancel",
'closeDialog':"closeDialog",
'tableDrag':"You must import the file uiUtils.js before drag! ",
'autofloatMsg':"The plugin AutoFloat depends on EditorUI!",
'anthorMsg':"Link",
'clearColor':'Clear',
'standardColor':'Standard color',
'themeColor':'Theme color',
'property':'Property',
'default':'Default',
'modify':'Modify',
'justifyleft':'Justify Left',
'justifyright':'Justify Right',
'justifycenter':'Justify Center',
'justify':'Default',
'clear':'Clear',
'anchorMsg':'Anchor',
'delete':'Delete',
'clickToUpload':"Click to upload",
'unset':"Language hasn't been set!",
't_row':'row',
't_col':'col',
'more':'More',
'pasteOpt':'Paste Option',
'pasteSourceFormat':"Keep Source Formatting",
'tagFormat':'Keep tag',
'pasteTextFormat':'Keep Text only',
//===============dialog i18N=======================
'image':{
'static':{
'lang_tab_local':"Local Upload",
'lang_tab_imgSearch':"Network Pictures",
'lang_input_dragTip':"Support drag upload",
'lang_btn_add':"Add"
},
'uploadError': 'Upload Error'
},
'emotion':{
'static':{
'lang_input_choice':'Choice',
'lang_input_Tuzki':'Tuzki',
'lang_input_lvdouwa':'LvDouWa',
'lang_input_BOBO':'BOBO',
'lang_input_babyCat':'BabyCat',
'lang_input_bubble':'Bubble',
'lang_input_youa':'YouA'
}
},
'gmap':{
'static':{
'lang_input_address':'Address:',
'lang_input_search':'Search',
'address':{'value':"Beijing"}
},
'searchError':'Unable to locate the address!'
},
'link':{
'static':{
'lang_input_text':'Text',
'lang_input_url':'URL',
'lang_input_title':'Title',
'lang_input_target':'open in new window'
},
'validLink':'Supports only effective when a link is selected',
'httpPrompt':'The hyperlink you enter should start with "http|https|ftp://"!'
},
'map':{
'static':{
'lang_city':"City",
'lang_address':"Address",
'city':{'value':"Beijing"},
'lang_search':"Search",
'lang_dynamicmap':"Dynamic map"
},
'cityMsg':"Please enter the city name!",
'errorMsg':"Can't find the place!"
},
'video':{
'static':{
'lang_tab_insertV':"Video",
'lang_video_url':" URL ",
'lang_video_size':"Video Size",
'lang_videoW':"Width",
'lang_videoH':"Height",
'lang_alignment':"Alignment",
'videoSearchTxt':{'value':"Enter the search keyword!"},
'videoType':{'options':["All", "Hot", "Entertainment", "Funny", "Sports", "Science", "variety"]},
'videoSearchBtn':{'value':"Search in Baidu"},
'videoSearchReset':{'value':"Clear result"}
},
'numError':"Please enter the correct Num. e.g 123,400",
'floatLeft':"Float left",
'floatRight':"Float right",
'default':"Default",
'block':"Display in block",
'urlError':"The video url format may be wrong!",
'loading':" &nbsp;The video is loading, please wait…",
'clickToSelect':"Click to select",
'goToSource':'Visit source video ',
'noVideo':" &nbsp; &nbsp;Sorry,can't find the video,please try again!"
},
'formula':{
'static':{
'lang_tab_common':'Common',
'lang_tab_symbol':'Symbol',
'lang_tab_letter':'Letter'
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1007 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -0,0 +1,150 @@
/**
* 中文语言包
*/
UM.I18N['zh-cn'] = {
'labelMap':{
'anchor':'锚点', 'undo':'撤销', 'redo':'重做', 'bold':'加粗', 'indent':'首行缩进', 'snapscreen':'截图',
'italic':'斜体', 'underline':'下划线', 'strikethrough':'删除线', 'subscript':'下标','fontborder':'字符边框',
'superscript':'上标', 'formatmatch':'格式刷', 'source':'源代码', 'blockquote':'引用',
'pasteplain':'纯文本粘贴模式', 'selectall':'全选', 'print':'打印', 'preview':'预览',
'horizontal':'分隔线', 'removeformat':'清除格式', 'time':'时间', 'date':'日期',
'unlink':'取消链接', 'insertrow':'前插入行', 'insertcol':'前插入列', 'mergeright':'右合并单元格', 'mergedown':'下合并单元格',
'deleterow':'删除行', 'deletecol':'删除列', 'splittorows':'拆分成行', 'splittocols':'拆分成列', 'splittocells':'完全拆分单元格',
'mergecells':'合并多个单元格', 'deletetable':'删除表格', 'cleardoc':'清空文档','insertparagraphbeforetable':"表格前插入行",'insertcode':'代码语言','fontfamily':'字体', 'fontsize':'字号', 'paragraph':'段落格式', 'image':'图片',
'edittable':'表格属性','edittd':'单元格属性', 'link':'超链接','emotion':'表情', 'spechars':'特殊字符', 'searchreplace':'查询替换', 'map':'百度地图', 'gmap':'Google地图',
'video':'视频', 'help':'帮助', 'justifyleft':'居左对齐', 'justifyright':'居右对齐', 'justifycenter':'居中对齐',
'justifyjustify':'两端对齐', 'forecolor':'字体颜色', 'backcolor':'背景色', 'insertorderedlist':'有序列表',
'insertunorderedlist':'无序列表', 'fullscreen':'全屏', 'directionalityltr':'从左向右输入', 'directionalityrtl':'从右向左输入',
'rowspacingtop':'段前距', 'rowspacingbottom':'段后距', 'highlightcode':'插入代码', 'pagebreak':'分页', 'insertframe':'插入Iframe', 'imagenone':'默认',
'imageleft':'左浮动', 'imageright':'右浮动', 'attachment':'附件', 'imagecenter':'居中', 'wordimage':'图片转存',
'lineheight':'行间距','edittip' :'编辑提示','customstyle':'自定义标题', 'autotypeset':'自动排版', 'webapp':'百度应用',
'touppercase':'字母大写', 'tolowercase':'字母小写','background':'背景','template':'模板','scrawl':'涂鸦','music':'音乐','inserttable':'插入表格',
'drafts': '草稿箱', 'formula':'数学公式'
},
'paragraph':{'p':'段落', 'h1':'标题 1', 'h2':'标题 2', 'h3':'标题 3', 'h4':'标题 4', 'h5':'标题 5', 'h6':'标题 6'},
'fontfamily':{
'songti':'宋体',
'kaiti':'楷体',
'heiti':'黑体',
'lishu':'隶书',
'yahei':'微软雅黑',
'andaleMono':'andale mono',
'arial': 'arial',
'arialBlack':'arial black',
'comicSansMs':'comic sans ms',
'impact':'impact',
'timesNewRoman':'times new roman'
},
'ok':"确认",
'cancel':"取消",
'closeDialog':"关闭对话框",
'tableDrag':"表格拖动必须引入uiUtils.js文件",
'autofloatMsg':"工具栏浮动依赖编辑器UI您首先需要引入UI文件!",
'anthorMsg':"链接",
'clearColor':'清空颜色',
'standardColor':'标准颜色',
'themeColor':'主题颜色',
'property':'属性',
'default':'默认',
'modify':'修改',
'justifyleft':'左对齐',
'justifyright':'右对齐',
'justifycenter':'居中',
'justify':'默认',
'clear':'清除',
'anchorMsg':'锚点',
'delete':'删除',
'clickToUpload':"点击上传",
'unset':'尚未设置语言文件',
't_row':'行',
't_col':'列',
'more':'更多',
'pasteOpt':'粘贴选项',
'pasteSourceFormat':"保留源格式",
'tagFormat':'只保留标签',
'pasteTextFormat':'只保留文本',
//===============dialog i18N=======================
'image':{
'static':{
'lang_tab_local':"本地上传",
'lang_tab_imgSearch':"网络图片",
'lang_input_dragTip':"支持图片拖拽上传",
'lang_btn_add':"添加"
},
'uploadError': '上传出错'
},
'emotion':{
'static':{
'lang_input_choice':'精选',
'lang_input_Tuzki':'兔斯基',
'lang_input_BOBO':'BOBO',
'lang_input_lvdouwa':'绿豆蛙',
'lang_input_babyCat':'baby猫',
'lang_input_bubble':'泡泡',
'lang_input_youa':'有啊'
}
},
'gmap':{
'static':{
'lang_input_address':'地址',
'lang_input_search':'搜索',
'address':{'value':"北京"}
},
'searchError':'无法定位到该地址!'
},
'link':{
'static':{
'lang_input_text':'文本内容:',
'lang_input_url':'链接地址:',
'lang_input_title':'标题:',
'lang_input_target':'是否在新窗口打开:'
},
'validLink':'只支持选中一个链接时生效',
'httpPrompt':'您输入的超链接中不包含http等协议名称默认将为您添加http://前缀'
},
'map':{
'static':{
'lang_city':"城市",
'lang_address':"地址",
'city':{'value':"北京"},
'lang_search':"搜索",
'lang_dynamicmap':"插入动态地图"
},
'cityMsg':"请选择城市",
'errorMsg':"抱歉,找不到该位置!"
},
'video':{
'static':{
'lang_tab_insertV':"插入视频",
'lang_video_url':"视频网址",
'lang_video_size':"视频尺寸",
'lang_videoW':"宽度",
'lang_videoH':"高度",
'lang_alignment':"对齐方式",
'videoSearchTxt':{'value':"请输入搜索关键字!"},
'videoType':{'options':["全部", "热门", "娱乐", "搞笑", "体育", "科技", "综艺"]},
'videoSearchBtn':{'value':"百度一下"},
'videoSearchReset':{'value':"清空结果"}
},
'numError':"请输入正确的数值如123,400",
'floatLeft':"左浮动",
'floatRight':"右浮动",
'default':"默认",
'block':"独占一行",
'urlError':"输入的视频地址有误,请检查后再试!",
'loading':" &nbsp;视频加载中,请等待……",
'clickToSelect':"点击选中",
'goToSource':'访问源视频',
'noVideo':" &nbsp; &nbsp;抱歉,找不到对应的视频,请重试!"
},
'formula':{
'static':{
'lang_tab_common':'常用公式',
'lang_tab_symbol':'符号',
'lang_tab_letter':'字母'
}
}
};

View File

@@ -0,0 +1,773 @@
.edui-container{
position: relative;
border: 1px solid #d4d4d4;
box-shadow: 2px 2px 5px #d3d6da;
background-color: #fff;
}
.edui-container .edui-toolbar{
position: relative;
width:auto;
border-bottom: 1px solid #e1e1e1;
box-shadow: 2px 2px 5px #d3d6da;
background-color: #fafafa;
z-index: 99999;
}
.edui-toolbar .edui-btn-toolbar{
position: relative;
padding: 5px;
}
.edui-container .edui-editor-body{
background-color: #fff;
}
.edui-editor-body .edui-body-container{
}
.edui-editor-body .edui-body-container p{margin:5px 0;}
.edui-editor-body .edui-body-container{
border:0;
outline:none;
cursor:text;
padding:0 10px 0;
overflow:auto;
display:block;
word-wrap:break-word;
font-size:16px;
font-family:sans-serif;
}
.edui-editor-body.focus{border:1px solid #5c9dff}
.edui-editor-body table{margin:10px 0 10px;border-collapse:collapse;display:table;}
.edui-editor-body td{padding: 5px 10px;border: 1px solid #DDD;}
.edui-editor-body iframe.mathquill-embedded-latex{
border: 0px;
padding: 0px;
display: inline;
margin: 0px;
background: none;
vertical-align: middle;
width: 0px;
height: 0px;
}
/*普通按钮*/
.edui-btn-toolbar .edui-btn{
position: relative;
display: inline-block;
vertical-align: top;
*display: inline;
*zoom:1;
width:auto;
margin: 0 1px;
padding:1px;
border:none;
background: none;
}
.edui-btn-toolbar .edui-btn .edui-icon{
width: 20px;
height: 20px;
margin: 0;
padding:0;
background-repeat: no-repeat;
background-image: url(../images/icons.png);
background-image: url(../images/icons.gif) \9;
}
/*状态反射*/
.edui-btn-toolbar .edui-btn.edui-hover,
.edui-btn-toolbar .edui-btn.edui-active{
background-color: #d5e1f2;
padding: 0;
border: 1px solid #a3bde3;
_z-index: 1;
}
.edui-btn-toolbar .edui-btn.edui-disabled{
opacity: 0.3;
filter: alpha(opacity = 30);
}
.edui-btn-toolbar .edui-btn .edui-icon-source {
background-position:-260px -0px;
}
.edui-btn-toolbar .edui-btn .edui-icon-undo {
background-position: -160px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-redo {
background-position: -100px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-bold{
background-position: 0 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-italic {
background-position: -60px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-underline {
background-position: -140px 0
}
.edui-btn-toolbar .edui-btn .edui-icon-strikethrough {
background-position: -120px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-superscript {
background-position: -620px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-subscript {
background-position: -600px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-font, .edui-btn-toolbar .edui-btn .edui-icon-forecolor {
background-position: -720px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-backcolor {
background-position: -760px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-insertorderedlist {
background-position: -80px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-insertunorderedlist {
background-position: -20px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-selectall {
background-position: -400px -20px;
}
.edui-btn-toolbar .edui-btn .edui-icon-cleardoc {
background-position: -520px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-paragraph {
background-position: -140px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-fontfamily {
background-position: -140px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-fontsize {
background-position: -140px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-justifyleft {
background-position: -460px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-justifycenter {
background-position: -420px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-justifyright {
background-position:-480px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-justifyjustify {
background-position: -440px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-link {
background-position: -500px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-unlink {
background-position: -640px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-image {
background-position: -380px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-emotion {
background-position: -60px -20px;
}
.edui-btn-toolbar .edui-btn .edui-icon-video {
background-position: -320px -20px;
}
.edui-btn-toolbar .edui-btn .edui-icon-map {
background-position: -40px -40px;
}
.edui-btn-toolbar .edui-btn .edui-icon-gmap {
background-position: -260px -40px;
}
.edui-btn-toolbar .edui-btn .edui-icon-horizontal {
background-position: -360px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-print {
background-position: -440px -20px;
}
.edui-btn-toolbar .edui-btn .edui-icon-preview {
background-position: -420px -20px;
}
.edui-btn-toolbar .edui-btn-fullscreen{
float:right;
}
.edui-btn-toolbar .edui-btn .edui-icon-fullscreen {
background-position: -100px -20px;
}
.edui-btn-toolbar .edui-btn .edui-icon-removeformat {
background-position: -580px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-drafts {
background-position: -560px 0;
}
.edui-btn-toolbar .edui-btn .edui-icon-formula {
background-position: -80px -20px;
}
.edui-btn-toolbar .edui-splitbutton{
position: relative;
display: inline-block ;
vertical-align: top;
*display: inline ;
*zoom:1;
margin:0 2px;
}
.edui-splitbutton .edui-btn{
margin: 0;
}
.edui-splitbutton .edui-caret{
position: relative;
display: inline-block ;
vertical-align: top;
*display: inline ;
*zoom:1;
width: 8px;
height: 20px;
background: url(../images/icons.png) -741px 0;
_background: url(../images/icons.gif) -741px 0;
}
.edui-btn-toolbar .edui-splitbutton,
.edui-btn-toolbar .edui-splitbutton{
_border: none;
}
/*状态反射*/
.edui-btn-toolbar .edui-splitbutton.edui-hover .edui-btn{
background-color: #d5e1f2;
}
.edui-btn-toolbar .edui-splitbutton.edui-disabled{
opacity: 0.3;
filter: alpha(opacity = 30);
}
.edui-btn-toolbar .edui-splitbutton.edui-disabled .edui-caret{
opacity: 0.3 \0;
filter: alpha(opacity = 30)\0;
}
.edui-btn-toolbar .edui-combobox{
border: 1px solid #CCC;
padding:0;
margin:0 2px;
line-height: 20px;
}
.edui-combobox .edui-button-label{
position: relative;
display: inline-block;
vertical-align: top;
*display: inline ;
*zoom:1;
width:60px;
height:20px;
line-height: 20px;
padding: 2px;
margin: 0;
font-size: 12px;
text-align: center;
cursor: default;
}
.edui-combobox .edui-button-spacing{
position: relative;
display: inline-block ;
vertical-align: top;
*display: inline ;
*zoom:1;
height:20px;
margin: 0;
padding:0 3px;
}
.edui-combobox .edui-caret{
position: relative;
display: inline-block ;
vertical-align: top;
*display: inline ;
*zoom:1;
height:20px;
width: 12px;
margin: 0;
padding: 0;
background: url(../images/icons.png) -741px 0;
_background: url(../images/icons.gif) -741px 0;
}
.edui-btn-toolbar .edui-combobox.edui-disabled{
opacity: 0.2;
filter: alpha(opacity = 20);
}
.edui-btn-toolbar .edui-combobox.edui-disabled .edui-button-label,
.edui-btn-toolbar .edui-combobox.edui-disabled .edui-caret{
opacity: 0.2 \0;
filter: alpha(opacity = 20)\0;
}
.edui-combobox-menu{
position: absolute;
top: 100%;
left: 0;
display: none;
list-style: none;
text-decoration: none;
margin: 0;
padding:5px;
background-color: #ffffff;
border: 1px solid #ccc;
font-size: 12px;
box-shadow: 2px 2px 5px #d3d6da;
min-width: 160px;
_width: 160px;
}
.edui-combobox-menu .edui-combobox-item {
display: block;
border: 1px solid white;
}
.edui-combobox-menu .edui-combobox-item-label {
height: 25px;
line-height: 25px;
display: inline-block;
_display: inline;
_zoom: 1;
margin-left: 10px;
}
.edui-combobox-menu .edui-combobox-item:hover, .edui-combobox-menu .edui-combobox-stack-item:hover, .edui-combobox-menu .edui-combobox-item-hover {
background-color: #d5e1f2;
padding: 0;
border: 1px solid #a3bde3;
}
.edui-combobox-menu .edui-combobox-item .edui-combobox-icon {
display: inline-block;
*zoom: 1;
*display: inline;
width: 24px;
height: 25px;
background: red;
vertical-align: bottom;
background: url(../images/ok.gif) no-repeat 1000px 1000px;
}
.edui-combobox-menu .edui-combobox-checked .edui-combobox-icon {
background-position: 10px 7px;
}
.edui-combobox-menu .edui-combobox-item-separator {
min-width: 160px;
height: 1px;
line-height: 1px;
overflow: hidden;
background: #d3d3d3;
margin: 5px 0;
*margin-top: -8px;
}
/* 字体样式校正 */
.edui-combobox-fontsize .edui-combobox-item-0.edui-combobox-checked .edui-combobox-icon {
background-position: 10px 7px;
}
.edui-combobox-fontsize .edui-combobox-item-1.edui-combobox-checked .edui-combobox-icon {
background-position: 10px 7px;
}
.edui-combobox-fontsize .edui-combobox-item-2.edui-combobox-checked .edui-combobox-icon {
background-position: 10px 7px;
}
.edui-combobox-fontsize .edui-combobox-item-3.edui-combobox-checked .edui-combobox-icon {
background-position: 10px 7px;
}
/* 24 */
.edui-combobox-fontsize .edui-combobox-item-4 .edui-combobox-item-label {
height: 27px;
line-height: 27px;
}
.edui-combobox-fontsize .edui-combobox-item-4.edui-combobox-checked .edui-combobox-icon {
background-position: 10px 5px;
}
/* 32 */
.edui-combobox-fontsize .edui-combobox-item-5 .edui-combobox-item-label {
height: 31px;
line-height: 31px;
}
.edui-combobox-fontsize .edui-combobox-item-5.edui-combobox-checked .edui-combobox-icon {
background-position: 10px 4px;
}
/* 48 */
.edui-combobox-fontsize .edui-combobox-item-6 .edui-combobox-item-label {
height: 47px;
line-height: 47px;
}
/*.edui-combobox-fontsize .edui-combobox-item-6 .edui-combobox-icon {*/
/*height: 25px;*/
/*margin-bottom: 11px;*/
/*}*/
/*.edui-combobox-fontsize .edui-combobox-item-6.edui-combobox-checked .edui-combobox-icon {*/
/*background-position: 10px 7px;*/
/*}*/
/* 段落样式校正 */
/* h1 */
.edui-combobox-paragraph .edui-combobox-item-1 .edui-combobox-item-label {
font-size: 32px;
height: 36px;
line-height: 36px;
}
.edui-combobox-paragraph .edui-combobox-item-1 .edui-combobox-icon {
height: 25px;
margin-bottom: 5px;
}
.edui-combobox-paragraph .edui-combobox-item-1.edui-combobox-checked .edui-combobox-icon {
background-position: 10px 7px;
}
/* h2 */
.edui-combobox-paragraph .edui-combobox-item-2 .edui-combobox-item-label {
font-size: 28px;
height: 27px;
line-height: 27px;
}
.edui-combobox-paragraph .edui-combobox-item-2 .edui-combobox-icon {
margin-bottom: 5px;
}
.edui-combobox-paragraph .edui-combobox-item-2.edui-combobox-checked .edui-combobox-icon {
background-position: 10px 10px;
}
/* h3 */
.edui-combobox-paragraph .edui-combobox-item-3 .edui-combobox-item-label {
font-size: 24px;
height: 25px;
line-height: 25px;
}
.edui-combobox-paragraph .edui-combobox-item-3 .edui-combobox-icon {
height: 25px;
margin-bottom: 5px;
}
.edui-combobox-paragraph .edui-combobox-item-3.edui-combobox-checked .edui-combobox-icon {
background-position: 10px 11px;
}
/* h4 */
.edui-combobox-paragraph .edui-combobox-item-4 .edui-combobox-item-label {
font-size: 18px;
height: 25px;
line-height: 25px;
}
.edui-combobox-paragraph .edui-combobox-item-4.edui-combobox-checked .edui-combobox-icon {
background-position: 10px 6px;
}
/* h5 */
.edui-combobox-paragraph .edui-combobox-item-5 .edui-combobox-item-label {
font-size: 16px;
}
/* h6 */
.edui-combobox-paragraph .edui-combobox-item-6 .edui-combobox-item-label {
font-size: 12px;
}
.edui-modal {
position: fixed;
_position: absolute;
top: 10%;
left: 50%;
border: 1px solid #acacac;
box-shadow: 2px 2px 5px #d3d6da;
background-color: #ffffff;
outline: 0;
}
.edui-modal-header {
padding: 5px 10px;
border-bottom: 1px solid #eee;
}
.edui-modal-header .edui-close {
float: right;
width:20px;
height:20px;
margin-top: 2px;
padding: 1px;
border: 0;
background: url("../images/close.png") no-repeat center center;
cursor: pointer;
}
.edui-modal-header .edui-close.edui-hover {
background-color: #d5e1f2;
padding:0;
border: 1px solid #a3bde3;
}
.edui-modal-header .edui-title {
margin: 0;
line-height: 25px;
font-size: 20px;
}
.edui-modal-body {
position: relative;
max-height: 400px;
font-size: 12px;
overflow-y: auto;
}
.edui-modal-footer {
float: right;
padding: 5px 15px 15px;
overflow: hidden;
}
.edui-modal-footer .edui-btn {
float: left;
height: 24px;
width: 96px;
margin: 0 10px;
background-color: #ffffff;
padding: 0;
border: 1px solid #ababab;
font-size: 12px;
line-height: 24px;
text-align: center;
cursor: pointer;
}
.edui-modal-footer .edui-btn.edui-hover{
background-color: #d5e1f2;
border: 1px solid #a3bde3;
}
.edui-modal-backdrop{
opacity: 0.5;
filter: alpha(opacity=50);
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: #c6c6c6;
}
.edui-modal .edui-modal-tip {
color: red;
position: absolute;
bottom: 10px;
left: 10px;
height: 30px;
line-height: 30px;
display: none;
}
/*图片上传*/
.edui-dialog-image-body {
width: 700px;
height: 400px;
}
/*插入视频*/
.edui-dialog-video-body{
width: 600px;
height: 350px;
}
/*谷歌地图*/
.edui-dialog-gmap-body{
width:550px;
height: 400px;
}
/*百度地图*/
.edui-dialog-map-body{
width:580px;
height: 400px;
}
/*链接*/
.edui-dialog-link-body{
width:400px;
height:200px;
}
.edui-popup{
display: none;
background: url('../images/pop-bg.png') repeat #fff;
padding: 2px;
}
.edui-popup .edui-popup-body{
border: 1px solid #bfbfbf;
background-color: #fff;
}
.edui-popup .edui-popup-caret{
width: 21px;
height: 11px;
}
.edui-popup .edui-popup-caret.up{
background:url('../images/caret.png') no-repeat 0 0;
}
.edui-popup .edui-popup-caret.down{
background:url('../images/caret.png') no-repeat 0 0;
}
.edui-tab-nav {
margin: 0;
padding:0;
border-bottom: 1px solid #ddd;
list-style: none;
height:30px;
}
.edui-tab-nav .edui-tab-item {
float:left;
margin-bottom: -1px;
margin-top: 1px;
margin-top: 0\9;
}
.edui-tab-nav .edui-tab-item .edui-tab-text{
display: block;
padding:8px 12px;
border: 1px solid transparent;
color: #0088cc;
text-decoration: none;
outline: 0;
_border:1px solid #fff ;
cursor: pointer;
}
.edui-tab-nav .edui-tab-item .edui-tab-text:FOCUS {
outline: none;
}
.edui-tab-nav .edui-tab-item.edui-active .edui-tab-text{
border: 1px solid #ddd;
border-bottom-color: transparent;
background-color: #fff;
padding:8px 12px;
color: #555555;
cursor: default;
}
.edui-tab-content .edui-tab-pane{
padding: 1px;
position: relative;
display: none;
background-color: #fff;
clear: both;
}
.edui-tab-content .edui-tab-pane.edui-active{
display: block;
}
.edui-btn-toolbar .edui-tooltip{
position: absolute;
padding: 5px 0;
display: none;
/*opacity: 0.8;*/
/*filter: alpha(opacity=80);*/
z-index: 99999;
}
.edui-tooltip .edui-tooltip-arrow{
position: absolute;
top: 0;
_top: -2px;
left: 50%;
width: 0;
height: 0;
padding: 0;
font-size:0;
margin-left: -5px;
border-color: transparent;
border-style: dashed dashed solid dashed;
border-bottom-color: #000000;
border-width: 0 5px 5px;
background: transparent;
}
.edui-tooltip .edui-tooltip-inner{
padding: 6px;
color: #ffffff;
text-align: center;
text-decoration: none;
font-size: 10px;
background-color: #000000;
white-space: nowrap;
line-height: 12px;
}
.edui-splitbutton-color-label {
width: 16px;
height: 3px;
position: absolute;
bottom: 2px;
left: 50%;
margin-left: -8px;
overflow: hidden;
line-height: 3px;
}
.edui-popup .edui-colorpicker {
margin: 10px;
font-size: 12px;
}
.edui-colorpicker .edui-colorpicker-topbar{
height: 27px;
width: 200px;
overflow: hidden;
}
.edui-colorpicker .edui-colorpicker-topbar .edui-colorpicker-preview{
height: 20px;
border: 1px inset black;
margin-left: 1px;
width: 128px;
float: left;
}
.edui-colorpicker .edui-colorpicker-topbar .edui-colorpicker-nocolor{
float: right;
margin-right: 1px;
font-size: 12px;
line-height: 14px;
height: 14px;
border: 1px solid #333;
padding: 3px 5px;
cursor: pointer;
}
.edui-colorpicker table{
border-collapse: collapse;
border-spacing: 2px;
}
.edui-colorpicker tr.edui-colorpicker-firstrow{
height: 30px;
}
.edui-colorpicker table td{
padding: 0 2px;
}
.edui-colorpicker table td .edui-colorpicker-colorcell{
display: block;
text-decoration: none;
color: black;
width: 14px;
height: 14px;
margin: 0;
cursor: pointer;
}
.edui-toolbar .edui-separator{
width: 2px;
height: 20px;
padding: 1px 2px;
background: url(../images/icons.png) -179px 1px;
background: url(../images/icons.gif) -179px 1px \9;
display: inline-block ;
vertical-align: top;
*display: inline ;
*zoom:1;
border:none;
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,103 @@
STIX Font License
24 May 2010
Copyright (c) 2001-2010 by the STI Pub Companies, consisting of the American
Institute of Physics, the American Chemical Society, the American Mathematical
Society, the American Physical Society, Elsevier, Inc., and The Institute of
Electrical and Electronic Engineers, Inc. (www.stixfonts.org), with Reserved
Font Name STIX Fonts, STIX Fonts (TM) is a trademark of The Institute of
Electrical and Electronics Engineers, Inc.
Portions copyright (c) 1998-2003 by MicroPress, Inc. (www.micropress-inc.com),
with Reserved Font Name TM Math. To obtain additional mathematical fonts, please
contact MicroPress, Inc., 68-30 Harrow Street, Forest Hills, NY 11375, USA,
Phone: (718) 575-1816.
Portions copyright (c) 1990 by Elsevier, Inc.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
---------------------------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
---------------------------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide development
of collaborative font projects, to support the font creation efforts of academic
and linguistic communities, and to provide a free and open framework in which
fonts may be shared and improved in partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and redistributed
freely as long as they are not sold by themselves. The fonts, including any
derivative works, can be bundled, embedded, redistributed and/or sold with any
software provided that any reserved names are not used by derivative works. The
fonts and derivatives, however, cannot be released under any other type of license.
The requirement for fonts to remain under this license does not apply to any
document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright Holder(s) under
this license and clearly marked as such. This may include source files, build
scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the copyright
statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting, or
substituting -- in part or in whole -- any of the components of the Original Version,
by changing formats or by porting the Font Software to a new environment.
"Author" refers to any designer, engineer, programmer, technical writer or other
person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the
Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell
modified and unmodified copies of the Font Software, subject to the following
conditions:
1) Neither the Font Software nor any of its individual components, in Original or
Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled, redistributed
and/or sold with any software, provided that each copy contains the above copyright
notice and this license. These can be included either as stand-alone text files,
human-readable headers or in the appropriate machine-readable metadata fields within
text or binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless
explicit written permission is granted by the corresponding Copyright Holder. This
restriction only applies to the primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall
not be used to promote, endorse or advertise any Modified Version, except to
acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with
their explicit written permission.
5) The Font Software, modified or unmodified, in part or in whole, must be distributed
entirely under this license, and must not be distributed under any other license. The
requirement for fonts to remain under this license does not apply to any document
created using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER
RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR
INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.0 MiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 533 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 415 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 397 KiB

View File

@@ -0,0 +1,357 @@
/*
* LaTeX Math in pure HTML and CSS -- No images whatsoever
* v0.xa
* by Jay and Han
* Lesser GPL Licensed: http: //www.gnu.org/licenses/lgpl.html
*
* This file is automatically included by mathquill.js
*
*/
@font-face {
font-family: Symbola;
src: url(font/Symbola.eot);
src: local("Symbola Regular"), local("Symbola"), url(font/Symbola.ttf) format("truetype"), url(font/Symbola.otf) format("opentype"), url(font/Symbola.svg#Symbola) format("svg");
}
.mathquill-editable {
display: -moz-inline-box;
display: inline-block;
white-space: pre-wrap;
}
.mathquill-editable .cursor {
border-left: 1px solid black;
margin-right: -1px;
position: relative;
z-index: 1;
padding: 0;
display: -moz-inline-box;
display: inline-block;
}
.mathquill-editable .cursor.blink {
visibility: hidden;
}
.mathquill-editable,
.mathquill-embedded-latex .mathquill-editable {
border: 1px solid gray;
padding: 2px;
}
.mathquill-embedded-latex .mathquill-editable {
margin: 1px;
}
.mathquill-editable.hasCursor,
.mathquill-editable .hasCursor {
-webkit-box-shadow: #68b4df 0 0 3px 2px;
-moz-box-shadow: #68b4df 0 0 3px 2px;
box-shadow: #68b4df 0 0 3px 2px;
}
.mathquill-editable .latex-command-input {
color: inherit;
font-family: "Courier New", monospace;
border: 1px solid gray;
padding-right: 1px;
margin-right: 1px;
margin-left: 2px;
}
.mathquill-editable .latex-command-input.empty {
background: transparent;
}
.mathquill-editable .latex-command-input.hasCursor {
border-color: ActiveBorder;
}
.mathquill-editable.empty:after,
.mathquill-textbox:after,
.mathquill-rendered-math .empty:after {
visibility: hidden;
content: 'c';
}
.mathquill-editable .cursor:only-child:after,
.mathquill-editable .textarea + .cursor:last-child:after {
visibility: hidden;
content: 'c';
}
.mathquill-textbox {
overflow-x: auto;
overflow-y: hidden;
}
.mathquill-rendered-math {
font-variant: normal;
font-weight: normal;
font-style: normal;
font-size: 115%;
line-height: 1;
display: -moz-inline-box;
display: inline-block;
}
.mathquill-rendered-math .non-leaf,
.mathquill-rendered-math .scaled {
display: -moz-inline-box;
display: inline-block;
}
.mathquill-rendered-math var,
.mathquill-rendered-math .text,
.mathquill-rendered-math .nonSymbola {
font-family: "Times New Roman", Symbola, serif;
line-height: .9;
}
.mathquill-rendered-math * {
font-size: inherit;
line-height: inherit;
margin: 0;
padding: 0;
border-color: black;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.mathquill-rendered-math .empty {
background: #ccc;
}
.mathquill-rendered-math.empty {
background: transparent;
}
.mathquill-rendered-math .text {
font-size: 87%;
}
.mathquill-rendered-math .font {
font: 1em "Times New Roman", Symbola, serif;
}
.mathquill-rendered-math .font * {
font-family: inherit;
font-style: inherit;
}
.mathquill-rendered-math b,
.mathquill-rendered-math b.font {
font-weight: bolder;
}
.mathquill-rendered-math var,
.mathquill-rendered-math i,
.mathquill-rendered-math i.font {
font-syle: italic;
}
.mathquill-rendered-math var.florin {
margin: 0 -0.1em;
}
.mathquill-rendered-math big {
font-size: 125%;
}
.mathquill-rendered-math .roman {
font-style: normal;
}
.mathquill-rendered-math .sans-serif {
font-family: sans-serif, Symbola, serif;
}
.mathquill-rendered-math .monospace {
font-family: monospace, Symbola, serif;
}
.mathquill-rendered-math .overline {
border-top: 1px solid black;
margin-top: 1px;
}
.mathquill-rendered-math .underline {
border-bottom: 1px solid black;
margin-bottom: 1px;
}
.mathquill-rendered-math .binary-operator {
padding: 0 0.2em;
display: -moz-inline-box;
display: inline-block;
}
.mathquill-rendered-math .unary-operator {
padding-left: 0.2em;
}
.mathquill-rendered-math sup,
.mathquill-rendered-math sub {
position: relative;
font-size: 90%;
}
.mathquill-rendered-math sup .binary-operator,
.mathquill-rendered-math sub .binary-operator {
padding: 0 .1em;
}
.mathquill-rendered-math sup .unary-operator,
.mathquill-rendered-math sub .unary-operator {
padding-left: .1em;
}
.mathquill-rendered-math sup.limit,
.mathquill-rendered-math sub.limit,
.mathquill-rendered-math sup.nthroot,
.mathquill-rendered-math sub.nthroot {
font-size: 80%;
}
.mathquill-rendered-math sup .fraction,
.mathquill-rendered-math sub .fraction {
font-size: 70%;
vertical-align: -0.4em;
}
.mathquill-rendered-math sup .numerator,
.mathquill-rendered-math sub .numerator {
padding-bottom: 0;
}
.mathquill-rendered-math sup .denominator,
.mathquill-rendered-math sub .denominator {
padding-top: 0;
}
.mathquill-rendered-math sup {
vertical-align: .5em;
}
.mathquill-rendered-math sup.limit,
.mathquill-rendered-math sup.nthroot {
vertical-align: 0.8em;
}
.mathquill-rendered-math sup.nthroot {
margin-right: -0.6em;
margin-left: .2em;
min-width: .5em;
}
.mathquill-rendered-math sub {
vertical-align: -0.4em;
}
.mathquill-rendered-math sub.limit {
vertical-align: -0.6em;
}
.mathquill-rendered-math .paren {
padding: 0 .1em;
vertical-align: bottom;
-webkit-transform-origin: bottom center;
-moz-transform-origin: bottom center;
-ms-transform-origin: bottom center;
-o-transform-origin: bottom center;
transform-origin: bottom center;
}
.mathquill-rendered-math .array {
vertical-align: middle;
text-align: center;
}
.mathquill-rendered-math .array > span {
display: block;
}
.mathquill-rendered-math .non-italicized-function {
font-family: Symbola, "Times New Roman", serif;
line-height: .9;
font-style: normal;
padding-right: .2em;
}
.mathquill-rendered-math .fraction {
font-size: 90%;
text-align: center;
vertical-align: -0.5em;
padding: 0 .2em;
}
.mathquill-rendered-math .fraction,
.mathquill-rendered-math x:-moz-any-link {
display: -moz-groupbox;
}
.mathquill-rendered-math .fraction,
.mathquill-rendered-math x:-moz-any-link,
.mathquill-rendered-math x:default {
display: inline-block;
}
.mathquill-rendered-math .numerator,
.mathquill-rendered-math .denominator {
display: block;
}
.mathquill-rendered-math .numerator {
padding: 0 0.1em;
margin-bottom: -0.1em;
}
.mathquill-rendered-math .denominator {
border-top: 1px solid;
float: right;
width: 100%;
padding: .1em .1em 0 .1em;
margin-right: -0.1em;
margin-left: -0.1em;
}
.mathquill-rendered-math .sqrt-prefix {
padding-top: 0;
position: relative;
top: .1em;
vertical-align: top;
-webkit-transform-origin: top;
-moz-transform-origin: top;
-ms-transform-origin: top;
-o-transform-origin: top;
transform-origin: top;
}
.mathquill-rendered-math .sqrt-stem {
border-top: 1px solid;
margin-top: 1px;
padding-left: .15em;
padding-right: .2em;
margin-right: .1em;
}
.mathquill-rendered-math .vector-prefix {
display: block;
text-align: center;
line-height: .25em;
margin-bottom: -0.1em;
font-size: 0.75em;
}
.mathquill-rendered-math .vector-stem {
display: block;
}
.mathquill-rendered-math,
.mathquill-rendered-math .mathquill-editable {
cursor: text;
font-family: Symbola, "Times New Roman", serif;
}
.mathquill-rendered-math .selection,
.mathquill-editable .selection,
.mathquill-rendered-math .selection .non-leaf,
.mathquill-editable .selection .non-leaf,
.mathquill-rendered-math .selection .scaled,
.mathquill-editable .selection .scaled {
background: #B4D5FE !important;
background: Highlight !important;
color: HighlightText;
border-color: HighlightText;
}
.mathquill-rendered-math .selection .matrixed,
.mathquill-editable .selection .matrixed {
background: #39F !important;
}
.mathquill-rendered-math .selection .matrixed-container,
.mathquill-editable .selection .matrixed-container {
filter: progid:DXImageTransform.Microsoft.Chroma(color='#3399FF') !important;
}
.mathquill-rendered-math .selection.blur,
.mathquill-editable .selection.blur,
.mathquill-rendered-math .selection.blur .non-leaf,
.mathquill-editable .selection.blur .non-leaf,
.mathquill-rendered-math .selection.blur .scaled,
.mathquill-editable .selection.blur .scaled,
.mathquill-rendered-math .selection.blur .matrixed,
.mathquill-editable .selection.blur .matrixed {
background: #D4D4D4 !important;
color: black;
border-color: black;
}
.mathquill-rendered-math .selection.blur .matrixed-container,
.mathquill-editable .selection.blur .matrixed-container {
filter: progid:DXImageTransform.Microsoft.Chroma(color='#D4D4D4') !important;
}
.mathquill-editable .textarea,
.mathquill-rendered-math .textarea {
position: relative;
-webkit-user-select: text;
-moz-user-select: text;
user-select: text;
}
.mathquill-editable .textarea textarea,
.mathquill-rendered-math .textarea textarea,
.mathquill-editable .selectable,
.mathquill-rendered-math .selectable {
-webkit-user-select: text;
-moz-user-select: text;
user-select: text;
position: absolute;
clip: rect(1em 1em 1em 1em);
}
.mathquill-rendered-math .matrixed {
background: white;
display: -moz-inline-box;
display: inline-block;
}
.mathquill-rendered-math .matrixed-container {
filter: progid:DXImageTransform.Microsoft.Chroma(color='white');
margin-top: -0.1em;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

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