@ -0,0 +1,94 @@ |
|||
/* 前后端通信相关的配置,注释只允许使用多行方式 */ |
|||
{ |
|||
/* 上传图片配置项 */ |
|||
"imageActionName": "uploadimage", /* 执行上传图片的action名称 */ |
|||
"imageFieldName": "upfile", /* 提交的图片表单名称 */ |
|||
"imageMaxSize": 2048000, /* 上传大小限制,单位B */ |
|||
"imageAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 上传图片格式显示 */ |
|||
"imageCompressEnable": true, /* 是否压缩图片,默认是true */ |
|||
"imageCompressBorder": 1600, /* 图片压缩最长边限制 */ |
|||
"imageInsertAlign": "none", /* 插入的图片浮动方式 */ |
|||
"imageUrlPrefix": "", /* 图片访问路径前缀 */ |
|||
"imagePathFormat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ |
|||
/* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */ |
|||
/* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */ |
|||
/* {time} 会替换成时间戳 */ |
|||
/* {yyyy} 会替换成四位年份 */ |
|||
/* {yy} 会替换成两位年份 */ |
|||
/* {mm} 会替换成两位月份 */ |
|||
/* {dd} 会替换成两位日期 */ |
|||
/* {hh} 会替换成两位小时 */ |
|||
/* {ii} 会替换成两位分钟 */ |
|||
/* {ss} 会替换成两位秒 */ |
|||
/* 非法字符 \ : * ? " < > | */ |
|||
/* 具请体看线上文档: fex.baidu.com/ueditor/#use-format_upload_filename */ |
|||
|
|||
/* 涂鸦图片上传配置项 */ |
|||
"scrawlActionName": "uploadscrawl", /* 执行上传涂鸦的action名称 */ |
|||
"scrawlFieldName": "upfile", /* 提交的图片表单名称 */ |
|||
"scrawlPathFormat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ |
|||
"scrawlMaxSize": 2048000, /* 上传大小限制,单位B */ |
|||
"scrawlUrlPrefix": "", /* 图片访问路径前缀 */ |
|||
"scrawlInsertAlign": "none", |
|||
|
|||
/* 截图工具上传 */ |
|||
"snapscreenActionName": "uploadimage", /* 执行上传截图的action名称 */ |
|||
"snapscreenPathFormat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ |
|||
"snapscreenUrlPrefix": "", /* 图片访问路径前缀 */ |
|||
"snapscreenInsertAlign": "none", /* 插入的图片浮动方式 */ |
|||
|
|||
/* 抓取远程图片配置 */ |
|||
"catcherLocalDomain": ["127.0.0.1", "localhost", "img.baidu.com"], |
|||
"catcherActionName": "catchimage", /* 执行抓取远程图片的action名称 */ |
|||
"catcherFieldName": "source", /* 提交的图片列表表单名称 */ |
|||
"catcherPathFormat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ |
|||
"catcherUrlPrefix": "", /* 图片访问路径前缀 */ |
|||
"catcherMaxSize": 2048000, /* 上传大小限制,单位B */ |
|||
"catcherAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 抓取图片格式显示 */ |
|||
|
|||
/* 上传视频配置 */ |
|||
"videoActionName": "uploadvideo", /* 执行上传视频的action名称 */ |
|||
"videoFieldName": "upfile", /* 提交的视频表单名称 */ |
|||
"videoPathFormat": "/ueditor/php/upload/video/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ |
|||
"videoUrlPrefix": "", /* 视频访问路径前缀 */ |
|||
"videoMaxSize": 102400000, /* 上传大小限制,单位B,默认100MB */ |
|||
"videoAllowFiles": [ |
|||
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", |
|||
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid"], /* 上传视频格式显示 */ |
|||
|
|||
/* 上传文件配置 */ |
|||
"fileActionName": "uploadfile", /* controller里,执行上传视频的action名称 */ |
|||
"fileFieldName": "upfile", /* 提交的文件表单名称 */ |
|||
"filePathFormat": "/ueditor/php/upload/file/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ |
|||
"fileUrlPrefix": "", /* 文件访问路径前缀 */ |
|||
"fileMaxSize": 51200000, /* 上传大小限制,单位B,默认50MB */ |
|||
"fileAllowFiles": [ |
|||
".png", ".jpg", ".jpeg", ".gif", ".bmp", |
|||
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", |
|||
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid", |
|||
".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", |
|||
".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml" |
|||
], /* 上传文件格式显示 */ |
|||
|
|||
/* 列出指定目录下的图片 */ |
|||
"imageManagerActionName": "listimage", /* 执行图片管理的action名称 */ |
|||
"imageManagerListPath": "/ueditor/php/upload/image/", /* 指定要列出图片的目录 */ |
|||
"imageManagerListSize": 20, /* 每次列出文件数量 */ |
|||
"imageManagerUrlPrefix": "", /* 图片访问路径前缀 */ |
|||
"imageManagerInsertAlign": "none", /* 插入的图片浮动方式 */ |
|||
"imageManagerAllowFiles": [".png", ".jpg", ".jpeg", ".gif", ".bmp"], /* 列出的文件类型 */ |
|||
|
|||
/* 列出指定目录下的文件 */ |
|||
"fileManagerActionName": "listfile", /* 执行文件管理的action名称 */ |
|||
"fileManagerListPath": "/ueditor/php/upload/file/", /* 指定要列出文件的目录 */ |
|||
"fileManagerUrlPrefix": "", /* 文件访问路径前缀 */ |
|||
"fileManagerListSize": 20, /* 每次列出文件数量 */ |
|||
"fileManagerAllowFiles": [ |
|||
".png", ".jpg", ".jpeg", ".gif", ".bmp", |
|||
".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", |
|||
".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid", |
|||
".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", |
|||
".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml" |
|||
] /* 列出的文件类型 */ |
|||
|
|||
} |
|||
@ -0,0 +1,175 @@ |
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
|||
"http://www.w3.org/TR/html4/loose.dtd"> |
|||
<html> |
|||
<head> |
|||
<title>完整demo</title> |
|||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> |
|||
<script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script> |
|||
<script type="text/javascript" charset="utf-8" src="ueditor.all.min.js"> </script> |
|||
<!--建议手动加在语言,避免在ie下有时因为加载语言失败导致编辑器加载失败--> |
|||
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型,比如你在配置项目里配置的是英文,这里加载的中文,那最后就是中文--> |
|||
<script type="text/javascript" charset="utf-8" src="lang/zh-cn/zh-cn.js"></script> |
|||
|
|||
<style type="text/css"> |
|||
div{ |
|||
width:100%; |
|||
} |
|||
</style> |
|||
</head> |
|||
<body> |
|||
<div> |
|||
<h1>完整demo</h1> |
|||
<script id="editor" type="text/plain" style="width:1024px;height:500px;"></script> |
|||
</div> |
|||
<div id="btns"> |
|||
<div> |
|||
<button onclick="getAllHtml()">获得整个html的内容</button> |
|||
<button onclick="getContent()">获得内容</button> |
|||
<button onclick="setContent()">写入内容</button> |
|||
<button onclick="setContent(true)">追加内容</button> |
|||
<button onclick="getContentTxt()">获得纯文本</button> |
|||
<button onclick="getPlainTxt()">获得带格式的纯文本</button> |
|||
<button onclick="hasContent()">判断是否有内容</button> |
|||
<button onclick="setFocus()">使编辑器获得焦点</button> |
|||
<button onmousedown="isFocus(event)">编辑器是否获得焦点</button> |
|||
<button onmousedown="setblur(event)" >编辑器失去焦点</button> |
|||
|
|||
</div> |
|||
<div> |
|||
<button onclick="getText()">获得当前选中的文本</button> |
|||
<button onclick="insertHtml()">插入给定的内容</button> |
|||
<button id="enable" onclick="setEnabled()">可以编辑</button> |
|||
<button onclick="setDisabled()">不可编辑</button> |
|||
<button onclick=" UE.getEditor('editor').setHide()">隐藏编辑器</button> |
|||
<button onclick=" UE.getEditor('editor').setShow()">显示编辑器</button> |
|||
<button onclick=" UE.getEditor('editor').setHeight(300)">设置高度为300默认关闭了自动长高</button> |
|||
</div> |
|||
|
|||
<div> |
|||
<button onclick="getLocalData()" >获取草稿箱内容</button> |
|||
<button onclick="clearLocalData()" >清空草稿箱</button> |
|||
</div> |
|||
|
|||
</div> |
|||
<div> |
|||
<button onclick="createEditor()"> |
|||
创建编辑器</button> |
|||
<button onclick="deleteEditor()"> |
|||
删除编辑器</button> |
|||
</div> |
|||
|
|||
<script type="text/javascript"> |
|||
|
|||
//实例化编辑器 |
|||
//建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例 |
|||
var ue = UE.getEditor('editor'); |
|||
|
|||
|
|||
function isFocus(e){ |
|||
alert(UE.getEditor('editor').isFocus()); |
|||
UE.dom.domUtils.preventDefault(e) |
|||
} |
|||
function setblur(e){ |
|||
UE.getEditor('editor').blur(); |
|||
UE.dom.domUtils.preventDefault(e) |
|||
} |
|||
function insertHtml() { |
|||
var value = prompt('插入html代码', ''); |
|||
UE.getEditor('editor').execCommand('insertHtml', value) |
|||
} |
|||
function createEditor() { |
|||
enableBtn(); |
|||
UE.getEditor('editor'); |
|||
} |
|||
function getAllHtml() { |
|||
alert(UE.getEditor('editor').getAllHtml()) |
|||
} |
|||
function getContent() { |
|||
var arr = []; |
|||
arr.push("使用editor.getContent()方法可以获得编辑器的内容"); |
|||
arr.push("内容为:"); |
|||
arr.push(UE.getEditor('editor').getContent()); |
|||
alert(arr.join("\n")); |
|||
} |
|||
function getPlainTxt() { |
|||
var arr = []; |
|||
arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容"); |
|||
arr.push("内容为:"); |
|||
arr.push(UE.getEditor('editor').getPlainTxt()); |
|||
alert(arr.join('\n')) |
|||
} |
|||
function setContent(isAppendTo) { |
|||
var arr = []; |
|||
arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容"); |
|||
UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo); |
|||
alert(arr.join("\n")); |
|||
} |
|||
function setDisabled() { |
|||
UE.getEditor('editor').setDisabled('fullscreen'); |
|||
disableBtn("enable"); |
|||
} |
|||
|
|||
function setEnabled() { |
|||
UE.getEditor('editor').setEnabled(); |
|||
enableBtn(); |
|||
} |
|||
|
|||
function getText() { |
|||
//当你点击按钮时编辑区域已经失去了焦点,如果直接用getText将不会得到内容,所以要在选回来,然后取得内容 |
|||
var range = UE.getEditor('editor').selection.getRange(); |
|||
range.select(); |
|||
var txt = UE.getEditor('editor').selection.getText(); |
|||
alert(txt) |
|||
} |
|||
|
|||
function getContentTxt() { |
|||
var arr = []; |
|||
arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容"); |
|||
arr.push("编辑器的纯文本内容为:"); |
|||
arr.push(UE.getEditor('editor').getContentTxt()); |
|||
alert(arr.join("\n")); |
|||
} |
|||
function hasContent() { |
|||
var arr = []; |
|||
arr.push("使用editor.hasContents()方法判断编辑器里是否有内容"); |
|||
arr.push("判断结果为:"); |
|||
arr.push(UE.getEditor('editor').hasContents()); |
|||
alert(arr.join("\n")); |
|||
} |
|||
function setFocus() { |
|||
UE.getEditor('editor').focus(); |
|||
} |
|||
function deleteEditor() { |
|||
disableBtn(); |
|||
UE.getEditor('editor').destroy(); |
|||
} |
|||
function disableBtn(str) { |
|||
var div = document.getElementById('btns'); |
|||
var btns = UE.dom.domUtils.getElementsByTagName(div, "button"); |
|||
for (var i = 0, btn; btn = btns[i++];) { |
|||
if (btn.id == str) { |
|||
UE.dom.domUtils.removeAttributes(btn, ["disabled"]); |
|||
} else { |
|||
btn.setAttribute("disabled", "true"); |
|||
} |
|||
} |
|||
} |
|||
function enableBtn() { |
|||
var div = document.getElementById('btns'); |
|||
var btns = UE.dom.domUtils.getElementsByTagName(div, "button"); |
|||
for (var i = 0, btn; btn = btns[i++];) { |
|||
UE.dom.domUtils.removeAttributes(btn, ["disabled"]); |
|||
} |
|||
} |
|||
|
|||
function getLocalData () { |
|||
alert(UE.getEditor('editor').execCommand( "getlocaldata" )); |
|||
} |
|||
|
|||
function clearLocalData () { |
|||
UE.getEditor('editor').execCommand( "clearlocaldata" ); |
|||
alert("已清空草稿箱") |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,684 @@ |
|||
/** |
|||
* Created with JetBrains PhpStorm. |
|||
* User: taoqili |
|||
* Date: 12-6-12 |
|||
* Time: 下午6:57 |
|||
* To change this template use File | Settings | File Templates. |
|||
*/ |
|||
UE.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','simpleupload':'Single Image','insertimage':'Multi Image','edittable':'Edit Table', 'edittd':'Edit Td','link':'Link', |
|||
'emotion':'Emotion', 'spechars':'Spechars', 'searchreplace':'SearchReplace', 'map':'BaiduMap', 'gmap':'GoogleMap', |
|||
'insertvideo':'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', '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', |
|||
'music':'Music', 'charts': 'charts','drafts': 'Load from Drafts' |
|||
}, |
|||
'insertorderedlist':{ |
|||
'num':'1,2,3...', |
|||
'num1':'1),2),3)...', |
|||
'num2':'(1),(2),(3)...', |
|||
'cn':'一,二,三....', |
|||
'cn1':'一),二),三)....', |
|||
'cn2':'(一),(二),(三)....', |
|||
'decimal':'1,2,3...', |
|||
'lower-alpha':'a,b,c...', |
|||
'lower-roman':'i,ii,iii...', |
|||
'upper-alpha':'A,B,C...', |
|||
'upper-roman':'I,II,III...' |
|||
}, |
|||
'insertunorderedlist':{ |
|||
'circle':'○ Circle', |
|||
'disc':'● Circle dot', |
|||
'square':'■ Rectangle ', |
|||
'dash' :'- Dash', |
|||
'dot' : '。dot' |
|||
}, |
|||
'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' |
|||
}, |
|||
'customstyle':{ |
|||
'tc':'Title center', |
|||
'tl':'Title left', |
|||
'im':'Important', |
|||
'hi':'Highlight' |
|||
}, |
|||
'autoupload': { |
|||
'exceedSizeError': 'File Size Exceed', |
|||
'exceedTypeError': 'File Type Not Allow', |
|||
'jsonEncodeError': 'Server Return Format Error', |
|||
'loading':"loading...", |
|||
'loadError':"load error", |
|||
'errorLoadConfig': 'Server config not loaded, upload can not work.', |
|||
}, |
|||
'simpleupload':{ |
|||
'exceedSizeError': 'File Size Exceed', |
|||
'exceedTypeError': 'File Type Not Allow', |
|||
'jsonEncodeError': 'Server Return Format Error', |
|||
'loading':"loading...", |
|||
'loadError':"load error", |
|||
'errorLoadConfig': 'Server config not loaded, upload can not work.', |
|||
}, |
|||
'elementPathTip':"Path", |
|||
'wordCountTip':"Word Count", |
|||
'wordCountMsg':'{#count} characters entered,{#leave} left. ', |
|||
'wordOverFlowMsg':'<span style="color:red;">The number of characters has exceeded allowable maximum values, the server may refuse to save!</span>', |
|||
'ok':"OK", |
|||
'cancel':"Cancel", |
|||
'closeDialog':"closeDialog", |
|||
'tableDrag':"You must import the file uiUtils.js before drag! ", |
|||
'autofloatMsg':"The plugin AutoFloat depends on EditorUI!", |
|||
'loadconfigError': 'Get server config error.', |
|||
'loadconfigFormatError': 'Server config format error.', |
|||
'loadconfigHttpError': 'Get server config http error.', |
|||
'snapScreen_plugin':{ |
|||
'browserMsg':"Only IE supported!", |
|||
'callBackErrorMsg':"The callback data is wrong,please check the config!", |
|||
'uploadErrorMsg':"Upload error,please check your server environment! " |
|||
}, |
|||
'insertcode':{ |
|||
'as3':'ActionScript 3', |
|||
'bash':'Bash/Shell', |
|||
'cpp':'C/C++', |
|||
'css':'CSS', |
|||
'cf':'ColdFusion', |
|||
'c#':'C#', |
|||
'delphi':'Delphi', |
|||
'diff':'Diff', |
|||
'erlang':'Erlang', |
|||
'groovy':'Groovy', |
|||
'html':'HTML', |
|||
'java':'Java', |
|||
'jfx':'JavaFX', |
|||
'js':'JavaScript', |
|||
'pl':'Perl', |
|||
'php':'PHP', |
|||
'plain':'Plain Text', |
|||
'ps':'PowerShell', |
|||
'python':'Python', |
|||
'ruby':'Ruby', |
|||
'scala':'Scala', |
|||
'sql':'SQL', |
|||
'vb':'Visual Basic', |
|||
'xml':'XML' |
|||
}, |
|||
'confirmClear':"Do you confirm to clear the Document?", |
|||
'contextMenu':{ |
|||
'delete':"Delete", |
|||
'selectall':"Select all", |
|||
'deletecode':"Delete Code", |
|||
'cleardoc':"Clear Document", |
|||
'confirmclear':"Do you confirm to clear the Document?", |
|||
'unlink':"Unlink", |
|||
'paragraph':"Paragraph", |
|||
'edittable':"Table property", |
|||
'aligncell':'Align cell', |
|||
'aligntable':'Table alignment', |
|||
'tableleft':'Left float', |
|||
'tablecenter':'Center', |
|||
'tableright':'Right float', |
|||
'aligntd':'Cell alignment', |
|||
'edittd':"Cell property", |
|||
'setbordervisible':'set table edge visible', |
|||
'table':"Table", |
|||
'justifyleft':'Justify Left', |
|||
'justifyright':'Justify Right', |
|||
'justifycenter':'Justify Center', |
|||
'justifyjustify':'Default', |
|||
'deletetable':"Delete table", |
|||
'insertparagraphbefore':"InsertedBeforeLine", |
|||
'insertparagraphafter':'InsertedAfterLine', |
|||
'inserttable':'Insert table', |
|||
'insertcaption':'Insert caption', |
|||
'deletecaption':'Delete Caption', |
|||
'inserttitle':'Insert Title', |
|||
'deletetitle':'Delete Title', |
|||
'inserttitlecol':'Insert Title Col', |
|||
'deletetitlecol':'Delete Title Col', |
|||
'averageDiseRow':'AverageDise Row', |
|||
'averageDisCol':'AverageDis Col', |
|||
'deleterow':"Delete row", |
|||
'deletecol':"Delete col", |
|||
'insertrow':"Insert row", |
|||
'insertcol':"Insert col", |
|||
'insertrownext':'Insert Row Next', |
|||
'insertcolnext':'Insert Col Next', |
|||
'mergeright':"Merge right", |
|||
'mergeleft':"Merge left", |
|||
'mergedown':"Merge down", |
|||
'mergecells':"Merge cells", |
|||
'splittocells':"Split to cells", |
|||
'splittocols':"Split to Cols", |
|||
'splittorows':"Split to Rows", |
|||
'tablesort':'Table sorting', |
|||
'enablesort':'Sorting Enable', |
|||
'disablesort':'Sorting Disable', |
|||
'reversecurrent':'Reverse current', |
|||
'orderbyasc':'Order By ASCII', |
|||
'reversebyasc':'Reverse By ASCII', |
|||
'orderbynum':'Order By Num', |
|||
'reversebynum':'Reverse By Num', |
|||
'borderbk':'Border shading', |
|||
'setcolor':'interlaced color', |
|||
'unsetcolor':'Cancel interlacedcolor', |
|||
'setbackground':'Background interlaced', |
|||
'unsetbackground':'Cancel Bk interlaced', |
|||
'redandblue':'Blue and red', |
|||
'threecolorgradient':'Three-color gradient', |
|||
'copy':"Copy(Ctrl + c)", |
|||
'copymsg':"Browser does not support. Please use 'Ctrl + c' instead!", |
|||
'paste':"Paste(Ctrl + v)", |
|||
'pastemsg':"Browser does not support. Please use 'Ctrl + v' instead!" |
|||
}, |
|||
'copymsg': "Browser does not support. Please use 'Ctrl + c' instead!", |
|||
'pastemsg': "Browser does not support. Please use 'Ctrl + v' instead!", |
|||
'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', |
|||
'pasteOpt':'Paste Option', |
|||
'pasteSourceFormat':"Keep Source Formatting", |
|||
'tagFormat':'Keep tag', |
|||
'pasteTextFormat':'Keep Text only', |
|||
'more':'More', |
|||
'autoTypeSet':{ |
|||
'mergeLine':"Merge empty line", |
|||
'delLine':"Del empty line", |
|||
'removeFormat':"Remove format", |
|||
'indent':"Indent", |
|||
'alignment':"Alignment", |
|||
'imageFloat':"Image float", |
|||
'removeFontsize':"Remove font size", |
|||
'removeFontFamily':"Remove fontFamily", |
|||
'removeHtml':"Remove redundant HTML code", |
|||
'pasteFilter':"Paste filter", |
|||
'run':"Done", |
|||
'symbol':'Symbol Conversion', |
|||
'bdc2sb':'Full-width to Half-width', |
|||
'tobdc':'Half-width to Full-width' |
|||
}, |
|||
|
|||
'background':{ |
|||
'static':{ |
|||
'lang_background_normal':'Normal', |
|||
'lang_background_local':'Online', |
|||
'lang_background_set':'Background Set', |
|||
'lang_background_none':'No Background', |
|||
'lang_background_colored':'Colored Background', |
|||
'lang_background_color':'Color Set', |
|||
'lang_background_netimg':'Net-Image', |
|||
'lang_background_align':'Align Type', |
|||
'lang_background_position':'Position', |
|||
'repeatType':{'options':["Center", "Repeat-x", "Repeat-y", "Tile","Custom"]} |
|||
}, |
|||
'noUploadImage':"No pictures has been uploaded!", |
|||
'toggleSelect':'Change the active state by click!\n Image Size: ' |
|||
}, |
|||
//===============dialog i18N=======================
|
|||
'insertimage':{ |
|||
'static':{ |
|||
'lang_tab_remote':"Insert", |
|||
'lang_tab_upload':"Local", |
|||
'lang_tab_online':"Manager", |
|||
'lang_tab_search':"Search", |
|||
'lang_input_url':"Address:", |
|||
'lang_input_size':"Size:", |
|||
'lang_input_width':"Width", |
|||
'lang_input_height':"Height", |
|||
'lang_input_border':"Border:", |
|||
'lang_input_vhspace':"Margins:", |
|||
'lang_input_title':"Title:", |
|||
'lang_input_align':'Image Float Style:', |
|||
'lang_imgLoading':"Loading...", |
|||
'lang_start_upload':"Start Upload", |
|||
'lock':{'title':"Lock rate"}, |
|||
'searchType':{'title':"ImageType", 'options':["News", "Wallpaper", "emotions", "photo"]}, |
|||
'searchTxt':{'value':"Enter the search keyword!"}, |
|||
'searchBtn':{'value':"Search"}, |
|||
'searchReset':{'value':"Clear"}, |
|||
'noneAlign':{'title':'None Float'}, |
|||
'leftAlign':{'title':'Left Float'}, |
|||
'rightAlign':{'title':'Right Float'}, |
|||
'centerAlign':{'title':'Center In A Line'} |
|||
}, |
|||
'uploadSelectFile':'Select File', |
|||
'uploadAddFile':'Add File', |
|||
'uploadStart':'Start Upload', |
|||
'uploadPause':'Pause Upload', |
|||
'uploadContinue':'Continue Upload', |
|||
'uploadRetry':'Retry Upload', |
|||
'uploadDelete':'Delete', |
|||
'uploadTurnLeft':'Turn Left', |
|||
'uploadTurnRight':'Turn Right', |
|||
'uploadPreview':'Doing Preview', |
|||
'uploadNoPreview':'Can Not Preview', |
|||
'updateStatusReady': 'Selected _ pictures, total _KB.', |
|||
'updateStatusConfirm': '_ uploaded successfully and _ upload failed', |
|||
'updateStatusFinish': 'Total _ pictures (_KB), _ uploaded successfully', |
|||
'updateStatusError': ' and _ upload failed', |
|||
'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player', |
|||
'errorLoadConfig': 'Server config not loaded, upload can not work.', |
|||
'errorExceedSize':'File Size Exceed', |
|||
'errorFileType':'File Type Not Allow', |
|||
'errorInterrupt':'File Upload Interrupted', |
|||
'errorUploadRetry':'Upload Error, Please Retry.', |
|||
'errorHttp':'Http Error', |
|||
'errorServerUpload':'Server Result Error.', |
|||
'remoteLockError':"Cannot Lock the Proportion between width and height", |
|||
'numError':"Please enter the correct Num. e.g 123,400", |
|||
'imageUrlError':"The image format may be wrong!", |
|||
'imageLoadError':"Error,please check the network or URL!", |
|||
'searchRemind':"Enter the search keyword!", |
|||
'searchLoading':"Image is loading,please wait...", |
|||
'searchRetry':" Sorry,can't find the image,please try again!" |
|||
}, |
|||
'attachment':{ |
|||
'static':{ |
|||
'lang_tab_upload': 'Upload', |
|||
'lang_tab_online': 'Online', |
|||
'lang_start_upload':"Start upload", |
|||
'lang_drop_remind':"You can drop files here, a single maximum of 300 files" |
|||
}, |
|||
'uploadSelectFile':'Select File', |
|||
'uploadAddFile':'Add File', |
|||
'uploadStart':'Start Upload', |
|||
'uploadPause':'Pause Upload', |
|||
'uploadContinue':'Continue Upload', |
|||
'uploadRetry':'Retry Upload', |
|||
'uploadDelete':'Delete', |
|||
'uploadTurnLeft':'Turn Left', |
|||
'uploadTurnRight':'Turn Right', |
|||
'uploadPreview':'Doing Preview', |
|||
'updateStatusReady': 'Selected _ files, total _KB.', |
|||
'updateStatusConfirm': '_ uploaded successfully and _ upload failed', |
|||
'updateStatusFinish': 'Total _ files (_KB), _ uploaded successfully', |
|||
'updateStatusError': ' and _ upload failed', |
|||
'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player', |
|||
'errorLoadConfig': 'Server config not loaded, upload can not work.', |
|||
'errorExceedSize':'File Size Exceed', |
|||
'errorFileType':'File Type Not Allow', |
|||
'errorInterrupt':'File Upload Interrupted', |
|||
'errorUploadRetry':'Upload Error, Please Retry.', |
|||
'errorHttp':'Http Error', |
|||
'errorServerUpload':'Server Result Error.' |
|||
}, |
|||
|
|||
'insertvideo':{ |
|||
'static':{ |
|||
'lang_tab_insertV':"Video", |
|||
'lang_tab_searchV':"Search", |
|||
'lang_tab_uploadV':"Upload", |
|||
'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"}, |
|||
|
|||
'lang_input_fileStatus':' No file uploaded!', |
|||
'startUpload':{'style':"background:url(upload.png) no-repeat;"}, |
|||
|
|||
'lang_upload_size':"Video Size", |
|||
'lang_upload_width':"Width", |
|||
'lang_upload_height':"Height", |
|||
'lang_upload_alignment':"Alignment", |
|||
'lang_format_advice':"Recommends mp4 format." |
|||
}, |
|||
'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':" The video is loading, please wait…", |
|||
'clickToSelect':"Click to select", |
|||
'goToSource':'Visit source video ', |
|||
'noVideo':" Sorry,can't find the video,please try again!", |
|||
|
|||
'browseFiles':'Open files', |
|||
'uploadSuccess':'Upload Successful!', |
|||
'delSuccessFile':'Remove from the success of the queue', |
|||
'delFailSaveFile':'Remove the save failed file', |
|||
'statusPrompt':' file(s) uploaded! ', |
|||
'flashVersionError':'The current Flash version is too low, please update FlashPlayer,then try again!', |
|||
'flashLoadingError':'The Flash failed loading! Please check the path or network state', |
|||
'fileUploadReady':'Wait for uploading...', |
|||
'delUploadQueue':'Remove from the uploading queue ', |
|||
'limitPrompt1':'Can not choose more than single', |
|||
'limitPrompt2':'file(s)!Please choose again!', |
|||
'delFailFile':'Remove failure file', |
|||
'fileSizeLimit':'File size exceeds the limit!', |
|||
'emptyFile':'Can not upload an empty file!', |
|||
'fileTypeError':'File type error!', |
|||
'unknownError':'Unknown error!', |
|||
'fileUploading':'Uploading,please wait...', |
|||
'cancelUpload':'Cancel upload', |
|||
'netError':'Network error', |
|||
'failUpload':'Upload failed', |
|||
'serverIOError':'Server IO error!', |
|||
'noAuthority':'No Permission!', |
|||
'fileNumLimit':'Upload limit to the number', |
|||
'failCheck':'Authentication fails, the upload is skipped!', |
|||
'fileCanceling':'Cancel, please wait...', |
|||
'stopUploading':'Upload has stopped...', |
|||
|
|||
'uploadSelectFile':'Select File', |
|||
'uploadAddFile':'Add File', |
|||
'uploadStart':'Start Upload', |
|||
'uploadPause':'Pause Upload', |
|||
'uploadContinue':'Continue Upload', |
|||
'uploadRetry':'Retry Upload', |
|||
'uploadDelete':'Delete', |
|||
'uploadTurnLeft':'Turn Left', |
|||
'uploadTurnRight':'Turn Right', |
|||
'uploadPreview':'Doing Preview', |
|||
'updateStatusReady': 'Selected _ files, total _KB.', |
|||
'updateStatusConfirm': '_ uploaded successfully and _ upload failed', |
|||
'updateStatusFinish': 'Total _ files (_KB), _ uploaded successfully', |
|||
'updateStatusError': ' and _ upload failed', |
|||
'errorNotSupport': 'WebUploader does not support the browser you are using. Please upgrade your browser or flash player', |
|||
'errorLoadConfig': 'Server config not loaded, upload can not work.', |
|||
'errorExceedSize':'File Size Exceed', |
|||
'errorFileType':'File Type Not Allow', |
|||
'errorInterrupt':'File Upload Interrupted', |
|||
'errorUploadRetry':'Upload Error, Please Retry.', |
|||
'errorHttp':'Http Error', |
|||
'errorServerUpload':'Server Result Error.' |
|||
}, |
|||
'webapp':{ |
|||
'tip1':"This function provided by Baidu APP,please apply for baidu APPKey webmaster first!", |
|||
'tip2':"And then open the file ueditor.config.js to set it! ", |
|||
'applyFor':"APPLY FOR", |
|||
'anthorApi':"Baidu API" |
|||
}, |
|||
'template':{ |
|||
'static':{ |
|||
'lang_template_bkcolor':'Background Color', |
|||
'lang_template_clear' : 'Keep Content', |
|||
'lang_template_select':'Select Template' |
|||
}, |
|||
'blank':"Blank", |
|||
'blog':"Blog", |
|||
'resume':"Resume", |
|||
'richText':"Rich Text", |
|||
'scrPapers':"Scientific Papers" |
|||
}, |
|||
scrawl:{ |
|||
'static':{ |
|||
'lang_input_previousStep':"Previous", |
|||
'lang_input_nextsStep':"Next", |
|||
'lang_input_clear':'Clear', |
|||
'lang_input_addPic':'AddImage', |
|||
'lang_input_ScalePic':'ScaleImage', |
|||
'lang_input_removePic':'RemoveImage', |
|||
'J_imgTxt':{title:'Add background image'} |
|||
}, |
|||
'noScarwl':"No paint, a white paper...", |
|||
'scrawlUpLoading':"Image is uploading, please wait...", |
|||
'continueBtn':"Try again", |
|||
'imageError':"Image failed to load!", |
|||
'backgroundUploading':'Image is uploading,please wait...' |
|||
}, |
|||
'music':{ |
|||
'static':{ |
|||
'lang_input_tips':"Input singer/song/album, search you interested in music!", |
|||
'J_searchBtn':{value:'Search songs'} |
|||
}, |
|||
'emptyTxt':'Not search to the relevant music results, please change a keyword try.', |
|||
'chapter':'Songs', |
|||
'singer':'Singer', |
|||
'special':'Album', |
|||
'listenTest':'Audition' |
|||
}, |
|||
anchor:{ |
|||
'static':{ |
|||
'lang_input_anchorName':'Anchor Name:' |
|||
} |
|||
}, |
|||
'charts':{ |
|||
'static':{ |
|||
'lang_data_source':'Data source:', |
|||
'lang_chart_format': 'Chart format:', |
|||
'lang_data_align': 'Align', |
|||
'lang_chart_align_same': 'Consistent with the X-axis Y-axis', |
|||
'lang_chart_align_reverse': 'X-axis Y-axis opposite', |
|||
'lang_chart_title': 'Title', |
|||
'lang_chart_main_title': 'main title:', |
|||
'lang_chart_sub_title': 'sub title:', |
|||
'lang_chart_x_title': 'X-axis title:', |
|||
'lang_chart_y_title': 'Y-axis title:', |
|||
'lang_chart_tip': 'Prompt', |
|||
'lang_cahrt_tip_prefix': 'prefix:', |
|||
'lang_cahrt_tip_description': '仅饼图有效, 当鼠标移动到饼图中相应的块上时,提示框内的文字的前缀', |
|||
'lang_chart_data_unit': 'Unit', |
|||
'lang_chart_data_unit_title': 'unit:', |
|||
'lang_chart_data_unit_description': '显示在每个数据点上的数据的单位, 比如: 温度的单位 ℃', |
|||
'lang_chart_type': 'Chart type:', |
|||
'lang_prev_btn': 'Previous', |
|||
'lang_next_btn': 'Next' |
|||
} |
|||
}, |
|||
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!' |
|||
}, |
|||
help:{ |
|||
'static':{ |
|||
'lang_input_about':'About', |
|||
'lang_input_shortcuts':'Shortcuts', |
|||
'lang_input_introduction':"UEditor is developed by Baidu Co.ltd. It is lightweight, customizable , focusing on user experience and etc. , UEditor is based on open source BSD license , allowing free use and redistribution.", |
|||
'lang_Txt_shortcuts':'Shortcuts', |
|||
'lang_Txt_func':'Function', |
|||
'lang_Txt_bold':'Bold', |
|||
'lang_Txt_copy':'Copy', |
|||
'lang_Txt_cut':'Cut', |
|||
'lang_Txt_Paste':'Paste', |
|||
'lang_Txt_undo':'Undo', |
|||
'lang_Txt_redo':'Redo', |
|||
'lang_Txt_italic':'Italic', |
|||
'lang_Txt_underline':'Underline', |
|||
'lang_Txt_selectAll':'Select All', |
|||
'lang_Txt_visualEnter':'Submit', |
|||
'lang_Txt_fullscreen':'Fullscreen' |
|||
} |
|||
}, |
|||
insertframe:{ |
|||
'static':{ |
|||
'lang_input_address':'Address:', |
|||
'lang_input_width':'Width:', |
|||
'lang_input_height':'height:', |
|||
'lang_input_isScroll':'Enable scrollbars:', |
|||
'lang_input_frameborder':'Show frame border:', |
|||
'lang_input_alignMode':'Alignment:', |
|||
'align':{title:"Alignment", options:["Default", "Left", "Right", "Center"]} |
|||
}, |
|||
'enterAddress':'Please enter an 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!" |
|||
}, |
|||
searchreplace:{ |
|||
'static':{ |
|||
lang_tab_search:"Search", |
|||
lang_tab_replace:"Replace", |
|||
lang_search1:"Search", |
|||
lang_search2:"Search", |
|||
lang_replace:"Replace", |
|||
lang_searchReg:'Support regular expression ,which starts and ends with a slash ,for example "/expression/"', |
|||
lang_searchReg1:'Support regular expression ,which starts and ends with a slash ,for example "/expression/"', |
|||
lang_case_sensitive1:"Case sense", |
|||
lang_case_sensitive2:"Case sense", |
|||
nextFindBtn:{value:"Next"}, |
|||
preFindBtn:{value:"Preview"}, |
|||
nextReplaceBtn:{value:"Next"}, |
|||
preReplaceBtn:{value:"Preview"}, |
|||
repalceBtn:{value:"Replace"}, |
|||
repalceAllBtn:{value:"Replace all"} |
|||
}, |
|||
getEnd:"Has the search to the bottom!", |
|||
getStart:"Has the search to the top!", |
|||
countMsg:"Altogether replaced {#count} character(s)!" |
|||
}, |
|||
snapscreen:{ |
|||
'static':{ |
|||
lang_showMsg:"You should install the UEditor screenshots program first!", |
|||
lang_download:"Download!", |
|||
lang_step1:"Step1:Download the program and then run it", |
|||
lang_step2:"Step2:After complete install,try to click the button again" |
|||
} |
|||
}, |
|||
spechars:{ |
|||
'static':{}, |
|||
tsfh:"Special", |
|||
lmsz:"Roman", |
|||
szfh:"Numeral", |
|||
rwfh:"Japanese", |
|||
xlzm:"The Greek", |
|||
ewzm:"Russian", |
|||
pyzm:"Phonetic", |
|||
yyyb:"English", |
|||
zyzf:"Others" |
|||
}, |
|||
'edittable':{ |
|||
'static':{ |
|||
'lang_tableStyle':'Table style', |
|||
'lang_insertCaption':'Add table header row', |
|||
'lang_insertTitle':'Add table title row', |
|||
'lang_insertTitleCol':'Add table title col', |
|||
'lang_tableSize':'Automatically adjust table size', |
|||
'lang_autoSizeContent':'Adaptive by form text', |
|||
'lang_orderbycontent':"Table of contents sortable", |
|||
'lang_autoSizePage':'Page width adaptive', |
|||
'lang_example':'Example', |
|||
'lang_borderStyle':'Table Border', |
|||
'lang_color':'Color:' |
|||
}, |
|||
captionName:'Caption', |
|||
titleName:'Title', |
|||
cellsName:'text', |
|||
errorMsg:'There are merged cells, can not sort.' |
|||
}, |
|||
'edittip':{ |
|||
'static':{ |
|||
lang_delRow:'Delete entire row', |
|||
lang_delCol:'Delete entire col' |
|||
} |
|||
}, |
|||
'edittd':{ |
|||
'static':{ |
|||
lang_tdBkColor:'Background Color:' |
|||
} |
|||
}, |
|||
'formula':{ |
|||
'static':{ |
|||
} |
|||
}, |
|||
wordimage:{ |
|||
'static':{ |
|||
lang_resave:"The re-save step", |
|||
uploadBtn:{src:"upload.png", alt:"Upload"}, |
|||
clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"}, |
|||
lang_step:" 1. Click top button to copy the url and then open the dialog to paste it. 2. Open after choose photos uploaded process." |
|||
}, |
|||
fileType:"Image", |
|||
flashError:"Flash initialization failed!", |
|||
netError:"Network error! Please try again!", |
|||
copySuccess:"URL has been copied!", |
|||
|
|||
'flashI18n':{ |
|||
lang:encodeURI( '{"UploadingState":"totalNum: ${a},uploadComplete: ${b}", "BeforeUpload":"waitingNum: ${a}", "ExceedSize":"Size exceed${a}", "ErrorInPreview":"Preview failed", "DefaultDescription":"Description", "LoadingImage":"Loading..."}' ), |
|||
uploadingTF:encodeURI( '{"font":"Arial", "size":12, "color":"0x000", "bold":"true", "italic":"false", "underline":"false"}' ), |
|||
imageTF:encodeURI( '{"font":"Arial", "size":11, "color":"red", "bold":"false", "italic":"false", "underline":"false"}' ), |
|||
textEncoding:"utf-8", |
|||
addImageSkinURL:"addImage.png", |
|||
allDeleteBtnUpSkinURL:"allDeleteBtnUpSkin.png", |
|||
allDeleteBtnHoverSkinURL:"allDeleteBtnHoverSkin.png", |
|||
rotateLeftBtnEnableSkinURL:"rotateLeftEnable.png", |
|||
rotateLeftBtnDisableSkinURL:"rotateLeftDisable.png", |
|||
rotateRightBtnEnableSkinURL:"rotateRightEnable.png", |
|||
rotateRightBtnDisableSkinURL:"rotateRightDisable.png", |
|||
deleteBtnEnableSkinURL:"deleteEnable.png", |
|||
deleteBtnDisableSkinURL:"deleteDisable.png", |
|||
backgroundURL:'', |
|||
listBackgroundURL:'', |
|||
buttonURL:'button.png' |
|||
} |
|||
}, |
|||
'autosave': { |
|||
'success':'Local conservation success' |
|||
} |
|||
}; |
|||
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 743 B |
|
After Width: | Height: | Size: 743 B |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 649 B |
|
After Width: | Height: | Size: 664 B |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 719 B |
|
After Width: | Height: | Size: 952 B |
|
After Width: | Height: | Size: 754 B |
|
After Width: | Height: | Size: 1007 B |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
@ -0,0 +1,669 @@ |
|||
/** |
|||
* Created with JetBrains PhpStorm. |
|||
* User: taoqili |
|||
* Date: 12-6-12 |
|||
* Time: 下午5:02 |
|||
* To change this template use File | Settings | File Templates. |
|||
*/ |
|||
UE.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':'完全拆分单元格','deletecaption':'删除表格标题','inserttitle':'插入标题', |
|||
'mergecells':'合并多个单元格', 'deletetable':'删除表格', 'cleardoc':'清空文档','insertparagraphbeforetable':"表格前插入行",'insertcode':'代码语言', |
|||
'fontfamily':'字体', 'fontsize':'字号', 'paragraph':'段落格式', 'simpleupload':'单图上传', 'insertimage':'多图上传','edittable':'表格属性','edittd':'单元格属性', 'link':'超链接', |
|||
'emotion':'表情', 'spechars':'特殊字符', 'searchreplace':'查询替换', 'map':'Baidu地图', 'gmap':'Google地图', |
|||
'insertvideo':'视频', 'help':'帮助', 'justifyleft':'居左对齐', 'justifyright':'居右对齐', 'justifycenter':'居中对齐', |
|||
'justifyjustify':'两端对齐', 'forecolor':'字体颜色', 'backcolor':'背景色', 'insertorderedlist':'有序列表', |
|||
'insertunorderedlist':'无序列表', 'fullscreen':'全屏', 'directionalityltr':'从左向右输入', 'directionalityrtl':'从右向左输入', |
|||
'rowspacingtop':'段前距', 'rowspacingbottom':'段后距', 'pagebreak':'分页', 'insertframe':'插入Iframe', 'imagenone':'默认', |
|||
'imageleft':'左浮动', 'imageright':'右浮动', 'attachment':'附件', 'imagecenter':'居中', 'wordimage':'图片转存', |
|||
'lineheight':'行间距','edittip' :'编辑提示','customstyle':'自定义标题', 'autotypeset':'自动排版', |
|||
'webapp':'百度应用','touppercase':'字母大写', 'tolowercase':'字母小写','background':'背景','template':'模板','scrawl':'涂鸦', |
|||
'music':'音乐','inserttable':'插入表格','drafts': '从草稿箱加载', 'charts': '图表' |
|||
}, |
|||
'insertorderedlist':{ |
|||
'num':'1,2,3...', |
|||
'num1':'1),2),3)...', |
|||
'num2':'(1),(2),(3)...', |
|||
'cn':'一,二,三....', |
|||
'cn1':'一),二),三)....', |
|||
'cn2':'(一),(二),(三)....', |
|||
'decimal':'1,2,3...', |
|||
'lower-alpha':'a,b,c...', |
|||
'lower-roman':'i,ii,iii...', |
|||
'upper-alpha':'A,B,C...', |
|||
'upper-roman':'I,II,III...' |
|||
}, |
|||
'insertunorderedlist':{ |
|||
'circle':'○ 大圆圈', |
|||
'disc':'● 小黑点', |
|||
'square':'■ 小方块 ', |
|||
'dash' :'— 破折号', |
|||
'dot':' 。 小圆圈' |
|||
}, |
|||
'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' |
|||
}, |
|||
'customstyle':{ |
|||
'tc':'标题居中', |
|||
'tl':'标题居左', |
|||
'im':'强调', |
|||
'hi':'明显强调' |
|||
}, |
|||
'autoupload': { |
|||
'exceedSizeError': '文件大小超出限制', |
|||
'exceedTypeError': '文件格式不允许', |
|||
'jsonEncodeError': '服务器返回格式错误', |
|||
'loading':"正在上传...", |
|||
'loadError':"上传错误", |
|||
'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!' |
|||
}, |
|||
'simpleupload':{ |
|||
'exceedSizeError': '文件大小超出限制', |
|||
'exceedTypeError': '文件格式不允许', |
|||
'jsonEncodeError': '服务器返回格式错误', |
|||
'loading':"正在上传...", |
|||
'loadError':"上传错误", |
|||
'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!' |
|||
}, |
|||
'elementPathTip':"元素路径", |
|||
'wordCountTip':"字数统计", |
|||
'wordCountMsg':'当前已输入{#count}个字符, 您还可以输入{#leave}个字符。 ', |
|||
'wordOverFlowMsg':'<span style="color:red;">字数超出最大允许值,服务器可能拒绝保存!</span>', |
|||
'ok':"确认", |
|||
'cancel':"取消", |
|||
'closeDialog':"关闭对话框", |
|||
'tableDrag':"表格拖动必须引入uiUtils.js文件!", |
|||
'autofloatMsg':"工具栏浮动依赖编辑器UI,您首先需要引入UI文件!", |
|||
'loadconfigError': '获取后台配置项请求出错,上传功能将不能正常使用!', |
|||
'loadconfigFormatError': '后台配置项返回格式出错,上传功能将不能正常使用!', |
|||
'loadconfigHttpError': '请求后台配置项http错误,上传功能将不能正常使用!', |
|||
'snapScreen_plugin':{ |
|||
'browserMsg':"仅支持IE浏览器!", |
|||
'callBackErrorMsg':"服务器返回数据有误,请检查配置项之后重试。", |
|||
'uploadErrorMsg':"截图上传失败,请检查服务器端环境! " |
|||
}, |
|||
'insertcode':{ |
|||
'as3':'ActionScript 3', |
|||
'bash':'Bash/Shell', |
|||
'cpp':'C/C++', |
|||
'css':'CSS', |
|||
'cf':'ColdFusion', |
|||
'c#':'C#', |
|||
'delphi':'Delphi', |
|||
'diff':'Diff', |
|||
'erlang':'Erlang', |
|||
'groovy':'Groovy', |
|||
'html':'HTML', |
|||
'java':'Java', |
|||
'jfx':'JavaFX', |
|||
'js':'JavaScript', |
|||
'pl':'Perl', |
|||
'php':'PHP', |
|||
'plain':'Plain Text', |
|||
'ps':'PowerShell', |
|||
'python':'Python', |
|||
'ruby':'Ruby', |
|||
'scala':'Scala', |
|||
'sql':'SQL', |
|||
'vb':'Visual Basic', |
|||
'xml':'XML' |
|||
}, |
|||
'confirmClear':"确定清空当前文档么?", |
|||
'contextMenu':{ |
|||
'delete':"删除", |
|||
'selectall':"全选", |
|||
'deletecode':"删除代码", |
|||
'cleardoc':"清空文档", |
|||
'confirmclear':"确定清空当前文档么?", |
|||
'unlink':"删除超链接", |
|||
'paragraph':"段落格式", |
|||
'edittable':"表格属性", |
|||
'aligntd':"单元格对齐方式", |
|||
'aligntable':'表格对齐方式', |
|||
'tableleft':'左浮动', |
|||
'tablecenter':'居中显示', |
|||
'tableright':'右浮动', |
|||
'edittd':"单元格属性", |
|||
'setbordervisible':'设置表格边线可见', |
|||
'justifyleft':'左对齐', |
|||
'justifyright':'右对齐', |
|||
'justifycenter':'居中对齐', |
|||
'justifyjustify':'两端对齐', |
|||
'table':"表格", |
|||
'inserttable':'插入表格', |
|||
'deletetable':"删除表格", |
|||
'insertparagraphbefore':"前插入段落", |
|||
'insertparagraphafter':'后插入段落', |
|||
'deleterow':"删除当前行", |
|||
'deletecol':"删除当前列", |
|||
'insertrow':"前插入行", |
|||
'insertcol':"左插入列", |
|||
'insertrownext':'后插入行', |
|||
'insertcolnext':'右插入列', |
|||
'insertcaption':'插入表格名称', |
|||
'deletecaption':'删除表格名称', |
|||
'inserttitle':'插入表格标题行', |
|||
'deletetitle':'删除表格标题行', |
|||
'inserttitlecol':'插入表格标题列', |
|||
'deletetitlecol':'删除表格标题列', |
|||
'averageDiseRow':'平均分布各行', |
|||
'averageDisCol':'平均分布各列', |
|||
'mergeright':"向右合并", |
|||
'mergeleft':"向左合并", |
|||
'mergedown':"向下合并", |
|||
'mergecells':"合并单元格", |
|||
'splittocells':"完全拆分单元格", |
|||
'splittocols':"拆分成列", |
|||
'splittorows':"拆分成行", |
|||
'tablesort':'表格排序', |
|||
'enablesort':'设置表格可排序', |
|||
'disablesort':'取消表格可排序', |
|||
'reversecurrent':'逆序当前', |
|||
'orderbyasc':'按ASCII字符升序', |
|||
'reversebyasc':'按ASCII字符降序', |
|||
'orderbynum':'按数值大小升序', |
|||
'reversebynum':'按数值大小降序', |
|||
'borderbk':'边框底纹', |
|||
'setcolor':'表格隔行变色', |
|||
'unsetcolor':'取消表格隔行变色', |
|||
'setbackground':'选区背景隔行', |
|||
'unsetbackground':'取消选区背景', |
|||
'redandblue':'红蓝相间', |
|||
'threecolorgradient':'三色渐变', |
|||
'copy':"复制(Ctrl + c)", |
|||
'copymsg': "浏览器不支持,请使用 'Ctrl + c'", |
|||
'paste':"粘贴(Ctrl + v)", |
|||
'pastemsg': "浏览器不支持,请使用 'Ctrl + v'" |
|||
}, |
|||
'copymsg': "浏览器不支持,请使用 'Ctrl + c'", |
|||
'pastemsg': "浏览器不支持,请使用 'Ctrl + v'", |
|||
'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':'只保留文本', |
|||
'autoTypeSet':{ |
|||
'mergeLine':"合并空行", |
|||
'delLine':"清除空行", |
|||
'removeFormat':"清除格式", |
|||
'indent':"首行缩进", |
|||
'alignment':"对齐方式", |
|||
'imageFloat':"图片浮动", |
|||
'removeFontsize':"清除字号", |
|||
'removeFontFamily':"清除字体", |
|||
'removeHtml':"清除冗余HTML代码", |
|||
'pasteFilter':"粘贴过滤", |
|||
'run':"执行", |
|||
'symbol':'符号转换', |
|||
'bdc2sb':'全角转半角', |
|||
'tobdc':'半角转全角' |
|||
}, |
|||
|
|||
'background':{ |
|||
'static':{ |
|||
'lang_background_normal':'背景设置', |
|||
'lang_background_local':'在线图片', |
|||
'lang_background_set':'选项', |
|||
'lang_background_none':'无背景色', |
|||
'lang_background_colored':'有背景色', |
|||
'lang_background_color':'颜色设置', |
|||
'lang_background_netimg':'网络图片', |
|||
'lang_background_align':'对齐方式', |
|||
'lang_background_position':'精确定位', |
|||
'repeatType':{'options':["居中", "横向重复", "纵向重复", "平铺","自定义"]} |
|||
|
|||
}, |
|||
'noUploadImage':"当前未上传过任何图片!", |
|||
'toggleSelect':"单击可切换选中状态\n原图尺寸: " |
|||
}, |
|||
//===============dialog i18N=======================
|
|||
'insertimage':{ |
|||
'static':{ |
|||
'lang_tab_remote':"插入图片", //节点
|
|||
'lang_tab_upload':"本地上传", |
|||
'lang_tab_online':"本地图片", |
|||
'lang_tab_search':"图片搜索", |
|||
'lang_input_url':"地 址:", |
|||
'lang_input_size':"大 小:", |
|||
'lang_input_width':"宽度", |
|||
'lang_input_height':"高度", |
|||
'lang_input_border':"边 框:", |
|||
'lang_input_vhspace':"边 距:", |
|||
'lang_input_title':"描 述:", |
|||
'lang_input_align':'图片浮动方式:', |
|||
'lang_imgLoading':" 图片加载中……", |
|||
'lang_start_upload':"开始上传", |
|||
'lock':{'title':"锁定宽高比例"}, //属性
|
|||
'searchType':{'title':"图片类型", 'options':["新闻", "壁纸", "表情", "头像"]}, //select的option
|
|||
'searchTxt':{'value':"请输入搜索关键词"}, |
|||
'searchBtn':{'value':"百度一下"}, |
|||
'searchReset':{'value':"清空搜索"}, |
|||
'noneAlign':{'title':'无浮动'}, |
|||
'leftAlign':{'title':'左浮动'}, |
|||
'rightAlign':{'title':'右浮动'}, |
|||
'centerAlign':{'title':'居中独占一行'} |
|||
}, |
|||
'uploadSelectFile':'点击选择图片', |
|||
'uploadAddFile':'继续添加', |
|||
'uploadStart':'开始上传', |
|||
'uploadPause':'暂停上传', |
|||
'uploadContinue':'继续上传', |
|||
'uploadRetry':'重试上传', |
|||
'uploadDelete':'删除', |
|||
'uploadTurnLeft':'向左旋转', |
|||
'uploadTurnRight':'向右旋转', |
|||
'uploadPreview':'预览中', |
|||
'uploadNoPreview':'不能预览', |
|||
'updateStatusReady': '选中_张图片,共_KB。', |
|||
'updateStatusConfirm': '已成功上传_张照片,_张照片上传失败', |
|||
'updateStatusFinish': '共_张(_KB),_张上传成功', |
|||
'updateStatusError': ',_张上传失败。', |
|||
'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。', |
|||
'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!', |
|||
'errorExceedSize':'文件大小超出', |
|||
'errorFileType':'文件格式不允许', |
|||
'errorInterrupt':'文件传输中断', |
|||
'errorUploadRetry':'上传失败,请重试', |
|||
'errorHttp':'http请求错误', |
|||
'errorServerUpload':'服务器返回出错', |
|||
'remoteLockError':"宽高不正确,不能所定比例", |
|||
'numError':"请输入正确的长度或者宽度值!例如:123,400", |
|||
'imageUrlError':"不允许的图片格式或者图片域!", |
|||
'imageLoadError':"图片加载失败!请检查链接地址或网络状态!", |
|||
'searchRemind':"请输入搜索关键词", |
|||
'searchLoading':"图片加载中,请稍后……", |
|||
'searchRetry':" :( ,抱歉,没有找到图片!请重试一次!" |
|||
}, |
|||
'attachment':{ |
|||
'static':{ |
|||
'lang_tab_upload': '上传附件', |
|||
'lang_tab_online': '在线附件', |
|||
'lang_start_upload':"开始上传", |
|||
'lang_drop_remind':"可以将文件拖到这里,单次最多可选100个文件" |
|||
}, |
|||
'uploadSelectFile':'点击选择文件', |
|||
'uploadAddFile':'继续添加', |
|||
'uploadStart':'开始上传', |
|||
'uploadPause':'暂停上传', |
|||
'uploadContinue':'继续上传', |
|||
'uploadRetry':'重试上传', |
|||
'uploadDelete':'删除', |
|||
'uploadTurnLeft':'向左旋转', |
|||
'uploadTurnRight':'向右旋转', |
|||
'uploadPreview':'预览中', |
|||
'updateStatusReady': '选中_个文件,共_KB。', |
|||
'updateStatusConfirm': '已成功上传_个文件,_个文件上传失败', |
|||
'updateStatusFinish': '共_个(_KB),_个上传成功', |
|||
'updateStatusError': ',_张上传失败。', |
|||
'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。', |
|||
'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!', |
|||
'errorExceedSize':'文件大小超出', |
|||
'errorFileType':'文件格式不允许', |
|||
'errorInterrupt':'文件传输中断', |
|||
'errorUploadRetry':'上传失败,请重试', |
|||
'errorHttp':'http请求错误', |
|||
'errorServerUpload':'服务器返回出错' |
|||
}, |
|||
'insertvideo':{ |
|||
'static':{ |
|||
'lang_tab_insertV':"插入视频", |
|||
'lang_tab_searchV':"搜索视频", |
|||
'lang_tab_uploadV':"上传视频", |
|||
'lang_video_url':"视频网址", |
|||
'lang_video_size':"视频尺寸", |
|||
'lang_videoW':"宽度", |
|||
'lang_videoH':"高度", |
|||
'lang_alignment':"对齐方式", |
|||
'videoSearchTxt':{'value':"请输入搜索关键字!"}, |
|||
'videoType':{'options':["全部", "热门", "娱乐", "搞笑", "体育", "科技", "综艺"]}, |
|||
'videoSearchBtn':{'value':"百度一下"}, |
|||
'videoSearchReset':{'value':"清空结果"}, |
|||
|
|||
'lang_input_fileStatus':' 当前未上传文件', |
|||
'startUpload':{'style':"background:url(upload.png) no-repeat;"}, |
|||
|
|||
'lang_upload_size':"视频尺寸", |
|||
'lang_upload_width':"宽度", |
|||
'lang_upload_height':"高度", |
|||
'lang_upload_alignment':"对齐方式", |
|||
'lang_format_advice':"建议使用mp4格式." |
|||
|
|||
}, |
|||
'numError':"请输入正确的数值,如123,400", |
|||
'floatLeft':"左浮动", |
|||
'floatRight':"右浮动", |
|||
'"default"':"默认", |
|||
'block':"独占一行", |
|||
'urlError':"输入的视频地址有误,请检查后再试!", |
|||
'loading':" 视频加载中,请等待……", |
|||
'clickToSelect':"点击选中", |
|||
'goToSource':'访问源视频', |
|||
'noVideo':" 抱歉,找不到对应的视频,请重试!", |
|||
|
|||
'browseFiles':'浏览文件', |
|||
'uploadSuccess':'上传成功!', |
|||
'delSuccessFile':'从成功队列中移除', |
|||
'delFailSaveFile':'移除保存失败文件', |
|||
'statusPrompt':' 个文件已上传! ', |
|||
'flashVersionError':'当前Flash版本过低,请更新FlashPlayer后重试!', |
|||
'flashLoadingError':'Flash加载失败!请检查路径或网络状态', |
|||
'fileUploadReady':'等待上传……', |
|||
'delUploadQueue':'从上传队列中移除', |
|||
'limitPrompt1':'单次不能选择超过', |
|||
'limitPrompt2':'个文件!请重新选择!', |
|||
'delFailFile':'移除失败文件', |
|||
'fileSizeLimit':'文件大小超出限制!', |
|||
'emptyFile':'空文件无法上传!', |
|||
'fileTypeError':'文件类型不允许!', |
|||
'unknownError':'未知错误!', |
|||
'fileUploading':'上传中,请等待……', |
|||
'cancelUpload':'取消上传', |
|||
'netError':'网络错误', |
|||
'failUpload':'上传失败!', |
|||
'serverIOError':'服务器IO错误!', |
|||
'noAuthority':'无权限!', |
|||
'fileNumLimit':'上传个数限制', |
|||
'failCheck':'验证失败,本次上传被跳过!', |
|||
'fileCanceling':'取消中,请等待……', |
|||
'stopUploading':'上传已停止……', |
|||
|
|||
'uploadSelectFile':'点击选择文件', |
|||
'uploadAddFile':'继续添加', |
|||
'uploadStart':'开始上传', |
|||
'uploadPause':'暂停上传', |
|||
'uploadContinue':'继续上传', |
|||
'uploadRetry':'重试上传', |
|||
'uploadDelete':'删除', |
|||
'uploadTurnLeft':'向左旋转', |
|||
'uploadTurnRight':'向右旋转', |
|||
'uploadPreview':'预览中', |
|||
'updateStatusReady': '选中_个文件,共_KB。', |
|||
'updateStatusConfirm': '成功上传_个,_个失败', |
|||
'updateStatusFinish': '共_个(_KB),_个成功上传', |
|||
'updateStatusError': ',_张上传失败。', |
|||
'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。', |
|||
'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!', |
|||
'errorExceedSize':'文件大小超出', |
|||
'errorFileType':'文件格式不允许', |
|||
'errorInterrupt':'文件传输中断', |
|||
'errorUploadRetry':'上传失败,请重试', |
|||
'errorHttp':'http请求错误', |
|||
'errorServerUpload':'服务器返回出错' |
|||
}, |
|||
'webapp':{ |
|||
'tip1':"本功能由百度APP提供,如看到此页面,请各位站长首先申请百度APPKey!", |
|||
'tip2':"申请完成之后请至ueditor.config.js中配置获得的appkey! ", |
|||
'applyFor':"点此申请", |
|||
'anthorApi':"百度API" |
|||
}, |
|||
'template':{ |
|||
'static':{ |
|||
'lang_template_bkcolor':'背景颜色', |
|||
'lang_template_clear' : '保留原有内容', |
|||
'lang_template_select' : '选择模板' |
|||
}, |
|||
'blank':"空白文档", |
|||
'blog':"博客文章", |
|||
'resume':"个人简历", |
|||
'richText':"图文混排", |
|||
'sciPapers':"科技论文" |
|||
|
|||
|
|||
}, |
|||
'scrawl':{ |
|||
'static':{ |
|||
'lang_input_previousStep':"上一步", |
|||
'lang_input_nextsStep':"下一步", |
|||
'lang_input_clear':'清空', |
|||
'lang_input_addPic':'添加背景', |
|||
'lang_input_ScalePic':'缩放背景', |
|||
'lang_input_removePic':'删除背景', |
|||
'J_imgTxt':{title:'添加背景图片'} |
|||
}, |
|||
'noScarwl':"尚未作画,白纸一张~", |
|||
'scrawlUpLoading':"涂鸦上传中,别急哦~", |
|||
'continueBtn':"继续", |
|||
'imageError':"糟糕,图片读取失败了!", |
|||
'backgroundUploading':'背景图片上传中,别急哦~' |
|||
}, |
|||
'music':{ |
|||
'static':{ |
|||
'lang_input_tips':"输入歌手/歌曲/专辑,搜索您感兴趣的音乐!", |
|||
'J_searchBtn':{value:'搜索歌曲'} |
|||
}, |
|||
'emptyTxt':'未搜索到相关音乐结果,请换一个关键词试试。', |
|||
'chapter':'歌曲', |
|||
'singer':'歌手', |
|||
'special':'专辑', |
|||
'listenTest':'试听' |
|||
}, |
|||
'anchor':{ |
|||
'static':{ |
|||
'lang_input_anchorName':'锚点名字:' |
|||
} |
|||
}, |
|||
'charts':{ |
|||
'static':{ |
|||
'lang_data_source':'数据源:', |
|||
'lang_chart_format': '图表格式:', |
|||
'lang_data_align': '数据对齐方式', |
|||
'lang_chart_align_same': '数据源与图表X轴Y轴一致', |
|||
'lang_chart_align_reverse': '数据源与图表X轴Y轴相反', |
|||
'lang_chart_title': '图表标题', |
|||
'lang_chart_main_title': '主标题:', |
|||
'lang_chart_sub_title': '子标题:', |
|||
'lang_chart_x_title': 'X轴标题:', |
|||
'lang_chart_y_title': 'Y轴标题:', |
|||
'lang_chart_tip': '提示文字', |
|||
'lang_cahrt_tip_prefix': '提示文字前缀:', |
|||
'lang_cahrt_tip_description': '仅饼图有效, 当鼠标移动到饼图中相应的块上时,提示框内的文字的前缀', |
|||
'lang_chart_data_unit': '数据单位', |
|||
'lang_chart_data_unit_title': '单位:', |
|||
'lang_chart_data_unit_description': '显示在每个数据点上的数据的单位, 比如: 温度的单位 ℃', |
|||
'lang_chart_type': '图表类型:', |
|||
'lang_prev_btn': '上一个', |
|||
'lang_next_btn': '下一个' |
|||
} |
|||
}, |
|||
'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:'无法定位到该地址!' |
|||
}, |
|||
'help':{ |
|||
'static':{ |
|||
'lang_input_about':'关于UEditor', |
|||
'lang_input_shortcuts':'快捷键', |
|||
'lang_input_introduction':'UEditor是由百度web前端研发部开发的所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点。开源基于BSD协议,允许自由使用和修改代码。', |
|||
'lang_Txt_shortcuts':'快捷键', |
|||
'lang_Txt_func':'功能', |
|||
'lang_Txt_bold':'给选中字设置为加粗', |
|||
'lang_Txt_copy':'复制选中内容', |
|||
'lang_Txt_cut':'剪切选中内容', |
|||
'lang_Txt_Paste':'粘贴', |
|||
'lang_Txt_undo':'重新执行上次操作', |
|||
'lang_Txt_redo':'撤销上一次操作', |
|||
'lang_Txt_italic':'给选中字设置为斜体', |
|||
'lang_Txt_underline':'给选中字加下划线', |
|||
'lang_Txt_selectAll':'全部选中', |
|||
'lang_Txt_visualEnter':'软回车', |
|||
'lang_Txt_fullscreen':'全屏' |
|||
} |
|||
}, |
|||
'insertframe':{ |
|||
'static':{ |
|||
'lang_input_address':'地址:', |
|||
'lang_input_width':'宽度:', |
|||
'lang_input_height':'高度:', |
|||
'lang_input_isScroll':'允许滚动条:', |
|||
'lang_input_frameborder':'显示框架边框:', |
|||
'lang_input_alignMode':'对齐方式:', |
|||
'align':{title:"对齐方式", options:["默认", "左对齐", "右对齐", "居中"]} |
|||
}, |
|||
'enterAddress':'请输入地址!' |
|||
}, |
|||
'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:"抱歉,找不到该位置!" |
|||
}, |
|||
'searchreplace':{ |
|||
'static':{ |
|||
lang_tab_search:"查找", |
|||
lang_tab_replace:"替换", |
|||
lang_search1:"查找", |
|||
lang_search2:"查找", |
|||
lang_replace:"替换", |
|||
lang_searchReg:'支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”', |
|||
lang_searchReg1:'支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”', |
|||
lang_case_sensitive1:"区分大小写", |
|||
lang_case_sensitive2:"区分大小写", |
|||
nextFindBtn:{value:"下一个"}, |
|||
preFindBtn:{value:"上一个"}, |
|||
nextReplaceBtn:{value:"下一个"}, |
|||
preReplaceBtn:{value:"上一个"}, |
|||
repalceBtn:{value:"替换"}, |
|||
repalceAllBtn:{value:"全部替换"} |
|||
}, |
|||
getEnd:"已经搜索到文章末尾!", |
|||
getStart:"已经搜索到文章头部", |
|||
countMsg:"总共替换了{#count}处!" |
|||
}, |
|||
'snapscreen':{ |
|||
'static':{ |
|||
lang_showMsg:"截图功能需要首先安装UEditor截图插件! ", |
|||
lang_download:"点此下载", |
|||
lang_step1:"第一步,下载UEditor截图插件并运行安装。", |
|||
lang_step2:"第二步,插件安装完成后即可使用,如不生效,请重启浏览器后再试!" |
|||
} |
|||
}, |
|||
'spechars':{ |
|||
'static':{}, |
|||
tsfh:"特殊字符", |
|||
lmsz:"罗马字符", |
|||
szfh:"数学字符", |
|||
rwfh:"日文字符", |
|||
xlzm:"希腊字母", |
|||
ewzm:"俄文字符", |
|||
pyzm:"拼音字母", |
|||
yyyb:"英语音标", |
|||
zyzf:"其他" |
|||
}, |
|||
'edittable':{ |
|||
'static':{ |
|||
'lang_tableStyle':'表格样式', |
|||
'lang_insertCaption':'添加表格名称行', |
|||
'lang_insertTitle':'添加表格标题行', |
|||
'lang_insertTitleCol':'添加表格标题列', |
|||
'lang_orderbycontent':"使表格内容可排序", |
|||
'lang_tableSize':'自动调整表格尺寸', |
|||
'lang_autoSizeContent':'按表格文字自适应', |
|||
'lang_autoSizePage':'按页面宽度自适应', |
|||
'lang_example':'示例', |
|||
'lang_borderStyle':'表格边框', |
|||
'lang_color':'颜色:' |
|||
}, |
|||
captionName:'表格名称', |
|||
titleName:'标题', |
|||
cellsName:'内容', |
|||
errorMsg:'有合并单元格,不可排序' |
|||
}, |
|||
'edittip':{ |
|||
'static':{ |
|||
lang_delRow:'删除整行', |
|||
lang_delCol:'删除整列' |
|||
} |
|||
}, |
|||
'edittd':{ |
|||
'static':{ |
|||
lang_tdBkColor:'背景颜色:' |
|||
} |
|||
}, |
|||
'formula':{ |
|||
'static':{ |
|||
} |
|||
}, |
|||
'wordimage':{ |
|||
'static':{ |
|||
lang_resave:"转存步骤", |
|||
uploadBtn:{src:"upload.png",alt:"上传"}, |
|||
clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"}, |
|||
lang_step:"1、点击顶部复制按钮,将地址复制到剪贴板;2、点击添加照片按钮,在弹出的对话框中使用Ctrl+V粘贴地址;3、点击打开后选择图片上传流程。" |
|||
}, |
|||
'fileType':"图片", |
|||
'flashError':"FLASH初始化失败,请检查FLASH插件是否正确安装!", |
|||
'netError':"网络连接错误,请重试!", |
|||
'copySuccess':"图片地址已经复制!", |
|||
'flashI18n':{} //留空默认中文
|
|||
}, |
|||
'autosave': { |
|||
'saving':'保存中...', |
|||
'success':'本地保存成功' |
|||
} |
|||
}; |
|||
@ -0,0 +1,104 @@ |
|||
.CodeMirror { |
|||
line-height: 1em; |
|||
font-family: monospace; |
|||
} |
|||
|
|||
.CodeMirror-scroll { |
|||
overflow: auto; |
|||
height: 300px; |
|||
/* This is needed to prevent an IE[67] bug where the scrolled content |
|||
is visible outside of the scrolling box. */ |
|||
position: relative; |
|||
} |
|||
|
|||
.CodeMirror-gutter { |
|||
position: absolute; left: 0; top: 0; |
|||
z-index: 10; |
|||
background-color: #f7f7f7; |
|||
border-right: 1px solid #eee; |
|||
min-width: 2em; |
|||
height: 100%; |
|||
} |
|||
.CodeMirror-gutter-text { |
|||
color: #aaa; |
|||
text-align: right; |
|||
padding: .4em .2em .4em .4em; |
|||
white-space: pre !important; |
|||
} |
|||
.CodeMirror-lines { |
|||
padding: .4em; |
|||
} |
|||
|
|||
.CodeMirror pre { |
|||
-moz-border-radius: 0; |
|||
-webkit-border-radius: 0; |
|||
-o-border-radius: 0; |
|||
border-radius: 0; |
|||
border-width: 0; margin: 0; padding: 0; background: transparent; |
|||
font-family: inherit; |
|||
font-size: inherit; |
|||
padding: 0; margin: 0; |
|||
white-space: pre; |
|||
word-wrap: normal; |
|||
} |
|||
|
|||
.CodeMirror-wrap pre { |
|||
word-wrap: break-word; |
|||
white-space: pre-wrap; |
|||
} |
|||
.CodeMirror-wrap .CodeMirror-scroll { |
|||
overflow-x: hidden; |
|||
} |
|||
|
|||
.CodeMirror textarea { |
|||
outline: none !important; |
|||
} |
|||
|
|||
.CodeMirror pre.CodeMirror-cursor { |
|||
z-index: 10; |
|||
position: absolute; |
|||
visibility: hidden; |
|||
border-left: 1px solid black; |
|||
} |
|||
.CodeMirror-focused pre.CodeMirror-cursor { |
|||
visibility: visible; |
|||
} |
|||
|
|||
span.CodeMirror-selected { background: #d9d9d9; } |
|||
.CodeMirror-focused span.CodeMirror-selected { background: #d2dcf8; } |
|||
|
|||
.CodeMirror-searching {background: #ffa;} |
|||
|
|||
/* Default theme */ |
|||
|
|||
.cm-s-default span.cm-keyword {color: #708;} |
|||
.cm-s-default span.cm-atom {color: #219;} |
|||
.cm-s-default span.cm-number {color: #164;} |
|||
.cm-s-default span.cm-def {color: #00f;} |
|||
.cm-s-default span.cm-variable {color: black;} |
|||
.cm-s-default span.cm-variable-2 {color: #05a;} |
|||
.cm-s-default span.cm-variable-3 {color: #085;} |
|||
.cm-s-default span.cm-property {color: black;} |
|||
.cm-s-default span.cm-operator {color: black;} |
|||
.cm-s-default span.cm-comment {color: #a50;} |
|||
.cm-s-default span.cm-string {color: #a11;} |
|||
.cm-s-default span.cm-string-2 {color: #f50;} |
|||
.cm-s-default span.cm-meta {color: #555;} |
|||
.cm-s-default span.cm-error {color: #f00;} |
|||
.cm-s-default span.cm-qualifier {color: #555;} |
|||
.cm-s-default span.cm-builtin {color: #30a;} |
|||
.cm-s-default span.cm-bracket {color: #cc7;} |
|||
.cm-s-default span.cm-tag {color: #170;} |
|||
.cm-s-default span.cm-attribute {color: #00c;} |
|||
.cm-s-default span.cm-header {color: #a0a;} |
|||
.cm-s-default span.cm-quote {color: #090;} |
|||
.cm-s-default span.cm-hr {color: #999;} |
|||
.cm-s-default span.cm-link {color: #00c;} |
|||
|
|||
span.cm-header, span.cm-strong {font-weight: bold;} |
|||
span.cm-em {font-style: italic;} |
|||
span.cm-emstrong {font-style: italic; font-weight: bold;} |
|||
span.cm-link {text-decoration: underline;} |
|||
|
|||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} |
|||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} |
|||
@ -0,0 +1,13 @@ |
|||
/* |
|||
Highcharts JS v3.0.6 (2013-10-04) |
|||
MooTools adapter |
|||
|
|||
(c) 2010-2013 Torstein Hønsi |
|||
|
|||
License: www.highcharts.com/license |
|||
*/ |
|||
(function(){var e=window,h=document,f=e.MooTools.version.substring(0,3),i=f==="1.2"||f==="1.1",j=i||f==="1.3",g=e.$extend||function(){return Object.append.apply(Object,arguments)};e.HighchartsAdapter={init:function(a){var b=Fx.prototype,c=b.start,d=Fx.Morph.prototype,e=d.compute;b.start=function(b,d){var e=this.element;if(b.d)this.paths=a.init(e,e.d,this.toD);c.apply(this,arguments);return this};d.compute=function(b,c,d){var f=this.paths;if(f)this.element.attr("d",a.step(f[0],f[1],d,this.toD));else return e.apply(this, |
|||
arguments)}},adapterRun:function(a,b){if(b==="width"||b==="height")return parseInt($(a).getStyle(b),10)},getScript:function(a,b){var c=h.getElementsByTagName("head")[0],d=h.createElement("script");d.type="text/javascript";d.src=a;d.onload=b;c.appendChild(d)},animate:function(a,b,c){var d=a.attr,f=c&&c.complete;if(d&&!a.setStyle)a.getStyle=a.attr,a.setStyle=function(){var a=arguments;this.attr.call(this,a[0],a[1][0])},a.$family=function(){return!0};e.HighchartsAdapter.stop(a);c=new Fx.Morph(d?a:$(a), |
|||
g({transition:Fx.Transitions.Quad.easeInOut},c));if(d)c.element=a;if(b.d)c.toD=b.d;f&&c.addEvent("complete",f);c.start(b);a.fx=c},each:function(a,b){return i?$each(a,b):Array.each(a,b)},map:function(a,b){return a.map(b)},grep:function(a,b){return a.filter(b)},inArray:function(a,b,c){return b?b.indexOf(a,c):-1},offset:function(a){a=a.getPosition();return{left:a.x,top:a.y}},extendWithEvents:function(a){a.addEvent||(a.nodeName?$(a):g(a,new Events))},addEvent:function(a,b,c){typeof b==="string"&&(b=== |
|||
"unload"&&(b="beforeunload"),e.HighchartsAdapter.extendWithEvents(a),a.addEvent(b,c))},removeEvent:function(a,b,c){typeof a!=="string"&&a.addEvent&&(b?(b==="unload"&&(b="beforeunload"),c?a.removeEvent(b,c):a.removeEvents&&a.removeEvents(b)):a.removeEvents())},fireEvent:function(a,b,c,d){b={type:b,target:a};b=j?new Event(b):new DOMEvent(b);b=g(b,c);if(!b.target&&b.event)b.target=b.event.target;b.preventDefault=function(){d=null};a.fireEvent&&a.fireEvent(b.type,b);d&&d(b)},washMouseEvent:function(a){if(a.page)a.pageX= |
|||
a.page.x,a.pageY=a.page.y;return a},stop:function(a){a.fx&&a.fx.cancel()}}})(); |
|||
@ -0,0 +1,313 @@ |
|||
/** |
|||
* @license Highcharts JS v3.0.6 (2013-10-04) |
|||
* MooTools adapter |
|||
* |
|||
* (c) 2010-2013 Torstein Hønsi |
|||
* |
|||
* License: www.highcharts.com/license |
|||
*/ |
|||
|
|||
// JSLint options:
|
|||
/*global Fx, $, $extend, $each, $merge, Events, Event, DOMEvent */ |
|||
|
|||
(function () { |
|||
|
|||
var win = window, |
|||
doc = document, |
|||
mooVersion = win.MooTools.version.substring(0, 3), // Get the first three characters of the version number
|
|||
legacy = mooVersion === '1.2' || mooVersion === '1.1', // 1.1 && 1.2 considered legacy, 1.3 is not.
|
|||
legacyEvent = legacy || mooVersion === '1.3', // In versions 1.1 - 1.3 the event class is named Event, in newer versions it is named DOMEvent.
|
|||
$extend = win.$extend || function () { |
|||
return Object.append.apply(Object, arguments); |
|||
}; |
|||
|
|||
win.HighchartsAdapter = { |
|||
/** |
|||
* Initialize the adapter. This is run once as Highcharts is first run. |
|||
* @param {Object} pathAnim The helper object to do animations across adapters. |
|||
*/ |
|||
init: function (pathAnim) { |
|||
var fxProto = Fx.prototype, |
|||
fxStart = fxProto.start, |
|||
morphProto = Fx.Morph.prototype, |
|||
morphCompute = morphProto.compute; |
|||
|
|||
// override Fx.start to allow animation of SVG element wrappers
|
|||
/*jslint unparam: true*//* allow unused parameters in fx functions */ |
|||
fxProto.start = function (from, to) { |
|||
var fx = this, |
|||
elem = fx.element; |
|||
|
|||
// special for animating paths
|
|||
if (from.d) { |
|||
//this.fromD = this.element.d.split(' ');
|
|||
fx.paths = pathAnim.init( |
|||
elem, |
|||
elem.d, |
|||
fx.toD |
|||
); |
|||
} |
|||
fxStart.apply(fx, arguments); |
|||
|
|||
return this; // chainable
|
|||
}; |
|||
|
|||
// override Fx.step to allow animation of SVG element wrappers
|
|||
morphProto.compute = function (from, to, delta) { |
|||
var fx = this, |
|||
paths = fx.paths; |
|||
|
|||
if (paths) { |
|||
fx.element.attr( |
|||
'd', |
|||
pathAnim.step(paths[0], paths[1], delta, fx.toD) |
|||
); |
|||
} else { |
|||
return morphCompute.apply(fx, arguments); |
|||
} |
|||
}; |
|||
/*jslint unparam: false*/ |
|||
}, |
|||
|
|||
/** |
|||
* Run a general method on the framework, following jQuery syntax |
|||
* @param {Object} el The HTML element |
|||
* @param {String} method Which method to run on the wrapped element |
|||
*/ |
|||
adapterRun: function (el, method) { |
|||
|
|||
// This currently works for getting inner width and height. If adding
|
|||
// more methods later, we need a conditional implementation for each.
|
|||
if (method === 'width' || method === 'height') { |
|||
return parseInt($(el).getStyle(method), 10); |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* Downloads a script and executes a callback when done. |
|||
* @param {String} scriptLocation |
|||
* @param {Function} callback |
|||
*/ |
|||
getScript: function (scriptLocation, callback) { |
|||
// We cannot assume that Assets class from mootools-more is available so instead insert a script tag to download script.
|
|||
var head = doc.getElementsByTagName('head')[0]; |
|||
var script = doc.createElement('script'); |
|||
|
|||
script.type = 'text/javascript'; |
|||
script.src = scriptLocation; |
|||
script.onload = callback; |
|||
|
|||
head.appendChild(script); |
|||
}, |
|||
|
|||
/** |
|||
* Animate a HTML element or SVG element wrapper |
|||
* @param {Object} el |
|||
* @param {Object} params |
|||
* @param {Object} options jQuery-like animation options: duration, easing, callback |
|||
*/ |
|||
animate: function (el, params, options) { |
|||
var isSVGElement = el.attr, |
|||
effect, |
|||
complete = options && options.complete; |
|||
|
|||
if (isSVGElement && !el.setStyle) { |
|||
// add setStyle and getStyle methods for internal use in Moo
|
|||
el.getStyle = el.attr; |
|||
el.setStyle = function () { // property value is given as array in Moo - break it down
|
|||
var args = arguments; |
|||
this.attr.call(this, args[0], args[1][0]); |
|||
}; |
|||
// dirty hack to trick Moo into handling el as an element wrapper
|
|||
el.$family = function () { return true; }; |
|||
} |
|||
|
|||
// stop running animations
|
|||
win.HighchartsAdapter.stop(el); |
|||
|
|||
// define and run the effect
|
|||
effect = new Fx.Morph( |
|||
isSVGElement ? el : $(el), |
|||
$extend({ |
|||
transition: Fx.Transitions.Quad.easeInOut |
|||
}, options) |
|||
); |
|||
|
|||
// Make sure that the element reference is set when animating svg elements
|
|||
if (isSVGElement) { |
|||
effect.element = el; |
|||
} |
|||
|
|||
// special treatment for paths
|
|||
if (params.d) { |
|||
effect.toD = params.d; |
|||
} |
|||
|
|||
// jQuery-like events
|
|||
if (complete) { |
|||
effect.addEvent('complete', complete); |
|||
} |
|||
|
|||
// run
|
|||
effect.start(params); |
|||
|
|||
// record for use in stop method
|
|||
el.fx = effect; |
|||
}, |
|||
|
|||
/** |
|||
* MooTool's each function |
|||
* |
|||
*/ |
|||
each: function (arr, fn) { |
|||
return legacy ? |
|||
$each(arr, fn) : |
|||
Array.each(arr, fn); |
|||
}, |
|||
|
|||
/** |
|||
* Map an array |
|||
* @param {Array} arr |
|||
* @param {Function} fn |
|||
*/ |
|||
map: function (arr, fn) { |
|||
return arr.map(fn); |
|||
}, |
|||
|
|||
/** |
|||
* Grep or filter an array |
|||
* @param {Array} arr |
|||
* @param {Function} fn |
|||
*/ |
|||
grep: function (arr, fn) { |
|||
return arr.filter(fn); |
|||
}, |
|||
|
|||
/** |
|||
* Return the index of an item in an array, or -1 if not matched |
|||
*/ |
|||
inArray: function (item, arr, from) { |
|||
return arr ? arr.indexOf(item, from) : -1; |
|||
}, |
|||
|
|||
/** |
|||
* Get the offset of an element relative to the top left corner of the web page |
|||
*/ |
|||
offset: function (el) { |
|||
var offsets = el.getPosition(); // #1496
|
|||
return { |
|||
left: offsets.x, |
|||
top: offsets.y |
|||
}; |
|||
}, |
|||
|
|||
/** |
|||
* Extends an object with Events, if its not done |
|||
*/ |
|||
extendWithEvents: function (el) { |
|||
// if the addEvent method is not defined, el is a custom Highcharts object
|
|||
// like series or point
|
|||
if (!el.addEvent) { |
|||
if (el.nodeName) { |
|||
el = $(el); // a dynamically generated node
|
|||
} else { |
|||
$extend(el, new Events()); // a custom object
|
|||
} |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* Add an event listener |
|||
* @param {Object} el HTML element or custom object |
|||
* @param {String} type Event type |
|||
* @param {Function} fn Event handler |
|||
*/ |
|||
addEvent: function (el, type, fn) { |
|||
if (typeof type === 'string') { // chart broke due to el being string, type function
|
|||
|
|||
if (type === 'unload') { // Moo self destructs before custom unload events
|
|||
type = 'beforeunload'; |
|||
} |
|||
|
|||
win.HighchartsAdapter.extendWithEvents(el); |
|||
|
|||
el.addEvent(type, fn); |
|||
} |
|||
}, |
|||
|
|||
removeEvent: function (el, type, fn) { |
|||
if (typeof el === 'string') { |
|||
// el.removeEvents below apperantly calls this method again. Do not quite understand why, so for now just bail out.
|
|||
return; |
|||
} |
|||
|
|||
if (el.addEvent) { // If el doesn't have an addEvent method, there are no events to remove
|
|||
if (type) { |
|||
if (type === 'unload') { // Moo self destructs before custom unload events
|
|||
type = 'beforeunload'; |
|||
} |
|||
|
|||
if (fn) { |
|||
el.removeEvent(type, fn); |
|||
} else if (el.removeEvents) { // #958
|
|||
el.removeEvents(type); |
|||
} |
|||
} else { |
|||
el.removeEvents(); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
fireEvent: function (el, event, eventArguments, defaultFunction) { |
|||
var eventArgs = { |
|||
type: event, |
|||
target: el |
|||
}; |
|||
// create an event object that keeps all functions
|
|||
event = legacyEvent ? new Event(eventArgs) : new DOMEvent(eventArgs); |
|||
event = $extend(event, eventArguments); |
|||
|
|||
// When running an event on the Chart.prototype, MooTools nests the target in event.event
|
|||
if (!event.target && event.event) { |
|||
event.target = event.event.target; |
|||
} |
|||
|
|||
// override the preventDefault function to be able to use
|
|||
// this for custom events
|
|||
event.preventDefault = function () { |
|||
defaultFunction = null; |
|||
}; |
|||
// if fireEvent is not available on the object, there hasn't been added
|
|||
// any events to it above
|
|||
if (el.fireEvent) { |
|||
el.fireEvent(event.type, event); |
|||
} |
|||
|
|||
// fire the default if it is passed and it is not prevented above
|
|||
if (defaultFunction) { |
|||
defaultFunction(event); |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* Set back e.pageX and e.pageY that MooTools has abstracted away. #1165, #1346. |
|||
*/ |
|||
washMouseEvent: function (e) { |
|||
if (e.page) { |
|||
e.pageX = e.page.x; |
|||
e.pageY = e.page.y; |
|||
} |
|||
return e; |
|||
}, |
|||
|
|||
/** |
|||
* Stop running animations on the object |
|||
*/ |
|||
stop: function (el) { |
|||
if (el.fx) { |
|||
el.fx.cancel(); |
|||
} |
|||
} |
|||
}; |
|||
|
|||
}()); |
|||
@ -0,0 +1,15 @@ |
|||
/* |
|||
Highcharts JS v3.0.6 (2013-10-04) |
|||
Prototype adapter |
|||
|
|||
@author Michael Nelson, Torstein Hønsi. |
|||
|
|||
Feel free to use and modify this script. |
|||
Highcharts license: www.highcharts.com/license. |
|||
*/ |
|||
var HighchartsAdapter=function(){var f=typeof Effect!=="undefined";return{init:function(a){if(f)Effect.HighchartsTransition=Class.create(Effect.Base,{initialize:function(b,c,d,g){var e;this.element=b;this.key=c;e=b.attr?b.attr(c):$(b).getStyle(c);if(c==="d")this.paths=a.init(b,b.d,d),this.toD=d,e=0,d=1;this.start(Object.extend(g||{},{from:e,to:d,attribute:c}))},setup:function(){HighchartsAdapter._extend(this.element);if(!this.element._highchart_animation)this.element._highchart_animation={};this.element._highchart_animation[this.key]= |
|||
this},update:function(b){var c=this.paths,d=this.element;c&&(b=a.step(c[0],c[1],b,this.toD));d.attr?d.element&&d.attr(this.options.attribute,b):(c={},c[this.options.attribute]=b,$(d).setStyle(c))},finish:function(){this.element&&this.element._highchart_animation&&delete this.element._highchart_animation[this.key]}})},adapterRun:function(a,b){return parseInt($(a).getStyle(b),10)},getScript:function(a,b){var c=$$("head")[0];c&&c.appendChild((new Element("script",{type:"text/javascript",src:a})).observe("load", |
|||
b))},addNS:function(a){var b=/^(?:click|mouse(?:down|up|over|move|out))$/;return/^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/.test(a)||b.test(a)?a:"h:"+a},addEvent:function(a,b,c){a.addEventListener||a.attachEvent?Event.observe($(a),HighchartsAdapter.addNS(b),c):(HighchartsAdapter._extend(a),a._highcharts_observe(b,c))},animate:function(a,b,c){var d,c=c||{};c.delay=0;c.duration=(c.duration||500)/1E3;c.afterFinish=c.complete;if(f)for(d in b)new Effect.HighchartsTransition($(a), |
|||
d,b[d],c);else{if(a.attr)for(d in b)a.attr(d,b[d]);c.complete&&c.complete()}a.attr||$(a).setStyle(b)},stop:function(a){var b;if(a._highcharts_extended&&a._highchart_animation)for(b in a._highchart_animation)a._highchart_animation[b].cancel()},each:function(a,b){$A(a).each(b)},inArray:function(a,b,c){return b?b.indexOf(a,c):-1},offset:function(a){return $(a).cumulativeOffset()},fireEvent:function(a,b,c,d){a.fire?a.fire(HighchartsAdapter.addNS(b),c):a._highcharts_extended&&(c=c||{},a._highcharts_fire(b, |
|||
c));c&&c.defaultPrevented&&(d=null);d&&d(c)},removeEvent:function(a,b,c){$(a).stopObserving&&(b&&(b=HighchartsAdapter.addNS(b)),$(a).stopObserving(b,c));window===a?Event.stopObserving(a,b,c):(HighchartsAdapter._extend(a),a._highcharts_stop_observing(b,c))},washMouseEvent:function(a){return a},grep:function(a,b){return a.findAll(b)},map:function(a,b){return a.map(b)},_extend:function(a){a._highcharts_extended||Object.extend(a,{_highchart_events:{},_highchart_animation:null,_highcharts_extended:!0, |
|||
_highcharts_observe:function(b,a){this._highchart_events[b]=[this._highchart_events[b],a].compact().flatten()},_highcharts_stop_observing:function(b,a){b?a?this._highchart_events[b]=[this._highchart_events[b]].compact().flatten().without(a):delete this._highchart_events[b]:this._highchart_events={}},_highcharts_fire:function(a,c){var d=this;(this._highchart_events[a]||[]).each(function(a){if(!c.stopped)c.preventDefault=function(){c.defaultPrevented=!0},c.target=d,a.bind(this)(c)===!1&&c.preventDefault()}.bind(this))}})}}}(); |
|||
@ -0,0 +1,316 @@ |
|||
/** |
|||
* @license Highcharts JS v3.0.6 (2013-10-04) |
|||
* Prototype adapter |
|||
* |
|||
* @author Michael Nelson, Torstein Hønsi. |
|||
* |
|||
* Feel free to use and modify this script. |
|||
* Highcharts license: www.highcharts.com/license. |
|||
*/ |
|||
|
|||
// JSLint options:
|
|||
/*global Effect, Class, Event, Element, $, $$, $A */ |
|||
|
|||
// Adapter interface between prototype and the Highcharts charting library
|
|||
var HighchartsAdapter = (function () { |
|||
|
|||
var hasEffect = typeof Effect !== 'undefined'; |
|||
|
|||
return { |
|||
|
|||
/** |
|||
* Initialize the adapter. This is run once as Highcharts is first run. |
|||
* @param {Object} pathAnim The helper object to do animations across adapters. |
|||
*/ |
|||
init: function (pathAnim) { |
|||
if (hasEffect) { |
|||
/** |
|||
* Animation for Highcharts SVG element wrappers only |
|||
* @param {Object} element |
|||
* @param {Object} attribute |
|||
* @param {Object} to |
|||
* @param {Object} options |
|||
*/ |
|||
Effect.HighchartsTransition = Class.create(Effect.Base, { |
|||
initialize: function (element, attr, to, options) { |
|||
var from, |
|||
opts; |
|||
|
|||
this.element = element; |
|||
this.key = attr; |
|||
from = element.attr ? element.attr(attr) : $(element).getStyle(attr); |
|||
|
|||
// special treatment for paths
|
|||
if (attr === 'd') { |
|||
this.paths = pathAnim.init( |
|||
element, |
|||
element.d, |
|||
to |
|||
); |
|||
this.toD = to; |
|||
|
|||
|
|||
// fake values in order to read relative position as a float in update
|
|||
from = 0; |
|||
to = 1; |
|||
} |
|||
|
|||
opts = Object.extend((options || {}), { |
|||
from: from, |
|||
to: to, |
|||
attribute: attr |
|||
}); |
|||
this.start(opts); |
|||
}, |
|||
setup: function () { |
|||
HighchartsAdapter._extend(this.element); |
|||
// If this is the first animation on this object, create the _highcharts_animation helper that
|
|||
// contain pointers to the animation objects.
|
|||
if (!this.element._highchart_animation) { |
|||
this.element._highchart_animation = {}; |
|||
} |
|||
|
|||
// Store a reference to this animation instance.
|
|||
this.element._highchart_animation[this.key] = this; |
|||
}, |
|||
update: function (position) { |
|||
var paths = this.paths, |
|||
element = this.element, |
|||
obj; |
|||
|
|||
if (paths) { |
|||
position = pathAnim.step(paths[0], paths[1], position, this.toD); |
|||
} |
|||
|
|||
if (element.attr) { // SVGElement
|
|||
|
|||
if (element.element) { // If not, it has been destroyed (#1405)
|
|||
element.attr(this.options.attribute, position); |
|||
} |
|||
|
|||
} else { // HTML, #409
|
|||
obj = {}; |
|||
obj[this.options.attribute] = position; |
|||
$(element).setStyle(obj); |
|||
} |
|||
|
|||
}, |
|||
finish: function () { |
|||
// Delete the property that holds this animation now that it is finished.
|
|||
// Both canceled animations and complete ones gets a 'finish' call.
|
|||
if (this.element && this.element._highchart_animation) { // #1405
|
|||
delete this.element._highchart_animation[this.key]; |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* Run a general method on the framework, following jQuery syntax |
|||
* @param {Object} el The HTML element |
|||
* @param {String} method Which method to run on the wrapped element |
|||
*/ |
|||
adapterRun: function (el, method) { |
|||
|
|||
// This currently works for getting inner width and height. If adding
|
|||
// more methods later, we need a conditional implementation for each.
|
|||
return parseInt($(el).getStyle(method), 10); |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* Downloads a script and executes a callback when done. |
|||
* @param {String} scriptLocation |
|||
* @param {Function} callback |
|||
*/ |
|||
getScript: function (scriptLocation, callback) { |
|||
var head = $$('head')[0]; // Returns an array, so pick the first element.
|
|||
if (head) { |
|||
// Append a new 'script' element, set its type and src attributes, add a 'load' handler that calls the callback
|
|||
head.appendChild(new Element('script', { type: 'text/javascript', src: scriptLocation}).observe('load', callback)); |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* Custom events in prototype needs to be namespaced. This method adds a namespace 'h:' in front of |
|||
* events that are not recognized as native. |
|||
*/ |
|||
addNS: function (eventName) { |
|||
var HTMLEvents = /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/, |
|||
MouseEvents = /^(?:click|mouse(?:down|up|over|move|out))$/; |
|||
return (HTMLEvents.test(eventName) || MouseEvents.test(eventName)) ? |
|||
eventName : |
|||
'h:' + eventName; |
|||
}, |
|||
|
|||
// el needs an event to be attached. el is not necessarily a dom element
|
|||
addEvent: function (el, event, fn) { |
|||
if (el.addEventListener || el.attachEvent) { |
|||
Event.observe($(el), HighchartsAdapter.addNS(event), fn); |
|||
|
|||
} else { |
|||
HighchartsAdapter._extend(el); |
|||
el._highcharts_observe(event, fn); |
|||
} |
|||
}, |
|||
|
|||
// motion makes things pretty. use it if effects is loaded, if not... still get to the end result.
|
|||
animate: function (el, params, options) { |
|||
var key, |
|||
fx; |
|||
|
|||
// default options
|
|||
options = options || {}; |
|||
options.delay = 0; |
|||
options.duration = (options.duration || 500) / 1000; |
|||
options.afterFinish = options.complete; |
|||
|
|||
// animate wrappers and DOM elements
|
|||
if (hasEffect) { |
|||
for (key in params) { |
|||
// The fx variable is seemingly thrown away here, but the Effect.setup will add itself to the _highcharts_animation object
|
|||
// on the element itself so its not really lost.
|
|||
fx = new Effect.HighchartsTransition($(el), key, params[key], options); |
|||
} |
|||
} else { |
|||
if (el.attr) { // #409 without effects
|
|||
for (key in params) { |
|||
el.attr(key, params[key]); |
|||
} |
|||
} |
|||
if (options.complete) { |
|||
options.complete(); |
|||
} |
|||
} |
|||
|
|||
if (!el.attr) { // HTML element, #409
|
|||
$(el).setStyle(params); |
|||
} |
|||
}, |
|||
|
|||
// this only occurs in higcharts 2.0+
|
|||
stop: function (el) { |
|||
var key; |
|||
if (el._highcharts_extended && el._highchart_animation) { |
|||
for (key in el._highchart_animation) { |
|||
// Cancel the animation
|
|||
// The 'finish' function in the Effect object will remove the reference
|
|||
el._highchart_animation[key].cancel(); |
|||
} |
|||
} |
|||
}, |
|||
|
|||
// um.. each
|
|||
each: function (arr, fn) { |
|||
$A(arr).each(fn); |
|||
}, |
|||
|
|||
inArray: function (item, arr, from) { |
|||
return arr ? arr.indexOf(item, from) : -1; |
|||
}, |
|||
|
|||
/** |
|||
* Get the cumulative offset relative to the top left of the page. This method, unlike its |
|||
* jQuery and MooTools counterpart, still suffers from issue #208 regarding the position |
|||
* of a chart within a fixed container. |
|||
*/ |
|||
offset: function (el) { |
|||
return $(el).cumulativeOffset(); |
|||
}, |
|||
|
|||
// fire an event based on an event name (event) and an object (el).
|
|||
// again, el may not be a dom element
|
|||
fireEvent: function (el, event, eventArguments, defaultFunction) { |
|||
if (el.fire) { |
|||
el.fire(HighchartsAdapter.addNS(event), eventArguments); |
|||
} else if (el._highcharts_extended) { |
|||
eventArguments = eventArguments || {}; |
|||
el._highcharts_fire(event, eventArguments); |
|||
} |
|||
|
|||
if (eventArguments && eventArguments.defaultPrevented) { |
|||
defaultFunction = null; |
|||
} |
|||
|
|||
if (defaultFunction) { |
|||
defaultFunction(eventArguments); |
|||
} |
|||
}, |
|||
|
|||
removeEvent: function (el, event, handler) { |
|||
if ($(el).stopObserving) { |
|||
if (event) { |
|||
event = HighchartsAdapter.addNS(event); |
|||
} |
|||
$(el).stopObserving(event, handler); |
|||
} if (window === el) { |
|||
Event.stopObserving(el, event, handler); |
|||
} else { |
|||
HighchartsAdapter._extend(el); |
|||
el._highcharts_stop_observing(event, handler); |
|||
} |
|||
}, |
|||
|
|||
washMouseEvent: function (e) { |
|||
return e; |
|||
}, |
|||
|
|||
// um, grep
|
|||
grep: function (arr, fn) { |
|||
return arr.findAll(fn); |
|||
}, |
|||
|
|||
// um, map
|
|||
map: function (arr, fn) { |
|||
return arr.map(fn); |
|||
}, |
|||
|
|||
// extend an object to handle highchart events (highchart objects, not svg elements).
|
|||
// this is a very simple way of handling events but whatever, it works (i think)
|
|||
_extend: function (object) { |
|||
if (!object._highcharts_extended) { |
|||
Object.extend(object, { |
|||
_highchart_events: {}, |
|||
_highchart_animation: null, |
|||
_highcharts_extended: true, |
|||
_highcharts_observe: function (name, fn) { |
|||
this._highchart_events[name] = [this._highchart_events[name], fn].compact().flatten(); |
|||
}, |
|||
_highcharts_stop_observing: function (name, fn) { |
|||
if (name) { |
|||
if (fn) { |
|||
this._highchart_events[name] = [this._highchart_events[name]].compact().flatten().without(fn); |
|||
} else { |
|||
delete this._highchart_events[name]; |
|||
} |
|||
} else { |
|||
this._highchart_events = {}; |
|||
} |
|||
}, |
|||
_highcharts_fire: function (name, args) { |
|||
var target = this; |
|||
(this._highchart_events[name] || []).each(function (fn) { |
|||
// args is never null here
|
|||
if (args.stopped) { |
|||
return; // "throw $break" wasn't working. i think because of the scope of 'this'.
|
|||
} |
|||
|
|||
// Attach a simple preventDefault function to skip default handler if called
|
|||
args.preventDefault = function () { |
|||
args.defaultPrevented = true; |
|||
}; |
|||
args.target = target; |
|||
|
|||
// If the event handler return false, prevent the default handler from executing
|
|||
if (fn.bind(this)(args) === false) { |
|||
args.preventDefault(); |
|||
} |
|||
} |
|||
.bind(this)); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
}; |
|||
}()); |
|||
@ -0,0 +1,17 @@ |
|||
/* |
|||
Highcharts JS v3.0.6 (2013-10-04) |
|||
|
|||
Standalone Highcharts Framework |
|||
|
|||
License: MIT License |
|||
*/ |
|||
var HighchartsAdapter=function(){function o(c){function a(a,b,d){a.removeEventListener(b,d,!1)}function d(a,b,d){d=a.HCProxiedMethods[d.toString()];a.detachEvent("on"+b,d)}function b(b,c){var f=b.HCEvents,i,g,k,j;if(b.removeEventListener)i=a;else if(b.attachEvent)i=d;else return;c?(g={},g[c]=!0):g=f;for(j in g)if(f[j])for(k=f[j].length;k--;)i(b,j,f[j][k])}c.HCExtended||Highcharts.extend(c,{HCExtended:!0,HCEvents:{},bind:function(b,a){var d=this,c=this.HCEvents,g;if(d.addEventListener)d.addEventListener(b, |
|||
a,!1);else if(d.attachEvent){g=function(b){a.call(d,b)};if(!d.HCProxiedMethods)d.HCProxiedMethods={};d.HCProxiedMethods[a.toString()]=g;d.attachEvent("on"+b,g)}c[b]===r&&(c[b]=[]);c[b].push(a)},unbind:function(c,h){var f,i;c?(f=this.HCEvents[c]||[],h?(i=HighchartsAdapter.inArray(h,f),i>-1&&(f.splice(i,1),this.HCEvents[c]=f),this.removeEventListener?a(this,c,h):this.attachEvent&&d(this,c,h)):(b(this,c),this.HCEvents[c]=[])):(b(this),this.HCEvents={})},trigger:function(b,a){var d=this.HCEvents[b]|| |
|||
[],c=d.length,g,k,j;k=function(){a.defaultPrevented=!0};for(g=0;g<c;g++){j=d[g];if(a.stopped)break;a.preventDefault=k;a.target=this;a.type=b;j.call(this,a)===!1&&a.preventDefault()}}});return c}var r,l=document,p=[],m=[],q,n;Math.easeInOutSine=function(c,a,d,b){return-d/2*(Math.cos(Math.PI*c/b)-1)+a};return{init:function(c){if(!l.defaultView)this._getStyle=function(a,d){var b;return a.style[d]?a.style[d]:(d==="opacity"&&(d="filter"),b=a.currentStyle[d.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()})], |
|||
d==="filter"&&(b=b.replace(/alpha\(opacity=([0-9]+)\)/,function(b,a){return a/100})),b===""?1:b)},this.adapterRun=function(a,d){var b={width:"clientWidth",height:"clientHeight"}[d];if(b)return a.style.zoom=1,a[b]-2*parseInt(HighchartsAdapter._getStyle(a,"padding"),10)};if(!Array.prototype.forEach)this.each=function(a,d){for(var b=0,c=a.length;b<c;b++)if(d.call(a[b],a[b],b,a)===!1)return b};if(!Array.prototype.indexOf)this.inArray=function(a,d){var b,c=0;if(d)for(b=d.length;c<b;c++)if(d[c]===a)return c; |
|||
return-1};if(!Array.prototype.filter)this.grep=function(a,d){for(var b=[],c=0,h=a.length;c<h;c++)d(a[c],c)&&b.push(a[c]);return b};n=function(a,c,b){this.options=c;this.elem=a;this.prop=b};n.prototype={update:function(){var a;a=this.paths;var d=this.elem,b=d.element;a&&b?d.attr("d",c.step(a[0],a[1],this.now,this.toD)):d.attr?b&&d.attr(this.prop,this.now):(a={},a[d]=this.now+this.unit,Highcharts.css(d,a));this.options.step&&this.options.step.call(this.elem,this.now,this)},custom:function(a,c,b){var e= |
|||
this,h=function(a){return e.step(a)},f;this.startTime=+new Date;this.start=a;this.end=c;this.unit=b;this.now=this.start;this.pos=this.state=0;h.elem=this.elem;h()&&m.push(h)===1&&(q=setInterval(function(){for(f=0;f<m.length;f++)m[f]()||m.splice(f--,1);m.length||clearInterval(q)},13))},step:function(a){var c=+new Date,b;b=this.options;var e;if(this.elem.stopAnimation)b=!1;else if(a||c>=b.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();a=this.options.curAnim[this.prop]= |
|||
!0;for(e in b.curAnim)b.curAnim[e]!==!0&&(a=!1);a&&b.complete&&b.complete.call(this.elem);b=!1}else e=c-this.startTime,this.state=e/b.duration,this.pos=b.easing(e,0,1,b.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update(),b=!0;return b}};this.animate=function(a,d,b){var e,h="",f,i,g;a.stopAnimation=!1;if(typeof b!=="object"||b===null)e=arguments,b={duration:e[2],easing:e[3],complete:e[4]};if(typeof b.duration!=="number")b.duration=400;b.easing=Math[b.easing]||Math.easeInOutSine; |
|||
b.curAnim=Highcharts.extend({},d);for(g in d)i=new n(a,b,g),f=null,g==="d"?(i.paths=c.init(a,a.d,d.d),i.toD=d.d,e=0,f=1):a.attr?e=a.attr(g):(e=parseFloat(HighchartsAdapter._getStyle(a,g))||0,g!=="opacity"&&(h="px")),f||(f=parseFloat(d[g])),i.custom(e,f,h)}},_getStyle:function(c,a){return window.getComputedStyle(c).getPropertyValue(a)},getScript:function(c,a){var d=l.getElementsByTagName("head")[0],b=l.createElement("script");b.type="text/javascript";b.src=c;b.onload=a;d.appendChild(b)},inArray:function(c, |
|||
a){return a.indexOf?a.indexOf(c):p.indexOf.call(a,c)},adapterRun:function(c,a){return parseInt(HighchartsAdapter._getStyle(c,a),10)},grep:function(c,a){return p.filter.call(c,a)},map:function(c,a){for(var d=[],b=0,e=c.length;b<e;b++)d[b]=a.call(c[b],c[b],b,c);return d},offset:function(c){for(var a=0,d=0;c;)a+=c.offsetLeft,d+=c.offsetTop,c=c.offsetParent;return{left:a,top:d}},addEvent:function(c,a,d){o(c).bind(a,d)},removeEvent:function(c,a,d){o(c).unbind(a,d)},fireEvent:function(c,a,d,b){var e;l.createEvent&& |
|||
(c.dispatchEvent||c.fireEvent)?(e=l.createEvent("Events"),e.initEvent(a,!0,!0),e.target=c,Highcharts.extend(e,d),c.dispatchEvent?c.dispatchEvent(e):c.fireEvent(a,e)):c.HCExtended===!0&&(d=d||{},c.trigger(a,d));d&&d.defaultPrevented&&(b=null);b&&b(d)},washMouseEvent:function(c){return c},stop:function(c){c.stopAnimation=!0},each:function(c,a){return Array.prototype.forEach.call(c,a)}}}(); |
|||
@ -0,0 +1,583 @@ |
|||
/** |
|||
* @license Highcharts JS v3.0.6 (2013-10-04) |
|||
* |
|||
* Standalone Highcharts Framework |
|||
* |
|||
* License: MIT License |
|||
*/ |
|||
|
|||
|
|||
/*global Highcharts */ |
|||
var HighchartsAdapter = (function () { |
|||
|
|||
var UNDEFINED, |
|||
doc = document, |
|||
emptyArray = [], |
|||
timers = [], |
|||
timerId, |
|||
Fx; |
|||
|
|||
Math.easeInOutSine = function (t, b, c, d) { |
|||
return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; |
|||
}; |
|||
|
|||
|
|||
|
|||
/** |
|||
* Extend given object with custom events |
|||
*/ |
|||
function augment(obj) { |
|||
function removeOneEvent(el, type, fn) { |
|||
el.removeEventListener(type, fn, false); |
|||
} |
|||
|
|||
function IERemoveOneEvent(el, type, fn) { |
|||
fn = el.HCProxiedMethods[fn.toString()]; |
|||
el.detachEvent('on' + type, fn); |
|||
} |
|||
|
|||
function removeAllEvents(el, type) { |
|||
var events = el.HCEvents, |
|||
remove, |
|||
types, |
|||
len, |
|||
n; |
|||
|
|||
if (el.removeEventListener) { |
|||
remove = removeOneEvent; |
|||
} else if (el.attachEvent) { |
|||
remove = IERemoveOneEvent; |
|||
} else { |
|||
return; // break on non-DOM events
|
|||
} |
|||
|
|||
|
|||
if (type) { |
|||
types = {}; |
|||
types[type] = true; |
|||
} else { |
|||
types = events; |
|||
} |
|||
|
|||
for (n in types) { |
|||
if (events[n]) { |
|||
len = events[n].length; |
|||
while (len--) { |
|||
remove(el, n, events[n][len]); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
if (!obj.HCExtended) { |
|||
Highcharts.extend(obj, { |
|||
HCExtended: true, |
|||
|
|||
HCEvents: {}, |
|||
|
|||
bind: function (name, fn) { |
|||
var el = this, |
|||
events = this.HCEvents, |
|||
wrappedFn; |
|||
|
|||
// handle DOM events in modern browsers
|
|||
if (el.addEventListener) { |
|||
el.addEventListener(name, fn, false); |
|||
|
|||
// handle old IE implementation
|
|||
} else if (el.attachEvent) { |
|||
|
|||
wrappedFn = function (e) { |
|||
fn.call(el, e); |
|||
}; |
|||
|
|||
if (!el.HCProxiedMethods) { |
|||
el.HCProxiedMethods = {}; |
|||
} |
|||
|
|||
// link wrapped fn with original fn, so we can get this in removeEvent
|
|||
el.HCProxiedMethods[fn.toString()] = wrappedFn; |
|||
|
|||
el.attachEvent('on' + name, wrappedFn); |
|||
} |
|||
|
|||
|
|||
if (events[name] === UNDEFINED) { |
|||
events[name] = []; |
|||
} |
|||
|
|||
events[name].push(fn); |
|||
}, |
|||
|
|||
unbind: function (name, fn) { |
|||
var events, |
|||
index; |
|||
|
|||
if (name) { |
|||
events = this.HCEvents[name] || []; |
|||
if (fn) { |
|||
index = HighchartsAdapter.inArray(fn, events); |
|||
if (index > -1) { |
|||
events.splice(index, 1); |
|||
this.HCEvents[name] = events; |
|||
} |
|||
if (this.removeEventListener) { |
|||
removeOneEvent(this, name, fn); |
|||
} else if (this.attachEvent) { |
|||
IERemoveOneEvent(this, name, fn); |
|||
} |
|||
} else { |
|||
removeAllEvents(this, name); |
|||
this.HCEvents[name] = []; |
|||
} |
|||
} else { |
|||
removeAllEvents(this); |
|||
this.HCEvents = {}; |
|||
} |
|||
}, |
|||
|
|||
trigger: function (name, args) { |
|||
var events = this.HCEvents[name] || [], |
|||
target = this, |
|||
len = events.length, |
|||
i, |
|||
preventDefault, |
|||
fn; |
|||
|
|||
// Attach a simple preventDefault function to skip default handler if called
|
|||
preventDefault = function () { |
|||
args.defaultPrevented = true; |
|||
}; |
|||
|
|||
for (i = 0; i < len; i++) { |
|||
fn = events[i]; |
|||
|
|||
// args is never null here
|
|||
if (args.stopped) { |
|||
return; |
|||
} |
|||
|
|||
args.preventDefault = preventDefault; |
|||
args.target = target; |
|||
args.type = name; // #2297
|
|||
|
|||
// If the event handler return false, prevent the default handler from executing
|
|||
if (fn.call(this, args) === false) { |
|||
args.preventDefault(); |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
|
|||
return obj; |
|||
} |
|||
|
|||
|
|||
return { |
|||
/** |
|||
* Initialize the adapter. This is run once as Highcharts is first run. |
|||
*/ |
|||
init: function (pathAnim) { |
|||
|
|||
/** |
|||
* Compatibility section to add support for legacy IE. This can be removed if old IE |
|||
* support is not needed. |
|||
*/ |
|||
if (!doc.defaultView) { |
|||
this._getStyle = function (el, prop) { |
|||
var val; |
|||
if (el.style[prop]) { |
|||
return el.style[prop]; |
|||
} else { |
|||
if (prop === 'opacity') { |
|||
prop = 'filter'; |
|||
} |
|||
/*jslint unparam: true*/ |
|||
val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b) { return b.toUpperCase(); })]; |
|||
if (prop === 'filter') { |
|||
val = val.replace( |
|||
/alpha\(opacity=([0-9]+)\)/, |
|||
function (a, b) { |
|||
return b / 100; |
|||
} |
|||
); |
|||
} |
|||
/*jslint unparam: false*/ |
|||
return val === '' ? 1 : val; |
|||
} |
|||
}; |
|||
this.adapterRun = function (elem, method) { |
|||
var alias = { width: 'clientWidth', height: 'clientHeight' }[method]; |
|||
|
|||
if (alias) { |
|||
elem.style.zoom = 1; |
|||
return elem[alias] - 2 * parseInt(HighchartsAdapter._getStyle(elem, 'padding'), 10); |
|||
} |
|||
}; |
|||
} |
|||
|
|||
if (!Array.prototype.forEach) { |
|||
this.each = function (arr, fn) { // legacy
|
|||
var i = 0, |
|||
len = arr.length; |
|||
for (; i < len; i++) { |
|||
if (fn.call(arr[i], arr[i], i, arr) === false) { |
|||
return i; |
|||
} |
|||
} |
|||
}; |
|||
} |
|||
|
|||
if (!Array.prototype.indexOf) { |
|||
this.inArray = function (item, arr) { |
|||
var len, |
|||
i = 0; |
|||
|
|||
if (arr) { |
|||
len = arr.length; |
|||
|
|||
for (; i < len; i++) { |
|||
if (arr[i] === item) { |
|||
return i; |
|||
} |
|||
} |
|||
} |
|||
|
|||
return -1; |
|||
}; |
|||
} |
|||
|
|||
if (!Array.prototype.filter) { |
|||
this.grep = function (elements, callback) { |
|||
var ret = [], |
|||
i = 0, |
|||
length = elements.length; |
|||
|
|||
for (; i < length; i++) { |
|||
if (!!callback(elements[i], i)) { |
|||
ret.push(elements[i]); |
|||
} |
|||
} |
|||
|
|||
return ret; |
|||
}; |
|||
} |
|||
|
|||
//--- End compatibility section ---
|
|||
|
|||
|
|||
/** |
|||
* Start of animation specific code |
|||
*/ |
|||
Fx = function (elem, options, prop) { |
|||
this.options = options; |
|||
this.elem = elem; |
|||
this.prop = prop; |
|||
}; |
|||
Fx.prototype = { |
|||
|
|||
update: function () { |
|||
var styles, |
|||
paths = this.paths, |
|||
elem = this.elem, |
|||
elemelem = elem.element; // if destroyed, it is null
|
|||
|
|||
// Animating a path definition on SVGElement
|
|||
if (paths && elemelem) { |
|||
elem.attr('d', pathAnim.step(paths[0], paths[1], this.now, this.toD)); |
|||
|
|||
// Other animations on SVGElement
|
|||
} else if (elem.attr) { |
|||
if (elemelem) { |
|||
elem.attr(this.prop, this.now); |
|||
} |
|||
|
|||
// HTML styles
|
|||
} else { |
|||
styles = {}; |
|||
styles[elem] = this.now + this.unit; |
|||
Highcharts.css(elem, styles); |
|||
} |
|||
|
|||
if (this.options.step) { |
|||
this.options.step.call(this.elem, this.now, this); |
|||
} |
|||
|
|||
}, |
|||
custom: function (from, to, unit) { |
|||
var self = this, |
|||
t = function (gotoEnd) { |
|||
return self.step(gotoEnd); |
|||
}, |
|||
i; |
|||
|
|||
this.startTime = +new Date(); |
|||
this.start = from; |
|||
this.end = to; |
|||
this.unit = unit; |
|||
this.now = this.start; |
|||
this.pos = this.state = 0; |
|||
|
|||
t.elem = this.elem; |
|||
|
|||
if (t() && timers.push(t) === 1) { |
|||
timerId = setInterval(function () { |
|||
|
|||
for (i = 0; i < timers.length; i++) { |
|||
if (!timers[i]()) { |
|||
timers.splice(i--, 1); |
|||
} |
|||
} |
|||
|
|||
if (!timers.length) { |
|||
clearInterval(timerId); |
|||
} |
|||
}, 13); |
|||
} |
|||
}, |
|||
|
|||
step: function (gotoEnd) { |
|||
var t = +new Date(), |
|||
ret, |
|||
done, |
|||
options = this.options, |
|||
i; |
|||
|
|||
if (this.elem.stopAnimation) { |
|||
ret = false; |
|||
|
|||
} else if (gotoEnd || t >= options.duration + this.startTime) { |
|||
this.now = this.end; |
|||
this.pos = this.state = 1; |
|||
this.update(); |
|||
|
|||
this.options.curAnim[this.prop] = true; |
|||
|
|||
done = true; |
|||
for (i in options.curAnim) { |
|||
if (options.curAnim[i] !== true) { |
|||
done = false; |
|||
} |
|||
} |
|||
|
|||
if (done) { |
|||
if (options.complete) { |
|||
options.complete.call(this.elem); |
|||
} |
|||
} |
|||
ret = false; |
|||
|
|||
} else { |
|||
var n = t - this.startTime; |
|||
this.state = n / options.duration; |
|||
this.pos = options.easing(n, 0, 1, options.duration); |
|||
this.now = this.start + ((this.end - this.start) * this.pos); |
|||
this.update(); |
|||
ret = true; |
|||
} |
|||
return ret; |
|||
} |
|||
}; |
|||
|
|||
/** |
|||
* The adapter animate method |
|||
*/ |
|||
this.animate = function (el, prop, opt) { |
|||
var start, |
|||
unit = '', |
|||
end, |
|||
fx, |
|||
args, |
|||
name; |
|||
|
|||
el.stopAnimation = false; // ready for new
|
|||
|
|||
if (typeof opt !== 'object' || opt === null) { |
|||
args = arguments; |
|||
opt = { |
|||
duration: args[2], |
|||
easing: args[3], |
|||
complete: args[4] |
|||
}; |
|||
} |
|||
if (typeof opt.duration !== 'number') { |
|||
opt.duration = 400; |
|||
} |
|||
opt.easing = Math[opt.easing] || Math.easeInOutSine; |
|||
opt.curAnim = Highcharts.extend({}, prop); |
|||
|
|||
for (name in prop) { |
|||
fx = new Fx(el, opt, name); |
|||
end = null; |
|||
|
|||
if (name === 'd') { |
|||
fx.paths = pathAnim.init( |
|||
el, |
|||
el.d, |
|||
prop.d |
|||
); |
|||
fx.toD = prop.d; |
|||
start = 0; |
|||
end = 1; |
|||
} else if (el.attr) { |
|||
start = el.attr(name); |
|||
} else { |
|||
start = parseFloat(HighchartsAdapter._getStyle(el, name)) || 0; |
|||
if (name !== 'opacity') { |
|||
unit = 'px'; |
|||
} |
|||
} |
|||
|
|||
if (!end) { |
|||
end = parseFloat(prop[name]); |
|||
} |
|||
fx.custom(start, end, unit); |
|||
} |
|||
}; |
|||
}, |
|||
|
|||
/** |
|||
* Internal method to return CSS value for given element and property |
|||
*/ |
|||
_getStyle: function (el, prop) { |
|||
return window.getComputedStyle(el).getPropertyValue(prop); |
|||
}, |
|||
|
|||
/** |
|||
* Downloads a script and executes a callback when done. |
|||
* @param {String} scriptLocation |
|||
* @param {Function} callback |
|||
*/ |
|||
getScript: function (scriptLocation, callback) { |
|||
// We cannot assume that Assets class from mootools-more is available so instead insert a script tag to download script.
|
|||
var head = doc.getElementsByTagName('head')[0], |
|||
script = doc.createElement('script'); |
|||
|
|||
script.type = 'text/javascript'; |
|||
script.src = scriptLocation; |
|||
script.onload = callback; |
|||
|
|||
head.appendChild(script); |
|||
}, |
|||
|
|||
/** |
|||
* Return the index of an item in an array, or -1 if not found |
|||
*/ |
|||
inArray: function (item, arr) { |
|||
return arr.indexOf ? arr.indexOf(item) : emptyArray.indexOf.call(arr, item); |
|||
}, |
|||
|
|||
|
|||
/** |
|||
* A direct link to adapter methods |
|||
*/ |
|||
adapterRun: function (elem, method) { |
|||
return parseInt(HighchartsAdapter._getStyle(elem, method), 10); |
|||
}, |
|||
|
|||
/** |
|||
* Filter an array |
|||
*/ |
|||
grep: function (elements, callback) { |
|||
return emptyArray.filter.call(elements, callback); |
|||
}, |
|||
|
|||
/** |
|||
* Map an array |
|||
*/ |
|||
map: function (arr, fn) { |
|||
var results = [], i = 0, len = arr.length; |
|||
|
|||
for (; i < len; i++) { |
|||
results[i] = fn.call(arr[i], arr[i], i, arr); |
|||
} |
|||
|
|||
return results; |
|||
}, |
|||
|
|||
offset: function (el) { |
|||
var left = 0, |
|||
top = 0; |
|||
|
|||
while (el) { |
|||
left += el.offsetLeft; |
|||
top += el.offsetTop; |
|||
el = el.offsetParent; |
|||
} |
|||
|
|||
return { |
|||
left: left, |
|||
top: top |
|||
}; |
|||
}, |
|||
|
|||
/** |
|||
* Add an event listener |
|||
*/ |
|||
addEvent: function (el, type, fn) { |
|||
augment(el).bind(type, fn); |
|||
}, |
|||
|
|||
/** |
|||
* Remove event added with addEvent |
|||
*/ |
|||
removeEvent: function (el, type, fn) { |
|||
augment(el).unbind(type, fn); |
|||
}, |
|||
|
|||
/** |
|||
* Fire an event on a custom object |
|||
*/ |
|||
fireEvent: function (el, type, eventArguments, defaultFunction) { |
|||
var e; |
|||
|
|||
if (doc.createEvent && (el.dispatchEvent || el.fireEvent)) { |
|||
e = doc.createEvent('Events'); |
|||
e.initEvent(type, true, true); |
|||
e.target = el; |
|||
|
|||
Highcharts.extend(e, eventArguments); |
|||
|
|||
if (el.dispatchEvent) { |
|||
el.dispatchEvent(e); |
|||
} else { |
|||
el.fireEvent(type, e); |
|||
} |
|||
|
|||
} else if (el.HCExtended === true) { |
|||
eventArguments = eventArguments || {}; |
|||
el.trigger(type, eventArguments); |
|||
} |
|||
|
|||
if (eventArguments && eventArguments.defaultPrevented) { |
|||
defaultFunction = null; |
|||
} |
|||
|
|||
if (defaultFunction) { |
|||
defaultFunction(eventArguments); |
|||
} |
|||
}, |
|||
|
|||
washMouseEvent: function (e) { |
|||
return e; |
|||
}, |
|||
|
|||
|
|||
/** |
|||
* Stop running animation |
|||
*/ |
|||
stop: function (el) { |
|||
el.stopAnimation = true; |
|||
}, |
|||
|
|||
/** |
|||
* Utility for iterating over an array. Parameters are reversed compared to jQuery. |
|||
* @param {Array} arr |
|||
* @param {Function} fn |
|||
*/ |
|||
each: function (arr, fn) { // modern browsers
|
|||
return Array.prototype.forEach.call(arr, fn); |
|||
} |
|||
}; |
|||
}()); |
|||
@ -0,0 +1,50 @@ |
|||
/* |
|||
Highcharts JS v3.0.6 (2013-10-04) |
|||
|
|||
(c) 2009-2013 Torstein Hønsi |
|||
|
|||
License: www.highcharts.com/license |
|||
*/ |
|||
(function(j,C){function J(a,b,c){this.init.call(this,a,b,c)}function K(a,b,c){a.call(this,b,c);if(this.chart.polar)this.closeSegment=function(a){var c=this.xAxis.center;a.push("L",c[0],c[1])},this.closedStacks=!0}function L(a,b){var c=this.chart,d=this.options.animation,g=this.group,f=this.markerGroup,e=this.xAxis.center,i=c.plotLeft,n=c.plotTop;if(c.polar){if(c.renderer.isSVG)if(d===!0&&(d={}),b){if(c={translateX:e[0]+i,translateY:e[1]+n,scaleX:0.001,scaleY:0.001},g.attr(c),f)f.attrSetters=g.attrSetters, |
|||
f.attr(c)}else c={translateX:i,translateY:n,scaleX:1,scaleY:1},g.animate(c,d),f&&f.animate(c,d),this.animate=null}else a.call(this,b)}var P=j.arrayMin,Q=j.arrayMax,s=j.each,F=j.extend,p=j.merge,R=j.map,r=j.pick,v=j.pInt,m=j.getOptions().plotOptions,h=j.seriesTypes,x=j.extendClass,M=j.splat,o=j.wrap,N=j.Axis,u=j.Tick,z=j.Series,q=h.column.prototype,t=Math,D=t.round,A=t.floor,S=t.max,w=function(){};F(J.prototype,{init:function(a,b,c){var d=this,g=d.defaultOptions;d.chart=b;if(b.angular)g.background= |
|||
{};d.options=a=p(g,a);(a=a.background)&&s([].concat(M(a)).reverse(),function(a){var b=a.backgroundColor,a=p(d.defaultBackgroundOptions,a);if(b)a.backgroundColor=b;a.color=a.backgroundColor;c.options.plotBands.unshift(a)})},defaultOptions:{center:["50%","50%"],size:"85%",startAngle:0},defaultBackgroundOptions:{shape:"circle",borderWidth:1,borderColor:"silver",backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"#FFF"],[1,"#DDD"]]},from:Number.MIN_VALUE,innerRadius:0,to:Number.MAX_VALUE, |
|||
outerRadius:"105%"}});var G=N.prototype,u=u.prototype,T={getOffset:w,redraw:function(){this.isDirty=!1},render:function(){this.isDirty=!1},setScale:w,setCategories:w,setTitle:w},O={isRadial:!0,defaultRadialGaugeOptions:{labels:{align:"center",x:0,y:null},minorGridLineWidth:0,minorTickInterval:"auto",minorTickLength:10,minorTickPosition:"inside",minorTickWidth:1,plotBands:[],tickLength:10,tickPosition:"inside",tickWidth:2,title:{rotation:0},zIndex:2},defaultRadialXOptions:{gridLineWidth:1,labels:{align:null, |
|||
distance:15,x:0,y:null},maxPadding:0,minPadding:0,plotBands:[],showLastLabel:!1,tickLength:0},defaultRadialYOptions:{gridLineInterpolation:"circle",labels:{align:"right",x:-3,y:-2},plotBands:[],showLastLabel:!1,title:{x:4,text:null,rotation:90}},setOptions:function(a){this.options=p(this.defaultOptions,this.defaultRadialOptions,a)},getOffset:function(){G.getOffset.call(this);this.chart.axisOffset[this.side]=0},getLinePath:function(a,b){var c=this.center,b=r(b,c[2]/2-this.offset);return this.chart.renderer.symbols.arc(this.left+ |
|||
c[0],this.top+c[1],b,b,{start:this.startAngleRad,end:this.endAngleRad,open:!0,innerR:0})},setAxisTranslation:function(){G.setAxisTranslation.call(this);if(this.center&&(this.transA=this.isCircular?(this.endAngleRad-this.startAngleRad)/(this.max-this.min||1):this.center[2]/2/(this.max-this.min||1),this.isXAxis))this.minPixelPadding=this.transA*this.minPointOffset+(this.reversed?(this.endAngleRad-this.startAngleRad)/4:0)},beforeSetTickPositions:function(){this.autoConnect&&(this.max+=this.categories&& |
|||
1||this.pointRange||this.closestPointRange||0)},setAxisSize:function(){G.setAxisSize.call(this);if(this.isRadial)this.center=this.pane.center=h.pie.prototype.getCenter.call(this.pane),this.len=this.width=this.height=this.isCircular?this.center[2]*(this.endAngleRad-this.startAngleRad)/2:this.center[2]/2},getPosition:function(a,b){if(!this.isCircular)b=this.translate(a),a=this.min;return this.postTranslate(this.translate(a),r(b,this.center[2]/2)-this.offset)},postTranslate:function(a,b){var c=this.chart, |
|||
d=this.center,a=this.startAngleRad+a;return{x:c.plotLeft+d[0]+Math.cos(a)*b,y:c.plotTop+d[1]+Math.sin(a)*b}},getPlotBandPath:function(a,b,c){var d=this.center,g=this.startAngleRad,f=d[2]/2,e=[r(c.outerRadius,"100%"),c.innerRadius,r(c.thickness,10)],i=/%$/,n,l=this.isCircular;this.options.gridLineInterpolation==="polygon"?d=this.getPlotLinePath(a).concat(this.getPlotLinePath(b,!0)):(l||(e[0]=this.translate(a),e[1]=this.translate(b)),e=R(e,function(a){i.test(a)&&(a=v(a,10)*f/100);return a}),c.shape=== |
|||
"circle"||!l?(a=-Math.PI/2,b=Math.PI*1.5,n=!0):(a=g+this.translate(a),b=g+this.translate(b)),d=this.chart.renderer.symbols.arc(this.left+d[0],this.top+d[1],e[0],e[0],{start:a,end:b,innerR:r(e[1],e[0]-e[2]),open:n}));return d},getPlotLinePath:function(a,b){var c=this.center,d=this.chart,g=this.getPosition(a),f,e,i;this.isCircular?i=["M",c[0]+d.plotLeft,c[1]+d.plotTop,"L",g.x,g.y]:this.options.gridLineInterpolation==="circle"?(a=this.translate(a))&&(i=this.getLinePath(0,a)):(f=d.xAxis[0],i=[],a=this.translate(a), |
|||
c=f.tickPositions,f.autoConnect&&(c=c.concat([c[0]])),b&&(c=[].concat(c).reverse()),s(c,function(c,b){e=f.getPosition(c,a);i.push(b?"L":"M",e.x,e.y)}));return i},getTitlePosition:function(){var a=this.center,b=this.chart,c=this.options.title;return{x:b.plotLeft+a[0]+(c.x||0),y:b.plotTop+a[1]-{high:0.5,middle:0.25,low:0}[c.align]*a[2]+(c.y||0)}}};o(G,"init",function(a,b,c){var k;var d=b.angular,g=b.polar,f=c.isX,e=d&&f,i,n;n=b.options;var l=c.pane||0;if(d){if(F(this,e?T:O),i=!f)this.defaultRadialOptions= |
|||
this.defaultRadialGaugeOptions}else if(g)F(this,O),this.defaultRadialOptions=(i=f)?this.defaultRadialXOptions:p(this.defaultYAxisOptions,this.defaultRadialYOptions);a.call(this,b,c);if(!e&&(d||g)){a=this.options;if(!b.panes)b.panes=[];this.pane=(k=b.panes[l]=b.panes[l]||new J(M(n.pane)[l],b,this),l=k);l=l.options;b.inverted=!1;n.chart.zoomType=null;this.startAngleRad=b=(l.startAngle-90)*Math.PI/180;this.endAngleRad=n=(r(l.endAngle,l.startAngle+360)-90)*Math.PI/180;this.offset=a.offset||0;if((this.isCircular= |
|||
i)&&c.max===C&&n-b===2*Math.PI)this.autoConnect=!0}});o(u,"getPosition",function(a,b,c,d,g){var f=this.axis;return f.getPosition?f.getPosition(c):a.call(this,b,c,d,g)});o(u,"getLabelPosition",function(a,b,c,d,g,f,e,i,n){var l=this.axis,k=f.y,h=f.align,j=(l.translate(this.pos)+l.startAngleRad+Math.PI/2)/Math.PI*180%360;l.isRadial?(a=l.getPosition(this.pos,l.center[2]/2+r(f.distance,-25)),f.rotation==="auto"?d.attr({rotation:j}):k===null&&(k=v(d.styles.lineHeight)*0.9-d.getBBox().height/2),h===null&& |
|||
(h=l.isCircular?j>20&&j<160?"left":j>200&&j<340?"right":"center":"center",d.attr({align:h})),a.x+=f.x,a.y+=k):a=a.call(this,b,c,d,g,f,e,i,n);return a});o(u,"getMarkPath",function(a,b,c,d,g,f,e){var i=this.axis;i.isRadial?(a=i.getPosition(this.pos,i.center[2]/2+d),b=["M",b,c,"L",a.x,a.y]):b=a.call(this,b,c,d,g,f,e);return b});m.arearange=p(m.area,{lineWidth:1,marker:null,threshold:null,tooltip:{pointFormat:'<span style="color:{series.color}">{series.name}</span>: <b>{point.low}</b> - <b>{point.high}</b><br/>'}, |
|||
trackByArea:!0,dataLabels:{verticalAlign:null,xLow:0,xHigh:0,yLow:0,yHigh:0}});h.arearange=j.extendClass(h.area,{type:"arearange",pointArrayMap:["low","high"],toYData:function(a){return[a.low,a.high]},pointValKey:"low",getSegments:function(){var a=this;s(a.points,function(b){if(!a.options.connectNulls&&(b.low===null||b.high===null))b.y=null;else if(b.low===null&&b.high!==null)b.y=b.high});z.prototype.getSegments.call(this)},translate:function(){var a=this.yAxis;h.area.prototype.translate.apply(this); |
|||
s(this.points,function(b){var c=b.low,d=b.high,g=b.plotY;d===null&&c===null?b.y=null:c===null?(b.plotLow=b.plotY=null,b.plotHigh=a.translate(d,0,1,0,1)):d===null?(b.plotLow=g,b.plotHigh=null):(b.plotLow=g,b.plotHigh=a.translate(d,0,1,0,1))})},getSegmentPath:function(a){var b,c=[],d=a.length,g=z.prototype.getSegmentPath,f,e;e=this.options;var i=e.step;for(b=HighchartsAdapter.grep(a,function(a){return a.plotLow!==null});d--;)f=a[d],f.plotHigh!==null&&c.push({plotX:f.plotX,plotY:f.plotHigh});a=g.call(this, |
|||
b);if(i)i===!0&&(i="left"),e.step={left:"right",center:"center",right:"left"}[i];c=g.call(this,c);e.step=i;e=[].concat(a,c);c[0]="L";this.areaPath=this.areaPath.concat(a,c);return e},drawDataLabels:function(){var a=this.data,b=a.length,c,d=[],g=z.prototype,f=this.options.dataLabels,e,i=this.chart.inverted;if(f.enabled||this._hasPointLabels){for(c=b;c--;)e=a[c],e.y=e.high,e.plotY=e.plotHigh,d[c]=e.dataLabel,e.dataLabel=e.dataLabelUpper,e.below=!1,i?(f.align="left",f.x=f.xHigh):f.y=f.yHigh;g.drawDataLabels.apply(this, |
|||
arguments);for(c=b;c--;)e=a[c],e.dataLabelUpper=e.dataLabel,e.dataLabel=d[c],e.y=e.low,e.plotY=e.plotLow,e.below=!0,i?(f.align="right",f.x=f.xLow):f.y=f.yLow;g.drawDataLabels.apply(this,arguments)}},alignDataLabel:h.column.prototype.alignDataLabel,getSymbol:h.column.prototype.getSymbol,drawPoints:w});m.areasplinerange=p(m.arearange);h.areasplinerange=x(h.arearange,{type:"areasplinerange",getPointSpline:h.spline.prototype.getPointSpline});m.columnrange=p(m.column,m.arearange,{lineWidth:1,pointRange:null}); |
|||
h.columnrange=x(h.arearange,{type:"columnrange",translate:function(){var a=this,b=a.yAxis,c;q.translate.apply(a);s(a.points,function(d){var g=d.shapeArgs,f=a.options.minPointLength,e;d.plotHigh=c=b.translate(d.high,0,1,0,1);d.plotLow=d.plotY;e=c;d=d.plotY-c;d<f&&(f-=d,d+=f,e-=f/2);g.height=d;g.y=e})},trackerGroups:["group","dataLabels"],drawGraph:w,pointAttrToOptions:q.pointAttrToOptions,drawPoints:q.drawPoints,drawTracker:q.drawTracker,animate:q.animate,getColumnMetrics:q.getColumnMetrics});m.gauge= |
|||
p(m.line,{dataLabels:{enabled:!0,y:15,borderWidth:1,borderColor:"silver",borderRadius:3,style:{fontWeight:"bold"},verticalAlign:"top",zIndex:2},dial:{},pivot:{},tooltip:{headerFormat:""},showInLegend:!1});u={type:"gauge",pointClass:j.extendClass(j.Point,{setState:function(a){this.state=a}}),angular:!0,drawGraph:w,fixedBox:!0,trackerGroups:["group","dataLabels"],translate:function(){var a=this.yAxis,b=this.options,c=a.center;this.generatePoints();s(this.points,function(d){var g=p(b.dial,d.dial),f= |
|||
v(r(g.radius,80))*c[2]/200,e=v(r(g.baseLength,70))*f/100,i=v(r(g.rearLength,10))*f/100,n=g.baseWidth||3,l=g.topWidth||1,k=a.startAngleRad+a.translate(d.y,null,null,null,!0);b.wrap===!1&&(k=Math.max(a.startAngleRad,Math.min(a.endAngleRad,k)));k=k*180/Math.PI;d.shapeType="path";d.shapeArgs={d:g.path||["M",-i,-n/2,"L",e,-n/2,f,-l/2,f,l/2,e,n/2,-i,n/2,"z"],translateX:c[0],translateY:c[1],rotation:k};d.plotX=c[0];d.plotY=c[1]})},drawPoints:function(){var a=this,b=a.yAxis.center,c=a.pivot,d=a.options,g= |
|||
d.pivot,f=a.chart.renderer;s(a.points,function(c){var b=c.graphic,g=c.shapeArgs,l=g.d,k=p(d.dial,c.dial);b?(b.animate(g),g.d=l):c.graphic=f[c.shapeType](g).attr({stroke:k.borderColor||"none","stroke-width":k.borderWidth||0,fill:k.backgroundColor||"black",rotation:g.rotation}).add(a.group)});c?c.animate({translateX:b[0],translateY:b[1]}):a.pivot=f.circle(0,0,r(g.radius,5)).attr({"stroke-width":g.borderWidth||0,stroke:g.borderColor||"silver",fill:g.backgroundColor||"black"}).translate(b[0],b[1]).add(a.group)}, |
|||
animate:function(a){var b=this;if(!a)s(b.points,function(a){var d=a.graphic;d&&(d.attr({rotation:b.yAxis.startAngleRad*180/Math.PI}),d.animate({rotation:a.shapeArgs.rotation},b.options.animation))}),b.animate=null},render:function(){this.group=this.plotGroup("group","series",this.visible?"visible":"hidden",this.options.zIndex,this.chart.seriesGroup);h.pie.prototype.render.call(this);this.group.clip(this.chart.clipRect)},setData:h.pie.prototype.setData,drawTracker:h.column.prototype.drawTracker};h.gauge= |
|||
j.extendClass(h.line,u);m.boxplot=p(m.column,{fillColor:"#FFFFFF",lineWidth:1,medianWidth:2,states:{hover:{brightness:-0.3}},threshold:null,tooltip:{pointFormat:'<span style="color:{series.color};font-weight:bold">{series.name}</span><br/>Maximum: {point.high}<br/>Upper quartile: {point.q3}<br/>Median: {point.median}<br/>Lower quartile: {point.q1}<br/>Minimum: {point.low}<br/>'},whiskerLength:"50%",whiskerWidth:2});h.boxplot=x(h.column,{type:"boxplot",pointArrayMap:["low","q1","median","q3","high"], |
|||
toYData:function(a){return[a.low,a.q1,a.median,a.q3,a.high]},pointValKey:"high",pointAttrToOptions:{fill:"fillColor",stroke:"color","stroke-width":"lineWidth"},drawDataLabels:w,translate:function(){var a=this.yAxis,b=this.pointArrayMap;h.column.prototype.translate.apply(this);s(this.points,function(c){s(b,function(b){c[b]!==null&&(c[b+"Plot"]=a.translate(c[b],0,1,0,1))})})},drawPoints:function(){var a=this,b=a.points,c=a.options,d=a.chart.renderer,g,f,e,i,n,l,k,h,j,m,o,H,p,E,I,q,w,t,v,u,z,y,x=a.doQuartiles!== |
|||
!1,B=parseInt(a.options.whiskerLength,10)/100;s(b,function(b){j=b.graphic;z=b.shapeArgs;o={};E={};q={};y=b.color||a.color;if(b.plotY!==C)if(g=b.pointAttr[b.selected?"selected":""],w=z.width,t=A(z.x),v=t+w,u=D(w/2),f=A(x?b.q1Plot:b.lowPlot),e=A(x?b.q3Plot:b.lowPlot),i=A(b.highPlot),n=A(b.lowPlot),o.stroke=b.stemColor||c.stemColor||y,o["stroke-width"]=r(b.stemWidth,c.stemWidth,c.lineWidth),o.dashstyle=b.stemDashStyle||c.stemDashStyle,E.stroke=b.whiskerColor||c.whiskerColor||y,E["stroke-width"]=r(b.whiskerWidth, |
|||
c.whiskerWidth,c.lineWidth),q.stroke=b.medianColor||c.medianColor||y,q["stroke-width"]=r(b.medianWidth,c.medianWidth,c.lineWidth),k=o["stroke-width"]%2/2,h=t+u+k,m=["M",h,e,"L",h,i,"M",h,f,"L",h,n,"z"],x&&(k=g["stroke-width"]%2/2,h=A(h)+k,f=A(f)+k,e=A(e)+k,t+=k,v+=k,H=["M",t,e,"L",t,f,"L",v,f,"L",v,e,"L",t,e,"z"]),B&&(k=E["stroke-width"]%2/2,i+=k,n+=k,p=["M",h-u*B,i,"L",h+u*B,i,"M",h-u*B,n,"L",h+u*B,n]),k=q["stroke-width"]%2/2,l=D(b.medianPlot)+k,I=["M",t,l,"L",v,l,"z"],j)b.stem.animate({d:m}),B&& |
|||
b.whiskers.animate({d:p}),x&&b.box.animate({d:H}),b.medianShape.animate({d:I});else{b.graphic=j=d.g().add(a.group);b.stem=d.path(m).attr(o).add(j);if(B)b.whiskers=d.path(p).attr(E).add(j);if(x)b.box=d.path(H).attr(g).add(j);b.medianShape=d.path(I).attr(q).add(j)}})}});m.errorbar=p(m.boxplot,{color:"#000000",grouping:!1,linkedTo:":previous",tooltip:{pointFormat:m.arearange.tooltip.pointFormat},whiskerWidth:null});h.errorbar=x(h.boxplot,{type:"errorbar",pointArrayMap:["low","high"],toYData:function(a){return[a.low, |
|||
a.high]},pointValKey:"high",doQuartiles:!1,getColumnMetrics:function(){return this.linkedParent&&this.linkedParent.columnMetrics||h.column.prototype.getColumnMetrics.call(this)}});m.waterfall=p(m.column,{lineWidth:1,lineColor:"#333",dashStyle:"dot",borderColor:"#333"});h.waterfall=x(h.column,{type:"waterfall",upColorProp:"fill",pointArrayMap:["low","y"],pointValKey:"y",init:function(a,b){b.stacking=!0;h.column.prototype.init.call(this,a,b)},translate:function(){var a=this.options,b=this.yAxis,c,d, |
|||
g,f,e,i,n,l,k;c=a.threshold;a=a.borderWidth%2/2;h.column.prototype.translate.apply(this);l=c;g=this.points;for(d=0,c=g.length;d<c;d++){f=g[d];e=f.shapeArgs;i=this.getStack(d);k=i.points[this.index];if(isNaN(f.y))f.y=this.yData[d];n=S(l,l+f.y)+k[0];e.y=b.translate(n,0,1);f.isSum||f.isIntermediateSum?(e.y=b.translate(k[1],0,1),e.height=b.translate(k[0],0,1)-e.y):l+=i.total;e.height<0&&(e.y+=e.height,e.height*=-1);f.plotY=e.y=D(e.y)-a;e.height=D(e.height);f.yBottom=e.y+e.height}},processData:function(a){var b= |
|||
this.yData,c=this.points,d,g=b.length,f=this.options.threshold||0,e,i,h,l,k,j;i=e=h=l=f;for(j=0;j<g;j++)k=b[j],d=c&&c[j]?c[j]:{},k==="sum"||d.isSum?b[j]=i:k==="intermediateSum"||d.isIntermediateSum?(b[j]=e,e=f):(i+=k,e+=k),h=Math.min(i,h),l=Math.max(i,l);z.prototype.processData.call(this,a);this.dataMin=h;this.dataMax=l},toYData:function(a){if(a.isSum)return"sum";else if(a.isIntermediateSum)return"intermediateSum";return a.y},getAttribs:function(){h.column.prototype.getAttribs.apply(this,arguments); |
|||
var a=this.options,b=a.states,c=a.upColor||this.color,a=j.Color(c).brighten(0.1).get(),d=p(this.pointAttr),g=this.upColorProp;d[""][g]=c;d.hover[g]=b.hover.upColor||a;d.select[g]=b.select.upColor||c;s(this.points,function(a){if(a.y>0&&!a.color)a.pointAttr=d,a.color=c})},getGraphPath:function(){var a=this.data,b=a.length,c=D(this.options.lineWidth+this.options.borderWidth)%2/2,d=[],g,f,e;for(e=1;e<b;e++)f=a[e].shapeArgs,g=a[e-1].shapeArgs,f=["M",g.x+g.width,g.y+c,"L",f.x,g.y+c],a[e-1].y<0&&(f[2]+= |
|||
g.height,f[5]+=g.height),d=d.concat(f);return d},getExtremes:w,getStack:function(a){var b=this.yAxis.stacks,c=this.stackKey;this.processedYData[a]<this.options.threshold&&(c="-"+c);return b[c][a]},drawGraph:z.prototype.drawGraph});m.bubble=p(m.scatter,{dataLabels:{inside:!0,style:{color:"white",textShadow:"0px 0px 3px black"},verticalAlign:"middle"},marker:{lineColor:null,lineWidth:1},minSize:8,maxSize:"20%",tooltip:{pointFormat:"({point.x}, {point.y}), Size: {point.z}"},turboThreshold:0,zThreshold:0}); |
|||
h.bubble=x(h.scatter,{type:"bubble",pointArrayMap:["y","z"],trackerGroups:["group","dataLabelsGroup"],pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor"},applyOpacity:function(a){var b=this.options.marker,c=r(b.fillOpacity,0.5),a=a||b.fillColor||this.color;c!==1&&(a=j.Color(a).setOpacity(c).get("rgba"));return a},convertAttribs:function(){var a=z.prototype.convertAttribs.apply(this,arguments);a.fill=this.applyOpacity(a.fill);return a},getRadii:function(a,b,c,d){var g, |
|||
f,e,i=this.zData,h=[];for(f=0,g=i.length;f<g;f++)e=b-a,e=e>0?(i[f]-a)/(b-a):0.5,h.push(t.ceil(c+e*(d-c))/2);this.radii=h},animate:function(a){var b=this.options.animation;if(!a)s(this.points,function(a){var d=a.graphic,a=a.shapeArgs;d&&a&&(d.attr("r",1),d.animate({r:a.r},b))}),this.animate=null},translate:function(){var a,b=this.data,c,d,g=this.radii;h.scatter.prototype.translate.call(this);for(a=b.length;a--;)c=b[a],d=g?g[a]:0,c.negative=c.z<(this.options.zThreshold||0),d>=this.minPxSize/2?(c.shapeType= |
|||
"circle",c.shapeArgs={x:c.plotX,y:c.plotY,r:d},c.dlBox={x:c.plotX-d,y:c.plotY-d,width:2*d,height:2*d}):c.shapeArgs=c.plotY=c.dlBox=C},drawLegendSymbol:function(a,b){var c=v(a.itemStyle.fontSize)/2;b.legendSymbol=this.chart.renderer.circle(c,a.baseline-c,c).attr({zIndex:3}).add(b.legendGroup);b.legendSymbol.isMarker=!0},drawPoints:h.column.prototype.drawPoints,alignDataLabel:h.column.prototype.alignDataLabel});N.prototype.beforePadding=function(){var a=this,b=this.len,c=this.chart,d=0,g=b,f=this.isXAxis, |
|||
e=f?"xData":"yData",i=this.min,h={},j=t.min(c.plotWidth,c.plotHeight),k=Number.MAX_VALUE,m=-Number.MAX_VALUE,o=this.max-i,p=b/o,q=[];this.tickPositions&&(s(this.series,function(b){var c=b.options;if(b.type==="bubble"&&b.visible&&(a.allowZoomOutside=!0,q.push(b),f))s(["minSize","maxSize"],function(a){var b=c[a],d=/%$/.test(b),b=v(b);h[a]=d?j*b/100:b}),b.minPxSize=h.minSize,b=b.zData,b.length&&(k=t.min(k,t.max(P(b),c.displayNegative===!1?c.zThreshold:-Number.MAX_VALUE)),m=t.max(m,Q(b)))}),s(q,function(a){var b= |
|||
a[e],c=b.length,j;f&&a.getRadii(k,m,h.minSize,h.maxSize);if(o>0)for(;c--;)j=a.radii[c],d=Math.min((b[c]-i)*p-j,d),g=Math.max((b[c]-i)*p+j,g)}),q.length&&o>0&&r(this.options.min,this.userMin)===C&&r(this.options.max,this.userMax)===C&&(g-=b,p*=(b+d-g)/b,this.min+=d/p,this.max+=g/p))};var y=z.prototype,m=j.Pointer.prototype;y.toXY=function(a){var b,c=this.chart;b=a.plotX;var d=a.plotY;a.rectPlotX=b;a.rectPlotY=d;a.clientX=(b/Math.PI*180+this.xAxis.pane.options.startAngle)%360;b=this.xAxis.postTranslate(a.plotX, |
|||
this.yAxis.len-d);a.plotX=a.polarPlotX=b.x-c.plotLeft;a.plotY=a.polarPlotY=b.y-c.plotTop};y.orderTooltipPoints=function(a){if(this.chart.polar&&(a.sort(function(a,c){return a.clientX-c.clientX}),a[0]))a[0].wrappedClientX=a[0].clientX+360,a.push(a[0])};o(h.area.prototype,"init",K);o(h.areaspline.prototype,"init",K);o(h.spline.prototype,"getPointSpline",function(a,b,c,d){var g,f,e,i,h,j,k;if(this.chart.polar){g=c.plotX;f=c.plotY;a=b[d-1];e=b[d+1];this.connectEnds&&(a||(a=b[b.length-2]),e||(e=b[1])); |
|||
if(a&&e)i=a.plotX,h=a.plotY,b=e.plotX,j=e.plotY,i=(1.5*g+i)/2.5,h=(1.5*f+h)/2.5,e=(1.5*g+b)/2.5,k=(1.5*f+j)/2.5,b=Math.sqrt(Math.pow(i-g,2)+Math.pow(h-f,2)),j=Math.sqrt(Math.pow(e-g,2)+Math.pow(k-f,2)),i=Math.atan2(h-f,i-g),h=Math.atan2(k-f,e-g),k=Math.PI/2+(i+h)/2,Math.abs(i-k)>Math.PI/2&&(k-=Math.PI),i=g+Math.cos(k)*b,h=f+Math.sin(k)*b,e=g+Math.cos(Math.PI+k)*j,k=f+Math.sin(Math.PI+k)*j,c.rightContX=e,c.rightContY=k;d?(c=["C",a.rightContX||a.plotX,a.rightContY||a.plotY,i||g,h||f,g,f],a.rightContX= |
|||
a.rightContY=null):c=["M",g,f]}else c=a.call(this,b,c,d);return c});o(y,"translate",function(a){a.call(this);if(this.chart.polar&&!this.preventPostTranslate)for(var a=this.points,b=a.length;b--;)this.toXY(a[b])});o(y,"getSegmentPath",function(a,b){var c=this.points;if(this.chart.polar&&this.options.connectEnds!==!1&&b[b.length-1]===c[c.length-1]&&c[0].y!==null)this.connectEnds=!0,b=[].concat(b,[c[0]]);return a.call(this,b)});o(y,"animate",L);o(q,"animate",L);o(y,"setTooltipPoints",function(a,b){this.chart.polar&& |
|||
F(this.xAxis,{tooltipLen:360});return a.call(this,b)});o(q,"translate",function(a){var b=this.xAxis,c=this.yAxis.len,d=b.center,g=b.startAngleRad,f=this.chart.renderer,e,h;this.preventPostTranslate=!0;a.call(this);if(b.isRadial){b=this.points;for(h=b.length;h--;)e=b[h],a=e.barX+g,e.shapeType="path",e.shapeArgs={d:f.symbols.arc(d[0],d[1],c-e.plotY,null,{start:a,end:a+e.pointWidth,innerR:c-r(e.yBottom,c)})},this.toXY(e)}});o(q,"alignDataLabel",function(a,b,c,d,g,f){if(this.chart.polar){a=b.rectPlotX/ |
|||
Math.PI*180;if(d.align===null)d.align=a>20&&a<160?"left":a>200&&a<340?"right":"center";if(d.verticalAlign===null)d.verticalAlign=a<45||a>315?"bottom":a>135&&a<225?"top":"middle";y.alignDataLabel.call(this,b,c,d,g,f)}else a.call(this,b,c,d,g,f)});o(m,"getIndex",function(a,b){var c,d=this.chart,g;d.polar?(g=d.xAxis[0].center,c=b.chartX-g[0]-d.plotLeft,d=b.chartY-g[1]-d.plotTop,c=180-Math.round(Math.atan2(c,d)/Math.PI*180)):c=a.call(this,b);return c});o(m,"getCoordinates",function(a,b){var c=this.chart, |
|||
d={xAxis:[],yAxis:[]};c.polar?s(c.axes,function(a){var f=a.isXAxis,e=a.center,h=b.chartX-e[0]-c.plotLeft,e=b.chartY-e[1]-c.plotTop;d[f?"xAxis":"yAxis"].push({axis:a,value:a.translate(f?Math.PI-Math.atan2(h,e):Math.sqrt(Math.pow(h,2)+Math.pow(e,2)),!0)})}):d=a.call(this,b);return d})})(Highcharts); |
|||
@ -0,0 +1,283 @@ |
|||
/* |
|||
Highcharts JS v3.0.6 (2013-10-04) |
|||
|
|||
(c) 2009-2013 Torstein Hønsi |
|||
|
|||
License: www.highcharts.com/license |
|||
*/ |
|||
(function(){function r(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}function x(){var a,b=arguments.length,c={},d=function(a,b){var c,h;typeof a!=="object"&&(a={});for(h in b)b.hasOwnProperty(h)&&(c=b[h],a[h]=c&&typeof c==="object"&&Object.prototype.toString.call(c)!=="[object Array]"&&typeof c.nodeType!=="number"?d(a[h]||{},c):b[h]);return a};for(a=0;a<b;a++)c=d(c,arguments[a]);return c}function C(a,b){return parseInt(a,b||10)}function ea(a){return typeof a==="string"}function T(a){return typeof a=== |
|||
"object"}function Ia(a){return Object.prototype.toString.call(a)==="[object Array]"}function sa(a){return typeof a==="number"}function na(a){return R.log(a)/R.LN10}function fa(a){return R.pow(10,a)}function ga(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function u(a){return a!==w&&a!==null}function v(a,b,c){var d,e;if(ea(b))u(c)?a.setAttribute(b,c):a&&a.getAttribute&&(e=a.getAttribute(b));else if(u(b)&&T(b))for(d in b)a.setAttribute(d,b[d]);return e}function ja(a){return Ia(a)? |
|||
a:[a]}function o(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++)if(c=a[b],typeof c!=="undefined"&&c!==null)return c}function K(a,b){if(ta&&b&&b.opacity!==w)b.filter="alpha(opacity="+b.opacity*100+")";r(a.style,b)}function U(a,b,c,d,e){a=y.createElement(a);b&&r(a,b);e&&K(a,{padding:0,border:S,margin:0});c&&K(a,c);d&&d.appendChild(a);return a}function ha(a,b){var c=function(){};c.prototype=new a;r(c.prototype,b);return c}function Aa(a,b,c,d){var e=M.lang,a=+a||0,f=b===-1?(a.toString().split(".")[1]|| |
|||
"").length:isNaN(b=N(b))?2:b,b=c===void 0?e.decimalPoint:c,d=d===void 0?e.thousandsSep:d,e=a<0?"-":"",c=String(C(a=N(a).toFixed(f))),g=c.length>3?c.length%3:0;return e+(g?c.substr(0,g)+d:"")+c.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d)+(f?b+N(a-c).toFixed(f).slice(2):"")}function Ba(a,b){return Array((b||2)+1-String(a).length).join(0)+a}function mb(a,b,c){var d=a[b];a[b]=function(){var a=Array.prototype.slice.call(arguments);a.unshift(d);return c.apply(this,a)}}function Ca(a,b){for(var c="{",d=!1, |
|||
e,f,g,h,i,j=[];(c=a.indexOf(c))!==-1;){e=a.slice(0,c);if(d){f=e.split(":");g=f.shift().split(".");i=g.length;e=b;for(h=0;h<i;h++)e=e[g[h]];if(f.length)f=f.join(":"),g=/\.([0-9])/,h=M.lang,i=void 0,/f$/.test(f)?(i=(i=f.match(g))?i[1]:-1,e=Aa(e,i,h.decimalPoint,f.indexOf(",")>-1?h.thousandsSep:"")):e=Xa(f,e)}j.push(e);a=a.slice(c+1);c=(d=!d)?"}":"{"}j.push(a);return j.join("")}function nb(a){return R.pow(10,P(R.log(a)/R.LN10))}function ob(a,b,c,d){var e,c=o(c,1);e=a/c;b||(b=[1,2,2.5,5,10],d&&d.allowDecimals=== |
|||
!1&&(c===1?b=[1,2,5,10]:c<=0.1&&(b=[1/c])));for(d=0;d<b.length;d++)if(a=b[d],e<=(b[d]+(b[d+1]||b[d]))/2)break;a*=c;return a}function Cb(a,b){var c=b||[[Db,[1,2,5,10,20,25,50,100,200,500]],[pb,[1,2,5,10,15,30]],[Ya,[1,2,5,10,15,30]],[Qa,[1,2,3,4,6,8,12]],[ua,[1,2]],[Za,[1,2]],[Ra,[1,2,3,4,6]],[Da,null]],d=c[c.length-1],e=D[d[0]],f=d[1],g;for(g=0;g<c.length;g++)if(d=c[g],e=D[d[0]],f=d[1],c[g+1]&&a<=(e*f[f.length-1]+D[c[g+1][0]])/2)break;e===D[Da]&&a<5*e&&(f=[1,2,5]);c=ob(a/e,f,d[0]===Da?nb(a/e):1); |
|||
return{unitRange:e,count:c,unitName:d[0]}}function Eb(a,b,c,d){var e=[],f={},g=M.global.useUTC,h,i=new Date(b),j=a.unitRange,k=a.count;if(u(b)){j>=D[pb]&&(i.setMilliseconds(0),i.setSeconds(j>=D[Ya]?0:k*P(i.getSeconds()/k)));if(j>=D[Ya])i[Fb](j>=D[Qa]?0:k*P(i[qb]()/k));if(j>=D[Qa])i[Gb](j>=D[ua]?0:k*P(i[rb]()/k));if(j>=D[ua])i[sb](j>=D[Ra]?1:k*P(i[Sa]()/k));j>=D[Ra]&&(i[Hb](j>=D[Da]?0:k*P(i[$a]()/k)),h=i[ab]());j>=D[Da]&&(h-=h%k,i[Ib](h));if(j===D[Za])i[sb](i[Sa]()-i[tb]()+o(d,1));b=1;h=i[ab]();for(var d= |
|||
i.getTime(),l=i[$a](),m=i[Sa](),p=g?0:(864E5+i.getTimezoneOffset()*6E4)%864E5;d<c;)e.push(d),j===D[Da]?d=bb(h+b*k,0):j===D[Ra]?d=bb(h,l+b*k):!g&&(j===D[ua]||j===D[Za])?d=bb(h,l,m+b*k*(j===D[ua]?1:7)):d+=j*k,b++;e.push(d);n(ub(e,function(a){return j<=D[Qa]&&a%D[ua]===p}),function(a){f[a]=ua})}e.info=r(a,{higherRanks:f,totalRange:j*k});return e}function Jb(){this.symbol=this.color=0}function Kb(a,b){var c=a.length,d,e;for(e=0;e<c;e++)a[e].ss_i=e;a.sort(function(a,c){d=b(a,c);return d===0?a.ss_i-c.ss_i: |
|||
d});for(e=0;e<c;e++)delete a[e].ss_i}function Ja(a){for(var b=a.length,c=a[0];b--;)a[b]<c&&(c=a[b]);return c}function va(a){for(var b=a.length,c=a[0];b--;)a[b]>c&&(c=a[b]);return c}function Ka(a,b){for(var c in a)a[c]&&a[c]!==b&&a[c].destroy&&a[c].destroy(),delete a[c]}function Ta(a){cb||(cb=U(Ea));a&&cb.appendChild(a);cb.innerHTML=""}function ka(a,b){var c="Highcharts error #"+a+": www.highcharts.com/errors/"+a;if(b)throw c;else O.console&&console.log(c)}function ia(a){return parseFloat(a.toPrecision(14))} |
|||
function La(a,b){Fa=o(a,b.animation)}function Lb(){var a=M.global.useUTC,b=a?"getUTC":"get",c=a?"setUTC":"set";bb=a?Date.UTC:function(a,b,c,g,h,i){return(new Date(a,b,o(c,1),o(g,0),o(h,0),o(i,0))).getTime()};qb=b+"Minutes";rb=b+"Hours";tb=b+"Day";Sa=b+"Date";$a=b+"Month";ab=b+"FullYear";Fb=c+"Minutes";Gb=c+"Hours";sb=c+"Date";Hb=c+"Month";Ib=c+"FullYear"}function wa(){}function Ma(a,b,c,d){this.axis=a;this.pos=b;this.type=c||"";this.isNew=!0;!c&&!d&&this.addLabel()}function vb(a,b){this.axis=a;if(b)this.options= |
|||
b,this.id=b.id}function Mb(a,b,c,d,e,f){var g=a.chart.inverted;this.axis=a;this.isNegative=c;this.options=b;this.x=d;this.total=null;this.points={};this.stack=e;this.percent=f==="percent";this.alignOptions={align:b.align||(g?c?"left":"right":"center"),verticalAlign:b.verticalAlign||(g?"middle":c?"bottom":"top"),y:o(b.y,g?4:c?14:-6),x:o(b.x,g?c?-6:6:0)};this.textAlign=b.textAlign||(g?c?"right":"left":"center")}function db(){this.init.apply(this,arguments)}function wb(){this.init.apply(this,arguments)} |
|||
function xb(a,b){this.init(a,b)}function eb(a,b){this.init(a,b)}function yb(){this.init.apply(this,arguments)}var w,y=document,O=window,R=Math,t=R.round,P=R.floor,xa=R.ceil,s=R.max,I=R.min,N=R.abs,V=R.cos,ca=R.sin,ya=R.PI,Ua=ya*2/360,oa=navigator.userAgent,Nb=O.opera,ta=/msie/i.test(oa)&&!Nb,fb=y.documentMode===8,gb=/AppleWebKit/.test(oa),hb=/Firefox/.test(oa),Ob=/(Mobile|Android|Windows Phone)/.test(oa),za="http://www.w3.org/2000/svg",Z=!!y.createElementNS&&!!y.createElementNS(za,"svg").createSVGRect, |
|||
Ub=hb&&parseInt(oa.split("Firefox/")[1],10)<4,$=!Z&&!ta&&!!y.createElement("canvas").getContext,Va,ib=y.documentElement.ontouchstart!==w,Pb={},zb=0,cb,M,Xa,Fa,Ab,D,pa=function(){},Ga=[],Ea="div",S="none",Qb="rgba(192,192,192,"+(Z?1.0E-4:0.002)+")",Db="millisecond",pb="second",Ya="minute",Qa="hour",ua="day",Za="week",Ra="month",Da="year",Rb="stroke-width",bb,qb,rb,tb,Sa,$a,ab,Fb,Gb,sb,Hb,Ib,W={};O.Highcharts=O.Highcharts?ka(16,!0):{};Xa=function(a,b,c){if(!u(b)||isNaN(b))return"Invalid date";var a= |
|||
o(a,"%Y-%m-%d %H:%M:%S"),d=new Date(b),e,f=d[rb](),g=d[tb](),h=d[Sa](),i=d[$a](),j=d[ab](),k=M.lang,l=k.weekdays,d=r({a:l[g].substr(0,3),A:l[g],d:Ba(h),e:h,b:k.shortMonths[i],B:k.months[i],m:Ba(i+1),y:j.toString().substr(2,2),Y:j,H:Ba(f),I:Ba(f%12||12),l:f%12||12,M:Ba(d[qb]()),p:f<12?"AM":"PM",P:f<12?"am":"pm",S:Ba(d.getSeconds()),L:Ba(t(b%1E3),3)},Highcharts.dateFormats);for(e in d)for(;a.indexOf("%"+e)!==-1;)a=a.replace("%"+e,typeof d[e]==="function"?d[e](b):d[e]);return c?a.substr(0,1).toUpperCase()+ |
|||
a.substr(1):a};Jb.prototype={wrapColor:function(a){if(this.color>=a)this.color=0},wrapSymbol:function(a){if(this.symbol>=a)this.symbol=0}};D=function(){for(var a=0,b=arguments,c=b.length,d={};a<c;a++)d[b[a++]]=b[a];return d}(Db,1,pb,1E3,Ya,6E4,Qa,36E5,ua,864E5,Za,6048E5,Ra,26784E5,Da,31556952E3);Ab={init:function(a,b,c){var b=b||"",d=a.shift,e=b.indexOf("C")>-1,f=e?7:3,g,b=b.split(" "),c=[].concat(c),h,i,j=function(a){for(g=a.length;g--;)a[g]==="M"&&a.splice(g+1,0,a[g+1],a[g+2],a[g+1],a[g+2])};e&& |
|||
(j(b),j(c));a.isArea&&(h=b.splice(b.length-6,6),i=c.splice(c.length-6,6));if(d<=c.length/f&&b.length===c.length)for(;d--;)c=[].concat(c).splice(0,f).concat(c);a.shift=0;if(b.length)for(a=c.length;b.length<a;)d=[].concat(b).splice(b.length-f,f),e&&(d[f-6]=d[f-2],d[f-5]=d[f-1]),b=b.concat(d);h&&(b=b.concat(h),c=c.concat(i));return[b,c]},step:function(a,b,c,d){var e=[],f=a.length;if(c===1)e=d;else if(f===b.length&&c<1)for(;f--;)d=parseFloat(a[f]),e[f]=isNaN(d)?a[f]:c*parseFloat(b[f]-d)+d;else e=b;return e}}; |
|||
(function(a){O.HighchartsAdapter=O.HighchartsAdapter||a&&{init:function(b){var c=a.fx,d=c.step,e,f=a.Tween,g=f&&f.propHooks;e=a.cssHooks.opacity;a.extend(a.easing,{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}});a.each(["cur","_default","width","height","opacity"],function(a,b){var e=d,k,l;b==="cur"?e=c.prototype:b==="_default"&&f&&(e=g[b],b="set");(k=e[b])&&(e[b]=function(c){c=a?c:this;if(c.prop!=="align")return l=c.elem,l.attr?l.attr(c.prop,b==="cur"?w:c.now):k.apply(this,arguments)})}); |
|||
mb(e,"get",function(a,b,c){return b.attr?b.opacity||0:a.call(this,b,c)});e=function(a){var c=a.elem,d;if(!a.started)d=b.init(c,c.d,c.toD),a.start=d[0],a.end=d[1],a.started=!0;c.attr("d",b.step(a.start,a.end,a.pos,c.toD))};f?g.d={set:e}:d.d=e;this.each=Array.prototype.forEach?function(a,b){return Array.prototype.forEach.call(a,b)}:function(a,b){for(var c=0,d=a.length;c<d;c++)if(b.call(a[c],a[c],c,a)===!1)return c};a.fn.highcharts=function(){var a="Chart",b=arguments,c,d;ea(b[0])&&(a=b[0],b=Array.prototype.slice.call(b, |
|||
1));c=b[0];if(c!==w)c.chart=c.chart||{},c.chart.renderTo=this[0],new Highcharts[a](c,b[1]),d=this;c===w&&(d=Ga[v(this[0],"data-highcharts-chart")]);return d}},getScript:a.getScript,inArray:a.inArray,adapterRun:function(b,c){return a(b)[c]()},grep:a.grep,map:function(a,c){for(var d=[],e=0,f=a.length;e<f;e++)d[e]=c.call(a[e],a[e],e,a);return d},offset:function(b){return a(b).offset()},addEvent:function(b,c,d){a(b).bind(c,d)},removeEvent:function(b,c,d){var e=y.removeEventListener?"removeEventListener": |
|||
"detachEvent";y[e]&&b&&!b[e]&&(b[e]=function(){});a(b).unbind(c,d)},fireEvent:function(b,c,d,e){var f=a.Event(c),g="detached"+c,h;!ta&&d&&(delete d.layerX,delete d.layerY);r(f,d);b[c]&&(b[g]=b[c],b[c]=null);a.each(["preventDefault","stopPropagation"],function(a,b){var c=f[b];f[b]=function(){try{c.call(f)}catch(a){b==="preventDefault"&&(h=!0)}}});a(b).trigger(f);b[g]&&(b[c]=b[g],b[g]=null);e&&!f.isDefaultPrevented()&&!h&&e(f)},washMouseEvent:function(a){var c=a.originalEvent||a;if(c.pageX===w)c.pageX= |
|||
a.pageX,c.pageY=a.pageY;return c},animate:function(b,c,d){var e=a(b);if(!b.style)b.style={};if(c.d)b.toD=c.d,c.d=1;e.stop();c.opacity!==w&&b.attr&&(c.opacity+="px");e.animate(c,d)},stop:function(b){a(b).stop()}}})(O.jQuery);var X=O.HighchartsAdapter,G=X||{};X&&X.init.call(X,Ab);var jb=G.adapterRun,Vb=G.getScript,qa=G.inArray,n=G.each,ub=G.grep,Wb=G.offset,Na=G.map,J=G.addEvent,aa=G.removeEvent,z=G.fireEvent,Xb=G.washMouseEvent,Bb=G.animate,Wa=G.stop,G={enabled:!0,x:0,y:15,style:{color:"#666",cursor:"default", |
|||
fontSize:"11px",lineHeight:"14px"}};M={colors:"#2f7ed8,#0d233a,#8bbc21,#910000,#1aadce,#492970,#f28f43,#77a1e5,#c42525,#a6c96a".split(","),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),shortMonths:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),decimalPoint:".", |
|||
numericSymbols:"k,M,G,T,P,E".split(","),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:!0,canvasToolsURL:"http://code.highcharts.com/3.0.6/modules/canvas-tools.js",VMLRadialGradientURL:"http://code.highcharts.com/3.0.6/gfx/vml-radial-gradient.png"},chart:{borderColor:"#4572A7",borderRadius:5,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],style:{fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif', |
|||
fontSize:"12px"},backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0",resetZoomButton:{theme:{zIndex:20},position:{align:"right",x:-10,y:10}}},title:{text:"Chart title",align:"center",margin:15,style:{color:"#274b6d",fontSize:"16px"}},subtitle:{text:"",align:"center",style:{color:"#4d759e"}},plotOptions:{line:{allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},lineWidth:2,marker:{enabled:!0,lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{enabled:!0},select:{fillColor:"#FFFFFF", |
|||
lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:x(G,{align:"center",enabled:!1,formatter:function(){return this.y===null?"":Aa(this.y,-1)},verticalAlign:"bottom",y:0}),cropThreshold:300,pointRange:0,showInLegend:!0,states:{hover:{marker:{}},select:{marker:{}}},stickyTracking:!0}},labels:{style:{position:"absolute",color:"#3E576F"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderWidth:1,borderColor:"#909090",borderRadius:5,navigation:{activeColor:"#274b6d", |
|||
inactiveColor:"#CCC"},shadow:!1,itemStyle:{cursor:"pointer",color:"#274b6d",fontSize:"12px"},itemHoverStyle:{color:"#000"},itemHiddenStyle:{color:"#CCC"},itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},symbolWidth:16,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"1em"},style:{position:"absolute",backgroundColor:"white",opacity:0.5,textAlign:"center"}},tooltip:{enabled:!0,animation:Z, |
|||
backgroundColor:"rgba(255, 255, 255, .85)",borderWidth:1,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b><br/>',shadow:!0,snap:Ob?25:10,style:{color:"#333333",cursor:"default", |
|||
fontSize:"12px",padding:"8px",whiteSpace:"nowrap"}},credits:{enabled:!0,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"9px"}}};var Y=M.plotOptions,X=Y.line;Lb();var ra=function(a){var b=[],c,d;(function(a){a&&a.stops?d=Na(a.stops,function(a){return ra(a[1])}):(c=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/.exec(a))?b=[C(c[1]),C(c[2]), |
|||
C(c[3]),parseFloat(c[4],10)]:(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(a))?b=[C(c[1],16),C(c[2],16),C(c[3],16),1]:(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a))&&(b=[C(c[1]),C(c[2]),C(c[3]),1])})(a);return{get:function(c){var f;d?(f=x(a),f.stops=[].concat(f.stops),n(d,function(a,b){f.stops[b]=[f.stops[b][0],a.get(c)]})):f=b&&!isNaN(b[0])?c==="rgb"?"rgb("+b[0]+","+b[1]+","+b[2]+")":c==="a"?b[3]:"rgba("+b.join(",")+")":a;return f},brighten:function(a){if(d)n(d, |
|||
function(b){b.brighten(a)});else if(sa(a)&&a!==0){var c;for(c=0;c<3;c++)b[c]+=C(a*255),b[c]<0&&(b[c]=0),b[c]>255&&(b[c]=255)}return this},rgba:b,setOpacity:function(a){b[3]=a;return this}}};wa.prototype={init:function(a,b){this.element=b==="span"?U(b):y.createElementNS(za,b);this.renderer=a;this.attrSetters={}},opacity:1,animate:function(a,b,c){b=o(b,Fa,!0);Wa(this);if(b){b=x(b);if(c)b.complete=c;Bb(this,a,b)}else this.attr(a),c&&c()},attr:function(a,b){var c,d,e,f,g=this.element,h=g.nodeName.toLowerCase(), |
|||
i=this.renderer,j,k=this.attrSetters,l=this.shadows,m,p,q=this;ea(a)&&u(b)&&(c=a,a={},a[c]=b);if(ea(a))c=a,h==="circle"?c={x:"cx",y:"cy"}[c]||c:c==="strokeWidth"&&(c="stroke-width"),q=v(g,c)||this[c]||0,c!=="d"&&c!=="visibility"&&c!=="fill"&&(q=parseFloat(q));else{for(c in a)if(j=!1,d=a[c],e=k[c]&&k[c].call(this,d,c),e!==!1){e!==w&&(d=e);if(c==="d")d&&d.join&&(d=d.join(" ")),/(NaN| {2}|^$)/.test(d)&&(d="M 0 0");else if(c==="x"&&h==="text")for(e=0;e<g.childNodes.length;e++)f=g.childNodes[e],v(f,"x")=== |
|||
v(g,"x")&&v(f,"x",d);else if(this.rotation&&(c==="x"||c==="y"))p=!0;else if(c==="fill")d=i.color(d,g,c);else if(h==="circle"&&(c==="x"||c==="y"))c={x:"cx",y:"cy"}[c]||c;else if(h==="rect"&&c==="r")v(g,{rx:d,ry:d}),j=!0;else if(c==="translateX"||c==="translateY"||c==="rotation"||c==="verticalAlign"||c==="scaleX"||c==="scaleY")j=p=!0;else if(c==="stroke")d=i.color(d,g,c);else if(c==="dashstyle")if(c="stroke-dasharray",d=d&&d.toLowerCase(),d==="solid")d=S;else{if(d){d=d.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot", |
|||
"3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(e=d.length;e--;)d[e]=C(d[e])*o(a["stroke-width"],this["stroke-width"]);d=d.join(",")}}else if(c==="width")d=C(d);else if(c==="align")c="text-anchor",d={left:"start",center:"middle",right:"end"}[d];else if(c==="title")e=g.getElementsByTagName("title")[0],e||(e=y.createElementNS(za,"title"),g.appendChild(e)),e.textContent=d;c==="strokeWidth"&& |
|||
(c="stroke-width");if(c==="stroke-width"||c==="stroke"){this[c]=d;if(this.stroke&&this["stroke-width"])v(g,"stroke",this.stroke),v(g,"stroke-width",this["stroke-width"]),this.hasStroke=!0;else if(c==="stroke-width"&&d===0&&this.hasStroke)g.removeAttribute("stroke"),this.hasStroke=!1;j=!0}this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(c)&&(m||(this.symbolAttr(a),m=!0),j=!0);if(l&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(c))for(e=l.length;e--;)v(l[e], |
|||
c,c==="height"?s(d-(l[e].cutHeight||0),0):d);if((c==="width"||c==="height")&&h==="rect"&&d<0)d=0;this[c]=d;c==="text"?(d!==this.textStr&&delete this.bBox,this.textStr=d,this.added&&i.buildText(this)):j||v(g,c,d)}p&&this.updateTransform()}return q},addClass:function(a){var b=this.element,c=v(b,"class")||"";c.indexOf(a)===-1&&v(b,"class",c+" "+a);return this},symbolAttr:function(a){var b=this;n("x,y,r,start,end,width,height,innerR,anchorX,anchorY".split(","),function(c){b[c]=o(a[c],b[c])});b.attr({d:b.renderer.symbols[b.symbolName](b.x, |
|||
b.y,b.width,b.height,b)})},clip:function(a){return this.attr("clip-path",a?"url("+this.renderer.url+"#"+a.id+")":S)},crisp:function(a,b,c,d,e){var f,g={},h={},i,a=a||this.strokeWidth||this.attr&&this.attr("stroke-width")||0;i=t(a)%2/2;h.x=P(b||this.x||0)+i;h.y=P(c||this.y||0)+i;h.width=P((d||this.width||0)-2*i);h.height=P((e||this.height||0)-2*i);h.strokeWidth=a;for(f in h)this[f]!==h[f]&&(this[f]=g[f]=h[f]);return g},css:function(a){var b=this.element,c=a&&a.width&&b.nodeName.toLowerCase()==="text", |
|||
d,e="",f=function(a,b){return"-"+b.toLowerCase()};if(a&&a.color)a.fill=a.color;this.styles=a=r(this.styles,a);$&&c&&delete a.width;if(ta&&!Z)c&&delete a.width,K(this.element,a);else{for(d in a)e+=d.replace(/([A-Z])/g,f)+":"+a[d]+";";v(b,"style",e)}c&&this.added&&this.renderer.buildText(this);return this},on:function(a,b){var c=this,d=c.element;ib&&a==="click"?(d.ontouchstart=function(a){c.touchEventFired=Date.now();a.preventDefault();b.call(d,a)},d.onclick=function(a){(oa.indexOf("Android")===-1|| |
|||
Date.now()-(c.touchEventFired||0)>1100)&&b.call(d,a)}):d["on"+a]=b;return this},setRadialReference:function(a){this.element.radialReference=a;return this},translate:function(a,b){return this.attr({translateX:a,translateY:b})},invert:function(){this.inverted=!0;this.updateTransform();return this},htmlCss:function(a){var b=this.element;if(b=a&&b.tagName==="SPAN"&&a.width)delete a.width,this.textWidth=b,this.updateTransform();this.styles=r(this.styles,a);K(this.element,a);return this},htmlGetBBox:function(){var a= |
|||
this.element,b=this.bBox;if(!b){if(a.nodeName==="text")a.style.position="absolute";b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}}return b},htmlUpdateTransform:function(){if(this.added){var a=this.renderer,b=this.element,c=this.translateX||0,d=this.translateY||0,e=this.x||0,f=this.y||0,g=this.textAlign||"left",h={left:0,center:0.5,right:1}[g],i=g&&g!=="left",j=this.shadows;K(b,{marginLeft:c,marginTop:d});j&&n(j,function(a){K(a,{marginLeft:c+1,marginTop:d+1})}); |
|||
this.inverted&&n(b.childNodes,function(c){a.invertChild(c,b)});if(b.tagName==="SPAN"){var k,l,j=this.rotation,m;k=0;var p=1,q=0,ba;m=C(this.textWidth);var A=this.xCorr||0,L=this.yCorr||0,Sb=[j,g,b.innerHTML,this.textWidth].join(",");if(Sb!==this.cTT){u(j)&&(k=j*Ua,p=V(k),q=ca(k),this.setSpanRotation(j,q,p));k=o(this.elemWidth,b.offsetWidth);l=o(this.elemHeight,b.offsetHeight);if(k>m&&/[ \-]/.test(b.textContent||b.innerText))K(b,{width:m+"px",display:"block",whiteSpace:"normal"}),k=m;m=a.fontMetrics(b.style.fontSize).b; |
|||
A=p<0&&-k;L=q<0&&-l;ba=p*q<0;A+=q*m*(ba?1-h:h);L-=p*m*(j?ba?h:1-h:1);i&&(A-=k*h*(p<0?-1:1),j&&(L-=l*h*(q<0?-1:1)),K(b,{textAlign:g}));this.xCorr=A;this.yCorr=L}K(b,{left:e+A+"px",top:f+L+"px"});if(gb)l=b.offsetHeight;this.cTT=Sb}}else this.alignOnAdd=!0},setSpanRotation:function(a){var b={};b[ta?"-ms-transform":gb?"-webkit-transform":hb?"MozTransform":Nb?"-o-transform":""]=b.transform="rotate("+a+"deg)";K(this.element,b)},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c= |
|||
this.scaleX,d=this.scaleY,e=this.inverted,f=this.rotation;e&&(a+=this.attr("width"),b+=this.attr("height"));a=["translate("+a+","+b+")"];e?a.push("rotate(90) scale(-1,1)"):f&&a.push("rotate("+f+" "+(this.x||0)+" "+(this.y||0)+")");(u(c)||u(d))&&a.push("scale("+o(c,1)+" "+o(d,1)+")");a.length&&v(this.element,"transform",a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){var d,e,f,g,h={};e=this.renderer;f=e.alignedObjects;if(a){if(this.alignOptions= |
|||
a,this.alignByTranslate=b,!c||ea(c))this.alignTo=d=c||"renderer",ga(f,this),f.push(this),c=null}else a=this.alignOptions,b=this.alignByTranslate,d=this.alignTo;c=o(c,e[d],e);d=a.align;e=a.verticalAlign;f=(c.x||0)+(a.x||0);g=(c.y||0)+(a.y||0);if(d==="right"||d==="center")f+=(c.width-(a.width||0))/{right:1,center:2}[d];h[b?"translateX":"x"]=t(f);if(e==="bottom"||e==="middle")g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]||1);h[b?"translateY":"y"]=t(g);this[this.placed?"animate":"attr"](h);this.placed= |
|||
!0;this.alignAttr=h;return this},getBBox:function(){var a=this.bBox,b=this.renderer,c,d=this.rotation;c=this.element;var e=this.styles,f=d*Ua;if(!a){if(c.namespaceURI===za||b.forExport){try{a=c.getBBox?r({},c.getBBox()):{width:c.offsetWidth,height:c.offsetHeight}}catch(g){}if(!a||a.width<0)a={width:0,height:0}}else a=this.htmlGetBBox();if(b.isSVG){b=a.width;c=a.height;if(ta&&e&&e.fontSize==="11px"&&c.toPrecision(3)==="22.7")a.height=c=14;if(d)a.width=N(c*ca(f))+N(b*V(f)),a.height=N(c*V(f))+N(b*ca(f))}this.bBox= |
|||
a}return a},show:function(){return this.attr({visibility:"visible"})},hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(a){var b=this;b.animate({opacity:0},{duration:a||150,complete:function(){b.hide()}})},add:function(a){var b=this.renderer,c=a||b,d=c.element||b.box,e=d.childNodes,f=this.element,g=v(f,"zIndex"),h;if(a)this.parentGroup=a;this.parentInverted=a&&a.inverted;this.textStr!==void 0&&b.buildText(this);if(g)c.handleZ=!0,g=C(g);if(c.handleZ)for(c=0;c<e.length;c++)if(a= |
|||
e[c],b=v(a,"zIndex"),a!==f&&(C(b)>g||!u(g)&&u(b))){d.insertBefore(f,a);h=!0;break}h||d.appendChild(f);this.added=!0;z(this,"add");return this},safeRemoveChild:function(a){var b=a.parentNode;b&&b.removeChild(a)},destroy:function(){var a=this,b=a.element||{},c=a.shadows,d=a.renderer.isSVG&&b.nodeName==="SPAN"&&b.parentNode,e,f;b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=b.point=null;Wa(a);if(a.clipPath)a.clipPath=a.clipPath.destroy();if(a.stops){for(f=0;f<a.stops.length;f++)a.stops[f]=a.stops[f].destroy(); |
|||
a.stops=null}a.safeRemoveChild(b);for(c&&n(c,function(b){a.safeRemoveChild(b)});d&&d.childNodes.length===0;)b=d.parentNode,a.safeRemoveChild(d),d=b;a.alignTo&&ga(a.renderer.alignedObjects,a);for(e in a)delete a[e];return null},shadow:function(a,b,c){var d=[],e,f,g=this.element,h,i,j,k;if(a){i=o(a.width,3);j=(a.opacity||0.15)/i;k=this.parentInverted?"(-1,-1)":"("+o(a.offsetX,1)+", "+o(a.offsetY,1)+")";for(e=1;e<=i;e++){f=g.cloneNode(0);h=i*2+1-2*e;v(f,{isShadow:"true",stroke:a.color||"black","stroke-opacity":j* |
|||
e,"stroke-width":h,transform:"translate"+k,fill:S});if(c)v(f,"height",s(v(f,"height")-h,0)),f.cutHeight=h;b?b.element.appendChild(f):g.parentNode.insertBefore(f,g);d.push(f)}this.shadows=d}return this}};var Ha=function(){this.init.apply(this,arguments)};Ha.prototype={Element:wa,init:function(a,b,c,d){var e=location,f,g;f=this.createElement("svg").attr({version:"1.1"});g=f.element;a.appendChild(g);a.innerHTML.indexOf("xmlns")===-1&&v(g,"xmlns",za);this.isSVG=!0;this.box=g;this.boxWrapper=f;this.alignedObjects= |
|||
[];this.url=(hb||gb)&&y.getElementsByTagName("base").length?e.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(y.createTextNode("Created with Highcharts 3.0.6"));this.defs=this.createElement("defs").add();this.forExport=d;this.gradients={};this.setSize(b,c,!1);var h;if(hb&&a.getBoundingClientRect)this.subPixelFix=b=function(){K(a,{left:0,top:0});h=a.getBoundingClientRect();K(a,{left:xa(h.left)-h.left+"px",top:xa(h.top)- |
|||
h.top+"px"})},b(),J(O,"resize",b)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();Ka(this.gradients||{});this.gradients=null;if(a)this.defs=a.destroy();this.subPixelFix&&aa(O,"resize",this.subPixelFix);return this.alignedObjects=null},createElement:function(a){var b=new this.Element;b.init(this,a);return b},draw:function(){},buildText:function(a){for(var b=a.element,c=this,d=c.forExport,e=o(a.textStr, |
|||
"").toString().replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g),f=b.childNodes,g=/style="([^"]+)"/,h=/href="(http[^"]+)"/,i=v(b,"x"),j=a.styles,k=j&&j.width&&C(j.width),l=j&&j.lineHeight,m=f.length;m--;)b.removeChild(f[m]);k&&!a.added&&this.box.appendChild(b);e[e.length-1]===""&&e.pop();n(e,function(e,f){var m,o=0,e=e.replace(/<span/g,"|||<span").replace(/<\/span>/g, |
|||
"</span>|||");m=e.split("|||");n(m,function(e){if(e!==""||m.length===1){var p={},n=y.createElementNS(za,"tspan"),s;g.test(e)&&(s=e.match(g)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),v(n,"style",s));h.test(e)&&!d&&(v(n,"onclick",'location.href="'+e.match(h)[1]+'"'),K(n,{cursor:"pointer"}));e=(e.replace(/<(.|\n)*?>/g,"")||" ").replace(/</g,"<").replace(/>/g,">");if(e!==" "&&(n.appendChild(y.createTextNode(e)),o?p.dx=0:p.x=i,v(n,p),!o&&f&&(!Z&&d&&K(n,{display:"block"}),v(n,"dy",l||c.fontMetrics(/px$/.test(n.style.fontSize)? |
|||
n.style.fontSize:j.fontSize).h,gb&&n.offsetHeight)),b.appendChild(n),o++,k))for(var e=e.replace(/([^\^])-/g,"$1- ").split(" "),u,t,p=a._clipHeight,E=[],w=C(l||16),B=1;e.length||E.length;)delete a.bBox,u=a.getBBox(),t=u.width,u=t>k,!u||e.length===1?(e=E,E=[],e.length&&(B++,p&&B*w>p?(e=["..."],a.attr("title",a.textStr)):(n=y.createElementNS(za,"tspan"),v(n,{dy:w,x:i}),s&&v(n,"style",s),b.appendChild(n),t>k&&(k=t)))):(n.removeChild(n.firstChild),E.unshift(e.pop())),e.length&&n.appendChild(y.createTextNode(e.join(" ").replace(/- /g, |
|||
"-")))}})})},button:function(a,b,c,d,e,f,g,h){var i=this.label(a,b,c,null,null,null,null,null,"button"),j=0,k,l,m,p,q,n,a={x1:0,y1:0,x2:0,y2:1},e=x({"stroke-width":1,stroke:"#CCCCCC",fill:{linearGradient:a,stops:[[0,"#FEFEFE"],[1,"#F6F6F6"]]},r:2,padding:5,style:{color:"black"}},e);m=e.style;delete e.style;f=x(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#FFF"],[1,"#ACF"]]}},f);p=f.style;delete f.style;g=x(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#9BD"],[1,"#CDF"]]}},g);q=g.style; |
|||
delete g.style;h=x(e,{style:{color:"#CCC"}},h);n=h.style;delete h.style;J(i.element,ta?"mouseover":"mouseenter",function(){j!==3&&i.attr(f).css(p)});J(i.element,ta?"mouseout":"mouseleave",function(){j!==3&&(k=[e,f,g][j],l=[m,p,q][j],i.attr(k).css(l))});i.setState=function(a){(i.state=j=a)?a===2?i.attr(g).css(q):a===3&&i.attr(h).css(n):i.attr(e).css(m)};return i.on("click",function(){j!==3&&d.call(i)}).attr(e).css(r({cursor:"default"},m))},crispLine:function(a,b){a[1]===a[4]&&(a[1]=a[4]=t(a[1])-b% |
|||
2/2);a[2]===a[5]&&(a[2]=a[5]=t(a[2])+b%2/2);return a},path:function(a){var b={fill:S};Ia(a)?b.d=a:T(a)&&r(b,a);return this.createElement("path").attr(b)},circle:function(a,b,c){a=T(a)?a:{x:a,y:b,r:c};return this.createElement("circle").attr(a)},arc:function(a,b,c,d,e,f){if(T(a))b=a.y,c=a.r,d=a.innerR,e=a.start,f=a.end,a=a.x;a=this.symbol("arc",a||0,b||0,c||0,c||0,{innerR:d||0,start:e||0,end:f||0});a.r=c;return a},rect:function(a,b,c,d,e,f){e=T(a)?a.r:e;e=this.createElement("rect").attr({rx:e,ry:e, |
|||
fill:S});return e.attr(T(a)?a:e.crisp(f,a,b,s(c,0),s(d,0)))},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;this.width=a;this.height=b;for(this.boxWrapper[o(c,!0)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){var b=this.createElement("g");return u(a)?b.attr({"class":"highcharts-"+a}):b},image:function(a,b,c,d,e){var f={preserveAspectRatio:S};arguments.length>1&&r(f,{x:b,y:c,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink", |
|||
"href",a):f.element.setAttribute("hc-svg-href",a);return f},symbol:function(a,b,c,d,e,f){var g,h=this.symbols[a],h=h&&h(t(b),t(c),d,e,f),i=/^url\((.*?)\)$/,j,k;if(h)g=this.path(h),r(g,{symbolName:a,x:b,y:c,width:d,height:e}),f&&r(g,f);else if(i.test(a))k=function(a,b){a.element&&(a.attr({width:b[0],height:b[1]}),a.alignByTranslate||a.translate(t((d-b[0])/2),t((e-b[1])/2)))},j=a.match(i)[1],a=Pb[j],g=this.image(j).attr({x:b,y:c}),g.isImg=!0,a?k(g,a):(g.attr({width:0,height:0}),U("img",{onload:function(){k(g, |
|||
Pb[j]=[this.width,this.height])},src:j}));return g},symbols:{circle:function(a,b,c,d){var e=0.166*c;return["M",a+c/2,b,"C",a+c+e,b,a+c+e,b+d,a+c/2,b+d,"C",a-e,b+d,a-e,b,a+c/2,b,"Z"]},square:function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c,b+d,a,b+d,"Z"]},triangle:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d,a,b+d,"Z"]},"triangle-down":function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c/2,b+d,"Z"]},diamond:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d/2,a+c/2,b+d,a,b+d/2,"Z"]},arc:function(a,b,c,d, |
|||
e){var f=e.start,c=e.r||c||d,g=e.end-0.001,d=e.innerR,h=e.open,i=V(f),j=ca(f),k=V(g),g=ca(g),e=e.end-f<ya?0:1;return["M",a+c*i,b+c*j,"A",c,c,0,e,1,a+c*k,b+c*g,h?"M":"L",a+d*k,b+d*g,"A",d,d,0,e,0,a+d*i,b+d*j,h?"":"Z"]}},clipRect:function(a,b,c,d){var e="highcharts-"+zb++,f=this.createElement("clipPath").attr({id:e}).add(this.defs),a=this.rect(a,b,c,d,0).add(f);a.id=e;a.clipPath=f;return a},color:function(a,b,c){var d=this,e,f=/^rgba/,g,h,i,j,k,l,m,p=[];a&&a.linearGradient?g="linearGradient":a&&a.radialGradient&& |
|||
(g="radialGradient");if(g){c=a[g];h=d.gradients;j=a.stops;b=b.radialReference;Ia(c)&&(a[g]=c={x1:c[0],y1:c[1],x2:c[2],y2:c[3],gradientUnits:"userSpaceOnUse"});g==="radialGradient"&&b&&!u(c.gradientUnits)&&(c=x(c,{cx:b[0]-b[2]/2+c.cx*b[2],cy:b[1]-b[2]/2+c.cy*b[2],r:c.r*b[2],gradientUnits:"userSpaceOnUse"}));for(m in c)m!=="id"&&p.push(m,c[m]);for(m in j)p.push(j[m]);p=p.join(",");h[p]?a=h[p].id:(c.id=a="highcharts-"+zb++,h[p]=i=d.createElement(g).attr(c).add(d.defs),i.stops=[],n(j,function(a){f.test(a[1])? |
|||
(e=ra(a[1]),k=e.get("rgb"),l=e.get("a")):(k=a[1],l=1);a=d.createElement("stop").attr({offset:a[0],"stop-color":k,"stop-opacity":l}).add(i);i.stops.push(a)}));return"url("+d.url+"#"+a+")"}else return f.test(a)?(e=ra(a),v(b,c+"-opacity",e.get("a")),e.get("rgb")):(b.removeAttribute(c+"-opacity"),a)},text:function(a,b,c,d){var e=M.chart.style,f=$||!Z&&this.forExport;if(d&&!this.forExport)return this.html(a,b,c);b=t(o(b,0));c=t(o(c,0));a=this.createElement("text").attr({x:b,y:c,text:a}).css({fontFamily:e.fontFamily, |
|||
fontSize:e.fontSize});f&&a.css({position:"absolute"});a.x=b;a.y=c;return a},html:function(a,b,c){var d=M.chart.style,e=this.createElement("span"),f=e.attrSetters,g=e.element,h=e.renderer;f.text=function(a){a!==g.innerHTML&&delete this.bBox;g.innerHTML=a;return!1};f.x=f.y=f.align=function(a,b){b==="align"&&(b="textAlign");e[b]=a;e.htmlUpdateTransform();return!1};e.attr({text:a,x:t(b),y:t(c)}).css({position:"absolute",whiteSpace:"nowrap",fontFamily:d.fontFamily,fontSize:d.fontSize});e.css=e.htmlCss; |
|||
if(h.isSVG)e.add=function(a){var b,c=h.box.parentNode,d=[];if(a){if(b=a.div,!b){for(;a;)d.push(a),a=a.parentGroup;n(d.reverse(),function(a){var d;b=a.div=a.div||U(Ea,{className:v(a.element,"class")},{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px"},b||c);d=b.style;r(a.attrSetters,{translateX:function(a){d.left=a+"px"},translateY:function(a){d.top=a+"px"},visibility:function(a,b){d[b]=a}})})}}else b=c;b.appendChild(g);e.added=!0;e.alignOnAdd&&e.htmlUpdateTransform();return e}; |
|||
return e},fontMetrics:function(a){var a=C(a||11),a=a<24?a+4:t(a*1.2),b=t(a*0.8);return{h:a,b:b}},label:function(a,b,c,d,e,f,g,h,i){function j(){var a,b;a=o.element.style;L=(Oa===void 0||la===void 0||q.styles.textAlign)&&o.getBBox();q.width=(Oa||L.width||0)+2*da+kb;q.height=(la||L.height||0)+2*da;v=da+p.fontMetrics(a&&a.fontSize).b;if(C){if(!A)a=t(-s*da),b=h?-v:0,q.box=A=d?p.symbol(d,a,b,q.width,q.height):p.rect(a,b,q.width,q.height,0,lb[Rb]),A.add(q);A.isImg||A.attr(x({width:q.width,height:q.height}, |
|||
lb));lb=null}}function k(){var a=q.styles,a=a&&a.textAlign,b=kb+da*(1-s),c;c=h?0:v;if(u(Oa)&&(a==="center"||a==="right"))b+={center:0.5,right:1}[a]*(Oa-L.width);(b!==o.x||c!==o.y)&&o.attr({x:b,y:c});o.x=b;o.y=c}function l(a,b){A?A.attr(a,b):lb[a]=b}function m(){o.add(q);q.attr({text:a,x:b,y:c});A&&u(e)&&q.attr({anchorX:e,anchorY:f})}var p=this,q=p.g(i),o=p.text("",0,0,g).attr({zIndex:1}),A,L,s=0,da=3,kb=0,Oa,la,E,H,B=0,lb={},v,g=q.attrSetters,C;J(q,"add",m);g.width=function(a){Oa=a;return!1};g.height= |
|||
function(a){la=a;return!1};g.padding=function(a){u(a)&&a!==da&&(da=a,k());return!1};g.paddingLeft=function(a){u(a)&&a!==kb&&(kb=a,k());return!1};g.align=function(a){s={left:0,center:0.5,right:1}[a];return!1};g.text=function(a,b){o.attr(b,a);j();k();return!1};g[Rb]=function(a,b){C=!0;B=a%2/2;l(b,a);return!1};g.stroke=g.fill=g.r=function(a,b){b==="fill"&&(C=!0);l(b,a);return!1};g.anchorX=function(a,b){e=a;l(b,a+B-E);return!1};g.anchorY=function(a,b){f=a;l(b,a-H);return!1};g.x=function(a){q.x=a;a-=s* |
|||
((Oa||L.width)+da);E=t(a);q.attr("translateX",E);return!1};g.y=function(a){H=q.y=t(a);q.attr("translateY",H);return!1};var y=q.css;return r(q,{css:function(a){if(a){var b={},a=x(a);n("fontSize,fontWeight,fontFamily,color,lineHeight,width,textDecoration,textShadow".split(","),function(c){a[c]!==w&&(b[c]=a[c],delete a[c])});o.css(b)}return y.call(q,a)},getBBox:function(){return{width:L.width+2*da,height:L.height+2*da,x:L.x-da,y:L.y-da}},shadow:function(a){A&&A.shadow(a);return q},destroy:function(){aa(q, |
|||
"add",m);aa(q.element,"mouseenter");aa(q.element,"mouseleave");o&&(o=o.destroy());A&&(A=A.destroy());wa.prototype.destroy.call(q);q=p=j=k=l=m=null}})}};Va=Ha;var F;if(!Z&&!$){Highcharts.VMLElement=F={init:function(a,b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ","absolute",";"],e=b===Ea;(b==="shape"||e)&&d.push("left:0;top:0;width:1px;height:1px;");d.push("visibility: ",e?"hidden":"visible");c.push(' style="',d.join(""),'"/>');if(b)c=e||b==="span"||b==="img"?c.join(""):a.prepVML(c),this.element= |
|||
U(c);this.renderer=a;this.attrSetters={}},add:function(a){var b=this.renderer,c=this.element,d=b.box,d=a?a.element||a:d;a&&a.inverted&&b.invertChild(c,d);d.appendChild(c);this.added=!0;this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform();z(this,"add");return this},updateTransform:wa.prototype.htmlUpdateTransform,setSpanRotation:function(a,b,c){K(this.element,{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11=",c,", M12=",-b,", M21=",b,", M22=",c,", sizingMethod='auto expand')"].join(""): |
|||
S})},pathToVML:function(a){for(var b=a.length,c=[],d;b--;)if(sa(a[b]))c[b]=t(a[b]*10)-5;else if(a[b]==="Z")c[b]="x";else if(c[b]=a[b],a.isArc&&(a[b]==="wa"||a[b]==="at"))d=a[b]==="wa"?1:-1,c[b+5]===c[b+7]&&(c[b+7]-=d),c[b+6]===c[b+8]&&(c[b+8]-=d);return c.join(" ")||"x"},attr:function(a,b){var c,d,e,f=this.element||{},g=f.style,h=f.nodeName,i=this.renderer,j=this.symbolName,k,l=this.shadows,m,p=this.attrSetters,q=this;ea(a)&&u(b)&&(c=a,a={},a[c]=b);if(ea(a))c=a,q=c==="strokeWidth"||c==="stroke-width"? |
|||
this.strokeweight:this[c];else for(c in a)if(d=a[c],m=!1,e=p[c]&&p[c].call(this,d,c),e!==!1&&d!==null){e!==w&&(d=e);if(j&&/^(x|y|r|start|end|width|height|innerR|anchorX|anchorY)/.test(c))k||(this.symbolAttr(a),k=!0),m=!0;else if(c==="d"){d=d||[];this.d=d.join(" ");f.path=d=this.pathToVML(d);if(l)for(e=l.length;e--;)l[e].path=l[e].cutOff?this.cutOffPath(d,l[e].cutOff):d;m=!0}else if(c==="visibility"){if(l)for(e=l.length;e--;)l[e].style[c]=d;h==="DIV"&&(d=d==="hidden"?"-999em":0,fb||(g[c]=d?"visible": |
|||
"hidden"),c="top");g[c]=d;m=!0}else if(c==="zIndex")d&&(g[c]=d),m=!0;else if(qa(c,["x","y","width","height"])!==-1)this[c]=d,c==="x"||c==="y"?c={x:"left",y:"top"}[c]:d=s(0,d),this.updateClipping?(this[c]=d,this.updateClipping()):g[c]=d,m=!0;else if(c==="class"&&h==="DIV")f.className=d;else if(c==="stroke")d=i.color(d,f,c),c="strokecolor";else if(c==="stroke-width"||c==="strokeWidth")f.stroked=d?!0:!1,c="strokeweight",this[c]=d,sa(d)&&(d+="px");else if(c==="dashstyle")(f.getElementsByTagName("stroke")[0]|| |
|||
U(i.prepVML(["<stroke/>"]),null,null,f))[c]=d||"solid",this.dashstyle=d,m=!0;else if(c==="fill")if(h==="SPAN")g.color=d;else{if(h!=="IMG")f.filled=d!==S?!0:!1,d=i.color(d,f,c,this),c="fillcolor"}else if(c==="opacity")m=!0;else if(h==="shape"&&c==="rotation")this[c]=f.style[c]=d,f.style.left=-t(ca(d*Ua)+1)+"px",f.style.top=t(V(d*Ua))+"px";else if(c==="translateX"||c==="translateY"||c==="rotation")this[c]=d,this.updateTransform(),m=!0;else if(c==="text")this.bBox=null,f.innerHTML=d,m=!0;m||(fb?f[c]= |
|||
d:v(f,c,d))}return q},clip:function(a){var b=this,c;a?(c=a.members,ga(c,b),c.push(b),b.destroyClip=function(){ga(c,b)},a=a.getCSS(b)):(b.destroyClip&&b.destroyClip(),a={clip:fb?"inherit":"rect(auto)"});return b.css(a)},css:wa.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&Ta(a)},destroy:function(){this.destroyClip&&this.destroyClip();return wa.prototype.destroy.apply(this)},on:function(a,b){this.element["on"+a]=function(){var a=O.event;a.target=a.srcElement;b(a)};return this},cutOffPath:function(a, |
|||
b){var c,a=a.split(/[ ,]/);c=a.length;if(c===9||c===11)a[c-4]=a[c-2]=C(a[c-2])-10*b;return a.join(" ")},shadow:function(a,b,c){var d=[],e,f=this.element,g=this.renderer,h,i=f.style,j,k=f.path,l,m,p,q;k&&typeof k.value!=="string"&&(k="x");m=k;if(a){p=o(a.width,3);q=(a.opacity||0.15)/p;for(e=1;e<=3;e++){l=p*2+1-2*e;c&&(m=this.cutOffPath(k.value,l+0.5));j=['<shape isShadow="true" strokeweight="',l,'" filled="false" path="',m,'" coordsize="10 10" style="',f.style.cssText,'" />'];h=U(g.prepVML(j),null, |
|||
{left:C(i.left)+o(a.offsetX,1),top:C(i.top)+o(a.offsetY,1)});if(c)h.cutOff=l+1;j=['<stroke color="',a.color||"black",'" opacity="',q*e,'"/>'];U(g.prepVML(j),null,null,h);b?b.element.appendChild(h):f.parentNode.insertBefore(h,f);d.push(h)}this.shadows=d}return this}};F=ha(wa,F);var ma={Element:F,isIE8:oa.indexOf("MSIE 8.0")>-1,init:function(a,b,c){var d,e;this.alignedObjects=[];d=this.createElement(Ea);e=d.element;e.style.position="relative";a.appendChild(d.element);this.isVML=!0;this.box=e;this.boxWrapper= |
|||
d;this.setSize(b,c,!1);y.namespaces.hcv||(y.namespaces.add("hcv","urn:schemas-microsoft-com:vml"),(y.styleSheets.length?y.styleSheets[0]:y.createStyleSheet()).cssText+="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } ")},isHidden:function(){return!this.box.offsetWidth},clipRect:function(a,b,c,d){var e=this.createElement(),f=T(a);return r(e,{members:[],left:(f?a.x:a)+1,top:(f?a.y:b)+1,width:(f?a.width:c)-1,height:(f?a.height:d)-1,getCSS:function(a){var b= |
|||
a.element,c=b.nodeName,a=a.inverted,d=this.top-(c==="shape"?b.offsetTop:0),e=this.left,b=e+this.width,f=d+this.height,d={clip:"rect("+t(a?e:d)+"px,"+t(a?f:b)+"px,"+t(a?b:f)+"px,"+t(a?d:e)+"px)"};!a&&fb&&c==="DIV"&&r(d,{width:b+"px",height:f+"px"});return d},updateClipping:function(){n(e.members,function(a){a.css(e.getCSS(a))})}})},color:function(a,b,c,d){var e=this,f,g=/^rgba/,h,i,j=S;a&&a.linearGradient?i="gradient":a&&a.radialGradient&&(i="pattern");if(i){var k,l,m=a.linearGradient||a.radialGradient, |
|||
p,q,o,A,L,s="",a=a.stops,u,t=[],w=function(){h=['<fill colors="'+t.join(",")+'" opacity="',o,'" o:opacity2="',q,'" type="',i,'" ',s,'focus="100%" method="any" />'];U(e.prepVML(h),null,null,b)};p=a[0];u=a[a.length-1];p[0]>0&&a.unshift([0,p[1]]);u[0]<1&&a.push([1,u[1]]);n(a,function(a,b){g.test(a[1])?(f=ra(a[1]),k=f.get("rgb"),l=f.get("a")):(k=a[1],l=1);t.push(a[0]*100+"% "+k);b?(o=l,A=k):(q=l,L=k)});if(c==="fill")if(i==="gradient")c=m.x1||m[0]||0,a=m.y1||m[1]||0,p=m.x2||m[2]||0,m=m.y2||m[3]||0,s='angle="'+ |
|||
(90-R.atan((m-a)/(p-c))*180/ya)+'"',w();else{var j=m.r,r=j*2,E=j*2,H=m.cx,B=m.cy,x=b.radialReference,v,j=function(){x&&(v=d.getBBox(),H+=(x[0]-v.x)/v.width-0.5,B+=(x[1]-v.y)/v.height-0.5,r*=x[2]/v.width,E*=x[2]/v.height);s='src="'+M.global.VMLRadialGradientURL+'" size="'+r+","+E+'" origin="0.5,0.5" position="'+H+","+B+'" color2="'+L+'" ';w()};d.added?j():J(d,"add",j);j=A}else j=k}else if(g.test(a)&&b.tagName!=="IMG")f=ra(a),h=["<",c,' opacity="',f.get("a"),'"/>'],U(this.prepVML(h),null,null,b),j= |
|||
f.get("rgb");else{j=b.getElementsByTagName(c);if(j.length)j[0].opacity=1,j[0].type="solid";j=a}return j},prepVML:function(a){var b=this.isIE8,a=a.join("");b?(a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),a=a.indexOf('style="')===-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):a=a.replace("<","<hcv:");return a},text:Ha.prototype.html,path:function(a){var b={coordsize:"10 10"}; |
|||
Ia(a)?b.d=a:T(a)&&r(b,a);return this.createElement("shape").attr(b)},circle:function(a,b,c){var d=this.symbol("circle");if(T(a))c=a.r,b=a.y,a=a.x;d.isCircle=!0;d.r=c;return d.attr({x:a,y:b})},g:function(a){var b;a&&(b={className:"highcharts-"+a,"class":"highcharts-"+a});return this.createElement(Ea).attr(b)},image:function(a,b,c,d,e){var f=this.createElement("img").attr({src:a});arguments.length>1&&f.attr({x:b,y:c,width:d,height:e});return f},rect:function(a,b,c,d,e,f){var g=this.symbol("rect");g.r= |
|||
T(a)?a.r:e;return g.attr(T(a)?a:g.crisp(f,a,b,s(c,0),s(d,0)))},invertChild:function(a,b){var c=b.style;K(a,{flip:"x",left:C(c.width)-1,top:C(c.height)-1,rotation:-90})},symbols:{arc:function(a,b,c,d,e){var f=e.start,g=e.end,h=e.r||c||d,c=e.innerR,d=V(f),i=ca(f),j=V(g),k=ca(g);if(g-f===0)return["x"];f=["wa",a-h,b-h,a+h,b+h,a+h*d,b+h*i,a+h*j,b+h*k];e.open&&!c&&f.push("e","M",a,b);f.push("at",a-c,b-c,a+c,b+c,a+c*j,b+c*k,a+c*d,b+c*i,"x","e");f.isArc=!0;return f},circle:function(a,b,c,d,e){e&&(c=d=2*e.r); |
|||
e&&e.isCircle&&(a-=c/2,b-=d/2);return["wa",a,b,a+c,b+d,a+c,b+d/2,a+c,b+d/2,"e"]},rect:function(a,b,c,d,e){var f=a+c,g=b+d,h;!u(e)||!e.r?f=Ha.prototype.symbols.square.apply(0,arguments):(h=I(e.r,c,d),f=["M",a+h,b,"L",f-h,b,"wa",f-2*h,b,f,b+2*h,f-h,b,f,b+h,"L",f,g-h,"wa",f-2*h,g-2*h,f,g,f,g-h,f-h,g,"L",a+h,g,"wa",a,g-2*h,a+2*h,g,a+h,g,a,g-h,"L",a,b+h,"wa",a,b,a+2*h,b+2*h,a,b+h,a+h,b,"x","e"]);return f}}};Highcharts.VMLRenderer=F=function(){this.init.apply(this,arguments)};F.prototype=x(Ha.prototype, |
|||
ma);Va=F}var Tb;if($)Highcharts.CanVGRenderer=F=function(){za="http://www.w3.org/1999/xhtml"},F.prototype.symbols={},Tb=function(){function a(){var a=b.length,d;for(d=0;d<a;d++)b[d]();b=[]}var b=[];return{push:function(c,d){b.length===0&&Vb(d,a);b.push(c)}}}(),Va=F;Ma.prototype={addLabel:function(){var a=this.axis,b=a.options,c=a.chart,d=a.horiz,e=a.categories,f=a.series[0]&&a.series[0].names,g=this.pos,h=b.labels,i=a.tickPositions,d=d&&e&&!h.step&&!h.staggerLines&&!h.rotation&&c.plotWidth/i.length|| |
|||
!d&&(c.margin[3]||c.chartWidth*0.33),j=g===i[0],k=g===i[i.length-1],l,f=e?o(e[g],f&&f[g],g):g,e=this.label,m=i.info;a.isDatetimeAxis&&m&&(l=b.dateTimeLabelFormats[m.higherRanks[g]||m.unitName]);this.isFirst=j;this.isLast=k;b=a.labelFormatter.call({axis:a,chart:c,isFirst:j,isLast:k,dateTimeLabelFormat:l,value:a.isLog?ia(fa(f)):f});g=d&&{width:s(1,t(d-2*(h.padding||10)))+"px"};g=r(g,h.style);if(u(e))e&&e.attr({text:b}).css(g);else{l={align:a.labelAlign};if(sa(h.rotation))l.rotation=h.rotation;if(d&& |
|||
h.ellipsis)l._clipHeight=a.len/i.length;this.label=u(b)&&h.enabled?c.renderer.text(b,0,0,h.useHTML).attr(l).css(g).add(a.labelGroup):null}},getLabelSize:function(){var a=this.label,b=this.axis;return a?(this.labelBBox=a.getBBox())[b.horiz?"height":"width"]:0},getLabelSides:function(){var a=this.axis,b=this.labelBBox.width,a=b*{left:0,center:0.5,right:1}[a.labelAlign]-a.options.labels.x;return[-a,b-a]},handleOverflow:function(a,b){var c=!0,d=this.axis,e=d.chart,f=this.isFirst,g=this.isLast,h=b.x,i= |
|||
d.reversed,j=d.tickPositions;if(f||g){var k=this.getLabelSides(),l=k[0],k=k[1],e=e.plotLeft,m=e+d.len,j=(d=d.ticks[j[a+(f?1:-1)]])&&d.label.xy&&d.label.xy.x+d.getLabelSides()[f?0:1];f&&!i||g&&i?h+l<e&&(h=e-l,d&&h+k>j&&(c=!1)):h+k>m&&(h=m-k,d&&h+l<j&&(c=!1));b.x=h}return c},getPosition:function(a,b,c,d){var e=this.axis,f=e.chart,g=d&&f.oldChartHeight||f.chartHeight;return{x:a?e.translate(b+c,null,null,d)+e.transB:e.left+e.offset+(e.opposite?(d&&f.oldChartWidth||f.chartWidth)-e.right-e.left:0),y:a? |
|||
g-e.bottom+e.offset-(e.opposite?e.height:0):g-e.translate(b+c,null,null,d)-e.transB}},getLabelPosition:function(a,b,c,d,e,f,g,h){var i=this.axis,j=i.transA,k=i.reversed,l=i.staggerLines,m=i.chart.renderer.fontMetrics(e.style.fontSize).b,p=e.rotation,a=a+e.x-(f&&d?f*j*(k?-1:1):0),b=b+e.y-(f&&!d?f*j*(k?1:-1):0);p&&i.side===2&&(b-=m-m*V(p*Ua));!u(e.y)&&!p&&(b+=m-c.getBBox().height/2);l&&(b+=g/(h||1)%l*(i.labelOffset/l));return{x:a,y:b}},getMarkPath:function(a,b,c,d,e,f){return f.crispLine(["M",a,b,"L", |
|||
a+(e?0:-c),b+(e?c:0)],d)},render:function(a,b,c){var d=this.axis,e=d.options,f=d.chart.renderer,g=d.horiz,h=this.type,i=this.label,j=this.pos,k=e.labels,l=this.gridLine,m=h?h+"Grid":"grid",p=h?h+"Tick":"tick",q=e[m+"LineWidth"],n=e[m+"LineColor"],A=e[m+"LineDashStyle"],s=e[p+"Length"],m=e[p+"Width"]||0,u=e[p+"Color"],t=e[p+"Position"],p=this.mark,r=k.step,v=!0,x=d.tickmarkOffset,E=this.getPosition(g,j,x,b),H=E.x,E=E.y,B=g&&H===d.pos+d.len||!g&&E===d.pos?-1:1,C=d.staggerLines;this.isActive=!0;if(q){j= |
|||
d.getPlotLinePath(j+x,q*B,b,!0);if(l===w){l={stroke:n,"stroke-width":q};if(A)l.dashstyle=A;if(!h)l.zIndex=1;if(b)l.opacity=0;this.gridLine=l=q?f.path(j).attr(l).add(d.gridGroup):null}if(!b&&l&&j)l[this.isNew?"attr":"animate"]({d:j,opacity:c})}if(m&&s)t==="inside"&&(s=-s),d.opposite&&(s=-s),b=this.getMarkPath(H,E,s,m*B,g,f),p?p.animate({d:b,opacity:c}):this.mark=f.path(b).attr({stroke:u,"stroke-width":m,opacity:c}).add(d.axisGroup);if(i&&!isNaN(H))i.xy=E=this.getLabelPosition(H,E,i,g,k,x,a,r),this.isFirst&& |
|||
!this.isLast&&!o(e.showFirstLabel,1)||this.isLast&&!this.isFirst&&!o(e.showLastLabel,1)?v=!1:!C&&g&&k.overflow==="justify"&&!this.handleOverflow(a,E)&&(v=!1),r&&a%r&&(v=!1),v&&!isNaN(E.y)?(E.opacity=c,i[this.isNew?"attr":"animate"](E),this.isNew=!1):i.attr("y",-9999)},destroy:function(){Ka(this,this.axis)}};vb.prototype={render:function(){var a=this,b=a.axis,c=b.horiz,d=(b.pointRange||0)/2,e=a.options,f=e.label,g=a.label,h=e.width,i=e.to,j=e.from,k=u(j)&&u(i),l=e.value,m=e.dashStyle,p=a.svgElem,q= |
|||
[],n,A=e.color,L=e.zIndex,t=e.events,w=b.chart.renderer;b.isLog&&(j=na(j),i=na(i),l=na(l));if(h){if(q=b.getPlotLinePath(l,h),d={stroke:A,"stroke-width":h},m)d.dashstyle=m}else if(k){if(j=s(j,b.min-d),i=I(i,b.max+d),q=b.getPlotBandPath(j,i,e),d={fill:A},e.borderWidth)d.stroke=e.borderColor,d["stroke-width"]=e.borderWidth}else return;if(u(L))d.zIndex=L;if(p)q?p.animate({d:q},null,p.onGetPath):(p.hide(),p.onGetPath=function(){p.show()});else if(q&&q.length&&(a.svgElem=p=w.path(q).attr(d).add(),t))for(n in e= |
|||
function(b){p.on(b,function(c){t[b].apply(a,[c])})},t)e(n);if(f&&u(f.text)&&q&&q.length&&b.width>0&&b.height>0){f=x({align:c&&k&&"center",x:c?!k&&4:10,verticalAlign:!c&&k&&"middle",y:c?k?16:10:k?6:-4,rotation:c&&!k&&90},f);if(!g)a.label=g=w.text(f.text,0,0,f.useHTML).attr({align:f.textAlign||f.align,rotation:f.rotation,zIndex:L}).css(f.style).add();b=[q[1],q[4],o(q[6],q[1])];q=[q[2],q[5],o(q[7],q[2])];c=Ja(b);k=Ja(q);g.align(f,!1,{x:c,y:k,width:va(b)-c,height:va(q)-k});g.show()}else g&&g.hide();return a}, |
|||
destroy:function(){ga(this.axis.plotLinesAndBands,this);delete this.axis;Ka(this)}};Mb.prototype={destroy:function(){Ka(this,this.axis)},render:function(a){var b=this.options,c=b.format,c=c?Ca(c,this):b.formatter.call(this);this.label?this.label.attr({text:c,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(c,0,0,b.useHTML).css(b.style).attr({align:this.textAlign,rotation:b.rotation,visibility:"hidden"}).add(a)},setOffset:function(a,b){var c=this.axis,d=c.chart,e=d.inverted,f=this.isNegative, |
|||
g=c.translate(this.percent?100:this.total,0,0,0,1),c=c.translate(0),c=N(g-c),h=d.xAxis[0].translate(this.x)+a,i=d.plotHeight,f={x:e?f?g:g-c:h,y:e?i-h-b:f?i-g-c:i-g,width:e?c:b,height:e?b:c};if(e=this.label)e.align(this.alignOptions,null,f),f=e.alignAttr,e.attr({visibility:this.options.crop===!1||d.isInsidePlot(f.x,f.y)?Z?"inherit":"visible":"hidden"})}};db.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b", |
|||
month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#C0C0C0",labels:G,lineColor:"#C0D0E0",lineWidth:1,minPadding:0.01,maxPadding:0.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:5,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#4d759e",fontWeight:"bold"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0, |
|||
gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:0.05,minPadding:0.05,startOnTick:!0,tickWidth:0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return Aa(this.total,-1)},style:G.style}},defaultLeftAxisOptions:{labels:{x:-8,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:8,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{x:0,y:14},title:{rotation:0}},defaultTopAxisOptions:{labels:{x:0,y:-5}, |
|||
title:{rotation:0}},init:function(a,b){var c=b.isX;this.horiz=a.inverted?!c:c;this.xOrY=(this.isXAxis=c)?"x":"y";this.opposite=b.opposite;this.side=this.horiz?this.opposite?0:2:this.opposite?1:3;this.setOptions(b);var d=this.options,e=d.type;this.labelFormatter=d.labels.formatter||this.defaultLabelFormatter;this.userOptions=b;this.minPixelPadding=0;this.chart=a;this.reversed=d.reversed;this.zoomEnabled=d.zoomEnabled!==!1;this.categories=d.categories||e==="category";this.isLog=e==="logarithmic";this.isDatetimeAxis= |
|||
e==="datetime";this.isLinked=u(d.linkedTo);this.tickmarkOffset=this.categories&&d.tickmarkPlacement==="between"?0.5:0;this.ticks={};this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=d.minRange||d.maxZoom;this.range=d.range;this.offset=d.offset||0;this.stacks={};this.oldStacks={};this.stackExtremes={};this.min=this.max=null;var f,d=this.options.events;qa(this,a.axes)===-1&&(a.axes.push(this),a[c?"xAxis":"yAxis"].push(this));this.series=this.series|| |
|||
[];if(a.inverted&&c&&this.reversed===w)this.reversed=!0;this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(f in d)J(this,f,d[f]);if(this.isLog)this.val2lin=na,this.lin2val=fa},setOptions:function(a){this.options=x(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],x(M[this.isXAxis?"xAxis":"yAxis"],a))},update:function(a,b){var c=this.chart,a=c.options[this.xOrY+ |
|||
"Axis"][this.options.index]=x(this.userOptions,a);this.destroy(!0);this._addedPlotLB=this.userMin=this.userMax=w;this.init(c,r(a,{events:w}));c.isDirtyBox=!0;o(b,!0)&&c.redraw()},remove:function(a){var b=this.chart,c=this.xOrY+"Axis";n(this.series,function(a){a.remove(!1)});ga(b.axes,this);ga(b[c],this);b.options[c].splice(this.options.index,1);n(b[c],function(a,b){a.options.index=b});this.destroy();b.isDirtyBox=!0;o(a,!0)&&b.redraw()},defaultLabelFormatter:function(){var a=this.axis,b=this.value, |
|||
c=a.categories,d=this.dateTimeLabelFormat,e=M.lang.numericSymbols,f=e&&e.length,g,h=a.options.labels.format,a=a.isLog?b:a.tickInterval;if(h)g=Ca(h,this);else if(c)g=b;else if(d)g=Xa(d,b);else if(f&&a>=1E3)for(;f--&&g===w;)c=Math.pow(1E3,f+1),a>=c&&e[f]!==null&&(g=Aa(b/c,-1)+e[f]);g===w&&(g=b>=1E3?Aa(b,0):Aa(b,-1));return g},getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=null;a.stackExtremes={};a.buildStacks();n(a.series,function(c){if(c.visible||!b.options.chart.ignoreHiddenSeries){var d; |
|||
d=c.options.threshold;var e;a.hasVisibleSeries=!0;a.isLog&&d<=0&&(d=null);if(a.isXAxis){if(d=c.xData,d.length)a.dataMin=I(o(a.dataMin,d[0]),Ja(d)),a.dataMax=s(o(a.dataMax,d[0]),va(d))}else{c.getExtremes();e=c.dataMax;c=c.dataMin;if(u(c)&&u(e))a.dataMin=I(o(a.dataMin,c),c),a.dataMax=s(o(a.dataMax,e),e);if(u(d))if(a.dataMin>=d)a.dataMin=d,a.ignoreMinPadding=!0;else if(a.dataMax<d)a.dataMax=d,a.ignoreMaxPadding=!0}}})},translate:function(a,b,c,d,e,f){var g=this.len,h=1,i=0,j=d?this.oldTransA:this.transA, |
|||
d=d?this.oldMin:this.min,k=this.minPixelPadding,e=(this.options.ordinal||this.isLog&&e)&&this.lin2val;if(!j)j=this.transA;c&&(h*=-1,i=g);this.reversed&&(h*=-1,i-=h*g);b?(a=a*h+i,a-=k,a=a/j+d,e&&(a=this.lin2val(a))):(e&&(a=this.val2lin(a)),f==="between"&&(f=0.5),a=h*(a-d)*j+i+h*k+(sa(f)?j*f*this.pointRange:0));return a},toPixels:function(a,b){return this.translate(a,!1,!this.horiz,null,!0)+(b?0:this.pos)},toValue:function(a,b){return this.translate(a-(b?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a, |
|||
b,c,d){var e=this.chart,f=this.left,g=this.top,h,i,j,a=this.translate(a,null,null,c),k=c&&e.oldChartHeight||e.chartHeight,l=c&&e.oldChartWidth||e.chartWidth,m;h=this.transB;c=i=t(a+h);h=j=t(k-a-h);if(isNaN(a))m=!0;else if(this.horiz){if(h=g,j=k-this.bottom,c<f||c>f+this.width)m=!0}else if(c=f,i=l-this.right,h<g||h>g+this.height)m=!0;return m&&!d?null:e.renderer.crispLine(["M",c,h,"L",i,j],b||0)},getPlotBandPath:function(a,b){var c=this.getPlotLinePath(b),d=this.getPlotLinePath(a);d&&c?d.push(c[4], |
|||
c[5],c[1],c[2]):d=null;return d},getLinearTickPositions:function(a,b,c){for(var d,b=ia(P(b/a)*a),c=ia(xa(c/a)*a),e=[];b<=c;){e.push(b);b=ia(b+a);if(b===d)break;d=b}return e},getLogTickPositions:function(a,b,c,d){var e=this.options,f=this.len,g=[];if(!d)this._minorAutoInterval=null;if(a>=0.5)a=t(a),g=this.getLinearTickPositions(a,b,c);else if(a>=0.08)for(var f=P(b),h,i,j,k,l,e=a>0.3?[1,2,4]:a>0.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];f<c+1&&!l;f++){i=e.length;for(h=0;h<i&&!l;h++)j=na(fa(f)*e[h]),j>b&&(!d|| |
|||
k<=c)&&g.push(k),k>c&&(l=!0),k=j}else if(b=fa(b),c=fa(c),a=e[d?"minorTickInterval":"tickInterval"],a=o(a==="auto"?null:a,this._minorAutoInterval,(c-b)*(e.tickPixelInterval/(d?5:1))/((d?f/this.tickPositions.length:f)||1)),a=ob(a,null,nb(a)),g=Na(this.getLinearTickPositions(a,b,c),na),!d)this._minorAutoInterval=a/5;if(!d)this.tickInterval=a;return g},getMinorTickPositions:function(){var a=this.options,b=this.tickPositions,c=this.minorTickInterval,d=[],e;if(this.isLog){e=b.length;for(a=1;a<e;a++)d=d.concat(this.getLogTickPositions(c, |
|||
b[a-1],b[a],!0))}else if(this.isDatetimeAxis&&a.minorTickInterval==="auto")d=d.concat(Eb(Cb(c),this.min,this.max,a.startOfWeek)),d[0]<this.min&&d.shift();else for(b=this.min+(b[0]-this.min)%c;b<=this.max;b+=c)d.push(b);return d},adjustForMinRange:function(){var a=this.options,b=this.min,c=this.max,d,e=this.dataMax-this.dataMin>=this.minRange,f,g,h,i,j;if(this.isXAxis&&this.minRange===w&&!this.isLog)u(a.min)||u(a.max)?this.minRange=null:(n(this.series,function(a){i=a.xData;for(g=j=a.xIncrement?1:i.length- |
|||
1;g>0;g--)if(h=i[g]-i[g-1],f===w||h<f)f=h}),this.minRange=I(f*5,this.dataMax-this.dataMin));if(c-b<this.minRange){var k=this.minRange;d=(k-c+b)/2;d=[b-d,o(a.min,b-d)];if(e)d[2]=this.dataMin;b=va(d);c=[b+k,o(a.max,b+k)];if(e)c[2]=this.dataMax;c=Ja(c);c-b<k&&(d[0]=c-k,d[1]=o(a.min,c-k),b=va(d))}this.min=b;this.max=c},setAxisTranslation:function(a){var b=this.max-this.min,c=0,d,e=0,f=0,g=this.linkedParent,h=this.transA;if(this.isXAxis)g?(e=g.minPointOffset,f=g.pointRangePadding):n(this.series,function(a){var g= |
|||
a.pointRange,h=a.options.pointPlacement,l=a.closestPointRange;g>b&&(g=0);c=s(c,g);e=s(e,ea(h)?0:g/2);f=s(f,h==="on"?0:g);!a.noSharedTooltip&&u(l)&&(d=u(d)?I(d,l):l)}),g=this.ordinalSlope&&d?this.ordinalSlope/d:1,this.minPointOffset=e*=g,this.pointRangePadding=f*=g,this.pointRange=I(c,b),this.closestPointRange=d;if(a)this.oldTransA=h;this.translationSlope=this.transA=h=this.len/(b+f||1);this.transB=this.horiz?this.left:this.bottom;this.minPixelPadding=h*e},setTickPositions:function(a){var b=this,c= |
|||
b.chart,d=b.options,e=b.isLog,f=b.isDatetimeAxis,g=b.isXAxis,h=b.isLinked,i=b.options.tickPositioner,j=d.maxPadding,k=d.minPadding,l=d.tickInterval,m=d.minTickInterval,p=d.tickPixelInterval,q,ba=b.categories;h?(b.linkedParent=c[g?"xAxis":"yAxis"][d.linkedTo],c=b.linkedParent.getExtremes(),b.min=o(c.min,c.dataMin),b.max=o(c.max,c.dataMax),d.type!==b.linkedParent.options.type&&ka(11,1)):(b.min=o(b.userMin,d.min,b.dataMin),b.max=o(b.userMax,d.max,b.dataMax));if(e)!a&&I(b.min,o(b.dataMin,b.min))<=0&& |
|||
ka(10,1),b.min=ia(na(b.min)),b.max=ia(na(b.max));if(b.range&&(b.userMin=b.min=s(b.min,b.max-b.range),b.userMax=b.max,a))b.range=null;b.beforePadding&&b.beforePadding();b.adjustForMinRange();if(!ba&&!b.usePercentage&&!h&&u(b.min)&&u(b.max)&&(c=b.max-b.min)){if(!u(d.min)&&!u(b.userMin)&&k&&(b.dataMin<0||!b.ignoreMinPadding))b.min-=c*k;if(!u(d.max)&&!u(b.userMax)&&j&&(b.dataMax>0||!b.ignoreMaxPadding))b.max+=c*j}b.min===b.max||b.min===void 0||b.max===void 0?b.tickInterval=1:h&&!l&&p===b.linkedParent.options.tickPixelInterval? |
|||
b.tickInterval=b.linkedParent.tickInterval:(b.tickInterval=o(l,ba?1:(b.max-b.min)*p/s(b.len,p)),!u(l)&&b.len<p&&!this.isRadial&&(q=!0,b.tickInterval/=4));g&&!a&&n(b.series,function(a){a.processData(b.min!==b.oldMin||b.max!==b.oldMax)});b.setAxisTranslation(!0);b.beforeSetTickPositions&&b.beforeSetTickPositions();if(b.postProcessTickInterval)b.tickInterval=b.postProcessTickInterval(b.tickInterval);if(b.pointRange)b.tickInterval=s(b.pointRange,b.tickInterval);if(!l&&b.tickInterval<m)b.tickInterval= |
|||
m;if(!f&&!e&&!l)b.tickInterval=ob(b.tickInterval,null,nb(b.tickInterval),d);b.minorTickInterval=d.minorTickInterval==="auto"&&b.tickInterval?b.tickInterval/5:d.minorTickInterval;b.tickPositions=a=d.tickPositions?[].concat(d.tickPositions):i&&i.apply(b,[b.min,b.max]);if(!a)!b.ordinalPositions&&(b.max-b.min)/b.tickInterval>s(2*b.len,200)&&ka(19,!0),a=f?(b.getNonLinearTimeTicks||Eb)(Cb(b.tickInterval,d.units),b.min,b.max,d.startOfWeek,b.ordinalPositions,b.closestPointRange,!0):e?b.getLogTickPositions(b.tickInterval, |
|||
b.min,b.max):b.getLinearTickPositions(b.tickInterval,b.min,b.max),q&&a.splice(1,a.length-2),b.tickPositions=a;if(!h)e=a[0],f=a[a.length-1],h=b.minPointOffset||0,d.startOnTick?b.min=e:b.min-h>e&&a.shift(),d.endOnTick?b.max=f:b.max+h<f&&a.pop(),a.length===1&&(b.min-=0.001,b.max+=0.001)},setMaxTicks:function(){var a=this.chart,b=a.maxTicks||{},c=this.tickPositions,d=this._maxTicksKey=[this.xOrY,this.pos,this.len].join("-");if(!this.isLinked&&!this.isDatetimeAxis&&c&&c.length>(b[d]||0)&&this.options.alignTicks!== |
|||
!1)b[d]=c.length;a.maxTicks=b},adjustTickAmount:function(){var a=this._maxTicksKey,b=this.tickPositions,c=this.chart.maxTicks;if(c&&c[a]&&!this.isDatetimeAxis&&!this.categories&&!this.isLinked&&this.options.alignTicks!==!1){var d=this.tickAmount,e=b.length;this.tickAmount=a=c[a];if(e<a){for(;b.length<a;)b.push(ia(b[b.length-1]+this.tickInterval));this.transA*=(e-1)/(a-1);this.max=b[b.length-1]}if(u(d)&&a!==d)this.isDirty=!0}},setScale:function(){var a=this.stacks,b,c,d,e;this.oldMin=this.min;this.oldMax= |
|||
this.max;this.oldAxisLength=this.len;this.setAxisSize();e=this.len!==this.oldAxisLength;n(this.series,function(a){if(a.isDirtyData||a.isDirty||a.xAxis.isDirty)d=!0});if(e||d||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax){if(!this.isXAxis)for(b in a)delete a[b];this.forceRedraw=!1;this.getSeriesExtremes();this.setTickPositions();this.oldUserMin=this.userMin;this.oldUserMax=this.userMax;if(!this.isDirty)this.isDirty=e||this.min!==this.oldMin||this.max!== |
|||
this.oldMax}else if(!this.isXAxis){if(this.oldStacks)a=this.stacks=this.oldStacks;for(b in a)for(c in a[b])a[b][c].cum=a[b][c].total}this.setMaxTicks()},setExtremes:function(a,b,c,d,e){var f=this,g=f.chart,c=o(c,!0),e=r(e,{min:a,max:b});z(f,"setExtremes",e,function(){f.userMin=a;f.userMax=b;f.eventArgs=e;f.isDirtyExtremes=!0;c&&g.redraw(d)})},zoom:function(a,b){this.allowZoomOutside||(u(this.dataMin)&&a<=this.dataMin&&(a=w),u(this.dataMax)&&b>=this.dataMax&&(b=w));this.displayBtn=a!==w||b!==w;this.setExtremes(a, |
|||
b,!1,w,{trigger:"zoom"});return!0},setAxisSize:function(){var a=this.chart,b=this.options,c=b.offsetLeft||0,d=b.offsetRight||0,e=this.horiz,f,g;this.left=g=o(b.left,a.plotLeft+c);this.top=f=o(b.top,a.plotTop);this.width=c=o(b.width,a.plotWidth-c+d);this.height=b=o(b.height,a.plotHeight);this.bottom=a.chartHeight-b-f;this.right=a.chartWidth-c-g;this.len=s(e?c:b,0);this.pos=e?g:f},getExtremes:function(){var a=this.isLog;return{min:a?ia(fa(this.min)):this.min,max:a?ia(fa(this.max)):this.max,dataMin:this.dataMin, |
|||
dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,c=b?fa(this.min):this.min,b=b?fa(this.max):this.max;c>a||a===null?a=c:b<a&&(a=b);return this.translate(a,0,1,0,1)},addPlotBand:function(a){this.addPlotBandOrLine(a,"plotBands")},addPlotLine:function(a){this.addPlotBandOrLine(a,"plotLines")},addPlotBandOrLine:function(a,b){var c=(new vb(this,a)).render(),d=this.userOptions;c&&(b&&(d[b]=d[b]||[],d[b].push(a)),this.plotLinesAndBands.push(c));return c}, |
|||
autoLabelAlign:function(a){a=(o(a,0)-this.side*90+720)%360;return a>15&&a<165?"right":a>195&&a<345?"left":"center"},getOffset:function(){var a=this,b=a.chart,c=b.renderer,d=a.options,e=a.tickPositions,f=a.ticks,g=a.horiz,h=a.side,i=b.inverted?[1,0,3,2][h]:h,j,k=0,l,m=0,p=d.title,q=d.labels,ba=0,A=b.axisOffset,L=b.clipOffset,t=[-1,1,1,-1][h],r,v=1,x=o(q.maxStaggerLines,5),la,E,H,B;a.hasData=j=a.hasVisibleSeries||u(a.min)&&u(a.max)&&!!e;a.showAxis=b=j||o(d.showEmpty,!0);a.staggerLines=a.horiz&&q.staggerLines; |
|||
if(!a.axisGroup)a.gridGroup=c.g("grid").attr({zIndex:d.gridZIndex||1}).add(),a.axisGroup=c.g("axis").attr({zIndex:d.zIndex||2}).add(),a.labelGroup=c.g("axis-labels").attr({zIndex:q.zIndex||7}).add();if(j||a.isLinked){a.labelAlign=o(q.align||a.autoLabelAlign(q.rotation));n(e,function(b){f[b]?f[b].addLabel():f[b]=new Ma(a,b)});if(a.horiz&&!a.staggerLines&&x&&!q.rotation){for(r=a.reversed?[].concat(e).reverse():e;v<x;){j=[];la=!1;for(q=0;q<r.length;q++)E=r[q],H=(H=f[E].label&&f[E].label.getBBox())?H.width: |
|||
0,B=q%v,H&&(E=a.translate(E),j[B]!==w&&E<j[B]&&(la=!0),j[B]=E+H);if(la)v++;else break}if(v>1)a.staggerLines=v}n(e,function(b){if(h===0||h===2||{1:"left",3:"right"}[h]===a.labelAlign)ba=s(f[b].getLabelSize(),ba)});if(a.staggerLines)ba*=a.staggerLines,a.labelOffset=ba}else for(r in f)f[r].destroy(),delete f[r];if(p&&p.text&&p.enabled!==!1){if(!a.axisTitle)a.axisTitle=c.text(p.text,0,0,p.useHTML).attr({zIndex:7,rotation:p.rotation||0,align:p.textAlign||{low:"left",middle:"center",high:"right"}[p.align]}).css(p.style).add(a.axisGroup), |
|||
a.axisTitle.isNew=!0;if(b)k=a.axisTitle.getBBox()[g?"height":"width"],m=o(p.margin,g?5:10),l=p.offset;a.axisTitle[b?"show":"hide"]()}a.offset=t*o(d.offset,A[h]);a.axisTitleMargin=o(l,ba+m+(h!==2&&ba&&t*d.labels[g?"y":"x"]));A[h]=s(A[h],a.axisTitleMargin+k+t*a.offset);L[i]=s(L[i],P(d.lineWidth/2)*2)},getLinePath:function(a){var b=this.chart,c=this.opposite,d=this.offset,e=this.horiz,f=this.left+(c?this.width:0)+d,d=b.chartHeight-this.bottom-(c?this.height:0)+d;c&&(a*=-1);return b.renderer.crispLine(["M", |
|||
e?this.left:f,e?d:this.top,"L",e?b.chartWidth-this.right:f,e?d:b.chartHeight-this.bottom],a)},getTitlePosition:function(){var a=this.horiz,b=this.left,c=this.top,d=this.len,e=this.options.title,f=a?b:c,g=this.opposite,h=this.offset,i=C(e.style.fontSize||12),d={low:f+(a?0:d),middle:f+d/2,high:f+(a?d:0)}[e.align],b=(a?c+this.height:b)+(a?1:-1)*(g?-1:1)*this.axisTitleMargin+(this.side===2?i:0);return{x:a?d:b+(g?this.width:0)+h+(e.x||0),y:a?b-(g?this.height:0)+h:d+(e.y||0)}},render:function(){var a=this, |
|||
b=a.chart,c=b.renderer,d=a.options,e=a.isLog,f=a.isLinked,g=a.tickPositions,h=a.axisTitle,i=a.stacks,j=a.ticks,k=a.minorTicks,l=a.alternateBands,m=d.stackLabels,p=d.alternateGridColor,q=a.tickmarkOffset,o=d.lineWidth,A,s=b.hasRendered&&u(a.oldMin)&&!isNaN(a.oldMin);A=a.hasData;var t=a.showAxis,r,v;n([j,k,l],function(a){for(var b in a)a[b].isActive=!1});if(A||f)if(a.minorTickInterval&&!a.categories&&n(a.getMinorTickPositions(),function(b){k[b]||(k[b]=new Ma(a,b,"minor"));s&&k[b].isNew&&k[b].render(null, |
|||
!0);k[b].render(null,!1,1)}),g.length&&(n(g.slice(1).concat([g[0]]),function(b,c){c=c===g.length-1?0:c+1;if(!f||b>=a.min&&b<=a.max)j[b]||(j[b]=new Ma(a,b)),s&&j[b].isNew&&j[b].render(c,!0),j[b].render(c,!1,1)}),q&&a.min===0&&(j[-1]||(j[-1]=new Ma(a,-1,null,!0)),j[-1].render(-1))),p&&n(g,function(b,c){if(c%2===0&&b<a.max)l[b]||(l[b]=new vb(a)),r=b+q,v=g[c+1]!==w?g[c+1]+q:a.max,l[b].options={from:e?fa(r):r,to:e?fa(v):v,color:p},l[b].render(),l[b].isActive=!0}),!a._addedPlotLB)n((d.plotLines||[]).concat(d.plotBands|| |
|||
[]),function(b){a.addPlotBandOrLine(b)}),a._addedPlotLB=!0;n([j,k,l],function(a){var c,d,e=[],f=Fa?Fa.duration||500:0,g=function(){for(d=e.length;d--;)a[e[d]]&&!a[e[d]].isActive&&(a[e[d]].destroy(),delete a[e[d]])};for(c in a)if(!a[c].isActive)a[c].render(c,!1,0),a[c].isActive=!1,e.push(c);a===l||!b.hasRendered||!f?g():f&&setTimeout(g,f)});if(o)A=a.getLinePath(o),a.axisLine?a.axisLine.animate({d:A}):a.axisLine=c.path(A).attr({stroke:d.lineColor,"stroke-width":o,zIndex:7}).add(a.axisGroup),a.axisLine[t? |
|||
"show":"hide"]();if(h&&t)h[h.isNew?"attr":"animate"](a.getTitlePosition()),h.isNew=!1;if(m&&m.enabled){var x,la,d=a.stackTotalGroup;if(!d)a.stackTotalGroup=d=c.g("stack-labels").attr({visibility:"visible",zIndex:6}).add();d.translate(b.plotLeft,b.plotTop);for(x in i)for(la in c=i[x],c)c[la].render(d)}a.isDirty=!1},removePlotBandOrLine:function(a){for(var b=this.plotLinesAndBands,c=this.options,d=this.userOptions,e=b.length;e--;)b[e].id===a&&b[e].destroy();n([c.plotLines||[],d.plotLines||[],c.plotBands|| |
|||
[],d.plotBands||[]],function(b){for(e=b.length;e--;)b[e].id===a&&ga(b,b[e])})},setTitle:function(a,b){this.update({title:a},b)},redraw:function(){var a=this.chart.pointer;a.reset&&a.reset(!0);this.render();n(this.plotLinesAndBands,function(a){a.render()});n(this.series,function(a){a.isDirty=!0})},buildStacks:function(){var a=this.series,b=a.length;if(!this.isXAxis){for(;b--;)a[b].setStackedPoints();if(this.usePercentage)for(b=0;b<a.length;b++)a[b].setPercentStacks()}},setCategories:function(a,b){this.update({categories:a}, |
|||
b)},destroy:function(a){var b=this,c=b.stacks,d,e=b.plotLinesAndBands;a||aa(b);for(d in c)Ka(c[d]),c[d]=null;n([b.ticks,b.minorTicks,b.alternateBands],function(a){Ka(a)});for(a=e.length;a--;)e[a].destroy();n("stackTotalGroup,axisLine,axisGroup,gridGroup,labelGroup,axisTitle".split(","),function(a){b[a]&&(b[a]=b[a].destroy())})}};wb.prototype={init:function(a,b){var c=b.borderWidth,d=b.style,e=C(d.padding);this.chart=a;this.options=b;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.label= |
|||
a.renderer.label("",0,0,b.shape,null,null,b.useHTML,null,"tooltip").attr({padding:e,fill:b.backgroundColor,"stroke-width":c,r:b.borderRadius,zIndex:8}).css(d).css({padding:0}).add().attr({y:-999});$||this.label.shadow(b.shadow);this.shared=b.shared},destroy:function(){n(this.crosshairs,function(a){a&&a.destroy()});if(this.label)this.label=this.label.destroy();clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(a,b,c,d){var e=this,f=e.now,g=e.options.animation!==!1&&!e.isHidden; |
|||
r(f,{x:g?(2*f.x+a)/3:a,y:g?(f.y+b)/2:b,anchorX:g?(2*f.anchorX+c)/3:c,anchorY:g?(f.anchorY+d)/2:d});e.label.attr(f);if(g&&(N(a-f.x)>1||N(b-f.y)>1))clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){e&&e.move(a,b,c,d)},32)},hide:function(){var a=this,b;clearTimeout(this.hideTimer);if(!this.isHidden)b=this.chart.hoverPoints,this.hideTimer=setTimeout(function(){a.label.fadeOut();a.isHidden=!0},o(this.options.hideDelay,500)),b&&n(b,function(a){a.setState()}),this.chart.hoverPoints= |
|||
null},hideCrosshairs:function(){n(this.crosshairs,function(a){a&&a.hide()})},getAnchor:function(a,b){var c,d=this.chart,e=d.inverted,f=d.plotTop,g=0,h=0,i,a=ja(a);c=a[0].tooltipPos;this.followPointer&&b&&(b.chartX===w&&(b=d.pointer.normalize(b)),c=[b.chartX-d.plotLeft,b.chartY-f]);c||(n(a,function(a){i=a.series.yAxis;g+=a.plotX;h+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!e&&i?i.top-f:0)}),g/=a.length,h/=a.length,c=[e?d.plotWidth-h:g,this.shared&&!e&&a.length>1&&b?b.chartY-f:e?d.plotHeight-g: |
|||
h]);return Na(c,t)},getPosition:function(a,b,c){var d=this.chart,e=d.plotLeft,f=d.plotTop,g=d.plotWidth,h=d.plotHeight,i=o(this.options.distance,12),j=c.plotX,c=c.plotY,d=j+e+(d.inverted?i:-a-i),k=c-b+f+15,l;d<7&&(d=e+s(j,0)+i);d+a>e+g&&(d-=d+a-(e+g),k=c-b+f-i,l=!0);k<f+5&&(k=f+5,l&&c>=k&&c<=k+b&&(k=c+f+i));k+b>f+h&&(k=s(f,f+h-b-i));return{x:d,y:k}},defaultFormatter:function(a){var b=this.points||ja(this),c=b[0].series,d;d=[c.tooltipHeaderFormatter(b[0])];n(b,function(a){c=a.series;d.push(c.tooltipFormatter&& |
|||
c.tooltipFormatter(a)||a.point.tooltipFormatter(c.tooltipOptions.pointFormat))});d.push(a.options.footerFormat||"");return d.join("")},refresh:function(a,b){var c=this.chart,d=this.label,e=this.options,f,g,h={},i,j=[];i=e.formatter||this.defaultFormatter;var h=c.hoverPoints,k,l=e.crosshairs,m=this.shared;clearTimeout(this.hideTimer);this.followPointer=ja(a)[0].series.tooltipOptions.followPointer;g=this.getAnchor(a,b);f=g[0];g=g[1];m&&(!a.series||!a.series.noSharedTooltip)?(c.hoverPoints=a,h&&n(h, |
|||
function(a){a.setState()}),n(a,function(a){a.setState("hover");j.push(a.getLabelConfig())}),h={x:a[0].category,y:a[0].y},h.points=j,a=a[0]):h=a.getLabelConfig();i=i.call(h,this);h=a.series;i===!1?this.hide():(this.isHidden&&(Wa(d),d.attr("opacity",1).show()),d.attr({text:i}),k=e.borderColor||a.color||h.color||"#606060",d.attr({stroke:k}),this.updatePosition({plotX:f,plotY:g}),this.isHidden=!1);if(l){l=ja(l);for(d=l.length;d--;)if(m=a.series,e=m[d?"yAxis":"xAxis"],l[d]&&e)if(h=d?o(a.stackY,a.y):a.x, |
|||
e.isLog&&(h=na(h)),d===1&&m.modifyValue&&(h=m.modifyValue(h)),e=e.getPlotLinePath(h,1),this.crosshairs[d])this.crosshairs[d].attr({d:e,visibility:"visible"});else{h={"stroke-width":l[d].width||1,stroke:l[d].color||"#C0C0C0",zIndex:l[d].zIndex||2};if(l[d].dashStyle)h.dashstyle=l[d].dashStyle;this.crosshairs[d]=c.renderer.path(e).attr(h).add()}}z(c,"tooltipRefresh",{text:i,x:f+c.plotLeft,y:g+c.plotTop,borderColor:k})},updatePosition:function(a){var b=this.chart,c=this.label,c=(this.options.positioner|| |
|||
this.getPosition).call(this,c.width,c.height,a);this.move(t(c.x),t(c.y),a.plotX+b.plotLeft,a.plotY+b.plotTop)}};xb.prototype={init:function(a,b){var c=b.chart,d=c.events,e=$?"":c.zoomType,c=a.inverted,f;this.options=b;this.chart=a;this.zoomX=f=/x/.test(e);this.zoomY=e=/y/.test(e);this.zoomHor=f&&!c||e&&c;this.zoomVert=e&&!c||f&&c;this.runChartClick=d&&!!d.click;this.pinchDown=[];this.lastValidTouch={};if(b.tooltip.enabled)a.tooltip=new wb(a,b.tooltip);this.setDOMEvents()},normalize:function(a,b){var c, |
|||
d,a=a||O.event;if(!a.target)a.target=a.srcElement;a=Xb(a);d=a.touches?a.touches.item(0):a;if(!b)this.chartPosition=b=Wb(this.chart.container);d.pageX===w?(c=s(a.x,a.clientX-b.left),d=a.y):(c=d.pageX-b.left,d=d.pageY-b.top);return r(a,{chartX:t(c),chartY:t(d)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};n(this.chart.axes,function(c){b[c.isXAxis?"xAxis":"yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})});return b},getIndex:function(a){var b=this.chart;return b.inverted? |
|||
b.plotHeight+b.plotTop-a.chartY:a.chartX-b.plotLeft},runPointActions:function(a){var b=this.chart,c=b.series,d=b.tooltip,e,f=b.hoverPoint,g=b.hoverSeries,h,i,j=b.chartWidth,k=this.getIndex(a);if(d&&this.options.tooltip.shared&&(!g||!g.noSharedTooltip)){e=[];h=c.length;for(i=0;i<h;i++)if(c[i].visible&&c[i].options.enableMouseTracking!==!1&&!c[i].noSharedTooltip&&c[i].tooltipPoints.length&&(b=c[i].tooltipPoints[k])&&b.series)b._dist=N(k-b.clientX),j=I(j,b._dist),e.push(b);for(h=e.length;h--;)e[h]._dist> |
|||
j&&e.splice(h,1);if(e.length&&e[0].clientX!==this.hoverX)d.refresh(e,a),this.hoverX=e[0].clientX}if(g&&g.tracker){if((b=g.tooltipPoints[k])&&b!==f)b.onMouseOver(a)}else d&&d.followPointer&&!d.isHidden&&(a=d.getAnchor([{}],a),d.updatePosition({plotX:a[0],plotY:a[1]}))},reset:function(a){var b=this.chart,c=b.hoverSeries,d=b.hoverPoint,e=b.tooltip,b=e&&e.shared?b.hoverPoints:d;(a=a&&e&&b)&&ja(b)[0].plotX===w&&(a=!1);if(a)e.refresh(b);else{if(d)d.onMouseOut();if(c)c.onMouseOut();e&&(e.hide(),e.hideCrosshairs()); |
|||
this.hoverX=null}},scaleGroups:function(a,b){var c=this.chart,d;n(c.series,function(e){d=a||e.getPlotBox();e.xAxis&&e.xAxis.zoomEnabled&&(e.group.attr(d),e.markerGroup&&(e.markerGroup.attr(d),e.markerGroup.clip(b?c.clipRect:null)),e.dataLabelsGroup&&e.dataLabelsGroup.attr(d))});c.clipRect.attr(b||c.clipBox)},pinchTranslateDirection:function(a,b,c,d,e,f,g){var h=this.chart,i=a?"x":"y",j=a?"X":"Y",k="chart"+j,l=a?"width":"height",m=h["plot"+(a?"Left":"Top")],p,q,o=1,n=h.inverted,s=h.bounds[a?"h":"v"], |
|||
t=b.length===1,u=b[0][k],r=c[0][k],w=!t&&b[1][k],v=!t&&c[1][k],x,c=function(){!t&&N(u-w)>20&&(o=N(r-v)/N(u-w));q=(m-r)/o+u;p=h["plot"+(a?"Width":"Height")]/o};c();b=q;b<s.min?(b=s.min,x=!0):b+p>s.max&&(b=s.max-p,x=!0);x?(r-=0.8*(r-g[i][0]),t||(v-=0.8*(v-g[i][1])),c()):g[i]=[r,v];n||(f[i]=q-m,f[l]=p);f=n?1/o:o;e[l]=p;e[i]=b;d[n?a?"scaleY":"scaleX":"scale"+j]=o;d["translate"+j]=f*m+(r-f*u)},pinch:function(a){var b=this,c=b.chart,d=b.pinchDown,e=c.tooltip&&c.tooltip.options.followTouchMove,f=a.touches, |
|||
g=f.length,h=b.lastValidTouch,i=b.zoomHor||b.pinchHor,j=b.zoomVert||b.pinchVert,k=i||j,l=b.selectionMarker,m={},p=g===1&&(b.inClass(a.target,"highcharts-tracker")&&c.runTrackerClick||c.runChartClick),q={};(k||e)&&!p&&a.preventDefault();Na(f,function(a){return b.normalize(a)});if(a.type==="touchstart")n(f,function(a,b){d[b]={chartX:a.chartX,chartY:a.chartY}}),h.x=[d[0].chartX,d[1]&&d[1].chartX],h.y=[d[0].chartY,d[1]&&d[1].chartY],n(c.axes,function(a){if(a.zoomEnabled){var b=c.bounds[a.horiz?"h":"v"], |
|||
d=a.minPixelPadding,e=a.toPixels(a.dataMin),f=a.toPixels(a.dataMax),g=I(e,f),e=s(e,f);b.min=I(a.pos,g-d);b.max=s(a.pos+a.len,e+d)}});else if(d.length){if(!l)b.selectionMarker=l=r({destroy:pa},c.plotBox);i&&b.pinchTranslateDirection(!0,d,f,m,l,q,h);j&&b.pinchTranslateDirection(!1,d,f,m,l,q,h);b.hasPinched=k;b.scaleGroups(m,q);!k&&e&&g===1&&this.runPointActions(b.normalize(a))}},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type;b.cancelClick=!1;b.mouseDownX=this.mouseDownX=a.chartX;b.mouseDownY= |
|||
this.mouseDownY=a.chartY},drag:function(a){var b=this.chart,c=b.options.chart,d=a.chartX,e=a.chartY,f=this.zoomHor,g=this.zoomVert,h=b.plotLeft,i=b.plotTop,j=b.plotWidth,k=b.plotHeight,l,m=this.mouseDownX,p=this.mouseDownY;d<h?d=h:d>h+j&&(d=h+j);e<i?e=i:e>i+k&&(e=i+k);this.hasDragged=Math.sqrt(Math.pow(m-d,2)+Math.pow(p-e,2));if(this.hasDragged>10){l=b.isInsidePlot(m-h,p-i);if(b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&l&&!this.selectionMarker)this.selectionMarker=b.renderer.rect(h,i,f?1:j,g? |
|||
1:k,0).attr({fill:c.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add();this.selectionMarker&&f&&(d-=m,this.selectionMarker.attr({width:N(d),x:(d>0?0:d)+m}));this.selectionMarker&&g&&(d=e-p,this.selectionMarker.attr({height:N(d),y:(d>0?0:d)+p}));l&&!this.selectionMarker&&c.panning&&b.pan(a,c.panning)}},drop:function(a){var b=this.chart,c=this.hasPinched;if(this.selectionMarker){var d={xAxis:[],yAxis:[],originalEvent:a.originalEvent||a},e=this.selectionMarker,f=e.x,g=e.y,h;if(this.hasDragged|| |
|||
c)n(b.axes,function(a){if(a.zoomEnabled){var b=a.horiz,c=a.toValue(b?f:g),b=a.toValue(b?f+e.width:g+e.height);!isNaN(c)&&!isNaN(b)&&(d[a.xOrY+"Axis"].push({axis:a,min:I(c,b),max:s(c,b)}),h=!0)}}),h&&z(b,"selection",d,function(a){b.zoom(r(a,c?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();c&&this.scaleGroups()}if(b)K(b.container,{cursor:b._cursor}),b.cancelClick=this.hasDragged>10,b.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[]},onContainerMouseDown:function(a){a= |
|||
this.normalize(a);a.preventDefault&&a.preventDefault();this.dragStart(a)},onDocumentMouseUp:function(a){this.drop(a)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition,d=b.hoverSeries,a=this.normalize(a,c);c&&d&&!this.inClass(a.target,"highcharts-tracker")&&!b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&this.reset()},onContainerMouseLeave:function(){this.reset();this.chartPosition=null},onContainerMouseMove:function(a){var b=this.chart,a=this.normalize(a);a.returnValue= |
|||
!1;b.mouseIsDown==="mousedown"&&this.drag(a);(this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop))&&!b.openMenu&&this.runPointActions(a)},inClass:function(a,b){for(var c;a;){if(c=v(a,"class"))if(c.indexOf(b)!==-1)return!0;else if(c.indexOf("highcharts-container")!==-1)return!1;a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries;if(b&&!b.options.stickyTracking&&!this.inClass(a.toElement||a.relatedTarget,"highcharts-tooltip"))b.onMouseOut()}, |
|||
onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,e=b.plotTop,f=b.inverted,g,h,i,a=this.normalize(a);a.cancelBubble=!0;if(!b.cancelClick)c&&this.inClass(a.target,"highcharts-tracker")?(g=this.chartPosition,h=c.plotX,i=c.plotY,r(c,{pageX:g.left+d+(f?b.plotWidth-i:h),pageY:g.top+e+(f?b.plotHeight-h:i)}),z(c.series,"click",r(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(r(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&z(b,"click",a))},onContainerTouchStart:function(a){var b= |
|||
this.chart;a.touches.length===1?(a=this.normalize(a),b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)?(this.runPointActions(a),this.pinch(a)):this.reset()):a.touches.length===2&&this.pinch(a)},onContainerTouchMove:function(a){(a.touches.length===1||a.touches.length===2)&&this.pinch(a)},onDocumentTouchEnd:function(a){this.drop(a)},setDOMEvents:function(){var a=this,b=a.chart.container,c;this._events=c=[[b,"onmousedown","onContainerMouseDown"],[b,"onmousemove","onContainerMouseMove"],[b,"onclick", |
|||
"onContainerClick"],[b,"mouseleave","onContainerMouseLeave"],[y,"mousemove","onDocumentMouseMove"],[y,"mouseup","onDocumentMouseUp"]];ib&&c.push([b,"ontouchstart","onContainerTouchStart"],[b,"ontouchmove","onContainerTouchMove"],[y,"touchend","onDocumentTouchEnd"]);n(c,function(b){a["_"+b[2]]=function(c){a[b[2]](c)};b[1].indexOf("on")===0?b[0][b[1]]=a["_"+b[2]]:J(b[0],b[1],a["_"+b[2]])})},destroy:function(){var a=this;n(a._events,function(b){b[1].indexOf("on")===0?b[0][b[1]]=null:aa(b[0],b[1],a["_"+ |
|||
b[2]])});delete a._events;clearInterval(a.tooltipTimeout)}};eb.prototype={init:function(a,b){var c=this,d=b.itemStyle,e=o(b.padding,8),f=b.itemMarginTop||0;this.options=b;if(b.enabled)c.baseline=C(d.fontSize)+3+f,c.itemStyle=d,c.itemHiddenStyle=x(d,b.itemHiddenStyle),c.itemMarginTop=f,c.padding=e,c.initialItemX=e,c.initialItemY=e-5,c.maxItemWidth=0,c.chart=a,c.itemHeight=0,c.lastLineHeight=0,c.render(),J(c.chart,"endResize",function(){c.positionCheckboxes()})},colorizeItem:function(a,b){var c=this.options, |
|||
d=a.legendItem,e=a.legendLine,f=a.legendSymbol,g=this.itemHiddenStyle.color,c=b?c.itemStyle.color:g,h=b?a.color:g,g=a.options&&a.options.marker,i={stroke:h,fill:h},j;d&&d.css({fill:c,color:c});e&&e.attr({stroke:h});if(f){if(g&&f.isMarker)for(j in g=a.convertAttribs(g),g)d=g[j],d!==w&&(i[j]=d);f.attr(i)}},positionItem:function(a){var b=this.options,c=b.symbolPadding,b=!b.rtl,d=a._legendItemPos,e=d[0],d=d[1],f=a.checkbox;a.legendGroup&&a.legendGroup.translate(b?e:this.legendWidth-e-2*c-4,d);if(f)f.x= |
|||
e,f.y=d},destroyItem:function(a){var b=a.checkbox;n(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())});b&&Ta(a.checkbox)},destroy:function(){var a=this.group,b=this.box;if(b)this.box=b.destroy();if(a)this.group=a.destroy()},positionCheckboxes:function(a){var b=this.group.alignAttr,c,d=this.clipHeight||this.legendHeight;if(b)c=b.translateY,n(this.allItems,function(e){var f=e.checkbox,g;f&&(g=c+f.y+(a||0)+3,K(f,{left:b.translateX+e.legendItemWidth+f.x- |
|||
20+"px",top:g+"px",display:g>c-6&&g<c+d-6?"":S}))})},renderTitle:function(){var a=this.padding,b=this.options.title,c=0;if(b.text){if(!this.title)this.title=this.chart.renderer.label(b.text,a-3,a-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(b.style).add(this.group);a=this.title.getBBox();c=a.height;this.offsetWidth=a.width;this.contentGroup.attr({translateY:c})}this.titleHeight=c},renderItem:function(a){var B;var b=this,c=b.chart,d=c.renderer,e=b.options,f=e.layout==="horizontal", |
|||
g=e.symbolWidth,h=e.symbolPadding,i=b.itemStyle,j=b.itemHiddenStyle,k=b.padding,l=f?o(e.itemDistance,8):0,m=!e.rtl,p=e.width,q=e.itemMarginBottom||0,n=b.itemMarginTop,A=b.initialItemX,t=a.legendItem,u=a.series||a,r=u.options,w=r.showCheckbox,v=e.useHTML;if(!t&&(a.legendGroup=d.g("legend-item").attr({zIndex:1}).add(b.scrollGroup),u.drawLegendSymbol(b,a),a.legendItem=t=d.text(e.labelFormat?Ca(e.labelFormat,a):e.labelFormatter.call(a),m?g+h:-h,b.baseline,v).css(x(a.visible?i:j)).attr({align:m?"left": |
|||
"right",zIndex:2}).add(a.legendGroup),(v?t:a.legendGroup).on("mouseover",function(){a.setState("hover");t.css(b.options.itemHoverStyle)}).on("mouseout",function(){t.css(a.visible?i:j);a.setState()}).on("click",function(b){var c=function(){a.setVisible()},b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):z(a,"legendItemClick",b,c)}),b.colorizeItem(a,a.visible),r&&w))a.checkbox=U("input",{type:"checkbox",checked:a.selected,defaultChecked:a.selected},e.itemCheckboxStyle,c.container), |
|||
J(a.checkbox,"click",function(b){z(a,"checkboxClick",{checked:b.target.checked},function(){a.select()})});d=t.getBBox();B=a.legendItemWidth=e.itemWidth||g+h+d.width+l+(w?20:0),e=B;b.itemHeight=g=d.height;if(f&&b.itemX-A+e>(p||c.chartWidth-2*k-A))b.itemX=A,b.itemY+=n+b.lastLineHeight+q,b.lastLineHeight=0;b.maxItemWidth=s(b.maxItemWidth,e);b.lastItemY=n+b.itemY+q;b.lastLineHeight=s(g,b.lastLineHeight);a._legendItemPos=[b.itemX,b.itemY];f?b.itemX+=e:(b.itemY+=n+g+q,b.lastLineHeight=g);b.offsetWidth= |
|||
p||s((f?b.itemX-A-l:e)+k,b.offsetWidth)},render:function(){var a=this,b=a.chart,c=b.renderer,d=a.group,e,f,g,h,i=a.box,j=a.options,k=a.padding,l=j.borderWidth,m=j.backgroundColor;a.itemX=a.initialItemX;a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;if(!d)a.group=d=c.g("legend").attr({zIndex:7}).add(),a.contentGroup=c.g().attr({zIndex:1}).add(d),a.scrollGroup=c.g().add(a.contentGroup);a.renderTitle();e=[];n(b.series,function(a){var b=a.options;b.showInLegend&&!u(b.linkedTo)&&(e=e.concat(a.legendItems|| |
|||
(b.legendType==="point"?a.data:a)))});Kb(e,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});j.reversed&&e.reverse();a.allItems=e;a.display=f=!!e.length;n(e,function(b){a.renderItem(b)});g=j.width||a.offsetWidth;h=a.lastItemY+a.lastLineHeight+a.titleHeight;h=a.handleOverflow(h);if(l||m){g+=k;h+=k;if(i){if(g>0&&h>0)i[i.isNew?"attr":"animate"](i.crisp(null,null,null,g,h)),i.isNew=!1}else a.box=i=c.rect(0,0,g,h,j.borderRadius,l||0).attr({stroke:j.borderColor, |
|||
"stroke-width":l||0,fill:m||S}).add(d).shadow(j.shadow),i.isNew=!0;i[f?"show":"hide"]()}a.legendWidth=g;a.legendHeight=h;n(e,function(b){a.positionItem(b)});f&&d.align(r({width:g,height:h},j),!0,"spacingBox");b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var b=this,c=this.chart,d=c.renderer,e=this.options,f=e.y,f=c.spacingBox.height+(e.verticalAlign==="top"?-f:f)-this.padding,g=e.maxHeight,h=this.clipRect,i=e.navigation,j=o(i.animation,!0),k=i.arrowSize||12,l=this.nav;e.layout=== |
|||
"horizontal"&&(f/=2);g&&(f=I(f,g));if(a>f&&!e.useHTML){this.clipHeight=c=f-20-this.titleHeight;this.pageCount=xa(a/c);this.currentPage=o(this.currentPage,1);this.fullHeight=a;if(!h)h=b.clipRect=d.clipRect(0,0,9999,0),b.contentGroup.clip(h);h.attr({height:c});if(!l)this.nav=l=d.g().attr({zIndex:1}).add(this.group),this.up=d.symbol("triangle",0,0,k,k).on("click",function(){b.scroll(-1,j)}).add(l),this.pager=d.text("",15,10).css(i.style).add(l),this.down=d.symbol("triangle-down",0,0,k,k).on("click", |
|||
function(){b.scroll(1,j)}).add(l);b.scroll(0);a=f}else if(l)h.attr({height:c.chartHeight}),l.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0;return a},scroll:function(a,b){var c=this.pageCount,d=this.currentPage+a,e=this.clipHeight,f=this.options.navigation,g=f.activeColor,h=f.inactiveColor,f=this.pager,i=this.padding;d>c&&(d=c);if(d>0)b!==w&&La(b,this.chart),this.nav.attr({translateX:i,translateY:e+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:d===1?h:g}).css({cursor:d=== |
|||
1?"default":"pointer"}),f.attr({text:d+"/"+this.pageCount}),this.down.attr({x:18+this.pager.getBBox().width,fill:d===c?h:g}).css({cursor:d===c?"default":"pointer"}),e=-I(e*(d-1),this.fullHeight-e+i)+1,this.scrollGroup.animate({translateY:e}),f.attr({text:d+"/"+c}),this.currentPage=d,this.positionCheckboxes(e)}};/Trident.*?11\.0/.test(oa)&&mb(eb.prototype,"positionItem",function(a,b){var c=this;setTimeout(function(){a.call(c,b)})});yb.prototype={init:function(a,b){var c,d=a.series;a.series=null;c= |
|||
x(M,a);c.series=a.series=d;d=c.chart;this.margin=this.splashArray("margin",d);this.spacing=this.splashArray("spacing",d);var e=d.events;this.bounds={h:{},v:{}};this.callback=b;this.isResizing=0;this.options=c;this.axes=[];this.series=[];this.hasCartesianSeries=d.showAxes;var f=this,g;f.index=Ga.length;Ga.push(f);d.reflow!==!1&&J(f,"load",function(){f.initReflow()});if(e)for(g in e)J(f,g,e[g]);f.xAxis=[];f.yAxis=[];f.animation=$?!1:o(d.animation,!0);f.pointCount=0;f.counters=new Jb;f.firstRender()}, |
|||
initSeries:function(a){var b=this.options.chart;(b=W[a.type||b.type||b.defaultSeriesType])||ka(17,!0);b=new b;b.init(this,a);return b},addSeries:function(a,b,c){var d,e=this;a&&(b=o(b,!0),z(e,"addSeries",{options:a},function(){d=e.initSeries(a);e.isDirtyLegend=!0;e.linkSeries();b&&e.redraw(c)}));return d},addAxis:function(a,b,c,d){var e=b?"xAxis":"yAxis",f=this.options;new db(this,x(a,{index:this[e].length,isX:b}));f[e]=ja(f[e]||{});f[e].push(a);o(c,!0)&&this.redraw(d)},isInsidePlot:function(a,b, |
|||
c){var d=c?b:a,a=c?a:b;return d>=0&&d<=this.plotWidth&&a>=0&&a<=this.plotHeight},adjustTickAmounts:function(){this.options.chart.alignTicks!==!1&&n(this.axes,function(a){a.adjustTickAmount()});this.maxTicks=null},redraw:function(a){var b=this.axes,c=this.series,d=this.pointer,e=this.legend,f=this.isDirtyLegend,g,h,i=this.isDirtyBox,j=c.length,k=j,l=this.renderer,m=l.isHidden(),p=[];La(a,this);m&&this.cloneRenderTo();for(this.layOutTitles();k--;)if(a=c[k],a.options.stacking&&(g=!0,a.isDirty)){h=!0; |
|||
break}if(h)for(k=j;k--;)if(a=c[k],a.options.stacking)a.isDirty=!0;n(c,function(a){a.isDirty&&a.options.legendType==="point"&&(f=!0)});if(f&&e.options.enabled)e.render(),this.isDirtyLegend=!1;g&&this.getStacks();if(this.hasCartesianSeries){if(!this.isResizing)this.maxTicks=null,n(b,function(a){a.setScale()});this.adjustTickAmounts();this.getMargins();n(b,function(a){a.isDirty&&(i=!0)});n(b,function(a){if(a.isDirtyExtremes)a.isDirtyExtremes=!1,p.push(function(){z(a,"afterSetExtremes",r(a.eventArgs, |
|||
a.getExtremes()));delete a.eventArgs});(i||g)&&a.redraw()})}i&&this.drawChartBox();n(c,function(a){a.isDirty&&a.visible&&(!a.isCartesian||a.xAxis)&&a.redraw()});d&&d.reset&&d.reset(!0);l.draw();z(this,"redraw");m&&this.cloneRenderTo(!0);n(p,function(a){a.call()})},showLoading:function(a){var b=this.options,c=this.loadingDiv,d=b.loading;if(!c)this.loadingDiv=c=U(Ea,{className:"highcharts-loading"},r(d.style,{zIndex:10,display:S}),this.container),this.loadingSpan=U("span",null,d.labelStyle,c);this.loadingSpan.innerHTML= |
|||
a||b.lang.loading;if(!this.loadingShown)K(c,{opacity:0,display:"",left:this.plotLeft+"px",top:this.plotTop+"px",width:this.plotWidth+"px",height:this.plotHeight+"px"}),Bb(c,{opacity:d.style.opacity},{duration:d.showDuration||0}),this.loadingShown=!0},hideLoading:function(){var a=this.options,b=this.loadingDiv;b&&Bb(b,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){K(b,{display:S})}});this.loadingShown=!1},get:function(a){var b=this.axes,c=this.series,d,e;for(d=0;d<b.length;d++)if(b[d].options.id=== |
|||
a)return b[d];for(d=0;d<c.length;d++)if(c[d].options.id===a)return c[d];for(d=0;d<c.length;d++){e=c[d].points||[];for(b=0;b<e.length;b++)if(e[b].id===a)return e[b]}return null},getAxes:function(){var a=this,b=this.options,c=b.xAxis=ja(b.xAxis||{}),b=b.yAxis=ja(b.yAxis||{});n(c,function(a,b){a.index=b;a.isX=!0});n(b,function(a,b){a.index=b});c=c.concat(b);n(c,function(b){new db(a,b)});a.adjustTickAmounts()},getSelectedPoints:function(){var a=[];n(this.series,function(b){a=a.concat(ub(b.points||[], |
|||
function(a){return a.selected}))});return a},getSelectedSeries:function(){return ub(this.series,function(a){return a.selected})},getStacks:function(){var a=this;n(a.yAxis,function(a){if(a.stacks&&a.hasVisibleSeries)a.oldStacks=a.stacks});n(a.series,function(b){if(b.options.stacking&&(b.visible===!0||a.options.chart.ignoreHiddenSeries===!1))b.stackKey=b.type+o(b.options.stack,"")})},showResetZoom:function(){var a=this,b=M.lang,c=a.options.chart.resetZoomButton,d=c.theme,e=d.states,f=c.relativeTo=== |
|||
"chart"?null:"plotBox";this.resetZoomButton=a.renderer.button(b.resetZoom,null,null,function(){a.zoomOut()},d,e&&e.hover).attr({align:c.position.align,title:b.resetZoomTitle}).add().align(c.position,!1,f)},zoomOut:function(){var a=this;z(a,"selection",{resetSelection:!0},function(){a.zoom()})},zoom:function(a){var b,c=this.pointer,d=!1,e;!a||a.resetSelection?n(this.axes,function(a){b=a.zoom()}):n(a.xAxis.concat(a.yAxis),function(a){var e=a.axis,h=e.isXAxis;if(c[h?"zoomX":"zoomY"]||c[h?"pinchX":"pinchY"])b= |
|||
e.zoom(a.min,a.max),e.displayBtn&&(d=!0)});e=this.resetZoomButton;if(d&&!e)this.showResetZoom();else if(!d&&T(e))this.resetZoomButton=e.destroy();b&&this.redraw(o(this.options.chart.animation,a&&a.animation,this.pointCount<100))},pan:function(a,b){var c=this,d=c.hoverPoints,e;d&&n(d,function(a){a.setState()});n(b==="xy"?[1,0]:[1],function(b){var d=a[b?"chartX":"chartY"],h=c[b?"xAxis":"yAxis"][0],i=c[b?"mouseDownX":"mouseDownY"],j=(h.pointRange||0)/2,k=h.getExtremes(),l=h.toValue(i-d,!0)+j,i=h.toValue(i+ |
|||
c[b?"plotWidth":"plotHeight"]-d,!0)-j;h.series.length&&l>I(k.dataMin,k.min)&&i<s(k.dataMax,k.max)&&(h.setExtremes(l,i,!1,!1,{trigger:"pan"}),e=!0);c[b?"mouseDownX":"mouseDownY"]=d});e&&c.redraw(!1);K(c.container,{cursor:"move"})},setTitle:function(a,b){var f;var c=this,d=c.options,e;e=d.title=x(d.title,a);f=d.subtitle=x(d.subtitle,b),d=f;n([["title",a,e],["subtitle",b,d]],function(a){var b=a[0],d=c[b],e=a[1],a=a[2];d&&e&&(c[b]=d=d.destroy());a&&a.text&&!d&&(c[b]=c.renderer.text(a.text,0,0,a.useHTML).attr({align:a.align, |
|||
"class":"highcharts-"+b,zIndex:a.zIndex||4}).css(a.style).add())});c.layOutTitles()},layOutTitles:function(){var a=0,b=this.title,c=this.subtitle,d=this.options,e=d.title,d=d.subtitle,f=this.spacingBox.width-44;if(b&&(b.css({width:(e.width||f)+"px"}).align(r({y:15},e),!1,"spacingBox"),!e.floating&&!e.verticalAlign))a=b.getBBox().height,a>=18&&a<=25&&(a=15);c&&(c.css({width:(d.width||f)+"px"}).align(r({y:a+e.margin},d),!1,"spacingBox"),!d.floating&&!d.verticalAlign&&(a=xa(a+c.getBBox().height)));this.titleOffset= |
|||
a},getChartSize:function(){var a=this.options.chart,b=this.renderToClone||this.renderTo;this.containerWidth=jb(b,"width");this.containerHeight=jb(b,"height");this.chartWidth=s(0,a.width||this.containerWidth||600);this.chartHeight=s(0,o(a.height,this.containerHeight>19?this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container;a?b&&(this.renderTo.appendChild(c),Ta(b),delete this.renderToClone):(c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone= |
|||
b=this.renderTo.cloneNode(0),K(b,{position:"absolute",top:"-9999px",display:"block"}),y.body.appendChild(b),c&&b.appendChild(c))},getContainer:function(){var a,b=this.options.chart,c,d,e;this.renderTo=a=b.renderTo;e="highcharts-"+zb++;if(ea(a))this.renderTo=a=y.getElementById(a);a||ka(13,!0);c=C(v(a,"data-highcharts-chart"));!isNaN(c)&&Ga[c]&&Ga[c].destroy();v(a,"data-highcharts-chart",this.index);a.innerHTML="";a.offsetWidth||this.cloneRenderTo();this.getChartSize();c=this.chartWidth;d=this.chartHeight; |
|||
this.container=a=U(Ea,{className:"highcharts-container"+(b.className?" "+b.className:""),id:e},r({position:"relative",overflow:"hidden",width:c+"px",height:d+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},b.style),this.renderToClone||a);this._cursor=a.style.cursor;this.renderer=b.forExport?new Ha(a,c,d,!0):new Va(a,c,d);$&&this.renderer.create(this,a,c,d)},getMargins:function(){var a=this.spacing,b,c=this.legend,d=this.margin,e=this.options.legend, |
|||
f=o(e.margin,10),g=e.x,h=e.y,i=e.align,j=e.verticalAlign,k=this.titleOffset;this.resetMargins();b=this.axisOffset;if(k&&!u(d[0]))this.plotTop=s(this.plotTop,k+this.options.title.margin+a[0]);if(c.display&&!e.floating)if(i==="right"){if(!u(d[1]))this.marginRight=s(this.marginRight,c.legendWidth-g+f+a[1])}else if(i==="left"){if(!u(d[3]))this.plotLeft=s(this.plotLeft,c.legendWidth+g+f+a[3])}else if(j==="top"){if(!u(d[0]))this.plotTop=s(this.plotTop,c.legendHeight+h+f+a[0])}else if(j==="bottom"&&!u(d[2]))this.marginBottom= |
|||
s(this.marginBottom,c.legendHeight-h+f+a[2]);this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);this.hasCartesianSeries&&n(this.axes,function(a){a.getOffset()});u(d[3])||(this.plotLeft+=b[3]);u(d[0])||(this.plotTop+=b[0]);u(d[2])||(this.marginBottom+=b[2]);u(d[1])||(this.marginRight+=b[1]);this.setChartSize()},initReflow:function(){function a(a){var g=c.width||jb(d,"width"),h=c.height||jb(d,"height"),a=a?a.target:O;if(!b.hasUserSize&& |
|||
g&&h&&(a===O||a===y)){if(g!==b.containerWidth||h!==b.containerHeight)clearTimeout(e),b.reflowTimeout=e=setTimeout(function(){if(b.container)b.setSize(g,h,!1),b.hasUserSize=null},100);b.containerWidth=g;b.containerHeight=h}}var b=this,c=b.options.chart,d=b.renderTo,e;b.reflow=a;J(O,"resize",a);J(b,"destroy",function(){aa(O,"resize",a)})},setSize:function(a,b,c){var d=this,e,f,g;d.isResizing+=1;g=function(){d&&z(d,"endResize",null,function(){d.isResizing-=1})};La(c,d);d.oldChartHeight=d.chartHeight; |
|||
d.oldChartWidth=d.chartWidth;if(u(a))d.chartWidth=e=s(0,t(a)),d.hasUserSize=!!e;if(u(b))d.chartHeight=f=s(0,t(b));K(d.container,{width:e+"px",height:f+"px"});d.setChartSize(!0);d.renderer.setSize(e,f,c);d.maxTicks=null;n(d.axes,function(a){a.isDirty=!0;a.setScale()});n(d.series,function(a){a.isDirty=!0});d.isDirtyLegend=!0;d.isDirtyBox=!0;d.getMargins();d.redraw(c);d.oldChartHeight=null;z(d,"resize");Fa===!1?g():setTimeout(g,Fa&&Fa.duration||500)},setChartSize:function(a){var b=this.inverted,c=this.renderer, |
|||
d=this.chartWidth,e=this.chartHeight,f=this.options.chart,g=this.spacing,h=this.clipOffset,i,j,k,l;this.plotLeft=i=t(this.plotLeft);this.plotTop=j=t(this.plotTop);this.plotWidth=k=s(0,t(d-i-this.marginRight));this.plotHeight=l=s(0,t(e-j-this.marginBottom));this.plotSizeX=b?l:k;this.plotSizeY=b?k:l;this.plotBorderWidth=f.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:g[3],y:g[0],width:d-g[3]-g[1],height:e-g[0]-g[2]};this.plotBox=c.plotBox={x:i,y:j,width:k,height:l};d=2*P(this.plotBorderWidth/2); |
|||
b=xa(s(d,h[3])/2);c=xa(s(d,h[0])/2);this.clipBox={x:b,y:c,width:P(this.plotSizeX-s(d,h[1])/2-b),height:P(this.plotSizeY-s(d,h[2])/2-c)};a||n(this.axes,function(a){a.setAxisSize();a.setAxisTranslation()})},resetMargins:function(){var a=this.spacing,b=this.margin;this.plotTop=o(b[0],a[0]);this.marginRight=o(b[1],a[1]);this.marginBottom=o(b[2],a[2]);this.plotLeft=o(b[3],a[3]);this.axisOffset=[0,0,0,0];this.clipOffset=[0,0,0,0]},drawChartBox:function(){var a=this.options.chart,b=this.renderer,c=this.chartWidth, |
|||
d=this.chartHeight,e=this.chartBackground,f=this.plotBackground,g=this.plotBorder,h=this.plotBGImage,i=a.borderWidth||0,j=a.backgroundColor,k=a.plotBackgroundColor,l=a.plotBackgroundImage,m=a.plotBorderWidth||0,p,q=this.plotLeft,o=this.plotTop,n=this.plotWidth,s=this.plotHeight,t=this.plotBox,u=this.clipRect,r=this.clipBox;p=i+(a.shadow?8:0);if(i||j)if(e)e.animate(e.crisp(null,null,null,c-p,d-p));else{e={fill:j||S};if(i)e.stroke=a.borderColor,e["stroke-width"]=i;this.chartBackground=b.rect(p/2,p/ |
|||
2,c-p,d-p,a.borderRadius,i).attr(e).add().shadow(a.shadow)}if(k)f?f.animate(t):this.plotBackground=b.rect(q,o,n,s,0).attr({fill:k}).add().shadow(a.plotShadow);if(l)h?h.animate(t):this.plotBGImage=b.image(l,q,o,n,s).add();u?u.animate({width:r.width,height:r.height}):this.clipRect=b.clipRect(r);if(m)g?g.animate(g.crisp(null,q,o,n,s)):this.plotBorder=b.rect(q,o,n,s,0,-m).attr({stroke:a.plotBorderColor,"stroke-width":m,zIndex:1}).add();this.isDirtyBox=!1},propFromSeries:function(){var a=this,b=a.options.chart, |
|||
c,d=a.options.series,e,f;n(["inverted","angular","polar"],function(g){c=W[b.type||b.defaultSeriesType];f=a[g]||b[g]||c&&c.prototype[g];for(e=d&&d.length;!f&&e--;)(c=W[d[e].type])&&c.prototype[g]&&(f=!0);a[g]=f})},linkSeries:function(){var a=this,b=a.series;n(b,function(a){a.linkedSeries.length=0});n(b,function(b){var d=b.options.linkedTo;if(ea(d)&&(d=d===":previous"?a.series[b.index-1]:a.get(d)))d.linkedSeries.push(b),b.linkedParent=d})},render:function(){var a=this,b=a.axes,c=a.renderer,d=a.options, |
|||
e=d.labels,f=d.credits,g;a.setTitle();a.legend=new eb(a,d.legend);a.getStacks();n(b,function(a){a.setScale()});a.getMargins();a.maxTicks=null;n(b,function(a){a.setTickPositions(!0);a.setMaxTicks()});a.adjustTickAmounts();a.getMargins();a.drawChartBox();a.hasCartesianSeries&&n(b,function(a){a.render()});if(!a.seriesGroup)a.seriesGroup=c.g("series-group").attr({zIndex:3}).add();n(a.series,function(a){a.translate();a.setTooltipPoints();a.render()});e.items&&n(e.items,function(b){var d=r(e.style,b.style), |
|||
f=C(d.left)+a.plotLeft,g=C(d.top)+a.plotTop+12;delete d.left;delete d.top;c.text(b.html,f,g).attr({zIndex:2}).css(d).add()});if(f.enabled&&!a.credits)g=f.href,a.credits=c.text(f.text,0,0).on("click",function(){if(g)location.href=g}).attr({align:f.position.align,zIndex:8}).css(f.style).add().align(f.position);a.hasRendered=!0},destroy:function(){var a=this,b=a.axes,c=a.series,d=a.container,e,f=d&&d.parentNode;z(a,"destroy");Ga[a.index]=w;a.renderTo.removeAttribute("data-highcharts-chart");aa(a);for(e= |
|||
b.length;e--;)b[e]=b[e].destroy();for(e=c.length;e--;)c[e]=c[e].destroy();n("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,pointer,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),function(b){var c=a[b];c&&c.destroy&&(a[b]=c.destroy())});if(d)d.innerHTML="",aa(d),f&&Ta(d);for(e in a)delete a[e]},isReadyToRender:function(){var a=this;return!Z&&O==O.top&&y.readyState!=="complete"||$&&!O.canvg?($?Tb.push(function(){a.firstRender()}, |
|||
a.options.global.canvasToolsURL):y.attachEvent("onreadystatechange",function(){y.detachEvent("onreadystatechange",a.firstRender);y.readyState==="complete"&&a.firstRender()}),!1):!0},firstRender:function(){var a=this,b=a.options,c=a.callback;if(a.isReadyToRender())a.getContainer(),z(a,"init"),a.resetMargins(),a.setChartSize(),a.propFromSeries(),a.getAxes(),n(b.series||[],function(b){a.initSeries(b)}),a.linkSeries(),z(a,"beforeRender"),a.pointer=new xb(a,b),a.render(),a.renderer.draw(),c&&c.apply(a, |
|||
[a]),n(a.callbacks,function(b){b.apply(a,[a])}),a.cloneRenderTo(!0),z(a,"load")},splashArray:function(a,b){var c=b[a],c=T(c)?c:[c,c,c,c];return[o(b[a+"Top"],c[0]),o(b[a+"Right"],c[1]),o(b[a+"Bottom"],c[2]),o(b[a+"Left"],c[3])]}};yb.prototype.callbacks=[];var Pa=function(){};Pa.prototype={init:function(a,b,c){this.series=a;this.applyOptions(b,c);this.pointAttr={};if(a.options.colorByPoint&&(b=a.options.colors||a.chart.options.colors,this.color=this.color||b[a.colorCounter++],a.colorCounter===b.length))a.colorCounter= |
|||
0;a.chart.pointCount++;return this},applyOptions:function(a,b){var c=this.series,d=c.pointValKey,a=Pa.prototype.optionsToObject.call(this,a);r(this,a);this.options=this.options?r(this.options,a):a;if(d)this.y=this[d];if(this.x===w&&c)this.x=b===w?c.autoIncrement():b;return this},optionsToObject:function(a){var b,c=this.series,d=c.pointArrayMap||["y"],e=d.length,f=0,g=0;if(typeof a==="number"||a===null)b={y:a};else if(Ia(a)){b={};if(a.length>e){c=typeof a[0];if(c==="string")b.name=a[0];else if(c=== |
|||
"number")b.x=a[0];f++}for(;g<e;)b[d[g++]]=a[f++]}else if(typeof a==="object"){b=a;if(a.dataLabels)c._hasPointLabels=!0;if(a.marker)c._hasPointMarkers=!0}return b},destroy:function(){var a=this.series.chart,b=a.hoverPoints,c;a.pointCount--;if(b&&(this.setState(),ga(b,this),!b.length))a.hoverPoints=null;if(this===a.hoverPoint)this.onMouseOut();if(this.graphic||this.dataLabel)aa(this),this.destroyElements();this.legendItem&&a.legend.destroyItem(this);for(c in this)this[c]=null},destroyElements:function(){for(var a= |
|||
"graphic,dataLabel,dataLabelUpper,group,connector,shadowGroup".split(","),b,c=6;c--;)b=a[c],this[b]&&(this[b]=this[b].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},select:function(a,b){var c=this,d=c.series,e=d.chart,a=o(a,!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=c.options.selected=a;d.options.data[qa(c,d.data)]= |
|||
c.options;c.setState(a&&"select");b||n(e.getSelectedPoints(),function(a){if(a.selected&&a!==c)a.selected=a.options.selected=!1,d.options.data[qa(a,d.data)]=a.options,a.setState(""),a.firePointEvent("unselect")})})},onMouseOver:function(a){var b=this.series,c=b.chart,d=c.tooltip,e=c.hoverPoint;if(e&&e!==this)e.onMouseOut();this.firePointEvent("mouseOver");d&&(!d.shared||b.noSharedTooltip)&&d.refresh(this,a);this.setState("hover");c.hoverPoint=this},onMouseOut:function(){var a=this.series.chart,b=a.hoverPoints; |
|||
if(!b||qa(this,b)===-1)this.firePointEvent("mouseOut"),this.setState(),a.hoverPoint=null},tooltipFormatter:function(a){var b=this.series,c=b.tooltipOptions,d=o(c.valueDecimals,""),e=c.valuePrefix||"",f=c.valueSuffix||"";n(b.pointArrayMap||["y"],function(b){b="{point."+b;if(e||f)a=a.replace(b+"}",e+b+"}"+f);a=a.replace(b+"}",b+":,."+d+"f}")});return Ca(a,{point:this,series:this.series})},update:function(a,b,c){var d=this,e=d.series,f=d.graphic,g,h=e.data,i=e.chart,j=e.options,b=o(b,!0);d.firePointEvent("update", |
|||
{options:a},function(){d.applyOptions(a);if(T(a)&&(e.getAttribs(),f))a.marker&&a.marker.symbol?d.graphic=f.destroy():f.attr(d.pointAttr[d.state||""]);g=qa(d,h);e.xData[g]=d.x;e.yData[g]=e.toYData?e.toYData(d):d.y;e.zData[g]=d.z;j.data[g]=d.options;e.isDirty=e.isDirtyData=!0;if(!e.fixedBox&&e.hasCartesianSeries)i.isDirtyBox=!0;j.legendType==="point"&&i.legend.destroyItem(d);b&&i.redraw(c)})},remove:function(a,b){var c=this,d=c.series,e=d.points,f=d.chart,g,h=d.data;La(b,f);a=o(a,!0);c.firePointEvent("remove", |
|||
null,function(){g=qa(c,h);h.length===e.length&&e.splice(g,1);h.splice(g,1);d.options.data.splice(g,1);d.xData.splice(g,1);d.yData.splice(g,1);d.zData.splice(g,1);c.destroy();d.isDirty=!0;d.isDirtyData=!0;a&&f.redraw()})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])&&this.importEvents();a==="click"&&e.allowPointSelect&&(c=function(a){d.select(null,a.ctrlKey||a.metaKey||a.shiftKey)});z(this,a,b,c)},importEvents:function(){if(!this.hasImportedEvents){var a= |
|||
x(this.series.options.point,this.options).events,b;this.events=a;for(b in a)J(this,b,a[b]);this.hasImportedEvents=!0}},setState:function(a){var b=this.plotX,c=this.plotY,d=this.series,e=d.options.states,f=Y[d.type].marker&&d.options.marker,g=f&&!f.enabled,h=f&&f.states[a],i=h&&h.enabled===!1,j=d.stateMarkerGraphic,k=this.marker||{},l=d.chart,m=this.pointAttr,a=a||"";if(!(a===this.state||this.selected&&a!=="select"||e[a]&&e[a].enabled===!1||a&&(i||g&&!h.enabled))){if(this.graphic)e=f&&this.graphic.symbolName&& |
|||
m[a].r,this.graphic.attr(x(m[a],e?{x:b-e,y:c-e,width:2*e,height:2*e}:{}));else{if(a&&h)e=h.radius,k=k.symbol||d.symbol,j&&j.currentSymbol!==k&&(j=j.destroy()),j?j.attr({x:b-e,y:c-e}):(d.stateMarkerGraphic=j=l.renderer.symbol(k,b-e,c-e,2*e,2*e).attr(m[a]).add(d.markerGroup),j.currentSymbol=k);if(j)j[a&&l.isInsidePlot(b,c)?"show":"hide"]()}this.state=a}}};var Q=function(){};Q.prototype={isCartesian:!0,type:"line",pointClass:Pa,sorted:!0,requireSorting:!0,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth", |
|||
fill:"fillColor",r:"radius"},colorCounter:0,init:function(a,b){var c,d,e=a.series;this.chart=a;this.options=b=this.setOptions(b);this.linkedSeries=[];this.bindAxes();r(this,{name:b.name,state:"",pointAttr:{},visible:b.visible!==!1,selected:b.selected===!0});if($)b.animation=!1;d=b.events;for(c in d)J(this,c,d[c]);if(d&&d.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=!0;this.getColor();this.getSymbol();this.setData(b.data,!1);if(this.isCartesian)a.hasCartesianSeries= |
|||
!0;e.push(this);this._i=e.length-1;Kb(e,function(a,b){return o(a.options.index,a._i)-o(b.options.index,a._i)});n(e,function(a,b){a.index=b;a.name=a.name||"Series "+(b+1)})},bindAxes:function(){var a=this,b=a.options,c=a.chart,d;a.isCartesian&&n(["xAxis","yAxis"],function(e){n(c[e],function(c){d=c.options;if(b[e]===d.index||b[e]!==w&&b[e]===d.id||b[e]===w&&d.index===0)c.series.push(a),a[e]=c,c.isDirty=!0});a[e]||ka(18,!0)})},autoIncrement:function(){var a=this.options,b=this.xIncrement,b=o(b,a.pointStart, |
|||
0);this.pointInterval=o(this.pointInterval,a.pointInterval,1);this.xIncrement=b+this.pointInterval;return b},getSegments:function(){var a=-1,b=[],c,d=this.points,e=d.length;if(e)if(this.options.connectNulls){for(c=e;c--;)d[c].y===null&&d.splice(c,1);d.length&&(b=[d])}else n(d,function(c,g){c.y===null?(g>a+1&&b.push(d.slice(a+1,g)),a=g):g===e-1&&b.push(d.slice(a+1,g+1))});this.segments=b},setOptions:function(a){var b=this.chart.options,c=b.plotOptions,d=c[this.type];this.userOptions=a;a=x(d,c.series, |
|||
a);this.tooltipOptions=x(b.tooltip,a.tooltip);d.marker===null&&delete a.marker;return a},getColor:function(){var a=this.options,b=this.userOptions,c=this.chart.options.colors,d=this.chart.counters,e;e=a.color||Y[this.type].color;if(!e&&!a.colorByPoint)u(b._colorIndex)?a=b._colorIndex:(b._colorIndex=d.color,a=d.color++),e=c[a];this.color=e;d.wrapColor(c.length)},getSymbol:function(){var a=this.userOptions,b=this.options.marker,c=this.chart,d=c.options.symbols,c=c.counters;this.symbol=b.symbol;if(!this.symbol)u(a._symbolIndex)? |
|||
a=a._symbolIndex:(a._symbolIndex=c.symbol,a=c.symbol++),this.symbol=d[a];if(/^url/.test(this.symbol))b.radius=0;c.wrapSymbol(d.length)},drawLegendSymbol:function(a){var b=this.options,c=b.marker,d=a.options,e;e=d.symbolWidth;var f=this.chart.renderer,g=this.legendGroup,a=a.baseline-t(f.fontMetrics(d.itemStyle.fontSize).b*0.3);if(b.lineWidth){d={"stroke-width":b.lineWidth};if(b.dashStyle)d.dashstyle=b.dashStyle;this.legendLine=f.path(["M",0,a,"L",e,a]).attr(d).add(g)}if(c&&c.enabled)b=c.radius,this.legendSymbol= |
|||
e=f.symbol(this.symbol,e/2-b,a-b,2*b,2*b).add(g),e.isMarker=!0},addPoint:function(a,b,c,d){var e=this.options,f=this.data,g=this.graph,h=this.area,i=this.chart,j=this.xData,k=this.yData,l=this.zData,m=this.names,p=g&&g.shift||0,q=e.data,s;La(d,i);c&&n([g,h,this.graphNeg,this.areaNeg],function(a){if(a)a.shift=p+1});if(h)h.isArea=!0;b=o(b,!0);d={series:this};this.pointClass.prototype.applyOptions.apply(d,[a]);g=d.x;h=j.length;if(this.requireSorting&&g<j[h-1])for(s=!0;h&&j[h-1]>g;)h--;j.splice(h,0,g); |
|||
k.splice(h,0,this.toYData?this.toYData(d):d.y);l.splice(h,0,d.z);if(m)m[g]=d.name;q.splice(h,0,a);s&&(this.data.splice(h,0,null),this.processData());e.legendType==="point"&&this.generatePoints();c&&(f[0]&&f[0].remove?f[0].remove(!1):(f.shift(),j.shift(),k.shift(),l.shift(),q.shift()));this.isDirtyData=this.isDirty=!0;b&&(this.getAttribs(),i.redraw())},setData:function(a,b){var c=this.points,d=this.options,e=this.chart,f=null,g=this.xAxis,h=g&&g.categories&&!g.categories.length?[]:null,i;this.xIncrement= |
|||
null;this.pointRange=g&&g.categories?1:d.pointRange;this.colorCounter=0;var j=[],k=[],l=[],m=a?a.length:[];i=o(d.turboThreshold,1E3);var p=this.pointArrayMap,p=p&&p.length,q=!!this.toYData;if(i&&m>i){for(i=0;f===null&&i<m;)f=a[i],i++;if(sa(f)){f=o(d.pointStart,0);d=o(d.pointInterval,1);for(i=0;i<m;i++)j[i]=f,k[i]=a[i],f+=d;this.xIncrement=f}else if(Ia(f))if(p)for(i=0;i<m;i++)d=a[i],j[i]=d[0],k[i]=d.slice(1,p+1);else for(i=0;i<m;i++)d=a[i],j[i]=d[0],k[i]=d[1];else ka(12)}else for(i=0;i<m;i++)if(a[i]!== |
|||
w&&(d={series:this},this.pointClass.prototype.applyOptions.apply(d,[a[i]]),j[i]=d.x,k[i]=q?this.toYData(d):d.y,l[i]=d.z,h&&d.name))h[d.x]=d.name;ea(k[0])&&ka(14,!0);this.data=[];this.options.data=a;this.xData=j;this.yData=k;this.zData=l;this.names=h;for(i=c&&c.length||0;i--;)c[i]&&c[i].destroy&&c[i].destroy();if(g)g.minRange=g.userMinRange;this.isDirty=this.isDirtyData=e.isDirtyBox=!0;o(b,!0)&&e.redraw(!1)},remove:function(a,b){var c=this,d=c.chart,a=o(a,!0);if(!c.isRemoving)c.isRemoving=!0,z(c,"remove", |
|||
null,function(){c.destroy();d.isDirtyLegend=d.isDirtyBox=!0;d.linkSeries();a&&d.redraw(b)});c.isRemoving=!1},processData:function(a){var b=this.xData,c=this.yData,d=b.length,e;e=0;var f,g,h=this.xAxis,i=this.options,j=i.cropThreshold,k=this.isCartesian;if(k&&!this.isDirty&&!h.isDirty&&!this.yAxis.isDirty&&!a)return!1;if(k&&this.sorted&&(!j||d>j||this.forceCrop))if(a=h.min,h=h.max,b[d-1]<a||b[0]>h)b=[],c=[];else if(b[0]<a||b[d-1]>h)e=this.cropData(this.xData,this.yData,a,h),b=e.xData,c=e.yData,e=e.start, |
|||
f=!0;for(h=b.length-1;h>=0;h--)d=b[h]-b[h-1],d>0&&(g===w||d<g)?g=d:d<0&&this.requireSorting&&ka(15);this.cropped=f;this.cropStart=e;this.processedXData=b;this.processedYData=c;if(i.pointRange===null)this.pointRange=g||1;this.closestPointRange=g},cropData:function(a,b,c,d){var e=a.length,f=0,g=e,h=o(this.cropShoulder,1),i;for(i=0;i<e;i++)if(a[i]>=c){f=s(0,i-h);break}for(;i<e;i++)if(a[i]>d){g=i+h;break}return{xData:a.slice(f,g),yData:b.slice(f,g),start:f,end:g}},generatePoints:function(){var a=this.options.data, |
|||
b=this.data,c,d=this.processedXData,e=this.processedYData,f=this.pointClass,g=d.length,h=this.cropStart||0,i,j=this.hasGroupedData,k,l=[],m;if(!b&&!j)b=[],b.length=a.length,b=this.data=b;for(m=0;m<g;m++)i=h+m,j?l[m]=(new f).init(this,[d[m]].concat(ja(e[m]))):(b[i]?k=b[i]:a[i]!==w&&(b[i]=k=(new f).init(this,a[i],d[m])),l[m]=k);if(b&&(g!==(c=b.length)||j))for(m=0;m<c;m++)if(m===h&&!j&&(m+=g),b[m])b[m].destroyElements(),b[m].plotX=w;this.data=b;this.points=l},setStackedPoints:function(){if(this.options.stacking&& |
|||
!(this.visible!==!0&&this.chart.options.chart.ignoreHiddenSeries!==!1)){var a=this.processedXData,b=this.processedYData,c=[],d=b.length,e=this.options,f=e.threshold,g=e.stack,e=e.stacking,h=this.stackKey,i="-"+h,j=this.negStacks,k=this.yAxis,l=k.stacks,m=k.oldStacks,p,q,o,n,t;for(o=0;o<d;o++){n=a[o];t=b[o];q=(p=j&&t<f)?i:h;l[q]||(l[q]={});if(!l[q][n])m[q]&&m[q][n]?(l[q][n]=m[q][n],l[q][n].total=null):l[q][n]=new Mb(k,k.options.stackLabels,p,n,g,e);q=l[q][n];q.points[this.index]=[q.cum||0];e==="percent"? |
|||
(p=p?h:i,j&&l[p]&&l[p][n]?(p=l[p][n],q.total=p.total=s(p.total,q.total)+N(t)||0):q.total+=N(t)||0):q.total+=t||0;q.cum=(q.cum||0)+(t||0);q.points[this.index].push(q.cum);c[o]=q.cum}if(e==="percent")k.usePercentage=!0;this.stackedYData=c;k.oldStacks={}}},setPercentStacks:function(){var a=this,b=a.stackKey,c=a.yAxis.stacks;n([b,"-"+b],function(b){var d;for(var e=a.xData.length,f,g;e--;)if(f=a.xData[e],d=(g=c[b]&&c[b][f])&&g.points[a.index],f=d)g=g.total?100/g.total:0,f[0]=ia(f[0]*g),f[1]=ia(f[1]*g), |
|||
a.stackedYData[e]=f[1]})},getExtremes:function(){var a=this.yAxis,b=this.processedXData,c=this.stackedYData||this.processedYData,d=c.length,e=[],f=0,g=this.xAxis.getExtremes(),h=g.min,g=g.max,i,j,k,l;for(l=0;l<d;l++)if(j=b[l],k=c[l],i=k!==null&&k!==w&&(!a.isLog||k.length||k>0),j=this.getExtremesFromAll||this.cropped||(b[l+1]||j)>=h&&(b[l-1]||j)<=g,i&&j)if(i=k.length)for(;i--;)k[i]!==null&&(e[f++]=k[i]);else e[f++]=k;this.dataMin=o(void 0,Ja(e));this.dataMax=o(void 0,va(e))},translate:function(){this.processedXData|| |
|||
this.processData();this.generatePoints();for(var a=this.options,b=a.stacking,c=this.xAxis,d=c.categories,e=this.yAxis,f=this.points,g=f.length,h=!!this.modifyValue,i=a.pointPlacement,j=i==="between"||sa(i),k=a.threshold,a=0;a<g;a++){var l=f[a],m=l.x,p=l.y,q=l.low,n=e.stacks[(this.negStacks&&p<k?"-":"")+this.stackKey];if(e.isLog&&p<=0)l.y=p=null;l.plotX=c.translate(m,0,0,0,1,i,this.type==="flags");if(b&&this.visible&&n&&n[m])n=n[m],p=n.points[this.index],q=p[0],p=p[1],q===0&&(q=o(k,e.min)),e.isLog&& |
|||
q<=0&&(q=null),l.percentage=b==="percent"&&p,l.total=l.stackTotal=n.total,l.stackY=p,n.setOffset(this.pointXOffset||0,this.barW||0);l.yBottom=u(q)?e.translate(q,0,1,0,1):null;h&&(p=this.modifyValue(p,l));l.plotY=typeof p==="number"&&p!==Infinity?e.translate(p,0,1,0,1):w;l.clientX=j?c.translate(m,0,0,0,1):l.plotX;l.negative=l.y<(k||0);l.category=d&&d[l.x]!==w?d[l.x]:l.x}this.getSegments()},setTooltipPoints:function(a){var b=[],c,d,e=this.xAxis,f=e&&e.getExtremes(),g=e?e.tooltipLen||e.len:this.chart.plotSizeX, |
|||
h,i,j=[];if(this.options.enableMouseTracking!==!1){if(a)this.tooltipPoints=null;n(this.segments||this.points,function(a){b=b.concat(a)});e&&e.reversed&&(b=b.reverse());this.orderTooltipPoints&&this.orderTooltipPoints(b);a=b.length;for(i=0;i<a;i++)if(e=b[i],c=e.x,c>=f.min&&c<=f.max){h=b[i+1];c=d===w?0:d+1;for(d=b[i+1]?I(s(0,P((e.clientX+(h?h.wrappedClientX||h.clientX:g))/2)),g):g;c>=0&&c<=d;)j[c++]=e}this.tooltipPoints=j}},tooltipHeaderFormatter:function(a){var b=this.tooltipOptions,c=b.xDateFormat, |
|||
d=b.dateTimeLabelFormats,e=this.xAxis,f=e&&e.options.type==="datetime",b=b.headerFormat,e=e&&e.closestPointRange,g;if(f&&!c)if(e)for(g in D){if(D[g]>=e){c=d[g];break}}else c=d.day;f&&c&&sa(a.key)&&(b=b.replace("{point.key}","{point.key:"+c+"}"));return Ca(b,{point:a,series:this})},onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(b&&b!==this)b.onMouseOut();this.options.events.mouseOver&&z(this,"mouseOver");this.setState("hover");a.hoverSeries=this},onMouseOut:function(){var a=this.options, |
|||
b=this.chart,c=b.tooltip,d=b.hoverPoint;if(d)d.onMouseOut();this&&a.events.mouseOut&&z(this,"mouseOut");c&&!a.stickyTracking&&(!c.shared||this.noSharedTooltip)&&c.hide();this.setState();b.hoverSeries=null},animate:function(a){var b=this,c=b.chart,d=c.renderer,e;e=b.options.animation;var f=c.clipBox,g=c.inverted,h;if(e&&!T(e))e=Y[b.type].animation;h="_sharedClip"+e.duration+e.easing;if(a)a=c[h],e=c[h+"m"],a||(c[h]=a=d.clipRect(r(f,{width:0})),c[h+"m"]=e=d.clipRect(-99,g?-c.plotLeft:-c.plotTop,99,g? |
|||
c.chartWidth:c.chartHeight)),b.group.clip(a),b.markerGroup.clip(e),b.sharedClipKey=h;else{if(a=c[h])a.animate({width:c.plotSizeX},e),c[h+"m"].animate({width:c.plotSizeX+99},e);b.animate=null;b.animationTimeout=setTimeout(function(){b.afterAnimate()},e.duration)}},afterAnimate:function(){var a=this.chart,b=this.sharedClipKey,c=this.group;c&&this.options.clip!==!1&&(c.clip(a.clipRect),this.markerGroup.clip());setTimeout(function(){b&&a[b]&&(a[b]=a[b].destroy(),a[b+"m"]=a[b+"m"].destroy())},100)},drawPoints:function(){var a, |
|||
b=this.points,c=this.chart,d,e,f,g,h,i,j,k,l=this.options.marker,m,p=this.markerGroup;if(l.enabled||this._hasPointMarkers)for(f=b.length;f--;)if(g=b[f],d=P(g.plotX),e=g.plotY,k=g.graphic,i=g.marker||{},a=l.enabled&&i.enabled===w||i.enabled,m=c.isInsidePlot(t(d),e,c.inverted),a&&e!==w&&!isNaN(e)&&g.y!==null)if(a=g.pointAttr[g.selected?"select":""],h=a.r,i=o(i.symbol,this.symbol),j=i.indexOf("url")===0,k)k.attr({visibility:m?Z?"inherit":"visible":"hidden"}).animate(r({x:d-h,y:e-h},k.symbolName?{width:2* |
|||
h,height:2*h}:{}));else{if(m&&(h>0||j))g.graphic=c.renderer.symbol(i,d-h,e-h,2*h,2*h).attr(a).add(p)}else if(k)g.graphic=k.destroy()},convertAttribs:function(a,b,c,d){var e=this.pointAttrToOptions,f,g,h={},a=a||{},b=b||{},c=c||{},d=d||{};for(f in e)g=e[f],h[f]=o(a[g],b[f],c[f],d[f]);return h},getAttribs:function(){var a=this,b=a.options,c=Y[a.type].marker?b.marker:b,d=c.states,e=d.hover,f,g=a.color,h={stroke:g,fill:g},i=a.points||[],j=[],k,l=a.pointAttrToOptions,m=b.negativeColor,p=c.lineColor,q; |
|||
b.marker?(e.radius=e.radius||c.radius+2,e.lineWidth=e.lineWidth||c.lineWidth+1):e.color=e.color||ra(e.color||g).brighten(e.brightness).get();j[""]=a.convertAttribs(c,h);n(["hover","select"],function(b){j[b]=a.convertAttribs(d[b],j[""])});a.pointAttr=j;for(g=i.length;g--;){h=i[g];if((c=h.options&&h.options.marker||h.options)&&c.enabled===!1)c.radius=0;if(h.negative&&m)h.color=h.fillColor=m;f=b.colorByPoint||h.color;if(h.options)for(q in l)u(c[l[q]])&&(f=!0);if(f){c=c||{};k=[];d=c.states||{};f=d.hover= |
|||
d.hover||{};if(!b.marker)f.color=ra(f.color||h.color).brighten(f.brightness||e.brightness).get();k[""]=a.convertAttribs(r({color:h.color,fillColor:h.color,lineColor:p===null?h.color:w},c),j[""]);k.hover=a.convertAttribs(d.hover,j.hover,k[""]);k.select=a.convertAttribs(d.select,j.select,k[""])}else k=j;h.pointAttr=k}},update:function(a,b){var c=this.chart,d=this.type,e=W[d].prototype,f,a=x(this.userOptions,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1); |
|||
for(f in e)e.hasOwnProperty(f)&&(this[f]=w);r(this,W[a.type||d].prototype);this.init(c,a);o(b,!0)&&c.redraw(!1)},destroy:function(){var a=this,b=a.chart,c=/AppleWebKit\/533/.test(oa),d,e,f=a.data||[],g,h,i;z(a,"destroy");aa(a);n(["xAxis","yAxis"],function(b){if(i=a[b])ga(i.series,a),i.isDirty=i.forceRedraw=!0,i.stacks={}});a.legendItem&&a.chart.legend.destroyItem(a);for(e=f.length;e--;)(g=f[e])&&g.destroy&&g.destroy();a.points=null;clearTimeout(a.animationTimeout);n("area,graph,dataLabelsGroup,group,markerGroup,tracker,graphNeg,areaNeg,posClip,negClip".split(","), |
|||
function(b){a[b]&&(d=c&&b==="group"?"hide":"destroy",a[b][d]())});if(b.hoverSeries===a)b.hoverSeries=null;ga(b.series,a);for(h in a)delete a[h]},drawDataLabels:function(){var a=this,b=a.options.dataLabels,c=a.points,d,e,f,g;if(b.enabled||a._hasPointLabels)a.dlProcessOptions&&a.dlProcessOptions(b),g=a.plotGroup("dataLabelsGroup","data-labels",a.visible?"visible":"hidden",b.zIndex||6),e=b,n(c,function(c){var i,j=c.dataLabel,k,l,m=c.connector,p=!0;d=c.options&&c.options.dataLabels;i=o(d&&d.enabled,e.enabled); |
|||
if(j&&!i)c.dataLabel=j.destroy();else if(i){b=x(e,d);i=b.rotation;k=c.getLabelConfig();f=b.format?Ca(b.format,k):b.formatter.call(k,b);b.style.color=o(b.color,b.style.color,a.color,"black");if(j)if(u(f))j.attr({text:f}),p=!1;else{if(c.dataLabel=j=j.destroy(),m)c.connector=m.destroy()}else if(u(f)){j={fill:b.backgroundColor,stroke:b.borderColor,"stroke-width":b.borderWidth,r:b.borderRadius||0,rotation:i,padding:b.padding,zIndex:1};for(l in j)j[l]===w&&delete j[l];j=c.dataLabel=a.chart.renderer[i?"text": |
|||
"label"](f,0,-999,null,null,null,b.useHTML).attr(j).css(b.style).add(g).shadow(b.shadow)}j&&a.alignDataLabel(c,j,b,null,p)}})},alignDataLabel:function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=o(a.plotX,-999),i=o(a.plotY,-999),j=b.getBBox();if(a=this.visible&&f.isInsidePlot(a.plotX,a.plotY,g))d=r({x:g?f.plotWidth-i:h,y:t(g?f.plotHeight-h:i),width:0,height:0},d),r(c,{width:j.width,height:j.height}),c.rotation?(g={align:c.align,x:d.x+c.x+d.width/2,y:d.y+c.y+d.height/2},b[e?"attr":"animate"](g)):(b.align(c, |
|||
null,d),g=b.alignAttr,o(c.overflow,"justify")==="justify"?this.justifyDataLabel(b,c,g,j,d,e):o(c.crop,!0)&&(a=f.isInsidePlot(g.x,g.y)&&f.isInsidePlot(g.x+j.width,g.y+j.height)));a||b.attr({y:-999})},justifyDataLabel:function(a,b,c,d,e,f){var g=this.chart,h=b.align,i=b.verticalAlign,j,k;j=c.x;if(j<0)h==="right"?b.align="left":b.x=-j,k=!0;j=c.x+d.width;if(j>g.plotWidth)h==="left"?b.align="right":b.x=g.plotWidth-j,k=!0;j=c.y;if(j<0)i==="bottom"?b.verticalAlign="top":b.y=-j,k=!0;j=c.y+d.height;if(j>g.plotHeight)i=== |
|||
"top"?b.verticalAlign="bottom":b.y=g.plotHeight-j,k=!0;if(k)a.placed=!f,a.align(b,null,e)},getSegmentPath:function(a){var b=this,c=[],d=b.options.step;n(a,function(e,f){var g=e.plotX,h=e.plotY,i;b.getPointSpline?c.push.apply(c,b.getPointSpline(a,e,f)):(c.push(f?"L":"M"),d&&f&&(i=a[f-1],d==="right"?c.push(i.plotX,h):d==="center"?c.push((i.plotX+g)/2,i.plotY,(i.plotX+g)/2,h):c.push(g,i.plotY)),c.push(e.plotX,e.plotY))});return c},getGraphPath:function(){var a=this,b=[],c,d=[];n(a.segments,function(e){c= |
|||
a.getSegmentPath(e);e.length>1?b=b.concat(c):d.push(e[0])});a.singlePoints=d;return a.graphPath=b},drawGraph:function(){var a=this,b=this.options,c=[["graph",b.lineColor||this.color]],d=b.lineWidth,e=b.dashStyle,f=this.getGraphPath(),g=b.negativeColor;g&&c.push(["graphNeg",g]);n(c,function(c,g){var j=c[0],k=a[j];if(k)Wa(k),k.animate({d:f});else if(d&&f.length)k={stroke:c[1],"stroke-width":d,zIndex:1},e?k.dashstyle=e:k["stroke-linecap"]=k["stroke-linejoin"]="round",a[j]=a.chart.renderer.path(f).attr(k).add(a.group).shadow(!g&& |
|||
b.shadow)})},clipNeg:function(){var a=this.options,b=this.chart,c=b.renderer,d=a.negativeColor||a.negativeFillColor,e,f=this.graph,g=this.area,h=this.posClip,i=this.negClip;e=b.chartWidth;var j=b.chartHeight,k=s(e,j),l=this.yAxis;if(d&&(f||g)){d=t(l.toPixels(a.threshold||0,!0));a={x:0,y:0,width:k,height:d};k={x:0,y:d,width:k,height:k};if(b.inverted)a.height=k.y=b.plotWidth-d,c.isVML&&(a={x:b.plotWidth-d-b.plotLeft,y:0,width:e,height:j},k={x:d+b.plotLeft-e,y:0,width:b.plotLeft+d,height:e});l.reversed? |
|||
(b=k,e=a):(b=a,e=k);h?(h.animate(b),i.animate(e)):(this.posClip=h=c.clipRect(b),this.negClip=i=c.clipRect(e),f&&this.graphNeg&&(f.clip(h),this.graphNeg.clip(i)),g&&(g.clip(h),this.areaNeg.clip(i)))}},invertGroups:function(){function a(){var a={width:b.yAxis.len,height:b.xAxis.len};n(["group","markerGroup"],function(c){b[c]&&b[c].attr(a).invert()})}var b=this,c=b.chart;if(b.xAxis)J(c,"resize",a),J(b,"destroy",function(){aa(c,"resize",a)}),a(),b.invertGroups=a},plotGroup:function(a,b,c,d,e){var f=this[a], |
|||
g=!f;g&&(this[a]=f=this.chart.renderer.g(b).attr({visibility:c,zIndex:d||0.1}).add(e));f[g?"attr":"animate"](this.getPlotBox());return f},getPlotBox:function(){return{translateX:this.xAxis?this.xAxis.left:this.chart.plotLeft,translateY:this.yAxis?this.yAxis.top:this.chart.plotTop,scaleX:1,scaleY:1}},render:function(){var a=this.chart,b,c=this.options,d=c.animation&&!!this.animate&&a.renderer.isSVG,e=this.visible?"visible":"hidden",f=c.zIndex,g=this.hasRendered,h=a.seriesGroup;b=this.plotGroup("group", |
|||
"series",e,f,h);this.markerGroup=this.plotGroup("markerGroup","markers",e,f,h);d&&this.animate(!0);this.getAttribs();b.inverted=this.isCartesian?a.inverted:!1;this.drawGraph&&(this.drawGraph(),this.clipNeg());this.drawDataLabels();this.drawPoints();this.options.enableMouseTracking!==!1&&this.drawTracker();a.inverted&&this.invertGroups();c.clip!==!1&&!this.sharedClipKey&&!g&&b.clip(a.clipRect);d?this.animate():g||this.afterAnimate();this.isDirty=this.isDirtyData=!1;this.hasRendered=!0},redraw:function(){var a= |
|||
this.chart,b=this.isDirtyData,c=this.group,d=this.xAxis,e=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:o(d&&d.left,a.plotLeft),translateY:o(e&&e.top,a.plotTop)}));this.translate();this.setTooltipPoints(!0);this.render();b&&z(this,"updatedData")},setState:function(a){var b=this.options,c=this.graph,d=this.graphNeg,e=b.states,b=b.lineWidth,a=a||"";if(this.state!==a)this.state=a,e[a]&&e[a].enabled===!1||(a&&(b=e[a].lineWidth||b+1),c&&!c.dashstyle&& |
|||
(a={"stroke-width":b},c.attr(a),d&&d.attr(a)))},setVisible:function(a,b){var c=this,d=c.chart,e=c.legendItem,f,g=d.options.chart.ignoreHiddenSeries,h=c.visible;f=(c.visible=a=c.userOptions.visible=a===w?!h:a)?"show":"hide";n(["group","dataLabelsGroup","markerGroup","tracker"],function(a){if(c[a])c[a][f]()});if(d.hoverSeries===c)c.onMouseOut();e&&d.legend.colorizeItem(c,a);c.isDirty=!0;c.options.stacking&&n(d.series,function(a){if(a.options.stacking&&a.visible)a.isDirty=!0});n(c.linkedSeries,function(b){b.setVisible(a, |
|||
!1)});if(g)d.isDirtyBox=!0;b!==!1&&d.redraw();z(c,f)},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=a===w?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;z(this,a?"select":"unselect")},drawTracker:function(){var a=this,b=a.options,c=b.trackByArea,d=[].concat(c?a.areaPath:a.graphPath),e=d.length,f=a.chart,g=f.pointer,h=f.renderer,i=f.options.tooltip.snap,j=a.tracker,k=b.cursor,l=k&&{cursor:k},k=a.singlePoints,m,p=function(){if(f.hoverSeries!== |
|||
a)a.onMouseOver()};if(e&&!c)for(m=e+1;m--;)d[m]==="M"&&d.splice(m+1,0,d[m+1]-i,d[m+2],"L"),(m&&d[m]==="M"||m===e)&&d.splice(m,0,"L",d[m-2]+i,d[m-1]);for(m=0;m<k.length;m++)e=k[m],d.push("M",e.plotX-i,e.plotY,"L",e.plotX+i,e.plotY);j?j.attr({d:d}):(a.tracker=h.path(d).attr({"stroke-linejoin":"round",visibility:a.visible?"visible":"hidden",stroke:Qb,fill:c?Qb:S,"stroke-width":b.lineWidth+(c?0:2*i),zIndex:2}).add(a.group),n([a.tracker,a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover", |
|||
p).on("mouseout",function(a){g.onTrackerMouseOut(a)}).css(l);if(ib)a.on("touchstart",p)}))}};G=ha(Q);W.line=G;Y.area=x(X,{threshold:0});G=ha(Q,{type:"area",getSegments:function(){var a=[],b=[],c=[],d=this.xAxis,e=this.yAxis,f=e.stacks[this.stackKey],g={},h,i,j=this.points,k=this.options.connectNulls,l,m,p;if(this.options.stacking&&!this.cropped){for(m=0;m<j.length;m++)g[j[m].x]=j[m];for(p in f)c.push(+p);c.sort(function(a,b){return a-b});n(c,function(a){if(!k||g[a]&&g[a].y!==null)g[a]?b.push(g[a]): |
|||
(h=d.translate(a),l=f[a].percent?f[a].total?f[a].cum*100/f[a].total:0:f[a].cum,i=e.toPixels(l,!0),b.push({y:null,plotX:h,clientX:h,plotY:i,yBottom:i,onMouseOver:pa}))});b.length&&a.push(b)}else Q.prototype.getSegments.call(this),a=this.segments;this.segments=a},getSegmentPath:function(a){var b=Q.prototype.getSegmentPath.call(this,a),c=[].concat(b),d,e=this.options;d=b.length;var f=this.yAxis.getThreshold(e.threshold),g;d===3&&c.push("L",b[1],b[2]);if(e.stacking&&!this.closedStacks)for(d=a.length- |
|||
1;d>=0;d--)g=o(a[d].yBottom,f),d<a.length-1&&e.step&&c.push(a[d+1].plotX,g),c.push(a[d].plotX,g);else this.closeSegment(c,a,f);this.areaPath=this.areaPath.concat(c);return b},closeSegment:function(a,b,c){a.push("L",b[b.length-1].plotX,c,"L",b[0].plotX,c)},drawGraph:function(){this.areaPath=[];Q.prototype.drawGraph.apply(this);var a=this,b=this.areaPath,c=this.options,d=c.negativeColor,e=c.negativeFillColor,f=[["area",this.color,c.fillColor]];(d||e)&&f.push(["areaNeg",d,e]);n(f,function(d){var e=d[0], |
|||
f=a[e];f?f.animate({d:b}):a[e]=a.chart.renderer.path(b).attr({fill:o(d[2],ra(d[1]).setOpacity(o(c.fillOpacity,0.75)).get()),zIndex:0}).add(a.group)})},drawLegendSymbol:function(a,b){b.legendSymbol=this.chart.renderer.rect(0,a.baseline-11,a.options.symbolWidth,12,2).attr({zIndex:3}).add(b.legendGroup)}});W.area=G;Y.spline=x(X);F=ha(Q,{type:"spline",getPointSpline:function(a,b,c){var d=b.plotX,e=b.plotY,f=a[c-1],g=a[c+1],h,i,j,k;if(f&&g){a=f.plotY;j=g.plotX;var g=g.plotY,l;h=(1.5*d+f.plotX)/2.5;i=(1.5* |
|||
e+a)/2.5;j=(1.5*d+j)/2.5;k=(1.5*e+g)/2.5;l=(k-i)*(j-d)/(j-h)+e-k;i+=l;k+=l;i>a&&i>e?(i=s(a,e),k=2*e-i):i<a&&i<e&&(i=I(a,e),k=2*e-i);k>g&&k>e?(k=s(g,e),i=2*e-k):k<g&&k<e&&(k=I(g,e),i=2*e-k);b.rightContX=j;b.rightContY=k}c?(b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,i||e,d,e],f.rightContX=f.rightContY=null):b=["M",d,e];return b}});W.spline=F;Y.areaspline=x(Y.area);ma=G.prototype;F=ha(F,{type:"areaspline",closedStacks:!0,getSegmentPath:ma.getSegmentPath,closeSegment:ma.closeSegment,drawGraph:ma.drawGraph, |
|||
drawLegendSymbol:ma.drawLegendSymbol});W.areaspline=F;Y.column=x(X,{borderColor:"#FFFFFF",borderWidth:1,borderRadius:0,groupPadding:0.2,marker:null,pointPadding:0.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{brightness:0.1,shadow:!1},select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}},dataLabels:{align:null,verticalAlign:null,y:null},stickyTracking:!1,threshold:0});F=ha(Q,{type:"column",pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color", |
|||
r:"borderRadius"},cropShoulder:0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){Q.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasRendered&&n(b.series,function(b){if(b.type===a.type)b.isDirty=!0})},getColumnMetrics:function(){var a=this,b=a.options,c=a.xAxis,d=a.yAxis,e=c.reversed,f,g={},h,i=0;b.grouping===!1?i=1:n(a.chart.series,function(b){var c=b.options,e=b.yAxis;if(b.type===a.type&&b.visible&&d.len===e.len&&d.pos===e.pos)c.stacking?(f=b.stackKey,g[f]=== |
|||
w&&(g[f]=i++),h=g[f]):c.grouping!==!1&&(h=i++),b.columnIndex=h});var c=I(N(c.transA)*(c.ordinalSlope||b.pointRange||c.closestPointRange||1),c.len),j=c*b.groupPadding,k=(c-2*j)/i,l=b.pointWidth,b=u(l)?(k-l)/2:k*b.pointPadding,l=o(l,k-2*b);return a.columnMetrics={width:l,offset:b+(j+((e?i-(a.columnIndex||0):a.columnIndex)||0)*k-c/2)*(e?-1:1)}},translate:function(){var a=this.chart,b=this.options,c=b.borderWidth,d=this.yAxis,e=this.translatedThreshold=d.getThreshold(b.threshold),f=o(b.minPointLength, |
|||
5),b=this.getColumnMetrics(),g=b.width,h=this.barW=xa(s(g,1+2*c)),i=this.pointXOffset=b.offset,j=-(c%2?0.5:0),k=c%2?0.5:1;a.renderer.isVML&&a.inverted&&(k+=1);Q.prototype.translate.apply(this);n(this.points,function(a){var b=o(a.yBottom,e),c=I(s(-999-b,a.plotY),d.len+999+b),n=a.plotX+i,u=h,r=I(c,b),w,c=s(c,b)-r;N(c)<f&&f&&(c=f,r=t(N(r-e)>f?b-f:e-(d.translate(a.y,0,1,0,1)<=e?f:0)));a.barX=n;a.pointWidth=g;b=N(n)<0.5;u=t(n+u)+j;n=t(n)+j;u-=n;w=N(r)<0.5;c=t(r+c)+k;r=t(r)+k;c-=r;b&&(n+=1,u-=1);w&&(r-= |
|||
1,c+=1);a.shapeType="rect";a.shapeArgs={x:n,y:r,width:u,height:c}})},getSymbol:pa,drawLegendSymbol:G.prototype.drawLegendSymbol,drawGraph:pa,drawPoints:function(){var a=this,b=a.options,c=a.chart.renderer,d;n(a.points,function(e){var f=e.plotY,g=e.graphic;if(f!==w&&!isNaN(f)&&e.y!==null)d=e.shapeArgs,g?(Wa(g),g.animate(x(d))):e.graphic=c[e.shapeType](d).attr(e.pointAttr[e.selected?"select":""]).add(a.group).shadow(b.shadow,null,b.stacking&&!b.borderRadius);else if(g)e.graphic=g.destroy()})},drawTracker:function(){var a= |
|||
this,b=a.chart,c=b.pointer,d=a.options.cursor,e=d&&{cursor:d},f=function(c){var d=c.target,e;if(b.hoverSeries!==a)a.onMouseOver();for(;d&&!e;)e=d.point,d=d.parentNode;if(e!==w&&e!==b.hoverPoint)e.onMouseOver(c)};n(a.points,function(a){if(a.graphic)a.graphic.element.point=a;if(a.dataLabel)a.dataLabel.element.point=a});if(!a._hasTracking)n(a.trackerGroups,function(b){if(a[b]&&(a[b].addClass("highcharts-tracker").on("mouseover",f).on("mouseout",function(a){c.onTrackerMouseOut(a)}).css(e),ib))a[b].on("touchstart", |
|||
f)}),a._hasTracking=!0},alignDataLabel:function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=a.dlBox||a.shapeArgs,i=a.below||a.plotY>o(this.translatedThreshold,f.plotSizeY),j=o(c.inside,!!this.options.stacking);if(h&&(d=x(h),g&&(d={x:f.plotWidth-d.y-d.height,y:f.plotHeight-d.x-d.width,width:d.height,height:d.width}),!j))g?(d.x+=i?0:d.width,d.width=0):(d.y+=i?d.height:0,d.height=0);c.align=o(c.align,!g||j?"center":i?"right":"left");c.verticalAlign=o(c.verticalAlign,g||j?"middle":i?"top":"bottom");Q.prototype.alignDataLabel.call(this, |
|||
a,b,c,d,e)},animate:function(a){var b=this.yAxis,c=this.options,d=this.chart.inverted,e={};if(Z)a?(e.scaleY=0.001,a=I(b.pos+b.len,s(b.pos,b.toPixels(c.threshold))),d?e.translateX=a-b.len:e.translateY=a,this.group.attr(e)):(e.scaleY=1,e[d?"translateX":"translateY"]=b.pos,this.group.animate(e,this.options.animation),this.animate=null)},remove:function(){var a=this,b=a.chart;b.hasRendered&&n(b.series,function(b){if(b.type===a.type)b.isDirty=!0});Q.prototype.remove.apply(a,arguments)}});W.column=F;Y.bar= |
|||
x(Y.column);ma=ha(F,{type:"bar",inverted:!0});W.bar=ma;Y.scatter=x(X,{lineWidth:0,tooltip:{headerFormat:'<span style="font-size: 10px; color:{series.color}">{series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>",followPointer:!0},stickyTracking:!1});ma=ha(Q,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["markerGroup"],drawTracker:F.prototype.drawTracker,setTooltipPoints:pa});W.scatter=ma;Y.pie=x(X,{borderColor:"#FFFFFF",borderWidth:1, |
|||
center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return this.point.name}},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,states:{hover:{brightness:0.1,shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}});X={type:"pie",isCartesian:!1,pointClass:ha(Pa,{init:function(){Pa.prototype.init.apply(this,arguments);var a=this,b;if(a.y<0)a.y=null;r(a,{visible:a.visible!==!1,name:o(a.name,"Slice")});b=function(b){a.slice(b.type=== |
|||
"select")};J(a,"select",b);J(a,"unselect",b);return a},setVisible:function(a){var b=this,c=b.series,d=c.chart,e;b.visible=b.options.visible=a=a===w?!b.visible:a;c.options.data[qa(b,c.data)]=b.options;e=a?"show":"hide";n(["graphic","dataLabel","connector","shadowGroup"],function(a){if(b[a])b[a][e]()});b.legendItem&&d.legend.colorizeItem(b,a);if(!c.isDirty&&c.options.ignoreHiddenPoint)c.isDirty=!0,d.redraw()},slice:function(a,b,c){var d=this.series;La(c,d.chart);o(b,!0);this.sliced=this.options.sliced= |
|||
a=u(a)?a:!this.sliced;d.options.data[qa(this,d.data)]=this.options;a=a?this.slicedTranslation:{translateX:0,translateY:0};this.graphic.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)}}),requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},getColor:pa,animate:function(a){var b=this,c=b.points,d=b.startAngleRad;if(!a)n(c,function(a){var c=a.graphic,a=a.shapeArgs;c&&(c.attr({r:b.center[3]/ |
|||
2,start:d,end:d}),c.animate({r:a.r,start:a.start,end:a.end},b.options.animation))}),b.animate=null},setData:function(a,b){Q.prototype.setData.call(this,a,!1);this.processData();this.generatePoints();o(b,!0)&&this.chart.redraw()},generatePoints:function(){var a,b=0,c,d,e,f=this.options.ignoreHiddenPoint;Q.prototype.generatePoints.call(this);c=this.points;d=c.length;for(a=0;a<d;a++)e=c[a],b+=f&&!e.visible?0:e.y;this.total=b;for(a=0;a<d;a++)e=c[a],e.percentage=b>0?e.y/b*100:0,e.total=b},getCenter:function(){var a= |
|||
this.options,b=this.chart,c=2*(a.slicedOffset||0),d,e=b.plotWidth-2*c,f=b.plotHeight-2*c,b=a.center,a=[o(b[0],"50%"),o(b[1],"50%"),a.size||"100%",a.innerSize||0],g=I(e,f),h;return Na(a,function(a,b){h=/%$/.test(a);d=b<2||b===2&&h;return(h?[e,f,g,g][b]*C(a)/100:a)+(d?c:0)})},translate:function(a){this.generatePoints();var b=0,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,f,g,h,i=c.startAngle||0,j=this.startAngleRad=ya/180*(i-90),i=(this.endAngleRad=ya/180*((c.endAngle||i+360)-90))-j,k=this.points, |
|||
l=c.dataLabels.distance,c=c.ignoreHiddenPoint,m,n=k.length,o;if(!a)this.center=a=this.getCenter();this.getX=function(b,c){h=R.asin((b-a[1])/(a[2]/2+l));return a[0]+(c?-1:1)*V(h)*(a[2]/2+l)};for(m=0;m<n;m++){o=k[m];f=j+b*i;if(!c||o.visible)b+=o.percentage/100;g=j+b*i;o.shapeType="arc";o.shapeArgs={x:a[0],y:a[1],r:a[2]/2,innerR:a[3]/2,start:t(f*1E3)/1E3,end:t(g*1E3)/1E3};h=(g+f)/2;h>0.75*i&&(h-=2*ya);o.slicedTranslation={translateX:t(V(h)*d),translateY:t(ca(h)*d)};f=V(h)*a[2]/2;g=ca(h)*a[2]/2;o.tooltipPos= |
|||
[a[0]+f*0.7,a[1]+g*0.7];o.half=h<-ya/2||h>ya/2?1:0;o.angle=h;e=I(e,l/2);o.labelPos=[a[0]+f+V(h)*l,a[1]+g+ca(h)*l,a[0]+f+V(h)*e,a[1]+g+ca(h)*e,a[0]+f,a[1]+g,l<0?"center":o.half?"right":"left",h]}},setTooltipPoints:pa,drawGraph:null,drawPoints:function(){var a=this,b=a.chart.renderer,c,d,e=a.options.shadow,f,g;if(e&&!a.shadowGroup)a.shadowGroup=b.g("shadow").add(a.group);n(a.points,function(h){d=h.graphic;g=h.shapeArgs;f=h.shadowGroup;if(e&&!f)f=h.shadowGroup=b.g("shadow").add(a.shadowGroup);c=h.sliced? |
|||
h.slicedTranslation:{translateX:0,translateY:0};f&&f.attr(c);d?d.animate(r(g,c)):h.graphic=d=b.arc(g).setRadialReference(a.center).attr(h.pointAttr[h.selected?"select":""]).attr({"stroke-linejoin":"round"}).attr(c).add(a.group).shadow(e,f);h.visible===!1&&h.setVisible(!1)})},sortByAngle:function(a,b){a.sort(function(a,d){return a.angle!==void 0&&(d.angle-a.angle)*b})},drawDataLabels:function(){var a=this,b=a.data,c,d=a.chart,e=a.options.dataLabels,f=o(e.connectorPadding,10),g=o(e.connectorWidth,1), |
|||
h=d.plotWidth,d=d.plotHeight,i,j,k=o(e.softConnector,!0),l=e.distance,m=a.center,p=m[2]/2,q=m[1],u=l>0,r,w,v,x,C=[[],[]],y,z,E,H,B,D=[0,0,0,0],I=function(a,b){return b.y-a.y};if(a.visible&&(e.enabled||a._hasPointLabels)){Q.prototype.drawDataLabels.apply(a);n(b,function(a){a.dataLabel&&C[a.half].push(a)});for(H=0;!x&&b[H];)x=b[H]&&b[H].dataLabel&&(b[H].dataLabel.getBBox().height||21),H++;for(H=2;H--;){var b=[],K=[],G=C[H],J=G.length,F;a.sortByAngle(G,H-0.5);if(l>0){for(B=q-p-l;B<=q+p+l;B+=x)b.push(B); |
|||
w=b.length;if(J>w){c=[].concat(G);c.sort(I);for(B=J;B--;)c[B].rank=B;for(B=J;B--;)G[B].rank>=w&&G.splice(B,1);J=G.length}for(B=0;B<J;B++){c=G[B];v=c.labelPos;c=9999;var O,M;for(M=0;M<w;M++)O=N(b[M]-v[1]),O<c&&(c=O,F=M);if(F<B&&b[B]!==null)F=B;else for(w<J-B+F&&b[B]!==null&&(F=w-J+B);b[F]===null;)F++;K.push({i:F,y:b[F]});b[F]=null}K.sort(I)}for(B=0;B<J;B++){c=G[B];v=c.labelPos;r=c.dataLabel;E=c.visible===!1?"hidden":"visible";c=v[1];if(l>0){if(w=K.pop(),F=w.i,z=w.y,c>z&&b[F+1]!==null||c<z&&b[F-1]!== |
|||
null)z=c}else z=c;y=e.justify?m[0]+(H?-1:1)*(p+l):a.getX(F===0||F===b.length-1?c:z,H);r._attr={visibility:E,align:v[6]};r._pos={x:y+e.x+({left:f,right:-f}[v[6]]||0),y:z+e.y-10};r.connX=y;r.connY=z;if(this.options.size===null)w=r.width,y-w<f?D[3]=s(t(w-y+f),D[3]):y+w>h-f&&(D[1]=s(t(y+w-h+f),D[1])),z-x/2<0?D[0]=s(t(-z+x/2),D[0]):z+x/2>d&&(D[2]=s(t(z+x/2-d),D[2]))}}if(va(D)===0||this.verifyDataLabelOverflow(D))this.placeDataLabels(),u&&g&&n(this.points,function(b){i=b.connector;v=b.labelPos;if((r=b.dataLabel)&& |
|||
r._pos)E=r._attr.visibility,y=r.connX,z=r.connY,j=k?["M",y+(v[6]==="left"?5:-5),z,"C",y,z,2*v[2]-v[4],2*v[3]-v[5],v[2],v[3],"L",v[4],v[5]]:["M",y+(v[6]==="left"?5:-5),z,"L",v[2],v[3],"L",v[4],v[5]],i?(i.animate({d:j}),i.attr("visibility",E)):b.connector=i=a.chart.renderer.path(j).attr({"stroke-width":g,stroke:e.connectorColor||b.color||"#606060",visibility:E}).add(a.group);else if(i)b.connector=i.destroy()})}},verifyDataLabelOverflow:function(a){var b=this.center,c=this.options,d=c.center,e=c=c.minSize|| |
|||
80,f;d[0]!==null?e=s(b[2]-s(a[1],a[3]),c):(e=s(b[2]-a[1]-a[3],c),b[0]+=(a[3]-a[1])/2);d[1]!==null?e=s(I(e,b[2]-s(a[0],a[2])),c):(e=s(I(e,b[2]-a[0]-a[2]),c),b[1]+=(a[0]-a[2])/2);e<b[2]?(b[2]=e,this.translate(b),n(this.points,function(a){if(a.dataLabel)a.dataLabel._pos=null}),this.drawDataLabels()):f=!0;return f},placeDataLabels:function(){n(this.points,function(a){var a=a.dataLabel,b;if(a)(b=a._pos)?(a.attr(a._attr),a[a.moved?"animate":"attr"](b),a.moved=!0):a&&a.attr({y:-999})})},alignDataLabel:pa, |
|||
drawTracker:F.prototype.drawTracker,drawLegendSymbol:G.prototype.drawLegendSymbol,getSymbol:pa};X=ha(Q,X);W.pie=X;r(Highcharts,{Axis:db,Chart:yb,Color:ra,Legend:eb,Pointer:xb,Point:Pa,Tick:Ma,Tooltip:wb,Renderer:Va,Series:Q,SVGElement:wa,SVGRenderer:Ha,arrayMin:Ja,arrayMax:va,charts:Ga,dateFormat:Xa,format:Ca,pathAnim:Ab,getOptions:function(){return M},hasBidiBug:Ub,isTouchDevice:Ob,numberFormat:Aa,seriesTypes:W,setOptions:function(a){M=x(M,a);Lb();return M},addEvent:J,removeEvent:aa,createElement:U, |
|||
discardElement:Ta,css:K,each:n,extend:r,map:Na,merge:x,pick:o,splat:ja,extendClass:ha,pInt:C,wrap:mb,svg:Z,canvas:$,vml:!Z&&!$,product:"Highcharts",version:"3.0.6"})})(); |
|||
@ -0,0 +1,7 @@ |
|||
(function(i,C){function m(a){return typeof a==="number"}function n(a){return a!==D&&a!==null}var D,p,r,s=i.Chart,t=i.extend,z=i.each;r=["path","rect","circle"];p={top:0,left:0,center:0.5,middle:0.5,bottom:1,right:1};var u=C.inArray,A=i.merge,B=function(){this.init.apply(this,arguments)};B.prototype={init:function(a,d){var c=d.shape&&d.shape.type;this.chart=a;var b,f;f={xAxis:0,yAxis:0,title:{style:{},text:"",x:0,y:0},shape:{params:{stroke:"#000000",fill:"transparent",strokeWidth:2}}};b={circle:{params:{x:0, |
|||
y:0}}};if(b[c])f.shape=A(f.shape,b[c]);this.options=A({},f,d)},render:function(a){var d=this.chart,c=this.chart.renderer,b=this.group,f=this.title,e=this.shape,h=this.options,i=h.title,l=h.shape;if(!b)b=this.group=c.g();if(!e&&l&&u(l.type,r)!==-1)e=this.shape=c[h.shape.type](l.params),e.add(b);if(!f&&i)f=this.title=c.label(i),f.add(b);b.add(d.annotations.group);this.linkObjects();a!==!1&&this.redraw()},redraw:function(){var a=this.options,d=this.chart,c=this.group,b=this.title,f=this.shape,e=this.linkedObject, |
|||
h=d.xAxis[a.xAxis],v=d.yAxis[a.yAxis],l=a.width,w=a.height,x=p[a.anchorY],y=p[a.anchorX],j,o,g,q;if(e)j=e instanceof i.Point?"point":e instanceof i.Series?"series":null,j==="point"?(a.xValue=e.x,a.yValue=e.y,o=e.series):j==="series"&&(o=e),c.visibility!==o.group.visibility&&c.attr({visibility:o.group.visibility});e=n(a.xValue)?h.toPixels(a.xValue+h.minPointOffset)-h.minPixelPadding:a.x;j=n(a.yValue)?v.toPixels(a.yValue):a.y;if(!isNaN(e)&&!isNaN(j)&&m(e)&&m(j)){b&&(b.attr(a.title),b.css(a.title.style)); |
|||
if(f){b=t({},a.shape.params);if(a.units==="values"){for(g in b)u(g,["width","x"])>-1?b[g]=h.translate(b[g]):u(g,["height","y"])>-1&&(b[g]=v.translate(b[g]));b.width&&(b.width-=h.toPixels(0)-h.left);b.x&&(b.x+=h.minPixelPadding);if(a.shape.type==="path"){g=b.d;o=e;for(var r=j,s=g.length,k=0;k<s;)typeof g[k]==="number"&&typeof g[k+1]==="number"?(g[k]=h.toPixels(g[k])-o,g[k+1]=v.toPixels(g[k+1])-r,k+=2):k+=1}}a.shape.type==="circle"&&(b.x+=b.r,b.y+=b.r);f.attr(b)}c.bBox=null;if(!m(l))q=c.getBBox(),l= |
|||
q.width;if(!m(w))q||(q=c.getBBox()),w=q.height;if(!m(y))y=p.center;if(!m(x))x=p.center;e-=l*y;j-=w*x;d.animation&&n(c.translateX)&&n(c.translateY)?c.animate({translateX:e,translateY:j}):c.translate(e,j)}},destroy:function(){var a=this,d=this.chart.annotations.allItems,c=d.indexOf(a);c>-1&&d.splice(c,1);z(["title","shape","group"],function(b){a[b]&&(a[b].destroy(),a[b]=null)});a.group=a.title=a.shape=a.chart=a.options=null},update:function(a,d){t(this.options,a);this.linkObjects();this.render(d)}, |
|||
linkObjects:function(){var a=this.chart,d=this.linkedObject,c=d&&(d.id||d.options.id),b=this.options.linkedTo;if(n(b)){if(!n(d)||b!==c)this.linkedObject=a.get(b)}else this.linkedObject=null}};t(s.prototype,{annotations:{add:function(a,d){var c=this.allItems,b=this.chart,f,e;Object.prototype.toString.call(a)==="[object Array]"||(a=[a]);for(e=a.length;e--;)f=new B(b,a[e]),c.push(f),f.render(d)},redraw:function(){z(this.allItems,function(a){a.redraw()})}}});s.prototype.callbacks.push(function(a){var d= |
|||
a.options.annotations,c;c=a.renderer.g("annotations");c.attr({zIndex:7});c.add();a.annotations.allItems=[];a.annotations.chart=a;a.annotations.group=c;Object.prototype.toString.call(d)==="[object Array]"&&d.length>0&&a.annotations.add(a.options.annotations);i.addEvent(a,"redraw",function(){a.annotations.redraw()})})})(Highcharts,HighchartsAdapter); |
|||
@ -0,0 +1,401 @@ |
|||
(function (Highcharts, HighchartsAdapter) { |
|||
|
|||
var UNDEFINED, |
|||
ALIGN_FACTOR, |
|||
ALLOWED_SHAPES, |
|||
Chart = Highcharts.Chart, |
|||
extend = Highcharts.extend, |
|||
each = Highcharts.each; |
|||
|
|||
ALLOWED_SHAPES = ["path", "rect", "circle"]; |
|||
|
|||
ALIGN_FACTOR = { |
|||
top: 0, |
|||
left: 0, |
|||
center: 0.5, |
|||
middle: 0.5, |
|||
bottom: 1, |
|||
right: 1 |
|||
}; |
|||
|
|||
|
|||
// Highcharts helper methods
|
|||
var inArray = HighchartsAdapter.inArray, |
|||
merge = Highcharts.merge; |
|||
|
|||
function defaultOptions(shapeType) { |
|||
var shapeOptions, |
|||
options; |
|||
|
|||
options = { |
|||
xAxis: 0, |
|||
yAxis: 0, |
|||
title: { |
|||
style: {}, |
|||
text: "", |
|||
x: 0, |
|||
y: 0 |
|||
}, |
|||
shape: { |
|||
params: { |
|||
stroke: "#000000", |
|||
fill: "transparent", |
|||
strokeWidth: 2 |
|||
} |
|||
} |
|||
}; |
|||
|
|||
shapeOptions = { |
|||
circle: { |
|||
params: { |
|||
x: 0, |
|||
y: 0 |
|||
} |
|||
} |
|||
}; |
|||
|
|||
if (shapeOptions[shapeType]) { |
|||
options.shape = merge(options.shape, shapeOptions[shapeType]); |
|||
} |
|||
|
|||
return options; |
|||
} |
|||
|
|||
function isArray(obj) { |
|||
return Object.prototype.toString.call(obj) === '[object Array]'; |
|||
} |
|||
|
|||
function isNumber(n) { |
|||
return typeof n === 'number'; |
|||
} |
|||
|
|||
function defined(obj) { |
|||
return obj !== UNDEFINED && obj !== null; |
|||
} |
|||
|
|||
function translatePath(d, xAxis, yAxis, xOffset, yOffset) { |
|||
var len = d.length, |
|||
i = 0; |
|||
|
|||
while (i < len) { |
|||
if (typeof d[i] === 'number' && typeof d[i + 1] === 'number') { |
|||
d[i] = xAxis.toPixels(d[i]) - xOffset; |
|||
d[i + 1] = yAxis.toPixels(d[i + 1]) - yOffset; |
|||
i += 2; |
|||
} else { |
|||
i += 1; |
|||
} |
|||
} |
|||
|
|||
return d; |
|||
} |
|||
|
|||
|
|||
// Define annotation prototype
|
|||
var Annotation = function () { |
|||
this.init.apply(this, arguments); |
|||
}; |
|||
Annotation.prototype = { |
|||
/* |
|||
* Initialize the annotation |
|||
*/ |
|||
init: function (chart, options) { |
|||
var shapeType = options.shape && options.shape.type; |
|||
|
|||
this.chart = chart; |
|||
this.options = merge({}, defaultOptions(shapeType), options); |
|||
}, |
|||
|
|||
/* |
|||
* Render the annotation |
|||
*/ |
|||
render: function (redraw) { |
|||
var annotation = this, |
|||
chart = this.chart, |
|||
renderer = annotation.chart.renderer, |
|||
group = annotation.group, |
|||
title = annotation.title, |
|||
shape = annotation.shape, |
|||
options = annotation.options, |
|||
titleOptions = options.title, |
|||
shapeOptions = options.shape; |
|||
|
|||
if (!group) { |
|||
group = annotation.group = renderer.g(); |
|||
} |
|||
|
|||
|
|||
if (!shape && shapeOptions && inArray(shapeOptions.type, ALLOWED_SHAPES) !== -1) { |
|||
shape = annotation.shape = renderer[options.shape.type](shapeOptions.params); |
|||
shape.add(group); |
|||
} |
|||
|
|||
if (!title && titleOptions) { |
|||
title = annotation.title = renderer.label(titleOptions); |
|||
title.add(group); |
|||
} |
|||
|
|||
group.add(chart.annotations.group); |
|||
|
|||
// link annotations to point or series
|
|||
annotation.linkObjects(); |
|||
|
|||
if (redraw !== false) { |
|||
annotation.redraw(); |
|||
} |
|||
}, |
|||
|
|||
/* |
|||
* Redraw the annotation title or shape after options update |
|||
*/ |
|||
redraw: function () { |
|||
var options = this.options, |
|||
chart = this.chart, |
|||
group = this.group, |
|||
title = this.title, |
|||
shape = this.shape, |
|||
linkedTo = this.linkedObject, |
|||
xAxis = chart.xAxis[options.xAxis], |
|||
yAxis = chart.yAxis[options.yAxis], |
|||
width = options.width, |
|||
height = options.height, |
|||
anchorY = ALIGN_FACTOR[options.anchorY], |
|||
anchorX = ALIGN_FACTOR[options.anchorX], |
|||
resetBBox = false, |
|||
shapeParams, |
|||
linkType, |
|||
series, |
|||
param, |
|||
bbox, |
|||
x, |
|||
y; |
|||
|
|||
if (linkedTo) { |
|||
linkType = (linkedTo instanceof Highcharts.Point) ? 'point' : |
|||
(linkedTo instanceof Highcharts.Series) ? 'series' : null; |
|||
|
|||
if (linkType === 'point') { |
|||
options.xValue = linkedTo.x; |
|||
options.yValue = linkedTo.y; |
|||
series = linkedTo.series; |
|||
} else if (linkType === 'series') { |
|||
series = linkedTo; |
|||
} |
|||
|
|||
if (group.visibility !== series.group.visibility) { |
|||
group.attr({ |
|||
visibility: series.group.visibility |
|||
}); |
|||
} |
|||
} |
|||
|
|||
|
|||
// Based on given options find annotation pixel position
|
|||
x = (defined(options.xValue) ? xAxis.toPixels(options.xValue + xAxis.minPointOffset) - xAxis.minPixelPadding : options.x); |
|||
y = defined(options.yValue) ? yAxis.toPixels(options.yValue) : options.y; |
|||
|
|||
if (isNaN(x) || isNaN(y) || !isNumber(x) || !isNumber(y)) { |
|||
return; |
|||
} |
|||
|
|||
|
|||
if (title) { |
|||
title.attr(options.title); |
|||
title.css(options.title.style); |
|||
resetBBox = true; |
|||
} |
|||
|
|||
if (shape) { |
|||
shapeParams = extend({}, options.shape.params); |
|||
|
|||
if (options.units === 'values') { |
|||
for (param in shapeParams) { |
|||
if (inArray(param, ['width', 'x']) > -1) { |
|||
shapeParams[param] = xAxis.translate(shapeParams[param]); |
|||
} else if (inArray(param, ['height', 'y']) > -1) { |
|||
shapeParams[param] = yAxis.translate(shapeParams[param]); |
|||
} |
|||
} |
|||
|
|||
if (shapeParams.width) { |
|||
shapeParams.width -= xAxis.toPixels(0) - xAxis.left; |
|||
} |
|||
|
|||
if (shapeParams.x) { |
|||
shapeParams.x += xAxis.minPixelPadding; |
|||
} |
|||
|
|||
if (options.shape.type === 'path') { |
|||
translatePath(shapeParams.d, xAxis, yAxis, x, y); |
|||
} |
|||
} |
|||
|
|||
// move the center of the circle to shape x/y
|
|||
if (options.shape.type === 'circle') { |
|||
shapeParams.x += shapeParams.r; |
|||
shapeParams.y += shapeParams.r; |
|||
} |
|||
|
|||
resetBBox = true; |
|||
shape.attr(shapeParams); |
|||
} |
|||
|
|||
group.bBox = null; |
|||
|
|||
// If annotation width or height is not defined in options use bounding box size
|
|||
if (!isNumber(width)) { |
|||
bbox = group.getBBox(); |
|||
width = bbox.width; |
|||
} |
|||
|
|||
if (!isNumber(height)) { |
|||
// get bbox only if it wasn't set before
|
|||
if (!bbox) { |
|||
bbox = group.getBBox(); |
|||
} |
|||
|
|||
height = bbox.height; |
|||
} |
|||
|
|||
// Calculate anchor point
|
|||
if (!isNumber(anchorX)) { |
|||
anchorX = ALIGN_FACTOR.center; |
|||
} |
|||
|
|||
if (!isNumber(anchorY)) { |
|||
anchorY = ALIGN_FACTOR.center; |
|||
} |
|||
|
|||
// Translate group according to its dimension and anchor point
|
|||
x = x - width * anchorX; |
|||
y = y - height * anchorY; |
|||
|
|||
if (chart.animation && defined(group.translateX) && defined(group.translateY)) { |
|||
group.animate({ |
|||
translateX: x, |
|||
translateY: y |
|||
}); |
|||
} else { |
|||
group.translate(x, y); |
|||
} |
|||
}, |
|||
|
|||
/* |
|||
* Destroy the annotation |
|||
*/ |
|||
destroy: function () { |
|||
var annotation = this, |
|||
chart = this.chart, |
|||
allItems = chart.annotations.allItems, |
|||
index = allItems.indexOf(annotation); |
|||
|
|||
if (index > -1) { |
|||
allItems.splice(index, 1); |
|||
} |
|||
|
|||
each(['title', 'shape', 'group'], function (element) { |
|||
if (annotation[element]) { |
|||
annotation[element].destroy(); |
|||
annotation[element] = null; |
|||
} |
|||
}); |
|||
|
|||
annotation.group = annotation.title = annotation.shape = annotation.chart = annotation.options = null; |
|||
}, |
|||
|
|||
/* |
|||
* Update the annotation with a given options |
|||
*/ |
|||
update: function (options, redraw) { |
|||
extend(this.options, options); |
|||
|
|||
// update link to point or series
|
|||
this.linkObjects(); |
|||
|
|||
this.render(redraw); |
|||
}, |
|||
|
|||
linkObjects: function () { |
|||
var annotation = this, |
|||
chart = annotation.chart, |
|||
linkedTo = annotation.linkedObject, |
|||
linkedId = linkedTo && (linkedTo.id || linkedTo.options.id), |
|||
options = annotation.options, |
|||
id = options.linkedTo; |
|||
|
|||
if (!defined(id)) { |
|||
annotation.linkedObject = null; |
|||
} else if (!defined(linkedTo) || id !== linkedId) { |
|||
annotation.linkedObject = chart.get(id); |
|||
} |
|||
} |
|||
}; |
|||
|
|||
|
|||
// Add annotations methods to chart prototype
|
|||
extend(Chart.prototype, { |
|||
annotations: { |
|||
/* |
|||
* Unified method for adding annotations to the chart |
|||
*/ |
|||
add: function (options, redraw) { |
|||
var annotations = this.allItems, |
|||
chart = this.chart, |
|||
item, |
|||
len; |
|||
|
|||
if (!isArray(options)) { |
|||
options = [options]; |
|||
} |
|||
|
|||
len = options.length; |
|||
|
|||
while (len--) { |
|||
item = new Annotation(chart, options[len]); |
|||
annotations.push(item); |
|||
item.render(redraw); |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* Redraw all annotations, method used in chart events |
|||
*/ |
|||
redraw: function () { |
|||
each(this.allItems, function (annotation) { |
|||
annotation.redraw(); |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
|
|||
// Initialize on chart load
|
|||
Chart.prototype.callbacks.push(function (chart) { |
|||
var options = chart.options.annotations, |
|||
group; |
|||
|
|||
group = chart.renderer.g("annotations"); |
|||
group.attr({ |
|||
zIndex: 7 |
|||
}); |
|||
group.add(); |
|||
|
|||
// initialize empty array for annotations
|
|||
chart.annotations.allItems = []; |
|||
|
|||
// link chart object to annotations
|
|||
chart.annotations.chart = chart; |
|||
|
|||
// link annotations group element to the chart
|
|||
chart.annotations.group = group; |
|||
|
|||
if (isArray(options) && options.length > 0) { |
|||
chart.annotations.add(chart.options.annotations); |
|||
} |
|||
|
|||
// update annotations after chart redraw
|
|||
Highcharts.addEvent(chart, 'redraw', function () { |
|||
chart.annotations.redraw(); |
|||
}); |
|||
}); |
|||
}(Highcharts, HighchartsAdapter)); |
|||
@ -0,0 +1,133 @@ |
|||
/* |
|||
A class to parse color values |
|||
@author Stoyan Stefanov <sstoo@gmail.com> |
|||
@link http://www.phpied.com/rgb-color-parser-in-javascript/
|
|||
Use it if you like it |
|||
|
|||
canvg.js - Javascript SVG parser and renderer on Canvas |
|||
MIT Licensed |
|||
Gabe Lerner (gabelerner@gmail.com) |
|||
http://code.google.com/p/canvg/
|
|||
|
|||
Requires: rgbcolor.js - http://www.phpied.com/rgb-color-parser-in-javascript/
|
|||
|
|||
Highcharts JS v3.0.6 (2013-10-04) |
|||
CanVGRenderer Extension module |
|||
|
|||
(c) 2011-2012 Torstein Hønsi, Erik Olsson |
|||
|
|||
License: www.highcharts.com/license |
|||
*/ |
|||
function RGBColor(m){this.ok=!1;m.charAt(0)=="#"&&(m=m.substr(1,6));var m=m.replace(/ /g,""),m=m.toLowerCase(),a={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b", |
|||
darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff", |
|||
gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa", |
|||
lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080", |
|||
oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd", |
|||
slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},c;for(c in a)m==c&&(m=a[c]);var d=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(b){return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/, |
|||
example:["#00ff00","336699"],process:function(b){return[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(b){return[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]}}];for(c=0;c<d.length;c++){var b=d[c].process,k=d[c].re.exec(m);if(k)channels=b(k),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r;this.g=this.g<0||isNaN(this.g)?0: |
|||
this.g>255?255:this.g;this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b;this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"};this.toHex=function(){var b=this.r.toString(16),a=this.g.toString(16),d=this.b.toString(16);b.length==1&&(b="0"+b);a.length==1&&(a="0"+a);d.length==1&&(d="0"+d);return"#"+b+a+d};this.getHelpXML=function(){for(var b=[],k=0;k<d.length;k++)for(var c=d[k].example,j=0;j<c.length;j++)b[b.length]=c[j];for(var h in a)b[b.length]=h;c=document.createElement("ul"); |
|||
c.setAttribute("id","rgbcolor-examples");for(k=0;k<b.length;k++)try{var l=document.createElement("li"),o=new RGBColor(b[k]),n=document.createElement("div");n.style.cssText="margin: 3px; border: 1px solid black; background:"+o.toHex()+"; color:"+o.toHex();n.appendChild(document.createTextNode("test"));var q=document.createTextNode(" "+b[k]+" -> "+o.toRGB()+" -> "+o.toHex());l.appendChild(n);l.appendChild(q);c.appendChild(l)}catch(p){}return c}} |
|||
if(!window.console)window.console={},window.console.log=function(){},window.console.dir=function(){};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(m){for(var a=0;a<this.length;a++)if(this[a]==m)return a;return-1}; |
|||
(function(){function m(){var a={FRAMERATE:30,MAX_VIRTUAL_PIXELS:3E4};a.init=function(c){a.Definitions={};a.Styles={};a.Animations=[];a.Images=[];a.ctx=c;a.ViewPort=new function(){this.viewPorts=[];this.Clear=function(){this.viewPorts=[]};this.SetCurrent=function(a,b){this.viewPorts.push({width:a,height:b})};this.RemoveCurrent=function(){this.viewPorts.pop()};this.Current=function(){return this.viewPorts[this.viewPorts.length-1]};this.width=function(){return this.Current().width};this.height=function(){return this.Current().height}; |
|||
this.ComputeSize=function(a){return a!=null&&typeof a=="number"?a:a=="x"?this.width():a=="y"?this.height():Math.sqrt(Math.pow(this.width(),2)+Math.pow(this.height(),2))/Math.sqrt(2)}}};a.init();a.ImagesLoaded=function(){for(var c=0;c<a.Images.length;c++)if(!a.Images[c].loaded)return!1;return!0};a.trim=function(a){return a.replace(/^\s+|\s+$/g,"")};a.compressSpaces=function(a){return a.replace(/[\s\r\t\n]+/gm," ")};a.ajax=function(a){var d;return(d=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"))? |
|||
(d.open("GET",a,!1),d.send(null),d.responseText):null};a.parseXml=function(a){if(window.DOMParser)return(new DOMParser).parseFromString(a,"text/xml");else{var a=a.replace(/<!DOCTYPE svg[^>]*>/,""),d=new ActiveXObject("Microsoft.XMLDOM");d.async="false";d.loadXML(a);return d}};a.Property=function(c,d){this.name=c;this.value=d;this.hasValue=function(){return this.value!=null&&this.value!==""};this.numValue=function(){if(!this.hasValue())return 0;var b=parseFloat(this.value);(this.value+"").match(/%$/)&& |
|||
(b/=100);return b};this.valueOrDefault=function(b){return this.hasValue()?this.value:b};this.numValueOrDefault=function(b){return this.hasValue()?this.numValue():b};var b=this;this.Color={addOpacity:function(d){var c=b.value;if(d!=null&&d!=""){var f=new RGBColor(b.value);f.ok&&(c="rgba("+f.r+", "+f.g+", "+f.b+", "+d+")")}return new a.Property(b.name,c)}};this.Definition={getDefinition:function(){var d=b.value.replace(/^(url\()?#([^\)]+)\)?$/,"$2");return a.Definitions[d]},isUrl:function(){return b.value.indexOf("url(")== |
|||
0},getFillStyle:function(b){var d=this.getDefinition();return d!=null&&d.createGradient?d.createGradient(a.ctx,b):d!=null&&d.createPattern?d.createPattern(a.ctx,b):null}};this.Length={DPI:function(){return 96},EM:function(b){var d=12,c=new a.Property("fontSize",a.Font.Parse(a.ctx.font).fontSize);c.hasValue()&&(d=c.Length.toPixels(b));return d},toPixels:function(d){if(!b.hasValue())return 0;var c=b.value+"";return c.match(/em$/)?b.numValue()*this.EM(d):c.match(/ex$/)?b.numValue()*this.EM(d)/2:c.match(/px$/)? |
|||
b.numValue():c.match(/pt$/)?b.numValue()*1.25:c.match(/pc$/)?b.numValue()*15:c.match(/cm$/)?b.numValue()*this.DPI(d)/2.54:c.match(/mm$/)?b.numValue()*this.DPI(d)/25.4:c.match(/in$/)?b.numValue()*this.DPI(d):c.match(/%$/)?b.numValue()*a.ViewPort.ComputeSize(d):b.numValue()}};this.Time={toMilliseconds:function(){if(!b.hasValue())return 0;var a=b.value+"";if(a.match(/s$/))return b.numValue()*1E3;a.match(/ms$/);return b.numValue()}};this.Angle={toRadians:function(){if(!b.hasValue())return 0;var a=b.value+ |
|||
"";return a.match(/deg$/)?b.numValue()*(Math.PI/180):a.match(/grad$/)?b.numValue()*(Math.PI/200):a.match(/rad$/)?b.numValue():b.numValue()*(Math.PI/180)}}};a.Font=new function(){this.Styles=["normal","italic","oblique","inherit"];this.Variants=["normal","small-caps","inherit"];this.Weights="normal,bold,bolder,lighter,100,200,300,400,500,600,700,800,900,inherit".split(",");this.CreateFont=function(d,b,c,e,f,g){g=g!=null?this.Parse(g):this.CreateFont("","","","","",a.ctx.font);return{fontFamily:f|| |
|||
g.fontFamily,fontSize:e||g.fontSize,fontStyle:d||g.fontStyle,fontWeight:c||g.fontWeight,fontVariant:b||g.fontVariant,toString:function(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}};var c=this;this.Parse=function(d){for(var b={},d=a.trim(a.compressSpaces(d||"")).split(" "),k=!1,e=!1,f=!1,g=!1,j="",h=0;h<d.length;h++)if(!e&&c.Styles.indexOf(d[h])!=-1){if(d[h]!="inherit")b.fontStyle=d[h];e=!0}else if(!g&&c.Variants.indexOf(d[h])!=-1){if(d[h]!="inherit")b.fontVariant= |
|||
d[h];e=g=!0}else if(!f&&c.Weights.indexOf(d[h])!=-1){if(d[h]!="inherit")b.fontWeight=d[h];e=g=f=!0}else if(k)d[h]!="inherit"&&(j+=d[h]);else{if(d[h]!="inherit")b.fontSize=d[h].split("/")[0];e=g=f=k=!0}if(j!="")b.fontFamily=j;return b}};a.ToNumberArray=function(c){for(var c=a.trim(a.compressSpaces((c||"").replace(/,/g," "))).split(" "),d=0;d<c.length;d++)c[d]=parseFloat(c[d]);return c};a.Point=function(a,d){this.x=a;this.y=d;this.angleTo=function(b){return Math.atan2(b.y-this.y,b.x-this.x)};this.applyTransform= |
|||
function(b){var a=this.x*b[1]+this.y*b[3]+b[5];this.x=this.x*b[0]+this.y*b[2]+b[4];this.y=a}};a.CreatePoint=function(c){c=a.ToNumberArray(c);return new a.Point(c[0],c[1])};a.CreatePath=function(c){for(var c=a.ToNumberArray(c),d=[],b=0;b<c.length;b+=2)d.push(new a.Point(c[b],c[b+1]));return d};a.BoundingBox=function(a,d,b,k){this.y2=this.x2=this.y1=this.x1=Number.NaN;this.x=function(){return this.x1};this.y=function(){return this.y1};this.width=function(){return this.x2-this.x1};this.height=function(){return this.y2- |
|||
this.y1};this.addPoint=function(b,a){if(b!=null){if(isNaN(this.x1)||isNaN(this.x2))this.x2=this.x1=b;if(b<this.x1)this.x1=b;if(b>this.x2)this.x2=b}if(a!=null){if(isNaN(this.y1)||isNaN(this.y2))this.y2=this.y1=a;if(a<this.y1)this.y1=a;if(a>this.y2)this.y2=a}};this.addX=function(b){this.addPoint(b,null)};this.addY=function(b){this.addPoint(null,b)};this.addBoundingBox=function(b){this.addPoint(b.x1,b.y1);this.addPoint(b.x2,b.y2)};this.addQuadraticCurve=function(b,a,d,c,k,l){d=b+2/3*(d-b);c=a+2/3*(c- |
|||
a);this.addBezierCurve(b,a,d,d+1/3*(k-b),c,c+1/3*(l-a),k,l)};this.addBezierCurve=function(b,a,d,c,k,l,o,n){var q=[b,a],p=[d,c],t=[k,l],m=[o,n];this.addPoint(q[0],q[1]);this.addPoint(m[0],m[1]);for(i=0;i<=1;i++)b=function(b){return Math.pow(1-b,3)*q[i]+3*Math.pow(1-b,2)*b*p[i]+3*(1-b)*Math.pow(b,2)*t[i]+Math.pow(b,3)*m[i]},a=6*q[i]-12*p[i]+6*t[i],d=-3*q[i]+9*p[i]-9*t[i]+3*m[i],c=3*p[i]-3*q[i],d==0?a!=0&&(a=-c/a,0<a&&a<1&&(i==0&&this.addX(b(a)),i==1&&this.addY(b(a)))):(c=Math.pow(a,2)-4*c*d,c<0||(k= |
|||
(-a+Math.sqrt(c))/(2*d),0<k&&k<1&&(i==0&&this.addX(b(k)),i==1&&this.addY(b(k))),a=(-a-Math.sqrt(c))/(2*d),0<a&&a<1&&(i==0&&this.addX(b(a)),i==1&&this.addY(b(a)))))};this.isPointInBox=function(b,a){return this.x1<=b&&b<=this.x2&&this.y1<=a&&a<=this.y2};this.addPoint(a,d);this.addPoint(b,k)};a.Transform=function(c){var d=this;this.Type={};this.Type.translate=function(b){this.p=a.CreatePoint(b);this.apply=function(b){b.translate(this.p.x||0,this.p.y||0)};this.applyToPoint=function(b){b.applyTransform([1, |
|||
0,0,1,this.p.x||0,this.p.y||0])}};this.Type.rotate=function(b){b=a.ToNumberArray(b);this.angle=new a.Property("angle",b[0]);this.cx=b[1]||0;this.cy=b[2]||0;this.apply=function(b){b.translate(this.cx,this.cy);b.rotate(this.angle.Angle.toRadians());b.translate(-this.cx,-this.cy)};this.applyToPoint=function(b){var a=this.angle.Angle.toRadians();b.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]);b.applyTransform([Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0]);b.applyTransform([1,0,0,1,-this.p.x|| |
|||
0,-this.p.y||0])}};this.Type.scale=function(b){this.p=a.CreatePoint(b);this.apply=function(b){b.scale(this.p.x||1,this.p.y||this.p.x||1)};this.applyToPoint=function(b){b.applyTransform([this.p.x||0,0,0,this.p.y||0,0,0])}};this.Type.matrix=function(b){this.m=a.ToNumberArray(b);this.apply=function(b){b.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])};this.applyToPoint=function(b){b.applyTransform(this.m)}};this.Type.SkewBase=function(b){this.base=d.Type.matrix;this.base(b);this.angle= |
|||
new a.Property("angle",b)};this.Type.SkewBase.prototype=new this.Type.matrix;this.Type.skewX=function(b){this.base=d.Type.SkewBase;this.base(b);this.m=[1,0,Math.tan(this.angle.Angle.toRadians()),1,0,0]};this.Type.skewX.prototype=new this.Type.SkewBase;this.Type.skewY=function(b){this.base=d.Type.SkewBase;this.base(b);this.m=[1,Math.tan(this.angle.Angle.toRadians()),0,1,0,0]};this.Type.skewY.prototype=new this.Type.SkewBase;this.transforms=[];this.apply=function(b){for(var a=0;a<this.transforms.length;a++)this.transforms[a].apply(b)}; |
|||
this.applyToPoint=function(b){for(var a=0;a<this.transforms.length;a++)this.transforms[a].applyToPoint(b)};for(var c=a.trim(a.compressSpaces(c)).split(/\s(?=[a-z])/),b=0;b<c.length;b++){var k=c[b].split("(")[0],e=c[b].split("(")[1].replace(")","");this.transforms.push(new this.Type[k](e))}};a.AspectRatio=function(c,d,b,k,e,f,g,j,h,l){var d=a.compressSpaces(d),d=d.replace(/^defer\s/,""),o=d.split(" ")[0]||"xMidYMid",d=d.split(" ")[1]||"meet",n=b/k,q=e/f,p=Math.min(n,q),m=Math.max(n,q);d=="meet"&&(k*= |
|||
p,f*=p);d=="slice"&&(k*=m,f*=m);h=new a.Property("refX",h);l=new a.Property("refY",l);h.hasValue()&&l.hasValue()?c.translate(-p*h.Length.toPixels("x"),-p*l.Length.toPixels("y")):(o.match(/^xMid/)&&(d=="meet"&&p==q||d=="slice"&&m==q)&&c.translate(b/2-k/2,0),o.match(/YMid$/)&&(d=="meet"&&p==n||d=="slice"&&m==n)&&c.translate(0,e/2-f/2),o.match(/^xMax/)&&(d=="meet"&&p==q||d=="slice"&&m==q)&&c.translate(b-k,0),o.match(/YMax$/)&&(d=="meet"&&p==n||d=="slice"&&m==n)&&c.translate(0,e-f));o=="none"?c.scale(n, |
|||
q):d=="meet"?c.scale(p,p):d=="slice"&&c.scale(m,m);c.translate(g==null?0:-g,j==null?0:-j)};a.Element={};a.Element.ElementBase=function(c){this.attributes={};this.styles={};this.children=[];this.attribute=function(b,d){var c=this.attributes[b];if(c!=null)return c;c=new a.Property(b,"");d==!0&&(this.attributes[b]=c);return c};this.style=function(b,d){var c=this.styles[b];if(c!=null)return c;c=this.attribute(b);if(c!=null&&c.hasValue())return c;c=this.parent;if(c!=null&&(c=c.style(b),c!=null&&c.hasValue()))return c; |
|||
c=new a.Property(b,"");d==!0&&(this.styles[b]=c);return c};this.render=function(b){if(this.style("display").value!="none"&&this.attribute("visibility").value!="hidden"){b.save();this.setContext(b);if(this.attribute("mask").hasValue()){var a=this.attribute("mask").Definition.getDefinition();a!=null&&a.apply(b,this)}else this.style("filter").hasValue()?(a=this.style("filter").Definition.getDefinition(),a!=null&&a.apply(b,this)):this.renderChildren(b);this.clearContext(b);b.restore()}};this.setContext= |
|||
function(){};this.clearContext=function(){};this.renderChildren=function(b){for(var a=0;a<this.children.length;a++)this.children[a].render(b)};this.addChild=function(b,d){var c=b;d&&(c=a.CreateElement(b));c.parent=this;this.children.push(c)};if(c!=null&&c.nodeType==1){for(var d=0;d<c.childNodes.length;d++){var b=c.childNodes[d];b.nodeType==1&&this.addChild(b,!0)}for(d=0;d<c.attributes.length;d++)b=c.attributes[d],this.attributes[b.nodeName]=new a.Property(b.nodeName,b.nodeValue);b=a.Styles[c.nodeName]; |
|||
if(b!=null)for(var k in b)this.styles[k]=b[k];if(this.attribute("class").hasValue())for(var d=a.compressSpaces(this.attribute("class").value).split(" "),e=0;e<d.length;e++){b=a.Styles["."+d[e]];if(b!=null)for(k in b)this.styles[k]=b[k];b=a.Styles[c.nodeName+"."+d[e]];if(b!=null)for(k in b)this.styles[k]=b[k]}if(this.attribute("style").hasValue()){b=this.attribute("style").value.split(";");for(d=0;d<b.length;d++)a.trim(b[d])!=""&&(c=b[d].split(":"),k=a.trim(c[0]),c=a.trim(c[1]),this.styles[k]=new a.Property(k, |
|||
c))}this.attribute("id").hasValue()&&a.Definitions[this.attribute("id").value]==null&&(a.Definitions[this.attribute("id").value]=this)}};a.Element.RenderedElementBase=function(c){this.base=a.Element.ElementBase;this.base(c);this.setContext=function(d){if(this.style("fill").Definition.isUrl()){var b=this.style("fill").Definition.getFillStyle(this);if(b!=null)d.fillStyle=b}else if(this.style("fill").hasValue())b=this.style("fill"),this.style("fill-opacity").hasValue()&&(b=b.Color.addOpacity(this.style("fill-opacity").value)), |
|||
d.fillStyle=b.value=="none"?"rgba(0,0,0,0)":b.value;if(this.style("stroke").Definition.isUrl()){if(b=this.style("stroke").Definition.getFillStyle(this),b!=null)d.strokeStyle=b}else if(this.style("stroke").hasValue())b=this.style("stroke"),this.style("stroke-opacity").hasValue()&&(b=b.Color.addOpacity(this.style("stroke-opacity").value)),d.strokeStyle=b.value=="none"?"rgba(0,0,0,0)":b.value;if(this.style("stroke-width").hasValue())d.lineWidth=this.style("stroke-width").Length.toPixels();if(this.style("stroke-linecap").hasValue())d.lineCap= |
|||
this.style("stroke-linecap").value;if(this.style("stroke-linejoin").hasValue())d.lineJoin=this.style("stroke-linejoin").value;if(this.style("stroke-miterlimit").hasValue())d.miterLimit=this.style("stroke-miterlimit").value;if(typeof d.font!="undefined")d.font=a.Font.CreateFont(this.style("font-style").value,this.style("font-variant").value,this.style("font-weight").value,this.style("font-size").hasValue()?this.style("font-size").Length.toPixels()+"px":"",this.style("font-family").value).toString(); |
|||
this.attribute("transform").hasValue()&&(new a.Transform(this.attribute("transform").value)).apply(d);this.attribute("clip-path").hasValue()&&(b=this.attribute("clip-path").Definition.getDefinition(),b!=null&&b.apply(d));if(this.style("opacity").hasValue())d.globalAlpha=this.style("opacity").numValue()}};a.Element.RenderedElementBase.prototype=new a.Element.ElementBase;a.Element.PathElementBase=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.path=function(d){d!=null&&d.beginPath(); |
|||
return new a.BoundingBox};this.renderChildren=function(d){this.path(d);a.Mouse.checkPath(this,d);d.fillStyle!=""&&d.fill();d.strokeStyle!=""&&d.stroke();var b=this.getMarkers();if(b!=null){if(this.style("marker-start").Definition.isUrl()){var c=this.style("marker-start").Definition.getDefinition();c.render(d,b[0][0],b[0][1])}if(this.style("marker-mid").Definition.isUrl())for(var c=this.style("marker-mid").Definition.getDefinition(),e=1;e<b.length-1;e++)c.render(d,b[e][0],b[e][1]);this.style("marker-end").Definition.isUrl()&& |
|||
(c=this.style("marker-end").Definition.getDefinition(),c.render(d,b[b.length-1][0],b[b.length-1][1]))}};this.getBoundingBox=function(){return this.path()};this.getMarkers=function(){return null}};a.Element.PathElementBase.prototype=new a.Element.RenderedElementBase;a.Element.svg=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.baseClearContext=this.clearContext;this.clearContext=function(d){this.baseClearContext(d);a.ViewPort.RemoveCurrent()};this.baseSetContext=this.setContext; |
|||
this.setContext=function(d){d.strokeStyle="rgba(0,0,0,0)";d.lineCap="butt";d.lineJoin="miter";d.miterLimit=4;this.baseSetContext(d);this.attribute("x").hasValue()&&this.attribute("y").hasValue()&&d.translate(this.attribute("x").Length.toPixels("x"),this.attribute("y").Length.toPixels("y"));var b=a.ViewPort.width(),c=a.ViewPort.height();if(typeof this.root=="undefined"&&this.attribute("width").hasValue()&&this.attribute("height").hasValue()){var b=this.attribute("width").Length.toPixels("x"),c=this.attribute("height").Length.toPixels("y"), |
|||
e=0,f=0;this.attribute("refX").hasValue()&&this.attribute("refY").hasValue()&&(e=-this.attribute("refX").Length.toPixels("x"),f=-this.attribute("refY").Length.toPixels("y"));d.beginPath();d.moveTo(e,f);d.lineTo(b,f);d.lineTo(b,c);d.lineTo(e,c);d.closePath();d.clip()}a.ViewPort.SetCurrent(b,c);if(this.attribute("viewBox").hasValue()){var e=a.ToNumberArray(this.attribute("viewBox").value),f=e[0],g=e[1],b=e[2],c=e[3];a.AspectRatio(d,this.attribute("preserveAspectRatio").value,a.ViewPort.width(),b,a.ViewPort.height(), |
|||
c,f,g,this.attribute("refX").value,this.attribute("refY").value);a.ViewPort.RemoveCurrent();a.ViewPort.SetCurrent(e[2],e[3])}}};a.Element.svg.prototype=new a.Element.RenderedElementBase;a.Element.rect=function(c){this.base=a.Element.PathElementBase;this.base(c);this.path=function(d){var b=this.attribute("x").Length.toPixels("x"),c=this.attribute("y").Length.toPixels("y"),e=this.attribute("width").Length.toPixels("x"),f=this.attribute("height").Length.toPixels("y"),g=this.attribute("rx").Length.toPixels("x"), |
|||
j=this.attribute("ry").Length.toPixels("y");this.attribute("rx").hasValue()&&!this.attribute("ry").hasValue()&&(j=g);this.attribute("ry").hasValue()&&!this.attribute("rx").hasValue()&&(g=j);d!=null&&(d.beginPath(),d.moveTo(b+g,c),d.lineTo(b+e-g,c),d.quadraticCurveTo(b+e,c,b+e,c+j),d.lineTo(b+e,c+f-j),d.quadraticCurveTo(b+e,c+f,b+e-g,c+f),d.lineTo(b+g,c+f),d.quadraticCurveTo(b,c+f,b,c+f-j),d.lineTo(b,c+j),d.quadraticCurveTo(b,c,b+g,c),d.closePath());return new a.BoundingBox(b,c,b+e,c+f)}};a.Element.rect.prototype= |
|||
new a.Element.PathElementBase;a.Element.circle=function(c){this.base=a.Element.PathElementBase;this.base(c);this.path=function(d){var b=this.attribute("cx").Length.toPixels("x"),c=this.attribute("cy").Length.toPixels("y"),e=this.attribute("r").Length.toPixels();d!=null&&(d.beginPath(),d.arc(b,c,e,0,Math.PI*2,!0),d.closePath());return new a.BoundingBox(b-e,c-e,b+e,c+e)}};a.Element.circle.prototype=new a.Element.PathElementBase;a.Element.ellipse=function(c){this.base=a.Element.PathElementBase;this.base(c); |
|||
this.path=function(d){var b=4*((Math.sqrt(2)-1)/3),c=this.attribute("rx").Length.toPixels("x"),e=this.attribute("ry").Length.toPixels("y"),f=this.attribute("cx").Length.toPixels("x"),g=this.attribute("cy").Length.toPixels("y");d!=null&&(d.beginPath(),d.moveTo(f,g-e),d.bezierCurveTo(f+b*c,g-e,f+c,g-b*e,f+c,g),d.bezierCurveTo(f+c,g+b*e,f+b*c,g+e,f,g+e),d.bezierCurveTo(f-b*c,g+e,f-c,g+b*e,f-c,g),d.bezierCurveTo(f-c,g-b*e,f-b*c,g-e,f,g-e),d.closePath());return new a.BoundingBox(f-c,g-e,f+c,g+e)}};a.Element.ellipse.prototype= |
|||
new a.Element.PathElementBase;a.Element.line=function(c){this.base=a.Element.PathElementBase;this.base(c);this.getPoints=function(){return[new a.Point(this.attribute("x1").Length.toPixels("x"),this.attribute("y1").Length.toPixels("y")),new a.Point(this.attribute("x2").Length.toPixels("x"),this.attribute("y2").Length.toPixels("y"))]};this.path=function(d){var b=this.getPoints();d!=null&&(d.beginPath(),d.moveTo(b[0].x,b[0].y),d.lineTo(b[1].x,b[1].y));return new a.BoundingBox(b[0].x,b[0].y,b[1].x,b[1].y)}; |
|||
this.getMarkers=function(){var a=this.getPoints(),b=a[0].angleTo(a[1]);return[[a[0],b],[a[1],b]]}};a.Element.line.prototype=new a.Element.PathElementBase;a.Element.polyline=function(c){this.base=a.Element.PathElementBase;this.base(c);this.points=a.CreatePath(this.attribute("points").value);this.path=function(d){var b=new a.BoundingBox(this.points[0].x,this.points[0].y);d!=null&&(d.beginPath(),d.moveTo(this.points[0].x,this.points[0].y));for(var c=1;c<this.points.length;c++)b.addPoint(this.points[c].x, |
|||
this.points[c].y),d!=null&&d.lineTo(this.points[c].x,this.points[c].y);return b};this.getMarkers=function(){for(var a=[],b=0;b<this.points.length-1;b++)a.push([this.points[b],this.points[b].angleTo(this.points[b+1])]);a.push([this.points[this.points.length-1],a[a.length-1][1]]);return a}};a.Element.polyline.prototype=new a.Element.PathElementBase;a.Element.polygon=function(c){this.base=a.Element.polyline;this.base(c);this.basePath=this.path;this.path=function(a){var b=this.basePath(a);a!=null&&(a.lineTo(this.points[0].x, |
|||
this.points[0].y),a.closePath());return b}};a.Element.polygon.prototype=new a.Element.polyline;a.Element.path=function(c){this.base=a.Element.PathElementBase;this.base(c);c=this.attribute("d").value;c=c.replace(/,/gm," ");c=c.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");c=c.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");c=c.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2");c=c.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");c=c.replace(/([0-9])([+\-])/gm, |
|||
"$1 $2");c=c.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");c=c.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");c=a.compressSpaces(c);c=a.trim(c);this.PathParser=new function(d){this.tokens=d.split(" ");this.reset=function(){this.i=-1;this.previousCommand=this.command="";this.start=new a.Point(0,0);this.control=new a.Point(0,0);this.current=new a.Point(0,0);this.points=[];this.angles=[]};this.isEnd=function(){return this.i>=this.tokens.length-1};this.isCommandOrEnd=function(){return this.isEnd()? |
|||
!0:this.tokens[this.i+1].match(/^[A-Za-z]$/)!=null};this.isRelativeCommand=function(){return this.command==this.command.toLowerCase()};this.getToken=function(){this.i+=1;return this.tokens[this.i]};this.getScalar=function(){return parseFloat(this.getToken())};this.nextCommand=function(){this.previousCommand=this.command;this.command=this.getToken()};this.getPoint=function(){return this.makeAbsolute(new a.Point(this.getScalar(),this.getScalar()))};this.getAsControlPoint=function(){var b=this.getPoint(); |
|||
return this.control=b};this.getAsCurrentPoint=function(){var b=this.getPoint();return this.current=b};this.getReflectedControlPoint=function(){return this.previousCommand.toLowerCase()!="c"&&this.previousCommand.toLowerCase()!="s"?this.current:new a.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y)};this.makeAbsolute=function(b){if(this.isRelativeCommand())b.x=this.current.x+b.x,b.y=this.current.y+b.y;return b};this.addMarker=function(b,a,d){d!=null&&this.angles.length>0&&this.angles[this.angles.length- |
|||
1]==null&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(d));this.addMarkerAngle(b,a==null?null:a.angleTo(b))};this.addMarkerAngle=function(b,a){this.points.push(b);this.angles.push(a)};this.getMarkerPoints=function(){return this.points};this.getMarkerAngles=function(){for(var b=0;b<this.angles.length;b++)if(this.angles[b]==null)for(var a=b+1;a<this.angles.length;a++)if(this.angles[a]!=null){this.angles[b]=this.angles[a];break}return this.angles}}(c);this.path=function(d){var b= |
|||
this.PathParser;b.reset();var c=new a.BoundingBox;for(d!=null&&d.beginPath();!b.isEnd();)switch(b.nextCommand(),b.command.toUpperCase()){case "M":var e=b.getAsCurrentPoint();b.addMarker(e);c.addPoint(e.x,e.y);d!=null&&d.moveTo(e.x,e.y);for(b.start=b.current;!b.isCommandOrEnd();)e=b.getAsCurrentPoint(),b.addMarker(e,b.start),c.addPoint(e.x,e.y),d!=null&&d.lineTo(e.x,e.y);break;case "L":for(;!b.isCommandOrEnd();){var f=b.current,e=b.getAsCurrentPoint();b.addMarker(e,f);c.addPoint(e.x,e.y);d!=null&& |
|||
d.lineTo(e.x,e.y)}break;case "H":for(;!b.isCommandOrEnd();)e=new a.Point((b.isRelativeCommand()?b.current.x:0)+b.getScalar(),b.current.y),b.addMarker(e,b.current),b.current=e,c.addPoint(b.current.x,b.current.y),d!=null&&d.lineTo(b.current.x,b.current.y);break;case "V":for(;!b.isCommandOrEnd();)e=new a.Point(b.current.x,(b.isRelativeCommand()?b.current.y:0)+b.getScalar()),b.addMarker(e,b.current),b.current=e,c.addPoint(b.current.x,b.current.y),d!=null&&d.lineTo(b.current.x,b.current.y);break;case "C":for(;!b.isCommandOrEnd();){var g= |
|||
b.current,f=b.getPoint(),j=b.getAsControlPoint(),e=b.getAsCurrentPoint();b.addMarker(e,j,f);c.addBezierCurve(g.x,g.y,f.x,f.y,j.x,j.y,e.x,e.y);d!=null&&d.bezierCurveTo(f.x,f.y,j.x,j.y,e.x,e.y)}break;case "S":for(;!b.isCommandOrEnd();)g=b.current,f=b.getReflectedControlPoint(),j=b.getAsControlPoint(),e=b.getAsCurrentPoint(),b.addMarker(e,j,f),c.addBezierCurve(g.x,g.y,f.x,f.y,j.x,j.y,e.x,e.y),d!=null&&d.bezierCurveTo(f.x,f.y,j.x,j.y,e.x,e.y);break;case "Q":for(;!b.isCommandOrEnd();)g=b.current,j=b.getAsControlPoint(), |
|||
e=b.getAsCurrentPoint(),b.addMarker(e,j,j),c.addQuadraticCurve(g.x,g.y,j.x,j.y,e.x,e.y),d!=null&&d.quadraticCurveTo(j.x,j.y,e.x,e.y);break;case "T":for(;!b.isCommandOrEnd();)g=b.current,j=b.getReflectedControlPoint(),b.control=j,e=b.getAsCurrentPoint(),b.addMarker(e,j,j),c.addQuadraticCurve(g.x,g.y,j.x,j.y,e.x,e.y),d!=null&&d.quadraticCurveTo(j.x,j.y,e.x,e.y);break;case "A":for(;!b.isCommandOrEnd();){var g=b.current,h=b.getScalar(),l=b.getScalar(),f=b.getScalar()*(Math.PI/180),o=b.getScalar(),j=b.getScalar(), |
|||
e=b.getAsCurrentPoint(),n=new a.Point(Math.cos(f)*(g.x-e.x)/2+Math.sin(f)*(g.y-e.y)/2,-Math.sin(f)*(g.x-e.x)/2+Math.cos(f)*(g.y-e.y)/2),q=Math.pow(n.x,2)/Math.pow(h,2)+Math.pow(n.y,2)/Math.pow(l,2);q>1&&(h*=Math.sqrt(q),l*=Math.sqrt(q));o=(o==j?-1:1)*Math.sqrt((Math.pow(h,2)*Math.pow(l,2)-Math.pow(h,2)*Math.pow(n.y,2)-Math.pow(l,2)*Math.pow(n.x,2))/(Math.pow(h,2)*Math.pow(n.y,2)+Math.pow(l,2)*Math.pow(n.x,2)));isNaN(o)&&(o=0);var p=new a.Point(o*h*n.y/l,o*-l*n.x/h),g=new a.Point((g.x+e.x)/2+Math.cos(f)* |
|||
p.x-Math.sin(f)*p.y,(g.y+e.y)/2+Math.sin(f)*p.x+Math.cos(f)*p.y),m=function(b,a){return(b[0]*a[0]+b[1]*a[1])/(Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2))*Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)))},s=function(b,a){return(b[0]*a[1]<b[1]*a[0]?-1:1)*Math.acos(m(b,a))},o=s([1,0],[(n.x-p.x)/h,(n.y-p.y)/l]),q=[(n.x-p.x)/h,(n.y-p.y)/l],p=[(-n.x-p.x)/h,(-n.y-p.y)/l],n=s(q,p);if(m(q,p)<=-1)n=Math.PI;m(q,p)>=1&&(n=0);j==0&&n>0&&(n-=2*Math.PI);j==1&&n<0&&(n+=2*Math.PI);q=new a.Point(g.x-h*Math.cos((o+n)/ |
|||
2),g.y-l*Math.sin((o+n)/2));b.addMarkerAngle(q,(o+n)/2+(j==0?1:-1)*Math.PI/2);b.addMarkerAngle(e,n+(j==0?1:-1)*Math.PI/2);c.addPoint(e.x,e.y);d!=null&&(m=h>l?h:l,e=h>l?1:h/l,h=h>l?l/h:1,d.translate(g.x,g.y),d.rotate(f),d.scale(e,h),d.arc(0,0,m,o,o+n,1-j),d.scale(1/e,1/h),d.rotate(-f),d.translate(-g.x,-g.y))}break;case "Z":d!=null&&d.closePath(),b.current=b.start}return c};this.getMarkers=function(){for(var a=this.PathParser.getMarkerPoints(),b=this.PathParser.getMarkerAngles(),c=[],e=0;e<a.length;e++)c.push([a[e], |
|||
b[e]]);return c}};a.Element.path.prototype=new a.Element.PathElementBase;a.Element.pattern=function(c){this.base=a.Element.ElementBase;this.base(c);this.createPattern=function(d){var b=new a.Element.svg;b.attributes.viewBox=new a.Property("viewBox",this.attribute("viewBox").value);b.attributes.x=new a.Property("x",this.attribute("x").value);b.attributes.y=new a.Property("y",this.attribute("y").value);b.attributes.width=new a.Property("width",this.attribute("width").value);b.attributes.height=new a.Property("height", |
|||
this.attribute("height").value);b.children=this.children;var c=document.createElement("canvas");c.width=this.attribute("width").Length.toPixels("x");c.height=this.attribute("height").Length.toPixels("y");b.render(c.getContext("2d"));return d.createPattern(c,"repeat")}};a.Element.pattern.prototype=new a.Element.ElementBase;a.Element.marker=function(c){this.base=a.Element.ElementBase;this.base(c);this.baseRender=this.render;this.render=function(d,b,c){d.translate(b.x,b.y);this.attribute("orient").valueOrDefault("auto")== |
|||
"auto"&&d.rotate(c);this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"&&d.scale(d.lineWidth,d.lineWidth);d.save();var e=new a.Element.svg;e.attributes.viewBox=new a.Property("viewBox",this.attribute("viewBox").value);e.attributes.refX=new a.Property("refX",this.attribute("refX").value);e.attributes.refY=new a.Property("refY",this.attribute("refY").value);e.attributes.width=new a.Property("width",this.attribute("markerWidth").value);e.attributes.height=new a.Property("height", |
|||
this.attribute("markerHeight").value);e.attributes.fill=new a.Property("fill",this.attribute("fill").valueOrDefault("black"));e.attributes.stroke=new a.Property("stroke",this.attribute("stroke").valueOrDefault("none"));e.children=this.children;e.render(d);d.restore();this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"&&d.scale(1/d.lineWidth,1/d.lineWidth);this.attribute("orient").valueOrDefault("auto")=="auto"&&d.rotate(-c);d.translate(-b.x,-b.y)}};a.Element.marker.prototype= |
|||
new a.Element.ElementBase;a.Element.defs=function(c){this.base=a.Element.ElementBase;this.base(c);this.render=function(){}};a.Element.defs.prototype=new a.Element.ElementBase;a.Element.GradientBase=function(c){this.base=a.Element.ElementBase;this.base(c);this.gradientUnits=this.attribute("gradientUnits").valueOrDefault("objectBoundingBox");this.stops=[];for(c=0;c<this.children.length;c++)this.stops.push(this.children[c]);this.getGradient=function(){};this.createGradient=function(d,b){var c=this;this.attribute("xlink:href").hasValue()&& |
|||
(c=this.attribute("xlink:href").Definition.getDefinition());for(var e=this.getGradient(d,b),f=0;f<c.stops.length;f++)e.addColorStop(c.stops[f].offset,c.stops[f].color);if(this.attribute("gradientTransform").hasValue()){c=a.ViewPort.viewPorts[0];f=new a.Element.rect;f.attributes.x=new a.Property("x",-a.MAX_VIRTUAL_PIXELS/3);f.attributes.y=new a.Property("y",-a.MAX_VIRTUAL_PIXELS/3);f.attributes.width=new a.Property("width",a.MAX_VIRTUAL_PIXELS);f.attributes.height=new a.Property("height",a.MAX_VIRTUAL_PIXELS); |
|||
var g=new a.Element.g;g.attributes.transform=new a.Property("transform",this.attribute("gradientTransform").value);g.children=[f];f=new a.Element.svg;f.attributes.x=new a.Property("x",0);f.attributes.y=new a.Property("y",0);f.attributes.width=new a.Property("width",c.width);f.attributes.height=new a.Property("height",c.height);f.children=[g];g=document.createElement("canvas");g.width=c.width;g.height=c.height;c=g.getContext("2d");c.fillStyle=e;f.render(c);return c.createPattern(g,"no-repeat")}return e}}; |
|||
a.Element.GradientBase.prototype=new a.Element.ElementBase;a.Element.linearGradient=function(c){this.base=a.Element.GradientBase;this.base(c);this.getGradient=function(a,b){var c=b.getBoundingBox(),e=this.gradientUnits=="objectBoundingBox"?c.x()+c.width()*this.attribute("x1").numValue():this.attribute("x1").Length.toPixels("x"),f=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("y1").numValue():this.attribute("y1").Length.toPixels("y"),g=this.gradientUnits=="objectBoundingBox"? |
|||
c.x()+c.width()*this.attribute("x2").numValue():this.attribute("x2").Length.toPixels("x"),c=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("y2").numValue():this.attribute("y2").Length.toPixels("y");return a.createLinearGradient(e,f,g,c)}};a.Element.linearGradient.prototype=new a.Element.GradientBase;a.Element.radialGradient=function(c){this.base=a.Element.GradientBase;this.base(c);this.getGradient=function(a,b){var c=b.getBoundingBox(),e=this.gradientUnits=="objectBoundingBox"? |
|||
c.x()+c.width()*this.attribute("cx").numValue():this.attribute("cx").Length.toPixels("x"),f=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("cy").numValue():this.attribute("cy").Length.toPixels("y"),g=e,j=f;this.attribute("fx").hasValue()&&(g=this.gradientUnits=="objectBoundingBox"?c.x()+c.width()*this.attribute("fx").numValue():this.attribute("fx").Length.toPixels("x"));this.attribute("fy").hasValue()&&(j=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("fy").numValue(): |
|||
this.attribute("fy").Length.toPixels("y"));c=this.gradientUnits=="objectBoundingBox"?(c.width()+c.height())/2*this.attribute("r").numValue():this.attribute("r").Length.toPixels();return a.createRadialGradient(g,j,0,e,f,c)}};a.Element.radialGradient.prototype=new a.Element.GradientBase;a.Element.stop=function(c){this.base=a.Element.ElementBase;this.base(c);this.offset=this.attribute("offset").numValue();c=this.style("stop-color");this.style("stop-opacity").hasValue()&&(c=c.Color.addOpacity(this.style("stop-opacity").value)); |
|||
this.color=c.value};a.Element.stop.prototype=new a.Element.ElementBase;a.Element.AnimateBase=function(c){this.base=a.Element.ElementBase;this.base(c);a.Animations.push(this);this.duration=0;this.begin=this.attribute("begin").Time.toMilliseconds();this.maxDuration=this.begin+this.attribute("dur").Time.toMilliseconds();this.getProperty=function(){var a=this.attribute("attributeType").value,b=this.attribute("attributeName").value;return a=="CSS"?this.parent.style(b,!0):this.parent.attribute(b,!0)};this.initialValue= |
|||
null;this.removed=!1;this.calcValue=function(){return""};this.update=function(a){if(this.initialValue==null)this.initialValue=this.getProperty().value;if(this.duration>this.maxDuration)if(this.attribute("repeatCount").value=="indefinite")this.duration=0;else return this.attribute("fill").valueOrDefault("remove")=="remove"&&!this.removed?(this.removed=!0,this.getProperty().value=this.initialValue,!0):!1;this.duration+=a;a=!1;if(this.begin<this.duration)a=this.calcValue(),this.attribute("type").hasValue()&& |
|||
(a=this.attribute("type").value+"("+a+")"),this.getProperty().value=a,a=!0;return a};this.progress=function(){return(this.duration-this.begin)/(this.maxDuration-this.begin)}};a.Element.AnimateBase.prototype=new a.Element.ElementBase;a.Element.animate=function(c){this.base=a.Element.AnimateBase;this.base(c);this.calcValue=function(){var a=this.attribute("from").numValue(),b=this.attribute("to").numValue();return a+(b-a)*this.progress()}};a.Element.animate.prototype=new a.Element.AnimateBase;a.Element.animateColor= |
|||
function(c){this.base=a.Element.AnimateBase;this.base(c);this.calcValue=function(){var a=new RGBColor(this.attribute("from").value),b=new RGBColor(this.attribute("to").value);if(a.ok&&b.ok){var c=a.r+(b.r-a.r)*this.progress(),e=a.g+(b.g-a.g)*this.progress(),a=a.b+(b.b-a.b)*this.progress();return"rgb("+parseInt(c,10)+","+parseInt(e,10)+","+parseInt(a,10)+")"}return this.attribute("from").value}};a.Element.animateColor.prototype=new a.Element.AnimateBase;a.Element.animateTransform=function(c){this.base= |
|||
a.Element.animate;this.base(c)};a.Element.animateTransform.prototype=new a.Element.animate;a.Element.font=function(c){this.base=a.Element.ElementBase;this.base(c);this.horizAdvX=this.attribute("horiz-adv-x").numValue();this.isArabic=this.isRTL=!1;this.missingGlyph=this.fontFace=null;this.glyphs=[];for(c=0;c<this.children.length;c++){var d=this.children[c];if(d.type=="font-face")this.fontFace=d,d.style("font-family").hasValue()&&(a.Definitions[d.style("font-family").value]=this);else if(d.type=="missing-glyph")this.missingGlyph= |
|||
d;else if(d.type=="glyph")d.arabicForm!=""?(this.isArabic=this.isRTL=!0,typeof this.glyphs[d.unicode]=="undefined"&&(this.glyphs[d.unicode]=[]),this.glyphs[d.unicode][d.arabicForm]=d):this.glyphs[d.unicode]=d}};a.Element.font.prototype=new a.Element.ElementBase;a.Element.fontface=function(c){this.base=a.Element.ElementBase;this.base(c);this.ascent=this.attribute("ascent").value;this.descent=this.attribute("descent").value;this.unitsPerEm=this.attribute("units-per-em").numValue()};a.Element.fontface.prototype= |
|||
new a.Element.ElementBase;a.Element.missingglyph=function(c){this.base=a.Element.path;this.base(c);this.horizAdvX=0};a.Element.missingglyph.prototype=new a.Element.path;a.Element.glyph=function(c){this.base=a.Element.path;this.base(c);this.horizAdvX=this.attribute("horiz-adv-x").numValue();this.unicode=this.attribute("unicode").value;this.arabicForm=this.attribute("arabic-form").value};a.Element.glyph.prototype=new a.Element.path;a.Element.text=function(c){this.base=a.Element.RenderedElementBase; |
|||
this.base(c);if(c!=null){this.children=[];for(var d=0;d<c.childNodes.length;d++){var b=c.childNodes[d];b.nodeType==1?this.addChild(b,!0):b.nodeType==3&&this.addChild(new a.Element.tspan(b),!1)}}this.baseSetContext=this.setContext;this.setContext=function(b){this.baseSetContext(b);if(this.style("dominant-baseline").hasValue())b.textBaseline=this.style("dominant-baseline").value;if(this.style("alignment-baseline").hasValue())b.textBaseline=this.style("alignment-baseline").value};this.renderChildren= |
|||
function(b){for(var a=this.style("text-anchor").valueOrDefault("start"),c=this.attribute("x").Length.toPixels("x"),d=this.attribute("y").Length.toPixels("y"),j=0;j<this.children.length;j++){var h=this.children[j];h.attribute("x").hasValue()?h.x=h.attribute("x").Length.toPixels("x"):(h.attribute("dx").hasValue()&&(c+=h.attribute("dx").Length.toPixels("x")),h.x=c);c=h.measureText(b);if(a!="start"&&(j==0||h.attribute("x").hasValue())){for(var l=c,o=j+1;o<this.children.length;o++){var n=this.children[o]; |
|||
if(n.attribute("x").hasValue())break;l+=n.measureText(b)}h.x-=a=="end"?l:l/2}c=h.x+c;h.attribute("y").hasValue()?h.y=h.attribute("y").Length.toPixels("y"):(h.attribute("dy").hasValue()&&(d+=h.attribute("dy").Length.toPixels("y")),h.y=d);d=h.y;h.render(b)}}};a.Element.text.prototype=new a.Element.RenderedElementBase;a.Element.TextElementBase=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.getGlyph=function(a,b,c){var e=b[c],f=null;if(a.isArabic){var g="isolated";if((c==0||b[c- |
|||
1]==" ")&&c<b.length-2&&b[c+1]!=" ")g="terminal";c>0&&b[c-1]!=" "&&c<b.length-2&&b[c+1]!=" "&&(g="medial");if(c>0&&b[c-1]!=" "&&(c==b.length-1||b[c+1]==" "))g="initial";typeof a.glyphs[e]!="undefined"&&(f=a.glyphs[e][g],f==null&&a.glyphs[e].type=="glyph"&&(f=a.glyphs[e]))}else f=a.glyphs[e];if(f==null)f=a.missingGlyph;return f};this.renderChildren=function(c){var b=this.parent.style("font-family").Definition.getDefinition();if(b!=null){var k=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize), |
|||
e=this.parent.style("font-style").valueOrDefault(a.Font.Parse(a.ctx.font).fontStyle),f=this.getText();b.isRTL&&(f=f.split("").reverse().join(""));for(var g=a.ToNumberArray(this.parent.attribute("dx").value),j=0;j<f.length;j++){var h=this.getGlyph(b,f,j),l=k/b.fontFace.unitsPerEm;c.translate(this.x,this.y);c.scale(l,-l);var o=c.lineWidth;c.lineWidth=c.lineWidth*b.fontFace.unitsPerEm/k;e=="italic"&&c.transform(1,0,0.4,1,0,0);h.render(c);e=="italic"&&c.transform(1,0,-0.4,1,0,0);c.lineWidth=o;c.scale(1/ |
|||
l,-1/l);c.translate(-this.x,-this.y);this.x+=k*(h.horizAdvX||b.horizAdvX)/b.fontFace.unitsPerEm;typeof g[j]!="undefined"&&!isNaN(g[j])&&(this.x+=g[j])}}else c.strokeStyle!=""&&c.strokeText(a.compressSpaces(this.getText()),this.x,this.y),c.fillStyle!=""&&c.fillText(a.compressSpaces(this.getText()),this.x,this.y)};this.getText=function(){};this.measureText=function(c){var b=this.parent.style("font-family").Definition.getDefinition();if(b!=null){var c=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize), |
|||
k=0,e=this.getText();b.isRTL&&(e=e.split("").reverse().join(""));for(var f=a.ToNumberArray(this.parent.attribute("dx").value),g=0;g<e.length;g++){var j=this.getGlyph(b,e,g);k+=(j.horizAdvX||b.horizAdvX)*c/b.fontFace.unitsPerEm;typeof f[g]!="undefined"&&!isNaN(f[g])&&(k+=f[g])}return k}b=a.compressSpaces(this.getText());if(!c.measureText)return b.length*10;c.save();this.setContext(c);b=c.measureText(b).width;c.restore();return b}};a.Element.TextElementBase.prototype=new a.Element.RenderedElementBase; |
|||
a.Element.tspan=function(c){this.base=a.Element.TextElementBase;this.base(c);this.text=c.nodeType==3?c.nodeValue:c.childNodes.length>0?c.childNodes[0].nodeValue:c.text;this.getText=function(){return this.text}};a.Element.tspan.prototype=new a.Element.TextElementBase;a.Element.tref=function(c){this.base=a.Element.TextElementBase;this.base(c);this.getText=function(){var a=this.attribute("xlink:href").Definition.getDefinition();if(a!=null)return a.children[0].getText()}};a.Element.tref.prototype=new a.Element.TextElementBase; |
|||
a.Element.a=function(c){this.base=a.Element.TextElementBase;this.base(c);this.hasText=!0;for(var d=0;d<c.childNodes.length;d++)if(c.childNodes[d].nodeType!=3)this.hasText=!1;this.text=this.hasText?c.childNodes[0].nodeValue:"";this.getText=function(){return this.text};this.baseRenderChildren=this.renderChildren;this.renderChildren=function(b){if(this.hasText){this.baseRenderChildren(b);var c=new a.Property("fontSize",a.Font.Parse(a.ctx.font).fontSize);a.Mouse.checkBoundingBox(this,new a.BoundingBox(this.x, |
|||
this.y-c.Length.toPixels("y"),this.x+this.measureText(b),this.y))}else c=new a.Element.g,c.children=this.children,c.parent=this,c.render(b)};this.onclick=function(){window.open(this.attribute("xlink:href").value)};this.onmousemove=function(){a.ctx.canvas.style.cursor="pointer"}};a.Element.a.prototype=new a.Element.TextElementBase;a.Element.image=function(c){this.base=a.Element.RenderedElementBase;this.base(c);a.Images.push(this);this.img=document.createElement("img");this.loaded=!1;var d=this;this.img.onload= |
|||
function(){d.loaded=!0};this.img.src=this.attribute("xlink:href").value;this.renderChildren=function(b){var c=this.attribute("x").Length.toPixels("x"),d=this.attribute("y").Length.toPixels("y"),f=this.attribute("width").Length.toPixels("x"),g=this.attribute("height").Length.toPixels("y");f==0||g==0||(b.save(),b.translate(c,d),a.AspectRatio(b,this.attribute("preserveAspectRatio").value,f,this.img.width,g,this.img.height,0,0),b.drawImage(this.img,0,0),b.restore())}};a.Element.image.prototype=new a.Element.RenderedElementBase; |
|||
a.Element.g=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.getBoundingBox=function(){for(var c=new a.BoundingBox,b=0;b<this.children.length;b++)c.addBoundingBox(this.children[b].getBoundingBox());return c}};a.Element.g.prototype=new a.Element.RenderedElementBase;a.Element.symbol=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.baseSetContext=this.setContext;this.setContext=function(c){this.baseSetContext(c);if(this.attribute("viewBox").hasValue()){var b= |
|||
a.ToNumberArray(this.attribute("viewBox").value),k=b[0],e=b[1];width=b[2];height=b[3];a.AspectRatio(c,this.attribute("preserveAspectRatio").value,this.attribute("width").Length.toPixels("x"),width,this.attribute("height").Length.toPixels("y"),height,k,e);a.ViewPort.SetCurrent(b[2],b[3])}}};a.Element.symbol.prototype=new a.Element.RenderedElementBase;a.Element.style=function(c){this.base=a.Element.ElementBase;this.base(c);for(var c=c.childNodes[0].nodeValue+(c.childNodes.length>1?c.childNodes[1].nodeValue: |
|||
""),c=c.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,""),c=a.compressSpaces(c),c=c.split("}"),d=0;d<c.length;d++)if(a.trim(c[d])!="")for(var b=c[d].split("{"),k=b[0].split(","),b=b[1].split(";"),e=0;e<k.length;e++){var f=a.trim(k[e]);if(f!=""){for(var g={},j=0;j<b.length;j++){var h=b[j].indexOf(":"),l=b[j].substr(0,h),h=b[j].substr(h+1,b[j].length-h);l!=null&&h!=null&&(g[a.trim(l)]=new a.Property(a.trim(l),a.trim(h)))}a.Styles[f]=g;if(f=="@font-face"){f=g["font-family"].value.replace(/"/g, |
|||
"");g=g.src.value.split(",");for(j=0;j<g.length;j++)if(g[j].indexOf('format("svg")')>0){l=g[j].indexOf("url");h=g[j].indexOf(")",l);l=g[j].substr(l+5,h-l-6);l=a.parseXml(a.ajax(l)).getElementsByTagName("font");for(h=0;h<l.length;h++){var o=a.CreateElement(l[h]);a.Definitions[f]=o}}}}}};a.Element.style.prototype=new a.Element.ElementBase;a.Element.use=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.baseSetContext=this.setContext;this.setContext=function(a){this.baseSetContext(a); |
|||
this.attribute("x").hasValue()&&a.translate(this.attribute("x").Length.toPixels("x"),0);this.attribute("y").hasValue()&&a.translate(0,this.attribute("y").Length.toPixels("y"))};this.getDefinition=function(){var a=this.attribute("xlink:href").Definition.getDefinition();if(this.attribute("width").hasValue())a.attribute("width",!0).value=this.attribute("width").value;if(this.attribute("height").hasValue())a.attribute("height",!0).value=this.attribute("height").value;return a};this.path=function(a){var b= |
|||
this.getDefinition();b!=null&&b.path(a)};this.renderChildren=function(a){var b=this.getDefinition();b!=null&&b.render(a)}};a.Element.use.prototype=new a.Element.RenderedElementBase;a.Element.mask=function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,b){var c=this.attribute("x").Length.toPixels("x"),e=this.attribute("y").Length.toPixels("y"),f=this.attribute("width").Length.toPixels("x"),g=this.attribute("height").Length.toPixels("y"),j=b.attribute("mask").value;b.attribute("mask").value= |
|||
"";var h=document.createElement("canvas");h.width=c+f;h.height=e+g;var l=h.getContext("2d");this.renderChildren(l);var o=document.createElement("canvas");o.width=c+f;o.height=e+g;var n=o.getContext("2d");b.render(n);n.globalCompositeOperation="destination-in";n.fillStyle=l.createPattern(h,"no-repeat");n.fillRect(0,0,c+f,e+g);a.fillStyle=n.createPattern(o,"no-repeat");a.fillRect(0,0,c+f,e+g);b.attribute("mask").value=j};this.render=function(){}};a.Element.mask.prototype=new a.Element.ElementBase;a.Element.clipPath= |
|||
function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a){for(var b=0;b<this.children.length;b++)this.children[b].path&&(this.children[b].path(a),a.clip())};this.render=function(){}};a.Element.clipPath.prototype=new a.Element.ElementBase;a.Element.filter=function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,b){var c=b.getBoundingBox(),e=this.attribute("x").Length.toPixels("x"),f=this.attribute("y").Length.toPixels("y");if(e==0||f==0)e=c.x1,f=c.y1;var g= |
|||
this.attribute("width").Length.toPixels("x"),j=this.attribute("height").Length.toPixels("y");if(g==0||j==0)g=c.width(),j=c.height();c=b.style("filter").value;b.style("filter").value="";var h=0.2*g,l=0.2*j,o=document.createElement("canvas");o.width=g+2*h;o.height=j+2*l;var n=o.getContext("2d");n.translate(-e+h,-f+l);b.render(n);for(var q=0;q<this.children.length;q++)this.children[q].apply(n,0,0,g+2*h,j+2*l);a.drawImage(o,0,0,g+2*h,j+2*l,e-h,f-l,g+2*h,j+2*l);b.style("filter",!0).value=c};this.render= |
|||
function(){}};a.Element.filter.prototype=new a.Element.ElementBase;a.Element.feGaussianBlur=function(c){function d(a,c,d,f,g){for(var j=0;j<g;j++)for(var h=0;h<f;h++)for(var l=a[j*f*4+h*4+3]/255,o=0;o<4;o++){for(var n=d[0]*(l==0?255:a[j*f*4+h*4+o])*(l==0||o==3?1:l),q=1;q<d.length;q++){var p=Math.max(h-q,0),m=a[j*f*4+p*4+3]/255,p=Math.min(h+q,f-1),p=a[j*f*4+p*4+3]/255,s=d[q],r;m==0?r=255:(r=Math.max(h-q,0),r=a[j*f*4+r*4+o]);m=r*(m==0||o==3?1:m);p==0?r=255:(r=Math.min(h+q,f-1),r=a[j*f*4+r*4+o]);n+= |
|||
s*(m+r*(p==0||o==3?1:p))}c[h*g*4+j*4+o]=n}}this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,c,e,f,g){var e=this.attribute("stdDeviation").numValue(),c=a.getImageData(0,0,f,g),e=Math.max(e,0.01),j=Math.ceil(e*4)+1;mask=[];for(var h=0;h<j;h++)mask[h]=Math.exp(-0.5*(h/e)*(h/e));e=mask;j=0;for(h=1;h<e.length;h++)j+=Math.abs(e[h]);j=2*j+Math.abs(e[0]);for(h=0;h<e.length;h++)e[h]/=j;tmp=[];d(c.data,tmp,e,f,g);d(tmp,c.data,e,g,f);a.clearRect(0,0,f,g);a.putImageData(c,0,0)}};a.Element.filter.prototype= |
|||
new a.Element.feGaussianBlur;a.Element.title=function(){};a.Element.title.prototype=new a.Element.ElementBase;a.Element.desc=function(){};a.Element.desc.prototype=new a.Element.ElementBase;a.Element.MISSING=function(a){console.log("ERROR: Element '"+a.nodeName+"' not yet implemented.")};a.Element.MISSING.prototype=new a.Element.ElementBase;a.CreateElement=function(c){var d=c.nodeName.replace(/^[^:]+:/,""),d=d.replace(/\-/g,""),b=null,b=typeof a.Element[d]!="undefined"?new a.Element[d](c):new a.Element.MISSING(c); |
|||
b.type=c.nodeName;return b};a.load=function(c,d){a.loadXml(c,a.ajax(d))};a.loadXml=function(c,d){a.loadXmlDoc(c,a.parseXml(d))};a.loadXmlDoc=function(c,d){a.init(c);var b=function(a){for(var b=c.canvas;b;)a.x-=b.offsetLeft,a.y-=b.offsetTop,b=b.offsetParent;window.scrollX&&(a.x+=window.scrollX);window.scrollY&&(a.y+=window.scrollY);return a};if(a.opts.ignoreMouse!=!0)c.canvas.onclick=function(c){c=b(new a.Point(c!=null?c.clientX:event.clientX,c!=null?c.clientY:event.clientY));a.Mouse.onclick(c.x,c.y)}, |
|||
c.canvas.onmousemove=function(c){c=b(new a.Point(c!=null?c.clientX:event.clientX,c!=null?c.clientY:event.clientY));a.Mouse.onmousemove(c.x,c.y)};var k=a.CreateElement(d.documentElement),e=k.root=!0,f=function(){a.ViewPort.Clear();c.canvas.parentNode&&a.ViewPort.SetCurrent(c.canvas.parentNode.clientWidth,c.canvas.parentNode.clientHeight);if(a.opts.ignoreDimensions!=!0){if(k.style("width").hasValue())c.canvas.width=k.style("width").Length.toPixels("x"),c.canvas.style.width=c.canvas.width+"px";if(k.style("height").hasValue())c.canvas.height= |
|||
k.style("height").Length.toPixels("y"),c.canvas.style.height=c.canvas.height+"px"}var b=c.canvas.clientWidth||c.canvas.width,d=c.canvas.clientHeight||c.canvas.height;a.ViewPort.SetCurrent(b,d);if(a.opts!=null&&a.opts.offsetX!=null)k.attribute("x",!0).value=a.opts.offsetX;if(a.opts!=null&&a.opts.offsetY!=null)k.attribute("y",!0).value=a.opts.offsetY;if(a.opts!=null&&a.opts.scaleWidth!=null&&a.opts.scaleHeight!=null){var f=1,g=1;k.attribute("width").hasValue()&&(f=k.attribute("width").Length.toPixels("x")/ |
|||
a.opts.scaleWidth);k.attribute("height").hasValue()&&(g=k.attribute("height").Length.toPixels("y")/a.opts.scaleHeight);k.attribute("width",!0).value=a.opts.scaleWidth;k.attribute("height",!0).value=a.opts.scaleHeight;k.attribute("viewBox",!0).value="0 0 "+b*f+" "+d*g;k.attribute("preserveAspectRatio",!0).value="none"}a.opts.ignoreClear!=!0&&c.clearRect(0,0,b,d);k.render(c);e&&(e=!1,a.opts!=null&&typeof a.opts.renderCallback=="function"&&a.opts.renderCallback())},g=!0;a.ImagesLoaded()&&(g=!1,f()); |
|||
a.intervalID=setInterval(function(){var b=!1;g&&a.ImagesLoaded()&&(g=!1,b=!0);a.opts.ignoreMouse!=!0&&(b|=a.Mouse.hasEvents());if(a.opts.ignoreAnimation!=!0)for(var c=0;c<a.Animations.length;c++)b|=a.Animations[c].update(1E3/a.FRAMERATE);a.opts!=null&&typeof a.opts.forceRedraw=="function"&&a.opts.forceRedraw()==!0&&(b=!0);b&&(f(),a.Mouse.runEvents())},1E3/a.FRAMERATE)};a.stop=function(){a.intervalID&&clearInterval(a.intervalID)};a.Mouse=new function(){this.events=[];this.hasEvents=function(){return this.events.length!= |
|||
0};this.onclick=function(a,d){this.events.push({type:"onclick",x:a,y:d,run:function(a){if(a.onclick)a.onclick()}})};this.onmousemove=function(a,d){this.events.push({type:"onmousemove",x:a,y:d,run:function(a){if(a.onmousemove)a.onmousemove()}})};this.eventElements=[];this.checkPath=function(a,d){for(var b=0;b<this.events.length;b++){var k=this.events[b];d.isPointInPath&&d.isPointInPath(k.x,k.y)&&(this.eventElements[b]=a)}};this.checkBoundingBox=function(a,d){for(var b=0;b<this.events.length;b++){var k= |
|||
this.events[b];d.isPointInBox(k.x,k.y)&&(this.eventElements[b]=a)}};this.runEvents=function(){a.ctx.canvas.style.cursor="";for(var c=0;c<this.events.length;c++)for(var d=this.events[c],b=this.eventElements[c];b;)d.run(b),b=b.parent;this.events=[];this.eventElements=[]}};return a}this.canvg=function(a,c,d){if(a==null&&c==null&&d==null)for(var c=document.getElementsByTagName("svg"),b=0;b<c.length;b++){a=c[b];d=document.createElement("canvas");d.width=a.clientWidth;d.height=a.clientHeight;a.parentNode.insertBefore(d, |
|||
a);a.parentNode.removeChild(a);var k=document.createElement("div");k.appendChild(a);canvg(d,k.innerHTML)}else d=d||{},typeof a=="string"&&(a=document.getElementById(a)),a.svg==null?(b=m(),a.svg=b):(b=a.svg,b.stop()),b.opts=d,a=a.getContext("2d"),typeof c.documentElement!="undefined"?b.loadXmlDoc(a,c):c.substr(0,1)=="<"?b.loadXml(a,c):b.load(a,c)}})(); |
|||
if(CanvasRenderingContext2D)CanvasRenderingContext2D.prototype.drawSvg=function(m,a,c,d,b){canvg(this.canvas,m,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:a,offsetY:c,scaleWidth:d,scaleHeight:b})}; |
|||
(function(m){var a=m.css,c=m.CanVGRenderer,d=m.SVGRenderer,b=m.extend,k=m.merge,e=m.addEvent,f=m.createElement,g=m.discardElement;b(c.prototype,d.prototype);b(c.prototype,{create:function(a,b,c,d){this.setContainer(b,c,d);this.configure(a)},setContainer:function(a,b,c){var d=a.style,e=a.parentNode,g=d.left,d=d.top,k=a.offsetWidth,m=a.offsetHeight,s={visibility:"hidden",position:"absolute"};this.init.apply(this,[a,b,c]);this.canvas=f("canvas",{width:k,height:m},{position:"relative",left:g,top:d},a); |
|||
this.ttLine=f("div",null,s,e);this.ttDiv=f("div",null,s,e);this.ttTimer=void 0;this.hiddenSvg=a=f("div",{width:k,height:m},{visibility:"hidden",left:g,top:d},e);a.appendChild(this.box)},configure:function(b){var c=this,d=b.options.tooltip,f=d.borderWidth,g=c.ttDiv,m=d.style,p=c.ttLine,t=parseInt(m.padding,10),m=k(m,{padding:t+"px","background-color":d.backgroundColor,"border-style":"solid","border-width":f+"px","border-radius":d.borderRadius+"px"});d.shadow&&(m=k(m,{"box-shadow":"1px 1px 3px gray", |
|||
"-webkit-box-shadow":"1px 1px 3px gray"}));a(g,m);a(p,{"border-left":"1px solid darkgray"});e(b,"tooltipRefresh",function(d){var e=b.container,f=e.offsetLeft,e=e.offsetTop,k;g.innerHTML=d.text;k=b.tooltip.getPosition(g.offsetWidth,g.offsetHeight,{plotX:d.x,plotY:d.y});a(g,{visibility:"visible",left:k.x+"px",top:k.y+"px","border-color":d.borderColor});a(p,{visibility:"visible",left:f+d.x+"px",top:e+b.plotTop+"px",height:b.plotHeight+"px"});c.ttTimer!==void 0&&clearTimeout(c.ttTimer);c.ttTimer=setTimeout(function(){a(g, |
|||
{visibility:"hidden"});a(p,{visibility:"hidden"})},3E3)})},destroy:function(){g(this.canvas);this.ttTimer!==void 0&&clearTimeout(this.ttTimer);g(this.ttLine);g(this.ttDiv);g(this.hiddenSvg);return d.prototype.destroy.apply(this)},color:function(a,b,c){a&&a.linearGradient&&(a=a.stops[a.stops.length-1][1]);return d.prototype.color.call(this,a,b,c)},draw:function(){window.canvg(this.canvas,this.hiddenSvg.innerHTML)}})})(Highcharts); |
|||
@ -0,0 +1,17 @@ |
|||
/* |
|||
Data plugin for Highcharts |
|||
|
|||
(c) 2012-2013 Torstein Hønsi |
|||
Last revision 2013-06-07 |
|||
|
|||
License: www.highcharts.com/license |
|||
*/ |
|||
(function(h){var k=h.each,m=function(b,a){this.init(b,a)};h.extend(m.prototype,{init:function(b,a){this.options=b;this.chartOptions=a;this.columns=b.columns||this.rowsToColumns(b.rows)||[];this.columns.length?this.dataFound():(this.parseCSV(),this.parseTable(),this.parseGoogleSpreadsheet())},getColumnDistribution:function(){var b=this.chartOptions,a=b&&b.chart&&b.chart.type,c=[];k(b&&b.series||[],function(b){c.push((h.seriesTypes[b.type||a||"line"].prototype.pointArrayMap||[0]).length)});this.valueCount= |
|||
{global:(h.seriesTypes[a||"line"].prototype.pointArrayMap||[0]).length,individual:c}},dataFound:function(){this.parseTypes();this.findHeaderRow();this.parsed();this.complete()},parseCSV:function(){var b=this,a=this.options,c=a.csv,d=this.columns,f=a.startRow||0,i=a.endRow||Number.MAX_VALUE,j=a.startColumn||0,e=a.endColumn||Number.MAX_VALUE,g=0;c&&(c=c.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split(a.lineDelimiter||"\n"),k(c,function(c,h){var n=b.trim(c),p=n.indexOf("#")===0;h>=f&&h<=i&&!p&&n!==""&& |
|||
(n=c.split(a.itemDelimiter||","),k(n,function(b,a){a>=j&&a<=e&&(d[a-j]||(d[a-j]=[]),d[a-j][g]=b)}),g+=1)}),this.dataFound())},parseTable:function(){var b=this.options,a=b.table,c=this.columns,d=b.startRow||0,f=b.endRow||Number.MAX_VALUE,i=b.startColumn||0,j=b.endColumn||Number.MAX_VALUE,e;a&&(typeof a==="string"&&(a=document.getElementById(a)),k(a.getElementsByTagName("tr"),function(a,b){e=0;b>=d&&b<=f&&k(a.childNodes,function(a){if((a.tagName==="TD"||a.tagName==="TH")&&e>=i&&e<=j)c[e]||(c[e]=[]), |
|||
c[e][b-d]=a.innerHTML,e+=1})}),this.dataFound())},parseGoogleSpreadsheet:function(){var b=this,a=this.options,c=a.googleSpreadsheetKey,d=this.columns,f=a.startRow||0,i=a.endRow||Number.MAX_VALUE,j=a.startColumn||0,e=a.endColumn||Number.MAX_VALUE,g,h;c&&jQuery.getJSON("https://spreadsheets.google.com/feeds/cells/"+c+"/"+(a.googleSpreadsheetWorksheet||"od6")+"/public/values?alt=json-in-script&callback=?",function(a){var a=a.feed.entry,c,k=a.length,m=0,o=0,l;for(l=0;l<k;l++)c=a[l],m=Math.max(m,c.gs$cell.col), |
|||
o=Math.max(o,c.gs$cell.row);for(l=0;l<m;l++)if(l>=j&&l<=e)d[l-j]=[],d[l-j].length=Math.min(o,i-f);for(l=0;l<k;l++)if(c=a[l],g=c.gs$cell.row-1,h=c.gs$cell.col-1,h>=j&&h<=e&&g>=f&&g<=i)d[h-j][g-f]=c.content.$t;b.dataFound()})},findHeaderRow:function(){k(this.columns,function(){});this.headerRow=0},trim:function(b){return typeof b==="string"?b.replace(/^\s+|\s+$/g,""):b},parseTypes:function(){for(var b=this.columns,a=b.length,c,d,f,i;a--;)for(c=b[a].length;c--;)d=b[a][c],f=parseFloat(d),i=this.trim(d), |
|||
i==f?(b[a][c]=f,f>31536E6?b[a].isDatetime=!0:b[a].isNumeric=!0):(d=this.parseDate(d),a===0&&typeof d==="number"&&!isNaN(d)?(b[a][c]=d,b[a].isDatetime=!0):b[a][c]=i===""?null:i)},dateFormats:{"YYYY-mm-dd":{regex:"^([0-9]{4})-([0-9]{2})-([0-9]{2})$",parser:function(b){return Date.UTC(+b[1],b[2]-1,+b[3])}}},parseDate:function(b){var a=this.options.parseDate,c,d,f;a&&(c=a(b));if(typeof b==="string")for(d in this.dateFormats)a=this.dateFormats[d],(f=b.match(a.regex))&&(c=a.parser(f));return c},rowsToColumns:function(b){var a, |
|||
c,d,f,i;if(b){i=[];c=b.length;for(a=0;a<c;a++){f=b[a].length;for(d=0;d<f;d++)i[d]||(i[d]=[]),i[d][a]=b[a][d]}}return i},parsed:function(){this.options.parsed&&this.options.parsed.call(this,this.columns)},complete:function(){var b=this.columns,a,c,d=this.options,f,i,j,e,g,k;if(d.complete){this.getColumnDistribution();b.length>1&&(a=b.shift(),this.headerRow===0&&a.shift(),a.isDatetime?c="datetime":a.isNumeric||(c="category"));for(e=0;e<b.length;e++)if(this.headerRow===0)b[e].name=b[e].shift();i=[]; |
|||
for(e=0,k=0;e<b.length;k++){f=h.pick(this.valueCount.individual[k],this.valueCount.global);j=[];for(g=0;g<b[e].length;g++)j[g]=[a[g],b[e][g]!==void 0?b[e][g]:null],f>1&&j[g].push(b[e+1][g]!==void 0?b[e+1][g]:null),f>2&&j[g].push(b[e+2][g]!==void 0?b[e+2][g]:null),f>3&&j[g].push(b[e+3][g]!==void 0?b[e+3][g]:null),f>4&&j[g].push(b[e+4][g]!==void 0?b[e+4][g]:null);i[k]={name:b[e].name,data:j};e+=f}d.complete({xAxis:{type:c},series:i})}}});h.Data=m;h.data=function(b,a){return new m(b,a)};h.wrap(h.Chart.prototype, |
|||
"init",function(b,a,c){var d=this;a&&a.data?h.data(h.extend(a.data,{complete:function(f){a.series&&k(a.series,function(b,c){a.series[c]=h.merge(b,f.series[c])});a=h.merge(f,a);b.call(d,a,c)}}),a):b.call(d,a,c)})})(Highcharts); |
|||
@ -0,0 +1,582 @@ |
|||
/** |
|||
* @license Data plugin for Highcharts |
|||
* |
|||
* (c) 2012-2013 Torstein Hønsi |
|||
* Last revision 2013-06-07 |
|||
* |
|||
* License: www.highcharts.com/license |
|||
*/ |
|||
|
|||
/* |
|||
* The Highcharts Data plugin is a utility to ease parsing of input sources like |
|||
* CSV, HTML tables or grid views into basic configuration options for use |
|||
* directly in the Highcharts constructor. |
|||
* |
|||
* Demo: http://jsfiddle.net/highcharts/SnLFj/
|
|||
* |
|||
* --- OPTIONS --- |
|||
* |
|||
* - columns : Array<Array<Mixed>> |
|||
* A two-dimensional array representing the input data on tabular form. This input can |
|||
* be used when the data is already parsed, for example from a grid view component. |
|||
* Each cell can be a string or number. If not switchRowsAndColumns is set, the columns |
|||
* are interpreted as series. See also the rows option. |
|||
* |
|||
* - complete : Function(chartOptions) |
|||
* The callback that is evaluated when the data is finished loading, optionally from an |
|||
* external source, and parsed. The first argument passed is a finished chart options |
|||
* object, containing series and an xAxis with categories if applicable. Thise options |
|||
* can be extended with additional options and passed directly to the chart constructor. |
|||
* |
|||
* - csv : String |
|||
* A comma delimited string to be parsed. Related options are startRow, endRow, startColumn |
|||
* and endColumn to delimit what part of the table is used. The lineDelimiter and |
|||
* itemDelimiter options define the CSV delimiter formats. |
|||
* |
|||
* - endColumn : Integer |
|||
* In tabular input data, the first row (indexed by 0) to use. Defaults to the last |
|||
* column containing data. |
|||
* |
|||
* - endRow : Integer |
|||
* In tabular input data, the last row (indexed by 0) to use. Defaults to the last row |
|||
* containing data. |
|||
* |
|||
* - googleSpreadsheetKey : String |
|||
* A Google Spreadsheet key. See https://developers.google.com/gdata/samples/spreadsheet_sample
|
|||
* for general information on GS. |
|||
* |
|||
* - googleSpreadsheetWorksheet : String |
|||
* The Google Spreadsheet worksheet. The available id's can be read from |
|||
* https://spreadsheets.google.com/feeds/worksheets/{key}/public/basic
|
|||
* |
|||
* - itemDelimiter : String |
|||
* Item or cell delimiter for parsing CSV. Defaults to ",". |
|||
* |
|||
* - lineDelimiter : String |
|||
* Line delimiter for parsing CSV. Defaults to "\n". |
|||
* |
|||
* - parsed : Function |
|||
* A callback function to access the parsed columns, the two-dimentional input data |
|||
* array directly, before they are interpreted into series data and categories. |
|||
* |
|||
* - parseDate : Function |
|||
* A callback function to parse string representations of dates into JavaScript timestamps. |
|||
* Return an integer on success. |
|||
* |
|||
* - rows : Array<Array<Mixed>> |
|||
* The same as the columns input option, but defining rows intead of columns. |
|||
* |
|||
* - startColumn : Integer |
|||
* In tabular input data, the first column (indexed by 0) to use. |
|||
* |
|||
* - startRow : Integer |
|||
* In tabular input data, the first row (indexed by 0) to use. |
|||
* |
|||
* - table : String|HTMLElement |
|||
* A HTML table or the id of such to be parsed as input data. Related options ara startRow, |
|||
* endRow, startColumn and endColumn to delimit what part of the table is used. |
|||
*/ |
|||
|
|||
// JSLint options:
|
|||
/*global jQuery */ |
|||
|
|||
(function (Highcharts) { |
|||
|
|||
// Utilities
|
|||
var each = Highcharts.each; |
|||
|
|||
|
|||
// The Data constructor
|
|||
var Data = function (dataOptions, chartOptions) { |
|||
this.init(dataOptions, chartOptions); |
|||
}; |
|||
|
|||
// Set the prototype properties
|
|||
Highcharts.extend(Data.prototype, { |
|||
|
|||
/** |
|||
* Initialize the Data object with the given options |
|||
*/ |
|||
init: function (options, chartOptions) { |
|||
this.options = options; |
|||
this.chartOptions = chartOptions; |
|||
this.columns = options.columns || this.rowsToColumns(options.rows) || []; |
|||
|
|||
// No need to parse or interpret anything
|
|||
if (this.columns.length) { |
|||
this.dataFound(); |
|||
|
|||
// Parse and interpret
|
|||
} else { |
|||
|
|||
// Parse a CSV string if options.csv is given
|
|||
this.parseCSV(); |
|||
|
|||
// Parse a HTML table if options.table is given
|
|||
this.parseTable(); |
|||
|
|||
// Parse a Google Spreadsheet
|
|||
this.parseGoogleSpreadsheet(); |
|||
} |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* Get the column distribution. For example, a line series takes a single column for |
|||
* Y values. A range series takes two columns for low and high values respectively, |
|||
* and an OHLC series takes four columns. |
|||
*/ |
|||
getColumnDistribution: function () { |
|||
var chartOptions = this.chartOptions, |
|||
getValueCount = function (type) { |
|||
return (Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap || [0]).length; |
|||
}, |
|||
globalType = chartOptions && chartOptions.chart && chartOptions.chart.type, |
|||
individualCounts = []; |
|||
|
|||
each((chartOptions && chartOptions.series) || [], function (series) { |
|||
individualCounts.push(getValueCount(series.type || globalType)); |
|||
}); |
|||
|
|||
this.valueCount = { |
|||
global: getValueCount(globalType), |
|||
individual: individualCounts |
|||
}; |
|||
}, |
|||
|
|||
|
|||
dataFound: function () { |
|||
// Interpret the values into right types
|
|||
this.parseTypes(); |
|||
|
|||
// Use first row for series names?
|
|||
this.findHeaderRow(); |
|||
|
|||
// Handle columns if a handleColumns callback is given
|
|||
this.parsed(); |
|||
|
|||
// Complete if a complete callback is given
|
|||
this.complete(); |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* Parse a CSV input string |
|||
*/ |
|||
parseCSV: function () { |
|||
var self = this, |
|||
options = this.options, |
|||
csv = options.csv, |
|||
columns = this.columns, |
|||
startRow = options.startRow || 0, |
|||
endRow = options.endRow || Number.MAX_VALUE, |
|||
startColumn = options.startColumn || 0, |
|||
endColumn = options.endColumn || Number.MAX_VALUE, |
|||
lines, |
|||
activeRowNo = 0; |
|||
|
|||
if (csv) { |
|||
|
|||
lines = csv |
|||
.replace(/\r\n/g, "\n") // Unix
|
|||
.replace(/\r/g, "\n") // Mac
|
|||
.split(options.lineDelimiter || "\n"); |
|||
|
|||
each(lines, function (line, rowNo) { |
|||
var trimmed = self.trim(line), |
|||
isComment = trimmed.indexOf('#') === 0, |
|||
isBlank = trimmed === '', |
|||
items; |
|||
|
|||
if (rowNo >= startRow && rowNo <= endRow && !isComment && !isBlank) { |
|||
items = line.split(options.itemDelimiter || ','); |
|||
each(items, function (item, colNo) { |
|||
if (colNo >= startColumn && colNo <= endColumn) { |
|||
if (!columns[colNo - startColumn]) { |
|||
columns[colNo - startColumn] = []; |
|||
} |
|||
|
|||
columns[colNo - startColumn][activeRowNo] = item; |
|||
} |
|||
}); |
|||
activeRowNo += 1; |
|||
} |
|||
}); |
|||
|
|||
this.dataFound(); |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* Parse a HTML table |
|||
*/ |
|||
parseTable: function () { |
|||
var options = this.options, |
|||
table = options.table, |
|||
columns = this.columns, |
|||
startRow = options.startRow || 0, |
|||
endRow = options.endRow || Number.MAX_VALUE, |
|||
startColumn = options.startColumn || 0, |
|||
endColumn = options.endColumn || Number.MAX_VALUE, |
|||
colNo; |
|||
|
|||
if (table) { |
|||
|
|||
if (typeof table === 'string') { |
|||
table = document.getElementById(table); |
|||
} |
|||
|
|||
each(table.getElementsByTagName('tr'), function (tr, rowNo) { |
|||
colNo = 0; |
|||
if (rowNo >= startRow && rowNo <= endRow) { |
|||
each(tr.childNodes, function (item) { |
|||
if ((item.tagName === 'TD' || item.tagName === 'TH') && colNo >= startColumn && colNo <= endColumn) { |
|||
if (!columns[colNo]) { |
|||
columns[colNo] = []; |
|||
} |
|||
columns[colNo][rowNo - startRow] = item.innerHTML; |
|||
|
|||
colNo += 1; |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
|
|||
this.dataFound(); // continue
|
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* TODO: |
|||
* - switchRowsAndColumns |
|||
*/ |
|||
parseGoogleSpreadsheet: function () { |
|||
var self = this, |
|||
options = this.options, |
|||
googleSpreadsheetKey = options.googleSpreadsheetKey, |
|||
columns = this.columns, |
|||
startRow = options.startRow || 0, |
|||
endRow = options.endRow || Number.MAX_VALUE, |
|||
startColumn = options.startColumn || 0, |
|||
endColumn = options.endColumn || Number.MAX_VALUE, |
|||
gr, // google row
|
|||
gc; // google column
|
|||
|
|||
if (googleSpreadsheetKey) { |
|||
jQuery.getJSON('https://spreadsheets.google.com/feeds/cells/' + |
|||
googleSpreadsheetKey + '/' + (options.googleSpreadsheetWorksheet || 'od6') + |
|||
'/public/values?alt=json-in-script&callback=?', |
|||
function (json) { |
|||
|
|||
// Prepare the data from the spreadsheat
|
|||
var cells = json.feed.entry, |
|||
cell, |
|||
cellCount = cells.length, |
|||
colCount = 0, |
|||
rowCount = 0, |
|||
i; |
|||
|
|||
// First, find the total number of columns and rows that
|
|||
// are actually filled with data
|
|||
for (i = 0; i < cellCount; i++) { |
|||
cell = cells[i]; |
|||
colCount = Math.max(colCount, cell.gs$cell.col); |
|||
rowCount = Math.max(rowCount, cell.gs$cell.row); |
|||
} |
|||
|
|||
// Set up arrays containing the column data
|
|||
for (i = 0; i < colCount; i++) { |
|||
if (i >= startColumn && i <= endColumn) { |
|||
// Create new columns with the length of either end-start or rowCount
|
|||
columns[i - startColumn] = []; |
|||
|
|||
// Setting the length to avoid jslint warning
|
|||
columns[i - startColumn].length = Math.min(rowCount, endRow - startRow); |
|||
} |
|||
} |
|||
|
|||
// Loop over the cells and assign the value to the right
|
|||
// place in the column arrays
|
|||
for (i = 0; i < cellCount; i++) { |
|||
cell = cells[i]; |
|||
gr = cell.gs$cell.row - 1; // rows start at 1
|
|||
gc = cell.gs$cell.col - 1; // columns start at 1
|
|||
|
|||
// If both row and col falls inside start and end
|
|||
// set the transposed cell value in the newly created columns
|
|||
if (gc >= startColumn && gc <= endColumn && |
|||
gr >= startRow && gr <= endRow) { |
|||
columns[gc - startColumn][gr - startRow] = cell.content.$t; |
|||
} |
|||
} |
|||
self.dataFound(); |
|||
}); |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* Find the header row. For now, we just check whether the first row contains |
|||
* numbers or strings. Later we could loop down and find the first row with |
|||
* numbers. |
|||
*/ |
|||
findHeaderRow: function () { |
|||
var headerRow = 0; |
|||
each(this.columns, function (column) { |
|||
if (typeof column[0] !== 'string') { |
|||
headerRow = null; |
|||
} |
|||
}); |
|||
this.headerRow = 0; |
|||
}, |
|||
|
|||
/** |
|||
* Trim a string from whitespace |
|||
*/ |
|||
trim: function (str) { |
|||
return typeof str === 'string' ? str.replace(/^\s+|\s+$/g, '') : str; |
|||
}, |
|||
|
|||
/** |
|||
* Parse numeric cells in to number types and date types in to true dates. |
|||
* @param {Object} columns |
|||
*/ |
|||
parseTypes: function () { |
|||
var columns = this.columns, |
|||
col = columns.length, |
|||
row, |
|||
val, |
|||
floatVal, |
|||
trimVal, |
|||
dateVal; |
|||
|
|||
while (col--) { |
|||
row = columns[col].length; |
|||
while (row--) { |
|||
val = columns[col][row]; |
|||
floatVal = parseFloat(val); |
|||
trimVal = this.trim(val); |
|||
|
|||
/*jslint eqeq: true*/ |
|||
if (trimVal == floatVal) { // is numeric
|
|||
/*jslint eqeq: false*/ |
|||
columns[col][row] = floatVal; |
|||
|
|||
// If the number is greater than milliseconds in a year, assume datetime
|
|||
if (floatVal > 365 * 24 * 3600 * 1000) { |
|||
columns[col].isDatetime = true; |
|||
} else { |
|||
columns[col].isNumeric = true; |
|||
} |
|||
|
|||
} else { // string, continue to determine if it is a date string or really a string
|
|||
dateVal = this.parseDate(val); |
|||
|
|||
if (col === 0 && typeof dateVal === 'number' && !isNaN(dateVal)) { // is date
|
|||
columns[col][row] = dateVal; |
|||
columns[col].isDatetime = true; |
|||
|
|||
} else { // string
|
|||
columns[col][row] = trimVal === '' ? null : trimVal; |
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
|||
}, |
|||
//*
|
|||
dateFormats: { |
|||
'YYYY-mm-dd': { |
|||
regex: '^([0-9]{4})-([0-9]{2})-([0-9]{2})$', |
|||
parser: function (match) { |
|||
return Date.UTC(+match[1], match[2] - 1, +match[3]); |
|||
} |
|||
} |
|||
}, |
|||
// */
|
|||
/** |
|||
* Parse a date and return it as a number. Overridable through options.parseDate. |
|||
*/ |
|||
parseDate: function (val) { |
|||
var parseDate = this.options.parseDate, |
|||
ret, |
|||
key, |
|||
format, |
|||
match; |
|||
|
|||
if (parseDate) { |
|||
ret = parseDate(val); |
|||
} |
|||
|
|||
if (typeof val === 'string') { |
|||
for (key in this.dateFormats) { |
|||
format = this.dateFormats[key]; |
|||
match = val.match(format.regex); |
|||
if (match) { |
|||
ret = format.parser(match); |
|||
} |
|||
} |
|||
} |
|||
return ret; |
|||
}, |
|||
|
|||
/** |
|||
* Reorganize rows into columns |
|||
*/ |
|||
rowsToColumns: function (rows) { |
|||
var row, |
|||
rowsLength, |
|||
col, |
|||
colsLength, |
|||
columns; |
|||
|
|||
if (rows) { |
|||
columns = []; |
|||
rowsLength = rows.length; |
|||
for (row = 0; row < rowsLength; row++) { |
|||
colsLength = rows[row].length; |
|||
for (col = 0; col < colsLength; col++) { |
|||
if (!columns[col]) { |
|||
columns[col] = []; |
|||
} |
|||
columns[col][row] = rows[row][col]; |
|||
} |
|||
} |
|||
} |
|||
return columns; |
|||
}, |
|||
|
|||
/** |
|||
* A hook for working directly on the parsed columns |
|||
*/ |
|||
parsed: function () { |
|||
if (this.options.parsed) { |
|||
this.options.parsed.call(this, this.columns); |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* If a complete callback function is provided in the options, interpret the |
|||
* columns into a Highcharts options object. |
|||
*/ |
|||
complete: function () { |
|||
|
|||
var columns = this.columns, |
|||
firstCol, |
|||
type, |
|||
options = this.options, |
|||
valueCount, |
|||
series, |
|||
data, |
|||
i, |
|||
j, |
|||
seriesIndex; |
|||
|
|||
|
|||
if (options.complete) { |
|||
|
|||
this.getColumnDistribution(); |
|||
|
|||
// Use first column for X data or categories?
|
|||
if (columns.length > 1) { |
|||
firstCol = columns.shift(); |
|||
if (this.headerRow === 0) { |
|||
firstCol.shift(); // remove the first cell
|
|||
} |
|||
|
|||
|
|||
if (firstCol.isDatetime) { |
|||
type = 'datetime'; |
|||
} else if (!firstCol.isNumeric) { |
|||
type = 'category'; |
|||
} |
|||
} |
|||
|
|||
// Get the names and shift the top row
|
|||
for (i = 0; i < columns.length; i++) { |
|||
if (this.headerRow === 0) { |
|||
columns[i].name = columns[i].shift(); |
|||
} |
|||
} |
|||
|
|||
// Use the next columns for series
|
|||
series = []; |
|||
for (i = 0, seriesIndex = 0; i < columns.length; seriesIndex++) { |
|||
|
|||
// This series' value count
|
|||
valueCount = Highcharts.pick(this.valueCount.individual[seriesIndex], this.valueCount.global); |
|||
|
|||
// Iterate down the cells of each column and add data to the series
|
|||
data = []; |
|||
for (j = 0; j < columns[i].length; j++) { |
|||
data[j] = [ |
|||
firstCol[j], |
|||
columns[i][j] !== undefined ? columns[i][j] : null |
|||
]; |
|||
if (valueCount > 1) { |
|||
data[j].push(columns[i + 1][j] !== undefined ? columns[i + 1][j] : null); |
|||
} |
|||
if (valueCount > 2) { |
|||
data[j].push(columns[i + 2][j] !== undefined ? columns[i + 2][j] : null); |
|||
} |
|||
if (valueCount > 3) { |
|||
data[j].push(columns[i + 3][j] !== undefined ? columns[i + 3][j] : null); |
|||
} |
|||
if (valueCount > 4) { |
|||
data[j].push(columns[i + 4][j] !== undefined ? columns[i + 4][j] : null); |
|||
} |
|||
} |
|||
|
|||
// Add the series
|
|||
series[seriesIndex] = { |
|||
name: columns[i].name, |
|||
data: data |
|||
}; |
|||
|
|||
i += valueCount; |
|||
} |
|||
|
|||
// Do the callback
|
|||
options.complete({ |
|||
xAxis: { |
|||
type: type |
|||
}, |
|||
series: series |
|||
}); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
// Register the Data prototype and data function on Highcharts
|
|||
Highcharts.Data = Data; |
|||
Highcharts.data = function (options, chartOptions) { |
|||
return new Data(options, chartOptions); |
|||
}; |
|||
|
|||
// Extend Chart.init so that the Chart constructor accepts a new configuration
|
|||
// option group, data.
|
|||
Highcharts.wrap(Highcharts.Chart.prototype, 'init', function (proceed, userOptions, callback) { |
|||
var chart = this; |
|||
|
|||
if (userOptions && userOptions.data) { |
|||
Highcharts.data(Highcharts.extend(userOptions.data, { |
|||
complete: function (dataOptions) { |
|||
|
|||
// Merge series configs
|
|||
if (userOptions.series) { |
|||
each(userOptions.series, function (series, i) { |
|||
userOptions.series[i] = Highcharts.merge(series, dataOptions.series[i]); |
|||
}); |
|||
} |
|||
|
|||
// Do the merge
|
|||
userOptions = Highcharts.merge(dataOptions, userOptions); |
|||
|
|||
proceed.call(chart, userOptions, callback); |
|||
} |
|||
}), userOptions); |
|||
} else { |
|||
proceed.call(chart, userOptions, callback); |
|||
} |
|||
}); |
|||
|
|||
}(Highcharts)); |
|||
@ -0,0 +1,11 @@ |
|||
(function(e){function q(b,a,c){return"rgba("+[Math.round(b[0]+(a[0]-b[0])*c),Math.round(b[1]+(a[1]-b[1])*c),Math.round(b[2]+(a[2]-b[2])*c),b[3]+(a[3]-b[3])*c].join(",")+")"}var m=function(){},j=e.getOptions(),g=e.each,n=e.extend,o=e.wrap,h=e.Chart,i=e.seriesTypes,k=i.pie,l=i.column,r=HighchartsAdapter.fireEvent;n(j.lang,{drillUpText:"◁ Back to {series.name}"});j.drilldown={activeAxisLabelStyle:{cursor:"pointer",color:"#039",fontWeight:"bold",textDecoration:"underline"},activeDataLabelStyle:{cursor:"pointer", |
|||
color:"#039",fontWeight:"bold",textDecoration:"underline"},animation:{duration:500},drillUpButton:{position:{align:"right",x:-10,y:10}}};e.SVGRenderer.prototype.Element.prototype.fadeIn=function(){this.attr({opacity:0.1,visibility:"visible"}).animate({opacity:1},{duration:250})};h.prototype.drilldownLevels=[];h.prototype.addSeriesAsDrilldown=function(b,a){var c=b.series,d=c.xAxis,f=c.yAxis,e;e=b.color||c.color;var g,a=n({color:e},a);g=HighchartsAdapter.inArray(this,c.points);this.drilldownLevels.push({seriesOptions:c.userOptions, |
|||
shapeArgs:b.shapeArgs,bBox:b.graphic.getBBox(),color:e,newSeries:a,pointOptions:c.options.data[g],pointIndex:g,oldExtremes:{xMin:d&&d.userMin,xMax:d&&d.userMax,yMin:f&&f.userMin,yMax:f&&f.userMax}});e=this.addSeries(a,!1);if(d)d.oldPos=d.pos,d.userMin=d.userMax=null,f.userMin=f.userMax=null;if(c.type===e.type)e.animate=e.animateDrilldown||m,e.options.animation=!0;c.remove(!1);this.redraw();this.showDrillUpButton()};h.prototype.getDrilldownBackText=function(){return this.options.lang.drillUpText.replace("{series.name}", |
|||
this.drilldownLevels[this.drilldownLevels.length-1].seriesOptions.name)};h.prototype.showDrillUpButton=function(){var b=this,a=this.getDrilldownBackText(),c=b.options.drilldown.drillUpButton;this.drillUpButton?this.drillUpButton.attr({text:a}).align():this.drillUpButton=this.renderer.button(a,null,null,function(){b.drillUp()}).attr(n({align:c.position.align,zIndex:9},c.theme)).add().align(c.position,!1,c.relativeTo||"plotBox")};h.prototype.drillUp=function(){var b=this.drilldownLevels.pop(),a=this.series[0], |
|||
c=b.oldExtremes,d=this.addSeries(b.seriesOptions,!1);r(this,"drillup",{seriesOptions:b.seriesOptions});if(d.type===a.type)d.drilldownLevel=b,d.animate=d.animateDrillupTo||m,d.options.animation=!0,a.animateDrillupFrom&&a.animateDrillupFrom(b);a.remove(!1);d.xAxis&&(d.xAxis.setExtremes(c.xMin,c.xMax,!1),d.yAxis.setExtremes(c.yMin,c.yMax,!1));this.redraw();this.drilldownLevels.length===0?this.drillUpButton=this.drillUpButton.destroy():this.drillUpButton.attr({text:this.getDrilldownBackText()}).align()}; |
|||
k.prototype.animateDrilldown=function(b){var a=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1],c=this.chart.options.drilldown.animation,d=a.shapeArgs,f=d.start,s=(d.end-f)/this.points.length,h=e.Color(a.color).rgba;b||g(this.points,function(a,b){var g=e.Color(a.color).rgba;a.graphic.attr(e.merge(d,{start:f+b*s,end:f+(b+1)*s})).animate(a.shapeArgs,e.merge(c,{step:function(a,d){d.prop==="start"&&this.attr({fill:q(h,g,d.pos)})}}))})};k.prototype.animateDrillupTo=l.prototype.animateDrillupTo= |
|||
function(b){if(!b){var a=this,c=a.drilldownLevel;g(this.points,function(a){a.graphic.hide();a.dataLabel&&a.dataLabel.hide();a.connector&&a.connector.hide()});setTimeout(function(){g(a.points,function(a,b){var e=b===c.pointIndex?"show":"fadeIn";a.graphic[e]();if(a.dataLabel)a.dataLabel[e]();if(a.connector)a.connector[e]()})},Math.max(this.chart.options.drilldown.animation.duration-50,0));this.animate=m}};l.prototype.animateDrilldown=function(b){var a=this.chart.drilldownLevels[this.chart.drilldownLevels.length- |
|||
1].shapeArgs,c=this.chart.options.drilldown.animation;b||(a.x+=this.xAxis.oldPos-this.xAxis.pos,g(this.points,function(b){b.graphic.attr(a).animate(b.shapeArgs,c)}))};l.prototype.animateDrillupFrom=k.prototype.animateDrillupFrom=function(b){var a=this.chart.options.drilldown.animation,c=this.group;delete this.group;g(this.points,function(d){var f=d.graphic,g=e.Color(d.color).rgba;delete d.graphic;f.animate(b.shapeArgs,e.merge(a,{step:function(a,c){c.prop==="start"&&this.attr({fill:q(g,e.Color(b.color).rgba, |
|||
c.pos)})},complete:function(){f.destroy();c&&(c=c.destroy())}}))})};e.Point.prototype.doDrilldown=function(){for(var b=this.series.chart,a=b.options.drilldown,c=a.series.length,d;c--&&!d;)a.series[c].id===this.drilldown&&(d=a.series[c]);r(b,"drilldown",{point:this,seriesOptions:d});d&&b.addSeriesAsDrilldown(this,d)};o(e.Point.prototype,"init",function(b,a,c,d){var f=b.call(this,a,c,d),b=a.chart,a=(a=a.xAxis&&a.xAxis.ticks[d])&&a.label;if(f.drilldown){if(e.addEvent(f,"click",function(){f.doDrilldown()}), |
|||
a){if(!a._basicStyle)a._basicStyle=a.element.getAttribute("style");a.addClass("highcharts-drilldown-axis-label").css(b.options.drilldown.activeAxisLabelStyle).on("click",function(){f.doDrilldown&&f.doDrilldown()})}}else a&&a._basicStyle&&a.element.setAttribute("style",a._basicStyle);return f});o(e.Series.prototype,"drawDataLabels",function(b){var a=this.chart.options.drilldown.activeDataLabelStyle;b.call(this);g(this.points,function(b){if(b.drilldown&&b.dataLabel)b.dataLabel.attr({"class":"highcharts-drilldown-data-label"}).css(a).on("click", |
|||
function(){b.doDrilldown()})})});l.prototype.supportsDrilldown=!0;k.prototype.supportsDrilldown=!0;var p,j=function(b){b.call(this);g(this.points,function(a){a.drilldown&&a.graphic&&a.graphic.attr({"class":"highcharts-drilldown-point"}).css({cursor:"pointer"})})};for(p in i)i[p].prototype.supportsDrilldown&&o(i[p].prototype,"drawTracker",j)})(Highcharts); |
|||
@ -0,0 +1,447 @@ |
|||
/** |
|||
* Highcharts Drilldown plugin |
|||
* |
|||
* Author: Torstein Honsi |
|||
* Last revision: 2013-02-18 |
|||
* License: MIT License |
|||
* |
|||
* Demo: http://jsfiddle.net/highcharts/Vf3yT/
|
|||
*/ |
|||
|
|||
/*global HighchartsAdapter*/ |
|||
(function (H) { |
|||
|
|||
"use strict"; |
|||
|
|||
var noop = function () {}, |
|||
defaultOptions = H.getOptions(), |
|||
each = H.each, |
|||
extend = H.extend, |
|||
wrap = H.wrap, |
|||
Chart = H.Chart, |
|||
seriesTypes = H.seriesTypes, |
|||
PieSeries = seriesTypes.pie, |
|||
ColumnSeries = seriesTypes.column, |
|||
fireEvent = HighchartsAdapter.fireEvent; |
|||
|
|||
// Utilities
|
|||
function tweenColors(startColor, endColor, pos) { |
|||
var rgba = [ |
|||
Math.round(startColor[0] + (endColor[0] - startColor[0]) * pos), |
|||
Math.round(startColor[1] + (endColor[1] - startColor[1]) * pos), |
|||
Math.round(startColor[2] + (endColor[2] - startColor[2]) * pos), |
|||
startColor[3] + (endColor[3] - startColor[3]) * pos |
|||
]; |
|||
return 'rgba(' + rgba.join(',') + ')'; |
|||
} |
|||
|
|||
// Add language
|
|||
extend(defaultOptions.lang, { |
|||
drillUpText: '◁ Back to {series.name}' |
|||
}); |
|||
defaultOptions.drilldown = { |
|||
activeAxisLabelStyle: { |
|||
cursor: 'pointer', |
|||
color: '#039', |
|||
fontWeight: 'bold', |
|||
textDecoration: 'underline' |
|||
}, |
|||
activeDataLabelStyle: { |
|||
cursor: 'pointer', |
|||
color: '#039', |
|||
fontWeight: 'bold', |
|||
textDecoration: 'underline' |
|||
}, |
|||
animation: { |
|||
duration: 500 |
|||
}, |
|||
drillUpButton: { |
|||
position: { |
|||
align: 'right', |
|||
x: -10, |
|||
y: 10 |
|||
} |
|||
// relativeTo: 'plotBox'
|
|||
// theme
|
|||
} |
|||
}; |
|||
|
|||
/** |
|||
* A general fadeIn method |
|||
*/ |
|||
H.SVGRenderer.prototype.Element.prototype.fadeIn = function () { |
|||
this |
|||
.attr({ |
|||
opacity: 0.1, |
|||
visibility: 'visible' |
|||
}) |
|||
.animate({ |
|||
opacity: 1 |
|||
}, { |
|||
duration: 250 |
|||
}); |
|||
}; |
|||
|
|||
// Extend the Chart prototype
|
|||
Chart.prototype.drilldownLevels = []; |
|||
|
|||
Chart.prototype.addSeriesAsDrilldown = function (point, ddOptions) { |
|||
var oldSeries = point.series, |
|||
xAxis = oldSeries.xAxis, |
|||
yAxis = oldSeries.yAxis, |
|||
newSeries, |
|||
color = point.color || oldSeries.color, |
|||
pointIndex, |
|||
level; |
|||
|
|||
ddOptions = extend({ |
|||
color: color |
|||
}, ddOptions); |
|||
pointIndex = HighchartsAdapter.inArray(this, oldSeries.points); |
|||
level = { |
|||
seriesOptions: oldSeries.userOptions, |
|||
shapeArgs: point.shapeArgs, |
|||
bBox: point.graphic.getBBox(), |
|||
color: color, |
|||
newSeries: ddOptions, |
|||
pointOptions: oldSeries.options.data[pointIndex], |
|||
pointIndex: pointIndex, |
|||
oldExtremes: { |
|||
xMin: xAxis && xAxis.userMin, |
|||
xMax: xAxis && xAxis.userMax, |
|||
yMin: yAxis && yAxis.userMin, |
|||
yMax: yAxis && yAxis.userMax |
|||
} |
|||
}; |
|||
|
|||
this.drilldownLevels.push(level); |
|||
|
|||
newSeries = this.addSeries(ddOptions, false); |
|||
if (xAxis) { |
|||
xAxis.oldPos = xAxis.pos; |
|||
xAxis.userMin = xAxis.userMax = null; |
|||
yAxis.userMin = yAxis.userMax = null; |
|||
} |
|||
|
|||
// Run fancy cross-animation on supported and equal types
|
|||
if (oldSeries.type === newSeries.type) { |
|||
newSeries.animate = newSeries.animateDrilldown || noop; |
|||
newSeries.options.animation = true; |
|||
} |
|||
|
|||
oldSeries.remove(false); |
|||
|
|||
this.redraw(); |
|||
this.showDrillUpButton(); |
|||
}; |
|||
|
|||
Chart.prototype.getDrilldownBackText = function () { |
|||
var lastLevel = this.drilldownLevels[this.drilldownLevels.length - 1]; |
|||
|
|||
return this.options.lang.drillUpText.replace('{series.name}', lastLevel.seriesOptions.name); |
|||
|
|||
}; |
|||
|
|||
Chart.prototype.showDrillUpButton = function () { |
|||
var chart = this, |
|||
backText = this.getDrilldownBackText(), |
|||
buttonOptions = chart.options.drilldown.drillUpButton; |
|||
|
|||
|
|||
if (!this.drillUpButton) { |
|||
this.drillUpButton = this.renderer.button( |
|||
backText, |
|||
null, |
|||
null, |
|||
function () { |
|||
chart.drillUp(); |
|||
} |
|||
) |
|||
.attr(extend({ |
|||
align: buttonOptions.position.align, |
|||
zIndex: 9 |
|||
}, buttonOptions.theme)) |
|||
.add() |
|||
.align(buttonOptions.position, false, buttonOptions.relativeTo || 'plotBox'); |
|||
} else { |
|||
this.drillUpButton.attr({ |
|||
text: backText |
|||
}) |
|||
.align(); |
|||
} |
|||
}; |
|||
|
|||
Chart.prototype.drillUp = function () { |
|||
var chart = this, |
|||
level = chart.drilldownLevels.pop(), |
|||
oldSeries = chart.series[0], |
|||
oldExtremes = level.oldExtremes, |
|||
newSeries = chart.addSeries(level.seriesOptions, false); |
|||
|
|||
fireEvent(chart, 'drillup', { seriesOptions: level.seriesOptions }); |
|||
|
|||
if (newSeries.type === oldSeries.type) { |
|||
newSeries.drilldownLevel = level; |
|||
newSeries.animate = newSeries.animateDrillupTo || noop; |
|||
newSeries.options.animation = true; |
|||
|
|||
if (oldSeries.animateDrillupFrom) { |
|||
oldSeries.animateDrillupFrom(level); |
|||
} |
|||
} |
|||
|
|||
oldSeries.remove(false); |
|||
|
|||
// Reset the zoom level of the upper series
|
|||
if (newSeries.xAxis) { |
|||
newSeries.xAxis.setExtremes(oldExtremes.xMin, oldExtremes.xMax, false); |
|||
newSeries.yAxis.setExtremes(oldExtremes.yMin, oldExtremes.yMax, false); |
|||
} |
|||
|
|||
|
|||
this.redraw(); |
|||
|
|||
if (this.drilldownLevels.length === 0) { |
|||
this.drillUpButton = this.drillUpButton.destroy(); |
|||
} else { |
|||
this.drillUpButton.attr({ |
|||
text: this.getDrilldownBackText() |
|||
}) |
|||
.align(); |
|||
} |
|||
}; |
|||
|
|||
PieSeries.prototype.animateDrilldown = function (init) { |
|||
var level = this.chart.drilldownLevels[this.chart.drilldownLevels.length - 1], |
|||
animationOptions = this.chart.options.drilldown.animation, |
|||
animateFrom = level.shapeArgs, |
|||
start = animateFrom.start, |
|||
angle = animateFrom.end - start, |
|||
startAngle = angle / this.points.length, |
|||
startColor = H.Color(level.color).rgba; |
|||
|
|||
if (!init) { |
|||
each(this.points, function (point, i) { |
|||
var endColor = H.Color(point.color).rgba; |
|||
|
|||
/*jslint unparam: true*/ |
|||
point.graphic |
|||
.attr(H.merge(animateFrom, { |
|||
start: start + i * startAngle, |
|||
end: start + (i + 1) * startAngle |
|||
})) |
|||
.animate(point.shapeArgs, H.merge(animationOptions, { |
|||
step: function (val, fx) { |
|||
if (fx.prop === 'start') { |
|||
this.attr({ |
|||
fill: tweenColors(startColor, endColor, fx.pos) |
|||
}); |
|||
} |
|||
} |
|||
})); |
|||
/*jslint unparam: false*/ |
|||
}); |
|||
} |
|||
}; |
|||
|
|||
|
|||
/** |
|||
* When drilling up, keep the upper series invisible until the lower series has |
|||
* moved into place |
|||
*/ |
|||
PieSeries.prototype.animateDrillupTo = |
|||
ColumnSeries.prototype.animateDrillupTo = function (init) { |
|||
if (!init) { |
|||
var newSeries = this, |
|||
level = newSeries.drilldownLevel; |
|||
|
|||
each(this.points, function (point) { |
|||
point.graphic.hide(); |
|||
if (point.dataLabel) { |
|||
point.dataLabel.hide(); |
|||
} |
|||
if (point.connector) { |
|||
point.connector.hide(); |
|||
} |
|||
}); |
|||
|
|||
|
|||
// Do dummy animation on first point to get to complete
|
|||
setTimeout(function () { |
|||
each(newSeries.points, function (point, i) { |
|||
// Fade in other points
|
|||
var verb = i === level.pointIndex ? 'show' : 'fadeIn'; |
|||
point.graphic[verb](); |
|||
if (point.dataLabel) { |
|||
point.dataLabel[verb](); |
|||
} |
|||
if (point.connector) { |
|||
point.connector[verb](); |
|||
} |
|||
}); |
|||
}, Math.max(this.chart.options.drilldown.animation.duration - 50, 0)); |
|||
|
|||
// Reset
|
|||
this.animate = noop; |
|||
} |
|||
|
|||
}; |
|||
|
|||
ColumnSeries.prototype.animateDrilldown = function (init) { |
|||
var animateFrom = this.chart.drilldownLevels[this.chart.drilldownLevels.length - 1].shapeArgs, |
|||
animationOptions = this.chart.options.drilldown.animation; |
|||
|
|||
if (!init) { |
|||
|
|||
animateFrom.x += (this.xAxis.oldPos - this.xAxis.pos); |
|||
|
|||
each(this.points, function (point) { |
|||
point.graphic |
|||
.attr(animateFrom) |
|||
.animate(point.shapeArgs, animationOptions); |
|||
}); |
|||
} |
|||
|
|||
}; |
|||
|
|||
/** |
|||
* When drilling up, pull out the individual point graphics from the lower series |
|||
* and animate them into the origin point in the upper series. |
|||
*/ |
|||
ColumnSeries.prototype.animateDrillupFrom = |
|||
PieSeries.prototype.animateDrillupFrom = |
|||
function (level) { |
|||
var animationOptions = this.chart.options.drilldown.animation, |
|||
group = this.group; |
|||
|
|||
delete this.group; |
|||
each(this.points, function (point) { |
|||
var graphic = point.graphic, |
|||
startColor = H.Color(point.color).rgba; |
|||
|
|||
delete point.graphic; |
|||
|
|||
/*jslint unparam: true*/ |
|||
graphic.animate(level.shapeArgs, H.merge(animationOptions, { |
|||
|
|||
step: function (val, fx) { |
|||
if (fx.prop === 'start') { |
|||
this.attr({ |
|||
fill: tweenColors(startColor, H.Color(level.color).rgba, fx.pos) |
|||
}); |
|||
} |
|||
}, |
|||
complete: function () { |
|||
graphic.destroy(); |
|||
if (group) { |
|||
group = group.destroy(); |
|||
} |
|||
} |
|||
})); |
|||
/*jslint unparam: false*/ |
|||
}); |
|||
}; |
|||
|
|||
H.Point.prototype.doDrilldown = function () { |
|||
var series = this.series, |
|||
chart = series.chart, |
|||
drilldown = chart.options.drilldown, |
|||
i = drilldown.series.length, |
|||
seriesOptions; |
|||
|
|||
while (i-- && !seriesOptions) { |
|||
if (drilldown.series[i].id === this.drilldown) { |
|||
seriesOptions = drilldown.series[i]; |
|||
} |
|||
} |
|||
|
|||
// Fire the event. If seriesOptions is undefined, the implementer can check for
|
|||
// seriesOptions, and call addSeriesAsDrilldown async if necessary.
|
|||
fireEvent(chart, 'drilldown', { |
|||
point: this, |
|||
seriesOptions: seriesOptions |
|||
}); |
|||
|
|||
if (seriesOptions) { |
|||
chart.addSeriesAsDrilldown(this, seriesOptions); |
|||
} |
|||
|
|||
}; |
|||
|
|||
wrap(H.Point.prototype, 'init', function (proceed, series, options, x) { |
|||
var point = proceed.call(this, series, options, x), |
|||
chart = series.chart, |
|||
tick = series.xAxis && series.xAxis.ticks[x], |
|||
tickLabel = tick && tick.label; |
|||
|
|||
if (point.drilldown) { |
|||
|
|||
// Add the click event to the point label
|
|||
H.addEvent(point, 'click', function () { |
|||
point.doDrilldown(); |
|||
}); |
|||
|
|||
// Make axis labels clickable
|
|||
if (tickLabel) { |
|||
if (!tickLabel._basicStyle) { |
|||
tickLabel._basicStyle = tickLabel.element.getAttribute('style'); |
|||
} |
|||
tickLabel |
|||
.addClass('highcharts-drilldown-axis-label') |
|||
.css(chart.options.drilldown.activeAxisLabelStyle) |
|||
.on('click', function () { |
|||
if (point.doDrilldown) { |
|||
point.doDrilldown(); |
|||
} |
|||
}); |
|||
|
|||
} |
|||
} else if (tickLabel && tickLabel._basicStyle) { |
|||
tickLabel.element.setAttribute('style', tickLabel._basicStyle); |
|||
} |
|||
|
|||
return point; |
|||
}); |
|||
|
|||
wrap(H.Series.prototype, 'drawDataLabels', function (proceed) { |
|||
var css = this.chart.options.drilldown.activeDataLabelStyle; |
|||
|
|||
proceed.call(this); |
|||
|
|||
each(this.points, function (point) { |
|||
if (point.drilldown && point.dataLabel) { |
|||
point.dataLabel |
|||
.attr({ |
|||
'class': 'highcharts-drilldown-data-label' |
|||
}) |
|||
.css(css) |
|||
.on('click', function () { |
|||
point.doDrilldown(); |
|||
}); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
// Mark the trackers with a pointer
|
|||
ColumnSeries.prototype.supportsDrilldown = true; |
|||
PieSeries.prototype.supportsDrilldown = true; |
|||
var type, |
|||
drawTrackerWrapper = function (proceed) { |
|||
proceed.call(this); |
|||
each(this.points, function (point) { |
|||
if (point.drilldown && point.graphic) { |
|||
point.graphic |
|||
.attr({ |
|||
'class': 'highcharts-drilldown-point' |
|||
}) |
|||
.css({ cursor: 'pointer' }); |
|||
} |
|||
}); |
|||
}; |
|||
for (type in seriesTypes) { |
|||
if (seriesTypes[type].prototype.supportsDrilldown) { |
|||
wrap(seriesTypes[type].prototype, 'drawTracker', drawTrackerWrapper); |
|||
} |
|||
} |
|||
|
|||
}(Highcharts)); |
|||
@ -0,0 +1,22 @@ |
|||
/* |
|||
Highcharts JS v3.0.6 (2013-10-04) |
|||
Exporting module |
|||
|
|||
(c) 2010-2013 Torstein Hønsi |
|||
|
|||
License: www.highcharts.com/license |
|||
*/ |
|||
(function(f){var A=f.Chart,t=f.addEvent,C=f.removeEvent,k=f.createElement,n=f.discardElement,u=f.css,o=f.merge,r=f.each,p=f.extend,D=Math.max,j=document,B=window,E=f.isTouchDevice,F=f.Renderer.prototype.symbols,x=f.getOptions(),y;p(x.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",contextButtonTitle:"Chart context menu"});x.navigation={menuStyle:{border:"1px solid #A0A0A0", |
|||
background:"#FFFFFF",padding:"5px 0"},menuItemStyle:{padding:"0 10px",background:"none",color:"#303030",fontSize:E?"14px":"11px"},menuItemHoverStyle:{background:"#4572A5",color:"#FFFFFF"},buttonOptions:{symbolFill:"#E0E0E0",symbolSize:14,symbolStroke:"#666",symbolStrokeWidth:3,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,theme:{fill:"white",stroke:"none"},verticalAlign:"top",width:24}};x.exporting={type:"image/png",url:"http://export.highcharts.com/",buttons:{contextButton:{menuClassName:"highcharts-contextmenu", |
|||
symbol:"menu",_titleKey:"contextButtonTitle",menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},{textKey:"downloadPNG",onclick:function(){this.exportChart()}},{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}]}}};f.post=function(c,a){var d,b;b=k("form",{method:"post", |
|||
action:c,enctype:"multipart/form-data"},{display:"none"},j.body);for(d in a)k("input",{type:"hidden",name:d,value:a[d]},null,b);b.submit();n(b)};p(A.prototype,{getSVG:function(c){var a=this,d,b,z,h,g=o(a.options,c);if(!j.createElementNS)j.createElementNS=function(a,b){return j.createElement(b)};c=k("div",null,{position:"absolute",top:"-9999em",width:a.chartWidth+"px",height:a.chartHeight+"px"},j.body);b=a.renderTo.style.width;h=a.renderTo.style.height;b=g.exporting.sourceWidth||g.chart.width||/px$/.test(b)&& |
|||
parseInt(b,10)||600;h=g.exporting.sourceHeight||g.chart.height||/px$/.test(h)&&parseInt(h,10)||400;p(g.chart,{animation:!1,renderTo:c,forExport:!0,width:b,height:h});g.exporting.enabled=!1;g.series=[];r(a.series,function(a){z=o(a.options,{animation:!1,showCheckbox:!1,visible:a.visible});z.isInternal||g.series.push(z)});d=new f.Chart(g,a.callback);r(["xAxis","yAxis"],function(b){r(a[b],function(a,c){var g=d[b][c],f=a.getExtremes(),h=f.userMin,f=f.userMax;g&&(h!==void 0||f!==void 0)&&g.setExtremes(h, |
|||
f,!0,!1)})});b=d.container.innerHTML;g=null;d.destroy();n(c);b=b.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ').replace(/ href=/g," xlink:href=").replace(/\n/," ").replace(/<\/svg>.*?$/,"</svg>").replace(/ /g," ").replace(/­/g,"").replace(/<IMG /g,"<image ").replace(/height=([^" ]+)/g,'height="$1"').replace(/width=([^" ]+)/g, |
|||
'width="$1"').replace(/hc-svg-href="([^"]+)">/g,'xlink:href="$1"/>').replace(/id=([^" >]+)/g,'id="$1"').replace(/class=([^" >]+)/g,'class="$1"').replace(/ transform /g," ").replace(/:(path|rect)/g,"$1").replace(/style="([^"]+)"/g,function(a){return a.toLowerCase()});return b=b.replace(/(url\(#highcharts-[0-9]+)"/g,"$1").replace(/"/g,"'")},exportChart:function(c,a){var c=c||{},d=this.options.exporting,d=this.getSVG(o({chart:{borderRadius:0}},d.chartOptions,a,{exporting:{sourceWidth:c.sourceWidth|| |
|||
d.sourceWidth,sourceHeight:c.sourceHeight||d.sourceHeight}})),c=o(this.options.exporting,c);f.post(c.url,{filename:c.filename||"chart",type:c.type,width:c.width||0,scale:c.scale||2,svg:d})},print:function(){var c=this,a=c.container,d=[],b=a.parentNode,f=j.body,h=f.childNodes;if(!c.isPrinting)c.isPrinting=!0,r(h,function(a,b){if(a.nodeType===1)d[b]=a.style.display,a.style.display="none"}),f.appendChild(a),B.focus(),B.print(),setTimeout(function(){b.appendChild(a);r(h,function(a,b){if(a.nodeType=== |
|||
1)a.style.display=d[b]});c.isPrinting=!1},1E3)},contextMenu:function(c,a,d,b,f,h,g){var e=this,j=e.options.navigation,q=j.menuItemStyle,l=e.chartWidth,m=e.chartHeight,o="cache-"+c,i=e[o],s=D(f,h),v,w,n;if(!i)e[o]=i=k("div",{className:c},{position:"absolute",zIndex:1E3,padding:s+"px"},e.container),v=k("div",null,p({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},j.menuStyle),i),w=function(){u(i,{display:"none"});g&&g.setState(0);e.openMenu=!1},t(i, |
|||
"mouseleave",function(){n=setTimeout(w,500)}),t(i,"mouseenter",function(){clearTimeout(n)}),t(document,"mousedown",function(a){e.pointer.inClass(a.target,c)||w()}),r(a,function(a){if(a){var b=a.separator?k("hr",null,null,v):k("div",{onmouseover:function(){u(this,j.menuItemHoverStyle)},onmouseout:function(){u(this,q)},onclick:function(){w();a.onclick.apply(e,arguments)},innerHTML:a.text||e.options.lang[a.textKey]},p({cursor:"pointer"},q),v);e.exportDivElements.push(b)}}),e.exportDivElements.push(v, |
|||
i),e.exportMenuWidth=i.offsetWidth,e.exportMenuHeight=i.offsetHeight;a={display:"block"};d+e.exportMenuWidth>l?a.right=l-d-f-s+"px":a.left=d-s+"px";b+h+e.exportMenuHeight>m&&g.alignOptions.verticalAlign!=="top"?a.bottom=m-b-s+"px":a.top=b+h-s+"px";u(i,a);e.openMenu=!0},addButton:function(c){var a=this,d=a.renderer,b=o(a.options.navigation.buttonOptions,c),j=b.onclick,h=b.menuItems,g,e,k={stroke:b.symbolStroke,fill:b.symbolFill},q=b.symbolSize||12;if(!a.btnCount)a.btnCount=0;if(!a.exportDivElements)a.exportDivElements= |
|||
[],a.exportSVGElements=[];if(b.enabled!==!1){var l=b.theme,m=l.states,n=m&&m.hover,m=m&&m.select,i;delete l.states;j?i=function(){j.apply(a,arguments)}:h&&(i=function(){a.contextMenu(e.menuClassName,h,e.translateX,e.translateY,e.width,e.height,e);e.setState(2)});b.text&&b.symbol?l.paddingLeft=f.pick(l.paddingLeft,25):b.text||p(l,{width:b.width,height:b.height,padding:0});e=d.button(b.text,0,0,i,l,n,m).attr({title:a.options.lang[b._titleKey],"stroke-linecap":"round"});e.menuClassName=c.menuClassName|| |
|||
"highcharts-menu-"+a.btnCount++;b.symbol&&(g=d.symbol(b.symbol,b.symbolX-q/2,b.symbolY-q/2,q,q).attr(p(k,{"stroke-width":b.symbolStrokeWidth||1,zIndex:1})).add(e));e.add().align(p(b,{width:e.width,x:f.pick(b.x,y)}),!0,"spacingBox");y+=(e.width+b.buttonSpacing)*(b.align==="right"?-1:1);a.exportSVGElements.push(e,g)}},destroyExport:function(c){var c=c.target,a,d;for(a=0;a<c.exportSVGElements.length;a++)if(d=c.exportSVGElements[a])d.onclick=d.ontouchstart=null,c.exportSVGElements[a]=d.destroy();for(a= |
|||
0;a<c.exportDivElements.length;a++)d=c.exportDivElements[a],C(d,"mouseleave"),c.exportDivElements[a]=d.onmouseout=d.onmouseover=d.ontouchstart=d.onclick=null,n(d)}});F.menu=function(c,a,d,b){return["M",c,a+2.5,"L",c+d,a+2.5,"M",c,a+b/2+0.5,"L",c+d,a+b/2+0.5,"M",c,a+b-1.5,"L",c+d,a+b-1.5]};A.prototype.callbacks.push(function(c){var a,d=c.options.exporting,b=d.buttons;y=0;if(d.enabled!==!1){for(a in b)c.addButton(b[a]);t(c,"destroy",c.destroyExport)}})})(Highcharts); |
|||
@ -0,0 +1,709 @@ |
|||
/** |
|||
* @license Highcharts JS v3.0.6 (2013-10-04) |
|||
* Exporting module |
|||
* |
|||
* (c) 2010-2013 Torstein Hønsi |
|||
* |
|||
* License: www.highcharts.com/license |
|||
*/ |
|||
|
|||
// JSLint options:
|
|||
/*global Highcharts, document, window, Math, setTimeout */ |
|||
|
|||
(function (Highcharts) { // encapsulate
|
|||
|
|||
// create shortcuts
|
|||
var Chart = Highcharts.Chart, |
|||
addEvent = Highcharts.addEvent, |
|||
removeEvent = Highcharts.removeEvent, |
|||
createElement = Highcharts.createElement, |
|||
discardElement = Highcharts.discardElement, |
|||
css = Highcharts.css, |
|||
merge = Highcharts.merge, |
|||
each = Highcharts.each, |
|||
extend = Highcharts.extend, |
|||
math = Math, |
|||
mathMax = math.max, |
|||
doc = document, |
|||
win = window, |
|||
isTouchDevice = Highcharts.isTouchDevice, |
|||
M = 'M', |
|||
L = 'L', |
|||
DIV = 'div', |
|||
HIDDEN = 'hidden', |
|||
NONE = 'none', |
|||
PREFIX = 'highcharts-', |
|||
ABSOLUTE = 'absolute', |
|||
PX = 'px', |
|||
UNDEFINED, |
|||
symbols = Highcharts.Renderer.prototype.symbols, |
|||
defaultOptions = Highcharts.getOptions(), |
|||
buttonOffset; |
|||
|
|||
// Add language
|
|||
extend(defaultOptions.lang, { |
|||
printChart: 'Print chart', |
|||
downloadPNG: 'Download PNG image', |
|||
downloadJPEG: 'Download JPEG image', |
|||
downloadPDF: 'Download PDF document', |
|||
downloadSVG: 'Download SVG vector image', |
|||
contextButtonTitle: 'Chart context menu' |
|||
}); |
|||
|
|||
// Buttons and menus are collected in a separate config option set called 'navigation'.
|
|||
// This can be extended later to add control buttons like zoom and pan right click menus.
|
|||
defaultOptions.navigation = { |
|||
menuStyle: { |
|||
border: '1px solid #A0A0A0', |
|||
background: '#FFFFFF', |
|||
padding: '5px 0' |
|||
}, |
|||
menuItemStyle: { |
|||
padding: '0 10px', |
|||
background: NONE, |
|||
color: '#303030', |
|||
fontSize: isTouchDevice ? '14px' : '11px' |
|||
}, |
|||
menuItemHoverStyle: { |
|||
background: '#4572A5', |
|||
color: '#FFFFFF' |
|||
}, |
|||
|
|||
buttonOptions: { |
|||
symbolFill: '#E0E0E0', |
|||
symbolSize: 14, |
|||
symbolStroke: '#666', |
|||
symbolStrokeWidth: 3, |
|||
symbolX: 12.5, |
|||
symbolY: 10.5, |
|||
align: 'right', |
|||
buttonSpacing: 3, |
|||
height: 22, |
|||
// text: null,
|
|||
theme: { |
|||
fill: 'white', // capture hover
|
|||
stroke: 'none' |
|||
}, |
|||
verticalAlign: 'top', |
|||
width: 24 |
|||
} |
|||
}; |
|||
|
|||
|
|||
|
|||
// Add the export related options
|
|||
defaultOptions.exporting = { |
|||
//enabled: true,
|
|||
//filename: 'chart',
|
|||
type: 'image/png', |
|||
url: 'http://export.highcharts.com/', |
|||
//width: undefined,
|
|||
//scale: 2
|
|||
buttons: { |
|||
contextButton: { |
|||
menuClassName: PREFIX + 'contextmenu', |
|||
//x: -10,
|
|||
symbol: 'menu', |
|||
_titleKey: 'contextButtonTitle', |
|||
menuItems: [{ |
|||
textKey: 'printChart', |
|||
onclick: function () { |
|||
this.print(); |
|||
} |
|||
}, { |
|||
separator: true |
|||
}, { |
|||
textKey: 'downloadPNG', |
|||
onclick: function () { |
|||
this.exportChart(); |
|||
} |
|||
}, { |
|||
textKey: 'downloadJPEG', |
|||
onclick: function () { |
|||
this.exportChart({ |
|||
type: 'image/jpeg' |
|||
}); |
|||
} |
|||
}, { |
|||
textKey: 'downloadPDF', |
|||
onclick: function () { |
|||
this.exportChart({ |
|||
type: 'application/pdf' |
|||
}); |
|||
} |
|||
}, { |
|||
textKey: 'downloadSVG', |
|||
onclick: function () { |
|||
this.exportChart({ |
|||
type: 'image/svg+xml' |
|||
}); |
|||
} |
|||
} |
|||
// Enable this block to add "View SVG" to the dropdown menu
|
|||
/* |
|||
,{ |
|||
|
|||
text: 'View SVG', |
|||
onclick: function () { |
|||
var svg = this.getSVG() |
|||
.replace(/</g, '\n<') |
|||
.replace(/>/g, '>'); |
|||
|
|||
doc.body.innerHTML = '<pre>' + svg + '</pre>'; |
|||
} |
|||
} // */
|
|||
] |
|||
} |
|||
} |
|||
}; |
|||
|
|||
// Add the Highcharts.post utility
|
|||
Highcharts.post = function (url, data) { |
|||
var name, |
|||
form; |
|||
|
|||
// create the form
|
|||
form = createElement('form', { |
|||
method: 'post', |
|||
action: url, |
|||
enctype: 'multipart/form-data' |
|||
}, { |
|||
display: NONE |
|||
}, doc.body); |
|||
|
|||
// add the data
|
|||
for (name in data) { |
|||
createElement('input', { |
|||
type: HIDDEN, |
|||
name: name, |
|||
value: data[name] |
|||
}, null, form); |
|||
} |
|||
|
|||
// submit
|
|||
form.submit(); |
|||
|
|||
// clean up
|
|||
discardElement(form); |
|||
}; |
|||
|
|||
extend(Chart.prototype, { |
|||
|
|||
/** |
|||
* Return an SVG representation of the chart |
|||
* |
|||
* @param additionalOptions {Object} Additional chart options for the generated SVG representation |
|||
*/ |
|||
getSVG: function (additionalOptions) { |
|||
var chart = this, |
|||
chartCopy, |
|||
sandbox, |
|||
svg, |
|||
seriesOptions, |
|||
sourceWidth, |
|||
sourceHeight, |
|||
cssWidth, |
|||
cssHeight, |
|||
options = merge(chart.options, additionalOptions); // copy the options and add extra options
|
|||
|
|||
// IE compatibility hack for generating SVG content that it doesn't really understand
|
|||
if (!doc.createElementNS) { |
|||
/*jslint unparam: true*//* allow unused parameter ns in function below */ |
|||
doc.createElementNS = function (ns, tagName) { |
|||
return doc.createElement(tagName); |
|||
}; |
|||
/*jslint unparam: false*/ |
|||
} |
|||
|
|||
// create a sandbox where a new chart will be generated
|
|||
sandbox = createElement(DIV, null, { |
|||
position: ABSOLUTE, |
|||
top: '-9999em', |
|||
width: chart.chartWidth + PX, |
|||
height: chart.chartHeight + PX |
|||
}, doc.body); |
|||
|
|||
// get the source size
|
|||
cssWidth = chart.renderTo.style.width; |
|||
cssHeight = chart.renderTo.style.height; |
|||
sourceWidth = options.exporting.sourceWidth || |
|||
options.chart.width || |
|||
(/px$/.test(cssWidth) && parseInt(cssWidth, 10)) || |
|||
600; |
|||
sourceHeight = options.exporting.sourceHeight || |
|||
options.chart.height || |
|||
(/px$/.test(cssHeight) && parseInt(cssHeight, 10)) || |
|||
400; |
|||
|
|||
// override some options
|
|||
extend(options.chart, { |
|||
animation: false, |
|||
renderTo: sandbox, |
|||
forExport: true, |
|||
width: sourceWidth, |
|||
height: sourceHeight |
|||
}); |
|||
options.exporting.enabled = false; // hide buttons in print
|
|||
|
|||
// prepare for replicating the chart
|
|||
options.series = []; |
|||
each(chart.series, function (serie) { |
|||
seriesOptions = merge(serie.options, { |
|||
animation: false, // turn off animation
|
|||
showCheckbox: false, |
|||
visible: serie.visible |
|||
}); |
|||
|
|||
if (!seriesOptions.isInternal) { // used for the navigator series that has its own option set
|
|||
options.series.push(seriesOptions); |
|||
} |
|||
}); |
|||
|
|||
// generate the chart copy
|
|||
chartCopy = new Highcharts.Chart(options, chart.callback); |
|||
|
|||
// reflect axis extremes in the export
|
|||
each(['xAxis', 'yAxis'], function (axisType) { |
|||
each(chart[axisType], function (axis, i) { |
|||
var axisCopy = chartCopy[axisType][i], |
|||
extremes = axis.getExtremes(), |
|||
userMin = extremes.userMin, |
|||
userMax = extremes.userMax; |
|||
|
|||
if (axisCopy && (userMin !== UNDEFINED || userMax !== UNDEFINED)) { |
|||
axisCopy.setExtremes(userMin, userMax, true, false); |
|||
} |
|||
}); |
|||
}); |
|||
|
|||
// get the SVG from the container's innerHTML
|
|||
svg = chartCopy.container.innerHTML; |
|||
|
|||
// free up memory
|
|||
options = null; |
|||
chartCopy.destroy(); |
|||
discardElement(sandbox); |
|||
|
|||
// sanitize
|
|||
svg = svg |
|||
.replace(/zIndex="[^"]+"/g, '') |
|||
.replace(/isShadow="[^"]+"/g, '') |
|||
.replace(/symbolName="[^"]+"/g, '') |
|||
.replace(/jQuery[0-9]+="[^"]+"/g, '') |
|||
.replace(/url\([^#]+#/g, 'url(#') |
|||
.replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ') |
|||
.replace(/ href=/g, ' xlink:href=') |
|||
.replace(/\n/, ' ') |
|||
.replace(/<\/svg>.*?$/, '</svg>') // any HTML added to the container after the SVG (#894)
|
|||
/* This fails in IE < 8 |
|||
.replace(/([0-9]+)\.([0-9]+)/g, function(s1, s2, s3) { // round off to save weight
|
|||
return s2 +'.'+ s3[0]; |
|||
})*/ |
|||
|
|||
// Replace HTML entities, issue #347
|
|||
.replace(/ /g, '\u00A0') // no-break space
|
|||
.replace(/­/g, '\u00AD') // soft hyphen
|
|||
|
|||
// IE specific
|
|||
.replace(/<IMG /g, '<image ') |
|||
.replace(/height=([^" ]+)/g, 'height="$1"') |
|||
.replace(/width=([^" ]+)/g, 'width="$1"') |
|||
.replace(/hc-svg-href="([^"]+)">/g, 'xlink:href="$1"/>') |
|||
.replace(/id=([^" >]+)/g, 'id="$1"') |
|||
.replace(/class=([^" >]+)/g, 'class="$1"') |
|||
.replace(/ transform /g, ' ') |
|||
.replace(/:(path|rect)/g, '$1') |
|||
.replace(/style="([^"]+)"/g, function (s) { |
|||
return s.toLowerCase(); |
|||
}); |
|||
|
|||
// IE9 beta bugs with innerHTML. Test again with final IE9.
|
|||
svg = svg.replace(/(url\(#highcharts-[0-9]+)"/g, '$1') |
|||
.replace(/"/g, "'"); |
|||
|
|||
return svg; |
|||
}, |
|||
|
|||
/** |
|||
* Submit the SVG representation of the chart to the server |
|||
* @param {Object} options Exporting options. Possible members are url, type and width. |
|||
* @param {Object} chartOptions Additional chart options for the SVG representation of the chart |
|||
*/ |
|||
exportChart: function (options, chartOptions) { |
|||
options = options || {}; |
|||
|
|||
var chart = this, |
|||
chartExportingOptions = chart.options.exporting, |
|||
svg = chart.getSVG(merge( |
|||
{ chart: { borderRadius: 0 } }, |
|||
chartExportingOptions.chartOptions, |
|||
chartOptions, |
|||
{ |
|||
exporting: { |
|||
sourceWidth: options.sourceWidth || chartExportingOptions.sourceWidth, |
|||
sourceHeight: options.sourceHeight || chartExportingOptions.sourceHeight |
|||
} |
|||
} |
|||
)); |
|||
|
|||
// merge the options
|
|||
options = merge(chart.options.exporting, options); |
|||
|
|||
// do the post
|
|||
Highcharts.post(options.url, { |
|||
filename: options.filename || 'chart', |
|||
type: options.type, |
|||
width: options.width || 0, // IE8 fails to post undefined correctly, so use 0
|
|||
scale: options.scale || 2, |
|||
svg: svg |
|||
}); |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* Print the chart |
|||
*/ |
|||
print: function () { |
|||
|
|||
var chart = this, |
|||
container = chart.container, |
|||
origDisplay = [], |
|||
origParent = container.parentNode, |
|||
body = doc.body, |
|||
childNodes = body.childNodes; |
|||
|
|||
if (chart.isPrinting) { // block the button while in printing mode
|
|||
return; |
|||
} |
|||
|
|||
chart.isPrinting = true; |
|||
|
|||
// hide all body content
|
|||
each(childNodes, function (node, i) { |
|||
if (node.nodeType === 1) { |
|||
origDisplay[i] = node.style.display; |
|||
node.style.display = NONE; |
|||
} |
|||
}); |
|||
|
|||
// pull out the chart
|
|||
body.appendChild(container); |
|||
|
|||
// print
|
|||
win.focus(); // #1510
|
|||
win.print(); |
|||
|
|||
// allow the browser to prepare before reverting
|
|||
setTimeout(function () { |
|||
|
|||
// put the chart back in
|
|||
origParent.appendChild(container); |
|||
|
|||
// restore all body content
|
|||
each(childNodes, function (node, i) { |
|||
if (node.nodeType === 1) { |
|||
node.style.display = origDisplay[i]; |
|||
} |
|||
}); |
|||
|
|||
chart.isPrinting = false; |
|||
|
|||
}, 1000); |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* Display a popup menu for choosing the export type |
|||
* |
|||
* @param {String} className An identifier for the menu |
|||
* @param {Array} items A collection with text and onclicks for the items |
|||
* @param {Number} x The x position of the opener button |
|||
* @param {Number} y The y position of the opener button |
|||
* @param {Number} width The width of the opener button |
|||
* @param {Number} height The height of the opener button |
|||
*/ |
|||
contextMenu: function (className, items, x, y, width, height, button) { |
|||
var chart = this, |
|||
navOptions = chart.options.navigation, |
|||
menuItemStyle = navOptions.menuItemStyle, |
|||
chartWidth = chart.chartWidth, |
|||
chartHeight = chart.chartHeight, |
|||
cacheName = 'cache-' + className, |
|||
menu = chart[cacheName], |
|||
menuPadding = mathMax(width, height), // for mouse leave detection
|
|||
boxShadow = '3px 3px 10px #888', |
|||
innerMenu, |
|||
hide, |
|||
hideTimer, |
|||
menuStyle; |
|||
|
|||
// create the menu only the first time
|
|||
if (!menu) { |
|||
|
|||
// create a HTML element above the SVG
|
|||
chart[cacheName] = menu = createElement(DIV, { |
|||
className: className |
|||
}, { |
|||
position: ABSOLUTE, |
|||
zIndex: 1000, |
|||
padding: menuPadding + PX |
|||
}, chart.container); |
|||
|
|||
innerMenu = createElement(DIV, null, |
|||
extend({ |
|||
MozBoxShadow: boxShadow, |
|||
WebkitBoxShadow: boxShadow, |
|||
boxShadow: boxShadow |
|||
}, navOptions.menuStyle), menu); |
|||
|
|||
// hide on mouse out
|
|||
hide = function () { |
|||
css(menu, { display: NONE }); |
|||
if (button) { |
|||
button.setState(0); |
|||
} |
|||
chart.openMenu = false; |
|||
}; |
|||
|
|||
// Hide the menu some time after mouse leave (#1357)
|
|||
addEvent(menu, 'mouseleave', function () { |
|||
hideTimer = setTimeout(hide, 500); |
|||
}); |
|||
addEvent(menu, 'mouseenter', function () { |
|||
clearTimeout(hideTimer); |
|||
}); |
|||
// Hide it on clicking or touching outside the menu (#2258)
|
|||
addEvent(document, 'mousedown', function (e) { |
|||
if (!chart.pointer.inClass(e.target, className)) { |
|||
hide(); |
|||
} |
|||
}); |
|||
|
|||
|
|||
// create the items
|
|||
each(items, function (item) { |
|||
if (item) { |
|||
var element = item.separator ? |
|||
createElement('hr', null, null, innerMenu) : |
|||
createElement(DIV, { |
|||
onmouseover: function () { |
|||
css(this, navOptions.menuItemHoverStyle); |
|||
}, |
|||
onmouseout: function () { |
|||
css(this, menuItemStyle); |
|||
}, |
|||
onclick: function () { |
|||
hide(); |
|||
item.onclick.apply(chart, arguments); |
|||
}, |
|||
innerHTML: item.text || chart.options.lang[item.textKey] |
|||
}, extend({ |
|||
cursor: 'pointer' |
|||
}, menuItemStyle), innerMenu); |
|||
|
|||
|
|||
// Keep references to menu divs to be able to destroy them
|
|||
chart.exportDivElements.push(element); |
|||
} |
|||
}); |
|||
|
|||
// Keep references to menu and innerMenu div to be able to destroy them
|
|||
chart.exportDivElements.push(innerMenu, menu); |
|||
|
|||
chart.exportMenuWidth = menu.offsetWidth; |
|||
chart.exportMenuHeight = menu.offsetHeight; |
|||
} |
|||
|
|||
menuStyle = { display: 'block' }; |
|||
|
|||
// if outside right, right align it
|
|||
if (x + chart.exportMenuWidth > chartWidth) { |
|||
menuStyle.right = (chartWidth - x - width - menuPadding) + PX; |
|||
} else { |
|||
menuStyle.left = (x - menuPadding) + PX; |
|||
} |
|||
// if outside bottom, bottom align it
|
|||
if (y + height + chart.exportMenuHeight > chartHeight && button.alignOptions.verticalAlign !== 'top') { |
|||
menuStyle.bottom = (chartHeight - y - menuPadding) + PX; |
|||
} else { |
|||
menuStyle.top = (y + height - menuPadding) + PX; |
|||
} |
|||
|
|||
css(menu, menuStyle); |
|||
chart.openMenu = true; |
|||
}, |
|||
|
|||
/** |
|||
* Add the export button to the chart |
|||
*/ |
|||
addButton: function (options) { |
|||
var chart = this, |
|||
renderer = chart.renderer, |
|||
btnOptions = merge(chart.options.navigation.buttonOptions, options), |
|||
onclick = btnOptions.onclick, |
|||
menuItems = btnOptions.menuItems, |
|||
symbol, |
|||
button, |
|||
symbolAttr = { |
|||
stroke: btnOptions.symbolStroke, |
|||
fill: btnOptions.symbolFill |
|||
}, |
|||
symbolSize = btnOptions.symbolSize || 12; |
|||
if (!chart.btnCount) { |
|||
chart.btnCount = 0; |
|||
} |
|||
|
|||
// Keeps references to the button elements
|
|||
if (!chart.exportDivElements) { |
|||
chart.exportDivElements = []; |
|||
chart.exportSVGElements = []; |
|||
} |
|||
|
|||
if (btnOptions.enabled === false) { |
|||
return; |
|||
} |
|||
|
|||
|
|||
var attr = btnOptions.theme, |
|||
states = attr.states, |
|||
hover = states && states.hover, |
|||
select = states && states.select, |
|||
callback; |
|||
|
|||
delete attr.states; |
|||
|
|||
if (onclick) { |
|||
callback = function () { |
|||
onclick.apply(chart, arguments); |
|||
}; |
|||
|
|||
} else if (menuItems) { |
|||
callback = function () { |
|||
chart.contextMenu( |
|||
button.menuClassName, |
|||
menuItems, |
|||
button.translateX, |
|||
button.translateY, |
|||
button.width, |
|||
button.height, |
|||
button |
|||
); |
|||
button.setState(2); |
|||
}; |
|||
} |
|||
|
|||
|
|||
if (btnOptions.text && btnOptions.symbol) { |
|||
attr.paddingLeft = Highcharts.pick(attr.paddingLeft, 25); |
|||
|
|||
} else if (!btnOptions.text) { |
|||
extend(attr, { |
|||
width: btnOptions.width, |
|||
height: btnOptions.height, |
|||
padding: 0 |
|||
}); |
|||
} |
|||
|
|||
button = renderer.button(btnOptions.text, 0, 0, callback, attr, hover, select) |
|||
.attr({ |
|||
title: chart.options.lang[btnOptions._titleKey], |
|||
'stroke-linecap': 'round' |
|||
}); |
|||
button.menuClassName = options.menuClassName || PREFIX + 'menu-' + chart.btnCount++; |
|||
|
|||
if (btnOptions.symbol) { |
|||
symbol = renderer.symbol( |
|||
btnOptions.symbol, |
|||
btnOptions.symbolX - (symbolSize / 2), |
|||
btnOptions.symbolY - (symbolSize / 2), |
|||
symbolSize, |
|||
symbolSize |
|||
) |
|||
.attr(extend(symbolAttr, { |
|||
'stroke-width': btnOptions.symbolStrokeWidth || 1, |
|||
zIndex: 1 |
|||
})).add(button); |
|||
} |
|||
|
|||
button.add() |
|||
.align(extend(btnOptions, { |
|||
width: button.width, |
|||
x: Highcharts.pick(btnOptions.x, buttonOffset) // #1654
|
|||
}), true, 'spacingBox'); |
|||
|
|||
buttonOffset += (button.width + btnOptions.buttonSpacing) * (btnOptions.align === 'right' ? -1 : 1); |
|||
|
|||
chart.exportSVGElements.push(button, symbol); |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* Destroy the buttons. |
|||
*/ |
|||
destroyExport: function (e) { |
|||
var chart = e.target, |
|||
i, |
|||
elem; |
|||
|
|||
// Destroy the extra buttons added
|
|||
for (i = 0; i < chart.exportSVGElements.length; i++) { |
|||
elem = chart.exportSVGElements[i]; |
|||
|
|||
// Destroy and null the svg/vml elements
|
|||
if (elem) { // #1822
|
|||
elem.onclick = elem.ontouchstart = null; |
|||
chart.exportSVGElements[i] = elem.destroy(); |
|||
} |
|||
} |
|||
|
|||
// Destroy the divs for the menu
|
|||
for (i = 0; i < chart.exportDivElements.length; i++) { |
|||
elem = chart.exportDivElements[i]; |
|||
|
|||
// Remove the event handler
|
|||
removeEvent(elem, 'mouseleave'); |
|||
|
|||
// Remove inline events
|
|||
chart.exportDivElements[i] = elem.onmouseout = elem.onmouseover = elem.ontouchstart = elem.onclick = null; |
|||
|
|||
// Destroy the div by moving to garbage bin
|
|||
discardElement(elem); |
|||
} |
|||
} |
|||
}); |
|||
|
|||
|
|||
symbols.menu = function (x, y, width, height) { |
|||
var arr = [ |
|||
M, x, y + 2.5, |
|||
L, x + width, y + 2.5, |
|||
M, x, y + height / 2 + 0.5, |
|||
L, x + width, y + height / 2 + 0.5, |
|||
M, x, y + height - 1.5, |
|||
L, x + width, y + height - 1.5 |
|||
]; |
|||
return arr; |
|||
}; |
|||
|
|||
// Add the buttons on chart load
|
|||
Chart.prototype.callbacks.push(function (chart) { |
|||
var n, |
|||
exportingOptions = chart.options.exporting, |
|||
buttons = exportingOptions.buttons; |
|||
|
|||
buttonOffset = 0; |
|||
|
|||
if (exportingOptions.enabled !== false) { |
|||
|
|||
for (n in buttons) { |
|||
chart.addButton(buttons[n]); |
|||
} |
|||
|
|||
// Destroy the export elements at chart destroy
|
|||
addEvent(chart, 'destroy', chart.destroyExport); |
|||
} |
|||
|
|||
}); |
|||
|
|||
|
|||
}(Highcharts)); |
|||
@ -0,0 +1,12 @@ |
|||
/* |
|||
|
|||
Highcharts funnel module, Beta |
|||
|
|||
(c) 2010-2012 Torstein Hønsi |
|||
|
|||
License: www.highcharts.com/license |
|||
*/ |
|||
(function(d){var u=d.getOptions().plotOptions,p=d.seriesTypes,D=d.merge,z=function(){},A=d.each;u.funnel=D(u.pie,{center:["50%","50%"],width:"90%",neckWidth:"30%",height:"100%",neckHeight:"25%",dataLabels:{connectorWidth:1,connectorColor:"#606060"},size:!0,states:{select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}}});p.funnel=d.extendClass(p.pie,{type:"funnel",animate:z,translate:function(){var a=function(k,a){return/%$/.test(k)?a*parseInt(k,10)/100:parseInt(k,10)},g=0,e=this.chart,f=e.plotWidth, |
|||
e=e.plotHeight,h=0,c=this.options,C=c.center,b=a(C[0],f),d=a(C[0],e),p=a(c.width,f),i,q,j=a(c.height,e),r=a(c.neckWidth,f),s=a(c.neckHeight,e),v=j-s,a=this.data,w,x,u=c.dataLabels.position==="left"?1:0,y,m,B,n,l,t,o;this.getWidthAt=q=function(k){return k>j-s||j===s?r:r+(p-r)*((j-s-k)/(j-s))};this.getX=function(k,a){return b+(a?-1:1)*(q(k)/2+c.dataLabels.distance)};this.center=[b,d,j];this.centerX=b;A(a,function(a){g+=a.y});A(a,function(a){o=null;x=g?a.y/g:0;m=d-j/2+h*j;l=m+x*j;i=q(m);y=b-i/2;B=y+ |
|||
i;i=q(l);n=b-i/2;t=n+i;m>v?(y=n=b-r/2,B=t=b+r/2):l>v&&(o=l,i=q(v),n=b-i/2,t=n+i,l=v);w=["M",y,m,"L",B,m,t,l];o&&w.push(t,o,n,o);w.push(n,l,"Z");a.shapeType="path";a.shapeArgs={d:w};a.percentage=x*100;a.plotX=b;a.plotY=(m+(o||l))/2;a.tooltipPos=[b,a.plotY];a.slice=z;a.half=u;h+=x});this.setTooltipPoints()},drawPoints:function(){var a=this,g=a.options,e=a.chart.renderer;A(a.data,function(f){var h=f.graphic,c=f.shapeArgs;h?h.animate(c):f.graphic=e.path(c).attr({fill:f.color,stroke:g.borderColor,"stroke-width":g.borderWidth}).add(a.group)})}, |
|||
sortByAngle:z,drawDataLabels:function(){var a=this.data,g=this.options.dataLabels.distance,e,f,h,c=a.length,d,b;for(this.center[2]-=2*g;c--;)h=a[c],f=(e=h.half)?1:-1,b=h.plotY,d=this.getX(b,e),h.labelPos=[0,b,d+(g-5)*f,b,d+g*f,b,e?"right":"left",0];p.pie.prototype.drawDataLabels.call(this)}})})(Highcharts); |
|||
@ -0,0 +1,289 @@ |
|||
/** |
|||
* @license |
|||
* Highcharts funnel module, Beta |
|||
* |
|||
* (c) 2010-2012 Torstein Hønsi |
|||
* |
|||
* License: www.highcharts.com/license |
|||
*/ |
|||
|
|||
/*global Highcharts */ |
|||
(function (Highcharts) { |
|||
|
|||
'use strict'; |
|||
|
|||
// create shortcuts
|
|||
var defaultOptions = Highcharts.getOptions(), |
|||
defaultPlotOptions = defaultOptions.plotOptions, |
|||
seriesTypes = Highcharts.seriesTypes, |
|||
merge = Highcharts.merge, |
|||
noop = function () {}, |
|||
each = Highcharts.each; |
|||
|
|||
// set default options
|
|||
defaultPlotOptions.funnel = merge(defaultPlotOptions.pie, { |
|||
center: ['50%', '50%'], |
|||
width: '90%', |
|||
neckWidth: '30%', |
|||
height: '100%', |
|||
neckHeight: '25%', |
|||
|
|||
dataLabels: { |
|||
//position: 'right',
|
|||
connectorWidth: 1, |
|||
connectorColor: '#606060' |
|||
}, |
|||
size: true, // to avoid adapting to data label size in Pie.drawDataLabels
|
|||
states: { |
|||
select: { |
|||
color: '#C0C0C0', |
|||
borderColor: '#000000', |
|||
shadow: false |
|||
} |
|||
} |
|||
}); |
|||
|
|||
|
|||
seriesTypes.funnel = Highcharts.extendClass(seriesTypes.pie, { |
|||
|
|||
type: 'funnel', |
|||
animate: noop, |
|||
|
|||
/** |
|||
* Overrides the pie translate method |
|||
*/ |
|||
translate: function () { |
|||
|
|||
var |
|||
// Get positions - either an integer or a percentage string must be given
|
|||
getLength = function (length, relativeTo) { |
|||
return (/%$/).test(length) ? |
|||
relativeTo * parseInt(length, 10) / 100 : |
|||
parseInt(length, 10); |
|||
}, |
|||
|
|||
sum = 0, |
|||
series = this, |
|||
chart = series.chart, |
|||
plotWidth = chart.plotWidth, |
|||
plotHeight = chart.plotHeight, |
|||
cumulative = 0, // start at top
|
|||
options = series.options, |
|||
center = options.center, |
|||
centerX = getLength(center[0], plotWidth), |
|||
centerY = getLength(center[0], plotHeight), |
|||
width = getLength(options.width, plotWidth), |
|||
tempWidth, |
|||
getWidthAt, |
|||
height = getLength(options.height, plotHeight), |
|||
neckWidth = getLength(options.neckWidth, plotWidth), |
|||
neckHeight = getLength(options.neckHeight, plotHeight), |
|||
neckY = height - neckHeight, |
|||
data = series.data, |
|||
path, |
|||
fraction, |
|||
half = options.dataLabels.position === 'left' ? 1 : 0, |
|||
|
|||
x1, |
|||
y1, |
|||
x2, |
|||
x3, |
|||
y3, |
|||
x4, |
|||
y5; |
|||
|
|||
// Return the width at a specific y coordinate
|
|||
series.getWidthAt = getWidthAt = function (y) { |
|||
return y > height - neckHeight || height === neckHeight ? |
|||
neckWidth : |
|||
neckWidth + (width - neckWidth) * ((height - neckHeight - y) / (height - neckHeight)); |
|||
}; |
|||
series.getX = function (y, half) { |
|||
return centerX + (half ? -1 : 1) * ((getWidthAt(y) / 2) + options.dataLabels.distance); |
|||
}; |
|||
|
|||
// Expose
|
|||
series.center = [centerX, centerY, height]; |
|||
series.centerX = centerX; |
|||
|
|||
/* |
|||
* Individual point coordinate naming: |
|||
* |
|||
* x1,y1 _________________ x2,y1 |
|||
* \ / |
|||
* \ / |
|||
* \ / |
|||
* \ / |
|||
* \ / |
|||
* x3,y3 _________ x4,y3 |
|||
* |
|||
* Additional for the base of the neck: |
|||
* |
|||
* | | |
|||
* | | |
|||
* | | |
|||
* x3,y5 _________ x4,y5 |
|||
*/ |
|||
|
|||
|
|||
|
|||
|
|||
// get the total sum
|
|||
each(data, function (point) { |
|||
sum += point.y; |
|||
}); |
|||
|
|||
each(data, function (point) { |
|||
// set start and end positions
|
|||
y5 = null; |
|||
fraction = sum ? point.y / sum : 0; |
|||
y1 = centerY - height / 2 + cumulative * height; |
|||
y3 = y1 + fraction * height; |
|||
//tempWidth = neckWidth + (width - neckWidth) * ((height - neckHeight - y1) / (height - neckHeight));
|
|||
tempWidth = getWidthAt(y1); |
|||
x1 = centerX - tempWidth / 2; |
|||
x2 = x1 + tempWidth; |
|||
tempWidth = getWidthAt(y3); |
|||
x3 = centerX - tempWidth / 2; |
|||
x4 = x3 + tempWidth; |
|||
|
|||
// the entire point is within the neck
|
|||
if (y1 > neckY) { |
|||
x1 = x3 = centerX - neckWidth / 2; |
|||
x2 = x4 = centerX + neckWidth / 2; |
|||
|
|||
// the base of the neck
|
|||
} else if (y3 > neckY) { |
|||
y5 = y3; |
|||
|
|||
tempWidth = getWidthAt(neckY); |
|||
x3 = centerX - tempWidth / 2; |
|||
x4 = x3 + tempWidth; |
|||
|
|||
y3 = neckY; |
|||
} |
|||
|
|||
// save the path
|
|||
path = [ |
|||
'M', |
|||
x1, y1, |
|||
'L', |
|||
x2, y1, |
|||
x4, y3 |
|||
]; |
|||
if (y5) { |
|||
path.push(x4, y5, x3, y5); |
|||
} |
|||
path.push(x3, y3, 'Z'); |
|||
|
|||
// prepare for using shared dr
|
|||
point.shapeType = 'path'; |
|||
point.shapeArgs = { d: path }; |
|||
|
|||
|
|||
// for tooltips and data labels
|
|||
point.percentage = fraction * 100; |
|||
point.plotX = centerX; |
|||
point.plotY = (y1 + (y5 || y3)) / 2; |
|||
|
|||
// Placement of tooltips and data labels
|
|||
point.tooltipPos = [ |
|||
centerX, |
|||
point.plotY |
|||
]; |
|||
|
|||
// Slice is a noop on funnel points
|
|||
point.slice = noop; |
|||
|
|||
// Mimicking pie data label placement logic
|
|||
point.half = half; |
|||
|
|||
cumulative += fraction; |
|||
}); |
|||
|
|||
|
|||
series.setTooltipPoints(); |
|||
}, |
|||
/** |
|||
* Draw a single point (wedge) |
|||
* @param {Object} point The point object |
|||
* @param {Object} color The color of the point |
|||
* @param {Number} brightness The brightness relative to the color |
|||
*/ |
|||
drawPoints: function () { |
|||
var series = this, |
|||
options = series.options, |
|||
chart = series.chart, |
|||
renderer = chart.renderer; |
|||
|
|||
each(series.data, function (point) { |
|||
|
|||
var graphic = point.graphic, |
|||
shapeArgs = point.shapeArgs; |
|||
|
|||
if (!graphic) { // Create the shapes
|
|||
point.graphic = renderer.path(shapeArgs). |
|||
attr({ |
|||
fill: point.color, |
|||
stroke: options.borderColor, |
|||
'stroke-width': options.borderWidth |
|||
}). |
|||
add(series.group); |
|||
|
|||
} else { // Update the shapes
|
|||
graphic.animate(shapeArgs); |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
/** |
|||
* Funnel items don't have angles (#2289) |
|||
*/ |
|||
sortByAngle: noop, |
|||
|
|||
/** |
|||
* Extend the pie data label method |
|||
*/ |
|||
drawDataLabels: function () { |
|||
var data = this.data, |
|||
labelDistance = this.options.dataLabels.distance, |
|||
leftSide, |
|||
sign, |
|||
point, |
|||
i = data.length, |
|||
x, |
|||
y; |
|||
|
|||
// In the original pie label anticollision logic, the slots are distributed
|
|||
// from one labelDistance above to one labelDistance below the pie. In funnels
|
|||
// we don't want this.
|
|||
this.center[2] -= 2 * labelDistance; |
|||
|
|||
// Set the label position array for each point.
|
|||
while (i--) { |
|||
point = data[i]; |
|||
leftSide = point.half; |
|||
sign = leftSide ? 1 : -1; |
|||
y = point.plotY; |
|||
x = this.getX(y, leftSide); |
|||
|
|||
// set the anchor point for data labels
|
|||
point.labelPos = [ |
|||
0, // first break of connector
|
|||
y, // a/a
|
|||
x + (labelDistance - 5) * sign, // second break, right outside point shape
|
|||
y, // a/a
|
|||
x + labelDistance * sign, // landing point for connector
|
|||
y, // a/a
|
|||
leftSide ? 'right' : 'left', // alignment
|
|||
0 // center angle
|
|||
]; |
|||
} |
|||
|
|||
seriesTypes.pie.prototype.drawDataLabels.call(this); |
|||
} |
|||
|
|||
}); |
|||
|
|||
|
|||
}(Highcharts)); |
|||
@ -0,0 +1 @@ |
|||
(function(b){var k=b.seriesTypes,l=b.each;k.heatmap=b.extendClass(k.map,{colorKey:"z",useMapGeometry:!1,pointArrayMap:["y","z"],translate:function(){var c=this,b=c.options,i=Number.MAX_VALUE,j=Number.MIN_VALUE;c.generatePoints();l(c.data,function(a){var e=a.x,f=a.y,d=a.z,g=(b.colsize||1)/2,h=(b.rowsize||1)/2;a.path=["M",e-g,f-h,"L",e+g,f-h,"L",e+g,f+h,"L",e-g,f+h,"Z"];a.shapeType="path";a.shapeArgs={d:c.translatePath(a.path)};typeof d==="number"&&(d>j?j=d:d<i&&(i=d))});c.translateColors(i,j)},getBox:function(){}})})(Highcharts); |
|||
@ -0,0 +1,53 @@ |
|||
(function (Highcharts) { |
|||
var seriesTypes = Highcharts.seriesTypes, |
|||
each = Highcharts.each; |
|||
|
|||
seriesTypes.heatmap = Highcharts.extendClass(seriesTypes.map, { |
|||
colorKey: 'z', |
|||
useMapGeometry: false, |
|||
pointArrayMap: ['y', 'z'], |
|||
translate: function () { |
|||
var series = this, |
|||
options = series.options, |
|||
dataMin = Number.MAX_VALUE, |
|||
dataMax = Number.MIN_VALUE; |
|||
|
|||
series.generatePoints(); |
|||
|
|||
each(series.data, function (point) { |
|||
var x = point.x, |
|||
y = point.y, |
|||
value = point.z, |
|||
xPad = (options.colsize || 1) / 2, |
|||
yPad = (options.rowsize || 1) / 2; |
|||
|
|||
point.path = [ |
|||
'M', x - xPad, y - yPad, |
|||
'L', x + xPad, y - yPad, |
|||
'L', x + xPad, y + yPad, |
|||
'L', x - xPad, y + yPad, |
|||
'Z' |
|||
]; |
|||
|
|||
point.shapeType = 'path'; |
|||
point.shapeArgs = { |
|||
d: series.translatePath(point.path) |
|||
}; |
|||
|
|||
if (typeof value === 'number') { |
|||
if (value > dataMax) { |
|||
dataMax = value; |
|||
} else if (value < dataMin) { |
|||
dataMin = value; |
|||
} |
|||
} |
|||
}); |
|||
|
|||
series.translateColors(dataMin, dataMax); |
|||
}, |
|||
|
|||
getBox: function () {} |
|||
|
|||
}); |
|||
|
|||
}(Highcharts)); |
|||
@ -0,0 +1,27 @@ |
|||
/* |
|||
Map plugin v0.1 for Highcharts |
|||
|
|||
(c) 2011-2013 Torstein Hønsi |
|||
|
|||
License: www.highcharts.com/license |
|||
*/ |
|||
(function(g){function x(a,b,c){for(var d=4,e=[];d--;)e[d]=Math.round(b.rgba[d]+(a.rgba[d]-b.rgba[d])*(1-c));return"rgba("+e.join(",")+")"}var r=g.Axis,y=g.Chart,s=g.Point,z=g.Pointer,l=g.each,v=g.extend,p=g.merge,n=g.pick,A=g.numberFormat,B=g.getOptions(),k=g.seriesTypes,q=B.plotOptions,t=g.wrap,u=g.Color,w=function(){};B.mapNavigation={buttonOptions:{align:"right",verticalAlign:"bottom",x:0,width:18,height:18,style:{fontSize:"15px",fontWeight:"bold",textAlign:"center"}},buttons:{zoomIn:{onclick:function(){this.mapZoom(0.5)}, |
|||
text:"+",y:-32},zoomOut:{onclick:function(){this.mapZoom(2)},text:"-",y:0}}};g.splitPath=function(a){var b,a=a.replace(/([A-Za-z])/g," $1 "),a=a.replace(/^\s*/,"").replace(/\s*$/,""),a=a.split(/[ ,]+/);for(b=0;b<a.length;b++)/[a-zA-Z]/.test(a[b])||(a[b]=parseFloat(a[b]));return a};g.maps={};t(r.prototype,"getSeriesExtremes",function(a){var b=this.isXAxis,c,d,e=[];l(this.series,function(a,b){if(a.useMapGeometry)e[b]=a.xData,a.xData=[]});a.call(this);c=n(this.dataMin,Number.MAX_VALUE);d=n(this.dataMax, |
|||
Number.MIN_VALUE);l(this.series,function(a,i){if(a.useMapGeometry)c=Math.min(c,a[b?"minX":"minY"]),d=Math.max(d,a[b?"maxX":"maxY"]),a.xData=e[i]});this.dataMin=c;this.dataMax=d});t(r.prototype,"setAxisTranslation",function(a){var b=this.chart,c=b.plotWidth/b.plotHeight,d=this.isXAxis,e=b.xAxis[0];a.call(this);if(b.options.chart.type==="map"&&!d&&e.transA!==void 0)this.transA=e.transA=Math.min(this.transA,e.transA),a=(e.max-e.min)/(this.max-this.min),e=a>c?this:e,c=(e.max-e.min)*e.transA,e.minPixelPadding= |
|||
(e.len-c)/2});t(y.prototype,"render",function(a){var b=this,c=b.options.mapNavigation;a.call(b);b.renderMapNavigation();c.zoomOnDoubleClick&&g.addEvent(b.container,"dblclick",function(a){b.pointer.onContainerDblClick(a)});c.zoomOnMouseWheel&&g.addEvent(b.container,document.onmousewheel===void 0?"DOMMouseScroll":"mousewheel",function(a){b.pointer.onContainerMouseWheel(a)})});v(z.prototype,{onContainerDblClick:function(a){var b=this.chart,a=this.normalize(a);b.isInsidePlot(a.chartX-b.plotLeft,a.chartY- |
|||
b.plotTop)&&b.mapZoom(0.5,b.xAxis[0].toValue(a.chartX),b.yAxis[0].toValue(a.chartY))},onContainerMouseWheel:function(a){var b=this.chart,c,a=this.normalize(a);c=a.detail||-(a.wheelDelta/120);b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&b.mapZoom(c>0?2:0.5,b.xAxis[0].toValue(a.chartX),b.yAxis[0].toValue(a.chartY))}});t(z.prototype,"init",function(a,b,c){a.call(this,b,c);if(c.mapNavigation.enableTouchZoom)this.pinchX=this.pinchHor=this.pinchY=this.pinchVert=!0});v(y.prototype,{renderMapNavigation:function(){var a= |
|||
this,b=this.options.mapNavigation,c=b.buttons,d,e,f,i=function(){this.handler.call(a)};if(b.enableButtons)for(d in c)if(c.hasOwnProperty(d))f=p(b.buttonOptions,c[d]),e=a.renderer.button(f.text,0,0,i).attr({width:f.width,height:f.height}).css(f.style).add(),e.handler=f.onclick,e.align(v(f,{width:e.width,height:e.height}),null,"spacingBox")},fitToBox:function(a,b){l([["x","width"],["y","height"]],function(c){var d=c[0],c=c[1];a[d]+a[c]>b[d]+b[c]&&(a[c]>b[c]?(a[c]=b[c],a[d]=b[d]):a[d]=b[d]+b[c]-a[c]); |
|||
a[c]>b[c]&&(a[c]=b[c]);a[d]<b[d]&&(a[d]=b[d])});return a},mapZoom:function(a,b,c){if(!this.isMapZooming){var d=this,e=d.xAxis[0],f=e.max-e.min,i=n(b,e.min+f/2),b=f*a,f=d.yAxis[0],h=f.max-f.min,c=n(c,f.min+h/2);a*=h;i-=b/2;h=c-a/2;c=n(d.options.chart.animation,!0);b=d.fitToBox({x:i,y:h,width:b,height:a},{x:e.dataMin,y:f.dataMin,width:e.dataMax-e.dataMin,height:f.dataMax-f.dataMin});e.setExtremes(b.x,b.x+b.width,!1);f.setExtremes(b.y,b.y+b.height,!1);if(e=c?c.duration||500:0)d.isMapZooming=!0,setTimeout(function(){d.isMapZooming= |
|||
!1},e);d.redraw()}}});q.map=p(q.scatter,{animation:!1,nullColor:"#F8F8F8",borderColor:"silver",borderWidth:1,marker:null,stickyTracking:!1,dataLabels:{verticalAlign:"middle"},turboThreshold:0,tooltip:{followPointer:!0,pointFormat:"{point.name}: {point.y}<br/>"},states:{normal:{animation:!0}}});r=g.extendClass(s,{applyOptions:function(a,b){var c=s.prototype.applyOptions.call(this,a,b);if(c.path&&typeof c.path==="string")c.path=c.options.path=g.splitPath(c.path);return c},onMouseOver:function(){clearTimeout(this.colorInterval); |
|||
s.prototype.onMouseOver.call(this)},onMouseOut:function(){var a=this,b=+new Date,c=u(a.options.color),d=u(a.pointAttr.hover.fill),e=a.series.options.states.normal.animation,f=e&&(e.duration||500);if(f&&c.rgba.length===4&&d.rgba.length===4)delete a.pointAttr[""].fill,clearTimeout(a.colorInterval),a.colorInterval=setInterval(function(){var e=(new Date-b)/f,h=a.graphic;e>1&&(e=1);h&&h.attr("fill",x(d,c,e));e>=1&&clearTimeout(a.colorInterval)},13);s.prototype.onMouseOut.call(a)}});k.map=g.extendClass(k.scatter, |
|||
{type:"map",pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},colorKey:"y",pointClass:r,trackerGroups:["group","markerGroup","dataLabelsGroup"],getSymbol:w,supportsDrilldown:!0,getExtremesFromAll:!0,useMapGeometry:!0,init:function(a){var b=this,c=a.options.legend.valueDecimals,d=[],e,f,i,h,j,o,m;o=a.options.legend.layout==="horizontal";g.Series.prototype.init.apply(this,arguments);j=b.options.colorRange;if(h=b.options.valueRanges)l(h,function(a){f=a.from;i=a.to;e= |
|||
"";f===void 0?e="< ":i===void 0&&(e="> ");f!==void 0&&(e+=A(f,c));f!==void 0&&i!==void 0&&(e+=" - ");i!==void 0&&(e+=A(i,c));d.push(g.extend({chart:b.chart,name:e,options:{},drawLegendSymbol:k.area.prototype.drawLegendSymbol,visible:!0,setState:function(){},setVisible:function(){}},a))}),b.legendItems=d;else if(j)f=j.from,i=j.to,h=j.fromLabel,j=j.toLabel,m=o?[0,0,1,0]:[0,1,0,0],o||(o=h,h=j,j=o),o={linearGradient:{x1:m[0],y1:m[1],x2:m[2],y2:m[3]},stops:[[0,f],[1,i]]},d=[{chart:b.chart,options:{},fromLabel:h, |
|||
toLabel:j,color:o,drawLegendSymbol:this.drawLegendSymbolGradient,visible:!0,setState:function(){},setVisible:function(){}}],b.legendItems=d},drawLegendSymbol:k.area.prototype.drawLegendSymbol,drawLegendSymbolGradient:function(a,b){var c=a.options.symbolPadding,d=n(a.options.padding,8),e,f,i=this.chart.renderer.fontMetrics(a.options.itemStyle.fontSize).h,h=a.options.layout==="horizontal",j;j=n(a.options.rectangleLength,200);h?(e=-(c/2),f=0):(e=-j+a.baseline-c/2,f=d+i);b.fromText=this.chart.renderer.text(b.fromLabel, |
|||
f,e).attr({zIndex:2}).add(b.legendGroup);f=b.fromText.getBBox();b.legendSymbol=this.chart.renderer.rect(h?f.x+f.width+c:f.x-i-c,f.y,h?j:i,h?i:j,2).attr({zIndex:1}).add(b.legendGroup);j=b.legendSymbol.getBBox();b.toText=this.chart.renderer.text(b.toLabel,j.x+j.width+c,h?e:j.y+j.height-c).attr({zIndex:2}).add(b.legendGroup);e=b.toText.getBBox();h?(a.offsetWidth=f.width+j.width+e.width+c*2+d,a.itemY=i+d):(a.offsetWidth=Math.max(f.width,e.width)+c+j.width+d,a.itemY=j.height+d,a.itemX=c)},getBox:function(a){var b= |
|||
Number.MIN_VALUE,c=Number.MAX_VALUE,d=Number.MIN_VALUE,e=Number.MAX_VALUE;l(a||this.options.data,function(a){for(var i=a.path,h=i.length,j=!1,g=Number.MIN_VALUE,m=Number.MAX_VALUE,k=Number.MIN_VALUE,l=Number.MAX_VALUE;h--;)typeof i[h]==="number"&&!isNaN(i[h])&&(j?(g=Math.max(g,i[h]),m=Math.min(m,i[h])):(k=Math.max(k,i[h]),l=Math.min(l,i[h])),j=!j);a._maxX=g;a._minX=m;a._maxY=k;a._minY=l;b=Math.max(b,g);c=Math.min(c,m);d=Math.max(d,k);e=Math.min(e,l)});this.minY=e;this.maxY=d;this.minX=c;this.maxX= |
|||
b},translatePath:function(a){var b=!1,c=this.xAxis,d=this.yAxis,e,a=[].concat(a);for(e=a.length;e--;)typeof a[e]==="number"&&(a[e]=b?Math.round(c.translate(a[e])):Math.round(d.len-d.translate(a[e])),b=!b);return a},setData:function(){g.Series.prototype.setData.apply(this,arguments);this.getBox()},translate:function(){var a=this,b=Number.MAX_VALUE,c=Number.MIN_VALUE;a.generatePoints();l(a.data,function(d){d.shapeType="path";d.shapeArgs={d:a.translatePath(d.path)};if(typeof d.y==="number")if(d.y>c)c= |
|||
d.y;else if(d.y<b)b=d.y});a.translateColors(b,c)},translateColors:function(a,b){var c=this.options,d=c.valueRanges,e=c.colorRange,f=this.colorKey,i,h;e&&(i=u(e.from),h=u(e.to));l(this.data,function(g){var k=g[f],m,l,n;if(d)for(n=d.length;n--;){if(m=d[n],i=m.from,h=m.to,(i===void 0||k>=i)&&(h===void 0||k<=h)){l=m.color;break}}else e&&k!==void 0&&(m=1-(b-k)/(b-a),l=k===null?c.nullColor:x(i,h,m));if(l)g.color=null,g.options.color=l})},drawGraph:w,drawDataLabels:w,drawPoints:function(){var a=this.xAxis, |
|||
b=this.yAxis,c=this.colorKey;l(this.data,function(a){a.plotY=1;if(a[c]===null)a[c]=0,a.isNull=!0});k.column.prototype.drawPoints.apply(this);l(this.data,function(d){var e=d.dataLabels,f=a.toPixels(d._minX,!0),g=a.toPixels(d._maxX,!0),h=b.toPixels(d._minY,!0),j=b.toPixels(d._maxY,!0);d.plotX=Math.round(f+(g-f)*n(e&&e.anchorX,0.5));d.plotY=Math.round(h+(j-h)*n(e&&e.anchorY,0.5));d.isNull&&(d[c]=null)});g.Series.prototype.drawDataLabels.call(this)},animateDrilldown:function(a){var b=this.chart.plotBox, |
|||
c=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1],d=c.bBox,e=this.chart.options.drilldown.animation;if(!a)a=Math.min(d.width/b.width,d.height/b.height),c.shapeArgs={scaleX:a,scaleY:a,translateX:d.x,translateY:d.y},l(this.points,function(a){a.graphic.attr(c.shapeArgs).animate({scaleX:1,scaleY:1,translateX:0,translateY:0},e)}),delete this.animate},animateDrillupFrom:function(a){k.column.prototype.animateDrillupFrom.call(this,a)},animateDrillupTo:function(a){k.column.prototype.animateDrillupTo.call(this, |
|||
a)}});q.mapline=p(q.map,{lineWidth:1,backgroundColor:"none"});k.mapline=g.extendClass(k.map,{type:"mapline",pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth",fill:"backgroundColor"},drawLegendSymbol:k.line.prototype.drawLegendSymbol});q.mappoint=p(q.scatter,{dataLabels:{enabled:!0,format:"{point.name}",color:"black",style:{textShadow:"0 0 5px white"}}});k.mappoint=g.extendClass(k.scatter,{type:"mappoint"});g.Map=function(a,b){var c={endOnTick:!1,gridLineWidth:0,labels:{enabled:!1},lineWidth:0, |
|||
minPadding:0,maxPadding:0,startOnTick:!1,tickWidth:0,title:null},d;d=a.series;a.series=null;a=p({chart:{type:"map",panning:"xy"},xAxis:c,yAxis:p(c,{reversed:!0})},a,{chart:{inverted:!1}});a.series=d;return new g.Chart(a,b)}})(Highcharts); |
|||
@ -0,0 +1,12 @@ |
|||
/* |
|||
Highcharts JS v3.0.6 (2013-10-04) |
|||
Plugin for displaying a message when there is no data visible in chart. |
|||
|
|||
(c) 2010-2013 Highsoft AS |
|||
Author: Øystein Moseng |
|||
|
|||
License: www.highcharts.com/license |
|||
*/ |
|||
(function(c){function f(){return!!this.points.length}function g(){this.hasData()?this.hideNoData():this.showNoData()}var d=c.seriesTypes,e=c.Chart.prototype,h=c.getOptions(),i=c.extend;i(h.lang,{noData:"No data to display"});h.noData={position:{x:0,y:0,align:"center",verticalAlign:"middle"},attr:{},style:{fontWeight:"bold",fontSize:"12px",color:"#60606a"}};d.pie.prototype.hasData=f;if(d.gauge)d.gauge.prototype.hasData=f;if(d.waterfall)d.waterfall.prototype.hasData=f;c.Series.prototype.hasData=function(){return this.dataMax!== |
|||
void 0&&this.dataMin!==void 0};e.showNoData=function(a){var b=this.options,a=a||b.lang.noData,b=b.noData;if(!this.noDataLabel)this.noDataLabel=this.renderer.label(a,0,0,null,null,null,null,null,"no-data").attr(b.attr).css(b.style).add(),this.noDataLabel.align(i(this.noDataLabel.getBBox(),b.position),!1,"plotBox")};e.hideNoData=function(){if(this.noDataLabel)this.noDataLabel=this.noDataLabel.destroy()};e.hasData=function(){for(var a=this.series,b=a.length;b--;)if(a[b].hasData()&&!a[b].options.isInternal)return!0; |
|||
return!1};e.callbacks.push(function(a){c.addEvent(a,"load",g);c.addEvent(a,"redraw",g)})})(Highcharts); |
|||
@ -0,0 +1,128 @@ |
|||
/** |
|||
* @license Highcharts JS v3.0.6 (2013-10-04) |
|||
* Plugin for displaying a message when there is no data visible in chart. |
|||
* |
|||
* (c) 2010-2013 Highsoft AS |
|||
* Author: Øystein Moseng |
|||
* |
|||
* License: www.highcharts.com/license |
|||
*/ |
|||
|
|||
(function (H) { // docs
|
|||
|
|||
var seriesTypes = H.seriesTypes, |
|||
chartPrototype = H.Chart.prototype, |
|||
defaultOptions = H.getOptions(), |
|||
extend = H.extend; |
|||
|
|||
// Add language option
|
|||
extend(defaultOptions.lang, { |
|||
noData: 'No data to display' |
|||
}); |
|||
|
|||
// Add default display options for message
|
|||
defaultOptions.noData = { |
|||
position: { |
|||
x: 0, |
|||
y: 0, |
|||
align: 'center', |
|||
verticalAlign: 'middle' |
|||
}, |
|||
attr: { |
|||
}, |
|||
style: { |
|||
fontWeight: 'bold', |
|||
fontSize: '12px', |
|||
color: '#60606a' |
|||
} |
|||
}; |
|||
|
|||
/** |
|||
* Define hasData functions for series. These return true if there are data points on this series within the plot area |
|||
*/ |
|||
function hasDataPie() { |
|||
return !!this.points.length; /* != 0 */ |
|||
} |
|||
|
|||
seriesTypes.pie.prototype.hasData = hasDataPie; |
|||
|
|||
if (seriesTypes.gauge) { |
|||
seriesTypes.gauge.prototype.hasData = hasDataPie; |
|||
} |
|||
|
|||
if (seriesTypes.waterfall) { |
|||
seriesTypes.waterfall.prototype.hasData = hasDataPie; |
|||
} |
|||
|
|||
H.Series.prototype.hasData = function () { |
|||
return this.dataMax !== undefined && this.dataMin !== undefined; |
|||
}; |
|||
|
|||
/** |
|||
* Display a no-data message. |
|||
* |
|||
* @param {String} str An optional message to show in place of the default one |
|||
*/ |
|||
chartPrototype.showNoData = function (str) { |
|||
var chart = this, |
|||
options = chart.options, |
|||
text = str || options.lang.noData, |
|||
noDataOptions = options.noData; |
|||
|
|||
if (!chart.noDataLabel) { |
|||
chart.noDataLabel = chart.renderer.label(text, 0, 0, null, null, null, null, null, 'no-data') |
|||
.attr(noDataOptions.attr) |
|||
.css(noDataOptions.style) |
|||
.add(); |
|||
chart.noDataLabel.align(extend(chart.noDataLabel.getBBox(), noDataOptions.position), false, 'plotBox'); |
|||
} |
|||
}; |
|||
|
|||
/** |
|||
* Hide no-data message |
|||
*/ |
|||
chartPrototype.hideNoData = function () { |
|||
var chart = this; |
|||
if (chart.noDataLabel) { |
|||
chart.noDataLabel = chart.noDataLabel.destroy(); |
|||
} |
|||
}; |
|||
|
|||
/** |
|||
* Returns true if there are data points within the plot area now |
|||
*/ |
|||
chartPrototype.hasData = function () { |
|||
var chart = this, |
|||
series = chart.series, |
|||
i = series.length; |
|||
|
|||
while (i--) { |
|||
if (series[i].hasData() && !series[i].options.isInternal) { |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
return false; |
|||
}; |
|||
|
|||
/** |
|||
* Show no-data message if there is no data in sight. Otherwise, hide it. |
|||
*/ |
|||
function handleNoData() { |
|||
var chart = this; |
|||
if (chart.hasData()) { |
|||
chart.hideNoData(); |
|||
} else { |
|||
chart.showNoData(); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Add event listener to handle automatic display of no-data message |
|||
*/ |
|||
chartPrototype.callbacks.push(function (chart) { |
|||
H.addEvent(chart, 'load', handleNoData); |
|||
H.addEvent(chart, 'redraw', handleNoData); |
|||
}); |
|||
|
|||
}(Highcharts)); |
|||
@ -0,0 +1,254 @@ |
|||
/** |
|||
* Dark blue theme for Highcharts JS |
|||
* @author Torstein Hønsi |
|||
*/ |
|||
|
|||
Highcharts.theme = { |
|||
colors: ["#DDDF0D", "#55BF3B", "#DF5353", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee", |
|||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"], |
|||
chart: { |
|||
backgroundColor: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 }, |
|||
stops: [ |
|||
[0, 'rgb(48, 48, 96)'], |
|||
[1, 'rgb(0, 0, 0)'] |
|||
] |
|||
}, |
|||
borderColor: '#000000', |
|||
borderWidth: 2, |
|||
className: 'dark-container', |
|||
plotBackgroundColor: 'rgba(255, 255, 255, .1)', |
|||
plotBorderColor: '#CCCCCC', |
|||
plotBorderWidth: 1 |
|||
}, |
|||
title: { |
|||
style: { |
|||
color: '#C0C0C0', |
|||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif' |
|||
} |
|||
}, |
|||
subtitle: { |
|||
style: { |
|||
color: '#666666', |
|||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif' |
|||
} |
|||
}, |
|||
xAxis: { |
|||
gridLineColor: '#333333', |
|||
gridLineWidth: 1, |
|||
labels: { |
|||
style: { |
|||
color: '#A0A0A0' |
|||
} |
|||
}, |
|||
lineColor: '#A0A0A0', |
|||
tickColor: '#A0A0A0', |
|||
title: { |
|||
style: { |
|||
color: '#CCC', |
|||
fontWeight: 'bold', |
|||
fontSize: '12px', |
|||
fontFamily: 'Trebuchet MS, Verdana, sans-serif' |
|||
|
|||
} |
|||
} |
|||
}, |
|||
yAxis: { |
|||
gridLineColor: '#333333', |
|||
labels: { |
|||
style: { |
|||
color: '#A0A0A0' |
|||
} |
|||
}, |
|||
lineColor: '#A0A0A0', |
|||
minorTickInterval: null, |
|||
tickColor: '#A0A0A0', |
|||
tickWidth: 1, |
|||
title: { |
|||
style: { |
|||
color: '#CCC', |
|||
fontWeight: 'bold', |
|||
fontSize: '12px', |
|||
fontFamily: 'Trebuchet MS, Verdana, sans-serif' |
|||
} |
|||
} |
|||
}, |
|||
tooltip: { |
|||
backgroundColor: 'rgba(0, 0, 0, 0.75)', |
|||
style: { |
|||
color: '#F0F0F0' |
|||
} |
|||
}, |
|||
toolbar: { |
|||
itemStyle: { |
|||
color: 'silver' |
|||
} |
|||
}, |
|||
plotOptions: { |
|||
line: { |
|||
dataLabels: { |
|||
color: '#CCC' |
|||
}, |
|||
marker: { |
|||
lineColor: '#333' |
|||
} |
|||
}, |
|||
spline: { |
|||
marker: { |
|||
lineColor: '#333' |
|||
} |
|||
}, |
|||
scatter: { |
|||
marker: { |
|||
lineColor: '#333' |
|||
} |
|||
}, |
|||
candlestick: { |
|||
lineColor: 'white' |
|||
} |
|||
}, |
|||
legend: { |
|||
itemStyle: { |
|||
font: '9pt Trebuchet MS, Verdana, sans-serif', |
|||
color: '#A0A0A0' |
|||
}, |
|||
itemHoverStyle: { |
|||
color: '#FFF' |
|||
}, |
|||
itemHiddenStyle: { |
|||
color: '#444' |
|||
} |
|||
}, |
|||
credits: { |
|||
style: { |
|||
color: '#666' |
|||
} |
|||
}, |
|||
labels: { |
|||
style: { |
|||
color: '#CCC' |
|||
} |
|||
}, |
|||
|
|||
navigation: { |
|||
buttonOptions: { |
|||
symbolStroke: '#DDDDDD', |
|||
hoverSymbolStroke: '#FFFFFF', |
|||
theme: { |
|||
fill: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#606060'], |
|||
[0.6, '#333333'] |
|||
] |
|||
}, |
|||
stroke: '#000000' |
|||
} |
|||
} |
|||
}, |
|||
|
|||
// scroll charts
|
|||
rangeSelector: { |
|||
buttonTheme: { |
|||
fill: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#888'], |
|||
[0.6, '#555'] |
|||
] |
|||
}, |
|||
stroke: '#000000', |
|||
style: { |
|||
color: '#CCC', |
|||
fontWeight: 'bold' |
|||
}, |
|||
states: { |
|||
hover: { |
|||
fill: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#BBB'], |
|||
[0.6, '#888'] |
|||
] |
|||
}, |
|||
stroke: '#000000', |
|||
style: { |
|||
color: 'white' |
|||
} |
|||
}, |
|||
select: { |
|||
fill: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.1, '#000'], |
|||
[0.3, '#333'] |
|||
] |
|||
}, |
|||
stroke: '#000000', |
|||
style: { |
|||
color: 'yellow' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
inputStyle: { |
|||
backgroundColor: '#333', |
|||
color: 'silver' |
|||
}, |
|||
labelStyle: { |
|||
color: 'silver' |
|||
} |
|||
}, |
|||
|
|||
navigator: { |
|||
handles: { |
|||
backgroundColor: '#666', |
|||
borderColor: '#AAA' |
|||
}, |
|||
outlineColor: '#CCC', |
|||
maskFill: 'rgba(16, 16, 16, 0.5)', |
|||
series: { |
|||
color: '#7798BF', |
|||
lineColor: '#A6C7ED' |
|||
} |
|||
}, |
|||
|
|||
scrollbar: { |
|||
barBackgroundColor: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#888'], |
|||
[0.6, '#555'] |
|||
] |
|||
}, |
|||
barBorderColor: '#CCC', |
|||
buttonArrowColor: '#CCC', |
|||
buttonBackgroundColor: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#888'], |
|||
[0.6, '#555'] |
|||
] |
|||
}, |
|||
buttonBorderColor: '#CCC', |
|||
rifleColor: '#FFF', |
|||
trackBackgroundColor: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0, '#000'], |
|||
[1, '#333'] |
|||
] |
|||
}, |
|||
trackBorderColor: '#666' |
|||
}, |
|||
|
|||
// special colors for some of the
|
|||
legendBackgroundColor: 'rgba(0, 0, 0, 0.5)', |
|||
legendBackgroundColorSolid: 'rgb(35, 35, 70)', |
|||
dataLabelsColor: '#444', |
|||
textColor: '#C0C0C0', |
|||
maskColor: 'rgba(255,255,255,0.3)' |
|||
}; |
|||
|
|||
// Apply the theme
|
|||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme); |
|||
@ -0,0 +1,255 @@ |
|||
/** |
|||
* Dark blue theme for Highcharts JS |
|||
* @author Torstein Hønsi |
|||
*/ |
|||
|
|||
Highcharts.theme = { |
|||
colors: ["#DDDF0D", "#55BF3B", "#DF5353", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee", |
|||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"], |
|||
chart: { |
|||
backgroundColor: { |
|||
linearGradient: [0, 0, 250, 500], |
|||
stops: [ |
|||
[0, 'rgb(48, 96, 48)'], |
|||
[1, 'rgb(0, 0, 0)'] |
|||
] |
|||
}, |
|||
borderColor: '#000000', |
|||
borderWidth: 2, |
|||
className: 'dark-container', |
|||
plotBackgroundColor: 'rgba(255, 255, 255, .1)', |
|||
plotBorderColor: '#CCCCCC', |
|||
plotBorderWidth: 1 |
|||
}, |
|||
title: { |
|||
style: { |
|||
color: '#C0C0C0', |
|||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif' |
|||
} |
|||
}, |
|||
subtitle: { |
|||
style: { |
|||
color: '#666666', |
|||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif' |
|||
} |
|||
}, |
|||
xAxis: { |
|||
gridLineColor: '#333333', |
|||
gridLineWidth: 1, |
|||
labels: { |
|||
style: { |
|||
color: '#A0A0A0' |
|||
} |
|||
}, |
|||
lineColor: '#A0A0A0', |
|||
tickColor: '#A0A0A0', |
|||
title: { |
|||
style: { |
|||
color: '#CCC', |
|||
fontWeight: 'bold', |
|||
fontSize: '12px', |
|||
fontFamily: 'Trebuchet MS, Verdana, sans-serif' |
|||
|
|||
} |
|||
} |
|||
}, |
|||
yAxis: { |
|||
gridLineColor: '#333333', |
|||
labels: { |
|||
style: { |
|||
color: '#A0A0A0' |
|||
} |
|||
}, |
|||
lineColor: '#A0A0A0', |
|||
minorTickInterval: null, |
|||
tickColor: '#A0A0A0', |
|||
tickWidth: 1, |
|||
title: { |
|||
style: { |
|||
color: '#CCC', |
|||
fontWeight: 'bold', |
|||
fontSize: '12px', |
|||
fontFamily: 'Trebuchet MS, Verdana, sans-serif' |
|||
} |
|||
} |
|||
}, |
|||
tooltip: { |
|||
backgroundColor: 'rgba(0, 0, 0, 0.75)', |
|||
style: { |
|||
color: '#F0F0F0' |
|||
} |
|||
}, |
|||
toolbar: { |
|||
itemStyle: { |
|||
color: 'silver' |
|||
} |
|||
}, |
|||
plotOptions: { |
|||
line: { |
|||
dataLabels: { |
|||
color: '#CCC' |
|||
}, |
|||
marker: { |
|||
lineColor: '#333' |
|||
} |
|||
}, |
|||
spline: { |
|||
marker: { |
|||
lineColor: '#333' |
|||
} |
|||
}, |
|||
scatter: { |
|||
marker: { |
|||
lineColor: '#333' |
|||
} |
|||
}, |
|||
candlestick: { |
|||
lineColor: 'white' |
|||
} |
|||
}, |
|||
legend: { |
|||
itemStyle: { |
|||
font: '9pt Trebuchet MS, Verdana, sans-serif', |
|||
color: '#A0A0A0' |
|||
}, |
|||
itemHoverStyle: { |
|||
color: '#FFF' |
|||
}, |
|||
itemHiddenStyle: { |
|||
color: '#444' |
|||
} |
|||
}, |
|||
credits: { |
|||
style: { |
|||
color: '#666' |
|||
} |
|||
}, |
|||
labels: { |
|||
style: { |
|||
color: '#CCC' |
|||
} |
|||
}, |
|||
|
|||
|
|||
navigation: { |
|||
buttonOptions: { |
|||
symbolStroke: '#DDDDDD', |
|||
hoverSymbolStroke: '#FFFFFF', |
|||
theme: { |
|||
fill: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#606060'], |
|||
[0.6, '#333333'] |
|||
] |
|||
}, |
|||
stroke: '#000000' |
|||
} |
|||
} |
|||
}, |
|||
|
|||
// scroll charts
|
|||
rangeSelector: { |
|||
buttonTheme: { |
|||
fill: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#888'], |
|||
[0.6, '#555'] |
|||
] |
|||
}, |
|||
stroke: '#000000', |
|||
style: { |
|||
color: '#CCC', |
|||
fontWeight: 'bold' |
|||
}, |
|||
states: { |
|||
hover: { |
|||
fill: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#BBB'], |
|||
[0.6, '#888'] |
|||
] |
|||
}, |
|||
stroke: '#000000', |
|||
style: { |
|||
color: 'white' |
|||
} |
|||
}, |
|||
select: { |
|||
fill: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.1, '#000'], |
|||
[0.3, '#333'] |
|||
] |
|||
}, |
|||
stroke: '#000000', |
|||
style: { |
|||
color: 'yellow' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
inputStyle: { |
|||
backgroundColor: '#333', |
|||
color: 'silver' |
|||
}, |
|||
labelStyle: { |
|||
color: 'silver' |
|||
} |
|||
}, |
|||
|
|||
navigator: { |
|||
handles: { |
|||
backgroundColor: '#666', |
|||
borderColor: '#AAA' |
|||
}, |
|||
outlineColor: '#CCC', |
|||
maskFill: 'rgba(16, 16, 16, 0.5)', |
|||
series: { |
|||
color: '#7798BF', |
|||
lineColor: '#A6C7ED' |
|||
} |
|||
}, |
|||
|
|||
scrollbar: { |
|||
barBackgroundColor: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#888'], |
|||
[0.6, '#555'] |
|||
] |
|||
}, |
|||
barBorderColor: '#CCC', |
|||
buttonArrowColor: '#CCC', |
|||
buttonBackgroundColor: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#888'], |
|||
[0.6, '#555'] |
|||
] |
|||
}, |
|||
buttonBorderColor: '#CCC', |
|||
rifleColor: '#FFF', |
|||
trackBackgroundColor: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0, '#000'], |
|||
[1, '#333'] |
|||
] |
|||
}, |
|||
trackBorderColor: '#666' |
|||
}, |
|||
|
|||
// special colors for some of the
|
|||
legendBackgroundColor: 'rgba(0, 0, 0, 0.5)', |
|||
legendBackgroundColorSolid: 'rgb(35, 35, 70)', |
|||
dataLabelsColor: '#444', |
|||
textColor: '#C0C0C0', |
|||
maskColor: 'rgba(255,255,255,0.3)' |
|||
}; |
|||
|
|||
// Apply the theme
|
|||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme); |
|||
@ -0,0 +1,257 @@ |
|||
/** |
|||
* Gray theme for Highcharts JS |
|||
* @author Torstein Hønsi |
|||
*/ |
|||
|
|||
Highcharts.theme = { |
|||
colors: ["#DDDF0D", "#7798BF", "#55BF3B", "#DF5353", "#aaeeee", "#ff0066", "#eeaaee", |
|||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"], |
|||
chart: { |
|||
backgroundColor: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0, 'rgb(96, 96, 96)'], |
|||
[1, 'rgb(16, 16, 16)'] |
|||
] |
|||
}, |
|||
borderWidth: 0, |
|||
borderRadius: 15, |
|||
plotBackgroundColor: null, |
|||
plotShadow: false, |
|||
plotBorderWidth: 0 |
|||
}, |
|||
title: { |
|||
style: { |
|||
color: '#FFF', |
|||
font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' |
|||
} |
|||
}, |
|||
subtitle: { |
|||
style: { |
|||
color: '#DDD', |
|||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' |
|||
} |
|||
}, |
|||
xAxis: { |
|||
gridLineWidth: 0, |
|||
lineColor: '#999', |
|||
tickColor: '#999', |
|||
labels: { |
|||
style: { |
|||
color: '#999', |
|||
fontWeight: 'bold' |
|||
} |
|||
}, |
|||
title: { |
|||
style: { |
|||
color: '#AAA', |
|||
font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' |
|||
} |
|||
} |
|||
}, |
|||
yAxis: { |
|||
alternateGridColor: null, |
|||
minorTickInterval: null, |
|||
gridLineColor: 'rgba(255, 255, 255, .1)', |
|||
minorGridLineColor: 'rgba(255,255,255,0.07)', |
|||
lineWidth: 0, |
|||
tickWidth: 0, |
|||
labels: { |
|||
style: { |
|||
color: '#999', |
|||
fontWeight: 'bold' |
|||
} |
|||
}, |
|||
title: { |
|||
style: { |
|||
color: '#AAA', |
|||
font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' |
|||
} |
|||
} |
|||
}, |
|||
legend: { |
|||
itemStyle: { |
|||
color: '#CCC' |
|||
}, |
|||
itemHoverStyle: { |
|||
color: '#FFF' |
|||
}, |
|||
itemHiddenStyle: { |
|||
color: '#333' |
|||
} |
|||
}, |
|||
labels: { |
|||
style: { |
|||
color: '#CCC' |
|||
} |
|||
}, |
|||
tooltip: { |
|||
backgroundColor: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0, 'rgba(96, 96, 96, .8)'], |
|||
[1, 'rgba(16, 16, 16, .8)'] |
|||
] |
|||
}, |
|||
borderWidth: 0, |
|||
style: { |
|||
color: '#FFF' |
|||
} |
|||
}, |
|||
|
|||
|
|||
plotOptions: { |
|||
series: { |
|||
shadow: true |
|||
}, |
|||
line: { |
|||
dataLabels: { |
|||
color: '#CCC' |
|||
}, |
|||
marker: { |
|||
lineColor: '#333' |
|||
} |
|||
}, |
|||
spline: { |
|||
marker: { |
|||
lineColor: '#333' |
|||
} |
|||
}, |
|||
scatter: { |
|||
marker: { |
|||
lineColor: '#333' |
|||
} |
|||
}, |
|||
candlestick: { |
|||
lineColor: 'white' |
|||
} |
|||
}, |
|||
|
|||
toolbar: { |
|||
itemStyle: { |
|||
color: '#CCC' |
|||
} |
|||
}, |
|||
|
|||
navigation: { |
|||
buttonOptions: { |
|||
symbolStroke: '#DDDDDD', |
|||
hoverSymbolStroke: '#FFFFFF', |
|||
theme: { |
|||
fill: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#606060'], |
|||
[0.6, '#333333'] |
|||
] |
|||
}, |
|||
stroke: '#000000' |
|||
} |
|||
} |
|||
}, |
|||
|
|||
// scroll charts
|
|||
rangeSelector: { |
|||
buttonTheme: { |
|||
fill: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#888'], |
|||
[0.6, '#555'] |
|||
] |
|||
}, |
|||
stroke: '#000000', |
|||
style: { |
|||
color: '#CCC', |
|||
fontWeight: 'bold' |
|||
}, |
|||
states: { |
|||
hover: { |
|||
fill: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#BBB'], |
|||
[0.6, '#888'] |
|||
] |
|||
}, |
|||
stroke: '#000000', |
|||
style: { |
|||
color: 'white' |
|||
} |
|||
}, |
|||
select: { |
|||
fill: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.1, '#000'], |
|||
[0.3, '#333'] |
|||
] |
|||
}, |
|||
stroke: '#000000', |
|||
style: { |
|||
color: 'yellow' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
inputStyle: { |
|||
backgroundColor: '#333', |
|||
color: 'silver' |
|||
}, |
|||
labelStyle: { |
|||
color: 'silver' |
|||
} |
|||
}, |
|||
|
|||
navigator: { |
|||
handles: { |
|||
backgroundColor: '#666', |
|||
borderColor: '#AAA' |
|||
}, |
|||
outlineColor: '#CCC', |
|||
maskFill: 'rgba(16, 16, 16, 0.5)', |
|||
series: { |
|||
color: '#7798BF', |
|||
lineColor: '#A6C7ED' |
|||
} |
|||
}, |
|||
|
|||
scrollbar: { |
|||
barBackgroundColor: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#888'], |
|||
[0.6, '#555'] |
|||
] |
|||
}, |
|||
barBorderColor: '#CCC', |
|||
buttonArrowColor: '#CCC', |
|||
buttonBackgroundColor: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0.4, '#888'], |
|||
[0.6, '#555'] |
|||
] |
|||
}, |
|||
buttonBorderColor: '#CCC', |
|||
rifleColor: '#FFF', |
|||
trackBackgroundColor: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, |
|||
stops: [ |
|||
[0, '#000'], |
|||
[1, '#333'] |
|||
] |
|||
}, |
|||
trackBorderColor: '#666' |
|||
}, |
|||
|
|||
// special colors for some of the demo examples
|
|||
legendBackgroundColor: 'rgba(48, 48, 48, 0.8)', |
|||
legendBackgroundColorSolid: 'rgb(70, 70, 70)', |
|||
dataLabelsColor: '#444', |
|||
textColor: '#E0E0E0', |
|||
maskColor: 'rgba(255,255,255,0.3)' |
|||
}; |
|||
|
|||
// Apply the theme
|
|||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme); |
|||
@ -0,0 +1,103 @@ |
|||
/** |
|||
* Grid theme for Highcharts JS |
|||
* @author Torstein Hønsi |
|||
*/ |
|||
|
|||
Highcharts.theme = { |
|||
colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'], |
|||
chart: { |
|||
backgroundColor: { |
|||
linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 }, |
|||
stops: [ |
|||
[0, 'rgb(255, 255, 255)'], |
|||
[1, 'rgb(240, 240, 255)'] |
|||
] |
|||
}, |
|||
borderWidth: 2, |
|||
plotBackgroundColor: 'rgba(255, 255, 255, .9)', |
|||
plotShadow: true, |
|||
plotBorderWidth: 1 |
|||
}, |
|||
title: { |
|||
style: { |
|||
color: '#000', |
|||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif' |
|||
} |
|||
}, |
|||
subtitle: { |
|||
style: { |
|||
color: '#666666', |
|||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif' |
|||
} |
|||
}, |
|||
xAxis: { |
|||
gridLineWidth: 1, |
|||
lineColor: '#000', |
|||
tickColor: '#000', |
|||
labels: { |
|||
style: { |
|||
color: '#000', |
|||
font: '11px Trebuchet MS, Verdana, sans-serif' |
|||
} |
|||
}, |
|||
title: { |
|||
style: { |
|||
color: '#333', |
|||
fontWeight: 'bold', |
|||
fontSize: '12px', |
|||
fontFamily: 'Trebuchet MS, Verdana, sans-serif' |
|||
|
|||
} |
|||
} |
|||
}, |
|||
yAxis: { |
|||
minorTickInterval: 'auto', |
|||
lineColor: '#000', |
|||
lineWidth: 1, |
|||
tickWidth: 1, |
|||
tickColor: '#000', |
|||
labels: { |
|||
style: { |
|||
color: '#000', |
|||
font: '11px Trebuchet MS, Verdana, sans-serif' |
|||
} |
|||
}, |
|||
title: { |
|||
style: { |
|||
color: '#333', |
|||
fontWeight: 'bold', |
|||
fontSize: '12px', |
|||
fontFamily: 'Trebuchet MS, Verdana, sans-serif' |
|||
} |
|||
} |
|||
}, |
|||
legend: { |
|||
itemStyle: { |
|||
font: '9pt Trebuchet MS, Verdana, sans-serif', |
|||
color: 'black' |
|||
|
|||
}, |
|||
itemHoverStyle: { |
|||
color: '#039' |
|||
}, |
|||
itemHiddenStyle: { |
|||
color: 'gray' |
|||
} |
|||
}, |
|||
labels: { |
|||
style: { |
|||
color: '#99b' |
|||
} |
|||
}, |
|||
|
|||
navigation: { |
|||
buttonOptions: { |
|||
theme: { |
|||
stroke: '#CCCCCC' |
|||
} |
|||
} |
|||
} |
|||
}; |
|||
|
|||
// Apply the theme
|
|||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme); |
|||
@ -0,0 +1,89 @@ |
|||
/** |
|||
* Skies theme for Highcharts JS |
|||
* @author Torstein Hønsi |
|||
*/ |
|||
|
|||
Highcharts.theme = { |
|||
colors: ["#514F78", "#42A07B", "#9B5E4A", "#72727F", "#1F949A", "#82914E", "#86777F", "#42A07B"], |
|||
chart: { |
|||
className: 'skies', |
|||
borderWidth: 0, |
|||
plotShadow: true, |
|||
plotBackgroundImage: 'http://www.highcharts.com/demo/gfx/skies.jpg', |
|||
plotBackgroundColor: { |
|||
linearGradient: [0, 0, 250, 500], |
|||
stops: [ |
|||
[0, 'rgba(255, 255, 255, 1)'], |
|||
[1, 'rgba(255, 255, 255, 0)'] |
|||
] |
|||
}, |
|||
plotBorderWidth: 1 |
|||
}, |
|||
title: { |
|||
style: { |
|||
color: '#3E576F', |
|||
font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' |
|||
} |
|||
}, |
|||
subtitle: { |
|||
style: { |
|||
color: '#6D869F', |
|||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' |
|||
} |
|||
}, |
|||
xAxis: { |
|||
gridLineWidth: 0, |
|||
lineColor: '#C0D0E0', |
|||
tickColor: '#C0D0E0', |
|||
labels: { |
|||
style: { |
|||
color: '#666', |
|||
fontWeight: 'bold' |
|||
} |
|||
}, |
|||
title: { |
|||
style: { |
|||
color: '#666', |
|||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' |
|||
} |
|||
} |
|||
}, |
|||
yAxis: { |
|||
alternateGridColor: 'rgba(255, 255, 255, .5)', |
|||
lineColor: '#C0D0E0', |
|||
tickColor: '#C0D0E0', |
|||
tickWidth: 1, |
|||
labels: { |
|||
style: { |
|||
color: '#666', |
|||
fontWeight: 'bold' |
|||
} |
|||
}, |
|||
title: { |
|||
style: { |
|||
color: '#666', |
|||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' |
|||
} |
|||
} |
|||
}, |
|||
legend: { |
|||
itemStyle: { |
|||
font: '9pt Trebuchet MS, Verdana, sans-serif', |
|||
color: '#3E576F' |
|||
}, |
|||
itemHoverStyle: { |
|||
color: 'black' |
|||
}, |
|||
itemHiddenStyle: { |
|||
color: 'silver' |
|||
} |
|||
}, |
|||
labels: { |
|||
style: { |
|||
color: '#3E576F' |
|||
} |
|||
} |
|||
}; |
|||
|
|||
// Apply the theme
|
|||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme); |
|||
|
After Width: | Height: | Size: 9.6 KiB |
@ -0,0 +1,766 @@ |
|||
/*! |
|||
Video.js Default Styles (http://videojs.com) |
|||
Version 4.3.0 |
|||
Create your own skin at http://designer.videojs.com |
|||
*/ |
|||
/* SKIN |
|||
================================================================================ |
|||
The main class name for all skin-specific styles. To make your own skin, |
|||
replace all occurances of 'vjs-default-skin' with a new name. Then add your new |
|||
skin name to your video tag instead of the default skin. |
|||
e.g. <video class="video-js my-skin-name"> |
|||
*/ |
|||
.vjs-default-skin { |
|||
color: #cccccc; |
|||
} |
|||
/* Custom Icon Font |
|||
-------------------------------------------------------------------------------- |
|||
The control icons are from a custom font. Each icon corresponds to a character |
|||
(e.g. "\e001"). Font icons allow for easy scaling and coloring of icons. |
|||
*/ |
|||
@font-face { |
|||
font-family: 'VideoJS'; |
|||
src: url('font/vjs.eot'); |
|||
src: url('font/vjs.eot?#iefix') format('embedded-opentype'), url('font/vjs.woff') format('woff'), url('font/vjs.ttf') format('truetype'); |
|||
font-weight: normal; |
|||
font-style: normal; |
|||
} |
|||
/* Base UI Component Classes |
|||
-------------------------------------------------------------------------------- |
|||
*/ |
|||
/* Slider - used for Volume bar and Seek bar */ |
|||
.vjs-default-skin .vjs-slider { |
|||
/* Replace browser focus hightlight with handle highlight */ |
|||
outline: 0; |
|||
position: relative; |
|||
cursor: pointer; |
|||
padding: 0; |
|||
/* background-color-with-alpha */ |
|||
background-color: #333333; |
|||
background-color: rgba(51, 51, 51, 0.9); |
|||
} |
|||
.vjs-default-skin .vjs-slider:focus { |
|||
/* box-shadow */ |
|||
-webkit-box-shadow: 0 0 2em #ffffff; |
|||
-moz-box-shadow: 0 0 2em #ffffff; |
|||
box-shadow: 0 0 2em #ffffff; |
|||
} |
|||
.vjs-default-skin .vjs-slider-handle { |
|||
position: absolute; |
|||
/* Needed for IE6 */ |
|||
left: 0; |
|||
top: 0; |
|||
} |
|||
.vjs-default-skin .vjs-slider-handle:before { |
|||
content: "\e009"; |
|||
font-family: VideoJS; |
|||
font-size: 1em; |
|||
line-height: 1; |
|||
text-align: center; |
|||
text-shadow: 0em 0em 1em #fff; |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
/* Rotate the square icon to make a diamond */ |
|||
/* transform */ |
|||
-webkit-transform: rotate(-45deg); |
|||
-moz-transform: rotate(-45deg); |
|||
-ms-transform: rotate(-45deg); |
|||
-o-transform: rotate(-45deg); |
|||
transform: rotate(-45deg); |
|||
} |
|||
/* Control Bar |
|||
-------------------------------------------------------------------------------- |
|||
The default control bar that is a container for most of the controls. |
|||
*/ |
|||
.vjs-default-skin .vjs-control-bar { |
|||
/* Start hidden */ |
|||
display: none; |
|||
position: absolute; |
|||
/* Place control bar at the bottom of the player box/video. |
|||
If you want more margin below the control bar, add more height. */ |
|||
bottom: 0; |
|||
/* Use left/right to stretch to 100% width of player div */ |
|||
left: 0; |
|||
right: 0; |
|||
/* Height includes any margin you want above or below control items */ |
|||
height: 3.0em; |
|||
/* background-color-with-alpha */ |
|||
background-color: #07141e; |
|||
background-color: rgba(7, 20, 30, 0.7); |
|||
} |
|||
/* Show the control bar only once the video has started playing */ |
|||
.vjs-default-skin.vjs-has-started .vjs-control-bar { |
|||
display: block; |
|||
/* Visibility needed to make sure things hide in older browsers too. */ |
|||
|
|||
visibility: visible; |
|||
opacity: 1; |
|||
/* transition */ |
|||
-webkit-transition: visibility 0.1s, opacity 0.1s; |
|||
-moz-transition: visibility 0.1s, opacity 0.1s; |
|||
-o-transition: visibility 0.1s, opacity 0.1s; |
|||
transition: visibility 0.1s, opacity 0.1s; |
|||
} |
|||
/* Hide the control bar when the video is playing and the user is inactive */ |
|||
.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar { |
|||
display: block; |
|||
visibility: hidden; |
|||
opacity: 0; |
|||
/* transition */ |
|||
-webkit-transition: visibility 1s, opacity 1s; |
|||
-moz-transition: visibility 1s, opacity 1s; |
|||
-o-transition: visibility 1s, opacity 1s; |
|||
transition: visibility 1s, opacity 1s; |
|||
} |
|||
.vjs-default-skin.vjs-controls-disabled .vjs-control-bar { |
|||
display: none; |
|||
} |
|||
.vjs-default-skin.vjs-using-native-controls .vjs-control-bar { |
|||
display: none; |
|||
} |
|||
/* IE8 is flakey with fonts, and you have to change the actual content to force |
|||
fonts to show/hide properly. |
|||
- "\9" IE8 hack didn't work for this |
|||
- Found in XP IE8 from http://modern.ie. Does not show up in "IE8 mode" in IE9 |
|||
*/ |
|||
@media \0screen { |
|||
.vjs-default-skin.vjs-user-inactive.vjs-playing .vjs-control-bar :before { |
|||
content: ""; |
|||
} |
|||
} |
|||
/* General styles for individual controls. */ |
|||
.vjs-default-skin .vjs-control { |
|||
outline: none; |
|||
position: relative; |
|||
float: left; |
|||
text-align: center; |
|||
margin: 0; |
|||
padding: 0; |
|||
height: 3.0em; |
|||
width: 4em; |
|||
} |
|||
/* FontAwsome button icons */ |
|||
.vjs-default-skin .vjs-control:before { |
|||
font-family: VideoJS; |
|||
font-size: 1.5em; |
|||
line-height: 2; |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
width: 100%; |
|||
height: 100%; |
|||
text-align: center; |
|||
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5); |
|||
} |
|||
/* Replacement for focus outline */ |
|||
.vjs-default-skin .vjs-control:focus:before, |
|||
.vjs-default-skin .vjs-control:hover:before { |
|||
text-shadow: 0em 0em 1em #ffffff; |
|||
} |
|||
.vjs-default-skin .vjs-control:focus { |
|||
/* outline: 0; */ |
|||
/* keyboard-only users cannot see the focus on several of the UI elements when |
|||
this is set to 0 */ |
|||
|
|||
} |
|||
/* Hide control text visually, but have it available for screenreaders */ |
|||
.vjs-default-skin .vjs-control-text { |
|||
/* hide-visually */ |
|||
border: 0; |
|||
clip: rect(0 0 0 0); |
|||
height: 1px; |
|||
margin: -1px; |
|||
overflow: hidden; |
|||
padding: 0; |
|||
position: absolute; |
|||
width: 1px; |
|||
} |
|||
/* Play/Pause |
|||
-------------------------------------------------------------------------------- |
|||
*/ |
|||
.vjs-default-skin .vjs-play-control { |
|||
width: 5em; |
|||
cursor: pointer; |
|||
} |
|||
.vjs-default-skin .vjs-play-control:before { |
|||
content: "\e001"; |
|||
} |
|||
.vjs-default-skin.vjs-playing .vjs-play-control:before { |
|||
content: "\e002"; |
|||
} |
|||
/* Volume/Mute |
|||
-------------------------------------------------------------------------------- */ |
|||
.vjs-default-skin .vjs-mute-control, |
|||
.vjs-default-skin .vjs-volume-menu-button { |
|||
cursor: pointer; |
|||
float: right; |
|||
} |
|||
.vjs-default-skin .vjs-mute-control:before, |
|||
.vjs-default-skin .vjs-volume-menu-button:before { |
|||
content: "\e006"; |
|||
} |
|||
.vjs-default-skin .vjs-mute-control.vjs-vol-0:before, |
|||
.vjs-default-skin .vjs-volume-menu-button.vjs-vol-0:before { |
|||
content: "\e003"; |
|||
} |
|||
.vjs-default-skin .vjs-mute-control.vjs-vol-1:before, |
|||
.vjs-default-skin .vjs-volume-menu-button.vjs-vol-1:before { |
|||
content: "\e004"; |
|||
} |
|||
.vjs-default-skin .vjs-mute-control.vjs-vol-2:before, |
|||
.vjs-default-skin .vjs-volume-menu-button.vjs-vol-2:before { |
|||
content: "\e005"; |
|||
} |
|||
.vjs-default-skin .vjs-volume-control { |
|||
width: 5em; |
|||
float: right; |
|||
} |
|||
.vjs-default-skin .vjs-volume-bar { |
|||
width: 5em; |
|||
height: 0.6em; |
|||
margin: 1.1em auto 0; |
|||
} |
|||
.vjs-default-skin .vjs-volume-menu-button .vjs-menu-content { |
|||
height: 2.9em; |
|||
} |
|||
.vjs-default-skin .vjs-volume-level { |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
height: 0.5em; |
|||
background: #66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat; |
|||
} |
|||
.vjs-default-skin .vjs-volume-bar .vjs-volume-handle { |
|||
width: 0.5em; |
|||
height: 0.5em; |
|||
} |
|||
.vjs-default-skin .vjs-volume-handle:before { |
|||
font-size: 0.9em; |
|||
top: -0.2em; |
|||
left: -0.2em; |
|||
width: 1em; |
|||
height: 1em; |
|||
} |
|||
.vjs-default-skin .vjs-volume-menu-button .vjs-menu .vjs-menu-content { |
|||
width: 6em; |
|||
left: -4em; |
|||
} |
|||
/* Progress |
|||
-------------------------------------------------------------------------------- |
|||
*/ |
|||
.vjs-default-skin .vjs-progress-control { |
|||
position: absolute; |
|||
left: 0; |
|||
right: 0; |
|||
width: auto; |
|||
font-size: 0.3em; |
|||
height: 1em; |
|||
/* Set above the rest of the controls. */ |
|||
top: -1em; |
|||
/* Shrink the bar slower than it grows. */ |
|||
/* transition */ |
|||
-webkit-transition: all 0.4s; |
|||
-moz-transition: all 0.4s; |
|||
-o-transition: all 0.4s; |
|||
transition: all 0.4s; |
|||
} |
|||
/* On hover, make the progress bar grow to something that's more clickable. |
|||
This simply changes the overall font for the progress bar, and this |
|||
updates both the em-based widths and heights, as wells as the icon font */ |
|||
.vjs-default-skin:hover .vjs-progress-control { |
|||
font-size: .9em; |
|||
/* Even though we're not changing the top/height, we need to include them in |
|||
the transition so they're handled correctly. */ |
|||
|
|||
/* transition */ |
|||
-webkit-transition: all 0.2s; |
|||
-moz-transition: all 0.2s; |
|||
-o-transition: all 0.2s; |
|||
transition: all 0.2s; |
|||
} |
|||
/* Box containing play and load progresses. Also acts as seek scrubber. */ |
|||
.vjs-default-skin .vjs-progress-holder { |
|||
height: 100%; |
|||
} |
|||
/* Progress Bars */ |
|||
.vjs-default-skin .vjs-progress-holder .vjs-play-progress, |
|||
.vjs-default-skin .vjs-progress-holder .vjs-load-progress { |
|||
position: absolute; |
|||
display: block; |
|||
height: 100%; |
|||
margin: 0; |
|||
padding: 0; |
|||
/* Needed for IE6 */ |
|||
left: 0; |
|||
top: 0; |
|||
} |
|||
.vjs-default-skin .vjs-play-progress { |
|||
/* |
|||
Using a data URI to create the white diagonal lines with a transparent |
|||
background. Surprisingly works in IE8. |
|||
Created using http://www.patternify.com |
|||
Changing the first color value will change the bar color. |
|||
Also using a paralax effect to make the lines move backwards. |
|||
The -50% left position makes that happen. |
|||
*/ |
|||
|
|||
background: #66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat; |
|||
} |
|||
.vjs-default-skin .vjs-load-progress { |
|||
background: #646464 /* IE8- Fallback */; |
|||
background: rgba(255, 255, 255, 0.4); |
|||
} |
|||
.vjs-default-skin .vjs-seek-handle { |
|||
width: 1.5em; |
|||
height: 100%; |
|||
} |
|||
.vjs-default-skin .vjs-seek-handle:before { |
|||
padding-top: 0.1em /* Minor adjustment */; |
|||
} |
|||
/* Time Display |
|||
-------------------------------------------------------------------------------- |
|||
*/ |
|||
.vjs-default-skin .vjs-time-controls { |
|||
font-size: 1em; |
|||
/* Align vertically by making the line height the same as the control bar */ |
|||
line-height: 3em; |
|||
} |
|||
.vjs-default-skin .vjs-current-time { |
|||
float: left; |
|||
} |
|||
.vjs-default-skin .vjs-duration { |
|||
float: left; |
|||
} |
|||
/* Remaining time is in the HTML, but not included in default design */ |
|||
.vjs-default-skin .vjs-remaining-time { |
|||
display: none; |
|||
float: left; |
|||
} |
|||
.vjs-time-divider { |
|||
float: left; |
|||
line-height: 3em; |
|||
} |
|||
/* Fullscreen |
|||
-------------------------------------------------------------------------------- |
|||
*/ |
|||
.vjs-default-skin .vjs-fullscreen-control { |
|||
width: 3.8em; |
|||
cursor: pointer; |
|||
float: right; |
|||
} |
|||
.vjs-default-skin .vjs-fullscreen-control:before { |
|||
content: "\e000"; |
|||
} |
|||
/* Switch to the exit icon when the player is in fullscreen */ |
|||
.vjs-default-skin.vjs-fullscreen .vjs-fullscreen-control:before { |
|||
content: "\e00b"; |
|||
} |
|||
/* Big Play Button (play button at start) |
|||
-------------------------------------------------------------------------------- |
|||
Positioning of the play button in the center or other corners can be done more |
|||
easily in the skin designer. http://designer.videojs.com/ |
|||
*/ |
|||
.vjs-default-skin .vjs-big-play-button { |
|||
left: 0.5em; |
|||
top: 0.5em; |
|||
font-size: 3em; |
|||
display: block; |
|||
z-index: 2; |
|||
position: absolute; |
|||
width: 4em; |
|||
height: 2.6em; |
|||
text-align: center; |
|||
vertical-align: middle; |
|||
cursor: pointer; |
|||
opacity: 1; |
|||
/* Need a slightly gray bg so it can be seen on black backgrounds */ |
|||
/* background-color-with-alpha */ |
|||
background-color: #07141e; |
|||
background-color: rgba(7, 20, 30, 0.7); |
|||
border: 0.1em solid #3b4249; |
|||
/* border-radius */ |
|||
-webkit-border-radius: 0.8em; |
|||
-moz-border-radius: 0.8em; |
|||
border-radius: 0.8em; |
|||
/* box-shadow */ |
|||
-webkit-box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25); |
|||
-moz-box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25); |
|||
box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25); |
|||
/* transition */ |
|||
-webkit-transition: all 0.4s; |
|||
-moz-transition: all 0.4s; |
|||
-o-transition: all 0.4s; |
|||
transition: all 0.4s; |
|||
} |
|||
/* Optionally center */ |
|||
.vjs-default-skin.vjs-big-play-centered .vjs-big-play-button { |
|||
/* Center it horizontally */ |
|||
left: 50%; |
|||
margin-left: -2.1em; |
|||
/* Center it vertically */ |
|||
top: 50%; |
|||
margin-top: -1.4000000000000001em; |
|||
} |
|||
/* Hide if controls are disabled */ |
|||
.vjs-default-skin.vjs-controls-disabled .vjs-big-play-button { |
|||
display: none; |
|||
} |
|||
/* Hide when video starts playing */ |
|||
.vjs-default-skin.vjs-has-started .vjs-big-play-button { |
|||
display: none; |
|||
} |
|||
/* Hide on mobile devices. Remove when we stop using native controls |
|||
by default on mobile */ |
|||
.vjs-default-skin.vjs-using-native-controls .vjs-big-play-button { |
|||
display: none; |
|||
} |
|||
.vjs-default-skin:hover .vjs-big-play-button, |
|||
.vjs-default-skin .vjs-big-play-button:focus { |
|||
outline: 0; |
|||
border-color: #fff; |
|||
/* IE8 needs a non-glow hover state */ |
|||
background-color: #505050; |
|||
background-color: rgba(50, 50, 50, 0.75); |
|||
/* box-shadow */ |
|||
-webkit-box-shadow: 0 0 3em #ffffff; |
|||
-moz-box-shadow: 0 0 3em #ffffff; |
|||
box-shadow: 0 0 3em #ffffff; |
|||
/* transition */ |
|||
-webkit-transition: all 0s; |
|||
-moz-transition: all 0s; |
|||
-o-transition: all 0s; |
|||
transition: all 0s; |
|||
} |
|||
.vjs-default-skin .vjs-big-play-button:before { |
|||
content: "\e001"; |
|||
font-family: VideoJS; |
|||
/* In order to center the play icon vertically we need to set the line height |
|||
to the same as the button height */ |
|||
|
|||
line-height: 2.6em; |
|||
text-shadow: 0.05em 0.05em 0.1em #000; |
|||
text-align: center /* Needed for IE8 */; |
|||
position: absolute; |
|||
left: 0; |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
/* Loading Spinner |
|||
-------------------------------------------------------------------------------- |
|||
*/ |
|||
.vjs-loading-spinner { |
|||
display: none; |
|||
position: absolute; |
|||
top: 50%; |
|||
left: 50%; |
|||
font-size: 4em; |
|||
line-height: 1; |
|||
width: 1em; |
|||
height: 1em; |
|||
margin-left: -0.5em; |
|||
margin-top: -0.5em; |
|||
opacity: 0.75; |
|||
/* animation */ |
|||
-webkit-animation: spin 1.5s infinite linear; |
|||
-moz-animation: spin 1.5s infinite linear; |
|||
-o-animation: spin 1.5s infinite linear; |
|||
animation: spin 1.5s infinite linear; |
|||
} |
|||
.vjs-default-skin .vjs-loading-spinner:before { |
|||
content: "\e01e"; |
|||
font-family: VideoJS; |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
width: 1em; |
|||
height: 1em; |
|||
text-align: center; |
|||
text-shadow: 0em 0em 0.1em #000; |
|||
} |
|||
@-moz-keyframes spin { |
|||
0% { |
|||
-moz-transform: rotate(0deg); |
|||
} |
|||
100% { |
|||
-moz-transform: rotate(359deg); |
|||
} |
|||
} |
|||
@-webkit-keyframes spin { |
|||
0% { |
|||
-webkit-transform: rotate(0deg); |
|||
} |
|||
100% { |
|||
-webkit-transform: rotate(359deg); |
|||
} |
|||
} |
|||
@-o-keyframes spin { |
|||
0% { |
|||
-o-transform: rotate(0deg); |
|||
} |
|||
100% { |
|||
-o-transform: rotate(359deg); |
|||
} |
|||
} |
|||
@keyframes spin { |
|||
0% { |
|||
transform: rotate(0deg); |
|||
} |
|||
100% { |
|||
transform: rotate(359deg); |
|||
} |
|||
} |
|||
/* Menu Buttons (Captions/Subtitles/etc.) |
|||
-------------------------------------------------------------------------------- |
|||
*/ |
|||
.vjs-default-skin .vjs-menu-button { |
|||
float: right; |
|||
cursor: pointer; |
|||
} |
|||
.vjs-default-skin .vjs-menu { |
|||
display: none; |
|||
position: absolute; |
|||
bottom: 0; |
|||
left: 0em; |
|||
/* (Width of vjs-menu - width of button) / 2 */ |
|||
|
|||
width: 0em; |
|||
height: 0em; |
|||
margin-bottom: 3em; |
|||
border-left: 2em solid transparent; |
|||
border-right: 2em solid transparent; |
|||
border-top: 1.55em solid #000000; |
|||
/* Same width top as ul bottom */ |
|||
|
|||
border-top-color: rgba(7, 40, 50, 0.5); |
|||
/* Same as ul background */ |
|||
|
|||
} |
|||
/* Button Pop-up Menu */ |
|||
.vjs-default-skin .vjs-menu-button .vjs-menu .vjs-menu-content { |
|||
display: block; |
|||
padding: 0; |
|||
margin: 0; |
|||
position: absolute; |
|||
width: 10em; |
|||
bottom: 1.5em; |
|||
/* Same bottom as vjs-menu border-top */ |
|||
|
|||
max-height: 15em; |
|||
overflow: auto; |
|||
left: -5em; |
|||
/* Width of menu - width of button / 2 */ |
|||
|
|||
/* background-color-with-alpha */ |
|||
background-color: #07141e; |
|||
background-color: rgba(7, 20, 30, 0.7); |
|||
/* box-shadow */ |
|||
-webkit-box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2); |
|||
-moz-box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2); |
|||
box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2); |
|||
} |
|||
.vjs-default-skin .vjs-menu-button:hover .vjs-menu { |
|||
display: block; |
|||
} |
|||
.vjs-default-skin .vjs-menu-button ul li { |
|||
list-style: none; |
|||
margin: 0; |
|||
padding: 0.3em 0 0.3em 0; |
|||
line-height: 1.4em; |
|||
font-size: 1.2em; |
|||
text-align: center; |
|||
text-transform: lowercase; |
|||
} |
|||
.vjs-default-skin .vjs-menu-button ul li.vjs-selected { |
|||
background-color: #000; |
|||
} |
|||
.vjs-default-skin .vjs-menu-button ul li:focus, |
|||
.vjs-default-skin .vjs-menu-button ul li:hover, |
|||
.vjs-default-skin .vjs-menu-button ul li.vjs-selected:focus, |
|||
.vjs-default-skin .vjs-menu-button ul li.vjs-selected:hover { |
|||
outline: 0; |
|||
color: #111; |
|||
/* background-color-with-alpha */ |
|||
background-color: #ffffff; |
|||
background-color: rgba(255, 255, 255, 0.75); |
|||
/* box-shadow */ |
|||
-webkit-box-shadow: 0 0 1em #ffffff; |
|||
-moz-box-shadow: 0 0 1em #ffffff; |
|||
box-shadow: 0 0 1em #ffffff; |
|||
} |
|||
.vjs-default-skin .vjs-menu-button ul li.vjs-menu-title { |
|||
text-align: center; |
|||
text-transform: uppercase; |
|||
font-size: 1em; |
|||
line-height: 2em; |
|||
padding: 0; |
|||
margin: 0 0 0.3em 0; |
|||
font-weight: bold; |
|||
cursor: default; |
|||
} |
|||
/* Subtitles Button */ |
|||
.vjs-default-skin .vjs-subtitles-button:before { |
|||
content: "\e00c"; |
|||
} |
|||
/* Captions Button */ |
|||
.vjs-default-skin .vjs-captions-button:before { |
|||
content: "\e008"; |
|||
} |
|||
/* Replacement for focus outline */ |
|||
.vjs-default-skin .vjs-captions-button:focus .vjs-control-content:before, |
|||
.vjs-default-skin .vjs-captions-button:hover .vjs-control-content:before { |
|||
/* box-shadow */ |
|||
-webkit-box-shadow: 0 0 1em #ffffff; |
|||
-moz-box-shadow: 0 0 1em #ffffff; |
|||
box-shadow: 0 0 1em #ffffff; |
|||
} |
|||
/* |
|||
REQUIRED STYLES (be careful overriding) |
|||
================================================================================ |
|||
When loading the player, the video tag is replaced with a DIV, |
|||
that will hold the video tag or object tag for other playback methods. |
|||
The div contains the video playback element (Flash or HTML5) and controls, |
|||
and sets the width and height of the video. |
|||
|
|||
** If you want to add some kind of border/padding (e.g. a frame), or special |
|||
positioning, use another containing element. Otherwise you risk messing up |
|||
control positioning and full window mode. ** |
|||
*/ |
|||
.video-js { |
|||
background-color: #000; |
|||
position: relative; |
|||
padding: 0; |
|||
/* Start with 10px for base font size so other dimensions can be em based and |
|||
easily calculable. */ |
|||
|
|||
font-size: 10px; |
|||
/* Allow poster to be vertially aligned. */ |
|||
|
|||
vertical-align: middle; |
|||
/* display: table-cell; */ |
|||
/*This works in Safari but not Firefox.*/ |
|||
|
|||
/* Provide some basic defaults for fonts */ |
|||
|
|||
font-weight: normal; |
|||
font-style: normal; |
|||
/* Avoiding helvetica: issue #376 */ |
|||
|
|||
font-family: Arial, sans-serif; |
|||
/* Turn off user selection (text highlighting) by default. |
|||
The majority of player components will not be text blocks. |
|||
Text areas will need to turn user selection back on. */ |
|||
|
|||
/* user-select */ |
|||
-webkit-user-select: none; |
|||
-moz-user-select: none; |
|||
-ms-user-select: none; |
|||
user-select: none; |
|||
} |
|||
/* Playback technology elements expand to the width/height of the containing div |
|||
<video> or <object> */ |
|||
.video-js .vjs-tech { |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
/* Fix for Firefox 9 fullscreen (only if it is enabled). Not needed when |
|||
checking fullScreenEnabled. */ |
|||
.video-js:-moz-full-screen { |
|||
position: absolute; |
|||
} |
|||
/* Fullscreen Styles */ |
|||
body.vjs-full-window { |
|||
padding: 0; |
|||
margin: 0; |
|||
height: 100%; |
|||
/* Fix for IE6 full-window. http://www.cssplay.co.uk/layouts/fixed.html */ |
|||
overflow-y: auto; |
|||
} |
|||
.video-js.vjs-fullscreen { |
|||
position: fixed; |
|||
overflow: hidden; |
|||
z-index: 1000; |
|||
left: 0; |
|||
top: 0; |
|||
bottom: 0; |
|||
right: 0; |
|||
width: 100% !important; |
|||
height: 100% !important; |
|||
/* IE6 full-window (underscore hack) */ |
|||
_position: absolute; |
|||
} |
|||
.video-js:-webkit-full-screen { |
|||
width: 100% !important; |
|||
height: 100% !important; |
|||
} |
|||
.video-js.vjs-fullscreen.vjs-user-inactive { |
|||
cursor: none; |
|||
} |
|||
/* Poster Styles */ |
|||
.vjs-poster { |
|||
background-repeat: no-repeat; |
|||
background-position: 50% 50%; |
|||
background-size: contain; |
|||
cursor: pointer; |
|||
height: 100%; |
|||
margin: 0; |
|||
padding: 0; |
|||
position: relative; |
|||
width: 100%; |
|||
} |
|||
.vjs-poster img { |
|||
display: block; |
|||
margin: 0 auto; |
|||
max-height: 100%; |
|||
padding: 0; |
|||
width: 100%; |
|||
} |
|||
/* Hide the poster when native controls are used otherwise it covers them */ |
|||
.video-js.vjs-using-native-controls .vjs-poster { |
|||
display: none; |
|||
} |
|||
/* Text Track Styles */ |
|||
/* Overall track holder for both captions and subtitles */ |
|||
.video-js .vjs-text-track-display { |
|||
text-align: center; |
|||
position: absolute; |
|||
bottom: 4em; |
|||
/* Leave padding on left and right */ |
|||
left: 1em; |
|||
right: 1em; |
|||
} |
|||
/* Individual tracks */ |
|||
.video-js .vjs-text-track { |
|||
display: none; |
|||
font-size: 1.4em; |
|||
text-align: center; |
|||
margin-bottom: 0.1em; |
|||
/* Transparent black background, or fallback to all black (oldIE) */ |
|||
/* background-color-with-alpha */ |
|||
background-color: #000000; |
|||
background-color: rgba(0, 0, 0, 0.5); |
|||
} |
|||
.video-js .vjs-subtitles { |
|||
color: #ffffff /* Subtitles are white */; |
|||
} |
|||
.video-js .vjs-captions { |
|||
color: #ffcc66 /* Captions are yellow */; |
|||
} |
|||
.vjs-tt-cue { |
|||
display: block; |
|||
} |
|||
/* Hide disabled or unsupported controls */ |
|||
.vjs-default-skin .vjs-hidden { |
|||
display: none; |
|||
} |
|||
.vjs-lock-showing { |
|||
display: block !important; |
|||
opacity: 1; |
|||
visibility: visible; |
|||
} |
|||
/* ----------------------------------------------------------------------------- |
|||
The original source of this file lives at |
|||
https://github.com/videojs/video.js/blob/master/src/css/video-js.less */ |
|||
@ -0,0 +1,129 @@ |
|||
/*! Video.js v4.3.0 Copyright 2013 Brightcove, Inc. https://github.com/videojs/video.js/blob/master/LICENSE */ (function() {var b=void 0,f=!0,h=null,l=!1;function m(){return function(){}}function p(a){return function(){return this[a]}}function s(a){return function(){return a}}var t;document.createElement("video");document.createElement("audio");document.createElement("track");function u(a,c,d){if("string"===typeof a){0===a.indexOf("#")&&(a=a.slice(1));if(u.xa[a])return u.xa[a];a=u.w(a)}if(!a||!a.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");return a.player||new u.s(a,c,d)}var v=u; |
|||
window.Td=window.Ud=u;u.Tb="4.3";u.Fc="https:"==document.location.protocol?"https://":"http://";u.options={techOrder:["html5","flash"],html5:{},flash:{},width:300,height:150,defaultVolume:0,children:{mediaLoader:{},posterImage:{},textTrackDisplay:{},loadingSpinner:{},bigPlayButton:{},controlBar:{}},notSupportedMessage:'Sorry, no compatible source and playback technology were found for this video. Try using another browser like <a href="http://bit.ly/ccMUEC">Chrome</a> or download the latest <a href="http://adobe.ly/mwfN1">Adobe Flash Player</a>.'}; |
|||
"GENERATED_CDN_VSN"!==u.Tb&&(v.options.flash.swf=u.Fc+"vjs.zencdn.net/"+u.Tb+"/video-js.swf");u.xa={};u.la=u.CoreObject=m();u.la.extend=function(a){var c,d;a=a||{};c=a.init||a.i||this.prototype.init||this.prototype.i||m();d=function(){c.apply(this,arguments)};d.prototype=u.k.create(this.prototype);d.prototype.constructor=d;d.extend=u.la.extend;d.create=u.la.create;for(var e in a)a.hasOwnProperty(e)&&(d.prototype[e]=a[e]);return d}; |
|||
u.la.create=function(){var a=u.k.create(this.prototype);this.apply(a,arguments);return a};u.d=function(a,c,d){var e=u.getData(a);e.z||(e.z={});e.z[c]||(e.z[c]=[]);d.t||(d.t=u.t++);e.z[c].push(d);e.W||(e.disabled=l,e.W=function(c){if(!e.disabled){c=u.kc(c);var d=e.z[c.type];if(d)for(var d=d.slice(0),k=0,q=d.length;k<q&&!c.pc();k++)d[k].call(a,c)}});1==e.z[c].length&&(document.addEventListener?a.addEventListener(c,e.W,l):document.attachEvent&&a.attachEvent("on"+c,e.W))}; |
|||
u.o=function(a,c,d){if(u.oc(a)){var e=u.getData(a);if(e.z)if(c){var g=e.z[c];if(g){if(d){if(d.t)for(e=0;e<g.length;e++)g[e].t===d.t&&g.splice(e--,1)}else e.z[c]=[];u.gc(a,c)}}else for(g in e.z)c=g,e.z[c]=[],u.gc(a,c)}};u.gc=function(a,c){var d=u.getData(a);0===d.z[c].length&&(delete d.z[c],document.removeEventListener?a.removeEventListener(c,d.W,l):document.detachEvent&&a.detachEvent("on"+c,d.W));u.Bb(d.z)&&(delete d.z,delete d.W,delete d.disabled);u.Bb(d)&&u.vc(a)}; |
|||
u.kc=function(a){function c(){return f}function d(){return l}if(!a||!a.Cb){var e=a||window.event;a={};for(var g in e)"layerX"!==g&&"layerY"!==g&&(a[g]=e[g]);a.target||(a.target=a.srcElement||document);a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;a.preventDefault=function(){e.preventDefault&&e.preventDefault();a.returnValue=l;a.Ab=c};a.Ab=d;a.stopPropagation=function(){e.stopPropagation&&e.stopPropagation();a.cancelBubble=f;a.Cb=c};a.Cb=d;a.stopImmediatePropagation=function(){e.stopImmediatePropagation&& |
|||
e.stopImmediatePropagation();a.pc=c;a.stopPropagation()};a.pc=d;if(a.clientX!=h){g=document.documentElement;var j=document.body;a.pageX=a.clientX+(g&&g.scrollLeft||j&&j.scrollLeft||0)-(g&&g.clientLeft||j&&j.clientLeft||0);a.pageY=a.clientY+(g&&g.scrollTop||j&&j.scrollTop||0)-(g&&g.clientTop||j&&j.clientTop||0)}a.which=a.charCode||a.keyCode;a.button!=h&&(a.button=a.button&1?0:a.button&4?1:a.button&2?2:0)}return a}; |
|||
u.j=function(a,c){var d=u.oc(a)?u.getData(a):{},e=a.parentNode||a.ownerDocument;"string"===typeof c&&(c={type:c,target:a});c=u.kc(c);d.W&&d.W.call(a,c);if(e&&!c.Cb()&&c.bubbles!==l)u.j(e,c);else if(!e&&!c.Ab()&&(d=u.getData(c.target),c.target[c.type])){d.disabled=f;if("function"===typeof c.target[c.type])c.target[c.type]();d.disabled=l}return!c.Ab()};u.U=function(a,c,d){function e(){u.o(a,c,e);d.apply(this,arguments)}e.t=d.t=d.t||u.t++;u.d(a,c,e)};var w=Object.prototype.hasOwnProperty; |
|||
u.e=function(a,c){var d,e;d=document.createElement(a||"div");for(e in c)w.call(c,e)&&(-1!==e.indexOf("aria-")||"role"==e?d.setAttribute(e,c[e]):d[e]=c[e]);return d};u.$=function(a){return a.charAt(0).toUpperCase()+a.slice(1)};u.k={};u.k.create=Object.create||function(a){function c(){}c.prototype=a;return new c};u.k.ua=function(a,c,d){for(var e in a)w.call(a,e)&&c.call(d||this,e,a[e])};u.k.B=function(a,c){if(!c)return a;for(var d in c)w.call(c,d)&&(a[d]=c[d]);return a}; |
|||
u.k.ic=function(a,c){var d,e,g;a=u.k.copy(a);for(d in c)w.call(c,d)&&(e=a[d],g=c[d],a[d]=u.k.qc(e)&&u.k.qc(g)?u.k.ic(e,g):c[d]);return a};u.k.copy=function(a){return u.k.B({},a)};u.k.qc=function(a){return!!a&&"object"===typeof a&&"[object Object]"===a.toString()&&a.constructor===Object};u.bind=function(a,c,d){function e(){return c.apply(a,arguments)}c.t||(c.t=u.t++);e.t=d?d+"_"+c.t:c.t;return e};u.ra={};u.t=1;u.expando="vdata"+(new Date).getTime(); |
|||
u.getData=function(a){var c=a[u.expando];c||(c=a[u.expando]=u.t++,u.ra[c]={});return u.ra[c]};u.oc=function(a){a=a[u.expando];return!(!a||u.Bb(u.ra[a]))};u.vc=function(a){var c=a[u.expando];if(c){delete u.ra[c];try{delete a[u.expando]}catch(d){a.removeAttribute?a.removeAttribute(u.expando):a[u.expando]=h}}};u.Bb=function(a){for(var c in a)if(a[c]!==h)return l;return f};u.n=function(a,c){-1==(" "+a.className+" ").indexOf(" "+c+" ")&&(a.className=""===a.className?c:a.className+" "+c)}; |
|||
u.u=function(a,c){var d,e;if(-1!=a.className.indexOf(c)){d=a.className.split(" ");for(e=d.length-1;0<=e;e--)d[e]===c&&d.splice(e,1);a.className=d.join(" ")}};u.na=u.e("video");u.F=navigator.userAgent;u.Mc=/iPhone/i.test(u.F);u.Lc=/iPad/i.test(u.F);u.Nc=/iPod/i.test(u.F);u.Kc=u.Mc||u.Lc||u.Nc;var aa=u,x;var y=u.F.match(/OS (\d+)_/i);x=y&&y[1]?y[1]:b;aa.Fd=x;u.Ic=/Android/i.test(u.F);var ba=u,z;var A=u.F.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i),B,C; |
|||
A?(B=A[1]&&parseFloat(A[1]),C=A[2]&&parseFloat(A[2]),z=B&&C?parseFloat(A[1]+"."+A[2]):B?B:h):z=h;ba.Gc=z;u.Oc=u.Ic&&/webkit/i.test(u.F)&&2.3>u.Gc;u.Jc=/Firefox/i.test(u.F);u.Gd=/Chrome/i.test(u.F);u.ac=!!("ontouchstart"in window||window.Hc&&document instanceof window.Hc); |
|||
u.xb=function(a){var c,d,e,g;c={};if(a&&a.attributes&&0<a.attributes.length){d=a.attributes;for(var j=d.length-1;0<=j;j--){e=d[j].name;g=d[j].value;if("boolean"===typeof a[e]||-1!==",autoplay,controls,loop,muted,default,".indexOf(","+e+","))g=g!==h?f:l;c[e]=g}}return c}; |
|||
u.Kd=function(a,c){var d="";document.defaultView&&document.defaultView.getComputedStyle?d=document.defaultView.getComputedStyle(a,"").getPropertyValue(c):a.currentStyle&&(d=a["client"+c.substr(0,1).toUpperCase()+c.substr(1)]+"px");return d};u.zb=function(a,c){c.firstChild?c.insertBefore(a,c.firstChild):c.appendChild(a)};u.Pb={};u.w=function(a){0===a.indexOf("#")&&(a=a.slice(1));return document.getElementById(a)}; |
|||
u.La=function(a,c){c=c||a;var d=Math.floor(a%60),e=Math.floor(a/60%60),g=Math.floor(a/3600),j=Math.floor(c/60%60),k=Math.floor(c/3600);if(isNaN(a)||Infinity===a)g=e=d="-";g=0<g||0<k?g+":":"";return g+(((g||10<=j)&&10>e?"0"+e:e)+":")+(10>d?"0"+d:d)};u.Tc=function(){document.body.focus();document.onselectstart=s(l)};u.Bd=function(){document.onselectstart=s(f)};u.trim=function(a){return(a+"").replace(/^\s+|\s+$/g,"")};u.round=function(a,c){c||(c=0);return Math.round(a*Math.pow(10,c))/Math.pow(10,c)}; |
|||
u.tb=function(a,c){return{length:1,start:function(){return a},end:function(){return c}}}; |
|||
u.get=function(a,c,d){var e,g;"undefined"===typeof XMLHttpRequest&&(window.XMLHttpRequest=function(){try{return new window.ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new window.ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new window.ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw Error("This browser does not support XMLHttpRequest.");});g=new XMLHttpRequest;try{g.open("GET",a)}catch(j){d(j)}e=0===a.indexOf("file:")||0===window.location.href.indexOf("file:")&&-1===a.indexOf("http"); |
|||
g.onreadystatechange=function(){4===g.readyState&&(200===g.status||e&&0===g.status?c(g.responseText):d&&d())};try{g.send()}catch(k){d&&d(k)}};u.td=function(a){try{var c=window.localStorage||l;c&&(c.volume=a)}catch(d){22==d.code||1014==d.code?u.log("LocalStorage Full (VideoJS)",d):18==d.code?u.log("LocalStorage not allowed (VideoJS)",d):u.log("LocalStorage Error (VideoJS)",d)}};u.mc=function(a){a.match(/^https?:\/\//)||(a=u.e("div",{innerHTML:'<a href="'+a+'">x</a>'}).firstChild.href);return a}; |
|||
u.log=function(){u.log.history=u.log.history||[];u.log.history.push(arguments);window.console&&window.console.log(Array.prototype.slice.call(arguments))};u.ad=function(a){var c,d;a.getBoundingClientRect&&a.parentNode&&(c=a.getBoundingClientRect());if(!c)return{left:0,top:0};a=document.documentElement;d=document.body;return{left:c.left+(window.pageXOffset||d.scrollLeft)-(a.clientLeft||d.clientLeft||0),top:c.top+(window.pageYOffset||d.scrollTop)-(a.clientTop||d.clientTop||0)}}; |
|||
u.c=u.la.extend({i:function(a,c,d){this.b=a;this.g=u.k.copy(this.g);c=this.options(c);this.Q=c.id||(c.el&&c.el.id?c.el.id:a.id()+"_component_"+u.t++);this.gd=c.name||h;this.a=c.el||this.e();this.G=[];this.qb={};this.V={};if((a=this.g)&&a.children){var e=this;u.k.ua(a.children,function(a,c){c!==l&&!c.loadEvent&&(e[a]=e.Z(a,c))})}this.L(d)}});t=u.c.prototype; |
|||
t.D=function(){this.j("dispose");if(this.G)for(var a=this.G.length-1;0<=a;a--)this.G[a].D&&this.G[a].D();this.V=this.qb=this.G=h;this.o();this.a.parentNode&&this.a.parentNode.removeChild(this.a);u.vc(this.a);this.a=h};t.b=f;t.K=p("b");t.options=function(a){return a===b?this.g:this.g=u.k.ic(this.g,a)};t.e=function(a,c){return u.e(a,c)};t.w=p("a");t.id=p("Q");t.name=p("gd");t.children=p("G"); |
|||
t.Z=function(a,c){var d,e;"string"===typeof a?(e=a,c=c||{},d=c.componentClass||u.$(e),c.name=e,d=new window.videojs[d](this.b||this,c)):d=a;this.G.push(d);"function"===typeof d.id&&(this.qb[d.id()]=d);(e=e||d.name&&d.name())&&(this.V[e]=d);"function"===typeof d.el&&d.el()&&(this.sa||this.a).appendChild(d.el());return d}; |
|||
t.removeChild=function(a){"string"===typeof a&&(a=this.V[a]);if(a&&this.G){for(var c=l,d=this.G.length-1;0<=d;d--)if(this.G[d]===a){c=f;this.G.splice(d,1);break}c&&(this.qb[a.id]=h,this.V[a.name]=h,(c=a.w())&&c.parentNode===(this.sa||this.a)&&(this.sa||this.a).removeChild(a.w()))}};t.T=s("");t.d=function(a,c){u.d(this.a,a,u.bind(this,c));return this};t.o=function(a,c){u.o(this.a,a,c);return this};t.U=function(a,c){u.U(this.a,a,u.bind(this,c));return this};t.j=function(a,c){u.j(this.a,a,c);return this}; |
|||
t.L=function(a){a&&(this.aa?a.call(this):(this.Sa===b&&(this.Sa=[]),this.Sa.push(a)));return this};t.Ua=function(){this.aa=f;var a=this.Sa;if(a&&0<a.length){for(var c=0,d=a.length;c<d;c++)a[c].call(this);this.Sa=[];this.j("ready")}};t.n=function(a){u.n(this.a,a);return this};t.u=function(a){u.u(this.a,a);return this};t.show=function(){this.a.style.display="block";return this};t.C=function(){this.a.style.display="none";return this};function D(a){a.u("vjs-lock-showing")} |
|||
t.disable=function(){this.C();this.show=m()};t.width=function(a,c){return E(this,"width",a,c)};t.height=function(a,c){return E(this,"height",a,c)};t.Xc=function(a,c){return this.width(a,f).height(c)};function E(a,c,d,e){if(d!==b)return a.a.style[c]=-1!==(""+d).indexOf("%")||-1!==(""+d).indexOf("px")?d:"auto"===d?"":d+"px",e||a.j("resize"),a;if(!a.a)return 0;d=a.a.style[c];e=d.indexOf("px");return-1!==e?parseInt(d.slice(0,e),10):parseInt(a.a["offset"+u.$(c)],10)} |
|||
u.q=u.c.extend({i:function(a,c){u.c.call(this,a,c);var d=l;this.d("touchstart",function(a){a.preventDefault();d=f});this.d("touchmove",function(){d=l});var e=this;this.d("touchend",function(a){d&&e.p(a);a.preventDefault()});this.d("click",this.p);this.d("focus",this.Oa);this.d("blur",this.Na)}});t=u.q.prototype; |
|||
t.e=function(a,c){c=u.k.B({className:this.T(),innerHTML:'<div class="vjs-control-content"><span class="vjs-control-text">'+(this.qa||"Need Text")+"</span></div>",qd:"button","aria-live":"polite",tabIndex:0},c);return u.c.prototype.e.call(this,a,c)};t.T=function(){return"vjs-control "+u.c.prototype.T.call(this)};t.p=m();t.Oa=function(){u.d(document,"keyup",u.bind(this,this.ba))};t.ba=function(a){if(32==a.which||13==a.which)a.preventDefault(),this.p()}; |
|||
t.Na=function(){u.o(document,"keyup",u.bind(this,this.ba))};u.O=u.c.extend({i:function(a,c){u.c.call(this,a,c);this.Sc=this.V[this.g.barName];this.handle=this.V[this.g.handleName];a.d(this.tc,u.bind(this,this.update));this.d("mousedown",this.Pa);this.d("touchstart",this.Pa);this.d("focus",this.Oa);this.d("blur",this.Na);this.d("click",this.p);this.b.d("controlsvisible",u.bind(this,this.update));a.L(u.bind(this,this.update));this.P={}}});t=u.O.prototype; |
|||
t.e=function(a,c){c=c||{};c.className+=" vjs-slider";c=u.k.B({qd:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},c);return u.c.prototype.e.call(this,a,c)};t.Pa=function(a){a.preventDefault();u.Tc();this.P.move=u.bind(this,this.Hb);this.P.end=u.bind(this,this.Ib);u.d(document,"mousemove",this.P.move);u.d(document,"mouseup",this.P.end);u.d(document,"touchmove",this.P.move);u.d(document,"touchend",this.P.end);this.Hb(a)}; |
|||
t.Ib=function(){u.Bd();u.o(document,"mousemove",this.P.move,l);u.o(document,"mouseup",this.P.end,l);u.o(document,"touchmove",this.P.move,l);u.o(document,"touchend",this.P.end,l);this.update()};t.update=function(){if(this.a){var a,c=this.yb(),d=this.handle,e=this.Sc;isNaN(c)&&(c=0);a=c;if(d){a=this.a.offsetWidth;var g=d.w().offsetWidth;a=g?g/a:0;c*=1-a;a=c+a/2;d.w().style.left=u.round(100*c,2)+"%"}e.w().style.width=u.round(100*a,2)+"%"}}; |
|||
function F(a,c){var d,e,g,j;d=a.a;e=u.ad(d);j=g=d.offsetWidth;d=a.handle;if(a.g.Cd)return j=e.top,e=c.changedTouches?c.changedTouches[0].pageY:c.pageY,d&&(d=d.w().offsetHeight,j+=d/2,g-=d),Math.max(0,Math.min(1,(j-e+g)/g));g=e.left;e=c.changedTouches?c.changedTouches[0].pageX:c.pageX;d&&(d=d.w().offsetWidth,g+=d/2,j-=d);return Math.max(0,Math.min(1,(e-g)/j))}t.Oa=function(){u.d(document,"keyup",u.bind(this,this.ba))}; |
|||
t.ba=function(a){37==a.which?(a.preventDefault(),this.yc()):39==a.which&&(a.preventDefault(),this.zc())};t.Na=function(){u.o(document,"keyup",u.bind(this,this.ba))};t.p=function(a){a.stopImmediatePropagation();a.preventDefault()};u.ea=u.c.extend();u.ea.prototype.defaultValue=0;u.ea.prototype.e=function(a,c){c=c||{};c.className+=" vjs-slider-handle";c=u.k.B({innerHTML:'<span class="vjs-control-text">'+this.defaultValue+"</span>"},c);return u.c.prototype.e.call(this,"div",c)};u.ma=u.c.extend(); |
|||
function ca(a,c){a.Z(c);c.d("click",u.bind(a,function(){D(this)}))}u.ma.prototype.e=function(){var a=this.options().Vc||"ul";this.sa=u.e(a,{className:"vjs-menu-content"});a=u.c.prototype.e.call(this,"div",{append:this.sa,className:"vjs-menu"});a.appendChild(this.sa);u.d(a,"click",function(a){a.preventDefault();a.stopImmediatePropagation()});return a};u.N=u.q.extend({i:function(a,c){u.q.call(this,a,c);this.selected(c.selected)}}); |
|||
u.N.prototype.e=function(a,c){return u.q.prototype.e.call(this,"li",u.k.B({className:"vjs-menu-item",innerHTML:this.g.label},c))};u.N.prototype.p=function(){this.selected(f)};u.N.prototype.selected=function(a){a?(this.n("vjs-selected"),this.a.setAttribute("aria-selected",f)):(this.u("vjs-selected"),this.a.setAttribute("aria-selected",l))}; |
|||
u.R=u.q.extend({i:function(a,c){u.q.call(this,a,c);this.wa=this.Ka();this.Z(this.wa);this.I&&0===this.I.length&&this.C();this.d("keyup",this.ba);this.a.setAttribute("aria-haspopup",f);this.a.setAttribute("role","button")}});t=u.R.prototype;t.pa=l;t.Ka=function(){var a=new u.ma(this.b);this.options().title&&a.w().appendChild(u.e("li",{className:"vjs-menu-title",innerHTML:u.$(this.A),zd:-1}));if(this.I=this.createItems())for(var c=0;c<this.I.length;c++)ca(a,this.I[c]);return a};t.ta=m(); |
|||
t.T=function(){return this.className+" vjs-menu-button "+u.q.prototype.T.call(this)};t.Oa=m();t.Na=m();t.p=function(){this.U("mouseout",u.bind(this,function(){D(this.wa);this.a.blur()}));this.pa?G(this):H(this)};t.ba=function(a){a.preventDefault();32==a.which||13==a.which?this.pa?G(this):H(this):27==a.which&&this.pa&&G(this)};function H(a){a.pa=f;a.wa.n("vjs-lock-showing");a.a.setAttribute("aria-pressed",f);a.I&&0<a.I.length&&a.I[0].w().focus()} |
|||
function G(a){a.pa=l;D(a.wa);a.a.setAttribute("aria-pressed",l)} |
|||
u.s=u.c.extend({i:function(a,c,d){this.M=a;c=u.k.B(da(a),c);this.v={};this.uc=c.poster;this.sb=c.controls;a.controls=l;u.c.call(this,this,c,d);this.controls()?this.n("vjs-controls-enabled"):this.n("vjs-controls-disabled");this.U("play",function(a){u.j(this.a,{type:"firstplay",target:this.a})||(a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation())});this.d("ended",this.hd);this.d("play",this.Kb);this.d("firstplay",this.jd);this.d("pause",this.Jb);this.d("progress",this.ld);this.d("durationchange", |
|||
this.sc);this.d("error",this.Gb);this.d("fullscreenchange",this.kd);u.xa[this.Q]=this;c.plugins&&u.k.ua(c.plugins,function(a,c){this[a](c)},this);var e,g,j,k;e=this.Mb;a=function(){e();clearInterval(g);g=setInterval(u.bind(this,e),250)};c=function(){e();clearInterval(g)};this.d("mousedown",a);this.d("mousemove",e);this.d("mouseup",c);this.d("keydown",e);this.d("keyup",e);this.d("touchstart",a);this.d("touchmove",e);this.d("touchend",c);this.d("touchcancel",c);j=setInterval(u.bind(this,function(){this.ka&& |
|||
(this.ka=l,this.ja(f),clearTimeout(k),k=setTimeout(u.bind(this,function(){this.ka||this.ja(l)}),2E3))}),250);this.d("dispose",function(){clearInterval(j);clearTimeout(k)})}});t=u.s.prototype;t.g=u.options;t.D=function(){this.j("dispose");this.o("dispose");u.xa[this.Q]=h;this.M&&this.M.player&&(this.M.player=h);this.a&&this.a.player&&(this.a.player=h);clearInterval(this.Ra);this.za();this.h&&this.h.D();u.c.prototype.D.call(this)}; |
|||
function da(a){var c={sources:[],tracks:[]};u.k.B(c,u.xb(a));if(a.hasChildNodes()){var d,e,g,j;a=a.childNodes;g=0;for(j=a.length;g<j;g++)d=a[g],e=d.nodeName.toLowerCase(),"source"===e?c.sources.push(u.xb(d)):"track"===e&&c.tracks.push(u.xb(d))}return c} |
|||
t.e=function(){var a=this.a=u.c.prototype.e.call(this,"div"),c=this.M;c.removeAttribute("width");c.removeAttribute("height");if(c.hasChildNodes()){var d,e,g,j,k;d=c.childNodes;e=d.length;for(k=[];e--;)g=d[e],j=g.nodeName.toLowerCase(),"track"===j&&k.push(g);for(d=0;d<k.length;d++)c.removeChild(k[d])}c.id=c.id||"vjs_video_"+u.t++;a.id=c.id;a.className=c.className;c.id+="_html5_api";c.className="vjs-tech";c.player=a.player=this;this.n("vjs-paused");this.width(this.g.width,f);this.height(this.g.height, |
|||
f);c.parentNode&&c.parentNode.insertBefore(a,c);u.zb(c,a);return a}; |
|||
function I(a,c,d){a.h?(a.aa=l,a.h.D(),a.Eb&&(a.Eb=l,clearInterval(a.Ra)),a.Fb&&J(a),a.h=l):"Html5"!==c&&a.M&&(u.l.jc(a.M),a.M=h);a.ia=c;a.aa=l;var e=u.k.B({source:d,parentEl:a.a},a.g[c.toLowerCase()]);d&&(d.src==a.v.src&&0<a.v.currentTime&&(e.startTime=a.v.currentTime),a.v.src=d.src);a.h=new window.videojs[c](a,e);a.h.L(function(){this.b.Ua();if(!this.m.progressEvents){var a=this.b;a.Eb=f;a.Ra=setInterval(u.bind(a,function(){this.v.lb<this.buffered().end(0)?this.j("progress"):1==this.Ja()&&(clearInterval(this.Ra), |
|||
this.j("progress"))}),500);a.h.U("progress",function(){this.m.progressEvents=f;var a=this.b;a.Eb=l;clearInterval(a.Ra)})}this.m.timeupdateEvents||(a=this.b,a.Fb=f,a.d("play",a.Cc),a.d("pause",a.za),a.h.U("timeupdate",function(){this.m.timeupdateEvents=f;J(this.b)}))})}function J(a){a.Fb=l;a.za();a.o("play",a.Cc);a.o("pause",a.za)}t.Cc=function(){this.hc&&this.za();this.hc=setInterval(u.bind(this,function(){this.j("timeupdate")}),250)};t.za=function(){clearInterval(this.hc)}; |
|||
t.Kb=function(){u.u(this.a,"vjs-paused");u.n(this.a,"vjs-playing")};t.jd=function(){this.g.starttime&&this.currentTime(this.g.starttime);this.n("vjs-has-started")};t.Jb=function(){u.u(this.a,"vjs-playing");u.n(this.a,"vjs-paused")};t.ld=function(){1==this.Ja()&&this.j("loadedalldata")};t.hd=function(){this.g.loop&&(this.currentTime(0),this.play())};t.sc=function(){this.duration(K(this,"duration"))};t.kd=function(){this.H?this.n("vjs-fullscreen"):this.u("vjs-fullscreen")}; |
|||
t.Gb=function(a){u.log("Video Error",a)};function L(a,c,d){if(a.h&&!a.h.aa)a.h.L(function(){this[c](d)});else try{a.h[c](d)}catch(e){throw u.log(e),e;}}function K(a,c){if(a.h&&a.h.aa)try{return a.h[c]()}catch(d){throw a.h[c]===b?u.log("Video.js: "+c+" method not defined for "+a.ia+" playback technology.",d):"TypeError"==d.name?(u.log("Video.js: "+c+" unavailable on "+a.ia+" playback technology element.",d),a.h.aa=l):u.log(d),d;}}t.play=function(){L(this,"play");return this}; |
|||
t.pause=function(){L(this,"pause");return this};t.paused=function(){return K(this,"paused")===l?l:f};t.currentTime=function(a){return a!==b?(this.v.rc=a,L(this,"setCurrentTime",a),this.Fb&&this.j("timeupdate"),this):this.v.currentTime=K(this,"currentTime")||0};t.duration=function(a){if(a!==b)return this.v.duration=parseFloat(a),this;this.v.duration===b&&this.sc();return this.v.duration}; |
|||
t.buffered=function(){var a=K(this,"buffered"),c=a.length-1,d=this.v.lb=this.v.lb||0;a&&(0<=c&&a.end(c)!==d)&&(d=a.end(c),this.v.lb=d);return u.tb(0,d)};t.Ja=function(){return this.duration()?this.buffered().end(0)/this.duration():0};t.volume=function(a){if(a!==b)return a=Math.max(0,Math.min(1,parseFloat(a))),this.v.volume=a,L(this,"setVolume",a),u.td(a),this;a=parseFloat(K(this,"volume"));return isNaN(a)?1:a};t.muted=function(a){return a!==b?(L(this,"setMuted",a),this):K(this,"muted")||l}; |
|||
t.Ta=function(){return K(this,"supportsFullScreen")||l}; |
|||
t.ya=function(){var a=u.Pb.ya;this.H=f;a?(u.d(document,a.vb,u.bind(this,function(c){this.H=document[a.H];this.H===l&&u.o(document,a.vb,arguments.callee);this.j("fullscreenchange")})),this.a[a.wc]()):this.h.Ta()?L(this,"enterFullScreen"):(this.cd=f,this.Yc=document.documentElement.style.overflow,u.d(document,"keydown",u.bind(this,this.lc)),document.documentElement.style.overflow="hidden",u.n(document.body,"vjs-full-window"),this.j("enterFullWindow"),this.j("fullscreenchange"));return this}; |
|||
t.ob=function(){var a=u.Pb.ya;this.H=l;if(a)document[a.nb]();else this.h.Ta()?L(this,"exitFullScreen"):(M(this),this.j("fullscreenchange"));return this};t.lc=function(a){27===a.keyCode&&(this.H===f?this.ob():M(this))};function M(a){a.cd=l;u.o(document,"keydown",a.lc);document.documentElement.style.overflow=a.Yc;u.u(document.body,"vjs-full-window");a.j("exitFullWindow")} |
|||
t.src=function(a){if(a instanceof Array){var c;a:{c=a;for(var d=0,e=this.g.techOrder;d<e.length;d++){var g=u.$(e[d]),j=window.videojs[g];if(j.isSupported())for(var k=0,q=c;k<q.length;k++){var n=q[k];if(j.canPlaySource(n)){c={source:n,h:g};break a}}}c=l}c?(a=c.source,c=c.h,c==this.ia?this.src(a):I(this,c,a)):this.a.appendChild(u.e("p",{innerHTML:this.options().notSupportedMessage}))}else a instanceof Object?window.videojs[this.ia].canPlaySource(a)?this.src(a.src):this.src([a]):(this.v.src=a,this.aa? |
|||
(L(this,"src",a),"auto"==this.g.preload&&this.load(),this.g.autoplay&&this.play()):this.L(function(){this.src(a)}));return this};t.load=function(){L(this,"load");return this};t.currentSrc=function(){return K(this,"currentSrc")||this.v.src||""};t.Qa=function(a){return a!==b?(L(this,"setPreload",a),this.g.preload=a,this):K(this,"preload")};t.autoplay=function(a){return a!==b?(L(this,"setAutoplay",a),this.g.autoplay=a,this):K(this,"autoplay")}; |
|||
t.loop=function(a){return a!==b?(L(this,"setLoop",a),this.g.loop=a,this):K(this,"loop")};t.poster=function(a){return a!==b?(this.uc=a,this):this.uc};t.controls=function(a){return a!==b?(a=!!a,this.sb!==a&&((this.sb=a)?(this.u("vjs-controls-disabled"),this.n("vjs-controls-enabled"),this.j("controlsenabled")):(this.u("vjs-controls-enabled"),this.n("vjs-controls-disabled"),this.j("controlsdisabled"))),this):this.sb};u.s.prototype.Sb;t=u.s.prototype; |
|||
t.Rb=function(a){return a!==b?(a=!!a,this.Sb!==a&&((this.Sb=a)?(this.n("vjs-using-native-controls"),this.j("usingnativecontrols")):(this.u("vjs-using-native-controls"),this.j("usingcustomcontrols"))),this):this.Sb};t.error=function(){return K(this,"error")};t.seeking=function(){return K(this,"seeking")};t.ka=f;t.Mb=function(){this.ka=f};t.Qb=f; |
|||
t.ja=function(a){return a!==b?(a=!!a,a!==this.Qb&&((this.Qb=a)?(this.ka=f,this.u("vjs-user-inactive"),this.n("vjs-user-active"),this.j("useractive")):(this.ka=l,this.h.U("mousemove",function(a){a.stopPropagation();a.preventDefault()}),this.u("vjs-user-active"),this.n("vjs-user-inactive"),this.j("userinactive"))),this):this.Qb};var N,O,P;P=document.createElement("div");O={}; |
|||
P.Hd!==b?(O.wc="requestFullscreen",O.nb="exitFullscreen",O.vb="fullscreenchange",O.H="fullScreen"):(document.mozCancelFullScreen?(N="moz",O.H=N+"FullScreen"):(N="webkit",O.H=N+"IsFullScreen"),P[N+"RequestFullScreen"]&&(O.wc=N+"RequestFullScreen",O.nb=N+"CancelFullScreen"),O.vb=N+"fullscreenchange");document[O.nb]&&(u.Pb.ya=O);u.Fa=u.c.extend(); |
|||
u.Fa.prototype.g={Md:"play",children:{playToggle:{},currentTimeDisplay:{},timeDivider:{},durationDisplay:{},remainingTimeDisplay:{},progressControl:{},fullscreenToggle:{},volumeControl:{},muteToggle:{}}};u.Fa.prototype.e=function(){return u.e("div",{className:"vjs-control-bar"})};u.Yb=u.q.extend({i:function(a,c){u.q.call(this,a,c);a.d("play",u.bind(this,this.Kb));a.d("pause",u.bind(this,this.Jb))}});t=u.Yb.prototype;t.qa="Play";t.T=function(){return"vjs-play-control "+u.q.prototype.T.call(this)}; |
|||
t.p=function(){this.b.paused()?this.b.play():this.b.pause()};t.Kb=function(){u.u(this.a,"vjs-paused");u.n(this.a,"vjs-playing");this.a.children[0].children[0].innerHTML="Pause"};t.Jb=function(){u.u(this.a,"vjs-playing");u.n(this.a,"vjs-paused");this.a.children[0].children[0].innerHTML="Play"};u.Ya=u.c.extend({i:function(a,c){u.c.call(this,a,c);a.d("timeupdate",u.bind(this,this.Ca))}}); |
|||
u.Ya.prototype.e=function(){var a=u.c.prototype.e.call(this,"div",{className:"vjs-current-time vjs-time-controls vjs-control"});this.content=u.e("div",{className:"vjs-current-time-display",innerHTML:'<span class="vjs-control-text">Current Time </span>0:00',"aria-live":"off"});a.appendChild(u.e("div").appendChild(this.content));return a}; |
|||
u.Ya.prototype.Ca=function(){var a=this.b.Nb?this.b.v.currentTime:this.b.currentTime();this.content.innerHTML='<span class="vjs-control-text">Current Time </span>'+u.La(a,this.b.duration())};u.Za=u.c.extend({i:function(a,c){u.c.call(this,a,c);a.d("timeupdate",u.bind(this,this.Ca))}}); |
|||
u.Za.prototype.e=function(){var a=u.c.prototype.e.call(this,"div",{className:"vjs-duration vjs-time-controls vjs-control"});this.content=u.e("div",{className:"vjs-duration-display",innerHTML:'<span class="vjs-control-text">Duration Time </span>0:00',"aria-live":"off"});a.appendChild(u.e("div").appendChild(this.content));return a};u.Za.prototype.Ca=function(){var a=this.b.duration();a&&(this.content.innerHTML='<span class="vjs-control-text">Duration Time </span>'+u.La(a))}; |
|||
u.cc=u.c.extend({i:function(a,c){u.c.call(this,a,c)}});u.cc.prototype.e=function(){return u.c.prototype.e.call(this,"div",{className:"vjs-time-divider",innerHTML:"<div><span>/</span></div>"})};u.fb=u.c.extend({i:function(a,c){u.c.call(this,a,c);a.d("timeupdate",u.bind(this,this.Ca))}}); |
|||
u.fb.prototype.e=function(){var a=u.c.prototype.e.call(this,"div",{className:"vjs-remaining-time vjs-time-controls vjs-control"});this.content=u.e("div",{className:"vjs-remaining-time-display",innerHTML:'<span class="vjs-control-text">Remaining Time </span>-0:00',"aria-live":"off"});a.appendChild(u.e("div").appendChild(this.content));return a};u.fb.prototype.Ca=function(){this.b.duration()&&(this.content.innerHTML='<span class="vjs-control-text">Remaining Time </span>-'+u.La(this.b.duration()-this.b.currentTime()))}; |
|||
u.Ga=u.q.extend({i:function(a,c){u.q.call(this,a,c)}});u.Ga.prototype.qa="Fullscreen";u.Ga.prototype.T=function(){return"vjs-fullscreen-control "+u.q.prototype.T.call(this)};u.Ga.prototype.p=function(){this.b.H?(this.b.ob(),this.a.children[0].children[0].innerHTML="Fullscreen"):(this.b.ya(),this.a.children[0].children[0].innerHTML="Non-Fullscreen")};u.eb=u.c.extend({i:function(a,c){u.c.call(this,a,c)}});u.eb.prototype.g={children:{seekBar:{}}}; |
|||
u.eb.prototype.e=function(){return u.c.prototype.e.call(this,"div",{className:"vjs-progress-control vjs-control"})};u.Zb=u.O.extend({i:function(a,c){u.O.call(this,a,c);a.d("timeupdate",u.bind(this,this.Ba));a.L(u.bind(this,this.Ba))}});t=u.Zb.prototype;t.g={children:{loadProgressBar:{},playProgressBar:{},seekHandle:{}},barName:"playProgressBar",handleName:"seekHandle"};t.tc="timeupdate";t.e=function(){return u.O.prototype.e.call(this,"div",{className:"vjs-progress-holder","aria-label":"video progress bar"})}; |
|||
t.Ba=function(){var a=this.b.Nb?this.b.v.currentTime:this.b.currentTime();this.a.setAttribute("aria-valuenow",u.round(100*this.yb(),2));this.a.setAttribute("aria-valuetext",u.La(a,this.b.duration()))};t.yb=function(){var a;"Flash"===this.b.ia&&this.b.seeking()?(a=this.b.v,a=a.rc?a.rc:this.b.currentTime()):a=this.b.currentTime();return a/this.b.duration()};t.Pa=function(a){u.O.prototype.Pa.call(this,a);this.b.Nb=f;this.Dd=!this.b.paused();this.b.pause()}; |
|||
t.Hb=function(a){a=F(this,a)*this.b.duration();a==this.b.duration()&&(a-=0.1);this.b.currentTime(a)};t.Ib=function(a){u.O.prototype.Ib.call(this,a);this.b.Nb=l;this.Dd&&this.b.play()};t.zc=function(){this.b.currentTime(this.b.currentTime()+5)};t.yc=function(){this.b.currentTime(this.b.currentTime()-5)};u.ab=u.c.extend({i:function(a,c){u.c.call(this,a,c);a.d("progress",u.bind(this,this.update))}});u.ab.prototype.e=function(){return u.c.prototype.e.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text">Loaded: 0%</span>'})}; |
|||
u.ab.prototype.update=function(){this.a.style&&(this.a.style.width=u.round(100*this.b.Ja(),2)+"%")};u.Xb=u.c.extend({i:function(a,c){u.c.call(this,a,c)}});u.Xb.prototype.e=function(){return u.c.prototype.e.call(this,"div",{className:"vjs-play-progress",innerHTML:'<span class="vjs-control-text">Progress: 0%</span>'})};u.gb=u.ea.extend();u.gb.prototype.defaultValue="00:00";u.gb.prototype.e=function(){return u.ea.prototype.e.call(this,"div",{className:"vjs-seek-handle"})}; |
|||
u.ib=u.c.extend({i:function(a,c){u.c.call(this,a,c);a.h&&(a.h.m&&a.h.m.volumeControl===l)&&this.n("vjs-hidden");a.d("loadstart",u.bind(this,function(){a.h.m&&a.h.m.volumeControl===l?this.n("vjs-hidden"):this.u("vjs-hidden")}))}});u.ib.prototype.g={children:{volumeBar:{}}};u.ib.prototype.e=function(){return u.c.prototype.e.call(this,"div",{className:"vjs-volume-control vjs-control"})}; |
|||
u.hb=u.O.extend({i:function(a,c){u.O.call(this,a,c);a.d("volumechange",u.bind(this,this.Ba));a.L(u.bind(this,this.Ba));setTimeout(u.bind(this,this.update),0)}});t=u.hb.prototype;t.Ba=function(){this.a.setAttribute("aria-valuenow",u.round(100*this.b.volume(),2));this.a.setAttribute("aria-valuetext",u.round(100*this.b.volume(),2)+"%")};t.g={children:{volumeLevel:{},volumeHandle:{}},barName:"volumeLevel",handleName:"volumeHandle"};t.tc="volumechange"; |
|||
t.e=function(){return u.O.prototype.e.call(this,"div",{className:"vjs-volume-bar","aria-label":"volume level"})};t.Hb=function(a){this.b.muted()&&this.b.muted(l);this.b.volume(F(this,a))};t.yb=function(){return this.b.muted()?0:this.b.volume()};t.zc=function(){this.b.volume(this.b.volume()+0.1)};t.yc=function(){this.b.volume(this.b.volume()-0.1)};u.dc=u.c.extend({i:function(a,c){u.c.call(this,a,c)}}); |
|||
u.dc.prototype.e=function(){return u.c.prototype.e.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})};u.jb=u.ea.extend();u.jb.prototype.defaultValue="00:00";u.jb.prototype.e=function(){return u.ea.prototype.e.call(this,"div",{className:"vjs-volume-handle"})}; |
|||
u.da=u.q.extend({i:function(a,c){u.q.call(this,a,c);a.d("volumechange",u.bind(this,this.update));a.h&&(a.h.m&&a.h.m.volumeControl===l)&&this.n("vjs-hidden");a.d("loadstart",u.bind(this,function(){a.h.m&&a.h.m.volumeControl===l?this.n("vjs-hidden"):this.u("vjs-hidden")}))}});u.da.prototype.e=function(){return u.q.prototype.e.call(this,"div",{className:"vjs-mute-control vjs-control",innerHTML:'<div><span class="vjs-control-text">Mute</span></div>'})}; |
|||
u.da.prototype.p=function(){this.b.muted(this.b.muted()?l:f)};u.da.prototype.update=function(){var a=this.b.volume(),c=3;0===a||this.b.muted()?c=0:0.33>a?c=1:0.67>a&&(c=2);this.b.muted()?"Unmute"!=this.a.children[0].children[0].innerHTML&&(this.a.children[0].children[0].innerHTML="Unmute"):"Mute"!=this.a.children[0].children[0].innerHTML&&(this.a.children[0].children[0].innerHTML="Mute");for(a=0;4>a;a++)u.u(this.a,"vjs-vol-"+a);u.n(this.a,"vjs-vol-"+c)}; |
|||
u.oa=u.R.extend({i:function(a,c){u.R.call(this,a,c);a.d("volumechange",u.bind(this,this.update));a.h&&(a.h.m&&a.h.m.Dc===l)&&this.n("vjs-hidden");a.d("loadstart",u.bind(this,function(){a.h.m&&a.h.m.Dc===l?this.n("vjs-hidden"):this.u("vjs-hidden")}));this.n("vjs-menu-button")}});u.oa.prototype.Ka=function(){var a=new u.ma(this.b,{Vc:"div"}),c=new u.hb(this.b,u.k.B({Cd:f},this.g.Vd));a.Z(c);return a};u.oa.prototype.p=function(){u.da.prototype.p.call(this);u.R.prototype.p.call(this)}; |
|||
u.oa.prototype.e=function(){return u.q.prototype.e.call(this,"div",{className:"vjs-volume-menu-button vjs-menu-button vjs-control",innerHTML:'<div><span class="vjs-control-text">Mute</span></div>'})};u.oa.prototype.update=u.da.prototype.update;u.cb=u.q.extend({i:function(a,c){u.q.call(this,a,c);(!a.poster()||!a.controls())&&this.C();a.d("play",u.bind(this,this.C))}}); |
|||
u.cb.prototype.e=function(){var a=u.e("div",{className:"vjs-poster",tabIndex:-1}),c=this.b.poster();c&&("backgroundSize"in a.style?a.style.backgroundImage='url("'+c+'")':a.appendChild(u.e("img",{src:c})));return a};u.cb.prototype.p=function(){this.K().controls()&&this.b.play()}; |
|||
u.Wb=u.c.extend({i:function(a,c){u.c.call(this,a,c);a.d("canplay",u.bind(this,this.C));a.d("canplaythrough",u.bind(this,this.C));a.d("playing",u.bind(this,this.C));a.d("seeked",u.bind(this,this.C));a.d("seeking",u.bind(this,this.show));a.d("seeked",u.bind(this,this.C));a.d("error",u.bind(this,this.show));a.d("waiting",u.bind(this,this.show))}});u.Wb.prototype.e=function(){return u.c.prototype.e.call(this,"div",{className:"vjs-loading-spinner"})};u.Wa=u.q.extend(); |
|||
u.Wa.prototype.e=function(){return u.q.prototype.e.call(this,"div",{className:"vjs-big-play-button",innerHTML:'<span aria-hidden="true"></span>',"aria-label":"play video"})};u.Wa.prototype.p=function(){this.b.play()}; |
|||
u.r=u.c.extend({i:function(a,c,d){u.c.call(this,a,c,d);var e,g;g=this;e=this.K();a=function(){if(e.controls()&&!e.Rb()){var a,c;g.d("mousedown",g.p);g.d("touchstart",function(a){a.preventDefault();a.stopPropagation();c=this.b.ja()});a=function(a){a.stopPropagation();c&&this.b.Mb()};g.d("touchmove",a);g.d("touchleave",a);g.d("touchcancel",a);g.d("touchend",a);var d,n,r;d=0;g.d("touchstart",function(){d=(new Date).getTime();r=f});a=function(){r=l};g.d("touchmove",a);g.d("touchleave",a);g.d("touchcancel", |
|||
a);g.d("touchend",function(){r===f&&(n=(new Date).getTime()-d,250>n&&this.j("tap"))});g.d("tap",g.md)}};c=u.bind(g,g.pd);this.L(a);e.d("controlsenabled",a);e.d("controlsdisabled",c)}});u.r.prototype.pd=function(){this.o("tap");this.o("touchstart");this.o("touchmove");this.o("touchleave");this.o("touchcancel");this.o("touchend");this.o("click");this.o("mousedown")};u.r.prototype.p=function(a){0===a.button&&this.K().controls()&&(this.K().paused()?this.K().play():this.K().pause())}; |
|||
u.r.prototype.md=function(){this.K().ja(!this.K().ja())};u.r.prototype.m={volumeControl:f,fullscreenResize:l,progressEvents:l,timeupdateEvents:l};u.media={};u.media.Va="play pause paused currentTime setCurrentTime duration buffered volume setVolume muted setMuted width height supportsFullScreen enterFullScreen src load currentSrc preload setPreload autoplay setAutoplay loop setLoop error networkState readyState seeking initialTime startOffsetTime played seekable ended videoTracks audioTracks videoWidth videoHeight textTracks defaultPlaybackRate playbackRate mediaGroup controller controls defaultMuted".split(" "); |
|||
function ea(){var a=u.media.Va[i];return function(){throw Error('The "'+a+"\" method is not available on the playback technology's API");}}for(var i=u.media.Va.length-1;0<=i;i--)u.r.prototype[u.media.Va[i]]=ea(); |
|||
u.l=u.r.extend({i:function(a,c,d){this.m.volumeControl=u.l.Uc();this.m.movingMediaElementInDOM=!u.Kc;this.m.fullscreenResize=f;u.r.call(this,a,c,d);(c=c.source)&&this.a.currentSrc===c.src&&0<this.a.networkState?a.j("loadstart"):c&&(this.a.src=c.src);if(u.ac&&a.options().nativeControlsForTouch!==l){var e,g,j,k;e=this;g=this.K();c=g.controls();e.a.controls=!!c;j=function(){e.a.controls=f};k=function(){e.a.controls=l};g.d("controlsenabled",j);g.d("controlsdisabled",k);c=function(){g.o("controlsenabled", |
|||
j);g.o("controlsdisabled",k)};e.d("dispose",c);g.d("usingcustomcontrols",c);g.Rb(f)}a.L(function(){this.M&&(this.g.autoplay&&this.paused())&&(delete this.M.poster,this.play())});for(a=u.l.$a.length-1;0<=a;a--)u.d(this.a,u.l.$a[a],u.bind(this.b,this.$c));this.Ua()}});t=u.l.prototype;t.D=function(){u.r.prototype.D.call(this)}; |
|||
t.e=function(){var a=this.b,c=a.M,d;if(!c||this.m.movingMediaElementInDOM===l)c?(d=c.cloneNode(l),u.l.jc(c),c=d,a.M=h):c=u.e("video",{id:a.id()+"_html5_api",className:"vjs-tech"}),c.player=a,u.zb(c,a.w());d=["autoplay","preload","loop","muted"];for(var e=d.length-1;0<=e;e--){var g=d[e];a.g[g]!==h&&(c[g]=a.g[g])}return c};t.$c=function(a){this.j(a);a.stopPropagation()};t.play=function(){this.a.play()};t.pause=function(){this.a.pause()};t.paused=function(){return this.a.paused};t.currentTime=function(){return this.a.currentTime}; |
|||
t.sd=function(a){try{this.a.currentTime=a}catch(c){u.log(c,"Video is not ready. (Video.js)")}};t.duration=function(){return this.a.duration||0};t.buffered=function(){return this.a.buffered};t.volume=function(){return this.a.volume};t.xd=function(a){this.a.volume=a};t.muted=function(){return this.a.muted};t.vd=function(a){this.a.muted=a};t.width=function(){return this.a.offsetWidth};t.height=function(){return this.a.offsetHeight}; |
|||
t.Ta=function(){return"function"==typeof this.a.webkitEnterFullScreen&&(/Android/.test(u.F)||!/Chrome|Mac OS X 10.5/.test(u.F))?f:l};t.src=function(a){this.a.src=a};t.load=function(){this.a.load()};t.currentSrc=function(){return this.a.currentSrc};t.Qa=function(){return this.a.Qa};t.wd=function(a){this.a.Qa=a};t.autoplay=function(){return this.a.autoplay};t.rd=function(a){this.a.autoplay=a};t.controls=function(){return this.a.controls};t.loop=function(){return this.a.loop}; |
|||
t.ud=function(a){this.a.loop=a};t.error=function(){return this.a.error};t.seeking=function(){return this.a.seeking};u.l.isSupported=function(){return!!u.na.canPlayType};u.l.mb=function(a){try{return!!u.na.canPlayType(a.type)}catch(c){return""}};u.l.Uc=function(){var a=u.na.volume;u.na.volume=a/2+0.1;return a!==u.na.volume};u.l.$a="loadstart suspend abort error emptied stalled loadedmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate progress play pause ratechange volumechange".split(" "); |
|||
u.l.jc=function(a){if(a){a.player=h;for(a.parentNode&&a.parentNode.removeChild(a);a.hasChildNodes();)a.removeChild(a.firstChild);a.removeAttribute("src");"function"===typeof a.load&&a.load()}};u.Oc&&(document.createElement("video").constructor.prototype.canPlayType=function(a){return a&&-1!=a.toLowerCase().indexOf("video/mp4")?"maybe":""}); |
|||
u.f=u.r.extend({i:function(a,c,d){u.r.call(this,a,c,d);var e=c.source;d=c.parentEl;var g=this.a=u.e("div",{id:a.id()+"_temp_flash"}),j=a.id()+"_flash_api";a=a.g;var k=u.k.B({readyFunction:"videojs.Flash.onReady",eventProxyFunction:"videojs.Flash.onEvent",errorEventProxyFunction:"videojs.Flash.onError",autoplay:a.autoplay,preload:a.Qa,loop:a.loop,muted:a.muted},c.flashVars),q=u.k.B({wmode:"opaque",bgcolor:"#000000"},c.params),n=u.k.B({id:j,name:j,"class":"vjs-tech"},c.attributes);e&&(e.type&&u.f.ed(e.type)? |
|||
(a=u.f.Ac(e.src),k.rtmpConnection=encodeURIComponent(a.rb),k.rtmpStream=encodeURIComponent(a.Ob)):k.src=encodeURIComponent(u.mc(e.src)));u.zb(g,d);c.startTime&&this.L(function(){this.load();this.play();this.currentTime(c.startTime)});if(c.iFrameMode===f&&!u.Jc){var r=u.e("iframe",{id:j+"_iframe",name:j+"_iframe",className:"vjs-tech",scrolling:"no",marginWidth:0,marginHeight:0,frameBorder:0});k.readyFunction="ready";k.eventProxyFunction="events";k.errorEventProxyFunction="errors";u.d(r,"load",u.bind(this, |
|||
function(){var a,d=r.contentWindow;a=r.contentDocument?r.contentDocument:r.contentWindow.document;a.write(u.f.nc(c.swf,k,q,n));d.player=this.b;d.ready=u.bind(this.b,function(c){var d=this.h;d.a=a.getElementById(c);u.f.pb(d)});d.events=u.bind(this.b,function(a,c){this&&"flash"===this.ia&&this.j(c)});d.errors=u.bind(this.b,function(a,c){u.log("Flash Error",c)})}));g.parentNode.replaceChild(r,g)}else u.f.Zc(c.swf,g,k,q,n)}});t=u.f.prototype;t.D=function(){u.r.prototype.D.call(this)};t.play=function(){this.a.vjs_play()}; |
|||
t.pause=function(){this.a.vjs_pause()};t.src=function(a){u.f.dd(a)?(a=u.f.Ac(a),this.Qd(a.rb),this.Rd(a.Ob)):(a=u.mc(a),this.a.vjs_src(a));if(this.b.autoplay()){var c=this;setTimeout(function(){c.play()},0)}};t.currentSrc=function(){var a=this.a.vjs_getProperty("currentSrc");if(a==h){var c=this.Od(),d=this.Pd();c&&d&&(a=u.f.yd(c,d))}return a};t.load=function(){this.a.vjs_load()};t.poster=function(){this.a.vjs_getProperty("poster")};t.buffered=function(){return u.tb(0,this.a.vjs_getProperty("buffered"))}; |
|||
t.Ta=s(l);var Q=u.f.prototype,R="rtmpConnection rtmpStream preload currentTime defaultPlaybackRate playbackRate autoplay loop mediaGroup controller controls volume muted defaultMuted".split(" "),S="error currentSrc networkState readyState seeking initialTime duration startOffsetTime paused played seekable ended videoTracks audioTracks videoWidth videoHeight textTracks".split(" "); |
|||
function fa(){var a=R[T],c=a.charAt(0).toUpperCase()+a.slice(1);Q["set"+c]=function(c){return this.a.vjs_setProperty(a,c)}}function U(a){Q[a]=function(){return this.a.vjs_getProperty(a)}}var T;for(T=0;T<R.length;T++)U(R[T]),fa();for(T=0;T<S.length;T++)U(S[T]);u.f.isSupported=function(){return 10<=u.f.version()[0]};u.f.mb=function(a){if(!a.type)return"";a=a.type.replace(/;.*/,"").toLowerCase();if(a in u.f.bd||a in u.f.Bc)return"maybe"}; |
|||
u.f.bd={"video/flv":"FLV","video/x-flv":"FLV","video/mp4":"MP4","video/m4v":"MP4"};u.f.Bc={"rtmp/mp4":"MP4","rtmp/flv":"FLV"};u.f.onReady=function(a){a=u.w(a);var c=a.player||a.parentNode.player,d=c.h;a.player=c;d.a=a;u.f.pb(d)};u.f.pb=function(a){a.w().vjs_getProperty?a.Ua():setTimeout(function(){u.f.pb(a)},50)};u.f.onEvent=function(a,c){u.w(a).player.j(c)};u.f.onError=function(a,c){u.w(a).player.j("error");u.log("Flash Error",c,a)}; |
|||
u.f.version=function(){var a="0,0,0";try{a=(new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(c){try{navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(a=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1])}catch(d){}}return a.split(",")}; |
|||
u.f.Zc=function(a,c,d,e,g){a=u.f.nc(a,d,e,g);a=u.e("div",{innerHTML:a}).childNodes[0];d=c.parentNode;c.parentNode.replaceChild(a,c);var j=d.childNodes[0];setTimeout(function(){j.style.display="block"},1E3)}; |
|||
u.f.nc=function(a,c,d,e){var g="",j="",k="";c&&u.k.ua(c,function(a,c){g+=a+"="+c+"&"});d=u.k.B({movie:a,flashvars:g,allowScriptAccess:"always",allowNetworking:"all"},d);u.k.ua(d,function(a,c){j+='<param name="'+a+'" value="'+c+'" />'});e=u.k.B({data:a,width:"100%",height:"100%"},e);u.k.ua(e,function(a,c){k+=a+'="'+c+'" '});return'<object type="application/x-shockwave-flash"'+k+">"+j+"</object>"};u.f.yd=function(a,c){return a+"&"+c}; |
|||
u.f.Ac=function(a){var c={rb:"",Ob:""};if(!a)return c;var d=a.indexOf("&"),e;-1!==d?e=d+1:(d=e=a.lastIndexOf("/")+1,0===d&&(d=e=a.length));c.rb=a.substring(0,d);c.Ob=a.substring(e,a.length);return c};u.f.ed=function(a){return a in u.f.Bc};u.f.Qc=/^rtmp[set]?:\/\//i;u.f.dd=function(a){return u.f.Qc.test(a)}; |
|||
u.Pc=u.c.extend({i:function(a,c,d){u.c.call(this,a,c,d);if(!a.g.sources||0===a.g.sources.length){c=0;for(d=a.g.techOrder;c<d.length;c++){var e=u.$(d[c]),g=window.videojs[e];if(g&&g.isSupported()){I(a,e);break}}}else a.src(a.g.sources)}});function V(a){a.Aa=a.Aa||[];return a.Aa}function W(a,c,d){for(var e=a.Aa,g=0,j=e.length,k,q;g<j;g++)k=e[g],k.id()===c?(k.show(),q=k):d&&(k.J()==d&&0<k.mode())&&k.disable();(c=q?q.J():d?d:l)&&a.j(c+"trackchange")} |
|||
u.X=u.c.extend({i:function(a,c){u.c.call(this,a,c);this.Q=c.id||"vjs_"+c.kind+"_"+c.language+"_"+u.t++;this.xc=c.src;this.Wc=c["default"]||c.dflt;this.Ad=c.title;this.Ld=c.srclang;this.fd=c.label;this.fa=[];this.ec=[];this.ga=this.ha=0;this.b.d("fullscreenchange",u.bind(this,this.Rc))}});t=u.X.prototype;t.J=p("A");t.src=p("xc");t.ub=p("Wc");t.title=p("Ad");t.label=p("fd");t.readyState=p("ha");t.mode=p("ga");t.Rc=function(){this.a.style.fontSize=this.b.H?140*(screen.width/this.b.width())+"%":""}; |
|||
t.e=function(){return u.c.prototype.e.call(this,"div",{className:"vjs-"+this.A+" vjs-text-track"})};t.show=function(){X(this);this.ga=2;u.c.prototype.show.call(this)};t.C=function(){X(this);this.ga=1;u.c.prototype.C.call(this)};t.disable=function(){2==this.ga&&this.C();this.b.o("timeupdate",u.bind(this,this.update,this.Q));this.b.o("ended",u.bind(this,this.reset,this.Q));this.reset();this.b.V.textTrackDisplay.removeChild(this);this.ga=0}; |
|||
function X(a){0===a.ha&&a.load();0===a.ga&&(a.b.d("timeupdate",u.bind(a,a.update,a.Q)),a.b.d("ended",u.bind(a,a.reset,a.Q)),("captions"===a.A||"subtitles"===a.A)&&a.b.V.textTrackDisplay.Z(a))}t.load=function(){0===this.ha&&(this.ha=1,u.get(this.xc,u.bind(this,this.nd),u.bind(this,this.Gb)))};t.Gb=function(a){this.error=a;this.ha=3;this.j("error")}; |
|||
t.nd=function(a){var c,d;a=a.split("\n");for(var e="",g=1,j=a.length;g<j;g++)if(e=u.trim(a[g])){-1==e.indexOf("--\x3e")?(c=e,e=u.trim(a[++g])):c=this.fa.length;c={id:c,index:this.fa.length};d=e.split(" --\x3e ");c.startTime=Y(d[0]);c.va=Y(d[1]);for(d=[];a[++g]&&(e=u.trim(a[g]));)d.push(e);c.text=d.join("<br/>");this.fa.push(c)}this.ha=2;this.j("loaded")}; |
|||
function Y(a){var c=a.split(":");a=0;var d,e,g;3==c.length?(d=c[0],e=c[1],c=c[2]):(d=0,e=c[0],c=c[1]);c=c.split(/\s+/);c=c.splice(0,1)[0];c=c.split(/\.|,/);g=parseFloat(c[1]);c=c[0];a+=3600*parseFloat(d);a+=60*parseFloat(e);a+=parseFloat(c);g&&(a+=g/1E3);return a} |
|||
t.update=function(){if(0<this.fa.length){var a=this.b.currentTime();if(this.Lb===b||a<this.Lb||this.Ma<=a){var c=this.fa,d=this.b.duration(),e=0,g=l,j=[],k,q,n,r;a>=this.Ma||this.Ma===b?r=this.wb!==b?this.wb:0:(g=f,r=this.Db!==b?this.Db:c.length-1);for(;;){n=c[r];if(n.va<=a)e=Math.max(e,n.va),n.Ia&&(n.Ia=l);else if(a<n.startTime){if(d=Math.min(d,n.startTime),n.Ia&&(n.Ia=l),!g)break}else g?(j.splice(0,0,n),q===b&&(q=r),k=r):(j.push(n),k===b&&(k=r),q=r),d=Math.min(d,n.va),e=Math.max(e,n.startTime), |
|||
n.Ia=f;if(g)if(0===r)break;else r--;else if(r===c.length-1)break;else r++}this.ec=j;this.Ma=d;this.Lb=e;this.wb=k;this.Db=q;a=this.ec;c="";d=0;for(e=a.length;d<e;d++)c+='<span class="vjs-tt-cue">'+a[d].text+"</span>";this.a.innerHTML=c;this.j("cuechange")}}};t.reset=function(){this.Ma=0;this.Lb=this.b.duration();this.Db=this.wb=0};u.Ub=u.X.extend();u.Ub.prototype.A="captions";u.$b=u.X.extend();u.$b.prototype.A="subtitles";u.Vb=u.X.extend();u.Vb.prototype.A="chapters"; |
|||
u.bc=u.c.extend({i:function(a,c,d){u.c.call(this,a,c,d);if(a.g.tracks&&0<a.g.tracks.length){c=this.b;a=a.g.tracks;var e;for(d=0;d<a.length;d++){e=a[d];var g=c,j=e.kind,k=e.label,q=e.language,n=e;e=g.Aa=g.Aa||[];n=n||{};n.kind=j;n.label=k;n.language=q;j=u.$(j||"subtitles");g=new window.videojs[j+"Track"](g,n);e.push(g)}}}});u.bc.prototype.e=function(){return u.c.prototype.e.call(this,"div",{className:"vjs-text-track-display"})}; |
|||
u.Y=u.N.extend({i:function(a,c){var d=this.ca=c.track;c.label=d.label();c.selected=d.ub();u.N.call(this,a,c);this.b.d(d.J()+"trackchange",u.bind(this,this.update))}});u.Y.prototype.p=function(){u.N.prototype.p.call(this);W(this.b,this.ca.Q,this.ca.J())};u.Y.prototype.update=function(){this.selected(2==this.ca.mode())};u.bb=u.Y.extend({i:function(a,c){c.track={J:function(){return c.kind},K:a,label:function(){return c.kind+" off"},ub:s(l),mode:s(l)};u.Y.call(this,a,c);this.selected(f)}}); |
|||
u.bb.prototype.p=function(){u.Y.prototype.p.call(this);W(this.b,this.ca.Q,this.ca.J())};u.bb.prototype.update=function(){for(var a=V(this.b),c=0,d=a.length,e,g=f;c<d;c++)e=a[c],e.J()==this.ca.J()&&2==e.mode()&&(g=l);this.selected(g)};u.S=u.R.extend({i:function(a,c){u.R.call(this,a,c);1>=this.I.length&&this.C()}});u.S.prototype.ta=function(){var a=[],c;a.push(new u.bb(this.b,{kind:this.A}));for(var d=0;d<V(this.b).length;d++)c=V(this.b)[d],c.J()===this.A&&a.push(new u.Y(this.b,{track:c}));return a}; |
|||
u.Da=u.S.extend({i:function(a,c,d){u.S.call(this,a,c,d);this.a.setAttribute("aria-label","Captions Menu")}});u.Da.prototype.A="captions";u.Da.prototype.qa="Captions";u.Da.prototype.className="vjs-captions-button";u.Ha=u.S.extend({i:function(a,c,d){u.S.call(this,a,c,d);this.a.setAttribute("aria-label","Subtitles Menu")}});u.Ha.prototype.A="subtitles";u.Ha.prototype.qa="Subtitles";u.Ha.prototype.className="vjs-subtitles-button"; |
|||
u.Ea=u.S.extend({i:function(a,c,d){u.S.call(this,a,c,d);this.a.setAttribute("aria-label","Chapters Menu")}});t=u.Ea.prototype;t.A="chapters";t.qa="Chapters";t.className="vjs-chapters-button";t.ta=function(){for(var a=[],c,d=0;d<V(this.b).length;d++)c=V(this.b)[d],c.J()===this.A&&a.push(new u.Y(this.b,{track:c}));return a}; |
|||
t.Ka=function(){for(var a=V(this.b),c=0,d=a.length,e,g,j=this.I=[];c<d;c++)if(e=a[c],e.J()==this.A&&e.ub()){if(2>e.readyState()){this.Id=e;e.d("loaded",u.bind(this,this.Ka));return}g=e;break}a=this.wa=new u.ma(this.b);a.a.appendChild(u.e("li",{className:"vjs-menu-title",innerHTML:u.$(this.A),zd:-1}));if(g){e=g.fa;for(var k,c=0,d=e.length;c<d;c++)k=e[c],k=new u.Xa(this.b,{track:g,cue:k}),j.push(k),a.Z(k)}0<this.I.length&&this.show();return a}; |
|||
u.Xa=u.N.extend({i:function(a,c){var d=this.ca=c.track,e=this.cue=c.cue,g=a.currentTime();c.label=e.text;c.selected=e.startTime<=g&&g<e.va;u.N.call(this,a,c);d.d("cuechange",u.bind(this,this.update))}});u.Xa.prototype.p=function(){u.N.prototype.p.call(this);this.b.currentTime(this.cue.startTime);this.update(this.cue.startTime)};u.Xa.prototype.update=function(){var a=this.cue,c=this.b.currentTime();this.selected(a.startTime<=c&&c<a.va)}; |
|||
u.k.B(u.Fa.prototype.g.children,{subtitlesButton:{},captionsButton:{},chaptersButton:{}}); |
|||
if("undefined"!==typeof window.JSON&&"function"===window.JSON.parse)u.JSON=window.JSON;else{u.JSON={};var Z=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;u.JSON.parse=function(a,c){function d(a,e){var k,q,n=a[e];if(n&&"object"===typeof n)for(k in n)Object.prototype.hasOwnProperty.call(n,k)&&(q=d(n,k),q!==b?n[k]=q:delete n[k]);return c.call(a,e,n)}var e;a=String(a);Z.lastIndex=0;Z.test(a)&&(a=a.replace(Z,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})); |
|||
if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof c?d({"":e},""):e;throw new SyntaxError("JSON.parse(): invalid or malformed JSON data");}} |
|||
u.fc=function(){var a,c,d=document.getElementsByTagName("video");if(d&&0<d.length)for(var e=0,g=d.length;e<g;e++)if((c=d[e])&&c.getAttribute)c.player===b&&(a=c.getAttribute("data-setup"),a!==h&&(a=u.JSON.parse(a||"{}"),v(c,a)));else{u.kb();break}else u.Ec||u.kb()};u.kb=function(){setTimeout(u.fc,1)};"complete"===document.readyState?u.Ec=f:u.U(window,"load",function(){u.Ec=f});u.kb();u.od=function(a,c){u.s.prototype[a]=c};var ga=this;ga.Ed=f;function $(a,c){var d=a.split("."),e=ga;!(d[0]in e)&&e.execScript&&e.execScript("var "+d[0]);for(var g;d.length&&(g=d.shift());)!d.length&&c!==b?e[g]=c:e=e[g]?e[g]:e[g]={}};$("videojs",u);$("_V_",u);$("videojs.options",u.options);$("videojs.players",u.xa);$("videojs.TOUCH_ENABLED",u.ac);$("videojs.cache",u.ra);$("videojs.Component",u.c);u.c.prototype.player=u.c.prototype.K;u.c.prototype.dispose=u.c.prototype.D;u.c.prototype.createEl=u.c.prototype.e;u.c.prototype.el=u.c.prototype.w;u.c.prototype.addChild=u.c.prototype.Z;u.c.prototype.children=u.c.prototype.children;u.c.prototype.on=u.c.prototype.d;u.c.prototype.off=u.c.prototype.o;u.c.prototype.one=u.c.prototype.U; |
|||
u.c.prototype.trigger=u.c.prototype.j;u.c.prototype.triggerReady=u.c.prototype.Ua;u.c.prototype.show=u.c.prototype.show;u.c.prototype.hide=u.c.prototype.C;u.c.prototype.width=u.c.prototype.width;u.c.prototype.height=u.c.prototype.height;u.c.prototype.dimensions=u.c.prototype.Xc;u.c.prototype.ready=u.c.prototype.L;u.c.prototype.addClass=u.c.prototype.n;u.c.prototype.removeClass=u.c.prototype.u;$("videojs.Player",u.s);u.s.prototype.dispose=u.s.prototype.D;u.s.prototype.requestFullScreen=u.s.prototype.ya; |
|||
u.s.prototype.cancelFullScreen=u.s.prototype.ob;u.s.prototype.bufferedPercent=u.s.prototype.Ja;u.s.prototype.usingNativeControls=u.s.prototype.Rb;u.s.prototype.reportUserActivity=u.s.prototype.Mb;u.s.prototype.userActive=u.s.prototype.ja;$("videojs.MediaLoader",u.Pc);$("videojs.TextTrackDisplay",u.bc);$("videojs.ControlBar",u.Fa);$("videojs.Button",u.q);$("videojs.PlayToggle",u.Yb);$("videojs.FullscreenToggle",u.Ga);$("videojs.BigPlayButton",u.Wa);$("videojs.LoadingSpinner",u.Wb); |
|||
$("videojs.CurrentTimeDisplay",u.Ya);$("videojs.DurationDisplay",u.Za);$("videojs.TimeDivider",u.cc);$("videojs.RemainingTimeDisplay",u.fb);$("videojs.Slider",u.O);$("videojs.ProgressControl",u.eb);$("videojs.SeekBar",u.Zb);$("videojs.LoadProgressBar",u.ab);$("videojs.PlayProgressBar",u.Xb);$("videojs.SeekHandle",u.gb);$("videojs.VolumeControl",u.ib);$("videojs.VolumeBar",u.hb);$("videojs.VolumeLevel",u.dc);$("videojs.VolumeMenuButton",u.oa);$("videojs.VolumeHandle",u.jb);$("videojs.MuteToggle",u.da); |
|||
$("videojs.PosterImage",u.cb);$("videojs.Menu",u.ma);$("videojs.MenuItem",u.N);$("videojs.MenuButton",u.R);u.R.prototype.createItems=u.R.prototype.ta;u.S.prototype.createItems=u.S.prototype.ta;u.Ea.prototype.createItems=u.Ea.prototype.ta;$("videojs.SubtitlesButton",u.Ha);$("videojs.CaptionsButton",u.Da);$("videojs.ChaptersButton",u.Ea);$("videojs.MediaTechController",u.r);u.r.prototype.features=u.r.prototype.m;u.r.prototype.m.volumeControl=u.r.prototype.m.Dc;u.r.prototype.m.fullscreenResize=u.r.prototype.m.Jd; |
|||
u.r.prototype.m.progressEvents=u.r.prototype.m.Nd;u.r.prototype.m.timeupdateEvents=u.r.prototype.m.Sd;$("videojs.Html5",u.l);u.l.Events=u.l.$a;u.l.isSupported=u.l.isSupported;u.l.canPlaySource=u.l.mb;u.l.prototype.setCurrentTime=u.l.prototype.sd;u.l.prototype.setVolume=u.l.prototype.xd;u.l.prototype.setMuted=u.l.prototype.vd;u.l.prototype.setPreload=u.l.prototype.wd;u.l.prototype.setAutoplay=u.l.prototype.rd;u.l.prototype.setLoop=u.l.prototype.ud;$("videojs.Flash",u.f);u.f.isSupported=u.f.isSupported; |
|||
u.f.canPlaySource=u.f.mb;u.f.onReady=u.f.onReady;$("videojs.TextTrack",u.X);u.X.prototype.label=u.X.prototype.label;$("videojs.CaptionsTrack",u.Ub);$("videojs.SubtitlesTrack",u.$b);$("videojs.ChaptersTrack",u.Vb);$("videojs.autoSetup",u.fc);$("videojs.plugin",u.od);$("videojs.createTimeRange",u.tb);})(); |
|||
@ -0,0 +1,28 @@ |
|||
.webuploader-container { |
|||
position: relative; |
|||
} |
|||
.webuploader-element-invisible { |
|||
position: absolute !important; |
|||
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ |
|||
clip: rect(1px,1px,1px,1px); |
|||
} |
|||
.webuploader-pick { |
|||
position: relative; |
|||
display: inline-block; |
|||
cursor: pointer; |
|||
background: #00b7ee; |
|||
padding: 10px 15px; |
|||
color: #fff; |
|||
text-align: center; |
|||
border-radius: 3px; |
|||
overflow: hidden; |
|||
} |
|||
.webuploader-pick-hover { |
|||
background: #00a2d4; |
|||
} |
|||
|
|||
.webuploader-pick-disable { |
|||
opacity: 0.6; |
|||
pointer-events:none; |
|||
} |
|||
|
|||
@ -0,0 +1,709 @@ |
|||
(function(){function X(d,b,c){var a;b=b.toLowerCase();return(a=d.__allListeners||c&&(d.__allListeners={}))&&(a[b]||c&&(a[b]=[]))}function Y(d,b,c,a,e,h){a=a&&d[b];var g;for(!a&&(a=d[c]);!a&&(g=(g||d).parentNode);){if("BODY"==g.tagName||h&&!h(g))return null;a=g[c]}return a&&e&&!e(a)?Y(a,b,c,!1,e):a}UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var t=window.baidu||{};window.baidu=t;window.UE=t.editor=window.UE||{};UE.plugins={};UE.commands={};UE.instants={};UE.I18N={};UE._customizeUI={};UE.version="1.4.3"; |
|||
var M=UE.dom={},r=UE.browser=function(){var d=navigator.userAgent.toLowerCase(),b=window.opera,c={ie:/(msie\s|trident.*rv:)([\w.]+)/.test(d),opera:!!b&&b.version,webkit:-1<d.indexOf(" applewebkit/"),mac:-1<d.indexOf("macintosh"),quirks:"BackCompat"==document.compatMode};c.gecko="Gecko"==navigator.product&&!c.webkit&&!c.opera&&!c.ie;var a=0;if(c.ie){var a=d.match(/(?:msie\s([\w.]+))/),e=d.match(/(?:trident.*rv:([\w.]+))/),a=a&&e&&a[1]&&e[1]?Math.max(1*a[1],1*e[1]):a&&a[1]?1*a[1]:e&&e[1]?1*e[1]:0;c.ie11Compat= |
|||
11==document.documentMode;c.ie9Compat=9==document.documentMode;c.ie8=!!document.documentMode;c.ie8Compat=8==document.documentMode;c.ie7Compat=7==a&&!document.documentMode||7==document.documentMode;c.ie6Compat=7>a||c.quirks;c.ie9above=8<a;c.ie9below=9>a;c.ie11above=10<a;c.ie11below=11>a}c.gecko&&(e=d.match(/rv:([\d\.]+)/))&&(e=e[1].split("."),a=1E4*e[0]+100*(e[1]||0)+1*(e[2]||0));/chrome\/(\d+\.\d)/i.test(d)&&(c.chrome=+RegExp.$1);/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(d)&&!/chrome/i.test(d)&& |
|||
(c.safari=+(RegExp.$1||RegExp.$2));c.opera&&(a=parseFloat(b.version()));c.webkit&&(a=parseFloat(d.match(/ applewebkit\/(\d+)/)[1]));c.version=a;c.isCompatible=!c.mobile&&(c.ie&&6<=a||c.gecko&&10801<=a||c.opera&&9.5<=a||c.air&&1<=a||c.webkit&&522<=a||!1);return c}(),J=r.ie,ma=r.opera,p=UE.utils={each:function(d,b,c){if(null!=d)if(d.length===+d.length)for(var a=0,e=d.length;a<e;a++){if(!1===b.call(c,d[a],a,d))return!1}else for(a in d)if(d.hasOwnProperty(a)&&!1===b.call(c,d[a],a,d))return!1},makeInstance:function(d){var b= |
|||
new Function;b.prototype=d;d=new b;b.prototype=null;return d},extend:function(d,b,c){if(b)for(var a in b)c&&d.hasOwnProperty(a)||(d[a]=b[a]);return d},extend2:function(d){for(var b=arguments,c=1;c<b.length;c++){var a=b[c],e;for(e in a)d.hasOwnProperty(e)||(d[e]=a[e])}return d},inherits:function(d,b){var c=d.prototype,a=p.makeInstance(b.prototype);p.extend(a,c,!0);d.prototype=a;return a.constructor=d},bind:function(d,b){return function(){return d.apply(b,arguments)}},defer:function(d,b,c){var a;return function(){c&& |
|||
clearTimeout(a);a=setTimeout(d,b)}},indexOf:function(d,b,c){var a=-1;c=this.isNumber(c)?c:0;this.each(d,function(e,h){if(h>=c&&e===b)return a=h,!1});return a},removeItem:function(d,b){for(var c=0,a=d.length;c<a;c++)d[c]===b&&(d.splice(c,1),c--)},trim:function(d){return d.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},listToMap:function(d){if(!d)return{};d=p.isArray(d)?d:d.split(",");for(var b=0,c,a={};c=d[b++];)a[c.toUpperCase()]=a[c]=1;return a},unhtml:function(d,b){return d?d.replace(b||/[&<">'](?:(amp|lt|quot|gt|#39|nbsp|#\d+);)?/g, |
|||
function(c,a){return a?c:{"<":"<","&":"&",'"':""",">":">","'":"'"}[c]}):""},html:function(d){return d?d.replace(/&((g|l|quo)t|amp|#39|nbsp);/g,function(b){return{"<":"<","&":"&",""":'"',">":">","'":"'"," ":" "}[b]}):""},cssStyleToDomStyle:function(){var d=document.createElement("div").style,b={"float":void 0!=d.cssFloat?"cssFloat":void 0!=d.styleFloat?"styleFloat":"float"};return function(c){return b[c]||(b[c]=c.toLowerCase().replace(/-./g,function(a){return a.charAt(1).toUpperCase()}))}}(), |
|||
loadFile:function(){function d(c,a){try{for(var e=0,h;h=b[e++];)if(h.doc===c&&h.url==(a.src||a.href))return h}catch(g){return null}}var b=[];return function(c,a,e){var h=d(c,a);if(h)h.ready?e&&e():h.funs.push(e);else if(b.push({doc:c,url:a.src||a.href,funs:[e]}),!c.body){e=[];for(var g in a)"tag"!=g&&e.push(g+'="'+a[g]+'"');c.write("<"+a.tag+" "+e.join(" ")+" ></"+a.tag+">")}else if(!a.id||!c.getElementById(a.id)){var l=c.createElement(a.tag);delete a.tag;for(g in a)l.setAttribute(g,a[g]);l.onload= |
|||
l.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){h=d(c,a);if(0<h.funs.length){h.ready=1;for(var e;e=h.funs.pop();)e()}l.onload=l.onreadystatechange=null}};l.onerror=function(){throw Error("The load "+(a.href||a.src)+" fails,check the url settings of file ueditor.config.js ");};c.getElementsByTagName("head")[0].appendChild(l)}}}(),isEmptyObject:function(d){if(null==d)return!0;if(this.isArray(d)||this.isString(d))return 0===d.length;for(var b in d)if(d.hasOwnProperty(b))return!1; |
|||
return!0},fixColor:function(d,b){if(/color/i.test(d)&&/rgba?/.test(b)){var c=b.split(",");if(3<c.length)return"";b="#";for(var a=0,e;e=c[a++];)e=parseInt(e.replace(/[^\d]/gi,""),10).toString(16),b+=1==e.length?"0"+e:e;b=b.toUpperCase()}return b},optCss:function(d){function b(a,c){if(!a)return"";var g=a.top,b=a.bottom,k=a.left,d=a.right,n="";if(g&&k&&b&&d)n+=";"+c+":"+(g==b&&b==k&&k==d?g:g==b&&k==d?g+" "+k:k==d?g+" "+k+" "+b:g+" "+d+" "+b+" "+k)+";";else for(var f in a)n+=";"+c+"-"+f+":"+a[f]+";"; |
|||
return n}var c,a;d=d.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,function(e,b,g,l){if(1==l.split(" ").length)switch(b){case "padding":return!c&&(c={}),c[g]=l,"";case "margin":return!a&&(a={}),a[g]=l,"";case "border":return"initial"==l?"":e}return e});d+=b(c,"padding")+b(a,"margin");return d.replace(/^[ \n\r\t;]*|[ \n\r\t]*$/,"").replace(/;([ \n\r\t]+)|\1;/g,";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,function(a,b){return b?b+";;":";"})},clone:function(d,b){var c;b=b||{};for(var a in d)d.hasOwnProperty(a)&& |
|||
(c=d[a],"object"==typeof c?(b[a]=p.isArray(c)?[]:{},p.clone(d[a],b[a])):b[a]=c);return b},transUnitToPx:function(d){if(!/(pt|cm)/.test(d))return d;var b;d.replace(/([\d.]+)(\w+)/,function(c,a,e){d=a;b=e});switch(b){case "cm":d=25*parseFloat(d);break;case "pt":d=Math.round(96*parseFloat(d)/72)}return d+(d?"px":"")},domReady:function(){function d(c){for(c.isReady=!0;c=b.pop();c());}var b=[];return function(c,a){a=a||window;var e=a.document;c&&b.push(c);"complete"===e.readyState?d(e):(e.isReady&&d(e), |
|||
r.ie&&11!=r.version?(function(){if(!e.isReady){try{e.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}d(e)}}(),a.attachEvent("onload",function(){d(e)})):(e.addEventListener("DOMContentLoaded",function(){e.removeEventListener("DOMContentLoaded",arguments.callee,!1);d(e)},!1),a.addEventListener("load",function(){d(e)},!1)))}}(),cssRule:r.ie&&11!=r.version?function(d,b,c){var a,e;if(void 0===b||b&&b.nodeType&&9==b.nodeType){if(c=b&&b.nodeType&&9==b.nodeType?b:c||document, |
|||
a=c.indexList||(c.indexList={}),e=a[d],void 0!==e)return c.styleSheets[e].cssText}else{c=c||document;a=c.indexList||(c.indexList={});e=a[d];if(""===b)return void 0!==e?(c.styleSheets[e].cssText="",delete a[d],!0):!1;void 0!==e?sheetStyle=c.styleSheets[e]:(sheetStyle=c.createStyleSheet("",e=c.styleSheets.length),a[d]=e);sheetStyle.cssText=b}}:function(d,b,c){var a;if(void 0===b||b&&b.nodeType&&9==b.nodeType)return c=b&&b.nodeType&&9==b.nodeType?b:c||document,(a=c.getElementById(d))?a.innerHTML:void 0; |
|||
c=c||document;a=c.getElementById(d);if(""===b)return a?(a.parentNode.removeChild(a),!0):!1;a?a.innerHTML=b:(a=c.createElement("style"),a.id=d,a.innerHTML=b,c.getElementsByTagName("head")[0].appendChild(a))},sort:function(d,b){b=b||function(a,e){return a.localeCompare(e)};for(var c=0,a=d.length;c<a;c++)for(var e=c,h=d.length;e<h;e++)if(0<b(d[c],d[e])){var g=d[c];d[c]=d[e];d[e]=g}return d},serializeParam:function(d){var b=[],c;for(c in d)if("method"!=c&&"timeout"!=c&&"async"!=c)if("function"!=(typeof d[c]).toLowerCase()&& |
|||
"object"!=(typeof d[c]).toLowerCase())b.push(encodeURIComponent(c)+"="+encodeURIComponent(d[c]));else if(p.isArray(d[c]))for(var a=0;a<d[c].length;a++)b.push(encodeURIComponent(c)+"[]="+encodeURIComponent(d[c][a]));return b.join("&")},formatUrl:function(d){d=d.replace(/&&/g,"&");d=d.replace(/\?&/g,"?");d=d.replace(/&$/g,"");d=d.replace(/&#/g,"#");return d=d.replace(/&+/g,"&")},isCrossDomainUrl:function(d){var b=document.createElement("a");b.href=d;r.ie&&(b.href=b.href);return!(b.protocol==location.protocol&& |
|||
b.hostname==location.hostname&&(b.port==location.port||"80"==b.port&&""==location.port||""==b.port&&"80"==location.port))},clearEmptyAttrs:function(d){for(var b in d)""===d[b]&&delete d[b];return d},str2json:function(d){return p.isString(d)?window.JSON?JSON.parse(d):(new Function("return "+p.trim(d||"")))():null},json2str:function(){if(window.JSON)return JSON.stringify;var d=function(a){return 10>a?"0"+a:a},b=function(a){/["\\\x00-\x1f]/.test(a)&&(a=a.replace(/["\\\x00-\x1f]/g,function(a){var b=c[a]; |
|||
if(b)return b;b=a.charCodeAt();return"\\u00"+Math.floor(b/16).toString(16)+(b%16).toString(16)}));return'"'+a+'"'},c={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return function(a){switch(typeof a){case "undefined":return"undefined";case "number":return isFinite(a)?String(a):"null";case "string":return b(a);case "boolean":return String(a);default:if(null===a)return"null";if(p.isArray(a)){var e=["["],c=a.length,g,l,k;for(l=0;l<c;l++)switch(k=a[l],typeof k){case "undefined":case "function":case "unknown":break; |
|||
default:g&&e.push(","),e.push(p.json2str(k)),g=1}e.push("]");return e.join("")}if(p.isDate(a))return'"'+a.getFullYear()+"-"+d(a.getMonth()+1)+"-"+d(a.getDate())+"T"+d(a.getHours())+":"+d(a.getMinutes())+":"+d(a.getSeconds())+'"';g=["{"];l=p.json2str;for(c in a)if(Object.prototype.hasOwnProperty.call(a,c))switch(k=a[c],typeof k){case "undefined":case "unknown":case "function":break;default:e&&g.push(","),e=1,g.push(l(c)+":"+l(k))}g.push("}");return g.join("")}}}()};p.each("String Function Array Number RegExp Object Date".split(" "), |
|||
function(d){UE.utils["is"+d]=function(b){return Object.prototype.toString.apply(b)=="[object "+d+"]"}});var ba=UE.EventBase=function(){};ba.prototype={addListener:function(d,b){d=p.trim(d).split(/\s+/);for(var c=0,a;a=d[c++];)X(this,a,!0).push(b)},on:function(d,b){return this.addListener(d,b)},off:function(d,b){return this.removeListener(d,b)},trigger:function(){return this.fireEvent.apply(this,arguments)},removeListener:function(d,b){d=p.trim(d).split(/\s+/);for(var c=0,a;a=d[c++];)p.removeItem(X(this, |
|||
a)||[],b)},fireEvent:function(){for(var d=arguments[0],d=p.trim(d).split(" "),b=0,c;c=d[b++];){var a=X(this,c),e,h,g;if(a)for(g=a.length;g--;)if(a[g]){h=a[g].apply(this,arguments);if(!0===h)return h;void 0!==h&&(e=h)}if(h=this["on"+c.toLowerCase()])e=h.apply(this,arguments)}return e}};var w=M.dtd=function(){function d(a){for(var e in a)a[e.toUpperCase()]=a[e];return a}var b=p.extend2,c=d({isindex:1,fieldset:1}),a=d({input:1,button:1,select:1,textarea:1,label:1}),e=b(d({a:1}),a),h=b({iframe:1},e), |
|||
g=d({hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1}),l=d({ins:1,del:1,script:1,style:1}),k=b(d({b:1,acronym:1,bdo:1,"var":1,"#":1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1}),l),f=b(d({sub:1,img:1,embed:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1}),k),n=b(d({p:1}),f),a=b(d({iframe:1}),f,a),f=d({img:1,embed:1,noscript:1,br:1,kbd:1,center:1, |
|||
button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,"#":1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,"var":1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1}),q=b(d({a:0}),a),u=d({tr:1}),x=d({"#":1}),z=b(d({param:1}),f),v=b(d({form:1}),c,h,g,n), |
|||
D=d({li:1,ol:1,ul:1}),F=d({style:1,script:1}),H=d({base:1,link:1,meta:1,title:1}),F=b(H,F),B=d({head:1,body:1}),O=d({html:1}),r=d({address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1}),t=d({area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1});return d({$nonBodyContent:b(O,B,H),$block:r,$inline:q,$inlineWithA:b(d({a:1}), |
|||
q),$body:b(d({script:1,style:1}),r),$cdata:d({script:1,style:1}),$empty:t,$nonChild:d({iframe:1,textarea:1}),$listItem:d({dd:1,dt:1,li:1}),$list:d({ul:1,ol:1,dl:1}),$isNotEmpty:d({table:1,ul:1,ol:1,dl:1,iframe:1,area:1,base:1,col:1,hr:1,img:1,embed:1,input:1,link:1,meta:1,param:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1}),$removeEmpty:d({a:1,abbr:1,acronym:1,address:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1, |
|||
u:1,"var":1}),$removeEmptyBlock:d({p:1,div:1}),$tableContent:d({caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1,table:1}),$notTransContent:d({pre:1,script:1,style:1,textarea:1}),html:B,head:F,style:x,script:x,body:v,base:{},link:{},meta:{},title:x,col:{},tr:d({td:1,th:1}),img:{},embed:{},colgroup:d({thead:1,col:1,tbody:1,tr:1,tfoot:1}),noscript:v,td:v,br:{},th:v,center:v,kbd:q,button:b(n,g),basefont:{},h5:q,h4:q,samp:q,h6:q,ol:D,h1:q,h3:q,option:x,h2:q,form:b(c,h,g,n),select:d({optgroup:1, |
|||
option:1}),font:q,ins:q,menu:D,abbr:q,label:q,table:d({thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1}),code:q,tfoot:u,cite:q,li:v,input:{},iframe:v,strong:q,textarea:x,noframes:v,big:q,small:q,span:d({"#":1,br:1,b:1,strong:1,u:1,i:1,em:1,sub:1,sup:1,strike:1,span:1}),hr:q,dt:q,sub:q,optgroup:d({option:1}),param:{},bdo:q,"var":q,div:v,object:z,sup:q,dd:v,strike:q,area:{},dir:D,map:b(d({area:1,form:1,p:1}),c,l,g),applet:z,dl:d({dt:1,dd:1}),del:q,isindex:{},fieldset:b(d({legend:1}),f),thead:u, |
|||
ul:D,acronym:q,b:q,a:b(d({a:1}),a),blockquote:b(d({td:1,tr:1,tbody:1,li:1}),v),caption:q,i:q,u:q,tbody:u,s:q,address:b(h,n),tt:q,legend:q,q:q,pre:b(k,e),p:b(d({a:1}),q),em:q,dfn:q})}(),ka=J&&9>r.version?{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder"}:{tabindex:"tabIndex",readonly:"readOnly"},oa=p.listToMap("-webkit-box -moz-box block list-item table table-row-group table-header-group table-footer-group table-row table-column-group table-column table-cell table-caption".split(" ")), |
|||
f=M.domUtils={NODE_ELEMENT:1,NODE_DOCUMENT:9,NODE_TEXT:3,NODE_COMMENT:8,NODE_DOCUMENT_FRAGMENT:11,POSITION_IDENTICAL:0,POSITION_DISCONNECTED:1,POSITION_FOLLOWING:2,POSITION_PRECEDING:4,POSITION_IS_CONTAINED:8,POSITION_CONTAINS:16,fillChar:J&&"6"==r.version?"\ufeff":"\u200b",keys:{8:1,46:1,16:1,17:1,18:1,37:1,38:1,39:1,40:1,13:1},getPosition:function(d,b){if(d===b)return 0;var c,a=[d],e=[b];for(c=d;c=c.parentNode;){if(c===b)return 10;a.push(c)}for(c=b;c=c.parentNode;){if(c===d)return 20;e.push(c)}a.reverse(); |
|||
e.reverse();if(a[0]!==e[0])return 1;for(c=-1;c++,a[c]===e[c];);d=a[c];for(b=e[c];d=d.nextSibling;)if(d===b)return 4;return 2},getNodeIndex:function(d,b){for(var c=d,a=0;c=c.previousSibling;)b&&3==c.nodeType?c.nodeType!=c.nextSibling.nodeType&&a++:a++;return a},inDoc:function(d,b){return 10==f.getPosition(d,b)},findParent:function(d,b,c){if(d&&!f.isBody(d))for(d=c?d:d.parentNode;d;){if(!b||b(d)||f.isBody(d))return b&&!b(d)&&f.isBody(d)?null:d;d=d.parentNode}return null},findParentByTagName:function(d, |
|||
b,c,a){b=p.listToMap(p.isArray(b)?b:[b]);return f.findParent(d,function(e){return b[e.tagName]&&!(a&&a(e))},c)},findParents:function(d,b,c,a){for(b=b&&(c&&c(d)||!c)?[d]:[];d=f.findParent(d,c);)b.push(d);return a?b:b.reverse()},insertAfter:function(d,b){return d.nextSibling?d.parentNode.insertBefore(b,d.nextSibling):d.parentNode.appendChild(b)},remove:function(d,b){var c=d.parentNode,a;if(c){if(b&&d.hasChildNodes())for(;a=d.firstChild;)c.insertBefore(a,d);c.removeChild(d)}return d},getNextDomNode:function(d, |
|||
b,c,a){return Y(d,"firstChild","nextSibling",b,c,a)},getPreDomNode:function(d,b,c,a){return Y(d,"lastChild","previousSibling",b,c,a)},isBookmarkNode:function(d){return 1==d.nodeType&&d.id&&/^_baidu_bookmark_/i.test(d.id)},getWindow:function(d){d=d.ownerDocument||d;return d.defaultView||d.parentWindow},getCommonAncestor:function(d,b){if(d===b)return d;for(var c=[d],a=[b],e=d,h=-1;e=e.parentNode;){if(e===b)return e;c.push(e)}for(e=b;e=e.parentNode;){if(e===d)return e;a.push(e)}c.reverse();for(a.reverse();h++, |
|||
c[h]===a[h];);return 0==h?null:c[h-1]},clearEmptySibling:function(d,b,c){function a(a,b){for(var g;a&&!f.isBookmarkNode(a)&&(f.isEmptyInlineElement(a)||!(new RegExp("[^\t\n\r"+f.fillChar+"]")).test(a.nodeValue));)g=a[b],f.remove(a),a=g}!b&&a(d.nextSibling,"nextSibling");!c&&a(d.previousSibling,"previousSibling")},split:function(d,b){var c=d.ownerDocument;if(r.ie&&b==d.nodeValue.length){var a=c.createTextNode("");return f.insertAfter(d,a)}a=d.splitText(b);r.ie8&&(c=c.createTextNode(""),f.insertAfter(a, |
|||
c),f.remove(c));return a},isWhitespace:function(d){return!(new RegExp("[^ \t\n\r"+f.fillChar+"]")).test(d.nodeValue)},getXY:function(d){for(var b=0,c=0;d.offsetParent;)c+=d.offsetTop,b+=d.offsetLeft,d=d.offsetParent;return{x:b,y:c}},on:function(d,b,c){var a=p.isArray(b)?b:p.trim(b).split(/\s+/),e=a.length;if(e)for(;e--;)if(b=a[e],d.addEventListener)d.addEventListener(b,c,!1);else{c._d||(c._d={els:[]});var h=b+c.toString(),g=p.indexOf(c._d.els,d);c._d[h]&&-1!=g||(-1==g&&c._d.els.push(d),c._d[h]||(c._d[h]= |
|||
function(a){return c.call(a.srcElement,a||window.event)}),d.attachEvent("on"+b,c._d[h]))}d=null},un:function(d,b,c){var a=p.isArray(b)?b:p.trim(b).split(/\s+/),e=a.length;if(e)for(;e--;)if(b=a[e],d.removeEventListener)d.removeEventListener(b,c,!1);else{var h=b+c.toString();try{d.detachEvent("on"+b,c._d?c._d[h]:c)}catch(g){}c._d&&c._d[h]&&(b=p.indexOf(c._d.els,d),-1!=b&&c._d.els.splice(b,1),0==c._d.els.length&&delete c._d[h])}},isSameElement:function(d,b){if(d.tagName!=b.tagName)return!1;var c=d.attributes, |
|||
a=b.attributes;if(!J&&c.length!=a.length)return!1;for(var e,h,g=0,l=0,k=0;e=c[k++];){if("style"==e.nodeName)if(e.specified&&g++,f.isSameStyle(d,b))continue;else return!1;if(J)if(e.specified)g++,h=a.getNamedItem(e.nodeName);else continue;else h=b.attributes[e.nodeName];if(!h.specified||e.nodeValue!=h.nodeValue)return!1}if(J){for(k=0;h=a[k++];)h.specified&&l++;if(g!=l)return!1}return!0},isSameStyle:function(d,b){var c=d.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":"),a=b.style.cssText.replace(/( ?; ?)/g, |
|||
";").replace(/( ?: ?)/g,":");if(r.opera){c=d.style;a=b.style;if(c.length!=a.length)return!1;for(var e in c)if(!/^(\d+|csstext)$/i.test(e)&&c[e]!=a[e])return!1;return!0}if(!c||!a)return c==a;c=c.split(";");a=a.split(";");if(c.length!=a.length)return!1;e=0;for(var h;h=c[e++];)if(-1==p.indexOf(a,h))return!1;return!0},isBlockElm:function(d){return 1==d.nodeType&&(w.$block[d.tagName]||oa[f.getComputedStyle(d,"display")])&&!w.$nonChild[d.tagName]},isBody:function(d){return d&&1==d.nodeType&&"body"==d.tagName.toLowerCase()}, |
|||
breakParent:function(d,b){var c,a=d,e=d,h,g;do{a=a.parentNode;h?(c=a.cloneNode(!1),c.appendChild(h),h=c,c=a.cloneNode(!1),c.appendChild(g),g=c):(h=a.cloneNode(!1),g=h.cloneNode(!1));for(;c=e.previousSibling;)h.insertBefore(c,h.firstChild);for(;c=e.nextSibling;)g.appendChild(c);e=a}while(b!==a);c=b.parentNode;c.insertBefore(h,b);c.insertBefore(g,b);c.insertBefore(d,g);f.remove(b);return d},isEmptyInlineElement:function(d){if(1!=d.nodeType||!w.$removeEmpty[d.tagName])return 0;for(d=d.firstChild;d;){if(f.isBookmarkNode(d)|| |
|||
1==d.nodeType&&!f.isEmptyInlineElement(d)||3==d.nodeType&&!f.isWhitespace(d))return 0;d=d.nextSibling}return 1},trimWhiteTextNode:function(d){function b(b){for(var a;(a=d[b])&&3==a.nodeType&&f.isWhitespace(a);)d.removeChild(a)}b("firstChild");b("lastChild")},mergeChild:function(d,b,c){b=f.getElementsByTagName(d,d.tagName.toLowerCase());for(var a=0,e;e=b[a++];)if(e.parentNode&&!f.isBookmarkNode(e))if("span"==e.tagName.toLowerCase()){if(d===e.parentNode&&(f.trimWhiteTextNode(d),1==d.childNodes.length)){d.style.cssText= |
|||
e.style.cssText+";"+d.style.cssText;f.remove(e,!0);continue}e.style.cssText=d.style.cssText+";"+e.style.cssText;if(c){var h=c.style;if(h)for(var h=h.split(";"),g=0,l;l=h[g++];)e.style[p.cssStyleToDomStyle(l.split(":")[0])]=l.split(":")[1]}f.isSameStyle(e,d)&&f.remove(e,!0)}else f.isSameElement(d,e)&&f.remove(e,!0)},getElementsByTagName:function(d,b,c){if(c&&p.isString(c)){var a=c;c=function(e){return f.hasClass(e,a)}}b=p.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var e=[],h=0,g;g=b[h++];){g=d.getElementsByTagName(g); |
|||
for(var l=0,k;k=g[l++];)c&&!c(k)||e.push(k)}return e},mergeToParent:function(d){for(var b=d.parentNode;b&&w.$removeEmpty[b.tagName];){if(b.tagName==d.tagName||"A"==b.tagName){f.trimWhiteTextNode(b);if("SPAN"==b.tagName&&!f.isSameStyle(b,d)||"A"==b.tagName&&"SPAN"==d.tagName)if(1<b.childNodes.length||b!==d.parentNode){d.style.cssText=b.style.cssText+";"+d.style.cssText;b=b.parentNode;continue}else b.style.cssText+=";"+d.style.cssText,"A"==b.tagName&&(b.style.textDecoration="underline");if("A"!=b.tagName){b=== |
|||
d.parentNode&&f.remove(d,!0);break}}b=b.parentNode}},mergeSibling:function(d,b,c){function a(a,b,g){var c;if((c=g[a])&&!f.isBookmarkNode(c)&&1==c.nodeType&&f.isSameElement(g,c)){for(;c.firstChild;)"firstChild"==b?g.insertBefore(c.lastChild,g.firstChild):g.appendChild(c.firstChild);f.remove(c)}}!b&&a("previousSibling","firstChild",d);!c&&a("nextSibling","lastChild",d)},unSelectable:J&&r.ie9below||r.opera?function(d){d.onselectstart=function(){return!1};d.onclick=d.onkeyup=d.onkeydown=function(){return!1}; |
|||
d.unselectable="on";d.setAttribute("unselectable","on");for(var b=0,c;c=d.all[b++];)switch(c.tagName.toLowerCase()){case "iframe":case "textarea":case "input":case "select":break;default:c.unselectable="on",d.setAttribute("unselectable","on")}}:function(d){d.style.MozUserSelect=d.style.webkitUserSelect=d.style.msUserSelect=d.style.KhtmlUserSelect="none"},removeAttributes:function(d,b){b=p.isArray(b)?b:p.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c=0,a;a=b[c++];){a=ka[a]||a;switch(a){case "className":d[a]= |
|||
"";break;case "style":d.style.cssText="";var e=d.getAttributeNode("style");!r.ie&&e&&d.removeAttributeNode(e)}d.removeAttribute(a)}},createElement:function(d,b,c){return f.setAttributes(d.createElement(b),c)},setAttributes:function(d,b){for(var c in b)if(b.hasOwnProperty(c)){var a=b[c];switch(c){case "class":d.className=a;break;case "style":d.style.cssText=d.style.cssText+";"+a;break;case "innerHTML":d[c]=a;break;case "value":d.value=a;break;default:d.setAttribute(ka[c]||c,a)}}return d},getComputedStyle:function(d, |
|||
b){if(-1<"width height top left".indexOf(b))return d["offset"+b.replace(/^\w/,function(a){return a.toUpperCase()})]+"px";3==d.nodeType&&(d=d.parentNode);if(r.ie&&9>r.version&&"font-size"==b&&!d.style.fontSize&&!w.$empty[d.tagName]&&!w.$nonChild[d.tagName]){var c=d.ownerDocument.createElement("span");c.style.cssText="padding:0;border:0;font-family:simsun;";c.innerHTML=".";d.appendChild(c);var a=c.offsetHeight;d.removeChild(c);c=null;return a+"px"}try{c=f.getStyle(d,b)||(window.getComputedStyle?f.getWindow(d).getComputedStyle(d, |
|||
"").getPropertyValue(b):(d.currentStyle||d.style)[p.cssStyleToDomStyle(b)])}catch(e){return""}return p.transUnitToPx(p.fixColor(b,c))},removeClasses:function(d,b){b=p.isArray(b)?b:p.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c=0,a,e=d.className;a=b[c++];)e=e.replace(new RegExp("\\b"+a+"\\b"),"");(e=p.trim(e).replace(/[ ]{2,}/g," "))?d.className=e:f.removeAttributes(d,["class"])},addClass:function(d,b){if(d){b=p.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c=0,a,e=d.className;a=b[c++];)(new RegExp("\\b"+ |
|||
a+"\\b")).test(e)||(e+=" "+a);d.className=p.trim(e)}},hasClass:function(d,b){if(p.isRegExp(b))return b.test(d.className);b=p.trim(b).replace(/[ ]{2,}/g," ").split(" ");for(var c=0,a,e=d.className;a=b[c++];)if(!(new RegExp("\\b"+a+"\\b","i")).test(e))return!1;return c-1==b.length},preventDefault:function(d){d.preventDefault?d.preventDefault():d.returnValue=!1},removeStyle:function(d,b){r.ie?("color"==b&&(b="(^|;)"+b),d.style.cssText=d.style.cssText.replace(new RegExp(b+"[^:]*:[^;]+;?","ig"),"")):d.style.removeProperty? |
|||
d.style.removeProperty(b):d.style.removeAttribute(p.cssStyleToDomStyle(b));d.style.cssText||f.removeAttributes(d,["style"])},getStyle:function(d,b){var c=d.style[p.cssStyleToDomStyle(b)];return p.fixColor(b,c)},setStyle:function(d,b,c){d.style[p.cssStyleToDomStyle(b)]=c;p.trim(d.style.cssText)||this.removeAttributes(d,"style")},setStyles:function(d,b){for(var c in b)b.hasOwnProperty(c)&&f.setStyle(d,c,b[c])},removeDirtyAttr:function(d){for(var b=0,c,a=d.getElementsByTagName("*");c=a[b++];)c.removeAttribute("_moz_dirty"); |
|||
d.removeAttribute("_moz_dirty")},getChildCount:function(d,b){var c=0,a=d.firstChild;for(b=b||function(){return 1};a;)b(a)&&c++,a=a.nextSibling;return c},isEmptyNode:function(d){return!d.firstChild||0==f.getChildCount(d,function(b){return!f.isBr(b)&&!f.isBookmarkNode(b)&&!f.isWhitespace(b)})},clearSelectedArr:function(d){for(var b;b=d.pop();)f.removeAttributes(b,["class"])},scrollToView:function(d,b,c){var a=function(){var a=b.document,c="CSS1Compat"==a.compatMode;return{width:(c?a.documentElement.clientWidth: |
|||
a.body.clientWidth)||0,height:(c?a.documentElement.clientHeight:a.body.clientHeight)||0}}().height;c=-1*a+c+(d.offsetHeight||0);d=f.getXY(d);c+=d.y;d=function(a){if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};a=a.document;return{x:a.documentElement.scrollLeft||a.body.scrollLeft||0,y:a.documentElement.scrollTop||a.body.scrollTop||0}}(b).y;(c>d||c<d-a)&&b.scrollTo(0,c+(0>c?-20:20))},isBr:function(d){return 1==d.nodeType&&"BR"==d.tagName},isFillChar:function(d,b){if(3!=d.nodeType)return!1; |
|||
var c=d.nodeValue;return b?(new RegExp("^"+f.fillChar)).test(c):!c.replace(new RegExp(f.fillChar,"g"),"").length},isStartInblock:function(d){d=d.cloneRange();var b=0,c=d.startContainer,a;if(1==c.nodeType&&c.childNodes[d.startOffset])for(var c=c.childNodes[d.startOffset],e=c.previousSibling;e&&f.isFillChar(e);)c=e,e=e.previousSibling;this.isFillChar(c,!0)&&1==d.startOffset&&(d.setStartBefore(c),c=d.startContainer);for(;c&&f.isFillChar(c);)a=c,c=c.previousSibling;a&&(d.setStartBefore(a),c=d.startContainer); |
|||
for(1==c.nodeType&&f.isEmptyNode(c)&&1==d.startOffset&&d.setStart(c,0).collapse(!0);!d.startOffset;){c=d.startContainer;if(f.isBlockElm(c)||f.isBody(c)){b=1;break}var e=d.startContainer.previousSibling,h;if(e){for(;e&&f.isFillChar(e);)h=e,e=e.previousSibling;h?d.setStartBefore(h):d.setStartBefore(d.startContainer)}else d.setStartBefore(d.startContainer)}return b&&!f.isBody(d.startContainer)?1:0},isEmptyBlock:function(d,b){if(1!=d.nodeType)return 0;b=b||new RegExp("[ \u00a0\t\r\n"+f.fillChar+"]","g"); |
|||
if(0<d[r.ie?"innerText":"textContent"].replace(b,"").length)return 0;for(var c in w.$isNotEmpty)if(d.getElementsByTagName(c).length)return 0;return 1},setViewportOffset:function(d,b){var c=parseInt(d.style.left)|0,a=parseInt(d.style.top)|0,e=d.getBoundingClientRect(),h=b.left-e.left,e=b.top-e.top;h&&(d.style.left=c+h+"px");e&&(d.style.top=a+e+"px")},fillNode:function(d,b){var c=r.ie?d.createTextNode(f.fillChar):d.createElement("br");b.innerHTML="";b.appendChild(c)},moveChild:function(d,b,c){for(;d.firstChild;)c&& |
|||
b.firstChild?b.insertBefore(d.lastChild,b.firstChild):b.appendChild(d.firstChild)},hasNoAttributes:function(d){return r.ie?/^<\w+\s*?>/.test(d.outerHTML):0==d.attributes.length},isCustomeNode:function(d){return 1==d.nodeType&&d.getAttribute("_ue_custom_node_")},isTagNode:function(d,b){return 1==d.nodeType&&(new RegExp("\\b"+d.tagName+"\\b","i")).test(b)},filterNodeList:function(d,b,c){var a=[];if(!p.isFunction(b)){var e=b;b=function(a){return-1!=p.indexOf(p.isArray(e)?e:e.split(" "),a.tagName.toLowerCase())}}p.each(d, |
|||
function(e){b(e)&&a.push(e)});return 0==a.length?null:1!=a.length&&c?a:a[0]},isInNodeEndBoundary:function(d,b){var c=d.startContainer;if(3==c.nodeType&&d.startOffset!=c.nodeValue.length||1==c.nodeType&&d.startOffset!=c.childNodes.length)return 0;for(;c!==b;){if(c.nextSibling)return 0;c=c.parentNode}return 1},isBoundaryNode:function(d,b){for(var c;!f.isBody(d);)if(c=d,d=d.parentNode,c!==d[b])return!1;return!0},fillHtml:r.ie11below?" ":"<br/>"},Q=new RegExp(f.fillChar,"g");(function(){function d(a){return!a.collapsed&& |
|||
1==a.startContainer.nodeType&&a.startContainer===a.endContainer&&1==a.endOffset-a.startOffset}function b(a,g,e,b){1==g.nodeType&&(w.$empty[g.tagName]||w.$nonChild[g.tagName])&&(e=f.getNodeIndex(g)+(a?0:1),g=g.parentNode);a?(b.startContainer=g,b.startOffset=e,b.endContainer||b.collapse(!0)):(b.endContainer=g,b.endOffset=e,b.startContainer||b.collapse(!1));b.collapsed=b.startContainer&&b.endContainer&&b.startContainer===b.endContainer&&b.startOffset==b.endOffset;return b}function c(a,g){var b=a.startContainer, |
|||
e=a.endContainer,c=a.startOffset,l=a.endOffset,k=a.document,h=k.createDocumentFragment(),d,p;1==b.nodeType&&(b=b.childNodes[c]||(d=b.appendChild(k.createTextNode(""))));1==e.nodeType&&(e=e.childNodes[l]||(p=e.appendChild(k.createTextNode(""))));if(b===e&&3==b.nodeType)return h.appendChild(k.createTextNode(b.substringData(c,l-c))),g&&(b.deleteData(c,l-c),a.collapse(!0)),h;for(var B,O,r=h,t=f.findParents(b,!0),w=f.findParents(e,!0),A=0;t[A]==w[A];)A++;for(var I=A,E;E=t[I];I++){B=E.nextSibling;E==b? |
|||
d||(3==a.startContainer.nodeType?(r.appendChild(k.createTextNode(b.nodeValue.slice(c))),g&&b.deleteData(c,b.nodeValue.length-c)):r.appendChild(g?b:b.cloneNode(!0))):(O=E.cloneNode(!1),r.appendChild(O));for(;B&&B!==e&&B!==w[I];)E=B.nextSibling,r.appendChild(g?B:B.cloneNode(!0)),B=E;r=O}r=h;t[A]||(r.appendChild(t[A-1].cloneNode(!1)),r=r.firstChild);for(I=A;c=w[I];I++){B=c.previousSibling;c==e?p||3!=a.endContainer.nodeType||(r.appendChild(k.createTextNode(e.substringData(0,l))),g&&e.deleteData(0,l)): |
|||
(O=c.cloneNode(!1),r.appendChild(O));if(I!=A||!t[A])for(;B&&B!==b;)c=B.previousSibling,r.insertBefore(g?B:B.cloneNode(!0),r.firstChild),B=c;r=O}g&&a.setStartBefore(w[A]?t[A]?w[A]:t[A-1]:w[A-1]).collapse(!0);d&&f.remove(d);p&&f.remove(p);return h}function a(a,g){try{if(l&&f.inDoc(l,a))if(l.nodeValue.replace(Q,"").length)l.nodeValue=l.nodeValue.replace(Q,"");else{var b=l.parentNode;for(f.remove(l);b&&f.isEmptyInlineElement(b)&&(r.safari?!(f.getPosition(b,g)&f.POSITION_CONTAINS):!b.contains(g));)l=b.parentNode, |
|||
f.remove(b),b=l}}catch(e){}}function e(a,b){var g;for(a=a[b];a&&f.isFillChar(a);)g=a[b],f.remove(a),a=g}var h=0,g=f.fillChar,l,k=M.Range=function(a){this.startContainer=this.startOffset=this.endContainer=this.endOffset=null;this.document=a;this.collapsed=!0};k.prototype={cloneContents:function(){return this.collapsed?null:c(this,0)},deleteContents:function(){var a;this.collapsed||c(this,1);r.webkit&&(a=this.startContainer,3!=a.nodeType||a.nodeValue.length||(this.setStartBefore(a).collapse(!0),f.remove(a))); |
|||
return this},extractContents:function(){return this.collapsed?null:c(this,2)},setStart:function(a,g){return b(!0,a,g,this)},setEnd:function(a,g){return b(!1,a,g,this)},setStartAfter:function(a){return this.setStart(a.parentNode,f.getNodeIndex(a)+1)},setStartBefore:function(a){return this.setStart(a.parentNode,f.getNodeIndex(a))},setEndAfter:function(a){return this.setEnd(a.parentNode,f.getNodeIndex(a)+1)},setEndBefore:function(a){return this.setEnd(a.parentNode,f.getNodeIndex(a))},setStartAtFirst:function(a){return this.setStart(a, |
|||
0)},setStartAtLast:function(a){return this.setStart(a,3==a.nodeType?a.nodeValue.length:a.childNodes.length)},setEndAtFirst:function(a){return this.setEnd(a,0)},setEndAtLast:function(a){return this.setEnd(a,3==a.nodeType?a.nodeValue.length:a.childNodes.length)},selectNode:function(a){return this.setStartBefore(a).setEndAfter(a)},selectNodeContents:function(a){return this.setStart(a,0).setEndAtLast(a)},cloneRange:function(){return(new k(this.document)).setStart(this.startContainer,this.startOffset).setEnd(this.endContainer, |
|||
this.endOffset)},collapse:function(a){a?(this.endContainer=this.startContainer,this.endOffset=this.startOffset):(this.startContainer=this.endContainer,this.startOffset=this.endOffset);this.collapsed=!0;return this},shrinkBoundary:function(a){function g(a){return 1==a.nodeType&&!f.isBookmarkNode(a)&&!w.$empty[a.tagName]&&!w.$nonChild[a.tagName]}for(var b,e=this.collapsed;1==this.startContainer.nodeType&&(b=this.startContainer.childNodes[this.startOffset])&&g(b);)this.setStart(b,0);if(e)return this.collapse(!0); |
|||
if(!a)for(;1==this.endContainer.nodeType&&0<this.endOffset&&(b=this.endContainer.childNodes[this.endOffset-1])&&g(b);)this.setEnd(b,b.childNodes.length);return this},getCommonAncestor:function(a,b){var g=this.startContainer,e=this.endContainer;return g===e?a&&d(this)&&(g=g.childNodes[this.startOffset],1==g.nodeType)?g:b&&3==g.nodeType?g.parentNode:g:f.getCommonAncestor(g,e)},trimBoundary:function(a){this.txtToElmBoundary();var g=this.startContainer,b=this.startOffset,e=this.collapsed,c=this.endContainer; |
|||
if(3==g.nodeType){if(0==b)this.setStartBefore(g);else if(b>=g.nodeValue.length)this.setStartAfter(g);else{var l=f.split(g,b);g===c?this.setEnd(l,this.endOffset-b):g.parentNode===c&&(this.endOffset+=1);this.setStartBefore(l)}if(e)return this.collapse(!0)}a||(b=this.endOffset,c=this.endContainer,3==c.nodeType&&(0==b?this.setEndBefore(c):(b<c.nodeValue.length&&f.split(c,b),this.setEndAfter(c))));return this},txtToElmBoundary:function(a){function g(a,b){var e=a[b+"Container"],c=a[b+"Offset"];if(3==e.nodeType)if(!c)a["set"+ |
|||
b.replace(/(\w)/,function(a){return a.toUpperCase()})+"Before"](e);else if(c>=e.nodeValue.length)a["set"+b.replace(/(\w)/,function(a){return a.toUpperCase()})+"After"](e)}if(a||!this.collapsed)g(this,"start"),g(this,"end");return this},insertNode:function(a){var g=a,b=1;11==a.nodeType&&(g=a.firstChild,b=a.childNodes.length);this.trimBoundary(!0);var e=this.startContainer,c=e.childNodes[this.startOffset];c?e.insertBefore(a,c):e.appendChild(a);g.parentNode===this.endContainer&&(this.endOffset+=b);return this.setStartBefore(g)}, |
|||
setCursor:function(a,g){return this.collapse(!a).select(g)},createBookmark:function(a,g){var b,e=this.document.createElement("span");e.style.cssText="display:none;line-height:0px;";e.appendChild(this.document.createTextNode("\u200d"));e.id="_baidu_bookmark_start_"+(g?"":h++);this.collapsed||(b=e.cloneNode(!0),b.id="_baidu_bookmark_end_"+(g?"":h++));this.insertNode(e);b&&this.collapse().insertNode(b).setEndBefore(b);this.setStartAfter(e);return{start:a?e.id:e,end:b?a?b.id:b:null,id:a}},moveToBookmark:function(a){var g= |
|||
a.id?this.document.getElementById(a.start):a.start;a=a.end&&a.id?this.document.getElementById(a.end):a.end;this.setStartBefore(g);f.remove(g);a?(this.setEndBefore(a),f.remove(a)):this.collapse(!0);return this},enlarge:function(a,g){var b=f.isBody,e,c,l=this.document.createTextNode("");if(a){c=this.startContainer;1==c.nodeType?c.childNodes[this.startOffset]?e=c=c.childNodes[this.startOffset]:(c.appendChild(l),e=c=l):e=c;for(;;){if(f.isBlockElm(c)){for(c=e;(e=c.previousSibling)&&!f.isBlockElm(e);)c= |
|||
e;this.setStartBefore(c);break}e=c;c=c.parentNode}c=this.endContainer;1==c.nodeType?((e=c.childNodes[this.endOffset])?c.insertBefore(l,e):c.appendChild(l),e=c=l):e=c;for(;;){if(f.isBlockElm(c)){for(c=e;(e=c.nextSibling)&&!f.isBlockElm(e);)c=e;this.setEndAfter(c);break}e=c;c=c.parentNode}l.parentNode===this.endContainer&&this.endOffset--;f.remove(l)}if(!this.collapsed){for(;!(0!=this.startOffset||g&&g(this.startContainer)||b(this.startContainer));)this.setStartBefore(this.startContainer);for(;!(this.endOffset!= |
|||
(1==this.endContainer.nodeType?this.endContainer.childNodes.length:this.endContainer.nodeValue.length)||g&&g(this.endContainer)||b(this.endContainer));)this.setEndAfter(this.endContainer)}return this},enlargeToBlockElm:function(a){for(;!f.isBlockElm(this.startContainer);)this.setStartBefore(this.startContainer);if(!a)for(;!f.isBlockElm(this.endContainer);)this.setEndAfter(this.endContainer);return this},adjustmentBoundary:function(){if(!this.collapsed){for(;!f.isBody(this.startContainer)&&this.startOffset== |
|||
this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length&&this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length;)this.setStartAfter(this.startContainer);for(;!f.isBody(this.endContainer)&&!this.endOffset&&this.endContainer[3==this.endContainer.nodeType?"nodeValue":"childNodes"].length;)this.setEndBefore(this.endContainer)}return this},applyInlineStyle:function(a,g,b){if(this.collapsed)return this;this.trimBoundary().enlarge(!1,function(a){return 1== |
|||
a.nodeType&&f.isBlockElm(a)}).adjustmentBoundary();for(var e=this.createBookmark(),c=e.end,l=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase():!f.isWhitespace(a)},k=f.getNextDomNode(e.start,!1,l),h,d,p=this.cloneRange();k&&f.getPosition(k,c)&f.POSITION_PRECEDING;)if(3==k.nodeType||w[a][k.tagName]){p.setStartBefore(k);for(h=k;h&&(3==h.nodeType||w[a][h.tagName])&&h!==c;)d=h,h=f.getNextDomNode(h,1==h.nodeType,null,function(g){return w[a][g.tagName]});var k=p.setEndAfter(d).extractContents(), |
|||
B;if(b&&0<b.length){var O;O=B=b[0].cloneNode(!1);for(var r=1,t;t=b[r++];)B.appendChild(t.cloneNode(!1)),B=B.firstChild}else B=p.document.createElement(a);g&&f.setAttributes(B,g);B.appendChild(k);p.insertNode(b?O:B);var U;"span"==a&&g.style&&/text\-decoration/.test(g.style)&&(U=f.findParentByTagName(B,"a",!0))?(f.setAttributes(U,g),f.remove(B,!0),B=U):(f.mergeSibling(B),f.clearEmptySibling(B));f.mergeChild(B,g);k=f.getNextDomNode(B,!1,l);f.mergeToParent(B);if(h===c)break}else k=f.getNextDomNode(k, |
|||
!0,l);return this.moveToBookmark(e)},removeInlineStyle:function(a){if(this.collapsed)return this;a=p.isArray(a)?a:[a];this.shrinkBoundary().adjustmentBoundary();for(var g=this.startContainer,b=this.endContainer;;){if(1==g.nodeType){if(-1<p.indexOf(a,g.tagName.toLowerCase()))break;if("body"==g.tagName.toLowerCase()){g=null;break}}g=g.parentNode}for(;;){if(1==b.nodeType){if(-1<p.indexOf(a,b.tagName.toLowerCase()))break;if("body"==b.tagName.toLowerCase()){b=null;break}}b=b.parentNode}var e=this.createBookmark(), |
|||
c,l;g&&(l=this.cloneRange().setEndBefore(e.start).setStartBefore(g),c=l.extractContents(),l.insertNode(c),f.clearEmptySibling(g,!0),g.parentNode.insertBefore(e.start,g));b&&(l=this.cloneRange().setStartAfter(e.end).setEndAfter(b),c=l.extractContents(),l.insertNode(c),f.clearEmptySibling(b,!1,!0),b.parentNode.insertBefore(e.end,b.nextSibling));for(g=f.getNextDomNode(e.start,!1,function(a){return 1==a.nodeType});g&&g!==e.end;)b=f.getNextDomNode(g,!0,function(a){return 1==a.nodeType}),-1<p.indexOf(a, |
|||
g.tagName.toLowerCase())&&f.remove(g,!0),g=b;return this.moveToBookmark(e)},getClosedNode:function(){var a;if(!this.collapsed){var g=this.cloneRange().adjustmentBoundary().shrinkBoundary();d(g)&&(g=g.startContainer.childNodes[g.startOffset])&&1==g.nodeType&&(w.$empty[g.tagName]||w.$nonChild[g.tagName])&&(a=g)}return a},select:r.ie?function(b,c){var k;this.collapsed||this.shrinkBoundary();var h=this.getClosedNode();if(h&&!c){try{k=this.document.body.createControlRange(),k.addElement(h),k.select()}catch(d){}return this}var h= |
|||
this.createBookmark(),z=h.start;k=this.document.body.createTextRange();k.moveToElementText(z);k.moveStart("character",1);if(!this.collapsed){var v=this.document.body.createTextRange(),z=h.end;v.moveToElementText(z);k.setEndPoint("EndToEnd",v)}else if(!b&&3!=this.startContainer.nodeType){var v=this.document.createTextNode(g),D=this.document.createElement("span");D.appendChild(this.document.createTextNode(g));z.parentNode.insertBefore(D,z);z.parentNode.insertBefore(v,z);a(this.document,v);l=v;e(D,"previousSibling"); |
|||
e(z,"nextSibling");k.moveStart("character",-1);k.collapse(!0)}this.moveToBookmark(h);D&&f.remove(D);try{k.select()}catch(p){}return this}:function(b){function c(a){function b(g,e,c){3==g.nodeType&&g.nodeValue.length<e&&(a[c+"Offset"]=g.nodeValue.length)}b(a.startContainer,a.startOffset,"start");b(a.endContainer,a.endOffset,"end")}var k=f.getWindow(this.document),h=k.getSelection();r.gecko?this.document.body.focus():k.focus();if(h){h.removeAllRanges();this.collapsed&&!b&&(b=k=this.startContainer,1== |
|||
k.nodeType&&(b=k.childNodes[this.startOffset]),3==k.nodeType&&this.startOffset||(b?b.previousSibling&&3==b.previousSibling.nodeType:k.lastChild&&3==k.lastChild.nodeType)||(b=this.document.createTextNode(g),this.insertNode(b),a(this.document,b),e(b,"previousSibling"),e(b,"nextSibling"),l=b,this.setStart(b,r.webkit?1:0).collapse(!0)));k=this.document.createRange();if(this.collapsed&&r.opera&&1==this.startContainer.nodeType)if(b=this.startContainer.childNodes[this.startOffset]){for(;b&&f.isBlockElm(b);)if(1== |
|||
b.nodeType&&b.childNodes[0])b=b.childNodes[0];else break;b&&this.setStartBefore(b).collapse(!0)}else(b=this.startContainer.lastChild)&&f.isBr(b)&&this.setStartBefore(b).collapse(!0);c(this);k.setStart(this.startContainer,this.startOffset);k.setEnd(this.endContainer,this.endOffset);h.addRange(k)}return this},scrollToView:function(a,b){a=a?window:f.getWindow(this.document);var g=this.document.createElement("span");g.innerHTML=" ";this.cloneRange().insertNode(g);f.scrollToView(g,a,b);f.remove(g); |
|||
return this},inFillChar:function(){var a=this.startContainer;return this.collapsed&&3==a.nodeType&&a.nodeValue.replace(new RegExp("^"+f.fillChar),"").length+1==a.nodeValue.length?!0:!1},createAddress:function(a,b){function g(a){for(var e=a?c.startContainer:c.endContainer,k=f.findParents(e,!0,function(a){return!f.isBody(a)}),l=[],h=0,d;d=k[h++];)l.push(f.getNodeIndex(d,b));k=0;if(b)if(3==e.nodeType){for(e=e.previousSibling;e&&3==e.nodeType;)k+=e.nodeValue.replace(Q,"").length,e=e.previousSibling;k+= |
|||
a?c.startOffset:c.endOffset}else if(e=e.childNodes[a?c.startOffset:c.endOffset])k=f.getNodeIndex(e,b);else for(e=a?c.startContainer:c.endContainer,a=e.firstChild;a;)if(f.isFillChar(a))a=a.nextSibling;else if(k++,3==a.nodeType)for(;a&&3==a.nodeType;)a=a.nextSibling;else a=a.nextSibling;else k=a?f.isFillChar(e)?0:c.startOffset:c.endOffset;0>k&&(k=0);l.push(k);return l}var e={},c=this;e.startAddress=g(!0);a||(e.endAddress=c.collapsed?[].concat(e.startAddress):g());return e},moveToAddress:function(a, |
|||
b){function g(a,b){for(var c=e.document.body,k,l,h=0,d,n=a.length;h<n;h++)if(d=a[h],k=c,c=c.childNodes[d],!c){l=d;break}b?c?e.setStartBefore(c):e.setStart(k,l):c?e.setEndBefore(c):e.setEnd(k,l)}var e=this;g(a.startAddress,!0);!b&&a.endAddress&&g(a.endAddress);return e},equals:function(a){for(var b in this)if(this.hasOwnProperty(b)&&this[b]!==a[b])return!1;return!0},traversal:function(a,b){if(this.collapsed)return this;for(var g=this.createBookmark(),e=g.end,c=f.getNextDomNode(g.start,!1,b);c&&c!== |
|||
e&&f.getPosition(c,e)&f.POSITION_PRECEDING;){var k=f.getNextDomNode(c,!1,b);a(c);c=k}return this.moveToBookmark(g)}}})();(function(){function d(a,b){var c=f.getNodeIndex;a=a.duplicate();a.collapse(b);var g=a.parentElement();if(!g.hasChildNodes())return{container:g,offset:0};for(var l=g.children,k,d=a.duplicate(),n=0,q=l.length-1,u=-1;n<=q;){u=Math.floor((n+q)/2);k=l[u];d.moveToElementText(k);var x=d.compareEndPoints("StartToStart",a);if(0<x)q=u-1;else if(0>x)n=u+1;else return{container:g,offset:c(k)}}if(-1== |
|||
u){d.moveToElementText(g);d.setEndPoint("StartToStart",a);d=d.text.replace(/(\r\n|\r)/g,"\n").length;l=g.childNodes;if(!d)return k=l[l.length-1],{container:k,offset:k.nodeValue.length};for(c=l.length;0<d;)d-=l[--c].nodeValue.length;return{container:l[c],offset:-d}}d.collapse(0<x);d.setEndPoint(0<x?"StartToStart":"EndToStart",a);d=d.text.replace(/(\r\n|\r)/g,"\n").length;if(!d)return w.$empty[k.tagName]||w.$nonChild[k.tagName]?{container:g,offset:c(k)+(0<x?0:1)}:{container:k,offset:0<x?0:k.childNodes.length}; |
|||
for(;0<d;)try{l=k,k=k[0<x?"previousSibling":"nextSibling"],d-=k.nodeValue.length}catch(z){return{container:g,offset:c(l)}}return{container:k,offset:0<x?-d:k.nodeValue.length+d}}function b(a,b){if(a.item)b.selectNode(a.item(0));else{var c=d(a,!0);b.setStart(c.container,c.offset);0!=a.compareEndPoints("StartToEnd",a)&&(c=d(a,!1),b.setEnd(c.container,c.offset))}return b}function c(a){var b;try{b=a.getNative().createRange()}catch(c){return null}var g=b.item?b.item(0):b.parentElement();return(g.ownerDocument|| |
|||
g)===a.document?b:null}(M.Selection=function(a){var b=this;b.document=a;r.ie9below&&(a=f.getWindow(a).frameElement,f.on(a,"beforedeactivate",function(){b._bakIERange=b.getIERange()}),f.on(a,"activate",function(){try{!c(b)&&b._bakIERange&&b._bakIERange.select()}catch(a){}b._bakIERange=null}));a=a=null}).prototype={rangeInBody:function(a,b){var c=r.ie9below||b?a.item?a.item():a.parentElement():a.startContainer;return c===this.document.body||f.inDoc(c,this.document)},getNative:function(){var a=this.document; |
|||
try{return a?r.ie9below?a.selection:f.getWindow(a).getSelection():null}catch(b){return null}},getIERange:function(){var a=c(this);return!a&&this._bakIERange?this._bakIERange:a},cache:function(){this.clear();this._cachedRange=this.getRange();this._cachedStartElement=this.getStart();this._cachedStartElementPath=this.getStartElementPath()},getStartElementPath:function(){if(this._cachedStartElementPath)return this._cachedStartElementPath;var a=this.getStart();return a?f.findParents(a,!0,null,!0):[]}, |
|||
clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{if(r.ie9below){var a=c(this);return!(!a||!this.rangeInBody(a))}return!!this.getNative().rangeCount}catch(b){return!1}},getRange:function(){function a(a){for(var b=c.document.body.firstChild,g=a.collapsed;b&&b.firstChild;)a.setStart(b,0),b=b.firstChild;a.startContainer||a.setStart(c.document.body,0);g&&a.collapse(!0)}var c=this;if(null!=c._cachedRange)return this._cachedRange;var h= |
|||
new t.editor.dom.Range(c.document);if(r.ie9below){var g=c.getIERange();if(g)try{b(g,h)}catch(l){a(h)}else a(h)}else{var k=c.getNative();if(k&&k.rangeCount)g=k.getRangeAt(0),k=k.getRangeAt(k.rangeCount-1),h.setStart(g.startContainer,g.startOffset).setEnd(k.endContainer,k.endOffset),h.collapsed&&f.isBody(h.startContainer)&&!h.startOffset&&a(h);else{if(this._bakRange&&f.inDoc(this._bakRange.startContainer,this.document))return this._bakRange;a(h)}}return this._bakRange=h},getStart:function(){if(this._cachedStartElement)return this._cachedStartElement; |
|||
var a=r.ie9below?this.getIERange():this.getRange(),b,c;if(r.ie9below){if(!a)return this.document.body.firstChild;if(a.item)return a.item(0);b=a.duplicate();0<b.text.length&&b.moveStart("character",1);b.collapse(1);b=b.parentElement();for(c=a=a.parentElement();a=a.parentNode;)if(a==b){b=c;break}}else if(a.shrinkBoundary(),b=a.startContainer,1==b.nodeType&&b.hasChildNodes()&&(b=b.childNodes[Math.min(b.childNodes.length-1,a.startOffset)]),3==b.nodeType)return b.parentNode;return b},getText:function(){var a; |
|||
return this.isFocus()&&(a=this.getNative())?(a=r.ie9below?a.createRange():a.getRangeAt(0),r.ie9below?a.text:a.toString()):""},clearRange:function(){this.getNative()[r.ie9below?"empty":"removeAllRanges"]()}}})();(function(){function d(a,b){var c;if(b.textarea)if(p.isString(b.textarea))for(var e=0,h,d=f.getElementsByTagName(a,"textarea");h=d[e++];){if(h.id=="ueditor_textarea_"+b.options.textarea){c=h;break}}else c=b.textarea;c||(a.appendChild(c=f.createElement(document,"textarea",{name:b.options.textarea, |
|||
id:"ueditor_textarea_"+b.options.textarea,style:"display:none"})),b.textarea=c);!c.getAttribute("name")&&c.setAttribute("name",b.options.textarea);c.value=b.hasContents()?b.options.allHtmlEnabled?b.getAllHtml():b.getContent(null,null,!0):""}function b(a){for(var b in a)return b}function c(a){a.langIsReady=!0;a.fireEvent("langReady")}var a=0,e,h=UE.Editor=function(g){var e=this;e.uid=a++;ba.call(e);e.commands={};e.options=p.extend(p.clone(g||{}),UEDITOR_CONFIG,!0);e.shortcutkeys={};e.inputRules=[]; |
|||
e.outputRules=[];e.setOpt(h.defaultOptions(e));e.loadServerConfig();p.isEmptyObject(UE.I18N)?p.loadFile(document,{src:e.options.langPath+e.options.lang+"/"+e.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},function(){UE.plugin.load(e);c(e)}):(e.options.lang=b(UE.I18N),UE.plugin.load(e),c(e));UE.instants["ueditorInstant"+e.uid]=e};h.prototype={registerCommand:function(a,b){this.commands[a]=b},ready:function(a){a&&(this.isReady?a.apply(this):this.addListener("ready",a))},setOpt:function(a, |
|||
b){var c={};p.isString(a)?c[a]=b:c=a;p.extend(this.options,c,!0)},getOpt:function(a){return this.options[a]},destroy:function(){this.fireEvent("destroy");var a=this.container.parentNode,b=this.textarea;b?b.style.display="":(b=document.createElement("textarea"),a.parentNode.insertBefore(b,a));b.style.width=this.iframe.offsetWidth+"px";b.style.height=this.iframe.offsetHeight+"px";b.value=this.getContent();b.id=this.key;a.innerHTML="";f.remove(a);var a=this.key,c;for(c in this)this.hasOwnProperty(c)&& |
|||
delete this[c];UE.delEditor(a)},render:function(a){var b=this.options;p.isString(a)&&(a=document.getElementById(a));if(a){b.minFrameWidth=b.initialFrameWidth?b.initialFrameWidth:b.initialFrameWidth=a.offsetWidth;b.initialFrameHeight?b.minFrameHeight=b.initialFrameHeight:b.initialFrameHeight=b.minFrameHeight=a.offsetHeight;a.style.width=/%$/.test(b.initialFrameWidth)?"100%":b.initialFrameWidth-parseInt(f.getComputedStyle(a,"padding-left"))-parseInt(f.getComputedStyle(a,"padding-right"))+"px";a.style.height= |
|||
/%$/.test(b.initialFrameHeight)?"100%":b.initialFrameHeight-parseInt(f.getComputedStyle(a,"padding-top"))-parseInt(f.getComputedStyle(a,"padding-bottom"))+"px";a.style.zIndex=b.zIndex;var c=(J&&9>r.version?"":"<!DOCTYPE html>")+"<html xmlns='http://www.w3.org/1999/xhtml' class='view' ><head><style type='text/css'>.view{padding:0;word-wrap:break-word;cursor:text;height:90%;}\nbody{margin:8px;font-family:sans-serif;font-size:16px;}p{margin:5px 0;}</style>"+(b.iframeCssUrl?"<link rel='stylesheet' type='text/css' href='"+ |
|||
p.unhtml(b.iframeCssUrl)+"'/>":"")+(b.initialStyle?"<style>"+b.initialStyle+"</style>":"")+"</head><body class='view' ></body><script type='text/javascript' "+(J?"defer='defer'":"")+" id='_initialScript'>setTimeout(function(){editor = window.parent.UE.instants['ueditorInstant"+this.uid+"'];editor._setup(document);},0);var _tmpScript = document.getElementById('_initialScript');_tmpScript.parentNode.removeChild(_tmpScript);\x3c/script></html>";a.appendChild(f.createElement(document,"iframe",{id:"ueditor_"+ |
|||
this.uid,width:"100%",height:"100%",frameborder:"0",src:"javascript:void(function(){document.open();"+(b.customDomain&&document.domain!=location.hostname?'document.domain="'+document.domain+'";':"")+'document.write("'+c+'");document.close();}())'}));a.style.overflow="hidden";setTimeout(function(){/%$/.test(b.initialFrameWidth)&&(b.minFrameWidth=b.initialFrameWidth=a.offsetWidth);/%$/.test(b.initialFrameHeight)&&(b.minFrameHeight=b.initialFrameHeight=a.offsetHeight,a.style.height=b.initialFrameHeight+ |
|||
"px")})}},_setup:function(a){var b=this,c=b.options;J?(a.body.disabled=!0,a.body.contentEditable=!0,a.body.disabled=!1):a.body.contentEditable=!0;a.body.spellcheck=!1;b.document=a;b.window=a.defaultView||a.parentWindow;b.iframe=b.window.frameElement;b.body=a.body;b.selection=new M.Selection(a);var e;r.gecko&&(e=this.selection.getNative())&&e.removeAllRanges();this._initEvents();for(var h=this.iframe.parentNode;!f.isBody(h);h=h.parentNode)if("FORM"==h.tagName){b.form=h;if(b.options.autoSyncData)f.on(b.window, |
|||
"blur",function(){d(h,b)});else f.on(h,"submit",function(){d(this,b)});break}if(c.initialContent)if(c.autoClearinitialContent){var q=b.execCommand;b.execCommand=function(){b.fireEvent("firstBeforeExecCommand");return q.apply(b,arguments)};this._setDefaultContent(c.initialContent)}else this.setContent(c.initialContent,!1,!0);f.isEmptyNode(b.body)&&(b.body.innerHTML="<p>"+(r.ie?"":"<br/>")+"</p>");c.focus&&setTimeout(function(){b.focus(b.options.focusInEnd);!b.options.autoClearinitialContent&&b._selectionChange()}, |
|||
0);b.container||(b.container=this.iframe.parentNode);c.fullscreen&&b.ui&&b.ui.setFullScreen(!0);try{b.document.execCommand("2D-position",!1,!1)}catch(u){}try{b.document.execCommand("enableInlineTableEditing",!1,!1)}catch(x){}try{b.document.execCommand("enableObjectResizing",!1,!1)}catch(z){}b._bindshortcutKeys();b.isReady=1;b.fireEvent("ready");c.onready&&c.onready.call(b);if(!r.ie9below)f.on(b.window,["blur","focus"],function(a){if("blur"==a.type){b._bakRange=b.selection.getRange();try{b._bakNativeRange= |
|||
b.selection.getNative().getRangeAt(0),b.selection.getNative().removeAllRanges()}catch(c){b._bakNativeRange=null}}else try{b._bakRange&&b._bakRange.select()}catch(e){}});r.gecko&&10902>=r.version&&(b.body.contentEditable=!1,setTimeout(function(){b.body.contentEditable=!0},100),setInterval(function(){b.body.style.height=b.iframe.offsetHeight-20+"px"},100));!c.isShow&&b.setHide();c.readonly&&b.setDisabled()},sync:function(a){(a=a?document.getElementById(a):f.findParent(this.iframe.parentNode,function(a){return"FORM"== |
|||
a.tagName},!0))&&d(a,this)},setHeight:function(a,b){a!==parseInt(this.iframe.parentNode.style.height)&&(this.iframe.parentNode.style.height=a+"px");!b&&(this.options.minFrameHeight=this.options.initialFrameHeight=a);this.body.style.height=a+"px";!b&&this.trigger("setHeight")},addshortcutkey:function(a,b){var c={};b?c[a]=b:c=a;p.extend(this.shortcutkeys,c)},_bindshortcutKeys:function(){var a=this,b=this.shortcutkeys;a.addListener("keydown",function(c,e){var h=e.keyCode||e.which,d;for(d in b)for(var u= |
|||
b[d].split(","),x=0,z;z=u[x++];){z=z.split(":");var v=z[0];z=z[1];if(/^(ctrl)(\+shift)?\+(\d+)$/.test(v.toLowerCase())||/^(\d+)$/.test(v))if("ctrl"==RegExp.$1&&(e.ctrlKey||e.metaKey)&&(""!=RegExp.$2?e[RegExp.$2.slice(1)+"Key"]:1)&&h==RegExp.$3||h==RegExp.$1)-1!=a.queryCommandState(d,z)&&a.execCommand(d,z),f.preventDefault(e)}})},getContent:function(a,b,c,e,h){a&&p.isFunction(a)&&(b=a,a="");if(b?!b():!this.hasContents())return"";this.fireEvent("beforegetcontent");b=UE.htmlparser(this.body.innerHTML, |
|||
e);this.filterOutputRule(b);this.fireEvent("aftergetcontent",a,b);return b.toHtml(h)},getAllHtml:function(){var a=[];this.fireEvent("getAllHtml",a);if(r.ie&&8<r.version){var b="";p.each(this.document.styleSheets,function(a){b+=a.href?'<link rel="stylesheet" type="text/css" href="'+a.href+'" />':"<style>"+a.cssText+"</style>"});p.each(this.document.getElementsByTagName("script"),function(a){b+=a.outerHTML})}return"<html><head>"+(this.options.charset?'<meta http-equiv="Content-Type" content="text/html; charset='+ |
|||
this.options.charset+'"/>':"")+(b||this.document.getElementsByTagName("head")[0].innerHTML)+a.join("\n")+"</head><body "+(J&&9>r.version?'class="view"':"")+">"+this.getContent(null,null,!0)+"</body></html>"},getPlainTxt:function(){var a=new RegExp(f.fillChar,"g"),b=this.body.innerHTML.replace(/[\n\r]/g,""),b=b.replace(/<(p|div)[^>]*>(<br\/?>| )<\/\1>/gi,"\n").replace(/<br\/?>/gi,"\n").replace(/<[^>/]+>/g,"").replace(/(\n)?<\/([^>]+)>/g,function(a,b,c){return w.$block[c]?"\n":b?b:""});return b.replace(a, |
|||
"").replace(/\u00a0/g," ").replace(/ /g," ")},getContentTxt:function(){return this.body[r.ie?"innerText":"textContent"].replace(new RegExp(f.fillChar,"g"),"").replace(/\u00a0/g," ")},setContent:function(a,b,c){this.fireEvent("beforesetcontent",a);a=UE.htmlparser(a);this.filterInputRule(a);a=a.toHtml();this.body.innerHTML=(b?this.body.innerHTML:"")+a;if("p"==this.options.enterTag)if(b=this.body.firstChild,!b||1==b.nodeType&&(w.$cdata[b.tagName]||"DIV"==b.tagName&&b.getAttribute("cdata_tag")|| |
|||
f.isCustomeNode(b))&&b===this.body.lastChild)this.body.innerHTML="<p>"+(r.ie?" ":"<br/>")+"</p>"+this.body.innerHTML;else for(var e=this.document.createElement("p");b;){for(;b&&(3==b.nodeType||1==b.nodeType&&w.p[b.tagName]&&!w.$cdata[b.tagName]);)a=b.nextSibling,e.appendChild(b),b=a;if(e.firstChild)if(b)b.parentNode.insertBefore(e,b),e=this.document.createElement("p");else{this.body.appendChild(e);break}b=b.nextSibling}this.fireEvent("aftersetcontent");this.fireEvent("contentchange");!c&&this._selectionChange(); |
|||
this._bakRange=this._bakIERange=this._bakNativeRange=null;var h;r.gecko&&(h=this.selection.getNative())&&h.removeAllRanges();this.options.autoSyncData&&this.form&&d(this.form,this)},focus:function(a){try{var b=this.selection.getRange();if(a){var c=this.body.lastChild;c&&1==c.nodeType&&!w.$empty[c.tagName]&&(f.isEmptyBlock(c)?b.setStartAtFirst(c):b.setStartAtLast(c),b.collapse(!0));b.setCursor(!0)}else!b.collapsed&&f.isBody(b.startContainer)&&0==b.startOffset&&(c=this.body.firstChild)&&1==c.nodeType&& |
|||
!w.$empty[c.tagName]&&b.setStartAtFirst(c).collapse(!0),b.select(!0);this.fireEvent("focus selectionchange")}catch(e){}},isFocus:function(){return this.selection.isFocus()},blur:function(){var a=this.selection.getNative();if(a.empty&&r.ie){var b=document.body.createTextRange();b.moveToElementText(document.body);b.collapse(!0);b.select();a.empty()}else a.removeAllRanges()},_initEvents:function(){var a=this,b=a.document,c=a.window;a._proxyDomEvent=p.bind(a._proxyDomEvent,a);f.on(b,"click contextmenu mousedown keydown keyup keypress mouseup mouseover mouseout selectstart".split(" "), |
|||
a._proxyDomEvent);f.on(c,["focus","blur"],a._proxyDomEvent);f.on(a.body,"drop",function(b){r.gecko&&b.stopPropagation&&b.stopPropagation();a.fireEvent("contentchange")});f.on(b,["mouseup","keydown"],function(b){"keydown"==b.type&&(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)||2!=b.button&&a._selectionChange(250,b)})},_proxyDomEvent:function(a){return!1===this.fireEvent("before"+a.type.replace(/^on/,"").toLowerCase())||!1===this.fireEvent(a.type.replace(/^on/,""),a)?!1:this.fireEvent("after"+a.type.replace(/^on/, |
|||
"").toLowerCase())},_selectionChange:function(a,b){var c=this,h=!1,d,f;r.ie&&9>r.version&&b&&"mouseup"==b.type&&!this.selection.getRange().collapsed&&(h=!0,d=b.clientX,f=b.clientY);clearTimeout(e);e=setTimeout(function(){if(c.selection&&c.selection.getNative()){var a;if(h&&"None"==c.selection.getNative().type){a=c.document.body.createTextRange();try{a.moveToPoint(d,f)}catch(e){a=null}}var g;a&&(g=c.selection.getIERange,c.selection.getIERange=function(){return a});c.selection.cache();g&&(c.selection.getIERange= |
|||
g);c.selection._cachedRange&&c.selection._cachedStartElement&&(c.fireEvent("beforeselectionchange"),c.fireEvent("selectionchange",!!b),c.fireEvent("afterselectionchange"),c.selection.clear())}},a||50)},_callCmdFn:function(a,b){var c=b[0].toLowerCase(),e;e=(c=this.commands[c]||UE.commands[c])&&c[a];if(!(c&&e||"queryCommandState"!=a))return 0;if(e)return e.apply(this,b)},execCommand:function(a){a=a.toLowerCase();var b,c=this.commands[a]||UE.commands[a];if(!c||!c.execCommand)return null;c.notNeedUndo|| |
|||
this.__hasEnterExecCommand?(b=this._callCmdFn("execCommand",arguments),this.__hasEnterExecCommand||c.ignoreContentChange||this._ignoreContentChange||this.fireEvent("contentchange")):(this.__hasEnterExecCommand=!0,-1!=this.queryCommandState.apply(this,arguments)&&(this.fireEvent("saveScene"),this.fireEvent.apply(this,["beforeexeccommand",a].concat(arguments)),b=this._callCmdFn("execCommand",arguments),this.fireEvent.apply(this,["afterexeccommand",a].concat(arguments)),this.fireEvent("saveScene")), |
|||
this.__hasEnterExecCommand=!1);this.__hasEnterExecCommand||c.ignoreContentChange||this._ignoreContentChange||this._selectionChange();return b},queryCommandState:function(a){return this._callCmdFn("queryCommandState",arguments)},queryCommandValue:function(a){return this._callCmdFn("queryCommandValue",arguments)},hasContents:function(a){if(a)for(var b=0,c;c=a[b++];)if(0<this.document.getElementsByTagName(c).length)return!0;if(!f.isEmptyBlock(this.body))return!0;a=["div"];for(b=0;c=a[b++];){c=f.getElementsByTagName(this.document, |
|||
c);for(var e=0,h;h=c[e++];)if(f.isCustomeNode(h))return!0}return!1},reset:function(){this.fireEvent("reset")},setEnabled:function(){var a;if("false"==this.body.contentEditable){this.body.contentEditable=!0;a=this.selection.getRange();try{a.moveToBookmark(this.lastBk),delete this.lastBk}catch(b){a.setStartAtFirst(this.body).collapse(!0)}a.select(!0);this.bkqueryCommandState&&(this.queryCommandState=this.bkqueryCommandState,delete this.bkqueryCommandState);this.bkqueryCommandValue&&(this.queryCommandValue= |
|||
this.bkqueryCommandValue,delete this.bkqueryCommandValue);this.fireEvent("selectionchange")}},enable:function(){return this.setEnabled()},setDisabled:function(a){var b=this;a=a?p.isArray(a)?a:[a]:[];"true"==b.body.contentEditable&&(b.lastBk||(b.lastBk=b.selection.getRange().createBookmark(!0)),b.body.contentEditable=!1,b.bkqueryCommandState=b.queryCommandState,b.bkqueryCommandValue=b.queryCommandValue,b.queryCommandState=function(c){return-1!=p.indexOf(a,c)?b.bkqueryCommandState.apply(b,arguments): |
|||
-1},b.queryCommandValue=function(c){return-1!=p.indexOf(a,c)?b.bkqueryCommandValue.apply(b,arguments):null},b.fireEvent("selectionchange"))},disable:function(a){return this.setDisabled(a)},_setDefaultContent:function(){function a(){var b=this;b.document.getElementById("initContent")&&(b.body.innerHTML="<p>"+(J?"":"<br/>")+"</p>",b.removeListener("firstBeforeExecCommand focus",a),setTimeout(function(){b.focus();b._selectionChange()},0))}return function(b){this.body.innerHTML='<p id="initContent">'+ |
|||
b+"</p>";this.addListener("firstBeforeExecCommand focus",a)}}(),setShow:function(){var a=this.selection.getRange();if("none"==this.container.style.display){try{a.moveToBookmark(this.lastBk),delete this.lastBk}catch(b){a.setStartAtFirst(this.body).collapse(!0)}setTimeout(function(){a.select(!0)},100);this.container.style.display=""}},show:function(){return this.setShow()},setHide:function(){this.lastBk||(this.lastBk=this.selection.getRange().createBookmark(!0));this.container.style.display="none"}, |
|||
hide:function(){return this.setHide()},getLang:function(a){var b=UE.I18N[this.options.lang];if(!b)throw Error("not import language file");a=(a||"").split(".");for(var c=0,e;(e=a[c++])&&(b=b[e],b););return b},getContentLength:function(a,b){var c=this.getContent(!1,!1,!0).length;if(a){b=(b||[]).concat(["hr","img","iframe"]);for(var c=this.getContentTxt().replace(/[\t\r\n]+/g,"").length,e=0,h;h=b[e++];)c+=this.document.getElementsByTagName(h).length}return c},addInputRule:function(a){this.inputRules.push(a)}, |
|||
filterInputRule:function(a){for(var b=0,c;c=this.inputRules[b++];)c.call(this,a)},addOutputRule:function(a){this.outputRules.push(a)},filterOutputRule:function(a){for(var b=0,c;c=this.outputRules[b++];)c.call(this,a)},getActionUrl:function(a){a=this.getOpt(a)||a;var b=this.getOpt("imageUrl"),c=this.getOpt("serverUrl");!c&&b&&(c=b.replace(/^(.*[\/]).+([\.].+)$/,"$1controller$2"));return c?(c=c+(-1==c.indexOf("?")?"?":"&")+"action="+(a||""),p.formatUrl(c)):""}};p.inherits(h,ba)})();UE.Editor.defaultOptions= |
|||
function(d){d=d.options.UEDITOR_HOME_URL;return{isShow:!0,initialContent:"",initialStyle:"",autoClearinitialContent:!1,iframeCssUrl:d+"themes/iframe.css",textarea:"editorValue",focus:!1,focusInEnd:!0,autoClearEmptyNode:!0,fullscreen:!1,readonly:!1,zIndex:999,imagePopup:!0,enterTag:"p",customDomain:!1,lang:"zh-cn",langPath:d+"lang/",theme:"default",themePath:d+"themes/",allHtmlEnabled:!1,scaleEnabled:!1,tableNativeEditInFF:!1,autoSyncData:!0,fileNameFormat:"{time}{rand:6}"}};(function(){UE.Editor.prototype.loadServerConfig= |
|||
function(){function d(b){console&&console.error(b)}var b=this;setTimeout(function(){try{b.options.imageUrl&&b.setOpt("serverUrl",b.options.imageUrl.replace(/^(.*[\/]).+([\.].+)$/,"$1controller$2"));var c=b.getActionUrl("config"),a=p.isCrossDomainUrl(c);b._serverConfigLoaded=!1;c&&UE.ajax.request(c,{method:"GET",dataType:a?"jsonp":"",onsuccess:function(c){try{var e=a?c:eval("("+c.responseText+")");p.extend(b.options,e);b.fireEvent("serverConfigLoaded");b._serverConfigLoaded=!0}catch(l){d(b.getLang("loadconfigFormatError"))}}, |
|||
onerror:function(){d(b.getLang("loadconfigHttpError"))}})}catch(e){d(b.getLang("loadconfigError"))}})};UE.Editor.prototype.isServerConfigLoaded=function(){return this._serverConfigLoaded||!1};UE.Editor.prototype.afterConfigReady=function(d){if(d&&p.isFunction(d)){var b=this,c=function(){d.apply(b,arguments);b.removeListener("serverConfigLoaded",c)};b.isServerConfigLoaded()?d.call(b,"serverConfigLoaded"):b.addListener("serverConfigLoaded",c)}}})();UE.ajax=function(){function d(a){var b=[],c;for(c in a)if("method"!= |
|||
c&&"timeout"!=c&&"async"!=c&&"dataType"!=c&&"callback"!=c&&void 0!=a[c]&&null!=a[c])if("function"!=(typeof a[c]).toLowerCase()&&"object"!=(typeof a[c]).toLowerCase())b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));else if(p.isArray(a[c]))for(var e=0;e<a[c].length;e++)b.push(encodeURIComponent(c)+"[]="+encodeURIComponent(a[c][e]));return b.join("&")}function b(a,b){var c=g(),e=!1,h={method:"POST",timeout:5E3,async:!0,data:{},onsuccess:function(){},onerror:function(){}};"object"===typeof a&& |
|||
(b=a,a=b.url);if(c&&a){var f=b?p.extend(h,b):h,h=d(f);p.isEmptyObject(f.data)||(h+=(h?"&":"")+d(f.data));var x=setTimeout(function(){4!=c.readyState&&(e=!0,c.abort(),clearTimeout(x))},f.timeout),z=f.method.toUpperCase(),v=a+(-1==a.indexOf("?")?"?":"&")+("POST"==z?"":h+"&noCache="+ +new Date);c.open(z,v,f.async);c.onreadystatechange=function(){if(4==c.readyState)if(e||200!=c.status)f.onerror(c);else f.onsuccess(c)};"POST"==z?(c.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),c.send(h)): |
|||
c.send(null)}}function c(a,b){function c(a){return function(){try{if(a)h.onerror&&h.onerror();else try{clearTimeout(F),e.apply(window,arguments)}catch(b){}}catch(c){h.onerror&&h.onerror.call(window,c)}finally{h.oncomplete&&h.oncomplete.apply(window,arguments);g.parentNode&&g.parentNode.removeChild(g);window[v]=null;try{delete window[v]}catch(k){}}}}var e=b.onsuccess||function(){},g=document.createElement("SCRIPT"),h=b||{},f=h.charset,z=h.jsonp||"callback",v,D=h.timeOut||0,F,H=new RegExp("(\\?|&)"+ |
|||
z+"=([^&]*)"),B;if(p.isFunction(e))v="bd__editor__"+Math.floor(2147483648*Math.random()).toString(36),window[v]=c(0);else if(p.isString(e))v=e;else if(B=H.exec(a))v=B[2];a=a.replace(H,"$1"+z+"="+v);0>a.search(H)&&(a+=(0>a.indexOf("?")?"?":"&")+z+"="+v);z=d(b);p.isEmptyObject(b.data)||(z+=(z?"&":"")+d(b.data));z&&(a=a.replace(/\?/,"?"+z+"&"));g.onerror=c(1);D&&(F=setTimeout(c(1),D));(function(a,b,c){a.setAttribute("type","text/javascript");a.setAttribute("defer","defer");c&&a.setAttribute("charset", |
|||
c);a.setAttribute("src",b);document.getElementsByTagName("head")[0].appendChild(a)})(g,a,f)}var a="XMLHttpRequest()";try{new ActiveXObject("Msxml2.XMLHTTP"),a="ActiveXObject('Msxml2.XMLHTTP')"}catch(e){try{new ActiveXObject("Microsoft.XMLHTTP"),a="ActiveXObject('Microsoft.XMLHTTP')"}catch(h){}}var g=new Function("return new "+a);return{request:function(a,e){e&&"jsonp"==e.dataType?c(a,e):b(a,e)},getJSONP:function(a,b,e){c(a,{data:b,oncomplete:e})}}}();UE.filterWord=function(){function d(b){return b= |
|||
b.replace(/[\d.]+\w+/g,function(a){return p.transUnitToPx(a)})}function b(b){return b.replace(/[\t\r\n]+/g," ").replace(/\x3c!--[\s\S]*?--\x3e/ig,"").replace(/<v:shape [^>]*>[\s\S]*?.<\/v:shape>/gi,function(a){if(r.opera)return"";try{if(/Bitmap/i.test(a))return"";var b=a.match(/width:([ \d.]*p[tx])/i)[1],c=a.match(/height:([ \d.]*p[tx])/i)[1],g=a.match(/src=\s*"([^"]*)"/i)[1];return'<img width="'+d(b)+'" height="'+d(c)+'" src="'+g+'" />'}catch(l){return""}}).replace(/<\/?div[^>]*>/g,"").replace(/v:\w+=(["']?)[^'"]+\1/g, |
|||
"").replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi,"").replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>").replace(/\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/ig,function(a,b,c,g){return"class"==b&&"MsoListParagraph"==g?a:""}).replace(/<(font|span)[^>]*>(\s*)<\/\1>/gi,function(a,b,c){return c.replace(/[\t\r\n ]+/g," ")}).replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,function(a,b,c,g){a=[]; |
|||
g=g.replace(/^\s+|\s+$/,"").replace(/'/g,"'").replace(/"/gi,"'").replace(/[\d.]+(cm|pt)/g,function(a){return p.transUnitToPx(a)}).split(/;\s*/g);c=0;for(var l;l=g[c];c++){var k,f=l.split(":");if(2==f.length&&(l=f[0].toLowerCase(),k=f[1].toLowerCase(),!(/^(background)\w*/.test(l)&&0==k.replace(/(initial|\s)/g,"").length||/^(margin)\w*/.test(l)&&/^0\w+$/.test(k)))){switch(l){case "mso-padding-alt":case "mso-padding-top-alt":case "mso-padding-right-alt":case "mso-padding-bottom-alt":case "mso-padding-left-alt":case "mso-margin-alt":case "mso-margin-top-alt":case "mso-margin-right-alt":case "mso-margin-bottom-alt":case "mso-margin-left-alt":case "mso-height":case "mso-width":case "mso-vertical-align-alt":/<table/.test(b)|| |
|||
(a[c]=l.replace(/^mso-|-alt$/g,"")+":"+d(k));continue;case "horiz-align":a[c]="text-align:"+k;continue;case "vert-align":a[c]="vertical-align:"+k;continue;case "font-color":case "mso-foreground":a[c]="color:"+k;continue;case "mso-background":case "mso-highlight":a[c]="background:"+k;continue;case "mso-default-height":a[c]="min-height:"+d(k);continue;case "mso-default-width":a[c]="min-width:"+d(k);continue;case "mso-padding-between-alt":a[c]="border-collapse:separate;border-spacing:"+d(k);continue; |
|||
case "text-line-through":if("single"==k||"double"==k)a[c]="text-decoration:line-through";continue;case "mso-zero-height":"yes"==k&&(a[c]="display:none");continue;case "margin":if(!/[1-9]/.test(k))continue}/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?:decor|trans)|top-bar|version|vnd|word-break)/.test(l)||/text\-indent|padding|margin/.test(l)&&/\-[\d.]+/.test(k)||(a[c]=l+":"+f[1])}}return b+(a.length?' style="'+a.join(";").replace(/;{2,}/g, |
|||
";")+'"':"")})}return function(c){return/(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|<(v|o):|lang=)/ig.test(c)?b(c):c}}();(function(){function d(a,b,c){a.push("\n");return b+(c?1:-1)}function b(a,b){for(var c=0;c<b;c++)a.push(" ")}function c(e,g,h,k){switch(e.type){case "root":for(var l=0,v;v=e.children[l++];)h&&"element"==v.type&&!w.$inlineWithA[v.tagName]&&1<l&&(d(g,k,!0),b(g,k)),c(v,g,h,k);break;case "text":"pre"==e.parentNode.tagName?g.push(e.data):g.push(f[e.parentNode.tagName]?p.html(e.data): |
|||
e.data.replace(/[ ]{2}/g," "));break;case "element":a(e,g,h,k);break;case "comment":g.push("\x3c!--"+e.data+"--\x3e")}return g}function a(a,e,g,h){var l="";if(a.attrs){var l=[],f=a.attrs,m;for(m in f)l.push(m+(void 0!==f[m]?'="'+(k[m]?p.html(f[m]).replace(/["]/g,function(a){return"""}):p.unhtml(f[m]))+'"':""));l=l.join(" ")}e.push("<"+a.tagName+(l?" "+l:"")+(w.$empty[a.tagName]?"/":"")+">");g&&!w.$inlineWithA[a.tagName]&&"pre"!=a.tagName&&a.children&&a.children.length&&(h=d(e,h,!0),b(e, |
|||
h));if(a.children&&a.children.length)for(l=0;f=a.children[l++];)g&&"element"==f.type&&!w.$inlineWithA[f.tagName]&&1<l&&(d(e,h),b(e,h)),c(f,e,g,h);w.$empty[a.tagName]||(g&&!w.$inlineWithA[a.tagName]&&"pre"!=a.tagName&&a.children&&a.children.length&&(h=d(e,h),b(e,h)),e.push("</"+a.tagName+">"))}function e(a,b){var c;if("element"==a.type&&a.getAttr("id")==b)return a;if(a.children&&a.children.length)for(var g=0;c=a.children[g++];)if(c=e(c,b))return c}function h(a,b,c){"element"==a.type&&a.tagName==b&& |
|||
c.push(a);if(a.children&&a.children.length)for(var e=0,g;g=a.children[e++];)h(g,b,c)}function g(a,b){if(a.children&&a.children.length)for(var c=0,e;e=a.children[c];)g(e,b),e.parentNode&&(e.children&&e.children.length&&b(e),e.parentNode&&c++);else b(a)}var l=UE.uNode=function(a){this.type=a.type;this.data=a.data;this.tagName=a.tagName;this.parentNode=a.parentNode;this.attrs=a.attrs||{};this.children=a.children},k={href:1,src:1,_src:1,_href:1,cdata_data:1},f={style:1,script:1};l.createElement=function(a){return/[<>]/.test(a)? |
|||
UE.htmlparser(a).children[0]:new l({type:"element",children:[],tagName:a})};l.createText=function(a,b){return new UE.uNode({type:"text",data:b?a:p.unhtml(a||"")})};l.prototype={toHtml:function(a){var b=[];c(this,b,a,0);return b.join("")},innerHTML:function(a){if("element"!=this.type||w.$empty[this.tagName])return this;if(p.isString(a)){if(this.children)for(var b=0,c;c=this.children[b++];)c.parentNode=null;this.children=[];a=UE.htmlparser(a);for(b=0;c=a.children[b++];)this.children.push(c),c.parentNode= |
|||
this;return this}a=new UE.uNode({type:"root",children:this.children});return a.toHtml()},innerText:function(a,b){if("element"!=this.type||w.$empty[this.tagName])return this;if(a){if(this.children)for(var c=0,e;e=this.children[c++];)e.parentNode=null;this.children=[];this.appendChild(l.createText(a,b));return this}return this.toHtml().replace(/<[^>]+>/g,"")},getData:function(){return"element"==this.type?"":this.data},firstChild:function(){return this.children?this.children[0]:null},lastChild:function(){return this.children? |
|||
this.children[this.children.length-1]:null},previousSibling:function(){for(var a=this.parentNode,b=0,c;c=a.children[b];b++)if(c===this)return 0==b?null:a.children[b-1]},nextSibling:function(){for(var a=this.parentNode,b=0,c;c=a.children[b++];)if(c===this)return a.children[b]},replaceChild:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c=0,e;e=this.children[c];c++)if(e===b)return this.children.splice(c,1,a),b.parentNode=null,a.parentNode=this,a}},appendChild:function(a){if("root"== |
|||
this.type||"element"==this.type&&!w.$empty[this.tagName]){this.children||(this.children=[]);a.parentNode&&a.parentNode.removeChild(a);for(var b=0,c;c=this.children[b];b++)if(c===a){this.children.splice(b,1);break}this.children.push(a);a.parentNode=this;return a}},insertBefore:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var c=0,e;e=this.children[c];c++)if(e===b)return this.children.splice(c,0,a),a.parentNode=this,a}},insertAfter:function(a,b){if(this.children){a.parentNode&& |
|||
a.parentNode.removeChild(a);for(var c=0,e;e=this.children[c];c++)if(e===b)return this.children.splice(c+1,0,a),a.parentNode=this,a}},removeChild:function(a,b){if(this.children)for(var c=0,e;e=this.children[c];c++)if(e===a){this.children.splice(c,1);e.parentNode=null;if(b&&e.children&&e.children.length)for(var g=0,h;h=e.children[g];g++)this.children.splice(c+g,0,h),h.parentNode=this;return e}},getAttr:function(a){return this.attrs&&this.attrs[a.toLowerCase()]},setAttr:function(a,b){if(a)if(this.attrs|| |
|||
(this.attrs={}),p.isObject(a))for(var c in a)a[c]?this.attrs[c.toLowerCase()]=a[c]:delete this.attrs[c];else b?this.attrs[a.toLowerCase()]=b:delete this.attrs[a];else delete this.attrs},getIndex:function(){for(var a=this.parentNode,b=0,c;c=a.children[b];b++)if(c===this)return b;return-1},getNodeById:function(a){var b;if(this.children&&this.children.length)for(var c=0;b=this.children[c++];)if(b=e(b,a))return b},getNodesByTagName:function(a){a=p.trim(a).replace(/[ ]{2,}/g," ").split(" ");var b=[],c= |
|||
this;p.each(a,function(a){if(c.children&&c.children.length)for(var e=0,g;g=c.children[e++];)h(g,a,b)});return b},getStyle:function(a){var b=this.getAttr("style");return b?(a=b.match(new RegExp("(^|;)\\s*"+a+":([^;]+)","i")))&&a[0]?a[2]:"":""},setStyle:function(a,b){function c(a,b){e=e.replace(new RegExp("(^|;)\\s*"+a+":([^;]+;?)","gi"),"$1");b&&(e=a+":"+p.unhtml(b)+";"+e)}var e=this.getAttr("style");e||(e="");if(p.isObject(a))for(var g in a)c(g,a[g]);else c(a,b);this.setAttr("style",p.trim(e))},traversal:function(a){this.children&& |
|||
this.children.length&&g(this,a);return this}}})();UE.htmlparser=function(d,b){function c(a,b){if(n[a.tagName]){var c=k.createElement(n[a.tagName]);a.appendChild(c);c.appendChild(k.createText(b))}else a.appendChild(k.createText(b))}function a(b,c,e){var g;if(g=m[c]){for(var d=b,f;"root"!=d.type;){if(p.isArray(g)?-1!=p.indexOf(g,d.tagName):g==d.tagName){b=d;f=!0;break}d=d.parentNode}f||(b=a(b,p.isArray(g)?g[0]:g))}g=new k({parentNode:b,type:"element",tagName:c.toLowerCase(),children:w.$empty[c]?null: |
|||
[]});if(e){for(d={};f=h.exec(e);)d[f[1].toLowerCase()]=l[f[1].toLowerCase()]?f[2]||f[3]||f[4]:p.unhtml(f[2]||f[3]||f[4]);g.attrs=d}b.children.push(g);return w.$empty[c]?b:g}var e=/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\s\/<>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g,h=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,g={b:1,code:1,i:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,span:1,sub:1,img:1,sup:1,font:1,big:1,small:1,iframe:1,a:1,br:1,pre:1}; |
|||
d=d.replace(new RegExp(f.fillChar,"g"),"");b||(d=d.replace(new RegExp("[\\r\\t\\n"+(b?"":" ")+"]*</?(\\w+)\\s*(?:[^>]*)>[\\r\\t\\n"+(b?"":" ")+"]*","g"),function(a,c){return c&&g[c.toLowerCase()]?a.replace(/(^[\n\r]+)|([\n\r]+$)/g,""):a.replace(new RegExp("^[\\r\\n"+(b?"":" ")+"]+"),"").replace(new RegExp("[\\r\\n"+(b?"":" ")+"]+$"),"")}));for(var l={href:1,src:1},k=UE.uNode,m={td:"tr",tr:["tbody","thead","tfoot"],tbody:"table",th:"tr",thead:"table",tfoot:"table",caption:"table",li:["ul","ol"],dt:"dl", |
|||
dd:"dl",option:"select"},n={ol:"li",ul:"li"},q,u=0,x=0,z=new k({type:"root",children:[]}),v=z;q=e.exec(d);){u=q.index;try{if(u>x&&c(v,d.slice(x,u)),q[3])w.$cdata[v.tagName]?c(v,q[0]):v=a(v,q[3].toLowerCase(),q[4]);else if(q[1]){if("root"!=v.type)if(w.$cdata[v.tagName]&&!w.$cdata[q[1]])c(v,q[0]);else{for(u=v;"element"==v.type&&v.tagName!=q[1].toLowerCase();)if(v=v.parentNode,"root"==v.type)throw v=u,"break";v=v.parentNode}}else q[2]&&v.children.push(new k({type:"comment",data:q[2],parentNode:v}))}catch(D){}x= |
|||
e.lastIndex}x<d.length&&c(v,d.slice(x));return z};UE.filterNode=function(){function d(b,c){switch(b.type){case "element":var a;if(a=c[b.tagName])if("-"===a)b.parentNode.removeChild(b);else if(p.isFunction(a)){var e=b.parentNode,h=b.getIndex();a(b);if(b.parentNode){if(b.children)for(a=0;h=b.children[a];)d(h,c),h.parentNode&&a++}else for(a=h;h=e.children[a];)d(h,c),h.parentNode&&a++}else{if((a=a.$)&&b.attrs){var h={},g;for(e in a){g=b.getAttr(e);if("style"==e&&p.isArray(a[e])){var l=[];p.each(a[e], |
|||
function(a){var c;(c=b.getStyle(a))&&l.push(a+":"+c)});g=l.join(";")}g&&(h[e]=g)}b.attrs=h}if(b.children)for(a=0;h=b.children[a];)d(h,c),h.parentNode&&a++}else if(w.$cdata[b.tagName])b.parentNode.removeChild(b);else for(e=b.parentNode,h=b.getIndex(),b.parentNode.removeChild(b,!0),a=h;h=e.children[a];)d(h,c),h.parentNode&&a++;break;case "comment":b.parentNode.removeChild(b)}}return function(b,c){if(p.isEmptyObject(c))return b;var a;(a=c["-"])&&p.each(a.split(" "),function(a){c[a]="-"});a=0;for(var e;e= |
|||
b.children[a];)d(e,c),e.parentNode&&a++;return b}}();UE.plugin=function(){var d={};return{register:function(b,c,a,e){a&&p.isFunction(a)&&(e=a,a=null);d[b]={optionName:a||b,execFn:c,afterDisabled:e}},load:function(b){p.each(d,function(c){var a=c.execFn.call(b);!1!==b.options[c.optionName]?a&&p.each(a,function(a,c){switch(c.toLowerCase()){case "shortcutkey":b.addshortcutkey(a);break;case "bindevents":p.each(a,function(a,c){b.addListener(c,a)});break;case "bindmultievents":p.each(p.isArray(a)?a:[a], |
|||
function(a){var c=p.trim(a.type).split(/\s+/);p.each(c,function(c){b.addListener(c,a.handler)})});break;case "commands":p.each(a,function(a,c){b.commands[c]=a});break;case "outputrule":b.addOutputRule(a);break;case "inputrule":b.addInputRule(a);break;case "defaultoptions":b.setOpt(a)}}):c.afterDisabled&&c.afterDisabled.call(b)});p.each(UE.plugins,function(c){c.call(b)})},run:function(b,c){var a=d[b];a&&a.exeFn.call(c)}}}();var ja=UE.keymap={Backspace:8,Tab:9,Enter:13,Shift:16,Control:17,Alt:18,CapsLock:20, |
|||
Esc:27,Spacebar:32,PageUp:33,PageDown:34,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Insert:45,Del:46,NumLock:144,Cmd:91,"=":187,"-":189,b:66,i:73,z:90,y:89,v:86,x:88,s:83,n:78},Z=UE.LocalStorage=function(){function d(){var a=document.createElement("div");a.style.display="none";if(!a.addBehavior)return null;a.addBehavior("#default#userdata");return{getItem:function(b){var h=null;try{document.body.appendChild(a),a.load(c),h=a.getAttribute(b),document.body.removeChild(a)}catch(g){}return h},setItem:function(b, |
|||
h){document.body.appendChild(a);a.setAttribute(b,h);a.save(c);document.body.removeChild(a)},removeItem:function(b){document.body.appendChild(a);a.removeAttribute(b);a.save(c);document.body.removeChild(a)}}}var b=window.localStorage||d()||null,c="localStorage";return{saveLocalData:function(a,c){return b&&c?(b.setItem(a,c),!0):!1},getLocalData:function(a){return b?b.getItem(a):null},removeItem:function(a){b&&b.removeItem(a)}}}();(function(){UE.Editor.prototype.setPreferences=function(d,b){var c={}; |
|||
p.isString(d)?c[d]=b:c=d;var a=Z.getLocalData("ueditor_preference");a&&(a=p.str2json(a))?p.extend(a,c):a=c;a&&Z.saveLocalData("ueditor_preference",p.json2str(a))};UE.Editor.prototype.getPreferences=function(d){var b=Z.getLocalData("ueditor_preference");return b&&(b=p.str2json(b))?d?b[d]:b:null};UE.Editor.prototype.removePreferences=function(d){var b=Z.getLocalData("ueditor_preference");b&&(b=p.str2json(b))&&(b[d]=void 0,delete b[d]);b&&Z.saveLocalData("ueditor_preference",p.json2str(b))}})();UE.plugins.defaultfilter= |
|||
function(){var d=this;d.setOpt({allowDivTransToP:!0,disabledTableInTable:!0});d.addInputRule(function(b){function c(a){for(;a&&"element"==a.type;){if("td"==a.tagName)return!0;a=a.parentNode}return!1}var a=this.options.allowDivTransToP,e;b.traversal(function(b){if("element"==b.type)if(w.$cdata[b.tagName]||!d.options.autoClearEmptyNode||!w.$inline[b.tagName]||w.$empty[b.tagName]||b.attrs&&!p.isEmptyObject(b.attrs))switch(b.tagName){case "style":case "script":b.setAttr({cdata_tag:b.tagName,cdata_data:b.innerHTML()|| |
|||
"",_ue_custom_node_:"true"});b.tagName="div";b.innerHTML("");break;case "a":(e=b.getAttr("href"))&&b.setAttr("_href",e);break;case "img":if((e=b.getAttr("src"))&&/^data:/.test(e)){b.parentNode.removeChild(b);break}b.setAttr("_src",b.getAttr("src"));break;case "span":r.webkit&&(e=b.getStyle("white-space"))&&/nowrap|normal/.test(e)&&(b.setStyle("white-space",""),d.options.autoClearEmptyNode&&p.isEmptyObject(b.attrs)&&b.parentNode.removeChild(b,!0));(e=b.getAttr("id"))&&/^_baidu_bookmark_/i.test(e)&& |
|||
b.parentNode.removeChild(b);break;case "p":if(e=b.getAttr("align"))b.setAttr("align"),b.setStyle("text-align",e);p.each(b.children,function(a){if("element"==a.type&&"p"==a.tagName){var c=a.nextSibling();for(b.parentNode.insertAfter(a,b);c;){var e=c.nextSibling();b.parentNode.insertAfter(c,a);a=c;c=e}return!1}});b.firstChild()||b.innerHTML(r.ie?" ":"<br/>");break;case "div":if(b.getAttr("cdata_tag"))break;if((e=b.getAttr("class"))&&/^line number\d+/.test(e))break;if(!a)break;for(var g,l=UE.uNode.createElement("p");g= |
|||
b.firstChild();)"text"!=g.type&&UE.dom.dtd.$block[g.tagName]?l.firstChild()?(b.parentNode.insertBefore(l,b),l=UE.uNode.createElement("p")):b.parentNode.insertBefore(g,b):l.appendChild(g);l.firstChild()&&b.parentNode.insertBefore(l,b);b.parentNode.removeChild(b);break;case "dl":b.tagName="ul";break;case "dt":case "dd":b.tagName="li";break;case "li":(g=b.getAttr("class"))&&/list\-/.test(g)||b.setAttr();g=b.getNodesByTagName("ol ul");UE.utils.each(g,function(a){b.parentNode.insertAfter(a,b)});break; |
|||
case "td":case "th":case "caption":b.children&&b.children.length||b.appendChild(r.ie11below?UE.uNode.createText(" "):UE.uNode.createElement("br"));break;case "table":d.options.disabledTableInTable&&c(b)&&(b.parentNode.insertBefore(UE.uNode.createText(b.innerText()),b),b.parentNode.removeChild(b))}else b.firstChild()?"span"!=b.tagName||b.attrs&&!p.isEmptyObject(b.attrs)||b.parentNode.removeChild(b,!0):b.parentNode.removeChild(b)})});d.addOutputRule(function(b){var c;b.traversal(function(a){if("element"== |
|||
a.type)if(!d.options.autoClearEmptyNode||!w.$inline[a.tagName]||w.$empty[a.tagName]||a.attrs&&!p.isEmptyObject(a.attrs))switch(a.tagName){case "div":if(c=a.getAttr("cdata_tag"))a.tagName=c,a.appendChild(UE.uNode.createText(a.getAttr("cdata_data"))),a.setAttr({cdata_tag:"",cdata_data:"",_ue_custom_node_:""});break;case "a":(c=a.getAttr("_href"))&&a.setAttr({href:p.html(c),_href:""});break;case "span":(c=a.getAttr("id"))&&/^_baidu_bookmark_/i.test(c)&&a.parentNode.removeChild(a);break;case "img":(c= |
|||
a.getAttr("_src"))&&a.setAttr({src:a.getAttr("_src"),_src:""})}else a.firstChild()?"span"!=a.tagName||a.attrs&&!p.isEmptyObject(a.attrs)||a.parentNode.removeChild(a,!0):a.parentNode.removeChild(a)})})};UE.commands.inserthtml={execCommand:function(d,b,c){var a=this,e;if(b&&!0!==a.fireEvent("beforeinserthtml",b)){e=a.selection.getRange();d=e.document.createElement("div");d.style.display="inline";c||(c=UE.htmlparser(b),a.options.filterRules&&UE.filterNode(c,a.options.filterRules),a.filterInputRule(c), |
|||
b=c.toHtml());d.innerHTML=p.trim(b);if(!e.collapsed&&(c=e.startContainer,f.isFillChar(c)&&e.setStartBefore(c),c=e.endContainer,f.isFillChar(c)&&e.setEndAfter(c),e.txtToElmBoundary(),e.endContainer&&1==e.endContainer.nodeType&&(c=e.endContainer.childNodes[e.endOffset])&&f.isBr(c)&&e.setEndAfter(c),0==e.startOffset&&(c=e.startContainer,f.isBoundaryNode(c,"firstChild")&&(c=e.endContainer,e.endOffset==(3==c.nodeType?c.nodeValue.length:c.childNodes.length)&&f.isBoundaryNode(c,"lastChild")&&(a.body.innerHTML= |
|||
"<p>"+(r.ie?"":"<br/>")+"</p>",e.setStart(a.body.firstChild,0).collapse(!0)))),!e.collapsed&&e.deleteContents(),1==e.startContainer.nodeType)){c=e.startContainer.childNodes[e.startOffset];var h;if(c&&f.isBlockElm(c)&&(h=c.previousSibling)&&f.isBlockElm(h)){for(e.setEnd(h,h.childNodes.length).collapse();c.firstChild;)h.appendChild(c.firstChild);f.remove(c)}}var g,l,k=0,m;e.inFillChar()&&(c=e.startContainer,f.isFillChar(c)?(e.setStartBefore(c).collapse(!0),f.remove(c)):f.isFillChar(c,!0)&&(c.nodeValue= |
|||
c.nodeValue.replace(Q,""),e.startOffset--,e.collapsed&&e.collapse(!0)));var n=f.findParentByTagName(e.startContainer,"li",!0);if(n){for(var q;c=d.firstChild;){for(;c&&(3==c.nodeType||!f.isBlockElm(c)||"HR"==c.tagName);)q=c.nextSibling,e.insertNode(c).collapse(),g=c,c=q;if(c)if(/^(ol|ul)$/i.test(c.tagName)){for(;c.firstChild;)g=c.firstChild,f.insertAfter(n,c.firstChild),n=n.nextSibling;f.remove(c)}else q=c.nextSibling,h=a.document.createElement("li"),f.insertAfter(n,h),h.appendChild(c),g=c,c=q,n=h}n= |
|||
f.findParentByTagName(e.startContainer,"li",!0);f.isEmptyBlock(n)&&f.remove(n);g&&e.setStartAfter(g).collapse(!0).select(!0)}else{for(;c=d.firstChild;){if(k){for(g=a.document.createElement("p");c&&(3==c.nodeType||!w.$block[c.tagName]);)m=c.nextSibling,g.appendChild(c),c=m;g.firstChild&&(c=g)}e.insertNode(c);m=c.nextSibling;if(!k&&c.nodeType==f.NODE_ELEMENT&&f.isBlockElm(c)&&(g=f.findParent(c,function(a){return f.isBlockElm(a)}))&&"body"!=g.tagName.toLowerCase()&&(!w[g.tagName][c.nodeName]||c.parentNode!== |
|||
g)){if(w[g.tagName][c.nodeName])for(l=c.parentNode;l!==g;)h=l,l=l.parentNode;else h=g;f.breakParent(c,h||l);h=c.previousSibling;f.trimWhiteTextNode(h);h.childNodes.length||f.remove(h);!r.ie&&(q=c.nextSibling)&&f.isBlockElm(q)&&q.lastChild&&!f.isBr(q.lastChild)&&q.appendChild(a.document.createElement("br"));k=1}q=c.nextSibling;if(!d.firstChild&&q&&f.isBlockElm(q)){e.setStart(q,0).collapse(!0);break}e.setEndAfter(c).collapse()}c=e.startContainer;m&&f.isBr(m)&&f.remove(m);if(f.isBlockElm(c)&&f.isEmptyNode(c))if(m= |
|||
c.nextSibling)f.remove(c),1==m.nodeType&&w.$block[m.tagName]&&e.setStart(m,0).collapse(!0).shrinkBoundary();else try{c.innerHTML=r.ie?f.fillChar:"<br/>"}catch(u){e.setStartBefore(c),f.remove(c)}try{e.select(!0)}catch(x){}}setTimeout(function(){e=a.selection.getRange();e.scrollToView(a.autoHeightEnabled,a.autoHeightEnabled?f.getXY(a.iframe).y:0);a.fireEvent("afterinserthtml",b)},200)}}};UE.plugins.autotypeset=function(){function d(a,b){if(!a||3==a.nodeType)return 0;if(f.isBr(a))return 1;if(a&&a.parentNode&& |
|||
k[a.tagName.toLowerCase()])return m&&m.contains(a)||a.getAttribute("pagebreak")?0:b?!f.isEmptyBlock(a):f.isEmptyBlock(a,new RegExp("[\\s"+f.fillChar+"]","g"))}function b(a){a.style.cssText||(f.removeAttributes(a,["style"]),"span"==a.tagName.toLowerCase()&&f.hasNoAttributes(a)&&f.remove(a,!0))}function c(a,c){var e;if(c){if(!h.pasteFilter)return;e=this.document.createElement("div");e.innerHTML=c.html}else e=this.document.body;for(var k=f.getElementsByTagName(e,"*"),z=0,v;v=k[z++];)if(!0!==this.fireEvent("excludeNodeinautotype", |
|||
v)){h.clearFontSize&&v.style.fontSize&&(f.removeStyle(v,"font-size"),b(v));h.clearFontFamily&&v.style.fontFamily&&(f.removeStyle(v,"font-family"),b(v));if(d(v)){if(h.mergeEmptyline)for(var D=v.nextSibling,F,H=f.isBr(v);d(D);){F=D;D=F.nextSibling;if(H&&(!D||D&&!f.isBr(D)))break;f.remove(F)}if(h.removeEmptyline&&f.inDoc(v,e)&&!l[v.parentNode.tagName.toLowerCase()]){if(f.isBr(v)&&(D=v.nextSibling)&&!f.isBr(D))continue;f.remove(v);continue}}d(v,!0)&&"SPAN"!=v.tagName&&(h.indent&&(v.style.textIndent=h.indentValue), |
|||
h.textAlign&&(v.style.textAlign=h.textAlign));if(h.removeClass&&v.className&&!g[v.className.toLowerCase()]){if(m&&m.contains(v))continue;f.removeAttributes(v,["class"])}if(h.imageBlockLine&&"img"==v.tagName.toLowerCase()&&!v.getAttribute("emotion"))if(c)switch(H=v,h.imageBlockLine){case "left":case "right":case "none":for(var D=H.parentNode,r;w.$inline[D.tagName]||"A"==D.tagName;)D=D.parentNode;F=D;if("P"==F.tagName&&"center"==f.getStyle(F,"text-align")&&!f.isBody(F)&&1==f.getChildCount(F,function(a){return!f.isBr(a)&& |
|||
!f.isWhitespace(a)}))if(r=F.previousSibling,D=F.nextSibling,r&&D&&1==r.nodeType&&1==D.nodeType&&r.tagName==D.tagName&&f.isBlockElm(r)){for(r.appendChild(F.firstChild);D.firstChild;)r.appendChild(D.firstChild);f.remove(F);f.remove(D)}else f.setStyle(F,"text-align","");f.setStyle(H,"float",h.imageBlockLine);break;case "center":if("center"!=this.queryCommandValue("imagefloat")){D=H.parentNode;f.setStyle(H,"float","none");for(F=H;D&&1==f.getChildCount(D,function(a){return!f.isBr(a)&&!f.isWhitespace(a)})&& |
|||
(w.$inline[D.tagName]||"A"==D.tagName);)F=D,D=D.parentNode;D=this.document.createElement("p");f.setAttributes(D,{style:"text-align:center"});F.parentNode.insertBefore(D,F);D.appendChild(F);f.setStyle(F,"float","")}}else this.selection.getRange().selectNode(v).select(),this.execCommand("imagefloat",h.imageBlockLine);h.removeEmptyNode&&h.removeTagNames[v.tagName.toLowerCase()]&&f.hasNoAttributes(v)&&f.isEmptyBlock(v)&&f.remove(v)}h.tobdc&&(k=UE.htmlparser(e.innerHTML),k.traversal(function(a){if("text"== |
|||
a.type){for(var b=a.data,b=p.html(b),c="",e=0;e<b.length;e++)c=32==b.charCodeAt(e)?c+String.fromCharCode(12288):127>b.charCodeAt(e)?c+String.fromCharCode(b.charCodeAt(e)+65248):c+b.charAt(e);a.data=c}}),e.innerHTML=k.toHtml());h.bdc2sb&&(k=UE.htmlparser(e.innerHTML),k.traversal(function(a){if("text"==a.type){for(var b=a.data,c="",e=0;e<b.length;e++)var g=b.charCodeAt(e),c=65281<=g&&65373>=g?c+String.fromCharCode(b.charCodeAt(e)-65248):12288==g?c+String.fromCharCode(b.charCodeAt(e)-12288+32):c+b.charAt(e); |
|||
a.data=c}}),e.innerHTML=k.toHtml());c&&(c.html=e.innerHTML)}function a(){var a=e.getPreferences("autotypeset");p.extend(e.options.autotypeset,a)}this.setOpt({autotypeset:{mergeEmptyline:!0,removeClass:!0,removeEmptyline:!1,textAlign:"left",imageBlockLine:"center",pasteFilter:!1,clearFontSize:!1,clearFontFamily:!1,removeEmptyNode:!1,removeTagNames:p.extend({div:1},w.$removeEmpty),indent:!1,indentValue:"2em",bdc2sb:!1,tobdc:!1}});var e=this,h=e.options.autotypeset,g={selectTdClass:1,pagebreak:1,anchorclass:1}, |
|||
l={li:1},k={div:1,p:1,blockquote:1,center:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,span:1},m;h&&(a(),h.pasteFilter&&e.addListener("beforepaste",c),e.commands.autotypeset={execCommand:function(){e.removeListener("beforepaste",c);h.pasteFilter&&e.addListener("beforepaste",c);c.call(e)}})};UE.plugin.register("autosubmit",function(){return{shortcutkey:{autosubmit:"ctrl+13"},commands:{autosubmit:{execCommand:function(){var d=f.findParentByTagName(this.iframe,"form",!1);d&&!1!==this.fireEvent("beforesubmit")&&(this.sync(), |
|||
d.submit())}}}}});UE.plugin.register("background",function(){function d(a){var b={};a=a.split(";");p.each(a,function(a){var c=a.indexOf(":"),e=p.trim(a.substr(0,c)).toLowerCase();e&&(b[e]=p.trim(a.substr(c+1)||""))});return b}function b(a){if(a){var b=[],e;for(e in a)a.hasOwnProperty(e)&&b.push(e+":"+a[e]+"; ");p.cssRule("editor_background",b.length?"body{"+b.join("")+"}":"",c.document)}else p.cssRule("editor_background","",c.document)}var c=this,a,e=/body[\s]*\{(.+)\}/i,h=c.hasContents;c.hasContents= |
|||
function(){return c.queryCommandValue("background")?!0:h.apply(c,arguments)};return{bindEvents:{getAllHtml:function(a,b){var e=this.body,h=f.getComputedStyle(e,"background-image"),d="",d=0<h.indexOf(c.options.imagePath)?h.substring(h.indexOf(c.options.imagePath),h.length-1).replace(/"|\(|\)/ig,""):"none"!=h?h.replace(/url\("?|"?\)/ig,""):"",h='<style type="text/css">body{',e={"background-color":f.getComputedStyle(e,"background-color")||"#ffffff","background-image":d?"url("+d+")":"","background-repeat":f.getComputedStyle(e, |
|||
"background-repeat")||"","background-position":r.ie?f.getComputedStyle(e,"background-position-x")+" "+f.getComputedStyle(e,"background-position-y"):f.getComputedStyle(e,"background-position"),height:f.getComputedStyle(e,"height")},q;for(q in e)e.hasOwnProperty(q)&&(h+=q+":"+e[q]+"; ");b.push(h+"}</style> ")},aftersetcontent:function(){0==a&&b()}},inputRule:function(c){a=!1;p.each(c.getNodesByTagName("p"),function(c){var e=c.getAttr("data-background");e&&(a=!0,b(d(e)),c.parentNode.removeChild(c))})}, |
|||
outputRule:function(a){var b=(p.cssRule("editor_background",this.document)||"").replace(/[\n\r]+/g,"").match(e);b&&a.appendChild(UE.uNode.createElement('<p style="display:none;" data-background="'+p.trim(b[1].replace(/"/g,"").replace(/[\s]+/g," "))+'"><br/></p>'))},commands:{background:{execCommand:function(a,c){b(c)},queryCommandValue:function(){var a=(p.cssRule("editor_background",this.document)||"").replace(/[\n\r]+/g,"").match(e);return a?d(a[1]):null},notNeedUndo:!0}}}});UE.commands.imagefloat= |
|||
{execCommand:function(d,b){var c=this.selection.getRange();if(!c.collapsed){var a=c.getClosedNode();if(a&&"IMG"==a.tagName)switch(b){case "left":case "right":case "none":for(var e=a.parentNode,h,g;w.$inline[e.tagName]||"A"==e.tagName;)e=e.parentNode;h=e;if("P"==h.tagName&&"center"==f.getStyle(h,"text-align")){if(!f.isBody(h)&&1==f.getChildCount(h,function(a){return!f.isBr(a)&&!f.isWhitespace(a)}))if(e=h.previousSibling,g=h.nextSibling,e&&g&&1==e.nodeType&&1==g.nodeType&&e.tagName==g.tagName&&f.isBlockElm(e)){for(e.appendChild(h.firstChild);g.firstChild;)e.appendChild(g.firstChild); |
|||
f.remove(h);f.remove(g)}else f.setStyle(h,"text-align","");c.selectNode(a).select()}f.setStyle(a,"float","none"==b?"":b);"none"==b&&f.removeAttributes(a,"align");break;case "center":if("center"!=this.queryCommandValue("imagefloat")){e=a.parentNode;f.setStyle(a,"float","");f.removeAttributes(a,"align");for(h=a;e&&1==f.getChildCount(e,function(a){return!f.isBr(a)&&!f.isWhitespace(a)})&&(w.$inline[e.tagName]||"A"==e.tagName);)h=e,e=e.parentNode;c.setStartBefore(h).setCursor(!1);e=this.document.createElement("div"); |
|||
e.appendChild(h);f.setStyle(h,"float","");this.execCommand("insertHtml",'<p id="_img_parent_tmp" style="text-align:center">'+e.innerHTML+"</p>");h=this.document.getElementById("_img_parent_tmp");h.removeAttribute("id");h=h.firstChild;c.selectNode(h).select();(g=h.parentNode.nextSibling)&&f.isEmptyNode(g)&&f.remove(g)}}}},queryCommandValue:function(){var d=this.selection.getRange(),b;return d.collapsed?"none":(d=d.getClosedNode())&&1==d.nodeType&&"IMG"==d.tagName?(b=f.getComputedStyle(d,"float")|| |
|||
d.getAttribute("align"),"none"==b&&(b="center"==f.getComputedStyle(d.parentNode,"text-align")?"center":b),{left:1,right:1,center:1}[b]?b:"none"):"none"},queryCommandState:function(){var d=this.selection.getRange();return d.collapsed?-1:(d=d.getClosedNode())&&1==d.nodeType&&"IMG"==d.tagName?0:-1}};UE.commands.insertimage={execCommand:function(d,b){b=p.isArray(b)?b:[b];if(b.length){var c=this.selection.getRange(),a=c.getClosedNode();if(!0!==this.fireEvent("beforeinsertimage",b)){if(!a||!/img/i.test(a.tagName)|| |
|||
"edui-faked-video"==a.className&&-1==a.className.indexOf("edui-upload-video")||a.getAttribute("word_img")){var c=[],a="",e;e=b[0];if(1==b.length)a='<img src="'+e.src+'" '+(e._src?' _src="'+e._src+'" ':"")+(e.width?'width="'+e.width+'" ':"")+(e.height?' height="'+e.height+'" ':"")+("left"==e.floatStyle||"right"==e.floatStyle?' style="float:'+e.floatStyle+';"':"")+(e.title&&""!=e.title?' title="'+e.title+'"':"")+(e.border&&"0"!=e.border?' border="'+e.border+'"':"")+(e.alt&&""!=e.alt?' alt="'+e.alt+ |
|||
'"':"")+(e.hspace&&"0"!=e.hspace?' hspace = "'+e.hspace+'"':"")+(e.vspace&&"0"!=e.vspace?' vspace = "'+e.vspace+'"':"")+"/>","center"==e.floatStyle&&(a='<p style="text-align: center">'+a+"</p>"),c.push(a);else for(var h=0;e=b[h++];)a="<p "+("center"==e.floatStyle?'style="text-align: center" ':"")+'><img src="'+e.src+'" '+(e.width?'width="'+e.width+'" ':"")+(e._src?' _src="'+e._src+'" ':"")+(e.height?' height="'+e.height+'" ':"")+' style="'+(e.floatStyle&&"center"!=e.floatStyle?"float:"+e.floatStyle+ |
|||
";":"")+(e.border||"")+'" '+(e.title?' title="'+e.title+'"':"")+" /></p>",c.push(a);this.execCommand("insertHtml",c.join(""))}else e=b.shift(),h=e.floatStyle,delete e.floatStyle,f.setAttributes(a,e),this.execCommand("imagefloat",h),0<b.length&&(c.setStartAfter(a).setCursor(!1,!0),this.execCommand("insertimage",b));this.fireEvent("afterinsertimage",b)}}}};UE.plugins.justify=function(){var d=f.isBlockElm,b={left:1,right:1,center:1,justify:1},c=function(a,b){var c=a.createBookmark(),g=function(a){return 1== |
|||
a.nodeType?"br"!=a.tagName.toLowerCase()&&!f.isBookmarkNode(a):!f.isWhitespace(a)};a.enlarge(!0);for(var l=a.createBookmark(),k=f.getNextDomNode(l.start,!1,g),m=a.cloneRange(),n;k&&!(f.getPosition(k,l.end)&f.POSITION_FOLLOWING);)if(3!=k.nodeType&&d(k))k=f.getNextDomNode(k,!0,g);else{for(m.setStartBefore(k);k&&k!==l.end&&!d(k);)n=k,k=f.getNextDomNode(k,!1,null,function(a){return!d(a)});m.setEndAfter(n);k=m.getCommonAncestor();if(!f.isBody(k)&&d(k))f.setStyles(k,p.isString(b)?{"text-align":b}:b);else{k= |
|||
a.document.createElement("p");f.setStyles(k,p.isString(b)?{"text-align":b}:b);var q=m.extractContents();k.appendChild(q);m.insertNode(k)}k=f.getNextDomNode(k,!1,g)}return a.moveToBookmark(l).moveToBookmark(c)};UE.commands.justify={execCommand:function(a,b){var h=this.selection.getRange(),g;h.collapsed&&(g=this.document.createTextNode("p"),h.insertNode(g));c(h,b);g&&(h.setStartBefore(g).collapse(!0),f.remove(g));h.select();return!0},queryCommandValue:function(){var a=this.selection.getStart(),a=f.getComputedStyle(a, |
|||
"text-align");return b[a]?a:"left"},queryCommandState:function(){var a=this.selection.getStart();return a&&f.findParentByTagName(a,["td","th","caption"],!0)?-1:0}}};UE.plugins.font=function(){function d(a){for(var b;b=a.parentNode;)if("SPAN"==b.tagName&&1==f.getChildCount(b,function(a){return!f.isBookmarkNode(a)&&!f.isBr(a)}))b.style.cssText+=a.style.cssText,f.remove(a,!0),a=b;else break}function b(a,b,c){if(h[b]&&(a.adjustmentBoundary(),!a.collapsed&&1==a.startContainer.nodeType)){var e=a.startContainer.childNodes[a.startOffset]; |
|||
if(e&&f.isTagNode(e,"span")){var g=a.createBookmark();p.each(f.getElementsByTagName(e,"span"),function(a){!a.parentNode||f.isBookmarkNode(a)||"backcolor"==b&&f.getComputedStyle(a,"background-color").toLowerCase()===c||(f.removeStyle(a,h[b]),0==a.style.cssText.replace(/^\s+$/,"").length&&f.remove(a,!0))});a.moveToBookmark(g)}}}function c(a,c,e){var g=a.collapsed,h=a.createBookmark();if(g)for(g=h.start.parentNode;w.$inline[g.tagName];)g=g.parentNode;else g=f.getCommonAncestor(h.start,h.end);p.each(f.getElementsByTagName(g, |
|||
"span"),function(a){if(a.parentNode&&!f.isBookmarkNode(a))if(/\s*border\s*:\s*none;?\s*/i.test(a.style.cssText))/^\s*border\s*:\s*none;?\s*$/.test(a.style.cssText)?f.remove(a,!0):f.removeStyle(a,"border");else{/border/i.test(a.style.cssText)&&"SPAN"==a.parentNode.tagName&&/border/i.test(a.parentNode.style.cssText)&&(a.style.cssText=a.style.cssText.replace(/border[^:]*:[^;]+;?/gi,""));if("fontborder"!=c||"none"!=e)for(var b=a.nextSibling;b&&1==b.nodeType&&"SPAN"==b.tagName;){if(f.isBookmarkNode(b)&& |
|||
"fontborder"==c)a.appendChild(b);else if(b.style.cssText==a.style.cssText&&(f.moveChild(b,a),f.remove(b)),a.nextSibling===b)break;b=a.nextSibling}d(a);r.ie&&8<r.version&&(b=f.findParent(a,function(a){return"SPAN"==a.tagName&&/background-color/.test(a.style.cssText)}))&&!/background-color/.test(a.style.cssText)&&(a.style.backgroundColor=b.style.backgroundColor)}});a.moveToBookmark(h);b(a,c,e)}var a={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family",underline:"text-decoration", |
|||
strikethrough:"text-decoration",fontborder:"border"},e={underline:1,strikethrough:1,fontborder:1},h={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family"};this.setOpt({fontfamily:[{name:"songti",val:"\u5b8b\u4f53,SimSun"},{name:"yahei",val:"\u5fae\u8f6f\u96c5\u9ed1,Microsoft YaHei"},{name:"kaiti",val:"\u6977\u4f53,\u6977\u4f53_GB2312, SimKai"},{name:"heiti",val:"\u9ed1\u4f53, SimHei"},{name:"lishu",val:"\u96b6\u4e66, SimLi"},{name:"andaleMono",val:"andale mono"}, |
|||
{name:"arial",val:"arial, helvetica,sans-serif"},{name:"arialBlack",val:"arial black,avant garde"},{name:"comicSansMs",val:"comic sans ms"},{name:"impact",val:"impact,chicago"},{name:"timesNewRoman",val:"times new roman"}],fontsize:[10,11,12,14,16,18,20,24,36]});this.addInputRule(function(a){p.each(a.getNodesByTagName("u s del font strike"),function(a){if("font"==a.tagName){var b=[],c;for(c in a.attrs)switch(c){case "size":b.push("font-size:"+({1:"10",2:"12",3:"16",4:"18",5:"24",6:"32",7:"48"}[a.attrs[c]]|| |
|||
a.attrs[c])+"px");break;case "color":b.push("color:"+a.attrs[c]);break;case "face":b.push("font-family:"+a.attrs[c]);break;case "style":b.push(a.attrs[c])}a.attrs={style:b.join(";")}}else b="u"==a.tagName?"underline":"line-through",a.attrs={style:(a.getAttr("style")||"")+"text-decoration:"+b+";"};a.tagName="span"})});for(var g in a)(function(a,b){UE.commands[a]={execCommand:function(g,h){h=h||(this.queryCommandState(g)?"none":"underline"==g?"underline":"fontborder"==g?"1px solid #000":"line-through"); |
|||
var d=this.selection.getRange(),u;if("default"==h)d.collapsed&&(u=this.document.createTextNode("font"),d.insertNode(u).select()),this.execCommand("removeFormat","span,a",b),u&&(d.setStartBefore(u).collapse(!0),f.remove(u)),c(d,g,h),d.select();else if(d.collapsed){var x=f.findParentByTagName(d.startContainer,"span",!0);u=this.document.createTextNode("font");if(!x||x.children.length||x[r.ie?"innerText":"textContent"].replace(Q,"").length){d.insertNode(u);d.selectNode(u).select();x=d.document.createElement("span"); |
|||
if(e[a]){if(f.findParentByTagName(u,"a",!0)){d.setStartBefore(u).setCursor();f.remove(u);return}this.execCommand("removeFormat","span,a",b)}x.style.cssText=b+":"+h;u.parentNode.insertBefore(x,u);if(!r.ie||r.ie&&9==r.version)for(var z=x.parentNode;!f.isBlockElm(z);)"SPAN"==z.tagName&&(x.style.cssText=z.style.cssText+";"+x.style.cssText),z=z.parentNode;ma?setTimeout(function(){d.setStart(x,0).collapse(!0);c(d,g,h);d.select()}):(d.setStart(x,0).collapse(!0),c(d,g,h),d.select())}else d.insertNode(u), |
|||
e[a]&&(d.selectNode(u).select(),this.execCommand("removeFormat","span,a",b,null),x=f.findParentByTagName(u,"span",!0),d.setStartBefore(u)),x&&(x.style.cssText+=";"+b+":"+h),d.collapse(!0).select();f.remove(u)}else e[a]&&this.queryCommandValue(a)&&this.execCommand("removeFormat","span,a",b),d=this.selection.getRange(),d.applyInlineStyle("span",{style:b+":"+h}),c(d,g,h),d.select();return!0},queryCommandValue:function(a){var c=this.selection.getStart();if("underline"==a||"strikethrough"==a){for(var e= |
|||
c;e&&!f.isBlockElm(e)&&!f.isBody(e);){if(1==e.nodeType&&(a=f.getComputedStyle(e,b),"none"!=a))return a;e=e.parentNode}return"none"}if("fontborder"==a){for(a=c;a&&w.$inline[a.tagName];){if((e=f.getComputedStyle(a,"border"))&&/1px/.test(e)&&/solid/.test(e))return e;a=a.parentNode}return""}return"FontSize"==a?(e=f.getComputedStyle(c,b),(a=/^([\d\.]+)(\w+)$/.exec(e))?Math.floor(a[1])+a[2]:e):f.getComputedStyle(c,b)},queryCommandState:function(a){if(!e[a])return 0;var b=this.queryCommandValue(a);return"fontborder"== |
|||
a?/1px/.test(b)&&/solid/.test(b):"underline"==a?/underline/.test(b):/line\-through/.test(b)}}})(g,a[g])};UE.plugins.link=function(){function d(b){var c=b.startContainer,a=b.endContainer;(c=f.findParentByTagName(c,"a",!0))&&b.setStartBefore(c);(a=f.findParentByTagName(a,"a",!0))&&b.setEndAfter(a)}UE.commands.unlink={execCommand:function(){var b=this.selection.getRange(),c;if(!b.collapsed||f.findParentByTagName(b.startContainer,"a",!0))c=b.createBookmark(),d(b),b.removeInlineStyle("a").moveToBookmark(c).select()}, |
|||
queryCommandState:function(){return!this.highlight&&this.queryCommandValue("link")?0:-1}};UE.commands.link={execCommand:function(b,c){var a;c._href&&(c._href=p.unhtml(c._href,/[<">]/g));c.href&&(c.href=p.unhtml(c.href,/[<">]/g));c.textValue&&(c.textValue=p.unhtml(c.textValue,/[<">]/g));var e=a=this.selection.getRange(),h=e.cloneRange(),g=this.queryCommandValue("link");d(e=e.adjustmentBoundary());var l=e.startContainer;1==l.nodeType&&g&&(l=l.childNodes[e.startOffset])&&1==l.nodeType&&"A"==l.tagName&& |
|||
/^(?:https?|ftp|file)\s*:\s*\/\//.test(l[r.ie?"innerText":"textContent"])&&(l[r.ie?"innerText":"textContent"]=p.html(c.textValue||c.href));if(!h.collapsed||g)e.removeInlineStyle("a"),h=e.cloneRange();if(h.collapsed){var g=e.document.createElement("a"),k="";c.textValue?(k=p.html(c.textValue),delete c.textValue):k=p.html(c.href);f.setAttributes(g,c);(l=f.findParentByTagName(h.startContainer,"a",!0))&&f.isInNodeEndBoundary(h,l)&&e.setStartAfter(l).collapse(!0);g[r.ie?"innerText":"textContent"]=k;e.insertNode(g).selectNode(g)}else e.applyInlineStyle("a", |
|||
c);a.collapse().select(!0)},queryCommandValue:function(){var b=this.selection.getRange(),c;if(b.collapsed){if(c=b.startContainer,(c=1==c.nodeType?c:c.parentNode)&&(c=f.findParentByTagName(c,"a",!0))&&!f.isInNodeEndBoundary(b,c))return c}else{b.shrinkBoundary();var a=3!=b.startContainer.nodeType&&b.startContainer.childNodes[b.startOffset]?b.startContainer.childNodes[b.startOffset]:b.startContainer,e=3==b.endContainer.nodeType||0==b.endOffset?b.endContainer:b.endContainer.childNodes[b.endOffset-1], |
|||
b=b.getCommonAncestor();c=f.findParentByTagName(b,"a",!0);if(!c&&1==b.nodeType)for(var b=b.getElementsByTagName("a"),h,g,d=0,k;k=b[d++];)if(h=f.getPosition(k,a),g=f.getPosition(k,e),(h&f.POSITION_FOLLOWING||h&f.POSITION_CONTAINS)&&(g&f.POSITION_PRECEDING||g&f.POSITION_CONTAINS)){c=k;break}return c}},queryCommandState:function(){var b=this.selection.getRange().getClosedNode();return!b||"edui-faked-video"!=b.className&&-1==b.className.indexOf("edui-upload-video")?0:-1}}};UE.plugins.insertframe=function(){var d= |
|||
this;d.addListener("selectionchange",function(){d._iframe&&delete d._iframe})};UE.commands.scrawl={queryCommandState:function(){return r.ie&&8>=r.version?-1:0}};UE.plugins.removeformat=function(){this.setOpt({removeFormatTags:"b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var",removeFormatAttributes:"class,style,lang,width,height,align,hspace,valign"});this.commands.removeformat={execCommand:function(d,b,c,a,e){function h(a){if(3==a.nodeType||"span"!=a.tagName.toLowerCase())return 0; |
|||
if(r.ie){var b=a.attributes;if(b.length){a=0;for(var c=b.length;a<c;a++)if(b[a].specified)return 0;return 1}}return!a.attributes.length}var g=new RegExp("^(?:"+(b||this.options.removeFormatTags).replace(/,/g,"|")+")$","i"),l=c?[]:(a||this.options.removeFormatAttributes).split(",");d=new M.Range(this.document);var k,m,n=function(a){return 1==a.nodeType};d=this.selection.getRange();(function(a){var b=a.createBookmark();a.collapsed&&a.enlarge(!0);if(!e){var d=f.findParentByTagName(a.startContainer,"a", |
|||
!0);d&&a.setStartBefore(d);(d=f.findParentByTagName(a.endContainer,"a",!0))&&a.setEndAfter(d)}k=a.createBookmark();for(d=k.start;(m=d.parentNode)&&!f.isBlockElm(m);)f.breakParent(d,m),f.clearEmptySibling(d);if(k.end){for(d=k.end;(m=d.parentNode)&&!f.isBlockElm(m);)f.breakParent(d,m),f.clearEmptySibling(d);for(var d=f.getNextDomNode(k.start,!1,n),z;d&&d!=k.end;)z=f.getNextDomNode(d,!0,n),w.$empty[d.tagName.toLowerCase()]||f.isBookmarkNode(d)||(g.test(d.tagName)?c?(f.removeStyle(d,c),h(d)&&"text-decoration"!= |
|||
c&&f.remove(d,!0)):f.remove(d,!0):w.$tableContent[d.tagName]||w.$list[d.tagName]||(f.removeAttributes(d,l),h(d)&&f.remove(d,!0))),d=z}d=k.start.parentNode;!f.isBlockElm(d)||w.$tableContent[d.tagName]||w.$list[d.tagName]||f.removeAttributes(d,l);d=k.end.parentNode;k.end&&f.isBlockElm(d)&&!w.$tableContent[d.tagName]&&!w.$list[d.tagName]&&f.removeAttributes(d,l);a.moveToBookmark(k).moveToBookmark(b);d=a.startContainer;for(z=a.collapsed;1==d.nodeType&&f.isEmptyNode(d)&&w.$removeEmpty[d.tagName];)b=d.parentNode, |
|||
a.setStartBefore(d),a.startContainer===a.endContainer&&a.endOffset--,f.remove(d),d=b;if(!z)for(d=a.endContainer;1==d.nodeType&&f.isEmptyNode(d)&&w.$removeEmpty[d.tagName];)b=d.parentNode,a.setEndBefore(d),f.remove(d),d=b})(d);d.select()}}};UE.plugins.blockquote=function(){this.commands.blockquote={execCommand:function(d,b){var c=this.selection.getRange(),a=f.filterNodeList(this.selection.getStartElementPath(),"blockquote"),e=w.blockquote,h=c.createBookmark();if(a){var e=c.startContainer,e=f.isBlockElm(e)? |
|||
e:f.findParent(e,function(a){return f.isBlockElm(a)}),g=c.endContainer,g=f.isBlockElm(g)?g:f.findParent(g,function(a){return f.isBlockElm(a)}),e=f.findParentByTagName(e,"li",!0)||e,g=f.findParentByTagName(g,"li",!0)||g;"LI"==e.tagName||"TD"==e.tagName||e===a||f.isBody(e)?f.remove(a,!0):f.breakParent(e,a);e!==g&&(a=f.findParentByTagName(g,"blockquote"))&&("LI"==g.tagName||"TD"==g.tagName||f.isBody(g)?a.parentNode&&f.remove(a,!0):f.breakParent(g,a));for(var l=f.getElementsByTagName(this.document,"blockquote"), |
|||
a=0,k;k=l[a++];)k.childNodes.length?f.getPosition(k,e)&f.POSITION_FOLLOWING&&f.getPosition(k,g)&f.POSITION_PRECEDING&&f.remove(k,!0):f.remove(k)}else{a=c.cloneRange();l=g=1==a.startContainer.nodeType?a.startContainer:a.startContainer.parentNode;for(k=1;;){if(f.isBody(g)){l!==g?c.collapsed?(a.selectNode(l),k=0):a.setStartBefore(l):a.setStart(g,0);break}if(!e[g.tagName]){c.collapsed?a.selectNode(l):a.setStartBefore(l);break}l=g;g=g.parentNode}if(k)for(l=g=g=1==a.endContainer.nodeType?a.endContainer: |
|||
a.endContainer.parentNode;;){if(f.isBody(g)){l!==g?a.setEndAfter(l):a.setEnd(g,g.childNodes.length);break}if(!e[g.tagName]){a.setEndAfter(l);break}l=g;g=g.parentNode}g=c.document.createElement("blockquote");f.setAttributes(g,b);g.appendChild(a.extractContents());a.insertNode(g);e=f.getElementsByTagName(g,"blockquote");for(a=0;g=e[a++];)g.parentNode&&f.remove(g,!0)}c.moveToBookmark(h).select()},queryCommandState:function(){return f.filterNodeList(this.selection.getStartElementPath(),"blockquote")? |
|||
1:0}}};UE.commands.touppercase=UE.commands.tolowercase={execCommand:function(d){var b=this.selection.getRange();if(b.collapsed)return b;for(var c=b.createBookmark(),a=c.end,e=function(a){return!f.isBr(a)&&!f.isWhitespace(a)},h=f.getNextDomNode(c.start,!1,e);h&&f.getPosition(h,a)&f.POSITION_PRECEDING&&(3==h.nodeType&&(h.nodeValue=h.nodeValue["touppercase"==d?"toUpperCase":"toLowerCase"]()),h=f.getNextDomNode(h,!0,e),h!==a););b.moveToBookmark(c).select()}};UE.commands.indent={execCommand:function(){var d= |
|||
this.queryCommandState("indent")?"0em":this.options.indentValue||"2em";this.execCommand("Paragraph","p",{style:"text-indent:"+d})},queryCommandState:function(){var d=f.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return d&&d.style.textIndent&&parseInt(d.style.textIndent)?1:0}};UE.commands.print={execCommand:function(){this.window.print()},notNeedUndo:1};UE.commands.preview={execCommand:function(){var d=window.open("","_blank","").document;d.open();d.write('<!DOCTYPE html><html><head><meta charset="utf-8"/><script src="'+ |
|||
this.options.UEDITOR_HOME_URL+"ueditor.parse.js\">\x3c/script><script>setTimeout(function(){uParse('div',{rootPath: '"+this.options.UEDITOR_HOME_URL+"'})},300)\x3c/script></head><body><div>"+this.getContent(null,null,!0)+"</div></body></html>");d.close()},notNeedUndo:1};UE.plugins.selectall=function(){this.commands.selectall={execCommand:function(){var d=this.body,b=this.selection.getRange();b.selectNodeContents(d);f.isEmptyBlock(d)&&(r.opera&&d.firstChild&&1==d.firstChild.nodeType&&b.setStartAtFirst(d.firstChild), |
|||
b.collapse(!0));b.select(!0)},notNeedUndo:1};this.addshortcutkey({selectAll:"ctrl+65"})};UE.plugins.paragraph=function(){var d=f.isBlockElm,b=["TD","LI","PRE"],c=function(a,c,h,g){var l=a.createBookmark(),k=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase()&&!f.isBookmarkNode(a):!f.isWhitespace(a)},m;a.enlarge(!0);var n=a.createBookmark();m=f.getNextDomNode(n.start,!1,k);for(var q=a.cloneRange(),u;m&&!(f.getPosition(m,n.end)&f.POSITION_FOLLOWING);)if(3!=m.nodeType&&d(m))m=f.getNextDomNode(m, |
|||
!0,k);else{for(q.setStartBefore(m);m&&m!==n.end&&!d(m);)u=m,m=f.getNextDomNode(m,!1,null,function(a){return!d(a)});q.setEndAfter(u);m=a.document.createElement(c);h&&(f.setAttributes(m,h),g&&"customstyle"==g&&h.style&&(m.style.cssText=h.style));m.appendChild(q.extractContents());f.isEmptyNode(m)&&f.fillChar(a.document,m);q.insertNode(m);var x=m.parentNode;d(x)&&!f.isBody(m.parentNode)&&-1==p.indexOf(b,x.tagName)&&(g&&"customstyle"==g||(x.getAttribute("dir")&&m.setAttribute("dir",x.getAttribute("dir")), |
|||
x.style.cssText&&(m.style.cssText=x.style.cssText+";"+m.style.cssText),x.style.textAlign&&!m.style.textAlign&&(m.style.textAlign=x.style.textAlign),x.style.textIndent&&!m.style.textIndent&&(m.style.textIndent=x.style.textIndent),x.style.padding&&!m.style.padding&&(m.style.padding=x.style.padding)),h&&/h\d/i.test(x.tagName)&&!/h\d/i.test(m.tagName)?(f.setAttributes(x,h),g&&"customstyle"==g&&h.style&&(x.style.cssText=h.style),f.remove(m,!0),m=x):f.remove(m.parentNode,!0));m=-1!=p.indexOf(b,x.tagName)? |
|||
x:m;m=f.getNextDomNode(m,!1,k)}return a.moveToBookmark(n).moveToBookmark(l)};this.setOpt("paragraph",{p:"",h1:"",h2:"",h3:"",h4:"",h5:"",h6:""});this.commands.paragraph={execCommand:function(a,b,h,g){a=this.selection.getRange();if(a.collapsed){var d=this.document.createTextNode("p");a.insertNode(d);if(r.ie){var k=d.previousSibling;k&&f.isWhitespace(k)&&f.remove(k);(k=d.nextSibling)&&f.isWhitespace(k)&&f.remove(k)}}a=c(a,b,h,g);d&&(a.setStartBefore(d).collapse(!0),pN=d.parentNode,f.remove(d),f.isBlockElm(pN)&& |
|||
f.isEmptyNode(pN)&&f.fillNode(this.document,pN));r.gecko&&a.collapsed&&1==a.startContainer.nodeType&&(h=a.startContainer.childNodes[a.startOffset])&&1==h.nodeType&&h.tagName.toLowerCase()==b&&a.setStart(h,0).collapse(!0);a.select();return!0},queryCommandValue:function(){var a=f.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return a?a.tagName.toLowerCase():""}}};(function(){var d=f.isBlockElm,b=function(a){return f.filterNodeList(a.selection.getStartElementPath(),function(a){return a&& |
|||
1==a.nodeType&&a.getAttribute("dir")})},c=function(a,c,h){var g=function(a){return 1==a.nodeType?!f.isBookmarkNode(a):!f.isWhitespace(a)};if((c=b(c))&&a.collapsed)return c.setAttribute("dir",h),a;c=a.createBookmark();a.enlarge(!0);for(var l=a.createBookmark(),k=f.getNextDomNode(l.start,!1,g),m=a.cloneRange(),n;k&&!(f.getPosition(k,l.end)&f.POSITION_FOLLOWING);)if(3!=k.nodeType&&d(k))k=f.getNextDomNode(k,!0,g);else{for(m.setStartBefore(k);k&&k!==l.end&&!d(k);)n=k,k=f.getNextDomNode(k,!1,null,function(a){return!d(a)}); |
|||
m.setEndAfter(n);k=m.getCommonAncestor();if(!f.isBody(k)&&d(k))k.setAttribute("dir",h);else{k=a.document.createElement("p");k.setAttribute("dir",h);var q=m.extractContents();k.appendChild(q);m.insertNode(k)}k=f.getNextDomNode(k,!1,g)}return a.moveToBookmark(l).moveToBookmark(c)};UE.commands.directionality={execCommand:function(a,b){var h=this.selection.getRange();if(h.collapsed){var g=this.document.createTextNode("d");h.insertNode(g)}c(h,this,b);g&&(h.setStartBefore(g).collapse(!0),f.remove(g));h.select(); |
|||
return!0},queryCommandValue:function(){var a=b(this);return a?a.getAttribute("dir"):"ltr"}}})();UE.plugins.horizontal=function(){this.commands.horizontal={execCommand:function(d){if(-1!==this.queryCommandState(d)){this.execCommand("insertHtml","<hr>");d=this.selection.getRange();var b=d.startContainer;if(1==b.nodeType&&!b.childNodes[d.startOffset]){var c;(c=b.childNodes[d.startOffset-1])&&1==c.nodeType&&"HR"==c.tagName&&("p"==this.options.enterTag?(c=this.document.createElement("p"),d.insertNode(c), |
|||
d.setStart(c,0).setCursor()):(c=this.document.createElement("br"),d.insertNode(c),d.setStartBefore(c).setCursor()))}return!0}},queryCommandState:function(){return f.filterNodeList(this.selection.getStartElementPath(),"table")?-1:0}};this.addListener("delkeydown",function(d,b){var c=this.selection.getRange();c.txtToElmBoundary(!0);if(f.isStartInblock(c)){var a=c.startContainer.previousSibling;if(a&&f.isTagNode(a,"hr"))return f.remove(a),c.select(),f.preventDefault(b),!0}})};UE.commands.time=UE.commands.date= |
|||
{execCommand:function(d,b){function c(a,b){var c=("0"+a.getHours()).slice(-2),e=("0"+a.getMinutes()).slice(-2),d=("0"+a.getSeconds()).slice(-2);return(b||"hh:ii:ss").replace(/hh/ig,c).replace(/ii/ig,e).replace(/ss/ig,d)}function a(a,b){var c=("000"+a.getFullYear()).slice(-4),e=c.slice(-2),d=("0"+(a.getMonth()+1)).slice(-2),f=("0"+a.getDate()).slice(-2);return(b||"yyyy-mm-dd").replace(/yyyy/ig,c).replace(/yy/ig,e).replace(/mm/ig,d).replace(/dd/ig,f)}var e=new Date;this.execCommand("insertHtml","time"== |
|||
d?c(e,b):a(e,b))}};UE.plugins.rowspacing=function(){this.setOpt({rowspacingtop:["5","10","15","20","25"],rowspacingbottom:["5","10","15","20","25"]});this.commands.rowspacing={execCommand:function(d,b,c){this.execCommand("paragraph","p",{style:"margin-"+c+":"+b+"px"});return!0},queryCommandValue:function(d,b){var c=f.filterNodeList(this.selection.getStartElementPath(),function(a){return f.isBlockElm(a)});return c?(c=f.getComputedStyle(c,"margin-"+b).replace(/[^\d]/g,""))?c:0:0}}};UE.plugins.lineheight= |
|||
function(){this.setOpt({lineheight:"1 1.5 1.75 2 3 4 5".split(" ")});this.commands.lineheight={execCommand:function(d,b){this.execCommand("paragraph","p",{style:"line-height:"+("1"==b?"normal":b+"em")});return!0},queryCommandValue:function(){var d=f.filterNodeList(this.selection.getStartElementPath(),function(b){return f.isBlockElm(b)});if(d)return d=f.getComputedStyle(d,"line-height"),"normal"==d?1:d.replace(/[^\d.]*/ig,"")}}};UE.plugins.insertcode=function(){var d=this;d.ready(function(){p.cssRule("pre", |
|||
"pre{margin:.5em 0;padding:.4em .6em;border-radius:8px;background:#f8f8f8;}",d.document)});d.setOpt("insertcode",{as3:"ActionScript3",bash:"Bash/Shell",cpp:"C/C++",css:"Css",cf:"CodeFunction","c#":"C#",delphi:"Delphi",diff:"Diff",erlang:"Erlang",groovy:"Groovy",html:"Html",java:"Java",jfx:"JavaFx",js:"Javascript",pl:"Perl",php:"Php",plain:"Plain Text",ps:"PowerShell",python:"Python",ruby:"Ruby",scala:"Scala",sql:"Sql",vb:"Vb",xml:"Xml"});d.commands.insertcode={execCommand:function(b,c){var a=this.selection.getRange(), |
|||
e=f.findParentByTagName(a.startContainer,"pre",!0);if(e)e.className="brush:"+c+";toolbar:false;";else{var h="";a.collapsed?h=r.ie&&r.ie11below?8>=r.version?" ":"":"<br/>":(e=a.extractContents(),a=this.document.createElement("div"),a.appendChild(e),p.each(UE.filterNode(UE.htmlparser(a.innerHTML.replace(/[\r\t]/g,"")),this.options.filterTxtRules).children,function(a){r.ie&&r.ie11below&&8<r.version?("element"==a.type?"br"==a.tagName?h+="\n":w.$empty[a.tagName]||(p.each(a.children,function(b){"element"== |
|||
b.type?"br"==b.tagName?h+="\n":w.$empty[a.tagName]||(h+=b.innerText()):h+=b.data}),/\n$/.test(h)||(h+="\n")):h+=a.data+"\n",!a.nextSibling()&&/\n$/.test(h)&&(h=h.replace(/\n$/,""))):r.ie&&r.ie11below?("element"==a.type?"br"==a.tagName?h+="<br>":w.$empty[a.tagName]||(p.each(a.children,function(b){"element"==b.type?"br"==b.tagName?h+="<br>":w.$empty[a.tagName]||(h+=b.innerText()):h+=b.data}),/br>$/.test(h)||(h+="<br>")):h+=a.data+"<br>",!a.nextSibling()&&/<br>$/.test(h)&&(h=h.replace(/<br>$/,""))): |
|||
(h+="element"==a.type?w.$empty[a.tagName]?"":a.innerText():a.data,!/br\/?\s*>$/.test(h)&&a.nextSibling()&&(h+="<br>"))}));this.execCommand("inserthtml",'<pre id="coder"class="brush:'+c+';toolbar:false">'+h+"</pre>",!0);e=this.document.getElementById("coder");f.removeAttributes(e,"id");(a=e.previousSibling)&&(3==a.nodeType&&1==a.nodeValue.length&&r.ie&&6==r.version||f.isEmptyBlock(a))&&f.remove(a);a=this.selection.getRange();f.isEmptyBlock(e)?a.setStart(e,0).setCursor(!1,!0):a.selectNodeContents(e).select()}}, |
|||
queryCommandValue:function(){var b=this.selection.getStartElementPath(),c="";p.each(b,function(a){if("PRE"==a.nodeName)return c=(a=a.className.match(/brush:([^;]+)/))&&a[1]?a[1]:"",!1});return c}};d.addInputRule(function(b){p.each(b.getNodesByTagName("pre"),function(b){var a=b.getNodesByTagName("br");a.length?r.ie&&r.ie11below&&8<r.version&&p.each(a,function(a){var b=UE.uNode.createText("\n");a.parentNode.insertBefore(b,a);a.parentNode.removeChild(a)}):r.ie&&r.ie11below&&8<r.version||(a=b.innerText().split(/\n/), |
|||
b.innerHTML(""),p.each(a,function(a){a.length&&b.appendChild(UE.uNode.createText(a));b.appendChild(UE.uNode.createElement("br"))}))})});d.addOutputRule(function(b){p.each(b.getNodesByTagName("pre"),function(b){var a="";p.each(b.children,function(b){a="text"==b.type?a+b.data.replace(/[ ]/g," ").replace(/\n$/,""):"br"==b.tagName?a+"\n":a+(w.$empty[b.tagName]?b.innerText():"")});b.innerText(a.replace(/( |\n)+$/,""))})});d.notNeedCodeQuery={help:1,undo:1,redo:1,source:1,print:1,searchreplace:1, |
|||
fullscreen:1,preview:1,insertparagraph:1,elementpath:1,insertcode:1,inserthtml:1,selectall:1};d.queryCommandState=function(b){return!this.notNeedCodeQuery[b.toLowerCase()]&&this.selection&&this.queryCommandValue("insertcode")?-1:UE.Editor.prototype.queryCommandState.apply(this,arguments)};d.addListener("beforeenterkeydown",function(){var b=d.selection.getRange(),c=f.findParentByTagName(b.startContainer,"pre",!0);if(c){d.fireEvent("saveScene");b.collapsed||b.deleteContents();if(!r.ie||r.ie9above){c= |
|||
d.document.createElement("br");b.insertNode(c).setStartAfter(c).collapse(!0);c.nextSibling||r.ie&&!(10<r.version)?b.setStartAfter(c):b.insertNode(c.cloneNode(!1));for(var c=c.previousSibling,a;c;)if(a=c,c=c.previousSibling,!c||"BR"==c.nodeName){c=a;break}if(c){for(a="";c&&"BR"!=c.nodeName&&(new RegExp("^[\\s"+f.fillChar+"]*$")).test(c.nodeValue);)a+=c.nodeValue,c=c.nextSibling;"BR"!=c.nodeName&&(c=c.nodeValue.match(new RegExp("^([\\s"+f.fillChar+"]+)")))&&c[1]&&(a+=c[1]);a&&(a=d.document.createTextNode(a), |
|||
b.insertNode(a).setStartAfter(a))}b.collapse(!0).select(!0)}else if(8<r.version)if(c=d.document.createTextNode("\n"),a=b.startContainer,0==b.startOffset){if(a.previousSibling){b.insertNode(c);var e=d.document.createTextNode(" ");b.setStartAfter(c).insertNode(e).setStart(e,0).collapse(!0).select(!0)}}else b.insertNode(c).setStartAfter(c),e=d.document.createTextNode(" "),(a=b.startContainer.childNodes[b.startOffset])&&!/^\n/.test(a.nodeValue)&&b.setStartBefore(c),b.insertNode(e).setStart(e,0).collapse(!0).select(!0); |
|||
else{c=d.document.createElement("br");b.insertNode(c);b.insertNode(d.document.createTextNode(f.fillChar));b.setStartAfter(c);for(c=c.previousSibling;c;)if(a=c,c=c.previousSibling,!c||"BR"==c.nodeName){c=a;break}if(c){for(a="";c&&"BR"!=c.nodeName&&(new RegExp("^[ "+f.fillChar+"]*$")).test(c.nodeValue);)a+=c.nodeValue,c=c.nextSibling;"BR"!=c.nodeName&&(c=c.nodeValue.match(new RegExp("^([ "+f.fillChar+"]+)")))&&c[1]&&(a+=c[1]);a=d.document.createTextNode(a);b.insertNode(a).setStartAfter(a)}b.collapse(!0).select()}d.fireEvent("saveScene"); |
|||
return!0}});d.addListener("tabkeydown",function(b,c){var a=d.selection.getRange(),e=f.findParentByTagName(a.startContainer,"pre",!0);if(e){d.fireEvent("saveScene");if(!c.shiftKey)if(a.collapsed)e=d.document.createTextNode(" "),a.insertNode(e).setStartAfter(e).collapse(!0).select(!0);else{for(var h=a.createBookmark(),g=h.start.previousSibling;g;){if(e.firstChild===g&&!f.isBr(g)){e.insertBefore(d.document.createTextNode(" "),g);break}if(f.isBr(g)){e.insertBefore(d.document.createTextNode(" "), |
|||
g.nextSibling);break}g=g.previousSibling}var l=h.end,g=h.start.nextSibling;for(e.firstChild===h.start&&e.insertBefore(d.document.createTextNode(" "),g.nextSibling);g&&g!==l;){if(f.isBr(g)&&g.nextSibling){if(g.nextSibling===l)break;e.insertBefore(d.document.createTextNode(" "),g.nextSibling)}g=g.nextSibling}a.moveToBookmark(h).select()}d.fireEvent("saveScene");return!0}});d.addListener("beforeinserthtml",function(b,c){var a=this,e=a.selection.getRange();if(f.findParentByTagName(e.startContainer, |
|||
"pre",!0)){e.collapsed||e.deleteContents();var h="";if(r.ie&&8<r.version){p.each(UE.filterNode(UE.htmlparser(c),a.options.filterTxtRules).children,function(a){"element"==a.type?"br"==a.tagName?h+="\n":w.$empty[a.tagName]||(p.each(a.children,function(b){"element"==b.type?"br"==b.tagName?h+="\n":w.$empty[a.tagName]||(h+=b.innerText()):h+=b.data}),/\n$/.test(h)||(h+="\n")):h+=a.data+"\n";!a.nextSibling()&&/\n$/.test(h)&&(h=h.replace(/\n$/,""))});var g=a.document.createTextNode(p.html(h.replace(/ /g, |
|||
" ")));e.insertNode(g).selectNode(g).select()}else{var d=a.document.createDocumentFragment();p.each(UE.filterNode(UE.htmlparser(c),a.options.filterTxtRules).children,function(b){"element"==b.type?"br"==b.tagName?d.appendChild(a.document.createElement("br")):w.$empty[b.tagName]||(p.each(b.children,function(c){"element"==c.type?"br"==c.tagName?d.appendChild(a.document.createElement("br")):w.$empty[b.tagName]||d.appendChild(a.document.createTextNode(p.html(c.innerText().replace(/ /g," ")))):d.appendChild(a.document.createTextNode(p.html(c.data.replace(/ /g, |
|||
" "))))}),"BR"!=d.lastChild.nodeName&&d.appendChild(a.document.createElement("br"))):d.appendChild(a.document.createTextNode(p.html(b.data.replace(/ /g," "))));b.nextSibling()||"BR"!=d.lastChild.nodeName||d.removeChild(d.lastChild)});e.insertNode(d).select()}return!0}});d.addListener("keydown",function(b,c){if(40==(c.keyCode||c.which)){var a=this.selection.getRange(),e,h=a.startContainer;if(a.collapsed&&(e=f.findParentByTagName(a.startContainer,"pre",!0))&&!e.nextSibling){for(var g=e.lastChild;g&& |
|||
"BR"==g.nodeName;)g=g.previousSibling;if(g===h||a.startContainer===e&&a.startOffset==e.childNodes.length)this.execCommand("insertparagraph"),f.preventDefault(c)}}});d.addListener("delkeydown",function(b,c){var a=this.selection.getRange();a.txtToElmBoundary(!0);var e=a.startContainer;if(f.isTagNode(e,"pre")&&a.collapsed&&f.isStartInblock(a)){var h=d.document.createElement("p");f.fillNode(d.document,h);e.parentNode.insertBefore(h,e);f.remove(e);a.setStart(h,0).setCursor(!1,!0);f.preventDefault(c);return!0}})}; |
|||
UE.commands.cleardoc={execCommand:function(d){var b=this;d=b.options.enterTag;var c=b.selection.getRange();"br"==d?(b.body.innerHTML="<br/>",c.setStart(b.body,0).setCursor()):(b.body.innerHTML="<p>"+(J?"":"<br/>")+"</p>",c.setStart(b.body.firstChild,0).setCursor(!1,!0));setTimeout(function(){b.fireEvent("clearDoc")},0)}};UE.plugin.register("anchor",function(){return{bindEvents:{ready:function(){p.cssRule("anchor",".anchorclass{background: url('"+this.options.themePath+this.options.theme+"/images/anchor.gif') no-repeat scroll left center transparent;cursor: auto;display: inline-block;height: 16px;width: 15px;}", |
|||
this.document)}},outputRule:function(d){p.each(d.getNodesByTagName("img"),function(b){var c;if(c=b.getAttr("anchorname"))b.tagName="a",b.setAttr({anchorname:"",name:c,"class":""})})},inputRule:function(d){p.each(d.getNodesByTagName("a"),function(b){b.getAttr("name")&&!b.getAttr("href")&&(b.tagName="img",b.setAttr({anchorname:b.getAttr("name"),"class":"anchorclass"}),b.setAttr("name"))})},commands:{anchor:{execCommand:function(d,b){var c=this.selection.getRange(),a=c.getClosedNode();a&&a.getAttribute("anchorname")? |
|||
b?a.setAttribute("anchorname",b):(c.setStartBefore(a).setCursor(),f.remove(a)):b&&(a=this.document.createElement("img"),c.collapse(!0),f.setAttributes(a,{anchorname:b,"class":"anchorclass"}),c.insertNode(a).setStartAfter(a).setCursor(!1,!0))}}}}});UE.plugins.wordcount=function(){var d=this;d.setOpt("wordCount",!0);d.addListener("contentchange",function(){d.fireEvent("wordcount")});var b;d.addListener("ready",function(){var c=this;f.on(c.body,"keyup",function(a){(a.keyCode||a.which)in{16:1,18:1,20:1, |
|||
37:1,38:1,39:1,40:1}||(clearTimeout(b),b=setTimeout(function(){c.fireEvent("wordcount")},200))})})};UE.plugins.pagebreak=function(){function d(a){if(f.isEmptyBlock(a)){for(var b=a.firstChild,g;b&&1==b.nodeType&&f.isEmptyBlock(b);)g=b,b=b.firstChild;!g&&(g=a);f.fillNode(c.document,g)}}function b(a){return a&&1==a.nodeType&&"HR"==a.tagName&&"pagebreak"==a.className}var c=this,a=["td"];c.setOpt("pageBreakTag","_ueditor_page_break_tag_");c.ready(function(){p.cssRule("pagebreak",".pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}", |
|||
c.document)});c.addInputRule(function(a){a.traversal(function(a){if("text"==a.type&&a.data==c.options.pageBreakTag){var b=UE.uNode.createElement('<hr class="pagebreak" noshade="noshade" size="5" style="-webkit-user-select: none;">');a.parentNode.insertBefore(b,a);a.parentNode.removeChild(a)}})});c.addOutputRule(function(a){p.each(a.getNodesByTagName("hr"),function(a){if("pagebreak"==a.getAttr("class")){var b=UE.uNode.createText(c.options.pageBreakTag);a.parentNode.insertBefore(b,a);a.parentNode.removeChild(a)}})}); |
|||
c.commands.pagebreak={execCommand:function(){var e=c.selection.getRange(),h=c.document.createElement("hr");f.setAttributes(h,{"class":"pagebreak",noshade:"noshade",size:"5"});f.unSelectable(h);var g=f.findParentByTagName(e.startContainer,a,!0),l=[];if(g)switch(g.tagName){case "TD":g=g.parentNode,g.previousSibling?(g.parentNode.insertBefore(h,g),l=f.findParents(h)):(e=f.findParentByTagName(g,"table"),e.parentNode.insertBefore(h,e),l=f.findParents(h,!0)),g=l[1],h!==g&&f.breakParent(h,g),c.fireEvent("afteradjusttable", |
|||
c.document)}else{if(!e.collapsed)for(e.deleteContents(),g=e.startContainer;!f.isBody(g)&&f.isBlockElm(g)&&f.isEmptyNode(g);)e.setStartBefore(g).collapse(!0),f.remove(g),g=e.startContainer;e.insertNode(h);for(g=h.parentNode;!f.isBody(g);)f.breakParent(h,g),(g=h.nextSibling)&&f.isEmptyBlock(g)&&f.remove(g),g=h.parentNode;g=h.nextSibling;l=h.previousSibling;b(l)?f.remove(l):l&&d(l);g?(b(g)?f.remove(g):d(g),e.setEndAfter(h).collapse(!1)):(g=c.document.createElement("p"),h.parentNode.appendChild(g),f.fillNode(c.document, |
|||
g),e.setStart(g,0).collapse(!0));e.select(!0)}}}};UE.plugin.register("wordimage",function(){var d=this,b=[];return{commands:{wordimage:{execCommand:function(){for(var b=f.getElementsByTagName(d.body,"img"),a=[],e=0,h;h=b[e++];)(h=h.getAttribute("word_img"))&&a.push(h);return a},queryCommandState:function(){b=f.getElementsByTagName(d.body,"img");for(var c=0,a;a=b[c++];)if(a.getAttribute("word_img"))return 1;return-1},notNeedUndo:!0}},inputRule:function(b){p.each(b.getNodesByTagName("img"),function(a){var b= |
|||
a.attrs,c=128>parseInt(b.width)||43>parseInt(b.height),g=d.options,f=g.UEDITOR_HOME_URL+"themes/default/images/spacer.gif";b.src&&/^(?:(file:\/+))/.test(b.src)&&a.setAttr({width:b.width,height:b.height,alt:b.alt,word_img:b.src,src:f,style:"background:url("+(c?g.themePath+g.theme+"/images/word.gif":g.langPath+g.lang+"/images/localimage.png")+") no-repeat center center;border:1px solid #ddd"})})}}});UE.plugins.dragdrop=function(){var d=this;d.ready(function(){f.on(this.body,"dragend",function(){var b= |
|||
d.selection.getRange(),c=b.getClosedNode()||d.selection.getStart();if(c&&"IMG"==c.tagName){for(var a=c.previousSibling,e;(e=c.nextSibling)&&1==e.nodeType&&"SPAN"==e.tagName&&!e.firstChild;)f.remove(e);(!a||1!=a.nodeType||f.isEmptyBlock(a))&&a||e&&(!e||f.isEmptyBlock(e))||(a&&"P"==a.tagName&&!f.isEmptyBlock(a)?(a.appendChild(c),f.moveChild(e,a),f.remove(e)):e&&"P"==e.tagName&&!f.isEmptyBlock(e)&&e.insertBefore(c,e.firstChild),a&&"P"==a.tagName&&f.isEmptyBlock(a)&&f.remove(a),e&&"P"==e.tagName&&f.isEmptyBlock(e)&& |
|||
f.remove(e),b.selectNode(c).select(),d.fireEvent("saveScene"))}})});d.addListener("keyup",function(b,c){if(13==(c.keyCode||c.which)){var a=d.selection.getRange(),e;(e=f.findParentByTagName(a.startContainer,"p",!0))&&"center"==f.getComputedStyle(e,"text-align")&&f.removeStyle(e,"text-align")}})};UE.plugins.undo=function(){function d(a,b){if(a.length!=b.length)return 0;for(var c=0,e=a.length;c<e;c++)if(a[c]!=b[c])return 0;return 1}var b,c=this,a=c.options.maxUndoCount||20,e=c.options.maxInputCount|| |
|||
20,h=new RegExp(f.fillChar+"|</hr>","gi"),g={ol:1,ul:1,table:1,tbody:1,tr:1,body:1},l=c.options.autoClearEmptyNode;c.undoManger=new function(){this.list=[];this.index=0;this.hasRedo=this.hasUndo=!1;this.undo=function(){if(this.hasUndo)if(this.list[this.index-1]||1!=this.list.length){for(;this.list[this.index].content==this.list[this.index-1].content;)if(this.index--,0==this.index)return this.restore(0);this.restore(--this.index)}else this.reset()};this.redo=function(){if(this.hasRedo){for(;this.list[this.index].content== |
|||
this.list[this.index+1].content;)if(this.index++,this.index==this.list.length-1)return this.restore(this.index);this.restore(++this.index)}};this.restore=function(){var a=this.editor,b=this.list[this.index],c=UE.htmlparser(b.content.replace(h,""));a.options.autoClearEmptyNode=!1;a.filterInputRule(c);a.options.autoClearEmptyNode=l;a.document.body.innerHTML=c.toHtml();a.fireEvent("afterscencerestore");r.ie&&p.each(f.getElementsByTagName(a.document,"td th caption p"),function(b){f.isEmptyNode(b)&&f.fillNode(a.document, |
|||
b)});try{var e=(new M.Range(a.document)).moveToAddress(b.address);e.select(g[e.startContainer.nodeName.toLowerCase()])}catch(d){}this.update();this.clearKey();a.fireEvent("reset",!0)};this.getScene=function(){var a=this.editor,b=a.selection.getRange().createAddress(!1,!0);a.fireEvent("beforegetscene");var c=UE.htmlparser(a.body.innerHTML);a.options.autoClearEmptyNode=!1;a.filterOutputRule(c);a.options.autoClearEmptyNode=l;c=c.toHtml();a.fireEvent("aftergetscene");return{address:b,content:c}};this.save= |
|||
function(e,g){clearTimeout(b);var h=this.getScene(g),k=this.list[this.index];k&&k.content!=h.content&&c.trigger("contentchange");var f;if(f=k&&k.content==h.content)e?k=1:(k=k.address,f=h.address,k=k.collapsed!=f.collapsed?0:d(k.startAddress,f.startAddress)&&d(k.endAddress,f.endAddress)?1:0),f=k;f||(this.list=this.list.slice(0,this.index+1),this.list.push(h),this.list.length>a&&this.list.shift(),this.index=this.list.length-1,this.clearKey(),this.update())};this.update=function(){this.hasRedo=!!this.list[this.index+ |
|||
1];this.hasUndo=!!this.list[this.index-1]};this.reset=function(){this.list=[];this.index=0;this.hasRedo=this.hasUndo=!1;this.clearKey()};this.clearKey=function(){m=0}};c.undoManger.editor=c;c.addListener("saveScene",function(){var a=Array.prototype.splice.call(arguments,1);this.undoManger.save.apply(this.undoManger,a)});c.addListener("reset",function(a,b){b||this.undoManger.reset()});c.commands.redo=c.commands.undo={execCommand:function(a){this.undoManger[a]()},queryCommandState:function(a){return this.undoManger["has"+ |
|||
("undo"==a.toLowerCase()?"Undo":"Redo")]?0:-1},notNeedUndo:1};var k={16:1,17:1,18:1,37:1,38:1,39:1,40:1},m=0,n=!1;c.addListener("ready",function(){f.on(this.body,"compositionstart",function(){n=!0});f.on(this.body,"compositionend",function(){n=!1})});c.addshortcutkey({Undo:"ctrl+90",Redo:"ctrl+89"});var q=!0;c.addListener("keydown",function(a,c){var g=this;if(!(k[c.keyCode||c.which]||c.ctrlKey||c.metaKey||c.shiftKey||c.altKey)){var h=function(a){a.undoManger.save(!1,!0);a.fireEvent("selectionchange")}; |
|||
n||(g.selection.getRange().collapsed?(0==g.undoManger.list.length&&g.undoManger.save(!0),clearTimeout(b),b=setTimeout(function(){if(n)var a=setInterval(function(){n||(h(g),clearInterval(a))},300);else h(g)},200),m++,m>=e&&h(g)):(g.undoManger.save(!1,!0),q=!1))}});c.addListener("keyup",function(a,b){k[b.keyCode||b.which]||b.ctrlKey||b.metaKey||b.shiftKey||b.altKey||n||q||(this.undoManger.save(!1,!0),q=!0)});c.stopCmdUndo=function(){c.__hasEnterExecCommand=!0};c.startCmdUndo=function(){c.__hasEnterExecCommand= |
|||
!1}};UE.plugin.register("copy",function(){function d(){ZeroClipboard.config({debug:!1,swfPath:b.options.UEDITOR_HOME_URL+"third-party/zeroclipboard/ZeroClipboard.swf"});var c=b.zeroclipboard=new ZeroClipboard;c.on("copy",function(a){a=a.client;var c=b.selection.getRange(),h=document.createElement("div");h.appendChild(c.cloneContents());a.setText(h.innerText||h.textContent);a.setHtml(h.innerHTML);c.select()});c.on("mouseover mouseout",function(a){var b=a.target;"mouseover"==a.type?f.addClass(b,"edui-state-hover"): |
|||
"mouseout"==a.type&&f.removeClasses(b,"edui-state-hover")});c.on("wrongflash noflash",function(){ZeroClipboard.destroy()})}var b=this;return{bindEvents:{ready:function(){r.ie||(window.ZeroClipboard?d():p.loadFile(document,{src:b.options.UEDITOR_HOME_URL+"third-party/zeroclipboard/ZeroClipboard.js",tag:"script",type:"text/javascript",defer:"defer"},function(){d()}))}},commands:{copy:{execCommand:function(c){b.document.execCommand("copy")||alert(b.getLang("copymsg"))}}}}});UE.plugins.paste=function(){function d(a){var b= |
|||
this.document;if(!b.getElementById("baidu_pastebin")){var c=this.selection.getRange(),e=c.createBookmark(),g=b.createElement("div");g.id="baidu_pastebin";r.webkit&&g.appendChild(b.createTextNode(f.fillChar+f.fillChar));b.body.appendChild(g);e.start.style.display="";g.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:"+f.getXY(e.start).y+"px";c.selectNodeContents(g).select(!0);setTimeout(function(){if(r.webkit)for(var h=0,d=b.querySelectorAll("#baidu_pastebin"), |
|||
z;z=d[h++];)if(f.isEmptyNode(z))f.remove(z);else{g=z;break}try{g.parentNode.removeChild(g)}catch(v){}c.moveToBookmark(e).select(!0);a(g)},0)}}function b(a){return a.replace(/<(\/?)([\w\-]+)([^>]*)>/gi,function(a,b,c,e){c=c.toLowerCase();if({img:1}[c])return a;e=e.replace(/([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi,function(a,b,c){return{src:1,href:1,name:1}[b.toLowerCase()]?b+"="+c+" ":""});return{span:1,div:1}[c]?"":"<"+b+c+" "+p.trim(e)+">"})}function c(c){var d;if(c.firstChild){var m= |
|||
f.getElementsByTagName(c,"span");d=0;for(var n;n=m[d++];)"_baidu_cut_start"!=n.id&&"_baidu_cut_end"!=n.id||f.remove(n);if(r.webkit){n=c.querySelectorAll("div br");for(d=0;m=n[d++];)m=m.parentNode,"DIV"==m.tagName&&1==m.childNodes.length&&(m.innerHTML="<p><br/></p>",f.remove(m));m=c.querySelectorAll("#baidu_pastebin");for(d=0;n=m[d++];){var q=a.document.createElement("p");for(n.parentNode.insertBefore(q,n);n.firstChild;)q.appendChild(n.firstChild);f.remove(n)}n=c.querySelectorAll("meta");for(d=0;m= |
|||
n[d++];)f.remove(m);n=c.querySelectorAll("br");for(d=0;m=n[d++];)/^apple-/i.test(m.className)&&f.remove(m)}if(r.gecko)for(n=c.querySelectorAll("[_moz_dirty]"),d=0;m=n[d++];)m.removeAttribute("_moz_dirty");if(!r.ie)for(n=c.querySelectorAll("span.Apple-style-span"),d=0;m=n[d++];)f.remove(m,!0);d=c.innerHTML;d=UE.filterWord(d);c=UE.htmlparser(d);a.options.filterRules&&UE.filterNode(c,a.options.filterRules);a.filterInputRule(c);r.webkit&&((d=c.lastChild())&&"element"==d.type&&"br"==d.tagName&&c.removeChild(d), |
|||
p.each(a.body.querySelectorAll("div"),function(a){f.isEmptyBlock(a)&&f.remove(a,!0)}));d={html:c.toHtml()};a.fireEvent("beforepaste",d,c);d.html&&(c=UE.htmlparser(d.html,!0),1===a.queryCommandState("pasteplain")?a.execCommand("insertHtml",UE.filterNode(c,a.options.filterTxtRules).toHtml(),!0):(UE.filterNode(c,a.options.filterTxtRules),e=c.toHtml(),h=d.html,g=a.selection.getRange().createAddress(!0),a.execCommand("insertHtml",!0===a.getOpt("retainOnlyLabelPasted")?b(h):h,!0)),a.fireEvent("afterpaste", |
|||
d))}}var a=this;a.setOpt({retainOnlyLabelPasted:!1});var e,h,g;a.addListener("pasteTransfer",function(c,d){if(g&&e&&h&&e!=h){var m=a.selection.getRange();m.moveToAddress(g,!0);if(!m.collapsed){for(;!f.isBody(m.startContainer);){var n=m.startContainer;if(1==n.nodeType){n=n.childNodes[m.startOffset];if(!n){m.setStartBefore(m.startContainer);continue}(n=n.previousSibling)&&3==n.nodeType&&(new RegExp("^[\n\r\t "+f.fillChar+"]*$")).test(n.nodeValue)&&m.setStartBefore(n)}if(0==m.startOffset)m.setStartBefore(m.startContainer); |
|||
else break}for(;!f.isBody(m.endContainer);){n=m.endContainer;if(1==n.nodeType){n=n.childNodes[m.endOffset];if(!n){m.setEndAfter(m.endContainer);continue}(n=n.nextSibling)&&3==n.nodeType&&(new RegExp("^[\n\r\t"+f.fillChar+"]*$")).test(n.nodeValue)&&m.setEndAfter(n)}if(m.endOffset==m.endContainer[3==m.endContainer.nodeType?"nodeValue":"childNodes"].length)m.setEndAfter(m.endContainer);else break}}m.deleteContents();m.select(!0);a.__hasEnterExecCommand=!0;m=h;2===d?m=b(m):d&&(m=e);a.execCommand("inserthtml", |
|||
m,!0);a.__hasEnterExecCommand=!1;for(m=a.selection.getRange();!f.isBody(m.startContainer)&&!m.startOffset&&m.startContainer[3==m.startContainer.nodeType?"nodeValue":"childNodes"].length;)m.setStartBefore(m.startContainer);m=m.createAddress(!0);g.endAddress=m.startAddress}});a.addListener("ready",function(){f.on(a.body,"cut",function(){!a.selection.getRange().collapsed&&a.undoManger&&a.undoManger.save()});f.on(a.body,r.ie||r.opera?"keydown":"paste",function(b){(!r.ie&&!r.opera||(b.ctrlKey||b.metaKey)&& |
|||
"86"==b.keyCode)&&d.call(a,function(a){c(a)})})});a.commands.paste={execCommand:function(b){r.ie?(d.call(a,function(a){c(a)}),a.document.execCommand("paste")):alert(a.getLang("pastemsg"))}}};UE.plugins.pasteplain=function(){this.setOpt({pasteplain:!1,filterTxtRules:function(){function b(a){a.tagName="p";a.setStyle()}function c(a){a.parentNode.removeChild(a,!0)}return{"-":"script style object iframe embed input select",p:{$:{}},br:{$:{}},div:function(a){for(var b,c=UE.uNode.createElement("p");b=a.firstChild();)"text"!= |
|||
b.type&&UE.dom.dtd.$block[b.tagName]?c.firstChild()?(a.parentNode.insertBefore(c,a),c=UE.uNode.createElement("p")):a.parentNode.insertBefore(b,a):c.appendChild(b);c.firstChild()&&a.parentNode.insertBefore(c,a);a.parentNode.removeChild(a)},ol:c,ul:c,dl:c,dt:c,dd:c,li:c,caption:b,th:b,tr:b,h1:b,h2:b,h3:b,h4:b,h5:b,h6:b,td:function(a){a.innerText()&&a.parentNode.insertAfter(UE.uNode.createText(" "),a);a.parentNode.removeChild(a,a.innerText())}}}()});var d=this.options.pasteplain;this.commands.pasteplain= |
|||
{queryCommandState:function(){return d?1:0},execCommand:function(){d=!d|0},notNeedUndo:1}};UE.plugins.list=function(){function d(a){var b=[],c;for(c in a)b.push(c);return b}function b(a){var b=a.className;return f.hasClass(a,/custom_/)?b.match(/custom_(\w+)/)[1]:f.getStyle(a,"list-style-type")}function c(c,g){p.each(f.getElementsByTagName(c,"ol ul"),function(d){if(f.inDoc(d,c)){var h=d.parentNode;if(h.tagName==d.tagName){var k=b(d)||("OL"==d.tagName?"decimal":"disc"),l=b(h)||("OL"==h.tagName?"decimal": |
|||
"disc");k==l&&(k=p.indexOf(n[d.tagName],k),k=k+1==n[d.tagName].length?0:k+1,e(d,n[d.tagName][k]))}var q=0,k=2;f.hasClass(d,/custom_/)?/[ou]l/i.test(h.tagName)&&f.hasClass(h,/custom_/)||(k=1):/[ou]l/i.test(h.tagName)&&f.hasClass(h,/custom_/)&&(k=3);(h=f.getStyle(d,"list-style-type"))&&(d.style.cssText="list-style-type:"+h);d.className=p.trim(d.className.replace(/list-paddingleft-\w+/,""))+" list-paddingleft-"+k;p.each(f.getElementsByTagName(d,"li"),function(a){a.style.cssText&&(a.style.cssText=""); |
|||
if(!a.firstChild)f.remove(a);else if(a.parentNode===d){q++;if(f.hasClass(d,/custom_/)){var c=1,e=b(d);if("OL"==d.tagName){if(e)switch(e){case "cn":case "cn1":case "cn2":10<q&&(0==q%10||10<q&&20>q)?c=2:20<q&&(c=3);break;case "num2":9<q&&(c=2)}a.className="list-"+m[e]+q+" list-"+e+"-paddingleft-"+c}else a.className="list-"+m[e]+" list-"+e+"-paddingleft"}else a.className=a.className.replace(/list-[\w\-]+/gi,"");c=a.getAttribute("class");null===c||c.replace(/\s/g,"")||f.removeAttributes(a,"class")}}); |
|||
!g&&a(d,d.tagName.toLowerCase(),b(d)||f.getStyle(d,"list-style-type"),!0)}})}function a(a,e,g,d){var h=a.nextSibling;h&&1==h.nodeType&&h.tagName.toLowerCase()==e&&(b(h)||f.getStyle(h,"list-style-type")||("ol"==e?"decimal":"disc"))==g&&(f.moveChild(h,a),0==h.childNodes.length&&f.remove(h));h&&f.isFillChar(h)&&f.remove(h);(h=a.previousSibling)&&1==h.nodeType&&h.tagName.toLowerCase()==e&&(b(h)||f.getStyle(h,"list-style-type")||("ol"==e?"decimal":"disc"))==g&&f.moveChild(a,h);h&&f.isFillChar(h)&&f.remove(h); |
|||
!d&&f.isEmptyBlock(a)&&f.remove(a);b(a)&&c(a.ownerDocument,!0)}function e(a,b){m[b]&&(a.className="custom_"+b);try{f.setStyle(a,"list-style-type",b)}catch(c){}}function h(a){var b=a.previousSibling;b&&f.isEmptyBlock(b)&&f.remove(b);(b=a.nextSibling)&&f.isEmptyBlock(b)&&f.remove(b)}function g(a){for(;a&&!f.isBody(a);){if("TABLE"==a.nodeName)return null;if("LI"==a.nodeName)return a;a=a.parentNode}}var l=this,k={TD:1,PRE:1,BLOCKQUOTE:1},m={cn:"cn-1-",cn1:"cn-2-",cn2:"cn-3-",num:"num-1-",num1:"num-2-", |
|||
num2:"num-3-",dash:"dash",dot:"dot"};l.setOpt({autoTransWordToList:!1,insertorderedlist:{num:"",num1:"",num2:"",cn:"",cn1:"",cn2:"",decimal:"","lower-alpha":"","lower-roman":"","upper-alpha":"","upper-roman":""},insertunorderedlist:{circle:"",disc:"",square:"",dash:"",dot:""},listDefaultPaddingLeft:"30",listiconpath:"http://bs.baidu.com/listicon/",maxListLevel:-1,disablePInList:!1});var n={OL:d(l.options.insertorderedlist),UL:d(l.options.insertunorderedlist)},q=l.options.listiconpath,u;for(u in m)l.options.insertorderedlist.hasOwnProperty(u)|| |
|||
l.options.insertunorderedlist.hasOwnProperty(u)||delete m[u];l.ready(function(){var a=[],b;for(b in m){if("dash"==b||"dot"==b)a.push("li.list-"+m[b]+"{background-image:url("+q+m[b]+".gif)}"),a.push("ul.custom_"+b+"{list-style:none;}ul.custom_"+b+" li{background-position:0 3px;background-repeat:no-repeat}");else{for(var c=0;99>c;c++)a.push("li.list-"+m[b]+c+"{background-image:url("+q+"list-"+m[b]+c+".gif)}");a.push("ol.custom_"+b+"{list-style:none;}ol.custom_"+b+" li{background-position:0 3px;background-repeat:no-repeat}")}switch(b){case "cn":a.push("li.list-"+ |
|||
b+"-paddingleft-1{padding-left:25px}");a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}");a.push("li.list-"+b+"-paddingleft-3{padding-left:55px}");break;case "cn1":a.push("li.list-"+b+"-paddingleft-1{padding-left:30px}");a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}");a.push("li.list-"+b+"-paddingleft-3{padding-left:55px}");break;case "cn2":a.push("li.list-"+b+"-paddingleft-1{padding-left:40px}");a.push("li.list-"+b+"-paddingleft-2{padding-left:55px}");a.push("li.list-"+b+"-paddingleft-3{padding-left:68px}"); |
|||
break;case "num":case "num1":a.push("li.list-"+b+"-paddingleft-1{padding-left:25px}");break;case "num2":a.push("li.list-"+b+"-paddingleft-1{padding-left:35px}");a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}");break;case "dash":a.push("li.list-"+b+"-paddingleft{padding-left:35px}");break;case "dot":a.push("li.list-"+b+"-paddingleft{padding-left:20px}")}}a.push(".list-paddingleft-1{padding-left:0}");a.push(".list-paddingleft-2{padding-left:"+l.options.listDefaultPaddingLeft+"px}");a.push(".list-paddingleft-3{padding-left:"+ |
|||
2*l.options.listDefaultPaddingLeft+"px}");p.cssRule("list","ol,ul{margin:0;pading:0;"+(r.ie?"":"width:95%")+"}li{clear:both;}"+a.join("\n"),l.document)});l.ready(function(){f.on(l.body,"cut",function(){setTimeout(function(){var a=l.selection.getRange(),b;if(!a.collapsed&&(b=f.findParentByTagName(a.startContainer,"li",!0))&&!b.nextSibling&&f.isEmptyBlock(b)){b=b.parentNode;var c;(c=b.previousSibling)?(f.remove(b),a.setStartAtLast(c).collapse(!0)):(c=b.nextSibling)?(f.remove(b),a.setStartAtFirst(c).collapse(!0)): |
|||
(c=l.document.createElement("p"),f.fillNode(l.document,c),b.parentNode.insertBefore(c,b),f.remove(b),a.setStart(c,0).collapse(!0));a.select(!0)}})})});l.addListener("beforepaste",function(a,c){var e=this.selection.getRange(),g=UE.htmlparser(c.html,!0);if(e=f.findParentByTagName(e.startContainer,"li",!0)){var d=e.parentNode;p.each(g.getNodesByTagName("OL"==d.tagName?"ul":"ol"),function(c){c.tagName=d.tagName;c.setAttr();if(c.parentNode===g)a=b(d)||("OL"==d.tagName?"decimal":"disc");else{var e=c.parentNode.getAttr("class"); |
|||
(a=e&&/custom_/.test(e)?e.match(/custom_(\w+)/)[1]:c.parentNode.getStyle("list-style-type"))||(a="OL"==d.tagName?"decimal":"disc")}e=p.indexOf(n[d.tagName],a);c.parentNode!==g&&(e=e+1==n[d.tagName].length?0:e+1);e=n[d.tagName][e];m[e]?c.setAttr("class","custom_"+e):c.setStyle("list-style-type",e)})}c.html=g.toHtml()});!0===l.getOpt("disablePInList")&&l.addOutputRule(function(a){p.each(a.getNodesByTagName("li"),function(a){var b=[],c=0;p.each(a.children,function(e){if("p"==e.tagName){for(var g;g=e.children.pop();)b.splice(c, |
|||
0,g),g.parentNode=a,lastNode=g;g=b[b.length-1];g&&"element"==g.type&&"br"==g.tagName||(e=UE.uNode.createElement("br"),e.parentNode=a,b.push(e));c=b.length}});b.length&&(a.children=b)})});l.addInputRule(function(a){p.each(a.getNodesByTagName("li"),function(a){for(var b=UE.uNode.createElement("p"),c=0,e;e=a.children[c];)"text"==e.type||w.p[e.tagName]?b.appendChild(e):b.firstChild()?(a.insertBefore(b,e),b=UE.uNode.createElement("p"),c+=2):c++;(b.firstChild()&&!b.parentNode||!a.firstChild())&&a.appendChild(b); |
|||
b.firstChild()||b.innerHTML(r.ie?" ":"<br/>");a=a.firstChild();(b=a.lastChild())&&"text"==b.type&&/^\s*$/.test(b.data)&&a.removeChild(b)});if(l.options.autoTransWordToList){var b=function(a,b){var g=b.firstChild();if(g&&"element"==g.type&&"span"==g.tagName&&/Wingdings|Symbol/.test(g.getStyle("font-family"))){for(var d in e)if(e[d]==g.data)return d;return"disc"}for(d in c)if(c[d].test(a))return d},c={num1:/^\d+\)/,decimal:/^\d+\./,"lower-alpha":/^[a-z]+\)/,"upper-alpha":/^[A-Z]+\./,cn:/^[\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+[\u3001]/, |
|||
cn2:/^\([\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+\)/},e={square:"n"};p.each(a.getNodesByTagName("p"),function(a){if("MsoListParagraph"==a.getAttr("class")){a.setStyle("margin","");a.setStyle("margin-left","");a.setAttr("class","");var e=a,g,d=a;if("li"!=a.parentNode.tagName&&(g=b(a.innerText(),a))){var h=UE.uNode.createElement(l.options.insertorderedlist.hasOwnProperty(g)?"ol":"ul");for(m[g]?h.setAttr("class","custom_"+g):h.setStyle("list-style-type",g);a&&"li"!=a.parentNode.tagName&& |
|||
b(a.innerText(),a);){(e=a.nextSibling())||a.parentNode.insertBefore(h,a);var k=h,f=g;if("ol"==k.tagName)if(r.ie){var n=a.firstChild();"element"==n.type&&"span"==n.tagName&&c[f].test(n.innerText())&&a.removeChild(n)}else a.innerHTML(a.innerHTML().replace(c[f],""));else a.removeChild(a.firstChild());f=UE.uNode.createElement("li");f.appendChild(a);k.appendChild(f);a=e}!h.parentNode&&a&&a.parentNode&&a.parentNode.insertBefore(h,a)}(e=d.firstChild())&&"element"==e.type&&"span"==e.tagName&&/^\s*( )+\s*$/.test(e.innerText())&& |
|||
e.parentNode.removeChild(e)}})}});l.addListener("contentchange",function(){c(l.document)});l.addListener("keydown",function(a,b){function c(){b.preventDefault?b.preventDefault():b.returnValue=!1;l.fireEvent("contentchange");l.undoManger&&l.undoManger.save()}function e(a,b){for(;a&&!f.isBody(a)&&!b(a);){if(1==a.nodeType&&/[ou]l/i.test(a.tagName))return a;a=a.parentNode}return null}var g=b.keyCode||b.which;if(13==g&&!b.shiftKey){var d=l.selection.getRange(),k=f.findParent(d.startContainer,function(a){return f.isBlockElm(a)}, |
|||
!0),n=f.findParentByTagName(d.startContainer,"li",!0);k&&"PRE"!=k.tagName&&!n&&(n=k.innerHTML.replace(new RegExp(f.fillChar,"g"),""),/^\s*1\s*\.[^\d]/.test(n)&&(k.innerHTML=n.replace(/^\s*1\s*\./,""),d.setStartAtLast(k).collapse(!0).select(),l.__hasEnterExecCommand=!0,l.execCommand("insertorderedlist"),l.__hasEnterExecCommand=!1));d=l.selection.getRange();k=e(d.startContainer,function(a){return"TABLE"==a.tagName});n=d.collapsed?k:e(d.endContainer,function(a){return"TABLE"==a.tagName});if(k&&n&&k=== |
|||
n){if(!d.collapsed)if(k=f.findParentByTagName(d.startContainer,"li",!0),n=f.findParentByTagName(d.endContainer,"li",!0),k&&n&&k===n){if(d.deleteContents(),(n=f.findParentByTagName(d.startContainer,"li",!0))&&f.isEmptyBlock(n)){u=n.previousSibling;next=n.nextSibling;k=l.document.createElement("p");f.fillNode(l.document,k);q=n.parentNode;u&&next?(d.setStart(next,0).collapse(!0).select(!0),f.remove(n)):((u||next)&&u?n.parentNode.parentNode.insertBefore(k,q.nextSibling):q.parentNode.insertBefore(k,q), |
|||
f.remove(n),q.firstChild||f.remove(q),d.setStart(k,0).setCursor());c();return}}else{var k=d.cloneRange(),m=k.collapse(!1).createBookmark();d.deleteContents();k.moveToBookmark(m);n=f.findParentByTagName(k.startContainer,"li",!0);h(n);k.select();c();return}if(n=f.findParentByTagName(d.startContainer,"li",!0)){if(f.isEmptyBlock(n)){var m=d.createBookmark(),q=n.parentNode;n!==q.lastChild?(f.breakParent(n,q),h(n)):(q.parentNode.insertBefore(n,q.nextSibling),f.isEmptyNode(q)&&f.remove(q));if(!w.$list[n.parentNode.tagName])if(f.isBlockElm(n.firstChild))f.remove(n, |
|||
!0);else{k=l.document.createElement("p");for(n.parentNode.insertBefore(k,n);n.firstChild;)k.appendChild(n.firstChild);f.remove(n)}d.moveToBookmark(m).select()}else{k=n.firstChild;if(!k||!f.isBlockElm(k)){k=l.document.createElement("p");for(!n.firstChild&&f.fillNode(l.document,k);n.firstChild;)k.appendChild(n.firstChild);n.appendChild(k)}m=l.document.createElement("span");d.insertNode(m);f.breakParent(m,n);u=m.nextSibling;k=u.firstChild;k||(k=l.document.createElement("p"),f.fillNode(l.document,k), |
|||
u.appendChild(k));f.isEmptyNode(k)&&(k.innerHTML="",f.fillNode(l.document,k));d.setStart(k,0).collapse(!0).shrinkBoundary().select();f.remove(m);var u=u.previousSibling;u&&f.isEmptyBlock(u)&&(u.innerHTML="<p></p>",f.fillNode(l.document,u.firstChild))}c()}}}if(8==g&&(d=l.selection.getRange(),d.collapsed&&f.isStartInblock(d)&&(k=d.cloneRange().trimBoundary(),(n=f.findParentByTagName(d.startContainer,"li",!0))&&f.isStartInblock(k))))if((k=f.findParentByTagName(d.startContainer,"p",!0))&&k!==n.firstChild)q= |
|||
f.findParentByTagName(k,["ol","ul"]),f.breakParent(k,q),h(k),l.fireEvent("contentchange"),d.setStart(k,0).setCursor(!1,!0),l.fireEvent("saveScene"),f.preventDefault(b);else if(n&&(u=n.previousSibling)){if(46!=g||!n.childNodes.length){w.$list[u.tagName]&&(u=u.lastChild);l.undoManger&&l.undoManger.save();k=n.firstChild;if(f.isBlockElm(k))if(f.isEmptyNode(k))for(u.appendChild(k),d.setStart(k,0).setCursor(!1,!0);n.firstChild;)u.appendChild(n.firstChild);else m=l.document.createElement("span"),d.insertNode(m), |
|||
f.isEmptyBlock(u)&&(u.innerHTML=""),f.moveChild(n,u),d.setStartBefore(m).collapse(!0).select(!0),f.remove(m);else if(f.isEmptyNode(n))k=l.document.createElement("p"),u.appendChild(k),d.setStart(k,0).setCursor();else for(d.setEnd(u,u.childNodes.length).collapse().select(!0);n.firstChild;)u.appendChild(n.firstChild);f.remove(n);l.fireEvent("contentchange");l.fireEvent("saveScene");f.preventDefault(b)}}else if(n&&!n.previousSibling){q=n.parentNode;m=d.createBookmark();if(f.isTagNode(q.parentNode,"ol ul"))q.parentNode.insertBefore(n, |
|||
q);else{for(;n.firstChild;)q.parentNode.insertBefore(n.firstChild,q);f.remove(n)}f.isEmptyNode(q)&&f.remove(q);d.moveToBookmark(m).setCursor(!1,!0);l.fireEvent("contentchange");l.fireEvent("saveScene");f.preventDefault(b)}});l.addListener("keyup",function(c,e){if(8==(e.keyCode||e.which)){var g=l.selection.getRange(),d;(d=f.findParentByTagName(g.startContainer,["ol","ul"],!0))&&a(d,d.tagName.toLowerCase(),b(d)||f.getComputedStyle(d,"list-style-type"),!0)}});l.addListener("tabkeydown",function(){function c(a){if(-1!= |
|||
l.options.maxListLevel){a=a.parentNode;for(var b=0;/[ou]l/i.test(a.tagName);)b++,a=a.parentNode;if(b>=l.options.maxListLevel)return!0}}var g=l.selection.getRange(),d=f.findParentByTagName(g.startContainer,"li",!0);if(d){var h;if(g.collapsed){if(c(d))return!0;var k=d.parentNode,m=l.document.createElement(k.tagName),q=p.indexOf(n[m.tagName],b(k)||f.getComputedStyle(k,"list-style-type")),q=q+1==n[m.tagName].length?0:q+1,q=n[m.tagName][q];e(m,q);if(f.isStartInblock(g))return l.fireEvent("saveScene"), |
|||
h=g.createBookmark(),k.insertBefore(m,d),m.appendChild(d),a(m,m.tagName.toLowerCase(),q),l.fireEvent("contentchange"),g.moveToBookmark(h).select(!0),!0}else{l.fireEvent("saveScene");h=g.createBookmark();for(var k=0,u,m=f.findParents(d),r;r=m[k++];)if(f.isTagNode(r,"ol ul")){u=r;break}r=d;if(h.end)for(;r&&!(f.getPosition(r,h.end)&f.POSITION_FOLLOWING);)if(c(r))r=f.getNextDomNode(r,!1,null,function(a){return a!==u});else{k=r.parentNode;m=l.document.createElement(k.tagName);q=p.indexOf(n[m.tagName], |
|||
b(k)||f.getComputedStyle(k,"list-style-type"));q=n[m.tagName][q+1==n[m.tagName].length?0:q+1];e(m,q);for(k.insertBefore(m,r);r&&!(f.getPosition(r,h.end)&f.POSITION_FOLLOWING);){d=r.nextSibling;m.appendChild(r);if(!d||f.isTagNode(d,"ol ul")){if(d)for(;(d=d.firstChild)&&"LI"!=d.tagName;);else d=f.getNextDomNode(r,!1,null,function(a){return a!==u});break}r=d}a(m,m.tagName.toLowerCase(),q);r=d}l.fireEvent("contentchange");g.moveToBookmark(h).select();return!0}}});l.commands.insertorderedlist=l.commands.insertunorderedlist= |
|||
{execCommand:function(c,d){d||(d="insertorderedlist"==c.toLowerCase()?"decimal":"disc");var h=this.selection.getRange(),l=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase():!f.isWhitespace(a)},n="insertorderedlist"==c.toLowerCase()?"ol":"ul",m=this.document.createDocumentFragment();h.adjustmentBoundary().shrinkBoundary();var q=h.createBookmark(!0),u=g(this.document.getElementById(q.start)),p=0,r=g(this.document.getElementById(q.end)),t=0,A,I,E,C;if(u||r){u&&(A=u.parentNode);q.end||(r= |
|||
u);r&&(I=r.parentNode);if(A===I){for(;u!==r;){C=u;u=u.nextSibling;if(!f.isBlockElm(C.firstChild)){for(l=this.document.createElement("p");C.firstChild;)l.appendChild(C.firstChild);C.appendChild(l)}m.appendChild(C)}C=this.document.createElement("span");A.insertBefore(C,r);if(!f.isBlockElm(r.firstChild)){for(l=this.document.createElement("p");r.firstChild;)l.appendChild(r.firstChild);r.appendChild(l)}m.appendChild(r);f.breakParent(C,A);f.isEmptyNode(C.previousSibling)&&f.remove(C.previousSibling);f.isEmptyNode(C.nextSibling)&& |
|||
f.remove(C.nextSibling);l=b(A)||f.getComputedStyle(A,"list-style-type")||("insertorderedlist"==c.toLowerCase()?"decimal":"disc");if(A.tagName.toLowerCase()==n&&l==d){r=0;for(r=this.document.createDocumentFragment();l=m.firstChild;)if(f.isTagNode(l,"ol ul"))r.appendChild(l);else for(;l.firstChild;)r.appendChild(l.firstChild),f.remove(l);C.parentNode.insertBefore(r,C)}else E=this.document.createElement(n),e(E,d),E.appendChild(m),C.parentNode.insertBefore(E,C);f.remove(C);E&&a(E,n,d);h.moveToBookmark(q).select(); |
|||
return}if(u){for(;u;){C=u.nextSibling;if(f.isTagNode(u,"ol ul"))m.appendChild(u);else{E=this.document.createDocumentFragment();for(var P=0;u.firstChild;)f.isBlockElm(u.firstChild)&&(P=1),E.appendChild(u.firstChild);P?m.appendChild(E):(P=this.document.createElement("p"),P.appendChild(E),m.appendChild(P));f.remove(u)}u=C}A.parentNode.insertBefore(m,A.nextSibling);f.isEmptyNode(A)?(h.setStartBefore(A),f.remove(A)):h.setStartAfter(A);p=1}if(r&&f.inDoc(I,this.document)){for(u=I.firstChild;u&&u!==r;){C= |
|||
u.nextSibling;if(f.isTagNode(u,"ol ul"))m.appendChild(u);else{E=this.document.createDocumentFragment();for(P=0;u.firstChild;)f.isBlockElm(u.firstChild)&&(P=1),E.appendChild(u.firstChild);P?m.appendChild(E):(P=this.document.createElement("p"),P.appendChild(E),m.appendChild(P));f.remove(u)}u=C}C=f.createElement(this.document,"div",{tmpDiv:1});f.moveChild(r,C);m.appendChild(C);f.remove(r);I.parentNode.insertBefore(m,I);h.setEndBefore(I);f.isEmptyNode(I)&&f.remove(I);t=1}}p||h.setStartBefore(this.document.getElementById(q.start)); |
|||
q.end&&!t&&h.setEndAfter(this.document.getElementById(q.end));h.enlarge(!0,function(a){return k[a.tagName]});m=this.document.createDocumentFragment();r=h.createBookmark();A=f.getNextDomNode(r.start,!1,l);E=h.cloneRange();for(p=f.isBlockElm;A&&A!==r.end&&f.getPosition(A,r.end)&f.POSITION_PRECEDING;)if(3==A.nodeType||w.li[A.tagName])if(1==A.nodeType&&w.$list[A.tagName]){for(;A.firstChild;)m.appendChild(A.firstChild);u=f.getNextDomNode(A,!1,l);f.remove(A);A=u}else{u=A;for(E.setStartBefore(A);A&&A!== |
|||
r.end&&(!p(A)||f.isBookmarkNode(A));)u=A,A=f.getNextDomNode(A,!1,null,function(a){return!k[a.tagName]});A&&p(A)&&(C=f.getNextDomNode(u,!1,l))&&f.isBookmarkNode(C)&&(A=f.getNextDomNode(C,!1,l),u=C);E.setEndAfter(u);A=f.getNextDomNode(u,!1,l);C=h.document.createElement("li");C.appendChild(E.extractContents());if(f.isEmptyNode(C)){for(u=h.document.createElement("p");C.firstChild;)u.appendChild(C.firstChild);C.appendChild(u)}m.appendChild(C)}else A=f.getNextDomNode(A,!0,l);h.moveToBookmark(r).collapse(!0); |
|||
E=this.document.createElement(n);e(E,d);E.appendChild(m);h.insertNode(E);a(E,n,d);r=0;for(n=f.getElementsByTagName(E,"div");l=n[r++];)l.getAttribute("tmpDiv")&&f.remove(l,!0);h.moveToBookmark(q).select()},queryCommandState:function(a){a="insertorderedlist"==a.toLowerCase()?"ol":"ul";for(var b=this.selection.getStartElementPath(),c=0,e;(e=b[c++])&&"TABLE"!=e.nodeName;)if(a==e.nodeName.toLowerCase())return 1;return 0},queryCommandValue:function(a){a="insertorderedlist"==a.toLowerCase()?"ol":"ul";for(var c= |
|||
this.selection.getStartElementPath(),e,g=0,d;d=c[g++];){if("TABLE"==d.nodeName){e=null;break}if(a==d.nodeName.toLowerCase()){e=d;break}}return e?b(e)||f.getComputedStyle(e,"list-style-type"):null}}};(function(){var d={textarea:function(b,c){var a=c.ownerDocument.createElement("textarea");a.style.cssText="position:absolute;resize:none;width:100%;height:100%;border:0;padding:0;margin:0;overflow-y:auto;";r.ie&&8>r.version&&(a.style.width=c.offsetWidth+"px",a.style.height=c.offsetHeight+"px",c.onresize= |
|||
function(){a.style.width=c.offsetWidth+"px";a.style.height=c.offsetHeight+"px"});c.appendChild(a);return{setContent:function(b){a.value=b},getContent:function(){return a.value},select:function(){var b;r.ie?(b=a.createTextRange(),b.collapse(!0),b.select()):(a.setSelectionRange(0,0),a.focus())},dispose:function(){c.removeChild(a);c=a=c.onresize=null}}},codemirror:function(b,c){var a=window.CodeMirror(c,{mode:"text/html",tabMode:"indent",lineNumbers:!0,lineWrapping:!0}),e=a.getWrapperElement();e.style.cssText= |
|||
'position:absolute;left:0;top:0;width:100%;height:100%;font-family:consolas,"Courier new",monospace;font-size:13px;';a.getScrollerElement().style.cssText="position:absolute;left:0;top:0;width:100%;height:100%;";a.refresh();return{getCodeMirror:function(){return a},setContent:function(b){a.setValue(b)},getContent:function(){return a.getValue()},select:function(){a.focus()},dispose:function(){c.removeChild(e);a=e=null}}}};UE.plugins.source=function(){var b=this,c=this.options,a=!1,e,h;c.sourceEditor= |
|||
r.ie?"textarea":c.sourceEditor||"codemirror";b.setOpt({sourceEditorFirst:!1});var g,l,k;b.commands.source={execCommand:function(){if(a=!a){k=b.selection.getRange().createAddress(!1,!0);b.undoManger&&b.undoManger.save(!0);r.gecko&&(b.body.contentEditable=!1);g=b.iframe.style.cssText;b.iframe.style.cssText+="position:absolute;left:-32768px;top:-32768px;";b.fireEvent("beforegetcontent");var n=UE.htmlparser(b.body.innerHTML);b.filterOutputRule(n);n.traversal(function(a){if("element"==a.type)switch(a.tagName){case "td":case "th":case "caption":a.children&& |
|||
1==a.children.length&&"br"==a.firstChild().tagName&&a.removeChild(a.firstChild());break;case "pre":a.innerText(a.innerText().replace(/ /g," "))}});b.fireEvent("aftergetcontent");n=n.toHtml(!0);e=d["codemirror"==c.sourceEditor&&window.CodeMirror?"codemirror":"textarea"](b,b.iframe.parentNode);e.setContent(n);h=b.setContent;b.setContent=function(a){a=UE.htmlparser(a);b.filterInputRule(a);a=a.toHtml();e.setContent(a)};setTimeout(function(){e.select();b.addListener("fullscreenchanged",function(){try{e.getCodeMirror().refresh()}catch(a){}})}); |
|||
l=b.getContent;b.getContent=function(){return e.getContent()||"<p>"+(r.ie?"":"<br/>")+"</p>"}}else if(b.iframe.style.cssText=g,n=e.getContent()||"<p>"+(r.ie?"":"<br/>")+"</p>",n=n.replace(RegExp("[\\r\\t\\n ]*</?(\\w+)\\s*(?:[^>]*)>","g"),function(a,b){return b&&!w.$inlineWithA[b.toLowerCase()]?a.replace(/(^[\n\r\t ]*)|([\n\r\t ]*$)/g,""):a.replace(/(^[\n\r\t]*)|([\n\r\t]*$)/g,"")}),b.setContent=h,b.setContent(n),e.dispose(),e=null,b.getContent=l,n=b.body.firstChild,n||(b.body.innerHTML="<p>"+(r.ie? |
|||
"":"<br/>")+"</p>",n=b.body.firstChild),b.undoManger&&b.undoManger.save(!0),r.gecko){var m=document.createElement("input");m.style.cssText="position:absolute;left:0;top:-32768px";document.body.appendChild(m);b.body.contentEditable=!1;setTimeout(function(){f.setViewportOffset(m,{left:-32768,top:0});m.focus();setTimeout(function(){b.body.contentEditable=!0;b.selection.getRange().moveToAddress(k).select(!0);f.remove(m)})})}else try{b.selection.getRange().moveToAddress(k).select(!0)}catch(u){}this.fireEvent("sourcemodechanged", |
|||
a)},queryCommandState:function(){return a|0},notNeedUndo:1};var m=b.queryCommandState;b.queryCommandState=function(b){b=b.toLowerCase();return a?b in{source:1,fullscreen:1}?1:-1:m.apply(this,arguments)};"codemirror"==c.sourceEditor&&b.addListener("ready",function(){p.loadFile(document,{src:c.codeMirrorJsUrl||c.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.js",tag:"script",type:"text/javascript",defer:"defer"},function(){c.sourceEditorFirst&&setTimeout(function(){b.execCommand("source")},0)}); |
|||
p.loadFile(document,{tag:"link",rel:"stylesheet",type:"text/css",href:c.codeMirrorCssUrl||c.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.css"})})}})();UE.plugins.enterkey=function(){var d,b=this,c=b.options.enterTag;b.addListener("keyup",function(a,c){if(13==(c.keyCode||c.which)){var h=b.selection.getRange(),g=h.startContainer,l;if(r.ie)b.fireEvent("saveScene",!0,!0);else{if(/h\d/i.test(d)){if(r.gecko)f.findParentByTagName(g,"h1 h2 h3 h4 h5 h6 blockquote caption table".split(" "),!0)||(b.document.execCommand("formatBlock", |
|||
!1,"<p>"),l=1);else if(1==g.nodeType){var g=b.document.createTextNode(""),k;h.insertNode(g);if(k=f.findParentByTagName(g,"div",!0)){for(l=b.document.createElement("p");k.firstChild;)l.appendChild(k.firstChild);k.parentNode.insertBefore(l,k);f.remove(k);h.setStartBefore(g).setCursor();l=1}f.remove(g)}b.undoManger&&l&&b.undoManger.save()}r.opera&&h.select()}}});b.addListener("keydown",function(a,e){if(13==(e.keyCode||e.which))if(b.fireEvent("beforeenterkeydown"))f.preventDefault(e);else{b.fireEvent("saveScene", |
|||
!0,!0);d="";var h=b.selection.getRange();if(!h.collapsed){var g=h.startContainer,l=h.endContainer,g=f.findParentByTagName(g,"td",!0),l=f.findParentByTagName(l,"td",!0);if(g&&l&&g!==l||!g&&l||g&&!l){e.preventDefault?e.preventDefault():e.returnValue=!1;return}}if("p"==c)r.ie||((g=f.findParentByTagName(h.startContainer,"ol ul p h1 h2 h3 h4 h5 h6 blockquote caption".split(" "),!0))||r.opera?(d=g.tagName,"p"==g.tagName.toLowerCase()&&r.gecko&&f.removeDirtyAttr(g)):(b.document.execCommand("formatBlock", |
|||
!1,"<p>"),r.gecko&&(h=b.selection.getRange(),(g=f.findParentByTagName(h.startContainer,"p",!0))&&f.removeDirtyAttr(g))));else if(e.preventDefault?e.preventDefault():e.returnValue=!1,h.collapsed)l=h.document.createElement("br"),h.insertNode(l),l.parentNode.lastChild===l?(l.parentNode.insertBefore(l.cloneNode(!0),l),h.setStartBefore(l)):h.setStartAfter(l),h.setCursor();else if(h.deleteContents(),g=h.startContainer,1==g.nodeType&&(g=g.childNodes[h.startOffset])){for(;1==g.nodeType;){if(w.$empty[g.tagName])return h.setStartBefore(g).setCursor(), |
|||
b.undoManger&&b.undoManger.save(),!1;if(!g.firstChild)return l=h.document.createElement("br"),g.appendChild(l),h.setStart(g,0).setCursor(),b.undoManger&&b.undoManger.save(),!1;g=g.firstChild}g===h.startContainer.childNodes[h.startOffset]?(l=h.document.createElement("br"),h.insertNode(l).setCursor()):h.setStart(g,0).setCursor()}else l=h.document.createElement("br"),h.insertNode(l).setStartAfter(l).setCursor()}})};UE.plugins.keystrokes=function(){var d=this,b=!0;d.addListener("keydown",function(c,a){var e= |
|||
a.keyCode||a.which,h=d.selection.getRange();if(!(h.collapsed||a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)&&(65<=e&&90>=e||48<=e&&57>=e||96<=e&&111>=e||{13:1,8:1,46:1}[e])){var g=h.startContainer;f.isFillChar(g)&&h.setStartBefore(g);g=h.endContainer;f.isFillChar(g)&&h.setEndAfter(g);h.txtToElmBoundary();h.endContainer&&1==h.endContainer.nodeType&&(g=h.endContainer.childNodes[h.endOffset])&&f.isBr(g)&&h.setEndAfter(g);if(0==h.startOffset&&(g=h.startContainer,f.isBoundaryNode(g,"firstChild")&&(g=h.endContainer, |
|||
h.endOffset==(3==g.nodeType?g.nodeValue.length:g.childNodes.length)&&f.isBoundaryNode(g,"lastChild")))){d.fireEvent("saveScene");d.body.innerHTML="<p>"+(r.ie?"":"<br/>")+"</p>";h.setStart(d.body.firstChild,0).setCursor(!1,!0);d._selectionChange();return}}if(e==ja.Backspace){h=d.selection.getRange();b=h.collapsed;if(d.fireEvent("delkeydown",a))return;var l,k;h.collapsed&&h.inFillChar()&&(l=h.startContainer,f.isFillChar(l)?(h.setStartBefore(l).shrinkBoundary(!0).collapse(!0),f.remove(l)):(l.nodeValue= |
|||
l.nodeValue.replace(new RegExp("^"+f.fillChar),""),h.startOffset--,h.collapse(!0).select(!0)));if(l=h.getClosedNode()){d.fireEvent("saveScene");h.setStartBefore(l);f.remove(l);h.setCursor();d.fireEvent("saveScene");f.preventDefault(a);return}if(!r.ie&&(l=f.findParentByTagName(h.startContainer,"table",!0),k=f.findParentByTagName(h.endContainer,"table",!0),l&&!k||!l&&k||l!==k)){a.preventDefault();return}}if(e==ja.Tab){var m={ol:1,ul:1,table:1};if(d.fireEvent("tabkeydown",a)){f.preventDefault(a);return}h= |
|||
d.selection.getRange();d.fireEvent("saveScene");var g=0,n="";l=d.options.tabSize||4;for(k=d.options.tabNode||" ";g<l;g++)n+=k;g=d.document.createElement("span");g.innerHTML=n+f.fillChar;if(h.collapsed)h.insertNode(g.cloneNode(!0).firstChild).setCursor(!0);else if(n=function(a){return f.isBlockElm(a)&&!m[a.tagName.toLowerCase()]},l=f.findParent(h.startContainer,n,!0),k=f.findParent(h.endContainer,n,!0),l&&k&&l===k)h.deleteContents(),h.insertNode(g.cloneNode(!0).firstChild).setCursor(!0);else{l= |
|||
h.createBookmark();h.enlarge(!0);k=h.createBookmark();for(var q=f.getNextDomNode(k.start,!1,n);q&&!(f.getPosition(q,k.end)&f.POSITION_FOLLOWING);)q.insertBefore(g.cloneNode(!0).firstChild,q.firstChild),q=f.getNextDomNode(q,!1,n);h.moveToBookmark(k).moveToBookmark(l).select()}f.preventDefault(a)}if(r.gecko&&46==e&&(h=d.selection.getRange(),h.collapsed&&(l=h.startContainer,f.isEmptyBlock(l)))){for(e=l.parentNode;1==f.getChildCount(e)&&!f.isBody(e);)l=e,e=e.parentNode;l===e.lastChild&&a.preventDefault()}}); |
|||
d.addListener("keyup",function(c,a){var e;if((a.keyCode||a.which)==ja.Backspace&&!this.fireEvent("delkeyup")){e=this.selection.getRange();if(e.collapsed){var d;if((d=f.findParentByTagName(e.startContainer,"h1 h2 h3 h4 h5 h6".split(" "),!0))&&f.isEmptyBlock(d)){var g=d.previousSibling;if(g&&"TABLE"!=g.nodeName){f.remove(d);e.setStartAtLast(g).setCursor(!1,!0);return}if((g=d.nextSibling)&&"TABLE"!=g.nodeName){f.remove(d);e.setStartAtFirst(g).setCursor(!1,!0);return}}f.isBody(e.startContainer)&&(d=f.createElement(this.document, |
|||
"p",{innerHTML:r.ie?f.fillChar:"<br/>"}),e.insertNode(d).setStart(d,0).setCursor(!1,!0))}!b&&(3==e.startContainer.nodeType||1==e.startContainer.nodeType&&f.isEmptyBlock(e.startContainer))&&(r.ie?(d=e.document.createElement("span"),e.insertNode(d).setStartBefore(d).collapse(!0),e.select(),f.remove(d)):e.select())}})};UE.plugins.fiximgclick=function(){function d(){this.cover=this.resizer=this.editor=null;this.doc=document;this.prePos={x:0,y:0};this.startPos={x:0,y:0}}var b=!1;(function(){var c=[[0, |
|||
0,-1,-1],[0,0,0,-1],[0,0,1,-1],[0,0,-1,0],[0,0,1,0],[0,0,-1,1],[0,0,0,1],[0,0,1,1]];d.prototype={init:function(a){var b=this;b.editor=a;b.startPos=this.prePos={x:0,y:0};b.dragId=-1;a=[];var c=b.cover=document.createElement("div"),g=b.resizer=document.createElement("div");c.id=b.editor.ui.id+"_imagescale_cover";c.style.cssText="position:absolute;display:none;z-index:"+b.editor.options.zIndex+";filter:alpha(opacity=0); opacity:0;background:#CCC;";f.on(c,"mousedown click",function(){b.hide()});for(i= |
|||
0;8>i;i++)a.push('<span class="edui-editor-imagescale-hand'+i+'"></span>');g.id=b.editor.ui.id+"_imagescale";g.className="edui-editor-imagescale";g.innerHTML=a.join("");g.style.cssText+=";display:none;border:1px solid #3b77ff;z-index:"+b.editor.options.zIndex+";";b.editor.ui.getDom().appendChild(c);b.editor.ui.getDom().appendChild(g);b.initStyle();b.initEvents()},initStyle:function(){p.cssRule("imagescale",".edui-editor-imagescale{display:none;position:absolute;border:1px solid #38B2CE;cursor:hand;-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;}.edui-editor-imagescale span{position:absolute;width:6px;height:6px;overflow:hidden;font-size:0px;display:block;background-color:#3C9DD0;}.edui-editor-imagescale .edui-editor-imagescale-hand0{cursor:nw-resize;top:0;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand1{cursor:n-resize;top:0;margin-top:-4px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand2{cursor:ne-resize;top:0;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand3{cursor:w-resize;top:50%;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand4{cursor:e-resize;top:50%;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand5{cursor:sw-resize;top:100%;margin-top:-3px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand6{cursor:s-resize;top:100%;margin-top:-3px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand7{cursor:se-resize;top:100%;margin-top:-3px;left:100%;margin-left:-3px;}")}, |
|||
initEvents:function(){this.startPos.x=this.startPos.y=0;this.isDraging=!1},_eventHandler:function(a){switch(a.type){case "mousedown":var c=a.target||a.srcElement;-1!=c.className.indexOf("edui-editor-imagescale-hand")&&-1==this.dragId&&(this.dragId=c.className.slice(-1),this.startPos.x=this.prePos.x=a.clientX,this.startPos.y=this.prePos.y=a.clientY,f.on(this.doc,"mousemove",this.proxy(this._eventHandler,this)));break;case "mousemove":-1!=this.dragId&&(this.updateContainerStyle(this.dragId,{x:a.clientX- |
|||
this.prePos.x,y:a.clientY-this.prePos.y}),this.prePos.x=a.clientX,this.prePos.y=a.clientY,b=!0,this.updateTargetElement());break;case "mouseup":-1!=this.dragId&&(this.updateContainerStyle(this.dragId,{x:a.clientX-this.prePos.x,y:a.clientY-this.prePos.y}),this.updateTargetElement(),this.target.parentNode&&this.attachTo(this.target),this.dragId=-1),f.un(this.doc,"mousemove",this.proxy(this._eventHandler,this)),b&&(b=!1,this.editor.fireEvent("contentchange"))}},updateTargetElement:function(){f.setStyles(this.target, |
|||
{width:this.resizer.style.width,height:this.resizer.style.height});this.target.width=parseInt(this.resizer.style.width);this.target.height=parseInt(this.resizer.style.height);this.attachTo(this.target)},updateContainerStyle:function(a,b){var d=this.resizer,g;0!=c[a][0]&&(g=parseInt(d.style.left)+b.x,d.style.left=this._validScaledProp("left",g)+"px");0!=c[a][1]&&(g=parseInt(d.style.top)+b.y,d.style.top=this._validScaledProp("top",g)+"px");0!=c[a][2]&&(g=d.clientWidth+c[a][2]*b.x,d.style.width=this._validScaledProp("width", |
|||
g)+"px");0!=c[a][3]&&(g=d.clientHeight+c[a][3]*b.y,d.style.height=this._validScaledProp("height",g)+"px")},_validScaledProp:function(a,b){var c=this.resizer,g=document;b=isNaN(b)?0:b;switch(a){case "left":return 0>b?0:b+c.clientWidth>g.clientWidth?g.clientWidth-c.clientWidth:b;case "top":return 0>b?0:b+c.clientHeight>g.clientHeight?g.clientHeight-c.clientHeight:b;case "width":return 0>=b?1:b+c.offsetLeft>g.clientWidth?g.clientWidth-c.offsetLeft:b;case "height":return 0>=b?1:b+c.offsetTop>g.clientHeight? |
|||
g.clientHeight-c.offsetTop:b}},hideCover:function(){this.cover.style.display="none"},showCover:function(){var a=f.getXY(this.editor.ui.getDom()),b=f.getXY(this.editor.iframe);f.setStyles(this.cover,{width:this.editor.iframe.offsetWidth+"px",height:this.editor.iframe.offsetHeight+"px",top:b.y-a.y+"px",left:b.x-a.x+"px",position:"absolute",display:""})},show:function(a){this.resizer.style.display="block";a&&this.attachTo(a);f.on(this.resizer,"mousedown",this.proxy(this._eventHandler,this));f.on(this.doc, |
|||
"mouseup",this.proxy(this._eventHandler,this));this.showCover();this.editor.fireEvent("afterscaleshow",this);this.editor.fireEvent("saveScene")},hide:function(){this.hideCover();this.resizer.style.display="none";f.un(this.resizer,"mousedown",this.proxy(this._eventHandler,this));f.un(this.doc,"mouseup",this.proxy(this._eventHandler,this));this.editor.fireEvent("afterscalehide",this)},proxy:function(a,b){return function(c){return a.apply(b||this,arguments)}},attachTo:function(a){a=this.target=a;var b= |
|||
this.resizer,c=f.getXY(a),g=f.getXY(this.editor.iframe),d=f.getXY(b.parentNode);f.setStyles(b,{width:a.width+"px",height:a.height+"px",left:g.x+c.x-this.editor.document.body.scrollLeft-d.x-parseInt(b.style.borderLeftWidth)+"px",top:g.y+c.y-this.editor.document.body.scrollTop-d.y-parseInt(b.style.borderTopWidth)+"px"})}}})();return function(){var b=this,a;b.setOpt("imageScaleEnabled",!0);!r.ie&&b.options.imageScaleEnabled&&b.addListener("click",function(e,h){var g=b.selection.getRange().getClosedNode(); |
|||
if(g&&"IMG"==g.tagName&&"false"!=b.body.contentEditable){if(!(-1!=g.className.indexOf("edui-faked-music")||g.getAttribute("anchorname")||f.hasClass(g,"loadingclass")||f.hasClass(g,"loaderrorclass"))){if(!a){a=new d;a.init(b);b.ui.getDom().appendChild(a.resizer);var l=function(e){a.hide();a.target&&b.selection.getRange().selectNode(a.target).select()},k=function(a){var b=a.target||a.srcElement;!b||void 0!==b.className&&-1!=b.className.indexOf("edui-editor-imagescale")||l(a)},m;b.addListener("afterscaleshow", |
|||
function(a){b.addListener("beforekeydown",l);b.addListener("beforemousedown",k);f.on(document,"keydown",l);f.on(document,"mousedown",k);b.selection.getNative().removeAllRanges()});b.addListener("afterscalehide",function(e){b.removeListener("beforekeydown",l);b.removeListener("beforemousedown",k);f.un(document,"keydown",l);f.un(document,"mousedown",k);e=a.target;e.parentNode&&b.selection.getRange().selectNode(e).select()});f.on(a.resizer,"mousedown",function(e){b.selection.getNative().removeAllRanges(); |
|||
var g=e.target||e.srcElement;g&&-1==g.className.indexOf("edui-editor-imagescale-hand")&&(m=setTimeout(function(){a.hide();a.target&&b.selection.getRange().selectNode(g).select()},200))});f.on(a.resizer,"mouseup",function(a){(a=a.target||a.srcElement)&&-1==a.className.indexOf("edui-editor-imagescale-hand")&&clearTimeout(m)})}a.show(g)}}else a&&"none"!=a.resizer.style.display&&a.hide()});r.webkit&&b.addListener("click",function(a,d){"IMG"==d.target.tagName&&"false"!=b.body.contentEditable&&(new M.Range(b.document)).selectNode(d.target).select()})}}(); |
|||
UE.plugin.register("autolink",function(){return r.ie?{}:{bindEvents:{reset:function(){},keydown:function(d,b){var c=b.keyCode||b.which;if(32==c||13==c){for(var c=this.selection.getNative(),a=c.getRangeAt(0).cloneRange(),e,h=a.startContainer;1==h.nodeType&&0<a.startOffset;){h=a.startContainer.childNodes[a.startOffset-1];if(!h)break;a.setStart(h,1==h.nodeType?h.childNodes.length:h.nodeValue.length);a.collapse(!0);h=a.startContainer}do{if(0==a.startOffset){for(h=a.startContainer.previousSibling;h&&1== |
|||
h.nodeType;)h=h.lastChild;if(!h||f.isFillChar(h))break;e=h.nodeValue.length}else h=a.startContainer,e=a.startOffset;a.setStart(h,e-1);e=a.toString().charCodeAt(0)}while(160!=e&&32!=e);if(a.toString().replace(new RegExp(f.fillChar,"g"),"").match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i)){for(;a.toString().length&&!/^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test(a.toString());)try{a.setStart(a.startContainer,a.startOffset+1)}catch(g){for(h=a.startContainer;!(next=h.nextSibling);){if(f.isBody(h))return; |
|||
h=h.parentNode}a.setStart(next,0)}if(!f.findParentByTagName(a.startContainer,"a",!0)){e=this.document.createElement("a");var h=this.document.createTextNode(" "),l;this.undoManger&&this.undoManger.save();e.appendChild(a.extractContents());e.href=e.innerHTML=e.innerHTML.replace(/<[^>]+>/g,"");l=e.getAttribute("href").replace(new RegExp(f.fillChar,"g"),"");l=/^(?:https?:\/\/)/ig.test(l)?l:"http://"+l;e.setAttribute("_src",p.html(l));e.href=p.html(l);a.insertNode(e);e.parentNode.insertBefore(h,e.nextSibling); |
|||
a.setStart(h,0);a.collapse(!0);c.removeAllRanges();c.addRange(a);this.undoManger&&this.undoManger.save()}}}}}}},function(){function d(b){if(3==b.nodeType)return null;if("A"==b.nodeName)return b;for(b=b.lastChild;b;){if("A"==b.nodeName)return b;if(3==b.nodeType){if(f.isWhitespace(b)){b=b.previousSibling;continue}return null}b=b.lastChild}}var b={37:1,38:1,39:1,40:1,13:1,32:1};r.ie&&this.addListener("keyup",function(c,a){var e=a.keyCode;if(b[e]){var h=this.selection.getRange(),g=h.startContainer;if(13== |
|||
e){for(;g&&!f.isBody(g)&&!f.isBlockElm(g);)g=g.parentNode;g&&!f.isBody(g)&&"P"==g.nodeName&&(h=g.previousSibling)&&1==h.nodeType&&(h=d(h))&&!h.getAttribute("_href")&&f.remove(h,!0)}else 32==e?3==g.nodeType&&/^\s$/.test(g.nodeValue)&&(g=g.previousSibling)&&"A"==g.nodeName&&!g.getAttribute("_href")&&f.remove(g,!0):(g=f.findParentByTagName(g,"a",!0))&&!g.getAttribute("_href")&&(e=h.createBookmark(),f.remove(g,!0),h.moveToBookmark(e).select(!0))}})});UE.plugins.autoheight=function(){function d(){var b= |
|||
this;clearTimeout(g);l||b.queryCommandState&&(!b.queryCommandState||1==b.queryCommandState("source"))||(g=setTimeout(function(){for(var c=b.body.lastChild;c&&1!=c.nodeType;)c=c.previousSibling;c&&1==c.nodeType&&(c.style.clear="both",h=Math.max(f.getXY(c).y+c.offsetHeight+25,Math.max(e.minFrameHeight,e.initialFrameHeight)),h!=a&&(h!==parseInt(b.iframe.parentNode.style.height)&&(b.iframe.parentNode.style.height=h+"px"),b.body.style.height=h+"px",a=h),f.removeStyle(c,"clear"))},50))}var b=this;b.autoHeightEnabled= |
|||
!1!==b.options.autoHeightEnabled;if(b.autoHeightEnabled){var c,a=0,e=b.options,h,g,l;b.addListener("fullscreenchanged",function(a,b){l=b});b.addListener("destroy",function(){b.removeListener("contentchange afterinserthtml keyup mouseup",d)});b.enableAutoHeight=function(){var a=this;if(a.autoHeightEnabled){var b=a.document;a.autoHeightEnabled=!0;c=b.body.style.overflowY;b.body.style.overflowY="hidden";a.addListener("contentchange afterinserthtml keyup mouseup",d);setTimeout(function(){d.call(a)},r.gecko? |
|||
100:0);a.fireEvent("autoheightchanged",a.autoHeightEnabled)}};b.disableAutoHeight=function(){b.body.style.overflowY=c||"";b.removeListener("contentchange",d);b.removeListener("keyup",d);b.removeListener("mouseup",d);b.autoHeightEnabled=!1;b.fireEvent("autoheightchanged",b.autoHeightEnabled)};b.on("setHeight",function(){b.disableAutoHeight()});b.addListener("ready",function(){b.enableAutoHeight();var a;f.on(r.ie?b.body:b.document,r.webkit?"dragover":"drop",function(){clearTimeout(a);a=setTimeout(function(){d.call(b)}, |
|||
100)});var c;window.onscroll=function(){null===c?c=this.scrollY:0==this.scrollY&&0!=c&&(b.window.scrollTo(0,0),c=null)}})}};UE.plugins.autofloat=function(){function d(){var a=document.body.style;a.backgroundImage='url("about:blank")';a.backgroundAttachment="fixed"}function b(){z=!0;n.parentNode&&n.parentNode.removeChild(n);q.style.cssText=m}function c(){var c=x(a.container),e=a.options.toolbarTopOffset||0;if(0>c.top&&c.bottom-q.offsetHeight>e){var c=f.getXY(q),e=f.getComputedStyle(q,"position"),g= |
|||
f.getComputedStyle(q,"left");q.style.width=q.offsetWidth+"px";q.style.zIndex=1*a.options.zIndex+1;q.parentNode.insertBefore(n,q);l||k&&r.ie?("absolute"!=q.style.position&&(q.style.position="absolute"),q.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-u+h+"px"):(r.ie7Compat&&z&&(z=!1,q.style.left=f.getXY(q).x-document.documentElement.getBoundingClientRect().left+2+"px"),"fixed"!=q.style.position&&(q.style.position="fixed",q.style.top=h+"px",("absolute"==e||"relative"==e)&&parseFloat(g)&& |
|||
(q.style.left=c.x+"px")))}else b()}var a=this,e=a.getLang();a.setOpt({topOffset:0});var h=a.options.topOffset;if(!1!==a.options.autoFloatEnabled){var g=UE.ui.uiUtils,l=r.ie&&6>=r.version,k=r.quirks,m,n=document.createElement("div"),q,u,x,z=!0,v=p.defer(function(){c()},r.ie?200:100,!0);a.addListener("destroy",function(){f.un(window,["scroll","resize"],c);a.removeListener("keydown",v)});a.addListener("ready",function(){var h;UE.ui?h=1:(alert(e.autofloatMsg),h=0);h&&a.ui&&(x=g.getClientRect,q=a.ui.getDom("toolbarbox"), |
|||
u=x(q).top,m=q.style.cssText,n.style.height=q.offsetHeight+"px",l&&d(),f.on(window,["scroll","resize"],c),a.addListener("keydown",v),a.addListener("beforefullscreenchange",function(a,c){c&&b()}),a.addListener("fullscreenchanged",function(a,b){b||c()}),a.addListener("sourcemodechanged",function(a,b){setTimeout(function(){c()},0)}),a.addListener("clearDoc",function(){setTimeout(function(){c()},0)}))})}};UE.plugins.video=function(){function d(a,b,d,g,f,k,m){var n;switch(m){case "image":n="<img "+(g? |
|||
'id="'+g+'"':"")+' width="'+b+'" height="'+d+'" _url="'+a+'" class="'+k.replace(/\bvideo-js\b/,"")+'" src="'+c.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" style="background:url('+c.options.UEDITOR_HOME_URL+"themes/default/images/videologo.gif) no-repeat center center; border:1px solid gray;"+(f?"float:"+f+";":"")+'" />';break;case "embed":n='<embed type="application/x-shockwave-flash" class="'+k+'" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+p.html(a)+'" width="'+ |
|||
b+'" height="'+d+'"'+(f?' style="float:'+f+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >';break;case "video":m=a.substr(a.lastIndexOf(".")+1),"ogv"==m&&(m="ogg"),n="<video"+(g?' id="'+g+'"':"")+' class="'+k+' video-js" '+(f?' style="float:'+f+'"':"")+' controls preload="none" width="'+b+'" height="'+d+'" src="'+a+'" data-setup="{}"><source src="'+a+'" type="video/'+m+'" /></video>'}return n}function b(a,b){p.each(a.getNodesByTagName(b? |
|||
"img":"embed video"),function(a){var c=a.getAttr("class");if(c&&-1!=c.indexOf("edui-faked-video")){var f=d(b?a.getAttr("_url"):a.getAttr("src"),a.getAttr("width"),a.getAttr("height"),null,a.getStyle("float")||"",c,b?"embed":"image");a.parentNode.replaceChild(UE.uNode.createElement(f),a)}c&&-1!=c.indexOf("edui-upload-video")&&(f=d(b?a.getAttr("_url"):a.getAttr("src"),a.getAttr("width"),a.getAttr("height"),null,a.getStyle("float")||"",c,b?"video":"image"),a.parentNode.replaceChild(UE.uNode.createElement(f), |
|||
a))})}var c=this;c.addOutputRule(function(a){b(a,!0)});c.addInputRule(function(a){b(a)});c.commands.insertvideo={execCommand:function(a,b,h){b=p.isArray(b)?b:[b];var g=[],l;a=0;for(var k,m=b.length;a<m;a++)k=b[a],l="upload"==h?"edui-upload-video video-js vjs-default-skin":"edui-faked-video",g.push(d(k.url,k.width||420,k.height||280,"tmpVedio"+a,null,l,"image"));c.execCommand("inserthtml",g.join(""),!0);h=this.selection.getRange();a=0;for(m=b.length;a<m;a++)g=this.document.getElementById("tmpVedio"+ |
|||
a),f.removeAttributes(g,"id"),h.selectNode(g).select(),c.execCommand("imagefloat",b[a].align)},queryCommandState:function(){var a=c.selection.getRange().getClosedNode();return!a||"edui-faked-video"!=a.className&&-1==a.className.indexOf("edui-upload-video")?0:1}}};(function(){var d=UE.UETable=function(b){this.table=b;this.indexTable=[];this.selectedTds=[];this.cellsRange={};this.update(b)};d.removeSelectedClass=function(b){p.each(b,function(b){f.removeClasses(b,"selectTdClass")})};d.addSelectedClass= |
|||
function(b){p.each(b,function(b){f.addClass(b,"selectTdClass")})};d.isEmptyBlock=function(b){var c=new RegExp(f.fillChar,"g");if(0<b[r.ie?"innerText":"textContent"].replace(/^\s*$/,"").replace(c,"").length)return 0;for(var a in w.$isNotEmpty)if(w.$isNotEmpty.hasOwnProperty(a)&&b.getElementsByTagName(a).length)return 0;return 1};d.getWidth=function(b){return b?parseInt(f.getComputedStyle(b,"width"),10):0};d.getTableCellAlignState=function(b){!p.isArray(b)&&(b=[b]);var c={},a=["align","valign"],e=null, |
|||
d=!0;p.each(b,function(b){p.each(a,function(a){e=b.getAttribute(a);if(!c[a]&&e)c[a]=e;else if(!c[a]||e!==c[a])return d=!1});return d});return d?c:null};d.getTableItemsByRange=function(b){var c=b.selection.getStart();c&&c.id&&0===c.id.indexOf("_baidu_bookmark_start_")&&c.nextSibling&&(c=c.nextSibling);var a=(b=c&&f.findParentByTagName(c,["td","th"],!0))&&b.parentNode,c=c&&f.findParentByTagName(c,"caption",!0);return{cell:b,tr:a,table:c?c.parentNode:a&&a.parentNode.parentNode,caption:c}};d.getUETableBySelected= |
|||
function(b){return(b=d.getTableItemsByRange(b).table)&&b.ueTable&&b.ueTable.selectedTds.length?b.ueTable:null};d.getDefaultValue=function(b,c){var a={thin:"0px",medium:"1px",thick:"2px"},e,d,g;if(c)l=c.getElementsByTagName("td")[0],g=f.getComputedStyle(c,"border-left-width"),e=parseInt(a[g]||g,10),g=f.getComputedStyle(l,"padding-left"),d=parseInt(a[g]||g,10),g=f.getComputedStyle(l,"border-left-width"),a=parseInt(a[g]||g,10);else{c=b.document.createElement("table");c.insertRow(0).insertCell(0).innerHTML= |
|||
"xxx";b.body.appendChild(c);var l=c.getElementsByTagName("td")[0];g=f.getComputedStyle(c,"border-left-width");e=parseInt(a[g]||g,10);g=f.getComputedStyle(l,"padding-left");d=parseInt(a[g]||g,10);g=f.getComputedStyle(l,"border-left-width");a=parseInt(a[g]||g,10);f.remove(c)}return{tableBorder:e,tdPadding:d,tdBorder:a}};d.getUETable=function(b){var c=b.tagName.toLowerCase();b="td"==c||"th"==c||"caption"==c?f.findParentByTagName(b,"table",!0):b;b.ueTable||(b.ueTable=new d(b));return b.ueTable};d.cloneCell= |
|||
function(b,c,a){if(!b||p.isString(b))return this.table.ownerDocument.createElement(b||"td");var e=f.hasClass(b,"selectTdClass");e&&f.removeClasses(b,"selectTdClass");var d=b.cloneNode(!0);c&&(d.rowSpan=d.colSpan=1);!a&&f.removeAttributes(d,"width height");!a&&f.removeAttributes(d,"style");d.style.borderLeftStyle="";d.style.borderTopStyle="";d.style.borderLeftColor=b.style.borderRightColor;d.style.borderLeftWidth=b.style.borderRightWidth;d.style.borderTopColor=b.style.borderBottomColor;d.style.borderTopWidth= |
|||
b.style.borderBottomWidth;e&&f.addClass(b,"selectTdClass");return d};d.prototype={getMaxRows:function(){for(var b=this.table.rows,c=1,a=0,e;e=b[a];a++){for(var d=1,g=0,f;f=e.cells[g++];)d=Math.max(f.rowSpan||1,d);c=Math.max(d+a,c)}return c},getMaxCols:function(){for(var b=this.table.rows,c=0,a={},e=0,d;d=b[e];e++){for(var g=0,f=0,k;k=d.cells[f++];)if(g+=k.colSpan||1,k.rowSpan&&1<k.rowSpan)for(var m=1;m<k.rowSpan;m++)a["row_"+(e+m)]?a["row_"+(e+m)]++:a["row_"+(e+m)]=k.colSpan||1;g+=a["row_"+e]||0; |
|||
c=Math.max(g,c)}return c},getCellColIndex:function(b){},getHSideCell:function(b,c){try{var a=this.getCellInfo(b),e,d,g=this.selectedTds.length,f=this.cellsRange;if(!c&&(g?!f.beginColIndex:!a.colIndex)||c&&(g?f.endColIndex==this.colsNum-1:a.colIndex==this.colsNum-1))return null;e=g?f.beginRowIndex:a.rowIndex;d=c?g?f.endColIndex+1:a.colIndex+1:g?f.beginColIndex-1:1>a.colIndex?0:a.colIndex-1;return this.getCell(this.indexTable[e][d].rowIndex,this.indexTable[e][d].cellIndex)}catch(k){}},getTabNextCell:function(b, |
|||
c){var a=this.getCellInfo(b),e=c||a.rowIndex,a=a.colIndex+1+(a.colSpan-1),d;try{d=this.getCell(this.indexTable[e][a].rowIndex,this.indexTable[e][a].cellIndex)}catch(g){try{e=1*e+1,a=0,d=this.getCell(this.indexTable[e][a].rowIndex,this.indexTable[e][a].cellIndex)}catch(f){}}return d},getVSideCell:function(b,c,a){try{var e=this.getCellInfo(b),d,g,f=this.selectedTds.length&&!a,k=this.cellsRange;if(!c&&0==e.rowIndex||c&&(f?k.endRowIndex==this.rowsNum-1:e.rowIndex+e.rowSpan>this.rowsNum-1))return null; |
|||
d=c?f?k.endRowIndex+1:e.rowIndex+e.rowSpan:f?k.beginRowIndex-1:e.rowIndex-1;g=f?k.beginColIndex:e.colIndex;return this.getCell(this.indexTable[d][g].rowIndex,this.indexTable[d][g].cellIndex)}catch(m){}},getSameEndPosCells:function(b,c){try{for(var a="x"===c.toLowerCase(),e=f.getXY(b)[a?"x":"y"]+b["offset"+(a?"Width":"Height")],d=this.table.rows,g=null,l=[],k=0;k<this.rowsNum;k++)for(var g=d[k].cells,m=0,n;n=g[m++];){var q=f.getXY(n)[a?"x":"y"]+n["offset"+(a?"Width":"Height")];if(q>e&&a)break;if(b== |
|||
n||e==q)if(1==n[a?"colSpan":"rowSpan"]&&l.push(n),a)break}return l}catch(u){}},setCellContent:function(b,c){b.innerHTML=c||(r.ie?f.fillChar:"<br />")},cloneCell:d.cloneCell,getSameStartPosXCells:function(b){try{var c=f.getXY(b).x+b.offsetWidth,a=this.table.rows,e;b=[];for(var d=0;d<this.rowsNum;d++){e=a[d].cells;for(var g=0,l;l=e[g++];){var k=f.getXY(l).x;if(k>c)break;if(k==c&&1==l.colSpan){b.push(l);break}}}return b}catch(m){}},update:function(b){this.table=b||this.table;this.selectedTds=[];this.cellsRange= |
|||
{};this.indexTable=[];b=this.table.rows;for(var c=this.getMaxRows(),a=c-b.length,e=this.getMaxCols();a--;)this.table.insertRow(b.length);this.rowsNum=c;this.colsNum=e;for(var a=0,d=b.length;a<d;a++)this.indexTable[a]=Array(e);for(var a=0,g;g=b[a];a++){var d=0,l;for(g=g.cells;l=g[d];d++){l.rowSpan>c&&(l.rowSpan=c);var k=d,m=l.rowSpan||1;for(l=l.colSpan||1;this.indexTable[a][k];)k++;for(var n=0;n<m;n++)for(var q=0;q<l;q++)this.indexTable[a+n][k+q]={rowIndex:a,cellIndex:d,colIndex:k,rowSpan:m,colSpan:l}}}for(n= |
|||
0;n<c;n++)for(q=0;q<e;q++)void 0===this.indexTable[n][q]&&(g=b[n],l=(l=g.cells[g.cells.length-1])?l.cloneNode(!0):this.table.ownerDocument.createElement("td"),this.setCellContent(l),1!==l.colSpan&&(l.colSpan=1),1!==l.rowSpan&&(l.rowSpan=1),g.appendChild(l),this.indexTable[n][q]={rowIndex:n,cellIndex:l.cellIndex,colIndex:q,rowSpan:1,colSpan:1});b=f.getElementsByTagName(this.table,"td");var u=[];p.each(b,function(a){f.hasClass(a,"selectTdClass")&&u.push(a)});u.length&&(c=u[u.length-1],b=this.getCellInfo(u[0]), |
|||
c=this.getCellInfo(c),this.selectedTds=u,this.cellsRange={beginRowIndex:b.rowIndex,beginColIndex:b.colIndex,endRowIndex:c.rowIndex+c.rowSpan-1,endColIndex:c.colIndex+c.colSpan-1});if(!f.hasClass(this.table.rows[0],"firstRow"))for(f.addClass(this.table.rows[0],"firstRow"),a=1;a<this.table.rows.length;a++)f.removeClasses(this.table.rows[a],"firstRow")},getCellInfo:function(b){if(b){var c=b.cellIndex;b=b.parentNode.rowIndex;for(var a=this.indexTable[b],e=this.colsNum,d=c;d<e;d++){var g=a[d];if(g.rowIndex=== |
|||
b&&g.cellIndex===c)return g}}},getCell:function(b,c){return b<this.rowsNum&&this.table.rows[b].cells[c]||null},deleteCell:function(b,c){c="number"==typeof c?c:b.parentNode.rowIndex;this.table.rows[c].deleteCell(b.cellIndex)},getCellsRange:function(b,c){function a(b,c,g,d){var k=b,h=c,f=g,l=d,n,m,q;if(0<b)for(m=c;m<d;m++)n=e.indexTable[b][m],q=n.rowIndex,q<b&&(k=Math.min(q,k));if(d<e.colsNum)for(q=b;q<g;q++)n=e.indexTable[q][d],m=n.colIndex+n.colSpan-1,m>d&&(l=Math.max(m,l));if(g<e.rowsNum)for(m=c;m< |
|||
d;m++)n=e.indexTable[g][m],q=n.rowIndex+n.rowSpan-1,q>g&&(f=Math.max(q,f));if(0<c)for(q=b;q<g;q++)n=e.indexTable[q][c],m=n.colIndex,m<c&&(h=Math.min(n.colIndex,h));return k!=b||h!=c||f!=g||l!=d?a(k,h,f,l):{beginRowIndex:b,beginColIndex:c,endRowIndex:g,endColIndex:d}}try{var e=this,d=e.getCellInfo(b);if(b===c)return{beginRowIndex:d.rowIndex,beginColIndex:d.colIndex,endRowIndex:d.rowIndex+d.rowSpan-1,endColIndex:d.colIndex+d.colSpan-1};var g=e.getCellInfo(c),f=Math.min(d.rowIndex,g.rowIndex),k=Math.min(d.colIndex, |
|||
g.colIndex),m=Math.max(d.rowIndex+d.rowSpan-1,g.rowIndex+g.rowSpan-1),n=Math.max(d.colIndex+d.colSpan-1,g.colIndex+g.colSpan-1);return a(f,k,m,n)}catch(q){}},getCells:function(b){this.clearSelected();for(var c=b.beginColIndex,a=b.endRowIndex,e=b.endColIndex,d,g,f={},k=[],m=b.beginRowIndex;m<=a;m++)for(var n=c;n<=e;n++){b=this.indexTable[m][n];d=b.rowIndex;g=b.colIndex;var q=d+"|"+g;if(!f[q]){f[q]=1;if(d<m||g<n||d+b.rowSpan-1>a||g+b.colSpan-1>e)return null;k.push(this.getCell(d,b.cellIndex))}}return k}, |
|||
clearSelected:function(){d.removeSelectedClass(this.selectedTds);this.selectedTds=[];this.cellsRange={}},setSelected:function(b){var c=this.getCells(b);d.addSelectedClass(c);this.selectedTds=c;this.cellsRange=b},isFullRow:function(){var b=this.cellsRange;return b.endColIndex-b.beginColIndex+1==this.colsNum},isFullCol:function(){var b=this.cellsRange,c=this.table.getElementsByTagName("th"),b=b.endRowIndex-b.beginRowIndex+1;return c.length?b==this.rowsNum||b==this.rowsNum-1:b==this.rowsNum},getNextCell:function(b, |
|||
c,a){try{var e=this.getCellInfo(b),d,g,f=this.selectedTds.length&&!a,k=this.cellsRange;if(!c&&0==e.rowIndex||c&&(f?k.endRowIndex==this.rowsNum-1:e.rowIndex+e.rowSpan>this.rowsNum-1))return null;d=c?f?k.endRowIndex+1:e.rowIndex+e.rowSpan:f?k.beginRowIndex-1:e.rowIndex-1;g=f?k.beginColIndex:e.colIndex;return this.getCell(this.indexTable[d][g].rowIndex,this.indexTable[d][g].cellIndex)}catch(m){}},getPreviewCell:function(b,c){try{var a=this.getCellInfo(b),e,d,g=this.selectedTds.length,f=this.cellsRange; |
|||
if(!c&&(g?!f.beginColIndex:!a.colIndex)||c&&(g?f.endColIndex==this.colsNum-1:a.rowIndex>this.colsNum-1))return null;e=c?g?f.beginRowIndex:1>a.rowIndex?0:a.rowIndex-1:g?f.beginRowIndex:a.rowIndex;d=c?g?f.endColIndex+1:a.colIndex:g?f.beginColIndex-1:1>a.colIndex?0:a.colIndex-1;return this.getCell(this.indexTable[e][d].rowIndex,this.indexTable[e][d].cellIndex)}catch(k){}},moveContent:function(b,c){if(!d.isEmptyBlock(c))if(d.isEmptyBlock(b))b.innerHTML=c.innerHTML;else{var a=b.lastChild;for(3!=a.nodeType&& |
|||
w.$block[a.tagName]||b.appendChild(b.ownerDocument.createElement("br"));a=c.firstChild;)b.appendChild(a)}},mergeRight:function(b){var c=this.getCellInfo(b),a=this.indexTable[c.rowIndex][c.colIndex+c.colSpan],e=this.getCell(a.rowIndex,a.cellIndex);b.colSpan=c.colSpan+a.colSpan;b.removeAttribute("width");this.moveContent(b,e);this.deleteCell(e,a.rowIndex);this.update()},mergeDown:function(b){var c=this.getCellInfo(b),a=this.indexTable[c.rowIndex+c.rowSpan][c.colIndex],e=this.getCell(a.rowIndex,a.cellIndex); |
|||
b.rowSpan=c.rowSpan+a.rowSpan;b.removeAttribute("height");this.moveContent(b,e);this.deleteCell(e,a.rowIndex);this.update()},mergeRange:function(){var b=this.cellsRange,c=this.getCell(b.beginRowIndex,this.indexTable[b.beginRowIndex][b.beginColIndex].cellIndex);if("TH"==c.tagName&&b.endRowIndex!==b.beginRowIndex)var a=this.indexTable,b=this.getCellInfo(c),c=this.getCell(1,a[1][b.colIndex].cellIndex),b=this.getCellsRange(c,this.getCell(a[this.rowsNum-1][b.colIndex].rowIndex,a[this.rowsNum-1][b.colIndex].cellIndex)); |
|||
for(var e=this.getCells(b),a=0,d;d=e[a++];)d!==c&&(this.moveContent(c,d),this.deleteCell(d));c.rowSpan=b.endRowIndex-b.beginRowIndex+1;1<c.rowSpan&&c.removeAttribute("height");c.colSpan=b.endColIndex-b.beginColIndex+1;1<c.colSpan&&c.removeAttribute("width");c.rowSpan==this.rowsNum&&1!=c.colSpan&&(c.colSpan=1);if(c.colSpan==this.colsNum&&1!=c.rowSpan){e=c.parentNode.rowIndex;if(this.table.deleteRow)for(a=e+1,e+=1,b=c.rowSpan;a<b;a++)this.table.deleteRow(e);else for(a=0,b=c.rowSpan-1;a<b;a++)d=this.table.rows[e+ |
|||
1],d.parentNode.removeChild(d);c.rowSpan=1}this.update()},insertRow:function(b,c){function a(a,b,c){0==a?(a=(c.nextSibling||c.previousSibling).cells[a],"TH"==a.tagName&&(a=b.ownerDocument.createElement("th"),a.appendChild(b.firstChild),c.insertBefore(a,b),f.remove(b))):"TH"==b.tagName&&(a=b.ownerDocument.createElement("td"),a.appendChild(b.firstChild),c.insertBefore(a,b),f.remove(b))}var e=this.colsNum,d=this.table.insertRow(b),g,l="string"==typeof c&&"TH"==c.toUpperCase();if(0==b||b==this.rowsNum)for(var k= |
|||
0;k<e;k++)g=this.cloneCell(c,!0),this.setCellContent(g),g.getAttribute("vAlign")&&g.setAttribute("vAlign",g.getAttribute("vAlign")),d.appendChild(g),l||a(k,g,d);else for(var m=this.indexTable[b],k=0;k<e;k++){var n=m[k];n.rowIndex<b?(g=this.getCell(n.rowIndex,n.cellIndex),g.rowSpan=n.rowSpan+1):(g=this.cloneCell(c,!0),this.setCellContent(g),d.appendChild(g));l||a(k,g,d)}this.update();return d},deleteRow:function(b){for(var c=this.table.rows[b],a=this.indexTable[b],e=this.colsNum,d=0,g=0;g<e;){var l= |
|||
a[g],k=this.getCell(l.rowIndex,l.cellIndex);if(1<k.rowSpan&&l.rowIndex==b){l=k.cloneNode(!0);l.rowSpan=k.rowSpan-1;l.innerHTML="";k.rowSpan=1;var m=b+1,n=this.table.rows[m],m=this.getPreviewMergedCellsNum(m,g)-d;m<g?(m=g-m-1,f.insertAfter(n.cells[m],l)):n.cells.length&&n.insertBefore(l,n.cells[0]);d+=1}g+=k.colSpan||1}b=[];d={};for(g=0;g<e;g++)k=a[g].rowIndex,l=a[g].cellIndex,n=k+"_"+l,d[n]||(d[n]=1,k=this.getCell(k,l),b.push(k));var q=[];p.each(b,function(a){1==a.rowSpan?a.parentNode.removeChild(a): |
|||
q.push(a)});p.each(q,function(a){a.rowSpan--});c.parentNode.removeChild(c);this.update()},insertCol:function(b,c,a){function e(a,b,c){0==a?(a=b.nextSibling||b.previousSibling,"TH"==a.tagName&&(a=b.ownerDocument.createElement("th"),a.appendChild(b.firstChild),c.insertBefore(a,b),f.remove(b))):"TH"==b.tagName&&(a=b.ownerDocument.createElement("td"),a.appendChild(b.firstChild),c.insertBefore(a,b),f.remove(b))}var d=this.rowsNum,g=0,l,k,m=parseInt((this.table.offsetWidth-20*(this.colsNum+1)-(this.colsNum+ |
|||
1))/(this.colsNum+1),10),n="string"==typeof c&&"TH"==c.toUpperCase(),q;if(0==b||b==this.colsNum)for(;g<d;g++)l=this.table.rows[g],q=l.cells[0==b?b:l.cells.length],k=this.cloneCell(c,!0),this.setCellContent(k),k.setAttribute("vAlign",k.getAttribute("vAlign")),q&&k.setAttribute("width",q.getAttribute("width")),b?f.insertAfter(l.cells[l.cells.length-1],k):l.insertBefore(k,l.cells[0]),n||e(g,k,l);else for(;g<d;g++)q=this.indexTable[g][b],q.colIndex<b?(k=this.getCell(q.rowIndex,q.cellIndex),k.colSpan= |
|||
q.colSpan+1):(l=this.table.rows[g],q=l.cells[q.cellIndex],k=this.cloneCell(c,!0),this.setCellContent(k),k.setAttribute("vAlign",k.getAttribute("vAlign")),q&&k.setAttribute("width",q.getAttribute("width")),q?l.insertBefore(k,q):l.appendChild(k)),n||e(g,k,l);this.update();this.updateWidth(m,a||{tdPadding:10,tdBorder:1})},updateWidth:function(b,c){var a=this.table,e=d.getWidth(a)-2*c.tdPadding-c.tdBorder+b;e<a.ownerDocument.body.offsetWidth?a.setAttribute("width",e):(a=f.getElementsByTagName(this.table, |
|||
"td th"),p.each(a,function(a){a.setAttribute("width",b)}))},deleteCol:function(b){for(var c=this.indexTable,a=this.table.rows,e=this.table.getAttribute("width"),d=0,g=this.rowsNum,f={},k=0;k<g;){var m=c[k][b],n=m.rowIndex+"_"+m.colIndex;f[n]||(f[n]=1,n=this.getCell(m.rowIndex,m.cellIndex),d||(d=n&&parseInt(n.offsetWidth/n.colSpan,10).toFixed(0)),1<n.colSpan?n.colSpan--:a[k].deleteCell(m.cellIndex),k+=m.rowSpan||1)}this.table.setAttribute("width",e-d);this.update()},splitToCells:function(b){var c= |
|||
this;b=this.splitToRows(b);p.each(b,function(a){c.splitToCols(a)})},splitToRows:function(b){var c=this.getCellInfo(b),a=c.rowIndex,e=c.colIndex,d=[];b.rowSpan=1;d.push(b);for(var g=a,f=a+c.rowSpan;g<f;g++)if(g!=a){var k=this.table.rows[g].insertCell(e-this.getPreviewMergedCellsNum(g,e));k.colSpan=c.colSpan;this.setCellContent(k);k.setAttribute("vAlign",b.getAttribute("vAlign"));k.setAttribute("align",b.getAttribute("align"));b.style.cssText&&(k.style.cssText=b.style.cssText);d.push(k)}this.update(); |
|||
return d},getPreviewMergedCellsNum:function(b,c){for(var a=this.indexTable[b],e=0,d=0;d<c;)var g=a[d].colSpan,e=e+(g-(a[d].rowIndex==b?1:0)),d=d+g;return e},splitToCols:function(b){var c=(b.offsetWidth/b.colSpan-22).toFixed(0),a=this.getCellInfo(b),e=a.rowIndex,d=a.colIndex,g=[];b.colSpan=1;b.setAttribute("width",c);g.push(b);for(var l=d,k=d+a.colSpan;l<k;l++)if(l!=d){var m=this.table.rows[e],n=m.insertCell(this.indexTable[e][l].cellIndex+1);n.rowSpan=a.rowSpan;this.setCellContent(n);n.setAttribute("vAlign", |
|||
b.getAttribute("vAlign"));n.setAttribute("align",b.getAttribute("align"));n.setAttribute("width",c);b.style.cssText&&(n.style.cssText=b.style.cssText);if("TH"==b.tagName){var q=b.ownerDocument.createElement("th");q.appendChild(n.firstChild);q.setAttribute("vAlign",b.getAttribute("vAlign"));q.rowSpan=n.rowSpan;m.insertBefore(q,n);f.remove(n)}g.push(n)}this.update();return g},isLastCell:function(b,c,a){c=c||this.rowsNum;a=a||this.colsNum;b=this.getCellInfo(b);return b.rowIndex+b.rowSpan==c&&b.colIndex+ |
|||
b.colSpan==a},getLastCell:function(b){b=b||this.table.getElementsByTagName("td");this.getCellInfo(b[0]);var c=this,a=b[0],e=a.parentNode,d=0,g=0,f;p.each(b,function(a){a.parentNode==e&&(g+=a.colSpan||1);d+=a.rowSpan*a.colSpan||1});f=d/g;p.each(b,function(b){if(c.isLastCell(b,f,g))return a=b,!1});return a},selectRow:function(b){var c=this.indexTable[b];b=this.getCell(c[0].rowIndex,c[0].cellIndex);c=this.getCell(c[this.colsNum-1].rowIndex,c[this.colsNum-1].cellIndex);b=this.getCellsRange(b,c);this.setSelected(b)}, |
|||
selectTable:function(){var b=this.table.getElementsByTagName("td"),b=this.getCellsRange(b[0],b[b.length-1]);this.setSelected(b)},setBackground:function(b,c){if("string"===typeof c)p.each(b,function(a){a.style.backgroundColor=c});else if("object"===typeof c){c=p.extend({repeat:!0,colorList:["#ddd","#fff"]},c);for(var a=this.getCellInfo(b[0]).rowIndex,e=0,d=c.colorList,g=function(a,b,c){return a[b]?a[b]:c?a[b%a.length]:""},f=0,k;k=b[f++];){var m=this.getCellInfo(k);k.style.backgroundColor=g(d,a+e== |
|||
m.rowIndex?e:++e,c.repeat)}}},removeBackground:function(b){p.each(b,function(b){b.style.backgroundColor=""})}}})();(function(){function d(c,e){var d=f.getElementsByTagName(c,"td th");p.each(d,function(a){a.removeAttribute("width")});c.setAttribute("width",b(e,!0,a.getDefaultValue(e,c)));var h=[];setTimeout(function(){p.each(d,function(a){1==a.colSpan&&h.push(a.offsetWidth)});p.each(d,function(a,b){1==a.colSpan&&a.setAttribute("width",h[b]+"")})},0)}function b(a,b,c){var e=a.body;return e.offsetWidth- |
|||
(b?2*parseInt(f.getComputedStyle(e,"margin-left"),10):0)-2*c.tableBorder-(a.options.offsetWidth||0)}function c(a){if(a=e(a).cell){var b=h(a);return b.selectedTds.length?b.selectedTds:[a]}return[]}var a=UE.UETable,e=function(b){return a.getTableItemsByRange(b)},h=function(b){return a.getUETable(b)};UE.commands.inserttable={queryCommandState:function(){return e(this).table?-1:0},execCommand:function(b,c){c||(c=p.extend({},{numCols:this.options.defaultCols,numRows:this.options.defaultRows,tdvalign:this.options.tdvalign})); |
|||
var e=this.selection.getRange().startContainer,e=f.findParent(e,function(a){return f.isBlockElm(a)},!0)||this.body,d=a.getDefaultValue(this,void 0),e=Math.floor(e.offsetWidth/c.numCols-2*d.tdPadding-d.tdBorder);!c.tdvalign&&(c.tdvalign=this.options.tdvalign);this.execCommand("inserthtml",function(a,b){for(var c=[],e=a.numRows,d=a.numCols,g=0;g<e;g++){c.push("<tr"+(0==g?' class="firstRow"':"")+">");for(var k=0;k<d;k++)c.push('<td width="'+b+'" vAlign="'+a.tdvalign+'" >'+(r.ie&&11>r.version?f.fillChar: |
|||
"<br/>")+"</td>");c.push("</tr>")}return"<table><tbody>"+c.join("")+"</tbody></table>"}(c,e))}};UE.commands.insertparagraphbeforetable={queryCommandState:function(){return e(this).cell?0:-1},execCommand:function(){var a=e(this).table;if(a){var b=this.document.createElement("p");b.innerHTML=r.ie?" ":"<br />";a.parentNode.insertBefore(b,a);this.selection.getRange().setStart(b,0).setCursor()}}};UE.commands.deletetable={queryCommandState:function(){var a=this.selection.getRange();return f.findParentByTagName(a.startContainer, |
|||
"table",!0)?0:-1},execCommand:function(a,b){var c=this.selection.getRange();if(b=b||f.findParentByTagName(c.startContainer,"table",!0)){var e=b.nextSibling;e||(e=f.createElement(this.document,"p",{innerHTML:r.ie?f.fillChar:"<br/>"}),b.parentNode.insertBefore(e,b));f.remove(b);c=this.selection.getRange();3==e.nodeType?c.setStartBefore(e):c.setStart(e,0);c.setCursor(!1,!0);this.fireEvent("tablehasdeleted")}}};UE.commands.cellalign={queryCommandState:function(){return c(this).length?0:-1},execCommand:function(a, |
|||
b){var e=c(this);if(e.length)for(var d=0,f;f=e[d++];)f.setAttribute("align",b)}};UE.commands.cellvalign={queryCommandState:function(){return c(this).length?0:-1},execCommand:function(a,b){var e=c(this);if(e.length)for(var d=0,f;f=e[d++];)f.setAttribute("vAlign",b)}};UE.commands.insertcaption={queryCommandState:function(){var a=e(this).table;return a?0==a.getElementsByTagName("caption").length?1:-1:-1},execCommand:function(){var a=e(this).table;if(a){var b=this.document.createElement("caption");b.innerHTML= |
|||
r.ie?f.fillChar:"<br/>";a.insertBefore(b,a.firstChild);this.selection.getRange().setStart(b,0).setCursor()}}};UE.commands.deletecaption={queryCommandState:function(){var a=this.selection.getRange();return(a=f.findParentByTagName(a.startContainer,"table"))?0==a.getElementsByTagName("caption").length?-1:1:-1},execCommand:function(){var a=this.selection.getRange();if(a=f.findParentByTagName(a.startContainer,"table"))f.remove(a.getElementsByTagName("caption")[0]),this.selection.getRange().setStart(a.rows[0].cells[0], |
|||
0).setCursor()}};UE.commands.inserttitle={queryCommandState:function(){var a=e(this).table;return a?(a=a.rows[0],"th"!=a.cells[a.cells.length-1].tagName.toLowerCase()?0:-1):-1},execCommand:function(){var a=e(this).table;a&&h(a).insertRow(0,"th");a=a.getElementsByTagName("th")[0];this.selection.getRange().setStart(a,0).setCursor(!1,!0)}};UE.commands.deletetitle={queryCommandState:function(){var a=e(this).table;return a?(a=a.rows[0],"th"==a.cells[a.cells.length-1].tagName.toLowerCase()?0:-1):-1},execCommand:function(){var a= |
|||
e(this).table;a&&f.remove(a.rows[0]);a=a.getElementsByTagName("td")[0];this.selection.getRange().setStart(a,0).setCursor(!1,!0)}};UE.commands.inserttitlecol={queryCommandState:function(){var a=e(this).table;return a?a.rows[a.rows.length-1].getElementsByTagName("th").length?-1:0:-1},execCommand:function(a){(a=e(this).table)&&h(a).insertCol(0,"th");d(a,this);a=a.getElementsByTagName("th")[0];this.selection.getRange().setStart(a,0).setCursor(!1,!0)}};UE.commands.deletetitlecol={queryCommandState:function(){var a= |
|||
e(this).table;return a?a.rows[a.rows.length-1].getElementsByTagName("th").length?0:-1:-1},execCommand:function(){var a=e(this).table;if(a)for(var b=0;b<a.rows.length;b++)f.remove(a.rows[b].children[0]);d(a,this);a=a.getElementsByTagName("td")[0];this.selection.getRange().setStart(a,0).setCursor(!1,!0)}};UE.commands.mergeright={queryCommandState:function(a){var b=e(this);a=b.table;b=b.cell;if(!a||!b)return-1;var c=h(a);if(c.selectedTds.length)return-1;var d=c.getCellInfo(b),f=d.colIndex+d.colSpan; |
|||
if(f>=c.colsNum)return-1;c=c.indexTable[d.rowIndex][f];return(a=a.rows[c.rowIndex].cells[c.cellIndex])&&b.tagName==a.tagName?c.rowIndex==d.rowIndex&&c.rowSpan==d.rowSpan?0:-1:-1},execCommand:function(a){a=this.selection.getRange();var b=a.createBookmark(!0),c=e(this).cell;h(c).mergeRight(c);a.moveToBookmark(b).select()}};UE.commands.mergedown={queryCommandState:function(a){var b=e(this);a=b.table;b=b.cell;if(!a||!b)return-1;var c=h(a);if(c.selectedTds.length)return-1;var d=c.getCellInfo(b),f=d.rowIndex+ |
|||
d.rowSpan;if(f>=c.rowsNum)return-1;c=c.indexTable[f][d.colIndex];return(a=a.rows[c.rowIndex].cells[c.cellIndex])&&b.tagName==a.tagName?c.colIndex==d.colIndex&&c.colSpan==d.colSpan?0:-1:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell;h(c).mergeDown(c);a.moveToBookmark(b).select()}};UE.commands.mergecells={queryCommandState:function(){return a.getUETableBySelected(this)?0:-1},execCommand:function(){var b=a.getUETableBySelected(this);if(b&&b.selectedTds.length){var c= |
|||
b.selectedTds[0];b.mergeRange();b=this.selection.getRange();f.isEmptyBlock(c)?b.setStart(c,0).collapse(!0):b.selectNodeContents(c);b.select()}}};UE.commands.insertrow={queryCommandState:function(){var a=e(this),b=a.cell;return b&&("TD"==b.tagName||"TH"==b.tagName&&a.tr!==a.table.rows[0])&&h(a.table).rowsNum<this.options.maxRowNum?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this),d=c.cell,c=c.table,f=h(c),q=f.getCellInfo(d);if(f.selectedTds.length)for(var q= |
|||
f.cellsRange,u=0,x=q.endRowIndex-q.beginRowIndex+1;u<x;u++)f.insertRow(q.beginRowIndex,d);else f.insertRow(q.rowIndex,d);a.moveToBookmark(b).select();"enabled"===c.getAttribute("interlaced")&&this.fireEvent("interlacetable",c)}};UE.commands.insertrownext={queryCommandState:function(){var a=e(this),b=a.cell;return b&&"TD"==b.tagName&&h(a.table).rowsNum<this.options.maxRowNum?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this),d=c.cell,c=c.table,f=h(c),q=f.getCellInfo(d); |
|||
if(f.selectedTds.length)for(var q=f.cellsRange,u=0,x=q.endRowIndex-q.beginRowIndex+1;u<x;u++)f.insertRow(q.endRowIndex+1,d);else f.insertRow(q.rowIndex+q.rowSpan,d);a.moveToBookmark(b).select();"enabled"===c.getAttribute("interlaced")&&this.fireEvent("interlacetable",c)}};UE.commands.deleterow={queryCommandState:function(){return e(this).cell?0:-1},execCommand:function(){var a=e(this).cell,b=h(a),c=b.cellsRange,d=b.getCellInfo(a),n=b.getVSideCell(a),q=b.getVSideCell(a,!0),a=this.selection.getRange(); |
|||
if(p.isEmptyObject(c))b.deleteRow(d.rowIndex);else for(var u=c.beginRowIndex;u<c.endRowIndex+1;u++)b.deleteRow(c.beginRowIndex);u=b.table;u.getElementsByTagName("td").length?1==d.rowSpan||d.rowSpan==c.endRowIndex-c.beginRowIndex+1?(q||n)&&a.selectNodeContents(q||n).setCursor(!1,!0):(b=b.getCell(d.rowIndex,b.indexTable[d.rowIndex][d.colIndex].cellIndex))&&a.selectNodeContents(b).setCursor(!1,!0):(b=u.nextSibling,f.remove(u),b&&a.setStart(b,0).setCursor(!1,!0));"enabled"===u.getAttribute("interlaced")&& |
|||
this.fireEvent("interlacetable",u)}};UE.commands.insertcol={queryCommandState:function(a){a=e(this);var b=a.cell;return b&&("TD"==b.tagName||"TH"==b.tagName&&b!==a.tr.cells[0])&&h(a.table).colsNum<this.options.maxColNum?0:-1},execCommand:function(a){var b=this.selection.getRange(),c=b.createBookmark(!0);if(-1!=this.queryCommandState(a)){a=e(this).cell;var d=h(a),f=d.getCellInfo(a);if(d.selectedTds.length)for(var f=d.cellsRange,q=0,u=f.endColIndex-f.beginColIndex+1;q<u;q++)d.insertCol(f.beginColIndex, |
|||
a);else d.insertCol(f.colIndex,a);b.moveToBookmark(c).select(!0)}}};UE.commands.insertcolnext={queryCommandState:function(){var a=e(this);return a.cell&&h(a.table).colsNum<this.options.maxColNum?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell,d=h(c),f=d.getCellInfo(c);if(d.selectedTds.length)for(var f=d.cellsRange,q=0,u=f.endColIndex-f.beginColIndex+1;q<u;q++)d.insertCol(f.endColIndex+1,c);else d.insertCol(f.colIndex+f.colSpan,c);a.moveToBookmark(b).select()}}; |
|||
UE.commands.deletecol={queryCommandState:function(){return e(this).cell?0:-1},execCommand:function(){var a=e(this).cell,b=h(a),c=b.cellsRange,d=b.getCellInfo(a),n=b.getHSideCell(a),q=b.getHSideCell(a,!0);if(p.isEmptyObject(c))b.deleteCol(d.colIndex);else for(d=c.beginColIndex;d<c.endColIndex+1;d++)b.deleteCol(c.beginColIndex);b=b.table;c=this.selection.getRange();b.getElementsByTagName("td").length?f.inDoc(a,this.document)?c.setStart(a,0).setCursor(!1,!0):q&&f.inDoc(q,this.document)?c.selectNodeContents(q).setCursor(!1, |
|||
!0):n&&f.inDoc(n,this.document)&&c.selectNodeContents(n).setCursor(!0,!0):(a=b.nextSibling,f.remove(b),a&&c.setStart(a,0).setCursor(!1,!0))}};UE.commands.splittocells={queryCommandState:function(){var a=e(this),b=a.cell;return!b||0<h(a.table).selectedTds.length?-1:b&&(1<b.colSpan||1<b.rowSpan)?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell;h(c).splitToCells(c);a.moveToBookmark(b).select()}};UE.commands.splittorows={queryCommandState:function(){var a= |
|||
e(this),b=a.cell;return!b||0<h(a.table).selectedTds.length?-1:b&&1<b.rowSpan?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell;h(c).splitToRows(c);a.moveToBookmark(b).select()}};UE.commands.splittocols={queryCommandState:function(){var a=e(this),b=a.cell;return!b||0<h(a.table).selectedTds.length?-1:b&&1<b.colSpan?0:-1},execCommand:function(){var a=this.selection.getRange(),b=a.createBookmark(!0),c=e(this).cell;h(c).splitToCols(c);a.moveToBookmark(b).select()}}; |
|||
UE.commands.adaptbytext=UE.commands.adaptbywindow={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(a){var b=e(this).table;b&&("adaptbywindow"==a?d(b,this):(a=f.getElementsByTagName(b,"td th"),p.each(a,function(a){a.removeAttribute("width")}),b.removeAttribute("width")))}};UE.commands.averagedistributecol={queryCommandState:function(){var b=a.getUETableBySelected(this);return b?b.isFullRow()||b.isFullCol()?0:-1:-1},execCommand:function(b){function c(){var b=h.table,e=0, |
|||
g=0,f=a.getDefaultValue(d,b);if(h.isFullRow())e=b.offsetWidth,g=h.colsNum;else for(var b=h.cellsRange.endColIndex,k,l=h.cellsRange.beginColIndex;l<=b;)k=h.selectedTds[l],e+=k.offsetWidth,l+=k.colSpan,g+=1;return Math.ceil(e/g)-2*f.tdBorder-2*f.tdPadding}function e(a){p.each(f.getElementsByTagName(h.table,"th"),function(a){a.setAttribute("width","")});var b=h.isFullRow()?f.getElementsByTagName(h.table,"td"):h.selectedTds;p.each(b,function(b){1==b.colSpan&&b.setAttribute("width",a)})}var d=this,h=a.getUETableBySelected(d); |
|||
h&&h.selectedTds.length&&e(c())}};UE.commands.averagedistributerow={queryCommandState:function(){var b=a.getUETableBySelected(this);return!b||b.selectedTds&&/th/ig.test(b.selectedTds[0].tagName)?-1:b.isFullRow()||b.isFullCol()?0:-1},execCommand:function(b){function c(){var b,e=0;b=h.table;var g=a.getDefaultValue(d,b),k=parseInt(f.getComputedStyle(b.getElementsByTagName("td")[0],"padding-top"));if(h.isFullCol()){var e=f.getElementsByTagName(b,"caption"),l=f.getElementsByTagName(b,"th"),p,t;0<e.length&& |
|||
(p=e[0].offsetHeight);0<l.length&&(t=l[0].offsetHeight);e=b.offsetHeight-(p||0)-(t||0);b=0==l.length?h.rowsNum:h.rowsNum-1}else{t=h.cellsRange.beginRowIndex;l=h.cellsRange.endRowIndex;p=0;for(b=f.getElementsByTagName(b,"tr");t<=l;t++)e+=b[t].offsetHeight,p+=1;b=p}return r.ie&&9>r.version?Math.ceil(e/b):Math.ceil(e/b)-2*g.tdBorder-2*k}function e(a){var b=h.isFullCol()?f.getElementsByTagName(h.table,"td"):h.selectedTds;p.each(b,function(b){1==b.rowSpan&&b.setAttribute("height",a)})}var d=this,h=a.getUETableBySelected(d); |
|||
h&&h.selectedTds.length&&e(c())}};UE.commands.cellalignment={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(b,c){var e=a.getUETableBySelected(this);e?p.each(e.selectedTds,function(a){f.setAttributes(a,c)}):(e=(e=this.selection.getStart())&&f.findParentByTagName(e,["td","th","caption"],!0),/caption/ig.test(e.tagName)?(e.style.textAlign=c.align,e.style.verticalAlign=c.vAlign):f.setAttributes(e,c),this.selection.getRange().setCursor(!0))},queryCommandValue:function(a){(a= |
|||
e(this).cell)||(a=c(this)[0]);if(a){var b=UE.UETable.getUETable(a).selectedTds;!b.length&&(b=a);return UE.UETable.getTableCellAlignState(b)}return null}};UE.commands.tablealignment={queryCommandState:function(){return r.ie&&8>r.version?-1:e(this).table?0:-1},execCommand:function(a,b){var c=this.selection.getStart();(c=c&&f.findParentByTagName(c,["table"],!0))&&c.setAttribute("align",b)}};UE.commands.edittable={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(a,b){var c= |
|||
this.selection.getRange();if(c=f.findParentByTagName(c.startContainer,"table"))c=f.getElementsByTagName(c,"td").concat(f.getElementsByTagName(c,"th"),f.getElementsByTagName(c,"caption")),p.each(c,function(a){a.style.borderColor=b})}};UE.commands.edittd={queryCommandState:function(){return e(this).table?0:-1},execCommand:function(b,c){var e=a.getUETableBySelected(this);if(e)p.each(e.selectedTds,function(a){a.style.backgroundColor=c});else if(e=(e=this.selection.getStart())&&f.findParentByTagName(e, |
|||
["td","th","caption"],!0))e.style.backgroundColor=c}};UE.commands.settablebackground={queryCommandState:function(){return 1<c(this).length?0:-1},execCommand:function(a,b){var e;e=c(this);h(e[0]).setBackground(e,b)}};UE.commands.cleartablebackground={queryCommandState:function(){var a=c(this);if(!a.length)return-1;for(var b=0,e;e=a[b++];)if(""!==e.style.backgroundColor)return 0;return-1},execCommand:function(){var a=c(this);h(a[0]).removeBackground(a)}};UE.commands.interlacetable=UE.commands.uninterlacetable= |
|||
{queryCommandState:function(a){var b=e(this).table;if(!b)return-1;b=b.getAttribute("interlaced");return"interlacetable"==a?"enabled"===b?-1:0:b&&"disabled"!==b?0:-1},execCommand:function(a,b){var c=e(this).table;"interlacetable"==a?(c.setAttribute("interlaced","enabled"),this.fireEvent("interlacetable",c,b)):(c.setAttribute("interlaced","disabled"),this.fireEvent("uninterlacetable",c))}};UE.commands.setbordervisible={queryCommandState:function(a){return e(this).table?0:-1},execCommand:function(){var a= |
|||
e(this).table;p.each(f.getElementsByTagName(a,"td"),function(a){a.style.borderWidth="1px";a.style.borderStyle="solid"})}}})();UE.plugins.table=function(){function d(a,c){b(a,"width",!0);b(a,"height",!0)}function b(a,b,c){a.style[b]&&(c&&a.setAttribute(b,parseInt(a.style[b],10)),a.style[b]="")}function c(a){if("TD"==a.tagName||"TH"==a.tagName)return a;var b;return(b=f.findParentByTagName(a,"td",!0)||f.findParentByTagName(a,"th",!0))?b:null}function a(a){var b=new RegExp(f.fillChar,"g");if(0<a[r.ie? |
|||
"innerText":"textContent"].replace(/^\s*$/,"").replace(b,"").length)return 0;for(var c in w.$isNotEmpty)if(a.getElementsByTagName(c).length)return 0;return 1}function e(a){return a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:{x:a.clientX+y.document.body.scrollLeft-y.document.body.clientLeft,y:a.clientY+y.document.body.scrollTop-y.document.body.clientTop}}function h(a){if(!ea())try{var b=c(a.target||a.srcElement),d;ca&&(y.body.style.webkitUserSelect="none",10<Math.abs(fa.x-a.clientX)||10<Math.abs(fa.y-a.clientY))&& |
|||
(t(),ca=!1,R=0,H(a));if(V&&S)if(R=0,y.body.style.webkitUserSelect="none",y.selection.getNative()[r.ie9below?"empty":"removeAllRanges"](),d=e(a),m(y,!0,V,d,b),"h"==V){var h=T.style,l;var b=S,q=N(b);if(q){var u=q.getSameEndPosCells(b,"x")[0],p=q.getSameStartPosXCells(b)[0],z=e(a).x,x=(u?f.getXY(u).x:f.getXY(q.table).x)+20,v=p?f.getXY(p).x+p.offsetWidth-20:y.body.offsetWidth+5||parseInt(f.getComputedStyle(y.body,"width"),10),x=x+5,v=v-5;l=z<x?x:z>v?v:z}else l=void 0;h.left=l+"px"}else{if("v"==V){var F= |
|||
T.style,w;a:{try{var A=f.getXY(S).y,B=e(a).y;w=B<A?A:B;break a}catch(C){}w=void 0}F.top=w+"px"}}else if(b){if(!0!==y.fireEvent("excludetable",b)){d=e(a);var E=n(b,d),da=f.findParentByTagName(b,"table",!0);k(da,b,a,!0)?!0!==y.fireEvent("excludetable",da)&&(y.body.style.cursor="url("+y.options.cursorpath+"h.png),pointer"):k(da,b,a)?!0!==y.fireEvent("excludetable",da)&&(y.body.style.cursor="url("+y.options.cursorpath+"v.png),pointer"):(y.body.style.cursor="text",/\d/.test(E)&&(E=E.replace(/\d/,""),b= |
|||
N(b).getPreviewCell(b,"v"==E)),m(y,b?!!E:!1,b?E:"",d,b))}}else g(!1,da,y)}catch(I){}}function g(a,b,c){a?l(b,c):ga||setTimeout(function(){!ga&&K&&K.parentNode&&K.parentNode.removeChild(K)},2E3)}function l(a,b){function c(e,d){clearTimeout(g);g=setTimeout(function(){b.fireEvent("tableClicked",a,d)},300)}var e=f.getXY(a),d=a.ownerDocument;if(K&&K.parentNode)return K;K=d.createElement("div");K.contentEditable=!1;K.innerHTML="";K.style.cssText="width:15px;height:15px;background-image:url("+b.options.UEDITOR_HOME_URL+ |
|||
"dialogs/table/dragicon.png);position: absolute;cursor:move;top:"+(e.y-15)+"px;left:"+e.x+"px;";f.unSelectable(K);K.onmouseover=function(a){ga=!0};K.onmouseout=function(a){ga=!1};f.on(K,"click",function(a,b){c(b,this)});f.on(K,"dblclick",function(c,e){clearTimeout(g);var d=N(a),f=a.rows[0].cells[0],h=d.getLastCell(),h=d.getCellsRange(f,h);b.selection.getRange().setStart(f,0).setCursor(!1,!0);d.setSelected(h)});f.on(K,"dragstart",function(a,b){f.preventDefault(b)});var g;d.body.appendChild(K)}function k(a, |
|||
b,c,d){c=e(c);b=n(b,c);return d?(d=(d=a.getElementsByTagName("caption")[0])?d.offsetHeight:0,"v1"==b&&8>c.y-f.getXY(a).y-d):"h1"==b&&8>c.x-f.getXY(a).x}function m(a,b,c,e,d){try{a.body.style.cursor="h"==c?"col-resize":"v"==c?"row-resize":"text",r.ie&&(!c||aa||G.getUETableBySelected(a)?J(a):(P(a,a.document),la(c,d))),X=b}catch(g){}}function n(a,b){var c=f.getXY(a);return c?5>c.x+a.offsetWidth-b.x?"h":5>b.x-c.x?"h1":5>c.y+a.offsetHeight-b.y?"v":5>b.y-c.y?"v1":"":""}function q(a,b){if(!ea())if(fa={x:b.clientX, |
|||
y:b.clientY},2==b.button){var c=G.getUETableBySelected(y),e=!1;if(c){var d=Y(y,b);p.each(c.selectedTds,function(a){a===d&&(e=!0)});e?(d=c.selectedTds[0],setTimeout(function(){y.selection.getRange().setStart(d,0).setCursor(!1,!0)},0)):(ha(f.getElementsByTagName(y.body,"th td")),c.clearSelected())}}else x(b)}function u(a){R=0;a=a||y.window.event;var b=c(a.target||a.srcElement);if(b){var d;if(d=n(b,e(a)))if(J(y),"h1"==d&&(d="h",k(f.findParentByTagName(b,"table"),b,a)?y.execCommand("adaptbywindow"):(b= |
|||
N(b).getPreviewCell(b))&&y.selection.getRange().selectNodeContents(b).setCursor(!0,!0)),"h"==d){a=N(b);var g=A(b,a.table,!0),g=v(g,"left");a.width=a.offsetWidth;var h=[],l=[];p.each(g,function(a){h.push(a.offsetWidth)});p.each(g,function(a){a.removeAttribute("width")});window.setTimeout(function(){var a=!0;p.each(g,function(b,c){var e=b.offsetWidth;if(e>h[c])return a=!1;l.push(e)});var b=a?l:h;p.each(g,function(a,c){a.width=b[c]-C()})},0)}}}function x(a){ha(f.getElementsByTagName(y.body,"td th")); |
|||
p.each(y.document.getElementsByTagName("table"),function(a){a.ueTable=null});if(L=Y(y,a)){var b=f.findParentByTagName(L,"table",!0);(ut=N(b))&&ut.clearSelected();X?z(a):(y.document.body.style.webkitUserSelect="",aa=!0,y.addListener("mouseover",O))}}function z(a){r.ie&&(a=F(a));t();ca=!0;ia=setTimeout(function(){H(a)},360)}function v(a,b){for(var c=[],e=null,d=0,g=a.length;d<g;d++)(e=a[d][b])&&c.push(e);return c}function t(){ia&&clearTimeout(ia);ia=null}function F(a){var b="pageX pageY clientX clientY srcElement target".split(" "), |
|||
c={};if(a)for(var e=0,d,g;d=b[e];e++)(g=a[d])&&(c[d]=g);return c}function H(a){ca=!1;if(L=a.target||a.srcElement)a=n(L,e(a)),/\d/.test(a)&&(a=a.replace(/\d/,""),L=N(L).getPreviewCell(L,"v"==a)),J(y),P(y,y.document),y.fireEvent("saveScene"),la(a,L),aa=!0,V=a,S=L}function B(a,b){if(!ea()){t();ca=!1;if(X&&(R=++R%3,fa={x:b.clientX,y:b.clientY},setTimeout(function(){0<R&&R--},360),2===R)){R=0;u(b);return}if(2!=b.button){var c=this.selection.getRange(),e=f.findParentByTagName(c.startContainer,"table",!0), |
|||
d=f.findParentByTagName(c.endContainer,"table",!0);if(e||d)e===d?(e=f.findParentByTagName(c.startContainer,["td","th","caption"],!0),d=f.findParentByTagName(c.endContainer,["td","th","caption"],!0),e!==d&&this.selection.clearRange()):this.selection.clearRange();aa=!1;this.document.body.style.webkitUserSelect="";if(V&&S&&(this.selection.getNative()[r.ie9below?"empty":"removeAllRanges"](),R=0,T=this.document.getElementById("ue_tableDragLine"))){c=f.getXY(S);e=f.getXY(T);switch(V){case "h":na(S,e.x- |
|||
c.x);break;case "v":U(S,e.y-c.y-S.offsetHeight)}V="";S=null;J(this);this.fireEvent("saveScene");return}if(L)(e=(c=N(L))?c.selectedTds[0]:null)?(c=new M.Range(this.document),f.isEmptyBlock(e)?c.setStart(e,0).setCursor(!1,!0):c.selectNodeContents(e).shrinkBoundary().setCursor(!1,!0)):(c=this.selection.getRange().shrinkBoundary(),c.collapsed||(e=f.findParentByTagName(c.startContainer,["td","th"],!0),d=f.findParentByTagName(c.endContainer,["td","th"],!0),(e&&!d||!e&&d||e&&d&&e!==d)&&c.setCursor(!1,!0))), |
|||
L=null,this.removeListener("mouseover",O);else if((e=f.findParentByTagName(b.target||b.srcElement,"td",!0))||(e=f.findParentByTagName(b.target||b.srcElement,"th",!0)),e&&("TD"==e.tagName||"TH"==e.tagName)){if(!0===this.fireEvent("excludetable",e))return;c=new M.Range(this.document);c.setStart(e,0).setCursor(!1,!0)}this._selectionChange(250,b)}}}function O(a,b){if(!ea()){var c=b.target||b.srcElement;W=f.findParentByTagName(c,"td",!0)||f.findParentByTagName(c,"th",!0);if(L&&W&&("TD"==L.tagName&&"TD"== |
|||
W.tagName||"TH"==L.tagName&&"TH"==W.tagName)&&f.findParentByTagName(L,"table")==f.findParentByTagName(W,"table"))if(c=N(W),L!=W){this.document.body.style.webkitUserSelect="none";this.selection.getNative()[r.ie9below?"empty":"removeAllRanges"]();var e=c.getCellsRange(L,W);c.setSelected(e)}else this.document.body.style.webkitUserSelect="",c.clearSelected();b.preventDefault?b.preventDefault():b.returnValue=!1}}function na(a,b){var c=N(a);if(c){var c=c.table,e=A(a,c);c.style.width="";c.removeAttribute("width"); |
|||
b=I(b,a,e);a.nextSibling?p.each(e,function(a){a.left.width=+a.left.width+b;a.right&&(a.right.width=+a.right.width-b)}):p.each(e,function(a){a.left.width-=-b})}}function ea(){return"false"===y.body.contentEditable}function U(a,b){if(!(10>Math.abs(b))){var c=N(a);if(c)for(var c=c.getSameEndPosCells(a,"y"),e=c[0]?c[0].offsetHeight:0,d=0,g;g=c[d++];){var h=b,k=e,l=parseInt(f.getComputedStyle(g,"line-height"),10),h=k+h,h=h<l?l:h;g.style.height&&(g.style.height="");1==g.rowSpan?g.setAttribute("height", |
|||
h):g.removeAttribute&&g.removeAttribute("height")}}}function A(a,b,c){b||(b=f.findParentByTagName(a,"table"));if(!b)return null;f.getNodeIndex(a);b=b.rows;for(var e=0;a;)1===a.nodeType&&(e+=a.colSpan||1),a=a.previousSibling;a=null;var d=[];p.each(b,function(a){var b=0;p.each(a.cells,function(a){b+=a.colSpan||1;if(b===e)return d.push({left:a,right:a.nextSibling||null}),!1;if(b>e)return c&&d.push({left:a}),!1})});return d}function I(a,b,c){a-=C();if(0>a)return 0;a-=E(b);var e=0>a?"left":"right";a=Math.abs(a); |
|||
p.each(c,function(b){(b=b[e])&&(a=Math.min(a,E(b)-5))});a=0>a?0:a;return"left"===e?-a:a}function E(a){var b=0,b=a.offsetWidth-C();if(!a.nextSibling){tab=f.findParentByTagName(a,"table",!1);if(void 0===tab.offsetVal){var c=a.previousSibling;tab.offsetVal=c?a.offsetWidth-c.offsetWidth===G.borderWidth?G.borderWidth:0:0}b-=tab.offsetVal}b=0>b?0:b;try{a.width=b}catch(e){}return b}function C(){if(void 0===G.tabcellSpace){var a=y.document.createElement("table"),b=y.document.createElement("tbody"),c=y.document.createElement("tr"), |
|||
e=y.document.createElement("td"),d=null;e.style.cssText="border: 0;";e.width=1;c.appendChild(e);c.appendChild(d=e.cloneNode(!1));b.appendChild(c);a.appendChild(b);a.style.cssText="visibility: hidden;";y.body.appendChild(a);G.paddingSpace=e.offsetWidth-1;b=a.offsetWidth;e.style.cssText="";d.style.cssText="";G.borderWidth=(a.offsetWidth-b)/3;G.tabcellSpace=G.paddingSpace+G.borderWidth;y.body.removeChild(a)}C=function(){return G.tabcellSpace};return G.tabcellSpace}function P(a,b){aa||(T=a.document.createElement("div"), |
|||
f.setAttributes(T,{id:"ue_tableDragLine",unselectable:"on",contenteditable:!1,onresizestart:"return false",ondragstart:"return false",onselectstart:"return false",style:"background-color:blue;position:absolute;padding:0;margin:0;background-image:none;border:0px none;opacity:0;filter:alpha(opacity=0)"}),a.body.appendChild(T))}function J(a){if(!aa)for(var b;b=a.document.getElementById("ue_tableDragLine");)f.remove(b)}function la(a,b){if(b){var c=f.findParentByTagName(b,"table"),e=c.getElementsByTagName("caption"), |
|||
d=c.offsetWidth,g=c.offsetHeight-(0<e.length?e[0].offsetHeight:0),c=f.getXY(c),h=f.getXY(b);switch(a){case "h":e="height:"+g+"px;top:"+(c.y+(0<e.length?e[0].offsetHeight:0))+"px;left:"+(h.x+b.offsetWidth);T.style.cssText=e+"px;position: absolute;display:block;background-color:blue;width:1px;border:0; color:blue;opacity:.3;filter:alpha(opacity=30)";break;case "v":e="width:"+d+"px;left:"+c.x+"px;top:"+(h.y+b.offsetHeight),T.style.cssText=e+"px;overflow:hidden;position: absolute;display:block;background-color:blue;height:1px;border:0;color:blue;opacity:.2;filter:alpha(opacity=20)"}}} |
|||
function Q(a,b){for(var c=f.getElementsByTagName(a.body,"table"),e,d=0,g;g=c[d++];)e=f.getElementsByTagName(g,"td"),e[0]&&(b?(e=e[0].style.borderColor.replace(/\s/g,""),/(#ffffff)|(rgb\(255,255,255\))/ig.test(e)&&f.addClass(g,"noBorderTable")):f.removeClasses(g,"noBorderTable"))}function Z(a,b,c){var e=a.body;return e.offsetWidth-(b?2*parseInt(f.getComputedStyle(e,"margin-left"),10):0)-2*c.tableBorder-(a.options.offsetWidth||0)}function Y(a,b){var c=f.findParentByTagName(b.target||b.srcElement,["td", |
|||
"th"],!0),d=null;if(!c)return null;d=n(c,e(b));if(!c)return null;if("h1"===d&&c.previousSibling){var d=f.getXY(c),g=c.offsetWidth;Math.abs(d.x+g-b.clientX)>g/3&&(c=c.previousSibling)}else"v1"===d&&c.parentNode.previousSibling&&(d=f.getXY(c),g=c.offsetHeight,Math.abs(d.y+g-b.clientY)>g/3&&(c=c.parentNode.previousSibling.firstChild));return c&&!0!==a.fireEvent("excludetable",c)?c:null}var y=this,ia=null,ca=!1,R=0,fa=null,G=UE.UETable,N=function(a){return G.getUETable(a)},ha=function(a){return G.removeSelectedClass(a)}; |
|||
y.ready(function(){var a=this,b=a.selection.getText;a.selection.getText=function(){var c=G.getUETableBySelected(a);if(c){var e="";p.each(c.selectedTds,function(a){e+=a[r.ie?"innerText":"textContent"]});return e}return b.call(a.selection)}});var L=null,W=null,V="",X=!1,K=null,ga=!1,T=null,S=null,aa=!1;y.setOpt({maxColNum:20,maxRowNum:100,defaultCols:5,defaultRows:5,tdvalign:"top",cursorpath:y.options.UEDITOR_HOME_URL+"themes/default/images/cursor_",tableDragable:!1,classList:["ue-table-interlace-color-single", |
|||
"ue-table-interlace-color-double"]});y.getUETable=N;var ba={deletetable:1,inserttable:1,cellvalign:1,insertcaption:1,deletecaption:1,inserttitle:1,deletetitle:1,mergeright:1,mergedown:1,mergecells:1,insertrow:1,insertrownext:1,deleterow:1,insertcol:1,insertcolnext:1,deletecol:1,splittocells:1,splittorows:1,splittocols:1,adaptbytext:1,adaptbywindow:1,adaptbycustomer:1,insertparagraph:1,insertparagraphbeforetable:1,averagedistributecol:1,averagedistributerow:1};y.ready(function(){p.cssRule("table", |
|||
".selectTdClass{background-color:#edf5fa !important}table.noBorderTable td,table.noBorderTable th,table.noBorderTable caption{border:1px dashed #ddd !important}table{margin-bottom:10px;border-collapse:collapse;display:table;}td,th{padding: 5px 10px;border: 1px solid #DDD;}caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}th{border-top:1px solid #BBB;background-color:#F7F7F7;}table tr.firstRow th{border-top-width:2px;}.ue-table-interlace-color-single{ background-color: #fcfcfc; } .ue-table-interlace-color-double{ background-color: #f7faff; }td p{margin:0;padding:0;}", |
|||
y.document);var b,e,l;y.addListener("keydown",function(c,d){var g=d.keyCode||d.which;if(8==g){var h=G.getUETableBySelected(this);h&&h.selectedTds.length&&(h.isFullCol()?this.execCommand("deletecol"):h.isFullRow()?this.execCommand("deleterow"):this.fireEvent("delcells"),f.preventDefault(d));var k=f.findParentByTagName(this.selection.getStart(),"caption",!0),n=this.selection.getRange();n.collapsed&&k&&a(k)&&(this.fireEvent("saveScene"),h=k.parentNode,f.remove(k),h&&n.setStart(h.rows[0].cells[0],0).setCursor(!1, |
|||
!0),this.fireEvent("saveScene"))}if(46==g&&(h=G.getUETableBySelected(this))){this.fireEvent("saveScene");for(k=0;n=h.selectedTds[k++];)f.fillNode(this.document,n);this.fireEvent("saveScene");f.preventDefault(d)}if(13==g){g=this.selection.getRange();if(k=f.findParentByTagName(g.startContainer,"caption",!0)){h=f.findParentByTagName(k,"table");g.collapsed?k&&g.setStart(h.rows[0].cells[0],0).setCursor(!1,!0):(g.deleteContents(),this.fireEvent("saveScene"));f.preventDefault(d);return}g.collapsed&&(h=f.findParentByTagName(g.startContainer, |
|||
"table"))&&(n=h.rows[0].cells[0],k=f.findParentByTagName(this.selection.getStart(),["td","th"],!0),h=h.previousSibling,n===k&&(!h||1==h.nodeType&&"TABLE"==h.tagName)&&f.isStartInblock(g)&&(g=f.findParent(this.selection.getStart(),function(a){return f.isBlockElm(a)},!0))&&(/t(h|d)/i.test(g.tagName)||g===k.firstChild)&&(this.execCommand("insertparagraphbeforetable"),f.preventDefault(d)))}if((d.ctrlKey||d.metaKey)&&"67"==d.keyCode&&(b=null,h=G.getUETableBySelected(this)))for(g=h.selectedTds,e=h.isFullCol(), |
|||
l=h.isFullRow(),b=[[h.cloneCell(g[0],null,!0)]],k=1;n=g[k];k++)n.parentNode!==g[k-1].parentNode?b.push([h.cloneCell(n,null,!0)]):b[b.length-1].push(h.cloneCell(n,null,!0))});y.addListener("tablehasdeleted",function(){m(this,!1,"",null);K&&f.remove(K)});y.addListener("beforepaste",function(c,g){var h=this,k=h.selection.getRange();if(f.findParentByTagName(k.startContainer,"caption",!0))k=h.document.createElement("div"),k.innerHTML=g.html,g.html=k[r.ie9below?"innerText":"textContent"];else{var n=G.getUETableBySelected(h); |
|||
if(b){h.fireEvent("saveScene");var k=h.selection.getRange(),m=f.findParentByTagName(k.startContainer,["td","th"],!0),q,u;if(m){n=N(m);if(l){var z=n.getCellInfo(m).rowIndex;"TH"==m.tagName&&z++;for(var k=0,x;x=b[k++];){u=n.insertRow(z++,"td");for(var v=0,t;t=x[v];v++)(m=u.cells[v])||(m=u.insertCell(v)),m.innerHTML=t.innerHTML,t.getAttribute("width")&&m.setAttribute("width",t.getAttribute("width")),t.getAttribute("vAlign")&&m.setAttribute("vAlign",t.getAttribute("vAlign")),t.getAttribute("align")&& |
|||
m.setAttribute("align",t.getAttribute("align")),t.style.cssText&&(m.style.cssText=t.style.cssText);for(v=0;(t=u.cells[v])&&x[v];v++)t.innerHTML=x[v].innerHTML,x[v].getAttribute("width")&&t.setAttribute("width",x[v].getAttribute("width")),x[v].getAttribute("vAlign")&&t.setAttribute("vAlign",x[v].getAttribute("vAlign")),x[v].getAttribute("align")&&t.setAttribute("align",x[v].getAttribute("align")),x[v].style.cssText&&(t.style.cssText=x[v].style.cssText)}}else{if(e){z=n.getCellInfo(m);v=m=0;for(x=b[0];t= |
|||
x[v++];)m+=t.colSpan||1;h.__hasEnterExecCommand=!0;for(k=0;k<m;k++)h.execCommand("insertcol");h.__hasEnterExecCommand=!1;m=n.table.rows[0].cells[z.cellIndex];"TH"==m.tagName&&(m=n.table.rows[1].cells[z.cellIndex])}for(k=0;x=b[k++];){q=m;for(v=0;t=x[v++];)m?(m.innerHTML=t.innerHTML,t.getAttribute("width")&&m.setAttribute("width",t.getAttribute("width")),t.getAttribute("vAlign")&&m.setAttribute("vAlign",t.getAttribute("vAlign")),t.getAttribute("align")&&m.setAttribute("align",t.getAttribute("align")), |
|||
t.style.cssText&&(m.style.cssText=t.style.cssText),u=m,m=m.nextSibling):(z=t.cloneNode(!0),f.removeAttributes(z,["class","rowSpan","colSpan"]),u.parentNode.appendChild(z));m=n.getNextCell(q,!0,!0);if(!b[k])break;m||(z=n.getCellInfo(q),n.table.insertRow(n.table.rows.length),n.update(),m=n.getVSideCell(q,!0))}}n.update()}else{n=h.document.createElement("table");for(k=0;x=b[k++];){u=n.insertRow(n.rows.length);for(v=0;t=x[v++];)z=G.cloneCell(t,null,!0),f.removeAttributes(z,["class"]),u.appendChild(z); |
|||
2==v&&1<z.rowSpan&&(z.rowSpan=1)}k=G.getDefaultValue(h,void 0);k=h.body.offsetWidth-2*parseInt(f.getComputedStyle(h.body,"margin-left"),10)-2*k.tableBorder-(h.options.offsetWidth||0);h.execCommand("insertHTML","<table "+(e&&l?'width="'+k+'"':"")+">"+n.innerHTML.replace(/>\s*</g,"><").replace(/\bth\b/gi,"td")+"</table>")}h.fireEvent("contentchange");h.fireEvent("saveScene");g.html="";return!0}k=h.document.createElement("div");k.innerHTML=g.html;x=k.getElementsByTagName("table");f.findParentByTagName(h.selection.getStart(), |
|||
"table")?(p.each(x,function(a){f.remove(a)}),f.findParentByTagName(h.selection.getStart(),"caption",!0)&&(k.innerHTML=k[r.ie?"innerText":"textContent"])):p.each(x,function(b){d(b,!0);f.removeAttributes(b,["style","border"]);p.each(f.getElementsByTagName(b,"td"),function(b){a(b)&&f.fillNode(h.document,b);d(b,!0)})});g.html=k.innerHTML}});y.addListener("afterpaste",function(){p.each(f.getElementsByTagName(y.body,"table"),function(a){if(a.offsetWidth>y.body.offsetWidth){var b=G.getDefaultValue(y,a); |
|||
a.style.width=y.body.offsetWidth-2*parseInt(f.getComputedStyle(y.body,"margin-left"),10)-2*b.tableBorder-(y.options.offsetWidth||0)+"px"}})});y.addListener("blur",function(){b=null});var n;y.addListener("keydown",function(){clearTimeout(n);n=setTimeout(function(){var a=y.selection.getRange();if(a=f.findParentByTagName(a.startContainer,["th","td"],!0)){var b=a.parentNode.parentNode.parentNode;b.offsetWidth>b.getAttribute("width")&&(a.style.wordBreak="break-all")}},100)});y.addListener("selectionchange", |
|||
function(){m(y,!1,"",null)});y.addListener("contentchange",function(){var a=this;J(a);if(!G.getUETableBySelected(a)){var b=a.selection.getRange().startContainer,b=f.findParentByTagName(b,["td","th"],!0);p.each(f.getElementsByTagName(a.document,"table"),function(b){!0!==a.fireEvent("excludetable",b)&&(b.ueTable=new G(b),b.onmouseover=function(){a.fireEvent("tablemouseover",b)},b.onmousemove=function(){a.fireEvent("tablemousemove",b);a.options.tableDragable&&g(!0,this,a);p.defer(function(){a.fireEvent("contentchange", |
|||
50)},!0)},b.onmouseout=function(){a.fireEvent("tablemouseout",b);m(a,!1,"",null);J(a)},b.onclick=function(b){b=a.window.event||b;var e=c(b.target||b.srcElement);if(e){var d=N(e),g=d.table,h=d.getCellInfo(e),f=a.selection.getRange();k(g,e,b,!0)?(g=d.getCell(d.indexTable[d.rowsNum-1][h.colIndex].rowIndex,d.indexTable[d.rowsNum-1][h.colIndex].cellIndex),b.shiftKey&&d.selectedTds.length?d.selectedTds[0]!==g?(b=d.getCellsRange(d.selectedTds[0],g),d.setSelected(b)):f&&f.selectNodeContents(g).select():e!== |
|||
g?(b=d.getCellsRange(e,g),d.setSelected(b)):f&&f.selectNodeContents(g).select()):k(g,e,b)&&(g=d.getCell(d.indexTable[h.rowIndex][d.colsNum-1].rowIndex,d.indexTable[h.rowIndex][d.colsNum-1].cellIndex),b.shiftKey&&d.selectedTds.length?d.selectedTds[0]!==g?(b=d.getCellsRange(d.selectedTds[0],g),d.setSelected(b)):f&&f.selectNodeContents(g).select():e!==g?(b=d.getCellsRange(e,g),d.setSelected(b)):f&&f.selectNodeContents(g).select())}})});Q(a,!0)}});f.on(y.document,"mousemove",h);f.on(y.document,"mouseout", |
|||
function(a){"TABLE"==(a.target||a.srcElement).tagName&&m(y,!1,"",null)});y.addListener("interlacetable",function(a,b,c){if(b){a=b.rows;b=a.length;for(var e=0;e<b;e++){var d=c||this.options.classList;a[e].className=d[e]?d[e]:d[e%d.length]}}});y.addListener("uninterlacetable",function(a,b){if(b)for(var c=b.rows,e=this.options.classList,d=c.length,g=0;g<d;g++)f.removeClasses(c[g],e)});y.addListener("mousedown",q);y.addListener("mouseup",B);f.on(y.body,"dragstart",function(a){B.call(y,"dragstart",a)}); |
|||
y.addOutputRule(function(a){p.each(a.getNodesByTagName("div"),function(a){"ue_tableDragLine"==a.getAttr("id")&&a.parentNode.removeChild(a)})});var u=0;y.addListener("mousedown",function(){u=0});y.addListener("tabkeydown",function(){var b=this.selection.getRange(),c=b.getCommonAncestor(!0,!0),e=f.findParentByTagName(c,"table");if(e){if(f.findParentByTagName(c,"caption",!0))(c=f.getElementsByTagName(e,"th td"))&&c.length&&b.setStart(c[0],0).setCursor(!1,!0);else{var c=f.findParentByTagName(c,["td", |
|||
"th"],!0),d=N(c);u=1<c.rowSpan?u:d.getCellInfo(c).rowIndex;(c=d.getTabNextCell(c,u))?a(c)?b.setStart(c,0).setCursor(!1,!0):b.selectNodeContents(c).select():(y.fireEvent("saveScene"),y.__hasEnterExecCommand=!0,this.execCommand("insertrownext"),y.__hasEnterExecCommand=!1,b=this.selection.getRange(),b.setStart(e.rows[e.rows.length-1].cells[0],0).setCursor(),y.fireEvent("saveScene"))}return!0}});r.ie&&y.addListener("selectionchange",function(){m(this,!1,"",null)});y.addListener("keydown",function(a,b){var c= |
|||
b.keyCode||b.which;if(8!=c&&46!=c){(c=!b.ctrlKey&&!b.metaKey&&!b.shiftKey&&!b.altKey)&&ha(f.getElementsByTagName(this.body,"td"));var e=G.getUETableBySelected(this);e&&c&&e.clearSelected()}});y.addListener("beforegetcontent",function(){Q(this,!1);r.ie&&p.each(this.document.getElementsByTagName("caption"),function(a){f.isEmptyNode(a)&&(a.innerHTML=" ")})});y.addListener("aftergetcontent",function(){Q(this,!0)});y.addListener("getAllHtml",function(){ha(y.document.getElementsByTagName("td"))}); |
|||
y.addListener("fullscreenchanged",function(a,b){if(!b){var c=this.body.offsetWidth/document.body.offsetWidth,e=f.getElementsByTagName(this.body,"table");p.each(e,function(a){if(a.offsetWidth<y.body.offsetWidth)return!1;var b=f.getElementsByTagName(a,"td"),e=[];p.each(b,function(a){e.push(a.offsetWidth)});for(var d=0,g;g=b[d];d++)g.setAttribute("width",Math.floor(e[d]*c));a.setAttribute("width",Math.floor(Z(y,!0,G.getDefaultValue(y,void 0))))})}});var z=y.execCommand;y.execCommand=function(b,c){b= |
|||
b.toLowerCase();var e=G.getUETableBySelected(this),d=new M.Range(this.document),g=this.commands[b]||UE.commands[b],h;if(g){if(!e||ba[b]||g.notNeedUndo||this.__hasEnterExecCommand)h=z.apply(this,arguments);else{this.__hasEnterExecCommand=!0;this.fireEvent("beforeexeccommand",b);for(var e=e.selectedTds,k=g=-2,l,n,m=0,q;q=e[m];m++)if(a(q)?d.setStart(q,0).setCursor(!1,!0):d.selectNode(q).select(!0),n=this.queryCommandState(b),l=this.queryCommandValue(b),-1!=n){if(g!==n||k!==l)this._ignoreContentChange= |
|||
!0,h=z.apply(this,arguments),this._ignoreContentChange=!1;g=this.queryCommandState(b);k=this.queryCommandValue(b);f.isEmptyBlock(q)&&f.fillNode(this.document,q)}d.setStart(e[0],0).shrinkBoundary(!0).setCursor(!1,!0);this.fireEvent("contentchange");this.fireEvent("afterexeccommand",b);this.__hasEnterExecCommand=!1;this._selectionChange()}return h}}})};UE.UETable.prototype.sortTable=function(d,b){var c=this.table,a=c.rows,e=[],h="TH"===a[0].cells[0].tagName,g=0;if(this.selectedTds.length){for(var f= |
|||
this.cellsRange,k=f.endRowIndex+1,m=f.beginRowIndex;m<k;m++)e[m]=a[m];e.splice(0,f.beginRowIndex);g=f.endRowIndex+1===this.rowsNum?0:f.endRowIndex+1}else for(m=0,k=a.length;m<k;m++)e[m]=a[m];var n={reversecurrent:function(a,b){return 1},orderbyasc:function(a,b){return(a.innerText||a.textContent).localeCompare(b.innerText||b.textContent)},reversebyasc:function(a,b){return b.innerHTML.localeCompare(a.innerHTML)},orderbynum:function(a,b){var c=a[r.ie?"innerText":"textContent"].match(/\d+/),e=b[r.ie? |
|||
"innerText":"textContent"].match(/\d+/);c&&(c=+c[0]);e&&(e=+e[0]);return(c||0)-(e||0)},reversebynum:function(a,b){var c=a[r.ie?"innerText":"textContent"].match(/\d+/),e=b[r.ie?"innerText":"textContent"].match(/\d+/);c&&(c=+c[0]);e&&(e=+e[0]);return(e||0)-(c||0)}};c.setAttribute("data-sort-type",b&&"string"===typeof b&&n[b]?b:"");h&&e.splice(0,1);e=p.sort(e,function(a,c){return b&&"function"===typeof b?b.call(this,a.cells[d],c.cells[d]):b&&"number"===typeof b?1:b&&"string"===typeof b&&n[b]?n[b].call(this, |
|||
a.cells[d],c.cells[d]):n.orderbyasc.call(this,a.cells[d],c.cells[d])});h=c.ownerDocument.createDocumentFragment();m=0;for(k=e.length;m<k;m++)h.appendChild(e[m]);c=c.getElementsByTagName("tbody")[0];g?c.insertBefore(h,a[g-f.endRowIndex+f.beginRowIndex-1]):c.appendChild(h)};UE.plugins.tablesort=function(){var d=this,b=UE.UETable;d.ready(function(){p.cssRule("tablesort","table.sortEnabled tr.firstRow th,table.sortEnabled tr.firstRow td{padding-right:20px;background-repeat: no-repeat;background-position: center right; background-image:url("+ |
|||
d.options.themePath+d.options.theme+"/images/sortable.png);}",d.document);d.addListener("afterexeccommand",function(b,a){"mergeright"!=a&&"mergedown"!=a&&"mergecells"!=a||this.execCommand("disablesort")})});UE.commands.sorttable={queryCommandState:function(){var c=b.getTableItemsByRange(this);if(!c.cell)return-1;for(var c=c.table.getElementsByTagName("td"),a=0,e;e=c[a++];)if(1!=e.rowSpan||1!=e.colSpan)return-1;return 0},execCommand:function(c,a){var e=this.selection.getRange(),d=e.createBookmark(!0), |
|||
g=b.getTableItemsByRange(this),f=g.cell,g=b.getUETable(g.table),f=g.getCellInfo(f);g.sortTable(f.cellIndex,a);e.moveToBookmark(d);try{e.select()}catch(k){}}};UE.commands.enablesort=UE.commands.disablesort={queryCommandState:function(c){var a=b.getTableItemsByRange(this).table;if(a&&"enablesort"==c)for(var e=f.getElementsByTagName(a,"th td"),d=0;d<e.length;d++)if(1<e[d].getAttribute("colspan")||1<e[d].getAttribute("rowspan"))return-1;return a?"enablesort"==c^"sortEnabled"!=a.getAttribute("data-sort")? |
|||
-1:0:-1},execCommand:function(c){var a=b.getTableItemsByRange(this).table;a.setAttribute("data-sort","enablesort"==c?"sortEnabled":"sortDisabled");"enablesort"==c?f.addClass(a,"sortEnabled"):f.removeClasses(a,"sortEnabled")}}};UE.plugins.contextmenu=function(){var d=this;d.setOpt("enableContextMenu",!0);if(!1!==d.getOpt("enableContextMenu")){var b=d.getLang("contextMenu"),c,a=d.options.contextMenu||[{label:b.selectall,cmdName:"selectall"},{label:b.cleardoc,cmdName:"cleardoc",exec:function(){confirm(b.confirmclear)&& |
|||
this.execCommand("cleardoc")}},"-",{label:b.unlink,cmdName:"unlink"},"-",{group:b.paragraph,icon:"justifyjustify",subMenu:[{label:b.justifyleft,cmdName:"justify",value:"left"},{label:b.justifyright,cmdName:"justify",value:"right"},{label:b.justifycenter,cmdName:"justify",value:"center"},{label:b.justifyjustify,cmdName:"justify",value:"justify"}]},"-",{group:b.table,icon:"table",subMenu:[{label:b.inserttable,cmdName:"inserttable"},{label:b.deletetable,cmdName:"deletetable"},"-",{label:b.deleterow, |
|||
cmdName:"deleterow"},{label:b.deletecol,cmdName:"deletecol"},{label:b.insertcol,cmdName:"insertcol"},{label:b.insertcolnext,cmdName:"insertcolnext"},{label:b.insertrow,cmdName:"insertrow"},{label:b.insertrownext,cmdName:"insertrownext"},"-",{label:b.insertcaption,cmdName:"insertcaption"},{label:b.deletecaption,cmdName:"deletecaption"},{label:b.inserttitle,cmdName:"inserttitle"},{label:b.deletetitle,cmdName:"deletetitle"},{label:b.inserttitlecol,cmdName:"inserttitlecol"},{label:b.deletetitlecol,cmdName:"deletetitlecol"}, |
|||
"-",{label:b.mergecells,cmdName:"mergecells"},{label:b.mergeright,cmdName:"mergeright"},{label:b.mergedown,cmdName:"mergedown"},"-",{label:b.splittorows,cmdName:"splittorows"},{label:b.splittocols,cmdName:"splittocols"},{label:b.splittocells,cmdName:"splittocells"},"-",{label:b.averageDiseRow,cmdName:"averagedistributerow"},{label:b.averageDisCol,cmdName:"averagedistributecol"},"-",{label:b.edittd,cmdName:"edittd",exec:function(){UE.ui.edittd&&new UE.ui.edittd(this);this.getDialog("edittd").open()}}, |
|||
{label:b.edittable,cmdName:"edittable",exec:function(){UE.ui.edittable&&new UE.ui.edittable(this);this.getDialog("edittable").open()}},{label:b.setbordervisible,cmdName:"setbordervisible"}]},{group:b.tablesort,icon:"tablesort",subMenu:[{label:b.enablesort,cmdName:"enablesort"},{label:b.disablesort,cmdName:"disablesort"},"-",{label:b.reversecurrent,cmdName:"sorttable",value:"reversecurrent"},{label:b.orderbyasc,cmdName:"sorttable",value:"orderbyasc"},{label:b.reversebyasc,cmdName:"sorttable",value:"reversebyasc"}, |
|||
{label:b.orderbynum,cmdName:"sorttable",value:"orderbynum"},{label:b.reversebynum,cmdName:"sorttable",value:"reversebynum"}]},{group:b.borderbk,icon:"borderBack",subMenu:[{label:b.setcolor,cmdName:"interlacetable",exec:function(){this.execCommand("interlacetable")}},{label:b.unsetcolor,cmdName:"uninterlacetable",exec:function(){this.execCommand("uninterlacetable")}},{label:b.setbackground,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#bbb", |
|||
"#ccc"]})}},{label:b.unsetbackground,cmdName:"cleartablebackground",exec:function(){this.execCommand("cleartablebackground")}},{label:b.redandblue,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["red","blue"]})}},{label:b.threecolorgradient,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#aaa","#bbb","#ccc"]})}}]},{group:b.aligntd,icon:"aligntd",subMenu:[{cmdName:"cellalignment",value:{align:"left", |
|||
vAlign:"top"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"right", |
|||
vAlign:"bottom"}}]},{group:b.aligntable,icon:"aligntable",subMenu:[{cmdName:"tablealignment",className:"left",label:b.tableleft,value:"left"},{cmdName:"tablealignment",className:"center",label:b.tablecenter,value:"center"},{cmdName:"tablealignment",className:"right",label:b.tableright,value:"right"}]},"-",{label:b.insertparagraphbefore,cmdName:"insertparagraph",value:!0},{label:b.insertparagraphafter,cmdName:"insertparagraph"},{label:b.copy,cmdName:"copy"},{label:b.paste,cmdName:"paste"}];if(a.length){var e= |
|||
UE.ui.uiUtils;d.addListener("contextmenu",function(h,g){var l=e.getViewportOffsetByEvent(g);d.fireEvent("beforeselectionchange");c&&c.destroy();for(var k=0,m,n=[];m=a[k];k++){var q;(function(a){if("-"==a)(q=n[n.length-1])&&"-"!==q&&n.push("-");else if(a.hasOwnProperty("group")){for(var c=0,e,g=[];e=a.subMenu[c];c++)(function(a){"-"==a?(q=g[g.length-1])&&"-"!==q?g.push("-"):g.splice(g.length-1):(d.commands[a.cmdName]||UE.commands[a.cmdName]||a.query)&&-1<(a.query?a.query():d.queryCommandState(a.cmdName))&& |
|||
g.push({label:a.label||d.getLang("contextMenu."+a.cmdName+(a.value||""))||"",className:"edui-for-"+a.cmdName+(a.className?" edui-for-"+a.cmdName+"-"+a.className:""),onclick:a.exec?function(){a.exec.call(d)}:function(){d.execCommand(a.cmdName,a.value)}})})(e);g.length&&n.push({label:function(){switch(a.icon){case "table":return d.getLang("contextMenu.table");case "justifyjustify":return d.getLang("contextMenu.paragraph");case "aligntd":return d.getLang("contextMenu.aligntd");case "aligntable":return d.getLang("contextMenu.aligntable"); |
|||
case "tablesort":return b.tablesort;case "borderBack":return b.borderbk;default:return""}}(),className:"edui-for-"+a.icon,subMenu:{items:g,editor:d}})}else(d.commands[a.cmdName]||UE.commands[a.cmdName]||a.query)&&-1<(a.query?a.query.call(d):d.queryCommandState(a.cmdName))&&n.push({label:a.label||d.getLang("contextMenu."+a.cmdName),className:"edui-for-"+(a.icon?a.icon:a.cmdName+(a.value||"")),onclick:a.exec?function(){a.exec.call(d)}:function(){d.execCommand(a.cmdName,a.value)}})})(m)}"-"==n[n.length- |
|||
1]&&n.pop();c=new UE.ui.Menu({items:n,className:"edui-contextmenu",editor:d});c.render();c.showAt(l);d.fireEvent("aftershowcontextmenu",c);f.preventDefault(g);if(r.ie){var u;try{u=d.selection.getNative().createRange()}catch(p){return}u.item&&(new M.Range(d.document)).selectNode(u.item(0)).select(!0,!0)}});d.addListener("aftershowcontextmenu",function(a,b){if(d.zeroclipboard){var c=b.items,e;for(e in c)"edui-for-copy"==c[e].className&&d.zeroclipboard.clip(c[e].getDom())}})}}};UE.plugins.shortcutmenu= |
|||
function(){var d,b=this.options.shortcutMenu||[];b.length&&(this.addListener("contextmenu mouseup",function(c,a){var e=this,h={type:c,target:a.target||a.srcElement,screenX:a.screenX,screenY:a.screenY,clientX:a.clientX,clientY:a.clientY};setTimeout(function(){if(!1===e.selection.getRange().collapsed||"contextmenu"==c)d||(d=new t.editor.ui.ShortCutMenu({editor:e,items:b,theme:e.options.theme,className:"edui-shortcutmenu"}),d.render(),e.fireEvent("afterrendershortcutmenu",d)),d.show(h,!!UE.plugins.contextmenu)}); |
|||
if("contextmenu"==c&&(f.preventDefault(a),r.ie9below)){var g;try{g=e.selection.getNative().createRange()}catch(l){return}g.item&&(new M.Range(e.document)).selectNode(g.item(0)).select(!0,!0)}}),this.addListener("keydown",function(b){"keydown"==b&&d&&!d.isHidden&&d.hide()}))};UE.plugins.basestyle=function(){var d={bold:["strong","b"],italic:["em","i"],subscript:["sub"],superscript:["sup"]},b=function(a,b){return f.filterNodeList(a.selection.getStartElementPath(),b)},c=this;c.addshortcutkey({Bold:"ctrl+66", |
|||
Italic:"ctrl+73",Underline:"ctrl+85"});c.addInputRule(function(a){p.each(a.getNodesByTagName("b i"),function(a){switch(a.tagName){case "b":a.tagName="strong";break;case "i":a.tagName="em"}})});for(var a in d)(function(a,d){c.commands[a]={execCommand:function(a){var e=c.selection.getRange(),k=b(this,d);if(e.collapsed){if(k)a=c.document.createTextNode(""),e.insertNode(a).removeInlineStyle(d),e.setStartBefore(a),f.remove(a);else{k=e.document.createElement(d[0]);if("superscript"==a||"subscript"==a)a= |
|||
c.document.createTextNode(""),e.insertNode(a).removeInlineStyle(["sub","sup"]).setStartBefore(a).collapse(!0);e.insertNode(k).setStart(k,0)}e.collapse(!0)}else{if("superscript"==a||"subscript"==a)k&&k.tagName.toLowerCase()==a||e.removeInlineStyle(["sub","sup"]);k?e.removeInlineStyle(d):e.applyInlineStyle(d[0])}e.select()},queryCommandState:function(){return b(this,d)?1:0}}})(a,d[a])};UE.plugins.elementpath=function(){var d,b,c=this;c.setOpt("elementPathEnabled",!0);c.options.elementPathEnabled&&(c.commands.elementpath= |
|||
{execCommand:function(a,e){var h=b[e],g=c.selection.getRange();d=1*e;g.selectNode(h).select()},queryCommandValue:function(){var a=[].concat(this.selection.getStartElementPath()).reverse(),c=[];b=a;for(var h=0,g;g=a[h];h++)if(3!=g.nodeType){var f=g.tagName.toLowerCase();"img"==f&&g.getAttribute("anchorname")&&(f="anchor");c[h]=f;if(d==h){d=-1;break}}return c}})};UE.plugins.formatmatch=function(){function d(h,g){if(r.webkit)var l="IMG"==g.target.tagName?g.target:null;b.undoManger&&b.undoManger.save(); |
|||
var k=b.selection.getRange(),l=l||k.getClosedNode();if(a&&l&&"IMG"==l.tagName)l.style.cssText+=";float:"+(a.style.cssFloat||a.style.styleFloat||"none")+";display:"+(a.style.display||"inline"),a=null;else if(!a){if(k.collapsed){var m=b.document.createTextNode("match");k.insertNode(m).select()}b.__hasEnterExecCommand=!0;k=b.options.removeFormatAttributes;b.options.removeFormatAttributes="";b.execCommand("removeformat");b.options.removeFormatAttributes=k;b.__hasEnterExecCommand=!1;k=b.selection.getRange(); |
|||
c.length&&(l=k,m&&l.selectNode(m),l.applyInlineStyle(c[c.length-1].tagName,null,c));m&&k.setStartBefore(m).collapse(!0);k.select();m&&f.remove(m)}b.undoManger&&b.undoManger.save();b.removeListener("mouseup",d);e=0}var b=this,c=[],a,e=0;b.addListener("reset",function(){c=[];e=0});b.commands.formatmatch={execCommand:function(h){if(e)e=0,c=[],b.removeListener("mouseup",d);else{h=b.selection.getRange();a=h.getClosedNode();if(!a||"IMG"!=a.tagName){h.collapse(!0).shrinkBoundary();c=f.findParents(h.startContainer, |
|||
!0,function(a){return!f.isBlockElm(a)&&1==a.nodeType});h=0;for(var g;g=c[h];h++)if("A"==g.tagName){c.splice(h,1);break}}b.addListener("mouseup",d);e=1}},queryCommandState:function(){return e},notNeedUndo:1}};UE.plugin.register("searchreplace",function(){function d(a,b,c){var l=0;a=a.firstChild;for(var k=0;a;){if(3==a.nodeType){if(k=a.nodeValue.replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,l+=k,l>=b)return{node:a,index:k-(l-b)}}else if(!w.$empty[a.tagName]&&(k=a[r.ie?"innerText":"textContent"].replace(/(^[\t\r\n]+)|([\t\r\n]+$)/, |
|||
"").length,l+=k,l>=b&&(k=d(a,k-(l-b),c))))return k;a=f.getNextDomNode(a)}}function b(b,h){var g=b.selection.getRange(),l,k=h.searchStr,m=b.document.createElement("span");m.innerHTML="$$ueditor_searchreplace_key$$";g.shrinkBoundary(!0);if(!g.collapsed){g.select();var n=b.selection.getText();if((new RegExp("^"+h.searchStr+"$",h.casesensitive?"":"i")).test(n)){if(void 0!=h.replaceStr)return k=h.replaceStr,k=c.document.createTextNode(k),g.deleteContents().insertNode(k),g.select(),!0;g.collapse(-1==h.dir)}}g.insertNode(m); |
|||
g.enlargeToBlockElm(!0);l=g.startContainer;n=l[r.ie?"innerText":"textContent"].indexOf("$$ueditor_searchreplace_key$$");g.setStartBefore(m);f.remove(m);a:{var m=l,q;l=h.all||1==h.dir?"getNextDomNode":"getPreDomNode";f.isBody(m)&&(m=m.firstChild);for(;m;){q=3==m.nodeType?m.nodeValue:m[r.ie?"innerText":"textContent"];b:{var u=h,p=n,z=u.searchStr;-1==u.dir&&(q=q.split("").reverse().join(""),z=z.split("").reverse().join(""),p=q.length-p);for(var z=new RegExp(z,"g"+(u.casesensitive?"":"i")),v=void 0;v= |
|||
z.exec(q);)if(v.index>=p){q=-1==u.dir?q.length-v.index-u.searchStr.length:v.index;break b}q=-1}if(-1!=q){n={node:m,index:q};break a}for(m=f[l](m);m&&a[m.nodeName.toLowerCase()];)m=f[l](m,!0);m&&(n=-1==h.dir?(3==m.nodeType?m.nodeValue:m[r.ie?"innerText":"textContent"]).length:0)}n=void 0}if(n)return m=d(n.node,n.index,k),k=d(n.node,n.index+k.length,k),g.setStart(m.node,m.index).setEnd(k.node,k.index),void 0!==h.replaceStr&&(k=h.replaceStr,k=c.document.createTextNode(k),g.deleteContents().insertNode(k)), |
|||
g.select(),!0;g.setCursor()}var c=this,a={table:1,tbody:1,tr:1,ol:1,ul:1};return{commands:{searchreplace:{execCommand:function(a,d){p.extend(d,{all:!1,casesensitive:!1,dir:1},!0);var g=0;if(d.all){var f=c.selection.getRange(),k=c.body.firstChild;k&&1==k.nodeType?(f.setStart(k,0),f.shrinkBoundary(!0)):3==k.nodeType&&f.setStartBefore(k);f.collapse(!0).select(!0);for(void 0!==d.replaceStr&&c.fireEvent("saveScene");b(this,d);)g++}else void 0!==d.replaceStr&&c.fireEvent("saveScene"),b(this,d)&&g++;g&& |
|||
c.fireEvent("saveScene");return g},notNeedUndo:1}}}});UE.plugins.customstyle=function(){var d=this;d.setOpt({customstyle:[{tag:"h1",name:"tc",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;"},{tag:"h1",name:"tl",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:left;margin:0 0 10px 0;"},{tag:"span",name:"im",style:"font-size:16px;font-style:italic;font-weight:bold;line-height:18px;"}, |
|||
{tag:"span",name:"hi",style:"font-size:16px;font-style:italic;font-weight:bold;color:rgb(51, 153, 204);line-height:18px;"}]});d.commands.customstyle={execCommand:function(b,c){var a=c.tag,e=f.findParent(this.selection.getStart(),function(a){return a.getAttribute("label")},!0),d,g,l={};for(d in c)void 0!==c[d]&&(l[d]=c[d]);delete l.tag;if(e&&e.getAttribute("label")==c.label){d=this.selection.getRange();g=d.createBookmark();if(d.collapsed)if(w.$block[e.tagName]){var k=this.document.createElement("p"); |
|||
f.moveChild(e,k);e.parentNode.insertBefore(k,e);f.remove(e)}else f.remove(e,!0);else{e=f.getCommonAncestor(g.start,g.end);l=f.getElementsByTagName(e,a);(new RegExp(a,"i")).test(e.tagName)&&l.push(e);for(var m=0,n;n=l[m++];)if(n.getAttribute("label")==c.label){var k=f.getPosition(n,g.start),q=f.getPosition(n,g.end);(k&f.POSITION_FOLLOWING||k&f.POSITION_CONTAINS)&&(q&f.POSITION_PRECEDING||q&f.POSITION_CONTAINS)&&w.$block[a]&&(k=this.document.createElement("p"),f.moveChild(n,k),n.parentNode.insertBefore(k, |
|||
n));f.remove(n,!0)}(e=f.findParent(e,function(a){return a.getAttribute("label")==c.label},!0))&&f.remove(e,!0)}d.moveToBookmark(g).select()}else w.$block[a]?(this.execCommand("paragraph",a,l,"customstyle"),d=this.selection.getRange(),d.collapsed||(d.collapse(),e=f.findParent(this.selection.getStart(),function(a){return a.getAttribute("label")==c.label},!0),a=this.document.createElement("p"),f.insertAfter(e,a),f.fillNode(this.document,a),d.setStart(a,0).setCursor())):(d=this.selection.getRange(),d.collapsed? |
|||
(e=this.document.createElement(a),f.setAttributes(e,l),d.insertNode(e).setStart(e,0).setCursor()):(g=d.createBookmark(),d.applyInlineStyle(a,l).moveToBookmark(g).select()))},queryCommandValue:function(){var b=f.filterNodeList(this.selection.getStartElementPath(),function(b){return b.getAttribute("label")});return b?b.getAttribute("label"):""}};d.addListener("keyup",function(b,c){var a=c.keyCode||c.which;if(32==a||13==a)if(a=d.selection.getRange(),a.collapsed){var e=f.findParent(d.selection.getStart(), |
|||
function(a){return a.getAttribute("label")},!0);if(e&&w.$block[e.tagName]&&f.isEmptyNode(e)){var h=d.document.createElement("p");f.insertAfter(e,h);f.fillNode(d.document,h);f.remove(e);a.setStart(h,0).setCursor()}}})};UE.plugins.catchremoteimage=function(){var d=this,b=UE.ajax;!1!==d.options.catchRemoteImageEnable&&(d.setOpt({catchRemoteImageEnable:!1}),d.addListener("afterpaste",function(){d.fireEvent("catchRemoteImage")}),d.addListener("catchRemoteImage",function(){function c(a,c){var f=p.serializeParam(d.queryCommandValue("serverparam"))|| |
|||
"",f=p.formatUrl(e+(-1==e.indexOf("?")?"?":"&")+f),h={method:"POST",dataType:p.isCrossDomainUrl(f)?"jsonp":"",timeout:6E4,onsuccess:c.success,onerror:c.error};h[g]=a;b.request(f,h)}for(var a=d.getOpt("catcherLocalDomain"),e=d.getActionUrl(d.getOpt("catcherActionName")),h=d.getOpt("catcherUrlPrefix"),g=d.getOpt("catcherFieldName"),l=[],k=f.getElementsByTagName(d.document,"img"),m=function(a,b){if(-1!=a.indexOf(location.host)||/(^\.)|(^\/)/.test(a))return!0;if(b)for(var c=0,e;e=b[c++];)if(-1!==a.indexOf(e))return!0; |
|||
return!1},n=0,q;q=k[n++];)q.getAttribute("word_img")||(q=q.getAttribute("_src")||q.src||"",/^(https?|ftp):/i.test(q)&&!m(q,a)&&l.push(q));l.length&&c(l,{success:function(a){try{var b=void 0!==a.state?a:eval("("+a.responseText+")")}catch(c){return}var e,g,n,l=b.list;for(a=0;b=k[a++];)for(n=b.getAttribute("_src")||b.src||"",e=0;g=l[e++];)if(n==g.source&&"SUCCESS"==g.state){e=h+g.url;f.setAttributes(b,{src:e,_src:e});break}d.fireEvent("catchremotesuccess")},error:function(){d.fireEvent("catchremoteerror")}})}))}; |
|||
UE.plugin.register("snapscreen",function(){function d(a){var c=document.createElement("a"),d=p.serializeParam(b.queryCommandValue("serverparam"))||"";c.href=a;r.ie&&(c.href=c.href);a=c.search;d&&(a=a+(-1==a.indexOf("?")?"?":"&")+d,a=a.replace(/[&]+/ig,"&"));return{port:c.port,hostname:c.hostname,path:c.pathname+a||+c.hash}}var b=this,c;return{commands:{snapscreen:{execCommand:function(a){function e(a){try{if(a=eval("("+a+")"),"SUCCESS"==a.state){var c=b.options;b.execCommand("insertimage",{src:c.snapscreenUrlPrefix+ |
|||
a.url,_src:c.snapscreenUrlPrefix+a.url,alt:a.title||"",floatStyle:c.snapscreenImgAlign})}else alert(a.state)}catch(e){alert(l.callBackErrorMsg)}}var f,g,l=b.getLang("snapScreen_plugin");if(!c){a=b.container;c=(b.container.ownerDocument||b.container.document).createElement("object");try{c.type="application/x-pluginbaidusnap"}catch(k){return}c.style.cssText="position:absolute;left:-9999px;width:0;height:0;";c.setAttribute("width","0");c.setAttribute("height","0");a.appendChild(c)}a=b.getActionUrl(b.getOpt("snapscreenActionName")); |
|||
f=d(a);setTimeout(function(){try{g=c.saveSnapshot(f.hostname,f.path,f.port)}catch(a){b.ui._dialogs.snapscreenDialog.open();return}e(g)},50)},queryCommandState:function(){return-1!=navigator.userAgent.indexOf("Windows",0)?0:-1}}}}});UE.commands.insertparagraph={execCommand:function(d,b){for(var c=this.selection.getRange(),a=c.startContainer,e;a&&!f.isBody(a);)e=a,a=a.parentNode;e&&(a=this.document.createElement("p"),b?e.parentNode.insertBefore(a,e):e.parentNode.insertBefore(a,e.nextSibling),f.fillNode(this.document, |
|||
a),c.setStart(a,0).setCursor(!1,!0))}};UE.plugin.register("webapp",function(){function d(c,a){return a?'<iframe class="edui-faked-webapp" title="'+c.title+'" '+(c.align&&!c.cssfloat?'align="'+c.align+'"':"")+(c.cssfloat?'style="float:'+c.cssfloat+'"':"")+'width="'+c.width+'" height="'+c.height+'" scrolling="no" frameborder="0" src="'+c.url+'" logo_url = "'+c.logo+'"></iframe>':'<img title="'+c.title+'" width="'+c.width+'" height="'+c.height+'" src="'+b.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" _logo_url="'+ |
|||
c.logo+'" style="background:url('+c.logo+') no-repeat center center; border:1px solid gray;" class="edui-faked-webapp" _url="'+c.url+'" '+(c.align&&!c.cssfloat?'align="'+c.align+'"':"")+(c.cssfloat?'style="float:'+c.cssfloat+'"':"")+"/>"}var b=this;return{outputRule:function(b){p.each(b.getNodesByTagName("img"),function(a){var b;"edui-faked-webapp"==a.getAttr("class")&&(b=d({title:a.getAttr("title"),width:a.getAttr("width"),height:a.getAttr("height"),align:a.getAttr("align"),cssfloat:a.getStyle("float"), |
|||
url:a.getAttr("_url"),logo:a.getAttr("_logo_url")},!0),b=UE.uNode.createElement(b),a.parentNode.replaceChild(b,a))})},inputRule:function(b){p.each(b.getNodesByTagName("iframe"),function(a){if("edui-faked-webapp"==a.getAttr("class")){var b=UE.uNode.createElement(d({title:a.getAttr("title"),width:a.getAttr("width"),height:a.getAttr("height"),align:a.getAttr("align"),cssfloat:a.getStyle("float"),url:a.getAttr("src"),logo:a.getAttr("logo_url")}));a.parentNode.replaceChild(b,a)}})},commands:{webapp:{execCommand:function(b, |
|||
a){var e=d(p.extend(a,{align:"none"}),!1);this.execCommand("inserthtml",e)},queryCommandState:function(){var b=this.selection.getRange().getClosedNode();return b&&"edui-faked-webapp"==b.className?1:0}}}}});UE.plugins.template=function(){UE.commands.template={execCommand:function(d,b){b.html&&this.execCommand("inserthtml",b.html)}};this.addListener("click",function(d,b){var c=b.target||b.srcElement,a=this.selection.getRange();(c=f.findParent(c,function(a){if(a.className&&f.hasClass(a,"ue_t"))return a}, |
|||
!0))&&a.selectNode(c).shrinkBoundary().select()});this.addListener("keydown",function(d,b){var c=this.selection.getRange();c.collapsed||b.ctrlKey||b.metaKey||b.shiftKey||b.altKey||(c=f.findParent(c.startContainer,function(a){if(a.className&&f.hasClass(a,"ue_t"))return a},!0))&&f.removeClasses(c,["ue_t"])})};UE.plugin.register("music",function(){function d(c,a,e,d,g,f){return f?'<embed type="application/x-shockwave-flash" class="edui-faked-music" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+ |
|||
c+'" width="'+a+'" height="'+e+'" '+(d&&!g?'align="'+d+'"':"")+(g?'style="float:'+g+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >':"<img "+(d&&!g?'align="'+d+'"':"")+(g?'style="float:'+g+'"':"")+' width="'+a+'" height="'+e+'" _url="'+c+'" class="edui-faked-music" src="'+b.options.langPath+b.options.lang+'/images/music.png" />'}var b=this;return{outputRule:function(b){p.each(b.getNodesByTagName("img"),function(a){var b;if("edui-faked-music"== |
|||
a.getAttr("class")){b=a.getStyle("float");var c=a.getAttr("align");b=d(a.getAttr("_url"),a.getAttr("width"),a.getAttr("height"),c,b,!0);b=UE.uNode.createElement(b);a.parentNode.replaceChild(b,a)}})},inputRule:function(b){p.each(b.getNodesByTagName("embed"),function(a){if("edui-faked-music"==a.getAttr("class")){var b=a.getStyle("float"),c=a.getAttr("align");html=d(a.getAttr("src"),a.getAttr("width"),a.getAttr("height"),c,b,!1);b=UE.uNode.createElement(html);a.parentNode.replaceChild(b,a)}})},commands:{music:{execCommand:function(b, |
|||
a){var e=d(a.url,a.width||400,a.height||95,"none",!1);this.execCommand("inserthtml",e)},queryCommandState:function(){var b=this.selection.getRange().getClosedNode();return b&&"edui-faked-music"==b.className?1:0}}}}});UE.plugin.register("autoupload",function(){function d(b,c){var a,e,d,g,l,k,m,n,q=/image\/\w+/i.test(b.type)?"image":"file",u="loading_"+(+new Date).toString(36);a=c.getOpt(q+"FieldName");e=c.getOpt(q+"UrlPrefix");d=c.getOpt(q+"MaxSize");g=c.getOpt(q+"AllowFiles");l=c.getActionUrl(c.getOpt(q+ |
|||
"ActionName"));m=function(a){var b=c.document.getElementById(u);b&&f.remove(b);c.fireEvent("showmessage",{id:u,content:a,type:"error",timeout:4E3})};"image"==q?(k='<img class="loadingclass" id="'+u+'" src="'+c.options.themePath+c.options.theme+'/images/spacer.gif" title="'+(c.getLang("autoupload.loading")||"")+'" >',n=function(a){var b=e+a.url,d=c.document.getElementById(u);d&&(d.setAttribute("src",b),d.setAttribute("_src",b),d.setAttribute("title",a.title||""),d.setAttribute("alt",a.original||""), |
|||
d.removeAttribute("id"),f.removeClasses(d,"loadingclass"))}):(k='<p><img class="loadingclass" id="'+u+'" src="'+c.options.themePath+c.options.theme+'/images/spacer.gif" title="'+(c.getLang("autoupload.loading")||"")+'" ></p>',n=function(a){a=e+a.url;var b=c.document.getElementById(u),d=c.selection.getRange(),g=d.createBookmark();d.selectNode(b).select();c.execCommand("insertfile",{url:a});d.moveToBookmark(g).select()});c.execCommand("inserthtml",k);c.getOpt(q+"ActionName")?b.size>d?m(c.getLang("autoupload.exceedSizeError")): |
|||
(d=b.name?b.name.substr(b.name.lastIndexOf(".")):"")&&"image"!=q||g&&-1==(g.join("")+".").indexOf(d.toLowerCase()+".")?m(c.getLang("autoupload.exceedTypeError")):(g=new XMLHttpRequest,q=new FormData,d=p.serializeParam(c.queryCommandValue("serverparam"))||"",l=p.formatUrl(l+(-1==l.indexOf("?")?"?":"&")+d),q.append(a,b,b.name||"blob."+b.type.substr(6)),q.append("type","ajax"),g.open("post",l,!0),g.setRequestHeader("X-Requested-With","XMLHttpRequest"),g.addEventListener("load",function(a){try{var b= |
|||
(new Function("return "+p.trim(a.target.response)))();"SUCCESS"==b.state&&b.url?n(b):m(b.state)}catch(e){m(c.getLang("autoupload.loadError"))}}),g.send(q)):m(c.getLang("autoupload.errorLoadConfig"))}return{outputRule:function(b){p.each(b.getNodesByTagName("img"),function(b){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(b.getAttr("class"))&&b.parentNode.removeChild(b)});p.each(b.getNodesByTagName("p"),function(b){/\bloadpara\b/.test(b.getAttr("class"))&&b.parentNode.removeChild(b)})},bindEvents:{ready:function(b){var c= |
|||
this;window.FormData&&window.FileReader&&(f.on(c.body,"paste drop",function(a){var b=!1,f;if(f="paste"==a.type?a.clipboardData&&a.clipboardData.items&&1==a.clipboardData.items.length&&/^image\//.test(a.clipboardData.items[0].type)?a.clipboardData.items:null:a.dataTransfer&&a.dataTransfer.files?a.dataTransfer.files:null){for(var g=f.length,l;g--;)l=f[g],l.getAsFile&&(l=l.getAsFile()),l&&0<l.size&&(d(l,c),b=!0);b&&a.preventDefault()}}),f.on(c.body,"dragover",function(a){"Files"==a.dataTransfer.types[0]&& |
|||
a.preventDefault()}),p.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-left:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}", |
|||
this.document))}}}});UE.plugin.register("autosave",function(){function d(e){var d;20>new Date-c||(e.hasContents()?(c=new Date,e._saveFlag=null,d=b.body.innerHTML,!1!==e.fireEvent("beforeautosave",{content:d})&&(b.setPreferences(a,d),e.fireEvent("afterautosave",{content:d}))):a&&b.removePreferences(a))}var b=this,c=new Date,a=null;return{defaultOptions:{saveInterval:500},bindEvents:{ready:function(){var c=null,c=b.key?b.key+"-drafts-data":(b.container.parentNode.id||"ue-common")+"-drafts-data";a=(location.protocol+ |
|||
location.host+location.pathname).replace(/[.:\/]/g,"_")+c},contentchange:function(){a&&(b._saveFlag&&window.clearTimeout(b._saveFlag),0<b.options.saveInterval?b._saveFlag=window.setTimeout(function(){d(b)},b.options.saveInterval):d(b))}},commands:{clearlocaldata:{execCommand:function(c,d){a&&b.getPreferences(a)&&b.removePreferences(a)},notNeedUndo:!0,ignoreContentChange:!0},getlocaldata:{execCommand:function(c,d){return a?b.getPreferences(a)||"":""},notNeedUndo:!0,ignoreContentChange:!0},drafts:{execCommand:function(c, |
|||
d){a&&(b.body.innerHTML=b.getPreferences(a)||"<p>"+f.fillHtml+"</p>",b.focus(!0))},queryCommandState:function(){return a?null===b.getPreferences(a)?-1:0:-1},notNeedUndo:!0,ignoreContentChange:!0}}}});UE.plugin.register("charts",function(){function d(b){var a=null,d=0;if(2>b.rows.length||2>b.rows[0].cells.length)return!1;for(var a=b.rows[0].cells,d=a.length,f=0,g;g=a[f];f++)if("th"!==g.tagName.toLowerCase())return!1;for(f=1;a=b.rows[f];f++){if(a.cells.length!=d||"th"!==a.cells[0].tagName.toLowerCase())return!1; |
|||
for(var l=1;g=a.cells[l];l++)if(g=p.trim(g.innerText||g.textContent||""),g=g.replace(new RegExp(UE.dom.domUtils.fillChar,"g"),"").replace(/^\s+|\s+$/g,""),!/^\d*\.?\d+$/.test(g))return!1}return!0}var b=this;return{bindEvents:{chartserror:function(){}},commands:{charts:{execCommand:function(c,a){var e=f.findParentByTagName(this.selection.getRange().startContainer,"table",!0),h=[],g={};if(!e)return!1;if(!d(e))return b.fireEvent("chartserror"),!1;g.title=a.title||"";g.subTitle=a.subTitle||"";g.xTitle= |
|||
a.xTitle||"";g.yTitle=a.yTitle||"";g.suffix=a.suffix||"";g.tip=a.tip||"";g.dataFormat=a.tableDataFormat||"";g.chartType=a.chartType||0;for(var l in g)g.hasOwnProperty(l)&&h.push(l+":"+g[l]);e.setAttribute("data-chart",h.join(";"));f.addClass(e,"edui-charts-table")},queryCommandState:function(b,a){var e=f.findParentByTagName(this.selection.getRange().startContainer,"table",!0);return e&&d(e)?0:-1}}},inputRule:function(b){p.each(b.getNodesByTagName("table"),function(a){void 0!==a.getAttr("data-chart")&& |
|||
a.setAttr("style")})},outputRule:function(b){p.each(b.getNodesByTagName("table"),function(a){void 0!==a.getAttr("data-chart")&&a.setAttr("style","display: none;")})}}});UE.plugin.register("section",function(){function d(a){this.tag="";this.level=-1;this.parentSection=this.previousSection=this.nextSection=this.dom=null;this.startAddress=[];this.endAddress=[];this.children=[]}function b(a){var b=new d;return p.extend(b,a)}function c(a,b){for(var c=b,d=0;d<a.length;d++){if(!c.childNodes)return null; |
|||
c=c.childNodes[a[d]]}return c}var a=this;return{bindMultiEvents:{type:"aftersetcontent afterscencerestore",handler:function(){a.fireEvent("updateSections")}},bindEvents:{ready:function(){a.fireEvent("updateSections");f.on(a.body,"drop paste",function(){a.fireEvent("updateSections")})},afterexeccommand:function(b,c){"paragraph"==c&&a.fireEvent("updateSections")},keyup:function(a,b){if(1!=this.selection.getRange().collapsed)this.fireEvent("updateSections");else{var c=b.keyCode||b.which;13!=c&&8!=c&& |
|||
46!=c||this.fireEvent("updateSections")}}},commands:{getsections:{execCommand:function(a,c){function d(a,c){for(var e,h=null,k,r=a.childNodes,t=0,w=r.length;t<w;t++){k=r[t];a:{e=k;for(var B=0;B<f.length;B++)if(f[B](e)){e=B;break a}e=-1}if(0<=e){h=m.selection.getRange().selectNode(k).createAddress(!0).startAddress;h=b({tag:k.tagName,title:k.innerText||k.textContent||"",level:e,dom:k,startAddress:p.clone(h,[]),endAddress:p.clone(h,[]),children:[]});n.nextSection=h;for(k=h.previousSection=n;e<=k.level;)k= |
|||
k.parentSection;h.parentSection=k;k.children.push(h);h=n=h}else 1===k.nodeType&&d(k,c),h&&h.endAddress[h.endAddress.length-1]++}}for(var f=c||"h1 h2 h3 h4 h5 h6".split(" "),k=0;k<f.length;k++)"string"==typeof f[k]?f[k]=function(a){return function(b){return b.tagName==a.toUpperCase()}}(f[k]):"function"!=typeof f[k]&&(f[k]=function(a){return null});var m=this,n=k=b({level:-1,title:"root"});d(m.body,k);return k},notNeedUndo:!0},movesection:{execCommand:function(a,b,d,l){if(b&&d&&-1!=d.level){d=l?d.endAddress: |
|||
d.startAddress;a=c(d,this.body);var k;if(!(k=!d||!a)){k=b.startAddress;for(var m=!1,n=!1,q=0;q<k.length&&!(q>=d.length);q++)if(d[q]>k[q]){m=!0;break}else if(d[q]<k[q])break;for(q=0;q<b.endAddress.length&&!(q>=d.length);q++)if(d[q]<k[q]){n=!0;break}else if(d[q]>k[q])break;k=m&&n}if(!k){d=c(b.startAddress,this.body);b=c(b.endAddress,this.body);if(l)for(l=b;l&&!(f.getPosition(d,l)&f.POSITION_FOLLOWING);){k=l.previousSibling;f.insertAfter(a,l);if(l==d)break;l=k}else for(l=d;l&&!(f.getPosition(l,b)&f.POSITION_FOLLOWING);){k= |
|||
l.nextSibling;a.parentNode.insertBefore(l,a);if(l==b)break;l=k}this.fireEvent("updateSections")}}}},deletesection:{execCommand:function(a,b,c){function d(a){for(var b=k.body,c=0;c<a.length;c++){if(!b.childNodes)return null;b=b.childNodes[a[c]]}return b}var k=this;if(b){a=d(b.startAddress);b=d(b.endAddress);if(c)f.remove(a);else for(;a&&f.inDoc(b,k.document)&&!(f.getPosition(a,b)&f.POSITION_FOLLOWING);)c=a.nextSibling,f.remove(a),a=c;k.fireEvent("updateSections")}}},selectsection:{execCommand:function(a, |
|||
b){if(!b&&!b.dom)return!1;var c=this.selection.getRange(),d={startAddress:p.clone(b.startAddress,[]),endAddress:p.clone(b.endAddress,[])};d.endAddress[d.endAddress.length-1]++;c.moveToAddress(d).select().scrollToView();return!0},notNeedUndo:!0},scrolltosection:{execCommand:function(a,b){if(!b&&!b.dom)return!1;var c=this.selection.getRange(),d={startAddress:b.startAddress,endAddress:b.endAddress};d.endAddress[d.endAddress.length-1]++;c.moveToAddress(d).scrollToView();return!0},notNeedUndo:!0}}}}); |
|||
UE.plugin.register("simpleupload",function(){function d(){var d=a.offsetWidth||20,h=a.offsetHeight||20,g=document.createElement("iframe"),l="display:block;width:"+d+"px;height:"+h+"px;overflow:hidden;border:0;margin:0;padding:0;position:absolute;top:0;left:0;filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0;cursor:pointer;";f.on(g,"load",function(){var a=(+new Date).toString(36),m,n,q;n=g.contentDocument||g.contentWindow.document;q=n.body;m=n.createElement("div");m.innerHTML='<form id="edui_form_'+ |
|||
a+'" target="edui_iframe_'+a+'" method="POST" enctype="multipart/form-data" action="'+b.getOpt("serverUrl")+'" style="'+l+'"><input id="edui_input_'+a+'" type="file" accept="image/jpg,image/jpeg,image/png" name="'+b.options.imageFieldName+'" style="'+l+'"></form><iframe id="edui_iframe_'+a+'" name="edui_iframe_'+a+'" style="display:none;width:0;height:0;border:0;margin:0;padding:0;position:absolute;"></iframe>';m.className="edui-"+b.options.theme;m.id=b.ui.id+"_iframeupload";q.style.cssText=l;q.style.width=d+"px";q.style.height= |
|||
h+"px";q.appendChild(m);q.parentNode&&(q.parentNode.style.width=d+"px",q.parentNode.style.height=d+"px");var u=n.getElementById("edui_form_"+a),x=n.getElementById("edui_input_"+a),r=n.getElementById("edui_iframe_"+a);f.on(x,"change",function(){function a(){try{var e,g,k,h=(r.contentDocument||r.contentWindow.document).body;g=(new Function("return "+(h.innerText||h.textContent||"")))();e=b.options.imageUrlPrefix+g.url;"SUCCESS"==g.state&&g.url?(k=b.document.getElementById(d),k.setAttribute("src",e), |
|||
k.setAttribute("_src",e),k.setAttribute("title",g.title||""),k.setAttribute("alt",g.original||""),k.removeAttribute("id"),f.removeClasses(k,"loadingclass")):c&&c(g.state)}catch(n){c&&c(b.getLang("simpleupload.loadError"))}u.reset();f.un(r,"load",a)}function c(a){if(d){var e=b.document.getElementById(d);e&&f.remove(e);b.fireEvent("showmessage",{id:d,content:a,type:"error",timeout:4E3})}}if(x.value){var d="loading_"+(+new Date).toString(36),e=p.serializeParam(b.queryCommandValue("serverparam"))||"", |
|||
g=b.getActionUrl(b.getOpt("imageActionName")),k=b.getOpt("imageAllowFiles");b.focus();b.execCommand("inserthtml",'<img class="loadingclass" id="'+d+'" src="'+b.options.themePath+b.options.theme+'/images/spacer.gif" title="'+(b.getLang("simpleupload.loading")||"")+'" >');if(b.getOpt("imageActionName")){var h=x.value,h=h?h.substr(h.lastIndexOf(".")):"";!h||k&&-1==(k.join("")+".").indexOf(h.toLowerCase()+".")?c(b.getLang("simpleupload.exceedTypeError")):(f.on(r,"load",a),u.action=p.formatUrl(g+(-1== |
|||
g.indexOf("?")?"?":"&")+e),u.submit())}else errorHandler(b.getLang("autoupload.errorLoadConfig"))}});var v;b.addListener("selectionchange",function(){clearTimeout(v);v=setTimeout(function(){-1==b.queryCommandState("simpleupload")?x.disabled="disabled":x.disabled=!1},400)});c=!0});g.style.cssText=l;a.appendChild(g)}var b=this,c=!1,a;return{bindEvents:{ready:function(){p.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+ |
|||
"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}",this.document)},simpleuploadbtnready:function(c,f){a=f;b.afterConfigReady(d)}},outputRule:function(a){p.each(a.getNodesByTagName("img"), |
|||
function(a){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(a.getAttr("class"))&&a.parentNode.removeChild(a)})},commands:{simpleupload:{queryCommandState:function(){return c?0:-1}}}}});UE.plugin.register("serverparam",function(){var d={};return{commands:{serverparam:{execCommand:function(b,c,a){void 0===c||null===c?d={}:p.isString(c)?void 0===a||null===a?delete d[c]:d[c]=a:p.isObject(c)?p.extend(d,c,!0):p.isFunction(c)&&p.extend(d,c(),!0)},queryCommandValue:function(){return d||{}}}}}});UE.plugin.register("insertfile", |
|||
function(){var d=this;return{commands:{insertfile:{execCommand:function(b,c){c=p.isArray(c)?c:[c];var a,e,f,g,l="";a=d.getOpt("UEDITOR_HOME_URL");var k=a+("/"==a.substr(a.length-1)?"":"/")+"dialogs/attachment/fileTypeImages/";for(a=0;a<c.length;a++)e=c[a],f=e.url,f=f.substr(f.lastIndexOf(".")+1).toLowerCase(),g={rar:"icon_rar.gif",zip:"icon_rar.gif",tar:"icon_rar.gif",gz:"icon_rar.gif",bz2:"icon_rar.gif",doc:"icon_doc.gif",docx:"icon_doc.gif",pdf:"icon_pdf.gif",mp3:"icon_mp3.gif",xls:"icon_xls.gif", |
|||
chm:"icon_chm.gif",ppt:"icon_ppt.gif",pptx:"icon_ppt.gif",avi:"icon_mv.gif",rmvb:"icon_mv.gif",wmv:"icon_mv.gif",flv:"icon_mv.gif",swf:"icon_mv.gif",rm:"icon_mv.gif",exe:"icon_exe.gif",psd:"icon_psd.gif",txt:"icon_txt.gif",jpg:"icon_jpg.gif",png:"icon_jpg.gif",jpeg:"icon_jpg.gif",gif:"icon_jpg.gif",ico:"icon_jpg.gif",bmp:"icon_jpg.gif"},f=k+(g[f]?g[f]:g.txt),g=e.title||e.url.substr(e.url.lastIndexOf("/")+1),l+='<p style="line-height: 16px;"><img style="vertical-align: middle; margin-right: 2px;" src="'+ |
|||
f+'" _src="'+f+'" /><a style="font-size:12px; color:#0066cc;" href="'+e.url+'" title="'+g+'">'+g+"</a></p>";d.execCommand("insertHtml",l)}}}}});t=t||{};t.editor=t.editor||{};UE.ui=t.editor.ui={};(function(){function d(){var a=document.getElementById("edui_fixedlayer");f.setViewportOffset(a,{left:0,top:0})}var b=t.editor.browser,c=t.editor.dom.domUtils,a=window.$EDITORUI={},e=0,f=t.editor.ui.uiUtils={uid:function(a){return a?a.ID$EDITORUI||(a.ID$EDITORUI=++e):++e},hook:function(a,b){var c;a&&a._callbacks? |
|||
c=a:(c=function(){var b;a&&(b=a.apply(this,arguments));for(var d=c._callbacks,e=d.length;e--;){var f=d[e].apply(this,arguments);void 0===b&&(b=f)}return b},c._callbacks=[]);c._callbacks.push(b);return c},createElementByHtml:function(a){var b=document.createElement("div");b.innerHTML=a;b=b.firstChild;b.parentNode.removeChild(b);return b},getViewportElement:function(){return b.ie&&b.quirks?document.body:document.documentElement},getClientRect:function(a){var b;try{b=a.getBoundingClientRect()}catch(d){b= |
|||
{left:0,top:0,height:0,width:0}}for(var e={left:Math.round(b.left),top:Math.round(b.top),height:Math.round(b.bottom-b.top),width:Math.round(b.right-b.left)},f;(f=a.ownerDocument)!==document&&(a=c.getWindow(f).frameElement);)b=a.getBoundingClientRect(),e.left+=b.left,e.top+=b.top;e.bottom=e.top+e.height;e.right=e.left+e.width;return e},getViewportRect:function(){var a=f.getViewportElement(),b=(window.innerWidth||a.clientWidth)|0,a=(window.innerHeight||a.clientHeight)|0;return{left:0,top:0,height:a, |
|||
width:b,bottom:a,right:b}},setViewportOffset:function(a,b){var d=f.getFixedLayer();a.parentNode===d?(a.style.left=b.left+"px",a.style.top=b.top+"px"):c.setViewportOffset(a,b)},getEventOffset:function(a){var b=f.getClientRect(a.target||a.srcElement);a=f.getViewportOffsetByEvent(a);return{left:a.left-b.left,top:a.top-b.top}},getViewportOffsetByEvent:function(a){var b=a.target||a.srcElement,d=c.getWindow(b).frameElement;a={left:a.clientX,top:a.clientY};d&&b.ownerDocument!==document&&(b=f.getClientRect(d), |
|||
a.left+=b.left,a.top+=b.top);return a},setGlobal:function(b,c){a[b]=c;return'$EDITORUI["'+b+'"]'},unsetGlobal:function(b){delete a[b]},copyAttributes:function(a,d){for(var e=d.attributes,f=e.length;f--;){var h=e[f];"style"==h.nodeName||"class"==h.nodeName||b.ie&&!h.specified||a.setAttribute(h.nodeName,h.nodeValue)}d.className&&c.addClass(a,d.className);d.style.cssText&&(a.style.cssText+=";"+d.style.cssText)},removeStyle:function(a,b){if(a.style.removeProperty)a.style.removeProperty(b);else if(a.style.removeAttribute)a.style.removeAttribute(b); |
|||
else throw"";},contains:function(a,b){return a&&b&&(a===b?!1:a.contains?a.contains(b):a.compareDocumentPosition(b)&16)},startDrag:function(a,b,c){function d(a){b.ondragmove(a.clientX-e,a.clientY-f,a);a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}c=c||document;var e=a.clientX,f=a.clientY;if(c.addEventListener){var h=function(a){c.removeEventListener("mousemove",d,!0);c.removeEventListener("mouseup",h,!0);window.removeEventListener("mouseup",h,!0);b.ondragstop()};c.addEventListener("mousemove", |
|||
d,!0);c.addEventListener("mouseup",h,!0);window.addEventListener("mouseup",h,!0);a.preventDefault()}else{var p=function(){r.releaseCapture();r.detachEvent("onmousemove",d);r.detachEvent("onmouseup",p);r.detachEvent("onlosecaptrue",p);b.ondragstop()},r=a.srcElement;r.setCapture();r.attachEvent("onmousemove",d);r.attachEvent("onmouseup",p);r.attachEvent("onlosecaptrue",p);a.returnValue=!1}b.ondragstart()},getFixedLayer:function(){var a=document.getElementById("edui_fixedlayer");null==a&&(a=document.createElement("div"), |
|||
a.id="edui_fixedlayer",document.body.appendChild(a),b.ie&&8>=b.version?(a.style.position="absolute",c.on(window,"scroll",d),c.on(window,"resize",t.editor.utils.defer(d,0,!0)),setTimeout(d)):a.style.position="fixed",a.style.left="0",a.style.top="0",a.style.width="0",a.style.height="0");return a},makeUnselectable:function(a){if(b.opera||b.ie&&9>b.version){if(a.unselectable="on",a.hasChildNodes())for(var c=0;c<a.childNodes.length;c++)1==a.childNodes[c].nodeType&&f.makeUnselectable(a.childNodes[c])}else void 0!== |
|||
a.style.MozUserSelect?a.style.MozUserSelect="none":void 0!==a.style.WebkitUserSelect?a.style.WebkitUserSelect="none":void 0!==a.style.KhtmlUserSelect&&(a.style.KhtmlUserSelect="none")}}})();(function(){var d=t.editor.utils,b=t.editor.ui.uiUtils,c=t.editor.EventBase,a=t.editor.ui.UIBase=function(){};a.prototype={className:"",uiName:"",initOptions:function(a){for(var c in a)this[c]=a[c];this.id=this.id||"edui"+b.uid()},initUIBase:function(){this._globalKey=d.unhtml(b.setGlobal(this.id,this))},render:function(a){for(var c= |
|||
this.renderHtml(),c=b.createElementByHtml(c),d=f.getElementsByTagName(c,"*"),l="edui-"+(this.theme||this.editor.options.theme),k=document.getElementById("edui_fixedlayer"),m=0,n;n=d[m++];)f.addClass(n,l);f.addClass(c,l);k&&(k.className="",f.addClass(k,l));d=this.getDom();null!=d?(d.parentNode.replaceChild(c,d),b.copyAttributes(c,d)):("string"==typeof a&&(a=document.getElementById(a)),a=a||b.getFixedLayer(),f.addClass(a,l),a.appendChild(c));this.postRender()},getDom:function(a){return a?document.getElementById(this.id+ |
|||
"_"+a):document.getElementById(this.id)},postRender:function(){this.fireEvent("postrender")},getHtmlTpl:function(){return""},formatHtml:function(a){var b="edui-"+this.uiName;return a.replace(/##/g,this.id).replace(/%%-/g,this.uiName?b+"-":"").replace(/%%/g,(this.uiName?b:"")+" "+this.className).replace(/\$\$/g,this._globalKey)},renderHtml:function(){return this.formatHtml(this.getHtmlTpl())},dispose:function(){var a=this.getDom();a&&t.editor.dom.domUtils.remove(a);b.unsetGlobal(this.id)}};d.inherits(a, |
|||
c)})();(function(){var d=t.editor.utils,b=t.editor.ui.UIBase,c=t.editor.ui.Separator=function(a){this.initOptions(a);this.initSeparator()};c.prototype={uiName:"separator",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"></div>'}};d.inherits(c,b)})();(function(){var d=t.editor.utils,b=t.editor.dom.domUtils,c=t.editor.ui.UIBase,a=t.editor.ui.uiUtils,e=t.editor.ui.Mask=function(a){this.initOptions(a);this.initUIBase()};e.prototype={getHtmlTpl:function(){return'<div id="##" class="edui-mask %%" onclick="return $$._onClick(event, this);" onmousedown="return $$._onMouseDown(event, this);"></div>'}, |
|||
postRender:function(){var a=this;b.on(window,"resize",function(){setTimeout(function(){a.isHidden()||a._fill()})})},show:function(a){this._fill();this.getDom().style.display="";this.getDom().style.zIndex=a},hide:function(){this.getDom().style.display="none";this.getDom().style.zIndex=""},isHidden:function(){return"none"==this.getDom().style.display},_onMouseDown:function(){return!1},_onClick:function(a,b){this.fireEvent("click",a,b)},_fill:function(){var b=this.getDom(),c=a.getViewportRect();b.style.width= |
|||
c.width+"px";b.style.height=c.height+"px"}};d.inherits(e,c)})();(function(){function d(a,b){for(var c=0;c<g.length;c++){var d=g[c];if(!d.isHidden()&&!1!==d.queryAutoHide(b)){if(a&&/scroll/ig.test(a.type)&&"edui-wordpastepop"==d.className)return;d.hide()}}g.length&&d.editor.fireEvent("afterhidepop")}var b=t.editor.utils,c=t.editor.ui.uiUtils,a=t.editor.dom.domUtils,e=t.editor.ui.UIBase,f=t.editor.ui.Popup=function(a){this.initOptions(a);this.initPopup()},g=[];f.postHide=d;var l=["edui-anchor-topleft", |
|||
"edui-anchor-topright","edui-anchor-bottomleft","edui-anchor-bottomright"];f.prototype={SHADOW_RADIUS:5,content:null,_hidden:!1,autoRender:!0,canSideLeft:!0,canSideUp:!0,initPopup:function(){this.initUIBase();g.push(this)},getHtmlTpl:function(){return'<div id="##" class="edui-popup %%" onmousedown="return false;"> <div id="##_body" class="edui-popup-body"> <iframe style="position:absolute;z-index:-1;left:0;top:0;background-color: transparent;" frameborder="0" width="100%" height="100%" src="about:blank"></iframe> <div class="edui-shadow"></div> <div id="##_content" class="edui-popup-content">'+ |
|||
this.getContentHtmlTpl()+" </div> </div></div>"},getContentHtmlTpl:function(){return this.content?"string"==typeof this.content?this.content:this.content.renderHtml():""},_UIBase_postRender:e.prototype.postRender,postRender:function(){this.content instanceof e&&this.content.postRender();if(this.captureWheel&&!this.captured){this.captured=!0;var b=(document.documentElement.clientHeight||document.body.clientHeight)-80,d=this.getDom().offsetHeight,f=c.getClientRect(this.combox.getDom()).top,g=this.getDom("content"), |
|||
h=this.getDom("body").getElementsByTagName("iframe"),l=this;for(h.length&&(h=h[0]);f+d>b;)d-=30;g.style.height=d+"px";h&&(h.style.height=d+"px");if(window.XMLHttpRequest)a.on(g,"onmousewheel"in document.body?"mousewheel":"DOMMouseScroll",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1;g.scrollTop=a.wheelDelta?g.scrollTop-a.wheelDelta/120*60:g.scrollTop-a.detail/-3*60});else a.on(this.getDom(),"mousewheel",function(a){a.returnValue=!1;l.getDom("content").scrollTop-=a.wheelDelta/120* |
|||
60})}this.fireEvent("postRenderAfter");this.hide(!0);this._UIBase_postRender()},_doAutoRender:function(){!this.getDom()&&this.autoRender&&this.render()},mesureSize:function(){var a=this.getDom("content");return c.getClientRect(a)},fitSize:function(){if(this.captureWheel&&this.sized)return this.__size;this.sized=!0;var a=this.getDom("body");a.style.width="";a.style.height="";var b=this.mesureSize();if(this.captureWheel){a.style.width=-(-20-b.width)+"px";var c=parseInt(this.getDom("content").style.height, |
|||
10);!window.isNaN(c)&&(b.height=c)}else a.style.width=b.width+"px";a.style.height=b.height+"px";this.__size=b;this.captureWheel&&(this.getDom("content").style.overflow="auto");return b},showAnchor:function(a,b){this.showAnchorRect(c.getClientRect(a),b)},showAnchorRect:function(b,d,e){this._doAutoRender();var f=c.getViewportRect();this.getDom().style.visibility="hidden";this._show();e=this.fitSize();var g;d?(d=this.canSideLeft&&b.right+e.width>f.right&&b.left>e.width,f=this.canSideUp&&b.top+e.height> |
|||
f.bottom&&b.bottom>e.height,g=d?b.left-e.width:b.right,b=f?b.bottom-e.height:b.top):(d=this.canSideLeft&&b.right+e.width>f.right&&b.left>e.width,f=this.canSideUp&&b.top+e.height>f.bottom&&b.bottom>e.height,g=d?b.right-e.width:b.left,b=f?b.top-e.height:b.bottom);e=this.getDom();c.setViewportOffset(e,{left:g,top:b});a.removeClasses(e,l);e.className+=" "+l[2*(f?1:0)+(d?1:0)];this.editor&&(e.style.zIndex=1*this.editor.container.style.zIndex+10,t.editor.ui.uiUtils.getFixedLayer().style.zIndex=e.style.zIndex- |
|||
1);this.getDom().style.visibility="visible"},showAt:function(a){var b=a.left;a=a.top;this.showAnchorRect({left:b,top:a,right:b,bottom:a,height:0,width:0},!1,!0)},_show:function(){this._hidden&&(this.getDom().style.display="",this._hidden=!1,this.fireEvent("show"))},isHidden:function(){return this._hidden},show:function(){this._doAutoRender();this._show()},hide:function(a){!this._hidden&&this.getDom()&&(this.getDom().style.display="none",this._hidden=!0,a||this.fireEvent("hide"))},queryAutoHide:function(a){return!a|| |
|||
!c.contains(this.getDom(),a)}};b.inherits(f,e);a.on(document,"mousedown",function(a){d(a,a.target||a.srcElement)});a.on(window,"scroll",function(a,b){d(a,b)})})();(function(){var d=t.editor.utils,b=t.editor.ui.UIBase,c=t.editor.ui.ColorPicker=function(a){this.initOptions(a);this.noColorText=this.noColorText||this.editor.getLang("clearColor");this.initUIBase()};c.prototype={getHtmlTpl:function(){for(var b=this.editor,c='<div id="##" class="edui-colorpicker %%"><div class="edui-colorpicker-topbar edui-clearfix"><div unselectable="on" id="##_preview" class="edui-colorpicker-preview"></div><div unselectable="on" class="edui-colorpicker-nocolor" onclick="$$._onPickNoColor(event, this);">'+ |
|||
this.noColorText+'</div></div><table class="edui-box" style="border-collapse: collapse;" onmouseover="$$._onTableOver(event, this);" onmouseout="$$._onTableOut(event, this);" onclick="return $$._onTableClick(event, this);" cellspacing="0" cellpadding="0"><tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#39C;padding-top: 2px"><td colspan="10">'+b.getLang("themeColor")+'</td> </tr><tr class="edui-colorpicker-tablefirstrow" >',d=0;d<a.length;d++)d&&0===d%10&&(c+="</tr>"+ |
|||
(60==d?'<tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#39C;"><td colspan="10">'+b.getLang("standardColor")+"</td></tr>":"")+"<tr"+(60==d?' class="edui-colorpicker-tablefirstrow"':"")+">"),c+=70>d?'<td style="padding: 0 2px;"><a hidefocus title="'+a[d]+'" onclick="return false;" href="javascript:" unselectable="on" class="edui-box edui-colorpicker-colorcell" data-color="#'+a[d]+'" style="background-color:#'+a[d]+";border:solid #ccc;"+(10>d||60<=d?"border-width:1px;": |
|||
10<=d&&20>d?"border-width:1px 1px 0 1px;":"border-width:0 1px 0 1px;")+'"></a></td>':"";return c+"</tr></table></div>"},_onTableClick:function(a){(a=(a.target||a.srcElement).getAttribute("data-color"))&&this.fireEvent("pickcolor",a)},_onTableOver:function(a){if(a=(a.target||a.srcElement).getAttribute("data-color"))this.getDom("preview").style.backgroundColor=a},_onTableOut:function(){this.getDom("preview").style.backgroundColor=""},_onPickNoColor:function(){this.fireEvent("picknocolor")}};d.inherits(c, |
|||
b);var a="ffffff 000000 eeece1 1f497d 4f81bd c0504d 9bbb59 8064a2 4bacc6 f79646 f2f2f2 7f7f7f ddd9c3 c6d9f0 dbe5f1 f2dcdb ebf1dd e5e0ec dbeef3 fdeada d8d8d8 595959 c4bd97 8db3e2 b8cce4 e5b9b7 d7e3bc ccc1d9 b7dde8 fbd5b5 bfbfbf 3f3f3f 938953 548dd4 95b3d7 d99694 c3d69b b2a2c7 92cddc fac08f a5a5a5 262626 494429 17365d 366092 953734 76923c 5f497a 31859b e36c09 7f7f7f 0c0c0c 1d1b10 0f243e 244061 632423 4f6128 3f3151 205867 974806 c00000 ff0000 ffc000 ffff00 92d050 00b050 00b0f0 0070c0 002060 7030a0 ".split(" ")})(); |
|||
(function(){var d=t.editor.utils,b=t.editor.ui.uiUtils,c=t.editor.ui.UIBase,a=t.editor.ui.TablePicker=function(a){this.initOptions(a);this.initTablePicker()};a.prototype={defaultNumRows:10,defaultNumCols:10,maxNumRows:20,maxNumCols:20,numRows:10,numCols:10,lengthOfCellSide:22,initTablePicker:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-tablepicker %%"><div class="edui-tablepicker-body"><div class="edui-infoarea"><span id="##_label" class="edui-label"></span></div><div class="edui-pickarea" onmousemove="$$._onMouseMove(event, this);" onmouseover="$$._onMouseOver(event, this);" onmouseout="$$._onMouseOut(event, this);" onclick="$$._onClick(event, this);"><div id="##_overlay" class="edui-overlay"></div></div></div></div>'}, |
|||
_UIBase_render:c.prototype.render,render:function(a){this._UIBase_render(a);this.getDom("label").innerHTML="0"+this.editor.getLang("t_row")+" x 0"+this.editor.getLang("t_col")},_track:function(a,b){var c=this.getDom("overlay").style,d=this.lengthOfCellSide;c.width=a*d+"px";c.height=b*d+"px";this.getDom("label").innerHTML=a+this.editor.getLang("t_col")+" x "+b+this.editor.getLang("t_row");this.numCols=a;this.numRows=b},_onMouseOver:function(a,c){var d=a.relatedTarget||a.fromElement;b.contains(c,d)|| |
|||
c===d||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="")},_onMouseOut:function(a,c){var d=a.relatedTarget||a.toElement;b.contains(c,d)||c===d||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="hidden")},_onMouseMove:function(a,c){this.getDom("overlay");var d=b.getEventOffset(a),f=this.lengthOfCellSide,k=Math.ceil(d.left/ |
|||
f),d=Math.ceil(d.top/f);this._track(k,d)},_onClick:function(){this.fireEvent("picktable",this.numCols,this.numRows)}};d.inherits(a,c)})();(function(){var d=t.editor.dom.domUtils,b=t.editor.ui.uiUtils,c='onmousedown="$$.Stateful_onMouseDown(event, this);" onmouseup="$$.Stateful_onMouseUp(event, this);"'+(t.editor.browser.ie?' onmouseenter="$$.Stateful_onMouseEnter(event, this);" onmouseleave="$$.Stateful_onMouseLeave(event, this);"':' onmouseover="$$.Stateful_onMouseOver(event, this);" onmouseout="$$.Stateful_onMouseOut(event, this);"'); |
|||
t.editor.ui.Stateful={alwalysHoverable:!1,target:null,Stateful_init:function(){this._Stateful_dGetHtmlTpl=this.getHtmlTpl;this.getHtmlTpl=this.Stateful_getHtmlTpl},Stateful_getHtmlTpl:function(){return this._Stateful_dGetHtmlTpl().replace(/stateful/g,function(){return c})},Stateful_onMouseEnter:function(a,b){this.target=b;if(!this.isDisabled()||this.alwalysHoverable)this.addState("hover"),this.fireEvent("over")},Stateful_onMouseLeave:function(a,b){if(!this.isDisabled()||this.alwalysHoverable)this.removeState("hover"), |
|||
this.removeState("active"),this.fireEvent("out")},Stateful_onMouseOver:function(a,c){var d=a.relatedTarget;b.contains(c,d)||c===d||this.Stateful_onMouseEnter(a,c)},Stateful_onMouseOut:function(a,c){var d=a.relatedTarget;b.contains(c,d)||c===d||this.Stateful_onMouseLeave(a,c)},Stateful_onMouseDown:function(a,b){this.isDisabled()||this.addState("active")},Stateful_onMouseUp:function(a,b){this.isDisabled()||this.removeState("active")},Stateful_postRender:function(){this.disabled&&!this.hasState("disabled")&& |
|||
this.addState("disabled")},hasState:function(a){return d.hasClass(this.getStateDom(),"edui-state-"+a)},addState:function(a){this.hasState(a)||(this.getStateDom().className+=" edui-state-"+a)},removeState:function(a){this.hasState(a)&&d.removeClasses(this.getStateDom(),["edui-state-"+a])},getStateDom:function(){return this.getDom("state")},isChecked:function(){return this.hasState("checked")},setChecked:function(a){!this.isDisabled()&&a?this.addState("checked"):this.removeState("checked")},isDisabled:function(){return this.hasState("disabled")}, |
|||
setDisabled:function(a){a?(this.removeState("hover"),this.removeState("checked"),this.removeState("active"),this.addState("disabled")):this.removeState("disabled")}}})();(function(){var d=t.editor.utils,b=t.editor.ui.UIBase,c=t.editor.ui.Stateful,a=t.editor.ui.Button=function(a){if(a.name){var b=a.name,c=a.cssRules;a.className||(a.className="edui-for-"+b);a.cssRules=".edui-default .edui-for-"+b+" .edui-icon {"+c+"}"}this.initOptions(a);this.initButton()};a.prototype={uiName:"button",label:"",title:"", |
|||
showIcon:!0,showText:!0,cssRules:"",initButton:function(){this.initUIBase();this.Stateful_init();this.cssRules&&d.cssRule("edui-customize-"+this.name+"-style",this.cssRules)},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div id="##_state" stateful><div class="%%-wrap"><div id="##_body" unselectable="on" '+(this.title?'title="'+this.title+'"':"")+' class="%%-body" onmousedown="return $$._onMouseDown(event, this);" onclick="return $$._onClick(event, this);">'+(this.showIcon?'<div class="edui-box edui-icon"></div>': |
|||
"")+(this.showText?'<div class="edui-box edui-label">'+this.label+"</div>":"")+"</div></div></div></div>"},postRender:function(){this.Stateful_postRender();this.setDisabled(this.disabled)},_onMouseDown:function(a){a=(a=a.target||a.srcElement)&&a.tagName&&a.tagName.toLowerCase();if("input"==a||"object"==a||"object"==a)return!1},_onClick:function(){this.isDisabled()||this.fireEvent("click")},setTitle:function(a){this.getDom("label").innerHTML=a}};d.inherits(a,b);d.extend(a.prototype,c)})();(function(){var d= |
|||
t.editor.utils,b=t.editor.ui.uiUtils,c=t.editor.ui.UIBase,a=t.editor.ui.Stateful,e=t.editor.ui.SplitButton=function(a){this.initOptions(a);this.initSplitButton()};e.prototype={popup:null,uiName:"splitbutton",title:"",initSplitButton:function(){this.initUIBase();this.Stateful_init();if(null!=this.popup){var a=this.popup;this.popup=null;this.setPopup(a)}},_UIBase_postRender:c.prototype.postRender,postRender:function(){this.Stateful_postRender();this._UIBase_postRender()},setPopup:function(a){this.popup!== |
|||
a&&(null!=this.popup&&this.popup.dispose(),a.addListener("show",d.bind(this._onPopupShow,this)),a.addListener("hide",d.bind(this._onPopupHide,this)),a.addListener("postrender",d.bind(function(){a.getDom("body").appendChild(b.createElementByHtml('<div id="'+this.popup.id+'_bordereraser" class="edui-bordereraser edui-background" style="width:'+(b.getClientRect(this.getDom()).width+20)+'px"></div>'));a.getDom().className+=" "+this.className},this)),this.popup=a)},_onPopupShow:function(){this.addState("opened")}, |
|||
_onPopupHide:function(){this.removeState("opened")},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div '+(this.title?'title="'+this.title+'"':"")+' id="##_state" stateful><div class="%%-body"><div id="##_button_body" class="edui-box edui-button-body" onclick="$$._onButtonClick(event, this);"><div class="edui-box edui-icon"></div></div><div class="edui-box edui-splitborder"></div><div class="edui-box edui-arrow" onclick="$$._onArrowClick();"></div></div></div></div>'},showPopup:function(){var a= |
|||
b.getClientRect(this.getDom());a.top-=this.popup.SHADOW_RADIUS;a.height+=this.popup.SHADOW_RADIUS;this.popup.showAnchorRect(a)},_onArrowClick:function(a,b){this.isDisabled()||this.showPopup()},_onButtonClick:function(){this.isDisabled()||this.fireEvent("buttonclick")}};d.inherits(e,c);d.extend(e.prototype,a,!0)})();(function(){var d=t.editor.utils,b=t.editor.ui.uiUtils,c=t.editor.ui.ColorPicker,a=t.editor.ui.Popup,e=t.editor.ui.SplitButton,f=t.editor.ui.ColorButton=function(a){this.initOptions(a); |
|||
this.initColorButton()};f.prototype={initColorButton:function(){var b=this;this.popup=new a({content:new c({noColorText:b.editor.getLang("clearColor"),editor:b.editor,onpickcolor:function(a,c){b._onPickColor(c)},onpicknocolor:function(a,c){b._onPickNoColor(c)}}),editor:b.editor});this.initSplitButton()},_SplitButton_postRender:e.prototype.postRender,postRender:function(){this._SplitButton_postRender();this.getDom("button_body").appendChild(b.createElementByHtml('<div id="'+this.id+'_colorlump" class="edui-colorlump"></div>')); |
|||
this.getDom().className+=" edui-colorbutton"},setColor:function(a){this.color=this.getDom("colorlump").style.backgroundColor=a},_onPickColor:function(a){!1!==this.fireEvent("pickcolor",a)&&(this.setColor(a),this.popup.hide())},_onPickNoColor:function(a){!1!==this.fireEvent("picknocolor")&&this.popup.hide()}};d.inherits(f,e)})();(function(){var d=t.editor.utils,b=t.editor.ui.Popup,c=t.editor.ui.TablePicker,a=t.editor.ui.SplitButton,e=t.editor.ui.TableButton=function(a){this.initOptions(a);this.initTableButton()}; |
|||
e.prototype={initTableButton:function(){var a=this;this.popup=new b({content:new c({editor:a.editor,onpicktable:function(b,c,d){a._onPickTable(c,d)}}),editor:a.editor});this.initSplitButton()},_onPickTable:function(a,b){!1!==this.fireEvent("picktable",a,b)&&this.popup.hide()}};d.inherits(e,a)})();(function(){var d=t.editor.utils,b=t.editor.ui.UIBase,c=t.editor.ui.AutoTypeSetPicker=function(a){this.initOptions(a);this.initAutoTypeSetPicker()};c.prototype={initAutoTypeSetPicker:function(){this.initUIBase()}, |
|||
getHtmlTpl:function(){var a=this.editor,b=a.options.autotypeset,c=a.getLang("autoTypeSet"),d="textAlignValue"+a.uid,f="imageBlockLineValue"+a.uid,k="symbolConverValue"+a.uid;return'<div id="##" class="edui-autotypesetpicker %%"><div class="edui-autotypesetpicker-body"><table ><tr><td nowrap><input type="checkbox" name="mergeEmptyline" '+(b.mergeEmptyline?"checked":"")+">"+c.mergeLine+'</td><td colspan="2"><input type="checkbox" name="removeEmptyline" '+(b.removeEmptyline?"checked":"")+">"+c.delLine+ |
|||
'</td></tr><tr><td nowrap><input type="checkbox" name="removeClass" '+(b.removeClass?"checked":"")+">"+c.removeFormat+'</td><td colspan="2"><input type="checkbox" name="indent" '+(b.indent?"checked":"")+">"+c.indent+'</td></tr><tr><td nowrap><input type="checkbox" name="textAlign" '+(b.textAlign?"checked":"")+">"+c.alignment+'</td><td colspan="2" id="'+d+'"><input type="radio" name="'+d+'" value="left" '+(b.textAlign&&"left"==b.textAlign?"checked":"")+">"+a.getLang("justifyleft")+'<input type="radio" name="'+ |
|||
d+'" value="center" '+(b.textAlign&&"center"==b.textAlign?"checked":"")+">"+a.getLang("justifycenter")+'<input type="radio" name="'+d+'" value="right" '+(b.textAlign&&"right"==b.textAlign?"checked":"")+">"+a.getLang("justifyright")+'</td></tr><tr><td nowrap><input type="checkbox" name="imageBlockLine" '+(b.imageBlockLine?"checked":"")+">"+c.imageFloat+'</td><td nowrap id="'+f+'"><input type="radio" name="'+f+'" value="none" '+(b.imageBlockLine&&"none"==b.imageBlockLine?"checked":"")+">"+a.getLang("default")+ |
|||
'<input type="radio" name="'+f+'" value="left" '+(b.imageBlockLine&&"left"==b.imageBlockLine?"checked":"")+">"+a.getLang("justifyleft")+'<input type="radio" name="'+f+'" value="center" '+(b.imageBlockLine&&"center"==b.imageBlockLine?"checked":"")+">"+a.getLang("justifycenter")+'<input type="radio" name="'+f+'" value="right" '+(b.imageBlockLine&&"right"==b.imageBlockLine?"checked":"")+">"+a.getLang("justifyright")+'</td></tr><tr><td nowrap><input type="checkbox" name="clearFontSize" '+(b.clearFontSize? |
|||
"checked":"")+">"+c.removeFontsize+'</td><td colspan="2"><input type="checkbox" name="clearFontFamily" '+(b.clearFontFamily?"checked":"")+">"+c.removeFontFamily+'</td></tr><tr><td nowrap colspan="3"><input type="checkbox" name="removeEmptyNode" '+(b.removeEmptyNode?"checked":"")+">"+c.removeHtml+'</td></tr><tr><td nowrap colspan="3"><input type="checkbox" name="pasteFilter" '+(b.pasteFilter?"checked":"")+">"+c.pasteFilter+'</td></tr><tr><td nowrap><input type="checkbox" name="symbolConver" '+(b.bdc2sb|| |
|||
b.tobdc?"checked":"")+">"+c.symbol+'</td><td id="'+k+'"><input type="radio" name="bdc" value="bdc2sb" '+(b.bdc2sb?"checked":"")+">"+c.bdc2sb+'<input type="radio" name="bdc" value="tobdc" '+(b.tobdc?"checked":"")+">"+c.tobdc+'</td><td nowrap align="right"><button >'+c.run+"</button></td></tr></table></div></div>"},_UIBase_render:b.prototype.render};d.inherits(c,b)})();(function(){function d(a){for(var c={},d=a.getDom(),e=a.editor.uid,h=null,h=null,q=f.getElementsByTagName(d,"input"),u=q.length-1,p;p= |
|||
q[u--];)if(h=p.getAttribute("type"),"checkbox"==h)if(h=p.getAttribute("name"),c[h]&&delete c[h],p.checked)if(p=document.getElementById(h+"Value"+e))if(/input/ig.test(p.tagName))c[h]=p.value;else{p=p.getElementsByTagName("input");for(var r=p.length-1,v;v=p[r--];)if(v.checked){c[h]=v.value;break}}else c[h]=!0;else c[h]=!1;else c[p.getAttribute("value")]=p.checked;d=f.getElementsByTagName(d,"select");for(u=0;e=d[u++];)q=e.getAttribute("name"),c[q]=c[q]?e.value:"";b.extend(a.editor.options.autotypeset, |
|||
c);a.editor.setPreferences("autotypeset",c)}var b=t.editor.utils,c=t.editor.ui.Popup,a=t.editor.ui.AutoTypeSetPicker,e=t.editor.ui.SplitButton,h=t.editor.ui.AutoTypeSetButton=function(a){this.initOptions(a);this.initAutoTypeSetButton()};h.prototype={initAutoTypeSetButton:function(){var b=this;this.popup=new c({content:new a({editor:b.editor}),editor:b.editor,hide:function(){!this._hidden&&this.getDom()&&(d(this),this.getDom().style.display="none",this._hidden=!0,this.fireEvent("hide"))}});var e=0; |
|||
this.popup.addListener("postRenderAfter",function(){var a=this;if(!e){var c=this.getDom();c.getElementsByTagName("button")[0].onclick=function(){d(a);b.editor.execCommand("autotypeset");a.hide()};f.on(c,"click",function(c){c=c.target||c.srcElement;var e=b.editor.uid;if(c&&"INPUT"==c.tagName){if("imageBlockLine"==c.name||"textAlign"==c.name||"symbolConver"==c.name)for(var f=c.checked,h=document.getElementById(c.name+"Value"+e).getElementsByTagName("input"),l={imageBlockLine:"none",textAlign:"left", |
|||
symbolConver:"tobdc"},m=0;m<h.length;m++)f?h[m].value==l[c.name]&&(h[m].checked="checked"):h[m].checked=!1;(c.name=="imageBlockLineValue"+e||c.name=="textAlignValue"+e||"bdc"==c.name)&&(c=c.parentNode.previousSibling.getElementsByTagName("input"))&&(c[0].checked=!0);d(a)}});e=1}});this.initSplitButton()}};b.inherits(h,e)})();(function(){var d=t.editor.utils,b=t.editor.ui.Popup,c=t.editor.ui.Stateful,a=t.editor.ui.UIBase,e=t.editor.ui.CellAlignPicker=function(a){this.initOptions(a);this.initSelected(); |
|||
this.initCellAlignPicker()};e.prototype={initSelected:function(){var a={top:0,middle:1,bottom:2},b={left:0,center:1,right:2};this.selected&&(this.selectedIndex=3*a[this.selected.valign]+b[this.selected.align])},initCellAlignPicker:function(){this.initUIBase();this.Stateful_init()},getHtmlTpl:function(){for(var a=["left","center","right"],b=null,c=-1,d=[],e=0;9>e;e++)b=this.selectedIndex===e?' class="edui-cellalign-selected" ':"",c=e%3,0===c&&d.push("<tr>"),d.push('<td index="'+e+'" '+b+' stateful><div class="edui-icon edui-'+ |
|||
a[c]+'"></div></td>'),2===c&&d.push("</tr>");return'<div id="##" class="edui-cellalignpicker %%"><div class="edui-cellalignpicker-body"><table onclick="$$._onClick(event);">'+d.join("")+"</table></div></div>"},getStateDom:function(){return this.target},_onClick:function(a){var c=a.target||a.srcElement;/icon/.test(c.className)&&(this.items[c.parentNode.getAttribute("index")].onclick(),b.postHide(a))},_UIBase_render:a.prototype.render};d.inherits(e,a);d.extend(e.prototype,c,!0)})();(function(){var d= |
|||
t.editor.utils,b=t.editor.ui.Stateful,c=t.editor.ui.uiUtils,a=t.editor.ui.UIBase,e=t.editor.ui.PastePicker=function(a){this.initOptions(a);this.initPastePicker()};e.prototype={initPastePicker:function(){this.initUIBase();this.Stateful_init()},getHtmlTpl:function(){return'<div class="edui-pasteicon" onclick="$$._onClick(this)"></div><div class="edui-pastecontainer"><div class="edui-title">'+this.editor.getLang("pasteOpt")+'</div><div class="edui-button"><div title="'+this.editor.getLang("pasteSourceFormat")+ |
|||
'" onclick="$$.format(false)" stateful><div class="edui-richtxticon"></div></div><div title="'+this.editor.getLang("tagFormat")+'" onclick="$$.format(2)" stateful><div class="edui-tagicon"></div></div><div title="'+this.editor.getLang("pasteTextFormat")+'" onclick="$$.format(true)" stateful><div class="edui-plaintxticon"></div></div></div></div></div>'},getStateDom:function(){return this.target},format:function(a){this.editor.ui._isTransfer=!0;this.editor.fireEvent("pasteTransfer",a)},_onClick:function(a){var b= |
|||
f.getNextDomNode(a),d=c.getViewportRect().height,e=c.getClientRect(b);b.style.top=e.top+e.height>d?-e.height-a.offsetHeight+"px":"";/hidden/ig.test(f.getComputedStyle(b,"visibility"))?(b.style.visibility="visible",f.addClass(a,"edui-state-opened")):(b.style.visibility="hidden",f.removeClasses(a,"edui-state-opened"))},_UIBase_render:a.prototype.render};d.inherits(e,a);d.extend(e.prototype,b,!0)})();(function(){var d=t.editor.utils,b=t.editor.ui.uiUtils,c=t.editor.ui.UIBase,a=t.editor.ui.Toolbar=function(a){this.initOptions(a); |
|||
this.initToolbar()};a.prototype={items:null,initToolbar:function(){this.items=this.items||[];this.initUIBase()},add:function(a,b){void 0===b?this.items.push(a):this.items.splice(b,0,a)},getHtmlTpl:function(){for(var a=[],b=0;b<this.items.length;b++)a[b]=this.items[b].renderHtml();return'<div id="##" class="edui-toolbar %%" onselectstart="return false;" onmousedown="return $$._onMouseDown(event, this);">'+a.join("")+"</div>"},postRender:function(){for(var a=this.getDom(),c=0;c<this.items.length;c++)this.items[c].postRender(); |
|||
b.makeUnselectable(a)},_onMouseDown:function(a){a=(a=a.target||a.srcElement)&&a.tagName&&a.tagName.toLowerCase();if("input"==a||"object"==a||"object"==a)return!1}};d.inherits(a,c)})();(function(){var d=t.editor.utils,b=t.editor.dom.domUtils,c=t.editor.ui.uiUtils,a=t.editor.ui.UIBase,e=t.editor.ui.Popup,f=t.editor.ui.Stateful,g=t.editor.ui.CellAlignPicker,l=t.editor.ui.Menu=function(a){this.initOptions(a);this.initMenu()},k={renderHtml:function(){return'<div class="edui-menuitem edui-menuseparator"><div class="edui-menuseparator-inner"></div></div>'}, |
|||
postRender:function(){},queryAutoHide:function(){return!0}};l.prototype={items:null,uiName:"menu",initMenu:function(){this.items=this.items||[];this.initPopup();this.initItems()},initItems:function(){for(var a=0;a<this.items.length;a++){var b=this.items[a];"-"==b?this.items[a]=this.getSeparator():b instanceof m||(b.editor=this.editor,b.theme=this.editor.options.theme,this.items[a]=this.createItem(b))}},getSeparator:function(){return k},createItem:function(a){a.menu=this;return new m(a)},_Popup_getContentHtmlTpl:e.prototype.getContentHtmlTpl, |
|||
getContentHtmlTpl:function(){if(0==this.items.length)return this._Popup_getContentHtmlTpl();for(var a=[],b=0;b<this.items.length;b++)a[b]=this.items[b].renderHtml();return'<div class="%%-body">'+a.join("")+"</div>"},_Popup_postRender:e.prototype.postRender,postRender:function(){for(var a=this,d=0;d<this.items.length;d++){var e=this.items[d];e.ownerMenu=this;e.postRender()}b.on(this.getDom(),"mouseover",function(b){b=b||event;b=b.relatedTarget||b.fromElement;var d=a.getDom();c.contains(d,b)||d===b|| |
|||
a.fireEvent("over")});this._Popup_postRender()},queryAutoHide:function(a){if(a){if(c.contains(this.getDom(),a))return!1;for(var b=0;b<this.items.length;b++)if(!1===this.items[b].queryAutoHide(a))return!1}},clearItems:function(){for(var a=0;a<this.items.length;a++){var b=this.items[a];clearTimeout(b._showingTimer);clearTimeout(b._closingTimer);b.subMenu&&b.subMenu.destroy()}this.items=[]},destroy:function(){this.getDom()&&b.remove(this.getDom());this.clearItems()},dispose:function(){this.destroy()}}; |
|||
d.inherits(l,e);var m=t.editor.ui.MenuItem=function(a){this.initOptions(a);this.initUIBase();this.Stateful_init();if(this.subMenu&&!(this.subMenu instanceof l))if(a.className&&-1!=a.className.indexOf("aligntd")){var c=this;this.subMenu.selected=this.editor.queryCommandValue("cellalignment");this.subMenu=new e({content:new g(this.subMenu),parentMenu:c,editor:c.editor,destroy:function(){this.getDom()&&b.remove(this.getDom())}});this.subMenu.addListener("postRenderAfter",function(){b.on(this.getDom(), |
|||
"mouseover",function(){c.addState("opened")})})}else this.subMenu=new l(this.subMenu)};m.prototype={label:"",subMenu:null,ownerMenu:null,uiName:"menuitem",alwalysHoverable:!0,getHtmlTpl:function(){return'<div id="##" class="%%" stateful onclick="$$._onClick(event, this);"><div class="%%-body">'+this.renderLabelHtml()+"</div></div>"},postRender:function(){var a=this;this.addListener("over",function(){a.ownerMenu.fireEvent("submenuover",a);a.subMenu&&a.delayShowSubMenu()});this.subMenu&&(this.getDom().className+= |
|||
" edui-hassubmenu",this.subMenu.render(),this.addListener("out",function(){a.delayHideSubMenu()}),this.subMenu.addListener("over",function(){clearTimeout(a._closingTimer);a._closingTimer=null;a.addState("opened")}),this.ownerMenu.addListener("hide",function(){a.hideSubMenu()}),this.ownerMenu.addListener("submenuover",function(b,c){c!==a&&a.delayHideSubMenu()}),this.subMenu._bakQueryAutoHide=this.subMenu.queryAutoHide,this.subMenu.queryAutoHide=function(b){return b&&c.contains(a.getDom(),b)?!1:this._bakQueryAutoHide(b)}); |
|||
this.getDom().style.tabIndex="-1";c.makeUnselectable(this.getDom());this.Stateful_postRender()},delayShowSubMenu:function(){var a=this;a.isDisabled()||(a.addState("opened"),clearTimeout(a._showingTimer),clearTimeout(a._closingTimer),a._closingTimer=null,a._showingTimer=setTimeout(function(){a.showSubMenu()},250))},delayHideSubMenu:function(){var a=this;a.isDisabled()||(a.removeState("opened"),clearTimeout(a._showingTimer),a._closingTimer||(a._closingTimer=setTimeout(function(){a.hasState("opened")|| |
|||
a.hideSubMenu();a._closingTimer=null},400)))},renderLabelHtml:function(){return'<div class="edui-arrow"></div><div class="edui-box edui-icon"></div><div class="edui-box edui-label %%-label">'+(this.label||"")+"</div>"},getStateDom:function(){return this.getDom()},queryAutoHide:function(a){if(this.subMenu&&this.hasState("opened"))return this.subMenu.queryAutoHide(a)},_onClick:function(a,b){this.hasState("disabled")||!1!==this.fireEvent("click",a,b)&&(this.subMenu?this.showSubMenu():e.postHide(a))}, |
|||
showSubMenu:function(){var a=c.getClientRect(this.getDom());a.right-=5;a.left+=2;a.width-=7;a.top-=4;a.bottom+=4;a.height+=8;this.subMenu.showAnchorRect(a,!0,!0)},hideSubMenu:function(){this.subMenu.hide()}};d.inherits(m,a);d.extend(m.prototype,f,!0)})();(function(){var d=t.editor.utils,b=t.editor.ui.uiUtils,c=t.editor.ui.Menu,a=t.editor.ui.SplitButton,e=t.editor.ui.Combox=function(a){this.initOptions(a);this.initCombox()};e.prototype={uiName:"combox",onbuttonclick:function(){this.showPopup()},initCombox:function(){var a= |
|||
this;this.items=this.items||[];for(var b=0;b<this.items.length;b++){var d=this.items[b];d.uiName="listitem";d.index=b;d.onclick=function(){a.selectByIndex(this.index)}}this.popup=new c({items:this.items,uiName:"list",editor:this.editor,captureWheel:!0,combox:this});this.initSplitButton()},_SplitButton_postRender:a.prototype.postRender,postRender:function(){this._SplitButton_postRender();this.setLabel(this.label||"");this.setValue(this.initValue||"")},showPopup:function(){var a=b.getClientRect(this.getDom()); |
|||
a.top+=1;--a.bottom;a.height-=2;this.popup.showAnchorRect(a)},getValue:function(){return this.value},setValue:function(a){var b=this.indexByValue(a);-1!=b?(this.selectedIndex=b,this.setLabel(this.items[b].label),this.value=this.items[b].value):(this.selectedIndex=-1,this.setLabel(this.getLabelForUnknowValue(a)),this.value=a)},setLabel:function(a){this.label=this.getDom("button_body").innerHTML=a},getLabelForUnknowValue:function(a){return a},indexByValue:function(a){for(var b=0;b<this.items.length;b++)if(a== |
|||
this.items[b].value)return b;return-1},getItem:function(a){return this.items[a]},selectByIndex:function(a){a<this.items.length&&!1!==this.fireEvent("select",a)&&(this.selectedIndex=a,this.value=this.items[a].value,this.setLabel(this.items[a].label))}};d.inherits(e,a)})();(function(){var d=t.editor.utils,b=t.editor.dom.domUtils,c=t.editor.ui.uiUtils,a=t.editor.ui.Mask,e=t.editor.ui.UIBase,f=t.editor.ui.Button,g=t.editor.ui.Dialog=function(a){if(a.name){var b=a.name,c=a.cssRules;a.className||(a.className= |
|||
"edui-for-"+b);c&&(a.cssRules=".edui-default .edui-for-"+b+" .edui-dialog-content {"+c+"}")}this.initOptions(d.extend({autoReset:!0,draggable:!0,onok:function(){},oncancel:function(){},onclose:function(a,b){return b?this.onok():this.oncancel()},holdScroll:!1},a));this.initDialog()},l,k,m;g.prototype={draggable:!1,uiName:"dialog",initDialog:function(){var b=this,c=this.editor.options.theme;this.cssRules&&d.cssRule("edui-customize-"+this.name+"-style",this.cssRules);this.initUIBase();this.modalMask= |
|||
l||(l=new a({className:"edui-dialog-modalmask",theme:c,onclick:function(){m&&m.close(!1)}}));this.dragMask=k||(k=new a({className:"edui-dialog-dragmask",theme:c}));this.closeButton=new f({className:"edui-dialog-closebutton",title:b.closeDialog,theme:c,onclick:function(){b.close(!1)}});this.fullscreen&&this.initResizeEvent();if(this.buttons)for(c=0;c<this.buttons.length;c++)this.buttons[c]instanceof f||(this.buttons[c]=new f(d.extend(this.buttons[c],{editor:this.editor},!0)))},initResizeEvent:function(){var a= |
|||
this;b.on(window,"resize",function(){a._hidden||void 0===a._hidden||(a.__resizeTimer&&window.clearTimeout(a.__resizeTimer),a.__resizeTimer=window.setTimeout(function(){a.__resizeTimer=null;var b=a.getDom(),d=a.getDom("content"),e=UE.ui.uiUtils.getClientRect(b),f=UE.ui.uiUtils.getClientRect(d),g=c.getViewportRect();d.style.width=g.width-e.width+f.width+"px";d.style.height=g.height-e.height+f.height+"px";b.style.width=g.width+"px";b.style.height=g.height+"px";a.fireEvent("resize")},100))})},fitSize:function(){var a= |
|||
this.getDom("body"),b=this.mesureSize();a.style.width=b.width+"px";a.style.height=b.height+"px";return b},safeSetOffset:function(a){var b=this.getDom(),d=c.getViewportRect(),e=c.getClientRect(b),f=a.left;f+e.width>d.right&&(f=d.right-e.width);a=a.top;a+e.height>d.bottom&&(a=d.bottom-e.height);b.style.left=Math.max(f,0)+"px";b.style.top=Math.max(a,0)+"px"},showAtCenter:function(){var a=c.getViewportRect();if(this.fullscreen){var d=this.getDom(),e=this.getDom("content");d.style.display="block";var f= |
|||
UE.ui.uiUtils.getClientRect(d),g=UE.ui.uiUtils.getClientRect(e);d.style.left="-100000px";e.style.width=a.width-f.width+g.width+"px";e.style.height=a.height-f.height+g.height+"px";d.style.width=a.width+"px";d.style.height=a.height+"px";d.style.left=0;this._originalContext={html:{overflowX:document.documentElement.style.overflowX,overflowY:document.documentElement.style.overflowY},body:{overflowX:document.body.style.overflowX,overflowY:document.body.style.overflowY}};document.documentElement.style.overflowX= |
|||
"hidden";document.documentElement.style.overflowY="hidden";document.body.style.overflowX="hidden";document.body.style.overflowY="hidden"}else this.getDom().style.display="",e=this.fitSize(),f=this.getDom("titlebar").offsetHeight|0,d=a.width/2-e.width/2,a=a.height/2-(e.height-f)/2-f,e=this.getDom(),this.safeSetOffset({left:Math.max(d|0,0),top:Math.max(a|0,0)}),b.hasClass(e,"edui-state-centered")||(e.className+=" edui-state-centered");this._show()},getContentHtml:function(){var a="";"string"==typeof this.content? |
|||
a=this.content:this.iframeUrl&&(a='<span id="'+this.id+'_contmask" class="dialogcontmask"></span><iframe id="'+this.id+'_iframe" class="%%-iframe" height="100%" width="100%" frameborder="0" src="'+this.iframeUrl+'"></iframe>');return a},getHtmlTpl:function(){var a="";if(this.buttons){for(var a=[],b=0;b<this.buttons.length;b++)a[b]=this.buttons[b].renderHtml();a='<div class="%%-foot"><div id="##_buttons" class="%%-buttons">'+a.join("")+"</div></div>"}return'<div id="##" class="%%"><div '+(this.fullscreen? |
|||
'class="%%-wrap edui-dialog-fullscreen-flag"':'class="%%"')+'><div id="##_body" class="%%-body"><div class="%%-shadow"></div><div id="##_titlebar" class="%%-titlebar"><div class="%%-draghandle" onmousedown="$$._onTitlebarMouseDown(event, this);"><span class="%%-caption">'+(this.title||"")+"</span></div>"+this.closeButton.renderHtml()+'</div><div id="##_content" class="%%-content">'+(this.autoReset?"":this.getContentHtml())+"</div>"+a+"</div></div></div>"},postRender:function(){this.modalMask.getDom()|| |
|||
(this.modalMask.render(),this.modalMask.hide());this.dragMask.getDom()||(this.dragMask.render(),this.dragMask.hide());var a=this;this.addListener("show",function(){a.modalMask.show(this.getDom().style.zIndex-2)});this.addListener("hide",function(){a.modalMask.hide()});if(this.buttons)for(var d=0;d<this.buttons.length;d++)this.buttons[d].postRender();b.on(window,"resize",function(){setTimeout(function(){a.isHidden()||a.safeSetOffset(c.getClientRect(a.getDom()))})});this._hide()},mesureSize:function(){var a= |
|||
this.getDom("body"),b=c.getClientRect(this.getDom("content")).width;a.style.width=b;return c.getClientRect(a)},_onTitlebarMouseDown:function(a,d){if(this.draggable){var e;c.getViewportRect();var f=this;c.startDrag(a,{ondragstart:function(){e=c.getClientRect(f.getDom());f.getDom("contmask").style.visibility="visible";f.dragMask.show(f.getDom().style.zIndex-1)},ondragmove:function(a,b){f.safeSetOffset({left:e.left+a,top:e.top+b})},ondragstop:function(){f.getDom("contmask").style.visibility="hidden"; |
|||
b.removeClasses(f.getDom(),["edui-state-centered"]);f.dragMask.hide()}})}},reset:function(){this.getDom("content").innerHTML=this.getContentHtml();this.fireEvent("dialogafterreset")},_show:function(){this._hidden&&(this.getDom().style.display="",this.editor.container.style.zIndex&&(this.getDom().style.zIndex=1*this.editor.container.style.zIndex+10),this._hidden=!1,this.fireEvent("show"),t.editor.ui.uiUtils.getFixedLayer().style.zIndex=this.getDom().style.zIndex-4)},isHidden:function(){return this._hidden}, |
|||
_hide:function(){if(!this._hidden){var a=this.getDom();a.style.display="none";a.style.zIndex="";a.style.width="";a.style.height="";this._hidden=!0;this.fireEvent("hide")}},open:function(){if(this.autoReset)try{this.reset()}catch(a){this.render(),this.open()}this.showAtCenter();if(this.iframeUrl)try{this.getDom("iframe").focus()}catch(b){}m=this},_onCloseButtonClick:function(a,b){this.close(!1)},close:function(a){if(!1!==this.fireEvent("close",a)){this.fullscreen&&(document.documentElement.style.overflowX= |
|||
this._originalContext.html.overflowX,document.documentElement.style.overflowY=this._originalContext.html.overflowY,document.body.style.overflowX=this._originalContext.body.overflowX,document.body.style.overflowY=this._originalContext.body.overflowY,delete this._originalContext);this._hide();a=this.getDom("content");var c=this.getDom("iframe");a&&c&&((c=c.contentDocument||c.contentWindow.document)&&(c.body.innerHTML=""),b.remove(a))}}};d.inherits(g,e)})();(function(){var d=t.editor.utils,b=t.editor.ui.Menu, |
|||
c=t.editor.ui.SplitButton,a=t.editor.ui.MenuButton=function(a){this.initOptions(a);this.initMenuButton()};a.prototype={initMenuButton:function(){var a=this;this.uiName="menubutton";this.popup=new b({items:a.items,className:a.className,editor:a.editor});this.popup.addListener("show",function(){for(var b=0;b<this.items.length;b++)this.items[b].removeState("checked"),this.items[b].value==a._value&&(this.items[b].addState("checked"),this.value=a._value)});this.initSplitButton()},setValue:function(a){this._value= |
|||
a}};d.inherits(a,c)})();(function(){var d=t.editor.utils,b=t.editor.ui.Popup,c=t.editor.ui.SplitButton,a=t.editor.ui.MultiMenuPop=function(a){this.initOptions(a);this.initMultiMenu()};a.prototype={initMultiMenu:function(){var a=this;this.popup=new b({content:"",editor:a.editor,iframe_rendered:!1,onshow:function(){this.iframe_rendered||(this.iframe_rendered=!0,this.getDom("content").innerHTML='<iframe id="'+a.id+'_iframe" src="'+a.iframeUrl+'" frameborder="0"></iframe>',a.editor.container.style.zIndex&& |
|||
(this.getDom().style.zIndex=1*a.editor.container.style.zIndex+1))}});this.onbuttonclick=function(){this.showPopup()};this.initSplitButton()}};d.inherits(a,c)})();(function(){function d(a){if(!f.findParent(a.target||a.srcElement,function(a){return f.hasClass(a,"edui-shortcutmenu")||f.hasClass(a,"edui-popup")},!0)){a=0;for(var b;b=g[a++];)b.hide()}}var b=t.editor.ui,c=b.UIBase,a=b.uiUtils,e=t.editor.utils,f=t.editor.dom.domUtils,g=[],l,k=!1,m=b.ShortCutMenu=function(a){this.initOptions(a);this.initShortCutMenu()}; |
|||
m.postHide=d;m.prototype={isHidden:!0,SPACE:5,initShortCutMenu:function(){this.items=this.items||[];this.initUIBase();this.initItems();this.initEvent();g.push(this)},initEvent:function(){var a=this,b=a.editor.document;f.on(b,"mousemove",function(b){if(!1===a.isHidden&&!a.getSubMenuMark()&&"contextmenu"!=a.eventType){var c=!0,d=a.getDom(),e=d.offsetWidth/2+a.SPACE,f=d.offsetHeight/2,g=Math.abs(b.screenX-a.left),k=Math.abs(b.screenY-a.top);clearTimeout(l);l=setTimeout(function(){0<k&&k<f?a.setOpacity(d, |
|||
"1"):k>f&&k<f+70?(a.setOpacity(d,"0.5"),c=!1):k>f+70&&k<f+140&&a.hide();c&&0<g&&g<e?a.setOpacity(d,"1"):g>e&&g<e+70?a.setOpacity(d,"0.5"):g>e+70&&g<e+140&&a.hide()})}});if(r.chrome)f.on(b,"mouseout",function(b){b=b.relatedTarget||b.toElement;null!=b&&"HTML"!=b.tagName||a.hide()});a.editor.addListener("afterhidepop",function(){a.isHidden||(k=!0)})},initItems:function(){if(e.isArray(this.items))for(var a=0,c=this.items.length;a<c;a++){var d=this.items[a].toLowerCase();b[d]&&(this.items[a]=new b[d](this.editor), |
|||
this.items[a].className+=" edui-shortcutsubmenu ")}},setOpacity:function(a,b){r.ie&&9>r.version?a.style.filter="alpha(opacity = "+100*parseFloat(b)+");":a.style.opacity=b},getSubMenuMark:function(){k=!1;for(var b=a.getFixedLayer(),b=f.getElementsByTagName(b,"div",function(a){return f.hasClass(a,"edui-shortcutsubmenu edui-popup")}),c=0,d;d=b[c++];)"none"!=d.style.display&&(k=!0);return k},show:function(b,c){function d(a){0>a.left&&(a.left=0);0>a.top&&(a.top=0);k.style.cssText="position:absolute;left:"+ |
|||
a.left+"px;top:"+a.top+"px;"}function e(a){a.tagName||(a=a.getDom());g.left=parseInt(a.style.left);g.top=parseInt(a.style.top);g.top-=k.offsetHeight+15;d(g)}var g={},k=this.getDom(),l=a.getFixedLayer();this.eventType=b.type;k.style.cssText="display:block;left:-9999px";if("contextmenu"==b.type&&c){var m=f.getElementsByTagName(l,"div","edui-contextmenu")[0];m?e(m):this.editor.addListener("aftershowcontextmenu",function(a,b){e(b)})}else g=a.getViewportOffsetByEvent(b),g.top-=k.offsetHeight+this.SPACE, |
|||
g.left+=this.SPACE+20,d(g),this.setOpacity(k,.2);this.isHidden=!1;this.left=b.screenX+k.offsetWidth/2-this.SPACE;this.top=b.screenY-k.offsetHeight/2-this.SPACE;this.editor&&(k.style.zIndex=1*this.editor.container.style.zIndex+10,l.style.zIndex=k.style.zIndex-1)},hide:function(){this.getDom()&&(this.getDom().style.display="none");this.isHidden=!0},postRender:function(){if(e.isArray(this.items))for(var a=0,b;b=this.items[a++];)b.postRender()},getHtmlTpl:function(){var a;if(e.isArray(this.items)){a= |
|||
[];for(var b=0;b<this.items.length;b++)a[b]=this.items[b].renderHtml();a=a.join("")}else a=this.items;return'<div id="##" class="%% edui-toolbar" data-src="shortcutmenu" onmousedown="return false;" onselectstart="return false;" >'+a+"</div>"}};e.inherits(m,c);f.on(document,"mousedown",function(a){d(a)});f.on(window,"scroll",function(a){d(a)})})();(function(){var d=t.editor.utils,b=t.editor.ui.UIBase,c=t.editor.ui.Breakline=function(a){this.initOptions(a);this.initSeparator()};c.prototype={uiName:"Breakline", |
|||
initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return"<br/>"}};d.inherits(c,b)})();(function(){var d=t.editor.utils,b=t.editor.dom.domUtils,c=t.editor.ui.UIBase,a=t.editor.ui.Message=function(a){this.initOptions(a);this.initMessage()};a.prototype={initMessage:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-message %%"> <div id="##_closer" class="edui-message-closer">\u00d7</div> <div id="##_body" class="edui-message-body edui-message-type-info"> <iframe style="position:absolute;z-index:-1;left:0;top:0;background-color: transparent;" frameborder="0" width="100%" height="100%" src="about:blank"></iframe> <div class="edui-shadow"></div> <div id="##_content" class="edui-message-content"> </div> </div></div>'}, |
|||
reset:function(a){var b=this;a.keepshow||(clearTimeout(this.timer),b.timer=setTimeout(function(){b.hide()},a.timeout||4E3));void 0!==a.content&&b.setContent(a.content);void 0!==a.type&&b.setType(a.type);b.show()},postRender:function(){var a=this,c=this.getDom("closer");c&&b.on(c,"click",function(){a.hide()})},setContent:function(a){this.getDom("content").innerHTML=a},setType:function(a){a=a||"info";var b=this.getDom("body");b.className=b.className.replace(/edui-message-type-[\w-]+/,"edui-message-type-"+ |
|||
a)},getContent:function(){return this.getDom("content").innerHTML},getType:function(){var a=this.getDom("body").match(/edui-message-type-([\w-]+)/);return a?a[1]:""},show:function(){this.getDom().style.display="block"},hide:function(){var a=this.getDom();a&&(a.style.display="none",a.parentNode&&a.parentNode.removeChild(a))}};d.inherits(a,c)})();(function(){var d=t.editor.utils,b=t.editor.ui,c=b.Dialog;b.buttons={};b.Dialog=function(a){var b=new c(a);b.addListener("hide",function(){if(b.editor){var a= |
|||
b.editor;try{if(r.gecko){var c=a.window.scrollY,d=a.window.scrollX;a.body.focus();a.window.scrollTo(d,c)}else a.focus()}catch(e){}}});return b};for(var a={anchor:"~/dialogs/anchor/anchor.html",insertimage:"~/dialogs/image/image.html",link:"~/dialogs/link/link.html",spechars:"~/dialogs/spechars/spechars.html",searchreplace:"~/dialogs/searchreplace/searchreplace.html",map:"~/dialogs/map/map.html",gmap:"~/dialogs/gmap/gmap.html",insertvideo:"~/dialogs/video/video.html",help:"~/dialogs/help/help.html", |
|||
preview:"~/dialogs/preview/preview.html",emotion:"~/dialogs/emotion/emotion.html",wordimage:"~/dialogs/wordimage/wordimage.html",attachment:"~/dialogs/attachment/attachment.html",insertframe:"~/dialogs/insertframe/insertframe.html",edittip:"~/dialogs/table/edittip.html",edittable:"~/dialogs/table/edittable.html",edittd:"~/dialogs/table/edittd.html",webapp:"~/dialogs/webapp/webapp.html",snapscreen:"~/dialogs/snapscreen/snapscreen.html",scrawl:"~/dialogs/scrawl/scrawl.html",music:"~/dialogs/music/music.html", |
|||
template:"~/dialogs/template/template.html",background:"~/dialogs/background/background.html",charts:"~/dialogs/charts/charts.html"},e="undo redo formatmatch bold italic underline fontborder touppercase tolowercase strikethrough subscript superscript source indent outdent blockquote pasteplain pagebreak selectall print horizontal removeformat time date unlink insertparagraphbeforetable insertrow insertcol mergeright mergedown deleterow deletecol splittorows splittocols splittocells mergecells deletetable drafts".split(" "), |
|||
f=0,g;g=e[f++];)g=g.toLowerCase(),b[g]=function(a){return function(c){var d=new b.Button({className:"edui-for-"+a,title:c.options.labelMap[a]||c.getLang("labelMap."+a)||"",onclick:function(){c.execCommand(a)},theme:c.options.theme,showText:!1});b.buttons[a]=d;c.addListener("selectionchange",function(b,e,f){b=c.queryCommandState(a);-1==b?(d.setDisabled(!0),d.setChecked(!1)):f||(d.setDisabled(!1),d.setChecked(b))});return d}}(g);b.cleardoc=function(a){var c=new b.Button({className:"edui-for-cleardoc", |
|||
title:a.options.labelMap.cleardoc||a.getLang("labelMap.cleardoc")||"",theme:a.options.theme,onclick:function(){confirm(a.getLang("confirmClear"))&&a.execCommand("cleardoc")}});b.buttons.cleardoc=c;a.addListener("selectionchange",function(){c.setDisabled(-1==a.queryCommandState("cleardoc"))});return c};var e={justify:["left","right","center","justify"],imagefloat:["none","left","center","right"],directionality:["ltr","rtl"]},l;for(l in e)(function(a,c){for(var d=0,e;e=c[d++];)(function(c){b[a.replace("float", |
|||
"")+c]=function(d){var e=new b.Button({className:"edui-for-"+a.replace("float","")+c,title:d.options.labelMap[a.replace("float","")+c]||d.getLang("labelMap."+a.replace("float","")+c)||"",theme:d.options.theme,onclick:function(){d.execCommand(a,c)}});b.buttons[a]=e;d.addListener("selectionchange",function(b,f,g){e.setDisabled(-1==d.queryCommandState(a));e.setChecked(d.queryCommandValue(a)==c&&!g)});return e}})(e)})(l,e[l]);for(f=0;g=["backcolor","forecolor"][f++];)b[g]=function(a){return function(c){var d= |
|||
new b.ColorButton({className:"edui-for-"+a,color:"default",title:c.options.labelMap[a]||c.getLang("labelMap."+a)||"",editor:c,onpickcolor:function(b,d){c.execCommand(a,d)},onpicknocolor:function(){c.execCommand(a,"default");this.setColor("transparent");this.color="default"},onbuttonclick:function(){c.execCommand(a,this.color)}});b.buttons[a]=d;c.addListener("selectionchange",function(){d.setDisabled(-1==c.queryCommandState(a))});return d}}(g);e={noOk:["searchreplace","help","spechars","webapp","preview"], |
|||
ok:"attachment anchor link insertimage map gmap insertframe wordimage insertvideo insertframe edittip edittable edittd scrawl template music background charts".split(" ")};for(l in e)(function(c,e){for(var f=0,g;g=e[f++];)r.opera&&"searchreplace"===g||function(e){b[e]=function(f,g,h){g=g||(f.options.iframeUrlMap||{})[e]||a[e];h=f.options.labelMap[e]||f.getLang("labelMap."+e)||"";var l;g&&(l=new b.Dialog(d.extend({iframeUrl:f.ui.mapUrl(g),editor:f,className:"edui-for-"+e,title:h,holdScroll:"insertimage"=== |
|||
e,fullscreen:/charts|preview/.test(e),closeDialog:f.getLang("closeDialog")},"ok"==c?{buttons:[{className:"edui-okbutton",label:f.getLang("ok"),editor:f,onclick:function(){l.close(!0)}},{className:"edui-cancelbutton",label:f.getLang("cancel"),editor:f,onclick:function(){l.close(!1)}}]}:{})),f.ui._dialogs[e+"Dialog"]=l);var m=new b.Button({className:"edui-for-"+e,title:h,onclick:function(){if(l)switch(e){case "wordimage":var a=f.execCommand("wordimage");a&&a.length&&(l.render(),l.open());break;case "scrawl":-1!= |
|||
f.queryCommandState("scrawl")&&(l.render(),l.open());break;default:l.render(),l.open()}},theme:f.options.theme,disabled:"scrawl"==e&&-1==f.queryCommandState("scrawl")||"charts"==e});b.buttons[e]=m;f.addListener("selectionchange",function(){if(!(e in{edittable:1})){var a=f.queryCommandState(e);m.getDom()&&(m.setDisabled(-1==a),m.setChecked(a))}});return m}}(g.toLowerCase())})(l,e[l]);b.snapscreen=function(c,d,e){e=c.options.labelMap.snapscreen||c.getLang("labelMap.snapscreen")||"";var f=new b.Button({className:"edui-for-snapscreen", |
|||
title:e,onclick:function(){c.execCommand("snapscreen")},theme:c.options.theme});b.buttons.snapscreen=f;if(d=d||(c.options.iframeUrlMap||{}).snapscreen||a.snapscreen){var g=new b.Dialog({iframeUrl:c.ui.mapUrl(d),editor:c,className:"edui-for-snapscreen",title:e,buttons:[{className:"edui-okbutton",label:c.getLang("ok"),editor:c,onclick:function(){g.close(!0)}},{className:"edui-cancelbutton",label:c.getLang("cancel"),editor:c,onclick:function(){g.close(!1)}}]});g.render();c.ui._dialogs.snapscreenDialog= |
|||
g}c.addListener("selectionchange",function(){f.setDisabled(-1==c.queryCommandState("snapscreen"))});return f};b.insertcode=function(a,c,e){c=a.options.insertcode||[];e=a.options.labelMap.insertcode||a.getLang("labelMap.insertcode")||"";var f=[];d.each(c,function(b,c){f.push({label:b,value:c,theme:a.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" >'+(this.label||"")+"</div>"}})});var g=new b.Combox({editor:a,items:f,onselect:function(b,c){a.execCommand("insertcode", |
|||
this.items[c].value)},onbuttonclick:function(){this.showPopup()},title:e,initValue:e,className:"edui-for-insertcode",indexByValue:function(a){if(a)for(var b=0,c;c=this.items[b];b++)if(-1!=c.value.indexOf(a))return b;return-1}});b.buttons.insertcode=g;a.addListener("selectionchange",function(b,c,d){d||(-1==a.queryCommandState("insertcode")?g.setDisabled(!0):(g.setDisabled(!1),(b=a.queryCommandValue("insertcode"))?(b&&(b=b.replace(/['"]/g,"").split(",")[0]),g.setValue(b)):g.setValue(e)))});return g}; |
|||
b.fontfamily=function(a,c,e){c=a.options.fontfamily||[];e=a.options.labelMap.fontfamily||a.getLang("labelMap.fontfamily")||"";if(c.length){for(var f=0,g,h=[];g=c[f];f++){var l=a.getLang("fontfamily")[g.name]||"";(function(b,c){h.push({label:b,value:c,theme:a.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="font-family:'+d.unhtml(this.value)+'">'+(this.label||"")+"</div>"}})})(g.label||l,g.val)}var p=new b.Combox({editor:a,items:h,onselect:function(b,c){a.execCommand("FontFamily", |
|||
this.items[c].value)},onbuttonclick:function(){this.showPopup()},title:e,initValue:e,className:"edui-for-fontfamily",indexByValue:function(a){if(a)for(var b=0,c;c=this.items[b];b++)if(-1!=c.value.indexOf(a))return b;return-1}});b.buttons.fontfamily=p;a.addListener("selectionchange",function(b,c,d){d||(-1==a.queryCommandState("FontFamily")?p.setDisabled(!0):(p.setDisabled(!1),(b=a.queryCommandValue("FontFamily"))&&(b=b.replace(/['"]/g,"").split(",")[0]),p.setValue(b)))});return p}};b.fontsize=function(a, |
|||
c,d){d=a.options.labelMap.fontsize||a.getLang("labelMap.fontsize")||"";c=c||a.options.fontsize||[];if(c.length){for(var e=[],f=0;f<c.length;f++){var g=c[f]+"px";e.push({label:g,value:g,theme:a.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="line-height:1;font-size:'+this.value+'">'+(this.label||"")+"</div>"}})}var h=new b.Combox({editor:a,items:e,title:d,initValue:d,onselect:function(b,c){a.execCommand("FontSize",this.items[c].value)},onbuttonclick:function(){this.showPopup()}, |
|||
className:"edui-for-fontsize"});b.buttons.fontsize=h;a.addListener("selectionchange",function(b,c,d){d||(-1==a.queryCommandState("FontSize")?h.setDisabled(!0):(h.setDisabled(!1),h.setValue(a.queryCommandValue("FontSize"))))});return h}};b.paragraph=function(a,c,e){e=a.options.labelMap.paragraph||a.getLang("labelMap.paragraph")||"";c=a.options.paragraph||[];if(!d.isEmptyObject(c)){var f=[],g;for(g in c)f.push({value:g,label:c[g]||a.getLang("paragraph")[g],theme:a.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><span class="edui-for-'+ |
|||
this.value+'">'+(this.label||"")+"</span></div>"}});var h=new b.Combox({editor:a,items:f,title:e,initValue:e,className:"edui-for-paragraph",onselect:function(b,c){a.execCommand("Paragraph",this.items[c].value)},onbuttonclick:function(){this.showPopup()}});b.buttons.paragraph=h;a.addListener("selectionchange",function(b,c,d){d||(-1==a.queryCommandState("Paragraph")?h.setDisabled(!0):(h.setDisabled(!1),b=a.queryCommandValue("Paragraph"),-1!=h.indexByValue(b)?h.setValue(b):h.setValue(h.initValue)))}); |
|||
return h}};b.customstyle=function(a){var c=a.options.customstyle||[],d=a.options.labelMap.customstyle||a.getLang("labelMap.customstyle")||"";if(c.length){for(var e=a.getLang("customstyle"),f=0,g=[],h;h=c[f++];)(function(b){var c={};c.label=b.label?b.label:e[b.name];c.style=b.style;c.className=b.className;c.tag=b.tag;g.push({label:c.label,value:c,theme:a.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><'+c.tag+" "+(c.className?' class="'+c.className+'"':"")+(c.style? |
|||
' style="'+c.style+'"':"")+">"+c.label+"</"+c.tag+"></div>"}})})(h);var l=new b.Combox({editor:a,items:g,title:d,initValue:d,className:"edui-for-customstyle",onselect:function(b,c){a.execCommand("customstyle",this.items[c].value)},onbuttonclick:function(){this.showPopup()},indexByValue:function(a){for(var b=0,c;c=this.items[b++];)if(c.label==a)return b-1;return-1}});b.buttons.customstyle=l;a.addListener("selectionchange",function(b,c,d){d||(-1==a.queryCommandState("customstyle")?l.setDisabled(!0): |
|||
(l.setDisabled(!1),b=a.queryCommandValue("customstyle"),-1!=l.indexByValue(b)?l.setValue(b):l.setValue(l.initValue)))});return l}};b.inserttable=function(a,c,d){d=a.options.labelMap.inserttable||a.getLang("labelMap.inserttable")||"";var e=new b.TableButton({editor:a,title:d,className:"edui-for-inserttable",onpicktable:function(b,c,d){a.execCommand("InsertTable",{numRows:d,numCols:c,border:1})},onbuttonclick:function(){this.showPopup()}});b.buttons.inserttable=e;a.addListener("selectionchange",function(){e.setDisabled(-1== |
|||
a.queryCommandState("inserttable"))});return e};b.lineheight=function(a){var c=a.options.lineheight||[];if(c.length){for(var d=0,e,f=[];e=c[d++];)f.push({label:e,value:e,theme:a.options.theme,onclick:function(){a.execCommand("lineheight",this.value)}});var g=new b.MenuButton({editor:a,className:"edui-for-lineheight",title:a.options.labelMap.lineheight||a.getLang("labelMap.lineheight")||"",items:f,onbuttonclick:function(){var b=a.queryCommandValue("LineHeight")||this.value;a.execCommand("LineHeight", |
|||
b)}});b.buttons.lineheight=g;a.addListener("selectionchange",function(){var b=a.queryCommandState("LineHeight");if(-1==b)g.setDisabled(!0);else{g.setDisabled(!1);var c=a.queryCommandValue("LineHeight");c&&g.setValue((c+"").replace(/cm/,""));g.setChecked(b)}});return g}};l=["top","bottom"];for(e=0;f=l[e++];)(function(a){b["rowspacing"+a]=function(c){var d=c.options["rowspacing"+a]||[];if(!d.length)return null;for(var e=0,f,g=[];f=d[e++];)g.push({label:f,value:f,theme:c.options.theme,onclick:function(){c.execCommand("rowspacing", |
|||
this.value,a)}});var h=new b.MenuButton({editor:c,className:"edui-for-rowspacing"+a,title:c.options.labelMap["rowspacing"+a]||c.getLang("labelMap.rowspacing"+a)||"",items:g,onbuttonclick:function(){var b=c.queryCommandValue("rowspacing",a)||this.value;c.execCommand("rowspacing",b,a)}});b.buttons[a]=h;c.addListener("selectionchange",function(){var b=c.queryCommandState("rowspacing",a);if(-1==b)h.setDisabled(!0);else{h.setDisabled(!1);var d=c.queryCommandValue("rowspacing",a);d&&h.setValue((d+"").replace(/%/, |
|||
""));h.setChecked(b)}});return h}})(f);l=["insertorderedlist","insertunorderedlist"];for(e=0;f=l[e++];)(function(a){b[a]=function(c){var d=c.options[a],e=function(){c.execCommand(a,this.value)},f=[],g;for(g in d)f.push({label:d[g]||c.getLang()[a][g]||"",value:g,theme:c.options.theme,onclick:e});var h=new b.MenuButton({editor:c,className:"edui-for-"+a,title:c.getLang("labelMap."+a)||"",items:f,onbuttonclick:function(){var b=c.queryCommandValue(a)||this.value;c.execCommand(a,b)}});b.buttons[a]=h;c.addListener("selectionchange", |
|||
function(){var b=c.queryCommandState(a);if(-1==b)h.setDisabled(!0);else{h.setDisabled(!1);var d=c.queryCommandValue(a);h.setValue(d);h.setChecked(b)}});return h}})(f);b.fullscreen=function(a,c){c=a.options.labelMap.fullscreen||a.getLang("labelMap.fullscreen")||"";var d=new b.Button({className:"edui-for-fullscreen",title:c,theme:a.options.theme,onclick:function(){a.ui&&a.ui.setFullScreen(!a.ui.isFullScreen());this.setChecked(a.ui.isFullScreen())}});b.buttons.fullscreen=d;a.addListener("selectionchange", |
|||
function(){var b=a.queryCommandState("fullscreen");d.setDisabled(-1==b);d.setChecked(a.ui.isFullScreen())});return d};b.emotion=function(c,d){var e=new b.MultiMenuPop({title:c.options.labelMap.emotion||c.getLang("labelMap.emotion")||"",editor:c,className:"edui-for-emotion",iframeUrl:c.ui.mapUrl(d||(c.options.iframeUrlMap||{}).emotion||a.emotion)});b.buttons.emotion=e;c.addListener("selectionchange",function(){e.setDisabled(-1==c.queryCommandState("emotion"))});return e};b.autotypeset=function(a){var c= |
|||
new b.AutoTypeSetButton({editor:a,title:a.options.labelMap.autotypeset||a.getLang("labelMap.autotypeset")||"",className:"edui-for-autotypeset",onbuttonclick:function(){a.execCommand("autotypeset")}});b.buttons.autotypeset=c;a.addListener("selectionchange",function(){c.setDisabled(-1==a.queryCommandState("autotypeset"))});return c};b.simpleupload=function(a){var c=new b.Button({className:"edui-for-simpleupload",title:a.options.labelMap.simpleupload||a.getLang("labelMap.simpleupload")||"",onclick:function(){}, |
|||
theme:a.options.theme,showText:!1});b.buttons.simpleupload=c;a.addListener("ready",function(){var b=c.getDom("body").children[0];a.fireEvent("simpleuploadbtnready",b)});a.addListener("selectionchange",function(b,d,e){b=a.queryCommandState("simpleupload");-1==b?(c.setDisabled(!0),c.setChecked(!1)):e||(c.setDisabled(!1),c.setChecked(b))});return c}})();(function(){function d(a){this.initOptions(a);this.initEditorUI()}var b=t.editor.utils,c=t.editor.ui.uiUtils,a=t.editor.ui.UIBase,e=t.editor.dom.domUtils, |
|||
f=[];d.prototype={uiName:"editor",initEditorUI:function(){function a(b,c){b.setOpt({wordCount:!0,maximumWords:1E4,wordCountMsg:b.options.wordCountMsg||b.getLang("wordCountMsg"),wordOverFlowMsg:b.options.wordOverFlowMsg||b.getLang("wordOverFlowMsg")});var d=b.options,e=d.maximumWords,f=d.wordCountMsg,g=d.wordOverFlowMsg,h=c.getDom("wordcount");d.wordCount&&(d=b.getContentLength(!0),d>e?(h.innerHTML=g,b.fireEvent("wordcountoverflow")):h.innerHTML=f.replace("{#leave}",e-d).replace("{#count}",d))}this.editor.ui= |
|||
this;this._dialogs={};this.initUIBase();this._initToolbars();var b=this.editor,c=this;b.addListener("ready",function(){b.getDialog=function(a){return b.ui._dialogs[a+"Dialog"]};e.on(b.window,"scroll",function(a){t.editor.ui.Popup.postHide(a)});b.ui._actualFrameWidth=b.options.initialFrameWidth;UE.browser.ie&&6===UE.browser.version&&b.container.ownerDocument.execCommand("BackgroundImageCache",!1,!0);b.options.elementPathEnabled&&(b.ui.getDom("elementpath").innerHTML='<div class="edui-editor-breadcrumb">'+ |
|||
b.getLang("elementPathTip")+":</div>");b.options.wordCount&&(e.on(b.document,"click",function(){a(b,c);e.un(b.document,"click",arguments.callee)}),b.ui.getDom("wordcount").innerHTML=b.getLang("wordCountTip"));b.ui._scale();b.options.scaleEnabled?(b.autoHeightEnabled&&b.disableAutoHeight(),c.enableScale()):c.disableScale();b.options.elementPathEnabled||b.options.wordCount||b.options.scaleEnabled||(b.ui.getDom("elementpath").style.display="none",b.ui.getDom("wordcount").style.display="none",b.ui.getDom("scale").style.display= |
|||
"none");b.selection.isFocus()&&b.fireEvent("selectionchange",!1,!0)});b.addListener("mousedown",function(a,b){t.editor.ui.Popup.postHide(b,b.target||b.srcElement);t.editor.ui.ShortCutMenu.postHide(b)});b.addListener("delcells",function(){UE.ui.edittip&&new UE.ui.edittip(b);b.getDialog("edittip").open()});var d,f=!1,g;b.addListener("afterpaste",function(){b.queryCommandState("pasteplain")||(t.editor.ui.PastePicker&&(d=new t.editor.ui.Popup({content:new t.editor.ui.PastePicker({editor:b}),editor:b, |
|||
className:"edui-wordpastepop"}),d.render()),f=!0)});b.addListener("afterinserthtml",function(){clearTimeout(g);g=setTimeout(function(){if(d&&(f||b.ui._isTransfer)){if(d.isHidden()){var a=e.createElement(b.document,"span",{style:"line-height:0px;",innerHTML:"\ufeff"});b.selection.getRange().insertNode(a);var c=Y(a,"firstChild","previousSibling");c&&d.showAnchor(3==c.nodeType?c.parentNode:c);e.remove(a)}else d.show();delete b.ui._isTransfer;f=!1}},200)});b.addListener("contextmenu",function(a,b){t.editor.ui.Popup.postHide(b)}); |
|||
b.addListener("keydown",function(a,b){d&&d.dispose(b);var c=b.keyCode||b.which;if(b.altKey&&90==c)UE.ui.buttons.fullscreen.onclick()});b.addListener("wordcount",function(b){a(this,c)});b.addListener("selectionchange",function(){if(b.options.elementPathEnabled)c[(-1==b.queryCommandState("elementpath")?"dis":"en")+"ableElementPath"]();if(b.options.scaleEnabled)c[(-1==b.queryCommandState("scale")?"dis":"en")+"ableScale"]()});var h=new t.editor.ui.Popup({editor:b,content:"",className:"edui-bubble",_onEditButtonClick:function(){this.hide(); |
|||
b.ui._dialogs.linkDialog.open()},_onImgEditButtonClick:function(a){this.hide();b.ui._dialogs[a]&&b.ui._dialogs[a].open()},_onImgSetFloat:function(a){this.hide();b.execCommand("imagefloat",a)},_setIframeAlign:function(a){var b=h.anchorEl,c=b.cloneNode(!0);switch(a){case -2:c.setAttribute("align","");break;case -1:c.setAttribute("align","left");break;case 1:c.setAttribute("align","right")}b.parentNode.insertBefore(c,b);e.remove(b);h.anchorEl=c;h.showAnchor(h.anchorEl)},_updateIframe:function(){var a= |
|||
b._iframe=h.anchorEl;e.hasClass(a,"ueditor_baidumap")?(b.selection.getRange().selectNode(a).select(),b.ui._dialogs.mapDialog.open()):b.ui._dialogs.insertframeDialog.open();h.hide()},_onRemoveButtonClick:function(a){b.execCommand(a);this.hide()},queryAutoHide:function(a){return a&&a.ownerDocument==b.document&&("img"==a.tagName.toLowerCase()||e.findParentByTagName(a,"a",!0))?a!==h.anchorEl:t.editor.ui.Popup.prototype.queryAutoHide.call(this,a)}});h.render();b.options.imagePopup&&(b.addListener("mouseover", |
|||
function(a,c){c=c||window.event;var d=c.target||c.srcElement;if(b.ui._dialogs.insertframeDialog&&/iframe/ig.test(d.tagName)){var e=h.formatHtml("<nobr>"+b.getLang("property")+': <span onclick=$$._setIframeAlign(-2) class="edui-clickable">'+b.getLang("default")+'</span> <span onclick=$$._setIframeAlign(-1) class="edui-clickable">'+b.getLang("justifyleft")+'</span> <span onclick=$$._setIframeAlign(1) class="edui-clickable">'+b.getLang("justifyright")+'</span> <span onclick="$$._updateIframe( this);" class="edui-clickable">'+ |
|||
b.getLang("modify")+"</span></nobr>");e?(h.getDom("content").innerHTML=e,h.anchorEl=d,h.showAnchor(h.anchorEl)):h.hide()}}),b.addListener("selectionchange",function(a,c){if(c){var d="",f="",g=b.selection.getRange().getClosedNode(),f=b.ui._dialogs;if(g&&"IMG"==g.tagName){var l="insertimageDialog";if(-1!=g.className.indexOf("edui-faked-video")||-1!=g.className.indexOf("edui-upload-video"))l="insertvideoDialog";-1!=g.className.indexOf("edui-faked-webapp")&&(l="webappDialog");-1!=g.src.indexOf("http://api.map.baidu.com")&& |
|||
(l="mapDialog");-1!=g.className.indexOf("edui-faked-music")&&(l="musicDialog");-1!=g.src.indexOf("http://maps.google.com/maps/api/staticmap")&&(l="gmapDialog");g.getAttribute("anchorname")&&(l="anchorDialog",d=h.formatHtml("<nobr>"+b.getLang("property")+': <span onclick=$$._onImgEditButtonClick("anchorDialog") class="edui-clickable">'+b.getLang("modify")+"</span> <span onclick=$$._onRemoveButtonClick('anchor') class=\"edui-clickable\">"+b.getLang("delete")+"</span></nobr>"));g.getAttribute("word_img")&& |
|||
(b.word_img=[g.getAttribute("word_img")],l="wordimageDialog");if(e.hasClass(g,"loadingclass")||e.hasClass(g,"loaderrorclass"))l="";if(!f[l])return;f="<nobr>"+b.getLang("property")+': <span onclick=$$._onImgSetFloat("none") class="edui-clickable">'+b.getLang("default")+'</span> <span onclick=$$._onImgSetFloat("left") class="edui-clickable">'+b.getLang("justifyleft")+'</span> <span onclick=$$._onImgSetFloat("right") class="edui-clickable">'+b.getLang("justifyright")+'</span> <span onclick=$$._onImgSetFloat("center") class="edui-clickable">'+ |
|||
b.getLang("justifycenter")+"</span> <span onclick=\"$$._onImgEditButtonClick('"+l+'\');" class="edui-clickable">'+b.getLang("modify")+"</span></nobr>";!d&&(d=h.formatHtml(f))}if(b.ui._dialogs.linkDialog){var m=b.queryCommandValue("link"),n;m&&(n=m.getAttribute("_href")||m.getAttribute("href",2))&&(f=n,30<n.length&&(f=n.substring(0,20)+"..."),d&&(d+='<div style="height:5px;"></div>'),d+=h.formatHtml("<nobr>"+b.getLang("anthorMsg")+': <a target="_blank" href="'+n+'" title="'+n+'" >'+f+'</a> <span class="edui-clickable" onclick="$$._onEditButtonClick();">'+ |
|||
b.getLang("modify")+'</span> <span class="edui-clickable" onclick="$$._onRemoveButtonClick(\'unlink\');"> '+b.getLang("clear")+"</span></nobr>"),h.showAnchor(m))}d?(h.getDom("content").innerHTML=d,h.anchorEl=g||m,h.showAnchor(h.anchorEl)):h.hide()}}))},_initToolbars:function(){for(var a=this.editor,c=this.toolbars||[],d=[],e=0;e<c.length;e++){for(var f=c[e],g=new t.editor.ui.Toolbar({theme:a.options.theme}),h=0;h<f.length;h++){var p=f[h],r=null;if("string"==typeof p){if(p=p.toLowerCase(),"|"==p&& |
|||
(p="Separator"),"||"==p&&(p="Breakline"),t.editor.ui[p]&&(r=new t.editor.ui[p](a)),"fullscreen"==p){d&&d[0]?d[0].items.splice(0,0,r):r&&g.items.splice(0,0,r);continue}}else r=p;r&&r.id&&g.add(r)}d[e]=g}b.each(UE._customizeUI,function(b,c){var d,e;if(b.id&&b.id!=a.key)return!1;if(d=b.execFn.call(a,a,c))e=b.index,void 0===e&&(e=g.items.length),g.add(d,e)});this.toolbars=d},getHtmlTpl:function(){return'<div id="##" class="%%"><div id="##_toolbarbox" class="%%-toolbarbox">'+(this.toolbars.length?'<div id="##_toolbarboxouter" class="%%-toolbarboxouter"><div class="%%-toolbarboxinner">'+ |
|||
this.renderToolbarBoxHtml()+"</div></div>":"")+'<div id="##_toolbarmsg" class="%%-toolbarmsg" style="display:none;"><div id = "##_upload_dialog" class="%%-toolbarmsg-upload" onclick="$$.showWordImageDialog();">'+this.editor.getLang("clickToUpload")+'</div><div class="%%-toolbarmsg-close" onclick="$$.hideToolbarMsg();">x</div><div id="##_toolbarmsg_label" class="%%-toolbarmsg-label"></div><div style="height:0;overflow:hidden;clear:both;"></div></div><div id="##_message_holder" class="%%-messageholder"></div></div><div id="##_iframeholder" class="%%-iframeholder"></div><div id="##_bottombar" class="%%-bottomContainer"><table><tr><td id="##_elementpath" class="%%-bottombar"></td><td id="##_wordcount" class="%%-wordcount"></td><td id="##_scale" class="%%-scale"><div class="%%-icon"></div></td></tr></table></div><div id="##_scalelayer"></div></div>'}, |
|||
showWordImageDialog:function(){this._dialogs.wordimageDialog.open()},renderToolbarBoxHtml:function(){for(var a=[],b=0;b<this.toolbars.length;b++)a.push(this.toolbars[b].renderHtml());return a.join("")},setFullScreen:function(a){var b=this.editor,c=b.container.parentNode.parentNode;if(this._fullscreen!=a){this._fullscreen=a;this.editor.fireEvent("beforefullscreenchange",a);if(t.editor.browser.gecko)var d=b.selection.getRange().createBookmark();if(a){for(;"BODY"!=c.tagName;){var e=t.editor.dom.domUtils.getComputedStyle(c, |
|||
"position");f.push(e);c.style.position="static";c=c.parentNode}this._bakHtmlOverflow=document.documentElement.style.overflow;this._bakBodyOverflow=document.body.style.overflow;this._bakAutoHeight=this.editor.autoHeightEnabled;this._bakScrollTop=Math.max(document.documentElement.scrollTop,document.body.scrollTop);this._bakEditorContaninerWidth=b.iframe.parentNode.offsetWidth;this._bakAutoHeight&&(b.autoHeightEnabled=!1,this.editor.disableAutoHeight());document.documentElement.style.overflow="hidden"; |
|||
window.scrollTo(0,window.scrollY);this._bakCssText=this.getDom().style.cssText;this._bakCssText1=this.getDom("iframeholder").style.cssText;b.iframe.parentNode.style.width="";this._updateFullScreen()}else{for(;"BODY"!=c.tagName;)c.style.position=f.shift(),c=c.parentNode;this.getDom().style.cssText=this._bakCssText;this.getDom("iframeholder").style.cssText=this._bakCssText1;this._bakAutoHeight&&(b.autoHeightEnabled=!0,this.editor.enableAutoHeight());document.documentElement.style.overflow=this._bakHtmlOverflow; |
|||
document.body.style.overflow=this._bakBodyOverflow;b.iframe.parentNode.style.width=this._bakEditorContaninerWidth+"px";window.scrollTo(0,this._bakScrollTop)}if(r.gecko&&"true"===b.body.contentEditable){var g=document.createElement("input");document.body.appendChild(g);b.body.contentEditable=!1;setTimeout(function(){g.focus();setTimeout(function(){b.body.contentEditable=!0;b.fireEvent("fullscreenchanged",a);b.selection.getRange().moveToBookmark(d).select(!0);t.editor.dom.domUtils.remove(g);a&&window.scroll(0, |
|||
0)},0)},0)}"true"===b.body.contentEditable&&(this.editor.fireEvent("fullscreenchanged",a),this.triggerLayout())}},_updateFullScreen:function(){if(this._fullscreen){var a=c.getViewportRect();this.getDom().style.cssText="border:0;position:absolute;left:0;top:"+(this.editor.options.topOffset||0)+"px;width:"+a.width+"px;height:"+a.height+"px;z-index:"+(1*this.getDom().style.zIndex+100);c.setViewportOffset(this.getDom(),{left:0,top:this.editor.options.topOffset||0});this.editor.setHeight(a.height-this.getDom("toolbarbox").offsetHeight- |
|||
this.getDom("bottombar").offsetHeight-(this.editor.options.topOffset||0),!0);if(r.gecko)try{window.onresize()}catch(b){}}},_updateElementPath:function(){var a=this.getDom("elementpath"),b;if(this.elementPathEnabled&&(b=this.editor.queryCommandValue("elementpath"))){for(var c=[],d=0,e;e=b[d];d++)c[d]=this.formatHtml('<span unselectable="on" onclick="$$.editor.execCommand("elementpath", "'+d+'");">'+e+"</span>");a.innerHTML='<div class="edui-editor-breadcrumb" onmousedown="return false;">'+ |
|||
this.editor.getLang("elementPathTip")+": "+c.join(" > ")+"</div>"}else a.style.display="none"},disableElementPath:function(){var a=this.getDom("elementpath");a.innerHTML="";a.style.display="none";this.elementPathEnabled=!1},enableElementPath:function(){this.getDom("elementpath").style.display="";this.elementPathEnabled=!0;this._updateElementPath()},_scale:function(){function a(){J=e.getXY(h);M||(M=g.options.minFrameHeight+t.offsetHeight+w.offsetHeight);H.style.cssText="position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:"+ |
|||
h.offsetWidth+"px;height:"+h.offsetHeight+"px;z-index:"+(g.options.zIndex+1);e.on(f,"mousemove",b);e.on(p,"mouseup",c);e.on(f,"mouseup",c)}function b(a){d();a=a||window.event;U=a.pageX||f.documentElement.scrollLeft+a.clientX;A=a.pageY||f.documentElement.scrollTop+a.clientY;I=U-J.x;E=A-J.y;I>=Q&&(B=!0,H.style.width=I+"px");E>=M&&(B=!0,H.style.height=E+"px")}function c(){B&&(B=!1,g.ui._actualFrameWidth=H.offsetWidth-2,h.style.width=g.ui._actualFrameWidth+"px",g.setHeight(H.offsetHeight-w.offsetHeight- |
|||
t.offsetHeight-2,!0));H&&(H.style.display="none");d();e.un(f,"mousemove",b);e.un(p,"mouseup",c);e.un(f,"mouseup",c)}function d(){r.ie?f.selection.clear():window.getSelection().removeAllRanges()}var f=document,g=this.editor,h=g.container,p=g.document,t=this.getDom("toolbarbox"),w=this.getDom("bottombar"),F=this.getDom("scale"),H=this.getDom("scalelayer"),B=!1,J=null,M=0,Q=g.options.minFrameWidth,U=0,A=0,I=0,E=0,C=this;this.editor.addListener("fullscreenchanged",function(a,b){if(b)C.disableScale(); |
|||
else if(C.editor.options.scaleEnabled){C.enableScale();var c=C.editor.document.createElement("span");C.editor.body.appendChild(c);C.editor.body.style.height=Math.max(e.getXY(c).y,C.editor.iframe.offsetHeight-20)+"px";e.remove(c)}});this.enableScale=function(){1!=g.queryCommandState("source")&&(F.style.display="",this.scaleEnabled=!0,e.on(F,"mousedown",a))};this.disableScale=function(){F.style.display="none";this.scaleEnabled=!1;e.un(F,"mousedown",a)}},isFullScreen:function(){return this._fullscreen}, |
|||
postRender:function(){a.prototype.postRender.call(this);for(var b=0;b<this.toolbars.length;b++)this.toolbars[b].postRender();var c=this,d,e=t.editor.dom.domUtils,f=function(){clearTimeout(d);d=setTimeout(function(){c._updateFullScreen()})};e.on(window,"resize",f);c.addListener("destroy",function(){e.un(window,"resize",f);clearTimeout(d)})},showToolbarMsg:function(a,b){this.getDom("toolbarmsg_label").innerHTML=a;this.getDom("toolbarmsg").style.display="";b||(this.getDom("upload_dialog").style.display= |
|||
"none")},hideToolbarMsg:function(){this.getDom("toolbarmsg").style.display="none"},mapUrl:function(a){return a?a.replace("~/",this.editor.options.UEDITOR_HOME_URL||""):""},triggerLayout:function(){var a=this.getDom();a.style.zoom="1"==a.style.zoom?"100%":"1"}};b.inherits(d,t.editor.ui.UIBase);var g={};UE.ui.Editor=function(a){var c=new UE.Editor(a);c.options.editor=c;b.loadFile(document,{href:c.options.themePath+c.options.theme+"/css/ueditor.css",tag:"link",type:"text/css",rel:"stylesheet"});var f= |
|||
c.render;c.render=function(a){a.constructor===String&&(c.key=a,g[a]=c);b.domReady(function(){function b(){c.setOpt({labelMap:c.options.labelMap||c.getLang("labelMap")});new d(c.options);if(a&&(a.constructor===String&&(a=document.getElementById(a)),a&&a.getAttribute("name")&&(c.options.textarea=a.getAttribute("name")),a&&/script|textarea/ig.test(a.tagName))){var g=document.createElement("div");a.parentNode.insertBefore(g,a);var h=a.value||a.innerHTML;c.options.initialContent=/^[\t\r\n ]*$/.test(h)? |
|||
c.options.initialContent:h.replace(/>[\n\r\t]+([ ]{4})+/g,">").replace(/[\n\r\t]+([ ]{4})+</g,"<").replace(/>[\n\r\t]+</g,"><");a.className&&(g.className=a.className);a.style.cssText&&(g.style.cssText=a.style.cssText);/textarea/i.test(a.tagName)?(c.textarea=a,c.textarea.style.display="none"):a.parentNode.removeChild(a);a.id&&(g.id=a.id,e.removeAttributes(a,"id"));a=g;a.innerHTML=""}e.addClass(a,"edui-"+c.options.theme);c.ui.render(a);g=c.options;c.container=c.ui.getDom();for(var h=e.findParents(a, |
|||
!0),l=[],p=0,q;q=h[p];p++)l[p]=q.style.display,q.style.display="block";g.initialFrameWidth?g.minFrameWidth=g.initialFrameWidth:(g.minFrameWidth=g.initialFrameWidth=a.offsetWidth,p=a.style.width,/%$/.test(p)&&(g.initialFrameWidth=p));g.initialFrameHeight?g.minFrameHeight=g.initialFrameHeight:g.initialFrameHeight=g.minFrameHeight=a.offsetHeight;for(p=0;q=h[p];p++)q.style.display=l[p];a.style.height&&(a.style.height="");c.container.style.width=g.initialFrameWidth+(/%$/.test(g.initialFrameWidth)?"":"px"); |
|||
c.container.style.zIndex=g.zIndex;f.call(c,c.ui.getDom("iframeholder"));c.fireEvent("afteruiready")}c.langIsReady?b():c.addListener("langReady",b)})};return c};UE.getEditor=function(a,b){var c=g[a];c||(c=g[a]=new UE.ui.Editor(b),c.render(a));return c};UE.delEditor=function(a){var b;if(b=g[a])b.key&&b.destroy(),delete g[a]};UE.registerUI=function(a,c,d,e){b.each(a.split(/\s+/),function(a){UE._customizeUI[a]={id:e,execFn:c,index:d}})}})();UE.registerUI("message",function(d){function b(){var b=f.ui.getDom("toolbarbox"); |
|||
b&&(a.style.top=b.offsetHeight+3+"px");a.style.zIndex=Math.max(f.options.zIndex,f.iframe.style.zIndex)+1}var c=t.editor.ui.Message,a,e=[],f=d;f.addListener("ready",function(){a=document.getElementById(f.ui.id+"_message_holder");b();setTimeout(function(){b()},500)});f.addListener("showmessage",function(d,l){l=p.isString(l)?{content:l}:l;var k=new c({timeout:l.timeout,type:l.type,content:l.content,keepshow:l.keepshow,editor:f}),m=l.id||"msg_"+(+new Date).toString(36);k.render(a);e[m]=k;k.reset(l);b(); |
|||
return m});f.addListener("updatemessage",function(b,c,d){d=p.isString(d)?{content:d}:d;b=e[c];b.render(a);b&&b.reset(d)});f.addListener("hidemessage",function(a,b){var c=e[b];c&&c.hide()})});UE.registerUI("autosave",function(d){var b=null,c=null;d.on("afterautosave",function(){clearTimeout(b);b=setTimeout(function(){c&&d.trigger("hidemessage",c);c=d.trigger("showmessage",{content:d.getLang("autosave.success"),timeout:2E3})},2E3)})})})(); |
|||
@ -0,0 +1,413 @@ |
|||
/** |
|||
* ueditor完整配置项 |
|||
* 可以在这里配置整个编辑器的特性 |
|||
*/ |
|||
/**************************提示******************************** |
|||
* 所有被注释的配置项均为UEditor默认值。 |
|||
* 修改默认配置请首先确保已经完全明确该参数的真实用途。 |
|||
* 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。 |
|||
* 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导致脚本报错。 |
|||
**************************提示********************************/ |
|||
|
|||
(function () { |
|||
|
|||
/** |
|||
* 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。 |
|||
* 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。 |
|||
* "相对于网站根目录的相对路径"也就是以斜杠开头的形如"/myProject/ueditor/"这样的路径。 |
|||
* 如果站点中有多个不在同一层级的页面需要实例化编辑器,且引用了同一UEditor的时候,此处的URL可能不适用于每个页面的编辑器。 |
|||
* 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。 |
|||
* window.UEDITOR_HOME_URL = "/xxxx/xxxx/"; |
|||
*/ |
|||
var URL = window.UEDITOR_HOME_URL || getUEBasePath(); |
|||
|
|||
/** |
|||
* 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。 |
|||
*/ |
|||
window.UEDITOR_CONFIG = { |
|||
|
|||
//为编辑器实例添加一个路径,这个不能被注释
|
|||
UEDITOR_HOME_URL: URL |
|||
|
|||
// 服务器统一请求接口路径
|
|||
, serverUrl: URL + "../../admin/Ueditor/upload" |
|||
|
|||
//工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的从新定义
|
|||
, toolbars: [[ |
|||
'fullscreen', '|', |
|||
'bold', 'underline', 'fontborder', 'strikethrough', 'removeformat', 'formatmatch', 'pasteplain', '|', 'forecolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', '|', |
|||
'rowspacingtop', 'rowspacingbottom', 'lineheight', '|', |
|||
'fontfamily', 'fontsize', '|', |
|||
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', |
|||
'simpleupload', 'insertimage', 'emotion', 'attachment','|', |
|||
'horizontal', 'date', 'wordimage', '|', |
|||
'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown' |
|||
]] |
|||
//当鼠标放在工具栏上时显示的tooltip提示,留空支持自动多语言配置,否则以配置值为准
|
|||
//,labelMap:{
|
|||
// 'anchor':'', 'undo':''
|
|||
//}
|
|||
|
|||
//语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件:
|
|||
//lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase()
|
|||
//,lang:admin_ueditor_lang
|
|||
//,langPath:URL +"lang/"
|
|||
|
|||
//主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换,当然,前提条件是themes文件夹下存在对应的主题文件:
|
|||
//现有如下皮肤:default
|
|||
//,theme:'default'
|
|||
//,themePath:URL +"themes/"
|
|||
|
|||
//,zIndex : 900 //编辑器层级的基数,默认是900
|
|||
|
|||
//针对getAllHtml方法,会在对应的head标签中增加该编码设置。
|
|||
//,charset:"utf-8"
|
|||
|
|||
//若实例化编辑器的页面手动修改的domain,此处需要设置为true
|
|||
//,customDomain:false
|
|||
|
|||
//常用配置项目
|
|||
//,isShow : true //默认显示编辑器
|
|||
|
|||
//,textarea:'editorValue' // 提交表单时,服务器获取编辑器提交内容的所用的参数,多实例时可以给容器name属性,会将name给定的值最为每个实例的键值,不用每次实例化的时候都设置这个值
|
|||
|
|||
//,initialContent:'欢迎使用ueditor!' //初始化编辑器的内容,也可以通过textarea/script给值,看官网例子
|
|||
|
|||
,initialFrameWidth:'100%' //初始化编辑器宽度,默认1000
|
|||
//,initialFrameHeight:320 //初始化编辑器高度,默认320
|
|||
|
|||
//,autoClearinitialContent:true //是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了
|
|||
|
|||
//,focus:false //初始化时,是否让编辑器获得焦点true或false
|
|||
|
|||
//如果自定义,最好给p标签如下的行高,要不输入中文时,会有跳动感
|
|||
//,initialStyle:'p{line-height:1em}'//编辑器层级的基数,可以用来改变字体等
|
|||
|
|||
//,iframeCssUrl: URL + '/themes/iframe.css' //给编辑器内部引入一个css文件
|
|||
|
|||
//indentValue
|
|||
//首行缩进距离,默认是2em
|
|||
//,indentValue:'2em'
|
|||
|
|||
//,initialFrameWidth:1000 //初始化编辑器宽度,默认1000
|
|||
//,initialFrameHeight:320 //初始化编辑器高度,默认320
|
|||
|
|||
//,readonly : false //编辑器初始化结束后,编辑区域是否是只读的,默认是false
|
|||
|
|||
//,autoClearEmptyNode : true //getContent时,是否删除空的inlineElement节点(包括嵌套的情况)
|
|||
|
|||
//启用自动保存
|
|||
,enableAutoSave: true |
|||
//自动保存间隔时间, 单位ms
|
|||
,saveInterval: 500 |
|||
|
|||
//,fullscreen : false //是否开启初始化时即全屏,默认关闭
|
|||
|
|||
//,imagePopup:true //图片操作的浮层开关,默认打开
|
|||
|
|||
//,autoSyncData:true //自动同步编辑器要提交的数据
|
|||
//,emotionLocalization:false //是否开启表情本地化,默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹
|
|||
|
|||
//粘贴只保留标签,去除标签所有属性
|
|||
//,retainOnlyLabelPasted: false
|
|||
|
|||
//,pasteplain:false //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
|
|||
//纯文本粘贴模式下的过滤规则
|
|||
//'filterTxtRules' : function(){
|
|||
// function transP(node){
|
|||
// node.tagName = 'p';
|
|||
// node.setStyle();
|
|||
// }
|
|||
// return {
|
|||
// //直接删除及其字节点内容
|
|||
// '-' : 'script style object iframe embed input select',
|
|||
// 'p': {$:{}},
|
|||
// 'br':{$:{}},
|
|||
// 'div':{'$':{}},
|
|||
// 'li':{'$':{}},
|
|||
// 'caption':transP,
|
|||
// 'th':transP,
|
|||
// 'tr':transP,
|
|||
// 'h1':transP,'h2':transP,'h3':transP,'h4':transP,'h5':transP,'h6':transP,
|
|||
// 'td':function(node){
|
|||
// //没有内容的td直接删掉
|
|||
// var txt = !!node.innerText();
|
|||
// if(txt){
|
|||
// node.parentNode.insertAfter(UE.uNode.createText(' '),node);
|
|||
// }
|
|||
// node.parentNode.removeChild(node,node.innerText())
|
|||
// }
|
|||
// }
|
|||
//}()
|
|||
|
|||
//,allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串
|
|||
|
|||
//insertorderedlist
|
|||
//有序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准
|
|||
//,'insertorderedlist':{
|
|||
// //自定的样式
|
|||
// 'num':'1,2,3...',
|
|||
// 'num1':'1),2),3)...',
|
|||
// 'num2':'(1),(2),(3)...',
|
|||
// 'cn':'一,二,三....',
|
|||
// 'cn1':'一),二),三)....',
|
|||
// 'cn2':'(一),(二),(三)....',
|
|||
// //系统自带
|
|||
// 'decimal' : '' , //'1,2,3...'
|
|||
// 'lower-alpha' : '' , // 'a,b,c...'
|
|||
// 'lower-roman' : '' , //'i,ii,iii...'
|
|||
// 'upper-alpha' : '' , lang //'A,B,C'
|
|||
// 'upper-roman' : '' //'I,II,III...'
|
|||
//}
|
|||
|
|||
//insertunorderedlist
|
|||
//无序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准
|
|||
//,insertunorderedlist : { //自定的样式
|
|||
// 'dash' :'— 破折号', //-破折号
|
|||
// 'dot':' 。 小圆圈', //系统自带
|
|||
// 'circle' : '', // '○ 小圆圈'
|
|||
// 'disc' : '', // '● 小圆点'
|
|||
// 'square' : '' //'■ 小方块'
|
|||
//}
|
|||
//,listDefaultPaddingLeft : '30'//默认的左边缩进的基数倍
|
|||
//,listiconpath : 'http://bs.baidu.com/listicon/'//自定义标号的路径
|
|||
//,maxListLevel : 3 //限制可以tab的级数, 设置-1为不限制
|
|||
|
|||
//,autoTransWordToList:false //禁止word中粘贴进来的列表自动变成列表标签
|
|||
|
|||
//fontfamily
|
|||
//字体设置 label留空支持多语言自动切换,若配置,则以配置值为准
|
|||
//,'fontfamily':[
|
|||
// { label:'',name:'songti',val:'宋体,SimSun'},
|
|||
// { label:'',name:'kaiti',val:'楷体,楷体_GB2312, SimKai'},
|
|||
// { label:'',name:'yahei',val:'微软雅黑,Microsoft YaHei'},
|
|||
// { label:'',name:'heiti',val:'黑体, SimHei'},
|
|||
// { label:'',name:'lishu',val:'隶书, SimLi'},
|
|||
// { label:'',name:'andaleMono',val:'andale mono'},
|
|||
// { label:'',name:'arial',val:'arial, helvetica,sans-serif'},
|
|||
// { label:'',name:'arialBlack',val:'arial black,avant garde'},
|
|||
// { label:'',name:'comicSansMs',val:'comic sans ms'},
|
|||
// { label:'',name:'impact',val:'impact,chicago'},
|
|||
// { label:'',name:'timesNewRoman',val:'times new roman'}
|
|||
//]
|
|||
|
|||
//fontsize
|
|||
//字号
|
|||
//,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36]
|
|||
|
|||
//paragraph
|
|||
//段落格式 值留空时支持多语言自动识别,若配置,则以配置值为准
|
|||
//,'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''}
|
|||
|
|||
//rowspacingtop
|
|||
//段间距 值和显示的名字相同
|
|||
//,'rowspacingtop':['5', '10', '15', '20', '25']
|
|||
|
|||
//rowspacingBottom
|
|||
//段间距 值和显示的名字相同
|
|||
//,'rowspacingbottom':['5', '10', '15', '20', '25']
|
|||
|
|||
//lineheight
|
|||
//行内间距 值和显示的名字相同
|
|||
//,'lineheight':['1', '1.5','1.75','2', '3', '4', '5']
|
|||
|
|||
//customstyle
|
|||
//自定义样式,不支持国际化,此处配置值即可最后显示值
|
|||
//block的元素是依据设置段落的逻辑设置的,inline的元素依据BIU的逻辑设置
|
|||
//尽量使用一些常用的标签
|
|||
//参数说明
|
|||
//tag 使用的标签名字
|
|||
//label 显示的名字也是用来标识不同类型的标识符,注意这个值每个要不同,
|
|||
//style 添加的样式
|
|||
//每一个对象就是一个自定义的样式
|
|||
//,'customstyle':[
|
|||
// {tag:'h1', name:'tc', label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;'},
|
|||
// {tag:'h1', name:'tl',label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;margin:0 0 10px 0;'},
|
|||
// {tag:'span',name:'im', label:'', style:'font-style:italic;font-weight:bold'},
|
|||
// {tag:'span',name:'hi', label:'', style:'font-style:italic;font-weight:bold;color:rgb(51, 153, 204)'}
|
|||
//]
|
|||
|
|||
//打开右键菜单功能
|
|||
//,enableContextMenu: true
|
|||
//右键菜单的内容,可以参考plugins/contextmenu.js里边的默认菜单的例子,label留空支持国际化,否则以此配置为准
|
|||
//,contextMenu:[
|
|||
// {
|
|||
// label:'', //显示的名称
|
|||
// cmdName:'selectall',//执行的command命令,当点击这个右键菜单时
|
|||
// //exec可选,有了exec就会在点击时执行这个function,优先级高于cmdName
|
|||
// exec:function () {
|
|||
// //this是当前编辑器的实例
|
|||
// //this.ui._dialogs['inserttableDialog'].open();
|
|||
// }
|
|||
// }
|
|||
//]
|
|||
|
|||
//快捷菜单
|
|||
//,shortcutMenu:["fontfamily", "fontsize", "bold", "italic", "underline", "forecolor", "backcolor", "insertorderedlist", "insertunorderedlist"]
|
|||
|
|||
//elementPathEnabled
|
|||
//是否启用元素路径,默认是显示
|
|||
//,elementPathEnabled : true
|
|||
|
|||
//wordCount
|
|||
//,wordCount:true //是否开启字数统计
|
|||
//,maximumWords:10000 //允许的最大字符数
|
|||
//字数统计提示,{#count}代表当前字数,{#leave}代表还可以输入多少字符数,留空支持多语言自动切换,否则按此配置显示
|
|||
//,wordCountMsg:'' //当前已输入 {#count} 个字符,您还可以输入{#leave} 个字符
|
|||
//超出字数限制提示 留空支持多语言自动切换,否则按此配置显示
|
|||
//,wordOverFlowMsg:'' //<span style="color:red;">你输入的字符个数已经超出最大允许值,服务器可能会拒绝保存!</span>
|
|||
|
|||
//tab
|
|||
//点击tab键时移动的距离,tabSize倍数,tabNode什么字符做为单位
|
|||
//,tabSize:4
|
|||
//,tabNode:' '
|
|||
|
|||
//removeFormat
|
|||
//清除格式时可以删除的标签和属性
|
|||
//removeForamtTags标签
|
|||
//,removeFormatTags:'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var'
|
|||
//removeFormatAttributes属性
|
|||
//,removeFormatAttributes:'class,style,lang,width,height,align,hspace,valign'
|
|||
|
|||
//undo
|
|||
//可以最多回退的次数,默认20
|
|||
//,maxUndoCount:20
|
|||
//当输入的字符数超过该值时,保存一次现场
|
|||
//,maxInputCount:1
|
|||
|
|||
//autoHeightEnabled
|
|||
// 是否自动长高,默认true
|
|||
//,autoHeightEnabled:true
|
|||
|
|||
//scaleEnabled
|
|||
//是否可以拉伸长高,默认true(当开启时,自动长高失效)
|
|||
//,scaleEnabled:false
|
|||
//,minFrameWidth:800 //编辑器拖动时最小宽度,默认800
|
|||
//,minFrameHeight:220 //编辑器拖动时最小高度,默认220
|
|||
|
|||
//autoFloatEnabled
|
|||
//是否保持toolbar的位置不动,默认true
|
|||
,autoFloatEnabled:true |
|||
//浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面
|
|||
,topOffset:46 |
|||
//编辑器底部距离工具栏高度(如果参数大于等于编辑器高度,则设置无效)
|
|||
//,toolbarTopOffset:400
|
|||
|
|||
//pageBreakTag
|
|||
//分页标识符,默认是_ueditor_page_break_tag_
|
|||
//,pageBreakTag:'_ueditor_page_break_tag_'
|
|||
|
|||
//autotypeset
|
|||
//自动排版参数
|
|||
//,autotypeset: {
|
|||
// mergeEmptyline: true, //合并空行
|
|||
// removeClass: true, //去掉冗余的class
|
|||
// removeEmptyline: false, //去掉空行
|
|||
// textAlign:"left", //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版
|
|||
// imageBlockLine: 'center', //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版
|
|||
// pasteFilter: false, //根据规则过滤没事粘贴进来的内容
|
|||
// clearFontSize: false, //去掉所有的内嵌字号,使用编辑器默认的字号
|
|||
// clearFontFamily: false, //去掉所有的内嵌字体,使用编辑器默认的字体
|
|||
// removeEmptyNode: false, // 去掉空节点
|
|||
// //可以去掉的标签
|
|||
// removeTagNames: {标签名字:1},
|
|||
// indent: false, // 行首缩进
|
|||
// indentValue : '2em', //行首缩进的大小
|
|||
// bdc2sb: false,
|
|||
// tobdc: false
|
|||
//}
|
|||
|
|||
//tableDragable
|
|||
//表格是否可以拖拽
|
|||
//,tableDragable: true
|
|||
|
|||
//,disabledTableInTable:true //禁止表格嵌套
|
|||
|
|||
//sourceEditor
|
|||
//源码的查看方式,codemirror 是代码高亮,textarea是文本框,默认是codemirror
|
|||
//注意默认codemirror只能在ie8+和非ie中使用
|
|||
//,sourceEditor:"codemirror"
|
|||
//如果sourceEditor是codemirror,还用配置一下两个参数
|
|||
//codeMirrorJsUrl js加载的路径,默认是 URL + "third-party/codemirror/codemirror.js"
|
|||
//,codeMirrorJsUrl:URL + "third-party/codemirror/codemirror.js"
|
|||
//codeMirrorCssUrl css加载的路径,默认是 URL + "third-party/codemirror/codemirror.css"
|
|||
//,codeMirrorCssUrl:URL + "third-party/codemirror/codemirror.css"
|
|||
//编辑器初始化完成后是否进入源码模式,默认为否。
|
|||
//,sourceEditorFirst:false
|
|||
|
|||
//iframeUrlMap
|
|||
//dialog内容的路径 ~会被替换成URL,垓属性一旦打开,将覆盖所有的dialog的默认路径
|
|||
//,iframeUrlMap:{
|
|||
// 'anchor':'~/dialogs/anchor/anchor.html',
|
|||
//}
|
|||
|
|||
//webAppKey 百度应用的APIkey,每个站长必须首先去百度官网注册一个key后方能正常使用app功能,注册介绍,http://app.baidu.com/static/cms/getapikey.html
|
|||
//, webAppKey: ""
|
|||
}; |
|||
|
|||
function getUEBasePath(docUrl, confUrl) { |
|||
|
|||
return getBasePath(docUrl || self.document.URL || self.location.href, confUrl || getConfigFilePath()); |
|||
|
|||
} |
|||
|
|||
function getConfigFilePath() { |
|||
|
|||
var configPath = document.getElementsByTagName('script'); |
|||
|
|||
return configPath[ configPath.length - 1 ].src; |
|||
|
|||
} |
|||
|
|||
function getBasePath(docUrl, confUrl) { |
|||
|
|||
var basePath = confUrl; |
|||
|
|||
|
|||
if (/^(\/|\\\\)/.test(confUrl)) { |
|||
|
|||
basePath = /^.+?\w(\/|\\\\)/.exec(docUrl)[0] + confUrl.replace(/^(\/|\\\\)/, ''); |
|||
|
|||
} else if (!/^[a-z]+:/i.test(confUrl)) { |
|||
|
|||
docUrl = docUrl.split("#")[0].split("?")[0].replace(/[^\\\/]+$/, ''); |
|||
|
|||
basePath = docUrl + "" + confUrl; |
|||
|
|||
} |
|||
|
|||
return optimizationPath(basePath); |
|||
|
|||
} |
|||
|
|||
function optimizationPath(path) { |
|||
|
|||
var protocol = /^[a-z]+:\/\//.exec(path)[ 0 ], |
|||
tmp = null, |
|||
res = []; |
|||
|
|||
path = path.replace(protocol, "").split("?")[0].split("#")[0]; |
|||
|
|||
path = path.replace(/\\/g, '/').split(/\//); |
|||
|
|||
path[ path.length - 1 ] = ""; |
|||
|
|||
while (path.length) { |
|||
|
|||
if (( tmp = path.shift() ) === "..") { |
|||
res.pop(); |
|||
} else if (tmp !== ".") { |
|||
res.push(tmp); |
|||
} |
|||
|
|||
} |
|||
|
|||
return protocol + res.join("/"); |
|||
|
|||
} |
|||
|
|||
window.UE = { |
|||
getUEBasePath: getUEBasePath |
|||
}; |
|||
|
|||
})(); |
|||
@ -0,0 +1,412 @@ |
|||
/** |
|||
* ueditor完整配置项 |
|||
* 可以在这里配置整个编辑器的特性 |
|||
*/ |
|||
/**************************提示******************************** |
|||
* 所有被注释的配置项均为UEditor默认值。 |
|||
* 修改默认配置请首先确保已经完全明确该参数的真实用途。 |
|||
* 主要有两种修改方案,一种是取消此处注释,然后修改成对应参数;另一种是在实例化编辑器时传入对应参数。 |
|||
* 当升级编辑器时,可直接使用旧版配置文件替换新版配置文件,不用担心旧版配置文件中因缺少新功能所需的参数而导致脚本报错。 |
|||
**************************提示********************************/ |
|||
|
|||
(function () { |
|||
|
|||
/** |
|||
* 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。 |
|||
* 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。 |
|||
* "相对于网站根目录的相对路径"也就是以斜杠开头的形如"/myProject/ueditor/"这样的路径。 |
|||
* 如果站点中有多个不在同一层级的页面需要实例化编辑器,且引用了同一UEditor的时候,此处的URL可能不适用于每个页面的编辑器。 |
|||
* 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。 |
|||
* window.UEDITOR_HOME_URL = "/xxxx/xxxx/"; |
|||
*/ |
|||
var URL = window.UEDITOR_HOME_URL || getUEBasePath(); |
|||
|
|||
/** |
|||
* 配置项主体。注意,此处所有涉及到路径的配置别遗漏URL变量。 |
|||
*/ |
|||
window.UEDITOR_CONFIG = { |
|||
|
|||
//为编辑器实例添加一个路径,这个不能被注释
|
|||
UEDITOR_HOME_URL: URL |
|||
|
|||
// 服务器统一请求接口路径
|
|||
, serverUrl: URL + "../../admin/Ueditor/upload" |
|||
|
|||
//工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的从新定义
|
|||
, toolbars: [['fullscreen', 'source','undo', 'redo', '|', |
|||
'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|', |
|||
'fontsize', '|', |
|||
'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', |
|||
'link', 'unlink', '|','insertvideo', |
|||
'insertimage', 'emotion', 'insertcode', '|', |
|||
'horizontal', '|', |
|||
'searchreplace', 'help','drafts'] |
|||
] |
|||
//当鼠标放在工具栏上时显示的tooltip提示,留空支持自动多语言配置,否则以配置值为准
|
|||
//,labelMap:{
|
|||
// 'anchor':'', 'undo':''
|
|||
//}
|
|||
|
|||
//语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件:
|
|||
//lang值也可以通过自动获取 (navigator.language||navigator.browserLanguage ||navigator.userLanguage).toLowerCase()
|
|||
,lang:'{eq name="lang" value="zh-cn"}zh-cn{else /}en-us{/eq}' |
|||
//,langPath:URL +"lang/"
|
|||
|
|||
//主题配置项,默认是default。有需要的话也可以使用如下这样的方式来自动多主题切换,当然,前提条件是themes文件夹下存在对应的主题文件:
|
|||
//现有如下皮肤:default
|
|||
//,theme:'default'
|
|||
//,themePath:URL +"themes/"
|
|||
|
|||
//,zIndex : 900 //编辑器层级的基数,默认是900
|
|||
|
|||
//针对getAllHtml方法,会在对应的head标签中增加该编码设置。
|
|||
//,charset:"utf-8"
|
|||
|
|||
//若实例化编辑器的页面手动修改的domain,此处需要设置为true
|
|||
//,customDomain:false
|
|||
|
|||
//常用配置项目
|
|||
//,isShow : true //默认显示编辑器
|
|||
|
|||
//,textarea:'editorValue' // 提交表单时,服务器获取编辑器提交内容的所用的参数,多实例时可以给容器name属性,会将name给定的值最为每个实例的键值,不用每次实例化的时候都设置这个值
|
|||
|
|||
//,initialContent:'欢迎使用ueditor!' //初始化编辑器的内容,也可以通过textarea/script给值,看官网例子
|
|||
|
|||
,initialFrameWidth:'100%' //初始化编辑器宽度,默认1000
|
|||
//,initialFrameHeight:320 //初始化编辑器高度,默认320
|
|||
|
|||
//,autoClearinitialContent:true //是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了
|
|||
|
|||
//,focus:false //初始化时,是否让编辑器获得焦点true或false
|
|||
|
|||
//如果自定义,最好给p标签如下的行高,要不输入中文时,会有跳动感
|
|||
//,initialStyle:'p{line-height:1em}'//编辑器层级的基数,可以用来改变字体等
|
|||
|
|||
//,iframeCssUrl: URL + '/themes/iframe.css' //给编辑器内部引入一个css文件
|
|||
|
|||
//indentValue
|
|||
//首行缩进距离,默认是2em
|
|||
//,indentValue:'2em'
|
|||
|
|||
//,initialFrameWidth:1000 //初始化编辑器宽度,默认1000
|
|||
//,initialFrameHeight:320 //初始化编辑器高度,默认320
|
|||
|
|||
//,readonly : false //编辑器初始化结束后,编辑区域是否是只读的,默认是false
|
|||
|
|||
//,autoClearEmptyNode : true //getContent时,是否删除空的inlineElement节点(包括嵌套的情况)
|
|||
|
|||
//启用自动保存
|
|||
//,enableAutoSave: true
|
|||
//自动保存间隔时间, 单位ms
|
|||
//,saveInterval: 500
|
|||
|
|||
//,fullscreen : false //是否开启初始化时即全屏,默认关闭
|
|||
|
|||
//,imagePopup:true //图片操作的浮层开关,默认打开
|
|||
|
|||
//,autoSyncData:true //自动同步编辑器要提交的数据
|
|||
//,emotionLocalization:false //是否开启表情本地化,默认关闭。若要开启请确保emotion文件夹下包含官网提供的images表情文件夹
|
|||
|
|||
//粘贴只保留标签,去除标签所有属性
|
|||
//,retainOnlyLabelPasted: false
|
|||
|
|||
//,pasteplain:false //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
|
|||
//纯文本粘贴模式下的过滤规则
|
|||
//'filterTxtRules' : function(){
|
|||
// function transP(node){
|
|||
// node.tagName = 'p';
|
|||
// node.setStyle();
|
|||
// }
|
|||
// return {
|
|||
// //直接删除及其字节点内容
|
|||
// '-' : 'script style object iframe embed input select',
|
|||
// 'p': {$:{}},
|
|||
// 'br':{$:{}},
|
|||
// 'div':{'$':{}},
|
|||
// 'li':{'$':{}},
|
|||
// 'caption':transP,
|
|||
// 'th':transP,
|
|||
// 'tr':transP,
|
|||
// 'h1':transP,'h2':transP,'h3':transP,'h4':transP,'h5':transP,'h6':transP,
|
|||
// 'td':function(node){
|
|||
// //没有内容的td直接删掉
|
|||
// var txt = !!node.innerText();
|
|||
// if(txt){
|
|||
// node.parentNode.insertAfter(UE.uNode.createText(' '),node);
|
|||
// }
|
|||
// node.parentNode.removeChild(node,node.innerText())
|
|||
// }
|
|||
// }
|
|||
//}()
|
|||
|
|||
//,allHtmlEnabled:false //提交到后台的数据是否包含整个html字符串
|
|||
|
|||
//insertorderedlist
|
|||
//有序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准
|
|||
//,'insertorderedlist':{
|
|||
// //自定的样式
|
|||
// 'num':'1,2,3...',
|
|||
// 'num1':'1),2),3)...',
|
|||
// 'num2':'(1),(2),(3)...',
|
|||
// 'cn':'一,二,三....',
|
|||
// 'cn1':'一),二),三)....',
|
|||
// 'cn2':'(一),(二),(三)....',
|
|||
// //系统自带
|
|||
// 'decimal' : '' , //'1,2,3...'
|
|||
// 'lower-alpha' : '' , // 'a,b,c...'
|
|||
// 'lower-roman' : '' , //'i,ii,iii...'
|
|||
// 'upper-alpha' : '' , lang //'A,B,C'
|
|||
// 'upper-roman' : '' //'I,II,III...'
|
|||
//}
|
|||
|
|||
//insertunorderedlist
|
|||
//无序列表的下拉配置,值留空时支持多语言自动识别,若配置值,则以此值为准
|
|||
//,insertunorderedlist : { //自定的样式
|
|||
// 'dash' :'— 破折号', //-破折号
|
|||
// 'dot':' 。 小圆圈', //系统自带
|
|||
// 'circle' : '', // '○ 小圆圈'
|
|||
// 'disc' : '', // '● 小圆点'
|
|||
// 'square' : '' //'■ 小方块'
|
|||
//}
|
|||
//,listDefaultPaddingLeft : '30'//默认的左边缩进的基数倍
|
|||
//,listiconpath : 'http://bs.baidu.com/listicon/'//自定义标号的路径
|
|||
//,maxListLevel : 3 //限制可以tab的级数, 设置-1为不限制
|
|||
|
|||
//,autoTransWordToList:false //禁止word中粘贴进来的列表自动变成列表标签
|
|||
|
|||
//fontfamily
|
|||
//字体设置 label留空支持多语言自动切换,若配置,则以配置值为准
|
|||
//,'fontfamily':[
|
|||
// { label:'',name:'songti',val:'宋体,SimSun'},
|
|||
// { label:'',name:'kaiti',val:'楷体,楷体_GB2312, SimKai'},
|
|||
// { label:'',name:'yahei',val:'微软雅黑,Microsoft YaHei'},
|
|||
// { label:'',name:'heiti',val:'黑体, SimHei'},
|
|||
// { label:'',name:'lishu',val:'隶书, SimLi'},
|
|||
// { label:'',name:'andaleMono',val:'andale mono'},
|
|||
// { label:'',name:'arial',val:'arial, helvetica,sans-serif'},
|
|||
// { label:'',name:'arialBlack',val:'arial black,avant garde'},
|
|||
// { label:'',name:'comicSansMs',val:'comic sans ms'},
|
|||
// { label:'',name:'impact',val:'impact,chicago'},
|
|||
// { label:'',name:'timesNewRoman',val:'times new roman'}
|
|||
//]
|
|||
|
|||
//fontsize
|
|||
//字号
|
|||
//,'fontsize':[10, 11, 12, 14, 16, 18, 20, 24, 36]
|
|||
|
|||
//paragraph
|
|||
//段落格式 值留空时支持多语言自动识别,若配置,则以配置值为准
|
|||
//,'paragraph':{'p':'', 'h1':'', 'h2':'', 'h3':'', 'h4':'', 'h5':'', 'h6':''}
|
|||
|
|||
//rowspacingtop
|
|||
//段间距 值和显示的名字相同
|
|||
//,'rowspacingtop':['5', '10', '15', '20', '25']
|
|||
|
|||
//rowspacingBottom
|
|||
//段间距 值和显示的名字相同
|
|||
//,'rowspacingbottom':['5', '10', '15', '20', '25']
|
|||
|
|||
//lineheight
|
|||
//行内间距 值和显示的名字相同
|
|||
//,'lineheight':['1', '1.5','1.75','2', '3', '4', '5']
|
|||
|
|||
//customstyle
|
|||
//自定义样式,不支持国际化,此处配置值即可最后显示值
|
|||
//block的元素是依据设置段落的逻辑设置的,inline的元素依据BIU的逻辑设置
|
|||
//尽量使用一些常用的标签
|
|||
//参数说明
|
|||
//tag 使用的标签名字
|
|||
//label 显示的名字也是用来标识不同类型的标识符,注意这个值每个要不同,
|
|||
//style 添加的样式
|
|||
//每一个对象就是一个自定义的样式
|
|||
//,'customstyle':[
|
|||
// {tag:'h1', name:'tc', label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;'},
|
|||
// {tag:'h1', name:'tl',label:'', style:'border-bottom:#ccc 2px solid;padding:0 4px 0 0;margin:0 0 10px 0;'},
|
|||
// {tag:'span',name:'im', label:'', style:'font-style:italic;font-weight:bold'},
|
|||
// {tag:'span',name:'hi', label:'', style:'font-style:italic;font-weight:bold;color:rgb(51, 153, 204)'}
|
|||
//]
|
|||
|
|||
//打开右键菜单功能
|
|||
//,enableContextMenu: true
|
|||
//右键菜单的内容,可以参考plugins/contextmenu.js里边的默认菜单的例子,label留空支持国际化,否则以此配置为准
|
|||
//,contextMenu:[
|
|||
// {
|
|||
// label:'', //显示的名称
|
|||
// cmdName:'selectall',//执行的command命令,当点击这个右键菜单时
|
|||
// //exec可选,有了exec就会在点击时执行这个function,优先级高于cmdName
|
|||
// exec:function () {
|
|||
// //this是当前编辑器的实例
|
|||
// //this.ui._dialogs['inserttableDialog'].open();
|
|||
// }
|
|||
// }
|
|||
//]
|
|||
|
|||
//快捷菜单
|
|||
//,shortcutMenu:["fontfamily", "fontsize", "bold", "italic", "underline", "forecolor", "backcolor", "insertorderedlist", "insertunorderedlist"]
|
|||
|
|||
//elementPathEnabled
|
|||
//是否启用元素路径,默认是显示
|
|||
//,elementPathEnabled : true
|
|||
|
|||
//wordCount
|
|||
//,wordCount:true //是否开启字数统计
|
|||
//,maximumWords:10000 //允许的最大字符数
|
|||
//字数统计提示,{#count}代表当前字数,{#leave}代表还可以输入多少字符数,留空支持多语言自动切换,否则按此配置显示
|
|||
//,wordCountMsg:'' //当前已输入 {#count} 个字符,您还可以输入{#leave} 个字符
|
|||
//超出字数限制提示 留空支持多语言自动切换,否则按此配置显示
|
|||
//,wordOverFlowMsg:'' //<span style="color:red;">你输入的字符个数已经超出最大允许值,服务器可能会拒绝保存!</span>
|
|||
|
|||
//tab
|
|||
//点击tab键时移动的距离,tabSize倍数,tabNode什么字符做为单位
|
|||
//,tabSize:4
|
|||
//,tabNode:' '
|
|||
|
|||
//removeFormat
|
|||
//清除格式时可以删除的标签和属性
|
|||
//removeForamtTags标签
|
|||
//,removeFormatTags:'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var'
|
|||
//removeFormatAttributes属性
|
|||
//,removeFormatAttributes:'class,style,lang,width,height,align,hspace,valign'
|
|||
|
|||
//undo
|
|||
//可以最多回退的次数,默认20
|
|||
//,maxUndoCount:20
|
|||
//当输入的字符数超过该值时,保存一次现场
|
|||
//,maxInputCount:1
|
|||
|
|||
//autoHeightEnabled
|
|||
// 是否自动长高,默认true
|
|||
//,autoHeightEnabled:true
|
|||
|
|||
//scaleEnabled
|
|||
//是否可以拉伸长高,默认true(当开启时,自动长高失效)
|
|||
//,scaleEnabled:false
|
|||
//,minFrameWidth:800 //编辑器拖动时最小宽度,默认800
|
|||
//,minFrameHeight:220 //编辑器拖动时最小高度,默认220
|
|||
|
|||
//autoFloatEnabled
|
|||
//是否保持toolbar的位置不动,默认true
|
|||
//,autoFloatEnabled:true
|
|||
//浮动时工具栏距离浏览器顶部的高度,用于某些具有固定头部的页面
|
|||
//,topOffset:30
|
|||
//编辑器底部距离工具栏高度(如果参数大于等于编辑器高度,则设置无效)
|
|||
//,toolbarTopOffset:400
|
|||
|
|||
//pageBreakTag
|
|||
//分页标识符,默认是_ueditor_page_break_tag_
|
|||
//,pageBreakTag:'_ueditor_page_break_tag_'
|
|||
|
|||
//autotypeset
|
|||
//自动排版参数
|
|||
//,autotypeset: {
|
|||
// mergeEmptyline: true, //合并空行
|
|||
// removeClass: true, //去掉冗余的class
|
|||
// removeEmptyline: false, //去掉空行
|
|||
// textAlign:"left", //段落的排版方式,可以是 left,right,center,justify 去掉这个属性表示不执行排版
|
|||
// imageBlockLine: 'center', //图片的浮动方式,独占一行剧中,左右浮动,默认: center,left,right,none 去掉这个属性表示不执行排版
|
|||
// pasteFilter: false, //根据规则过滤没事粘贴进来的内容
|
|||
// clearFontSize: false, //去掉所有的内嵌字号,使用编辑器默认的字号
|
|||
// clearFontFamily: false, //去掉所有的内嵌字体,使用编辑器默认的字体
|
|||
// removeEmptyNode: false, // 去掉空节点
|
|||
// //可以去掉的标签
|
|||
// removeTagNames: {标签名字:1},
|
|||
// indent: false, // 行首缩进
|
|||
// indentValue : '2em', //行首缩进的大小
|
|||
// bdc2sb: false,
|
|||
// tobdc: false
|
|||
//}
|
|||
|
|||
//tableDragable
|
|||
//表格是否可以拖拽
|
|||
//,tableDragable: true
|
|||
|
|||
//,disabledTableInTable:true //禁止表格嵌套
|
|||
|
|||
//sourceEditor
|
|||
//源码的查看方式,codemirror 是代码高亮,textarea是文本框,默认是codemirror
|
|||
//注意默认codemirror只能在ie8+和非ie中使用
|
|||
//,sourceEditor:"codemirror"
|
|||
//如果sourceEditor是codemirror,还用配置一下两个参数
|
|||
//codeMirrorJsUrl js加载的路径,默认是 URL + "third-party/codemirror/codemirror.js"
|
|||
//,codeMirrorJsUrl:URL + "third-party/codemirror/codemirror.js"
|
|||
//codeMirrorCssUrl css加载的路径,默认是 URL + "third-party/codemirror/codemirror.css"
|
|||
//,codeMirrorCssUrl:URL + "third-party/codemirror/codemirror.css"
|
|||
//编辑器初始化完成后是否进入源码模式,默认为否。
|
|||
//,sourceEditorFirst:false
|
|||
|
|||
//iframeUrlMap
|
|||
//dialog内容的路径 ~会被替换成URL,垓属性一旦打开,将覆盖所有的dialog的默认路径
|
|||
//,iframeUrlMap:{
|
|||
// 'anchor':'~/dialogs/anchor/anchor.html',
|
|||
//}
|
|||
|
|||
//webAppKey 百度应用的APIkey,每个站长必须首先去百度官网注册一个key后方能正常使用app功能,注册介绍,http://app.baidu.com/static/cms/getapikey.html
|
|||
//, webAppKey: ""
|
|||
}; |
|||
|
|||
function getUEBasePath(docUrl, confUrl) { |
|||
|
|||
return getBasePath(docUrl || self.document.URL || self.location.href, confUrl || getConfigFilePath()); |
|||
|
|||
} |
|||
|
|||
function getConfigFilePath() { |
|||
|
|||
var configPath = document.getElementsByTagName('script'); |
|||
|
|||
return configPath[ configPath.length - 1 ].src; |
|||
|
|||
} |
|||
|
|||
function getBasePath(docUrl, confUrl) { |
|||
|
|||
var basePath = confUrl; |
|||
|
|||
|
|||
if (/^(\/|\\\\)/.test(confUrl)) { |
|||
|
|||
basePath = /^.+?\w(\/|\\\\)/.exec(docUrl)[0] + confUrl.replace(/^(\/|\\\\)/, ''); |
|||
|
|||
} else if (!/^[a-z]+:/i.test(confUrl)) { |
|||
|
|||
docUrl = docUrl.split("#")[0].split("?")[0].replace(/[^\\\/]+$/, ''); |
|||
|
|||
basePath = docUrl + "" + confUrl; |
|||
|
|||
} |
|||
|
|||
return optimizationPath(basePath); |
|||
|
|||
} |
|||
|
|||
function optimizationPath(path) { |
|||
|
|||
var protocol = /^[a-z]+:\/\//.exec(path)[ 0 ], |
|||
tmp = null, |
|||
res = []; |
|||
|
|||
path = path.replace(protocol, "").split("?")[0].split("#")[0]; |
|||
|
|||
path = path.replace(/\\/g, '/').split(/\//); |
|||
|
|||
path[ path.length - 1 ] = ""; |
|||
|
|||
while (path.length) { |
|||
|
|||
if (( tmp = path.shift() ) === "..") { |
|||
res.pop(); |
|||
} else if (tmp !== ".") { |
|||
res.push(tmp); |
|||
} |
|||
|
|||
} |
|||
|
|||
return protocol + res.join("/"); |
|||
|
|||
} |
|||
|
|||
window.UE = { |
|||
getUEBasePath: getUEBasePath |
|||
}; |
|||
|
|||
})(); |
|||
@ -0,0 +1,28 @@ |
|||
(function(){(function(){UE=window.UE||{};var f=!!window.ActiveXObject,h={removeLastbs:function(a){return a.replace(/\/$/,"")},extend:function(a,c){for(var b=arguments,d=this.isBoolean(b[b.length-1])?b[b.length-1]:!1,e=this.isBoolean(b[b.length-1])?b.length-1:b.length,k=1;k<e;k++){var n=b[k],l;for(l in n)d&&a.hasOwnProperty(l)||(a[l]=n[l])}return a},isIE:f,cssRule:f?function(a,c,b){var d;b=b||document;d=b.indexList?b.indexList:b.indexList={};var e;if(d[a])e=b.styleSheets[d[a]];else{if(void 0===c)return""; |
|||
e=b.createStyleSheet("",b=b.styleSheets.length);d[a]=b}if(void 0===c)return e.cssText;e.cssText=e.cssText+"\n"+(c||"")}:function(a,c,b){b=b||document;var d=b.getElementsByTagName("head")[0],e;if(!(e=b.getElementById(a))){if(void 0===c)return"";e=b.createElement("style");e.id=a;d.appendChild(e)}if(void 0===c)return e.innerHTML;""!==c?e.innerHTML=e.innerHTML+"\n"+c:d.removeChild(e)},domReady:function(a){var c=window.document;"complete"===c.readyState?a():f?(function(){if(!c.isReady){try{c.documentElement.doScroll("left")}catch(b){setTimeout(arguments.callee, |
|||
0);return}a()}}(),window.attachEvent("onload",function(){a()})):(c.addEventListener("DOMContentLoaded",function(){c.removeEventListener("DOMContentLoaded",arguments.callee,!1);a()},!1),window.addEventListener("load",function(){a()},!1))},each:function(a,c,b){if(null!=a)if(a.length===+a.length)for(var d=0,e=a.length;d<e;d++){if(!1===c.call(b,a[d],d,a))return!1}else for(d in a)if(a.hasOwnProperty(d)&&!1===c.call(b,a[d],d,a))return!1},inArray:function(a,c){var b=-1;this.each(a,function(a,e){if(a===c)return b= |
|||
e,!1});return b},pushItem:function(a,c){-1==this.inArray(a,c)&&a.push(c)},trim:function(a){return a.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},indexOf:function(a,c,b){var d=-1;b=this.isNumber(b)?b:0;this.each(a,function(a,k){if(k>=b&&a===c)return d=k,!1});return d},hasClass:function(a,c){c=c.replace(/(^[ ]+)|([ ]+$)/g,"").replace(/[ ]{2,}/g," ").split(" ");for(var b=0,d,e=a.className;d=c[b++];)if(!(new RegExp("\\b"+d+"\\b","i")).test(e))return!1;return b-1==c.length},addClass:function(a,c){if(a){c= |
|||
this.trim(c).replace(/[ ]{2,}/g," ").split(" ");for(var b=0,d,e=a.className;d=c[b++];)(new RegExp("\\b"+d+"\\b")).test(e)||(e+=" "+d);a.className=h.trim(e)}},removeClass:function(a,c){c=this.isArray(c)?c:this.trim(c).replace(/[ ]{2,}/g," ").split(" ");for(var b=0,d,e=a.className;d=c[b++];)e=e.replace(new RegExp("\\b"+d+"\\b"),"");e=this.trim(e).replace(/[ ]{2,}/g," ");a.className=e;!e&&a.removeAttribute("className")},on:function(a,c,b){var d=this.isArray(c)?c:c.split(/\s+/),e=d.length;if(e)for(;e--;)if(c= |
|||
d[e],a.addEventListener)a.addEventListener(c,b,!1);else{b._d||(b._d={els:[]});var k=c+b.toString(),n=h.indexOf(b._d.els,a);b._d[k]&&-1!=n||(-1==n&&b._d.els.push(a),b._d[k]||(b._d[k]=function(a){return b.call(a.srcElement,a||window.event)}),a.attachEvent("on"+c,b._d[k]))}a=null},off:function(a,c,b){var d=this.isArray(c)?c:c.split(/\s+/),e=d.length;if(e)for(;e--;)if(c=d[e],a.removeEventListener)a.removeEventListener(c,b,!1);else{var k=c+b.toString();try{a.detachEvent("on"+c,b._d?b._d[k]:b)}catch(n){}b._d&& |
|||
b._d[k]&&(c=h.indexOf(b._d.els,a),-1!=c&&b._d.els.splice(c,1),0==b._d.els.length&&delete b._d[k])}},loadFile:function(){function a(a,d){try{for(var e=0,k;k=c[e++];)if(k.doc===a&&k.url==(d.src||d.href))return k}catch(n){return null}}var c=[];return function(b,d,e){var k=a(b,d);if(k)k.ready?e&&e():k.funs.push(e);else if(c.push({doc:b,url:d.src||d.href,funs:[e]}),!b.body){e=[];for(var n in d)"tag"!=n&&e.push(n+'="'+d[n]+'"');b.write("<"+d.tag+" "+e.join(" ")+" ></"+d.tag+">")}else if(!d.id||!b.getElementById(d.id)){var l= |
|||
b.createElement(d.tag);delete d.tag;for(n in d)l.setAttribute(n,d[n]);l.onload=l.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){k=a(b,d);if(0<k.funs.length){k.ready=1;for(var c;c=k.funs.pop();)c()}l.onload=l.onreadystatechange=null}};l.onerror=function(){throw Error("The load "+(d.href||d.src)+" fails,check the url");};b.getElementsByTagName("head")[0].appendChild(l)}}}()};h.each("String Function Array Number RegExp Object Boolean".split(" "),function(a){h["is"+ |
|||
a]=function(c){return Object.prototype.toString.apply(c)=="[object "+a+"]"}});var g={};UE.parse={register:function(a,c){g[a]=c},load:function(a){h.each(g,function(c){c.call(a,h)})}};uParse=function(a,c){h.domReady(function(){var b;document.querySelectorAll?b=document.querySelectorAll(a):/^#/.test(a)?b=[document.getElementById(a.replace(/^#/,""))]:/^\./.test(a)?(b=[],h.each(document.getElementsByTagName("*"),function(c){c.className&&(new RegExp("\\b"+a.replace(/^\./,"")+"\\b","i")).test(c.className)&& |
|||
b.push(c)})):b=document.getElementsByTagName(a);h.each(b,function(b){UE.parse.load(h.extend({root:b,selector:a},c))})})}})();UE.parse.register("insertcode",function(f){var h=this.root.getElementsByTagName("pre");if(h.length)if("undefined"==typeof XRegExp){var g,a;void 0!==this.rootPath?(g=f.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCore.js",a=f.removeLastbs(this.rootPath)+"/third-party/SyntaxHighlighter/shCoreDefault.css"):(g=this.highlightJsUrl,a=this.highlightCssUrl);f.loadFile(document, |
|||
{id:"syntaxhighlighter_css",tag:"link",rel:"stylesheet",type:"text/css",href:a});f.loadFile(document,{id:"syntaxhighlighter_js",src:g,tag:"script",type:"text/javascript",defer:"defer"},function(){f.each(h,function(a){a&&/brush/i.test(a.className)&&SyntaxHighlighter.highlight(a)})})}else f.each(h,function(a){a&&/brush/i.test(a.className)&&SyntaxHighlighter.highlight(a)})});UE.parse.register("table",function(f){var h=this,g=this.root,a=g.getElementsByTagName("table");if(a.length){var c=function(a,c){c= |
|||
c||function(a,b){return a.localeCompare(b)};for(var b=0,d=a.length;b<d;b++)for(var f=b,g=a.length;f<g;f++)if(0<c(a[b],a[f])){var h=a[b];a[b]=a[f];a[f]=h}return a},b=function(a,b,d){for(var l=a.rows,g=[],h="TH"===l[0].cells[0].tagName,r=0,t=l.length;r<t;r++)g[r]=l[r];var q={reversecurrent:function(a,b){return 1},orderbyasc:function(a,b){return(a.innerText||a.textContent).localeCompare(b.innerText||b.textContent)},reversebyasc:function(a,b){return b.innerHTML.localeCompare(a.innerHTML)},orderbynum:function(a, |
|||
b){var d=a[f.isIE?"innerText":"textContent"].match(/\d+/),c=b[f.isIE?"innerText":"textContent"].match(/\d+/);d&&(d=+d[0]);c&&(c=+c[0]);return(d||0)-(c||0)},reversebynum:function(a,b){var d=a[f.isIE?"innerText":"textContent"].match(/\d+/),c=b[f.isIE?"innerText":"textContent"].match(/\d+/);d&&(d=+d[0]);c&&(c=+c[0]);return(c||0)-(d||0)}};a.setAttribute("data-sort-type",d&&"string"===typeof d&&q[d]?d:"");h&&g.splice(0,1);g=c(g,function(a,c){return d&&"function"===typeof d?d.call(this,a.cells[b],c.cells[b]): |
|||
d&&"number"===typeof d?1:d&&"string"===typeof d&&q[d]?q[d].call(this,a.cells[b],c.cells[b]):q.orderbyasc.call(this,a.cells[b],c.cells[b])});l=a.ownerDocument.createDocumentFragment();h=0;for(t=g.length;h<t;h++)l.appendChild(g[h]);a.getElementsByTagName("tbody")[0].appendChild(l)},d=function(a,b){var d,c=a;for(b=f.isArray(b)?b:[b];c;){for(d=0;d<b.length;d++)if(c.tagName==b[d].toUpperCase())return c;c=c.parentNode}return null},a=this.selector;f.cssRule("table",a+" table.noBorderTable td,"+a+" table.noBorderTable th,"+ |
|||
a+" table.noBorderTable caption{border:1px dashed #ddd !important}"+a+" table.sortEnabled tr.firstRow th,"+a+" table.sortEnabled tr.firstRow td{padding-right:20px; background-repeat: no-repeat;background-position: center right; background-image:url("+this.rootPath+"themes/default/images/sortable.png);}"+a+" table.sortEnabled tr.firstRow th:hover,"+a+" table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}"+a+" table{margin-bottom:10px;border-collapse:collapse;display:table;}"+a+" td,"+a+ |
|||
" th{ background:white; padding: 5px 10px;border: 1px solid #DDD;}"+a+" caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}"+a+" th{border-top:1px solid #BBB;background:#F7F7F7;}"+a+" table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}"+a+" tr.ue-table-interlace-color-single td{ background: #fcfcfc; }"+a+" tr.ue-table-interlace-color-double td{ background: #f7faff; }"+a+" td p{margin:0;padding:0;}",document);f.each(["td","th","caption"],function(a){a=g.getElementsByTagName(a); |
|||
a.length&&f.each(a,function(a){a.firstChild||(a.innerHTML=" ")})});a=g.getElementsByTagName("table");f.each(a,function(a){if(/\bsortEnabled\b/.test(a.className))f.on(a,"click",function(a){a=a.target||a.srcElement;var c=d(a,["td","th"]);a=d(a,"table");var c=f.indexOf(a.rows[0].cells,c),l=a.getAttribute("data-sort-type");if(-1!=c&&(b(a,c,h.tableSortCompareFn||l),!f.hasClass(a.rows[0],"firstRow"))){for(c=1;c<a.rows.length;c++)f.removeClass(a.rows[c],"firstRow");f.addClass(a.rows[0],"firstRow")}})})}}); |
|||
UE.parse.register("charts",function(f){function h(a){var c=[];a=a.getElementsByTagName("table");for(var b=0,d;d=a[b];b++)null!==d.getAttribute("data-chart")&&c.push(g(d));return c.length?c:null}function g(a){for(var c=a.getAttribute("data-chart"),b={},d=[],f=0,e;e=a.rows[f];f++){for(var g=[],h=0,k;k=e.cells[h];h++){var m=k.innerText||k.textContent||"";g.push("TH"==k.tagName?m:m|0)}d.push(g)}c=c.split(";");for(f=0;e=c[f];f++)e=e.split(":"),b[e[0]]=e[1];return{table:a,meta:b,data:d}}function a(){window.jQuery? |
|||
c():f.loadFile(document,{src:d+"/third-party/jquery-1.10.2.min.js",tag:"script",type:"text/javascript",defer:"defer"},function(){c()})}function c(){window.Highcharts?b():f.loadFile(document,{src:d+"/third-party/highcharts/highcharts.js",tag:"script",type:"text/javascript",defer:"defer"},function(){b()})}function b(){f.loadFile(document,{src:d+"/dialogs/charts/chart.config.js",tag:"script",type:"text/javascript",defer:"defer"},function(){for(var a=null,c=null,b=null,d=0,f=k.length;d<f;d++){var a=k[d], |
|||
c=[],e=[],b=[],g=a.data,h=a.meta;if("1"!=h.dataFormat){for(var p=0,e=g.length;p<e;p++)for(var m=0,u=g[p].length;m<u;m++)b[m]||(b[m]=[]),b[m][p]=g[p][m];g=b}b={};if(h.chartType!=typeConfig.length-1){e=g[0].slice(1);p=1;for(m=void 0;m=g[p];p++)c.push({name:m[0],data:m.slice(1)});b.series=c;b.categories=e;b.title=h.title;b.subTitle=h.subTitle;b.xTitle=h.xTitle;b.yTitle=h.yTitle}else{m=[];p=1;for(e=g[0].length;p<e;p++)m.push([g[0][p],g[1][p]|0]);c[0]={type:"pie",name:h.tip,data:m};b.series=c;b.title= |
|||
h.title}b.suffix=h.suffix;c=b;b=a.table;g=document.createElement("div");g.className="edui-chart-container";b.parentNode.replaceChild(g,b);b=g;a=typeConfig[a.meta.chartType];$(b).highcharts($.extend({},a,{credits:{enabled:!1},exporting:{enabled:!1},title:{text:c.title,x:-20},subtitle:{text:c.subTitle,x:-20},xAxis:{title:{text:c.xTitle},categories:c.categories},yAxis:{title:{text:c.yTitle},plotLines:[{value:0,width:1,color:"#808080"}]},tooltip:{enabled:!0,valueSuffix:c.suffix},legend:{layout:"vertical", |
|||
align:"right",verticalAlign:"middle",borderWidth:1},series:c.series}))}})}f.cssRule("chartsContainerHeight",".edui-chart-container { height:"+(this.chartContainerHeight||300)+"px}");var d=this.rootPath,e=this.root,k=null;d&&(e=e?h(e):null,(k=e)&&a())});UE.parse.register("background",function(f){for(var h=this.root.getElementsByTagName("p"),g,a=0,c;c=h[a++];)(g=c.getAttribute("data-background"))&&c.parentNode.removeChild(c);g&&f.cssRule("ueditor_background",this.selector+"{"+g+"}",document)});UE.parse.register("list", |
|||
function(f){function h(b){var c=this;f.each(b,function(b){if(b.className&&/custom_/i.test(b.className)){var e=b.className.match(/custom_(\w+)/)[1];if("dash"==e||"dot"==e)f.pushItem(g,d+" li.list-"+a[e]+"{background-image:url("+c.liiconpath+a[e]+".gif)}"),f.pushItem(g,d+" ul.custom_"+e+"{list-style:none;} "+d+" ul.custom_"+e+" li{background-position:0 3px;background-repeat:no-repeat}");else{var h=1;f.each(b.childNodes,function(b){"LI"==b.tagName&&(f.pushItem(g,d+" li.list-"+a[e]+h+"{background-image:url("+ |
|||
c.liiconpath+"list-"+a[e]+h+".gif)}"),h++)});f.pushItem(g,d+" ol.custom_"+e+"{list-style:none;}"+d+" ol.custom_"+e+" li{background-position:0 3px;background-repeat:no-repeat}")}switch(e){case "cn":f.pushItem(g,d+" li.list-"+e+"-paddingleft-1{padding-left:25px}");f.pushItem(g,d+" li.list-"+e+"-paddingleft-2{padding-left:40px}");f.pushItem(g,d+" li.list-"+e+"-paddingleft-3{padding-left:55px}");break;case "cn1":f.pushItem(g,d+" li.list-"+e+"-paddingleft-1{padding-left:30px}");f.pushItem(g,d+" li.list-"+ |
|||
e+"-paddingleft-2{padding-left:40px}");f.pushItem(g,d+" li.list-"+e+"-paddingleft-3{padding-left:55px}");break;case "cn2":f.pushItem(g,d+" li.list-"+e+"-paddingleft-1{padding-left:40px}");f.pushItem(g,d+" li.list-"+e+"-paddingleft-2{padding-left:55px}");f.pushItem(g,d+" li.list-"+e+"-paddingleft-3{padding-left:68px}");break;case "num":case "num1":f.pushItem(g,d+" li.list-"+e+"-paddingleft-1{padding-left:25px}");break;case "num2":f.pushItem(g,d+" li.list-"+e+"-paddingleft-1{padding-left:35px}");f.pushItem(g, |
|||
d+" li.list-"+e+"-paddingleft-2{padding-left:40px}");break;case "dash":f.pushItem(g,d+" li.list-"+e+"-paddingleft{padding-left:35px}");break;case "dot":f.pushItem(g,d+" li.list-"+e+"-paddingleft{padding-left:20px}")}}})}var g=[],a={cn:"cn-1-",cn1:"cn-2-",cn2:"cn-3-",num:"num-1-",num1:"num-2-",num2:"num-3-",dash:"dash",dot:"dot"};f.extend(this,{liiconpath:"http://bs.baidu.com/listicon/",listDefaultPaddingLeft:"20"});var c=this.root,b=c.getElementsByTagName("ol"),c=c.getElementsByTagName("ul"),d=this.selector; |
|||
b.length&&h.call(this,b);c.length&&h.call(this,c);if(b.length||c.length)g.push(d+" .list-paddingleft-1{padding-left:0}"),g.push(d+" .list-paddingleft-2{padding-left:"+this.listDefaultPaddingLeft+"px}"),g.push(d+" .list-paddingleft-3{padding-left:"+2*this.listDefaultPaddingLeft+"px}"),f.cssRule("list",d+" ol,"+d+" ul{margin:0;padding:0;}li{clear:both;}"+g.join("\n"),document)});UE.parse.register("vedio",function(f){var h=this.root.getElementsByTagName("video"),g=this.root.getElementsByTagName("audio"); |
|||
document.createElement("video");document.createElement("audio");if(h.length||g.length){var h=f.removeLastbs(this.rootPath),g=h+"/third-party/video-js/video.js",a=h+"/third-party/video-js/video-js.min.css",c=h+"/third-party/video-js/video-js.swf";window.videojs?videojs.autoSetup():(f.loadFile(document,{id:"video_css",tag:"link",rel:"stylesheet",type:"text/css",href:a}),f.loadFile(document,{id:"video_js",src:g,tag:"script",type:"text/javascript"},function(){videojs.options.flash.swf=c;videojs.autoSetup()}))}})})(); |
|||