Browse Source

Set indent style to 4 spaces

tags/2.0.0
Jeroen Akkerman 1 year ago
parent
commit
de26368ad1
12 changed files with 9135 additions and 9133 deletions
  1. 6
    0
      .editorconfig
  2. 18
    22
      .eslintrc
  3. 2
    3
      .gitignore
  4. 4
    3
      debug/simplemde.css
  5. 1635
    1635
      debug/simplemde.debug.js
  6. 1634
    1634
      debug/simplemde.js
  7. 63
    63
      gulpfile.js
  8. 3998
    3998
      package-lock.json
  9. 38
    38
      package.json
  10. 4
    4
      src/css/simplemde.css
  11. 30
    30
      src/js/codemirror/tablist.js
  12. 1703
    1703
      src/js/simplemde.js

+ 6
- 0
.editorconfig View File

@@ -0,0 +1,6 @@
1
+[*]
2
+charset=utf-8
3
+end_of_line=lf
4
+insert_final_newline=true
5
+indent_style=space
6
+indent_size=4

+ 18
- 22
.eslintrc View File

@@ -1,23 +1,19 @@
1 1
 {
2
-  "rules": {
3
-    "indent": [
4
-      2,
5
-      "tab"
6
-    ],
7
-    "strict": 0,
8
-    "no-console": 0,
9
-    "quotes": [
10
-      2,
11
-      "double"
12
-    ],
13
-    "semi": [
14
-      2,
15
-      "always"
16
-    ]
17
-  },
18
-  "env": {
19
-    "browser": true,
20
-    "node":true
21
-  },
22
-  "extends": "eslint:recommended"
23
-}
2
+    "rules": {
3
+        "strict": 0,
4
+        "no-console": 0,
5
+        "quotes": [
6
+            2,
7
+            "double"
8
+        ],
9
+        "semi": [
10
+            2,
11
+            "always"
12
+        ]
13
+    },
14
+    "env": {
15
+        "browser": true,
16
+        "node": true
17
+    },
18
+    "extends": "eslint:recommended"
19
+}

+ 2
- 3
.gitignore View File

@@ -1,8 +1,7 @@
1
-localtesting/
1
+# NPM files
2 2
 node_modules/
3
-bower_components/
4 3
 
5
-#For IDE
4
+# IDE files
6 5
 *.iml
7 6
 *.ipr
8 7
 *.iws

+ 4
- 3
debug/simplemde.css View File

@@ -465,7 +465,7 @@ span.CodeMirror-selectedtext { background: none; }
465 465
     background: transparent;
466 466
     display: inline-block;
467 467
     text-align: center;
468
-    text-decoration: none!important;
468
+    text-decoration: none !important;
469 469
     width: 30px;
470 470
     height: 30px;
471 471
     margin: 0;
@@ -600,8 +600,8 @@ span.CodeMirror-selectedtext { background: none; }
600 600
     display: block
601 601
 }
602 602
 
603
-.editor-preview>p,
604
-.editor-preview-side>p {
603
+.editor-preview > p,
604
+.editor-preview-side > p {
605 605
     margin-top: 0
606 606
 }
607 607
 
@@ -675,6 +675,7 @@ span.CodeMirror-selectedtext { background: none; }
675 675
 .CodeMirror .CodeMirror-placeholder {
676 676
     opacity: .5;
677 677
 }
678
+
678 679
 .CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word) {
679 680
     background: rgba(255, 0, 0, .15);
680 681
 }

+ 1635
- 1635
debug/simplemde.debug.js
File diff suppressed because it is too large
View File


+ 1634
- 1634
debug/simplemde.js
File diff suppressed because it is too large
View File


+ 63
- 63
gulpfile.js View File

@@ -1,83 +1,83 @@
1 1
 "use strict";
2 2
 
3 3
 var gulp = require("gulp"),
4
-	minifycss = require("gulp-clean-css"),
5
-	uglify = require("gulp-uglify"),
6
-	concat = require("gulp-concat"),
7
-	header = require("gulp-header"),
8
-	buffer = require("vinyl-buffer"),
9
-	pkg = require("./package.json"),
10
-	debug = require("gulp-debug"),
11
-	eslint = require("gulp-eslint"),
12
-	browserify = require("browserify"),
13
-	source = require("vinyl-source-stream"),
14
-	rename = require("gulp-rename");
4
+    minifycss = require("gulp-clean-css"),
5
+    uglify = require("gulp-uglify"),
6
+    concat = require("gulp-concat"),
7
+    header = require("gulp-header"),
8
+    buffer = require("vinyl-buffer"),
9
+    pkg = require("./package.json"),
10
+    debug = require("gulp-debug"),
11
+    eslint = require("gulp-eslint"),
12
+    browserify = require("browserify"),
13
+    source = require("vinyl-source-stream"),
14
+    rename = require("gulp-rename");
15 15
 
