diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index cf16e9c..2f2f4c1 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,20 +1,31 @@ name: Publish Docs on: + push: + branches: + - main release: types: [created] jobs: docs: runs-on: ubuntu-latest + permissions: + contents: write steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 with: - node-version: '12.x' + node-version: 'latest' registry-url: 'https://npm.pkg.github.com' scope: '@djthorpe' - - run: npm install - - run: npm run docs - - uses: LuisEnMarroquin/gh-pages-publish@v2.4.4 + + - name: Generate Documentatin + run: | + npm install + npm run docs + + - name: Deploy Documentation + uses: JamesIves/github-pages-deploy-action@v4 with: - FOLDER: dist/doc - SSHKEY: ${{ secrets.SSH }} + folder: dist/doc diff --git a/.gitignore b/.gitignore index 39595ba..9ef30d7 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,5 @@ dist .tern-port .DS_Store .apdisk +._* +.DS_Store diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 48273d1..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true - }, - "eslint.validate": [ - "javascript" - ] -} diff --git a/README.md b/README.md index 4c4ff46..953e544 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,2 @@ # js-framework -This Javascript framework is a pretty traditional Model, View and Controller -implementation which provides the following classes: - - * __Controller class__: Subclass this and hook your views and provider events together; - * __Provider class__: To be used to request JSON objects and arrays of objects from an external source; - * __Model class__: subclass this for your JSON models, and separately define the members of your class; - * __View classes__: classes are provided for form, list, button, etc. - -It uses [Bootstrap](https://getbootstrap.com/) to implement the underlying user -interface, adding a few components. - -## Use - -Add the framework as a dependency in your project: - -```bash -[bash] echo "@djthorpe:registry=https://npm.pkg.github.com" >> .npmrc -[bash] npm install @djthorpe/js-framework -``` - -Import assets and create a controller in your JavaScript: - -```javascript -const jsframework = require('@djthorpe/js-framework'); - -// Run application -window.addEventListener('DOMContentLoaded', () => { - const app = jsframework.Controller.New(Controller); - app.main(); -}); -``` - -In reality, you would subclass the `Controller` class, and create models, views -and providers within the controller, then use `addEventListener` for each view -and provider to react to events. More informaton is provided in the documentation. - -## Reference - -The reference is provided in the `dist/doc` folder in the published package, or at -https://djthorpe.github.io/js-framework/ - diff --git a/config/jsdoc.config.json b/config/jsdoc.config.json index 79e5ab1..e3db4da 100644 --- a/config/jsdoc.config.json +++ b/config/jsdoc.config.json @@ -1,7 +1,7 @@ { "source": { "include": [ - "js" + "src" ], "exclude": [ "node_modules" @@ -12,8 +12,5 @@ "readme": "./README.md", "destination": "./dist/doc", "recurse": true - }, - "plugins": [ - "./node_modules/@ckeditor/jsdoc-plugins/lib/export-fixer/export-fixer.js" - ] + } } diff --git a/css/style.css b/css/style.css deleted file mode 100644 index 2c26f9c..0000000 --- a/css/style.css +++ /dev/null @@ -1,103 +0,0 @@ - -:root { - /* colours */ - --primary-color: #16f; - --secondary-color: #aaa; - --light-color: #eee; - --white-color: #fff; - --dark-color: #333; - --black-color: #000; - - /* controls */ - --control-color: #bbb; - --control-color-hover: #ccc; - --control-color-active: #ddd; - --control-color-disabled: #ddd; - - /* fonts */ - --font-size-normal: 0.9rem; - --font-size-small: 0.75rem; - --font-weight-normal: 500; - --font-weight-bold: 700; - --font-weight-extrabold: 700; - - /* borders */ - --border-radius: 0.25em; - - /* badge-view */ - --badge-background-color: var(--primary-color); - --badge-color: var(--light-color); - --badge-padding-x: 0.35em; - --badge-padding-y: 0.35em; - --badge-font-size: var(--font-size-small); - --badge-font-weight: var(--font-weight-bold); - --badge-border-radius: var(--border-radius); - - /* button-view */ - --button-background-color: var(--control-color); - --button-background-color-hover: var(--control-color-hover); - --button-background-color-active: var(--control-color-active); - --button-background-color-disabled: var(--control-color-disabled); - --button-color: var(--dark-color); - --button-color-hover: var(--dark-color); - --button-color-active: var(--light-color); - --button-color-disabled: var(--light-color); - --button-font-weight: var(--font-weight-bold); - --button-font-weight-hover: var(--font-weight-bold); - --button-font-weight-active: var(--font-weight-bold); - --button-font-weight-disabled: var(--font-weight-bold); - --button-border-radius: var(--border-radius); - --button-font-size: var(--font-size-normal); - --button-padding-x: 0.45em; - --button-padding-y: 0.45em; - --button-offset-active: 0.1em; - - /* card view */ - --card-margin: 0.05em; - --card-padding: 0.15em; - --card-background-color: none; - --card-border-color: var(--light-color); - --card-border-radius: var(--border-radius); - - /* navbar-view */ - --navbar-background-color: var(--light-color); - --navbar-color: var(--dark-color); - --navbar-border-color: var(--light-color); - --navbar-border-width: 0.5px; - --navbar-padding-y: 0.5em; - --navbar-padding-x: 0.5em; - - /* nav-view */ - --nav-border-bottom: 1px solid var(--secondary-color); - - /* navitem-view */ - --navitem-color: var(--dark-color); - --navitem-color-hover: var(--dark-color); - --navitem-color-active: var(--dark-color); - --navitem-color-disabled: var(--light-color); - --navitem-background-color: none; - --navitem-background-color-hover: none; - --navitem-background-color-active: none; - --navitem-background-color-disabled: none; - --navitem-font-weight: var(--font-weight-normal); - --navitem-font-weight-active: var(--font-weight-extrabold); - --navitem-font-weight-hover: var(--font-weight-bold); - --navitem-font-weight-disabled: var(--font-weight-normal); - --navitem-padding-x: 1rem; - --navitem-padding-y: .5rem; - - /* stepper-view */ - --stepper-background-color: var(--light-color); - --stepper-color: var(--dark-color); - --stepper-btn-color: var(--light-color); - --stepper-btn-background-color: var(--control-color); - --stepper-btn-background-color-hover: var(--control-color-hover); - --stepper-btn-background-color-active: var(--control-color-active); - --stepper-border-radius: var(--border-radius); - --stepper-padding-x: 0.35em; - --stepper-padding-y: 0.35em; - - /* icons */ - --icon-plus: url('data:image/svg+xml,'); - --icon-minus: url('data:image/svg+xml,'); -} diff --git a/etc/example.json b/etc/example.json deleted file mode 100644 index ecb7840..0000000 --- a/etc/example.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "fruit": "Apple", - "size": "Large", - "color": "Red" - }, - { - "fruit": "Banana", - "size": "Bendy", - "color": "Yellow" - } -] \ No newline at end of file diff --git a/etc/server.yaml b/etc/server.yaml deleted file mode 100644 index de64d89..0000000 --- a/etc/server.yaml +++ /dev/null @@ -1,8 +0,0 @@ -plugins: - - ../../bin/httpserver.plugin - - ../../bin/log.plugin - - ../../bin/static.plugin - -static: - "/": dist/ - \ No newline at end of file diff --git a/html/index.html b/html/index.html deleted file mode 100644 index 2583a4f..0000000 --- a/html/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - -
-Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore - et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut - aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse - cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in - culpa qui officia deserunt - mollit anim id est laborum.
-Duis aute irure dolor in reprehenderit in voluptate velit esse - cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in - culpa qui officia deserunt - mollit anim id est laborum.
-Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore - et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut - aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse - cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in - culpa qui officia deserunt - mollit anim id est laborum.
-Duis aute irure dolor in reprehenderit in voluptate velit esse - cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in - culpa qui officia deserunt - mollit anim id est laborum.
-