diff --git a/app/static/umeditor/dialogs/emotion/emotion.css b/app/static/umeditor/dialogs/emotion/emotion.css deleted file mode 100644 index 75d2ad8f..00000000 --- a/app/static/umeditor/dialogs/emotion/emotion.css +++ /dev/null @@ -1,87 +0,0 @@ -.edui-popup-emotion .edui-emotion-jd img{ - background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} -.edui-popup-emotion .edui-emotion-pp img{ - background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:25px;height:25px;display:block; -} - -.edui-popup-emotion .edui-emotion-ldw img{ - background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} - -.edui-popup-emotion .edui-emotion-tsj img{ - background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} - -.edui-popup-emotion .edui-emotion-cat img{ - background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} - -.edui-popup-emotion .edui-emotion-bb img{ - background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} - -.edui-popup-emotion .edui-emotion-youa img{ - background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top; - cursor:pointer;width:35px;height:35px;display:block; -} - -.edui-popup-emotion .edui-emotion-smileytable { - width: 100%; - border-spacing: 0; - border-collapse: collapse; - table-layout: fixed; -} - -.edui-popup-emotion .edui-emotion-wrapper { - padding: 15px; -} - -.edui-popup-emotion .edui-tab-nav{ - height: auto; - *height: 31px; -} -.edui-popup-emotion .edui-emotion-tabs{ - clear: both; - width: 0; - height: 0; -} - -.edui-popup-emotion .edui-tab-content { - padding: 15px 0; -} - -.edui-popup-emotion .edui-emotion-preview-box { - width:90px; - height:76px; - border:2px solid #9cb945; - background:#FFFFFF; - background-position:center; - background-repeat:no-repeat; - position: absolute; - top: 67px; - left: 494px; - display: none; -} - -.edui-popup-emotion .edui-tab-text { - font-size: 12px; -} - -.edui-popup-emotion .edui-emotion-preview-left { - left: 15px; -} - -.edui-popup-emotion .edui-emotion-preview-img { - width: 100%; - height: 100%; - display: block; - background-repeat: no-repeat; - background-position: center center; -} diff --git a/app/static/umeditor/dialogs/emotion/emotion.js b/app/static/umeditor/dialogs/emotion/emotion.js deleted file mode 100644 index 3be3f7f6..00000000 --- a/app/static/umeditor/dialogs/emotion/emotion.js +++ /dev/null @@ -1,272 +0,0 @@ -(function(){ - - var editor = null; - - UM.registerWidget('emotion',{ - - tpl: "emotion.css\">" + - "
" + - "" + - "
" + - "
" + - "
" + - "
" + - "
" + - "
" + - "
" + - "
" + - "
" + - "
" + - "\" class=\'edui-emotion-JfaceReview edui-emotion-preview-img\'/>" + - "
", - - sourceData: { - emotion: { - tabNum:7, //切换面板数量 - SmilmgName:{ 'edui-emotion-Jtab0':['j_00', 84], 'edui-emotion-Jtab1':['t_00', 40], 'edui-emotion-Jtab2':['w_00', 52], 'edui-emotion-Jtab3':['B_00', 63], 'edui-emotion-Jtab4':['C_00', 20], 'edui-emotion-Jtab5':['i_f', 50], 'edui-emotion-Jtab6':['y_00', 40] }, //图片前缀名 - imageFolders:{ 'edui-emotion-Jtab0':'jx2/', 'edui-emotion-Jtab1':'tsj/', 'edui-emotion-Jtab2':'ldw/', 'edui-emotion-Jtab3':'bobo/', 'edui-emotion-Jtab4':'babycat/', 'edui-emotion-Jtab5':'face/', 'edui-emotion-Jtab6':'youa/'}, //图片对应文件夹路径 - imageCss:{'edui-emotion-Jtab0':'jd', 'edui-emotion-Jtab1':'tsj', 'edui-emotion-Jtab2':'ldw', 'edui-emotion-Jtab3':'bb', 'edui-emotion-Jtab4':'cat', 'edui-emotion-Jtab5':'pp', 'edui-emotion-Jtab6':'youa'}, //图片css类名 - imageCssOffset:{'edui-emotion-Jtab0':35, 'edui-emotion-Jtab1':35, 'edui-emotion-Jtab2':35, 'edui-emotion-Jtab3':35, 'edui-emotion-Jtab4':35, 'edui-emotion-Jtab5':25, 'edui-emotion-Jtab6':35}, //图片偏移 - SmileyInfor:{ - 'edui-emotion-Jtab0':['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '打酱油', '俯卧撑', '气愤', '?', '吻', '怒', '胜利', 'HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '微笑', '亲吻', '调皮', '惊恐', '耍酷', '发火', '害羞', '汗水', '大哭', '', '加油', '困', '你NB', '晕倒', '开心', '偷笑', '大哭', '滴汗', '叹气', '超赞', '??', '飞吻', '天使', '撒花', '生气', '被砸', '吓傻', '随意吐'], - 'edui-emotion-Jtab1':['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '摊手', '睡觉', '瘫坐', '无聊', '星星闪', '旋转', '也不行', '郁闷', '正Music', '抓墙', '撞墙至死', '歪头', '戳眼', '飘过', '互相拍砖', '砍死你', '扔桌子', '少林寺', '什么?', '转头', '我爱牛奶', '我踢', '摇晃', '晕厥', '在笼子里', '震荡'], - 'edui-emotion-Jtab2':['大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '我错了', 'money', '气愤', '挑逗', '吻', '怒', '胜利', '委屈', '受伤', '说啥呢?', '闭嘴', '不', '逗你玩儿', '飞吻', '眩晕', '魔法', '我来了', '睡了', '我打', '闭嘴', '打', '打晕了', '刷牙', '爆揍', '炸弹', '倒立', '刮胡子', '邪恶的笑', '不要不要', '爱恋中', '放大仔细看', '偷窥', '超高兴', '晕', '松口气', '我跑', '享受', '修养', '哭', '汗', '啊~', '热烈欢迎', '打酱油', '俯卧撑', '?'], - 'edui-emotion-Jtab3':['HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '泪眼', '流泪', '生气', '吐舌', '喜欢', '旋转', '再见', '抓狂', '汗', '鄙视', '拜', '吐血', '嘘', '打人', '蹦跳', '变脸', '扯肉', '吃To', '吃花', '吹泡泡糖', '大变身', '飞天舞', '回眸', '可怜', '猛抽', '泡泡', '苹果', '亲', '', '骚舞', '烧香', '睡', '套娃娃', '捅捅', '舞倒', '西红柿', '爱慕', '摇', '摇摆', '杂耍', '招财', '被殴', '被球闷', '大惊', '理想', '欧打', '呕吐', '碎', '吐痰'], - 'edui-emotion-Jtab4':['发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '顶', '幸运', '爱心', '躲', '送花', '选择'], - 'edui-emotion-Jtab5':['微笑', '亲吻', '调皮', '惊讶', '耍酷', '发火', '害羞', '汗水', '大哭', '得意', '鄙视', '困', '夸奖', '晕倒', '疑问', '媒婆', '狂吐', '青蛙', '发愁', '亲吻', '', '爱心', '心碎', '玫瑰', '礼物', '哭', '奸笑', '可爱', '得意', '呲牙', '暴汗', '楚楚可怜', '困', '哭', '生气', '惊讶', '口水', '彩虹', '夜空', '太阳', '钱钱', '灯泡', '咖啡', '蛋糕', '音乐', '爱', '胜利', '赞', '鄙视', 'OK'], - 'edui-emotion-Jtab6':['男兜', '女兜', '开心', '乖乖', '偷笑', '大笑', '抽泣', '大哭', '无奈', '滴汗', '叹气', '狂晕', '委屈', '超赞', '??', '疑问', '飞吻', '天使', '撒花', '生气', '被砸', '口水', '泪奔', '吓傻', '吐舌头', '点头', '随意吐', '旋转', '困困', '鄙视', '狂顶', '篮球', '再见', '欢迎光临', '恭喜发财', '稍等', '我在线', '恕不议价', '库房有货', '货在路上'] - } - } - }, - initContent:function( _editor, $widget ){ - - var me = this, - emotion = me.sourceData.emotion, - lang = _editor.getLang( 'emotion' )['static'], - emotionUrl = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/emotion/', - options = $.extend( {}, lang, { - emotion_url: emotionUrl - }), - $root = me.root(); - - if( me.inited ) { - me.preventDefault(); - this.switchToFirst(); - return; - } - - me.inited = true; - - editor = _editor; - this.widget = $widget; - - emotion.SmileyPath = _editor.options.emotionLocalization === true ? emotionUrl + 'images/' : "http://img.baidu.com/hi/"; - emotion.SmileyBox = me.createTabList( emotion.tabNum ); - emotion.tabExist = me.createArr( emotion.tabNum ); - - options['cover_img'] = emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif' : 'default/0.gif'); - - $root.html( $.parseTmpl( me.tpl, options ) ); - - me.tabs = $.eduitab({selector:".edui-emotion-tab-Jpanel"}); - - //缓存预览对象 - me.previewBox = $root.find(".edui-emotion-JtabIconReview"); - me.previewImg = $root.find(".edui-emotion-JfaceReview"); - - me.initImgName(); - - }, - initEvent:function(){ - - var me = this; - - //防止点击过后关闭popup - me.root().on('click', function(e){ - return false; - }); - - //移动预览 - me.root().delegate( 'td', 'mouseover mouseout', function( evt ){ - - var $td = $( this), - url = $td.attr('data-surl') || null; - - if( url ) { - me[evt.type]( this, url , $td.attr('data-posflag') ); - } - - return false; - - } ); - - //点击选中 - me.root().delegate( 'td', 'click', function( evt ){ - - var $td = $( this), - realUrl = $td.attr('data-realurl') || null; - - if( realUrl ) { - me.insertSmiley( realUrl.replace( /'/g, "\\'" ), evt ); - } - - return false; - - } ); - - //更新模板 - me.tabs.edui().on("beforeshow", function( evt ){ - - var contentId = $(evt.target).attr('data-context').replace( /^.*\.(?=[^\s]*$)/, '' ); - - evt.stopPropagation(); - - me.updateTab( contentId ); - - }); - - this.switchToFirst(); - - }, - initImgName: function() { - - var emotion = this.sourceData.emotion; - - for ( var pro in emotion.SmilmgName ) { - var tempName = emotion.SmilmgName[pro], - tempBox = emotion.SmileyBox[pro], - tempStr = ""; - - if ( tempBox.length ) return; - - for ( var i = 1; i <= tempName[1]; i++ ) { - tempStr = tempName[0]; - if ( i < 10 ) tempStr = tempStr + '0'; - tempStr = tempStr + i + '.gif'; - tempBox.push( tempStr ); - } - } - - }, - /** - * 切换到第一个tab - */ - switchToFirst: function(){ - this.root().find(".edui-emotion-Jtabnav .edui-tab-text:first").trigger('click'); - }, - updateTab: function( contentBoxId ) { - - var me = this, - emotion = me.sourceData.emotion; - - me.autoHeight( contentBoxId ); - - if ( !emotion.tabExist[ contentBoxId ] ) { - - emotion.tabExist[ contentBoxId ] = true; - me.createTab( contentBoxId ); - - } - - }, - autoHeight: function( ) { - this.widget.height(this.root() + 2); - }, - createTabList: function( tabNum ) { - var obj = {}; - for ( var i = 0; i < tabNum; i++ ) { - obj["edui-emotion-Jtab" + i] = []; - } - return obj; - }, - mouseover: function( td, srcPath, posFlag ) { - - posFlag -= 0; - - $(td).css( 'backgroundColor', '#ACCD3C' ); - - this.previewImg.css( "backgroundImage", "url(" + srcPath + ")" ); - posFlag && this.previewBox.addClass('edui-emotion-preview-left'); - this.previewBox.show(); - - }, - mouseout: function( td ) { - $(td).css( 'backgroundColor', 'transparent' ); - this.previewBox.removeClass('edui-emotion-preview-left').hide(); - }, - insertSmiley: function( url, evt ) { - var obj = { - src: url - }; - obj._src = obj.src; - editor.execCommand( 'insertimage', obj ); - if ( !evt.ctrlKey ) { - //关闭预览 - this.previewBox.removeClass('edui-emotion-preview-left').hide(); - this.widget.edui().hide(); - } - }, - createTab: function( contentBoxId ) { - - var faceVersion = "?v=1.1", //版本号 - me = this, - $contentBox = this.root().find("."+contentBoxId), - emotion = me.sourceData.emotion, - imagePath = emotion.SmileyPath + emotion.imageFolders[ contentBoxId ], //获取显示表情和预览表情的路径 - positionLine = 11 / 2, //中间数 - iWidth = iHeight = 35, //图片长宽 - iColWidth = 3, //表格剩余空间的显示比例 - tableCss = emotion.imageCss[ contentBoxId ], - cssOffset = emotion.imageCssOffset[ contentBoxId ], - textHTML = [''], - i = 0, imgNum = emotion.SmileyBox[ contentBoxId ].length, imgColNum = 11, faceImage, - sUrl, realUrl, posflag, offset, infor; - - for ( ; i < imgNum; ) { - textHTML.push( '' ); - for ( var j = 0; j < imgColNum; j++, i++ ) { - faceImage = emotion.SmileyBox[ contentBoxId ][i]; - if ( faceImage ) { - sUrl = imagePath + faceImage + faceVersion; - realUrl = imagePath + faceImage; - posflag = j < positionLine ? 0 : 1; - offset = cssOffset * i * (-1) - 1; - infor = emotion.SmileyInfor[ contentBoxId ][i]; - - textHTML.push( '' ); - } - textHTML.push( '' ); - } - textHTML.push( '
' ); - textHTML.push( '' ); - textHTML.push( '' ); - textHTML.push( '' ); - } else { - textHTML.push( '' ); - } - textHTML.push( '
' ); - textHTML = textHTML.join( "" ); - $contentBox.html( textHTML ); - }, - createArr: function( tabNum ) { - var arr = []; - for ( var i = 0; i < tabNum; i++ ) { - arr[i] = 0; - } - return arr; - }, - width:603, - height:400 - }); - -})(); - diff --git a/app/static/umeditor/dialogs/emotion/images/0.gif b/app/static/umeditor/dialogs/emotion/images/0.gif deleted file mode 100644 index 6964168b..00000000 Binary files a/app/static/umeditor/dialogs/emotion/images/0.gif and /dev/null differ diff --git a/app/static/umeditor/dialogs/emotion/images/bface.gif b/app/static/umeditor/dialogs/emotion/images/bface.gif deleted file mode 100644 index 14fe618a..00000000 Binary files a/app/static/umeditor/dialogs/emotion/images/bface.gif and /dev/null differ diff --git a/app/static/umeditor/dialogs/emotion/images/cface.gif b/app/static/umeditor/dialogs/emotion/images/cface.gif deleted file mode 100644 index bff947f5..00000000 Binary files a/app/static/umeditor/dialogs/emotion/images/cface.gif and /dev/null differ diff --git a/app/static/umeditor/dialogs/emotion/images/fface.gif b/app/static/umeditor/dialogs/emotion/images/fface.gif deleted file mode 100644 index 0d8a6afe..00000000 Binary files a/app/static/umeditor/dialogs/emotion/images/fface.gif and /dev/null differ diff --git a/app/static/umeditor/dialogs/emotion/images/jxface2.gif b/app/static/umeditor/dialogs/emotion/images/jxface2.gif deleted file mode 100644 index a959c90f..00000000 Binary files a/app/static/umeditor/dialogs/emotion/images/jxface2.gif and /dev/null differ diff --git a/app/static/umeditor/dialogs/emotion/images/neweditor-tab-bg.png b/app/static/umeditor/dialogs/emotion/images/neweditor-tab-bg.png deleted file mode 100644 index 8f398b09..00000000 Binary files a/app/static/umeditor/dialogs/emotion/images/neweditor-tab-bg.png and /dev/null differ diff --git a/app/static/umeditor/dialogs/emotion/images/tface.gif b/app/static/umeditor/dialogs/emotion/images/tface.gif deleted file mode 100644 index 1354f54b..00000000 Binary files a/app/static/umeditor/dialogs/emotion/images/tface.gif and /dev/null differ diff --git a/app/static/umeditor/dialogs/emotion/images/wface.gif b/app/static/umeditor/dialogs/emotion/images/wface.gif deleted file mode 100644 index 5667160d..00000000 Binary files a/app/static/umeditor/dialogs/emotion/images/wface.gif and /dev/null differ diff --git a/app/static/umeditor/dialogs/emotion/images/yface.gif b/app/static/umeditor/dialogs/emotion/images/yface.gif deleted file mode 100644 index 51608be0..00000000 Binary files a/app/static/umeditor/dialogs/emotion/images/yface.gif and /dev/null differ diff --git a/app/static/umeditor/dialogs/formula/formula.css b/app/static/umeditor/dialogs/formula/formula.css deleted file mode 100644 index 6176681d..00000000 --- a/app/static/umeditor/dialogs/formula/formula.css +++ /dev/null @@ -1,32 +0,0 @@ -.edui-popup-formula .edui-formula-wrapper { - padding: 15px; -} -.edui-popup-formula .edui-formula-wrapper .edui-tab-nav{ - height: auto; - *height: 31px; -} -.edui-popup-formula .edui-formula-wrapper .edui-tab-text { - font-size: 12px; -} -.edui-popup-formula .edui-formula-wrapper .edui-formula-clearboth { - clear: both; - width: 0; - height: 0; -} -.edui-popup-formula .edui-formula-wrapper .edui-tab-pane ul { - margin: 0px; - padding: 0px; -} -.edui-popup-formula .edui-formula-wrapper .edui-tab-content { - padding: 5px 0px 0px 0px; -} -.edui-popup-formula .edui-formula-wrapper .edui-tab-pane .edui-formula-latex-item { - display: block; - float: left; - margin: 0px 3px 3px 0px; - width: 30px; - height: 30px; - border:1px solid #cccccc; - background-image: url("images/formula.png"); - cursor: pointer; -} \ No newline at end of file diff --git a/app/static/umeditor/dialogs/formula/formula.html b/app/static/umeditor/dialogs/formula/formula.html deleted file mode 100644 index c8d3c2b0..00000000 --- a/app/static/umeditor/dialogs/formula/formula.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - Document - - - - - -
-
-
- -
- -
- - - - - - \ No newline at end of file diff --git a/app/static/umeditor/dialogs/formula/formula.js b/app/static/umeditor/dialogs/formula/formula.js deleted file mode 100644 index 91d03a9c..00000000 --- a/app/static/umeditor/dialogs/formula/formula.js +++ /dev/null @@ -1,124 +0,0 @@ -(function () { - - var editor = null; - - UM.registerWidget('formula', { - - tpl: "formula.css\">" + - "
" + - "" + - "
" + - "
", - - sourceData: { - formula: { - 'common': [ - "{/}frac{ }{ }", "^{ }/_{ }", "x^{ }", "x_{ }", "x^{ }_{ }", "{/}bar{ }", "{/}sqrt{ }", "{/}nthroot{ }{ }", - "{/}sum^{ }_{n=}", "{/}sum", "{/}log_{ }", "{/}ln", "{/}int_{ }^{ }", "{/}oint_{ }^{ }" - ], - 'symbol': [ - "+", "-", "{/}pm", "{/}times", "{/}ast", "{/}div", "/", "{/}bigtriangleup", - "=", "{/}ne", "{/}approx", ">", "<", "{/}ge", "{/}le", "{/}infty", - "{/}cap", "{/}cup", "{/}because", "{/}therefore", "{/}subset", "{/}supset", "{/}subseteq", "{/}supseteq", - "{/}nsubseteq", "{/}nsupseteq", "{/}in", "{/}ni", "{/}notin", "{/}mapsto", "{/}leftarrow", "{/}rightarrow", - "{/}Leftarrow", "{/}Rightarrow", "{/}leftrightarrow", "{/}Leftrightarrow" - ], - 'letter': [ - "{/}alpha", "{/}beta", "{/}gamma", "{/}delta", "{/}varepsilon", "{/}varphi", "{/}lambda", "{/}mu", - "{/}rho", "{/}sigma", "{/}omega", "{/}Gamma", "{/}Delta", "{/}Theta", "{/}Lambda", "{/}Xi", - "{/}Pi", "{/}Sigma", "{/}Upsilon", "{/}Phi", "{/}Psi", "{/}Omega" - ] - } - }, - initContent: function (_editor, $widget) { - - var me = this, - formula = me.sourceData.formula, - lang = _editor.getLang('formula').static, - formulaUrl = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/formula/', - options = $.extend({}, lang, { 'formula_url': formulaUrl }), - $root = me.root(); - - if (me.inited) { - me.preventDefault(); - return; - } - me.inited = true; - - editor = _editor; - me.$widget = $widget; - - $root.html($.parseTmpl(me.tpl, options)); - me.tabs = $.eduitab({selector: "#edui-formula-tab-Jpanel"}); - - /* 初始化popup的内容 */ - var headHtml = [], xMax = 0, yMax = 0, - $tabContent = me.root().find('.edui-tab-content'); - $.each(formula, function (k, v) { - var contentHtml = []; - $.each(v, function (i, f) { - contentHtml.push('
  • '); - if (++xMax >=8) { - ++yMax; xMax = 0; - } - }); - yMax++; xMax = 0; - $tabContent.append('
    '); - headHtml.push('
  • ' + lang['lang_tab_' + k] + '
  • '); - }); - headHtml.push('
  • '); - $root.find('.edui-tab-nav').html(headHtml.join('')); - $root.find('.edui-tab-content').append('
    '); - - /* 选中第一个tab */ - me.switchTab(0); - }, - initEvent: function () { - var me = this; - - //防止点击过后关闭popup - me.root().on('click', function (e) { - return false; - }); - - //点击tab切换菜单 - me.root().find('.edui-tab-nav').delegate('.edui-tab-item', 'click', function (evt) { - me.switchTab(this); - return false; - }); - - //点击选中公式 - me.root().find('.edui-tab-pane').delegate('.edui-formula-latex-item', 'click', function (evt) { - var $item = $(this), - latex = $item.attr('data-latex') || ''; - - if (latex) { - me.insertLatex(latex.replace("{/}", "\\")); - } - me.$widget.edui().hide(); - return false; - }); - }, - switchTab:function(index){ - var me = this, - $root = me.root(), - index = $.isNumeric(index) ? index:$.inArray(index, $root.find('.edui-tab-nav .edui-tab-item')); - - $root.find('.edui-tab-nav .edui-tab-item').removeClass('edui-active').eq(index).addClass('edui-active'); - $root.find('.edui-tab-content .edui-tab-pane').removeClass('edui-active').eq(index).addClass('edui-active'); - - /* 自动长高 */ - me.autoHeight(0); - }, - autoHeight: function () { - this.$widget.height(this.root() + 2); - }, - insertLatex: function (latex) { - editor.execCommand('formula', latex ); - }, - width: 350, - height: 400 - }); - -})(); - diff --git a/app/static/umeditor/dialogs/formula/images/formula.png b/app/static/umeditor/dialogs/formula/images/formula.png deleted file mode 100644 index 04cbb3bb..00000000 Binary files a/app/static/umeditor/dialogs/formula/images/formula.png and /dev/null differ diff --git a/app/static/umeditor/dialogs/image/image.css b/app/static/umeditor/dialogs/image/image.css deleted file mode 100644 index 0d31f4ec..00000000 --- a/app/static/umeditor/dialogs/image/image.css +++ /dev/null @@ -1,42 +0,0 @@ -.edui-dialog-image .edui-image-wrapper{font-size: 12px;margin: 15px;} - -/*upload*/ -.edui-dialog-image .edui-image-upload1{position: absolute;top:50%;left:50%;width:44px;height:38px;margin-top:-19px; margin-left: -22px;} -.edui-dialog-image .edui-image-upload2{position:relative;float:left;width:120px;height:120px;margin:5px 0 0 5px;} - -.edui-dialog-image .edui-image-form{position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;opacity: 0;cursor: pointer;} -.edui-dialog-image .edui-image-form .edui-image-file{width: 100%;height:100%;filter: alpha(opacity=0)} - -.edui-dialog-image .edui-image-upload1 .edui-image-icon{display: inline-block;width:44px;height:38px;background-image: url('images/upload1.png')} -.edui-dialog-image .edui-image-upload1 .edui-image-icon.hover{background-position: -50px 0;} -.edui-dialog-image .edui-image-upload2 .edui-image-icon{display: inline-block;width:120px;height:120px;background-image: url('images/upload2.png')} - -.edui-dialog-image .edui-image-dragTip{position: absolute;display:none;top:50%;left:50%;margin-top:30px;margin-left: -60px; - color: #222;font-size:14px;text-shadow: 0px 2px 3px #555;} - -.edui-dialog-image .edui-image-content{height:330px;width:100%;position: relative;} - -.edui-dialog-image .edui-image-mask{display: none;position: absolute;top:0;left:0;width: 100%; height: 100%;background-color:#fff; - text-align: center;line-height:300px;color:#000;font-size:14px;font-weight:bold;opacity: 0.6;filter: alpha(opacity=60);} -.edui-dialog-image .edui-image-mask.edui-active{display: block;} - -/*network*/ -.edui-dialog-image .edui-image-searchBar{margin: 10px;} -.edui-dialog-image .edui-image-searchBar .edui-image-searchTxt{display: inline-block !important;*display: inline !important;*zoom:1;width:400px; border: 1px solid #c5d2ff; height: 20px; line-height: 18px; font-size: 14px; padding: 3px; margin: 0;outline:0;} -.edui-dialog-image .edui-image-searchBar .edui-image-searchAdd{display: inline-block !important;*display: inline !important;*zoom:1; - width:60px; text-align:center;height: 25px;text-align: center;line-height: 25px; - background-color: #ffffff;padding: 0; border: 1px solid #ababab;margin-left: 20px;cursor: pointer; -} -.edui-dialog-image .edui-image-searchBar .edui-image-searchAdd.hover{ - background-color: #d5e1f2; - padding: 0; - border: 1px solid #a3bde3; -} -.edui-dialog-image .edui-image-searchRes{height:280px;overflow:auto;} - - -/*common*/ -.edui-dialog-image .edui-image-item{position:relative;float:left;width:120px;height:120px;border: 1px solid #CCC;cursor: default;margin: 5px 0 0 5px;} -.edui-dialog-image .edui-image-item .edui-image-pic{position: absolute;left:-9999px;} -.edui-dialog-image .edui-image-item .edui-image-close{position:absolute;right:0;background: url('images/close.png');width:17px;height:17px;cursor:pointer;z-index:1} -.edui-dialog-image .edui-image-item.hover .edui-image-close{display: block;} diff --git a/app/static/umeditor/dialogs/image/image.js b/app/static/umeditor/dialogs/image/image.js deleted file mode 100644 index 163544ba..00000000 --- a/app/static/umeditor/dialogs/image/image.js +++ /dev/null @@ -1,445 +0,0 @@ -(function () { - - var utils = UM.utils, - browser = UM.browser, - Base = { - checkURL: function (url) { - if(!url) return false; - url = utils.trim(url); - if (url.length <= 0) { - return false; - } - if (url.search(/http:\/\/|https:\/\//) !== 0) { - url += 'http://'; - } - - url=url.replace(/\?[\s\S]*$/,""); - - if (!/(.gif|.jpg|.jpeg|.png)$/i.test(url)) { - return false; - } - return url; - }, - getAllPic: function (sel, $w, editor) { - var me = this, - arr = [], - $imgs = $(sel, $w); - - $.each($imgs, function (index, node) { - $(node).removeAttr("width").removeAttr("height"); - -// if (node.width > editor.options.initialFrameWidth) { -// me.scale(node, editor.options.initialFrameWidth - -// parseInt($(editor.body).css("padding-left")) - -// parseInt($(editor.body).css("padding-right"))); -// } - - return arr.push({ - _src: node.src, - src: node.src - }); - }); - - return arr; - }, - scale: function (img, max, oWidth, oHeight) { - var width = 0, height = 0, percent, ow = img.width || oWidth, oh = img.height || oHeight; - if (ow > max || oh > max) { - if (ow >= oh) { - if (width = ow - max) { - percent = (width / ow).toFixed(2); - img.height = oh - oh * percent; - img.width = max; - } - } else { - if (height = oh - max) { - percent = (height / oh).toFixed(2); - img.width = ow - ow * percent; - img.height = max; - } - } - } - - return this; - }, - close: function ($img) { - - $img.css({ - top: ($img.parent().height() - $img.height()) / 2, - left: ($img.parent().width()-$img.width())/2 - }).prev().on("click",function () { - - if ( $(this).parent().remove().hasClass("edui-image-upload-item") ) { - //显示图片计数-1 - Upload.showCount--; - Upload.updateView(); - } - - }); - - return this; - }, - createImgBase64: function (img, file, $w) { - if (browser.webkit) { - //Chrome8+ - img.src = window.webkitURL.createObjectURL(file); - } else if (browser.gecko) { - //FF4+ - img.src = window.URL.createObjectURL(file); - } else { - //实例化file reader对象 - var reader = new FileReader(); - reader.onload = function (e) { - img.src = this.result; - $w.append(img); - }; - reader.readAsDataURL(file); - } - }, - callback: function (editor, $w, url, state) { - - if (state == "SUCCESS") { - //显示图片计数+1 - Upload.showCount++; - var $img = $(""), - $item = $("
    ").append($img); - - if ($(".edui-image-upload2", $w).length < 1) { - $(".edui-image-content", $w).append($item); - - Upload.render(".edui-image-content", 2) - .config(".edui-image-upload2"); - } else { - $(".edui-image-upload2", $w).before($item).show(); - } - - $img.on("load", function () { - Base.scale(this, 120); - Base.close($(this)); - $(".edui-image-content", $w).focus(); - }); - - } else { - currentDialog.showTip( state ); - window.setTimeout( function () { - - currentDialog.hideTip(); - - }, 3000 ); - } - - Upload.toggleMask(); - - } - }; - - /* - * 本地上传 - * */ - var Upload = { - showCount: 0, - uploadTpl: '
    ' + - '' + - '
    ' + - '' + - '
    ' + - - '
    ', - init: function (editor, $w) { - var me = this; - - me.editor = editor; - me.dialog = $w; - me.render(".edui-image-local", 1); - me.config(".edui-image-upload1"); - me.submit(); - me.drag(); - - $(".edui-image-upload1").hover(function () { - $(".edui-image-icon", this).toggleClass("hover"); - }); - - if (!(UM.browser.ie && UM.browser.version <= 9)) { - $(".edui-image-dragTip", me.dialog).css("display", "block"); - } - - - return me; - }, - render: function (sel, t) { - var me = this; - - $(sel, me.dialog).append($(me.uploadTpl.replace(/%%/g, t))); - - return me; - }, - config: function (sel) { - var me = this, - url=me.editor.options.imageUrl; - - url=url + (url.indexOf("?") == -1 ? "?" : "&") + "editorid="+me.editor.id;//初始form提交地址; - - $("form", $(sel, me.dialog)).attr("action", url); - - return me; - }, - uploadComplete: function(r){ - var me = this; - try{ - var json = eval('('+r+')'); - Base.callback(me.editor, me.dialog, json.url, json.state); - }catch (e){ - var lang = me.editor.getLang('image'); - Base.callback(me.editor, me.dialog, '', (lang && lang.uploadError) || 'Error!'); - } - }, - submit: function (callback) { - - var me = this, - input = $( ''), - input = input[0]; - - $(me.dialog).delegate( ".edui-image-file", "change", function ( e ) { - - if ( !this.parentNode ) { - return; - } - - $('').insertBefore(me.dialog).on('load', function(){ - var r = this.contentWindow.document.body.innerHTML; - if(r == '')return; - me.uploadComplete(r); - $(this).unbind('load'); - $(this).remove(); - - }); - - $(this).parent()[0].submit(); - Upload.updateInput( input ); - me.toggleMask("Loading...."); - callback && callback(); - - }); - - return me; - }, - //更新input - updateInput: function ( inputField ) { - - $( ".edui-image-file", this.dialog ).each( function ( index, ele ) { - - ele.parentNode.replaceChild( inputField.cloneNode( true ), ele ); - - } ); - - }, - //更新上传框 - updateView: function () { - - if ( Upload.showCount !== 0 ) { - return; - } - - $(".edui-image-upload2", this.dialog).hide(); - $(".edui-image-dragTip", this.dialog).show(); - $(".edui-image-upload1", this.dialog).show(); - - }, - drag: function () { - var me = this; - //做拽上传的支持 - if (!UM.browser.ie9below) { - me.dialog.find('.edui-image-content').on('drop',function (e) { - - //获取文件列表 - var fileList = e.originalEvent.dataTransfer.files; - var img = document.createElement('img'); - var hasImg = false; - $.each(fileList, function (i, f) { - if (/^image/.test(f.type)) { - //创建图片的base64 - Base.createImgBase64(img, f, me.dialog); - - var xhr = new XMLHttpRequest(); - xhr.open("post", me.editor.getOpt('imageUrl') + "?type=ajax", true); - xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - - //模拟数据 - var fd = new FormData(); - fd.append(me.editor.getOpt('imageFieldName'), f); - - xhr.send(fd); - xhr.addEventListener('load', function (e) { - var r = e.target.response, json; - me.uploadComplete(r); - if (i == fileList.length - 1) { - $(img).remove() - } - }); - hasImg = true; - } - }); - if (hasImg) { - e.preventDefault(); - me.toggleMask("Loading...."); - } - - }).on('dragover', function (e) { - e.preventDefault(); - }); - } - }, - toggleMask: function (html) { - var me = this; - - var $mask = $(".edui-image-mask", me.dialog); - if (html) { - if (!(UM.browser.ie && UM.browser.version <= 9)) { - $(".edui-image-dragTip", me.dialog).css( "display", "none" ); - } - $(".edui-image-upload1", me.dialog).css( "display", "none" ); - $mask.addClass("edui-active").html(html); - } else { - - $mask.removeClass("edui-active").html(); - - if ( Upload.showCount > 0 ) { - return me; - } - - if (!(UM.browser.ie && UM.browser.version <= 9) ){ - $(".edui-image-dragTip", me.dialog).css("display", "block"); - } - $(".edui-image-upload1", me.dialog).css( "display", "block" ); - } - - return me; - } - }; - - /* - * 网络图片 - * */ - var NetWork = { - init: function (editor, $w) { - var me = this; - - me.editor = editor; - me.dialog = $w; - - me.initEvt(); - }, - initEvt: function () { - var me = this, - url, - $ele = $(".edui-image-searchTxt", me.dialog); - - $(".edui-image-searchAdd", me.dialog).on("click", function () { - url = Base.checkURL($ele.val()); - - if (url) { - - $("").on("load", function () { - - - - var $item = $("
    ").append(this); - - $(".edui-image-searchRes", me.dialog).append($item); - - Base.scale(this, 120); - - $item.width($(this).width()); - - Base.close($(this)); - - $ele.val(""); - }); - } - }) - .hover(function () { - $(this).toggleClass("hover"); - }); - } - }; - - var $tab = null, - currentDialog = null; - - UM.registerWidget('image', { - tpl: "image.css\">" + - "
    " + - "" + - "
    " + - "
    " + - "
    " + - "
    " + - "
    <%=lang_input_dragTip%>
    " + - "
    " + - "
    " + - "
    " + - "" + - "
    <%=lang_btn_add%>
    " + - "
    " + - "
    " + - "
    " + - "
    " + - "
    ", - initContent: function (editor, $dialog) { - var lang = editor.getLang('image')["static"], - opt = $.extend({}, lang, { - image_url: UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/image/' - }); - - Upload.showCount = 0; - - if (lang) { - var html = $.parseTmpl(this.tpl, opt); - } - - currentDialog = $dialog.edui(); - - this.root().html(html); - - }, - initEvent: function (editor, $w) { - $tab = $.eduitab({selector: ".edui-image-wrapper"}) - .edui().on("beforeshow", function (e) { - e.stopPropagation(); - }); - - Upload.init(editor, $w); - - NetWork.init(editor, $w); - }, - buttons: { - 'ok': { - exec: function (editor, $w) { - var sel = "", - index = $tab.activate(); - - if (index == 0) { - sel = ".edui-image-content .edui-image-pic"; - } else if (index == 1) { - sel = ".edui-image-searchRes .edui-image-pic"; - } - - var list = Base.getAllPic(sel, $w, editor); - - if (index != -1) { - editor.execCommand('insertimage', list); - } - } - }, - 'cancel': {} - }, - width: 700, - height: 408 - }, function (editor, $w, url, state) { - Base.callback(editor, $w, url, state) - }) -})(); - diff --git a/app/static/umeditor/dialogs/image/images/close.png b/app/static/umeditor/dialogs/image/images/close.png deleted file mode 100644 index d3683880..00000000 Binary files a/app/static/umeditor/dialogs/image/images/close.png and /dev/null differ diff --git a/app/static/umeditor/dialogs/image/images/upload1.png b/app/static/umeditor/dialogs/image/images/upload1.png deleted file mode 100644 index c9056ca5..00000000 Binary files a/app/static/umeditor/dialogs/image/images/upload1.png and /dev/null differ diff --git a/app/static/umeditor/dialogs/image/images/upload2.png b/app/static/umeditor/dialogs/image/images/upload2.png deleted file mode 100644 index 57ce63f0..00000000 Binary files a/app/static/umeditor/dialogs/image/images/upload2.png and /dev/null differ diff --git a/app/static/umeditor/dialogs/link/link.js b/app/static/umeditor/dialogs/link/link.js deleted file mode 100644 index 326bbaaf..00000000 --- a/app/static/umeditor/dialogs/link/link.js +++ /dev/null @@ -1,73 +0,0 @@ -(function(){ - var utils = UM.utils; - function hrefStartWith(href, arr) { - href = href.replace(/^\s+|\s+$/g, ''); - for (var i = 0, ai; ai = arr[i++];) { - if (href.indexOf(ai) == 0) { - return true; - } - } - return false; - } - - UM.registerWidget('link', { - tpl: "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + -// "" + -// "" + -// "" + - "", - initContent: function (editor) { - var lang = editor.getLang('link'); - if (lang) { - var html = $.parseTmpl(this.tpl, lang.static); - } - this.root().html(html); - }, - initEvent: function (editor, $w) { - var link = editor.queryCommandValue('link'); - if(link){ - $('#edui-link-Jhref',$w).val(utils.html($(link).attr('href'))); - $('#edui-link-Jtitle',$w).val($(link).attr('title')); - $(link).attr('target') == '_blank' && $('#edui-link-Jtarget').attr('checked',true) - } - $('#edui-link-Jhref',$w).focus(); - }, - buttons: { - 'ok': { - exec: function (editor, $w) { - var href = $('#edui-link-Jhref').val().replace(/^\s+|\s+$/g, ''); - - if (href) { - editor.execCommand('link', { - 'href': href, - 'target': $("#edui-link-Jtarget:checked").length ? "_blank" : '_self', - 'title': $("#edui-link-Jtitle").val().replace(/^\s+|\s+$/g, ''), - '_href': href - }); - } - } - }, - 'cancel':{} - }, - width: 400 - }) -})(); - diff --git a/app/static/umeditor/dialogs/map/map.html b/app/static/umeditor/dialogs/map/map.html deleted file mode 100644 index 6e2716bb..00000000 --- a/app/static/umeditor/dialogs/map/map.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - 百度地图API自定义地图 - - - - - - - -
    - - - \ No newline at end of file diff --git a/app/static/umeditor/dialogs/map/map.js b/app/static/umeditor/dialogs/map/map.js deleted file mode 100644 index df2ea75a..00000000 --- a/app/static/umeditor/dialogs/map/map.js +++ /dev/null @@ -1,263 +0,0 @@ -(function () { - - var widgetName = 'map'; - - UM.registerWidget(widgetName, { - - tpl: "" + - "
    " + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - ""+ - "" + - "
    <%=lang_city%>:\"/><%=lang_address%>:<%=lang_search%>
    " + - "
    " + - "
    " + - "", - initContent: function (editor, $widget) { - - var me = this, - lang = editor.getLang(widgetName), - theme_url = editor.options.themePath + editor.options.theme; - - if( me.inited ) { - me.preventDefault(); - return false; - } - - me.inited = true; - - me.lang = lang; - me.editor = editor; - - me.root().html($.parseTmpl(me.tpl, $.extend({}, lang['static'], { - 'theme_url': theme_url - }))); - - me.initRequestApi(); - - }, - /** - * 初始化请求API - */ - initRequestApi: function () { - - var $ifr = null; - - //已经初始化过, 不用再次初始化 - if (window.BMap && window.BMap.Map) { - this.initBaiduMap(); - } else { - - $ifr = $(''); - $ifr.appendTo( this.root() ); - - $ifr = $ifr[ 0 ].contentWindow.document; - - $ifr.open(); - $ifr.write( this.root().find(".edui-tpl-container").html().replace( /scr_ipt/g, 'script').replace('<>',"'" + this.editor.id + "'") ); - - } - - }, - requestMapApi: function (src) { - - var me = this; - - if (src.length) { - - var _src = src[0]; - - src = src.slice(1); - - if (_src) { - $.getScript(_src, function () { - me.requestMapApi(src); - }); - } else { - me.requestMapApi(src); - } - - } else { - - me.initBaiduMap(); - - } - - - }, - initBaiduMap: function () { - - var $root = this.root(), - map = new BMap.Map($root.find(".edui-map-container")[0]), - me = this, - marker, - point, - imgcss, - img = $(me.editor.selection.getRange().getClosedNode()); - - map.enableInertialDragging(); - map.enableScrollWheelZoom(); - map.enableContinuousZoom(); - - if (img.length && /api[.]map[.]baidu[.]com/ig.test(img.attr("src"))) { - var url = img.attr("src"), - centerPos = me.getPars(url, "center").split(","), - markerPos = me.getPars(url, "markers").split(","); - point = new BMap.Point(Number(centerPos[0]), Number(centerPos[1])); - marker = new BMap.Marker(new BMap.Point(Number(markerPos[0]), Number(markerPos[1]))); - map.addControl(new BMap.NavigationControl()); - map.centerAndZoom(point, Number(me.getPars(url, "zoom"))); - imgcss = img.attr('style'); - } else { - point = new BMap.Point(116.404, 39.915); // 创建点坐标 - marker = new BMap.Marker(point); - map.addControl(new BMap.NavigationControl()); - map.centerAndZoom(point, 10); // 初始化地图,设置中心点坐标和地图级别。 - } - marker.enableDragging(); - map.addOverlay(marker); - - me.map = map; - me.marker = marker; - me.imgcss = imgcss; - }, - doSearch: function () { - var me = this, - city = me.root().find('.edui-map-city').val(), - address = me.root().find('.edui-map-address').val(); - - if (!city) { - alert(me.lang.cityMsg); - return; - } - var search = new BMap.LocalSearch(city, { - onSearchComplete: function (results) { - if (results && results.getNumPois()) { - var points = []; - for (var i = 0; i < results.getCurrentNumPois(); i++) { - points.push(results.getPoi(i).point); - } - if (points.length > 1) { - me.map.setViewport(points); - } else { - me.map.centerAndZoom(points[0], 13); - } - point = me.map.getCenter(); - me.marker.setPoint(point); - } else { - alert(me.lang.errorMsg); - } - } - }); - search.search(address || city); - }, - getPars: function (str, par) { - var reg = new RegExp(par + "=((\\d+|[.,])*)", "g"); - return reg.exec(str)[1]; - }, - reset: function(){ - this.map && this.map.reset(); - }, - initEvent: function () { - var me = this, - $root = me.root(); - - $root.find('.edui-map-address').on('keydown', function (evt) { - evt = evt || event; - if (evt.keyCode == 13) { - me.doSearch(); - return false; - } - }); - - $root.find(".edui-map-button").on('click', function (evt) { - me.doSearch(); - }); - - $root.find(".edui-map-address").focus(); - - $root.on( "mousewheel DOMMouseScroll", function ( e ) { - return false; - } ); - - }, - width: 580, - height: 408, - buttons: { - ok: { - exec: function (editor) { - var widget = editor.getWidgetData(widgetName), - center = widget.map.getCenter(), - zoom = widget.map.getZoom(), - size = widget.map.getSize(), - point = widget.marker.P; - - if (widget.root().find(".edui-map-dynamic")[0].checked) { - var URL = editor.getOpt('UMEDITOR_HOME_URL'), - url = [URL + (/\/$/.test(URL) ? '':'/') + "dialogs/map/map.html" + - '#center=' + center.lng + ',' + center.lat, - '&zoom=' + zoom, - '&width=' + size.width, - '&height=' + size.height, - '&markers=' + point.lng + ',' + point.lat].join(''); - editor.execCommand('inserthtml', ''); - } else { - url = "http://api.map.baidu.com/staticimage?center=" + center.lng + ',' + center.lat + - "&zoom=" + zoom + "&width=" + size.width + '&height=' + size.height + "&markers=" + point.lng + ',' + point.lat; - editor.execCommand('inserthtml', '', true); - } - - widget.reset(); - } - }, - cancel: { - exec: function(editor){ - editor.getWidgetData(widgetName).reset(); - } - } - } - }); - -})(); - diff --git a/app/static/umeditor/dialogs/video/images/center_focus.jpg b/app/static/umeditor/dialogs/video/images/center_focus.jpg deleted file mode 100644 index 262b0291..00000000 Binary files a/app/static/umeditor/dialogs/video/images/center_focus.jpg and /dev/null differ diff --git a/app/static/umeditor/dialogs/video/images/left_focus.jpg b/app/static/umeditor/dialogs/video/images/left_focus.jpg deleted file mode 100644 index 7886d276..00000000 Binary files a/app/static/umeditor/dialogs/video/images/left_focus.jpg and /dev/null differ diff --git a/app/static/umeditor/dialogs/video/images/none_focus.jpg b/app/static/umeditor/dialogs/video/images/none_focus.jpg deleted file mode 100644 index 7c768dcb..00000000 Binary files a/app/static/umeditor/dialogs/video/images/none_focus.jpg and /dev/null differ diff --git a/app/static/umeditor/dialogs/video/images/right_focus.jpg b/app/static/umeditor/dialogs/video/images/right_focus.jpg deleted file mode 100644 index 173e10d2..00000000 Binary files a/app/static/umeditor/dialogs/video/images/right_focus.jpg and /dev/null differ diff --git a/app/static/umeditor/dialogs/video/video.css b/app/static/umeditor/dialogs/video/video.css deleted file mode 100644 index 380d2d21..00000000 --- a/app/static/umeditor/dialogs/video/video.css +++ /dev/null @@ -1,59 +0,0 @@ -@charset "utf-8"; -.edui-dialog-video .edui-video-wrapper{ width: 570px;_width:575px;margin: 10px auto; zoom:1;position: relative} -.edui-dialog-video .edui-video-tabbody{height:335px;} -.edui-dialog-video .edui-video-panel { position: absolute;width:100%; height:100%;background: #fff;} -.edui-dialog-video .edui-video-panel table td{vertical-align: middle;} -.edui-dialog-video #eduiVideoUrl { - width: 470px; - height: 21px; - line-height: 21px; - margin: 8px 5px; - background: #FFF; - border: 1px solid #d7d7d7; -} -.edui-dialog-video #eduiVideoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;} -.edui-dialog-video #searchList{width: 570px;overflow: auto;zoom:1;height: 270px;} -.edui-dialog-video #searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;} -.edui-dialog-video #searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/ -.edui-dialog-video #searchList p{margin-left: 10px;} -.edui-dialog-video #eduiVideoType{ - width: 65px; - height: 23px; - line-height: 22px; - border: 1px solid #d7d7d7; -} -.edui-dialog-video #eduiVideoSearchBtn,.edui-dialog-video #eduiVideoSearchReset{ - /*width: 80px;*/ - height: 25px; - line-height: 25px; - background: #eee; - border: 1px solid #d7d7d7; - cursor: pointer; - padding: 0 5px; -} - - - -.edui-dialog-video #eduiVideoPreview{width: 420px; margin-left: 10px; _margin-left:5px; height: 280px;background-color: #ddd;float: left} -.edui-dialog-video #eduiVideoInfo {width: 120px;float: left;margin-left: 10px;_margin-left:7px;} -.edui-dialog-video .edui-video-wrapper fieldset{ - border: 1px solid #ddd; - padding-left: 5px; - margin-bottom: 20px; - padding-bottom: 5px; - width: 115px; -} -.edui-dialog-video .edui-video-wrapper fieldset legend{font-weight: bold;} -.edui-dialog-video .edui-video-wrapper fieldset p{line-height: 30px;} -.edui-dialog-video .edui-video-wrapper fieldset input.edui-video-txt{ - width: 65px; - height: 21px; - line-height: 21px; - margin: 8px 5px; - background: #FFF; - border: 1px solid #d7d7d7; -} -.edui-dialog-video .edui-video-wrapper label.edui-video-url{font-weight: bold;margin-left: 5px;color: #06c;} -.edui-dialog-video #eduiVideoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;} -.edui-dialog-video #eduiVideoFloat .edui-video-focus{opacity: 1;filter: alpha(opacity = 100)} -.edui-dialog-video .edui-video-wrapper span.edui-video-view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue} \ No newline at end of file diff --git a/app/static/umeditor/dialogs/video/video.js b/app/static/umeditor/dialogs/video/video.js deleted file mode 100644 index f37d5b78..00000000 --- a/app/static/umeditor/dialogs/video/video.js +++ /dev/null @@ -1,282 +0,0 @@ - -(function(){ - var domUtils = UM.dom.domUtils; - var widgetName = 'video'; - - UM.registerWidget( widgetName,{ - - tpl: "video.css\" />" + - "
    " + - "
    " + - "
    " + - "<%=lang_tab_insertV%>" + - "
    " + - "
    " + - "
    " + - "
    " + - "
    " + - "
    " + - "
    " + - "<%=lang_video_size%>" + - "" + - "" + - "" + - "
    " + - "
    " + - "
    " + - "<%=lang_alignment%>" + - "
    " + - "
    " + - "
    " + - "
    " + - "
    " + - "
    " + - "
    ", - initContent:function( editor, $widget ){ - - var me = this, - lang = editor.getLang( widgetName), - video_url = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/video/'; - - me.lang = lang; - me.editor = editor; - me.$widget = $widget; - me.root().html( $.parseTmpl( me.tpl, $.extend( { video_url: video_url }, lang['static'] ) ) ); - - me.initController( lang ); - - }, - initEvent:function(){ - - var me = this, - url = $("#eduiVideoUrl", me.$widget)[0]; - - if( 'oninput' in url ) { - url.oninput = function(){ - me.createPreviewVideo( this.value ); - }; - } else { - url.onpropertychange = function () { - me.createPreviewVideo( this.value ); - } - } - - }, - initController: function( lang ){ - - var me = this, - img = me.editor.selection.getRange().getClosedNode(), - url; - - me.createAlignButton( ["eduiVideoFloat"] ); - - //编辑视频时初始化相关信息 - if(img && img.className == "edui-faked-video"){ - $("#eduiVideoUrl", me.$widget)[0].value = url = img.getAttribute("_url"); - $("#eduiVideoWidth", me.$widget)[0].value = img.width; - $("#eduiVideoHeight", me.$widget)[0].value = img.height; - var align = domUtils.getComputedStyle(img,"float"), - parentAlign = domUtils.getComputedStyle(img.parentNode,"text-align"); - me.updateAlignButton(parentAlign==="center"?"center":align); - } - me.createPreviewVideo(url); - - }, - /** - * 根据url生成视频预览 - */ - createPreviewVideo: function(url){ - - if ( !url )return; - - var me = this, - lang = me.lang, - conUrl = me.convert_url(url); - - if(!me.endWith(conUrl,[".swf",".flv",".wmv"])){ - $("#eduiVideoPreview", me.$widget).html( lang.urlError ); - return; - } - $("#eduiVideoPreview", me.$widget)[0].innerHTML = ''; - - }, - /** - * 将单个视频信息插入编辑器中 - */ - insertSingle: function(){ - - var me = this, - width = $("#eduiVideoWidth", me.$widget)[0], - height = $("#eduiVideoHeight", me.$widget)[0], - url=$('#eduiVideoUrl', me.$widget)[0].value, - align = this.findFocus("eduiVideoFloat","name"); - - if(!url) return false; - if ( !me.checkNum( [width, height] ) ) return false; - this.editor.execCommand('insertvideo', { - url: me.convert_url(url), - width: width.value, - height: height.value, - align: align - }); - - }, - /** - * URL转换 - */ - convert_url: function(url){ - if ( !url ) return ''; - var matches = url.match(/youtu.be\/(\w+)$/) || - url.match(/youtube\.com\/watch\?v=(\w+)/) || - url.match(/youtube.com\/v\/(\w+)/), - youku = url.match(/youku\.com\/v_show\/id_(\w+)/), - youkuPlay = /player\.youku\.com/ig.test(url); - - if(youkuPlay){ - url = url.replace(/\?f=.*/, ""); - } else if (matches){ - url = "https://www.youtube.com/v/" + matches[1] + "?version=3&feature=player_embedded"; - }else if(youku){ - url = "http://player.youku.com/player.php/sid/"+youku[1]+"/v.swf" - } else { - url = url.replace(/http:\/\/www\.tudou\.com\/programs\/view\/([\w\-]+)\/?/i, "http://www.tudou.com/v/$1") - .replace(/http:\/\/www\.youtube\.com\/watch\?v=([\w\-]+)/i, "http://www.youtube.com/v/$1") - .replace(/http:\/\/v\.youku\.com\/v_show\/id_([\w\-=]+)\.html/i, "http://player.youku.com/player.php/sid/$1") - .replace(/http:\/\/www\.56\.com\/u\d+\/v_([\w\-]+)\.html/i, "http://player.56.com/v_$1.swf") - .replace(/http:\/\/www.56.com\/w\d+\/play_album\-aid\-\d+_vid\-([^.]+)\.html/i, "http://player.56.com/v_$1.swf") - .replace(/http:\/\/v\.ku6\.com\/.+\/([^.]+)\.html/i, "http://player.ku6.com/refer/$1/v.swf") - .replace(/\?f=.*/, ""); - } - return url; - }, - /** - * 检测传入的所有input框中输入的长宽是否是正数 - */ - checkNum: function checkNum( nodes ) { - - var me = this; - - for ( var i = 0, ci; ci = nodes[i++]; ) { - var value = ci.value; - if ( !me.isNumber( value ) && value) { - alert( me.lang.numError ); - ci.value = ""; - ci.focus(); - return false; - } - } - return true; - }, - /** - * 数字判断 - * @param value - */ - isNumber: function( value ) { - return /(0|^[1-9]\d*$)/.test( value ); - }, - updateAlignButton: function( align ) { - var aligns = $( "#eduiVideoFloat", this.$widget )[0].children; - - for ( var i = 0, ci; ci = aligns[i++]; ) { - if ( ci.getAttribute( "name" ) == align ) { - if ( ci.className !="edui-video-focus" ) { - ci.className = "edui-video-focus"; - } - } else { - if ( ci.className =="edui-video-focus" ) { - ci.className = ""; - } - } - } - - }, - /** - * 创建图片浮动选择按钮 - * @param ids - */ - createAlignButton: function( ids ) { - var lang = this.lang, - vidoe_home = UMEDITOR_CONFIG.UMEDITOR_HOME_URL + 'dialogs/video/'; - - for ( var i = 0, ci; ci = ids[i++]; ) { - var floatContainer = $( "#" + ci, this.$widget ) [0], - nameMaps = {"none":lang['default'], "left":lang.floatLeft, "right":lang.floatRight}; - for ( var j in nameMaps ) { - var div = document.createElement( "div" ); - div.setAttribute( "name", j ); - if ( j == "none" ) div.className="edui-video-focus"; - div.style.cssText = "background:url("+ vidoe_home +"images/" + j + "_focus.jpg);"; - div.setAttribute( "title", nameMaps[j] ); - floatContainer.appendChild( div ); - } - this.switchSelect( ci ); - } - }, - /** - * 选择切换 - */ - switchSelect: function( selectParentId ) { - var selects = $( "#" + selectParentId, this.$widget )[0].children; - for ( var i = 0, ci; ci = selects[i++]; ) { - $(ci).on("click", function () { - for ( var j = 0, cj; cj = selects[j++]; ) { - cj.className = ""; - cj.removeAttribute && cj.removeAttribute( "class" ); - } - this.className = "edui-video-focus"; - } ) - } - }, - /** - * 找到id下具有focus类的节点并返回该节点下的某个属性 - * @param id - * @param returnProperty - */ - findFocus: function( id, returnProperty ) { - var tabs = $( "#" + id , this.$widget)[0].children, - property; - for ( var i = 0, ci; ci = tabs[i++]; ) { - if ( ci.className=="edui-video-focus" ) { - property = ci.getAttribute( returnProperty ); - break; - } - } - return property; - }, - /** - * 末尾字符检测 - */ - endWith: function(str,endStrArr){ - for(var i=0,len = endStrArr.length;i - - - - - UMEDITOR 完整demo - - - - - - - - - -

    UMEDITOR 完整demo

    - - - - - -
    -
    - - - - - - - - - - - -
    -   -   -   -   -   -   - -
    -   -   -   -   -   -   - -
    -   -   -   - -
    -
    - - - - -
    - - -
    - -
    -

    -
    - - - - \ No newline at end of file diff --git a/app/static/umeditor/lang/en/en.js b/app/static/umeditor/lang/en/en.js deleted file mode 100644 index 9a1944f4..00000000 --- a/app/static/umeditor/lang/en/en.js +++ /dev/null @@ -1,150 +0,0 @@ -/** - * English language package - */ -UM.I18N['en'] = { - 'labelMap':{ - 'anchor':'Anchor', 'undo':'Undo', 'redo':'Redo', 'bold':'Bold', 'indent':'Indent', 'snapscreen':'SnapScreen', - 'italic':'Italic', 'underline':'Underline', 'strikethrough':'Strikethrough', 'subscript':'SubScript','fontborder':'text border', - 'superscript':'SuperScript', 'formatmatch':'Format Match', 'source':'Source', 'blockquote':'BlockQuote', - 'pasteplain':'PastePlain', 'selectall':'SelectAll', 'print':'Print', 'preview':'Preview', - 'horizontal':'Horizontal', 'removeformat':'RemoveFormat', 'time':'Time', 'date':'Date', - 'unlink':'Unlink', 'insertrow':'InsertRow', 'insertcol':'InsertCol', 'mergeright':'MergeRight', 'mergedown':'MergeDown', - 'deleterow':'DeleteRow', 'deletecol':'DeleteCol', 'splittorows':'SplitToRows','insertcode':'insert code', - 'splittocols':'SplitToCols', 'splittocells':'SplitToCells','deletecaption':'DeleteCaption','inserttitle':'InsertTitle', - 'mergecells':'MergeCells', 'deletetable':'DeleteTable', 'cleardoc':'Clear', 'insertparagraphbeforetable':"InsertParagraphBeforeTable", - 'fontfamily':'FontFamily', 'fontsize':'FontSize', 'paragraph':'Paragraph', 'image':'Image','edittable':'Edit Table', 'edittd':'Edit Td','link':'Link', - 'emotion':'Emotion', 'spechars':'Spechars', 'searchreplace':'SearchReplace', 'map':'BaiduMap', 'gmap':'GoogleMap', - 'video':'Video', 'help':'Help', 'justifyleft':'JustifyLeft', 'justifyright':'JustifyRight', 'justifycenter':'JustifyCenter', - 'justifyjustify':'Justify', 'forecolor':'FontColor', 'backcolor':'BackColor', 'insertorderedlist':'OL', - 'insertunorderedlist':'UL', 'fullscreen':'FullScreen', 'directionalityltr':'EnterFromLeft', 'directionalityrtl':'EnterFromRight', - 'rowspacingtop':'RowSpacingTop', 'rowspacingbottom':'RowSpacingBottom', 'highlightcode':'Code', 'pagebreak':'PageBreak', 'insertframe':'Iframe', 'imagenone':'Default', - 'imageleft':'ImageLeft', 'imageright':'ImageRight', 'attachment':'Attachment', 'imagecenter':'ImageCenter', 'wordimage':'WordImage', - 'lineheight':'LineHeight','edittip':'EditTip','customstyle':'CustomStyle', 'scrawl':'Scrawl', 'autotypeset':'AutoTypeset', - 'webapp':'WebAPP', 'touppercase':'UpperCase', 'tolowercase':'LowerCase','template':'Template','background':'Background','inserttable':'InsertTable', - 'drafts': 'drafts', 'formula':'formula' - }, - 'paragraph':{'p':'Paragraph', 'h1':'Title 1', 'h2':'Title 2', 'h3':'Title 3', 'h4':'Title 4', 'h5':'Title 5', 'h6':'Title 6'}, - 'fontfamily':{ - 'songti':'Sim sun', - 'kaiti':'Sim kai', - 'heiti':'Sim hei', - 'lishu':'Sim li', - 'yahei': 'Microsoft yahei', - 'andaleMono':'Andale mono', - 'arial': 'Arial', - 'arialBlack':'Arial black', - 'comicSansMs':'Comic sans ms', - 'impact':'Impact', - 'timesNewRoman':'Times new roman' - }, - 'ok':"OK", - 'cancel':"Cancel", - 'closeDialog':"closeDialog", - 'tableDrag':"You must import the file uiUtils.js before drag! ", - 'autofloatMsg':"The plugin AutoFloat depends on EditorUI!", - 'anthorMsg':"Link", - 'clearColor':'Clear', - 'standardColor':'Standard color', - 'themeColor':'Theme color', - 'property':'Property', - 'default':'Default', - 'modify':'Modify', - 'justifyleft':'Justify Left', - 'justifyright':'Justify Right', - 'justifycenter':'Justify Center', - 'justify':'Default', - 'clear':'Clear', - 'anchorMsg':'Anchor', - 'delete':'Delete', - 'clickToUpload':"Click to upload", - 'unset':"Language hasn't been set!", - 't_row':'row', - 't_col':'col', - 'more':'More', - 'pasteOpt':'Paste Option', - 'pasteSourceFormat':"Keep Source Formatting", - 'tagFormat':'Keep tag', - 'pasteTextFormat':'Keep Text only', - - //===============dialog i18N======================= - 'image':{ - 'static':{ - 'lang_tab_local':"Local Upload", - 'lang_tab_imgSearch':"Network Pictures", - 'lang_input_dragTip':"Support drag upload", - 'lang_btn_add':"Add" - }, - 'uploadError': 'Upload Error' - }, - 'emotion':{ - 'static':{ - 'lang_input_choice':'Choice', - 'lang_input_Tuzki':'Tuzki', - 'lang_input_lvdouwa':'LvDouWa', - 'lang_input_BOBO':'BOBO', - 'lang_input_babyCat':'BabyCat', - 'lang_input_bubble':'Bubble', - 'lang_input_youa':'YouA' - } - }, - 'gmap':{ - 'static':{ - 'lang_input_address':'Address:', - 'lang_input_search':'Search', - 'address':{'value':"Beijing"} - }, - 'searchError':'Unable to locate the address!' - }, - 'link':{ - 'static':{ - 'lang_input_text':'Text:', - 'lang_input_url':'URL:', - 'lang_input_title':'Title:', - 'lang_input_target':'open in new window:' - }, - 'validLink':'Supports only effective when a link is selected', - 'httpPrompt':'The hyperlink you enter should start with "http|https|ftp://"!' - }, - 'map':{ - 'static':{ - 'lang_city':"City", - 'lang_address':"Address", - 'city':{'value':"Beijing"}, - 'lang_search':"Search", - 'lang_dynamicmap':"Dynamic map" - }, - 'cityMsg':"Please enter the city name!", - 'errorMsg':"Can't find the place!" - }, - 'video':{ - 'static':{ - 'lang_tab_insertV':"Video", - 'lang_video_url':" URL ", - 'lang_video_size':"Video Size", - 'lang_videoW':"Width", - 'lang_videoH':"Height", - 'lang_alignment':"Alignment", - 'videoSearchTxt':{'value':"Enter the search keyword!"}, - 'videoType':{'options':["All", "Hot", "Entertainment", "Funny", "Sports", "Science", "variety"]}, - 'videoSearchBtn':{'value':"Search in Baidu"}, - 'videoSearchReset':{'value':"Clear result"} - }, - 'numError':"Please enter the correct Num. e.g 123,400", - 'floatLeft':"Float left", - 'floatRight':"Float right", - 'default':"Default", - 'block':"Display in block", - 'urlError':"The video url format may be wrong!", - 'loading':"  The video is loading, please wait…", - 'clickToSelect':"Click to select", - 'goToSource':'Visit source video ', - 'noVideo':"    Sorry,can't find the video,please try again!" - }, - 'formula':{ - 'static':{ - 'lang_tab_common':'Common', - 'lang_tab_symbol':'Symbol', - 'lang_tab_letter':'Letter' - } - } -}; \ No newline at end of file diff --git a/app/static/umeditor/lang/en/images/addimage.png b/app/static/umeditor/lang/en/images/addimage.png deleted file mode 100644 index 3a2fd171..00000000 Binary files a/app/static/umeditor/lang/en/images/addimage.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/alldeletebtnhoverskin.png b/app/static/umeditor/lang/en/images/alldeletebtnhoverskin.png deleted file mode 100644 index 355eeabb..00000000 Binary files a/app/static/umeditor/lang/en/images/alldeletebtnhoverskin.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/alldeletebtnupskin.png b/app/static/umeditor/lang/en/images/alldeletebtnupskin.png deleted file mode 100644 index 61658ce6..00000000 Binary files a/app/static/umeditor/lang/en/images/alldeletebtnupskin.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/background.png b/app/static/umeditor/lang/en/images/background.png deleted file mode 100644 index d5bf5fdd..00000000 Binary files a/app/static/umeditor/lang/en/images/background.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/button.png b/app/static/umeditor/lang/en/images/button.png deleted file mode 100644 index 098874cb..00000000 Binary files a/app/static/umeditor/lang/en/images/button.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/copy.png b/app/static/umeditor/lang/en/images/copy.png deleted file mode 100644 index f982e8bc..00000000 Binary files a/app/static/umeditor/lang/en/images/copy.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/deletedisable.png b/app/static/umeditor/lang/en/images/deletedisable.png deleted file mode 100644 index c8ee7509..00000000 Binary files a/app/static/umeditor/lang/en/images/deletedisable.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/deleteenable.png b/app/static/umeditor/lang/en/images/deleteenable.png deleted file mode 100644 index 26acc883..00000000 Binary files a/app/static/umeditor/lang/en/images/deleteenable.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/imglabel.png b/app/static/umeditor/lang/en/images/imglabel.png deleted file mode 100644 index da401e68..00000000 Binary files a/app/static/umeditor/lang/en/images/imglabel.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/listbackground.png b/app/static/umeditor/lang/en/images/listbackground.png deleted file mode 100644 index 4f82ccd8..00000000 Binary files a/app/static/umeditor/lang/en/images/listbackground.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/localimage.png b/app/static/umeditor/lang/en/images/localimage.png deleted file mode 100644 index 12c8e6ae..00000000 Binary files a/app/static/umeditor/lang/en/images/localimage.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/music.png b/app/static/umeditor/lang/en/images/music.png deleted file mode 100644 index 2f495fe9..00000000 Binary files a/app/static/umeditor/lang/en/images/music.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/rotateleftdisable.png b/app/static/umeditor/lang/en/images/rotateleftdisable.png deleted file mode 100644 index 741526e0..00000000 Binary files a/app/static/umeditor/lang/en/images/rotateleftdisable.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/rotateleftenable.png b/app/static/umeditor/lang/en/images/rotateleftenable.png deleted file mode 100644 index e164ddbd..00000000 Binary files a/app/static/umeditor/lang/en/images/rotateleftenable.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/rotaterightdisable.png b/app/static/umeditor/lang/en/images/rotaterightdisable.png deleted file mode 100644 index 5a78c260..00000000 Binary files a/app/static/umeditor/lang/en/images/rotaterightdisable.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/rotaterightenable.png b/app/static/umeditor/lang/en/images/rotaterightenable.png deleted file mode 100644 index d768531f..00000000 Binary files a/app/static/umeditor/lang/en/images/rotaterightenable.png and /dev/null differ diff --git a/app/static/umeditor/lang/en/images/upload.png b/app/static/umeditor/lang/en/images/upload.png deleted file mode 100644 index 7bb15b3d..00000000 Binary files a/app/static/umeditor/lang/en/images/upload.png and /dev/null differ diff --git a/app/static/umeditor/lang/zh-cn/images/copy.png b/app/static/umeditor/lang/zh-cn/images/copy.png deleted file mode 100644 index b2536aac..00000000 Binary files a/app/static/umeditor/lang/zh-cn/images/copy.png and /dev/null differ diff --git a/app/static/umeditor/lang/zh-cn/images/imglabel.png b/app/static/umeditor/lang/zh-cn/images/imglabel.png deleted file mode 100644 index 4fc3c888..00000000 Binary files a/app/static/umeditor/lang/zh-cn/images/imglabel.png and /dev/null differ diff --git a/app/static/umeditor/lang/zh-cn/images/localimage.png b/app/static/umeditor/lang/zh-cn/images/localimage.png deleted file mode 100644 index 7303c364..00000000 Binary files a/app/static/umeditor/lang/zh-cn/images/localimage.png and /dev/null differ diff --git a/app/static/umeditor/lang/zh-cn/images/music.png b/app/static/umeditor/lang/zh-cn/images/music.png deleted file mode 100644 index 354edebc..00000000 Binary files a/app/static/umeditor/lang/zh-cn/images/music.png and /dev/null differ diff --git a/app/static/umeditor/lang/zh-cn/images/upload.png b/app/static/umeditor/lang/zh-cn/images/upload.png deleted file mode 100644 index 08d4d926..00000000 Binary files a/app/static/umeditor/lang/zh-cn/images/upload.png and /dev/null differ diff --git a/app/static/umeditor/lang/zh-cn/zh-cn.js b/app/static/umeditor/lang/zh-cn/zh-cn.js deleted file mode 100644 index ded5cd55..00000000 --- a/app/static/umeditor/lang/zh-cn/zh-cn.js +++ /dev/null @@ -1,150 +0,0 @@ -/** - * 中文语言包 - */ -UM.I18N['zh-cn'] = { - 'labelMap':{ - 'anchor':'锚点', 'undo':'撤销', 'redo':'重做', 'bold':'加粗', 'indent':'首行缩进', 'snapscreen':'截图', - 'italic':'斜体', 'underline':'下划线', 'strikethrough':'删除线', 'subscript':'下标','fontborder':'字符边框', - 'superscript':'上标', 'formatmatch':'格式刷', 'source':'源代码', 'blockquote':'引用', - 'pasteplain':'纯文本粘贴模式', 'selectall':'全选', 'print':'打印', 'preview':'预览', - 'horizontal':'分隔线', 'removeformat':'清除格式', 'time':'时间', 'date':'日期', - 'unlink':'取消链接', 'insertrow':'前插入行', 'insertcol':'前插入列', 'mergeright':'右合并单元格', 'mergedown':'下合并单元格', - 'deleterow':'删除行', 'deletecol':'删除列', 'splittorows':'拆分成行', 'splittocols':'拆分成列', 'splittocells':'完全拆分单元格', - 'mergecells':'合并多个单元格', 'deletetable':'删除表格', 'cleardoc':'清空文档','insertparagraphbeforetable':"表格前插入行",'insertcode':'代码语言','fontfamily':'字体', 'fontsize':'字号', 'paragraph':'段落格式', 'image':'图片', - 'edittable':'表格属性','edittd':'单元格属性', 'link':'超链接','emotion':'表情', 'spechars':'特殊字符', 'searchreplace':'查询替换', 'map':'百度地图', 'gmap':'Google地图', - 'video':'视频', 'help':'帮助', 'justifyleft':'居左对齐', 'justifyright':'居右对齐', 'justifycenter':'居中对齐', - 'justifyjustify':'两端对齐', 'forecolor':'字体颜色', 'backcolor':'背景色', 'insertorderedlist':'有序列表', - 'insertunorderedlist':'无序列表', 'fullscreen':'全屏', 'directionalityltr':'从左向右输入', 'directionalityrtl':'从右向左输入', - 'rowspacingtop':'段前距', 'rowspacingbottom':'段后距', 'highlightcode':'插入代码', 'pagebreak':'分页', 'insertframe':'插入Iframe', 'imagenone':'默认', - 'imageleft':'左浮动', 'imageright':'右浮动', 'attachment':'附件', 'imagecenter':'居中', 'wordimage':'图片转存', - 'lineheight':'行间距','edittip' :'编辑提示','customstyle':'自定义标题', 'autotypeset':'自动排版', 'webapp':'百度应用', - 'touppercase':'字母大写', 'tolowercase':'字母小写','background':'背景','template':'模板','scrawl':'涂鸦','music':'音乐','inserttable':'插入表格', - 'drafts': '草稿箱', 'formula':'数学公式' - - - }, - 'paragraph':{'p':'段落', 'h1':'标题 1', 'h2':'标题 2', 'h3':'标题 3', 'h4':'标题 4', 'h5':'标题 5', 'h6':'标题 6'}, - 'fontfamily':{ - 'songti':'宋体', - 'kaiti':'楷体', - 'heiti':'黑体', - 'lishu':'隶书', - 'yahei':'微软雅黑', - 'andaleMono':'andale mono', - 'arial': 'arial', - 'arialBlack':'arial black', - 'comicSansMs':'comic sans ms', - 'impact':'impact', - 'timesNewRoman':'times new roman' - }, - 'ok':"确认", - 'cancel':"取消", - 'closeDialog':"关闭对话框", - 'tableDrag':"表格拖动必须引入uiUtils.js文件!", - 'autofloatMsg':"工具栏浮动依赖编辑器UI,您首先需要引入UI文件!", - 'anthorMsg':"链接", - 'clearColor':'清空颜色', - 'standardColor':'标准颜色', - 'themeColor':'主题颜色', - 'property':'属性', - 'default':'默认', - 'modify':'修改', - 'justifyleft':'左对齐', - 'justifyright':'右对齐', - 'justifycenter':'居中', - 'justify':'默认', - 'clear':'清除', - 'anchorMsg':'锚点', - 'delete':'删除', - 'clickToUpload':"点击上传", - 'unset':'尚未设置语言文件', - 't_row':'行', - 't_col':'列', - 'more':'更多', - 'pasteOpt':'粘贴选项', - 'pasteSourceFormat':"保留源格式", - 'tagFormat':'只保留标签', - 'pasteTextFormat':'只保留文本', - - //===============dialog i18N======================= - 'image':{ - 'static':{ - 'lang_tab_local':"本地上传", - 'lang_tab_imgSearch':"网络图片", - 'lang_input_dragTip':"支持图片拖拽上传", - 'lang_btn_add':"添加" - }, - 'uploadError': '上传出错' - }, - 'emotion':{ - 'static':{ - 'lang_input_choice':'精选', - 'lang_input_Tuzki':'兔斯基', - 'lang_input_BOBO':'BOBO', - 'lang_input_lvdouwa':'绿豆蛙', - 'lang_input_babyCat':'baby猫', - 'lang_input_bubble':'泡泡', - 'lang_input_youa':'有啊' - } - }, - 'gmap':{ - 'static':{ - 'lang_input_address':'地址', - 'lang_input_search':'搜索', - 'address':{'value':"北京"} - }, - 'searchError':'无法定位到该地址!' - }, - 'link':{ - 'static':{ - 'lang_input_text':'文本内容:', - 'lang_input_url':'链接地址:', - 'lang_input_title':'标题:', - 'lang_input_target':'是否在新窗口打开:' - }, - 'validLink':'只支持选中一个链接时生效', - 'httpPrompt':'您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀' - }, - 'map':{ - 'static':{ - 'lang_city':"城市", - 'lang_address':"地址", - 'city':{'value':"北京"}, - 'lang_search':"搜索", - 'lang_dynamicmap':"插入动态地图" - }, - 'cityMsg':"请选择城市", - 'errorMsg':"抱歉,找不到该位置!" - }, - 'video':{ - 'static':{ - 'lang_tab_insertV':"插入视频", - 'lang_video_url':"视频网址", - 'lang_video_size':"视频尺寸", - 'lang_videoW':"宽度", - 'lang_videoH':"高度", - 'lang_alignment':"对齐方式", - 'videoSearchTxt':{'value':"请输入搜索关键字!"}, - 'videoType':{'options':["全部", "热门", "娱乐", "搞笑", "体育", "科技", "综艺"]}, - 'videoSearchBtn':{'value':"百度一下"}, - 'videoSearchReset':{'value':"清空结果"} - }, - 'numError':"请输入正确的数值,如123,400", - 'floatLeft':"左浮动", - 'floatRight':"右浮动", - 'default':"默认", - 'block':"独占一行", - 'urlError':"输入的视频地址有误,请检查后再试!", - 'loading':"  视频加载中,请等待……", - 'clickToSelect':"点击选中", - 'goToSource':'访问源视频', - 'noVideo':"    抱歉,找不到对应的视频,请重试!" - }, - 'formula':{ - 'static':{ - 'lang_tab_common':'常用公式', - 'lang_tab_symbol':'符号', - 'lang_tab_letter':'字母' - } - } -}; \ No newline at end of file diff --git a/app/static/umeditor/themes/default/css/umeditor.css b/app/static/umeditor/themes/default/css/umeditor.css deleted file mode 100644 index c3841b9f..00000000 --- a/app/static/umeditor/themes/default/css/umeditor.css +++ /dev/null @@ -1,773 +0,0 @@ -.edui-container{ - position: relative; - border: 1px solid #d4d4d4; - box-shadow: 2px 2px 5px #d3d6da; - background-color: #fff; -} -.edui-container .edui-toolbar{ - position: relative; - width:auto; - border-bottom: 1px solid #e1e1e1; - box-shadow: 2px 2px 5px #d3d6da; - background-color: #fafafa; - z-index: 99999; -} -.edui-toolbar .edui-btn-toolbar{ - position: relative; - padding: 5px; -} -.edui-container .edui-editor-body{ - background-color: #fff; -} -.edui-editor-body .edui-body-container{ -} - -.edui-editor-body .edui-body-container p{margin:5px 0;} -.edui-editor-body .edui-body-container{ - border:0; - outline:none; - cursor:text; - padding:0 10px 0; - overflow:auto; - display:block; - word-wrap:break-word; - font-size:16px; - font-family:sans-serif; -} -.edui-editor-body.focus{border:1px solid #5c9dff} -.edui-editor-body table{margin:10px 0 10px;border-collapse:collapse;display:table;} -.edui-editor-body td{padding: 5px 10px;border: 1px solid #DDD;} -.edui-editor-body iframe.mathquill-embedded-latex{ - border: 0px; - padding: 0px; - display: inline; - margin: 0px; - background: none; - vertical-align: middle; - width: 0px; - height: 0px; -} -/*普通按钮*/ -.edui-btn-toolbar .edui-btn{ - position: relative; - display: inline-block; - vertical-align: top; - *display: inline; - *zoom:1; - width:auto; - margin: 0 1px; - padding:1px; - border:none; - background: none; -} -.edui-btn-toolbar .edui-btn .edui-icon{ - width: 20px; - height: 20px; - margin: 0; - padding:0; - background-repeat: no-repeat; - background-image: url(../images/icons.png); - background-image: url(../images/icons.gif) \9; -} - -/*状态反射*/ -.edui-btn-toolbar .edui-btn.edui-hover, -.edui-btn-toolbar .edui-btn.edui-active{ - background-color: #d5e1f2; - padding: 0; - border: 1px solid #a3bde3; - _z-index: 1; -} -.edui-btn-toolbar .edui-btn.edui-disabled{ - opacity: 0.3; - filter: alpha(opacity = 30); -} -.edui-btn-toolbar .edui-btn .edui-icon-source { - background-position:-260px -0px; -} -.edui-btn-toolbar .edui-btn .edui-icon-undo { - background-position: -160px 0; -} -.edui-btn-toolbar .edui-btn .edui-icon-redo { - background-position: -100px 0; -} -.edui-btn-toolbar .edui-btn .edui-icon-bold{ - background-position: 0 0; -} -.edui-btn-toolbar .edui-btn .edui-icon-italic { - background-position: -60px 0; -} -.edui-btn-toolbar .edui-btn .edui-icon-underline { - background-position: -140px 0 -} -.edui-btn-toolbar .edui-btn .edui-icon-strikethrough { - background-position: -120px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-superscript { - background-position: -620px 0; -} -.edui-btn-toolbar .edui-btn .edui-icon-subscript { - background-position: -600px 0; -} -.edui-btn-toolbar .edui-btn .edui-icon-font, .edui-btn-toolbar .edui-btn .edui-icon-forecolor { - background-position: -720px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-backcolor { - background-position: -760px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-insertorderedlist { - background-position: -80px 0; -} -.edui-btn-toolbar .edui-btn .edui-icon-insertunorderedlist { - background-position: -20px 0; -} -.edui-btn-toolbar .edui-btn .edui-icon-selectall { - background-position: -400px -20px; -} -.edui-btn-toolbar .edui-btn .edui-icon-cleardoc { - background-position: -520px 0; -} -.edui-btn-toolbar .edui-btn .edui-icon-paragraph { - background-position: -140px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-fontfamily { - background-position: -140px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-fontsize { - background-position: -140px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-justifyleft { - background-position: -460px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-justifycenter { - background-position: -420px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-justifyright { - background-position:-480px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-justifyjustify { - background-position: -440px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-link { - background-position: -500px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-unlink { - background-position: -640px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-image { - background-position: -380px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-emotion { - background-position: -60px -20px; -} -.edui-btn-toolbar .edui-btn .edui-icon-video { - background-position: -320px -20px; -} - -.edui-btn-toolbar .edui-btn .edui-icon-map { - background-position: -40px -40px; -} - -.edui-btn-toolbar .edui-btn .edui-icon-gmap { - background-position: -260px -40px; -} -.edui-btn-toolbar .edui-btn .edui-icon-horizontal { - background-position: -360px 0; -} - -.edui-btn-toolbar .edui-btn .edui-icon-print { - background-position: -440px -20px; -} -.edui-btn-toolbar .edui-btn .edui-icon-preview { - background-position: -420px -20px; -} - -.edui-btn-toolbar .edui-btn-fullscreen{ - float:right; -} -.edui-btn-toolbar .edui-btn .edui-icon-fullscreen { - background-position: -100px -20px; -} - -.edui-btn-toolbar .edui-btn .edui-icon-removeformat { - background-position: -580px 0; -} -.edui-btn-toolbar .edui-btn .edui-icon-drafts { - background-position: -560px 0; -} -.edui-btn-toolbar .edui-btn .edui-icon-formula { - background-position: -80px -20px; -} -.edui-btn-toolbar .edui-splitbutton{ - position: relative; - display: inline-block ; - vertical-align: top; - *display: inline ; - *zoom:1; - margin:0 2px; -} -.edui-splitbutton .edui-btn{ - margin: 0; -} -.edui-splitbutton .edui-caret{ - position: relative; - display: inline-block ; - vertical-align: top; - *display: inline ; - *zoom:1; - width: 8px; - height: 20px; - background: url(../images/icons.png) -741px 0; - _background: url(../images/icons.gif) -741px 0; -} - -.edui-btn-toolbar .edui-splitbutton, -.edui-btn-toolbar .edui-splitbutton{ - _border: none; -} - -/*状态反射*/ -.edui-btn-toolbar .edui-splitbutton.edui-hover .edui-btn{ - background-color: #d5e1f2; -} - -.edui-btn-toolbar .edui-splitbutton.edui-disabled{ - opacity: 0.3; - filter: alpha(opacity = 30); -} -.edui-btn-toolbar .edui-splitbutton.edui-disabled .edui-caret{ - opacity: 0.3 \0; - filter: alpha(opacity = 30)\0; -} - - -.edui-btn-toolbar .edui-combobox{ - border: 1px solid #CCC; - padding:0; - margin:0 2px; - line-height: 20px; -} -.edui-combobox .edui-button-label{ - position: relative; - display: inline-block; - vertical-align: top; - *display: inline ; - *zoom:1; - width:60px; - height:20px; - line-height: 20px; - padding: 2px; - margin: 0; - font-size: 12px; - text-align: center; - cursor: default; -} -.edui-combobox .edui-button-spacing{ - position: relative; - display: inline-block ; - vertical-align: top; - *display: inline ; - *zoom:1; - height:20px; - margin: 0; - padding:0 3px; -} -.edui-combobox .edui-caret{ - position: relative; - display: inline-block ; - vertical-align: top; - *display: inline ; - *zoom:1; - height:20px; - width: 12px; - margin: 0; - padding: 0; - background: url(../images/icons.png) -741px 0; - _background: url(../images/icons.gif) -741px 0; -} -.edui-btn-toolbar .edui-combobox.edui-disabled{ - opacity: 0.2; - filter: alpha(opacity = 20); -} -.edui-btn-toolbar .edui-combobox.edui-disabled .edui-button-label, -.edui-btn-toolbar .edui-combobox.edui-disabled .edui-caret{ - opacity: 0.2 \0; - filter: alpha(opacity = 20)\0; -} -.edui-combobox-menu{ - position: absolute; - top: 100%; - left: 0; - display: none; - list-style: none; - text-decoration: none; - margin: 0; - padding:5px; - background-color: #ffffff; - border: 1px solid #ccc; - font-size: 12px; - box-shadow: 2px 2px 5px #d3d6da; - min-width: 160px; - _width: 160px; -} - -.edui-combobox-menu .edui-combobox-item { - display: block; - border: 1px solid white; -} - -.edui-combobox-menu .edui-combobox-item-label { - height: 25px; - line-height: 25px; - display: inline-block; - _display: inline; - _zoom: 1; - margin-left: 10px; -} - -.edui-combobox-menu .edui-combobox-item:hover, .edui-combobox-menu .edui-combobox-stack-item:hover, .edui-combobox-menu .edui-combobox-item-hover { - background-color: #d5e1f2; - padding: 0; - border: 1px solid #a3bde3; -} - -.edui-combobox-menu .edui-combobox-item .edui-combobox-icon { - display: inline-block; - *zoom: 1; - *display: inline; - width: 24px; - height: 25px; - background: red; - vertical-align: bottom; - background: url(../images/ok.gif) no-repeat 1000px 1000px; -} - -.edui-combobox-menu .edui-combobox-checked .edui-combobox-icon { - background-position: 10px 7px; -} - - -.edui-combobox-menu .edui-combobox-item-separator { - min-width: 160px; - height: 1px; - line-height: 1px; - overflow: hidden; - background: #d3d3d3; - margin: 5px 0; - *margin-top: -8px; -} - -/* 字体样式校正 */ - -.edui-combobox-fontsize .edui-combobox-item-0.edui-combobox-checked .edui-combobox-icon { - background-position: 10px 7px; -} - -.edui-combobox-fontsize .edui-combobox-item-1.edui-combobox-checked .edui-combobox-icon { - background-position: 10px 7px; -} - -.edui-combobox-fontsize .edui-combobox-item-2.edui-combobox-checked .edui-combobox-icon { - background-position: 10px 7px; -} - -.edui-combobox-fontsize .edui-combobox-item-3.edui-combobox-checked .edui-combobox-icon { - background-position: 10px 7px; -} - -/* 24 */ -.edui-combobox-fontsize .edui-combobox-item-4 .edui-combobox-item-label { - height: 27px; - line-height: 27px; -} - -.edui-combobox-fontsize .edui-combobox-item-4.edui-combobox-checked .edui-combobox-icon { - background-position: 10px 5px; -} - -/* 32 */ -.edui-combobox-fontsize .edui-combobox-item-5 .edui-combobox-item-label { - height: 31px; - line-height: 31px; -} - -.edui-combobox-fontsize .edui-combobox-item-5.edui-combobox-checked .edui-combobox-icon { - background-position: 10px 4px; -} - - -/* 48 */ -.edui-combobox-fontsize .edui-combobox-item-6 .edui-combobox-item-label { - height: 47px; - line-height: 47px; -} - -/*.edui-combobox-fontsize .edui-combobox-item-6 .edui-combobox-icon {*/ - /*height: 25px;*/ - /*margin-bottom: 11px;*/ -/*}*/ - -/*.edui-combobox-fontsize .edui-combobox-item-6.edui-combobox-checked .edui-combobox-icon {*/ - /*background-position: 10px 7px;*/ -/*}*/ - - -/* 段落样式校正 */ -/* h1 */ -.edui-combobox-paragraph .edui-combobox-item-1 .edui-combobox-item-label { - font-size: 32px; - height: 36px; - line-height: 36px; -} - -.edui-combobox-paragraph .edui-combobox-item-1 .edui-combobox-icon { - height: 25px; - margin-bottom: 5px; -} - -.edui-combobox-paragraph .edui-combobox-item-1.edui-combobox-checked .edui-combobox-icon { - background-position: 10px 7px; -} - -/* h2 */ -.edui-combobox-paragraph .edui-combobox-item-2 .edui-combobox-item-label { - font-size: 28px; - height: 27px; - line-height: 27px; -} - -.edui-combobox-paragraph .edui-combobox-item-2 .edui-combobox-icon { - margin-bottom: 5px; -} - -.edui-combobox-paragraph .edui-combobox-item-2.edui-combobox-checked .edui-combobox-icon { - background-position: 10px 10px; -} - -/* h3 */ -.edui-combobox-paragraph .edui-combobox-item-3 .edui-combobox-item-label { - font-size: 24px; - height: 25px; - line-height: 25px; -} - -.edui-combobox-paragraph .edui-combobox-item-3 .edui-combobox-icon { - height: 25px; - margin-bottom: 5px; -} - -.edui-combobox-paragraph .edui-combobox-item-3.edui-combobox-checked .edui-combobox-icon { - background-position: 10px 11px; -} - -/* h4 */ -.edui-combobox-paragraph .edui-combobox-item-4 .edui-combobox-item-label { - font-size: 18px; - height: 25px; - line-height: 25px; -} - -.edui-combobox-paragraph .edui-combobox-item-4.edui-combobox-checked .edui-combobox-icon { - background-position: 10px 6px; -} - -/* h5 */ -.edui-combobox-paragraph .edui-combobox-item-5 .edui-combobox-item-label { - font-size: 16px; -} - -/* h6 */ -.edui-combobox-paragraph .edui-combobox-item-6 .edui-combobox-item-label { - font-size: 12px; -} -.edui-modal { - position: fixed; - _position: absolute; - top: 10%; - left: 50%; - border: 1px solid #acacac; - box-shadow: 2px 2px 5px #d3d6da; - background-color: #ffffff; - outline: 0; -} -.edui-modal-header { - padding: 5px 10px; - border-bottom: 1px solid #eee; -} -.edui-modal-header .edui-close { - float: right; - width:20px; - height:20px; - margin-top: 2px; - padding: 1px; - border: 0; - background: url("../images/close.png") no-repeat center center; - cursor: pointer; -} -.edui-modal-header .edui-close.edui-hover { - background-color: #d5e1f2; - padding:0; - border: 1px solid #a3bde3; -} -.edui-modal-header .edui-title { - margin: 0; - line-height: 25px; - font-size: 20px; -} -.edui-modal-body { - position: relative; - max-height: 400px; - font-size: 12px; - overflow-y: auto; -} -.edui-modal-footer { - float: right; - padding: 5px 15px 15px; - overflow: hidden; -} -.edui-modal-footer .edui-btn { - float: left; - height: 24px; - width: 96px; - margin: 0 10px; - background-color: #ffffff; - padding: 0; - border: 1px solid #ababab; - font-size: 12px; - line-height: 24px; - text-align: center; - cursor: pointer; -} -.edui-modal-footer .edui-btn.edui-hover{ - background-color: #d5e1f2; - border: 1px solid #a3bde3; -} -.edui-modal-backdrop{ - opacity: 0.5; - filter: alpha(opacity=50); - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - background-color: #c6c6c6; -} - -.edui-modal .edui-modal-tip { - color: red; - position: absolute; - bottom: 10px; - left: 10px; - height: 30px; - line-height: 30px; - display: none; -} -/*图片上传*/ -.edui-dialog-image-body { - width: 700px; - height: 400px; -} -/*插入视频*/ -.edui-dialog-video-body{ - width: 600px; - height: 350px; -} -/*谷歌地图*/ -.edui-dialog-gmap-body{ - width:550px; - height: 400px; -} - -/*百度地图*/ -.edui-dialog-map-body{ - width:580px; - height: 400px; -} - -/*链接*/ -.edui-dialog-link-body{ - width:400px; - height:200px; -} -.edui-popup{ - display: none; - background: url('../images/pop-bg.png') repeat #fff; - padding: 2px; -} -.edui-popup .edui-popup-body{ - border: 1px solid #bfbfbf; - background-color: #fff; -} -.edui-popup .edui-popup-caret{ - width: 21px; - height: 11px; -} -.edui-popup .edui-popup-caret.up{ - background:url('../images/caret.png') no-repeat 0 0; -} -.edui-popup .edui-popup-caret.down{ - background:url('../images/caret.png') no-repeat 0 0; -} - - -.edui-tab-nav { - margin: 0; - padding:0; - border-bottom: 1px solid #ddd; - list-style: none; - height:30px; -} -.edui-tab-nav .edui-tab-item { - float:left; - margin-bottom: -1px; - margin-top: 1px; - margin-top: 0\9; -} -.edui-tab-nav .edui-tab-item .edui-tab-text{ - display: block; - padding:8px 12px; - border: 1px solid transparent; - color: #0088cc; - text-decoration: none; - outline: 0; - _border:1px solid #fff ; - cursor: pointer; -} -.edui-tab-nav .edui-tab-item .edui-tab-text:FOCUS { - outline: none; -} -.edui-tab-nav .edui-tab-item.edui-active .edui-tab-text{ - border: 1px solid #ddd; - border-bottom-color: transparent; - background-color: #fff; - padding:8px 12px; - color: #555555; - cursor: default; -} -.edui-tab-content .edui-tab-pane{ - padding: 1px; - position: relative; - display: none; - background-color: #fff; - clear: both; -} -.edui-tab-content .edui-tab-pane.edui-active{ - display: block; -} - - -.edui-btn-toolbar .edui-tooltip{ - position: absolute; - padding: 5px 0; - display: none; - /*opacity: 0.8;*/ - /*filter: alpha(opacity=80);*/ - z-index: 99999; -} -.edui-tooltip .edui-tooltip-arrow{ - position: absolute; - top: 0; - _top: -2px; - left: 50%; - width: 0; - height: 0; - padding: 0; - font-size:0; - margin-left: -5px; - border-color: transparent; - border-style: dashed dashed solid dashed; - border-bottom-color: #000000; - border-width: 0 5px 5px; - background: transparent; -} -.edui-tooltip .edui-tooltip-inner{ - padding: 6px; - color: #ffffff; - text-align: center; - text-decoration: none; - font-size: 10px; - background-color: #000000; - white-space: nowrap; - line-height: 12px; -} -.edui-splitbutton-color-label { - width: 16px; - height: 3px; - position: absolute; - bottom: 2px; - left: 50%; - margin-left: -8px; - overflow: hidden; - line-height: 3px; -} -.edui-popup .edui-colorpicker { - margin: 10px; - font-size: 12px; -} -.edui-colorpicker .edui-colorpicker-topbar{ - height: 27px; - width: 200px; - overflow: hidden; -} -.edui-colorpicker .edui-colorpicker-topbar .edui-colorpicker-preview{ - height: 20px; - border: 1px inset black; - margin-left: 1px; - width: 128px; - float: left; -} -.edui-colorpicker .edui-colorpicker-topbar .edui-colorpicker-nocolor{ - float: right; - margin-right: 1px; - font-size: 12px; - line-height: 14px; - height: 14px; - border: 1px solid #333; - padding: 3px 5px; - cursor: pointer; -} -.edui-colorpicker table{ - border-collapse: collapse; - border-spacing: 2px; -} -.edui-colorpicker tr.edui-colorpicker-firstrow{ - height: 30px; -} -.edui-colorpicker table td{ - padding: 0 2px; -} -.edui-colorpicker table td .edui-colorpicker-colorcell{ - display: block; - text-decoration: none; - color: black; - width: 14px; - height: 14px; - margin: 0; - cursor: pointer; -} -.edui-toolbar .edui-separator{ - width: 2px; - height: 20px; - padding: 1px 2px; - background: url(../images/icons.png) -179px 1px; - background: url(../images/icons.gif) -179px 1px \9; - display: inline-block ; - vertical-align: top; - *display: inline ; - *zoom:1; - border:none; - -} \ No newline at end of file diff --git a/app/static/umeditor/themes/default/css/umeditor.min.css b/app/static/umeditor/themes/default/css/umeditor.min.css deleted file mode 100644 index 32676357..00000000 --- a/app/static/umeditor/themes/default/css/umeditor.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * UEditor Mini版本 - * version: 1.2.2 - * build: Wed Mar 19 2014 17:14:14 GMT+0800 (中国标准时间) - */ - - -.edui-container{position:relative;border:1px solid #d4d4d4;box-shadow:2px 2px 5px #d3d6da;background-color:#fff}.edui-container .edui-toolbar{position:relative;width:auto;border-bottom:1px solid #e1e1e1;box-shadow:2px 2px 5px #d3d6da;background-color:#fafafa;z-index:99999}.edui-toolbar .edui-btn-toolbar{position:relative;padding:5px}.edui-container .edui-editor-body{background-color:#fff}.edui-editor-body .edui-body-container{}.edui-editor-body .edui-body-container p{margin:5px 0}.edui-editor-body .edui-body-container{border:0;outline:0;cursor:text;padding:0 10px;overflow:auto;display:block;word-wrap:break-word;font-size:16px;font-family:sans-serif}.edui-editor-body.focus{border:1px solid #5c9dff}.edui-editor-body table{margin:10px 0;border-collapse:collapse;display:table}.edui-editor-body td{padding:5px 10px;border:1px solid #DDD}.edui-editor-body iframe.mathquill-embedded-latex{border:0;padding:0;display:inline;margin:0;background:0 0;vertical-align:middle;width:0;height:0}.edui-btn-toolbar .edui-btn{position:relative;display:inline-block;vertical-align:top;*display:inline;*zoom:1;width:auto;margin:0 1px;padding:1px;border:0;background:0 0}.edui-btn-toolbar .edui-btn .edui-icon{width:20px;height:20px;margin:0;padding:0;background-repeat:no-repeat;background-image:url(../images/icons.png);background-image:url(../images/icons.gif) \9}.edui-btn-toolbar .edui-btn.edui-hover,.edui-btn-toolbar .edui-btn.edui-active{background-color:#d5e1f2;padding:0;border:1px solid #a3bde3;_z-index:1}.edui-btn-toolbar .edui-btn.edui-disabled{opacity:.3;filter:alpha(opacity=30)}.edui-btn-toolbar .edui-btn .edui-icon-source{background-position:-260px -0px}.edui-btn-toolbar .edui-btn .edui-icon-undo{background-position:-160px 0}.edui-btn-toolbar .edui-btn .edui-icon-redo{background-position:-100px 0}.edui-btn-toolbar .edui-btn .edui-icon-bold{background-position:0 0}.edui-btn-toolbar .edui-btn .edui-icon-italic{background-position:-60px 0}.edui-btn-toolbar .edui-btn .edui-icon-underline{background-position:-140px 0}.edui-btn-toolbar .edui-btn .edui-icon-strikethrough{background-position:-120px 0}.edui-btn-toolbar .edui-btn .edui-icon-superscript{background-position:-620px 0}.edui-btn-toolbar .edui-btn .edui-icon-subscript{background-position:-600px 0}.edui-btn-toolbar .edui-btn .edui-icon-font,.edui-btn-toolbar .edui-btn .edui-icon-forecolor{background-position:-720px 0}.edui-btn-toolbar .edui-btn .edui-icon-backcolor{background-position:-760px 0}.edui-btn-toolbar .edui-btn .edui-icon-insertorderedlist{background-position:-80px 0}.edui-btn-toolbar .edui-btn .edui-icon-insertunorderedlist{background-position:-20px 0}.edui-btn-toolbar .edui-btn .edui-icon-selectall{background-position:-400px -20px}.edui-btn-toolbar .edui-btn .edui-icon-cleardoc{background-position:-520px 0}.edui-btn-toolbar .edui-btn .edui-icon-paragraph{background-position:-140px 0}.edui-btn-toolbar .edui-btn .edui-icon-fontfamily{background-position:-140px 0}.edui-btn-toolbar .edui-btn .edui-icon-fontsize{background-position:-140px 0}.edui-btn-toolbar .edui-btn .edui-icon-justifyleft{background-position:-460px 0}.edui-btn-toolbar .edui-btn .edui-icon-justifycenter{background-position:-420px 0}.edui-btn-toolbar .edui-btn .edui-icon-justifyright{background-position:-480px 0}.edui-btn-toolbar .edui-btn .edui-icon-justifyjustify{background-position:-440px 0}.edui-btn-toolbar .edui-btn .edui-icon-link{background-position:-500px 0}.edui-btn-toolbar .edui-btn .edui-icon-unlink{background-position:-640px 0}.edui-btn-toolbar .edui-btn .edui-icon-image{background-position:-380px 0}.edui-btn-toolbar .edui-btn .edui-icon-emotion{background-position:-60px -20px}.edui-btn-toolbar .edui-btn .edui-icon-video{background-position:-320px -20px}.edui-btn-toolbar .edui-btn .edui-icon-map{background-position:-40px -40px}.edui-btn-toolbar .edui-btn .edui-icon-gmap{background-position:-260px -40px}.edui-btn-toolbar .edui-btn .edui-icon-horizontal{background-position:-360px 0}.edui-btn-toolbar .edui-btn .edui-icon-print{background-position:-440px -20px}.edui-btn-toolbar .edui-btn .edui-icon-preview{background-position:-420px -20px}.edui-btn-toolbar .edui-btn-fullscreen{float:right}.edui-btn-toolbar .edui-btn .edui-icon-fullscreen{background-position:-100px -20px}.edui-btn-toolbar .edui-btn .edui-icon-removeformat{background-position:-580px 0}.edui-btn-toolbar .edui-btn .edui-icon-drafts{background-position:-560px 0}.edui-btn-toolbar .edui-btn .edui-icon-formula{background-position:-80px -20px}.edui-btn-toolbar .edui-splitbutton{position:relative;display:inline-block;vertical-align:top;*display:inline;*zoom:1;margin:0 2px}.edui-splitbutton .edui-btn{margin:0}.edui-splitbutton .edui-caret{position:relative;display:inline-block;vertical-align:top;*display:inline;*zoom:1;width:8px;height:20px;background:url(../images/icons.png) -741px 0;_background:url(../images/icons.gif) -741px 0}.edui-btn-toolbar .edui-splitbutton,.edui-btn-toolbar .edui-splitbutton{_border:0}.edui-btn-toolbar .edui-splitbutton.edui-hover .edui-btn{background-color:#d5e1f2}.edui-btn-toolbar .edui-splitbutton.edui-disabled{opacity:.3;filter:alpha(opacity=30)}.edui-btn-toolbar .edui-splitbutton.edui-disabled .edui-caret{opacity:.3 \0;filter:alpha(opacity=30)\0}.edui-btn-toolbar .edui-combobox{border:1px solid #CCC;padding:0;margin:0 2px;line-height:20px}.edui-combobox .edui-button-label{position:relative;display:inline-block;vertical-align:top;*display:inline;*zoom:1;width:60px;height:20px;line-height:20px;padding:2px;margin:0;font-size:12px;text-align:center;cursor:default}.edui-combobox .edui-button-spacing{position:relative;display:inline-block;vertical-align:top;*display:inline;*zoom:1;height:20px;margin:0;padding:0 3px}.edui-combobox .edui-caret{position:relative;display:inline-block;vertical-align:top;*display:inline;*zoom:1;height:20px;width:12px;margin:0;padding:0;background:url(../images/icons.png) -741px 0;_background:url(../images/icons.gif) -741px 0}.edui-btn-toolbar .edui-combobox.edui-disabled{opacity:.2;filter:alpha(opacity=20)}.edui-btn-toolbar .edui-combobox.edui-disabled .edui-button-label,.edui-btn-toolbar .edui-combobox.edui-disabled .edui-caret{opacity:.2 \0;filter:alpha(opacity=20)\0}.edui-combobox-menu{position:absolute;top:100%;left:0;display:none;list-style:none;text-decoration:none;margin:0;padding:5px;background-color:#fff;border:1px solid #ccc;font-size:12px;box-shadow:2px 2px 5px #d3d6da;min-width:160px;_width:160px}.edui-combobox-menu .edui-combobox-item{display:block;border:1px solid #fff}.edui-combobox-menu .edui-combobox-item-label{height:25px;line-height:25px;display:inline-block;_display:inline;_zoom:1;margin-left:10px}.edui-combobox-menu .edui-combobox-item:hover,.edui-combobox-menu .edui-combobox-stack-item:hover,.edui-combobox-menu .edui-combobox-item-hover{background-color:#d5e1f2;padding:0;border:1px solid #a3bde3}.edui-combobox-menu .edui-combobox-item .edui-combobox-icon{display:inline-block;*zoom:1;*display:inline;width:24px;height:25px;background:red;vertical-align:bottom;background:url(../images/ok.gif) no-repeat 1000px 1000px}.edui-combobox-menu .edui-combobox-checked .edui-combobox-icon{background-position:10px 7px}.edui-combobox-menu .edui-combobox-item-separator{min-width:160px;height:1px;line-height:1px;overflow:hidden;background:#d3d3d3;margin:5px 0;*margin-top:-8px}.edui-combobox-fontsize .edui-combobox-item-0.edui-combobox-checked .edui-combobox-icon{background-position:10px 7px}.edui-combobox-fontsize .edui-combobox-item-1.edui-combobox-checked .edui-combobox-icon{background-position:10px 7px}.edui-combobox-fontsize .edui-combobox-item-2.edui-combobox-checked .edui-combobox-icon{background-position:10px 7px}.edui-combobox-fontsize .edui-combobox-item-3.edui-combobox-checked .edui-combobox-icon{background-position:10px 7px}.edui-combobox-fontsize .edui-combobox-item-4 .edui-combobox-item-label{height:27px;line-height:27px}.edui-combobox-fontsize .edui-combobox-item-4.edui-combobox-checked .edui-combobox-icon{background-position:10px 5px}.edui-combobox-fontsize .edui-combobox-item-5 .edui-combobox-item-label{height:31px;line-height:31px}.edui-combobox-fontsize .edui-combobox-item-5.edui-combobox-checked .edui-combobox-icon{background-position:10px 4px}.edui-combobox-fontsize .edui-combobox-item-6 .edui-combobox-item-label{height:47px;line-height:47px}.edui-combobox-paragraph .edui-combobox-item-1 .edui-combobox-item-label{font-size:32px;height:36px;line-height:36px}.edui-combobox-paragraph .edui-combobox-item-1 .edui-combobox-icon{height:25px;margin-bottom:5px}.edui-combobox-paragraph .edui-combobox-item-1.edui-combobox-checked .edui-combobox-icon{background-position:10px 7px}.edui-combobox-paragraph .edui-combobox-item-2 .edui-combobox-item-label{font-size:28px;height:27px;line-height:27px}.edui-combobox-paragraph .edui-combobox-item-2 .edui-combobox-icon{margin-bottom:5px}.edui-combobox-paragraph .edui-combobox-item-2.edui-combobox-checked .edui-combobox-icon{background-position:10px 10px}.edui-combobox-paragraph .edui-combobox-item-3 .edui-combobox-item-label{font-size:24px;height:25px;line-height:25px}.edui-combobox-paragraph .edui-combobox-item-3 .edui-combobox-icon{height:25px;margin-bottom:5px}.edui-combobox-paragraph .edui-combobox-item-3.edui-combobox-checked .edui-combobox-icon{background-position:10px 11px}.edui-combobox-paragraph .edui-combobox-item-4 .edui-combobox-item-label{font-size:18px;height:25px;line-height:25px}.edui-combobox-paragraph .edui-combobox-item-4.edui-combobox-checked .edui-combobox-icon{background-position:10px 6px}.edui-combobox-paragraph .edui-combobox-item-5 .edui-combobox-item-label{font-size:16px}.edui-combobox-paragraph .edui-combobox-item-6 .edui-combobox-item-label{font-size:12px}.edui-modal{position:fixed;_position:absolute;top:10%;left:50%;border:1px solid #acacac;box-shadow:2px 2px 5px #d3d6da;background-color:#fff;outline:0}.edui-modal-header{padding:5px 10px;border-bottom:1px solid #eee}.edui-modal-header .edui-close{float:right;width:20px;height:20px;margin-top:2px;padding:1px;border:0;background:url(../images/close.png) no-repeat center center;cursor:pointer}.edui-modal-header .edui-close.edui-hover{background-color:#d5e1f2;padding:0;border:1px solid #a3bde3}.edui-modal-header .edui-title{margin:0;line-height:25px;font-size:20px}.edui-modal-body{position:relative;max-height:400px;font-size:12px;overflow-y:auto}.edui-modal-footer{float:right;padding:5px 15px 15px;overflow:hidden}.edui-modal-footer .edui-btn{float:left;height:24px;width:96px;margin:0 10px;background-color:#fff;padding:0;border:1px solid #ababab;font-size:12px;line-height:24px;text-align:center;cursor:pointer}.edui-modal-footer .edui-btn.edui-hover{background-color:#d5e1f2;border:1px solid #a3bde3}.edui-modal-backdrop{opacity:.5;filter:alpha(opacity=50);position:fixed;top:0;right:0;bottom:0;left:0;background-color:#c6c6c6}.edui-modal .edui-modal-tip{color:red;position:absolute;bottom:10px;left:10px;height:30px;line-height:30px;display:none}.edui-dialog-image-body{width:700px;height:400px}.edui-dialog-video-body{width:600px;height:350px}.edui-dialog-gmap-body{width:550px;height:400px}.edui-dialog-map-body{width:580px;height:400px}.edui-dialog-link-body{width:400px;height:200px}.edui-popup{display:none;background:url(../images/pop-bg.png) repeat #fff;padding:2px}.edui-popup .edui-popup-body{border:1px solid #bfbfbf;background-color:#fff}.edui-popup .edui-popup-caret{width:21px;height:11px}.edui-popup .edui-popup-caret.up{background:url(../images/caret.png) no-repeat 0 0}.edui-popup .edui-popup-caret.down{background:url(../images/caret.png) no-repeat 0 0}.edui-tab-nav{margin:0;padding:0;border-bottom:1px solid #ddd;list-style:none;height:30px}.edui-tab-nav .edui-tab-item{float:left;margin-bottom:-1px;margin-top:1px;margin-top:0\9}.edui-tab-nav .edui-tab-item .edui-tab-text{display:block;padding:8px 12px;border:1px solid transparent;color:#08c;text-decoration:none;outline:0;_border:1px solid #fff;cursor:pointer}.edui-tab-nav .edui-tab-item .edui-tab-text:FOCUS{outline:0}.edui-tab-nav .edui-tab-item.edui-active .edui-tab-text{border:1px solid #ddd;border-bottom-color:transparent;background-color:#fff;padding:8px 12px;color:#555;cursor:default}.edui-tab-content .edui-tab-pane{padding:1px;position:relative;display:none;background-color:#fff;clear:both}.edui-tab-content .edui-tab-pane.edui-active{display:block}.edui-btn-toolbar .edui-tooltip{position:absolute;padding:5px 0;display:none;z-index:99999}.edui-tooltip .edui-tooltip-arrow{position:absolute;top:0;_top:-2px;left:50%;width:0;height:0;padding:0;font-size:0;margin-left:-5px;border-color:transparent;border-style:dashed dashed solid;border-bottom-color:#000;border-width:0 5px 5px;background:transparent}.edui-tooltip .edui-tooltip-inner{padding:6px;color:#fff;text-align:center;text-decoration:none;font-size:10px;background-color:#000;white-space:nowrap;line-height:12px}.edui-splitbutton-color-label{width:16px;height:3px;position:absolute;bottom:2px;left:50%;margin-left:-8px;overflow:hidden;line-height:3px}.edui-popup .edui-colorpicker{margin:10px;font-size:12px}.edui-colorpicker .edui-colorpicker-topbar{height:27px;width:200px;overflow:hidden}.edui-colorpicker .edui-colorpicker-topbar .edui-colorpicker-preview{height:20px;border:1px inset #000;margin-left:1px;width:128px;float:left}.edui-colorpicker .edui-colorpicker-topbar .edui-colorpicker-nocolor{float:right;margin-right:1px;font-size:12px;line-height:14px;height:14px;border:1px solid #333;padding:3px 5px;cursor:pointer}.edui-colorpicker table{border-collapse:collapse;border-spacing:2px}.edui-colorpicker tr.edui-colorpicker-firstrow{height:30px}.edui-colorpicker table td{padding:0 2px}.edui-colorpicker table td .edui-colorpicker-colorcell{display:block;text-decoration:none;color:#000;width:14px;height:14px;margin:0;cursor:pointer}.edui-toolbar .edui-separator{width:2px;height:20px;padding:1px 2px;background:url(../images/icons.png) -179px 1px;background:url(../images/icons.gif) -179px 1px \9;display:inline-block;vertical-align:top;*display:inline;*zoom:1;border:0} \ No newline at end of file diff --git a/app/static/umeditor/themes/default/images/caret.png b/app/static/umeditor/themes/default/images/caret.png deleted file mode 100644 index cf069475..00000000 Binary files a/app/static/umeditor/themes/default/images/caret.png and /dev/null differ diff --git a/app/static/umeditor/themes/default/images/close.png b/app/static/umeditor/themes/default/images/close.png deleted file mode 100644 index a57693f6..00000000 Binary files a/app/static/umeditor/themes/default/images/close.png and /dev/null differ diff --git a/app/static/umeditor/themes/default/images/icons.gif b/app/static/umeditor/themes/default/images/icons.gif deleted file mode 100644 index 82065607..00000000 Binary files a/app/static/umeditor/themes/default/images/icons.gif and /dev/null differ diff --git a/app/static/umeditor/themes/default/images/icons.png b/app/static/umeditor/themes/default/images/icons.png deleted file mode 100644 index de9a1bb2..00000000 Binary files a/app/static/umeditor/themes/default/images/icons.png and /dev/null differ diff --git a/app/static/umeditor/themes/default/images/ok.gif b/app/static/umeditor/themes/default/images/ok.gif deleted file mode 100644 index 9d1362c0..00000000 Binary files a/app/static/umeditor/themes/default/images/ok.gif and /dev/null differ diff --git a/app/static/umeditor/themes/default/images/pop-bg.png b/app/static/umeditor/themes/default/images/pop-bg.png deleted file mode 100644 index d7a5a301..00000000 Binary files a/app/static/umeditor/themes/default/images/pop-bg.png and /dev/null differ diff --git a/app/static/umeditor/themes/default/images/spacer.gif b/app/static/umeditor/themes/default/images/spacer.gif deleted file mode 100644 index 5bfd67a2..00000000 Binary files a/app/static/umeditor/themes/default/images/spacer.gif and /dev/null differ diff --git a/app/static/umeditor/themes/default/images/videologo.gif b/app/static/umeditor/themes/default/images/videologo.gif deleted file mode 100644 index 555af741..00000000 Binary files a/app/static/umeditor/themes/default/images/videologo.gif and /dev/null differ diff --git a/app/static/umeditor/third-party/jquery.min.js b/app/static/umeditor/third-party/jquery.min.js deleted file mode 100644 index 0de648ed..00000000 --- a/app/static/umeditor/third-party/jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.6.4 | (c) OpenJS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.4",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.cssHas=ce(function(){try{return C.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),d.cssHas||y.push(":has"),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",v.option=!!ce.lastChild;var ge={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
    ",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 - - - -This is a custom SVG webfont generated by Font Squirrel. -Designer : George Douros -Foundry : Free -Foundry URL : http://users.teilar.gr/_g1951d/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/static/umeditor/third-party/mathquill/font/Symbola.ttf b/app/static/umeditor/third-party/mathquill/font/Symbola.ttf deleted file mode 100644 index 52337df9..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/Symbola.ttf and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/font/Symbola.woff b/app/static/umeditor/third-party/mathquill/font/Symbola.woff deleted file mode 100644 index b9bba239..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/Symbola.woff and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/STIXFontLicense2010.txt b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/STIXFontLicense2010.txt deleted file mode 100644 index 753593c7..00000000 --- a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/STIXFontLicense2010.txt +++ /dev/null @@ -1,103 +0,0 @@ -STIX Font License - -24 May 2010 - -Copyright (c) 2001-2010 by the STI Pub Companies, consisting of the American -Institute of Physics, the American Chemical Society, the American Mathematical -Society, the American Physical Society, Elsevier, Inc., and The Institute of -Electrical and Electronic Engineers, Inc. (www.stixfonts.org), with Reserved -Font Name STIX Fonts, STIX Fonts (TM) is a trademark of The Institute of -Electrical and Electronics Engineers, Inc. - -Portions copyright (c) 1998-2003 by MicroPress, Inc. (www.micropress-inc.com), -with Reserved Font Name TM Math. To obtain additional mathematical fonts, please -contact MicroPress, Inc., 68-30 Harrow Street, Forest Hills, NY 11375, USA, -Phone: (718) 575-1816. - -Portions copyright (c) 1990 by Elsevier, Inc. - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - ---------------------------------------------------------------------------- -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ---------------------------------------------------------------------------- - -PREAMBLE - -The goals of the Open Font License (OFL) are to stimulate worldwide development -of collaborative font projects, to support the font creation efforts of academic -and linguistic communities, and to provide a free and open framework in which -fonts may be shared and improved in partnership with others. - -The OFL allows the licensed fonts to be used, studied, modified and redistributed -freely as long as they are not sold by themselves. The fonts, including any -derivative works, can be bundled, embedded, redistributed and/or sold with any -software provided that any reserved names are not used by derivative works. The -fonts and derivatives, however, cannot be released under any other type of license. -The requirement for fonts to remain under this license does not apply to any -document created using the fonts or their derivatives. - -DEFINITIONS - -"Font Software" refers to the set of files released by the Copyright Holder(s) under -this license and clearly marked as such. This may include source files, build -scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the copyright -statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, or -substituting -- in part or in whole -- any of the components of the Original Version, -by changing formats or by porting the Font Software to a new environment. - -"Author" refers to any designer, engineer, programmer, technical writer or other -person who contributed to the Font Software. - -PERMISSION & CONDITIONS - -Permission is hereby granted, free of charge, to any person obtaining a copy of the -Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell -modified and unmodified copies of the Font Software, subject to the following -conditions: - -1) Neither the Font Software nor any of its individual components, in Original or -Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, redistributed -and/or sold with any software, provided that each copy contains the above copyright -notice and this license. These can be included either as stand-alone text files, -human-readable headers or in the appropriate machine-readable metadata fields within -text or binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless -explicit written permission is granted by the corresponding Copyright Holder. This -restriction only applies to the primary font name as presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall -not be used to promote, endorse or advertise any Modified Version, except to -acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with -their explicit written permission. - -5) The Font Software, modified or unmodified, in part or in whole, must be distributed -entirely under this license, and must not be distributed under any other license. The -requirement for fonts to remain under this license does not apply to any document -created using the Font Software. - -TERMINATION - -This license becomes null and void if any of the above conditions are not met. - -DISCLAIMER - -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER -RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR -INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.eot b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.eot deleted file mode 100644 index 7fb79c7f..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.eot and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.svg b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.svg deleted file mode 100644 index b2afe8e1..00000000 --- a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.svg +++ /dev/null @@ -1,3318 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Designer : MicroPress Inc., with final additions and corrections provided by Coen Hoffman, Elsevier (retired) -Foundry URL : http://www.stixfonts.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.ttf b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.ttf deleted file mode 100644 index 15596701..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.ttf and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.woff b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.woff deleted file mode 100644 index c18a5b11..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneral-webfont.woff and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.eot b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.eot deleted file mode 100644 index c2523d8b..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.eot and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.svg b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.svg deleted file mode 100644 index 3d4c1606..00000000 --- a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.svg +++ /dev/null @@ -1,1738 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Designer : MicroPress Inc., with final additions and corrections provided by Coen Hoffman, Elsevier (retired) -Foundry URL : http://www.stixfonts.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.ttf b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.ttf deleted file mode 100644 index 837445a8..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.ttf and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.woff b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.woff deleted file mode 100644 index a7b64681..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbol-webfont.woff and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.eot b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.eot deleted file mode 100644 index 96db6774..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.eot and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.svg b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.svg deleted file mode 100644 index 4c2e6ce2..00000000 --- a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.svg +++ /dev/null @@ -1,1137 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Designer : MicroPress Inc., with final additions and corrections provided by Coen Hoffman, Elsevier (retired) -Foundry URL : http://www.stixfonts.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.ttf b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.ttf deleted file mode 100644 index 6b8c2518..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.ttf and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.woff b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.woff deleted file mode 100644 index 63a6f8e9..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralbolita-webfont.woff and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.eot b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.eot deleted file mode 100644 index 3573ca16..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.eot and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.svg b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.svg deleted file mode 100644 index 666ad8c9..00000000 --- a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.svg +++ /dev/null @@ -1,1089 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Designer : MicroPress Inc., with final additions and corrections provided by Coen Hoffman, Elsevier (retired) -Foundry URL : http://www.stixfonts.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.ttf b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.ttf deleted file mode 100644 index 256bf6cf..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.ttf and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.woff b/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.woff deleted file mode 100644 index c6d5aae3..00000000 Binary files a/app/static/umeditor/third-party/mathquill/font/stixgeneral-bundle/stixgeneralitalic-webfont.woff and /dev/null differ diff --git a/app/static/umeditor/third-party/mathquill/mathquill.css b/app/static/umeditor/third-party/mathquill/mathquill.css deleted file mode 100644 index 80d0b9bd..00000000 --- a/app/static/umeditor/third-party/mathquill/mathquill.css +++ /dev/null @@ -1,357 +0,0 @@ -/* - * LaTeX Math in pure HTML and CSS -- No images whatsoever - * v0.xa - * by Jay and Han - * Lesser GPL Licensed: http: //www.gnu.org/licenses/lgpl.html - * - * This file is automatically included by mathquill.js - * - */ -@font-face { - font-family: Symbola; - src: url(font/Symbola.eot); - src: local("Symbola Regular"), local("Symbola"), url(font/Symbola.ttf) format("truetype"), url(font/Symbola.otf) format("opentype"), url(font/Symbola.svg#Symbola) format("svg"); -} -.mathquill-editable { - display: -moz-inline-box; - display: inline-block; - white-space: pre-wrap; -} -.mathquill-editable .cursor { - border-left: 1px solid black; - margin-right: -1px; - position: relative; - z-index: 1; - padding: 0; - display: -moz-inline-box; - display: inline-block; -} -.mathquill-editable .cursor.blink { - visibility: hidden; -} -.mathquill-editable, -.mathquill-embedded-latex .mathquill-editable { - border: 1px solid gray; - padding: 2px; -} -.mathquill-embedded-latex .mathquill-editable { - margin: 1px; -} -.mathquill-editable.hasCursor, -.mathquill-editable .hasCursor { - -webkit-box-shadow: #68b4df 0 0 3px 2px; - -moz-box-shadow: #68b4df 0 0 3px 2px; - box-shadow: #68b4df 0 0 3px 2px; -} -.mathquill-editable .latex-command-input { - color: inherit; - font-family: "Courier New", monospace; - border: 1px solid gray; - padding-right: 1px; - margin-right: 1px; - margin-left: 2px; -} -.mathquill-editable .latex-command-input.empty { - background: transparent; -} -.mathquill-editable .latex-command-input.hasCursor { - border-color: ActiveBorder; -} -.mathquill-editable.empty:after, -.mathquill-textbox:after, -.mathquill-rendered-math .empty:after { - visibility: hidden; - content: 'c'; -} -.mathquill-editable .cursor:only-child:after, -.mathquill-editable .textarea + .cursor:last-child:after { - visibility: hidden; - content: 'c'; -} -.mathquill-textbox { - overflow-x: auto; - overflow-y: hidden; -} -.mathquill-rendered-math { - font-variant: normal; - font-weight: normal; - font-style: normal; - font-size: 115%; - line-height: 1; - display: -moz-inline-box; - display: inline-block; -} -.mathquill-rendered-math .non-leaf, -.mathquill-rendered-math .scaled { - display: -moz-inline-box; - display: inline-block; -} -.mathquill-rendered-math var, -.mathquill-rendered-math .text, -.mathquill-rendered-math .nonSymbola { - font-family: "Times New Roman", Symbola, serif; - line-height: .9; -} -.mathquill-rendered-math * { - font-size: inherit; - line-height: inherit; - margin: 0; - padding: 0; - border-color: black; - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; -} -.mathquill-rendered-math .empty { - background: #ccc; -} -.mathquill-rendered-math.empty { - background: transparent; -} -.mathquill-rendered-math .text { - font-size: 87%; -} -.mathquill-rendered-math .font { - font: 1em "Times New Roman", Symbola, serif; -} -.mathquill-rendered-math .font * { - font-family: inherit; - font-style: inherit; -} -.mathquill-rendered-math b, -.mathquill-rendered-math b.font { - font-weight: bolder; -} -.mathquill-rendered-math var, -.mathquill-rendered-math i, -.mathquill-rendered-math i.font { - font-syle: italic; -} -.mathquill-rendered-math var.florin { - margin: 0 -0.1em; -} -.mathquill-rendered-math big { - font-size: 125%; -} -.mathquill-rendered-math .roman { - font-style: normal; -} -.mathquill-rendered-math .sans-serif { - font-family: sans-serif, Symbola, serif; -} -.mathquill-rendered-math .monospace { - font-family: monospace, Symbola, serif; -} -.mathquill-rendered-math .overline { - border-top: 1px solid black; - margin-top: 1px; -} -.mathquill-rendered-math .underline { - border-bottom: 1px solid black; - margin-bottom: 1px; -} -.mathquill-rendered-math .binary-operator { - padding: 0 0.2em; - display: -moz-inline-box; - display: inline-block; -} -.mathquill-rendered-math .unary-operator { - padding-left: 0.2em; -} -.mathquill-rendered-math sup, -.mathquill-rendered-math sub { - position: relative; - font-size: 90%; -} -.mathquill-rendered-math sup .binary-operator, -.mathquill-rendered-math sub .binary-operator { - padding: 0 .1em; -} -.mathquill-rendered-math sup .unary-operator, -.mathquill-rendered-math sub .unary-operator { - padding-left: .1em; -} -.mathquill-rendered-math sup.limit, -.mathquill-rendered-math sub.limit, -.mathquill-rendered-math sup.nthroot, -.mathquill-rendered-math sub.nthroot { - font-size: 80%; -} -.mathquill-rendered-math sup .fraction, -.mathquill-rendered-math sub .fraction { - font-size: 70%; - vertical-align: -0.4em; -} -.mathquill-rendered-math sup .numerator, -.mathquill-rendered-math sub .numerator { - padding-bottom: 0; -} -.mathquill-rendered-math sup .denominator, -.mathquill-rendered-math sub .denominator { - padding-top: 0; -} -.mathquill-rendered-math sup { - vertical-align: .5em; -} -.mathquill-rendered-math sup.limit, -.mathquill-rendered-math sup.nthroot { - vertical-align: 0.8em; -} -.mathquill-rendered-math sup.nthroot { - margin-right: -0.6em; - margin-left: .2em; - min-width: .5em; -} -.mathquill-rendered-math sub { - vertical-align: -0.4em; -} -.mathquill-rendered-math sub.limit { - vertical-align: -0.6em; -} -.mathquill-rendered-math .paren { - padding: 0 .1em; - vertical-align: bottom; - -webkit-transform-origin: bottom center; - -moz-transform-origin: bottom center; - -ms-transform-origin: bottom center; - -o-transform-origin: bottom center; - transform-origin: bottom center; -} -.mathquill-rendered-math .array { - vertical-align: middle; - text-align: center; -} -.mathquill-rendered-math .array > span { - display: block; -} -.mathquill-rendered-math .non-italicized-function { - font-family: Symbola, "Times New Roman", serif; - line-height: .9; - font-style: normal; - padding-right: .2em; -} -.mathquill-rendered-math .fraction { - font-size: 90%; - text-align: center; - vertical-align: -0.5em; - padding: 0 .2em; -} -.mathquill-rendered-math .fraction, -.mathquill-rendered-math x:-moz-any-link { - display: -moz-groupbox; -} -.mathquill-rendered-math .fraction, -.mathquill-rendered-math x:-moz-any-link, -.mathquill-rendered-math x:default { - display: inline-block; -} -.mathquill-rendered-math .numerator, -.mathquill-rendered-math .denominator { - display: block; -} -.mathquill-rendered-math .numerator { - padding: 0 0.1em; - margin-bottom: -0.1em; -} -.mathquill-rendered-math .denominator { - border-top: 1px solid; - float: right; - width: 100%; - padding: .1em .1em 0 .1em; - margin-right: -0.1em; - margin-left: -0.1em; -} -.mathquill-rendered-math .sqrt-prefix { - padding-top: 0; - position: relative; - top: .1em; - vertical-align: top; - -webkit-transform-origin: top; - -moz-transform-origin: top; - -ms-transform-origin: top; - -o-transform-origin: top; - transform-origin: top; -} -.mathquill-rendered-math .sqrt-stem { - border-top: 1px solid; - margin-top: 1px; - padding-left: .15em; - padding-right: .2em; - margin-right: .1em; -} -.mathquill-rendered-math .vector-prefix { - display: block; - text-align: center; - line-height: .25em; - margin-bottom: -0.1em; - font-size: 0.75em; -} -.mathquill-rendered-math .vector-stem { - display: block; -} -.mathquill-rendered-math, -.mathquill-rendered-math .mathquill-editable { - cursor: text; - font-family: Symbola, "Times New Roman", serif; -} -.mathquill-rendered-math .selection, -.mathquill-editable .selection, -.mathquill-rendered-math .selection .non-leaf, -.mathquill-editable .selection .non-leaf, -.mathquill-rendered-math .selection .scaled, -.mathquill-editable .selection .scaled { - background: #B4D5FE !important; - background: Highlight !important; - color: HighlightText; - border-color: HighlightText; -} -.mathquill-rendered-math .selection .matrixed, -.mathquill-editable .selection .matrixed { - background: #39F !important; -} -.mathquill-rendered-math .selection .matrixed-container, -.mathquill-editable .selection .matrixed-container { - filter: progid:DXImageTransform.Microsoft.Chroma(color='#3399FF') !important; -} -.mathquill-rendered-math .selection.blur, -.mathquill-editable .selection.blur, -.mathquill-rendered-math .selection.blur .non-leaf, -.mathquill-editable .selection.blur .non-leaf, -.mathquill-rendered-math .selection.blur .scaled, -.mathquill-editable .selection.blur .scaled, -.mathquill-rendered-math .selection.blur .matrixed, -.mathquill-editable .selection.blur .matrixed { - background: #D4D4D4 !important; - color: black; - border-color: black; -} -.mathquill-rendered-math .selection.blur .matrixed-container, -.mathquill-editable .selection.blur .matrixed-container { - filter: progid:DXImageTransform.Microsoft.Chroma(color='#D4D4D4') !important; -} -.mathquill-editable .textarea, -.mathquill-rendered-math .textarea { - position: relative; - -webkit-user-select: text; - -moz-user-select: text; - user-select: text; -} -.mathquill-editable .textarea textarea, -.mathquill-rendered-math .textarea textarea, -.mathquill-editable .selectable, -.mathquill-rendered-math .selectable { - -webkit-user-select: text; - -moz-user-select: text; - user-select: text; - position: absolute; - clip: rect(1em 1em 1em 1em); -} -.mathquill-rendered-math .matrixed { - background: white; - display: -moz-inline-box; - display: inline-block; -} -.mathquill-rendered-math .matrixed-container { - filter: progid:DXImageTransform.Microsoft.Chroma(color='white'); - margin-top: -0.1em; -} diff --git a/app/static/umeditor/third-party/mathquill/mathquill.js b/app/static/umeditor/third-party/mathquill/mathquill.js deleted file mode 100644 index d02095f0..00000000 --- a/app/static/umeditor/third-party/mathquill/mathquill.js +++ /dev/null @@ -1,3888 +0,0 @@ -/** - * Copyleft 2010-2011 Jay and Han (laughinghan@gmail.com) - * under the GNU Lesser General Public License - * http://www.gnu.org/licenses/lgpl.html - * Project Website: http://mathquill.com - */ - -(function() { - -var jQuery = window.jQuery, - undefined, - _, //temp variable of prototypes - mqCmdId = 'mathquill-command-id', - mqBlockId = 'mathquill-block-id', - min = Math.min, - max = Math.max; - -var __slice = [].slice; - -function noop() {} - -/** - * sugar to make defining lots of commands easier. - * TODO: rethink this. - */ -function bind(cons /*, args... */) { - var args = __slice.call(arguments, 1); - return function() { - return cons.apply(this, args); - }; -} - -/** - * a development-only debug method. This definition and all - * calls to `pray` will be stripped from the minified - * build of mathquill. - * - * This function must be called by name to be removed - * at compile time. Do not define another function - * with the same name, and only call this function by - * name. - */ -function pray(message, cond) { - if (!cond) throw new Error('prayer failed: '+message); -} -var P = (function(prototype, ownProperty, undefined) { - // helper functions that also help minification - function isObject(o) { return typeof o === 'object'; } - function isFunction(f) { return typeof f === 'function'; } - - // a function that gets reused to make uninitialized objects - function BareConstructor() {} - - function P(_superclass /* = Object */, definition) { - // handle the case where no superclass is given - if (definition === undefined) { - definition = _superclass; - _superclass = Object; - } - - // C is the class to be returned. - // - // It delegates to instantiating an instance of `Bare`, so that it - // will always return a new instance regardless of the calling - // context. - // - // TODO: the Chrome inspector shows all created objects as `C` - // rather than `Object`. Setting the .name property seems to - // have no effect. Is there a way to override this behavior? - function C() { - var self = new Bare; - if (isFunction(self.init)) self.init.apply(self, arguments); - return self; - } - - // C.Bare is a class with a noop constructor. Its prototype is the - // same as C, so that instances of C.Bare are also instances of C. - // New objects can be allocated without initialization by calling - // `new MyClass.Bare`. - function Bare() {} - C.Bare = Bare; - - // Set up the prototype of the new class. - var _super = BareConstructor[prototype] = _superclass[prototype]; - var proto = Bare[prototype] = C[prototype] = new BareConstructor; - - // other variables, as a minifier optimization - var extensions; - - - // set the constructor property on the prototype, for convenience - proto.constructor = C; - - C.mixin = function(def) { - Bare[prototype] = C[prototype] = P(C, def)[prototype]; - return C; - } - - return (C.open = function(def) { - extensions = {}; - - if (isFunction(def)) { - // call the defining function with all the arguments you need - // extensions captures the return value. - extensions = def.call(C, proto, _super, C, _superclass); - } - else if (isObject(def)) { - // if you passed an object instead, we'll take it - extensions = def; - } - - // ...and extend it - if (isObject(extensions)) { - for (var ext in extensions) { - if (ownProperty.call(extensions, ext)) { - proto[ext] = extensions[ext]; - } - } - } - - // if there's no init, we assume we're inheriting a non-pjs class, so - // we default to applying the superclass's constructor. - if (!isFunction(proto.init)) { - proto.init = _superclass; - } - - return C; - })(definition); - } - - // ship it - return P; - - // as a minifier optimization, we've closured in a few helper functions - // and the string 'prototype' (C[p] is much shorter than C.prototype) -})('prototype', ({}).hasOwnProperty); -/************************************************* - * Textarea Manager - * - * An abstraction layer wrapping the textarea in - * an object with methods to manipulate and listen - * to events on, that hides all the nasty cross- - * browser incompatibilities behind a uniform API. - * - * Design goal: This is a *HARD* internal - * abstraction barrier. Cross-browser - * inconsistencies are not allowed to leak through - * and be dealt with by event handlers. All future - * cross-browser issues that arise must be dealt - * with here, and if necessary, the API updated. - * - * Organization: - * - key values map and stringify() - * - manageTextarea() - * + defer() and flush() - * + event handler logic - * + attach event handlers and export methods - ************************************************/ - -var manageTextarea = (function() { - // The following [key values][1] map was compiled from the - // [DOM3 Events appendix section on key codes][2] and - // [a widely cited report on cross-browser tests of key codes][3], - // except for 10: 'Enter', which I've empirically observed in Safari on iOS - // and doesn't appear to conflict with any other known key codes. - // - // [1]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#keys-keyvalues - // [2]: http://www.w3.org/TR/2012/WD-DOM-Level-3-Events-20120614/#fixed-virtual-key-codes - // [3]: http://unixpapa.com/js/key.html - var KEY_VALUES = { - 8: 'Backspace', - 9: 'Tab', - - 10: 'Enter', // for Safari on iOS - - 13: 'Enter', - - 16: 'Shift', - 17: 'Control', - 18: 'Alt', - 20: 'CapsLock', - - 27: 'Esc', - - 32: 'Spacebar', - - 33: 'PageUp', - 34: 'PageDown', - 35: 'End', - 36: 'Home', - - 37: 'Left', - 38: 'Up', - 39: 'Right', - 40: 'Down', - - 45: 'Insert', - - 46: 'Del', - - 144: 'NumLock' - }; - - // To the extent possible, create a normalized string representation - // of the key combo (i.e., key code and modifier keys). - function stringify(evt) { - var which = evt.which || evt.keyCode; - var keyVal = KEY_VALUES[which]; - var key; - var modifiers = []; - - if (evt.ctrlKey) modifiers.push('Ctrl'); - if (evt.originalEvent && evt.originalEvent.metaKey) modifiers.push('Meta'); - if (evt.altKey) modifiers.push('Alt'); - if (evt.shiftKey) modifiers.push('Shift'); - - key = keyVal || String.fromCharCode(which); - - if (!modifiers.length && !keyVal) return key; - - modifiers.push(key); - return modifiers.join('-'); - } - - // create a textarea manager that calls callbacks at useful times - // and exports useful public methods - return function manageTextarea(el, opts) { - var keydown = null; - var keypress = null; - - if (!opts) opts = {}; - var textCallback = opts.text || noop; - var keyCallback = opts.key || noop; - var pasteCallback = opts.paste || noop; - var onCut = opts.cut || noop; - - var textarea = jQuery(el); - var target = jQuery(opts.container || textarea); - - // checkTextareaFor() is called after keypress or paste events to - // say "Hey, I think something was just typed" or "pasted" (resp.), - // so that at all subsequent opportune times (next event or timeout), - // will check for expected typed or pasted text. - // Need to check repeatedly because #135: in Safari 5.1 (at least), - // after selecting something and then typing, the textarea is - // incorrectly reported as selected during the input event (but not - // subsequently). - var checkTextarea = noop, timeoutId; - function checkTextareaFor(checker) { - checkTextarea = checker; - clearTimeout(timeoutId); - timeoutId = setTimeout(checker); - } - target.bind('keydown keypress input keyup focusout paste', function() { checkTextarea(); }); - - - // -*- public methods -*- // - function select(text) { - // check textarea at least once/one last time before munging (so - // no race condition if selection happens after keypress/paste but - // before checkTextarea), then never again ('cos it's been munged) - checkTextarea(); - checkTextarea = noop; - clearTimeout(timeoutId); - - textarea.val(text); - if (text) textarea[0].select(); - } - - // -*- helper subroutines -*- // - - // Determine whether there's a selection in the textarea. - // This will always return false in IE < 9, which don't support - // HTMLTextareaElement::selection{Start,End}. - function hasSelection() { - var dom = textarea[0]; - - if (!('selectionStart' in dom)) return false; - return dom.selectionStart !== dom.selectionEnd; - } - - function popText(callback) { - var text = textarea.val(); - textarea.val(''); - if (text) callback(text); - } - - function handleKey() { - keyCallback(stringify(keydown), keydown); - } - - // -*- event handlers -*- // - function onKeydown(e) { - keydown = e; - keypress = null; - - handleKey(); - } - - function onKeypress(e) { - // call the key handler for repeated keypresses. - // This excludes keypresses that happen directly - // after keydown. In that case, there will be - // no previous keypress, so we skip it here - if (keydown && keypress) handleKey(); - - keypress = e; - - checkTextareaFor(typedText); - } - function typedText() { - // If there is a selection, the contents of the textarea couldn't - // possibly have just been typed in. - // This happens in browsers like Firefox and Opera that fire - // keypress for keystrokes that are not text entry and leave the - // selection in the textarea alone, such as Ctrl-C. - // Note: we assume that browsers that don't support hasSelection() - // also never fire keypress on keystrokes that are not text entry. - // This seems reasonably safe because: - // - all modern browsers including IE 9+ support hasSelection(), - // making it extremely unlikely any browser besides IE < 9 won't - // - as far as we know IE < 9 never fires keypress on keystrokes - // that aren't text entry, which is only as reliable as our - // tests are comprehensive, but the IE < 9 way to do - // hasSelection() is poorly documented and is also only as - // reliable as our tests are comprehensive - // If anything like #40 or #71 is reported in IE < 9, see - // b1318e5349160b665003e36d4eedd64101ceacd8 - if (hasSelection()) return; - - popText(textCallback); - } - - function onBlur() { keydown = keypress = null; } - - function onPaste(e) { - // browsers are dumb. - // - // In Linux, middle-click pasting causes onPaste to be called, - // when the textarea is not necessarily focused. We focus it - // here to ensure that the pasted text actually ends up in the - // textarea. - // - // It's pretty nifty that by changing focus in this handler, - // we can change the target of the default action. (This works - // on keydown too, FWIW). - // - // And by nifty, we mean dumb (but useful sometimes). - textarea.focus(); - - checkTextareaFor(pastedText); - } - function pastedText() { - popText(pasteCallback); - } - - // -*- attach event handlers -*- // - target.bind({ - keydown: onKeydown, - keypress: onKeypress, - focusout: onBlur, - cut: onCut, - paste: onPaste - }); - - // -*- export public methods -*- // - return { - select: select - }; - }; -}()); -var Parser = P(function(_, _super, Parser) { - // The Parser object is a wrapper for a parser function. - // Externally, you use one to parse a string by calling - // var result = SomeParser.parse('Me Me Me! Parse Me!'); - // You should never call the constructor, rather you should - // construct your Parser from the base parsers and the - // parser combinator methods. - - function parseError(stream, message) { - if (stream) { - stream = "'"+stream+"'"; - } - else { - stream = 'EOF'; - } - - throw 'Parse Error: '+message+' at '+stream; - } - - _.init = function(body) { this._ = body; }; - - _.parse = function(stream) { - return this.skip(eof)._(stream, success, parseError); - - function success(stream, result) { return result; } - }; - - // -*- primitive combinators -*- // - _.or = function(alternative) { - pray('or is passed a parser', alternative instanceof Parser); - - var self = this; - - return Parser(function(stream, onSuccess, onFailure) { - return self._(stream, onSuccess, failure); - - function failure(newStream) { - return alternative._(stream, onSuccess, onFailure); - } - }); - }; - - _.then = function(next) { - var self = this; - - return Parser(function(stream, onSuccess, onFailure) { - return self._(stream, success, onFailure); - - function success(newStream, result) { - var nextParser = (next instanceof Parser ? next : next(result)); - pray('a parser is returned', nextParser instanceof Parser); - return nextParser._(newStream, onSuccess, onFailure); - } - }); - }; - - // -*- optimized iterative combinators -*- // - _.many = function() { - var self = this; - - return Parser(function(stream, onSuccess, onFailure) { - var xs = []; - while (self._(stream, success, failure)); - return onSuccess(stream, xs); - - function success(newStream, x) { - stream = newStream; - xs.push(x); - return true; - } - - function failure() { - return false; - } - }); - }; - - _.times = function(min, max) { - if (arguments.length < 2) max = min; - var self = this; - - return Parser(function(stream, onSuccess, onFailure) { - var xs = []; - var result = true; - var failure; - - for (var i = 0; i < min; i += 1) { - result = self._(stream, success, firstFailure); - if (!result) return onFailure(stream, failure); - } - - for (; i < max && result; i += 1) { - result = self._(stream, success, secondFailure); - } - - return onSuccess(stream, xs); - - function success(newStream, x) { - xs.push(x); - stream = newStream; - return true; - } - - function firstFailure(newStream, msg) { - failure = msg; - stream = newStream; - return false; - } - - function secondFailure(newStream, msg) { - return false; - } - }); - }; - - // -*- higher-level combinators -*- // - _.result = function(res) { return this.then(succeed(res)); }; - _.atMost = function(n) { return this.times(0, n); }; - _.atLeast = function(n) { - var self = this; - return self.times(n).then(function(start) { - return self.many().map(function(end) { - return start.concat(end); - }); - }); - }; - - _.map = function(fn) { - return this.then(function(result) { return succeed(fn(result)); }); - }; - - _.skip = function(two) { - return this.then(function(result) { return two.result(result); }); - }; - - // -*- primitive parsers -*- // - var string = this.string = function(str) { - var len = str.length; - var expected = "expected '"+str+"'"; - - return Parser(function(stream, onSuccess, onFailure) { - var head = stream.slice(0, len); - - if (head === str) { - return onSuccess(stream.slice(len), head); - } - else { - return onFailure(stream, expected); - } - }); - }; - - var regex = this.regex = function(re) { - pray('regexp parser is anchored', re.toString().charAt(1) === '^'); - - var expected = 'expected '+re; - - return Parser(function(stream, onSuccess, onFailure) { - var match = re.exec(stream); - - if (match) { - var result = match[0]; - return onSuccess(stream.slice(result.length), result); - } - else { - return onFailure(stream, expected); - } - }); - }; - - var succeed = Parser.succeed = function(result) { - return Parser(function(stream, onSuccess) { - return onSuccess(stream, result); - }); - }; - - var fail = Parser.fail = function(msg) { - return Parser(function(stream, _, onFailure) { - return onFailure(stream, msg); - }); - }; - - var letter = Parser.letter = regex(/^[a-z]/i); - var letters = Parser.letters = regex(/^[a-z]*/i); - var digit = Parser.digit = regex(/^[0-9]/); - var digits = Parser.digits = regex(/^[0-9]*/); - var whitespace = Parser.whitespace = regex(/^\s+/); - var optWhitespace = Parser.optWhitespace = regex(/^\s*/); - - var any = Parser.any = Parser(function(stream, onSuccess, onFailure) { - if (!stream) return onFailure(stream, 'expected any character'); - - return onSuccess(stream.slice(1), stream.charAt(0)); - }); - - var all = Parser.all = Parser(function(stream, onSuccess, onFailure) { - return onSuccess('', stream); - }); - - var eof = Parser.eof = Parser(function(stream, onSuccess, onFailure) { - if (stream) return onFailure(stream, 'expected EOF'); - - return onSuccess(stream, stream); - }); -}); -/************************************************* - * Base classes of the MathQuill virtual DOM tree - * - * Only doing tree node manipulation via these - * adopt/ disown methods guarantees well-formedness - * of the tree. - ************************************************/ - -// L = 'left' -// R = 'right' -// -// the contract is that they can be used as object properties -// and (-L) === R, and (-R) === L. -var L = -1; -var R = 1; - -function prayDirection(dir) { - pray('a direction was passed', dir === L || dir === R); -} - -/** - * Tiny extension of jQuery adding directionalized DOM manipulation methods. - * - * Funny how Pjs v3 almost just works with `jQuery.fn.init`. - * - * jQuery features that don't work on $: - * - jQuery.*, like jQuery.ajax, obviously (Pjs doesn't and shouldn't - * copy constructor properties) - * - * - jQuery(function), the shortcut for `jQuery(document).ready(function)`, - * because `jQuery.fn.init` is idiosyncratic and Pjs doing, essentially, - * `jQuery.fn.init.apply(this, arguments)` isn't quite right, you need: - * - * _.init = function(s, c) { jQuery.fn.init.call(this, s, c, $(document)); }; - * - * if you actually give a shit (really, don't bother), - * see https://github.com/jquery/jquery/blob/1.7.2/src/core.js#L889 - * - * - jQuery(selector), because jQuery translates that to - * `jQuery(document).find(selector)`, but Pjs doesn't (should it?) let - * you override the result of a constructor call - * + note that because of the jQuery(document) shortcut-ness, there's also - * the 3rd-argument-needs-to-be-`$(document)` thing above, but the fix - * for that (as can be seen above) is really easy. This problem requires - * a way more intrusive fix - * - * And that's it! Everything else just magically works because jQuery internally - * uses `this.constructor()` everywhere (hence calling `$`), but never ever does - * `this.constructor.find` or anything like that, always doing `jQuery.find`. - */ -var $ = P(jQuery, function(_) { - _.insDirOf = function(dir, el) { - return dir === L ? - this.insertBefore(el.first()) : this.insertAfter(el.last()); - }; - _.insAtDirEnd = function(dir, el) { - return dir === L ? this.prependTo(el) : this.appendTo(el); - }; -}); - -var Point = P(function(_) { - _.parent = 0; - _[L] = 0; - _[R] = 0; - - _.init = function(parent, leftward, rightward) { - this.parent = parent; - this[L] = leftward; - this[R] = rightward; - }; -}); - -/** - * MathQuill virtual-DOM tree-node abstract base class - */ -var Node = P(function(_) { - _[L] = 0; - _[R] = 0 - _.parent = 0; - - _.init = function() { - this.ends = {}; - this.ends[L] = 0; - this.ends[R] = 0; - }; - - _.children = function() { - return Fragment(this.ends[L], this.ends[R]); - }; - - _.eachChild = function(fn) { - return this.children().each(fn); - }; - - _.foldChildren = function(fold, fn) { - return this.children().fold(fold, fn); - }; - - _.adopt = function(parent, leftward, rightward) { - Fragment(this, this).adopt(parent, leftward, rightward); - return this; - }; - - _.disown = function() { - Fragment(this, this).disown(); - return this; - }; -}); - -/** - * An entity outside the virtual tree with one-way pointers (so it's only a - * "view" of part of the tree, not an actual node/entity in the tree) that - * delimits a doubly-linked list of sibling nodes. - * It's like a fanfic love-child between HTML DOM DocumentFragment and the Range - * classes: like DocumentFragment, its contents must be sibling nodes - * (unlike Range, whose contents are arbitrary contiguous pieces of subtrees), - * but like Range, it has only one-way pointers to its contents, its contents - * have no reference to it and in fact may still be in the visible tree (unlike - * DocumentFragment, whose contents must be detached from the visible tree - * and have their 'parent' pointers set to the DocumentFragment). - */ -var Fragment = P(function(_) { - _.init = function(leftEnd, rightEnd) { - pray('no half-empty fragments', !leftEnd === !rightEnd); - - this.ends = {}; - - if (!leftEnd) return; - - pray('left end node is passed to Fragment', leftEnd instanceof Node); - pray('right end node is passed to Fragment', rightEnd instanceof Node); - pray('leftEnd and rightEnd have the same parent', - leftEnd.parent === rightEnd.parent); - - this.ends[L] = leftEnd; - this.ends[R] = rightEnd; - }; - - function prayWellFormed(parent, leftward, rightward) { - pray('a parent is always present', parent); - pray('leftward is properly set up', (function() { - // either it's empty and `rightward` is the left end child (possibly empty) - if (!leftward) return parent.ends[L] === rightward; - - // or it's there and its [R] and .parent are properly set up - return leftward[R] === rightward && leftward.parent === parent; - })()); - - pray('rightward is properly set up', (function() { - // either it's empty and `leftward` is the right end child (possibly empty) - if (!rightward) return parent.ends[R] === leftward; - - // or it's there and its [L] and .parent are properly set up - return rightward[L] === leftward && rightward.parent === parent; - })()); - } - - _.adopt = function(parent, leftward, rightward) { - prayWellFormed(parent, leftward, rightward); - - var self = this; - self.disowned = false; - - var leftEnd = self.ends[L]; - if (!leftEnd) return this; - - var rightEnd = self.ends[R]; - - if (leftward) { - // NB: this is handled in the ::each() block - // leftward[R] = leftEnd - } else { - parent.ends[L] = leftEnd; - } - - if (rightward) { - rightward[L] = rightEnd; - } else { - parent.ends[R] = rightEnd; - } - - self.ends[R][R] = rightward; - - self.each(function(el) { - el[L] = leftward; - el.parent = parent; - if (leftward) leftward[R] = el; - - leftward = el; - }); - - return self; - }; - - _.disown = function() { - var self = this; - var leftEnd = self.ends[L]; - - // guard for empty and already-disowned fragments - if (!leftEnd || self.disowned) return self; - - self.disowned = true; - - var rightEnd = self.ends[R] - var parent = leftEnd.parent; - - prayWellFormed(parent, leftEnd[L], leftEnd); - prayWellFormed(parent, rightEnd, rightEnd[R]); - - if (leftEnd[L]) { - leftEnd[L][R] = rightEnd[R]; - } else { - parent.ends[L] = rightEnd[R]; - } - - if (rightEnd[R]) { - rightEnd[R][L] = leftEnd[L]; - } else { - parent.ends[R] = leftEnd[L]; - } - - return self; - }; - - _.each = function(fn) { - var self = this; - var el = self.ends[L]; - if (!el) return self; - - for (;el !== self.ends[R][R]; el = el[R]) { - if (fn.call(self, el) === false) break; - } - - return self; - }; - - _.fold = function(fold, fn) { - this.each(function(el) { - fold = fn.call(this, fold, el); - }); - - return fold; - }; -}); -/************************************************* - * Abstract classes of math blocks and commands. - ************************************************/ - -var uuid = (function() { - var id = 0; - - return function() { return id += 1; }; -})(); - -/** - * Math tree node base class. - * Some math-tree-specific extensions to Node. - * Both MathBlock's and MathCommand's descend from it. - */ -var MathElement = P(Node, function(_, _super) { - _.init = function(obj) { - _super.init.call(this); - this.id = uuid(); - MathElement[this.id] = this; - }; - - _.toString = function() { - return '[MathElement '+this.id+']'; - }; - - _.bubble = function(event /*, args... */) { - var args = __slice.call(arguments, 1); - - for (var ancestor = this; ancestor; ancestor = ancestor.parent) { - var res = ancestor[event] && ancestor[event].apply(ancestor, args); - if (res === false) break; - } - - return this; - }; - - _.postOrder = function(fn /*, args... */) { - var args = __slice.call(arguments, 1); - - if (typeof fn === 'string') { - var methodName = fn; - fn = function(el) { - if (methodName in el) el[methodName].apply(el, args); - }; - } - - (function recurse(desc) { - desc.eachChild(recurse); - fn(desc); - })(this); - }; - - _.jQ = $(); - _.jQadd = function(jQ) { this.jQ = this.jQ.add(jQ); }; - - this.jQize = function(html) { - // Sets the .jQ of the entire math subtree rooted at this command. - // Expects .createBlocks() to have been called already, since it - // calls .html(). - var jQ = $(html); - jQ.find('*').andSelf().each(function() { - var jQ = $(this), - cmdId = jQ.attr('mathquill-command-id'), - blockId = jQ.attr('mathquill-block-id'); - if (cmdId) MathElement[cmdId].jQadd(jQ); - if (blockId) MathElement[blockId].jQadd(jQ); - }); - return jQ; - }; - - _.finalizeInsert = function() { - var self = this; - self.postOrder('finalizeTree'); - - // note: this order is important. - // empty elements need the empty box provided by blur to - // be present in order for their dimensions to be measured - // correctly in redraw. - self.postOrder('blur'); - - // adjust context-sensitive spacing - self.postOrder('respace'); - if (self[R].respace) self[R].respace(); - if (self[L].respace) self[L].respace(); - - self.postOrder('redraw'); - self.bubble('redraw'); - }; -}); - -/** - * Commands and operators, like subscripts, exponents, or fractions. - * Descendant commands are organized into blocks. - */ -var MathCommand = P(MathElement, function(_, _super) { - _.init = function(ctrlSeq, htmlTemplate, textTemplate) { - var cmd = this; - _super.init.call(cmd); - - if (!cmd.ctrlSeq) cmd.ctrlSeq = ctrlSeq; - if (htmlTemplate) cmd.htmlTemplate = htmlTemplate; - if (textTemplate) cmd.textTemplate = textTemplate; - }; - - // obvious methods - _.replaces = function(replacedFragment) { - replacedFragment.disown(); - this.replacedFragment = replacedFragment; - }; - _.isEmpty = function() { - return this.foldChildren(true, function(isEmpty, child) { - return isEmpty && child.isEmpty(); - }); - }; - - _.parser = function() { - var block = latexMathParser.block; - var self = this; - - return block.times(self.numBlocks()).map(function(blocks) { - self.blocks = blocks; - - for (var i = 0; i < blocks.length; i += 1) { - blocks[i].adopt(self, self.ends[R], 0); - } - - return self; - }); - }; - - // createLeftOf(cursor) and the methods it calls - _.createLeftOf = function(cursor) { - var cmd = this; - var replacedFragment = cmd.replacedFragment; - - cmd.createBlocks(); - MathElement.jQize(cmd.html()); - if (replacedFragment) { - replacedFragment.adopt(cmd.ends[L], 0, 0); - replacedFragment.jQ.appendTo(cmd.ends[L].jQ); - } - - cursor.jQ.before(cmd.jQ); - cursor[L] = cmd.adopt(cursor.parent, cursor[L], cursor[R]); - - cmd.finalizeInsert(cursor); - - cmd.placeCursor(cursor); - }; - _.createBlocks = function() { - var cmd = this, - numBlocks = cmd.numBlocks(), - blocks = cmd.blocks = Array(numBlocks); - - for (var i = 0; i < numBlocks; i += 1) { - var newBlock = blocks[i] = MathBlock(); - newBlock.adopt(cmd, cmd.ends[R], 0); - } - }; - _.respace = noop; //placeholder for context-sensitive spacing - _.placeCursor = function(cursor) { - //insert the cursor at the right end of the first empty child, searching - //left-to-right, or if none empty, the right end child - cursor.insAtRightEnd(this.foldChildren(this.ends[L], function(leftward, child) { - return leftward.isEmpty() ? leftward : child; - })); - }; - - // remove() - _.remove = function() { - this.disown(); - this.jQ.remove(); - - this.postOrder(function(el) { delete MathElement[el.id]; }); - - return this; - }; - - // methods involved in creating and cross-linking with HTML DOM nodes - /* - They all expect an .htmlTemplate like - '&0' - or - '&0&1' - - See html.test.js for more examples. - - Requirements: - - For each block of the command, there must be exactly one "block content - marker" of the form '&' where is the 0-based index of the - block. (Like the LaTeX \newcommand syntax, but with a 0-based rather than - 1-based index, because JavaScript because C because Dijkstra.) - - The block content marker must be the sole contents of the containing - element, there can't even be surrounding whitespace, or else we can't - guarantee sticking to within the bounds of the block content marker when - mucking with the HTML DOM. - - The HTML not only must be well-formed HTML (of course), but also must - conform to the XHTML requirements on tags, specifically all tags must - either be self-closing (like '
    ') or come in matching pairs. - Close tags are never optional. - - Note that & isn't well-formed HTML; if you wanted a literal '&123', - your HTML template would have to have '&123'. - */ - _.numBlocks = function() { - var matches = this.htmlTemplate.match(/&\d+/g); - return matches ? matches.length : 0; - }; - _.html = function() { - // Render the entire math subtree rooted at this command, as HTML. - // Expects .createBlocks() to have been called already, since it uses the - // .blocks array of child blocks. - // - // See html.test.js for example templates and intended outputs. - // - // Given an .htmlTemplate as described above, - // - insert the mathquill-command-id attribute into all top-level tags, - // which will be used to set this.jQ in .jQize(). - // This is straightforward: - // * tokenize into tags and non-tags - // * loop through top-level tokens: - // * add #cmdId attribute macro to top-level self-closing tags - // * else add #cmdId attribute macro to top-level open tags - // * skip the matching top-level close tag and all tag pairs - // in between - // - for each block content marker, - // + replace it with the contents of the corresponding block, - // rendered as HTML - // + insert the mathquill-block-id attribute into the containing tag - // This is even easier, a quick regex replace, since block tags cannot - // contain anything besides the block content marker. - // - // Two notes: - // - The outermost loop through top-level tokens should never encounter any - // top-level close tags, because we should have first encountered a - // matching top-level open tag, all inner tags should have appeared in - // matching pairs and been skipped, and then we should have skipped the - // close tag in question. - // - All open tags should have matching close tags, which means our inner - // loop should always encounter a close tag and drop nesting to 0. If - // a close tag is missing, the loop will continue until i >= tokens.length - // and token becomes undefined. This will not infinite loop, even in - // production without pray(), because it will then TypeError on .slice(). - - var cmd = this; - var blocks = cmd.blocks; - var cmdId = ' mathquill-command-id=' + cmd.id; - var tokens = cmd.htmlTemplate.match(/<[^<>]+>|[^<>]+/g); - - pray('no unmatched angle brackets', tokens.join('') === this.htmlTemplate); - - // add cmdId to all top-level tags - for (var i = 0, token = tokens[0]; token; i += 1, token = tokens[i]) { - // top-level self-closing tags - if (token.slice(-2) === '/>') { - tokens[i] = token.slice(0,-2) + cmdId + '/>'; - } - // top-level open tags - else if (token.charAt(0) === '<') { - pray('not an unmatched top-level close tag', token.charAt(1) !== '/'); - - tokens[i] = token.slice(0,-1) + cmdId + '>'; - - // skip matching top-level close tag and all tag pairs in between - var nesting = 1; - do { - i += 1, token = tokens[i]; - pray('no missing close tags', token); - // close tags - if (token.slice(0,2) === '') { - nesting += 1; - } - } while (nesting > 0); - } - } - return tokens.join('').replace(/>&(\d+)/g, function($0, $1) { - return ' mathquill-block-id=' + blocks[$1].id + '>' + blocks[$1].join('html'); - }); - }; - - // methods to export a string representation of the math tree - _.latex = function() { - return this.foldChildren(this.ctrlSeq, function(latex, child) { - return latex + '{' + (child.latex() || ' ') + '}'; - }); - }; - _.textTemplate = ['']; - _.text = function() { - var cmd = this, i = 0; - return cmd.foldChildren(cmd.textTemplate[i], function(text, child) { - i += 1; - var child_text = child.text(); - if (text && cmd.textTemplate[i] === '(' - && child_text[0] === '(' && child_text.slice(-1) === ')') - return text + child_text.slice(1, -1) + cmd.textTemplate[i]; - return text + child.text() + (cmd.textTemplate[i] || ''); - }); - }; -}); - -/** - * Lightweight command without blocks or children. - */ -var Symbol = P(MathCommand, function(_, _super) { - _.init = function(ctrlSeq, html, text) { - if (!text) text = ctrlSeq && ctrlSeq.length > 1 ? ctrlSeq.slice(1) : ctrlSeq; - - _super.init.call(this, ctrlSeq, html, [ text ]); - }; - - _.parser = function() { return Parser.succeed(this); }; - _.numBlocks = function() { return 0; }; - - _.replaces = function(replacedFragment) { - replacedFragment.remove(); - }; - _.createBlocks = noop; - _.latex = function(){ return this.ctrlSeq; }; - _.text = function(){ return this.textTemplate; }; - _.placeCursor = noop; - _.isEmpty = function(){ return true; }; -}); - -/** - * Children and parent of MathCommand's. Basically partitions all the - * symbols and operators that descend (in the Math DOM tree) from - * ancestor operators. - */ -var MathBlock = P(MathElement, function(_) { - _.join = function(methodName) { - return this.foldChildren('', function(fold, child) { - return fold + child[methodName](); - }); - }; - _.latex = function() { return this.join('latex'); }; - _.text = function() { - return this.ends[L] === this.ends[R] ? - this.ends[L].text() : - '(' + this.join('text') + ')' - ; - }; - _.isEmpty = function() { - return this.ends[L] === 0 && this.ends[R] === 0; - }; - _.write = function(cursor, ch, replacedFragment) { - var cmd; - if (ch.match(/^[a-eg-zA-Z]$/)) //exclude f because want florin - cmd = Variable(ch); - else if (cmd = CharCmds[ch] || LatexCmds[ch]) - cmd = cmd(ch); - else - cmd = VanillaSymbol(ch); - - if (replacedFragment) cmd.replaces(replacedFragment); - - cmd.createLeftOf(cursor); - }; - _.focus = function() { - this.jQ.addClass('hasCursor'); - this.jQ.removeClass('empty'); - - return this; - }; - _.blur = function() { - this.jQ.removeClass('hasCursor'); - if (this.isEmpty()) - this.jQ.addClass('empty'); - - return this; - }; -}); - -/** - * Math tree fragment base class. - * Some math-tree-specific extensions to Fragment. - */ -var MathFragment = P(Fragment, function(_, _super) { - _.init = function(leftEnd, rightEnd) { - // just select one thing if only one argument - _super.init.call(this, leftEnd, rightEnd || leftEnd); - this.jQ = this.fold($(), function(jQ, child){ return child.jQ.add(jQ); }); - }; - _.latex = function() { - return this.fold('', function(latex, el){ return latex + el.latex(); }); - }; - _.remove = function() { - this.jQ.remove(); - - this.each(function(el) { - el.postOrder(function(desc) { - delete MathElement[desc.id]; - }); - }); - - return this.disown(); - }; -}); -/********************************************* - * Root math elements with event delegation. - ********************************************/ - -function createRoot(jQ, root, textbox, editable) { - var contents = jQ.contents().detach(); - - if (!textbox) { - jQ.addClass('mathquill-rendered-math'); - } - - root.jQ = jQ.attr(mqBlockId, root.id); - root.revert = function() { - jQ.empty().unbind('.mathquill') - .removeClass('mathquill-rendered-math mathquill-editable mathquill-textbox') - .append(contents); - }; - - var cursor = root.cursor = Cursor(root); - - root.renderLatex(contents.text()); - - //textarea stuff - var textareaSpan = root.textarea = $(''), - textarea = textareaSpan.children(); - - /****** - * TODO [Han]: Document this - */ - var textareaSelectionTimeout; - root.selectionChanged = function() { - if (textareaSelectionTimeout === undefined) { - textareaSelectionTimeout = setTimeout(setTextareaSelection); - } - forceIERedraw(jQ[0]); - }; - function setTextareaSelection() { - textareaSelectionTimeout = undefined; - var latex = cursor.selection ? '$'+cursor.selection.latex()+'$' : ''; - textareaManager.select(latex); - } - - //prevent native selection except textarea - jQ.bind('selectstart.mathquill', function(e) { - if (e.target !== textarea[0]) e.preventDefault(); - e.stopPropagation(); - }); - - //drag-to-select event handling - var anticursor, blink = cursor.blink; - jQ.bind('mousedown.mathquill', function(e) { - function mousemove(e) { - cursor.seek($(e.target), e.pageX, e.pageY); - - if (cursor[L] !== anticursor[L] - || cursor.parent !== anticursor.parent) { - cursor.selectFrom(anticursor); - } - - return false; - } - - // docmousemove is attached to the document, so that - // selection still works when the mouse leaves the window. - function docmousemove(e) { - // [Han]: i delete the target because of the way seek works. - // it will not move the mouse to the target, but will instead - // just seek those X and Y coordinates. If there is a target, - // it will try to move the cursor to document, which will not work. - // cursor.seek needs to be refactored. - delete e.target; - - return mousemove(e); - } - - function mouseup(e) { - anticursor = undefined; - cursor.blink = blink; - if (!cursor.selection) { - if (editable) { - cursor.show(); - } - else { - textareaSpan.detach(); - } - } - - // delete the mouse handlers now that we're not dragging anymore - jQ.unbind('mousemove', mousemove); - $(e.target.ownerDocument).unbind('mousemove', docmousemove).unbind('mouseup', mouseup); - } - - setTimeout(function() { textarea.focus(); }); - // preventDefault won't prevent focus on mousedown in IE<9 - // that means immediately after this mousedown, whatever was - // mousedown-ed will receive focus - // http://bugs.jquery.com/ticket/10345 - - cursor.blink = noop; - cursor.seek($(e.target), e.pageX, e.pageY); - - anticursor = Point(cursor.parent, cursor[L], cursor[R]); - - if (!editable) jQ.prepend(textareaSpan); - - jQ.mousemove(mousemove); - $(e.target.ownerDocument).mousemove(docmousemove).mouseup(mouseup); - - return false; - }); - - if (!editable) { - var textareaManager = manageTextarea(textarea, { container: jQ }); - jQ.bind('cut paste', false).bind('copy', setTextareaSelection) - .prepend('$'+root.latex()+'$'); - textarea.blur(function() { - cursor.clearSelection(); - setTimeout(detach); //detaching during blur explodes in WebKit - }); - function detach() { - textareaSpan.detach(); - } - return; - } - - var textareaManager = manageTextarea(textarea, { - container: jQ, - key: function(key, evt) { - cursor.parent.bubble('onKey', key, evt); - }, - text: function(text) { - cursor.parent.bubble('onText', text); - }, - cut: function(e) { - if (cursor.selection) { - setTimeout(function() { - cursor.prepareEdit(); - cursor.parent.bubble('redraw'); - }); - } - - e.stopPropagation(); - }, - paste: function(text) { - // FIXME HACK the parser in RootTextBlock needs to be moved to - // Cursor::writeLatex or something so this'll work with - // MathQuill textboxes - if (text.slice(0,1) === '$' && text.slice(-1) === '$') { - text = text.slice(1, -1); - } - else { - text = '\\text{' + text + '}'; - } - - cursor.writeLatex(text).show(); - } - }); - - jQ.prepend(textareaSpan); - - //root CSS classes - jQ.addClass('mathquill-editable'); - if (textbox) - jQ.addClass('mathquill-textbox'); - - //focus and blur handling - textarea.focus(function(e) { - if (!cursor.parent) - cursor.insAtRightEnd(root); - cursor.parent.jQ.addClass('hasCursor'); - if (cursor.selection) { - cursor.selection.jQ.removeClass('blur'); - setTimeout(root.selectionChanged); //re-select textarea contents after tabbing away and back - } - else - cursor.show(); - e.stopPropagation(); - }).blur(function(e) { - cursor.hide().parent.blur(); - if (cursor.selection) - cursor.selection.jQ.addClass('blur'); - e.stopPropagation(); - }); - - jQ.bind('focus.mathquill blur.mathquill', function(e) { - textarea.trigger(e); - }).blur(); -} - -var RootMathBlock = P(MathBlock, function(_, _super) { - _.latex = function() { - return _super.latex.call(this).replace(/(\\[a-z]+) (?![a-z])/ig,'$1'); - }; - _.text = function() { - return this.foldChildren('', function(text, child) { - return text + child.text(); - }); - }; - _.renderLatex = function(latex) { - var jQ = this.jQ; - - jQ.children().slice(1).remove(); - this.ends[L] = this.ends[R] = 0; - - delete this.cursor.selection; - this.cursor.insAtRightEnd(this).writeLatex(latex); - }; - _.onKey = function(key, e) { - switch (key) { - case 'Ctrl-Shift-Backspace': - case 'Ctrl-Backspace': - while (this.cursor[L] || this.cursor.selection) { - this.cursor.backspace(); - } - break; - - case 'Shift-Backspace': - case 'Backspace': - this.cursor.backspace(); - break; - - // Tab or Esc -> go one block right if it exists, else escape right. - case 'Esc': - case 'Tab': - case 'Spacebar': - var parent = this.cursor.parent; - // cursor is in root editable, continue default - if (parent === this.cursor.root) { - if (key === 'Spacebar') e.preventDefault(); - return; - } - - this.cursor.prepareMove(); - if (parent[R]) { - // go one block right - this.cursor.insAtLeftEnd(parent[R]); - } else { - // get out of the block - this.cursor.insRightOf(parent.parent); - } - break; - - // Shift-Tab -> go one block left if it exists, else escape left. - case 'Shift-Tab': - case 'Shift-Esc': - case 'Shift-Spacebar': - var parent = this.cursor.parent; - //cursor is in root editable, continue default - if (parent === this.cursor.root) { - if (key === 'Shift-Spacebar') e.preventDefault(); - return; - } - - this.cursor.prepareMove(); - if (parent[L]) { - // go one block left - this.cursor.insAtRightEnd(parent[L]); - } else { - //get out of the block - this.cursor.insLeftOf(parent.parent); - } - break; - - // Prevent newlines from showing up - case 'Enter': break; - - - // End -> move to the end of the current block. - case 'End': - this.cursor.prepareMove().insAtRightEnd(this.cursor.parent); - break; - - // Ctrl-End -> move all the way to the end of the root block. - case 'Ctrl-End': - this.cursor.prepareMove().insAtRightEnd(this); - break; - - // Shift-End -> select to the end of the current block. - case 'Shift-End': - while (this.cursor[R]) { - this.cursor.selectRight(); - } - break; - - // Ctrl-Shift-End -> select to the end of the root block. - case 'Ctrl-Shift-End': - while (this.cursor[R] || this.cursor.parent !== this) { - this.cursor.selectRight(); - } - break; - - // Home -> move to the start of the root block or the current block. - case 'Home': - this.cursor.prepareMove().insAtLeftEnd(this.cursor.parent); - break; - - // Ctrl-Home -> move to the start of the current block. - case 'Ctrl-Home': - this.cursor.prepareMove().insAtLeftEnd(this); - break; - - // Shift-Home -> select to the start of the current block. - case 'Shift-Home': - while (this.cursor[L]) { - this.cursor.selectLeft(); - } - break; - - // Ctrl-Shift-Home -> move to the start of the root block. - case 'Ctrl-Shift-Home': - while (this.cursor[L] || this.cursor.parent !== this) { - this.cursor.selectLeft(); - } - break; - - case 'Left': this.cursor.moveLeft(); break; - case 'Shift-Left': this.cursor.selectLeft(); break; - case 'Ctrl-Left': break; - - case 'Right': this.cursor.moveRight(); break; - case 'Shift-Right': this.cursor.selectRight(); break; - case 'Ctrl-Right': break; - - case 'Up': this.cursor.moveUp(); break; - case 'Down': this.cursor.moveDown(); break; - - case 'Shift-Up': - if (this.cursor[L]) { - while (this.cursor[L]) this.cursor.selectLeft(); - } else { - this.cursor.selectLeft(); - } - - case 'Shift-Down': - if (this.cursor[R]) { - while (this.cursor[R]) this.cursor.selectRight(); - } - else { - this.cursor.selectRight(); - } - - case 'Ctrl-Up': break; - case 'Ctrl-Down': break; - - case 'Ctrl-Shift-Del': - case 'Ctrl-Del': - while (this.cursor[R] || this.cursor.selection) { - this.cursor.deleteForward(); - } - break; - - case 'Shift-Del': - case 'Del': - this.cursor.deleteForward(); - break; - - case 'Meta-A': - case 'Ctrl-A': - //so not stopPropagation'd at RootMathCommand - if (this !== this.cursor.root) return; - - this.cursor.prepareMove().insAtRightEnd(this); - while (this.cursor[L]) this.cursor.selectLeft(); - break; - - default: - return false; - } - e.preventDefault(); - return false; - }; - _.onText = function(ch) { - this.cursor.write(ch); - return false; - }; -}); - -var RootMathCommand = P(MathCommand, function(_, _super) { - _.init = function(cursor) { - _super.init.call(this, '$'); - this.cursor = cursor; - }; - _.htmlTemplate = '&0'; - _.createBlocks = function() { - this.ends[L] = - this.ends[R] = - RootMathBlock(); - - this.blocks = [ this.ends[L] ]; - - this.ends[L].parent = this; - - this.ends[L].cursor = this.cursor; - this.ends[L].write = function(cursor, ch, replacedFragment) { - if (ch !== '$') - MathBlock.prototype.write.call(this, cursor, ch, replacedFragment); - else if (this.isEmpty()) { - cursor.insRightOf(this.parent).backspace().show(); - VanillaSymbol('\\$','$').createLeftOf(cursor); - } - else if (!cursor[R]) - cursor.insRightOf(this.parent); - else if (!cursor[L]) - cursor.insLeftOf(this.parent); - else - MathBlock.prototype.write.call(this, cursor, ch, replacedFragment); - }; - }; - _.latex = function() { - return '$' + this.ends[L].latex() + '$'; - }; -}); - -var RootTextBlock = P(MathBlock, function(_) { - _.renderLatex = function(latex) { - var self = this; - var cursor = self.cursor; - self.jQ.children().slice(1).remove(); - self.ends[L] = self.ends[R] = 0; - delete cursor.selection; - cursor.show().insAtRightEnd(self); - - var regex = Parser.regex; - var string = Parser.string; - var eof = Parser.eof; - var all = Parser.all; - - // Parser RootMathCommand - var mathMode = string('$').then(latexMathParser) - // because TeX is insane, math mode doesn't necessarily - // have to end. So we allow for the case that math mode - // continues to the end of the stream. - .skip(string('$').or(eof)) - .map(function(block) { - // HACK FIXME: this shouldn't have to have access to cursor - var rootMathCommand = RootMathCommand(cursor); - - rootMathCommand.createBlocks(); - var rootMathBlock = rootMathCommand.ends[L]; - block.children().adopt(rootMathBlock, 0, 0); - - return rootMathCommand; - }) - ; - - var escapedDollar = string('\\$').result('$'); - var textChar = escapedDollar.or(regex(/^[^$]/)).map(VanillaSymbol); - var latexText = mathMode.or(textChar).many(); - var commands = latexText.skip(eof).or(all.result(false)).parse(latex); - - if (commands) { - for (var i = 0; i < commands.length; i += 1) { - commands[i].adopt(self, self.ends[R], 0); - } - - var html = self.join('html'); - MathElement.jQize(html).appendTo(self.jQ); - - this.finalizeInsert(); - } - }; - _.onKey = function(key) { - if (key === 'Spacebar' || key === 'Shift-Spacebar') return; - RootMathBlock.prototype.onKey.apply(this, arguments); - }; - _.onText = RootMathBlock.prototype.onText; - _.write = function(cursor, ch, replacedFragment) { - if (replacedFragment) replacedFragment.remove(); - if (ch === '$') - RootMathCommand(cursor).createLeftOf(cursor); - else { - var html; - if (ch === '<') html = '<'; - else if (ch === '>') html = '>'; - VanillaSymbol(ch, html).createLeftOf(cursor); - } - }; -}); -/*************************** - * Commands and Operators. - **************************/ - -var CharCmds = {}, LatexCmds = {}; //single character commands, LaTeX commands - -var scale, // = function(jQ, x, y) { ... } -//will use a CSS 2D transform to scale the jQuery-wrapped HTML elements, -//or the filter matrix transform fallback for IE 5.5-8, or gracefully degrade to -//increasing the fontSize to match the vertical Y scaling factor. - -//ideas from http://github.com/louisremi/jquery.transform.js -//see also http://msdn.microsoft.com/en-us/library/ms533014(v=vs.85).aspx - - forceIERedraw = noop, - div = document.createElement('div'), - div_style = div.style, - transformPropNames = { - transform:1, - WebkitTransform:1, - MozTransform:1, - OTransform:1, - msTransform:1 - }, - transformPropName; - -for (var prop in transformPropNames) { - if (prop in div_style) { - transformPropName = prop; - break; - } -} - -if (transformPropName) { - scale = function(jQ, x, y) { - jQ.css(transformPropName, 'scale('+x+','+y+')'); - }; -} -else if ('filter' in div_style) { //IE 6, 7, & 8 fallback, see https://github.com/laughinghan/mathquill/wiki/Transforms - forceIERedraw = function(el){ el.className = el.className; }; - scale = function(jQ, x, y) { //NOTE: assumes y > x - x /= (1+(y-1)/2); - jQ.css('fontSize', y + 'em'); - if (!jQ.hasClass('matrixed-container')) { - jQ.addClass('matrixed-container') - .wrapInner(''); - } - var innerjQ = jQ.children() - .css('filter', 'progid:DXImageTransform.Microsoft' - + '.Matrix(M11=' + x + ",SizingMethod='auto expand')" - ); - function calculateMarginRight() { - jQ.css('marginRight', (innerjQ.width()-1)*(x-1)/x + 'px'); - } - calculateMarginRight(); - var intervalId = setInterval(calculateMarginRight); - $(window).load(function() { - clearTimeout(intervalId); - calculateMarginRight(); - }); - }; -} -else { - scale = function(jQ, x, y) { - jQ.css('fontSize', y + 'em'); - }; -} - -var Style = P(MathCommand, function(_, _super) { - _.init = function(ctrlSeq, tagName, attrs) { - _super.init.call(this, ctrlSeq, '<'+tagName+' '+attrs+'>&0'); - }; -}); - -//fonts -LatexCmds.mathrm = bind(Style, '\\mathrm', 'span', 'class="roman font"'); -LatexCmds.mathit = bind(Style, '\\mathit', 'i', 'class="font"'); -LatexCmds.mathbf = bind(Style, '\\mathbf', 'b', 'class="font"'); -LatexCmds.mathsf = bind(Style, '\\mathsf', 'span', 'class="sans-serif font"'); -LatexCmds.mathtt = bind(Style, '\\mathtt', 'span', 'class="monospace font"'); -//text-decoration -LatexCmds.underline = bind(Style, '\\underline', 'span', 'class="non-leaf underline"'); -LatexCmds.overline = LatexCmds.bar = bind(Style, '\\overline', 'span', 'class="non-leaf overline"'); - -var SupSub = P(MathCommand, function(_, _super) { - _.init = function(ctrlSeq, tag, text) { - _super.init.call(this, ctrlSeq, '<'+tag+' class="non-leaf">&0', [ text ]); - }; - _.finalizeTree = function() { - //TODO: use inheritance - pray('SupSub is only _ and ^', - this.ctrlSeq === '^' || this.ctrlSeq === '_' - ); - - if (this.ctrlSeq === '_') { - this.down = this.ends[L]; - this.ends[L].up = insLeftOfMeUnlessAtEnd; - } - else { - this.up = this.ends[L]; - this.ends[L].down = insLeftOfMeUnlessAtEnd; - } - function insLeftOfMeUnlessAtEnd(cursor) { - // cursor.insLeftOf(cmd), unless cursor at the end of block, and every - // ancestor cmd is at the end of every ancestor block - var cmd = this.parent, ancestorCmd = cursor; - do { - if (ancestorCmd[R]) { - cursor.insLeftOf(cmd); - return false; - } - ancestorCmd = ancestorCmd.parent.parent; - } while (ancestorCmd !== cmd); - cursor.insRightOf(cmd); - return false; - } - }; - _.latex = function() { - var latex = this.ends[L].latex(); - if (latex.length === 1) - return this.ctrlSeq + latex; - else - return this.ctrlSeq + '{' + (latex || ' ') + '}'; - }; - _.redraw = function() { - if (this[L]) - this[L].respace(); - //SupSub::respace recursively calls respace on all the following SupSubs - //so if leftward is a SupSub, no need to call respace on this or following nodes - if (!(this[L] instanceof SupSub)) { - this.respace(); - //and if rightward is a SupSub, then this.respace() will have already called - //this[R].respace() - if (this[R] && !(this[R] instanceof SupSub)) - this[R].respace(); - } - }; - _.respace = function() { - if ( - this[L].ctrlSeq === '\\int ' || ( - this[L] instanceof SupSub && this[L].ctrlSeq != this.ctrlSeq - && this[L][L] && this[L][L].ctrlSeq === '\\int ' - ) - ) { - if (!this.limit) { - this.limit = true; - this.jQ.addClass('limit'); - } - } - else { - if (this.limit) { - this.limit = false; - this.jQ.removeClass('limit'); - } - } - - this.respaced = this[L] instanceof SupSub && this[L].ctrlSeq != this.ctrlSeq && !this[L].respaced; - if (this.respaced) { - var fontSize = +this.jQ.css('fontSize').slice(0,-2), - leftWidth = this[L].jQ.outerWidth(), - thisWidth = this.jQ.outerWidth(); - this.jQ.css({ - left: (this.limit && this.ctrlSeq === '_' ? -.25 : 0) - leftWidth/fontSize + 'em', - marginRight: .1 - min(thisWidth, leftWidth)/fontSize + 'em' - //1px extra so it doesn't wrap in retarded browsers (Firefox 2, I think) - }); - } - else if (this.limit && this.ctrlSeq === '_') { - this.jQ.css({ - left: '-.25em', - marginRight: '' - }); - } - else { - this.jQ.css({ - left: '', - marginRight: '' - }); - } - - if (this[R] instanceof SupSub) - this[R].respace(); - - return this; - }; -}); - -LatexCmds.subscript = -LatexCmds._ = bind(SupSub, '_', 'sub', '_'); - -LatexCmds.superscript = -LatexCmds.supscript = -LatexCmds['^'] = bind(SupSub, '^', 'sup', '**'); - -var Fraction = -LatexCmds.frac = -LatexCmds.dfrac = -LatexCmds.cfrac = -LatexCmds.fraction = P(MathCommand, function(_, _super) { - _.ctrlSeq = '\\frac'; - _.htmlTemplate = - '' - + '&0' - + '&1' - + ' ' - + '' - ; - _.textTemplate = ['(', '/', ')']; - _.finalizeTree = function() { - this.up = this.ends[R].up = this.ends[L]; - this.down = this.ends[L].down = this.ends[R]; - }; -}); - -var LiveFraction = -LatexCmds.over = -CharCmds['/'] = P(Fraction, function(_, _super) { - _.createLeftOf = function(cursor) { - if (!this.replacedFragment) { - var leftward = cursor[L]; - while (leftward && - !( - leftward instanceof BinaryOperator || - leftward instanceof TextBlock || - leftward instanceof BigSymbol || - ',;:'.split('').indexOf(leftward.ctrlSeq) > -1 - ) //lookbehind for operator - ) - leftward = leftward[L]; - - if (leftward instanceof BigSymbol && leftward[R] instanceof SupSub) { - leftward = leftward[R]; - if (leftward[R] instanceof SupSub && leftward[R].ctrlSeq != leftward.ctrlSeq) - leftward = leftward[R]; - } - - if (leftward !== cursor[L]) { - this.replaces(MathFragment(leftward[R] || cursor.parent.ends[L], cursor[L])); - cursor[L] = leftward; - } - } - _super.createLeftOf.call(this, cursor); - }; -}); - -var SquareRoot = -LatexCmds.sqrt = -LatexCmds['√'] = P(MathCommand, function(_, _super) { - _.ctrlSeq = '\\sqrt'; - _.htmlTemplate = - '' - + '' - + '&0' - + '' - ; - _.textTemplate = ['sqrt(', ')']; - _.parser = function() { - return latexMathParser.optBlock.then(function(optBlock) { - return latexMathParser.block.map(function(block) { - var nthroot = NthRoot(); - nthroot.blocks = [ optBlock, block ]; - optBlock.adopt(nthroot, 0, 0); - block.adopt(nthroot, optBlock, 0); - return nthroot; - }); - }).or(_super.parser.call(this)); - }; - _.redraw = function() { - var block = this.ends[R].jQ; - scale(block.prev(), 1, block.innerHeight()/+block.css('fontSize').slice(0,-2) - .1); - }; -}); - -var Vec = LatexCmds.vec = P(MathCommand, function(_, _super) { - _.ctrlSeq = '\\vec'; - _.htmlTemplate = - '' - + '' - + '&0' - + '' - ; - _.textTemplate = ['vec(', ')']; -}); - -var NthRoot = -LatexCmds.nthroot = P(SquareRoot, function(_, _super) { - _.htmlTemplate = - '&0' - + '' - + '' - + '&1' - + '' - ; - _.textTemplate = ['sqrt[', '](', ')']; - _.latex = function() { - return '\\sqrt['+this.ends[L].latex()+']{'+this.ends[R].latex()+'}'; - }; -}); - -// Round/Square/Curly/Angle Brackets (aka Parens/Brackets/Braces) -var Bracket = P(MathCommand, function(_, _super) { - _.init = function(open, close, ctrlSeq, end) { - _super.init.call(this, '\\left'+ctrlSeq, - '' - + ''+open+'' - + '&0' - + ''+close+'' - + '', - [open, close]); - this.end = '\\right'+end; - }; - _.jQadd = function() { - _super.jQadd.apply(this, arguments); - var jQ = this.jQ; - this.bracketjQs = jQ.children(':first').add(jQ.children(':last')); - }; - _.latex = function() { - return this.ctrlSeq + this.ends[L].latex() + this.end; - }; - _.redraw = function() { - var blockjQ = this.ends[L].jQ; - - var height = blockjQ.outerHeight()/+blockjQ.css('fontSize').slice(0,-2); - - scale(this.bracketjQs, min(1 + .2*(height - 1), 1.2), 1.05*height); - }; -}); - -LatexCmds.left = P(MathCommand, function(_) { - _.parser = function() { - var regex = Parser.regex; - var string = Parser.string; - var succeed = Parser.succeed; - var optWhitespace = Parser.optWhitespace; - - return optWhitespace.then(regex(/^(?:[([|]|\\\{)/)) - .then(function(open) { - if (open.charAt(0) === '\\') open = open.slice(1); - - var cmd = CharCmds[open](); - - return latexMathParser - .map(function (block) { - cmd.blocks = [ block ]; - block.adopt(cmd, 0, 0); - }) - .then(string('\\right')) - .skip(optWhitespace) - .then(regex(/^(?:[\])|]|\\\})/)) - .then(function(close) { - if (close.slice(-1) !== cmd.end.slice(-1)) { - return Parser.fail('open doesn\'t match close'); - } - - return succeed(cmd); - }) - ; - }) - ; - }; -}); - -LatexCmds.right = P(MathCommand, function(_) { - _.parser = function() { - return Parser.fail('unmatched \\right'); - }; -}); - -LatexCmds.lbrace = -CharCmds['{'] = bind(Bracket, '{', '}', '\\{', '\\}'); -LatexCmds.langle = -LatexCmds.lang = bind(Bracket, '⟨','⟩','\\langle ','\\rangle '); - -// Closing bracket matching opening bracket above -var CloseBracket = P(Bracket, function(_, _super) { - _.createLeftOf = function(cursor) { - // if I'm at the end of my parent who is a matching open-paren, - // and I am not replacing a selection fragment, don't create me, - // just put cursor after my parent - if (!cursor[R] && cursor.parent.parent && cursor.parent.parent.end === this.end && !this.replacedFragment) - cursor.insRightOf(cursor.parent.parent); - else - _super.createLeftOf.call(this, cursor); - }; - _.placeCursor = function(cursor) { - this.ends[L].blur(); - cursor.insRightOf(this); - }; -}); - -LatexCmds.rbrace = -CharCmds['}'] = bind(CloseBracket, '{','}','\\{','\\}'); -LatexCmds.rangle = -LatexCmds.rang = bind(CloseBracket, '⟨','⟩','\\langle ','\\rangle '); - -var parenMixin = function(_, _super) { - _.init = function(open, close) { - _super.init.call(this, open, close, open, close); - }; -}; - -var Paren = P(Bracket, parenMixin); - -LatexCmds.lparen = -CharCmds['('] = bind(Paren, '(', ')'); -LatexCmds.lbrack = -LatexCmds.lbracket = -CharCmds['['] = bind(Paren, '[', ']'); - -var CloseParen = P(CloseBracket, parenMixin); - -LatexCmds.rparen = -CharCmds[')'] = bind(CloseParen, '(', ')'); -LatexCmds.rbrack = -LatexCmds.rbracket = -CharCmds[']'] = bind(CloseParen, '[', ']'); - -var Pipes = -LatexCmds.lpipe = -LatexCmds.rpipe = -CharCmds['|'] = P(Paren, function(_, _super) { - _.init = function() { - _super.init.call(this, '|', '|'); - }; - - _.createLeftOf = CloseBracket.prototype.createLeftOf; -}); - -var TextBlock = -CharCmds.$ = -LatexCmds.text = -LatexCmds.textnormal = -LatexCmds.textrm = -LatexCmds.textup = -LatexCmds.textmd = P(MathCommand, function(_, _super) { - _.ctrlSeq = '\\text'; - _.htmlTemplate = '&0'; - _.replaces = function(replacedText) { - if (replacedText instanceof MathFragment) - this.replacedText = replacedText.remove().jQ.text(); - else if (typeof replacedText === 'string') - this.replacedText = replacedText; - }; - _.textTemplate = ['"', '"']; - _.parser = function() { - var self = this; - - // TODO: correctly parse text mode - var string = Parser.string; - var regex = Parser.regex; - var optWhitespace = Parser.optWhitespace; - return optWhitespace - .then(string('{')).then(regex(/^[^}]*/)).skip(string('}')) - .map(function(text) { - self.createBlocks(); - var block = self.ends[L]; - for (var i = 0; i < text.length; i += 1) { - var ch = VanillaSymbol(text.charAt(i)); - ch.adopt(block, block.ends[R], 0); - } - return self; - }) - ; - }; - _.createBlocks = function() { - //FIXME: another possible Law of Demeter violation, but this seems much cleaner, like it was supposed to be done this way - this.ends[L] = - this.ends[R] = - InnerTextBlock(); - - this.blocks = [ this.ends[L] ]; - - this.ends[L].parent = this; - }; - _.finalizeInsert = function() { - //FIXME HACK blur removes the TextBlock - this.ends[L].blur = function() { delete this.blur; return this; }; - _super.finalizeInsert.call(this); - }; - _.createLeftOf = function(cursor) { - _super.createLeftOf.call(this, this.cursor = cursor); - - if (this.replacedText) - for (var i = 0; i < this.replacedText.length; i += 1) - this.ends[L].write(cursor, this.replacedText.charAt(i)); - }; -}); - -var InnerTextBlock = P(MathBlock, function(_, _super) { - _.onKey = function(key, e) { - if (key === 'Spacebar' || key === 'Shift-Spacebar') return false; - }; - // backspace and delete at ends of block don't unwrap - _.deleteOutOf = function(dir, cursor) { - if (this.isEmpty()) cursor.insRightOf(this.parent); - }; - _.write = function(cursor, ch, replacedFragment) { - if (replacedFragment) replacedFragment.remove(); - - if (ch !== '$') { - var html; - if (ch === '<') html = '<'; - else if (ch === '>') html = '>'; - VanillaSymbol(ch, html).createLeftOf(cursor); - } - else if (this.isEmpty()) { - cursor.insRightOf(this.parent).backspace(); - VanillaSymbol('\\$','$').createLeftOf(cursor); - } - else if (!cursor[R]) - cursor.insRightOf(this.parent); - else if (!cursor[L]) - cursor.insLeftOf(this.parent); - else { //split apart - var rightward = TextBlock(); - rightward.replaces(MathFragment(cursor[R], this.ends[R])); - - cursor.insRightOf(this.parent); - - // FIXME HACK: pretend no prev so they don't get merged when - // .createLeftOf() calls blur on the InnerTextBlock - rightward.adopt = function() { - delete this.adopt; - this.adopt.apply(this, arguments); - this[L] = 0; - }; - rightward.createLeftOf(cursor); - rightward[L] = this.parent; - - cursor.insLeftOf(rightward); - } - return false; - }; - _.blur = function() { - this.jQ.removeClass('hasCursor'); - if (this.isEmpty()) { - var textblock = this.parent, cursor = textblock.cursor; - if (cursor.parent === this) - this.jQ.addClass('empty'); - else { - cursor.hide(); - textblock.remove(); - if (cursor[R] === textblock) - cursor[R] = textblock[R]; - else if (cursor[L] === textblock) - cursor[L] = textblock[L]; - - cursor.show().parent.bubble('redraw'); - } - } - return this; - }; - _.focus = function() { - _super.focus.call(this); - - var textblock = this.parent; - if (textblock[R].ctrlSeq === textblock.ctrlSeq) { //TODO: seems like there should be a better way to move MathElements around - var innerblock = this, - cursor = textblock.cursor, - rightward = textblock[R].ends[L]; - - rightward.eachChild(function(child){ - child.parent = innerblock; - child.jQ.appendTo(innerblock.jQ); - }); - - if (this.ends[R]) - this.ends[R][R] = rightward.ends[L]; - else - this.ends[L] = rightward.ends[L]; - - rightward.ends[L][L] = this.ends[R]; - this.ends[R] = rightward.ends[R]; - - rightward.parent.remove(); - - if (cursor[L]) - cursor.insRightOf(cursor[L]); - else - cursor.insAtLeftEnd(this); - - cursor.parent.bubble('redraw'); - } - else if (textblock[L].ctrlSeq === textblock.ctrlSeq) { - var cursor = textblock.cursor; - if (cursor[L]) - textblock[L].ends[L].focus(); - else - cursor.insAtRightEnd(textblock[L].ends[L]); - } - return this; - }; -}); - - -function makeTextBlock(latex, tagName, attrs) { - return P(TextBlock, { - ctrlSeq: latex, - htmlTemplate: '<'+tagName+' '+attrs+'>&0' - }); -} - -LatexCmds.em = LatexCmds.italic = LatexCmds.italics = -LatexCmds.emph = LatexCmds.textit = LatexCmds.textsl = - makeTextBlock('\\textit', 'i', 'class="text"'); -LatexCmds.strong = LatexCmds.bold = LatexCmds.textbf = - makeTextBlock('\\textbf', 'b', 'class="text"'); -LatexCmds.sf = LatexCmds.textsf = - makeTextBlock('\\textsf', 'span', 'class="sans-serif text"'); -LatexCmds.tt = LatexCmds.texttt = - makeTextBlock('\\texttt', 'span', 'class="monospace text"'); -LatexCmds.textsc = - makeTextBlock('\\textsc', 'span', 'style="font-variant:small-caps" class="text"'); -LatexCmds.uppercase = - makeTextBlock('\\uppercase', 'span', 'style="text-transform:uppercase" class="text"'); -LatexCmds.lowercase = - makeTextBlock('\\lowercase', 'span', 'style="text-transform:lowercase" class="text"'); - -// input box to type a variety of LaTeX commands beginning with a backslash -var LatexCommandInput = -CharCmds['\\'] = P(MathCommand, function(_, _super) { - _.ctrlSeq = '\\'; - _.replaces = function(replacedFragment) { - this._replacedFragment = replacedFragment.disown(); - this.isEmpty = function() { return false; }; - }; - _.htmlTemplate = '\\&0'; - _.textTemplate = ['\\']; - _.createBlocks = function() { - _super.createBlocks.call(this); - this.ends[L].focus = function() { - this.parent.jQ.addClass('hasCursor'); - if (this.isEmpty()) - this.parent.jQ.removeClass('empty'); - - return this; - }; - this.ends[L].blur = function() { - this.parent.jQ.removeClass('hasCursor'); - if (this.isEmpty()) - this.parent.jQ.addClass('empty'); - - return this; - }; - }; - _.createLeftOf = function(cursor) { - _super.createLeftOf.call(this, cursor); - - this.cursor = cursor.insAtRightEnd(this.ends[L]); - if (this._replacedFragment) { - var el = this.jQ[0]; - this.jQ = - this._replacedFragment.jQ.addClass('blur').bind( - 'mousedown mousemove', //FIXME: is monkey-patching the mousedown and mousemove handlers the right way to do this? - function(e) { - $(e.target = el).trigger(e); - return false; - } - ).insertBefore(this.jQ).add(this.jQ); - } - - this.ends[L].write = function(cursor, ch, replacedFragment) { - if (replacedFragment) replacedFragment.remove(); - - if (ch.match(/[a-z]/i)) VanillaSymbol(ch).createLeftOf(cursor); - else { - this.parent.renderCommand(); - if (ch !== '\\' || !this.isEmpty()) this.parent.parent.write(cursor, ch); - } - }; - }; - _.latex = function() { - return '\\' + this.ends[L].latex() + ' '; - }; - _.onKey = function(key, e) { - if (key === 'Tab' || key === 'Enter' || key === 'Spacebar') { - this.renderCommand(); - e.preventDefault(); - return false; - } - }; - _.renderCommand = function() { - this.jQ = this.jQ.last(); - this.remove(); - if (this[R]) { - this.cursor.insLeftOf(this[R]); - } else { - this.cursor.insAtRightEnd(this.parent); - } - - var latex = this.ends[L].latex(), cmd; - if (!latex) latex = 'backslash'; - this.cursor.insertCmd(latex, this._replacedFragment); - }; -}); - -var Binomial = -LatexCmds.binom = -LatexCmds.binomial = P(MathCommand, function(_, _super) { - _.ctrlSeq = '\\binom'; - _.htmlTemplate = - '(' - + '' - + '' - + '&0' - + '&1' - + '' - + '' - + ')' - ; - _.textTemplate = ['choose(',',',')']; - _.redraw = function() { - var blockjQ = this.jQ.eq(1); - - var height = blockjQ.outerHeight()/+blockjQ.css('fontSize').slice(0,-2); - - var parens = this.jQ.filter('.paren'); - scale(parens, min(1 + .2*(height - 1), 1.2), 1.05*height); - }; -}); - -var Choose = -LatexCmds.choose = P(Binomial, function(_) { - _.createLeftOf = LiveFraction.prototype.createLeftOf; -}); - -var Vector = -LatexCmds.vector = P(MathCommand, function(_, _super) { - _.ctrlSeq = '\\vector'; - _.htmlTemplate = '&0'; - _.latex = function() { - return '\\begin{matrix}' + this.foldChildren([], function(latex, child) { - latex.push(child.latex()); - return latex; - }).join('\\\\') + '\\end{matrix}'; - }; - _.text = function() { - return '[' + this.foldChildren([], function(text, child) { - text.push(child.text()); - return text; - }).join() + ']'; - }; - _.createLeftOf = function(cursor) { - _super.createLeftOf.call(this, this.cursor = cursor); - }; - _.onKey = function(key, e) { - var currentBlock = this.cursor.parent; - - if (currentBlock.parent === this) { - if (key === 'Enter') { //enter - var newBlock = MathBlock(); - newBlock.parent = this; - newBlock.jQ = $('') - .attr(mqBlockId, newBlock.id) - .insertAfter(currentBlock.jQ); - if (currentBlock[R]) - currentBlock[R][L] = newBlock; - else - this.ends[R] = newBlock; - - newBlock[R] = currentBlock[R]; - currentBlock[R] = newBlock; - newBlock[L] = currentBlock; - this.bubble('redraw').cursor.insAtRightEnd(newBlock); - - e.preventDefault(); - return false; - } - else if (key === 'Tab' && !currentBlock[R]) { - if (currentBlock.isEmpty()) { - if (currentBlock[L]) { - this.cursor.insRightOf(this); - delete currentBlock[L][R]; - this.ends[R] = currentBlock[L]; - currentBlock.jQ.remove(); - this.bubble('redraw'); - - e.preventDefault(); - return false; - } - else - return; - } - - var newBlock = MathBlock(); - newBlock.parent = this; - newBlock.jQ = $('').attr(mqBlockId, newBlock.id).appendTo(this.jQ); - this.ends[R] = newBlock; - currentBlock[R] = newBlock; - newBlock[L] = currentBlock; - this.bubble('redraw').cursor.insAtRightEnd(newBlock); - - e.preventDefault(); - return false; - } - else if (e.which === 8) { //backspace - if (currentBlock.isEmpty()) { - if (currentBlock[L]) { - this.cursor.insAtRightEnd(currentBlock[L]) - currentBlock[L][R] = currentBlock[R]; - } - else { - this.cursor.insLeftOf(this); - this.ends[L] = currentBlock[R]; - } - - if (currentBlock[R]) - currentBlock[R][L] = currentBlock[L]; - else - this.ends[R] = currentBlock[L]; - - currentBlock.jQ.remove(); - if (this.isEmpty()) - this.cursor.deleteForward(); - else - this.bubble('redraw'); - - e.preventDefault(); - return false; - } - else if (!this.cursor[L]) { - e.preventDefault(); - return false; - } - } - } - }; -}); - -LatexCmds.editable = P(RootMathCommand, function(_, _super) { - _.init = function() { - MathCommand.prototype.init.call(this, '\\editable'); - }; - - _.jQadd = function() { - var self = this; - // FIXME: this entire method is a giant hack to get around - // having to call createBlocks, and createRoot expecting to - // render the contents' LaTeX. Both need to be refactored. - _super.jQadd.apply(self, arguments); - var block = self.ends[L].disown(); - var blockjQ = self.jQ.children().detach(); - - self.ends[L] = - self.ends[R] = - RootMathBlock(); - - self.blocks = [ self.ends[L] ]; - - self.ends[L].parent = self; - - createRoot(self.jQ, self.ends[L], false, true); - self.cursor = self.ends[L].cursor; - - block.children().adopt(self.ends[L], 0, 0); - blockjQ.appendTo(self.ends[L].jQ); - - self.ends[L].cursor.insAtRightEnd(self.ends[L]); - }; - - _.latex = function(){ return this.ends[L].latex(); }; - _.text = function(){ return this.ends[L].text(); }; -}); -/********************************** - * Symbols and Special Characters - *********************************/ - -LatexCmds.f = bind(Symbol, 'f', 'ƒ '); - -var Variable = P(Symbol, function(_, _super) { - _.init = function(ch, html) { - _super.init.call(this, ch, ''+(html || ch)+''); - }; - _.text = function() { - var text = this.ctrlSeq; - if (this[L] && !(this[L] instanceof Variable) - && !(this[L] instanceof BinaryOperator)) - text = '*' + text; - if (this[R] && !(this[R] instanceof BinaryOperator) - && !(this[R].ctrlSeq === '^')) - text += '*'; - return text; - }; -}); - -var VanillaSymbol = P(Symbol, function(_, _super) { - _.init = function(ch, html) { - _super.init.call(this, ch, ''+(html || ch)+''); - }; -}); - -CharCmds[' '] = bind(VanillaSymbol, '\\:', ' '); - -LatexCmds.prime = CharCmds["'"] = bind(VanillaSymbol, "'", '′'); - -// does not use Symbola font -var NonSymbolaSymbol = P(Symbol, function(_, _super) { - _.init = function(ch, html) { - _super.init.call(this, ch, ''+(html || ch)+''); - }; -}); - -LatexCmds['@'] = NonSymbolaSymbol; -LatexCmds['&'] = bind(NonSymbolaSymbol, '\\&', '&'); -LatexCmds['%'] = bind(NonSymbolaSymbol, '\\%', '%'); - -//the following are all Greek to me, but this helped a lot: http://www.ams.org/STIX/ion/stixsig03.html - -//lowercase Greek letter variables -LatexCmds.alpha = -LatexCmds.beta = -LatexCmds.gamma = -LatexCmds.delta = -LatexCmds.zeta = -LatexCmds.eta = -LatexCmds.theta = -LatexCmds.iota = -LatexCmds.kappa = -LatexCmds.mu = -LatexCmds.nu = -LatexCmds.xi = -LatexCmds.rho = -LatexCmds.sigma = -LatexCmds.tau = -LatexCmds.chi = -LatexCmds.psi = -LatexCmds.omega = P(Variable, function(_, _super) { - _.init = function(latex) { - _super.init.call(this,'\\'+latex+' ','&'+latex+';'); - }; -}); - -//why can't anybody FUCKING agree on these -LatexCmds.phi = //W3C or Unicode? - bind(Variable,'\\phi ','ϕ'); - -LatexCmds.phiv = //Elsevier and 9573-13 -LatexCmds.varphi = //AMS and LaTeX - bind(Variable,'\\varphi ','φ'); - -LatexCmds.epsilon = //W3C or Unicode? - bind(Variable,'\\epsilon ','ϵ'); - -LatexCmds.epsiv = //Elsevier and 9573-13 -LatexCmds.varepsilon = //AMS and LaTeX - bind(Variable,'\\varepsilon ','ε'); - -LatexCmds.piv = //W3C/Unicode and Elsevier and 9573-13 -LatexCmds.varpi = //AMS and LaTeX - bind(Variable,'\\varpi ','ϖ'); - -LatexCmds.sigmaf = //W3C/Unicode -LatexCmds.sigmav = //Elsevier -LatexCmds.varsigma = //LaTeX - bind(Variable,'\\varsigma ','ς'); - -LatexCmds.thetav = //Elsevier and 9573-13 -LatexCmds.vartheta = //AMS and LaTeX -LatexCmds.thetasym = //W3C/Unicode - bind(Variable,'\\vartheta ','ϑ'); - -LatexCmds.upsilon = //AMS and LaTeX and W3C/Unicode -LatexCmds.upsi = //Elsevier and 9573-13 - bind(Variable,'\\upsilon ','υ'); - -//these aren't even mentioned in the HTML character entity references -LatexCmds.gammad = //Elsevier -LatexCmds.Gammad = //9573-13 -- WTF, right? I dunno if this was a typo in the reference (see above) -LatexCmds.digamma = //LaTeX - bind(Variable,'\\digamma ','ϝ'); - -LatexCmds.kappav = //Elsevier -LatexCmds.varkappa = //AMS and LaTeX - bind(Variable,'\\varkappa ','ϰ'); - -LatexCmds.rhov = //Elsevier and 9573-13 -LatexCmds.varrho = //AMS and LaTeX - bind(Variable,'\\varrho ','ϱ'); - -//Greek constants, look best in un-italicised Times New Roman -LatexCmds.pi = LatexCmds['π'] = bind(NonSymbolaSymbol,'\\pi ','π'); -LatexCmds.lambda = bind(NonSymbolaSymbol,'\\lambda ','λ'); - -//uppercase greek letters - -LatexCmds.Upsilon = //LaTeX -LatexCmds.Upsi = //Elsevier and 9573-13 -LatexCmds.upsih = //W3C/Unicode "upsilon with hook" -LatexCmds.Upsih = //'cos it makes sense to me - bind(Symbol,'\\Upsilon ','ϒ'); //Symbola's 'upsilon with a hook' is a capital Y without hooks :( - -//other symbols with the same LaTeX command and HTML character entity reference -LatexCmds.Gamma = -LatexCmds.Delta = -LatexCmds.Theta = -LatexCmds.Lambda = -LatexCmds.Xi = -LatexCmds.Pi = -LatexCmds.Sigma = -LatexCmds.Phi = -LatexCmds.Psi = -LatexCmds.Omega = -LatexCmds.forall = P(VanillaSymbol, function(_, _super) { - _.init = function(latex) { - _super.init.call(this,'\\'+latex+' ','&'+latex+';'); - }; -}); - -// symbols that aren't a single MathCommand, but are instead a whole -// Fragment. Creates the Fragment from a LaTeX string -var LatexFragment = P(MathCommand, function(_) { - _.init = function(latex) { this.latex = latex; }; - _.createLeftOf = function(cursor) { cursor.writeLatex(this.latex); }; - _.parser = function() { - var frag = latexMathParser.parse(this.latex).children(); - return Parser.succeed(frag); - }; -}); - -// for what seems to me like [stupid reasons][1], Unicode provides -// subscripted and superscripted versions of all ten Arabic numerals, -// as well as [so-called "vulgar fractions"][2]. -// Nobody really cares about most of them, but some of them actually -// predate Unicode, dating back to [ISO-8859-1][3], apparently also -// known as "Latin-1", which among other things [Windows-1252][4] -// largely coincides with, so Microsoft Word sometimes inserts them -// and they get copy-pasted into MathQuill. -// -// (Irrelevant but funny story: Windows-1252 is actually a strict -// superset of the "closely related but distinct"[3] "ISO 8859-1" -- -// see the lack of a dash after "ISO"? Completely different character -// set, like elephants vs elephant seals, or "Zombies" vs "Zombie -// Redneck Torture Family". What kind of idiot would get them confused. -// People in fact got them confused so much, it was so common to -// mislabel Windows-1252 text as ISO-8859-1, that most modern web -// browsers and email clients treat the MIME charset of ISO-8859-1 -// as actually Windows-1252, behavior now standard in the HTML5 spec.) -// -// [1]: http://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts -// [2]: http://en.wikipedia.org/wiki/Number_Forms -// [3]: http://en.wikipedia.org/wiki/ISO/IEC_8859-1 -// [4]: http://en.wikipedia.org/wiki/Windows-1252 -LatexCmds['¹'] = bind(LatexFragment, '^1'); -LatexCmds['²'] = bind(LatexFragment, '^2'); -LatexCmds['³'] = bind(LatexFragment, '^3'); -LatexCmds['¼'] = bind(LatexFragment, '\\frac14'); -LatexCmds['½'] = bind(LatexFragment, '\\frac12'); -LatexCmds['¾'] = bind(LatexFragment, '\\frac34'); - -var BinaryOperator = P(Symbol, function(_, _super) { - _.init = function(ctrlSeq, html, text) { - _super.init.call(this, - ctrlSeq, ''+html+'', text - ); - }; -}); - -var PlusMinus = P(BinaryOperator, function(_) { - _.init = VanillaSymbol.prototype.init; - - _.respace = function() { - if (!this[L]) { - this.jQ[0].className = ''; - } - else if ( - this[L] instanceof BinaryOperator && - this[R] && !(this[R] instanceof BinaryOperator) - ) { - this.jQ[0].className = 'unary-operator'; - } - else { - this.jQ[0].className = 'binary-operator'; - } - return this; - }; -}); - -LatexCmds['+'] = bind(PlusMinus, '+', '+'); -//yes, these are different dashes, I think one is an en dash and the other is a hyphen -LatexCmds['–'] = LatexCmds['-'] = bind(PlusMinus, '-', '−'); -LatexCmds['±'] = LatexCmds.pm = LatexCmds.plusmn = LatexCmds.plusminus = - bind(PlusMinus,'\\pm ','±'); -LatexCmds.mp = LatexCmds.mnplus = LatexCmds.minusplus = - bind(PlusMinus,'\\mp ','∓'); - -CharCmds['*'] = LatexCmds.sdot = LatexCmds.cdot = - bind(BinaryOperator, '\\cdot ', '·'); -//semantically should be ⋅, but · looks better - -LatexCmds['='] = bind(BinaryOperator, '=', '='); -LatexCmds['<'] = bind(BinaryOperator, '<', '<'); -LatexCmds['>'] = bind(BinaryOperator, '>', '>'); - -LatexCmds.notin = -LatexCmds.sim = -LatexCmds.cong = -LatexCmds.equiv = -LatexCmds.oplus = -LatexCmds.otimes = P(BinaryOperator, function(_, _super) { - _.init = function(latex) { - _super.init.call(this, '\\'+latex+' ', '&'+latex+';'); - }; -}); - -LatexCmds.times = bind(BinaryOperator, '\\times ', '×', '[x]'); - -LatexCmds['÷'] = LatexCmds.div = LatexCmds.divide = LatexCmds.divides = - bind(BinaryOperator,'\\div ','÷', '[/]'); - -LatexCmds['≠'] = LatexCmds.ne = LatexCmds.neq = bind(BinaryOperator,'\\ne ','≠'); - -LatexCmds.ast = LatexCmds.star = LatexCmds.loast = LatexCmds.lowast = - bind(BinaryOperator,'\\ast ','∗'); - //case 'there4 = // a special exception for this one, perhaps? -LatexCmds.therefor = LatexCmds.therefore = - bind(BinaryOperator,'\\therefore ','∴'); - -LatexCmds.cuz = // l33t -LatexCmds.because = bind(BinaryOperator,'\\because ','∵'); - -LatexCmds.prop = LatexCmds.propto = bind(BinaryOperator,'\\propto ','∝'); - -LatexCmds['≈'] = LatexCmds.asymp = LatexCmds.approx = bind(BinaryOperator,'\\approx ','≈'); - -LatexCmds.lt = bind(BinaryOperator,'<','<'); - -LatexCmds.gt = bind(BinaryOperator,'>','>'); - -LatexCmds['≤'] = LatexCmds.le = LatexCmds.leq = bind(BinaryOperator,'\\le ','≤'); - -LatexCmds['≥'] = LatexCmds.ge = LatexCmds.geq = bind(BinaryOperator,'\\ge ','≥'); - -LatexCmds.isin = LatexCmds['in'] = bind(BinaryOperator,'\\in ','∈'); - -LatexCmds.ni = LatexCmds.contains = bind(BinaryOperator,'\\ni ','∋'); - -LatexCmds.notni = LatexCmds.niton = LatexCmds.notcontains = LatexCmds.doesnotcontain = - bind(BinaryOperator,'\\not\\ni ','∌'); - -LatexCmds.sub = LatexCmds.subset = bind(BinaryOperator,'\\subset ','⊂'); - -LatexCmds.sup = LatexCmds.supset = LatexCmds.superset = - bind(BinaryOperator,'\\supset ','⊃'); - -LatexCmds.nsub = LatexCmds.notsub = -LatexCmds.nsubset = LatexCmds.notsubset = - bind(BinaryOperator,'\\not\\subset ','⊄'); - -LatexCmds.nsup = LatexCmds.notsup = -LatexCmds.nsupset = LatexCmds.notsupset = -LatexCmds.nsuperset = LatexCmds.notsuperset = - bind(BinaryOperator,'\\not\\supset ','⊅'); - -LatexCmds.sube = LatexCmds.subeq = LatexCmds.subsete = LatexCmds.subseteq = - bind(BinaryOperator,'\\subseteq ','⊆'); - -LatexCmds.supe = LatexCmds.supeq = -LatexCmds.supsete = LatexCmds.supseteq = -LatexCmds.supersete = LatexCmds.superseteq = - bind(BinaryOperator,'\\supseteq ','⊇'); - -LatexCmds.nsube = LatexCmds.nsubeq = -LatexCmds.notsube = LatexCmds.notsubeq = -LatexCmds.nsubsete = LatexCmds.nsubseteq = -LatexCmds.notsubsete = LatexCmds.notsubseteq = - bind(BinaryOperator,'\\not\\subseteq ','⊈'); - -LatexCmds.nsupe = LatexCmds.nsupeq = -LatexCmds.notsupe = LatexCmds.notsupeq = -LatexCmds.nsupsete = LatexCmds.nsupseteq = -LatexCmds.notsupsete = LatexCmds.notsupseteq = -LatexCmds.nsupersete = LatexCmds.nsuperseteq = -LatexCmds.notsupersete = LatexCmds.notsuperseteq = - bind(BinaryOperator,'\\not\\supseteq ','⊉'); - - -//sum, product, coproduct, integral -var BigSymbol = P(Symbol, function(_, _super) { - _.init = function(ch, html) { - _super.init.call(this, ch, ''+html+''); - }; -}); - -LatexCmds['∑'] = LatexCmds.sum = LatexCmds.summation = bind(BigSymbol,'\\sum ','∑'); -LatexCmds['∏'] = LatexCmds.prod = LatexCmds.product = bind(BigSymbol,'\\prod ','∏'); -LatexCmds.coprod = LatexCmds.coproduct = bind(BigSymbol,'\\coprod ','∐'); -LatexCmds['∫'] = LatexCmds['int'] = LatexCmds.integral = bind(BigSymbol,'\\int ','∫'); - - - -//the canonical sets of numbers -LatexCmds.N = LatexCmds.naturals = LatexCmds.Naturals = - bind(VanillaSymbol,'\\mathbb{N}','ℕ'); - -LatexCmds.P = -LatexCmds.primes = LatexCmds.Primes = -LatexCmds.projective = LatexCmds.Projective = -LatexCmds.probability = LatexCmds.Probability = - bind(VanillaSymbol,'\\mathbb{P}','ℙ'); - -LatexCmds.Z = LatexCmds.integers = LatexCmds.Integers = - bind(VanillaSymbol,'\\mathbb{Z}','ℤ'); - -LatexCmds.Q = LatexCmds.rationals = LatexCmds.Rationals = - bind(VanillaSymbol,'\\mathbb{Q}','ℚ'); - -LatexCmds.R = LatexCmds.reals = LatexCmds.Reals = - bind(VanillaSymbol,'\\mathbb{R}','ℝ'); - -LatexCmds.C = -LatexCmds.complex = LatexCmds.Complex = -LatexCmds.complexes = LatexCmds.Complexes = -LatexCmds.complexplane = LatexCmds.Complexplane = LatexCmds.ComplexPlane = - bind(VanillaSymbol,'\\mathbb{C}','ℂ'); - -LatexCmds.H = LatexCmds.Hamiltonian = LatexCmds.quaternions = LatexCmds.Quaternions = - bind(VanillaSymbol,'\\mathbb{H}','ℍ'); - -//spacing -LatexCmds.quad = LatexCmds.emsp = bind(VanillaSymbol,'\\quad ',' '); -LatexCmds.qquad = bind(VanillaSymbol,'\\qquad ',' '); -/* spacing special characters, gonna have to implement this in LatexCommandInput::onText somehow -case ',': - return VanillaSymbol('\\, ',' '); -case ':': - return VanillaSymbol('\\: ',' '); -case ';': - return VanillaSymbol('\\; ',' '); -case '!': - return Symbol('\\! ',''); -*/ - -//binary operators -LatexCmds.diamond = bind(VanillaSymbol, '\\diamond ', '◇'); -LatexCmds.bigtriangleup = bind(VanillaSymbol, '\\bigtriangleup ', '△'); -LatexCmds.ominus = bind(VanillaSymbol, '\\ominus ', '⊖'); -LatexCmds.uplus = bind(VanillaSymbol, '\\uplus ', '⊎'); -LatexCmds.bigtriangledown = bind(VanillaSymbol, '\\bigtriangledown ', '▽'); -LatexCmds.sqcap = bind(VanillaSymbol, '\\sqcap ', '⊓'); -LatexCmds.triangleleft = bind(VanillaSymbol, '\\triangleleft ', '⊲'); -LatexCmds.sqcup = bind(VanillaSymbol, '\\sqcup ', '⊔'); -LatexCmds.triangleright = bind(VanillaSymbol, '\\triangleright ', '⊳'); -LatexCmds.odot = bind(VanillaSymbol, '\\odot ', '⊙'); -LatexCmds.bigcirc = bind(VanillaSymbol, '\\bigcirc ', '◯'); -LatexCmds.dagger = bind(VanillaSymbol, '\\dagger ', '†'); -LatexCmds.ddagger = bind(VanillaSymbol, '\\ddagger ', '‡'); -LatexCmds.wr = bind(VanillaSymbol, '\\wr ', '≀'); -LatexCmds.amalg = bind(VanillaSymbol, '\\amalg ', '∐'); - -//relationship symbols -LatexCmds.models = bind(VanillaSymbol, '\\models ', '⊨'); -LatexCmds.prec = bind(VanillaSymbol, '\\prec ', '≺'); -LatexCmds.succ = bind(VanillaSymbol, '\\succ ', '≻'); -LatexCmds.preceq = bind(VanillaSymbol, '\\preceq ', '≼'); -LatexCmds.succeq = bind(VanillaSymbol, '\\succeq ', '≽'); -LatexCmds.simeq = bind(VanillaSymbol, '\\simeq ', '≃'); -LatexCmds.mid = bind(VanillaSymbol, '\\mid ', '∣'); -LatexCmds.ll = bind(VanillaSymbol, '\\ll ', '≪'); -LatexCmds.gg = bind(VanillaSymbol, '\\gg ', '≫'); -LatexCmds.parallel = bind(VanillaSymbol, '\\parallel ', '∥'); -LatexCmds.bowtie = bind(VanillaSymbol, '\\bowtie ', '⋈'); -LatexCmds.sqsubset = bind(VanillaSymbol, '\\sqsubset ', '⊏'); -LatexCmds.sqsupset = bind(VanillaSymbol, '\\sqsupset ', '⊐'); -LatexCmds.smile = bind(VanillaSymbol, '\\smile ', '⌣'); -LatexCmds.sqsubseteq = bind(VanillaSymbol, '\\sqsubseteq ', '⊑'); -LatexCmds.sqsupseteq = bind(VanillaSymbol, '\\sqsupseteq ', '⊒'); -LatexCmds.doteq = bind(VanillaSymbol, '\\doteq ', '≐'); -LatexCmds.frown = bind(VanillaSymbol, '\\frown ', '⌢'); -LatexCmds.vdash = bind(VanillaSymbol, '\\vdash ', '⊦'); -LatexCmds.dashv = bind(VanillaSymbol, '\\dashv ', '⊣'); - -//arrows -LatexCmds.longleftarrow = bind(VanillaSymbol, '\\longleftarrow ', '←'); -LatexCmds.longrightarrow = bind(VanillaSymbol, '\\longrightarrow ', '→'); -LatexCmds.Longleftarrow = bind(VanillaSymbol, '\\Longleftarrow ', '⇐'); -LatexCmds.Longrightarrow = bind(VanillaSymbol, '\\Longrightarrow ', '⇒'); -LatexCmds.longleftrightarrow = bind(VanillaSymbol, '\\longleftrightarrow ', '↔'); -LatexCmds.updownarrow = bind(VanillaSymbol, '\\updownarrow ', '↕'); -LatexCmds.Longleftrightarrow = bind(VanillaSymbol, '\\Longleftrightarrow ', '⇔'); -LatexCmds.Updownarrow = bind(VanillaSymbol, '\\Updownarrow ', '⇕'); -LatexCmds.mapsto = bind(VanillaSymbol, '\\mapsto ', '↦'); -LatexCmds.nearrow = bind(VanillaSymbol, '\\nearrow ', '↗'); -LatexCmds.hookleftarrow = bind(VanillaSymbol, '\\hookleftarrow ', '↩'); -LatexCmds.hookrightarrow = bind(VanillaSymbol, '\\hookrightarrow ', '↪'); -LatexCmds.searrow = bind(VanillaSymbol, '\\searrow ', '↘'); -LatexCmds.leftharpoonup = bind(VanillaSymbol, '\\leftharpoonup ', '↼'); -LatexCmds.rightharpoonup = bind(VanillaSymbol, '\\rightharpoonup ', '⇀'); -LatexCmds.swarrow = bind(VanillaSymbol, '\\swarrow ', '↙'); -LatexCmds.leftharpoondown = bind(VanillaSymbol, '\\leftharpoondown ', '↽'); -LatexCmds.rightharpoondown = bind(VanillaSymbol, '\\rightharpoondown ', '⇁'); -LatexCmds.nwarrow = bind(VanillaSymbol, '\\nwarrow ', '↖'); - -//Misc -LatexCmds.ldots = bind(VanillaSymbol, '\\ldots ', '…'); -LatexCmds.cdots = bind(VanillaSymbol, '\\cdots ', '⋯'); -LatexCmds.vdots = bind(VanillaSymbol, '\\vdots ', '⋮'); -LatexCmds.ddots = bind(VanillaSymbol, '\\ddots ', '⋰'); -LatexCmds.surd = bind(VanillaSymbol, '\\surd ', '√'); -LatexCmds.triangle = bind(VanillaSymbol, '\\triangle ', '▵'); -LatexCmds.ell = bind(VanillaSymbol, '\\ell ', 'ℓ'); -LatexCmds.top = bind(VanillaSymbol, '\\top ', '⊤'); -LatexCmds.flat = bind(VanillaSymbol, '\\flat ', '♭'); -LatexCmds.natural = bind(VanillaSymbol, '\\natural ', '♮'); -LatexCmds.sharp = bind(VanillaSymbol, '\\sharp ', '♯'); -LatexCmds.wp = bind(VanillaSymbol, '\\wp ', '℘'); -LatexCmds.bot = bind(VanillaSymbol, '\\bot ', '⊥'); -LatexCmds.clubsuit = bind(VanillaSymbol, '\\clubsuit ', '♣'); -LatexCmds.diamondsuit = bind(VanillaSymbol, '\\diamondsuit ', '♢'); -LatexCmds.heartsuit = bind(VanillaSymbol, '\\heartsuit ', '♡'); -LatexCmds.spadesuit = bind(VanillaSymbol, '\\spadesuit ', '♠'); - -//variable-sized -LatexCmds.oint = bind(VanillaSymbol, '\\oint ', '∮'); -LatexCmds.bigcap = bind(VanillaSymbol, '\\bigcap ', '∩'); -LatexCmds.bigcup = bind(VanillaSymbol, '\\bigcup ', '∪'); -LatexCmds.bigsqcup = bind(VanillaSymbol, '\\bigsqcup ', '⊔'); -LatexCmds.bigvee = bind(VanillaSymbol, '\\bigvee ', '∨'); -LatexCmds.bigwedge = bind(VanillaSymbol, '\\bigwedge ', '∧'); -LatexCmds.bigodot = bind(VanillaSymbol, '\\bigodot ', '⊙'); -LatexCmds.bigotimes = bind(VanillaSymbol, '\\bigotimes ', '⊗'); -LatexCmds.bigoplus = bind(VanillaSymbol, '\\bigoplus ', '⊕'); -LatexCmds.biguplus = bind(VanillaSymbol, '\\biguplus ', '⊎'); - -//delimiters -LatexCmds.lfloor = bind(VanillaSymbol, '\\lfloor ', '⌊'); -LatexCmds.rfloor = bind(VanillaSymbol, '\\rfloor ', '⌋'); -LatexCmds.lceil = bind(VanillaSymbol, '\\lceil ', '⌈'); -LatexCmds.rceil = bind(VanillaSymbol, '\\rceil ', '⌉'); -LatexCmds.slash = bind(VanillaSymbol, '\\slash ', '/'); -LatexCmds.opencurlybrace = bind(VanillaSymbol, '\\opencurlybrace ', '{'); -LatexCmds.closecurlybrace = bind(VanillaSymbol, '\\closecurlybrace ', '}'); - -//various symbols - -LatexCmds.caret = bind(VanillaSymbol,'\\caret ','^'); -LatexCmds.underscore = bind(VanillaSymbol,'\\underscore ','_'); -LatexCmds.backslash = bind(VanillaSymbol,'\\backslash ','\\'); -LatexCmds.vert = bind(VanillaSymbol,'|'); -LatexCmds.perp = LatexCmds.perpendicular = bind(VanillaSymbol,'\\perp ','⊥'); -LatexCmds.nabla = LatexCmds.del = bind(VanillaSymbol,'\\nabla ','∇'); -LatexCmds.hbar = bind(VanillaSymbol,'\\hbar ','ℏ'); - -LatexCmds.AA = LatexCmds.Angstrom = LatexCmds.angstrom = - bind(VanillaSymbol,'\\text\\AA ','Å'); - -LatexCmds.ring = LatexCmds.circ = LatexCmds.circle = - bind(VanillaSymbol,'\\circ ','∘'); - -LatexCmds.bull = LatexCmds.bullet = bind(VanillaSymbol,'\\bullet ','•'); - -LatexCmds.setminus = LatexCmds.smallsetminus = - bind(VanillaSymbol,'\\setminus ','∖'); - -LatexCmds.not = //bind(Symbol,'\\not ','/'); -LatexCmds['¬'] = LatexCmds.neg = bind(VanillaSymbol,'\\neg ','¬'); - -LatexCmds['…'] = LatexCmds.dots = LatexCmds.ellip = LatexCmds.hellip = -LatexCmds.ellipsis = LatexCmds.hellipsis = - bind(VanillaSymbol,'\\dots ','…'); - -LatexCmds.converges = -LatexCmds.darr = LatexCmds.dnarr = LatexCmds.dnarrow = LatexCmds.downarrow = - bind(VanillaSymbol,'\\downarrow ','↓'); - -LatexCmds.dArr = LatexCmds.dnArr = LatexCmds.dnArrow = LatexCmds.Downarrow = - bind(VanillaSymbol,'\\Downarrow ','⇓'); - -LatexCmds.diverges = LatexCmds.uarr = LatexCmds.uparrow = - bind(VanillaSymbol,'\\uparrow ','↑'); - -LatexCmds.uArr = LatexCmds.Uparrow = bind(VanillaSymbol,'\\Uparrow ','⇑'); - -LatexCmds.to = bind(BinaryOperator,'\\to ','→'); - -LatexCmds.rarr = LatexCmds.rightarrow = bind(VanillaSymbol,'\\rightarrow ','→'); - -LatexCmds.implies = bind(BinaryOperator,'\\Rightarrow ','⇒'); - -LatexCmds.rArr = LatexCmds.Rightarrow = bind(VanillaSymbol,'\\Rightarrow ','⇒'); - -LatexCmds.gets = bind(BinaryOperator,'\\gets ','←'); - -LatexCmds.larr = LatexCmds.leftarrow = bind(VanillaSymbol,'\\leftarrow ','←'); - -LatexCmds.impliedby = bind(BinaryOperator,'\\Leftarrow ','⇐'); - -LatexCmds.lArr = LatexCmds.Leftarrow = bind(VanillaSymbol,'\\Leftarrow ','⇐'); - -LatexCmds.harr = LatexCmds.lrarr = LatexCmds.leftrightarrow = - bind(VanillaSymbol,'\\leftrightarrow ','↔'); - -LatexCmds.iff = bind(BinaryOperator,'\\Leftrightarrow ','⇔'); - -LatexCmds.hArr = LatexCmds.lrArr = LatexCmds.Leftrightarrow = - bind(VanillaSymbol,'\\Leftrightarrow ','⇔'); - -LatexCmds.Re = LatexCmds.Real = LatexCmds.real = bind(VanillaSymbol,'\\Re ','ℜ'); - -LatexCmds.Im = LatexCmds.imag = -LatexCmds.image = LatexCmds.imagin = LatexCmds.imaginary = LatexCmds.Imaginary = - bind(VanillaSymbol,'\\Im ','ℑ'); - -LatexCmds.part = LatexCmds.partial = bind(VanillaSymbol,'\\partial ','∂'); - -LatexCmds.inf = LatexCmds.infin = LatexCmds.infty = LatexCmds.infinity = - bind(VanillaSymbol,'\\infty ','∞'); - -LatexCmds.alef = LatexCmds.alefsym = LatexCmds.aleph = LatexCmds.alephsym = - bind(VanillaSymbol,'\\aleph ','ℵ'); - -LatexCmds.xist = //LOL -LatexCmds.xists = LatexCmds.exist = LatexCmds.exists = - bind(VanillaSymbol,'\\exists ','∃'); - -LatexCmds.and = LatexCmds.land = LatexCmds.wedge = - bind(VanillaSymbol,'\\wedge ','∧'); - -LatexCmds.or = LatexCmds.lor = LatexCmds.vee = bind(VanillaSymbol,'\\vee ','∨'); - -LatexCmds.o = LatexCmds.O = -LatexCmds.empty = LatexCmds.emptyset = -LatexCmds.oslash = LatexCmds.Oslash = -LatexCmds.nothing = LatexCmds.varnothing = - bind(BinaryOperator,'\\varnothing ','∅'); - -LatexCmds.cup = LatexCmds.union = bind(BinaryOperator,'\\cup ','∪'); - -LatexCmds.cap = LatexCmds.intersect = LatexCmds.intersection = - bind(BinaryOperator,'\\cap ','∩'); - -LatexCmds.deg = LatexCmds.degree = bind(VanillaSymbol,'^\\circ ','°'); - -LatexCmds.ang = LatexCmds.angle = bind(VanillaSymbol,'\\angle ','∠'); - - -var NonItalicizedFunction = P(Symbol, function(_, _super) { - _.init = function(fn) { - _super.init.call(this, '\\'+fn+' ', ''+fn+''); - }; - _.respace = function() - { - this.jQ[0].className = - (this[R] instanceof SupSub || this[R] instanceof Bracket) ? - '' : 'non-italicized-function'; - }; -}); - -LatexCmds.ln = -LatexCmds.lg = -LatexCmds.log = -LatexCmds.span = -LatexCmds.proj = -LatexCmds.det = -LatexCmds.dim = -LatexCmds.min = -LatexCmds.max = -LatexCmds.mod = -LatexCmds.lcm = -LatexCmds.gcd = -LatexCmds.gcf = -LatexCmds.hcf = -LatexCmds.lim = NonItalicizedFunction; - -(function() { - var trig = ['sin', 'cos', 'tan', 'sec', 'cosec', 'csc', 'cotan', 'cot']; - for (var i in trig) { - LatexCmds[trig[i]] = - LatexCmds[trig[i]+'h'] = - LatexCmds['a'+trig[i]] = LatexCmds['arc'+trig[i]] = - LatexCmds['a'+trig[i]+'h'] = LatexCmds['arc'+trig[i]+'h'] = - NonItalicizedFunction; - } -}()); - -// Parser MathCommand -var latexMathParser = (function() { - function commandToBlock(cmd) { - var block = MathBlock(); - cmd.adopt(block, 0, 0); - return block; - } - function joinBlocks(blocks) { - var firstBlock = blocks[0] || MathBlock(); - - for (var i = 1; i < blocks.length; i += 1) { - blocks[i].children().adopt(firstBlock, firstBlock.ends[R], 0); - } - - return firstBlock; - } - - var string = Parser.string; - var regex = Parser.regex; - var letter = Parser.letter; - var any = Parser.any; - var optWhitespace = Parser.optWhitespace; - var succeed = Parser.succeed; - var fail = Parser.fail; - - // Parsers yielding MathCommands - var variable = letter.map(Variable); - var symbol = regex(/^[^${}\\_^]/).map(VanillaSymbol); - - var controlSequence = - regex(/^[^\\a-eg-zA-Z]/) // hotfix #164; match MathBlock::write - .or(string('\\').then( - regex(/^[a-z]+/i) - .or(regex(/^\s+/).result(' ')) - .or(any) - )).then(function(ctrlSeq) { - var cmdKlass = LatexCmds[ctrlSeq]; - - if (cmdKlass) { - return cmdKlass(ctrlSeq).parser(); - } - else { - return fail('unknown command: \\'+ctrlSeq); - } - }) - ; - - var command = - controlSequence - .or(variable) - .or(symbol) - ; - - // Parsers yielding MathBlocks - var mathGroup = string('{').then(function() { return mathSequence; }).skip(string('}')); - var mathBlock = optWhitespace.then(mathGroup.or(command.map(commandToBlock))); - var mathSequence = mathBlock.many().map(joinBlocks).skip(optWhitespace); - - var optMathBlock = - string('[').then( - mathBlock.then(function(block) { - return block.join('latex') !== ']' ? succeed(block) : fail(); - }) - .many().map(joinBlocks).skip(optWhitespace) - ).skip(string(']')) - ; - - var latexMath = mathSequence; - - latexMath.block = mathBlock; - latexMath.optBlock = optMathBlock; - return latexMath; -})(); -/******************************************** - * Cursor and Selection "singleton" classes - *******************************************/ - -/* The main thing that manipulates the Math DOM. Makes sure to manipulate the -HTML DOM to match. */ - -/* Sort of singletons, since there should only be one per editable math -textbox, but any one HTML document can contain many such textboxes, so any one -JS environment could actually contain many instances. */ - -//A fake cursor in the fake textbox that the math is rendered in. -var Cursor = P(Point, function(_) { - _.init = function(root) { - this.parent = this.root = root; - var jQ = this.jQ = this._jQ = $(''); - - //closured for setInterval - this.blink = function(){ jQ.toggleClass('blink'); }; - - this.upDownCache = {}; - }; - - _.show = function() { - this.jQ = this._jQ.removeClass('blink'); - if ('intervalId' in this) //already was shown, just restart interval - clearInterval(this.intervalId); - else { //was hidden and detached, insert this.jQ back into HTML DOM - if (this[R]) { - if (this.selection && this.selection.ends[L][L] === this[L]) - this.jQ.insertBefore(this.selection.jQ); - else - this.jQ.insertBefore(this[R].jQ.first()); - } - else - this.jQ.appendTo(this.parent.jQ); - this.parent.focus(); - } - this.intervalId = setInterval(this.blink, 500); - return this; - }; - _.hide = function() { - if ('intervalId' in this) - clearInterval(this.intervalId); - delete this.intervalId; - this.jQ.detach(); - this.jQ = $(); - return this; - }; - - _.withDirInsertAt = function(dir, parent, withDir, oppDir) { - var oldParent = this.parent; - this.parent = parent; - this[dir] = withDir; - this[-dir] = oppDir; - oldParent.blur(); - }; - _.insDirOf = function(dir, el) { - prayDirection(dir); - this.withDirInsertAt(dir, el.parent, el[dir], el); - this.parent.jQ.addClass('hasCursor'); - this.jQ.insDirOf(dir, el.jQ); - return this; - }; - _.insLeftOf = function(el) { return this.insDirOf(L, el); }; - _.insRightOf = function(el) { return this.insDirOf(R, el); }; - - _.insAtDirEnd = function(dir, el) { - prayDirection(dir); - this.withDirInsertAt(dir, el, 0, el.ends[dir]); - - // never insert before textarea - if (dir === L && el.textarea) { - this.jQ.insDirOf(-dir, el.textarea); - } - else { - this.jQ.insAtDirEnd(dir, el.jQ); - } - - el.focus(); - - return this; - }; - _.insAtLeftEnd = function(el) { return this.insAtDirEnd(L, el); }; - _.insAtRightEnd = function(el) { return this.insAtDirEnd(R, el); }; - - _.hopDir = function(dir) { - prayDirection(dir); - - this.jQ.insDirOf(dir, this[dir].jQ); - this[-dir] = this[dir]; - this[dir] = this[dir][dir]; - return this; - }; - _.hopLeft = function() { return this.hopDir(L); }; - _.hopRight = function() { return this.hopDir(R); }; - - _.moveDirWithin = function(dir, block) { - prayDirection(dir); - - if (this[dir]) { - if (this[dir].ends[-dir]) this.insAtDirEnd(-dir, this[dir].ends[-dir]); - else this.hopDir(dir); - } - else { - // we're at the beginning/end of the containing block, so do nothing - if (this.parent === block) return; - - if (this.parent[dir]) this.insAtDirEnd(-dir, this.parent[dir]); - else this.insDirOf(dir, this.parent.parent); - } - }; - _.moveLeftWithin = function(block) { - return this.moveDirWithin(L, block); - }; - _.moveRightWithin = function(block) { - return this.moveDirWithin(R, block); - }; - _.moveDir = function(dir) { - prayDirection(dir); - - clearUpDownCache(this); - - if (this.selection) { - this.insDirOf(dir, this.selection.ends[dir]).clearSelection(); - } - else { - this.moveDirWithin(dir, this.root); - } - - return this.show(); - }; - _.moveLeft = function() { return this.moveDir(L); }; - _.moveRight = function() { return this.moveDir(R); }; - - /** - * moveUp and moveDown have almost identical algorithms: - * - first check left and right, if so insAtLeft/RightEnd of them - * - else check the parent's 'up'/'down' property - if it's a function, - * call it with the cursor as the sole argument and use the return value. - * - * Given undefined, will bubble up to the next ancestor block. - * Given false, will stop bubbling. - * Given a MathBlock, - * + moveUp will insAtRightEnd of it - * + moveDown will insAtLeftEnd of it - * - */ - _.moveUp = function() { return moveUpDown(this, 'up'); }; - _.moveDown = function() { return moveUpDown(this, 'down'); }; - function moveUpDown(self, dir) { - if (self[R][dir]) self.insAtLeftEnd(self[R][dir]); - else if (self[L][dir]) self.insAtRightEnd(self[L][dir]); - else { - var ancestorBlock = self.parent; - do { - var prop = ancestorBlock[dir]; - if (prop) { - if (typeof prop === 'function') prop = ancestorBlock[dir](self); - if (prop === false || prop instanceof MathBlock) { - self.upDownCache[ancestorBlock.id] = Point(self.parent, self[L], self[R]); - - if (prop instanceof MathBlock) { - var cached = self.upDownCache[prop.id]; - - if (cached) { - if (cached[R]) { - self.insLeftOf(cached[R]); - } else { - self.insAtRightEnd(cached.parent); - } - } else { - var pageX = offset(self).left; - self.insAtRightEnd(prop); - self.seekHoriz(pageX, prop); - } - } - break; - } - } - ancestorBlock = ancestorBlock.parent.parent; - } while (ancestorBlock); - } - - return self.clearSelection().show(); - } - - _.seek = function(target, pageX, pageY) { - clearUpDownCache(this); - var cmd, block, cursor = this.clearSelection().show(); - if (target.hasClass('empty')) { - cursor.insAtLeftEnd(MathElement[target.attr(mqBlockId)]); - return cursor; - } - - cmd = MathElement[target.attr(mqCmdId)]; - if (cmd instanceof Symbol) { //insert at whichever side is closer - if (target.outerWidth() > 2*(pageX - target.offset().left)) - cursor.insLeftOf(cmd); - else - cursor.insRightOf(cmd); - - return cursor; - } - if (!cmd) { - block = MathElement[target.attr(mqBlockId)]; - if (!block) { //if no MathQuill data, try parent, if still no, just start from the root - target = target.parent(); - cmd = MathElement[target.attr(mqCmdId)]; - if (!cmd) { - block = MathElement[target.attr(mqBlockId)]; - if (!block) block = cursor.root; - } - } - } - - if (cmd) - cursor.insRightOf(cmd); - else - cursor.insAtRightEnd(block); - - return cursor.seekHoriz(pageX, cursor.root); - }; - _.seekHoriz = function(pageX, block) { - //move cursor to position closest to click - var cursor = this; - var dist = offset(cursor).left - pageX; - var leftDist; - - do { - cursor.moveLeftWithin(block); - leftDist = dist; - dist = offset(cursor).left - pageX; - } - while (dist > 0 && (cursor[L] || cursor.parent !== block)); - - if (-dist > leftDist) cursor.moveRightWithin(block); - - return cursor; - }; - function offset(self) { - //in Opera 11.62, .getBoundingClientRect() and hence jQuery::offset() - //returns all 0's on inline elements with negative margin-right (like - //the cursor) at the end of their parent, so temporarily remove the - //negative margin-right when calling jQuery::offset() - //Opera bug DSK-360043 - //http://bugs.jquery.com/ticket/11523 - //https://github.com/jquery/jquery/pull/717 - var offset = self.jQ.removeClass('cursor').offset(); - self.jQ.addClass('cursor'); - return offset; - } - _.writeLatex = function(latex) { - var self = this; - clearUpDownCache(self); - self.show().deleteSelection(); - - var all = Parser.all; - var eof = Parser.eof; - - var block = latexMathParser.skip(eof).or(all.result(false)).parse(latex); - - if (block) { - block.children().adopt(self.parent, self[L], self[R]); - MathElement.jQize(block.join('html')).insertBefore(self.jQ); - self[L] = block.ends[R]; - block.finalizeInsert(); - self.parent.bubble('redraw'); - } - - return this.hide(); - }; - _.write = function(ch) { - var seln = this.prepareWrite(); - return this.insertCh(ch, seln); - }; - _.insertCh = function(ch, replacedFragment) { - this.parent.write(this, ch, replacedFragment); - return this; - }; - _.insertCmd = function(latexCmd, replacedFragment) { - var cmd = LatexCmds[latexCmd]; - if (cmd) { - cmd = cmd(latexCmd); - if (replacedFragment) cmd.replaces(replacedFragment); - cmd.createLeftOf(this); - } - else { - cmd = TextBlock(); - cmd.replaces(latexCmd); - cmd.ends[L].focus = function(){ delete this.focus; return this; }; - cmd.createLeftOf(this); - this.insRightOf(cmd); - if (replacedFragment) - replacedFragment.remove(); - } - return this; - }; - _.unwrapGramp = function() { - var gramp = this.parent.parent; - var greatgramp = gramp.parent; - var rightward = gramp[R]; - var cursor = this; - - var leftward = gramp[L]; - gramp.disown().eachChild(function(uncle) { - if (uncle.isEmpty()) return; - - uncle.children() - .adopt(greatgramp, leftward, rightward) - .each(function(cousin) { - cousin.jQ.insertBefore(gramp.jQ.first()); - }) - ; - - leftward = uncle.ends[R]; - }); - - if (!this[R]) { //then find something to be rightward to insLeftOf - if (this[L]) - this[R] = this[L][R]; - else { - while (!this[R]) { - this.parent = this.parent[R]; - if (this.parent) - this[R] = this.parent.ends[L]; - else { - this[R] = gramp[R]; - this.parent = greatgramp; - break; - } - } - } - } - if (this[R]) - this.insLeftOf(this[R]); - else - this.insAtRightEnd(greatgramp); - - gramp.jQ.remove(); - - if (gramp[L]) - gramp[L].respace(); - if (gramp[R]) - gramp[R].respace(); - }; - _.deleteDir = function(dir) { - prayDirection(dir); - clearUpDownCache(this); - this.show(); - - if (this.deleteSelection()); // pass - else if (this[dir]) { - if (this[dir].isEmpty()) - this[dir] = this[dir].remove()[dir]; - else - this.selectDir(dir); - } - else if (this.parent !== this.root) { - if (this.parent.parent.isEmpty()) - return this.insDirOf(-dir, this.parent.parent).deleteDir(dir); - else - this.unwrapGramp(); - } - - if (this[L]) - this[L].respace(); - if (this[R]) - this[R].respace(); - this.parent.bubble('redraw'); - - return this; - }; - _.backspace = function() { return this.deleteDir(L); }; - _.deleteForward = function() { return this.deleteDir(R); }; - _.selectFrom = function(anticursor) { - //find ancestors of each with common parent - var oneA = this, otherA = anticursor; //one ancestor, the other ancestor - loopThroughAncestors: while (true) { - for (var oneI = this; oneI !== oneA.parent.parent; oneI = oneI.parent.parent) //one intermediate, the other intermediate - if (oneI.parent === otherA.parent) { - left = oneI; - right = otherA; - break loopThroughAncestors; - } - - for (var otherI = anticursor; otherI !== otherA.parent.parent; otherI = otherI.parent.parent) - if (oneA.parent === otherI.parent) { - left = oneA; - right = otherI; - break loopThroughAncestors; - } - - if (oneA.parent.parent) - oneA = oneA.parent.parent; - if (otherA.parent.parent) - otherA = otherA.parent.parent; - } - //figure out which is leftward and which is rightward - var left, right, leftRight; - if (left[R] !== right) { - for (var rightward = left; rightward; rightward = rightward[R]) { - if (rightward === right[L]) { - leftRight = true; - break; - } - } - if (!leftRight) { - leftRight = right; - right = left; - left = leftRight; - } - } - this.hide().selection = Selection(left[L][R] || left.parent.ends[L], right[R][L] || right.parent.ends[R]); - this.insRightOf(right[R][L] || right.parent.ends[R]); - this.root.selectionChanged(); - }; - _.selectDir = function(dir) { - prayDirection(dir); - clearUpDownCache(this); - - if (this.selection) { - // if cursor is at the (dir) edge of selection - if (this.selection.ends[dir] === this[-dir]) { - // then extend (dir) if possible - if (this[dir]) this.hopDir(dir).selection.extendDir(dir); - // else level up if possible - else if (this.parent !== this.root) { - this.insDirOf(dir, this.parent.parent).selection.levelUp(); - } - } - // else cursor is at the (-dir) edge of selection, retract if possible - else { - this.hopDir(dir); - - // clear the selection if we only have one thing selected - if (this.selection.ends[dir] === this.selection.ends[-dir]) { - this.clearSelection().show(); - return; - } - - this.selection.retractDir(dir); - } - } - // no selection, create one - else { - if (this[dir]) this.hopDir(dir); - // else edge of a block - else { - if (this.parent === this.root) return; - - this.insDirOf(dir, this.parent.parent); - } - - this.hide().selection = Selection(this[-dir]); - } - - this.root.selectionChanged(); - }; - _.selectLeft = function() { return this.selectDir(L); }; - _.selectRight = function() { return this.selectDir(R); }; - - function clearUpDownCache(self) { - self.upDownCache = {}; - } - - _.prepareMove = function() { - clearUpDownCache(this); - return this.show().clearSelection(); - }; - _.prepareEdit = function() { - clearUpDownCache(this); - return this.show().deleteSelection(); - }; - _.prepareWrite = function() { - clearUpDownCache(this); - return this.show().replaceSelection(); - }; - - _.clearSelection = function() { - if (this.selection) { - this.selection.clear(); - delete this.selection; - this.root.selectionChanged(); - } - return this; - }; - _.deleteSelection = function() { - if (!this.selection) return false; - - this[L] = this.selection.ends[L][L]; - this[R] = this.selection.ends[R][R]; - this.selection.remove(); - this.root.selectionChanged(); - return delete this.selection; - }; - _.replaceSelection = function() { - var seln = this.selection; - if (seln) { - this[L] = seln.ends[L][L]; - this[R] = seln.ends[R][R]; - delete this.selection; - } - return seln; - }; -}); - -var Selection = P(MathFragment, function(_, _super) { - _.init = function() { - var frag = this; - _super.init.apply(frag, arguments); - - frag.jQwrap(frag.jQ); - }; - _.jQwrap = function(children) { - this.jQ = children.wrapAll('').parent(); - //can't do wrapAll(this.jQ = $(...)) because wrapAll will clone it - }; - _.adopt = function() { - this.jQ.replaceWith(this.jQ = this.jQ.children()); - return _super.adopt.apply(this, arguments); - }; - _.clear = function() { - this.jQ.replaceWith(this.jQ.children()); - return this; - }; - _.levelUp = function() { - var seln = this, - gramp = seln.ends[L] = seln.ends[R] = seln.ends[R].parent.parent; - seln.clear().jQwrap(gramp.jQ); - return seln; - }; - _.extendDir = function(dir) { - prayDirection(dir); - this.ends[dir] = this.ends[dir][dir]; - this.ends[dir].jQ.insAtDirEnd(dir, this.jQ); - return this; - }; - _.extendLeft = function() { return this.extendDir(L); }; - _.extendRight = function() { return this.extendDir(R); }; - - _.retractDir = function(dir) { - prayDirection(dir); - this.ends[-dir].jQ.insDirOf(-dir, this.jQ); - this.ends[-dir] = this.ends[-dir][dir]; - }; - _.retractRight = function() { return this.retractDir(R); }; - _.retractLeft = function() { return this.retractDir(L); }; -}); -/********************************************************* - * The actual jQuery plugin and document ready handlers. - ********************************************************/ - -//The publicy exposed method of jQuery.prototype, available (and meant to be -//called) on jQuery-wrapped HTML DOM elements. -jQuery.fn.mathquill = function(cmd, latex) { - switch (cmd) { - case 'redraw': - return this.each(function() { - var blockId = $(this).attr(mqBlockId), - rootBlock = blockId && MathElement[blockId]; - if (rootBlock) { - (function postOrderRedraw(el) { - el.eachChild(postOrderRedraw); - if (el.redraw) el.redraw(); - }(rootBlock)); - } - }); - case 'revert': - return this.each(function() { - var blockId = $(this).attr(mqBlockId), - block = blockId && MathElement[blockId]; - if (block && block.revert) - block.revert(); - }); - case 'latex': - if (arguments.length > 1) { - return this.each(function() { - var blockId = $(this).attr(mqBlockId), - block = blockId && MathElement[blockId]; - if (block) - block.renderLatex(latex); - }); - } - - var blockId = $(this).attr(mqBlockId), - block = blockId && MathElement[blockId]; - return block && block.latex(); - case 'text': - var blockId = $(this).attr(mqBlockId), - block = blockId && MathElement[blockId]; - return block && block.text(); - case 'html': - return this.html().replace(/ ?hasCursor|hasCursor /, '') - .replace(/ class=(""|(?= |>))/g, '') - .replace(/<\/span>/i, '') - .replace(/'),m=l.children(),n.selectionChanged=function(){g===a&&(g=setTimeout(s)),O(e[0])},e.bind("selectstart.mathquill",function(t){t.target!==m[0]&&t.preventDefault(),t.stopPropagation()}),v=c.blink,e.bind("mousedown.mathquill",function(n){function i(t){return c.seek(f(t.target),t.pageX,t.pageY),(c[u]!==b[u]||c.parent!==b.parent)&&c.selectFrom(b),!1}function s(t){return delete t.target,i(t)}function o(t){b=a,c.blink=v,c.selection||(r?c.show():l.detach()),e.unbind("mousemove",i),f(t.target.ownerDocument).unbind("mousemove",s).unbind("mouseup",o)}return setTimeout(function(){m.focus()}),c.blink=t,c.seek(f(n.target),n.pageX,n.pageY),b=d(c.parent,c[u],c[p]),r||e.prepend(l),e.mousemove(i),f(n.target.ownerDocument).mousemove(s).mouseup(o),!1}),r?(w=h(m,{container:e,key:function(t,e){c.parent.bubble("onKey",t,e)},text:function(t){c.parent.bubble("onText",t)},cut:function(t){c.selection&&setTimeout(function(){c.prepareEdit(),c.parent.bubble("redraw")}),t.stopPropagation()},paste:function(t){t="$"===t.slice(0,1)&&"$"===t.slice(-1)?t.slice(1,-1):"\\text{"+t+"}",c.writeLatex(t).show()}}),e.prepend(l),e.addClass("mathquill-editable"),i&&e.addClass("mathquill-textbox"),m.focus(function(t){c.parent||c.insAtRightEnd(n),c.parent.jQ.addClass("hasCursor"),c.selection?(c.selection.jQ.removeClass("blur"),setTimeout(n.selectionChanged)):c.show(),t.stopPropagation()}).blur(function(t){c.hide().parent.blur(),c.selection&&c.selection.jQ.addClass("blur"),t.stopPropagation()}),e.bind("focus.mathquill blur.mathquill",function(t){m.trigger(t)}).blur(),a):(w=h(m,{container:e}),e.bind("cut paste",!1).bind("copy",s).prepend('$'+n.latex()+"$"),m.blur(function(){c.clearSelection(),setTimeout(o)}),a)}function s(t,e,n){return c(K,{ctrlSeq:t,htmlTemplate:"<"+e+" "+n+">&0"})}var a,o,c,h,l,u,p,f,d,m,g,b,v,w,x,j,k,q,y,Q,C,S,L,D,O,E,A,R,T,z,B,I,$,_,W,M,F,P,U,H,K,N,G,X,Z,Y,J,V,te,ee,ne,ie,re,se,ae=window.jQuery,oe="mathquill-command-id",ce="mathquill-block-id",he=Math.min;Math.max,o=[].slice,c=function(t,e,n){function i(t){return"object"==typeof t}function r(t){return"function"==typeof t}function s(){}function a(o,c){function h(){var t=new l;return r(t.init)&&t.init.apply(t,arguments),t}function l(){}var u,p,f;return c===n&&(c=o,o=Object),h.Bare=l,u=s[t]=o[t],p=l[t]=h[t]=new s,p.constructor=h,h.mixin=function(e){return l[t]=h[t]=a(h,e)[t],h},(h.open=function(t){if(f={},r(t)?f=t.call(h,p,u,h,o):i(t)&&(f=t),i(f))for(var n in f)e.call(f,n)&&(p[n]=f[n]);return r(p.init)||(p.init=o),h})(c)}return a}("prototype",{}.hasOwnProperty),h=function(){function e(t){var e,i=t.which||t.keyCode,r=n[i],s=[];return t.ctrlKey&&s.push("Ctrl"),t.originalEvent&&t.originalEvent.metaKey&&s.push("Meta"),t.altKey&&s.push("Alt"),t.shiftKey&&s.push("Shift"),e=r||String.fromCharCode(i),s.length||r?(s.push(e),s.join("-")):e}var n={8:"Backspace",9:"Tab",10:"Enter",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Esc",32:"Spacebar",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Del",144:"NumLock"};return function(n,i){function r(t){k=t,clearTimeout(j),j=setTimeout(t)}function s(e){k(),k=t,clearTimeout(j),w.val(e),e&&w[0].select()}function a(){var t=w[0];return"selectionStart"in t?t.selectionStart!==t.selectionEnd:!1}function o(t){var e=w.val();w.val(""),e&&t(e)}function c(){g(e(q),q)}function h(t){q=t,y=null,c()}function l(t){q&&y&&c(),y=t,r(u)}function u(){a()||o(m)}function p(){q=y=null}function f(){w.focus(),r(d)}function d(){o(b)}var m,g,b,v,w,x,j,k,q=null,y=null;return i||(i={}),m=i.text||t,g=i.key||t,b=i.paste||t,v=i.cut||t,w=ae(n),x=ae(i.container||w),k=t,x.bind("keydown keypress input keyup focusout paste",function(){k()}),x.bind({keydown:h,keypress:l,focusout:p,cut:v,paste:f}),{select:s}}}(),l=c(function(t,e,i){function r(t,e){throw t=t?"'"+t+"'":"EOF","Parse Error: "+e+" at "+t}var s,a,o;t.init=function(t){this._=t},t.parse=function(t){function e(t,e){return e}return this.skip(o)._(t,e,r)},t.or=function(t){n("or is passed a parser",t instanceof i);var e=this;return i(function(n,i,r){function s(){return t._(n,i,r)}return e._(n,i,s)})},t.then=function(t){var e=this;return i(function(r,s,a){function o(e,r){var o=t instanceof i?t:t(r);return n("a parser is returned",o instanceof i),o._(e,s,a)}return e._(r,o,a)})},t.many=function(){var t=this;return i(function(e,n){function i(t,n){return e=t,s.push(n),!0}function r(){return!1}for(var s=[];t._(e,i,r););return n(e,s)})},t.times=function(t,e){2>arguments.length&&(e=t);var n=this;return i(function(i,r,s){function a(t,e){return u.push(e),i=t,!0}function o(t,e){return h=e,i=t,!1}function c(){return!1}var h,l,u=[],p=!0;for(l=0;t>l;l+=1)if(p=n._(i,a,o),!p)return s(i,h);for(;e>l&&p;l+=1)p=n._(i,a,c);return r(i,u)})},t.result=function(t){return this.then(a(t))},t.atMost=function(t){return this.times(0,t)},t.atLeast=function(t){var e=this;return e.times(t).then(function(t){return e.many().map(function(e){return t.concat(e)})})},t.map=function(t){return this.then(function(e){return a(t(e))})},t.skip=function(t){return this.then(function(e){return t.result(e)})},this.string=function(t){var e=t.length,n="expected '"+t+"'";return i(function(i,r,s){var a=i.slice(0,e);return a===t?r(i.slice(e),a):s(i,n)})},s=this.regex=function(t){n("regexp parser is anchored","^"===(""+t).charAt(1));var e="expected "+t;return i(function(n,i,r){var s,a=t.exec(n);return a?(s=a[0],i(n.slice(s.length),s)):r(n,e)})},a=i.succeed=function(t){return i(function(e,n){return n(e,t)})},i.fail=function(t){return i(function(e,n,i){return i(e,t)})},i.letter=s(/^[a-z]/i),i.letters=s(/^[a-z]*/i),i.digit=s(/^[0-9]/),i.digits=s(/^[0-9]*/),i.whitespace=s(/^\s+/),i.optWhitespace=s(/^\s*/),i.any=i(function(t,e,n){return t?e(t.slice(1),t.charAt(0)):n(t,"expected any character")}),i.all=i(function(t,e){return e("",t)}),o=i.eof=i(function(t,e,n){return t?n(t,"expected EOF"):e(t,t)})}),u=-1,p=1,f=c(ae,function(t){t.insDirOf=function(t,e){return t===u?this.insertBefore(e.first()):this.insertAfter(e.last())},t.insAtDirEnd=function(t,e){return t===u?this.prependTo(e):this.appendTo(e)}}),d=c(function(t){t.parent=0,t[u]=0,t[p]=0,t.init=function(t,e,n){this.parent=t,this[u]=e,this[p]=n}}),m=c(function(t){t[u]=0,t[p]=0,t.parent=0,t.init=function(){this.ends={},this.ends[u]=0,this.ends[p]=0},t.children=function(){return g(this.ends[u],this.ends[p])},t.eachChild=function(t){return this.children().each(t)},t.foldChildren=function(t,e){return this.children().fold(t,e)},t.adopt=function(t,e,n){return g(this,this).adopt(t,e,n),this},t.disown=function(){return g(this,this).disown(),this}}),g=c(function(t){function e(t,e,i){n("a parent is always present",t),n("leftward is properly set up",function(){return e?e[p]===i&&e.parent===t:t.ends[u]===i}()),n("rightward is properly set up",function(){return i?i[u]===e&&i.parent===t:t.ends[p]===e}())}t.init=function(t,e){n("no half-empty fragments",!t==!e),this.ends={},t&&(n("left end node is passed to Fragment",t instanceof m),n("right end node is passed to Fragment",e instanceof m),n("leftEnd and rightEnd have the same parent",t.parent===e.parent),this.ends[u]=t,this.ends[p]=e)},t.adopt=function(t,n,i){var r,s,a;return e(t,n,i),r=this,r.disowned=!1,(s=r.ends[u])?(a=r.ends[p],n||(t.ends[u]=s),i?i[u]=a:t.ends[p]=a,r.ends[p][p]=i,r.each(function(e){e[u]=n,e.parent=t,n&&(n[p]=e),n=e}),r):this},t.disown=function(){var t,n,i=this,r=i.ends[u];return!r||i.disowned?i:(i.disowned=!0,t=i.ends[p],n=r.parent,e(n,r[u],r),e(n,t,t[p]),r[u]?r[u][p]=t[p]:n.ends[u]=t[p],t[p]?t[p][u]=r[u]:n.ends[p]=r[u],i)},t.each=function(t){var e=this,n=e.ends[u];if(!n)return e;for(;n!==e.ends[p][p]&&t.call(e,n)!==!1;n=n[p]);return e},t.fold=function(t,e){return this.each(function(n){t=e.call(this,t,n)}),t}}),b=function(){var t=0;return function(){return t+=1}}(),v=c(m,function(t,e){t.init=function(){e.init.call(this),this.id=b(),v[this.id]=this},t.toString=function(){return"[MathElement "+this.id+"]"},t.bubble=function(t){var e,n,i=o.call(arguments,1);for(e=this;e&&(n=e[t]&&e[t].apply(e,i),n!==!1);e=e.parent);return this},t.postOrder=function(t){var e,n=o.call(arguments,1);"string"==typeof t&&(e=t,t=function(t){e in t&&t[e].apply(t,n)}),function i(e){e.eachChild(i),t(e)}(this)},t.jQ=f(),t.jQadd=function(t){this.jQ=this.jQ.add(t)},this.jQize=function(t){var e=f(t);return e.find("*").andSelf().each(function(){var t=f(this),e=t.attr("mathquill-command-id"),n=t.attr("mathquill-block-id");e&&v[e].jQadd(t),n&&v[n].jQadd(t)}),e},t.finalizeInsert=function(){var t=this;t.postOrder("finalizeTree"),t.postOrder("blur"),t.postOrder("respace"),t[p].respace&&t[p].respace(),t[u].respace&&t[u].respace(),t.postOrder("redraw"),t.bubble("redraw")}}),w=c(v,function(e,i){e.init=function(t,e,n){var r=this;i.init.call(r),r.ctrlSeq||(r.ctrlSeq=t),e&&(r.htmlTemplate=e),n&&(r.textTemplate=n)},e.replaces=function(t){t.disown(),this.replacedFragment=t},e.isEmpty=function(){return this.foldChildren(!0,function(t,e){return t&&e.isEmpty()})},e.parser=function(){var t=ie.block,e=this;return t.times(e.numBlocks()).map(function(t){e.blocks=t;for(var n=0;t.length>n;n+=1)t[n].adopt(e,e.ends[p],0);return e})},e.createLeftOf=function(t){var e=this,n=e.replacedFragment;e.createBlocks(),v.jQize(e.html()),n&&(n.adopt(e.ends[u],0,0),n.jQ.appendTo(e.ends[u].jQ)),t.jQ.before(e.jQ),t[u]=e.adopt(t.parent,t[u],t[p]),e.finalizeInsert(t),e.placeCursor(t)},e.createBlocks=function(){var t,e,n=this,i=n.numBlocks(),r=n.blocks=Array(i);for(t=0;i>t;t+=1)e=r[t]=j(),e.adopt(n,n.ends[p],0)},e.respace=t,e.placeCursor=function(t){t.insAtRightEnd(this.foldChildren(this.ends[u],function(t,e){return t.isEmpty()?t:e}))},e.remove=function(){return this.disown(),this.jQ.remove(),this.postOrder(function(t){delete v[t.id]}),this},e.numBlocks=function(){var t=this.htmlTemplate.match(/&\d+/g);return t?t.length:0},e.html=function(){var t,e,i,r=this,s=r.blocks,a=" mathquill-command-id="+r.id,o=r.htmlTemplate.match(/<[^<>]+>|[^<>]+/g);for(n("no unmatched angle brackets",o.join("")===this.htmlTemplate),t=0,e=o[0];e;t+=1,e=o[t])if("/>"===e.slice(-2))o[t]=e.slice(0,-2)+a+"/>";else if("<"===e.charAt(0)){n("not an unmatched top-level close tag","/"!==e.charAt(1)),o[t]=e.slice(0,-1)+a+">",i=1;do t+=1,e=o[t],n("no missing close tags",e),""!==e.slice(-2)&&(i+=1);while(i>0)}return o.join("").replace(/>&(\d+)/g,function(t,e){return" mathquill-block-id="+s[e].id+">"+s[e].join("html")})},e.latex=function(){return this.foldChildren(this.ctrlSeq,function(t,e){return t+"{"+(e.latex()||" ")+"}"})},e.textTemplate=[""],e.text=function(){var t=this,e=0;return t.foldChildren(t.textTemplate[e],function(n,i){e+=1;var r=i.text();return n&&"("===t.textTemplate[e]&&"("===r[0]&&")"===r.slice(-1)?n+r.slice(1,-1)+t.textTemplate[e]:n+i.text()+(t.textTemplate[e]||"")})}}),x=c(w,function(e,n){e.init=function(t,e,i){i||(i=t&&t.length>1?t.slice(1):t),n.init.call(this,t,e,[i])},e.parser=function(){return l.succeed(this)},e.numBlocks=function(){return 0},e.replaces=function(t){t.remove()},e.createBlocks=t,e.latex=function(){return this.ctrlSeq},e.text=function(){return this.textTemplate},e.placeCursor=t,e.isEmpty=function(){return!0}}),j=c(v,function(t){t.join=function(t){return this.foldChildren("",function(e,n){return e+n[t]()})},t.latex=function(){return this.join("latex")},t.text=function(){return this.ends[u]===this.ends[p]?this.ends[u].text():"("+this.join("text")+")"},t.isEmpty=function(){return 0===this.ends[u]&&0===this.ends[p]},t.write=function(t,e,n){var i;i=e.match(/^[a-eg-zA-Z]$/)?X(e):(i=C[e]||S[e])?i(e):Z(e),n&&i.replaces(n),i.createLeftOf(t)},t.focus=function(){return this.jQ.addClass("hasCursor"),this.jQ.removeClass("empty"),this},t.blur=function(){return this.jQ.removeClass("hasCursor"),this.isEmpty()&&this.jQ.addClass("empty"),this}}),k=c(g,function(t,e){t.init=function(t,n){e.init.call(this,t,n||t),this.jQ=this.fold(f(),function(t,e){return e.jQ.add(t)})},t.latex=function(){return this.fold("",function(t,e){return t+e.latex()})},t.remove=function(){return this.jQ.remove(),this.each(function(t){t.postOrder(function(t){delete v[t.id]})}),this.disown()}}),q=c(j,function(t,e){t.latex=function(){return e.latex.call(this).replace(/(\\[a-z]+) (?![a-z])/gi,"$1")},t.text=function(){return this.foldChildren("",function(t,e){return t+e.text()})},t.renderLatex=function(t){var e=this.jQ;e.children().slice(1).remove(),this.ends[u]=this.ends[p]=0,delete this.cursor.selection,this.cursor.insAtRightEnd(this).writeLatex(t)},t.onKey=function(t,e){var n;switch(t){case"Ctrl-Shift-Backspace":case"Ctrl-Backspace":for(;this.cursor[u]||this.cursor.selection;)this.cursor.backspace();break;case"Shift-Backspace":case"Backspace":this.cursor.backspace();break;case"Esc":case"Tab":case"Spacebar":if(n=this.cursor.parent,n===this.cursor.root)return"Spacebar"===t&&e.preventDefault(),a;this.cursor.prepareMove(),n[p]?this.cursor.insAtLeftEnd(n[p]):this.cursor.insRightOf(n.parent);break;case"Shift-Tab":case"Shift-Esc":case"Shift-Spacebar":if(n=this.cursor.parent,n===this.cursor.root)return"Shift-Spacebar"===t&&e.preventDefault(),a;this.cursor.prepareMove(),n[u]?this.cursor.insAtRightEnd(n[u]):this.cursor.insLeftOf(n.parent);break;case"Enter":break;case"End":this.cursor.prepareMove().insAtRightEnd(this.cursor.parent);break;case"Ctrl-End":this.cursor.prepareMove().insAtRightEnd(this);break;case"Shift-End":for(;this.cursor[p];)this.cursor.selectRight();break;case"Ctrl-Shift-End":for(;this.cursor[p]||this.cursor.parent!==this;)this.cursor.selectRight();break;case"Home":this.cursor.prepareMove().insAtLeftEnd(this.cursor.parent);break;case"Ctrl-Home":this.cursor.prepareMove().insAtLeftEnd(this);break;case"Shift-Home":for(;this.cursor[u];)this.cursor.selectLeft();break;case"Ctrl-Shift-Home":for(;this.cursor[u]||this.cursor.parent!==this;)this.cursor.selectLeft();break;case"Left":this.cursor.moveLeft();break;case"Shift-Left":this.cursor.selectLeft();break;case"Ctrl-Left":break;case"Right":this.cursor.moveRight();break;case"Shift-Right":this.cursor.selectRight();break;case"Ctrl-Right":break;case"Up":this.cursor.moveUp();break;case"Down":this.cursor.moveDown();break;case"Shift-Up":if(this.cursor[u])for(;this.cursor[u];)this.cursor.selectLeft();else this.cursor.selectLeft();case"Shift-Down":if(this.cursor[p])for(;this.cursor[p];)this.cursor.selectRight();else this.cursor.selectRight();case"Ctrl-Up":break;case"Ctrl-Down":break;case"Ctrl-Shift-Del":case"Ctrl-Del":for(;this.cursor[p]||this.cursor.selection;)this.cursor.deleteForward();break;case"Shift-Del":case"Del":this.cursor.deleteForward();break;case"Meta-A":case"Ctrl-A":if(this!==this.cursor.root)return;for(this.cursor.prepareMove().insAtRightEnd(this);this.cursor[u];)this.cursor.selectLeft();break;default:return!1}return e.preventDefault(),!1},t.onText=function(t){return this.cursor.write(t),!1}}),y=c(w,function(t,e){t.init=function(t){e.init.call(this,"$"),this.cursor=t},t.htmlTemplate='&0',t.createBlocks=function(){this.ends[u]=this.ends[p]=q(),this.blocks=[this.ends[u]],this.ends[u].parent=this,this.ends[u].cursor=this.cursor,this.ends[u].write=function(t,e,n){"$"!==e?j.prototype.write.call(this,t,e,n):this.isEmpty()?(t.insRightOf(this.parent).backspace().show(),Z("\\$","$").createLeftOf(t)):t[p]?t[u]?j.prototype.write.call(this,t,e,n):t.insLeftOf(this.parent):t.insRightOf(this.parent)}},t.latex=function(){return"$"+this.ends[u].latex()+"$"}}),Q=c(j,function(t){t.renderLatex=function(t){var e,n,i,r,s,a,o,c,h,f,d,m=this,g=m.cursor;if(m.jQ.children().slice(1).remove(),m.ends[u]=m.ends[p]=0,delete g.selection,g.show().insAtRightEnd(m),e=l.regex,n=l.string,i=l.eof,r=l.all,s=n("$").then(ie).skip(n("$").or(i)).map(function(t){var e,n=y(g);return n.createBlocks(),e=n.ends[u],t.children().adopt(e,0,0),n}),a=n("\\$").result("$"),o=a.or(e(/^[^$]/)).map(Z),c=s.or(o).many(),h=c.skip(i).or(r.result(!1)).parse(t)){for(f=0;h.length>f;f+=1)h[f].adopt(m,m.ends[p],0);d=m.join("html"),v.jQize(d).appendTo(m.jQ),this.finalizeInsert()}},t.onKey=function(t){"Spacebar"!==t&&"Shift-Spacebar"!==t&&q.prototype.onKey.apply(this,arguments)},t.onText=q.prototype.onText,t.write=function(t,e,n){if(n&&n.remove(),"$"===e)y(t).createLeftOf(t);else{var i;"<"===e?i="<":">"===e&&(i=">"),Z(e,i).createLeftOf(t)}}}),C={},S={},O=t,E=document.createElement("div"),A=E.style,R={transform:1,WebkitTransform:1,MozTransform:1,OTransform:1,msTransform:1};for(T in R)if(T in A){D=T;break}D?L=function(t,e,n){t.css(D,"scale("+e+","+n+")")}:"filter"in A?(O=function(t){t.className=t.className},L=function(t,e,n){function i(){t.css("marginRight",(r.width()-1)*(e-1)/e+"px")}var r,s;e/=1+(n-1)/2,t.css("fontSize",n+"em"),t.hasClass("matrixed-container")||t.addClass("matrixed-container").wrapInner(''),r=t.children().css("filter","progid:DXImageTransform.Microsoft.Matrix(M11="+e+",SizingMethod='auto expand')"),i(),s=setInterval(i),f(window).load(function(){clearTimeout(s),i()})}):L=function(t,e,n){t.css("fontSize",n+"em")},z=c(w,function(t,e){t.init=function(t,n,i){e.init.call(this,t,"<"+n+" "+i+">&0")}}),S.mathrm=e(z,"\\mathrm","span",'class="roman font"'),S.mathit=e(z,"\\mathit","i",'class="font"'),S.mathbf=e(z,"\\mathbf","b",'class="font"'),S.mathsf=e(z,"\\mathsf","span",'class="sans-serif font"'),S.mathtt=e(z,"\\mathtt","span",'class="monospace font"'),S.underline=e(z,"\\underline","span",'class="non-leaf underline"'),S.overline=S.bar=e(z,"\\overline","span",'class="non-leaf overline"'),B=c(w,function(t,e){t.init=function(t,n,i){e.init.call(this,t,"<"+n+' class="non-leaf">&0",[i])},t.finalizeTree=function(){function t(t){var e=this.parent,n=t;do{if(n[p])return t.insLeftOf(e),!1;n=n.parent.parent}while(n!==e);return t.insRightOf(e),!1}n("SupSub is only _ and ^","^"===this.ctrlSeq||"_"===this.ctrlSeq),"_"===this.ctrlSeq?(this.down=this.ends[u],this.ends[u].up=t):(this.up=this.ends[u],this.ends[u].down=t)},t.latex=function(){var t=this.ends[u].latex();return 1===t.length?this.ctrlSeq+t:this.ctrlSeq+"{"+(t||" ")+"}"},t.redraw=function(){this[u]&&this[u].respace(),this[u]instanceof B||(this.respace(),!this[p]||this[p]instanceof B||this[p].respace())},t.respace=function(){if("\\int "===this[u].ctrlSeq||this[u]instanceof B&&this[u].ctrlSeq!=this.ctrlSeq&&this[u][u]&&"\\int "===this[u][u].ctrlSeq?this.limit||(this.limit=!0,this.jQ.addClass("limit")):this.limit&&(this.limit=!1,this.jQ.removeClass("limit")),this.respaced=this[u]instanceof B&&this[u].ctrlSeq!=this.ctrlSeq&&!this[u].respaced,this.respaced){var t=+this.jQ.css("fontSize").slice(0,-2),e=this[u].jQ.outerWidth(),n=this.jQ.outerWidth();this.jQ.css({left:(this.limit&&"_"===this.ctrlSeq?-.25:0)-e/t+"em",marginRight:.1-he(n,e)/t+"em"})}else this.limit&&"_"===this.ctrlSeq?this.jQ.css({left:"-.25em",marginRight:""}):this.jQ.css({left:"",marginRight:""});return this[p]instanceof B&&this[p].respace(),this}}),S.subscript=S._=e(B,"_","sub","_"),S.superscript=S.supscript=S["^"]=e(B,"^","sup","**"),I=S.frac=S.dfrac=S.cfrac=S.fraction=c(w,function(t){t.ctrlSeq="\\frac",t.htmlTemplate='&0&1 ',t.textTemplate=["(","/",")"],t.finalizeTree=function(){this.up=this.ends[p].up=this.ends[u],this.down=this.ends[u].down=this.ends[p]}}),$=S.over=C["/"]=c(I,function(t,e){t.createLeftOf=function(t){if(!this.replacedFragment){for(var n=t[u];n&&!(n instanceof V||n instanceof K||n instanceof ee||",;:".split("").indexOf(n.ctrlSeq)>-1);)n=n[u];n instanceof ee&&n[p]instanceof B&&(n=n[p],n[p]instanceof B&&n[p].ctrlSeq!=n.ctrlSeq&&(n=n[p])),n!==t[u]&&(this.replaces(k(n[p]||t.parent.ends[u],t[u])),t[u]=n)}e.createLeftOf.call(this,t)}}),_=S.sqrt=S["√"]=c(w,function(t,e){t.ctrlSeq="\\sqrt",t.htmlTemplate='&0',t.textTemplate=["sqrt(",")"],t.parser=function(){return ie.optBlock.then(function(t){return ie.block.map(function(e){var n=W();return n.blocks=[t,e],t.adopt(n,0,0),e.adopt(n,t,0),n})}).or(e.parser.call(this))},t.redraw=function(){var t=this.ends[p].jQ;L(t.prev(),1,t.innerHeight()/+t.css("fontSize").slice(0,-2)-.1)}}),S.vec=c(w,function(t){t.ctrlSeq="\\vec",t.htmlTemplate='&0',t.textTemplate=["vec(",")"]}),W=S.nthroot=c(_,function(t){t.htmlTemplate='&0&1',t.textTemplate=["sqrt[","](",")"],t.latex=function(){return"\\sqrt["+this.ends[u].latex()+"]{"+this.ends[p].latex()+"}"}}),M=c(w,function(t,e){t.init=function(t,n,i,r){e.init.call(this,"\\left"+i,''+t+""+'&0'+''+n+""+"",[t,n]),this.end="\\right"+r},t.jQadd=function(){e.jQadd.apply(this,arguments);var t=this.jQ;this.bracketjQs=t.children(":first").add(t.children(":last"))},t.latex=function(){return this.ctrlSeq+this.ends[u].latex()+this.end},t.redraw=function(){var t=this.ends[u].jQ,e=t.outerHeight()/+t.css("fontSize").slice(0,-2);L(this.bracketjQs,he(1+.2*(e-1),1.2),1.05*e)}}),S.left=c(w,function(t){t.parser=function(){var t=l.regex,e=l.string,n=l.succeed,i=l.optWhitespace;return i.then(t(/^(?:[([|]|\\\{)/)).then(function(r){"\\"===r.charAt(0)&&(r=r.slice(1));var s=C[r]();return ie.map(function(t){s.blocks=[t],t.adopt(s,0,0)}).then(e("\\right")).skip(i).then(t(/^(?:[\])|]|\\\})/)).then(function(t){return t.slice(-1)!==s.end.slice(-1)?l.fail("open doesn't match close"):n(s)})})}}),S.right=c(w,function(t){t.parser=function(){return l.fail("unmatched \\right")}}),S.lbrace=C["{"]=e(M,"{","}","\\{","\\}"),S.langle=S.lang=e(M,"⟨","⟩","\\langle ","\\rangle "),F=c(M,function(t,e){t.createLeftOf=function(t){t[p]||!t.parent.parent||t.parent.parent.end!==this.end||this.replacedFragment?e.createLeftOf.call(this,t):t.insRightOf(t.parent.parent)},t.placeCursor=function(t){this.ends[u].blur(),t.insRightOf(this)}}),S.rbrace=C["}"]=e(F,"{","}","\\{","\\}"),S.rangle=S.rang=e(F,"⟨","⟩","\\langle ","\\rangle "),P=function(t,e){t.init=function(t,n){e.init.call(this,t,n,t,n)}},U=c(M,P),S.lparen=C["("]=e(U,"(",")"),S.lbrack=S.lbracket=C["["]=e(U,"[","]"),H=c(F,P),S.rparen=C[")"]=e(H,"(",")"),S.rbrack=S.rbracket=C["]"]=e(H,"[","]"),S.lpipe=S.rpipe=C["|"]=c(U,function(t,e){t.init=function(){e.init.call(this,"|","|")},t.createLeftOf=F.prototype.createLeftOf}),K=C.$=S.text=S.textnormal=S.textrm=S.textup=S.textmd=c(w,function(t,e){t.ctrlSeq="\\text",t.htmlTemplate='&0',t.replaces=function(t){t instanceof k?this.replacedText=t.remove().jQ.text():"string"==typeof t&&(this.replacedText=t)},t.textTemplate=['"','"'],t.parser=function(){var t=this,e=l.string,n=l.regex,i=l.optWhitespace;return i.then(e("{")).then(n(/^[^}]*/)).skip(e("}")).map(function(e){var n,i,r;for(t.createBlocks(),n=t.ends[u],i=0;e.length>i;i+=1)r=Z(e.charAt(i)),r.adopt(n,n.ends[p],0);return t})},t.createBlocks=function(){this.ends[u]=this.ends[p]=N(),this.blocks=[this.ends[u]],this.ends[u].parent=this},t.finalizeInsert=function(){this.ends[u].blur=function(){return delete this.blur,this},e.finalizeInsert.call(this)},t.createLeftOf=function(t){if(e.createLeftOf.call(this,this.cursor=t),this.replacedText)for(var n=0;this.replacedText.length>n;n+=1)this.ends[u].write(t,this.replacedText.charAt(n))}}),N=c(j,function(t,e){t.onKey=function(t){return"Spacebar"===t||"Shift-Spacebar"===t?!1:a},t.deleteOutOf=function(t,e){this.isEmpty()&&e.insRightOf(this.parent)},t.write=function(t,e,n){var i,r;return n&&n.remove(),"$"!==e?("<"===e?i="<":">"===e&&(i=">"),Z(e,i).createLeftOf(t)):this.isEmpty()?(t.insRightOf(this.parent).backspace(),Z("\\$","$").createLeftOf(t)):t[p]?t[u]?(r=K(),r.replaces(k(t[p],this.ends[p])),t.insRightOf(this.parent),r.adopt=function(){delete this.adopt,this.adopt.apply(this,arguments),this[u]=0},r.createLeftOf(t),r[u]=this.parent,t.insLeftOf(r)):t.insLeftOf(this.parent):t.insRightOf(this.parent),!1},t.blur=function(){if(this.jQ.removeClass("hasCursor"),this.isEmpty()){var t=this.parent,e=t.cursor;e.parent===this?this.jQ.addClass("empty"):(e.hide(),t.remove(),e[p]===t?e[p]=t[p]:e[u]===t&&(e[u]=t[u]),e.show().parent.bubble("redraw"))}return this},t.focus=function(){var t,n,i,r;return e.focus.call(this),t=this.parent,t[p].ctrlSeq===t.ctrlSeq?(n=this,i=t.cursor,r=t[p].ends[u],r.eachChild(function(t){t.parent=n,t.jQ.appendTo(n.jQ)}),this.ends[p]?this.ends[p][p]=r.ends[u]:this.ends[u]=r.ends[u],r.ends[u][u]=this.ends[p],this.ends[p]=r.ends[p],r.parent.remove(),i[u]?i.insRightOf(i[u]):i.insAtLeftEnd(this),i.parent.bubble("redraw")):t[u].ctrlSeq===t.ctrlSeq&&(i=t.cursor,i[u]?t[u].ends[u].focus():i.insAtRightEnd(t[u].ends[u])),this}}),S.em=S.italic=S.italics=S.emph=S.textit=S.textsl=s("\\textit","i",'class="text"'),S.strong=S.bold=S.textbf=s("\\textbf","b",'class="text"'),S.sf=S.textsf=s("\\textsf","span",'class="sans-serif text"'),S.tt=S.texttt=s("\\texttt","span",'class="monospace text"'),S.textsc=s("\\textsc","span",'style="font-variant:small-caps" class="text"'),S.uppercase=s("\\uppercase","span",'style="text-transform:uppercase" class="text"'),S.lowercase=s("\\lowercase","span",'style="text-transform:lowercase" class="text"'),C["\\"]=c(w,function(t,e){t.ctrlSeq="\\",t.replaces=function(t){this._replacedFragment=t.disown(),this.isEmpty=function(){return!1}},t.htmlTemplate='\\&0',t.textTemplate=["\\"],t.createBlocks=function(){e.createBlocks.call(this),this.ends[u].focus=function(){return this.parent.jQ.addClass("hasCursor"),this.isEmpty()&&this.parent.jQ.removeClass("empty"),this},this.ends[u].blur=function(){return this.parent.jQ.removeClass("hasCursor"),this.isEmpty()&&this.parent.jQ.addClass("empty"),this}},t.createLeftOf=function(t){if(e.createLeftOf.call(this,t),this.cursor=t.insAtRightEnd(this.ends[u]),this._replacedFragment){var n=this.jQ[0];this.jQ=this._replacedFragment.jQ.addClass("blur").bind("mousedown mousemove",function(t){return f(t.target=n).trigger(t),!1}).insertBefore(this.jQ).add(this.jQ)}this.ends[u].write=function(t,e,n){n&&n.remove(),e.match(/[a-z]/i)?Z(e).createLeftOf(t):(this.parent.renderCommand(),"\\"===e&&this.isEmpty()||this.parent.parent.write(t,e))}},t.latex=function(){return"\\"+this.ends[u].latex()+" "},t.onKey=function(t,e){return"Tab"===t||"Enter"===t||"Spacebar"===t?(this.renderCommand(),e.preventDefault(),!1):a},t.renderCommand=function(){this.jQ=this.jQ.last(),this.remove(),this[p]?this.cursor.insLeftOf(this[p]):this.cursor.insAtRightEnd(this.parent);var t=this.ends[u].latex();t||(t="backslash"),this.cursor.insertCmd(t,this._replacedFragment)}}),G=S.binom=S.binomial=c(w,function(t){t.ctrlSeq="\\binom",t.htmlTemplate='(&0&1)',t.textTemplate=["choose(",",",")"],t.redraw=function(){var t=this.jQ.eq(1),e=t.outerHeight()/+t.css("fontSize").slice(0,-2),n=this.jQ.filter(".paren");L(n,he(1+.2*(e-1),1.2),1.05*e)}}),S.choose=c(G,function(t){t.createLeftOf=$.prototype.createLeftOf}),S.vector=c(w,function(t,e){t.ctrlSeq="\\vector",t.htmlTemplate='&0',t.latex=function(){return"\\begin{matrix}"+this.foldChildren([],function(t,e){return t.push(e.latex()),t}).join("\\\\")+"\\end{matrix}"},t.text=function(){return"["+this.foldChildren([],function(t,e){return t.push(e.text()),t}).join()+"]"},t.createLeftOf=function(t){e.createLeftOf.call(this,this.cursor=t)},t.onKey=function(t,e){var n,i=this.cursor.parent;if(i.parent===this){if("Enter"===t)return n=j(),n.parent=this,n.jQ=f("").attr(ce,n.id).insertAfter(i.jQ),i[p]?i[p][u]=n:this.ends[p]=n,n[p]=i[p],i[p]=n,n[u]=i,this.bubble("redraw").cursor.insAtRightEnd(n),e.preventDefault(),!1;if("Tab"===t&&!i[p])return i.isEmpty()?i[u]?(this.cursor.insRightOf(this),delete i[u][p],this.ends[p]=i[u],i.jQ.remove(),this.bubble("redraw"),e.preventDefault(),!1):a:(n=j(),n.parent=this,n.jQ=f("").attr(ce,n.id).appendTo(this.jQ),this.ends[p]=n,i[p]=n,n[u]=i,this.bubble("redraw").cursor.insAtRightEnd(n),e.preventDefault(),!1);if(8===e.which){if(i.isEmpty())return i[u]?(this.cursor.insAtRightEnd(i[u]),i[u][p]=i[p]):(this.cursor.insLeftOf(this),this.ends[u]=i[p]),i[p]?i[p][u]=i[u]:this.ends[p]=i[u],i.jQ.remove(),this.isEmpty()?this.cursor.deleteForward():this.bubble("redraw"),e.preventDefault(),!1;if(!this.cursor[u])return e.preventDefault(),!1}}}}),S.editable=c(y,function(t,e){t.init=function(){w.prototype.init.call(this,"\\editable")},t.jQadd=function(){var t,n,i=this;e.jQadd.apply(i,arguments),t=i.ends[u].disown(),n=i.jQ.children().detach(),i.ends[u]=i.ends[p]=q(),i.blocks=[i.ends[u]],i.ends[u].parent=i,r(i.jQ,i.ends[u],!1,!0),i.cursor=i.ends[u].cursor,t.children().adopt(i.ends[u],0,0),n.appendTo(i.ends[u].jQ),i.ends[u].cursor.insAtRightEnd(i.ends[u])},t.latex=function(){return this.ends[u].latex()},t.text=function(){return this.ends[u].text()}}),S.f=e(x,"f",'ƒ '),X=c(x,function(t,e){t.init=function(t,n){e.init.call(this,t,""+(n||t)+"")},t.text=function(){var t=this.ctrlSeq;return!this[u]||this[u]instanceof X||this[u]instanceof V||(t="*"+t),!this[p]||this[p]instanceof V||"^"===this[p].ctrlSeq||(t+="*"),t}}),Z=c(x,function(t,e){t.init=function(t,n){e.init.call(this,t,""+(n||t)+"")}}),C[" "]=e(Z,"\\:"," "),S.prime=C["'"]=e(Z,"'","′"),Y=c(x,function(t,e){t.init=function(t,n){e.init.call(this,t,''+(n||t)+"")}}),S["@"]=Y,S["&"]=e(Y,"\\&","&"),S["%"]=e(Y,"\\%","%"),S.alpha=S.beta=S.gamma=S.delta=S.zeta=S.eta=S.theta=S.iota=S.kappa=S.mu=S.nu=S.xi=S.rho=S.sigma=S.tau=S.chi=S.psi=S.omega=c(X,function(t,e){t.init=function(t){e.init.call(this,"\\"+t+" ","&"+t+";")}}),S.phi=e(X,"\\phi ","ϕ"),S.phiv=S.varphi=e(X,"\\varphi ","φ"),S.epsilon=e(X,"\\epsilon ","ϵ"),S.epsiv=S.varepsilon=e(X,"\\varepsilon ","ε"),S.piv=S.varpi=e(X,"\\varpi ","ϖ"),S.sigmaf=S.sigmav=S.varsigma=e(X,"\\varsigma ","ς"),S.thetav=S.vartheta=S.thetasym=e(X,"\\vartheta ","ϑ"),S.upsilon=S.upsi=e(X,"\\upsilon ","υ"),S.gammad=S.Gammad=S.digamma=e(X,"\\digamma ","ϝ"),S.kappav=S.varkappa=e(X,"\\varkappa ","ϰ"),S.rhov=S.varrho=e(X,"\\varrho ","ϱ"),S.pi=S["π"]=e(Y,"\\pi ","π"),S.lambda=e(Y,"\\lambda ","λ"),S.Upsilon=S.Upsi=S.upsih=S.Upsih=e(x,"\\Upsilon ",'ϒ'),S.Gamma=S.Delta=S.Theta=S.Lambda=S.Xi=S.Pi=S.Sigma=S.Phi=S.Psi=S.Omega=S.forall=c(Z,function(t,e){t.init=function(t){e.init.call(this,"\\"+t+" ","&"+t+";")}}),J=c(w,function(t){t.init=function(t){this.latex=t},t.createLeftOf=function(t){t.writeLatex(this.latex)},t.parser=function(){var t=ie.parse(this.latex).children();return l.succeed(t)}}),S["¹"]=e(J,"^1"),S["²"]=e(J,"^2"),S["³"]=e(J,"^3"),S["¼"]=e(J,"\\frac14"),S["½"]=e(J,"\\frac12"),S["¾"]=e(J,"\\frac34"),V=c(x,function(t,e){t.init=function(t,n,i){e.init.call(this,t,''+n+"",i) -}}),te=c(V,function(t){t.init=Z.prototype.init,t.respace=function(){return this.jQ[0].className=this[u]?this[u]instanceof V&&this[p]&&!(this[p]instanceof V)?"unary-operator":"binary-operator":"",this}}),S["+"]=e(te,"+","+"),S["–"]=S["-"]=e(te,"-","−"),S["±"]=S.pm=S.plusmn=S.plusminus=e(te,"\\pm ","±"),S.mp=S.mnplus=S.minusplus=e(te,"\\mp ","∓"),C["*"]=S.sdot=S.cdot=e(V,"\\cdot ","·"),S["="]=e(V,"=","="),S["<"]=e(V,"<","<"),S[">"]=e(V,">",">"),S.notin=S.sim=S.cong=S.equiv=S.oplus=S.otimes=c(V,function(t,e){t.init=function(t){e.init.call(this,"\\"+t+" ","&"+t+";")}}),S.times=e(V,"\\times ","×","[x]"),S["÷"]=S.div=S.divide=S.divides=e(V,"\\div ","÷","[/]"),S["≠"]=S.ne=S.neq=e(V,"\\ne ","≠"),S.ast=S.star=S.loast=S.lowast=e(V,"\\ast ","∗"),S.therefor=S.therefore=e(V,"\\therefore ","∴"),S.cuz=S.because=e(V,"\\because ","∵"),S.prop=S.propto=e(V,"\\propto ","∝"),S["≈"]=S.asymp=S.approx=e(V,"\\approx ","≈"),S.lt=e(V,"<","<"),S.gt=e(V,">",">"),S["≤"]=S.le=S.leq=e(V,"\\le ","≤"),S["≥"]=S.ge=S.geq=e(V,"\\ge ","≥"),S.isin=S["in"]=e(V,"\\in ","∈"),S.ni=S.contains=e(V,"\\ni ","∋"),S.notni=S.niton=S.notcontains=S.doesnotcontain=e(V,"\\not\\ni ","∌"),S.sub=S.subset=e(V,"\\subset ","⊂"),S.sup=S.supset=S.superset=e(V,"\\supset ","⊃"),S.nsub=S.notsub=S.nsubset=S.notsubset=e(V,"\\not\\subset ","⊄"),S.nsup=S.notsup=S.nsupset=S.notsupset=S.nsuperset=S.notsuperset=e(V,"\\not\\supset ","⊅"),S.sube=S.subeq=S.subsete=S.subseteq=e(V,"\\subseteq ","⊆"),S.supe=S.supeq=S.supsete=S.supseteq=S.supersete=S.superseteq=e(V,"\\supseteq ","⊇"),S.nsube=S.nsubeq=S.notsube=S.notsubeq=S.nsubsete=S.nsubseteq=S.notsubsete=S.notsubseteq=e(V,"\\not\\subseteq ","⊈"),S.nsupe=S.nsupeq=S.notsupe=S.notsupeq=S.nsupsete=S.nsupseteq=S.notsupsete=S.notsupseteq=S.nsupersete=S.nsuperseteq=S.notsupersete=S.notsuperseteq=e(V,"\\not\\supseteq ","⊉"),ee=c(x,function(t,e){t.init=function(t,n){e.init.call(this,t,""+n+"")}}),S["∑"]=S.sum=S.summation=e(ee,"\\sum ","∑"),S["∏"]=S.prod=S.product=e(ee,"\\prod ","∏"),S.coprod=S.coproduct=e(ee,"\\coprod ","∐"),S["∫"]=S["int"]=S.integral=e(ee,"\\int ","∫"),S.N=S.naturals=S.Naturals=e(Z,"\\mathbb{N}","ℕ"),S.P=S.primes=S.Primes=S.projective=S.Projective=S.probability=S.Probability=e(Z,"\\mathbb{P}","ℙ"),S.Z=S.integers=S.Integers=e(Z,"\\mathbb{Z}","ℤ"),S.Q=S.rationals=S.Rationals=e(Z,"\\mathbb{Q}","ℚ"),S.R=S.reals=S.Reals=e(Z,"\\mathbb{R}","ℝ"),S.C=S.complex=S.Complex=S.complexes=S.Complexes=S.complexplane=S.Complexplane=S.ComplexPlane=e(Z,"\\mathbb{C}","ℂ"),S.H=S.Hamiltonian=S.quaternions=S.Quaternions=e(Z,"\\mathbb{H}","ℍ"),S.quad=S.emsp=e(Z,"\\quad "," "),S.qquad=e(Z,"\\qquad "," "),S.diamond=e(Z,"\\diamond ","◇"),S.bigtriangleup=e(Z,"\\bigtriangleup ","△"),S.ominus=e(Z,"\\ominus ","⊖"),S.uplus=e(Z,"\\uplus ","⊎"),S.bigtriangledown=e(Z,"\\bigtriangledown ","▽"),S.sqcap=e(Z,"\\sqcap ","⊓"),S.triangleleft=e(Z,"\\triangleleft ","⊲"),S.sqcup=e(Z,"\\sqcup ","⊔"),S.triangleright=e(Z,"\\triangleright ","⊳"),S.odot=e(Z,"\\odot ","⊙"),S.bigcirc=e(Z,"\\bigcirc ","◯"),S.dagger=e(Z,"\\dagger ","†"),S.ddagger=e(Z,"\\ddagger ","‡"),S.wr=e(Z,"\\wr ","≀"),S.amalg=e(Z,"\\amalg ","∐"),S.models=e(Z,"\\models ","⊨"),S.prec=e(Z,"\\prec ","≺"),S.succ=e(Z,"\\succ ","≻"),S.preceq=e(Z,"\\preceq ","≼"),S.succeq=e(Z,"\\succeq ","≽"),S.simeq=e(Z,"\\simeq ","≃"),S.mid=e(Z,"\\mid ","∣"),S.ll=e(Z,"\\ll ","≪"),S.gg=e(Z,"\\gg ","≫"),S.parallel=e(Z,"\\parallel ","∥"),S.bowtie=e(Z,"\\bowtie ","⋈"),S.sqsubset=e(Z,"\\sqsubset ","⊏"),S.sqsupset=e(Z,"\\sqsupset ","⊐"),S.smile=e(Z,"\\smile ","⌣"),S.sqsubseteq=e(Z,"\\sqsubseteq ","⊑"),S.sqsupseteq=e(Z,"\\sqsupseteq ","⊒"),S.doteq=e(Z,"\\doteq ","≐"),S.frown=e(Z,"\\frown ","⌢"),S.vdash=e(Z,"\\vdash ","⊦"),S.dashv=e(Z,"\\dashv ","⊣"),S.longleftarrow=e(Z,"\\longleftarrow ","←"),S.longrightarrow=e(Z,"\\longrightarrow ","→"),S.Longleftarrow=e(Z,"\\Longleftarrow ","⇐"),S.Longrightarrow=e(Z,"\\Longrightarrow ","⇒"),S.longleftrightarrow=e(Z,"\\longleftrightarrow ","↔"),S.updownarrow=e(Z,"\\updownarrow ","↕"),S.Longleftrightarrow=e(Z,"\\Longleftrightarrow ","⇔"),S.Updownarrow=e(Z,"\\Updownarrow ","⇕"),S.mapsto=e(Z,"\\mapsto ","↦"),S.nearrow=e(Z,"\\nearrow ","↗"),S.hookleftarrow=e(Z,"\\hookleftarrow ","↩"),S.hookrightarrow=e(Z,"\\hookrightarrow ","↪"),S.searrow=e(Z,"\\searrow ","↘"),S.leftharpoonup=e(Z,"\\leftharpoonup ","↼"),S.rightharpoonup=e(Z,"\\rightharpoonup ","⇀"),S.swarrow=e(Z,"\\swarrow ","↙"),S.leftharpoondown=e(Z,"\\leftharpoondown ","↽"),S.rightharpoondown=e(Z,"\\rightharpoondown ","⇁"),S.nwarrow=e(Z,"\\nwarrow ","↖"),S.ldots=e(Z,"\\ldots ","…"),S.cdots=e(Z,"\\cdots ","⋯"),S.vdots=e(Z,"\\vdots ","⋮"),S.ddots=e(Z,"\\ddots ","⋰"),S.surd=e(Z,"\\surd ","√"),S.triangle=e(Z,"\\triangle ","▵"),S.ell=e(Z,"\\ell ","ℓ"),S.top=e(Z,"\\top ","⊤"),S.flat=e(Z,"\\flat ","♭"),S.natural=e(Z,"\\natural ","♮"),S.sharp=e(Z,"\\sharp ","♯"),S.wp=e(Z,"\\wp ","℘"),S.bot=e(Z,"\\bot ","⊥"),S.clubsuit=e(Z,"\\clubsuit ","♣"),S.diamondsuit=e(Z,"\\diamondsuit ","♢"),S.heartsuit=e(Z,"\\heartsuit ","♡"),S.spadesuit=e(Z,"\\spadesuit ","♠"),S.oint=e(Z,"\\oint ","∮"),S.bigcap=e(Z,"\\bigcap ","∩"),S.bigcup=e(Z,"\\bigcup ","∪"),S.bigsqcup=e(Z,"\\bigsqcup ","⊔"),S.bigvee=e(Z,"\\bigvee ","∨"),S.bigwedge=e(Z,"\\bigwedge ","∧"),S.bigodot=e(Z,"\\bigodot ","⊙"),S.bigotimes=e(Z,"\\bigotimes ","⊗"),S.bigoplus=e(Z,"\\bigoplus ","⊕"),S.biguplus=e(Z,"\\biguplus ","⊎"),S.lfloor=e(Z,"\\lfloor ","⌊"),S.rfloor=e(Z,"\\rfloor ","⌋"),S.lceil=e(Z,"\\lceil ","⌈"),S.rceil=e(Z,"\\rceil ","⌉"),S.slash=e(Z,"\\slash ","/"),S.opencurlybrace=e(Z,"\\opencurlybrace ","{"),S.closecurlybrace=e(Z,"\\closecurlybrace ","}"),S.caret=e(Z,"\\caret ","^"),S.underscore=e(Z,"\\underscore ","_"),S.backslash=e(Z,"\\backslash ","\\"),S.vert=e(Z,"|"),S.perp=S.perpendicular=e(Z,"\\perp ","⊥"),S.nabla=S.del=e(Z,"\\nabla ","∇"),S.hbar=e(Z,"\\hbar ","ℏ"),S.AA=S.Angstrom=S.angstrom=e(Z,"\\text\\AA ","Å"),S.ring=S.circ=S.circle=e(Z,"\\circ ","∘"),S.bull=S.bullet=e(Z,"\\bullet ","•"),S.setminus=S.smallsetminus=e(Z,"\\setminus ","∖"),S.not=S["¬"]=S.neg=e(Z,"\\neg ","¬"),S["…"]=S.dots=S.ellip=S.hellip=S.ellipsis=S.hellipsis=e(Z,"\\dots ","…"),S.converges=S.darr=S.dnarr=S.dnarrow=S.downarrow=e(Z,"\\downarrow ","↓"),S.dArr=S.dnArr=S.dnArrow=S.Downarrow=e(Z,"\\Downarrow ","⇓"),S.diverges=S.uarr=S.uparrow=e(Z,"\\uparrow ","↑"),S.uArr=S.Uparrow=e(Z,"\\Uparrow ","⇑"),S.to=e(V,"\\to ","→"),S.rarr=S.rightarrow=e(Z,"\\rightarrow ","→"),S.implies=e(V,"\\Rightarrow ","⇒"),S.rArr=S.Rightarrow=e(Z,"\\Rightarrow ","⇒"),S.gets=e(V,"\\gets ","←"),S.larr=S.leftarrow=e(Z,"\\leftarrow ","←"),S.impliedby=e(V,"\\Leftarrow ","⇐"),S.lArr=S.Leftarrow=e(Z,"\\Leftarrow ","⇐"),S.harr=S.lrarr=S.leftrightarrow=e(Z,"\\leftrightarrow ","↔"),S.iff=e(V,"\\Leftrightarrow ","⇔"),S.hArr=S.lrArr=S.Leftrightarrow=e(Z,"\\Leftrightarrow ","⇔"),S.Re=S.Real=S.real=e(Z,"\\Re ","ℜ"),S.Im=S.imag=S.image=S.imagin=S.imaginary=S.Imaginary=e(Z,"\\Im ","ℑ"),S.part=S.partial=e(Z,"\\partial ","∂"),S.inf=S.infin=S.infty=S.infinity=e(Z,"\\infty ","∞"),S.alef=S.alefsym=S.aleph=S.alephsym=e(Z,"\\aleph ","ℵ"),S.xist=S.xists=S.exist=S.exists=e(Z,"\\exists ","∃"),S.and=S.land=S.wedge=e(Z,"\\wedge ","∧"),S.or=S.lor=S.vee=e(Z,"\\vee ","∨"),S.o=S.O=S.empty=S.emptyset=S.oslash=S.Oslash=S.nothing=S.varnothing=e(V,"\\varnothing ","∅"),S.cup=S.union=e(V,"\\cup ","∪"),S.cap=S.intersect=S.intersection=e(V,"\\cap ","∩"),S.deg=S.degree=e(Z,"^\\circ ","°"),S.ang=S.angle=e(Z,"\\angle ","∠"),ne=c(x,function(t,e){t.init=function(t){e.init.call(this,"\\"+t+" ",""+t+"")},t.respace=function(){this.jQ[0].className=this[p]instanceof B||this[p]instanceof M?"":"non-italicized-function"}}),S.ln=S.lg=S.log=S.span=S.proj=S.det=S.dim=S.min=S.max=S.mod=S.lcm=S.gcd=S.gcf=S.hcf=S.lim=ne,function(){var t,e=["sin","cos","tan","sec","cosec","csc","cotan","cot"];for(t in e)S[e[t]]=S[e[t]+"h"]=S["a"+e[t]]=S["arc"+e[t]]=S["a"+e[t]+"h"]=S["arc"+e[t]+"h"]=ne}(),ie=function(){function t(t){var e=j();return t.adopt(e,0,0),e}function e(t){var e,n=t[0]||j();for(e=1;t.length>e;e+=1)t[e].children().adopt(n,n.ends[p],0);return n}var n=l.string,i=l.regex,r=l.letter,s=l.any,a=l.optWhitespace,o=l.succeed,c=l.fail,h=r.map(X),u=i(/^[^${}\\_^]/).map(Z),f=i(/^[^\\a-eg-zA-Z]/).or(n("\\").then(i(/^[a-z]+/i).or(i(/^\s+/).result(" ")).or(s))).then(function(t){var e=S[t];return e?e(t).parser():c("unknown command: \\"+t)}),d=f.or(h).or(u),m=n("{").then(function(){return b}).skip(n("}")),g=a.then(m.or(d.map(t))),b=g.many().map(e).skip(a),v=n("[").then(g.then(function(t){return"]"!==t.join("latex")?o(t):c()}).many().map(e).skip(a)).skip(n("]")),w=b;return w.block=g,w.optBlock=v,w}(),re=c(d,function(t){function e(t,e){var i,r,s,a;if(t[p][e])t.insAtLeftEnd(t[p][e]);else if(t[u][e])t.insAtRightEnd(t[u][e]);else{i=t.parent;do{if(r=i[e],r&&("function"==typeof r&&(r=i[e](t)),r===!1||r instanceof j)){t.upDownCache[i.id]=d(t.parent,t[u],t[p]),r instanceof j&&(s=t.upDownCache[r.id],s?s[p]?t.insLeftOf(s[p]):t.insAtRightEnd(s.parent):(a=n(t).left,t.insAtRightEnd(r),t.seekHoriz(a,r)));break}i=i.parent.parent}while(i)}return t.clearSelection().show()}function n(t){var e=t.jQ.removeClass("cursor").offset();return t.jQ.addClass("cursor"),e}function r(t){t.upDownCache={}}t.init=function(t){this.parent=this.root=t;var e=this.jQ=this._jQ=f('');this.blink=function(){e.toggleClass("blink")},this.upDownCache={}},t.show=function(){return this.jQ=this._jQ.removeClass("blink"),"intervalId"in this?clearInterval(this.intervalId):(this[p]?this.selection&&this.selection.ends[u][u]===this[u]?this.jQ.insertBefore(this.selection.jQ):this.jQ.insertBefore(this[p].jQ.first()):this.jQ.appendTo(this.parent.jQ),this.parent.focus()),this.intervalId=setInterval(this.blink,500),this},t.hide=function(){return"intervalId"in this&&clearInterval(this.intervalId),delete this.intervalId,this.jQ.detach(),this.jQ=f(),this},t.withDirInsertAt=function(t,e,n,i){var r=this.parent;this.parent=e,this[t]=n,this[-t]=i,r.blur()},t.insDirOf=function(t,e){return i(t),this.withDirInsertAt(t,e.parent,e[t],e),this.parent.jQ.addClass("hasCursor"),this.jQ.insDirOf(t,e.jQ),this},t.insLeftOf=function(t){return this.insDirOf(u,t)},t.insRightOf=function(t){return this.insDirOf(p,t)},t.insAtDirEnd=function(t,e){return i(t),this.withDirInsertAt(t,e,0,e.ends[t]),t===u&&e.textarea?this.jQ.insDirOf(-t,e.textarea):this.jQ.insAtDirEnd(t,e.jQ),e.focus(),this},t.insAtLeftEnd=function(t){return this.insAtDirEnd(u,t)},t.insAtRightEnd=function(t){return this.insAtDirEnd(p,t)},t.hopDir=function(t){return i(t),this.jQ.insDirOf(t,this[t].jQ),this[-t]=this[t],this[t]=this[t][t],this},t.hopLeft=function(){return this.hopDir(u)},t.hopRight=function(){return this.hopDir(p)},t.moveDirWithin=function(t,e){if(i(t),this[t])this[t].ends[-t]?this.insAtDirEnd(-t,this[t].ends[-t]):this.hopDir(t);else{if(this.parent===e)return;this.parent[t]?this.insAtDirEnd(-t,this.parent[t]):this.insDirOf(t,this.parent.parent)}},t.moveLeftWithin=function(t){return this.moveDirWithin(u,t)},t.moveRightWithin=function(t){return this.moveDirWithin(p,t)},t.moveDir=function(t){return i(t),r(this),this.selection?this.insDirOf(t,this.selection.ends[t]).clearSelection():this.moveDirWithin(t,this.root),this.show()},t.moveLeft=function(){return this.moveDir(u)},t.moveRight=function(){return this.moveDir(p)},t.moveUp=function(){return e(this,"up")},t.moveDown=function(){return e(this,"down")},t.seek=function(t,e){r(this);var n,i,s=this.clearSelection().show();return t.hasClass("empty")?(s.insAtLeftEnd(v[t.attr(ce)]),s):(n=v[t.attr(oe)],n instanceof x?(t.outerWidth()>2*(e-t.offset().left)?s.insLeftOf(n):s.insRightOf(n),s):(n||(i=v[t.attr(ce)],i||(t=t.parent(),n=v[t.attr(oe)],n||(i=v[t.attr(ce)],i||(i=s.root)))),n?s.insRightOf(n):s.insAtRightEnd(i),s.seekHoriz(e,s.root)))},t.seekHoriz=function(t,e){var i,r=this,s=n(r).left-t;do r.moveLeftWithin(e),i=s,s=n(r).left-t;while(s>0&&(r[u]||r.parent!==e));return-s>i&&r.moveRightWithin(e),r},t.writeLatex=function(t){var e,n,i,s=this;return r(s),s.show().deleteSelection(),e=l.all,n=l.eof,i=ie.skip(n).or(e.result(!1)).parse(t),i&&(i.children().adopt(s.parent,s[u],s[p]),v.jQize(i.join("html")).insertBefore(s.jQ),s[u]=i.ends[p],i.finalizeInsert(),s.parent.bubble("redraw")),this.hide()},t.write=function(t){var e=this.prepareWrite();return this.insertCh(t,e)},t.insertCh=function(t,e){return this.parent.write(this,t,e),this},t.insertCmd=function(t,e){var n=S[t];return n?(n=n(t),e&&n.replaces(e),n.createLeftOf(this)):(n=K(),n.replaces(t),n.ends[u].focus=function(){return delete this.focus,this},n.createLeftOf(this),this.insRightOf(n),e&&e.remove()),this},t.unwrapGramp=function(){var t=this.parent.parent,e=t.parent,n=t[p],i=t[u];if(t.disown().eachChild(function(r){r.isEmpty()||(r.children().adopt(e,i,n).each(function(e){e.jQ.insertBefore(t.jQ.first())}),i=r.ends[p])}),!this[p])if(this[u])this[p]=this[u][p];else for(;!this[p];){if(this.parent=this.parent[p],!this.parent){this[p]=t[p],this.parent=e;break}this[p]=this.parent.ends[u]}this[p]?this.insLeftOf(this[p]):this.insAtRightEnd(e),t.jQ.remove(),t[u]&&t[u].respace(),t[p]&&t[p].respace()},t.deleteDir=function(t){if(i(t),r(this),this.show(),this.deleteSelection());else if(this[t])this[t].isEmpty()?this[t]=this[t].remove()[t]:this.selectDir(t);else if(this.parent!==this.root){if(this.parent.parent.isEmpty())return this.insDirOf(-t,this.parent.parent).deleteDir(t);this.unwrapGramp()}return this[u]&&this[u].respace(),this[p]&&this[p].respace(),this.parent.bubble("redraw"),this},t.backspace=function(){return this.deleteDir(u)},t.deleteForward=function(){return this.deleteDir(p)},t.selectFrom=function(t){var e,n,i,r,s,a,o=this,c=t;t:for(;;){for(e=this;e!==o.parent.parent;e=e.parent.parent)if(e.parent===c.parent){i=e,r=c;break t}for(n=t;n!==c.parent.parent;n=n.parent.parent)if(o.parent===n.parent){i=o,r=n;break t}o.parent.parent&&(o=o.parent.parent),c.parent.parent&&(c=c.parent.parent)}if(i[p]!==r){for(a=i;a;a=a[p])if(a===r[u]){s=!0;break}s||(s=r,r=i,i=s)}this.hide().selection=se(i[u][p]||i.parent.ends[u],r[p][u]||r.parent.ends[p]),this.insRightOf(r[p][u]||r.parent.ends[p]),this.root.selectionChanged()},t.selectDir=function(t){if(i(t),r(this),this.selection)if(this.selection.ends[t]===this[-t])this[t]?this.hopDir(t).selection.extendDir(t):this.parent!==this.root&&this.insDirOf(t,this.parent.parent).selection.levelUp();else{if(this.hopDir(t),this.selection.ends[t]===this.selection.ends[-t])return this.clearSelection().show(),a;this.selection.retractDir(t)}else{if(this[t])this.hopDir(t);else{if(this.parent===this.root)return;this.insDirOf(t,this.parent.parent)}this.hide().selection=se(this[-t])}this.root.selectionChanged()},t.selectLeft=function(){return this.selectDir(u)},t.selectRight=function(){return this.selectDir(p)},t.prepareMove=function(){return r(this),this.show().clearSelection()},t.prepareEdit=function(){return r(this),this.show().deleteSelection()},t.prepareWrite=function(){return r(this),this.show().replaceSelection()},t.clearSelection=function(){return this.selection&&(this.selection.clear(),delete this.selection,this.root.selectionChanged()),this},t.deleteSelection=function(){return this.selection?(this[u]=this.selection.ends[u][u],this[p]=this.selection.ends[p][p],this.selection.remove(),this.root.selectionChanged(),delete this.selection):!1},t.replaceSelection=function(){var t=this.selection;return t&&(this[u]=t.ends[u][u],this[p]=t.ends[p][p],delete this.selection),t}}),se=c(k,function(t,e){t.init=function(){var t=this;e.init.apply(t,arguments),t.jQwrap(t.jQ)},t.jQwrap=function(t){this.jQ=t.wrapAll('').parent()},t.adopt=function(){return this.jQ.replaceWith(this.jQ=this.jQ.children()),e.adopt.apply(this,arguments)},t.clear=function(){return this.jQ.replaceWith(this.jQ.children()),this},t.levelUp=function(){var t=this,e=t.ends[u]=t.ends[p]=t.ends[p].parent.parent;return t.clear().jQwrap(e.jQ),t},t.extendDir=function(t){return i(t),this.ends[t]=this.ends[t][t],this.ends[t].jQ.insAtDirEnd(t,this.jQ),this},t.extendLeft=function(){return this.extendDir(u)},t.extendRight=function(){return this.extendDir(p)},t.retractDir=function(t){i(t),this.ends[-t].jQ.insDirOf(-t,this.jQ),this.ends[-t]=this.ends[-t][t]},t.retractRight=function(){return this.retractDir(p)},t.retractLeft=function(){return this.retractDir(u)}}),ae.fn.mathquill=function(t,e){var n,i,s,a,o;switch(t){case"redraw":return this.each(function(){var t=f(this).attr(ce),e=t&&v[t];e&&function n(t){t.eachChild(n),t.redraw&&t.redraw()}(e)});case"revert":return this.each(function(){var t=f(this).attr(ce),e=t&&v[t];e&&e.revert&&e.revert()});case"latex":return arguments.length>1?this.each(function(){var t=f(this).attr(ce),n=t&&v[t];n&&n.renderLatex(e)}):(n=f(this).attr(ce),i=n&&v[n],i&&i.latex());case"text":return n=f(this).attr(ce),i=n&&v[n],i&&i.text();case"html":return this.html().replace(/ ?hasCursor|hasCursor /,"").replace(/ class=(""|(?= |>))/g,"").replace(/<\/span>/i,"").replace(/