v1.0 beta init
This commit is contained in:
1 parent
8ae438272b
commit
593d2c2965
225 files changed
+27217
-3675
No files matched your search
@@ -1,110 +0,0 @@
|
||||
|
||||
#mdEditorPreview {
|
||||
position: absolute;
|
||||
top: 35px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
#left-column, #right-column
|
||||
{
|
||||
height: 100%;
|
||||
}
|
||||
#left-column {
|
||||
width: 60%;
|
||||
}
|
||||
#right-column {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
#right-column {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wmd-panel-editor, .preview-container, #wmd-input {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.wmd-panel-editor, .wmd-panel-preview {
|
||||
}
|
||||
|
||||
.wmd-input, .wmd-input:focus, #md-section-helper /* helper必须在这里 */
|
||||
{
|
||||
width: 100%;
|
||||
border: 1px #eee solid;
|
||||
border-radius: 5px;
|
||||
outline: none;
|
||||
font-size: 14px;
|
||||
resize: none;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
/* 不能为display: none */
|
||||
#md-section-helper {
|
||||
position: absolute;
|
||||
height: 0;
|
||||
overflow-y: scroll;
|
||||
padding: 0 6px;
|
||||
top:10px; /*一条横线....*/
|
||||
z-index: -1;
|
||||
opacity: none;
|
||||
}
|
||||
|
||||
#right-column {
|
||||
border: 1px dashed #BBBBBB;
|
||||
border-radius: 5px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
.preview-container {
|
||||
overflow: auto;
|
||||
|
||||
}
|
||||
|
||||
.wmd-preview {
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
overflow: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.wmd-button-row, .preview-button-row
|
||||
{
|
||||
padding: 0px;
|
||||
height: auto;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wmd-spacer
|
||||
{
|
||||
width: 0px;
|
||||
height: 20px;
|
||||
margin-left: 10px;
|
||||
|
||||
background-color: Silver;
|
||||
display: inline-block;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.wmd-button, .preview-button {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display: inline-block;
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.wmd-button {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.preview-button {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.wmd-button > span, .preview-button > span {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
display: inline-block;
|
||||
}
|
||||
@@ -38,7 +38,7 @@ code.prettyprint ol.linenums,pre.prettyprint ol.linenums {
|
||||
}
|
||||
|
||||
code.prettyprint ol.linenums li,pre.prettyprint ol.linenums li {
|
||||
padding-left: 12px;
|
||||
padding-left: 0;
|
||||
color: #bebec5;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
function bindMathJaxHooks(converter){var msie=/msie/.test(navigator.userAgent.toLowerCase());var inline="$";var SPLIT=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[\\{}$]|[{}]|(?:\n\s*)+|@@\d+@@)/i;function processMath(i,j){var block=blocks.slice(i,j+1).join("").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");if(msie){block=block.replace(/(%[^\n]*)\n/g,"$1<br/>\n")}while(j>i){blocks[j]="";j--}blocks[i]="@@"+math.length+"@@";math.push(block);start=end=last=null}function removeMath(text){start=end=last=null;math=[];blocks=text.replace(/\r\n?/g,"\n").split(SPLIT);for(var i=1,m=blocks.length;i<m;i+=2){var block=blocks[i];if(block.charAt(0)==="@"){blocks[i]="@@"+math.length+"@@";math.push(block)}else if(start){if(block===end){if(braces){last=i}else{processMath(start,i)}}else if(block.match(/\n.*\n/)){if(last){i=last;processMath(start,i)}start=end=last=null;braces=0}else if(block==="{"){braces++}else if(block==="}"&&braces){braces--}}else{if(block==="$$"){start=i;end=block;braces=0}else if(block.substr(1,5)==="begin"){start=i;end="\\end"+block.substr(6);braces=0}}}if(last){processMath(start,last)}return blocks.join("")}function replaceMath(text){text=text.replace(/@@(\d+)@@/g,function(match,n){return math[n]});math=null;return text}converter.hooks.chain("preConversion",removeMath);converter.hooks.chain("postConversion",replaceMath)}
|
||||
try{if(!Mobile.isMobile()){require(["//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"])}}catch(e){}function bindMathJaxHooks(converter){var msie=/msie/.test(navigator.userAgent.toLowerCase());var inline="$";var SPLIT=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[\\{}$]|[{}]|(?:\n\s*)+|@@\d+@@)/i;function processMath(i,j){var block=blocks.slice(i,j+1).join("").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");if(msie){block=block.replace(/(%[^\n]*)\n/g,"$1<br/>\n")}while(j>i){blocks[j]="";j--}blocks[i]="@@"+math.length+"@@";math.push(block);start=end=last=null}function removeMath(text){start=end=last=null;math=[];blocks=text.replace(/\r\n?/g,"\n").split(SPLIT);for(var i=1,m=blocks.length;i<m;i+=2){var block=blocks[i];if(block.charAt(0)==="@"){blocks[i]="@@"+math.length+"@@";math.push(block)}else if(start){if(block===end){if(braces){last=i}else{processMath(start,i)}}else if(block.match(/\n.*\n/)){if(last){i=last;processMath(start,i)}start=end=last=null;braces=0}else if(block==="{"){braces++}else if(block==="}"&&braces){braces--}}else{if(block==="$$"){start=i;end=block;braces=0}else if(block.substr(1,5)==="begin"){start=i;end="\\end"+block.substr(6);braces=0}}}if(last){processMath(start,last)}return blocks.join("")}function replaceMath(text){text=text.replace(/@@(\d+)@@/g,function(match,n){return math[n]});math=null;return text}converter.hooks.chain("preConversion",removeMath);converter.hooks.chain("postConversion",replaceMath)}
|
||||
@@ -1,3 +1,12 @@
|
||||
// 这一步非常耗时
|
||||
try {
|
||||
// mobile不要
|
||||
if(!Mobile.isMobile()) {
|
||||
require(['//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML']);
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
|
||||
function bindMathJaxHooks(converter) {
|
||||
|
||||
var msie = /msie/.test(navigator.userAgent.toLowerCase());
|
||||
|
||||
@@ -0,0 +1,377 @@
|
||||
// leanote's markdown editor
|
||||
// use require js
|
||||
var markdownLang = "Markdown.en";
|
||||
if(LEA.locale == "zh") {
|
||||
markdownLang = "Markdown.zh";
|
||||
}
|
||||
define('mdeditor',
|
||||
['Markdown.Converter', 'Markdown.Sanitizer', 'Markdown.Editor', markdownLang, 'Markdown.Extra',
|
||||
'underscore', 'scrollLink', 'mathJax', 'jquery.waitforimages', 'pretty'],
|
||||
function(){
|
||||
|
||||
new function($) {
|
||||
$.fn.setCursorPosition = function(pos) {
|
||||
if ($(this).get(0).setSelectionRange) {
|
||||
$(this).get(0).setSelectionRange(pos, pos);
|
||||
} else if ($(this).get(0).createTextRange) {
|
||||
var range = $(this).get(0).createTextRange();
|
||||
range.collapse(true);
|
||||
range.moveEnd('character', pos);
|
||||
range.moveStart('character', pos);
|
||||
range.select();
|
||||
}
|
||||
$(this).focus();
|
||||
}
|
||||
$.fn.tabHandler = function() {
|
||||
$(this).keydown(function(e) {
|
||||
if(e.keyCode === 9) { // tab was pressed
|
||||
// get caret position/selection
|
||||
var start = this.selectionStart;
|
||||
var end = this.selectionEnd;
|
||||
|
||||
var $this = $(this);
|
||||
var value = $this.val();
|
||||
|
||||
// set textarea value to: text before caret + four spaces + text after caret
|
||||
$this.val(value.substring(0, start)
|
||||
+ " "
|
||||
+ value.substring(end));
|
||||
|
||||
// put caret at right position again (add four for the spaces)
|
||||
this.selectionStart = this.selectionEnd = start + 4;
|
||||
|
||||
// prevent the focus lose
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
}(jQuery);
|
||||
|
||||
// full screen api
|
||||
/*
|
||||
(function() {
|
||||
var
|
||||
fullScreenApi = {
|
||||
supportsFullScreen: false,
|
||||
isFullScreen: function() { return false; },
|
||||
requestFullScreen: function() {},
|
||||
cancelFullScreen: function() {},
|
||||
fullScreenEventName: '',
|
||||
prefix: ''
|
||||
},
|
||||
browserPrefixes = 'webkit moz o ms khtml'.split(' ');
|
||||
|
||||
// check for native support
|
||||
if (typeof document.cancelFullScreen != 'undefined') {
|
||||
fullScreenApi.supportsFullScreen = true;
|
||||
} else {
|
||||
// check for fullscreen support by vendor prefix
|
||||
for (var i = 0, il = browserPrefixes.length; i < il; i++ ) {
|
||||
fullScreenApi.prefix = browserPrefixes[i];
|
||||
|
||||
if (typeof document[fullScreenApi.prefix + 'CancelFullScreen' ] != 'undefined' ) {
|
||||
fullScreenApi.supportsFullScreen = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// update methods to do something useful
|
||||
if (fullScreenApi.supportsFullScreen) {
|
||||
fullScreenApi.fullScreenEventName = fullScreenApi.prefix + 'fullscreenchange';
|
||||
|
||||
fullScreenApi.isFullScreen = function() {
|
||||
switch (this.prefix) {
|
||||
case '':
|
||||
return document.fullScreen;
|
||||
case 'webkit':
|
||||
return document.webkitIsFullScreen;
|
||||
default:
|
||||
return document[this.prefix + 'FullScreen'];
|
||||
}
|
||||
}
|
||||
fullScreenApi.requestFullScreen = function(el) {
|
||||
return (this.prefix === '') ? el.requestFullScreen() : el[this.prefix + 'RequestFullScreen']();
|
||||
}
|
||||
fullScreenApi.cancelFullScreen = function(el) {
|
||||
return (this.prefix === '') ? document.cancelFullScreen() : document[this.prefix + 'CancelFullScreen']();
|
||||
}
|
||||
}
|
||||
|
||||
// jQuery plugin
|
||||
if (typeof jQuery != 'undefined') {
|
||||
jQuery.fn.requestFullScreen = function() {
|
||||
|
||||
return this.each(function() {
|
||||
if (fullScreenApi.supportsFullScreen) {
|
||||
fullScreenApi.requestFullScreen(this);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
// export api
|
||||
window.fullScreenApi = fullScreenApi;
|
||||
})();
|
||||
|
||||
*/
|
||||
|
||||
(function () {
|
||||
// handle Tab keystroke
|
||||
$('#wmd-input').tabHandler();
|
||||
|
||||
var converter1 = Markdown.getSanitizingConverter();
|
||||
Converter = converter1;
|
||||
|
||||
// tell the converter to use Markdown Extra for tables, fenced_code_gfm, def_list
|
||||
Markdown.Extra.init(converter1, {extensions: ["tables", "fenced_code_gfm", "def_list"], highlighter: "prettify"});
|
||||
|
||||
// To handle LaTeX expressions, to avoid the expression fail to work because of markdown syntax. inspired by stackeditor
|
||||
// This will handle $$LaTeX expression$$ only, so that $LaTeX expression$ could fail to handle either.
|
||||
bindMathJaxHooks(converter1);
|
||||
|
||||
// 弹框显示markdown语法
|
||||
var markdownHelp = function () {
|
||||
window.open("http://leanote.com/blog/view/531b263bdfeb2c0ea9000002");
|
||||
return;
|
||||
}
|
||||
var options = {
|
||||
helpButton: { handler: markdownHelp },
|
||||
strings: Markdown.local.zh
|
||||
};
|
||||
|
||||
var editor1 = new Markdown.Editor(converter1, null, options);
|
||||
MarkdownEditor = editor1;
|
||||
|
||||
var scrollLink = getScrollLink();
|
||||
ScrollLink = scrollLink;
|
||||
scrollLink.onLayoutCreated();
|
||||
|
||||
editor1.hooks.chain("onPreviewRefresh", function () {
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
|
||||
// Call onPreviewFinished callbacks when all async preview are finished, make sure sync actions have been ABOVE the line below.
|
||||
var counter = 0;
|
||||
var nbAsyncPreviewCallback = 2; // 1 for waitForImages below and 1 for MathJax below, they are both time consuming task, if only they are both done, begin to caculate md section and scroll bar.
|
||||
function tryFinished() {
|
||||
if(++counter === nbAsyncPreviewCallback) {
|
||||
scrollLink.onPreviewFinished();
|
||||
}
|
||||
}
|
||||
// We assume images are loading in the preview
|
||||
$("#wmd-preview").waitForImages(tryFinished);
|
||||
// TODO: could we cache the result to speed up ? This action is slow, especially, when there are multiple LaTeX expression on the page, google solution.
|
||||
if(typeof MathJax != "undefined") {
|
||||
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
|
||||
MathJax.Hub.Queue(tryFinished);
|
||||
} else {
|
||||
scrollLink.onPreviewFinished();
|
||||
}
|
||||
});
|
||||
scrollLink.onEditorConfigure(editor1);
|
||||
|
||||
function popupEditorDialog(title, body, imageClass, placeholder) {
|
||||
$('#editorDialog').find('.modal-body input').val("");
|
||||
$('#editorDialog').find('.modal-body input').attr("placeholder", placeholder);
|
||||
$('#editorDialog').find('#editorDialog-title').text(title);
|
||||
$('#editorDialog').find('.modal-body p').text(body);
|
||||
$('#editorDialog').find('.modal-body i').removeClass().addClass(imageClass);
|
||||
$('#editorDialog').modal({keyboard : true});
|
||||
}
|
||||
|
||||
// Custom insert link dialog
|
||||
editor1.hooks.set("insertLinkDialog", function(callback) {
|
||||
popupEditorDialog(options.strings.linkTitle, options.strings.linkAddress, 'fa fa-link', options.strings.linkExample);
|
||||
editorDialogCallback = callback;
|
||||
return true; // tell the editor that we'll take care of getting the link url
|
||||
});
|
||||
|
||||
// Custom insert image dialog
|
||||
var editorDialogCallback = null;
|
||||
editor1.hooks.set("insertImageDialog", function(callback) {
|
||||
popupEditorDialog(options.strings.imageTitle, options.strings.imageAddress, 'fa fa-picture-o', options.strings.imageExample);
|
||||
editorDialogCallback = callback;
|
||||
return true; // tell the editor that we'll take care of getting the image url
|
||||
});
|
||||
|
||||
$('#editorDialog').on('hidden.bs.modal', function(){
|
||||
if (editorDialogCallback) {
|
||||
var url = $('#editorDialog-confirm').data('url');
|
||||
if (url) {
|
||||
$('#editorDialog-confirm').removeData('url');
|
||||
editorDialogCallback(url);
|
||||
} else {
|
||||
editorDialogCallback(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#editorDialog-confirm').click(function(event) {
|
||||
var url = $('#editorDialog').find('.modal-body input').val();
|
||||
if (url) {
|
||||
$(this).data('url', url);
|
||||
}
|
||||
$('#editorDialog').modal('hide');
|
||||
});
|
||||
|
||||
$('#editorDialog').on('shown.bs.modal', function(){
|
||||
$('#editorDialog').find('.modal-body input').focus();
|
||||
});
|
||||
|
||||
|
||||
// Make preview if it's inactive in 500ms to reduce the calls in onPreviewRefresh chains above and cpu cost.
|
||||
documentContent = undefined;
|
||||
var previewWrapper;
|
||||
previewWrapper = function(makePreview) {
|
||||
var debouncedMakePreview = _.debounce(makePreview, 500);
|
||||
return function() {
|
||||
if(documentContent === undefined) {
|
||||
makePreview();
|
||||
documentContent = '';
|
||||
} else {
|
||||
debouncedMakePreview();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
$(window).resize(function() {
|
||||
scrollLink.buildSections();
|
||||
});
|
||||
|
||||
// 渲染编辑器
|
||||
mainHandler();
|
||||
|
||||
function mainHandler(data) {
|
||||
var article = null;
|
||||
var cursorPosition = 0;
|
||||
|
||||
// start editor.
|
||||
editor1.run(previewWrapper);
|
||||
|
||||
// Load awesome font to button
|
||||
$('#wmd-bold-button > span').addClass('fa fa-bold');
|
||||
$('#wmd-italic-button > span').addClass('fa fa-italic');
|
||||
$('#wmd-link-button > span').addClass('fa fa-link');
|
||||
$('#wmd-quote-button > span').addClass('fa fa-quote-left');
|
||||
$('#wmd-code-button > span').addClass('fa fa-code');
|
||||
$('#wmd-image-button > span').addClass('fa fa-picture-o');
|
||||
$('#wmd-olist-button > span').addClass('fa fa-list-ol');
|
||||
$('#wmd-ulist-button > span').addClass('fa fa-list-ul');
|
||||
$('#wmd-heading-button > span').addClass('fa fa-list-alt');
|
||||
$('#wmd-hr-button > span').addClass('fa fa-minus');
|
||||
$('#wmd-undo-button > span').addClass('fa fa-undo');
|
||||
$('#wmd-redo-button > span').addClass('fa fa-repeat');
|
||||
|
||||
$('#wmd-help-button > span').addClass('fa fa-question-circle');
|
||||
|
||||
function buttonBinding(rowClassName, spanClassName) {
|
||||
// change color when hovering.
|
||||
$(rowClassName).hover(function() {
|
||||
$(spanClassName).animate({color: '#F9F9F5'}, 400);
|
||||
},
|
||||
function() {
|
||||
$(spanClassName).animate({color: '#BBBBBB'}, 400);
|
||||
});
|
||||
|
||||
// enlarge the icon when hovering.
|
||||
$(spanClassName).hover(function() {
|
||||
$(this).addClass('icon-large');
|
||||
},
|
||||
function() {
|
||||
$(this).removeClass('icon-large');
|
||||
});
|
||||
}
|
||||
buttonBinding('.wmd-button-row', '.wmd-button > span');
|
||||
buttonBinding('.preview-button-row', '.preview-button > span');
|
||||
|
||||
function getCurrentMode() {
|
||||
var currentMode = {isFullEditor: false, isFullReader: false, isEditorReader: false};
|
||||
return currentMode;
|
||||
}
|
||||
|
||||
/* ============================= Handle customized shortcut key binding. ========================================= */
|
||||
browserType = {
|
||||
isIE: /msie/.test(window.navigator.userAgent.toLowerCase()),
|
||||
isIE_5or6: /msie 6/.test(window.navigator.userAgent.toLowerCase()) || /msie 5/.test(window.navigator.userAgent.toLowerCase()),
|
||||
isOpera: /opera/.test(window.navigator.userAgent.toLowerCase()),
|
||||
isFirefox: /firefox/.test(window.navigator.userAgent.toLowerCase()),
|
||||
isChrome: /(chrome|chromium)/.test(window.navigator.userAgent.toLowerCase())
|
||||
};
|
||||
|
||||
var keyEvent = 'keydown';
|
||||
if (browserType.isOpera || browserType.isFirefox) {
|
||||
keyEvent = 'keypress';
|
||||
}
|
||||
|
||||
$(document).on(keyEvent, function(key) {
|
||||
// Check to see if we have a button key and, if so execute the callback.
|
||||
if ((key.ctrlKey || key.metaKey) && !key.shiftKey) {
|
||||
|
||||
var currentMode = getCurrentMode();
|
||||
|
||||
var keyCode = key.charCode || key.keyCode;
|
||||
var keyCodeStr = String.fromCharCode(keyCode).toLowerCase();
|
||||
|
||||
switch (keyCodeStr) {
|
||||
/*
|
||||
case "m":
|
||||
if (!key.altKey) { // 'ctrl + m' for switching normal/full editor
|
||||
if (currentMode.isEditorReader) {
|
||||
switchFullEditorMode();
|
||||
} else if (currentMode.isFullEditor) {
|
||||
switchNormalModeFromFullEditorMode();
|
||||
}
|
||||
} else { // 'ctrl + alt + m' for switching normal/full reader
|
||||
if (currentMode.isEditorReader) {
|
||||
switchFullReaderMode();
|
||||
} else if (currentMode.isFullReader) {
|
||||
switchNormalModeFromFullReaderMode();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "j":
|
||||
if (key.altKey) { // 'ctrl + alt + j' for switching site theme.
|
||||
switchSiteTheme();
|
||||
break;
|
||||
}
|
||||
case "h":
|
||||
if (key.altKey) { // 'ctrl + alt + h' for markdown help.
|
||||
markdownHelp();
|
||||
break;
|
||||
}
|
||||
case "n":
|
||||
if (key.altKey) { // 'ctrl + alt + n' for markdown help.
|
||||
clearAndNewFile();
|
||||
break;
|
||||
}
|
||||
*/
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (key.preventDefault) {
|
||||
key.preventDefault();
|
||||
}
|
||||
|
||||
if (window.event) {
|
||||
window.event.returnValue = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Switch mode if there is.
|
||||
var currentMode = getCurrentMode();
|
||||
if (currentMode.isFullEditor) {
|
||||
$('#wmd-input').setCursorPosition(cursorPosition);
|
||||
switchFullEditorMode();
|
||||
} else if (currentMode.isFullReader) { // Don't set focus on '#wmd-input', otherwise, when first time press pagedown key on full reader page, Firefox can't scroll.
|
||||
switchFullReaderMode();
|
||||
} else { // normal mode
|
||||
$('#wmd-input').setCursorPosition(cursorPosition);
|
||||
}
|
||||
} // mainHander
|
||||
})();
|
||||
|
||||
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
(function(){Markdown.local=Markdown.local||{};Markdown.local.zh={bold:"Bold <strong> Ctrl+B",boldexample:"Bold",italic:"Italic <em> Ctrl+I",italicexample:"Italic",link:"Link <a> Ctrl+L",linkTitle:"Link",linkAddress:"Input Link",linkExample:'http://example.com/ "Optional Title"',image:"Image <img> Ctrl+G",imageTitle:"Image",imageAddress:"Input Image Address",imageExample:'http://example.com/images/diagram.jpg "Optional Title"',quote:"Blockquote <blockquote> Ctrl+Q",quoteexample:"Blockquote ",code:"Code <pre><code> Ctrl+K",codeexample:"Input Code",olist:"Ordered List <ol> Ctrl+O",ulist:"Unordered list <ul> Ctrl+U",litem:"item",heading:"Heading <h1>/<h2> Ctrl+H",headingexample:"Heading",hr:"Hr <hr> Ctrl+R",undo:"Undo - Ctrl+Z",redo:"Redo - Ctrl+Y",redomac:"Redomac - Ctrl+Shift+Z",help:"Markdown Help Ctrl+Alt+H"}})();
|
||||
@@ -0,0 +1,45 @@
|
||||
// Usage:
|
||||
//
|
||||
// var myConverter = new Markdown.Editor(myConverter, null, { strings: Markdown.local.fr });
|
||||
|
||||
(function () {
|
||||
Markdown.local = Markdown.local || {};
|
||||
Markdown.local.zh = {
|
||||
bold: "Bold <strong> Ctrl+B",
|
||||
boldexample: "Bold",
|
||||
|
||||
italic: "Italic <em> Ctrl+I",
|
||||
italicexample: "Italic",
|
||||
|
||||
link: "Link <a> Ctrl+L",
|
||||
linkTitle:"Link",
|
||||
linkAddress:"Input Link",
|
||||
linkExample: 'http://example.com/ "Optional Title"',
|
||||
|
||||
image: "Image <img> Ctrl+G",
|
||||
imageTitle:"Image",
|
||||
imageAddress:"Input Image Address",
|
||||
imageExample: 'http://example.com/images/diagram.jpg "Optional Title"',
|
||||
|
||||
quote: "Blockquote <blockquote> Ctrl+Q",
|
||||
quoteexample: "Blockquote ",
|
||||
|
||||
code: "Code <pre><code> Ctrl+K",
|
||||
codeexample: "Input Code",
|
||||
|
||||
olist: "Ordered List <ol> Ctrl+O",
|
||||
ulist: "Unordered list <ul> Ctrl+U",
|
||||
litem: "item",
|
||||
|
||||
heading: "Heading <h1>/<h2> Ctrl+H",
|
||||
headingexample: "Heading",
|
||||
|
||||
hr: "Hr <hr> Ctrl+R",
|
||||
|
||||
undo: "Undo - Ctrl+Z",
|
||||
redo: "Redo - Ctrl+Y",
|
||||
redomac: "Redomac - Ctrl+Shift+Z",
|
||||
|
||||
help: "Markdown Help Ctrl+Alt+H"
|
||||
};
|
||||
})();
|
||||
@@ -1 +1 @@
|
||||
(function(){Markdown.local=Markdown.local||{};Markdown.local.zh={bold:"粗体 <strong> Ctrl+B",boldexample:"粗体文本",italic:"斜体 <em> Ctrl+I",italicexample:"斜体文本",link:"超链接 <a> Ctrl+L",linkdescription:"此处输入链接的描述",linkdialog:'<p><b>输入超链接</b></p><p>http://example.com/ "可选标题"</p>',quote:"段落引用 <blockquote> Ctrl+Q",quoteexample:"段落引用",code:"代码样例 <pre><code> Ctrl+K",codeexample:"此处输入代码",image:"图片 <img> Ctrl+G",imagedescription:"此处输入图片的描述",imagedialog:"<p><b>插入图片</b></p><p>http://example.com/images/diagram.jpg \"可选标题\"<br><br><a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>需要免费的图片主机?</a></p>",olist:"有序列表 <ol> Ctrl+O",ulist:"无序列表 <ul> Ctrl+U",litem:"列表项",heading:"标题 <h1>/<h2> Ctrl+H",headingexample:"标题",hr:"水平线 <hr> Ctrl+R",undo:"撤销 - Ctrl+Z",redo:"重复 - Ctrl+Y",redomac:"重复 - Ctrl+Shift+Z",help:"Markdown 语法帮助 Ctrl+Alt+H"}})();
|
||||
(function(){Markdown.local=Markdown.local||{};Markdown.local.zh={bold:"粗体 <strong> Ctrl+B",boldexample:"粗体文本",italic:"斜体 <em> Ctrl+I",italicexample:"斜体文本",link:"超链接 <a> Ctrl+L",linkTitle:"超链接",linkAddress:"请输入链接地址",linkdescription:"此处输入链接的描述",linkExample:'http://example.com/ "可选标题"',image:"图片 <img> Ctrl+G",imageTitle:"图片",imageAddress:"请输入图片地址",imagedescription:"此处输入图片的描述",imageExample:'http://example.com/images/diagram.jpg "可选标题"',quote:"段落引用 <blockquote> Ctrl+Q",quoteexample:"段落引用",code:"代码样例 <pre><code> Ctrl+K",codeexample:"此处输入代码",olist:"有序列表 <ol> Ctrl+O",ulist:"无序列表 <ul> Ctrl+U",litem:"列表项",heading:"标题 <h1>/<h2> Ctrl+H",headingexample:"标题",hr:"水平线 <hr> Ctrl+R",undo:"撤销 - Ctrl+Z",redo:"重复 - Ctrl+Y",redomac:"重复 - Ctrl+Shift+Z",help:"Markdown 语法帮助 Ctrl+Alt+H"}})();
|
||||
@@ -12,19 +12,23 @@
|
||||
italicexample: "斜体文本",
|
||||
|
||||
link: "超链接 <a> Ctrl+L",
|
||||
linkTitle:"超链接",
|
||||
linkAddress:"请输入链接地址",
|
||||
linkdescription: "此处输入链接的描述",
|
||||
linkdialog: "<p><b>输入超链接</b></p><p>http://example.com/ \"可选标题\"</p>",
|
||||
|
||||
linkExample: 'http://example.com/ "可选标题"',
|
||||
|
||||
image: "图片 <img> Ctrl+G",
|
||||
imageTitle:"图片",
|
||||
imageAddress:"请输入图片地址",
|
||||
imagedescription: "此处输入图片的描述",
|
||||
imageExample: 'http://example.com/images/diagram.jpg "可选标题"',
|
||||
|
||||
quote: "段落引用 <blockquote> Ctrl+Q",
|
||||
quoteexample: "段落引用",
|
||||
|
||||
code: "代码样例 <pre><code> Ctrl+K",
|
||||
codeexample: "此处输入代码",
|
||||
|
||||
image: "图片 <img> Ctrl+G",
|
||||
imagedescription: "此处输入图片的描述",
|
||||
imagedialog: "<p><b>插入图片</b></p><p>http://example.com/images/diagram.jpg \"可选标题\"<br><br><a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>需要免费的图片主机?</a></p>",
|
||||
|
||||
olist: "有序列表 <ol> Ctrl+O",
|
||||
ulist: "无序列表 <ul> Ctrl+U",
|
||||
litem: "列表项",
|
||||
|
||||
Reference in new issue
Block a user