16 16
 var banner = ["/**",
17
-	" * <%= pkg.name %> v<%= pkg.version %>",
18
-	" * Copyright <%= pkg.author %>",
19
-	" * @link <%= pkg.repository.url %>",
20
-	" * @license <%= pkg.license %>",
21
-	" */",
22
-	""].join("\n");
17
+    " * <%= pkg.name %> v<%= pkg.version %>",
18
+    " * Copyright <%= pkg.author %>",
19
+    " * @link <%= pkg.repository.url %>",
20
+    " * @license <%= pkg.license %>",
21
+    " */",
22
+    ""].join("\n");
23 23
 
24
-gulp.task("lint", function() {
25
-	gulp.src("./src/js/**/*.js")
26
-		.pipe(debug())
27
-		.pipe(eslint())
28
-		.pipe(eslint.format())
29
-		.pipe(eslint.failAfterError());
24
+gulp.task("lint", function () {
25
+    gulp.src("./src/js/**/*.js")
26
+        .pipe(debug())
27
+        .pipe(eslint())
28
+        .pipe(eslint.format())
29
+        .pipe(eslint.failAfterError());
30 30
 });
31 31
 
32 32
 function taskBrowserify(opts) {
33
-	return browserify("./src/js/simplemde.js", opts)
34
-		.bundle();
33
+    return browserify("./src/js/simplemde.js", opts)
34
+        .bundle();
35 35
 }
36 36
 
37
-gulp.task("browserify:debug", ["lint"], function() {
38
-	return taskBrowserify({debug:true, standalone:"SimpleMDE"})
39
-		.pipe(source("simplemde.debug.js"))
40
-		.pipe(buffer())
41
-		.pipe(header(banner, {pkg: pkg}))
42
-		.pipe(gulp.dest("./debug/"));
37
+gulp.task("browserify:debug", ["lint"], function () {
38
+    return taskBrowserify({debug: true, standalone: "SimpleMDE"})
39
+        .pipe(source("simplemde.debug.js"))
40
+        .pipe(buffer())
41
+        .pipe(header(banner, {pkg: pkg}))
42
+        .pipe(gulp.dest("./debug/"));
43 43
 });
44 44
 
45
-gulp.task("browserify", ["lint"], function() {
46
-	return taskBrowserify({standalone:"SimpleMDE"})
47
-		.pipe(source("simplemde.js"))
48
-		.pipe(buffer())
49
-		.pipe(header(banner, {pkg: pkg}))
50
-		.pipe(gulp.dest("./debug/"));
45
+gulp.task("browserify", ["lint"], function () {
46
+    return taskBrowserify({standalone: "SimpleMDE"})
47
+        .pipe(source("simplemde.js"))
48
+        .pipe(buffer())
49
+        .pipe(header(banner, {pkg: pkg}))
50
+        .pipe(gulp.dest("./debug/"));
51 51
 });
52 52
 
53
-gulp.task("scripts", ["browserify:debug", "browserify", "lint"], function() {
54
-	var js_files = ["./debug/simplemde.js"];
55
-	
56
-	return gulp.src(js_files)
57
-		.pipe(concat("simplemde.min.js"))
58
-		.pipe(uglify())
59
-		.pipe(buffer())
60
-		.pipe(header(banner, {pkg: pkg}))
61
-		.pipe(gulp.dest("./dist/"));
53
+gulp.task("scripts", ["browserify:debug", "browserify", "lint"], function () {
54
+    var js_files = ["./debug/simplemde.js"];
55
+
56
+    return gulp.src(js_files)
57
+        .pipe(concat("simplemde.min.js"))
58
+        .pipe(uglify())
59
+        .pipe(buffer())
60
+        .pipe(header(banner, {pkg: pkg}))
61
+        .pipe(gulp.dest("./dist/"));
62 62
 });
63 63
 
64
-gulp.task("styles", function() {
65
-	var css_files = [
66
-		"./node_modules/codemirror/lib/codemirror.css",
67
-		"./src/css/*.css",
68
-		"./node_modules/codemirror-spell-checker/src/css/spell-checker.css"
69
-	];
70
-	
71
-	return gulp.src(css_files)
72
-		.pipe(concat("simplemde.css"))
73
-		.pipe(buffer())
74
-		.pipe(header(banner, {pkg: pkg}))
75
-		.pipe(gulp.dest("./debug/"))
76
-		.pipe(minifycss())
77
-		.pipe(rename("simplemde.min.css"))
78
-		.pipe(buffer())
79
-		.pipe(header(banner, {pkg: pkg}))
80
-		.pipe(gulp.dest("./dist/"));
64
+gulp.task("styles", function () {
65
+    var css_files = [
66
+        "./node_modules/codemirror/lib/codemirror.css",
67
+        "./src/css/*.css",
68
+        "./node_modules/codemirror-spell-checker/src/css/spell-checker.css"
69
+    ];
70
+
71
+    return gulp.src(css_files)
72
+        .pipe(concat("simplemde.css"))
73
+        .pipe(buffer())
74
+        .pipe(header(banner, {pkg: pkg}))
75
+        .pipe(gulp.dest("./debug/"))
76
+        .pipe(minifycss())
77
+        .pipe(rename("simplemde.min.css"))
78
+        .pipe(buffer())
79
+        .pipe(header(banner, {pkg: pkg}))
80
+        .pipe(gulp.dest("./dist/"));
81 81
 });
82 82
 
83 83
 gulp.task("default", ["scripts", "styles"]);

+ 3998
- 3998
package-lock.json
File diff suppressed because it is too large
View File


+ 38
- 38
package.json View File

@@ -1,40 +1,40 @@
1 1
 {
2
-  "name": "simplemde",
3
-  "version": "1.11.2",
4
-  "description": "A simple, beautiful, and embeddable JavaScript Markdown editor. Features autosaving and spell checking.",
5
-  "keywords": [
6
-    "embeddable",
7
-    "markdown",
8
-    "editor",
9
-    "javascript",
10
-    "fontawesome"
11
-  ],
12
-  "main": "./src/js/simplemde.js",
13
-  "license": "MIT",
14
-  "author": "Jeroen Akkerman",
15
-  "bugs": {
16
-    "url": "https://github.com/ionaru/simplemde-markdown-editor/issues"
17
-  },
18
-  "dependencies": {
19
-    "codemirror": "^5.32.0",
20
-    "codemirror-spell-checker": "^1.1.2",
21
-    "marked": "^0.3.7"
22
-  },
23
-  "devDependencies": {
24
-    "browserify": "^14.5.0",
25
-    "gulp": "^3.9.1",
26
-    "gulp-clean-css": "^3.9.0",
27
-    "gulp-concat": "^2.6.1",
28
-    "gulp-debug": "^3.1.0",
29
-    "gulp-eslint": "^4.0.0",
30
-    "gulp-header": "^1.8.9",
31
-    "gulp-rename": "^1.2.2",
32
-    "gulp-uglify": "^3.0.0",
33
-    "vinyl-buffer": "^1.0.0",
34
-    "vinyl-source-stream": "^1.1.0"
35
-  },
36
-  "repository": {
37
-    "type": "git",
38
-    "url": "https://github.com/ionaru/simplemde-markdown-editor"
39
-  }
2
+    "name": "simplemde",
3
+    "version": "1.11.2",
4
+    "description": "A simple, beautiful, and embeddable JavaScript Markdown editor. Features autosaving and spell checking.",
5
+    "keywords": [
6
+        "embeddable",
7
+        "markdown",
8
+        "editor",
9
+        "javascript",
10
+        "fontawesome"
11
+    ],
12
+    "main": "./src/js/simplemde.js",
13
+    "license": "MIT",
14
+    "author": "Jeroen Akkerman",
15
+    "bugs": {
16
+        "url": "https://github.com/ionaru/simplemde-markdown-editor/issues"
17
+    },
18
+    "dependencies": {
19
+        "codemirror": "^5.32.0",
20
+        "codemirror-spell-checker": "^1.1.2",
21
+        "marked": "^0.3.7"
22
+    },
23
+    "devDependencies": {
24
+        "browserify": "^14.5.0",
25
+        "gulp": "^3.9.1",
26
+        "gulp-clean-css": "^3.9.0",
27
+        "gulp-concat": "^2.6.1",
28
+        "gulp-debug": "^3.1.0",
29
+        "gulp-eslint": "^4.0.0",
30
+        "gulp-header": "^1.8.9",
31
+        "gulp-rename": "^1.2.2",
32
+        "gulp-uglify": "^3.0.0",
33
+        "vinyl-buffer": "^1.0.0",
34
+        "vinyl-source-stream": "^1.1.0"
35
+    },
36
+    "repository": {
37
+        "type": "git",
38
+        "url": "https://github.com/ionaru/simplemde-markdown-editor"
39
+    }
40 40
 }

+ 4
- 4
src/css/simplemde.css View File

@@ -112,7 +112,7 @@
112 112
     background: transparent;
113 113
     display: inline-block;
114 114
     text-align: center;
115
-    text-decoration: none!important;
115
+    text-decoration: none !important;
116 116
     width: 30px;
117 117
     height: 30px;
118 118
     margin: 0;
@@ -247,8 +247,8 @@
247 247
     display: block
248 248
 }
249 249
 
250
-.editor-preview>p,
251
-.editor-preview-side>p {
250
+.editor-preview > p,
251
+.editor-preview-side > p {
252 252
     margin-top: 0
253 253
 }
254 254
 
@@ -321,4 +321,4 @@
321 321
 
322 322
 .CodeMirror .CodeMirror-placeholder {
323 323
     opacity: .5;
324
-}
324
+}

+ 30
- 30
src/js/codemirror/tablist.js View File

@@ -4,41 +4,41 @@
4 4
 var CodeMirror = require("codemirror");
5 5
 
6 6
 CodeMirror.commands.tabAndIndentMarkdownList = function (cm) {
7
-	var ranges = cm.listSelections();
8
-	var pos = ranges[0].head;
9
-	var eolState = cm.getStateAfter(pos.line);
10
-	var inList = eolState.list !== false;
7
+    var ranges = cm.listSelections();
8
+    var pos = ranges[0].head;
9
+    var eolState = cm.getStateAfter(pos.line);
10
+    var inList = eolState.list !== false;
11 11
 
12
-	if (inList) {
13
-		cm.execCommand("indentMore");
14
-		return;
15
-	}
12
+    if (inList) {
13
+        cm.execCommand("indentMore");
14
+        return;
15
+    }
16 16
 
17
-	if (cm.options.indentWithTabs) {
18
-		cm.execCommand("insertTab");
19
-	}
20
-	else {
21
-		var spaces = Array(cm.options.tabSize + 1).join(" ");
22
-		cm.replaceSelection(spaces);
23
-	}
17
+    if (cm.options.indentWithTabs) {
18
+        cm.execCommand("insertTab");
19
+    }
20
+    else {
21
+        var spaces = Array(cm.options.tabSize + 1).join(" ");
22
+        cm.replaceSelection(spaces);
23
+    }
24 24
 };
25 25
 
26 26
 CodeMirror.commands.shiftTabAndUnindentMarkdownList = function (cm) {
27
-	var ranges = cm.listSelections();
28
-	var pos = ranges[0].head;
29
-	var eolState = cm.getStateAfter(pos.line);
30
-	var inList = eolState.list !== false;
27
+    var ranges = cm.listSelections();
28
+    var pos = ranges[0].head;
29
+    var eolState = cm.getStateAfter(pos.line);
30
+    var inList = eolState.list !== false;
31 31
 
32
-	if (inList) {
33
-		cm.execCommand("indentLess");
34
-		return;
35
-	}
32
+    if (inList) {
33
+        cm.execCommand("indentLess");
34
+        return;
35
+    }
36 36
 
37
-	if (cm.options.indentWithTabs) {
38
-		cm.execCommand("insertTab");
39
-	}
40
-	else {
41
-		var spaces = Array(cm.options.tabSize + 1).join(" ");
42
-		cm.replaceSelection(spaces);
43
-	}
37
+    if (cm.options.indentWithTabs) {
38
+        cm.execCommand("insertTab");
39
+    }
40
+    else {
41
+        var spaces = Array(cm.options.tabSize + 1).join(" ");
42
+        cm.replaceSelection(spaces);
43
+    }
44 44
 };

+ 1703
- 1703
src/js/simplemde.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save