├── .gitignore ├── README.md ├── autoload ├── mpsync.vim └── python │ └── java_vim_bridge.py ├── plugin └── mpsync.vim ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── pingao │ │ ├── Main.java │ │ ├── enums │ │ ├── MiMeType.java │ │ └── Operate.java │ │ ├── model │ │ ├── MarkDownUnit.java │ │ ├── WebSocketMsg.java │ │ └── YAMLSpan.java │ │ ├── server │ │ ├── HttpRequestHandler.java │ │ ├── MarkDownServer.java │ │ ├── MarkDownServerInitializer.java │ │ ├── SocketServer.java │ │ └── TextWebSocketFrameHandler.java │ │ └── utils │ │ ├── Base64Utils.java │ │ ├── FileUtils.java │ │ ├── HtmlUtils.java │ │ └── JSoupUtils.java ├── resources │ └── tinylog.properties └── webapp │ ├── css │ ├── github-theme.css │ ├── github.css │ └── index.css │ ├── index.html │ └── js │ ├── MathJax │ ├── .travis.yml │ ├── LICENSE │ ├── MathJax.js │ ├── config │ │ └── default.js │ ├── extensions │ │ ├── AssistiveMML.js │ │ ├── MathEvents.js │ │ ├── fast-preview.js │ │ ├── tex2jax.js │ │ └── toMathML.js │ ├── jax │ │ ├── element │ │ │ └── mml │ │ │ │ ├── jax.js │ │ │ │ └── optable │ │ │ │ ├── Arrows.js │ │ │ │ ├── BasicLatin.js │ │ │ │ ├── CombDiacritMarks.js │ │ │ │ ├── CombDiactForSymbols.js │ │ │ │ ├── Dingbats.js │ │ │ │ ├── GeneralPunctuation.js │ │ │ │ ├── GeometricShapes.js │ │ │ │ ├── GreekAndCoptic.js │ │ │ │ ├── Latin1Supplement.js │ │ │ │ ├── LetterlikeSymbols.js │ │ │ │ ├── MathOperators.js │ │ │ │ ├── MiscMathSymbolsA.js │ │ │ │ ├── MiscMathSymbolsB.js │ │ │ │ ├── MiscSymbolsAndArrows.js │ │ │ │ ├── MiscTechnical.js │ │ │ │ ├── SpacingModLetters.js │ │ │ │ ├── SuppMathOperators.js │ │ │ │ ├── SupplementalArrowsA.js │ │ │ │ └── SupplementalArrowsB.js │ │ ├── input │ │ │ └── TeX │ │ │ │ ├── config.js │ │ │ │ └── jax.js │ │ └── output │ │ │ ├── CommonHTML │ │ │ ├── autoload │ │ │ │ ├── annotation-xml.js │ │ │ │ ├── maction.js │ │ │ │ ├── menclose.js │ │ │ │ ├── mglyph.js │ │ │ │ ├── mmultiscripts.js │ │ │ │ ├── ms.js │ │ │ │ ├── mtable.js │ │ │ │ └── multiline.js │ │ │ ├── config.js │ │ │ ├── fonts │ │ │ │ └── TeX │ │ │ │ │ ├── AMS-Regular.js │ │ │ │ │ ├── Caligraphic-Bold.js │ │ │ │ │ ├── Fraktur-Bold.js │ │ │ │ │ ├── Fraktur-Regular.js │ │ │ │ │ ├── Main-Bold.js │ │ │ │ │ ├── Math-BoldItalic.js │ │ │ │ │ ├── SansSerif-Bold.js │ │ │ │ │ ├── SansSerif-Italic.js │ │ │ │ │ ├── SansSerif-Regular.js │ │ │ │ │ ├── Script-Regular.js │ │ │ │ │ ├── Typewriter-Regular.js │ │ │ │ │ ├── fontdata-extra.js │ │ │ │ │ └── fontdata.js │ │ │ └── jax.js │ │ │ ├── HTML-CSS │ │ │ └── config.js │ │ │ ├── PlainSource │ │ │ ├── config.js │ │ │ └── jax.js │ │ │ ├── PreviewHTML │ │ │ ├── config.js │ │ │ └── jax.js │ │ │ └── SVG │ │ │ ├── autoload │ │ │ ├── annotation-xml.js │ │ │ ├── maction.js │ │ │ ├── menclose.js │ │ │ ├── mglyph.js │ │ │ ├── mmultiscripts.js │ │ │ ├── ms.js │ │ │ ├── mtable.js │ │ │ └── multiline.js │ │ │ ├── config.js │ │ │ ├── fonts │ │ │ └── TeX │ │ │ │ ├── AMS │ │ │ │ └── Regular │ │ │ │ │ ├── Arrows.js │ │ │ │ │ ├── BoxDrawing.js │ │ │ │ │ ├── CombDiacritMarks.js │ │ │ │ │ ├── Dingbats.js │ │ │ │ │ ├── EnclosedAlphanum.js │ │ │ │ │ ├── GeneralPunctuation.js │ │ │ │ │ ├── GeometricShapes.js │ │ │ │ │ ├── GreekAndCoptic.js │ │ │ │ │ ├── Latin1Supplement.js │ │ │ │ │ ├── LatinExtendedA.js │ │ │ │ │ ├── LetterlikeSymbols.js │ │ │ │ │ ├── Main.js │ │ │ │ │ ├── MathOperators.js │ │ │ │ │ ├── MiscMathSymbolsB.js │ │ │ │ │ ├── MiscSymbols.js │ │ │ │ │ ├── MiscTechnical.js │ │ │ │ │ ├── PUA.js │ │ │ │ │ ├── SpacingModLetters.js │ │ │ │ │ └── SuppMathOperators.js │ │ │ │ ├── Caligraphic │ │ │ │ ├── Bold │ │ │ │ │ └── Main.js │ │ │ │ └── Regular │ │ │ │ │ └── Main.js │ │ │ │ ├── Fraktur │ │ │ │ ├── Bold │ │ │ │ │ ├── BasicLatin.js │ │ │ │ │ ├── Main.js │ │ │ │ │ ├── Other.js │ │ │ │ │ └── PUA.js │ │ │ │ └── Regular │ │ │ │ │ ├── BasicLatin.js │ │ │ │ │ ├── Main.js │ │ │ │ │ ├── Other.js │ │ │ │ │ └── PUA.js │ │ │ │ ├── Main │ │ │ │ ├── Bold │ │ │ │ │ ├── Arrows.js │ │ │ │ │ ├── BasicLatin.js │ │ │ │ │ ├── CombDiacritMarks.js │ │ │ │ │ ├── CombDiactForSymbols.js │ │ │ │ │ ├── GeneralPunctuation.js │ │ │ │ │ ├── GeometricShapes.js │ │ │ │ │ ├── GreekAndCoptic.js │ │ │ │ │ ├── Latin1Supplement.js │ │ │ │ │ ├── LatinExtendedA.js │ │ │ │ │ ├── LatinExtendedB.js │ │ │ │ │ ├── LetterlikeSymbols.js │ │ │ │ │ ├── Main.js │ │ │ │ │ ├── MathOperators.js │ │ │ │ │ ├── MiscMathSymbolsA.js │ │ │ │ │ ├── MiscSymbols.js │ │ │ │ │ ├── MiscTechnical.js │ │ │ │ │ ├── SpacingModLetters.js │ │ │ │ │ ├── SuppMathOperators.js │ │ │ │ │ └── SupplementalArrowsA.js │ │ │ │ ├── Italic │ │ │ │ │ ├── BasicLatin.js │ │ │ │ │ ├── CombDiacritMarks.js │ │ │ │ │ ├── GeneralPunctuation.js │ │ │ │ │ ├── GreekAndCoptic.js │ │ │ │ │ ├── LatinExtendedA.js │ │ │ │ │ ├── LatinExtendedB.js │ │ │ │ │ ├── LetterlikeSymbols.js │ │ │ │ │ ├── Main.js │ │ │ │ │ └── MathOperators.js │ │ │ │ └── Regular │ │ │ │ │ ├── BasicLatin.js │ │ │ │ │ ├── CombDiacritMarks.js │ │ │ │ │ ├── GeometricShapes.js │ │ │ │ │ ├── GreekAndCoptic.js │ │ │ │ │ ├── LatinExtendedA.js │ │ │ │ │ ├── LatinExtendedB.js │ │ │ │ │ ├── LetterlikeSymbols.js │ │ │ │ │ ├── Main.js │ │ │ │ │ ├── MathOperators.js │ │ │ │ │ ├── MiscSymbols.js │ │ │ │ │ ├── SpacingModLetters.js │ │ │ │ │ └── SuppMathOperators.js │ │ │ │ ├── Math │ │ │ │ ├── BoldItalic │ │ │ │ │ └── Main.js │ │ │ │ └── Italic │ │ │ │ │ └── Main.js │ │ │ │ ├── SansSerif │ │ │ │ ├── Bold │ │ │ │ │ ├── BasicLatin.js │ │ │ │ │ ├── CombDiacritMarks.js │ │ │ │ │ ├── Main.js │ │ │ │ │ └── Other.js │ │ │ │ ├── Italic │ │ │ │ │ ├── BasicLatin.js │ │ │ │ │ ├── CombDiacritMarks.js │ │ │ │ │ ├── Main.js │ │ │ │ │ └── Other.js │ │ │ │ └── Regular │ │ │ │ │ ├── BasicLatin.js │ │ │ │ │ ├── CombDiacritMarks.js │ │ │ │ │ ├── Main.js │ │ │ │ │ └── Other.js │ │ │ │ ├── Script │ │ │ │ └── Regular │ │ │ │ │ ├── BasicLatin.js │ │ │ │ │ └── Main.js │ │ │ │ ├── Size1 │ │ │ │ └── Regular │ │ │ │ │ └── Main.js │ │ │ │ ├── Size2 │ │ │ │ └── Regular │ │ │ │ │ └── Main.js │ │ │ │ ├── Size3 │ │ │ │ └── Regular │ │ │ │ │ └── Main.js │ │ │ │ ├── Size4 │ │ │ │ └── Regular │ │ │ │ │ └── Main.js │ │ │ │ ├── Typewriter │ │ │ │ └── Regular │ │ │ │ │ ├── BasicLatin.js │ │ │ │ │ ├── CombDiacritMarks.js │ │ │ │ │ ├── Main.js │ │ │ │ │ └── Other.js │ │ │ │ ├── fontdata-extra.js │ │ │ │ └── fontdata.js │ │ │ └── jax.js │ └── latest.js │ ├── highlight.pack.js │ ├── index.js │ └── jquery.min.js └── test └── java └── CommonTest.java /.gitignore: -------------------------------------------------------------------------------- 1 | autoload/java/ 2 | .idea/ 3 | target/ 4 | *.class 5 | 6 | # Mobile Tools for Java (J2ME) 7 | .mtj.tmp/ 8 | 9 | # Package Files # 10 | *.war 11 | *.ear 12 | *.jar 13 | 14 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 15 | hs_err_pid* 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [TOC] 2 | 3 | ## A quasi real-time vim markdown preview plugin 4 | 5 | ![snapshot-en](https://wocanmei-hexo.nos-eastchina1.126.net/markdown-preview-sync/en.png) 6 | 7 | ![snapshot-ch](https://wocanmei-hexo.nos-eastchina1.126.net/markdown-preview-sync/ch.png) 8 | 9 | ### Feature 10 | 11 | - Code Highlight 12 | - MathJax 13 | - Custom CSS 14 | - GFM-Table 15 | - TOC 16 | 17 | ### Prerequisite 18 | 19 | - Jre8 or above 20 | - Vim with python2 or python3 support 21 | 22 | ### Installation 23 | 24 | If you use [pathogen](https://github.com/tpope/vim-pathogen), do this: unzip release file `markdown-preview-sync.zip` to bundle directory. 25 | 26 | If you don't use any plugin manager, just unzip release file `markdown-preview-sync.zip`, then copy files in /autoload and /plugin to Vim's /autoload and /plugin directory. 27 | 28 | ### Setting 29 | 30 | ```vim 31 | " Both Chrome and Firefox are good, but Chrome is prefer 32 | " Set Chrome path 33 | let g:markdown_preview_sync_chrome_path = "" 34 | 35 | " Set Firefox path 36 | let g:markdown_preview_sync_firefox_path = "" 37 | 38 | " (Optional)Set your own css theme, put your css file in 39 | " autoload/java/webapp/css directory with a name: name-theme.css, 40 | " then set 41 | let g:markdown_preview_sync_theme = "name" 42 | 43 | " Set key 44 | autocmd filetype markdown nnoremap :MarkSyncPreview 45 | autocmd filetype markdown nnoremap :MarkSyncClose 46 | ``` 47 | 48 | Last but not least, comments and issues are welcome. 49 | 50 | --- 51 | 52 | ## 一款准实时的Vim Markdown预览插件 53 | 54 | 下面简单介绍下这款插件: 55 | 56 | ### 特性 57 | 58 | - 代码高亮 59 | - MathJax 60 | - 自定义CSS 61 | - GFM-Table 62 | - 目录TOC 63 | 64 | ### 安装准备 65 | 66 | - Jre8及以上 67 | - Vim支持python2或python3 68 | 69 | ### 安装方式 70 | 71 | 如果你使用[pathogen](https://github.com/tpope/vim-pathogen),将release中的`markdown-preview-sync.zip`解压到bundle文件夹即可。 72 | 73 | 如果你没有使用任何插件管理工具,解压release中的`markdown-preview-sync.zip`,然后将/autoload和/plugin目录中的文件分别放在Vim的/autoload和/plugin目录即可。 74 | 75 | ### 设置 76 | 77 | ```vim 78 | " Chrome和Firefox都可以,推荐使用Chrome 79 | " 可以这样设置Chrome路径 80 | let g:markdown_preview_sync_chrome_path = "" 81 | 82 | " 设置Firefox浏览器路径 83 | let g:markdown_preview_sync_firefox_path = "" 84 | 85 | " (Optional)设置自定义CSS主题,将你的CSS文件放在autoload/java/webapp/css文件夹下, 86 | " 以“主题名-theme.css”方式命名,然后设置如下变量 87 | let g:markdown_preview_sync_theme = "主题名" 88 | 89 | " 配置快捷键 90 | autocmd filetype markdown nnoremap :MarkSyncPreview 91 | autocmd filetype markdown nnoremap :MarkSyncClose 92 | ``` 93 | 94 | 最后,欢迎大家多多提意见和建议。 95 | 96 | 后记:作为Vim粉丝一枚,一直在寻找一款好用的Markdown预览插件,功能要简单,能在书写之余偶尔撇一下效果即可,毕竟Markdown语法都烂熟于心了。先是偶然看到了Chrome一款插件[Markdown Viewer](https://chrome.google.com/webstore/detail/markdown-viewer/ckkdlimhmcjmikdlpkmbgfkaikojcbjk),风格非常喜欢,遗憾的是不能与Vim同步,后来又发现一款Vim插件[markdown-preview.vim](https://github.com/iamcco/markdown-preview.vim),但是我装了好几次,在我的机器上老是报错。故事本来到此就结束了,但是程序猿乞肯如此轻易屈服,程序猿要让这天,再遮不住眼,要这地,再埋不了心,程序猿要用自己的双手开天辟地!经过程序猿在键盘上一顿猛干,[markdown-preview-sync](https://github.com/pingao777/markdown-preview-sync)横空出世了!好了,就吹到这吧。 97 | -------------------------------------------------------------------------------- /autoload/python/java_vim_bridge.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Bridge connect vim to java 3 | 4 | @author wocanmei 5 | @date 2018-07-15 17:56:25 6 | """ 7 | 8 | import time 9 | import socket 10 | import sys 11 | 12 | 13 | MAX_CONN_TIMES = 5 14 | SEP = '__%#mpsync&@__' 15 | EOF = '\0' 16 | 17 | s = None 18 | 19 | 20 | def start(port, theme): 21 | is_connected = False 22 | connect_cnt = 0 23 | while not is_connected and connect_cnt < MAX_CONN_TIMES: 24 | connect_cnt += 1 25 | try: 26 | _connect(port, theme) 27 | except Exception: 28 | is_connected = False 29 | time.sleep(1) 30 | else: 31 | is_connected = True 32 | 33 | if not is_connected: 34 | raise Exception('Fail to connect after ' + str(connect_cnt) + ' tries') 35 | 36 | 37 | def _connect(port, theme): 38 | global s 39 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 40 | s.connect(('127.0.0.1', 23789)) 41 | s.sendall(wrap('start' + SEP + str(port) + SEP + theme + EOF)) 42 | 43 | 44 | def open(path): 45 | s.sendall(wrap('open' + SEP + path + EOF)) 46 | 47 | 48 | def sync(path, content, bottom): 49 | s.sendall(wrap('sync' + SEP + path + SEP + content + SEP + str(bottom) + EOF)) 50 | 51 | 52 | def close(path): 53 | s.sendall(wrap('close' + SEP + path + EOF)) 54 | 55 | 56 | def stop(): 57 | s.sendall(wrap('stop' + EOF)) 58 | s.close() 59 | 60 | 61 | def version(): 62 | return sys.version_info[0] 63 | 64 | 65 | def wrap(data): 66 | if version() == 2: 67 | return data 68 | elif version() == 3: 69 | return data.encode() 70 | -------------------------------------------------------------------------------- /plugin/mpsync.vim: -------------------------------------------------------------------------------- 1 | command! -nargs=0 MarkSyncPreview call mpsync#preview() 2 | command! -nargs=0 MarkSyncClose call mpsync#close() 3 | -------------------------------------------------------------------------------- /src/main/java/com/pingao/Main.java: -------------------------------------------------------------------------------- 1 | package com.pingao; 2 | 3 | import com.pingao.server.SocketServer; 4 | import org.pmw.tinylog.Logger; 5 | 6 | import java.io.File; 7 | 8 | 9 | /** 10 | * Created by pingao on 2018/7/12. 11 | */ 12 | public class Main { 13 | public static final String ROOT_PATH = resolveRootPath(); 14 | 15 | private static String resolveRootPath() { 16 | String path = Main.class.getProtectionDomain().getCodeSource().getLocation().getFile(); 17 | File source = new File(path); 18 | if (source.isDirectory()) { 19 | return source.getAbsolutePath().replace("%20", " "); 20 | } else { 21 | return source.getParentFile().getAbsolutePath().replace("%20", " "); 22 | } 23 | } 24 | 25 | public static void main(String[] args) { 26 | try { 27 | new SocketServer().start(); 28 | } catch (Exception e) { 29 | Logger.error("Error occurs on socket server start", e); 30 | } 31 | } 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/java/com/pingao/enums/MiMeType.java: -------------------------------------------------------------------------------- 1 | package com.pingao.enums; 2 | 3 | /** 4 | * Created by pingao on 2018/7/13. 5 | */ 6 | public enum MiMeType { 7 | HTML("text/html; charset=UTF-8"), 8 | PLAIN("text/plain; charset=UTF-8"), 9 | JAVA_SCRIPT("application/javascript; charset=UTF-8"), 10 | CSS("text/css; charset=UTF-8"), 11 | JSON("application/json; charset=UTF-8"), 12 | JPEG("image/jpeg"), 13 | PNG("image/png"), 14 | SVG("image/svg+xml"), 15 | ; 16 | 17 | private String type; 18 | 19 | MiMeType(String type) { 20 | this.type = type; 21 | } 22 | 23 | public String getType() { 24 | return type; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/pingao/enums/Operate.java: -------------------------------------------------------------------------------- 1 | package com.pingao.enums; 2 | 3 | /** 4 | * Created by pingao on 2018/7/21. 5 | */ 6 | public enum Operate { 7 | REPLACE, APPEND, REMOVE 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/pingao/model/MarkDownUnit.java: -------------------------------------------------------------------------------- 1 | package com.pingao.model; 2 | 3 | import com.pingao.enums.Operate; 4 | 5 | 6 | /** 7 | * Created by pingao on 2018/7/21. 8 | */ 9 | public class MarkDownUnit { 10 | private String id; 11 | private Operate operate; 12 | private String content; 13 | private int isMathJax; 14 | 15 | public MarkDownUnit(String id, Operate operate, String content, int isMathJax) { 16 | this.id = id; 17 | this.operate = operate; 18 | this.content = content; 19 | this.isMathJax = isMathJax; 20 | } 21 | 22 | public String getContent() { 23 | return content; 24 | } 25 | 26 | public void setContent(String content) { 27 | this.content = content; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return "MarkDownUnit[id=" + id + 33 | ", operate=" + operate + 34 | ", content=" + content + 35 | ", isMathJax=" + isMathJax; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/pingao/model/WebSocketMsg.java: -------------------------------------------------------------------------------- 1 | package com.pingao.model; 2 | 3 | import java.util.List; 4 | 5 | 6 | /** 7 | * Created by pingao on 2018/7/12. 8 | */ 9 | public class WebSocketMsg { 10 | private String command; 11 | private String path; 12 | private List units; 13 | 14 | public WebSocketMsg(String command, String path, List units) { 15 | this.command = command; 16 | this.path = path; 17 | this.units = units; 18 | } 19 | 20 | @Override 21 | public String toString() { 22 | return "WebSocketMsg[command=" + command + 23 | ", path=" + path + 24 | ", units=" + units.size(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/pingao/model/YAMLSpan.java: -------------------------------------------------------------------------------- 1 | package com.pingao.model; 2 | 3 | /** 4 | * Created by pingao on 2018/7/29. 5 | */ 6 | public class YAMLSpan { 7 | private int endRow = -1; 8 | private int endInd = -1; 9 | 10 | public int getEndRow() { 11 | return endRow; 12 | } 13 | 14 | public void setEndRow(int endRow) { 15 | this.endRow = endRow; 16 | } 17 | 18 | public int getEndInd() { 19 | return endInd; 20 | } 21 | 22 | public void setEndInd(int endInd) { 23 | this.endInd = endInd; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/pingao/server/MarkDownServer.java: -------------------------------------------------------------------------------- 1 | package com.pingao.server; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.GsonBuilder; 5 | import com.pingao.model.MarkDownUnit; 6 | import com.pingao.model.WebSocketMsg; 7 | import com.pingao.utils.HtmlUtils; 8 | import com.pingao.utils.JSoupUtils; 9 | import io.netty.bootstrap.ServerBootstrap; 10 | import io.netty.channel.Channel; 11 | import io.netty.channel.ChannelFuture; 12 | import io.netty.channel.EventLoopGroup; 13 | import io.netty.channel.group.ChannelGroup; 14 | import io.netty.channel.group.DefaultChannelGroup; 15 | import io.netty.channel.nio.NioEventLoopGroup; 16 | import io.netty.channel.socket.nio.NioServerSocketChannel; 17 | import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; 18 | import io.netty.util.concurrent.ImmediateEventExecutor; 19 | import org.pmw.tinylog.Logger; 20 | 21 | import java.net.InetSocketAddress; 22 | import java.util.List; 23 | 24 | 25 | public class MarkDownServer { 26 | private static final Gson GSON = new GsonBuilder().disableHtmlEscaping().create(); 27 | 28 | private static MarkDownServer INSTANCE; 29 | 30 | private final ChannelGroup channelGroup = 31 | new DefaultChannelGroup(ImmediateEventExecutor.INSTANCE); 32 | private final EventLoopGroup group = new NioEventLoopGroup(); 33 | private Channel channel; 34 | 35 | private boolean isRunning; 36 | 37 | private String theme; 38 | 39 | public static MarkDownServer getInstance() { 40 | if (INSTANCE == null) { 41 | INSTANCE = new MarkDownServer(); 42 | } 43 | return INSTANCE; 44 | } 45 | 46 | private MarkDownServer() { 47 | } 48 | 49 | public String getTheme() { 50 | return theme; 51 | } 52 | 53 | public void setTheme(String theme) { 54 | this.theme = theme; 55 | } 56 | 57 | public ChannelFuture start(int port) { 58 | ServerBootstrap bootstrap = new ServerBootstrap(); 59 | bootstrap.group(group) 60 | .channel(NioServerSocketChannel.class) 61 | .childHandler(new MarkDownServerInitializer(this)); 62 | ChannelFuture future = bootstrap.bind(new InetSocketAddress(port)); 63 | future.syncUninterruptibly(); 64 | channel = future.channel(); 65 | isRunning = true; 66 | Logger.info("Markdown server is running on {} ...", channel.localAddress()); 67 | return future; 68 | } 69 | 70 | public void destroy() { 71 | channel.close(); 72 | channelGroup.close(); 73 | group.shutdownGracefully(); 74 | Logger.info("Markdown server shutdown success"); 75 | } 76 | 77 | public boolean isRunning() { 78 | return isRunning; 79 | } 80 | 81 | public void addChannel(Channel channel) { 82 | channelGroup.add(channel); 83 | } 84 | 85 | public void broadcast(String command, String path, String content, int bottom) { 86 | String html = HtmlUtils.markdown2Html(HtmlUtils.plugBottomMarker(content, bottom)); 87 | List units = JSoupUtils.diff(path, html); 88 | WebSocketMsg msg = new WebSocketMsg(command, path, units); 89 | String json = GSON.toJson(msg); 90 | channelGroup.writeAndFlush(new TextWebSocketFrame(json)); 91 | Logger.info("Broadcast bottom {} msg {} success", bottom, msg); 92 | } 93 | 94 | public static void main(String[] args) { 95 | final MarkDownServer endpoint = new MarkDownServer(); 96 | endpoint.setTheme("github"); 97 | endpoint.start(7788); 98 | Runtime.getRuntime().addShutdownHook(new Thread(endpoint::destroy)); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/main/java/com/pingao/server/MarkDownServerInitializer.java: -------------------------------------------------------------------------------- 1 | package com.pingao.server; 2 | 3 | import io.netty.channel.Channel; 4 | import io.netty.channel.ChannelInitializer; 5 | import io.netty.channel.ChannelPipeline; 6 | import io.netty.handler.codec.http.HttpObjectAggregator; 7 | import io.netty.handler.codec.http.HttpServerCodec; 8 | import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler; 9 | import io.netty.handler.stream.ChunkedWriteHandler; 10 | 11 | 12 | public class MarkDownServerInitializer extends ChannelInitializer { 13 | private final MarkDownServer server; 14 | 15 | public MarkDownServerInitializer(MarkDownServer server) { 16 | this.server = server; 17 | } 18 | 19 | @Override 20 | protected void initChannel(Channel ch) { 21 | ChannelPipeline pipeline = ch.pipeline(); 22 | pipeline.addLast(new HttpServerCodec()); 23 | pipeline.addLast(new ChunkedWriteHandler()); 24 | pipeline.addLast(new HttpObjectAggregator(64 * 1024)); 25 | pipeline.addLast(new HttpRequestHandler(server)); 26 | pipeline.addLast(new WebSocketServerProtocolHandler("/ws")); 27 | pipeline.addLast(new TextWebSocketFrameHandler(server)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/pingao/server/SocketServer.java: -------------------------------------------------------------------------------- 1 | package com.pingao.server; 2 | 3 | import com.pingao.utils.FileUtils; 4 | import com.pingao.utils.JSoupUtils; 5 | import io.netty.bootstrap.ServerBootstrap; 6 | import io.netty.buffer.ByteBuf; 7 | import io.netty.buffer.Unpooled; 8 | import io.netty.channel.*; 9 | import io.netty.channel.nio.NioEventLoopGroup; 10 | import io.netty.channel.socket.SocketChannel; 11 | import io.netty.channel.socket.nio.NioServerSocketChannel; 12 | import io.netty.handler.codec.DelimiterBasedFrameDecoder; 13 | import io.netty.util.CharsetUtil; 14 | import org.pmw.tinylog.Logger; 15 | 16 | import java.net.InetSocketAddress; 17 | 18 | 19 | /** 20 | * Created by pingao on 2018/8/5. 21 | */ 22 | public class SocketServer { 23 | private static final String SEP = "__%#mpsync&@__"; 24 | private static final ByteBuf EOF = Unpooled.copiedBuffer(FileUtils.getBytes("\0")); 25 | 26 | private MarkDownServer server; 27 | 28 | public void start() throws Exception { 29 | final SocketServerHandler serverHandler = new SocketServerHandler(); 30 | EventLoopGroup group = new NioEventLoopGroup(); 31 | try { 32 | ServerBootstrap b = new ServerBootstrap(); 33 | b.group(group) 34 | .channel(NioServerSocketChannel.class) 35 | .localAddress(new InetSocketAddress(23789)) 36 | .childHandler(new ChannelInitializer() { 37 | @Override 38 | public void initChannel(SocketChannel ch) { 39 | ch.pipeline().addLast(new DelimiterBasedFrameDecoder(Integer.MAX_VALUE, EOF)); 40 | ch.pipeline().addLast(serverHandler); 41 | } 42 | }); 43 | 44 | ChannelFuture f = b.bind().sync(); 45 | Logger.info("Socket server is running on {} ...", f.channel().localAddress()); 46 | f.channel().closeFuture().sync(); 47 | } finally { 48 | group.shutdownGracefully().sync(); 49 | } 50 | } 51 | 52 | @ChannelHandler.Sharable 53 | private class SocketServerHandler extends ChannelInboundHandlerAdapter { 54 | @Override 55 | public void channelRead(ChannelHandlerContext ctx, Object msg) { 56 | ByteBuf in = (ByteBuf) msg; 57 | String string = in.toString(CharsetUtil.UTF_8); 58 | in.release(); 59 | Logger.info("Server received: " + string); 60 | String[] data = string.split(SEP); 61 | switch (data[0]) { 62 | case "start": 63 | server = MarkDownServer.getInstance(); 64 | server.setTheme(data[2]); 65 | server.start(Integer.parseInt(data[1])); 66 | break; 67 | case "open": 68 | JSoupUtils.removeCache(data[1]); 69 | break; 70 | case "sync": 71 | server.broadcast("sync", data[1], data[2], Integer.parseInt(data[3])); 72 | break; 73 | case "close": 74 | server.broadcast("close", data[1], "", 1); 75 | break; 76 | case "stop": 77 | server.destroy(); 78 | System.exit(0); 79 | break; 80 | default: 81 | Logger.info("Command {} is unknown", data[0]); 82 | } 83 | } 84 | 85 | @Override 86 | public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { 87 | Logger.error("Error occurs cause", cause); 88 | ctx.close(); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/main/java/com/pingao/server/TextWebSocketFrameHandler.java: -------------------------------------------------------------------------------- 1 | package com.pingao.server; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | import io.netty.channel.SimpleChannelInboundHandler; 5 | import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; 6 | import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler; 7 | import org.pmw.tinylog.Logger; 8 | 9 | 10 | public class TextWebSocketFrameHandler extends SimpleChannelInboundHandler { 11 | private final MarkDownServer server; 12 | 13 | public TextWebSocketFrameHandler(MarkDownServer server) { 14 | this.server = server; 15 | } 16 | 17 | @Override 18 | public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { 19 | if (evt instanceof WebSocketServerProtocolHandler.HandshakeComplete) { 20 | Logger.info("Channel {} joined", ctx.channel()); 21 | server.addChannel(ctx.channel()); 22 | } else { 23 | super.userEventTriggered(ctx, evt); 24 | } 25 | } 26 | 27 | @Override 28 | public void channelRead0(ChannelHandlerContext ctx, TextWebSocketFrame msg) { 29 | msg.retain(); 30 | Logger.info("Received msg {}", msg.text()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/pingao/utils/Base64Utils.java: -------------------------------------------------------------------------------- 1 | package com.pingao.utils; 2 | 3 | import java.nio.charset.Charset; 4 | import java.util.Base64; 5 | 6 | 7 | /** 8 | * Created by pingao on 2018/8/1. 9 | */ 10 | public class Base64Utils { 11 | private static final Base64.Decoder DECODER = Base64.getDecoder(); 12 | 13 | public static String decode2String(String encode) { 14 | return new String(DECODER.decode(encode), Charset.forName("UTF-8")); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/pingao/utils/FileUtils.java: -------------------------------------------------------------------------------- 1 | package com.pingao.utils; 2 | 3 | import org.pmw.tinylog.Logger; 4 | 5 | import java.io.IOException; 6 | import java.io.UnsupportedEncodingException; 7 | import java.nio.charset.Charset; 8 | import java.nio.file.Files; 9 | import java.nio.file.Paths; 10 | import java.util.stream.Collectors; 11 | 12 | 13 | /** 14 | * Created by pingao on 2018/8/3. 15 | */ 16 | public class FileUtils { 17 | private FileUtils() { 18 | } 19 | 20 | public static String readAsString(String path) { 21 | try { 22 | return Files.lines(Paths.get(path), Charset.forName("UTF-8")).collect(Collectors.joining("\n")); 23 | } catch (Exception e) { 24 | Logger.error("Error occurs on reading content of {}", path, e); 25 | } 26 | return ""; 27 | } 28 | 29 | public static byte[] readAllBytes(String path) { 30 | try { 31 | return Files.readAllBytes(Paths.get(path)); 32 | } catch (IOException e) { 33 | Logger.error("Error occurs on reading byte of {}", path, e); 34 | } 35 | return new byte[0]; 36 | } 37 | 38 | public static byte[] getBytes(String string) { 39 | try { 40 | return string.getBytes("UTF-8"); 41 | } catch (UnsupportedEncodingException e) { 42 | Logger.error("Error occurs on get bytes of {}", string, e); 43 | } 44 | return new byte[0]; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/resources/tinylog.properties: -------------------------------------------------------------------------------- 1 | tinylog.writer1 = console 2 | tinylog.writer1.level = info 3 | tinylog.writer1.format = {date} {level} {class_name}.{method}:{line} {message} 4 | 5 | tinylog.writer2 = file 6 | tinylog.writer2.filename = ${user.home}/markdown-preview-sync.log 7 | tinylog.writer2.level = info 8 | tinylog.writer2.format = {date} {level} {class_name}.{method}:{line} {message} 9 | -------------------------------------------------------------------------------- /src/main/webapp/css/github.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | github.com style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | color: #333; 12 | background: #f8f8f8; 13 | } 14 | 15 | .hljs-comment, 16 | .hljs-quote { 17 | color: #998; 18 | font-style: italic; 19 | } 20 | 21 | .hljs-keyword, 22 | .hljs-selector-tag, 23 | .hljs-subst { 24 | color: #333; 25 | font-weight: bold; 26 | } 27 | 28 | .hljs-number, 29 | .hljs-literal, 30 | .hljs-variable, 31 | .hljs-template-variable, 32 | .hljs-tag .hljs-attr { 33 | color: #008080; 34 | } 35 | 36 | .hljs-string, 37 | .hljs-doctag { 38 | color: #d14; 39 | } 40 | 41 | .hljs-title, 42 | .hljs-section, 43 | .hljs-selector-id { 44 | color: #900; 45 | font-weight: bold; 46 | } 47 | 48 | .hljs-subst { 49 | font-weight: normal; 50 | } 51 | 52 | .hljs-type, 53 | .hljs-class .hljs-title { 54 | color: #458; 55 | font-weight: bold; 56 | } 57 | 58 | .hljs-tag, 59 | .hljs-name, 60 | .hljs-attribute { 61 | color: #000080; 62 | font-weight: normal; 63 | } 64 | 65 | .hljs-regexp, 66 | .hljs-link { 67 | color: #009926; 68 | } 69 | 70 | .hljs-symbol, 71 | .hljs-bullet { 72 | color: #990073; 73 | } 74 | 75 | .hljs-built_in, 76 | .hljs-builtin-name { 77 | color: #0086b3; 78 | } 79 | 80 | .hljs-meta { 81 | color: #999; 82 | font-weight: bold; 83 | } 84 | 85 | .hljs-deletion { 86 | background: #fdd; 87 | } 88 | 89 | .hljs-addition { 90 | background: #dfd; 91 | } 92 | 93 | .hljs-emphasis { 94 | font-style: italic; 95 | } 96 | 97 | .hljs-strong { 98 | font-weight: bold; 99 | } 100 | -------------------------------------------------------------------------------- /src/main/webapp/css/index.css: -------------------------------------------------------------------------------- 1 | #toc_container { 2 | position: fixed; 3 | top: 0; 4 | bottom: 0; 5 | left: 0; 6 | width: 200px; 7 | height: 100%; 8 | overflow-y: auto; 9 | overflow-x: hidden; 10 | } 11 | 12 | #toc { 13 | list-style: none !important; 14 | margin: 0 !important; 15 | padding: 0 !important; 16 | } 17 | 18 | #toc a { 19 | font-size: 12px !important; 20 | color: #1b1f23; 21 | font-weight: normal !important; 22 | font-style: normal !important; 23 | text-transform: none !important; 24 | display: block !important; 25 | text-decoration: none !important; 26 | background: none !important; 27 | border: 0 !important; 28 | padding: 5px !important; 29 | } -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - stable 4 | sudo: false 5 | script: 6 | - npm install 7 | - npm test 8 | branches: 9 | only: 10 | - /^\d+\.\d+/ 11 | deploy: 12 | provider: npm 13 | email: manager@mathjax.org 14 | api_key: 15 | secure: TUDca8/Hk1h6GUqVwIjVXcVK4PUBUSfzXWumuq4PDcV6olmaaNFfcVBIdB3QC6dyTyY/ECDBnio+QdtVWmnaPvbbM/LdJeFrMgZzuCRHLMWjNH7+5B8GAiOJse2tKiJ+FUbqUQo6B5+dA+AH2spl6UdJWDV3ZvgWqExxR6gUC/nLDYEl0kF8UuLSe+PANaYkoUjldPvrgf16axRuRGfid+pCY456OUi251GxUXI5PXKYYPj1c7nLPllewxQZqJE588OcVaX4YflV8LDjBKuAqd4w0qHf0/CkKgl7b7zRYIz4BYbX4DXqHAazpKZqQkVQ6kDfFCg0yd+FKBZE3FHJTGTMm7Q4vlEdmww1sC3kT50kwUQNgs2r75pcwvmIrPylXo29mwFav1yKJJ1GiwX0OvgW3am4Ir/hcbz+KR2hiD1TCa659XRKrb7dT++M4j2YTLcq4UnUFmerVc264QyfZfpFJlxitXh8QS23yIlh8mFRpRkxYqyqAGUvd869vJX5lx2w08l4JdrhW2ant3Z02hCsMfhpYT8LyVlSH/Pt1TeYMYM+Xx5FCqX27Esyk4GlFaIYdOWS7npDfoJcHKkeqpaBIGh4MR4zWofVNrbeoNDUm+ZVT98BOZXgTyXqRRrnyCYGa0PApAzJkcBb5pVXGSH8iydOm/Ti/Z9F4S6AhWU= 16 | on: 17 | tags: true 18 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/extensions/AssistiveMML.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/extensions/AssistiveMML.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a,e,b,f){var c=b.config.menuSettings;var d=MathJax.Extension.AssistiveMML={version:"2.7.4",config:b.CombineConfig("AssistiveMML",{disabled:false,styles:{".MJX_Assistive_MathML":{position:"absolute!important",top:0,left:0,clip:(b.Browser.isMSIE&&(document.documentMode||0)<8?"rect(1px 1px 1px 1px)":"rect(1px, 1px, 1px, 1px)"),padding:"1px 0 0 0!important",border:"0!important",height:"1px!important",width:"1px!important",overflow:"hidden!important",display:"block!important","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"},".MJX_Assistive_MathML.MJX_Assistive_MathML_Block":{width:"100%!important"}}}),Config:function(){if(!this.config.disabled&&c.assistiveMML==null){b.Config({menuSettings:{assistiveMML:true}})}a.Styles(this.config.styles);b.Register.MessageHook("End Math",function(g){if(c.assistiveMML){return d.AddAssistiveMathML(g[1])}})},AddAssistiveMathML:function(g){var h={jax:b.getAllJax(g),i:0,callback:MathJax.Callback({})};this.HandleMML(h);return h.callback},RemoveAssistiveMathML:function(k){var h=b.getAllJax(k),l;for(var j=0,g=h.length;j/g,"")}catch(k){if(!k.restart){throw k}return MathJax.Callback.After(["HandleMML",this,l],k.restart)}n.setAttribute("data-mathml",i);j=f.addElement(n,"span",{isMathJax:true,unselectable:"on",className:"MJX_Assistive_MathML"+(h.root.Get("display")==="block"?" MJX_Assistive_MathML_Block":"")});try{j.innerHTML=i}catch(k){}n.style.position="relative";n.setAttribute("role","presentation");n.firstChild.setAttribute("aria-hidden","true");j.setAttribute("role","presentation")}l.i++}l.callback()}};b.Startup.signal.Post("AssistiveMML Ready")})(MathJax.Ajax,MathJax.Callback,MathJax.Hub,MathJax.HTML);MathJax.Callback.Queue(["Require",MathJax.Ajax,"[MathJax]/extensions/toMathML.js"],["loadComplete",MathJax.Ajax,"[MathJax]/extensions/AssistiveMML.js"],function(){MathJax.Hub.Register.StartupHook("End Config",["Config",MathJax.Extension.AssistiveMML])}); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/extensions/fast-preview.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/extensions/fast-preview.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(b,g,f){var c=b.config.menuSettings;var e=MathJax.OutputJax;var a=f.isMSIE&&(document.documentMode||0)<8;var d=MathJax.Extension["fast-preview"]={version:"2.7.4",enabled:true,config:b.CombineConfig("fast-preview",{Chunks:{EqnChunk:10000,EqnChunkFactor:1,EqnChunkDelay:0},color:"inherit!important",updateTime:30,updateDelay:6,messageStyle:"none",disabled:f.isMSIE&&!f.versionAtLeast("8.0")}),Config:function(){if(b.config["CHTML-preview"]){MathJax.Hub.Config({"fast-preview":b.config["CHTML-preview"]})}var m,j,k,h,l;var i=this.config;if(!i.disabled&&c.FastPreview==null){b.Config({menuSettings:{FastPreview:true}})}if(c.FastPreview){MathJax.Ajax.Styles({".MathJax_Preview .MJXf-math":{color:i.color}});b.Config({"HTML-CSS":i.Chunks,CommonHTML:i.Chunks,SVG:i.Chunks})}b.Register.MessageHook("Begin Math Output",function(){if(!h&&d.Active()){m=b.processUpdateTime;j=b.processUpdateDelay;k=b.config.messageStyle;b.processUpdateTime=i.updateTime;b.processUpdateDelay=i.updateDelay;b.Config({messageStyle:i.messageStyle});MathJax.Message.Clear(0,0);l=true}});b.Register.MessageHook("End Math Output",function(){if(!h&&l){b.processUpdateTime=m;b.processUpdateDelay=j;b.Config({messageStyle:k});h=true}})},Disable:function(){this.enabled=false},Enable:function(){this.enabled=true},Active:function(){return c.FastPreview&&this.enabled&&!(e[c.renderer]||{}).noFastPreview},Preview:function(h){if(!this.Active()||!h.script.parentNode){return}var i=h.script.MathJax.preview||h.script.previousSibling;if(!i||i.className!==MathJax.Hub.config.preRemoveClass){i=g.Element("span",{className:MathJax.Hub.config.preRemoveClass});h.script.parentNode.insertBefore(i,h.script);h.script.MathJax.preview=i}i.innerHTML="";i.style.color=(a?"black":"inherit");return this.postFilter(i,h)},postFilter:function(j,i){if(!i.math.root.toPreviewHTML){var h=MathJax.Callback.Queue();h.Push(["Require",MathJax.Ajax,"[MathJax]/jax/output/PreviewHTML/config.js"],["Require",MathJax.Ajax,"[MathJax]/jax/output/PreviewHTML/jax.js"]);b.RestartAfter(h.Push({}))}i.math.root.toPreviewHTML(j)},Register:function(h){b.Register.StartupHook(h+" Jax Require",function(){var i=MathJax.InputJax[h];i.postfilterHooks.Add(["Preview",MathJax.Extension["fast-preview"]],50)})}};d.Register("TeX");d.Register("MathML");d.Register("AsciiMath");b.Register.StartupHook("End Config",["Config",d]);b.Startup.signal.Post("fast-preview Ready")})(MathJax.Hub,MathJax.HTML,MathJax.Hub.Browser);MathJax.Ajax.loadComplete("[MathJax]/extensions/fast-preview.js"); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/Arrows.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/Arrows.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{infix:{"\u219A":c.RELACCENT,"\u219B":c.RELACCENT,"\u219C":c.WIDEREL,"\u219D":c.WIDEREL,"\u219E":c.WIDEREL,"\u219F":c.WIDEREL,"\u21A0":c.WIDEREL,"\u21A1":c.RELSTRETCH,"\u21A2":c.WIDEREL,"\u21A3":c.WIDEREL,"\u21A4":c.WIDEREL,"\u21A5":c.RELSTRETCH,"\u21A7":c.RELSTRETCH,"\u21A8":c.RELSTRETCH,"\u21AB":c.WIDEREL,"\u21AC":c.WIDEREL,"\u21AD":c.WIDEREL,"\u21AE":c.RELACCENT,"\u21AF":c.RELSTRETCH,"\u21B0":c.RELSTRETCH,"\u21B1":c.RELSTRETCH,"\u21B2":c.RELSTRETCH,"\u21B3":c.RELSTRETCH,"\u21B4":c.RELSTRETCH,"\u21B5":c.RELSTRETCH,"\u21B6":c.RELACCENT,"\u21B7":c.RELACCENT,"\u21B8":c.REL,"\u21B9":c.WIDEREL,"\u21BA":c.REL,"\u21BB":c.REL,"\u21BE":c.RELSTRETCH,"\u21BF":c.RELSTRETCH,"\u21C2":c.RELSTRETCH,"\u21C3":c.RELSTRETCH,"\u21C4":c.WIDEREL,"\u21C5":c.RELSTRETCH,"\u21C6":c.WIDEREL,"\u21C7":c.WIDEREL,"\u21C8":c.RELSTRETCH,"\u21C9":c.WIDEREL,"\u21CA":c.RELSTRETCH,"\u21CB":c.WIDEREL,"\u21CD":c.RELACCENT,"\u21CE":c.RELACCENT,"\u21CF":c.RELACCENT,"\u21D6":c.RELSTRETCH,"\u21D7":c.RELSTRETCH,"\u21D8":c.RELSTRETCH,"\u21D9":c.RELSTRETCH,"\u21DA":c.WIDEREL,"\u21DB":c.WIDEREL,"\u21DC":c.WIDEREL,"\u21DD":c.WIDEREL,"\u21DE":c.REL,"\u21DF":c.REL,"\u21E0":c.WIDEREL,"\u21E1":c.RELSTRETCH,"\u21E2":c.WIDEREL,"\u21E3":c.RELSTRETCH,"\u21E4":c.WIDEREL,"\u21E5":c.WIDEREL,"\u21E6":c.WIDEREL,"\u21E7":c.RELSTRETCH,"\u21E8":c.WIDEREL,"\u21E9":c.RELSTRETCH,"\u21EA":c.RELSTRETCH,"\u21EB":c.RELSTRETCH,"\u21EC":c.RELSTRETCH,"\u21ED":c.RELSTRETCH,"\u21EE":c.RELSTRETCH,"\u21EF":c.RELSTRETCH,"\u21F0":c.WIDEREL,"\u21F1":c.REL,"\u21F2":c.REL,"\u21F3":c.RELSTRETCH,"\u21F4":c.RELACCENT,"\u21F5":c.RELSTRETCH,"\u21F6":c.WIDEREL,"\u21F7":c.RELACCENT,"\u21F8":c.RELACCENT,"\u21F9":c.RELACCENT,"\u21FA":c.RELACCENT,"\u21FB":c.RELACCENT,"\u21FC":c.RELACCENT,"\u21FD":c.WIDEREL,"\u21FE":c.WIDEREL,"\u21FF":c.WIDEREL}}});MathJax.Ajax.loadComplete(a.optableDir+"/Arrows.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/BasicLatin.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/BasicLatin.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{prefix:{"||":[0,0,b.BIN,{fence:true,stretchy:true,symmetric:true}],"|||":[0,0,b.ORD,{fence:true,stretchy:true,symmetric:true}]},postfix:{"!!":[1,0,b.BIN],"'":c.ACCENT,"++":[0,0,b.BIN],"--":[0,0,b.BIN],"..":[0,0,b.BIN],"...":c.ORD,"||":[0,0,b.BIN,{fence:true,stretchy:true,symmetric:true}],"|||":[0,0,b.ORD,{fence:true,stretchy:true,symmetric:true}]},infix:{"!=":c.BIN4,"&&":c.BIN4,"**":[1,1,b.BIN],"*=":c.BIN4,"+=":c.BIN4,"-=":c.BIN4,"->":c.BIN5,"//":[1,1,b.BIN],"/=":c.BIN4,":=":c.BIN4,"<=":c.BIN5,"<>":[1,1,b.BIN],"==":c.BIN4,">=":c.BIN5,"@":c.ORD11,"||":[2,2,b.BIN,{fence:true,stretchy:true,symmetric:true}],"|||":[2,2,b.ORD,{fence:true,stretchy:true,symmetric:true}]}}});MathJax.Ajax.loadComplete(a.optableDir+"/BasicLatin.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/CombDiacritMarks.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/CombDiacritMarks.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{postfix:{"\u0311":c.ACCENT}}});MathJax.Ajax.loadComplete(a.optableDir+"/CombDiacritMarks.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/CombDiactForSymbols.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/CombDiactForSymbols.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{postfix:{"\u20DB":c.ACCENT,"\u20DC":c.ACCENT}}});MathJax.Ajax.loadComplete(a.optableDir+"/CombDiactForSymbols.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/Dingbats.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/Dingbats.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{prefix:{"\u2772":c.OPEN},postfix:{"\u2773":c.CLOSE}}});MathJax.Ajax.loadComplete(a.optableDir+"/Dingbats.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/GeneralPunctuation.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/GeneralPunctuation.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{prefix:{"\u2016":[0,0,b.ORD,{fence:true,stretchy:true}],"\u2018":[0,0,b.OPEN,{fence:true}],"\u201C":[0,0,b.OPEN,{fence:true}]},postfix:{"\u2016":[0,0,b.ORD,{fence:true,stretchy:true}],"\u2019":[0,0,b.CLOSE,{fence:true}],"\u201D":[0,0,b.CLOSE,{fence:true}]}}});MathJax.Ajax.loadComplete(a.optableDir+"/GeneralPunctuation.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/GeometricShapes.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/GeometricShapes.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{infix:{"\u25A0":c.BIN3,"\u25A1":c.BIN3,"\u25AA":c.BIN3,"\u25AB":c.BIN3,"\u25AD":c.BIN3,"\u25AE":c.BIN3,"\u25AF":c.BIN3,"\u25B0":c.BIN3,"\u25B1":c.BIN3,"\u25B2":c.BIN4,"\u25B4":c.BIN4,"\u25B6":c.BIN4,"\u25B7":c.BIN4,"\u25B8":c.BIN4,"\u25BC":c.BIN4,"\u25BE":c.BIN4,"\u25C0":c.BIN4,"\u25C1":c.BIN4,"\u25C2":c.BIN4,"\u25C4":c.BIN4,"\u25C5":c.BIN4,"\u25C6":c.BIN4,"\u25C7":c.BIN4,"\u25C8":c.BIN4,"\u25C9":c.BIN4,"\u25CC":c.BIN4,"\u25CD":c.BIN4,"\u25CE":c.BIN4,"\u25CF":c.BIN4,"\u25D6":c.BIN4,"\u25D7":c.BIN4,"\u25E6":c.BIN4}}});MathJax.Ajax.loadComplete(a.optableDir+"/GeometricShapes.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/GreekAndCoptic.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/GreekAndCoptic.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{infix:{"\u03F6":c.REL}}});MathJax.Ajax.loadComplete(a.optableDir+"/GreekAndCoptic.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/Latin1Supplement.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/Latin1Supplement.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{postfix:{"\u00B0":c.ORD,"\u00B4":c.ACCENT,"\u00B8":c.ACCENT}}});MathJax.Ajax.loadComplete(a.optableDir+"/Latin1Supplement.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/LetterlikeSymbols.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/LetterlikeSymbols.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{prefix:{"\u2145":c.ORD21,"\u2146":[2,0,b.ORD]}}});MathJax.Ajax.loadComplete(a.optableDir+"/LetterlikeSymbols.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/MathOperators.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/MathOperators.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{prefix:{"\u2204":c.ORD21,"\u221B":c.ORD11,"\u221C":c.ORD11,"\u2221":c.ORD,"\u2222":c.ORD,"\u222C":c.INTEGRAL,"\u222D":c.INTEGRAL,"\u222F":c.INTEGRAL,"\u2230":c.INTEGRAL,"\u2231":c.INTEGRAL,"\u2232":c.INTEGRAL,"\u2233":c.INTEGRAL},infix:{"\u2201":[1,2,b.ORD],"\u2206":c.BIN3,"\u220A":c.REL,"\u220C":c.REL,"\u220D":c.REL,"\u220E":c.BIN3,"\u2214":c.BIN4,"\u221F":c.REL,"\u2224":c.REL,"\u2226":c.REL,"\u2234":c.REL,"\u2235":c.REL,"\u2236":c.REL,"\u2237":c.REL,"\u2238":c.BIN4,"\u2239":c.REL,"\u223A":c.BIN4,"\u223B":c.REL,"\u223D":c.REL,"\u223D\u0331":c.BIN3,"\u223E":c.REL,"\u223F":c.BIN3,"\u2241":c.REL,"\u2242":c.REL,"\u2242\u0338":c.REL,"\u2244":c.REL,"\u2246":c.REL,"\u2247":c.REL,"\u2249":c.REL,"\u224A":c.REL,"\u224B":c.REL,"\u224C":c.REL,"\u224E":c.REL,"\u224E\u0338":c.REL,"\u224F":c.REL,"\u224F\u0338":c.REL,"\u2251":c.REL,"\u2252":c.REL,"\u2253":c.REL,"\u2254":c.REL,"\u2255":c.REL,"\u2256":c.REL,"\u2257":c.REL,"\u2258":c.REL,"\u2259":c.REL,"\u225A":c.REL,"\u225C":c.REL,"\u225D":c.REL,"\u225E":c.REL,"\u225F":c.REL,"\u2262":c.REL,"\u2263":c.REL,"\u2266":c.REL,"\u2266\u0338":c.REL,"\u2267":c.REL,"\u2268":c.REL,"\u2269":c.REL,"\u226A\u0338":c.REL,"\u226B\u0338":c.REL,"\u226C":c.REL,"\u226D":c.REL,"\u226E":c.REL,"\u226F":c.REL,"\u2270":c.REL,"\u2271":c.REL,"\u2272":c.REL,"\u2273":c.REL,"\u2274":c.REL,"\u2275":c.REL,"\u2276":c.REL,"\u2277":c.REL,"\u2278":c.REL,"\u2279":c.REL,"\u227C":c.REL,"\u227D":c.REL,"\u227E":c.REL,"\u227F":c.REL,"\u227F\u0338":c.REL,"\u2280":c.REL,"\u2281":c.REL,"\u2282\u20D2":c.REL,"\u2283\u20D2":c.REL,"\u2284":c.REL,"\u2285":c.REL,"\u2288":c.REL,"\u2289":c.REL,"\u228A":c.REL,"\u228B":c.REL,"\u228C":c.BIN4,"\u228D":c.BIN4,"\u228F":c.REL,"\u228F\u0338":c.REL,"\u2290":c.REL,"\u2290\u0338":c.REL,"\u229A":c.BIN4,"\u229B":c.BIN4,"\u229C":c.BIN4,"\u229D":c.BIN4,"\u229E":c.BIN4,"\u229F":c.BIN4,"\u22A0":c.BIN4,"\u22A1":c.BIN4,"\u22A6":c.REL,"\u22A7":c.REL,"\u22A9":c.REL,"\u22AA":c.REL,"\u22AB":c.REL,"\u22AC":c.REL,"\u22AD":c.REL,"\u22AE":c.REL,"\u22AF":c.REL,"\u22B0":c.REL,"\u22B1":c.REL,"\u22B2":c.REL,"\u22B3":c.REL,"\u22B4":c.REL,"\u22B5":c.REL,"\u22B6":c.REL,"\u22B7":c.REL,"\u22B8":c.REL,"\u22B9":c.REL,"\u22BA":c.BIN4,"\u22BB":c.BIN4,"\u22BC":c.BIN4,"\u22BD":c.BIN4,"\u22BE":c.BIN3,"\u22BF":c.BIN3,"\u22C7":c.BIN4,"\u22C9":c.BIN4,"\u22CA":c.BIN4,"\u22CB":c.BIN4,"\u22CC":c.BIN4,"\u22CD":c.REL,"\u22CE":c.BIN4,"\u22CF":c.BIN4,"\u22D0":c.REL,"\u22D1":c.REL,"\u22D2":c.BIN4,"\u22D3":c.BIN4,"\u22D4":c.REL,"\u22D5":c.REL,"\u22D6":c.REL,"\u22D7":c.REL,"\u22D8":c.REL,"\u22D9":c.REL,"\u22DA":c.REL,"\u22DB":c.REL,"\u22DC":c.REL,"\u22DD":c.REL,"\u22DE":c.REL,"\u22DF":c.REL,"\u22E0":c.REL,"\u22E1":c.REL,"\u22E2":c.REL,"\u22E3":c.REL,"\u22E4":c.REL,"\u22E5":c.REL,"\u22E6":c.REL,"\u22E7":c.REL,"\u22E8":c.REL,"\u22E9":c.REL,"\u22EA":c.REL,"\u22EB":c.REL,"\u22EC":c.REL,"\u22ED":c.REL,"\u22F0":c.REL,"\u22F2":c.REL,"\u22F3":c.REL,"\u22F4":c.REL,"\u22F5":c.REL,"\u22F6":c.REL,"\u22F7":c.REL,"\u22F8":c.REL,"\u22F9":c.REL,"\u22FA":c.REL,"\u22FB":c.REL,"\u22FC":c.REL,"\u22FD":c.REL,"\u22FE":c.REL,"\u22FF":c.REL}}});MathJax.Ajax.loadComplete(a.optableDir+"/MathOperators.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/MiscMathSymbolsA.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/MiscMathSymbolsA.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{prefix:{"\u27E6":c.OPEN,"\u27EA":c.OPEN,"\u27EC":c.OPEN},postfix:{"\u27E7":c.CLOSE,"\u27EB":c.CLOSE,"\u27ED":c.CLOSE}}});MathJax.Ajax.loadComplete(a.optableDir+"/MiscMathSymbolsA.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/MiscMathSymbolsB.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/MiscMathSymbolsB.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{prefix:{"\u2980":[0,0,b.ORD,{fence:true,stretchy:true}],"\u2983":c.OPEN,"\u2985":c.OPEN,"\u2987":c.OPEN,"\u2989":c.OPEN,"\u298B":c.OPEN,"\u298D":c.OPEN,"\u298F":c.OPEN,"\u2991":c.OPEN,"\u2993":c.OPEN,"\u2995":c.OPEN,"\u2997":c.OPEN,"\u29FC":c.OPEN},postfix:{"\u2980":[0,0,b.ORD,{fence:true,stretchy:true}],"\u2984":c.CLOSE,"\u2986":c.CLOSE,"\u2988":c.CLOSE,"\u298A":c.CLOSE,"\u298C":c.CLOSE,"\u298E":c.CLOSE,"\u2990":c.CLOSE,"\u2992":c.CLOSE,"\u2994":c.CLOSE,"\u2996":c.CLOSE,"\u2998":c.CLOSE,"\u29FD":c.CLOSE},infix:{"\u2981":c.BIN3,"\u2982":c.BIN3,"\u2999":c.BIN3,"\u299A":c.BIN3,"\u299B":c.BIN3,"\u299C":c.BIN3,"\u299D":c.BIN3,"\u299E":c.BIN3,"\u299F":c.BIN3,"\u29A0":c.BIN3,"\u29A1":c.BIN3,"\u29A2":c.BIN3,"\u29A3":c.BIN3,"\u29A4":c.BIN3,"\u29A5":c.BIN3,"\u29A6":c.BIN3,"\u29A7":c.BIN3,"\u29A8":c.BIN3,"\u29A9":c.BIN3,"\u29AA":c.BIN3,"\u29AB":c.BIN3,"\u29AC":c.BIN3,"\u29AD":c.BIN3,"\u29AE":c.BIN3,"\u29AF":c.BIN3,"\u29B0":c.BIN3,"\u29B1":c.BIN3,"\u29B2":c.BIN3,"\u29B3":c.BIN3,"\u29B4":c.BIN3,"\u29B5":c.BIN3,"\u29B6":c.BIN4,"\u29B7":c.BIN4,"\u29B8":c.BIN4,"\u29B9":c.BIN4,"\u29BA":c.BIN4,"\u29BB":c.BIN4,"\u29BC":c.BIN4,"\u29BD":c.BIN4,"\u29BE":c.BIN4,"\u29BF":c.BIN4,"\u29C0":c.REL,"\u29C1":c.REL,"\u29C2":c.BIN3,"\u29C3":c.BIN3,"\u29C4":c.BIN4,"\u29C5":c.BIN4,"\u29C6":c.BIN4,"\u29C7":c.BIN4,"\u29C8":c.BIN4,"\u29C9":c.BIN3,"\u29CA":c.BIN3,"\u29CB":c.BIN3,"\u29CC":c.BIN3,"\u29CD":c.BIN3,"\u29CE":c.REL,"\u29CF":c.REL,"\u29CF\u0338":c.REL,"\u29D0":c.REL,"\u29D0\u0338":c.REL,"\u29D1":c.REL,"\u29D2":c.REL,"\u29D3":c.REL,"\u29D4":c.REL,"\u29D5":c.REL,"\u29D6":c.BIN4,"\u29D7":c.BIN4,"\u29D8":c.BIN3,"\u29D9":c.BIN3,"\u29DB":c.BIN3,"\u29DC":c.BIN3,"\u29DD":c.BIN3,"\u29DE":c.REL,"\u29DF":c.BIN3,"\u29E0":c.BIN3,"\u29E1":c.REL,"\u29E2":c.BIN4,"\u29E3":c.REL,"\u29E4":c.REL,"\u29E5":c.REL,"\u29E6":c.REL,"\u29E7":c.BIN3,"\u29E8":c.BIN3,"\u29E9":c.BIN3,"\u29EA":c.BIN3,"\u29EB":c.BIN3,"\u29EC":c.BIN3,"\u29ED":c.BIN3,"\u29EE":c.BIN3,"\u29EF":c.BIN3,"\u29F0":c.BIN3,"\u29F1":c.BIN3,"\u29F2":c.BIN3,"\u29F3":c.BIN3,"\u29F4":c.REL,"\u29F5":c.BIN4,"\u29F6":c.BIN4,"\u29F7":c.BIN4,"\u29F8":c.BIN3,"\u29F9":c.BIN3,"\u29FA":c.BIN3,"\u29FB":c.BIN3,"\u29FE":c.BIN4,"\u29FF":c.BIN4}}});MathJax.Ajax.loadComplete(a.optableDir+"/MiscMathSymbolsB.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/MiscSymbolsAndArrows.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/MiscSymbolsAndArrows.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{infix:{"\u2B45":c.RELSTRETCH,"\u2B46":c.RELSTRETCH}}});MathJax.Ajax.loadComplete(a.optableDir+"/MiscSymbolsAndArrows.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/MiscTechnical.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/MiscTechnical.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{postfix:{"\u23B4":c.WIDEACCENT,"\u23B5":c.WIDEACCENT,"\u23DC":c.WIDEACCENT,"\u23DD":c.WIDEACCENT,"\u23E0":c.WIDEACCENT,"\u23E1":c.WIDEACCENT}}});MathJax.Ajax.loadComplete(a.optableDir+"/MiscTechnical.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/SpacingModLetters.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/SpacingModLetters.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{postfix:{"\u02CD":c.WIDEACCENT,"\u02DA":c.ACCENT,"\u02DD":c.ACCENT,"\u02F7":c.WIDEACCENT}}});MathJax.Ajax.loadComplete(a.optableDir+"/SpacingModLetters.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/SupplementalArrowsA.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/SupplementalArrowsA.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{infix:{"\u27F0":c.RELSTRETCH,"\u27F1":c.RELSTRETCH,"\u27FB":c.WIDEREL,"\u27FD":c.WIDEREL,"\u27FE":c.WIDEREL,"\u27FF":c.WIDEREL}}});MathJax.Ajax.loadComplete(a.optableDir+"/SupplementalArrowsA.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/element/mml/optable/SupplementalArrowsB.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/element/mml/optable/SupplementalArrowsB.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a){var c=a.mo.OPTYPES;var b=a.TEXCLASS;MathJax.Hub.Insert(a.mo.prototype,{OPTABLE:{infix:{"\u2900":c.RELACCENT,"\u2901":c.RELACCENT,"\u2902":c.RELACCENT,"\u2903":c.RELACCENT,"\u2904":c.RELACCENT,"\u2905":c.RELACCENT,"\u2906":c.RELACCENT,"\u2907":c.RELACCENT,"\u2908":c.REL,"\u2909":c.REL,"\u290A":c.RELSTRETCH,"\u290B":c.RELSTRETCH,"\u290C":c.WIDEREL,"\u290D":c.WIDEREL,"\u290E":c.WIDEREL,"\u290F":c.WIDEREL,"\u2910":c.WIDEREL,"\u2911":c.RELACCENT,"\u2912":c.RELSTRETCH,"\u2913":c.RELSTRETCH,"\u2914":c.RELACCENT,"\u2915":c.RELACCENT,"\u2916":c.RELACCENT,"\u2917":c.RELACCENT,"\u2918":c.RELACCENT,"\u2919":c.RELACCENT,"\u291A":c.RELACCENT,"\u291B":c.RELACCENT,"\u291C":c.RELACCENT,"\u291D":c.RELACCENT,"\u291E":c.RELACCENT,"\u291F":c.RELACCENT,"\u2920":c.RELACCENT,"\u2921":c.RELSTRETCH,"\u2922":c.RELSTRETCH,"\u2923":c.REL,"\u2924":c.REL,"\u2925":c.REL,"\u2926":c.REL,"\u2927":c.REL,"\u2928":c.REL,"\u2929":c.REL,"\u292A":c.REL,"\u292B":c.REL,"\u292C":c.REL,"\u292D":c.REL,"\u292E":c.REL,"\u292F":c.REL,"\u2930":c.REL,"\u2931":c.REL,"\u2932":c.REL,"\u2933":c.RELACCENT,"\u2934":c.REL,"\u2935":c.REL,"\u2936":c.REL,"\u2937":c.REL,"\u2938":c.REL,"\u2939":c.REL,"\u293A":c.RELACCENT,"\u293B":c.RELACCENT,"\u293C":c.RELACCENT,"\u293D":c.RELACCENT,"\u293E":c.REL,"\u293F":c.REL,"\u2940":c.REL,"\u2941":c.REL,"\u2942":c.RELACCENT,"\u2943":c.RELACCENT,"\u2944":c.RELACCENT,"\u2945":c.RELACCENT,"\u2946":c.RELACCENT,"\u2947":c.RELACCENT,"\u2948":c.RELACCENT,"\u2949":c.REL,"\u294A":c.RELACCENT,"\u294B":c.RELACCENT,"\u294C":c.REL,"\u294D":c.REL,"\u294E":c.WIDEREL,"\u294F":c.RELSTRETCH,"\u2950":c.WIDEREL,"\u2951":c.RELSTRETCH,"\u2952":c.WIDEREL,"\u2953":c.WIDEREL,"\u2954":c.RELSTRETCH,"\u2955":c.RELSTRETCH,"\u2956":c.RELSTRETCH,"\u2957":c.RELSTRETCH,"\u2958":c.RELSTRETCH,"\u2959":c.RELSTRETCH,"\u295A":c.WIDEREL,"\u295B":c.WIDEREL,"\u295C":c.RELSTRETCH,"\u295D":c.RELSTRETCH,"\u295E":c.WIDEREL,"\u295F":c.WIDEREL,"\u2960":c.RELSTRETCH,"\u2961":c.RELSTRETCH,"\u2962":c.RELACCENT,"\u2963":c.REL,"\u2964":c.RELACCENT,"\u2965":c.REL,"\u2966":c.RELACCENT,"\u2967":c.RELACCENT,"\u2968":c.RELACCENT,"\u2969":c.RELACCENT,"\u296A":c.RELACCENT,"\u296B":c.RELACCENT,"\u296C":c.RELACCENT,"\u296D":c.RELACCENT,"\u296E":c.RELSTRETCH,"\u296F":c.RELSTRETCH,"\u2970":c.RELACCENT,"\u2971":c.RELACCENT,"\u2972":c.RELACCENT,"\u2973":c.RELACCENT,"\u2974":c.RELACCENT,"\u2975":c.RELACCENT,"\u2976":c.RELACCENT,"\u2977":c.RELACCENT,"\u2978":c.RELACCENT,"\u2979":c.RELACCENT,"\u297A":c.RELACCENT,"\u297B":c.RELACCENT,"\u297C":c.RELACCENT,"\u297D":c.RELACCENT,"\u297E":c.REL,"\u297F":c.REL}}});MathJax.Ajax.loadComplete(a.optableDir+"/SupplementalArrowsB.js")})(MathJax.ElementJax.mml); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/input/TeX/config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/input/TeX/config.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | MathJax.InputJax.TeX=MathJax.InputJax({id:"TeX",version:"2.7.4",directory:MathJax.InputJax.directory+"/TeX",extensionDir:MathJax.InputJax.extensionDir+"/TeX",config:{TagSide:"right",TagIndent:"0.8em",MultLineWidth:"85%",equationNumbers:{autoNumber:"none",formatNumber:function(a){return a},formatTag:function(a){return"("+a+")"},formatID:function(a){return"mjx-eqn-"+String(a).replace(/\s/g,"_")},formatURL:function(b,a){return a+"#"+encodeURIComponent(b)},useLabelIds:true}},resetEquationNumbers:function(){}});MathJax.InputJax.TeX.Register("math/tex");MathJax.InputJax.TeX.loadComplete("config.js"); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/output/CommonHTML/autoload/annotation-xml.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/output/CommonHTML/autoload/annotation-xml.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function(){var c="2.7.4";var a=MathJax.ElementJax.mml,b=MathJax.OutputJax.CommonHTML;a["annotation-xml"].Augment({toCommonHTML:function(e){var d=this.Get("encoding");e=this.CHTMLdefaultNode(e,{childOptions:{encoding:d}});if(this.CHTML.rscale!==1){this.CHTML.rescale(1/this.CHTML.rscale)}return e}});a.xml.Augment({toCommonHTML:function(l,g){var n=this.CHTML=b.BBOX.zero();for(var j=0,d=this.data.length;j=9){delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter}if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax["HTML-CSS"].Register("jax/mml")}MathJax.Hub.Register.StartupHook("End Config",[function(b,c){var a=b.Insert({minBrowserVersion:{Firefox:3,Opera:9.52,MSIE:6,Chrome:0.3,Safari:2,Konqueror:4},inlineMathDelimiters:["$","$"],displayMathDelimiters:["$$","$$"],multilineDisplay:true,minBrowserTranslate:function(f){var e=b.getJaxFor(f),k=["[Math]"],j;var h=document.createElement("span",{className:"MathJax_Preview"});if(e.inputJax==="TeX"){if(e.root.Get("displaystyle")){j=a.displayMathDelimiters;k=[j[0]+e.originalText+j[1]];if(a.multilineDisplay){k=k[0].split(/\n/)}}else{j=a.inlineMathDelimiters;k=[j[0]+e.originalText.replace(/^\s+/,"").replace(/\s+$/,"")+j[1]]}}for(var g=0,d=k.length;g span":{display:"inline-block","text-align":"left"}}}});if(!MathJax.Hub.config.delayJaxRegistration){MathJax.OutputJax.PlainSource.Register("jax/mml")}MathJax.OutputJax.PlainSource.loadComplete("config.js"); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/MathJax/jax/output/PlainSource/jax.js: -------------------------------------------------------------------------------- 1 | /* 2 | * /MathJax/jax/output/PlainSource/jax.js 3 | * 4 | * Copyright (c) 2009-2018 The MathJax Consortium 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | (function(a,b,f,c){var e,g,d;c.Augment({settings:b.config.menuSettings,Config:function(){if(!this.require){this.require=[]}this.SUPER(arguments).Config.call(this);this.require.push(MathJax.OutputJax.extensionDir+"/MathEvents.js")},Startup:function(){e=MathJax.Extension.MathEvents.Event;g=MathJax.Extension.MathEvents.Touch;d=MathJax.Extension.MathEvents.Hover;this.ContextMenu=e.ContextMenu;this.Mousedown=e.AltContextMenu;this.Mouseover=d.Mouseover;this.Mouseout=d.Mouseout;this.Mousemove=d.Mousemove;return a.Styles(this.config.styles)},preTranslate:function(k){var o=k.jax[this.id],p,l=o.length,q,n,r,j,h;for(p=0;p0)&&(i.root.data[0].data[0].type==="semantics")){var o=i.root.data[0].data[0].data;for(var h=0;h0){o+=C;m-=C}}o=Math.max(o,H.superscriptshift);m=Math.max(m,H.subscriptshift);if(e){B.Add(e,l+j.w+y,o)}if(i){B.Add(i,l+L-i.w,o)}if(k){B.Add(k,l+j.w+y-L,-m)}if(n){B.Add(n,l-n.w,-m)}}}B.Clean();this.SVGhandleColor(B);this.SVGsaveData(B);var M=this.SVGdata;M.dx=l;M.s=y;M.u=o,M.v=m;M.delta=L;return B},SVGgetScripts:function(r){var p,d,e=[];var o=1,h=this.data.length,g=0;for(var l=0;l<4;l+=2){while(o element")}}function i(){var q=e();if(q){o(q.src.replace(/\/latest\.js/,"/MathJax.js"))}else{g("Can't determine the URL for loading MathJax")}}function m(q,r,s){var t=j();if(t){t.onreadystatechange=function(){if(t.readyState===4){if(t.status===200){var v=JSON.parse(t.responseText);if(v instanceof Array){v=v[0]}var u=v[q.version];if(u.substr(0,2)==="2."){c(u);o(q.mathjax+v[q.version]+s+"/MathJax.js"+r);return}}else{g("Problem acquiring MathJax version: status = "+t.status)}i()}};t.open("GET",q.api,true);t.send(null)}else{g("Can't create XMLHttpRequest object");i()}}var n=e();var p=a(n);if(p){var b=n.src.replace(/.*?(\?|$)/,"$1");b+=(b?"&":"?")+"latest";var f=(n.src.match(/\/unpacked\/latest\.js/)?"/unpacked":"");var k=d();if(k){o(p.mathjax+k+f+"/MathJax.js"+b)}else{m(p,b,f)}}else{i()}})(); 20 | -------------------------------------------------------------------------------- /src/main/webapp/js/index.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | hljs.initHighlightingOnLoad(); 3 | 4 | var init = function (data) { 5 | $('title').html(data.path); 6 | $('#path').val(data.path); 7 | $('.markdown-body').html(''); 8 | markdown_refresh(data.units); 9 | highlight_code(); 10 | scroll_if_possible(); 11 | }; 12 | 13 | var sync = function (data) { 14 | markdown_refresh(data.units); 15 | highlight_code(); 16 | scroll_if_possible(); 17 | }; 18 | 19 | var markdown_refresh = function (units) { 20 | $.each(units, function (i, u) { 21 | 22 | if (u.operate === 'REPLACE') { 23 | if (u.id === 'toc_container') { 24 | $('.markdown-body').css('padding-left', '200px'); 25 | var toc = $('#' + u.id); 26 | toc.html(u.content); 27 | toc.show(); 28 | } else { 29 | $('#' + u.id).replaceWith(u.content); 30 | } 31 | } else if (u.operate === 'APPEND') { 32 | $('.markdown-body').append(u.content); 33 | } else if (u.operate === 'REMOVE') { 34 | if (u.id === 'toc_container') { 35 | $('.markdown-body').css('padding-left', '45px'); 36 | var cot = $('#' + u.id); 37 | cot.html(''); 38 | cot.hide(); 39 | } else { 40 | $('#' + u.id).remove(); 41 | } 42 | } 43 | 44 | if (u.isMathJax === 1) { 45 | MathJax.Hub.Queue(['Typeset', MathJax.Hub, u.id]); 46 | } 47 | }) 48 | }; 49 | 50 | var close = function () { 51 | window.opener = null; 52 | window.open('', '_self'); 53 | window.close(); 54 | }; 55 | 56 | var highlight_code = function () { 57 | $('pre code').each(function (i, block) { 58 | hljs.highlightBlock(block); 59 | }); 60 | }; 61 | 62 | var scroll_if_possible = function () { 63 | var marker = document.getElementById('_markdown_preview_sync_bottom_marker'); 64 | if (marker !== null) { 65 | marker.scrollIntoView(false); 66 | } 67 | }; 68 | 69 | var url = 'ws://127.0.0.1:' + window.location.port + '/ws'; 70 | if (!WebSocket) { 71 | console.warn('WebSocket is not support'); 72 | } else { 73 | console.log('Try to connect ' + url); 74 | var ws = new WebSocket(url); 75 | ws.onerror = function (e) { 76 | console.error('Error : ' + e.message); 77 | }; 78 | 79 | ws.onopen = function () { 80 | console.log('Connected'); 81 | }; 82 | 83 | ws.onclose = function () { 84 | console.log('Disconnected'); 85 | close(); 86 | }; 87 | 88 | ws.onmessage = function (d) { 89 | console.log('Response : ' + d.data.length); 90 | var data = JSON.parse(d.data); 91 | var path = $('#path'); 92 | if (path.val() === '') { 93 | init(data); 94 | } else { 95 | if (path.val() === data.path) { 96 | if (data.command === 'close') { 97 | close() 98 | } else if (data.command === 'sync') { 99 | sync(data); 100 | } 101 | } 102 | } 103 | }; 104 | } 105 | 106 | 107 | self.mark_line = function (line) { 108 | if (ws !== null) { 109 | ws.send(line); 110 | } else { 111 | console.warn('WebSocket is close'); 112 | } 113 | }; 114 | }); 115 | --------------------------------------------------------------------------------