diff --git a/public/privacy_policy.html b/public/privacy_policy.html index 6ba419fc..7acf782c 100644 --- a/public/privacy_policy.html +++ b/public/privacy_policy.html @@ -8,7 +8,7 @@

StackEdit — Privacy Policy

-

This Privacy Policy governs the manner in which StackEdit collects, uses, maintains and discloses information collected from users (each, a “User”) of the stackedit.io website (“Site”). This privacy policy applies to the Site and all products and services offered by StackEdit.

+

This Privacy Policy governs the manner in which StackEdit collects, uses, maintains and discloses information collected from users (each, a “User”) of the stackedit.io website (“Site”). This privacy policy applies to the Site and all products and services offered by StackEdit.

Personal identification information

diff --git a/public/res/editor.js b/public/res/editor.js index 67e9b783..454b4345 100644 --- a/public/res/editor.js +++ b/public/res/editor.js @@ -769,20 +769,18 @@ define([ }); var action = function(action, options) { - options = options || {}; - var textContent = getValue(); - var selectionStart = options.start || selectionMgr.selectionStart; - var selectionEnd = options.end || selectionMgr.selectionEnd; + var min = Math.min(selectionMgr.selectionStart, selectionMgr.selectionEnd); + var max = Math.max(selectionMgr.selectionStart, selectionMgr.selectionEnd); var state = { - selectionStart: selectionStart, - selectionEnd: selectionEnd, - before: textContent.slice(0, selectionStart), - after: textContent.slice(selectionEnd), - selection: textContent.slice(selectionStart, selectionEnd) + selectionStart: min, + selectionEnd: max, + before: textContent.slice(0, min), + after: textContent.slice(max), + selection: textContent.slice(min, max) }; - actions[action](state, options); + actions[action](state, options || {}); setValue(state.before + state.selection + state.after); selectionMgr.setSelectionStartEnd(state.selectionStart, state.selectionEnd); selectionMgr.updateSelectionRange(); diff --git a/public/res/extensions/umlDiagrams.js b/public/res/extensions/umlDiagrams.js index 706de80a..177cc18f 100644 --- a/public/res/extensions/umlDiagrams.js +++ b/public/res/extensions/umlDiagrams.js @@ -13,78 +13,40 @@ define([ var umlDiagrams = new Extension("umlDiagrams", "UML Diagrams", true); umlDiagrams.settingsBlock = umlDiagramsSettingsBlockHTML; - var eventMgr; - umlDiagrams.onEventMgrCreated = function(eventMgrParameter) { - eventMgr = eventMgrParameter; - }; - - var previewContentsElt; - umlDiagrams.onReady = function() { - previewContentsElt = document.getElementById('preview-contents'); - }; - - var onAsyncPreview = function(cb) { - cb(); - }; - umlDiagrams.onAsyncPreview = function(cb) { - onAsyncPreview(cb); - }; - - umlDiagrams.onInit = function() { - var sequenceDiagramEltList, flowChartEltList; - function doSequenceDiagram(cb) { - if(sequenceDiagramEltList.length === 0) { - return cb(); - } - var sequenceDiagramElt = sequenceDiagramEltList.pop(); - try { - var diagram = sequenceDiagram.parse(sequenceDiagramElt.textContent); - var preElt = sequenceDiagramElt.parentNode; - var containerElt = crel('div', { - class: 'sequence-diagram' - }); - preElt.parentNode.replaceChild(containerElt, preElt); - diagram.drawSVG(containerElt, { - theme: 'simple' - }); - } - catch(e) { - } - _.delay(doSequenceDiagram, 0, cb); - } - - function doFlowChart(cb) { - if(flowChartEltList.length === 0) { - return cb(); - } - var flowChartElt = flowChartEltList.pop(); - try { - var chart = flowChart.parse(flowChartElt.textContent); - var preElt = flowChartElt.parentNode; - var containerElt = crel('div', { - class: 'flow-chart' - }); - preElt.parentNode.replaceChild(containerElt, preElt); - chart.drawSVG(containerElt, { - 'line-width': 2 - }); - } - catch(e) { - } - _.delay(doFlowChart, 0, cb); - } - - var afterDiagrams = onAsyncPreview; - onAsyncPreview = function(cb) { - sequenceDiagramEltList = Array.prototype.slice.call(previewContentsElt.querySelectorAll('.prettyprint > .language-sequence')); - flowChartEltList = Array.prototype.slice.call(previewContentsElt.querySelectorAll('.prettyprint > .language-flow')); - _.delay(doSequenceDiagram, 0, function() { - _.delay(doFlowChart, 0, function() { - afterDiagrams(cb); - }); + umlDiagrams.onPagedownConfigure = function(editor) { + var previewContentsElt = document.getElementById('preview-contents'); + editor.hooks.chain("onPreviewRefresh", function() { + _.each(previewContentsElt.querySelectorAll('.prettyprint > .language-sequence'), function(elt) { + try { + var diagram = sequenceDiagram.parse(elt.textContent); + var preElt = elt.parentNode; + var containerElt = crel('div', { + class: 'sequence-diagram' + }); + preElt.parentNode.replaceChild(containerElt, preElt); + diagram.drawSVG(containerElt, { + theme: 'simple' + }); + } + catch(e) { + } }); - }; - + _.each(previewContentsElt.querySelectorAll('.prettyprint > .language-flow'), function(elt) { + try { + var chart = flowChart.parse(elt.textContent); + var preElt = elt.parentNode; + var containerElt = crel('div', { + class: 'flow-chart' + }); + preElt.parentNode.replaceChild(containerElt, preElt); + chart.drawSVG(containerElt, { + 'line-width': 2 + }); + } + catch(e) { + } + }); + }); }; return umlDiagrams; diff --git a/public/res/html/markdownExtraSettingsBlock.html b/public/res/html/markdownExtraSettingsBlock.html index 2f0b502a..8a48551e 100644 --- a/public/res/html/markdownExtraSettingsBlock.html +++ b/public/res/html/markdownExtraSettingsBlock.html @@ -100,15 +100,6 @@
-
- -
-
- -
-
-
More info \ No newline at end of file diff --git a/public/res/styles/base.less b/public/res/styles/base.less index bca50a84..8c336a0b 100644 --- a/public/res/styles/base.less +++ b/public/res/styles/base.less @@ -1,8 +1,92 @@ -@import "../bower-libs/bootstrap/less/bootstrap.less"; -@import (less) "../bower-libs/google-code-prettify/src/prettify.css"; +// Core variables and mixins +@import "../bower-libs/bootstrap/less/variables.less"; +@import "../bower-libs/bootstrap/less/mixins.less"; + +// Reset +@import "../bower-libs/bootstrap/less/normalize.less"; + +// Core CSS +@import "../bower-libs/bootstrap/less/scaffolding.less"; +@import "../bower-libs/bootstrap/less/type.less"; +@import "../bower-libs/bootstrap/less/code.less"; +@import "../bower-libs/bootstrap/less/grid.less"; +@import "../bower-libs/bootstrap/less/tables.less"; +@import "../bower-libs/bootstrap/less/forms.less"; +@import "../bower-libs/bootstrap/less/buttons.less"; + +// Components +@import "../bower-libs/bootstrap/less/component-animations.less"; +@import "../bower-libs/bootstrap/less/glyphicons.less"; +@import "../bower-libs/bootstrap/less/dropdowns.less"; +@import "../bower-libs/bootstrap/less/button-groups.less"; +@import "../bower-libs/bootstrap/less/input-groups.less"; +@import "../bower-libs/bootstrap/less/navs.less"; +@import "../bower-libs/bootstrap/less/navbar.less"; +@import "../bower-libs/bootstrap/less/breadcrumbs.less"; +@import "../bower-libs/bootstrap/less/pagination.less"; +@import "../bower-libs/bootstrap/less/pager.less"; +@import "../bower-libs/bootstrap/less/labels.less"; +@import "../bower-libs/bootstrap/less/badges.less"; +@import "../bower-libs/bootstrap/less/jumbotron.less"; +@import "../bower-libs/bootstrap/less/thumbnails.less"; +@import "../bower-libs/bootstrap/less/alerts.less"; +@import "../bower-libs/bootstrap/less/progress-bars.less"; +@import "../bower-libs/bootstrap/less/media.less"; +@import "../bower-libs/bootstrap/less/list-group.less"; +@import "../bower-libs/bootstrap/less/panels.less"; +@import "../bower-libs/bootstrap/less/wells.less"; +@import "../bower-libs/bootstrap/less/close.less"; + +// Components w/ JavaScript +@import "../bower-libs/bootstrap/less/modals.less"; +@import "../bower-libs/bootstrap/less/tooltip.less"; +@import "../bower-libs/bootstrap/less/popovers.less"; + +// Utility classes +@import "../bower-libs/bootstrap/less/utilities.less"; + @import (less) "../libs/highlight/styles/default.css"; @import (less) "../libs/fontello/css/fontello.css"; +/* Pretty printing styles. Used with prettify.js. */ + +/* SPAN elements with the classes below are added by prettyprint. */ +.pln { color: #000 } /* plain text */ + +.str { color: #080 } /* string content */ +.kwd { color: #008 } /* a keyword */ +.com { color: #800 } /* a comment */ +.typ { color: #606 } /* a type name */ +.lit { color: #066 } /* a literal value */ +/* punctuation, lisp open bracket, lisp close bracket */ +.pun, .opn, .clo { color: #660 } +.tag { color: #008 } /* a markup tag name */ +.atn { color: #606 } /* a markup attribute name */ +.atv { color: #080 } /* a markup attribute value */ +.dec, .var { color: #606 } /* a declaration; a variable name */ +.fun { color: red } /* a function name */ + +/* Put a border around prettyprinted code snippets. */ +pre.prettyprint { padding: 2px; border: 1px solid #888 } + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L5, +li.L6, +li.L7, +li.L8 { list-style-type: none } +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { background: #eee } + + @body-bg: #fff; @text-color: #000; @kbd-color: #333; diff --git a/public/res/styles/main.less b/public/res/styles/main.less index 1381eb60..4c14a2de 100644 --- a/public/res/styles/main.less +++ b/public/res/styles/main.less @@ -1546,6 +1546,7 @@ div.jGrowl { @media print { html, body { + background: transparent !important; overflow: visible !important; } @@ -1561,6 +1562,7 @@ div.jGrowl { .layout-wrapper-l3, .preview-panel, .preview-container { + background: transparent !important; display: block !important; position: static !important; overflow: visible !important;