├── .gitattributes ├── .gitignore ├── README.md ├── css └── style.css ├── img └── editor.png ├── index.html └── js ├── diff.js ├── jquery.js ├── jquery.scrollto.js ├── pagedown-extra.js └── pagedown.js /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | 46 | [Dd]ebug/ 47 | [Rr]elease/ 48 | x64/ 49 | build/ 50 | [Bb]in/ 51 | [Oo]bj/ 52 | 53 | # MSTest test Results 54 | [Tt]est[Rr]esult*/ 55 | [Bb]uild[Ll]og.* 56 | 57 | *_i.c 58 | *_p.c 59 | *.ilk 60 | *.meta 61 | *.obj 62 | *.pch 63 | *.pdb 64 | *.pgc 65 | *.pgd 66 | *.rsp 67 | *.sbr 68 | *.tlb 69 | *.tli 70 | *.tlh 71 | *.tmp 72 | *.tmp_proj 73 | *.log 74 | *.vspscc 75 | *.vssscc 76 | .builds 77 | *.pidb 78 | *.log 79 | *.scc 80 | 81 | # Visual C++ cache files 82 | ipch/ 83 | *.aps 84 | *.ncb 85 | *.opensdf 86 | *.sdf 87 | *.cachefile 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | 101 | # TeamCity is a build add-in 102 | _TeamCity* 103 | 104 | # DotCover is a Code Coverage Tool 105 | *.dotCover 106 | 107 | # NCrunch 108 | *.ncrunch* 109 | .*crunch*.local.xml 110 | 111 | # Installshield output folder 112 | [Ee]xpress/ 113 | 114 | # DocProject is a documentation generator add-in 115 | DocProject/buildhelp/ 116 | DocProject/Help/*.HxT 117 | DocProject/Help/*.HxC 118 | DocProject/Help/*.hhc 119 | DocProject/Help/*.hhk 120 | DocProject/Help/*.hhp 121 | DocProject/Help/Html2 122 | DocProject/Help/html 123 | 124 | # Click-Once directory 125 | publish/ 126 | 127 | # Publish Web Output 128 | *.Publish.xml 129 | *.pubxml 130 | 131 | # NuGet Packages Directory 132 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 133 | #packages/ 134 | 135 | # Windows Azure Build Output 136 | csx 137 | *.build.csdef 138 | 139 | # Windows Store app package directory 140 | AppPackages/ 141 | 142 | # Others 143 | sql/ 144 | *.Cache 145 | ClientBin/ 146 | [Ss]tyle[Cc]op.* 147 | ~$* 148 | *~ 149 | *.dbmdl 150 | *.[Pp]ublish.xml 151 | *.pfx 152 | *.publishsettings 153 | 154 | # RIA/Silverlight projects 155 | Generated_Code/ 156 | 157 | # Backup & report files from converting an old project file to a newer 158 | # Visual Studio version. Backup files are not needed, because we have git ;-) 159 | _UpgradeReport_Files/ 160 | Backup*/ 161 | UpgradeLog*.XML 162 | UpgradeLog*.htm 163 | 164 | # SQL Server files 165 | App_Data/*.mdf 166 | App_Data/*.ldf 167 | 168 | ############# 169 | ## Windows detritus 170 | ############# 171 | 172 | # Windows image file caches 173 | Thumbs.db 174 | ehthumbs.db 175 | 176 | # Folder config file 177 | Desktop.ini 178 | 179 | # Recycle Bin used on file shares 180 | $RECYCLE.BIN/ 181 | 182 | # Mac crap 183 | .DS_Store 184 | 185 | 186 | ############# 187 | ## Python 188 | ############# 189 | 190 | *.py[co] 191 | 192 | # Packages 193 | *.egg 194 | *.egg-info 195 | dist/ 196 | build/ 197 | eggs/ 198 | parts/ 199 | var/ 200 | sdist/ 201 | develop-eggs/ 202 | .installed.cfg 203 | 204 | # Installer logs 205 | pip-log.txt 206 | 207 | # Unit test / coverage reports 208 | .coverage 209 | .tox 210 | 211 | #Translations 212 | *.mo 213 | 214 | #Mr Developer 215 | .mr.developer.cfg 216 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Markdown 说明 2 | 从Typecho中抽离的Markdown编辑器,基于jQuery。 3 | 4 | ## 示例 5 | http://www.zi-han.net/case/markdown/ 6 | -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | body{font-family:"Arial";} 2 | .markdown-editor textarea{resize:vertical;line-height:1.5;} 3 | .markdown-textarea{width:100%;font-family:"Arial";} 4 | .markdown-editor{line-height: 1.5em;} 5 | .md-prompt-dialog p{font-size:12px;color:#999;line-height: 1.2em;} 6 | .md-prompt-dialog b{font-size:12px;color:#333;padding-bottom:6px;display: block;} 7 | .md-prompt-dialog input,.markdown-textarea{background:#FFF;border:1px solid #D9D9D6;padding:10px;border-radius:2px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} 8 | .md-prompt-dialog button{border:none;background-color:#e9e9e6;cursor:pointer;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;display:inline-block;padding:0 12px;height:32px;color:#666;vertical-align:middle;zoom:1;} 9 | .md-prompt-dialog button:hover{-webkit-transition-duration:.4s;-moz-transition-duration:.4s;-o-transition-duration:.4s;transition-duration:.4s;background-color:#dbdbd6;} 10 | .md-prompt-dialog button:active,.md-prompt-dialog button.active{background-color:#d6d6d0;} 11 | .md-prompt-dialog .primary{border:none;background-color:#467b96;cursor:pointer;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;color:#FFF;} 12 | .md-prompt-dialog .primary:hover{-webkit-transition-duration:.4s;-moz-transition-duration:.4s;-o-transition-duration:.4s;transition-duration:.4s;background-color:#3c6a81;} 13 | .md-prompt-dialog .primary:active,.primary.active{background-color:#39647a;} 14 | .md-button-row{list-style:none;margin:0;padding:0;height:26px;line-height:1;} 15 | .md-button-row li{display:inline-block;margin-right:4px;padding:3px;cursor:pointer;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;} 16 | .md-button-row li:hover{background-color:#E9E9E6;} 17 | .md-button-row li.md-spacer{height:20px;margin:0 10px 0 6px;padding:3px 0;width:1px;background:#E9E9E6;cursor:default;} 18 | #md-button-row span{display:block;width:20px;height:20px;background:transparent url(../img/editor.png) no-repeat;} 19 | .md-edittab{float:right;margin-top:3px;font-size:.92857em;} 20 | .md-edittab a{display:inline-block;padding:0 8px;margin-left:5px;height:20px;line-height:20px;} 21 | .md-edittab a:hover{text-decoration:none;} 22 | .md-edittab a.active{background:#E9E9E6;color:#999;} 23 | .md-hidetab{display:none;} 24 | .md-visualhide{visibility:hidden;} 25 | .md-prompt-background{background-color:#000;} 26 | .md-prompt-dialog{position:fixed;z-index:1001;top:50%;left:50%;margin-top:-95px;margin-left:-200px;padding:20px;width:360px;background:#F6F6F3;} 27 | .md-prompt-dialog p{margin:0 0 5px;} 28 | .md-prompt-dialog form{margin-top:10px;} 29 | .md-prompt-dialog input[type="text"]{margin-bottom:10px;width:100%;} 30 | .md-prompt-dialog button{margin-right:10px;} 31 | #md-preview{background:#FFF;margin:1em 0;padding:0 15px;word-wrap:break-word;overflow:auto;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;} 32 | #md-preview img{max-width:100%;} 33 | #md-preview code,#md-preview pre{padding:2px 4px;background:#F3F3F0;font-size:.92857em;} 34 | #md-preview code{color:#B94A48;} 35 | #md-preview pre{padding:1em;} 36 | #md-preview pre code{padding:0;color:#444;} 37 | #md-preview blockquote{margin:1em 1.5em;padding-left:1.5em;border-left:4px solid #E9E9E6;color:#777;} 38 | #md-preview hr{margin:0.5em auto;border:1px solid #E9E9E6;border-width:2px 0 0 0;} 39 | #md-preview .summary:after{display:block;margin:2em 0;background:#FFF9E8;color:#ce9900;font-size:.85714em;text-align:center;content:"- more -";} 40 | .fullscreen #md-button-bar,.fullscreen #text,.fullscreen #md-preview,.fullscreen .submit{position:absolute;top:0;width:50%;background:#FFF;z-index:999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0;} 41 | .fullscreen #md-button-bar{left:0;padding:13px 20px;border-bottom:1px solid #F3F3F0;z-index:1000;} 42 | .fullscreen #text{top:53px;left:0;padding:20px;border:none;outline:none;} 43 | .fullscreen #md-preview{top:52px;right:0;margin:0;padding:5px 20px;border:none;border-left:1px solid #F3F3F0;border-top:1px solid #F3F3F0;background:#F6F6F3;overflow:auto;} 44 | .fullscreen #md-preview code,.fullscreen #md-preview pre{background:#F0F0EC;} 45 | .fullscreen .submit{right:0;margin:0;padding:10px 20px;border-bottom:1px solid #F3F3F0;} 46 | .fullscreen .md-edittab,.fullscreen .typecho-post-option,.fullscreen .title,.fullscreen .url-slug,.fullscreen .typecho-page-title,.fullscreen .typecho-head-nav,.fullscreen .message,.fullscreen #upload-panel{display:none;} 47 | .fullscreen .md-hidetab{display:block;} 48 | .fullscreen .md-visualhide{visibility:visible;} 49 | .md-edittab{float:right;margin-top:3px;font-size:.92857em;} 50 | .md-edittab a{font-size:12px;text-decoration: none;color:#999; display:inline-block;padding:0 8px;margin-left:5px;height:24px;line-height:24px;border-radius: 2px;} 51 | .md-edittab a:hover{text-decoration:none;} 52 | .md-edittab a.active{background:#3c6a81;color:#fff;} 53 | .md-hidetab{display:none;} 54 | .md-visualhide{visibility:hidden;} 55 | .md-prompt-background{background-color:#000;}. 56 | -------------------------------------------------------------------------------- /img/editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Beau-zihan/Markdown/3692215767511bf9286086367942e963fe9f6889/img/editor.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |