markdown-up 2.3.6 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app.js +12 -12
- package/package.json +5 -5
package/lib/app.js
CHANGED
|
@@ -33,6 +33,9 @@ struct MarkdownUp
|
|
|
33
33
|
# Variable expressions
|
|
34
34
|
optional string{} var
|
|
35
35
|
|
|
36
|
+
# Optional command
|
|
37
|
+
optional MarkdownUpView view
|
|
38
|
+
|
|
36
39
|
|
|
37
40
|
# The MarkdownUp local storage JSON schema
|
|
38
41
|
struct MarkdownUpLocal
|
|
@@ -50,9 +53,6 @@ struct MarkdownUpLocal
|
|
|
50
53
|
# The MarkdownUp session storage JSON schema
|
|
51
54
|
struct MarkdownUpSession
|
|
52
55
|
|
|
53
|
-
# Optional command
|
|
54
|
-
optional MarkdownUpView view
|
|
55
|
-
|
|
56
56
|
# If set, the menu is expanded (default is collapsed)
|
|
57
57
|
optional int(== 1) menu
|
|
58
58
|
|
|
@@ -266,7 +266,7 @@ export class MarkdownUp {
|
|
|
266
266
|
|
|
267
267
|
async main() {
|
|
268
268
|
// Help?
|
|
269
|
-
if (this.
|
|
269
|
+
if (this.params.view === 'help') {
|
|
270
270
|
return {
|
|
271
271
|
'title': 'MarkdownUp',
|
|
272
272
|
'elements': [
|
|
@@ -330,7 +330,7 @@ export class MarkdownUp {
|
|
|
330
330
|
const markdownTitle = getMarkdownTitle(markdownModel);
|
|
331
331
|
|
|
332
332
|
// Display the Markdown?
|
|
333
|
-
if (this.
|
|
333
|
+
if (this.params.view === 'markdown') {
|
|
334
334
|
return {
|
|
335
335
|
'title': markdownTitle,
|
|
336
336
|
'elements': [
|
|
@@ -496,7 +496,7 @@ export class MarkdownUp {
|
|
|
496
496
|
|
|
497
497
|
|
|
498
498
|
burgerElements() {
|
|
499
|
-
const paramString = encodeQueryString(
|
|
499
|
+
const paramString = encodeQueryString(this.params);
|
|
500
500
|
const topHeaderId = `${paramString}${paramString !== '' ? '&' : ''}_top`;
|
|
501
501
|
return [
|
|
502
502
|
!this.menu ? null : [
|
|
@@ -566,16 +566,16 @@ export class MarkdownUp {
|
|
|
566
566
|
|
|
567
567
|
|
|
568
568
|
menuViewToggle(viewValue, icon) {
|
|
569
|
-
icon.checked = this.
|
|
569
|
+
icon.checked = this.params.view === viewValue;
|
|
570
570
|
return this.menuButton(
|
|
571
571
|
() => {
|
|
572
|
-
|
|
573
|
-
|
|
572
|
+
const params = {...this.params};
|
|
573
|
+
if (params.view === viewValue) {
|
|
574
|
+
delete params.view;
|
|
574
575
|
} else {
|
|
575
|
-
|
|
576
|
+
params.view = viewValue;
|
|
576
577
|
}
|
|
577
|
-
this.window.
|
|
578
|
-
this.render(true);
|
|
578
|
+
this.window.location.href = `#${encodeQueryString(params)}`;
|
|
579
579
|
},
|
|
580
580
|
icon
|
|
581
581
|
);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "markdown-up",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.1",
|
|
5
5
|
"description": "MarkdownUp is a Markdown viewer",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"markdown",
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"test": "node --test test/"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"bare-script": "~2.
|
|
25
|
+
"bare-script": "~2.3",
|
|
26
26
|
"element-model": "~1.1",
|
|
27
27
|
"markdown-model": "~1.8",
|
|
28
28
|
"schema-markdown": "~1.2",
|
|
29
29
|
"schema-markdown-doc": "~1.6"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"c8": "~
|
|
33
|
-
"eslint": "~8.
|
|
32
|
+
"c8": "~9.1",
|
|
33
|
+
"eslint": "~8.56",
|
|
34
34
|
"jsdoc": "~4.0",
|
|
35
|
-
"jsdom": "~
|
|
35
|
+
"jsdom": "~24.0"
|
|
36
36
|
}
|
|
37
37
|
}
|