Skip to content

Commit 75a00be

Browse files
authored
0.0.56 - Deps. ESLint. Node v18. Cleanup. (#38)
* 0.0.50 - SD 1.0.47. Gallery 0.0.71. Update deps. * 0.0.52 - SD 1.0.52. Gallery 0.0.76. * 0.0.53 - Gallery 0.0.79. Enhance SSL cert create for local development. * 0.0.54 - Fixed .gitignore to avoid SSL files, and removed ssl/ files that should not be committed. Improved publish.sh to be more robust against GitHub policy changes. Adjust version in package.json to 0.0.54. * 0.0.55 - Update to smartdown v1.0.58. Add handling of ?theme= URL argument. * 0.0.56 - Update deps. Ensure that ESLint works again. Ensure that Node v18 (current LTS version) works. Add VERSIONS.md. Added 'SmartdownViewer' global variable that currently has a '.version' field. Delete app/simplemde.js, which was not being used.
1 parent 8792247 commit 75a00be

18 files changed

+10585
-9847
lines changed

.eslintrc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ extends:
77
root: true
88
parser: "babel-eslint"
99

10-
ecmaFeatures:
11-
modules: true
10+
// ecmaFeatures:
11+
// modules: true
1212

1313
env:
1414
es6: true
@@ -20,6 +20,7 @@ globals:
2020
"$": true
2121

2222
rules:
23+
no-prototype-builtins: 0
2324
indent: [0, 2, {SwitchCase: 1}]
2425
block-spacing: 2
2526
brace-style: [2, "stroustrup"]
@@ -55,7 +56,7 @@ rules:
5556
no-fallthrough: 2
5657
no-floating-decimal: 2
5758
no-implied-eval: 2
58-
no-invalid-this: 2
59+
no-invalid-this: 0
5960
no-iterator: 2
6061
no-label-var: 2
6162
no-labels: 2

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Output of build should not be committed
22
dist/
33

4+
ssl/ca.crt
5+
ssl/ca.key
6+
ssl/cert.crt
7+
ssl/cert.key
8+
49
# Nasty MacOS files generated by Finder
510
.DS_Store
611

README.md

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## Obtaining the Smartdown Library and Examples
1212

13-
Although Smartdown will eventually have all of its source code published and licensed under an open source license, it is currently in a rapid development phase and I'm just one person (so far), so I haven't nailed down all the niceties of a proper open source project. In order to effectively beta-test this software, however, I am making available many of the tools and examples as well as the compiled and bundled Smartdown library via `npm` and via [`https://unpkg.com/smartdown@0.0.63/docs/lib/`](https://unpkg.com/smartdown@0.0.63/docs/lib/). The `npm` `smartdown` module contains the source necessary to render a site similar to the [Simple Viewer Site](https://smartdown.site/lib) described above.
13+
Although Smartdown will eventually have all of its source code published and licensed under an open source license, it is currently in a rapid development phase and I'm just one person (so far), so I haven't nailed down all the niceties of a proper open source project. In order to effectively beta-test this software, however, I am making available many of the tools and examples as well as the compiled and bundled Smartdown library via `npm` and via [`https://unpkg.com/smartdown/docs/lib/`](https://unpkg.com/smartdown/docs/lib/). The `npm` `smartdown` module contains the source necessary to render a site similar to the [Simple Viewer Site](https://smartdown.site/lib) described above.
1414

1515
### Local Smartdown Viewing
1616

@@ -86,9 +86,8 @@ The `smartdown-viewer` app is designed so that the URL pointing to the app can b
8686

8787
This is what I use, you may get lucky with slightly older/newer versions.
8888

89-
- Node 6.11.2
90-
- NPM 5.5.1
91-
89+
- Node 18.16.0
90+
- npm '9.5.1
9291

9392
## Requirements to run
9493

@@ -103,7 +102,7 @@ npm install
103102
npm run build
104103
```
105104

106-
## Running
105+
## Running in Development Mode
107106

108107
```
109108
cd site/
@@ -114,56 +113,3 @@ open http://localhost:8080/webpack-dev-server/smartdown-viewer # On MacOSX
114113
#
115114
```
116115

117-
118-
## Version History
119-
120-
- **0.0.1** - First isolation from Smartdown's site/ directory.
121-
- **0.0.2** - Update to latest draft version of Smartdown 0.0.88
122-
- **0.0.3** - Apply this site as smartdown.site via CNAME.
123-
- **0.0.4** - Upgrade to SD 0.0.89. Populate the /lib directory for legacy clients who expected smartdown.site/lib/ to be where SD lives.
124-
- **0.0.5** - Add SimpleSiteExample to gist/ and lib/ for compatibility with existing users of gist/ and lib/ on smartdown.site.
125-
- **0.0.6** - Update to SD 0.0.92. Fix target=_blank links to use rel=noopener.
126-
- **0.0.7** - Update to SD 0.0.93.
127-
- **0.0.8** - Update to SD 0.0.94. Add temporary 'important' CSS qualifer for Disclosable Tooltip-style links. Smartdown CSS needs a more-specific selector, or the Viewer needs to have a more relaxed selector for text color. This is a hack.
128-
- **0.0.9** - Update to SD 0.0.95.
129-
- **0.0.10** - Update to SD 0.0.97.
130-
- **0.0.11** - SD 0.0.98.
131-
- **0.0.12** - SD 0.0.99. Use dist/ instead of docs/. Add publish.sh
132-
- **0.0.13** - SD 0.0.100. SD Gallery 0.0.20
133-
- **0.0.14** - SD 0.0.102. SD Gallery 0.0.22
134-
- **0.0.15** - SD 0.0.111. SD Gallery 0.0.23. Ensure Smartdown API docs are available. Includes Decoration capability.
135-
- **0.0.16** - SD 0.0.112.
136-
- **0.0.17** - SD 0.0.113, Gallery 0.0.25 (DisclosablesPlus and Decorations)
137-
- **0.0.18** - SD 0.0.114.
138-
- **0.0.19** - SD 0.0.115. Use Terser webpack plugin instead of UglifyJS.
139-
- **0.0.20** - SD 0.0.116. Gallery 0.0.26.
140-
- **0.0.21** - SD 0.0.117. Gallery 0.0.28.
141-
- **0.0.22** - SD 0.0.118. Gallery 0.0.29.
142-
- **0.0.23** - SD 1.0.0. Gallery 0.0.29.
143-
- **0.0.24** - SD 1.0.1. Gallery 0.0.30.
144-
- **0.0.25** - SD 1.0.2. Gallery 0.0.30.
145-
- **0.0.26** - SD 1.0.5. Gallery 0.0.33.
146-
- **0.0.27** - SD 1.0.5. Gallery 0.0.33. Update dependencies. Fix CodeMirror problem where cursor is misaligned and you can't enter more than 3 characters.
147-
- **0.0.28** - SD 1.0.8. Gallery 0.0.37 (jsPsych).
148-
- **0.0.29** - Gallery 0.0.39
149-
- **0.0.30** - Gallery 0.0.40, SD 1.0.9
150-
- **0.0.31** - Gallery 0.0.41, SD 1.0.11
151-
- **0.0.32** - Gallery 0.0.41, SD 1.0.12
152-
- **0.0.33** - Gallery 0.0.42, SD 1.0.13. Add more padding to smartdown-outer-container.
153-
- **0.0.34** - Gallery 0.0.43, SD 1.0.14. Update deps.
154-
- **0.0.35** - Gallery 0.0.44 SD 1.0.16. Update deps.
155-
- **0.0.36** - Gallery 0.0.46 SD 1.0.18. Update deps. Simplify TerserWebpackPlugin options and avoid mangle.keep_fnames=true.
156-
- **0.0.37** - Gallery 0.0.47, SD 1.0.19.
157-
- **0.0.38** - Gallery 0.0.48, SD 1.0.20
158-
- **0.0.39** - Gallery 0.0.49, SD 1.0.21.
159-
- **0.0.40** - Gallery 0.0.50, SD 1.0.23.
160-
- **0.0.41** - Gallery 0.0.52, SD 1.0.25.
161-
- **0.0.42** - Gallery 0.0.53, SD 1.0.26.
162-
- **0.0.43** - Gallery 0.0.57, SD 1.0.30.
163-
- **0.0.44** - SD 1.0.35. Gallery 0.0.61.
164-
- **0.0.45** - SD 1.0.38. Gallery 0.0.63.
165-
- **0.0.46** - SD 1.0.39. Gallery 0.0.64.
166-
- **0.0.47** - SD 1.0.40. Gallery 0.0.65. Adds support for subhashes within a page. General cleanup.
167-
- **0.0.48** - Fix issues with Gist handling. Updated to SD 1.0.45, Gallery 0.0.69. Fix intra-page link handling.
168-
- **0.0.49** - SD 1.0.46. Fix issue on Videos page where vertical scrollbar appears in smartdown-outer-container.
169-

VERSIONS.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
## Release History
2+
3+
- **0.0.1** - First isolation from Smartdown's site/ directory.
4+
- **0.0.2** - Update to latest draft version of Smartdown 0.0.88
5+
- **0.0.3** - Apply this site as smartdown.site via CNAME.
6+
- **0.0.4** - Upgrade to SD 0.0.89. Populate the /lib directory for legacy clients who expected smartdown.site/lib/ to be where SD lives.
7+
- **0.0.5** - Add SimpleSiteExample to gist/ and lib/ for compatibility with existing users of gist/ and lib/ on smartdown.site.
8+
- **0.0.6** - Update to SD 0.0.92. Fix target=_blank links to use rel=noopener.
9+
- **0.0.7** - Update to SD 0.0.93.
10+
- **0.0.8** - Update to SD 0.0.94. Add temporary 'important' CSS qualifer for Disclosable Tooltip-style links. Smartdown CSS needs a more-specific selector, or the Viewer needs to have a more relaxed selector for text color. This is a hack.
11+
- **0.0.9** - Update to SD 0.0.95.
12+
- **0.0.10** - Update to SD 0.0.97.
13+
- **0.0.11** - SD 0.0.98.
14+
- **0.0.12** - SD 0.0.99. Use dist/ instead of docs/. Add publish.sh
15+
- **0.0.13** - SD 0.0.100. SD Gallery 0.0.20
16+
- **0.0.14** - SD 0.0.102. SD Gallery 0.0.22
17+
- **0.0.15** - SD 0.0.111. SD Gallery 0.0.23. Ensure Smartdown API docs are available. Includes Decoration capability.
18+
- **0.0.16** - SD 0.0.112.
19+
- **0.0.17** - SD 0.0.113, Gallery 0.0.25 (DisclosablesPlus and Decorations)
20+
- **0.0.18** - SD 0.0.114.
21+
- **0.0.19** - SD 0.0.115. Use Terser webpack plugin instead of UglifyJS.
22+
- **0.0.20** - SD 0.0.116. Gallery 0.0.26.
23+
- **0.0.21** - SD 0.0.117. Gallery 0.0.28.
24+
- **0.0.22** - SD 0.0.118. Gallery 0.0.29.
25+
- **0.0.23** - SD 1.0.0. Gallery 0.0.29.
26+
- **0.0.24** - SD 1.0.1. Gallery 0.0.30.
27+
- **0.0.25** - SD 1.0.2. Gallery 0.0.30.
28+
- **0.0.26** - SD 1.0.5. Gallery 0.0.33.
29+
- **0.0.27** - SD 1.0.5. Gallery 0.0.33. Update dependencies. Fix CodeMirror problem where cursor is misaligned and you can't enter more than 3 characters.
30+
- **0.0.28** - SD 1.0.8. Gallery 0.0.37 (jsPsych).
31+
- **0.0.29** - Gallery 0.0.39
32+
- **0.0.30** - Gallery 0.0.40, SD 1.0.9
33+
- **0.0.31** - Gallery 0.0.41, SD 1.0.11
34+
- **0.0.32** - Gallery 0.0.41, SD 1.0.12
35+
- **0.0.33** - Gallery 0.0.42, SD 1.0.13. Add more padding to smartdown-outer-container.
36+
- **0.0.34** - Gallery 0.0.43, SD 1.0.14. Update deps.
37+
- **0.0.35** - Gallery 0.0.44 SD 1.0.16. Update deps.
38+
- **0.0.36** - Gallery 0.0.46 SD 1.0.18. Update deps. Simplify TerserWebpackPlugin options and avoid mangle.keep_fnames=true.
39+
- **0.0.37** - Gallery 0.0.47, SD 1.0.19.
40+
- **0.0.38** - Gallery 0.0.48, SD 1.0.20
41+
- **0.0.39** - Gallery 0.0.49, SD 1.0.21.
42+
- **0.0.40** - Gallery 0.0.50, SD 1.0.23.
43+
- **0.0.41** - Gallery 0.0.52, SD 1.0.25.
44+
- **0.0.42** - Gallery 0.0.53, SD 1.0.26.
45+
- **0.0.43** - Gallery 0.0.57, SD 1.0.30.
46+
- **0.0.44** - SD 1.0.35. Gallery 0.0.61.
47+
- **0.0.45** - SD 1.0.38. Gallery 0.0.63.
48+
- **0.0.46** - SD 1.0.39. Gallery 0.0.64.
49+
- **0.0.47** - SD 1.0.40. Gallery 0.0.65. Adds support for subhashes within a page. General cleanup.
50+
- **0.0.48** - Fix issues with Gist handling. Updated to SD 1.0.45, Gallery 0.0.69. Fix intra-page link handling.
51+
- **0.0.49** - SD 1.0.46. Fix issue on Videos page where vertical scrollbar appears in smartdown-outer-container.
52+
- **0.0.50** - SD 1.0.47. Gallery 0.0.71. Update deps.
53+
- **0.0.51** - SD 1.0.50. Gallery 0.0.74.
54+
- **0.0.52** - SD 1.0.52. Gallery 0.0.76.
55+
- **0.0.53** - SD 1.0.57. Gallery 0.0.79. Enhance SSL cert create for local development.
56+
- **0.0.54** - Fixed .gitignore to avoid SSL files, and removed ssl/ files that should not be committed. Improved publish.sh to be more robust against GitHub policy changes. Adjust version in package.json to 0.0.54.
57+
- **0.0.55** - Update to smartdown v1.0.58. Add handling of ?theme= URL argument.
58+
- **0.0.56** - Update deps. Ensure that ESLint works again. Ensure that Node v18 (current LTS version) works. Add VERSIONS.md. Added 'SmartdownViewer' global variable that currently has a '.version' field. Delete app/simplemde.js, which was not being used.

app/HelpController.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* global angular */
12
export default class HelpController {
23
constructor($http, $uibModalInstance, modalInfo) {
34
this.$http = $http;

app/MainController.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,32 @@ export default class MainController {
3131
this.$anchorScroll = $anchorScroll;
3232
this.$uibModal = $uibModal;
3333
this.showInputSource = false;
34+
35+
let hash = window.location.hash;
36+
let args = '';
37+
let themeName = '';
38+
const argsPos = hash.indexOf('?');
39+
if (argsPos >= 0) {
40+
args = hash.slice(argsPos + 1);
41+
hash = hash.slice(0, argsPos);
42+
43+
const extraArgPos = args.indexOf('?');
44+
45+
if (extraArgPos >= 0) {
46+
args = args.slice(0, extraArgPos);
47+
}
48+
49+
const argsParams = new URLSearchParams(args);
50+
themeName = argsParams.get('theme') || '';
51+
}
52+
53+
if (themeName === '') {
54+
const search = window.location.search;
55+
const searchParams = new URLSearchParams(search);
56+
themeName = searchParams.get('theme') || '';
57+
}
58+
59+
this.themeClass = `smartdown-theme-${themeName}`;
3460
this.inputSource = '';
3561
this.inputTitle = '';
3662
this.inputURL = '';
@@ -283,13 +309,13 @@ export default class MainController {
283309

284310
loadSource(source, cardKey, url, subHash) {
285311
// console.log('loadSource', source.slice(-20), cardKey, url, subHash);
312+
286313
this.inputSource = source;
287314
this.inputTitle = cardKey;
288315
// this.editSource = source;
289316
this.inputURL = url;
290317
this.errorMessage = null;
291318

292-
293319
var stateObj = window.history.state;
294320
// console.log('loadSource', source.slice(0, 20), cardKey, url, JSON.stringify(stateObj));
295321
if (url === null) {
@@ -434,6 +460,7 @@ export default class MainController {
434460
gistID = '';
435461
// console.log('this.lastLoadedRawPrefix !== rawPrefix', this.lastLoadedRawPrefix, rawPrefix);
436462
if (this.lastLoadedRawPrefix !== rawPrefix) {
463+
var suffix = '#NotSureWhatShouldGoHere';
437464
const cardURL = this.lastLoadedRawPrefix + suffix;
438465
// console.log('defaultCard1', this.lastLoadedRawPrefix, cardKey, cardURL);
439466
that.loadAsyncCard(cardKey, cardURL, subHash);

app/app.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import ngFileUpload from 'ng-file-upload';
88

99
import CodeMirror from 'codemirrorJS';
1010
window.CodeMirror = CodeMirror;
11+
window.SmartdownViewer = {
12+
version: '0.0.56',
13+
};
14+
1115
import 'codemirror/lib/codemirror.css';
1216
import 'codemirror/theme/neat.css';
1317
import 'codemirror/addon/edit/continuelist.js';
@@ -29,7 +33,7 @@ require('./style.css');
2933

3034
window.smartdown = smartdown;
3135

32-
var dependentModules = [nguibootstrap, ngResource, ngFileUpload, 'ui.codemirror']; // , 'simplemde'];
36+
var dependentModules = [nguibootstrap, ngResource, ngFileUpload, 'ui.codemirror'];
3337

3438
var app = angular.module('app', dependentModules);
3539

app/index.ejs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@
159159

160160
<div
161161
id="split-right"
162-
class="split smartdown-outer-container xsmartdown-theme-chat"
163-
ng-class="c.showInputSource ? 'source-visible' : 'source-hidden'">
162+
class="split smartdown-outer-container"
163+
ng-class="[c.showInputSource ? 'source-visible' : 'source-hidden', c.themeClass]">
164164
<div
165165
id="InputRender"
166166
class="smartdown-container InputRender"
@@ -227,7 +227,7 @@ Compose a URL that references an externally-hosted Smartdown document. For examp
227227

228228
</ul>
229229

230-
<h6>Smartdown v1.0.46, Gallery v0.0.69, Viewer v0.0.49</h6>
230+
<h6>Smartdown v1.0.47, Gallery v0.0.71, Viewer v0.0.50</h6>
231231

232232
</p>
233233

0 commit comments

Comments
 (0)