7
7
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.SimpleMDE = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
8
8
(function (global){
9
9
10
- ; Typo = global.Typo = require("D:\\My Web Sites\\ simplemde-markdown-editor\\ node_modules\\ codemirror-spell-checker\\ src\\js\\ typo.js");
10
+ ; Typo = global.Typo = require("/home/prostoandrei/Projects/ simplemde-markdown-editor/ node_modules/ codemirror-spell-checker/ src/js/ typo.js");
11
11
CodeMirror = global.CodeMirror = require("codemirror");
12
12
; var __browserify_shim_require__=require;(function browserifyShim(module, define, require) {
13
13
// Initialize data globally to reduce memory consumption
@@ -105,7 +105,7 @@ if(!String.prototype.includes) {
105
105
}).call(global, module, undefined, undefined);
106
106
107
107
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
108
- },{"D:\\My Web Sites\\ simplemde-markdown-editor\\ node_modules\\ codemirror-spell-checker\\ src\\js\\ typo.js":2,"codemirror":7}],2:[function(require,module,exports){
108
+ },{"/home/prostoandrei/Projects/ simplemde-markdown-editor/ node_modules/ codemirror-spell-checker/ src/js/ typo.js":2,"codemirror":7}],2:[function(require,module,exports){
109
109
(function (global){
110
110
; var __browserify_shim_require__=require;(function browserifyShim(module, exports, require, define, browserify_shim__define__module__export__) {
111
111
'use strict';
@@ -1876,6 +1876,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
1876
1876
1877
1877
function postUpdateDisplay(cm, update) {
1878
1878
var viewport = update.viewport;
1879
+
1879
1880
for (var first = true;; first = false) {
1880
1881
if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {
1881
1882
// Clip forced viewport to actual scrollable area.
@@ -1891,8 +1892,8 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
1891
1892
updateHeightsInViewport(cm);
1892
1893
var barMeasure = measureForScrollbars(cm);
1893
1894
updateSelection(cm);
1894
- setDocumentHeight(cm, barMeasure);
1895
1895
updateScrollbars(cm, barMeasure);
1896
+ setDocumentHeight(cm, barMeasure);
1896
1897
}
1897
1898
1898
1899
update.signal(cm, "update", cm);
@@ -1909,17 +1910,16 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
1909
1910
postUpdateDisplay(cm, update);
1910
1911
var barMeasure = measureForScrollbars(cm);
1911
1912
updateSelection(cm);
1912
- setDocumentHeight(cm, barMeasure);
1913
1913
updateScrollbars(cm, barMeasure);
1914
+ setDocumentHeight(cm, barMeasure);
1914
1915
update.finish();
1915
1916
}
1916
1917
}
1917
1918
1918
1919
function setDocumentHeight(cm, measure) {
1919
1920
cm.display.sizer.style.minHeight = measure.docHeight + "px";
1920
1921
cm.display.heightForcer.style.top = measure.docHeight + "px";
1921
- cm.display.gutters.style.height = Math.max(measure.docHeight + cm.display.barHeight + scrollGap(cm),
1922
- measure.clientHeight) + "px";
1922
+ cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px";
1923
1923
}
1924
1924
1925
1925
// Read the actual heights of the rendered lines, and update their
@@ -4244,10 +4244,10 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
4244
4244
4245
4245
if (op.preparedSelection)
4246
4246
cm.display.input.showSelection(op.preparedSelection);
4247
- if (op.updatedDisplay)
4248
- setDocumentHeight(cm, op.barMeasure);
4249
4247
if (op.updatedDisplay || op.startHeight != cm.doc.height)
4250
4248
updateScrollbars(cm, op.barMeasure);
4249
+ if (op.updatedDisplay)
4250
+ setDocumentHeight(cm, op.barMeasure);
4251
4251
4252
4252
if (op.selectionChanged) restartBlink(cm);
4253
4253
@@ -4624,7 +4624,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
4624
4624
over: function(e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},
4625
4625
start: function(e){onDragStart(cm, e);},
4626
4626
drop: operation(cm, onDrop),
4627
- leave: function() {clearDragCursor(cm);}
4627
+ leave: function(e ) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); } }
4628
4628
};
4629
4629
4630
4630
var inp = d.input.getField();
@@ -8775,9 +8775,9 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
8775
8775
},
8776
8776
8777
8777
posFromIndex: function(off) {
8778
- var ch, lineNo = this.first;
8778
+ var ch, lineNo = this.first, sepSize = this.lineSeparator().length ;
8779
8779
this.iter(function(line) {
8780
- var sz = line.text.length + 1 ;
8780
+ var sz = line.text.length + sepSize ;
8781
8781
if (sz > off) { ch = off; return true; }
8782
8782
off -= sz;
8783
8783
++lineNo;
@@ -8788,8 +8788,9 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
8788
8788
coords = clipPos(this, coords);
8789
8789
var index = coords.ch;
8790
8790
if (coords.line < this.first || coords.ch < 0) return 0;
8791
+ var sepSize = this.lineSeparator().length;
8791
8792
this.iter(this.first, coords.line, function (line) {
8792
- index += line.text.length + 1 ;
8793
+ index += line.text.length + sepSize ;
8793
8794
});
8794
8795
return index;
8795
8796
},
@@ -10018,7 +10019,7 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
10018
10019
10019
10020
// THE END
10020
10021
10021
- CodeMirror.version = "5.12.1 ";
10022
+ CodeMirror.version = "5.13.3 ";
10022
10023
10023
10024
return CodeMirror;
10024
10025
});
@@ -11069,6 +11070,7 @@ CodeMirror.defineMIME("text/x-markdown", "markdown");
11069
11070
{name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]},
11070
11071
{name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
11071
11072
{name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]},
11073
+ {name: "PowerShell", mime: "application/x-powershell", mode: "powershell", ext: ["ps1", "psd1", "psm1"]},
11072
11074
{name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]},
11073
11075
{name: "ProtoBuf", mime: "text/x-protobuf", mode: "protobuf", ext: ["proto"]},
11074
11076
{name: "Python", mime: "text/x-python", mode: "python", ext: ["py", "pyw"]},
@@ -14575,9 +14577,7 @@ SimpleMDE.prototype.createToolbar = function(items) {
14575
14577
var nonSeparatorIconsFollow = false;
14576
14578
14577
14579
for(var x = (i + 1); x < items.length; x++) {
14578
- console.log(x);
14579
14580
if(items[x] !== "|" && (!self.options.hideIcons || self.options.hideIcons.indexOf(items[x].name) == -1)) {
14580
- console.log(items[x]);
14581
14581
nonSeparatorIconsFollow = true;
14582
14582
}
14583
14583
}
@@ -14892,9 +14892,17 @@ SimpleMDE.prototype.toTextArea = function() {
14892
14892
var cm = this.codemirror;
14893
14893
var wrapper = cm.getWrapperElement();
14894
14894
14895
- wrapper.parentNode.removeChild(this.gui.toolbar);
14896
- wrapper.parentNode.removeChild(this.gui.statusbar);
14897
- wrapper.parentNode.removeChild(this.gui.sideBySide);
14895
+ if(wrapper.parentNode) {
14896
+ if(this.gui.toolbar) {
14897
+ wrapper.parentNode.removeChild(this.gui.toolbar);
14898
+ }
14899
+ if(this.gui.statusbar) {
14900
+ wrapper.parentNode.removeChild(this.gui.statusbar);
14901
+ }
14902
+ if(this.gui.sideBySide) {
14903
+ wrapper.parentNode.removeChild(this.gui.sideBySide);
14904
+ }
14905
+ }
14898
14906
14899
14907
cm.toTextArea();
14900
14908
0 commit comments