Fixes for new pre editor
This commit is contained in:
parent
23cf534614
commit
f54e5ef202
@ -131,7 +131,7 @@ define([
|
||||
result.push('<i class="' + classes + '"></i>');
|
||||
});
|
||||
if(_.size(this.publishLocations) !== 0) {
|
||||
result.push('<i class="icon-share title-icon-category"></i>');
|
||||
result.push('<i class="icon-upload title-icon-category"></i>');
|
||||
}
|
||||
result.push(_.escape(this.title));
|
||||
return result.join('');
|
||||
|
@ -4,7 +4,7 @@ define([
|
||||
"underscore",
|
||||
"crel",
|
||||
"ace",
|
||||
"classes/PreEditor",
|
||||
"preEditor",
|
||||
"constants",
|
||||
"utils",
|
||||
"storage",
|
||||
@ -26,7 +26,7 @@ define([
|
||||
'ace/ext/spellcheck',
|
||||
'ace/ext/searchbox'
|
||||
|
||||
], function($, _, crel, ace, PreEditor, constants, utils, storage, settings, eventMgr, shortcutMgr, mousetrap, bodyIndexHTML, bodyViewerHTML, settingsTemplateTooltipHTML, settingsUserCustomExtensionTooltipHTML) {
|
||||
], function($, _, crel, ace, preEditor, constants, utils, storage, settings, eventMgr, shortcutMgr, mousetrap, bodyIndexHTML, bodyViewerHTML, settingsTemplateTooltipHTML, settingsUserCustomExtensionTooltipHTML) {
|
||||
|
||||
var core = {};
|
||||
|
||||
@ -362,10 +362,10 @@ define([
|
||||
north__minSize: 49,
|
||||
center__minWidth: 250,
|
||||
center__minHeight: 180,
|
||||
east__onAlert: function() {
|
||||
east__onalert: function() {
|
||||
window.location.href = 'viewer';
|
||||
},
|
||||
south__onAlert: function() {
|
||||
south__onalert: function() {
|
||||
window.location.href = 'viewer';
|
||||
},
|
||||
fxSettings: {
|
||||
@ -385,12 +385,12 @@ define([
|
||||
}
|
||||
},
|
||||
onresize_end: function(paneName) {
|
||||
if(preEditor.$preContentElt !== undefined && paneName == 'center') {
|
||||
if(preEditor.$contentElt !== undefined && paneName == 'center') {
|
||||
var padding = ($editorElt.width() - getMaxWidth()) / 2;
|
||||
if(padding < constants.EDITOR_DEFAULT_PADDING) {
|
||||
padding = constants.EDITOR_DEFAULT_PADDING;
|
||||
}
|
||||
preEditor.$preContentElt.css({
|
||||
preEditor.$contentElt.css({
|
||||
'padding-left': padding + 'px',
|
||||
'padding-right': padding + 'px'
|
||||
});
|
||||
@ -499,7 +499,6 @@ define([
|
||||
var fileDesc;
|
||||
var documentContent;
|
||||
var UndoManager = require("ace/undomanager").UndoManager;
|
||||
var preEditor;
|
||||
core.initEditor = function(fileDescParam) {
|
||||
if(fileDesc !== undefined) {
|
||||
eventMgr.onFileClosed(fileDesc);
|
||||
@ -587,15 +586,30 @@ define([
|
||||
if(aceEditor !== undefined) {
|
||||
newDocumentContent = aceEditor.getValue();
|
||||
}
|
||||
if(documentContent === undefined) {
|
||||
preEditor.highlight();
|
||||
if(documentContent == newDocumentContent) {
|
||||
return false;
|
||||
}
|
||||
else if(documentContent != newDocumentContent) {
|
||||
|
||||
if(documentContent !== undefined) {
|
||||
fileDesc.content = newDocumentContent;
|
||||
eventMgr.onContentChanged(fileDesc);
|
||||
preEditor.highlight();
|
||||
}
|
||||
else {
|
||||
eventMgr.onFileOpen(fileDesc);
|
||||
$previewContainerElt.scrollTop(fileDesc.previewScrollTop);
|
||||
if(window.lightMode) {
|
||||
$editorElt.scrollTop(fileDesc.editorScrollTop);
|
||||
}
|
||||
else {
|
||||
preEditor.scrollTop = fileDesc.editorScrollTop;
|
||||
_.defer(function() {
|
||||
aceEditor.renderer.scrollToY(fileDesc.editorScrollTop);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
documentContent = newDocumentContent;
|
||||
return true;
|
||||
}
|
||||
|
||||
var previewWrapper;
|
||||
@ -629,44 +643,17 @@ define([
|
||||
previewWrapper = function(makePreview) {
|
||||
var debouncedMakePreview = _.debounce(makePreview, 500);
|
||||
return function() {
|
||||
if(documentContent === undefined) {
|
||||
makePreview();
|
||||
eventMgr.onFileOpen(fileDesc);
|
||||
$previewContainerElt.scrollTop(fileDesc.previewScrollTop);
|
||||
if(window.lightMode) {
|
||||
preEditor.scrollTop = fileDesc.editorScrollTop;
|
||||
$editorElt.scrollTop(preEditor.scrollTop);
|
||||
}
|
||||
else {
|
||||
_.defer(function() {
|
||||
aceEditor.renderer.scrollToY(fileDesc.editorScrollTop);
|
||||
});
|
||||
}
|
||||
var debounce = documentContent !== undefined;
|
||||
if(checkDocumentChanges()) {
|
||||
debounce ? debouncedMakePreview() : makePreview();
|
||||
}
|
||||
else {
|
||||
debouncedMakePreview();
|
||||
}
|
||||
checkDocumentChanges();
|
||||
};
|
||||
};
|
||||
}
|
||||
else {
|
||||
previewWrapper = function(makePreview) {
|
||||
return function() {
|
||||
makePreview();
|
||||
if(documentContent === undefined) {
|
||||
eventMgr.onFileOpen(fileDesc);
|
||||
$previewContainerElt.scrollTop(fileDesc.previewScrollTop);
|
||||
if(window.lightMode) {
|
||||
$editorElt.scrollTop(fileDesc.editorScrollTop);
|
||||
}
|
||||
else {
|
||||
_.defer(function() {
|
||||
aceEditor.renderer.scrollToY(fileDesc.editorScrollTop);
|
||||
});
|
||||
}
|
||||
}
|
||||
checkDocumentChanges();
|
||||
checkDocumentChanges() && makePreview();
|
||||
};
|
||||
};
|
||||
}
|
||||
@ -861,7 +848,7 @@ define([
|
||||
// In pre mode, we replace ACE with an editable pre
|
||||
$('#wmd-input').replaceWith(function() {
|
||||
var result = $('<pre id="wmd-input">').addClass(this.className).addClass('form-control');
|
||||
preEditor = new PreEditor(result[0]);
|
||||
preEditor.init(result[0]);
|
||||
return result;
|
||||
});
|
||||
|
||||
@ -1032,7 +1019,7 @@ define([
|
||||
});
|
||||
$(".action-import-docs-settings-confirm").click(function() {
|
||||
storage.clear();
|
||||
var allowedKeys = /^file\.|^focusMode$|^folder\.|^publish\.|^settings$|^sync\.|^google\.|^themeV3$|^mode$|^version$|^welcomeTour$/;
|
||||
var allowedKeys = /^file\.|^folder\.|^publish\.|^settings$|^sync\.|^google\.|^themeV3$|^mode$|^version$|^welcomeTour$/;
|
||||
_.each(newstorage, function(value, key) {
|
||||
if(allowedKeys.test(key)) {
|
||||
storage[key] = value;
|
||||
|
@ -39,7 +39,7 @@ define([
|
||||
"extensions/spellCheck",
|
||||
"extensions/userCustom",
|
||||
"bootstrap",
|
||||
"jquery-waitforimages"
|
||||
"jquery-waitforimages",
|
||||
], function($, _, crel, utils, logger, Extension, settings, settingsExtensionsAccordionHTML) {
|
||||
|
||||
var eventMgr = {};
|
||||
@ -233,7 +233,6 @@ define([
|
||||
_.each(previewContentsElt.children, function(elt) {
|
||||
html += elt.innerHTML;
|
||||
});
|
||||
html = html.replace(/^<div class="se-section-delimiter"><\/div>\n\n/gm, '');
|
||||
var htmlWithComments = utils.trim(html);
|
||||
var htmlWithoutComments = htmlWithComments.replace(/ <span class="comment label label-danger">.*?<\/span> /g, '');
|
||||
onPreviewFinished(htmlWithComments, htmlWithoutComments);
|
||||
|
@ -2,11 +2,10 @@ define([
|
||||
"jquery",
|
||||
"underscore",
|
||||
"crel",
|
||||
"storage",
|
||||
"classes/Extension"
|
||||
], function($, _, crel, storage, Extension) {
|
||||
], function($, _, crel, Extension) {
|
||||
|
||||
var buttonFocusMode = new Extension("buttonFocusMode", 'Button "Focus Mode"', true, true, true);
|
||||
var buttonFocusMode = new Extension("buttonFocusMode", 'Button "Focus Mode"', true, true);
|
||||
buttonFocusMode.settingsBlock = "When typing, scrolls automatically the editor to always have the caret centered verticaly.";
|
||||
|
||||
var aceEditor;
|
||||
@ -14,48 +13,57 @@ define([
|
||||
aceEditor = aceEditorParam;
|
||||
};
|
||||
|
||||
var isFocusModeOn = false;
|
||||
var isMouseActive = false;
|
||||
function doFocusMode() {
|
||||
if(isFocusModeOn === false || isMouseActive === true) {
|
||||
return;
|
||||
if(aceEditor) {
|
||||
if(isMouseActive === true) {
|
||||
return;
|
||||
}
|
||||
var positionInDocument = aceEditor.selection.getCursor();
|
||||
var positionInScreen = aceEditor.session.documentToScreenPosition(positionInDocument.row, positionInDocument.column);
|
||||
aceEditor.session.setScrollTop((positionInScreen.row + 0.5) * aceEditor.renderer.lineHeight - aceEditor.renderer.$size.scrollerHeight / 2);
|
||||
}
|
||||
var positionInDocument = aceEditor.selection.getCursor();
|
||||
var positionInScreen = aceEditor.session.documentToScreenPosition(positionInDocument.row, positionInDocument.column);
|
||||
aceEditor.session.setScrollTop((positionInScreen.row + 0.5) * aceEditor.renderer.lineHeight - aceEditor.renderer.$size.scrollerHeight / 2);
|
||||
}
|
||||
|
||||
var $button;
|
||||
buttonFocusMode.onReady = function() {
|
||||
aceEditor.getSession().selection.on('changeCursor', doFocusMode);
|
||||
aceEditor.container.addEventListener('keydown', function() {
|
||||
isMouseActive = false;
|
||||
}, true);
|
||||
aceEditor.container.addEventListener('mousedown', function() {
|
||||
isMouseActive = true;
|
||||
}, true);
|
||||
if(storage.focusMode == 'on') {
|
||||
$button.click();
|
||||
}
|
||||
};
|
||||
|
||||
buttonFocusMode.onCreateEditorButton = function() {
|
||||
$button = $([
|
||||
'<button class="btn btn-info" title="Focus Mode" data-toggle="button">',
|
||||
' <i class="icon-target"></i>',
|
||||
'</button>'
|
||||
].join(''));
|
||||
$button.click(function() {
|
||||
_.defer(function() {
|
||||
isFocusModeOn = $button.is('.active');
|
||||
storage.focusMode = isFocusModeOn ? 'on' : 'off';
|
||||
if(aceEditor) {
|
||||
aceEditor.getSession().selection.on('changeCursor', doFocusMode);
|
||||
aceEditor.container.addEventListener('keydown', function() {
|
||||
isMouseActive = false;
|
||||
aceEditor.focus();
|
||||
doFocusMode();
|
||||
});
|
||||
}, true);
|
||||
aceEditor.container.addEventListener('mousedown', function() {
|
||||
isMouseActive = true;
|
||||
}, true);
|
||||
return;
|
||||
}
|
||||
var $editorElt = $('#wmd-input');
|
||||
var $positionHelper = $('<span>').css('display', 'inline-block');
|
||||
var coef = 0.2;
|
||||
$editorElt.on('keydown', function(event) {
|
||||
if(event.altKey || event.ctrlKey || event.shiftKey || event.metaKey) {
|
||||
return;
|
||||
}
|
||||
setTimeout(function() {
|
||||
var range = window.getSelection().getRangeAt(0);
|
||||
range.insertNode($positionHelper[0]);
|
||||
var parentNode = $positionHelper[0].parentNode;
|
||||
var editorHeight = $editorElt.height();
|
||||
var cursorMinY = coef*editorHeight;
|
||||
var cursorMaxY = (1-coef)*editorHeight;
|
||||
var cursorY = $positionHelper.offset().top - $editorElt.offset().top;
|
||||
$positionHelper.detach();
|
||||
parentNode.normalize();
|
||||
if(cursorY < cursorMinY) {
|
||||
$editorElt.scrollTop($editorElt.scrollTop() - cursorMinY + cursorY);
|
||||
}
|
||||
else if(cursorY > cursorMaxY) {
|
||||
$editorElt.scrollTop($editorElt.scrollTop() + cursorY - cursorMaxY);
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
return $button[0];
|
||||
};
|
||||
|
||||
return buttonFocusMode;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@ define([
|
||||
class: 'btn btn-success button-publish',
|
||||
title: 'Update document publication'
|
||||
}, crel('i', {
|
||||
class: 'icon-share'
|
||||
class: 'icon-upload'
|
||||
}));
|
||||
$button = $(button).click(function() {
|
||||
if(!$button.hasClass("disabled")) {
|
||||
|
@ -11,11 +11,12 @@ define([
|
||||
markdownSectionParser.onEventMgrCreated = function(eventMgrParameter) {
|
||||
eventMgr = eventMgrParameter;
|
||||
};
|
||||
|
||||
|
||||
var sectionList = [];
|
||||
|
||||
// Regexp to look for section delimiters
|
||||
var regexp = '^.+[ \\t]*\\n=+[ \\t]*\\n+|^.+[ \\t]*\\n-+[ \\t]*\\n+|^\\#{1,6}[ \\t]*.+?[ \\t]*\\#*\\n+'; // Title delimiters
|
||||
markdownSectionParser.onPagedownConfigure = function(editor) {
|
||||
|
||||
// Build a regexp to look for section delimiters
|
||||
var regexp = '^.+[ \\t]*\\n=+[ \\t]*\\n+|^.+[ \\t]*\\n-+[ \\t]*\\n+|^\\#{1,6}[ \\t]*.+?[ \\t]*\\#*\\n+'; // Title delimiters
|
||||
if(markdownExtra.enabled) {
|
||||
if(_.some(markdownExtra.config.extensions, function(extension) {
|
||||
return extension == "fenced_code_gfm";
|
||||
@ -32,31 +33,44 @@ define([
|
||||
regexp = new RegExp(regexp, 'gm');
|
||||
|
||||
var converter = editor.getConverter();
|
||||
converter.hooks.chain("preConversion", function(text) {
|
||||
eventMgr.previewStartTime = new Date();
|
||||
var tmpText = text + "\n\n";
|
||||
function addSection(startOffset, endOffset) {
|
||||
var sectionText = tmpText.substring(offset, endOffset);
|
||||
sectionList.push({
|
||||
text: sectionText,
|
||||
textWithDelimiter: '\n<div class="se-section-delimiter"></div>\n\n' + sectionText + '\n'
|
||||
});
|
||||
}
|
||||
var sectionList = [], offset = 0;
|
||||
// Look for delimiters
|
||||
tmpText.replace(regexp, function(match, matchOffset) {
|
||||
// Create a new section with the text preceding the delimiter
|
||||
addSection(offset, matchOffset);
|
||||
offset = matchOffset;
|
||||
});
|
||||
// Last section
|
||||
addSection(offset, text.length);
|
||||
eventMgr.onSectionsCreated(sectionList);
|
||||
converter.hooks.chain("preConversion", function() {
|
||||
return _.reduce(sectionList, function(result, section) {
|
||||
return result + section.textWithDelimiter;
|
||||
return result + section.previewText;
|
||||
}, '');
|
||||
});
|
||||
};
|
||||
|
||||
var trimLen;
|
||||
markdownSectionParser.onMarkdownTrim = function(len) {
|
||||
trimLen = len;
|
||||
};
|
||||
|
||||
var sectionCounter = 0;
|
||||
function parseFileContent(fileDesc) {
|
||||
var text = fileDesc.content.substring(trimLen);
|
||||
var tmpText = text + "\n\n";
|
||||
function addSection(startOffset, endOffset) {
|
||||
var sectionText = tmpText.substring(offset, endOffset);
|
||||
sectionList.push({
|
||||
id: ++sectionCounter,
|
||||
text: sectionText
|
||||
});
|
||||
}
|
||||
sectionList = [];
|
||||
var offset = 0;
|
||||
// Look for delimiters
|
||||
tmpText.replace(regexp, function(match, matchOffset) {
|
||||
// Create a new section with the text preceding the delimiter
|
||||
addSection(offset, matchOffset);
|
||||
offset = matchOffset;
|
||||
});
|
||||
// Last section
|
||||
addSection(offset, text.length);
|
||||
eventMgr.onSectionsCreated(sectionList);
|
||||
}
|
||||
|
||||
markdownSectionParser.onFileOpen = parseFileContent;
|
||||
markdownSectionParser.onContentChanged = parseFileContent;
|
||||
|
||||
return markdownSectionParser;
|
||||
});
|
@ -10,14 +10,51 @@ define([
|
||||
partialRendering.settingsBlock = partialRenderingSettingsBlockHTML;
|
||||
|
||||
var converter;
|
||||
var sectionCounter = 0;
|
||||
var doFootnotes = false;
|
||||
var hasFootnotes = false;
|
||||
var currentSectionList = [];
|
||||
|
||||
var sectionList = [];
|
||||
var linkDefinition;
|
||||
var sectionsToRemove = [];
|
||||
var modifiedSections = [];
|
||||
var insertBeforeSection;
|
||||
var fileChanged = false;
|
||||
function updateSectionList(newSectionList, newLinkDefinition) {
|
||||
function updateSectionList() {
|
||||
var newSectionList = [];
|
||||
var newLinkDefinition = '\n';
|
||||
hasFootnotes = false;
|
||||
_.each(currentSectionList, function(section) {
|
||||
var text = '\n<div class="se-preview-section-delimiter"></div>\n\n' + section.text + '\n\n';
|
||||
|
||||
// Strip footnotes
|
||||
if(doFootnotes) {
|
||||
text = text.replace(/^```.*\n[\s\S]*?\n```|\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/gm, function(wholeMatch, footnote) {
|
||||
if(footnote) {
|
||||
hasFootnotes = true;
|
||||
newLinkDefinition += wholeMatch.replace(/^\s*\n/gm, '') + '\n';
|
||||
return "";
|
||||
}
|
||||
return wholeMatch;
|
||||
});
|
||||
}
|
||||
|
||||
// Strip link definitions
|
||||
text = text.replace(/^```.*\n[\s\S]*?\n```|^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm, function(wholeMatch, link) {
|
||||
if(link) {
|
||||
newLinkDefinition += wholeMatch.replace(/^\s*\n/gm, '') + '\n';
|
||||
return "";
|
||||
}
|
||||
return wholeMatch;
|
||||
});
|
||||
|
||||
// Add section to the newSectionList
|
||||
newSectionList.push({
|
||||
id: section.id,
|
||||
text: text + '\n'
|
||||
});
|
||||
});
|
||||
|
||||
modifiedSections = [];
|
||||
sectionsToRemove = [];
|
||||
insertBeforeSection = undefined;
|
||||
@ -65,47 +102,6 @@ define([
|
||||
sectionList = leftSections.concat(modifiedSections).concat(rightSections);
|
||||
}
|
||||
|
||||
var doFootnotes = false;
|
||||
var hasFootnotes = false;
|
||||
partialRendering.onSectionsCreated = function(sectionListParam) {
|
||||
|
||||
var newSectionList = [];
|
||||
var newLinkDefinition = '\n';
|
||||
hasFootnotes = false;
|
||||
_.each(sectionListParam, function(section) {
|
||||
var text = section.textWithDelimiter + '\n';
|
||||
|
||||
// Strip footnotes
|
||||
if(doFootnotes) {
|
||||
text = text.replace(/^```.*\n[\s\S]*?\n```|\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/gm, function(wholeMatch, footnote) {
|
||||
if(footnote) {
|
||||
hasFootnotes = true;
|
||||
newLinkDefinition += wholeMatch.replace(/^\s*\n/gm, '') + '\n';
|
||||
return "";
|
||||
}
|
||||
return wholeMatch;
|
||||
});
|
||||
}
|
||||
|
||||
// Strip link definitions
|
||||
text = text.replace(/^```.*\n[\s\S]*?\n```|^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm, function(wholeMatch, link) {
|
||||
if(link) {
|
||||
newLinkDefinition += wholeMatch.replace(/^\s*\n/gm, '') + '\n';
|
||||
return "";
|
||||
}
|
||||
return wholeMatch;
|
||||
});
|
||||
|
||||
// Add section to the newSectionList
|
||||
newSectionList.push({
|
||||
id: ++sectionCounter,
|
||||
text: text + '\n'
|
||||
});
|
||||
});
|
||||
|
||||
updateSectionList(newSectionList, newLinkDefinition);
|
||||
};
|
||||
|
||||
var footnoteMap = {};
|
||||
// Store one footnote elt in the footnote map
|
||||
function storeFootnote(footnoteElt) {
|
||||
@ -133,7 +129,8 @@ define([
|
||||
var isNextDelimiter = false;
|
||||
while (childNode) {
|
||||
var nextNode = childNode.nextSibling;
|
||||
if(isNextDelimiter === true && childNode.tagName == 'DIV' && childNode.className == 'se-section-delimiter') {
|
||||
var isDelimiter = childNode.className == 'se-preview-section-delimiter';
|
||||
if(isNextDelimiter === true && childNode.tagName == 'DIV' && isDelimiter) {
|
||||
// Stop when encountered the next delimiter
|
||||
break;
|
||||
}
|
||||
@ -142,7 +139,7 @@ define([
|
||||
_.each(childNode.querySelectorAll("ol > li"), storeFootnote);
|
||||
}
|
||||
else {
|
||||
sectionElt.appendChild(childNode);
|
||||
isDelimiter || sectionElt.appendChild(childNode);
|
||||
}
|
||||
childNode = nextNode;
|
||||
}
|
||||
@ -182,9 +179,14 @@ define([
|
||||
}
|
||||
}
|
||||
|
||||
partialRendering.onSectionsCreated = function(sectionListParam) {
|
||||
currentSectionList = sectionListParam;
|
||||
};
|
||||
|
||||
partialRendering.onPagedownConfigure = function(editor) {
|
||||
converter = editor.getConverter();
|
||||
converter.hooks.chain("preConversion", function() {
|
||||
updateSectionList();
|
||||
var result = _.map(modifiedSections, function(section) {
|
||||
return section.text;
|
||||
});
|
||||
|
@ -23,68 +23,48 @@ define([
|
||||
offsetBegin = offsetBeginParam;
|
||||
};
|
||||
|
||||
var $textareaElt;
|
||||
var $textareaHelperElt;
|
||||
var $editorElt;
|
||||
var $previewElt;
|
||||
var mdSectionList = [];
|
||||
var htmlSectionList = [];
|
||||
var lastEditorScrollTop;
|
||||
var lastPreviewScrollTop;
|
||||
var buildSections = _.debounce(function() {
|
||||
|
||||
if(!isPreviewVisible) {
|
||||
return;
|
||||
}
|
||||
mdSectionList = [];
|
||||
var mdTextOffset = 0;
|
||||
var mdSectionOffset = 0;
|
||||
var mdSectionOffset;
|
||||
var firstSectionOffset = offsetBegin;
|
||||
var padding = 0;
|
||||
function addTextareaSection(sectionText) {
|
||||
var sectionHeight = padding;
|
||||
if(sectionText !== undefined) {
|
||||
var textNode = document.createTextNode(sectionText);
|
||||
$textareaHelperElt.empty().append(textNode);
|
||||
sectionHeight += $textareaHelperElt.prop('scrollHeight');
|
||||
}
|
||||
var newSectionOffset = mdSectionOffset + sectionHeight;
|
||||
var scrollHeight;
|
||||
if(window.lightMode) {
|
||||
var editorScrollTop = $editorElt.scrollTop();
|
||||
$editorElt.find(".wmd-input-section").each(function() {
|
||||
if(mdSectionOffset === undefined) {
|
||||
// Force start to 0 for the first section
|
||||
mdSectionOffset = 0;
|
||||
return;
|
||||
}
|
||||
var $delimiterElt = $(this);
|
||||
// Consider div scroll position
|
||||
var newSectionOffset = $delimiterElt.position().top + editorScrollTop;
|
||||
mdSectionList.push({
|
||||
startOffset: mdSectionOffset,
|
||||
endOffset: newSectionOffset,
|
||||
height: newSectionOffset - mdSectionOffset
|
||||
});
|
||||
mdSectionOffset = newSectionOffset;
|
||||
});
|
||||
// Last section
|
||||
scrollHeight = $editorElt.prop('scrollHeight');
|
||||
mdSectionList.push({
|
||||
startOffset: mdSectionOffset,
|
||||
endOffset: newSectionOffset,
|
||||
height: sectionHeight
|
||||
});
|
||||
mdSectionOffset = newSectionOffset;
|
||||
}
|
||||
if(window.lightMode) {
|
||||
// Special treatment for light mode
|
||||
$textareaHelperElt.innerWidth($textareaElt.innerWidth());
|
||||
_.each(sectionList, function(section, index) {
|
||||
var sectionText = section.text;
|
||||
if(index !== sectionList.length - 1) {
|
||||
if(sectionText.length === 0) {
|
||||
sectionText = undefined;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(/\n$/.test(sectionText)) {
|
||||
// Need to add a line break to take into account a final empty line
|
||||
sectionText += '\n';
|
||||
}
|
||||
}
|
||||
addTextareaSection(sectionText);
|
||||
});
|
||||
|
||||
// Apply a coef to manage divergence in some browsers
|
||||
var theoricalHeight = _.last(mdSectionList).endOffset;
|
||||
var realHeight = $textareaElt[0].scrollHeight;
|
||||
var coef = realHeight/theoricalHeight;
|
||||
mdSectionList = _.map(mdSectionList, function(mdSection) {
|
||||
return {
|
||||
startOffset: mdSection.startOffset * coef,
|
||||
endOffset: mdSection.endOffset * coef,
|
||||
height: mdSection.height * coef,
|
||||
};
|
||||
endOffset: scrollHeight,
|
||||
height: scrollHeight - mdSectionOffset
|
||||
});
|
||||
}
|
||||
else {
|
||||
// Everything's much simpler with ACE
|
||||
var mdTextOffset = 0;
|
||||
_.each(sectionList, function(section) {
|
||||
mdTextOffset += section.text.length + firstSectionOffset;
|
||||
firstSectionOffset = 0;
|
||||
@ -101,11 +81,11 @@ define([
|
||||
});
|
||||
}
|
||||
|
||||
// Try to find corresponding sections in the preview
|
||||
// Find corresponding sections in the preview
|
||||
htmlSectionList = [];
|
||||
var htmlSectionOffset;
|
||||
var previewScrollTop = $previewElt.scrollTop();
|
||||
$previewElt.find(".preview-content > .se-section-delimiter").each(function() {
|
||||
$previewElt.find(".wmd-preview-section").each(function() {
|
||||
if(htmlSectionOffset === undefined) {
|
||||
// Force start to 0 for the first section
|
||||
htmlSectionOffset = 0;
|
||||
@ -122,7 +102,7 @@ define([
|
||||
htmlSectionOffset = newSectionOffset;
|
||||
});
|
||||
// Last section
|
||||
var scrollHeight = $previewElt.prop('scrollHeight');
|
||||
scrollHeight = $previewElt.prop('scrollHeight');
|
||||
htmlSectionList.push({
|
||||
startOffset: htmlSectionOffset,
|
||||
endOffset: scrollHeight,
|
||||
@ -141,12 +121,10 @@ define([
|
||||
var isPreviewMoving = false;
|
||||
var scrollingHelper = $('<div>');
|
||||
var doScrollLink = _.throttle(function() {
|
||||
if(mdSectionList.length === 0 || mdSectionList.length !== htmlSectionList.length) {
|
||||
// Delay
|
||||
doScrollLink();
|
||||
if(!isPreviewVisible || mdSectionList.length === 0 || mdSectionList.length !== htmlSectionList.length) {
|
||||
return;
|
||||
}
|
||||
var editorScrollTop = window.lightMode ? $textareaElt.scrollTop() : aceEditor.renderer.getScrollTop();
|
||||
var editorScrollTop = window.lightMode ? $editorElt.scrollTop() : aceEditor.renderer.getScrollTop();
|
||||
editorScrollTop < 0 && (editorScrollTop = 0);
|
||||
var previewScrollTop = $previewElt.scrollTop();
|
||||
function getDestScrollTop(srcScrollTop, srcSectionList, destSectionList) {
|
||||
@ -157,7 +135,7 @@ define([
|
||||
return srcScrollTop < section.endOffset;
|
||||
});
|
||||
if(srcSection === undefined) {
|
||||
// Something wrong in the algorithm...
|
||||
// Something very bad happened
|
||||
return;
|
||||
}
|
||||
var posInSection = (srcScrollTop - srcSection.startOffset) / (srcSection.height || 1);
|
||||
@ -211,7 +189,7 @@ define([
|
||||
if(window.lightMode) {
|
||||
destScrollTop = _.min([
|
||||
destScrollTop,
|
||||
$textareaElt.prop('scrollHeight') - $textareaElt.outerHeight()
|
||||
$editorElt.prop('scrollHeight') - $editorElt.outerHeight()
|
||||
]);
|
||||
}
|
||||
else {
|
||||
@ -228,7 +206,7 @@ define([
|
||||
return;
|
||||
}
|
||||
if(window.lightMode) {
|
||||
$textareaElt.stop('scrollLinkFx', true).animate({
|
||||
$editorElt.stop('scrollLinkFx', true).animate({
|
||||
scrollTop: destScrollTop
|
||||
}, {
|
||||
easing: 'easeOutSine',
|
||||
@ -271,6 +249,23 @@ define([
|
||||
isScrollEditor = true;
|
||||
buildSections();
|
||||
};
|
||||
|
||||
var isPreviewVisible = true;
|
||||
function setPreviewHidden() {
|
||||
isPreviewVisible = false;
|
||||
console.log(isPreviewVisible);
|
||||
}
|
||||
function setPreviewVisible() {
|
||||
isPreviewVisible = true;
|
||||
console.log(isPreviewVisible);
|
||||
}
|
||||
|
||||
scrollLink.onLayoutConfigure = function(layoutGlobalConfig) {
|
||||
layoutGlobalConfig.east__onclose = setPreviewHidden;
|
||||
layoutGlobalConfig.south__onclose = setPreviewHidden;
|
||||
layoutGlobalConfig.east__onopen_start = setPreviewVisible;
|
||||
layoutGlobalConfig.south__onclose_start = setPreviewVisible;
|
||||
};
|
||||
|
||||
scrollLink.onFileClosed = function() {
|
||||
mdSectionList = [];
|
||||
@ -279,9 +274,7 @@ define([
|
||||
var scrollAdjust = false;
|
||||
scrollLink.onReady = function() {
|
||||
$previewElt = $(".preview-container");
|
||||
$textareaElt = $("#wmd-input");
|
||||
// This helper is used to measure sections height in light mode
|
||||
$textareaHelperElt = $('.textarea-helper');
|
||||
$editorElt = $("#wmd-input");
|
||||
|
||||
$previewElt.scroll(function() {
|
||||
if(isPreviewMoving === false && scrollAdjust === false) {
|
||||
@ -299,7 +292,7 @@ define([
|
||||
}
|
||||
};
|
||||
if(window.lightMode) {
|
||||
$textareaElt.scroll(handleEditorScroll);
|
||||
$editorElt.scroll(handleEditorScroll);
|
||||
}
|
||||
else {
|
||||
aceEditor.session.on("changeScrollTop", handleEditorScroll);
|
||||
|
@ -121,7 +121,7 @@ define([
|
||||
|
||||
toc.onPagedownConfigure = function(editor) {
|
||||
previewContentsElt = document.getElementById('preview-contents');
|
||||
var tocExp = new RegExp("^" + toc.config.marker + "$");
|
||||
var tocExp = new RegExp("^\\s*" + toc.config.marker + "\\s*$");
|
||||
// Run TOC generation when conversion is finished directly on HTML
|
||||
editor.hooks.chain("onPreviewRefresh", function() {
|
||||
var tocEltList = document.querySelectorAll('.table-of-contents, .toc');
|
||||
|
@ -100,7 +100,7 @@ define([
|
||||
{
|
||||
element: '.navbar-inner > .nav .button-publish, .navbar .right-buttons-dropdown > .nav > .btn:not(:hidden)',
|
||||
title: 'Update publication',
|
||||
content: 'Once published, use the <i class="icon-share"></i> <code>Publish</code> button to update the publication.',
|
||||
content: 'Once published, use the <i class="icon-upload"></i> <code>Publish</code> button to update the publication.',
|
||||
placement: 'left',
|
||||
reflex: true,
|
||||
},
|
||||
|
@ -17,30 +17,27 @@ define([
|
||||
};
|
||||
|
||||
var regex = /^(\s*-{3}\s*\n([\w\W]+?)\n\s*-{3}\s*\n)?([\w\W]*)$/;
|
||||
yamlFrontMatterParser.onPagedownConfigure = function(editor) {
|
||||
var converter = editor.getConverter();
|
||||
converter.hooks.chain("preConversion", function(text) {
|
||||
var results = regex.exec(text);
|
||||
var yaml = results[2];
|
||||
yamlFrontMatterParser.onContentChanged = function(fileDesc) {
|
||||
var text = fileDesc.content;
|
||||
var results = regex.exec(text);
|
||||
var yaml = results[2];
|
||||
|
||||
if (yaml && (!fileDesc.frontMatter || fileDesc.frontMatter._yaml != yaml)) {
|
||||
fileDesc.frontMatter = undefined;
|
||||
try {
|
||||
fileDesc.frontMatter = YAML.parse(yaml);
|
||||
if(!_.isObject(fileDesc.frontMatter)) {
|
||||
fileDesc.frontMatter = undefined;
|
||||
}
|
||||
fileDesc.frontMatter._yaml = yaml;
|
||||
fileDesc.frontMatter._frontMatter = results[1];
|
||||
}
|
||||
catch (e) {
|
||||
eventMgr.onMarkdownTrim(0);
|
||||
return text;
|
||||
if (yaml && (!fileDesc.frontMatter || fileDesc.frontMatter._yaml != yaml)) {
|
||||
fileDesc.frontMatter = undefined;
|
||||
try {
|
||||
fileDesc.frontMatter = YAML.parse(yaml);
|
||||
if(!_.isObject(fileDesc.frontMatter)) {
|
||||
fileDesc.frontMatter = undefined;
|
||||
}
|
||||
fileDesc.frontMatter._yaml = yaml;
|
||||
fileDesc.frontMatter._frontMatter = results[1];
|
||||
}
|
||||
eventMgr.onMarkdownTrim((results[1] || '').length);
|
||||
return results[3];
|
||||
});
|
||||
catch (e) {
|
||||
eventMgr.onMarkdownTrim(0);
|
||||
return text;
|
||||
}
|
||||
}
|
||||
eventMgr.onMarkdownTrim((results[1] || '').length);
|
||||
};
|
||||
|
||||
return yamlFrontMatterParser;
|
||||
|
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Copyright (C) 2013 by original authors @ fontello.com</metadata>
|
||||
<metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
|
||||
<defs>
|
||||
<font id="fontello" horiz-adv-x="1000" >
|
||||
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
||||
@ -39,18 +39,15 @@
|
||||
<glyph glyph-name="plus" unicode="" d="m786 439v-107q0-22-16-38t-38-15h-232v-233q0-22-16-37t-38-16h-107q-22 0-38 16t-15 37v233h-232q-23 0-38 15t-16 38v107q0 23 16 38t38 16h232v232q0 22 15 38t38 16h107q23 0 38-16t16-38v-232h232q22 0 38-16t16-38z" horiz-adv-x="785.7" />
|
||||
<glyph glyph-name="plus-circled" unicode="" d="m679 314v72q0 14-11 25t-25 10h-143v143q0 15-11 25t-25 11h-71q-15 0-25-11t-11-25v-143h-143q-14 0-25-10t-10-25v-72q0-14 10-25t25-11h143v-142q0-15 11-25t25-11h71q15 0 25 11t11 25v142h143q14 0 25 11t11 25z m178 36q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="plus-squared" unicode="" d="m714 314v72q0 14-10 25t-25 10h-179v179q0 15-11 25t-25 11h-71q-15 0-25-11t-11-25v-179h-178q-15 0-26-10t-10-25v-72q0-14 10-25t26-10h178v-179q0-14 11-25t25-11h71q15 0 25 11t11 25v179h179q14 0 25 10t10 25z m143 304v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="plus-squared-small" unicode="" d="m500 332v-36q0-7-5-12t-13-5h-125v-125q0-8-5-13t-13-5h-35q-8 0-13 5t-5 13v125h-125q-8 0-13 5t-5 12v36q0 8 5 13t13 5h125v125q0 8 5 13t13 5h35q8 0 13-5t5-13v-125h125q8 0 13-5t5-13z m71-214v393q0 22-15 38t-38 15h-393q-22 0-38-15t-16-38v-393q0-22 16-38t38-16h393q22 0 38 16t15 38z m72 393v-393q0-51-37-88t-88-37h-393q-52 0-88 37t-37 88v393q0 52 37 88t88 37h393q52 0 88-37t37-88z" horiz-adv-x="642.9" />
|
||||
<glyph glyph-name="minus" unicode="" d="m786 439v-107q0-22-16-38t-38-15h-678q-23 0-38 15t-16 38v107q0 23 16 38t38 16h678q22 0 38-16t16-38z" horiz-adv-x="785.7" />
|
||||
<glyph glyph-name="minus-circled" unicode="" d="m679 314v72q0 14-11 25t-25 10h-429q-14 0-25-10t-10-25v-72q0-14 10-25t25-10h429q14 0 25 10t11 25z m178 36q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="minus-squared" unicode="" d="m714 314v72q0 14-10 25t-25 10h-500q-15 0-26-10t-10-25v-72q0-14 10-25t26-10h500q14 0 25 10t10 25z m143 304v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="minus-squared-alt" unicode="" d="m643 404v-36q0-8-5-13t-13-5h-464q-8 0-13 5t-5 13v36q0 7 5 12t13 5h464q8 0 13-5t5-12z m71-250v464q0 37-26 63t-63 26h-464q-37 0-63-26t-27-63v-464q0-37 27-64t63-26h464q37 0 63 26t26 64z m72 464v-464q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h464q66 0 114-48t47-113z" horiz-adv-x="785.7" />
|
||||
<glyph glyph-name="minus-squared-small" unicode="" d="m518 636q52 0 88-37t37-88v-393q0-51-37-88t-88-37h-393q-52 0-88 37t-37 88v393q0 52 37 88t88 37h393z m53-518v393q0 22-15 38t-38 15h-393q-22 0-38-15t-16-38v-393q0-22 16-38t38-16h393q22 0 38 16t15 38z m-89 232q8 0 13-5t5-13v-36q0-7-5-12t-13-5h-321q-8 0-13 5t-5 12v36q0 8 5 13t13 5h321z" horiz-adv-x="642.9" />
|
||||
<glyph glyph-name="help" unicode="" d="m393 149v-134q0-9-7-16t-15-6h-134q-9 0-16 6t-7 16v134q0 9 7 16t16 6h134q8 0 15-6t7-16z m176 335q0-30-8-56t-20-43t-31-33t-32-25t-34-19q-23-13-38-37t-15-37q0-10-7-18t-16-9h-134q-8 0-14 10t-6 21v26q0 46 37 87t79 60q33 15 47 32t14 42q0 23-26 41t-60 18q-36 0-60-16q-20-14-60-64q-7-9-17-9q-7 0-14 4l-91 70q-8 6-9 14t3 16q89 148 259 148q45 0 90-17t81-46t59-72t23-88z" horiz-adv-x="571.4" />
|
||||
<glyph glyph-name="help-circled" unicode="" d="m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65t-95 23q-136 0-207-119q-9-14 4-24l74-55q4-4 10-4q9 0 14 7q30 38 48 51q19 14 48 14q27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19t25 27t16 34t7 45z m214-107q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="info-circled" unicode="" d="m571 82v89q0 8-5 13t-12 5h-54v286q0 8-5 13t-13 5h-178q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h53v-179h-53q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h250q7 0 12 5t5 13z m-71 500v89q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-89q0-8 5-13t13-5h107q8 0 13 5t5 13z m357-232q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="info" unicode="" d="m357 100v-71q0-15-10-25t-26-11h-285q-15 0-25 11t-11 25v71q0 15 11 25t25 11h35v214h-35q-15 0-25 11t-11 25v71q0 15 11 25t25 11h214q15 0 25-11t11-25v-321h35q15 0 26-11t10-25z m-71 643v-107q0-15-11-25t-25-11h-143q-14 0-25 11t-11 25v107q0 14 11 25t25 11h143q15 0 25-11t11-25z" horiz-adv-x="357.1" />
|
||||
<glyph glyph-name="home" unicode="" d="m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264l321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322l-386-322q-7-4-13-4q-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z" horiz-adv-x="928.6" />
|
||||
<glyph glyph-name="link" unicode="" d="m812 171q0 23-15 38l-116 116q-16 16-38 16q-24 0-40-18q1-1 10-10t12-12t9-11t7-14t2-15q0-23-16-38t-38-16q-8 0-15 2t-14 7t-11 9t-12 12t-10 10q-19-17-19-40q0-23 16-38l115-116q15-15 38-15q22 0 38 15l82 81q15 16 15 37z m-392 394q0 22-15 38l-115 115q-16 16-38 16q-22 0-38-15l-82-82q-16-15-16-37q0-22 16-38l116-116q15-15 38-15q23 0 40 17q-2 2-11 11t-12 12t-8 10t-7 14t-2 16q0 22 15 38t38 15q9 0 16-2t14-7t10-8t12-12t11-11q18 17 18 41z m500-394q0-67-48-113l-82-81q-46-47-113-47q-68 0-114 48l-115 115q-46 47-46 114q0 68 49 116l-49 49q-48-49-116-49q-67 0-114 47l-116 116q-47 47-47 114t47 113l82 82q47 46 114 46q67 0 114-47l114-116q47-46 47-113q0-69-49-117l49-49q48 49 116 49q67 0 114-47l116-116q47-47 47-114z" horiz-adv-x="928.6" />
|
||||
<glyph glyph-name="unlink" unicode="" d="m245 141l-143-143q-5-5-13-5q-6 0-13 5q-5 5-5 13t5 13l143 142q6 5 13 5t13-5q5-5 5-12t-5-13z m94-23v-179q0-8-5-13t-13-5t-12 5t-5 13v179q0 8 5 13t12 5t13-5t5-13z m-125 125q0-8-5-13t-13-5h-178q-8 0-13 5t-5 13t5 13t13 5h178q8 0 13-5t5-13z m706-72q0-67-48-113l-82-81q-46-47-113-47q-68 0-114 48l-186 187q-12 11-24 31l134 10l152-153q15-15 38-15t38 15l82 81q15 16 15 37q0 23-15 38l-153 154l10 133q20-12 31-23l188-188q47-48 47-114z m-345 404l-133-10l-152 153q-16 16-38 16q-22 0-38-15l-82-82q-16-15-16-37q0-22 16-38l153-153l-10-134q-20 12-32 24l-187 187q-47 48-47 114q0 67 47 113l82 82q47 46 114 46q67 0 114-47l186-187q12-12 23-32z m354-46q0-8-5-13t-13-5h-179q-8 0-13 5t-5 13t5 12t13 5h179q8 0 13-5t5-12z m-304 303v-178q0-8-5-13t-13-5t-13 5t-5 13v178q0 8 5 13t13 5t13-5t5-13z m227-84l-143-143q-6-5-13-5t-12 5q-5 6-5 13t5 13l142 142q6 5 13 5t13-5q5-5 5-12t-5-13z" horiz-adv-x="928.6" />
|
||||
<glyph glyph-name="link-ext" unicode="" d="m786 332v-178q0-67-47-114t-114-47h-464q-67 0-114 47t-47 114v464q0 66 47 113t114 48h393q7 0 12-5t5-13v-36q0-8-5-13t-12-5h-393q-37 0-63-26t-27-63v-464q0-37 27-63t63-27h464q37 0 63 27t26 63v178q0 8 5 13t13 5h36q8 0 13-5t5-13z m214 482v-285q0-15-11-26t-25-10t-25 10l-98 99l-364-364q-5-6-13-6t-13 6l-63 63q-6 6-6 13t6 13l364 364l-99 98q-10 11-10 25t10 25t26 11h285q15 0 25-11t11-25z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="link-ext-alt" unicode="" d="m714 332v268q0 15-10 25t-25 11h-268q-24 0-33-22q-10-23 8-39l80-80l-298-298q-11-11-11-26t11-25l57-57q11-10 25-10t25 10l298 298l80-80q11-11 26-11q6 0 14 3q21 10 21 33z m143 286v-536q0-66-47-113t-114-48h-535q-67 0-114 48t-47 113v536q0 66 47 113t114 48h535q67 0 114-48t47-113z" horiz-adv-x="857.1" />
|
||||
@ -72,10 +69,6 @@
|
||||
<glyph glyph-name="thumbs-down" unicode="" d="m143 600q0 15-11 25t-25 11t-25-11t-11-25t11-25t25-11t25 11t11 25z m643-321q0 19-12 45t-30 26q8 10 14 27t5 30q0 39-29 67q10 18 10 38t-10 41t-26 30q2 16 2 31q0 47-27 70t-76 23h-71q-73 0-191-41q-3-1-16-6t-20-7t-20-6t-21-6t-18-4t-18-1h-18v-358h18q9 0 20-5t22-15t22-19t22-25t19-24t18-23t13-16q30-38 43-51q23-24 33-61t17-70t21-48q54 0 72 27t17 81q0 32-26 89t-27 89h196q28 0 50 22t22 49z m71-1q0-57-42-100t-101-42h-98q27-55 27-107q0-66-20-104q-19-39-57-57t-84-18q-28 0-50 21q-19 18-30 45t-14 51t-10 47t-17 36q-27 28-60 71q-57 73-77 86h-153q-29 0-50 21t-21 51v357q0 29 21 50t50 21h161q12 0 77 22q72 25 125 37t111 13h63q78 0 126-45t48-120v-3q33-43 33-99q0-13-1-24q21-38 21-81q0-20-5-38q27-41 27-91z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="thumbs-up-alt" unicode="" d="m143 100q0 15-11 25t-25 11q-15 0-25-11t-11-25q0-15 11-25t25-11q15 0 25 11t11 25z m89 286v-357q0-15-10-25t-26-11h-160q-15 0-25 11t-11 25v357q0 14 11 25t25 10h160q15 0 26-10t10-25z m661 0q0-48-31-83q9-25 9-43q1-42-24-76q9-32 0-66q-9-31-31-52q5-63-27-101q-36-43-110-44h-72q-37 0-80 9t-68 16t-67 22q-69 24-88 25q-15 0-26 11t-10 25v357q0 14 10 25t24 11q13 1 42 33t57 67q38 49 56 67q10 10 17 27t10 27t8 34q4 22 7 34t11 29t18 28q11 11 26 11q25 0 46-6t33-15t22-22t14-26t7-27t2-26t1-21q0-21-6-43t-10-33t-16-31q-1-4-5-10t-6-13t-5-13h155q43 0 75-32t32-75z" horiz-adv-x="928.6" />
|
||||
<glyph glyph-name="thumbs-down-alt" unicode="" d="m143 529q0-15-11-26t-25-10q-15 0-25 10t-11 26q0 15 11 25t25 10q15 0 25-10t11-25z m89-286v357q0 15-10 25t-26 11h-160q-15 0-25-11t-11-25v-357q0-15 11-25t25-11h160q15 0 26 11t10 25z m630 83q31-34 31-83q-1-44-32-75t-75-32h-155q2-8 5-14t6-12t5-10q10-21 15-32t11-32t6-43q0-14-1-22t-2-25t-7-28t-14-25t-22-23t-33-14t-46-6q-15 0-26 11q-11 11-18 27t-11 29t-7 35q-5 23-8 33t-10 27t-17 27q-18 19-56 67q-28 36-57 68t-42 33q-14 1-24 11t-10 24v358q0 15 10 25t26 11q19 0 88 24q43 15 67 22t68 16t80 9h72q74-1 110-43q32-39 27-101q22-21 31-53q9-34 0-65q25-34 24-77q0-18-9-42z" horiz-adv-x="928.6" />
|
||||
<glyph glyph-name="download" unicode="" d="m714 100q0 15-10 25t-25 11t-26-11t-10-25t10-25t26-11t25 11t10 25z m143 0q0 15-10 25t-26 11t-25-11t-10-25t10-25t25-11t26 11t10 25z m72 125v-179q0-22-16-37t-38-16h-821q-23 0-38 16t-16 37v179q0 22 16 38t38 16h259l75-76q33-32 76-32t76 32l76 76h259q22 0 38-16t16-38z m-182 318q10-23-8-40l-250-250q-10-10-25-10t-25 10l-250 250q-17 17-8 40q10 21 33 21h143v250q0 15 11 25t25 11h143q14 0 25-11t10-25v-250h143q24 0 33-21z" horiz-adv-x="928.6" />
|
||||
<glyph glyph-name="upload" unicode="" d="m714 29q0 14-10 25t-25 10t-26-10t-10-25t10-26t26-10t25 10t10 26z m143 0q0 14-10 25t-26 10t-25-10t-10-25t10-26t25-10t26 10t10 26z m72 125v-179q0-22-16-38t-38-16h-821q-23 0-38 16t-16 38v179q0 22 16 38t38 15h238q12-31 39-51t62-20h143q34 0 61 20t40 51h238q22 0 38-15t16-38z m-182 361q-9-22-33-22h-143v-250q0-15-10-25t-25-11h-143q-15 0-25 11t-11 25v250h-143q-23 0-33 22q-9 22 8 39l250 250q10 10 25 10t25-10l250-250q18-17 8-39z" horiz-adv-x="928.6" />
|
||||
<glyph glyph-name="download-cloud" unicode="" d="m714 332q0 8-5 13t-13 5h-125v196q0 8-5 13t-12 5h-108q-7 0-12-5t-5-13v-196h-125q-8 0-13-5t-5-13q0-8 5-13l196-196q5-5 13-5t13 5l196 196q5 6 5 13z m357-125q0-89-62-151t-152-63h-607q-103 0-177 73t-73 177q0 72 39 134t105 92q-1 17-1 24q0 118 84 202t202 84q87 0 159-49t105-129q40 35 93 35q59 0 101-42t42-101q0-43-23-77q72-17 119-76t46-133z" horiz-adv-x="1071.4" />
|
||||
<glyph glyph-name="upload-cloud" unicode="" d="m714 368q0 8-5 13l-196 196q-5 5-13 5t-13-5l-196-196q-5-6-5-13q0-8 5-13t13-5h125v-196q0-8 5-13t12-5h108q7 0 12 5t5 13v196h125q8 0 13 5t5 13z m357-161q0-89-62-151t-152-63h-607q-103 0-177 73t-73 177q0 72 39 134t105 92q-1 17-1 24q0 118 84 202t202 84q87 0 159-49t105-129q40 35 93 35q59 0 101-42t42-101q0-43-23-77q72-17 119-76t46-133z" horiz-adv-x="1071.4" />
|
||||
<glyph glyph-name="reply" unicode="" d="m1000 225q0-93-71-252q-2-4-6-13t-7-17t-8-12q-6-10-15-10q-9 0-13 6t-5 14q0 5 1 15t2 13q3 38 3 69q0 56-10 101t-27 77t-45 56t-59 39t-74 24t-86 12t-98 3h-125v-143q0-14-10-25t-26-11t-25 11l-285 286q-11 10-11 25t11 25l285 286q11 10 25 10t26-10t10-25v-143h125q398 0 488-225q30-75 30-186z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="reply-all" unicode="" d="m357 246v-39q0-23-22-33q-7-3-14-3q-15 0-25 11l-285 286q-11 10-11 25t11 25l285 286q17 17 39 7q22-9 22-32v-39l-221-222q-11-11-11-25t11-25z m643-21q0-32-9-74t-22-77t-27-70t-22-51l-12-22q-4-10-15-10q-3 0-5 1q-14 4-13 19q24 223-59 315q-36 40-95 62t-150 29v-140q0-23-21-33q-8-3-14-3q-15 0-25 11l-286 286q-11 10-11 25t11 25l286 286q16 17 39 7q21-9 21-32v-147q230-15 335-123q94-97 94-284z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="forward" unicode="" d="m1000 493q0-15-11-25l-285-286q-11-11-25-11t-26 11t-10 25v143h-125q-55 0-98-3t-86-12t-74-24t-59-39t-45-56t-27-77t-10-101q0-31 3-69q0-4 2-13t1-15q0-8-5-14t-13-6q-9 0-15 10q-4 5-8 12t-7 17t-6 13q-71 159-71 252q0 111 30 186q90 225 488 225h125v143q0 14 10 25t26 10t25-10l285-286q11-11 11-25z" horiz-adv-x="1000" />
|
||||
@ -161,17 +154,17 @@
|
||||
<glyph glyph-name="angle-double-up" unicode="" d="m600 118q0-7-6-13l-28-28q-5-5-12-5t-13 5l-220 219l-219-219q-5-5-13-5t-13 5l-27 28q-6 6-6 13t6 13l260 260q5 5 12 5t13-5l260-260q6-6 6-13z m0 214q0-7-6-13l-28-28q-5-5-12-5t-13 5l-220 220l-219-220q-5-5-13-5t-13 5l-27 28q-6 6-6 13t6 13l260 260q5 6 12 6t13-6l260-260q6-6 6-13z" horiz-adv-x="642.9" />
|
||||
<glyph glyph-name="angle-double-down" unicode="" d="m600 368q0-7-6-13l-260-260q-5-6-13-6t-12 6l-260 260q-6 6-6 13t6 13l27 28q6 5 13 5t13-5l219-220l220 220q5 5 13 5t12-5l28-28q6-6 6-13z m0 214q0-7-6-13l-260-260q-5-5-13-5t-12 5l-260 260q-6 6-6 13t6 13l27 28q6 5 13 5t13-5l219-220l220 220q5 5 13 5t12-5l28-28q6-6 6-13z" horiz-adv-x="642.9" />
|
||||
<glyph glyph-name="down" unicode="" d="m427 125q4-10-3-19l-195-215q-6-5-13-5q-8 0-13 5l-198 215q-8 9-3 19q5 11 16 11h125v696q0 8 5 13t13 5h107q8 0 13-5t5-13v-696h125q11 0 16-11z" horiz-adv-x="428.6" />
|
||||
<glyph glyph-name="left" unicode="" d="m964 352q0-8-5-14l-215-197q-9-8-19-4q-11 5-11 17v125h-696q-8 0-13 5t-5 12v108q0 7 5 12t13 5h696v125q0 12 11 17t19-3l215-196q5-5 5-12z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="right" unicode="" d="m1000 404v-108q0-7-5-12t-13-5h-696v-125q0-12-11-17t-19 3l-215 196q-5 5-5 12q0 8 5 14l215 197q9 8 19 4q11-5 11-17v-125h696q8 0 13-5t5-12z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="left" unicode="" d="m964 352q0-8-5-14l-215-197q-9-8-19-4q-11 5-11 17v125h-696q-8 0-13 5t-5 12v108q0 7 5 12t13 5h696v125q0 12 11 17t19-3l215-196q5-5 5-12z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="up" unicode="" d="m427 575q-5-11-16-11h-125v-696q0-8-5-13t-13-5h-107q-8 0-13 5t-5 13v696h-125q-12 0-16 11t3 19l195 215q5 5 13 5q7 0 13-5l198-215q7-9 3-19z" horiz-adv-x="428.6" />
|
||||
<glyph glyph-name="down-big" unicode="" d="m899 386q0-30-21-50l-363-364q-22-21-51-21q-29 0-50 21l-363 364q-21 20-21 50q0 29 21 51l41 41q22 21 51 21q29 0 50-21l164-164v393q0 29 21 50t51 22h71q29 0 50-22t21-50v-393l164 164q21 21 51 21q29 0 50-21l42-42q21-21 21-50z" horiz-adv-x="928.6" />
|
||||
<glyph glyph-name="music" unicode="" d="m857 725v-625q0-28-19-50t-48-33t-58-18t-53-6t-54 6t-58 18t-48 33t-19 50t19 50t48 33t58 18t54 6q58 0 107-22v300l-429-132v-396q0-28-19-50t-48-33t-58-18t-53-6t-54 6t-58 18t-48 33t-19 50t19 50t48 34t58 17t54 6q58 0 107-21v539q0 17 10 32t28 19l464 143q7 3 16 3q22 0 38-16t15-38z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="left-big" unicode="" d="m857 350v-71q0-30-18-51t-47-21h-393l164-164q21-20 21-50t-21-50l-42-43q-21-20-51-20q-29 0-50 20l-364 364q-20 21-20 50q0 29 20 51l364 363q21 21 50 21q29 0 51-21l42-42q21-21 21-50t-21-51l-164-164h393q29 0 47-20t18-51z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="right-big" unicode="" d="m821 314q0-30-20-50l-363-364q-22-20-51-20q-29 0-50 20l-42 42q-22 21-22 51t22 51l163 163h-393q-29 0-47 21t-18 51v71q0 30 18 51t47 20h393l-163 164q-22 21-22 51t22 50l42 42q21 21 50 21q29 0 51-21l363-363q20-20 20-51z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="up-big" unicode="" d="m899 308q0-28-21-50l-42-42q-21-21-50-21q-30 0-51 21l-164 164v-393q0-29-20-47t-51-19h-71q-30 0-51 19t-21 47v393l-164-164q-20-21-50-21t-50 21l-42 42q-21 21-21 50q0 30 21 51l363 363q20 21 50 21q30 0 51-21l363-363q21-22 21-51z" horiz-adv-x="928.6" />
|
||||
<glyph glyph-name="right-hand" unicode="" d="m143 100q0 15-11 25t-25 11t-25-11t-11-25t11-25t25-11t25 11t11 25z m786 321q0 29-22 50t-50 22h-321q0 11 8 27t19 31t18 38t8 47q0 37-25 54t-64 17q-13 0-50-77q-14-25-21-37q-22-35-62-81q-40-45-57-59q-38-32-78-32h-18v-357h18q40 0 93-18t108-35t100-18q106 0 106 93q0 14-3 31q17 9 27 30t9 41t-10 38q30 28 30 66q0 14-6 31t-14 27h185q29 0 50 21t22 50z m71 1q0-59-42-101t-101-42h-94q-2-35-21-67q2-12 2-24q0-56-34-99q1-78-47-123t-127-45q-74 0-179 39q-92 33-125 33h-161q-29 0-50 21t-21 50v357q0 30 21 51t50 21h161q6 0 12 2t13 8t13 10t13 13t12 12t10 12t8 9q36 42 56 72q7 12 18 35t21 40t23 35t30 28t39 10q70 0 115-38t46-105q0-38-13-72h209q58 0 101-42t42-100z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="left-hand" unicode="" d="m768 64h18v357h-18q-20 0-38 7t-35 21t-28 25t-27 31q-1 1-2 2t-2 3t-3 2q-40 46-62 81q-8 13-21 38q-1 2-6 13t-11 20t-11 20t-12 17t-10 6q-40 0-64-17t-25-54q0-24 8-47t19-38t18-31t8-27h-321q-28 0-50-22t-22-50q0-29 22-50t50-21h185q-9-9-14-26t-6-31q0-39 30-67q-10-18-10-38t9-41t27-30q-2-13-2-31q0-47 27-70t75-23q47 0 102 18t109 35t93 18z m161 36q0 15-11 25t-25 11t-25-11t-11-25t11-25t25-11t25 11t11 25z m71 321v-357q0-29-21-50t-50-21h-161q-33 0-125-33q-106-39-176-39q-80 0-129 44t-48 121l0 3q-34 42-34 99q0 12 2 24q-19 32-21 67h-94q-59 0-101 42t-42 101q0 57 42 100t101 42h209q-13 34-13 72q0 68 46 105t115 37q21 0 39-9t30-28t23-35t21-40t18-35q20-30 56-72q1-1 8-9t10-12t12-12t13-13t13-10t13-8t12-2h161q29 0 50-21t21-51z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="up-hand" unicode="" d="m714-43q0 15-10 25t-25 11t-26-11t-10-25t10-25t26-11t25 11t10 25z m72 426q0 106-93 106q-15 0-32-3q-9 17-29 27t-41 9t-39-10q-27 30-66 30q-14 0-31-6t-26-14v185q0 29-22 50t-50 22q-28 0-50-22t-21-50v-321q-11 0-27 8t-31 19t-38 18t-47 8q-37 0-55-25t-17-64q0-13 78-50q25-14 36-21q36-22 81-62q45-40 59-57q32-38 32-78v-18h357v18q0 40 18 93t36 108t18 100z m71 3q0-74-38-179q-33-92-33-125v-161q0-29-21-50t-51-21h-357q-29 0-50 21t-21 50v161q0 6-3 12t-8 13t-10 13t-12 13t-12 12t-12 10t-10 8q-41 36-72 56q-11 7-34 18t-40 21t-36 23t-27 30t-10 39q0 70 37 115t106 46q38 0 71-13v209q0 58 43 101t100 42q58 0 101-42t42-101v-94q35-2 66-21q12 2 24 2q57 0 100-34q77 1 122-47t45-127z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="down-hand" unicode="" d="m786 314q0 47-18 102t-36 109t-18 93v18h-357v-18q0-20-7-38t-20-35t-26-28t-30-27q-5-4-8-7q-45-40-81-62q-12-8-38-21q-1-1-12-6t-20-11t-20-11t-17-12t-7-10q0-40 17-65t55-24q24 0 47 8t38 18t31 19t27 8v-321q0-28 21-50t50-22q29 0 50 22t22 50v184q25-19 57-19q39 0 66 30q18-11 39-11t41 10t29 27q14-2 32-2q47 0 70 27t23 75z m-72 429q0 14-10 25t-25 11t-26-11t-10-25t10-25t26-11t25 11t10 25z m143-427q0-79-43-128t-121-48l-3 0q-43-34-100-34q-12 0-24 2q-30-17-66-21v-94q0-59-42-101t-101-42q-58 0-100 42t-43 101v208q-30-12-71-12q-68 0-105 46t-38 115q0 21 10 39t27 30t36 23t40 21t34 18q31 20 72 56q2 1 10 8t12 10t12 12t12 13t10 13t8 13t3 12v160q0 30 21 51t50 21h357q30 0 51-21t21-51v-160q0-33 33-125q38-106 38-177z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="music" unicode="" d="m857 725v-625q0-28-19-50t-48-33t-58-18t-53-6t-54 6t-58 18t-48 33t-19 50t19 50t48 33t58 18t54 6q58 0 107-22v300l-429-132v-396q0-28-19-50t-48-33t-58-18t-53-6t-54 6t-58 18t-48 33t-19 50t19 50t48 34t58 17t54 6q58 0 107-21v539q0 17 10 32t28 19l464 143q7 3 16 3q22 0 38-16t15-38z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="left-circled" unicode="" d="m714 314v72q0 14-10 25t-25 10h-281l106 106q11 11 11 25t-11 25l-51 51q-10 10-25 10t-25-10l-202-202l-51-51q-10-10-10-25t10-25l51-51l202-202q10-10 25-10t25 10l51 51q10 10 10 25t-10 25l-106 106h281q14 0 25 10t10 25z m143 36q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="right-circled" unicode="" d="m717 350q0 15-10 25l-51 51l-202 202q-10 10-25 10t-25-10l-51-51q-10-10-10-25t10-25l106-106h-280q-15 0-26-10t-10-25v-72q0-14 10-25t26-10h280l-106-106q-10-10-10-25t10-25l51-51q10-10 25-10t25 10l202 202l51 51q10 10 10 25z m140 0q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="up-circled" unicode="" d="m717 351q0 15-11 25l-202 202l-50 50q-10 11-25 11t-26-11l-50-50l-202-202q-10-10-10-25t10-26l50-50q11-10 26-10t25 10l105 105v-280q0-14 11-25t25-11h71q15 0 25 11t11 25v280l105-105q11-11 26-11t25 11l50 50q11 11 11 26z m140-1q0-117-57-215t-156-156t-215-58t-216 58t-155 156t-58 215t58 215t155 156t216 58t215-58t156-156t57-215z" horiz-adv-x="857.1" />
|
||||
@ -317,13 +310,18 @@
|
||||
<glyph glyph-name="target" unicode="" d="m521 407l0 162q60-16 103-60t59-102l-162 0z m0-113l162 0q-16-59-59-103t-103-59l0 162z m-113 113l-162 0q16 59 59 102t103 60l0-162z m0-113l0-162q-60 16-103 59t-59 103l162 0z m113 390l0 113q152-19 261-128t129-262l-113 0q-18 107-95 183t-182 94z m-390-277l-113 0q19 152 128 261t262 129l0-113q-106-18-182-94t-95-183z m277-390l0-114q-154 19-262 129t-128 262l113 0q18-107 95-183t182-94z m390 277l113 0q-21-153-129-262t-261-129l0 114q105 18 182 94t95 183z" horiz-adv-x="928" />
|
||||
<glyph glyph-name="layers" unicode="" d="m18 183l446-112l447 112l0-112l-447-112l-446 112l0 112z m0 223l446-112l447 112l0-112l-447-111l-446 111l0 112z m0 223l446 112l447-112l0-111l-447-112l-446 112l0 111z" horiz-adv-x="928" />
|
||||
<glyph glyph-name="chart-bar" unicode="" d="m688-97l0 894l223 0l0-894l-223 0z m-335 0l0 671l223 0l0-671l-223 0z m-335 0l0 448l223 0l0-448l-223 0z" horiz-adv-x="928" />
|
||||
<glyph glyph-name="link" unicode="" d="m8 96q-17 66 0 132t67 115l131 131q49 49 115 67t131 0t116-67q20-20 20-49t-20-50t-50-20t-49 20q-35 34-82 34t-81-34l-132-131q-33-34-33-82t33-82q34-33 82-33t81 33l27 28q78-38 164-36l-91-91q-49-49-115-66t-132 0t-115 66t-67 115z m291 180q0 29 21 49q20 21 49 21t50-21q33-34 81-34t82 34l131 132q34 34 34 81t-34 81q-33 34-81 34t-82-34l-27-26q-77 36-164 35l91 91q50 49 116 66t131 0t115-66q49-49 67-115t0-132t-67-115l-131-131q-49-49-115-67t-132 0t-114 67q-21 21-21 50z" horiz-adv-x="887.2" />
|
||||
<glyph glyph-name="download" unicode="" d="m0 84v73q0 33 24 56t57 24t56-24t24-56v-73q0-17 12-29t30-13h531q18 0 30 13t12 29v73q0 33 24 56t56 24t57-24t24-56v-73q0-84-59-143t-144-60h-531q-84 0-144 60t-59 143z m155 359q0 33 24 57q23 23 56 23t57-23l105-106v344q0 33 24 57t56 23t57-23t24-57v-344l110 110q24 24 57 24t56-24q24-23 24-56t-24-57l-247-247q-24-25-57-25q-32 0-56 25l-242 242q-24 24-24 57z" horiz-adv-x="937.5" />
|
||||
<glyph glyph-name="upload" unicode="" d="m0 84v73q0 33 24 56t57 24t56-24t24-56v-73q0-17 12-29t30-13h531q18 0 30 13t12 29v73q0 33 24 56t56 24t57-24t24-56v-73q0-84-59-143t-144-60h-531q-84 0-143 59t-60 144z m155 407q0 33 24 57l247 247q23 23 57 23q33 0 56-23l243-242q23-24 23-57t-23-57q-24-23-57-23t-57 23l-105 105v-344q0-33-24-57t-56-24q-33 0-57 24t-24 57v344l-110-110q-24-23-57-23t-56 23t-24 57z" horiz-adv-x="937.5" />
|
||||
<glyph glyph-name="download-cloud" unicode="" d="m0 274q2 54 23 103t63 87t95 61q64 28 154 15q39 79 113 127t164 49q83 0 152-41t109-111t40-148v-29h7q80 32 159-4t112-113q31-81-4-159t-113-113l-17-4t-16-4t-13-3t-15-2t-13-1h-724q-84 0-154 49t-102 134q-23 52-20 107z m448 103q-6-9 4-20l131-219q8-8 15-8q3 0 7 2t6 4l1 2l140 219q6 12 0 21t-22 9h-52v102h-153v-102h-59q-12 0-18-10z" horiz-adv-x="1205.6" />
|
||||
<glyph glyph-name="upload-cloud" unicode="" d="m0 251q-2 45 10 86t34 78t58 65t77 44q77 30 156 13q36 81 111 130t166 49q62 0 118-24t97-65t65-97t25-119q0-9-2-27q1 0 3 1t3 2q80 31 159-4t110-116q20-55 12-108t-43-96t-88-65q-35-13-73-14h-298v168h68q19 0 25 11t-4 26l-171 275q-6 10-16 10q-4 0-8-3t-6-5l-2-2l-171-275q-10-15-3-26t25-11h67v-168h-224v1q-86 0-158 48t-103 131q-17 42-19 87z" horiz-adv-x="1205.1" />
|
||||
<glyph glyph-name="share" unicode="" d="m0 90v490q0 70 50 119t119 50h129q29 0 48-20t20-46q0-29-20-48t-48-20h-129q-15 0-25-10t-10-25v-490q0-14 10-25t25-10h588q15 0 25 10t10 25v60q0 27 20 47t46 20q28 0 48-20t19-47v-60q0-70-49-119t-119-50h-588q-70 0-119 50t-50 119z m244 90q45 81 121 132t167 59q42 3 74-2v-103q0-22 11-30t27 4l283 207q10 8 10 19q0 6-2 11t-6 7l-2 2l-283 207q-15 12-27 4t-11-30v-84q-7 0-20-1q-73-7-137-41t-109-89t-72-124t-24-148z" horiz-adv-x="937.5" />
|
||||
<glyph glyph-name="hdd" unicode="" d="m0 171v200q0 26 17 45h0l93 123q21 29 57 29h66q112 31 269 31q157 0 269-31h65q37 0 58-29l93-123h0q17-19 17-45v-200q0-29-21-49t-49-21h-864q-29 0-49 21t-21 49z m99 60q0-15 11-26t27-11h88q15 0 26 11t11 26t-11 27t-26 11h-88q-16 0-27-11t-11-27z m73 236q0-23 44-41t120-30t166-11t166 11t120 30t44 41t-44 41t-120 30t-166 11t-166-11t-120-30t-44-41z m146-236q0-15 11-26t26-11h11q15 0 26 11t11 26t-11 27t-26 11h-11q-15 0-26-11t-11-27z m85 236q0 10 29 17t70 8q40 0 69-8t29-17t-29-17t-69-8q-41 0-70 8t-29 17z" horiz-adv-x="1004.4" />
|
||||
<glyph glyph-name="trash" unicode="" d="m0 633l0 141l289 0l0 76l246 0l0-76l289 0l0-141l-824 0z m43-783l0 676l738 0l0-676l-738 0z" horiz-adv-x="824" />
|
||||
<glyph glyph-name="folder" unicode="" d="m0-52l0 715l139 0l68 90l217 0l68-90l508 0l0-715l-1000 0z" horiz-adv-x="1000" />
|
||||
<glyph glyph-name="code" unicode="" d="m1000 849l500-500l-500-500l-154 154l346 346l-346 346z m-692-500l346-346l-154-154l-500 500l500 500l154-154z" horiz-adv-x="1500" />
|
||||
<glyph glyph-name="folder-open" unicode="" d="m1313 632h-1235q9 48 27 67q16 17 31 17h4q4-1 8-1q12 0 26 4q18 6 25 29l24 72q77 29 208 29q89 0 164-29l25-72q24-23 33-26t43-3h485q84 0 110-22q12-11 22-65z m78-164v-10l-68-523q-5-35-33-61t-65-25h-1058q-36 0-65 25t-34 61l-67 523q-1 3-1 10q0 33 23 55t55 21h1235q33 0 56-21t22-55z" horiz-adv-x="1391" />
|
||||
<glyph glyph-name="left-big" unicode="" d="m857 350v-71q0-30-18-51t-47-21h-393l164-164q21-20 21-50t-21-50l-42-43q-21-20-51-20q-29 0-50 20l-364 364q-20 21-20 50q0 29 20 51l364 363q21 21 50 21q29 0 51-21l42-42q21-21 21-50t-21-51l-164-164h393q29 0 47-20t18-51z" horiz-adv-x="857.1" />
|
||||
<glyph glyph-name="down-hand" unicode="" d="m786 314q0 47-18 102t-36 109t-18 93v18h-357v-18q0-20-7-38t-20-35t-26-28t-30-27q-5-4-8-7q-45-40-81-62q-12-8-38-21q-1-1-12-6t-20-11t-20-11t-17-12t-7-10q0-40 17-65t55-24q24 0 47 8t38 18t31 19t27 8v-321q0-28 21-50t50-22q29 0 50 22t22 50v184q25-19 57-19q39 0 66 30q18-11 39-11t41 10t29 27q14-2 32-2q47 0 70 27t23 75z m-72 429q0 14-10 25t-25 11t-26-11t-10-25t10-25t26-11t25 11t10 25z m143-427q0-79-43-128t-121-48l-3 0q-43-34-100-34q-12 0-24 2q-30-17-66-21v-94q0-59-42-101t-101-42q-58 0-100 42t-43 101v208q-30-12-71-12q-68 0-105 46t-38 115q0 21 10 39t27 30t36 23t40 21t34 18q31 20 72 56q2 1 10 8t12 10t12 12t12 13t10 13t8 13t3 12v160q0 30 21 51t50 21h357q30 0 51-21t21-51v-160q0-33 33-125q38-106 38-177z" horiz-adv-x="857.1" />
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
Before Width: | Height: | Size: 140 KiB After Width: | Height: | Size: 139 KiB |
Binary file not shown.
Binary file not shown.
@ -62,20 +62,6 @@
|
||||
</div>
|
||||
<div class=dropdown-header>EXPORT</div>
|
||||
<div class="list-group">
|
||||
<a href="#" data-toggle="collapse" data-target=".collapse-save-as"
|
||||
class="list-group-item"><i class="icon-hdd"></i> Save...</a>
|
||||
<div class="sub-menu collapse collapse-save-as clearfix">
|
||||
<ul class="nav">
|
||||
<li><a class="action-download-md" href="#"><i
|
||||
class="icon-download"></i> Save as Markdown</a></li>
|
||||
<li><a class="action-download-html" href="#"><i
|
||||
class="icon-download"></i> Save as HTML</a></li>
|
||||
<li><a class="action-download-template" href="#"><i
|
||||
class="icon-download"></i> Save using template</a></li>
|
||||
<li><a class="action-download-pdf" href="#"><i
|
||||
class="icon-download"></i> Save as PDF</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a href="#" data-toggle="collapse" data-target=".collapse-synchronize"
|
||||
class="list-group-item"><i
|
||||
class="icon-refresh"></i> Synchronize...</a>
|
||||
@ -87,13 +73,13 @@
|
||||
</ul>
|
||||
<ul class="nav">
|
||||
<li><a href="#" class="action-sync-export-dialog-dropbox"><i
|
||||
class="icon-provider-dropbox"></i> Export to Dropbox</a></li>
|
||||
class="icon-provider-dropbox"></i> Save on Dropbox</a></li>
|
||||
<li><a href="#" class="submenu-sync-gdrive action-sync-export-dialog-gdrive"><i
|
||||
class="icon-provider-gdrive"></i> Export to Google Drive</a></li>
|
||||
class="icon-provider-gdrive"></i> Save on Google Drive</a></li>
|
||||
<li><a href="#" class="submenu-sync-gdrivesec action-sync-export-dialog-gdrivesec"><i
|
||||
class="icon-provider-gdrive"></i> Export to Google Drive <small>(2nd account)</small></a></li>
|
||||
class="icon-provider-gdrive"></i> Save on Google Drive <small>(2nd account)</small></a></li>
|
||||
<li><a href="#" class="submenu-sync-gdriveter action-sync-export-dialog-gdriveter"><i
|
||||
class="icon-provider-gdrive"></i> Export to Google Drive <small>(3rd account)</small></a></li>
|
||||
class="icon-provider-gdrive"></i> Save on Google Drive <small>(3rd account)</small></a></li>
|
||||
<li><a href="#" class="submenu-sync-gdrive action-autosync-dialog-gdrive"><i
|
||||
class="icon-provider-gdrive"></i> Google Drive AutoSync</a></li>
|
||||
<li><a href="#" class="submenu-sync-gdrivesec action-autosync-dialog-gdrivesec"><i
|
||||
@ -103,15 +89,15 @@
|
||||
</ul>
|
||||
</div>
|
||||
<a href="#" data-toggle="collapse" data-target=".collapse-publish-on"
|
||||
class="list-group-item"><i class="icon-share"></i> Publish...</a>
|
||||
class="list-group-item"><i class="icon-upload"></i> Publish...</a>
|
||||
<div class="sub-menu collapse collapse-publish-on clearfix">
|
||||
<ul class="nav alert alert-danger show-already-published">
|
||||
<li><div>"<span class="file-title"></span>" is already published.</div></li>
|
||||
<li><a href="#" class="action-update-publication"
|
||||
data-toggle="collapse" data-target=".menu-panel"><i class="icon-share"></i>
|
||||
data-toggle="collapse" data-target=".menu-panel"><i class="icon-upload"></i>
|
||||
Update publication</a></li>
|
||||
<li><a href="#" data-toggle="modal" data-target=".modal-manage-publish"
|
||||
class="action-reset-input"><i class="icon-share"></i>
|
||||
class="action-reset-input"><i class="icon-upload"></i>
|
||||
Manage publishing</a></li>
|
||||
</ul>
|
||||
<ul class="nav publish-on-provider-list">
|
||||
@ -119,17 +105,31 @@
|
||||
</div>
|
||||
<a href="#" data-toggle="modal" data-target=".modal-manage-sharing"
|
||||
class="action-reset-input list-group-item"><i class="icon-provider-stackedit"></i>
|
||||
Sharing...</a>
|
||||
Sharing links</a>
|
||||
<a href="#" data-toggle="collapse" data-target=".collapse-save-as"
|
||||
class="list-group-item"><i class="icon-hdd"></i> Export to disk</a>
|
||||
<div class="sub-menu collapse collapse-save-as clearfix">
|
||||
<ul class="nav">
|
||||
<li><a class="action-download-md" href="#"><i
|
||||
class="icon-download"></i> Export as Markdown</a></li>
|
||||
<li><a class="action-download-html" href="#"><i
|
||||
class="icon-download"></i> Export as HTML</a></li>
|
||||
<li><a class="action-download-template" href="#"><i
|
||||
class="icon-download"></i> Export using template</a></li>
|
||||
<li><a class="action-download-pdf" href="#"><i
|
||||
class="icon-download"></i> Export as PDF</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class=dropdown-header>IMPORT</div>
|
||||
<div class="list-group">
|
||||
<a data-toggle="modal"
|
||||
data-target=".modal-import-harddrive-markdown"
|
||||
class="list-group-item action-reset-input" href="#"><i
|
||||
class="icon-hdd"></i> Open from disk</a>
|
||||
class="icon-hdd"></i> Import from disk</a>
|
||||
<a data-toggle="modal" data-target=".modal-import-url"
|
||||
class="list-group-item action-reset-input" href="#"><i
|
||||
class="icon-globe"></i> Open from URL</a>
|
||||
class="icon-globe"></i> Import from URL</a>
|
||||
<a data-toggle="modal"
|
||||
data-target=".modal-import-harddrive-html"
|
||||
class="list-group-item action-reset-input" href="#"><i
|
||||
@ -380,7 +380,7 @@
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h2 class="modal-title">Open from URL</h2>
|
||||
<h2 class="modal-title">Import from URL</h2>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Please provide a link to a Markdown document.</p>
|
||||
@ -485,7 +485,7 @@
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h2 class="modal-title">Export to Dropbox</h2>
|
||||
<h2 class="modal-title">Save on Dropbox</h2>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h2 class="modal-title">Export to <%= providerName %></h2>
|
||||
<h2 class="modal-title">Save on <%= providerName %></h2>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
|
@ -793,7 +793,7 @@ $.layout.defaults = {
|
||||
, onswap_end: null // CALLBACK when pane ENDS being Swapped
|
||||
, ondrag_start: null // CALLBACK when pane STARTS being ***MANUALLY*** Resized
|
||||
, ondrag_end: null // CALLBACK when pane ENDS being ***MANUALLY*** Resized
|
||||
, onAlert: null
|
||||
, onalert: null
|
||||
}
|
||||
/*
|
||||
* PANE-SPECIFIC SETTINGS
|
||||
@ -3479,7 +3479,7 @@ $.fn.layout = function (opts) {
|
||||
if (s.minSize > s.maxSize) { // INSUFFICIENT ROOM FOR PANE TO OPEN!
|
||||
syncPinBtns(pane, false); // make sure pin-buttons are reset
|
||||
if (!noAlert && o.tips.noRoomToOpen)
|
||||
o.onAlert ? o.onAlert(o.tips.noRoomToOpen) : alert(o.tips.noRoomToOpen);
|
||||
o.onalert ? o.onalert(o.tips.noRoomToOpen) : alert(o.tips.noRoomToOpen);
|
||||
return queueNext(); // ABORT
|
||||
}
|
||||
|
||||
|
@ -100,15 +100,10 @@ Prism.languages.md = (function() {
|
||||
linktitle: /['\"\(][^\'\"\)]*['\"\)]/
|
||||
}
|
||||
};
|
||||
md.tocmarker = {
|
||||
pattern: /(^|(?:^|\n)\s*\n)[ \t]*\[(toc|TOC)\]($|\n($|\s*\n))$/g,
|
||||
inside: {
|
||||
"md md-toc": /\[(toc|TOC)\]/
|
||||
}
|
||||
};
|
||||
md.p = {
|
||||
pattern: /^[^\n]+(?:\n|$)/gm,
|
||||
pattern: /.+/g,
|
||||
inside: {
|
||||
'md md-toc': /^\s*\[(toc|TOC)\]\s*$/g
|
||||
}
|
||||
};
|
||||
md.img = {
|
||||
|
@ -1,55 +1,57 @@
|
||||
/* jshint -W084, -W099 */
|
||||
define([
|
||||
'jquery',
|
||||
'underscore',
|
||||
'eventMgr',
|
||||
'prism-core',
|
||||
'crel',
|
||||
'libs/prism-markdown'
|
||||
], function ($, eventMgr, Prism) {
|
||||
], function ($, _, eventMgr, Prism, crel) {
|
||||
|
||||
String.prototype.splice = function (i, remove, add) {
|
||||
remove = +remove || 0;
|
||||
add = add || '';
|
||||
return this.slice(0, i) + add + this.slice(i + remove);
|
||||
};
|
||||
|
||||
var preEditor = {};
|
||||
|
||||
var undoManager;
|
||||
eventMgr.addListener('onPagedownConfigure', function (pagedownEditor) {
|
||||
eventMgr.addListener('onPagedownConfigure', function(pagedownEditor) {
|
||||
// Undo manager does exist at the moment
|
||||
setTimeout(function () {
|
||||
undoManager = pagedownEditor.undoManager;
|
||||
}, 0);
|
||||
});
|
||||
|
||||
String.prototype.splice = function (i, remove, add) {
|
||||
remove = +remove || 0;
|
||||
add = add || '';
|
||||
eventMgr.addListener('onSectionsCreated', function(newSectionList) {
|
||||
updateSectionList(newSectionList);
|
||||
highlightSections();
|
||||
});
|
||||
|
||||
return this.slice(0, i) + add + this.slice(i + remove);
|
||||
};
|
||||
var fileChanged = false;
|
||||
eventMgr.addListener('onFileSelected', function() {
|
||||
fileChanged = true;
|
||||
});
|
||||
|
||||
function PreEditor(preElt) {
|
||||
var preEditor = this;
|
||||
preEditor.selectionStart = 0;
|
||||
preEditor.selectionEnd = 0;
|
||||
preEditor.scrollTop = 0;
|
||||
preEditor.$preContentElt = $('<div contenteditable class="pre-content language-md">');
|
||||
preEditor.selectionStart = 0;
|
||||
preEditor.selectionEnd = 0;
|
||||
preEditor.scrollTop = 0;
|
||||
var preElt;
|
||||
preEditor.init = function(elt) {
|
||||
preElt = elt;
|
||||
preEditor.$contentElt = $('<div contenteditable class="pre-content language-md">');
|
||||
preElt.appendChild(preEditor.$contentElt[0]);
|
||||
|
||||
preElt.appendChild(preEditor.$preContentElt[0]);
|
||||
preEditor.highlight = function () {
|
||||
setTimeout(function () {
|
||||
preEditor.selectionStart = preElt.selectionStart;
|
||||
preEditor.selectionEnd = preElt.selectionEnd;
|
||||
var startDate = Date.now();
|
||||
Prism.highlightElement(preEditor.$preContentElt[0], false, function () {
|
||||
console.log(Date.now() - startDate);
|
||||
preElt.setSelectionRange(preEditor.selectionStart, preEditor.selectionEnd);
|
||||
});
|
||||
}, 0);
|
||||
};
|
||||
|
||||
preElt.focus = function () {
|
||||
preEditor.$preContentElt.focus();
|
||||
preElt.focus = function() {
|
||||
preEditor.$contentElt.focus();
|
||||
this.setSelectionRange(preEditor.selectionStart, preEditor.selectionEnd);
|
||||
preElt.scrollTop = preEditor.scrollTop;
|
||||
};
|
||||
preEditor.$preContentElt.focus(function () {
|
||||
preEditor.$contentElt.focus(function () {
|
||||
preElt.focused = true;
|
||||
});
|
||||
preEditor.$preContentElt.blur(function () {
|
||||
preEditor.$contentElt.blur(function () {
|
||||
preElt.focused = false;
|
||||
});
|
||||
Object.defineProperty(preElt, 'value', {
|
||||
@ -57,7 +59,7 @@ define([
|
||||
return this.textContent;
|
||||
},
|
||||
set: function (value) {
|
||||
//return preEditor.$preContentElt.text(value);
|
||||
//return preEditor.$contentElt.text(value);
|
||||
var currentValue = this.textContent;
|
||||
|
||||
// Find the first modified char
|
||||
@ -70,7 +72,7 @@ define([
|
||||
startIndex++;
|
||||
}
|
||||
if (startIndex === startIndexMax) {
|
||||
return preEditor.$preContentElt.text(value);
|
||||
return preEditor.$contentElt.text(value);
|
||||
}
|
||||
|
||||
// Find the last modified char
|
||||
@ -385,7 +387,7 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
preEditor.$preContentElt.on('keydown', function (evt) {
|
||||
preEditor.$contentElt.on('keydown', function (evt) {
|
||||
var cmdOrCtrl = evt.metaKey || evt.ctrlKey;
|
||||
|
||||
switch (evt.keyCode) {
|
||||
@ -411,8 +413,144 @@ define([
|
||||
break;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var sectionList = [];
|
||||
var sectionsToRemove = [];
|
||||
var modifiedSections = [];
|
||||
var insertBeforeSection;
|
||||
function updateSectionList(newSectionList) {
|
||||
|
||||
modifiedSections = [];
|
||||
sectionsToRemove = [];
|
||||
insertBeforeSection = undefined;
|
||||
|
||||
// Render everything if file changed
|
||||
if(fileChanged === true) {
|
||||
sectionsToRemove = sectionList;
|
||||
sectionList = newSectionList;
|
||||
modifiedSections = newSectionList;
|
||||
return;
|
||||
}
|
||||
|
||||
// Find modified section starting from top
|
||||
var leftIndex = sectionList.length;
|
||||
_.some(sectionList, function(section, index) {
|
||||
if(index >= newSectionList.length || section.text != newSectionList[index].text) {
|
||||
leftIndex = index;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// Find modified section starting from bottom
|
||||
var rightIndex = -sectionList.length;
|
||||
_.some(sectionList.slice().reverse(), function(section, index) {
|
||||
if(index >= newSectionList.length || section.text != newSectionList[newSectionList.length - index - 1].text) {
|
||||
rightIndex = -index;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
if(leftIndex - rightIndex > sectionList.length) {
|
||||
// Prevent overlap
|
||||
rightIndex = leftIndex - sectionList.length;
|
||||
}
|
||||
|
||||
// Create an array composed of left unmodified, modified, right
|
||||
// unmodified sections
|
||||
var leftSections = sectionList.slice(0, leftIndex);
|
||||
modifiedSections = newSectionList.slice(leftIndex, newSectionList.length + rightIndex);
|
||||
var rightSections = sectionList.slice(sectionList.length + rightIndex, sectionList.length);
|
||||
insertBeforeSection = _.first(rightSections);
|
||||
sectionsToRemove = sectionList.slice(leftIndex, sectionList.length + rightIndex);
|
||||
sectionList = leftSections.concat(modifiedSections).concat(rightSections);
|
||||
}
|
||||
|
||||
var elapsedTime = 0;
|
||||
var timeoutId;
|
||||
function highlightSections() {
|
||||
|
||||
if(fileChanged === true) {
|
||||
fileChanged = false;
|
||||
// Perform a synchronous transformation
|
||||
preEditor.selectionStart = preElt.selectionStart;
|
||||
preEditor.selectionEnd = preElt.selectionEnd;
|
||||
var newSectionEltList = document.createDocumentFragment();
|
||||
modifiedSections.forEach(function(section) {
|
||||
highlight(section);
|
||||
newSectionEltList.appendChild(section.highlightedContent);
|
||||
});
|
||||
preEditor.$contentElt.html('');
|
||||
preEditor.$contentElt[0].appendChild(newSectionEltList);
|
||||
preElt.setSelectionRange(preEditor.selectionStart, preEditor.selectionEnd);
|
||||
return;
|
||||
}
|
||||
|
||||
// Perform an asynchronous transformation on each modified sections
|
||||
clearTimeout(timeoutId);
|
||||
//timeoutId = setTimeout(asyncHighlightSections, elapsedTime);
|
||||
preEditor.selectionStart = preElt.selectionStart;
|
||||
preEditor.selectionEnd = preElt.selectionEnd;
|
||||
Prism.highlightElement(preEditor.$contentElt[0]);
|
||||
//preElt.setSelectionRange(preEditor.selectionStart, preEditor.selectionEnd);
|
||||
}
|
||||
|
||||
return PreEditor;
|
||||
function asyncHighlightSections() {
|
||||
var startTime = Date.now();
|
||||
var deferredList = [];
|
||||
modifiedSections.forEach(function(section) {
|
||||
var deferred = $.Deferred();
|
||||
setTimeout(function() {
|
||||
highlight(section);
|
||||
deferred.resolve();
|
||||
}, 0);
|
||||
deferredList.push(deferred);
|
||||
});
|
||||
$.when.apply($, deferredList).then(function() {
|
||||
var text = _.reduce(sectionList, function(text, section) {
|
||||
return text + section.text;
|
||||
}, '');
|
||||
|
||||
// Check that the editor has the actual value
|
||||
if(preElt.textContent == text) {
|
||||
preEditor.selectionStart = preElt.selectionStart;
|
||||
preEditor.selectionEnd = preElt.selectionEnd;
|
||||
|
||||
// Remove outdated sections
|
||||
_.each(sectionsToRemove, function(section) {
|
||||
var sectionElt = document.getElementById("wmd-input-section-" + section.id);
|
||||
preEditor.$contentElt[0].removeChild(sectionElt);
|
||||
});
|
||||
|
||||
var newSectionEltList = document.createDocumentFragment();
|
||||
modifiedSections.forEach(function(section) {
|
||||
newSectionEltList.appendChild(section.highlightedContent);
|
||||
});
|
||||
|
||||
if(insertBeforeSection !== undefined) {
|
||||
var insertBeforeElt = document.getElementById("wmd-input-section-" + insertBeforeSection.id);
|
||||
preEditor.$contentElt[0].insertBefore(newSectionEltList, insertBeforeElt);
|
||||
}
|
||||
else {
|
||||
preEditor.$contentElt[0].appendChild(newSectionEltList);
|
||||
}
|
||||
|
||||
preElt.setSelectionRange(preEditor.selectionStart, preEditor.selectionEnd);
|
||||
elapsedTime = Date.now() - startTime;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function highlight(section) {
|
||||
var text = section.text.replace(/&/g, '&').replace(/</g, '<').replace(/\u00a0/g, ' ');
|
||||
var sectionElt = crel('div', {
|
||||
id: 'wmd-input-section-' + section.id,
|
||||
class: 'wmd-input-section'
|
||||
});
|
||||
sectionElt.innerHTML = Prism.highlight(text, Prism.languages.md);
|
||||
section.highlightedContent = sectionElt;
|
||||
}
|
||||
|
||||
return preEditor;
|
||||
});
|
@ -19,7 +19,6 @@ define([
|
||||
// localStorage versioning
|
||||
var version = localStorage.version;
|
||||
|
||||
// Upgrade from v0 to v1
|
||||
if(version === undefined) {
|
||||
|
||||
// Not used anymore
|
||||
@ -41,7 +40,6 @@ define([
|
||||
version = "v1";
|
||||
}
|
||||
|
||||
// Upgrade from v1 to v2
|
||||
if(version == "v1") {
|
||||
var gdriveLastChangeId = localStorage["sync.gdrive.lastChangeId"];
|
||||
if(gdriveLastChangeId) {
|
||||
@ -85,7 +83,6 @@ define([
|
||||
version = "v2";
|
||||
}
|
||||
|
||||
// Upgrade from v2 to v3
|
||||
if(version == "v2") {
|
||||
_.each(fileIndexList, function(fileIndex) {
|
||||
if(!_.has(localStorage, fileIndex + ".sync")) {
|
||||
@ -98,7 +95,6 @@ define([
|
||||
version = "v3";
|
||||
}
|
||||
|
||||
// Upgrade from v3 to v4
|
||||
if(version == "v3") {
|
||||
currentFileIndex = localStorage["file.current"];
|
||||
if(currentFileIndex !== undefined && localStorage["file.list"].indexOf(";" + currentFileIndex + ";") === -1) {
|
||||
@ -107,14 +103,12 @@ define([
|
||||
version = "v4";
|
||||
}
|
||||
|
||||
// Upgrade from v4 to v5
|
||||
if(version == "v4") {
|
||||
// Recreate GitHub token
|
||||
localStorage.removeItem("githubToken");
|
||||
version = "v5";
|
||||
}
|
||||
|
||||
// Upgrade from v5 to v6
|
||||
if(version == "v5") {
|
||||
_.each(fileIndexList, function(fileIndex) {
|
||||
var publishIndexList = retrieveIndexArray(fileIndex + ".publish");
|
||||
@ -131,7 +125,6 @@ define([
|
||||
version = "v6";
|
||||
}
|
||||
|
||||
// Upgrade from v6 to v7
|
||||
if(version == "v6") {
|
||||
currentFileIndex = localStorage["file.current"];
|
||||
if(currentFileIndex !== undefined) {
|
||||
@ -141,7 +134,6 @@ define([
|
||||
version = "v7";
|
||||
}
|
||||
|
||||
// Upgrade from v7 to v8
|
||||
if(version == "v7") {
|
||||
_.each(_.keys(localStorage), function(key) {
|
||||
var matchResult = key.match(/(file\.\S+\.)\S+/);
|
||||
@ -154,7 +146,6 @@ define([
|
||||
version = "v8";
|
||||
}
|
||||
|
||||
// Upgrade from v8 to v9
|
||||
if(version == "v8") {
|
||||
_.each(_.keys(localStorage), function(key) {
|
||||
var matchResult = key.match(/file\.\S+\.(editorEnd|editorStart)/);
|
||||
@ -165,7 +156,6 @@ define([
|
||||
version = "v9";
|
||||
}
|
||||
|
||||
// Upgrade from v9 to v10
|
||||
if(version == "v9") {
|
||||
if(_.has(localStorage, 'settings')) {
|
||||
settings = JSON.parse(localStorage.settings);
|
||||
@ -177,7 +167,6 @@ define([
|
||||
version = "v10";
|
||||
}
|
||||
|
||||
// Upgrade from v10 to v11
|
||||
if(version == "v10") {
|
||||
if(_.has(localStorage, 'settings')) {
|
||||
settings = JSON.parse(localStorage.settings);
|
||||
@ -194,7 +183,6 @@ define([
|
||||
version = "v11";
|
||||
}
|
||||
|
||||
// Upgrade from v11 to v12
|
||||
if(version == "v11") {
|
||||
// Force new theme by using themeV3 variable
|
||||
localStorage.removeItem("theme");
|
||||
@ -210,7 +198,6 @@ define([
|
||||
version = "v12";
|
||||
}
|
||||
|
||||
// Upgrade from v12/v13 to v14
|
||||
if(version == "v12" || version == "v13") {
|
||||
if(_.has(localStorage, 'settings')) {
|
||||
settings = JSON.parse(localStorage.settings);
|
||||
@ -221,7 +208,6 @@ define([
|
||||
version = "v14";
|
||||
}
|
||||
|
||||
// Upgrade from v14 to v15
|
||||
if(version == "v14") {
|
||||
if(_.has(localStorage, 'settings')) {
|
||||
settings = JSON.parse(localStorage.settings);
|
||||
@ -232,7 +218,6 @@ define([
|
||||
version = "v15";
|
||||
}
|
||||
|
||||
// Upgrade from v15 to v16
|
||||
if(version == "v15") {
|
||||
localStorage.removeItem('gdrivePermissions');
|
||||
if(_.has(localStorage, 'gdrive.lastChangeId')) {
|
||||
@ -250,7 +235,6 @@ define([
|
||||
version = "v16";
|
||||
}
|
||||
|
||||
// Upgrade from v16 to v17
|
||||
if(version == "v16") {
|
||||
_.each(_.keys(localStorage), function(key) {
|
||||
var matchResult = key.match(/(file\.\S+\.)\S+/);
|
||||
@ -263,6 +247,11 @@ define([
|
||||
version = "v17";
|
||||
}
|
||||
|
||||
if(version == "v17") {
|
||||
localStorage.removeItem('focusMode');
|
||||
version = "v18";
|
||||
}
|
||||
|
||||
localStorage.version = version;
|
||||
return localStorage;
|
||||
});
|
@ -264,7 +264,7 @@ kbd {
|
||||
|
||||
.toc ul {
|
||||
list-style-type: none;
|
||||
margin-bottom: 5px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.footnote {
|
||||
|
@ -1341,18 +1341,20 @@ a {
|
||||
color: @tertiary-color-light;
|
||||
}
|
||||
|
||||
.md {
|
||||
.md, .hr {
|
||||
color: @tertiary-color-light;
|
||||
font-style: normal;
|
||||
font-weight: 400
|
||||
font-weight: normal
|
||||
}
|
||||
|
||||
.em,.em .md {
|
||||
font-style: italic
|
||||
.em,
|
||||
.em .md {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.strong,.strong .md {
|
||||
font-weight: 600
|
||||
.strong,
|
||||
.strong .md {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.md-strike-text {
|
||||
@ -1370,64 +1372,64 @@ a {
|
||||
}
|
||||
}
|
||||
|
||||
.md-li,.md-li2,.md-li3,.md-li4,.md-li5,.md-li6,.md-li7,.md-li8,.md-li9,.md-li10,.md-li11 {
|
||||
.md-li, .md-li2, .md-li3, .md-li4, .md-li5, .md-li6, .md-li7, .md-li8, .md-li9, .md-li10, .md-li11 {
|
||||
white-space: pre-line;
|
||||
}
|
||||
|
||||
.md-li {
|
||||
padding-left: 1.2em
|
||||
padding-left: 1.2em;
|
||||
}
|
||||
|
||||
.md-li2 {
|
||||
padding-left: 2.4em
|
||||
padding-left: 2.4em;
|
||||
}
|
||||
|
||||
.md-li3 {
|
||||
padding-left: 3.6em
|
||||
padding-left: 3.6em;
|
||||
}
|
||||
|
||||
.md-li4 {
|
||||
padding-left: 4.8em
|
||||
padding-left: 4.8em;
|
||||
}
|
||||
|
||||
.md-li5 {
|
||||
padding-left: 6em
|
||||
padding-left: 6em;
|
||||
}
|
||||
|
||||
.md-li6 {
|
||||
padding-left: 7.2em
|
||||
padding-left: 7.2em;
|
||||
}
|
||||
|
||||
.md-li7 {
|
||||
padding-left: 8.4em
|
||||
padding-left: 8.4em;
|
||||
}
|
||||
|
||||
.md-li8 {
|
||||
padding-left: 9.6em
|
||||
padding-left: 9.6em;
|
||||
}
|
||||
|
||||
.md-li9 {
|
||||
padding-left: 10.8em
|
||||
padding-left: 10.8em;
|
||||
}
|
||||
|
||||
.md-li10 {
|
||||
padding-left: 12em
|
||||
padding-left: 12em;
|
||||
}
|
||||
|
||||
.md-li11 {
|
||||
padding-left: 13.2em
|
||||
padding-left: 13.2em;
|
||||
}
|
||||
|
||||
.img,
|
||||
.imgref {
|
||||
padding: 0.2em 0.4em;
|
||||
padding-right: 0
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.md-bang,
|
||||
.md-alt,
|
||||
.md-title {
|
||||
color: #666
|
||||
color: @secondary-color-dark;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user