Browse Source

Clean up build process, Use new CodeMirror Spell Checker

pull/353/head
Wes Cossick 5 years ago
parent
commit
c8f23a3aa9
  1. 4
      debug/simplemde.css
  2. 2530
      debug/simplemde.debug.js
  3. 2528
      debug/simplemde.js
  4. 2
      dist/simplemde.min.css
  5. 17
      dist/simplemde.min.js
  6. 19
      gulpfile.js
  7. 37
      package.json
  8. 6
      src/js/simplemde.js

4
debug/simplemde.css

@ -58,7 +58,7 @@
}
.cm-fat-cursor .CodeMirror-cursor {
width: auto;
border: 0;
border: 0 !important;
background: #7e7;
}
.cm-fat-cursor div.CodeMirror-cursors {
@ -672,5 +672,5 @@ span.CodeMirror-selectedtext { background: none; }
opacity: .5;
}
.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word) {
background: rgba(255, 0, 0, .15);
background: rgba(255, 0, 0, .15);
}

2530
debug/simplemde.debug.js
File diff suppressed because it is too large
View File

2528
debug/simplemde.js
File diff suppressed because it is too large
View File

2
dist/simplemde.min.css
File diff suppressed because it is too large
View File

17
dist/simplemde.min.js
File diff suppressed because it is too large
View File

19
gulpfile.js

@ -1,6 +1,7 @@
"use strict";
var gulp = require("gulp"),
minifycss = require("gulp-minify-css"),
minifycss = require("gulp-clean-css"),
uglify = require("gulp-uglify"),
concat = require("gulp-concat"),
header = require("gulp-header"),
@ -8,11 +9,10 @@ var gulp = require("gulp"),
pkg = require("./package.json"),
debug = require("gulp-debug"),
eslint = require("gulp-eslint"),
prettify = require("gulp-jsbeautifier");
var browserify = require("browserify");
var source = require("vinyl-source-stream");
var rename = require("gulp-rename");
prettify = require("gulp-jsbeautifier"),
browserify = require("browserify"),
source = require("vinyl-source-stream"),
rename = require("gulp-rename");
var banner = ["/**",
" * <%= pkg.name %> v<%= pkg.version %>",
@ -45,10 +45,9 @@ gulp.task("lint", ["prettify-js"], function() {
function taskBrowserify(opts) {
return browserify("./src/js/simplemde.js", opts)
.bundle();
}
gulp.task("browserify:dev", ["lint"], function() {
gulp.task("browserify:debug", ["lint"], function() {
return taskBrowserify({debug:true, standalone:"SimpleMDE"})
.pipe(source("simplemde.debug.js"))
.pipe(buffer())
@ -56,7 +55,7 @@ gulp.task("browserify:dev", ["lint"], function() {
.pipe(gulp.dest("./debug/"));
});
gulp.task("browserify:min", ["lint"], function() {
gulp.task("browserify", ["lint"], function() {
return taskBrowserify({standalone:"SimpleMDE"})
.pipe(source("simplemde.js"))
.pipe(buffer())
@ -64,7 +63,7 @@ gulp.task("browserify:min", ["lint"], function() {
.pipe(gulp.dest("./debug/"));
});
gulp.task("scripts", ["browserify:dev", "browserify:min", "lint"], function() {
gulp.task("scripts", ["browserify:debug", "browserify", "lint"], function() {
var js_files = ["./debug/simplemde.js"];
return gulp.src(js_files)

37
package.json

@ -21,47 +21,26 @@
"url": "https://github.com/NextStepWebs/simplemde-markdown-editor/issues"
},
"dependencies": {
"codemirror": "codemirror/CodeMirror",
"codemirror-spell-checker": "nextstepwebs/codemirror-spell-checker",
"marked": "0.3.5"
"codemirror": "*",
"codemirror-spell-checker": "*",
"marked": "*"
},
"devDependencies": {
"browserify": "^11.2.0",
"browserify-shim": "^3.8.10",
"debug": "^2.2.0",
"browserify": "*",
"debug": "*",
"eslint": "*",
"gulp": "*",
"gulp-concat": "*",
"gulp-debug": "^2.1.1",
"gulp-debug": "*",
"gulp-eslint": "*",
"gulp-header": "*",
"gulp-jsbeautifier": "*",
"gulp-minify-css": "^1.2.1",
"gulp-rename": "^1.2.2",
"gulp-clean-css": "*",
"gulp-rename": "*",
"gulp-uglify": "*",
"vinyl-source-stream": "*",
"vinyl-buffer": "*"
},
"browserify": {
"transform": [
"browserify-shim"
]
},
"browser": {
"spell-checker": "codemirror-spell-checker/src/js/spell-checker.js",
"typo": "codemirror-spell-checker/src/js/typo.js"
},
"browserify-shim": {
"spell-checker": {
"depends": [
"typo:Typo",
"codemirror:CodeMirror"
]
},
"typo": {
"exports": "Typo"
}
},
"repository": {
"type": "git",
"url": "https://github.com/NextStepWebs/simplemde-markdown-editor"

6
src/js/simplemde.js

@ -10,7 +10,7 @@ require("codemirror/addon/display/placeholder.js");
require("codemirror/addon/selection/mark-selection.js");
require("codemirror/mode/gfm/gfm.js");
require("codemirror/mode/xml/xml.js");
require("spell-checker");
var CodeMirrorSpellChecker = require("codemirror-spell-checker");
var marked = require("marked");
@ -1466,6 +1466,10 @@ SimpleMDE.prototype.render = function(el) {
backdrop = options.parsingConfig;
backdrop.name = "gfm";
backdrop.gitHubSpice = false;
CodeMirrorSpellChecker({
codeMirrorInstance: CodeMirror
});
} else {
mode = options.parsingConfig;
mode.name = "gfm";

Loading…
Cancel
Save