0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 22:52:40 +00:00
Commit Graph

101 Commits

Author SHA1 Message Date
Trevor Buckner
e67fadef02 Separate "style" and "metadata" panels 2021-06-05 15:58:31 -04:00
Trevor Buckner
ab473b12da Apply asyncHandler to getBrewFromId 2021-03-26 22:55:46 -04:00
Trevor Buckner
83c444ce11 Central Error Handling 2021-03-26 22:50:03 -04:00
Trevor Buckner
b98586150f Condense Download and Source paths also 2021-03-17 12:35:50 -04:00
Trevor Buckner
2f094801ca Move "get brew" logic to common function
Also add centralized error handling middleware
2021-03-16 00:06:01 -04:00
Trevor Buckner
6a12518ac1 Hardcode prefix 2021-03-12 22:24:36 -05:00
Trevor Buckner
c4db94e86f Tweaks to work with current Master 2021-03-07 00:34:47 -05:00
Trevor Buckner
08492b943b Merge branch 'master' into pr/1198 2021-03-06 22:42:15 -05:00
Trevor Buckner
5b242989da Handle cached text
The NEW page saves to the browser LocalStorage the current text in case the user goes to a different page before saving. The new "import" function wasn't working since it was being overwritten by any cached values if they existed from an earlier "new" page.
2021-03-04 22:58:40 -05:00
G.Ambatte
2f9bd00d70 Merge importPage functions into newPage. 2021-03-04 22:01:11 -05:00
G.Ambatte
ed23578dcf Lint fixes. 2021-03-04 21:57:33 -05:00
G.Ambatte
41ecbb62a2 Redirect new to import. 2021-03-04 21:57:32 -05:00
G.Ambatte
32ef36d7f7 Initial commit: Import from Share ID appears to be functioning correctly. 2021-03-04 21:57:32 -05:00
Christian Brickhouse
68811eb3fc Implementing magic item snippet from Issue 671. (#842)
* Implementing magic item snippet from Issue 671.

* Fixes syntax errors. Function moved into existing magic module.

* Implementing magic item snippet from Issue 671.

* Fixes syntax errors. Function moved into existing magic module.

* Magic Item Snippet, <dl>, `:` for blank line

Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
2021-02-24 21:58:11 -05:00
Alexey Sachkov
7057422077 Enable caching of static assets (#1217)
* Enable caching of static assets

* Remove dependency on mime package

Since we only care about two file extensions at the moment,
there is no need to grab the whole package just to avoid
calling 'endsWith' twice.
2021-02-19 17:58:02 -05:00
Trevor Buckner
e2cd7d9f07 Legacy renderer (#1184)
* Include two versions of Marked.js

* Include two versions of Marked.js

* Working two different render pipelines

Adds stylesheet "styleLegacy.less"
Adds markdownHandler "markdownLegacy.js"
The BrewRenderer will switch between these and the new pipeline dependent on the "version" prop passed in.

* Mustache-style div blocks

* Legacy snippets & columnbreak

* Codemirror styling for Div Blocks

* Lint

* Codemirror highlights for inline Divs as well

These will turn red `{{class Content}}`

Multi-line divs will turn purple

```
{{class,class2
content
}}
```

No real need for these to be different colors. Just for testing.

* More lint

* Update dependencies.

* Adding Button to switch render pipelines

* Update Marked.js

* Popup alert to refresh page when renderer changed

* Don't compress files in Development (very slow)

* Block DIV or inline Span depending on {{ placement

* \column emits a Div instead of Span

* Allow share page to use new renderer

* {{ divs no longer need empty lines. Spans work in lists.

* Typo

* Typo

* Enforce \page must be at start of line. Code cleanup.

* Inject newlines after/before {{/}} to avoid needing blank lines

* Fixes issues with tables.

* Remove console.log

* Fix spacing issue for Spans

* Move things from Brewrenderer to Markdown

Try to keep all custom text fiddling in one spot.

* Rename variables

* Update Font-Awesome to v5.15. Fix style issues on popups.

* Update {{ Divs/Spans, Fix nested hilighting

* Fixed Spans/divs with no tags or just commas

* Use blacklist for {{ to allow more characters

* Update package-lock.json

* Update all icons to Font-awesome 5

* V3 hidden behind config variable

Add "globalThis.enable_v3 = true" in the console to enable.

* lint
2021-02-02 20:38:25 -05:00
G.Ambatte
c3bfd1e8bf Prefix loading successfully from config/local.json for both Homebrewery and Google brews.
Concats switched to string literals to make Linter happy.
2021-01-29 22:53:58 +13:00
G.Ambatte
051773a084 Move filename prefix to configurable item in config/default.json 2021-01-28 23:13:01 +13:00
G.Ambatte
bcbf596aa8 Increase minimum height of brewItem in CSS so all four items are always visible.
Adjust eslint line in `server.js` to re-enable the test with a slightly higher maximum value.
2021-01-22 21:24:22 +13:00
G.Ambatte
d88b04783d Lint corrections 2021-01-22 17:31:01 +13:00
G.Ambatte
6d219aa701 Unwinding refactored code + corrections. 2021-01-22 17:29:26 +13:00
G.Ambatte
da32845dd1 (WIP) Unwinding refactoring to improve clarity and readability of new functions 2021-01-22 16:44:34 +13:00
Sean Robertson
21f08c97a1 Expand source text escaping/processing for improved readability 2021-01-22 13:56:29 +13:00
G.Ambatte
06223d576d Fixes from Linter 2021-01-21 20:32:23 +13:00
G.Ambatte
5c7a9c92d1 Integrated download function into server.js
Remove new function from `Homebrew.Model.js`
Remove `sourceFunctions.jsx` module
2021-01-21 20:27:46 +13:00
G.Ambatte
e8135fcbb4 Added sanitizeHtml function to Homebrew model to generate HTML from the brew for the source page.
Moved `source` page generation function to a new function module. Added option to function to create plain text download with a sanitized filename and made it accessible from a new page: `download`.
Added the `download` item to the BrewItem so it appears on each brew on the User page.
Added `sanitize-filename` dependency to `package.json`.
2021-01-21 00:02:15 +13:00
G.Ambatte
7fccb7e03e Shift functionality to new file in attempt to reduce code duplication in server.js 2021-01-17 22:07:26 +13:00
G.Ambatte
715ddf2b8c Initial commit 2021-01-17 18:52:56 +13:00
G.Ambatte
24f5fcb5a0 Move NODE_ENV to service file; remove from server.js and config/default.json 2021-01-17 17:19:24 +13:00
G.Ambatte
8f6270723e Update server.js
Lint is happy, now attempting to pacify CircleCI
2021-01-17 17:19:24 +13:00
G.Ambatte
9cccd2d74e Update server.js
Eliminating unnecessary debugging code, reducing line count and making lint happy :)
2021-01-17 17:19:24 +13:00
G.Ambatte
e140b656a6 Update server.js
Change to setting NODE_ENV; default to 'local' if not set via environment variable or in the config file.
2021-01-17 17:19:23 +13:00
G.Ambatte
8887961d09 Add config items
Add config items and default values:
- web_port (8001)
- environment (local)
2021-01-17 17:19:17 +13:00
G.Ambatte
ba600f5da6 FreeBSD installation (#1165)
* Update server.js

Eliminate requirement to CD into project directory prior to running `npm start` or `node server.js`.

* Add rc.d daemon script

Adds a RC.d daemon script to control the HomeBrewery status. Based on Andrew Pearson's Node-RED script for the same purpose.

* Create install.sh

* Update install.sh

* Update install.sh

Switch to latest version of MongoDB

* Add config items

Add config items and default values:
- web_port (8001)
- environment (local)

* Remove environment variables from rc.d

Remove environment variables from rc.d as they are now in config/default.json.

* Update server.js

Change to setting NODE_ENV; default to 'local' if not set via environment variable or in the config file.

* Remove --force option

Remove --force option from `npm audit fix`. While this has not caused any issues to date, there is no guarantee that it will continue to be the case.

* Create README.FREEBSD.md

Initial write up of install instructions. Includes instruction to `wget` from the `naturalcrit/homebrewery` project rather than the FreeBSD fork, on the assumption that the PR will be merged at some point.

* Update install.sh

Change to main project repo, on assumption that the PR will be merged at some point

* Change install directory

Change of install directory to `/usr/local/homebrewery`

* Update homebrewery

Add `dev_mode` to the HomeBrewery service, which starts the HomeBrewery project in live rebuild mode.

* Update server.js

Eliminating unnecessary debugging code, reducing line count and making lint happy :)

* Update server.js

Lint is happy, now attempting to pacify CircleCI

* Move NODE_ENV to service file; remove from server.js and config/default.json

* Remove hanging comma in config.json
Change default port assignment from 8000 to 8001 in config.json and FreeBSD service config

* Add link to FreeBSD install documenation in the main README.md file

* Fix for MongoDB package update breaking install script
Change to enable use of rcvars for NODE_ENV and PORT
2021-01-10 17:44:49 -05:00
Trevor Buckner
5a17697e7e Merge pull request #1118 from naturalcrit/fixGoogleMetadata
Fix metadata in Google docs
2020-11-25 13:26:14 -05:00
Trevor Buckner
7462e66858 Fix metadata in Google docs
Update view counts via service account since modifying another users' file properties requires increased permission scope
2020-11-22 23:53:34 -05:00
Trevor Buckner
56795afabb Fix broken API calls
expressStaticGzip was serving empty index files when it saw requests ending in '/' like 'api/newGoogle/'
2020-11-12 17:17:02 -05:00
Trevor Buckner
74c615f156 Cleanup 2020-11-11 22:21:27 -05:00
Trevor Buckner
133af4ea2c lint 2020-11-11 22:02:17 -05:00
Trevor Buckner
4182c79354 Use a library instead. Checks that the browser is compatible first. 2020-11-11 22:01:42 -05:00
Trevor Buckner
759d986188 lint 2020-11-11 21:41:48 -05:00
Trevor Buckner
600ca90fc0 Serve compressed static files if available 2020-11-11 21:19:49 -05:00
Trevor Buckner
8add76fb50 Linting 2020-10-26 13:27:37 -04:00
Rodrigo Kuerten
b908cd7cbd Changed page title to show homebrew title whenever possible 2020-10-25 13:55:10 -03:00
Trevor Buckner
77973f0037 v2.10.1 - Fix brews lost on back button 2020-10-12 14:30:42 -04:00
Trevor Buckner
8fe0148821 Fix Share links 2020-10-07 17:13:37 -04:00
Trevor Buckner
28ed2fe8f2 Fix Config spelling (must be all lowercase) 2020-10-07 16:17:05 -04:00
Trevor Buckner
131df2d82a Bug Fix 2020-10-07 15:55:07 -04:00
Trevor Buckner
0afb503860 Update Version number & cleanup 2020-10-07 15:02:42 -04:00
Trevor Buckner
864cc7a7bb Fix issues making brews when not signed in 2020-10-06 14:20:09 -04:00