.github/ 0000775 0000000 0000000 00000000000 15160755404 0012425 5 ustar 00root root 0000000 0000000 .github/workflows/ 0000775 0000000 0000000 00000000000 15160755404 0014462 5 ustar 00root root 0000000 0000000 .github/workflows/build.yml 0000664 0000000 0000000 00000001676 15160755404 0016316 0 ustar 00root root 0000000 0000000 # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: build
on:
schedule:
- cron: '0 0 1 * *'
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['lts/*']
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm i -g grunt-cli
- run: npm install
- run: grunt
.gitignore 0000664 0000000 0000000 00000000337 15160755404 0013060 0 ustar 00root root 0000000 0000000 /build
/node_modules
/*.log
/*.iws
.idea/workspace.xml
.idea/tasks.xml
.idea/profiles_settings.xml
.idea/inspectionProfiles/Project_Default.xml
.idea/inspectionProfiles/profiles_settings.xml
node_modules/.yarn-integrity
.gitmodules 0000664 0000000 0000000 00000000552 15160755404 0013244 0 ustar 00root root 0000000 0000000 [submodule "corifeus-utils"]
path=corifeus-utils
url=https://github.com/patrikx3/corifeus-utils
branch=master
[submodule "corifeus-builder"]
path=corifeus-builder
url=https://github.com/patrikx3/corifeus-builder
branch=master
[submodule "corifeus-app-web-pages"]
path=corifeus-app-web-pages
url=https://github.com/patrikx3/corifeus-app-web-pages
branch=master
.npmignore 0000664 0000000 0000000 00000000271 15160755404 0013064 0 ustar 00root root 0000000 0000000 /.idea
/artifacts
/build
/Gemfile
/_layouts
/_site
/_includes
/test
/node_modules
/*.iml
/*.ipr
/*.iws
/.travis.yml
/.scrutinizer.yml
/Gruntfile.js
/corifeus-boot.json
/.github
/.vscode Gruntfile.js 0000664 0000000 0000000 00000004371 15160755404 0013367 0 ustar 00root root 0000000 0000000 const utils = require('corifeus-utils');
module.exports = (grunt) => {
const _ = require('lodash');
const builder = require(`corifeus-builder`);
const loader = new builder.loader(grunt);
loader.js();
grunt.registerTask('cory-load-modules', async function() {
const done = this.async();
try {
let replace = '';
/*
let finds = await utils.fs.find({
find: 'package.json',
});
const path = require('path')
const findsP3x = await utils.fs.find({
root: path.resolve(process.cwd(), '../p3x'),
find: 'package.json',
});
finds = finds.concat(findsP3x)
*/
const packages = (await utils.http.request('https://server.patrikx3.com/api/patrikx3/git/repos')).body.repo
let sortedObject = {}
sortedObject = Object.keys(packages).sort((a, b) => {
return packages[b].corifeus.stargazers_count - packages[a].corifeus.stargazers_count
}).reduce((prev, curr, i) => {
prev[i] = packages[curr]
return prev
}, {})
//console.log(JSON.stringify(sortedObject, null, 4))
Object.keys(sortedObject).forEach((key) => {
const pkg = sortedObject[key]
const desc = pkg.description ;
const hiddenStars = ``;;
replace += `
### ${hiddenStars} ${desc}
[README](https://corifeus.com/${pkg.corifeus.reponame === 'corifeus' ? 'matrix' : pkg.corifeus.reponame}) | [Github](https://github.com/patrikx3/${pkg.corifeus.reponame})
---
`
})
const config = grunt.config.get('cory-replace');
config['projects'] = {
prefix: '[//]: #@corifeus-projects',
postfix: '[//]: #@corifeus-projects:end',
replace: replace,
files: [
'README.md',
]
}
grunt.config.set('cory-replace', config)
done();
} catch(e) {
done(e)
}
});
grunt.registerTask('default', ['cory-load-modules'].concat(builder.config.task.build.js));
}
LICENSE 0000664 0000000 0000000 00000002252 15160755404 0012073 0 ustar 00root root 0000000 0000000
@license corifeus v2024.4.102
🎮 Corifeus Matrix
https://corifeus.com/matrix
Copyright (c) 2024 Patrik Laszlo / P3X / Corifeus and contributors.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
README.md 0000664 0000000 0000000 00000021270 15160755404 0012346 0 ustar 00root root 0000000 0000000 [//]: #@corifeus-header
[](https://paypal.me/patrikx3) [](https://www.patrikx3.com/en/front/contact) [](https://www.facebook.com/corifeus.software) [](https://stats.uptimerobot.com/9ggnzcWrw)
---
# 🎮 Corifeus Matrix v2024.4.102
**Bugs are evident™ - MATRIX️**
### NodeJS LTS is supported
### Built on NodeJs version
```txt
v20.11.0
```
# Description
[//]: #@corifeus-header:end
The fun nonsense passion derivate.
## Applications
[//]: #@corifeus-projects
### 📚 P3X OneNote Linux
[README](https://corifeus.com/onenote) | [Github](https://github.com/patrikx3/onenote)
---
### 📡 P3X Redis UI is a very functional handy database GUI and works in your pocket on the responsive web or as a desktop app
[README](https://corifeus.com/redis-ui) | [Github](https://github.com/patrikx3/redis-ui)
---
### 🆖 Angular Dynamic Compile - Convert strings to Angular components
[README](https://corifeus.com/angular-compile) | [Github](https://github.com/patrikx3/angular-compile)
---
### 🤖 P3X Gitlist - A decorated enhanced elegant, feature rich and modern private git ui repository viewer
[README](https://corifeus.com/gitlist) | [Github](https://github.com/patrikx3/gitlist)
---
### 💾 Linux RAM disk persistent with Systemd timer, service and suspend
[README](https://corifeus.com/ramdisk) | [Github](https://github.com/patrikx3/ramdisk)
---
### 🌐 Freenom API - Promise and auto renew expiring domains
[README](https://corifeus.com/freenom) | [Github](https://github.com/patrikx3/freenom)
---
### ☕ OpenWrt Insomnia for Linksys WRT
[README](https://corifeus.com/openwrt-insomnia) | [Github](https://github.com/patrikx3/openwrt-insomnia)
---
### 🏍️ The p3x-redis-ui-server package motor that is connected to the p3x-redis-ui-material web user interface
[README](https://corifeus.com/redis-ui-server) | [Github](https://github.com/patrikx3/redis-ui-server)
---
### ⌚ SystemD Manager, watchdog, notifier and service
[README](https://corifeus.com/systemd-manager) | [Github](https://github.com/patrikx3/systemd-manager)
---
### 🎮 Corifeus Matrix
[README](https://corifeus.com/matrix) | [Github](https://github.com/patrikx3/corifeus)
---
### Converts xml to json and vice-versa, using node-expat
[README](https://corifeus.com/xml2json) | [Github](https://github.com/patrikx3/xml2json)
---
### 💿 The p3x-redis-ui-material web interface that connects to the p3x-redis-ui-server via http and socket.io
[README](https://corifeus.com/redis-ui-material) | [Github](https://github.com/patrikx3/redis-ui-material)
---
### 🔥 Cache every request in Angular, not only the GET, but all methods of this interceptor, and allows you to interact with the interceptor via specific headers and modify the request, and these specific headers will be not included in the final request
[README](https://corifeus.com/angular-http-cache-interceptor) | [Github](https://github.com/patrikx3/angular-http-cache-interceptor)
---
### 📃 Generates PDF from HTML with custom headers and footers with wkhtmltopdf
[README](https://corifeus.com/html-pdf) | [Github](https://github.com/patrikx3/html-pdf)
---
### 🍶 Verdaccio CLI
[README](https://corifeus.com/verdaccio-cli) | [Github](https://github.com/patrikx3/verdaccio-cli)
---
### 🚅 Find the closest or exact value using binary search
[README](https://corifeus.com/binary-search-closest) | [Github](https://github.com/patrikx3/binary-search-closest)
---
### 🕸️ Corifeus App Web Pages
[README](https://corifeus.com/corifeus-app-web-pages) | [Github](https://github.com/patrikx3/corifeus-app-web-pages)
---
### 🚧 Grunt Express Server updated with additional options
[README](https://corifeus.com/grunt-p3x-express) | [Github](https://github.com/patrikx3/grunt-p3x-express)
---
### 📈 Convert JSON to Excel XLSX with offloading the constructing the data using a worker thread
[README](https://corifeus.com/json2xls-worker-thread) | [Github](https://github.com/patrikx3/json2xls-worker-thread)
---
### 💣 Tools
[README](https://corifeus.com/tools) | [Github](https://github.com/patrikx3/tools)
---
### ❤️ Corifeus Utils
[README](https://corifeus.com/corifeus-utils) | [Github](https://github.com/patrikx3/corifeus-utils)
---
### 🏗️ Corifeus Builder
[README](https://corifeus.com/corifeus-builder) | [Github](https://github.com/patrikx3/corifeus-builder)
---
[//]: #@corifeus-projects:end
## History ...
#### [Code style](artifacts/readme/code-style.md)
#### [Architecture](artifacts/readme/arthictecture/overview.md)
#### [The name of the original company](https://en.wikipedia.org/wiki/Coryphaeus)
[//]: #@corifeus-footer
---
🙏 This is an open-source project. Star this repository, if you like it, or even donate to maintain the servers and the development. Thank you so much!
Possible, this server, rarely, is down, please, hang on for 15-30 minutes and the server will be back up.
All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://corifeus.com)) could have minor errors, since I am developing in my free time. However, it is usually stable.
**Note about versioning:** Versions are cut in Major.Minor.Patch schema. Major is always the current year. Minor is either 4 (January - June) or 10 (July - December). Patch is incremental by every build. If there is a breaking change, it should be noted in the readme.
---
[**CORIFEUS**](https://corifeus.com/matrix) Build v2024.4.102
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [](https://www.patrikx3.com/en/front/contact) [](https://www.facebook.com/corifeus.software)
[//]: #@corifeus-footer:end
artifacts/ 0000775 0000000 0000000 00000000000 15160755404 0013045 5 ustar 00root root 0000000 0000000 artifacts/readme/ 0000775 0000000 0000000 00000000000 15160755404 0014302 5 ustar 00root root 0000000 0000000 artifacts/readme/arthictecture/ 0000775 0000000 0000000 00000000000 15160755404 0017150 5 ustar 00root root 0000000 0000000 artifacts/readme/arthictecture/overview.md 0000664 0000000 0000000 00000006144 15160755404 0021345 0 ustar 00root root 0000000 0000000 [//]: #@corifeus-header
# 🎮 Corifeus Matrix
[//]: #@corifeus-header:end
# Architecture

[//]: #@corifeus-footer
---
🙏 This is an open-source project. Star this repository, if you like it, or even donate to maintain the servers and the development. Thank you so much!
Possible, this server, rarely, is down, please, hang on for 15-30 minutes and the server will be back up.
All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://corifeus.com)) could have minor errors, since I am developing in my free time. However, it is usually stable.
**Note about versioning:** Versions are cut in Major.Minor.Patch schema. Major is always the current year. Minor is either 4 (January - June) or 10 (July - December). Patch is incremental by every build. If there is a breaking change, it should be noted in the readme.
---
[**CORIFEUS**](https://corifeus.com/matrix) Build v2024.4.102
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [](https://www.patrikx3.com/en/front/contact) [](https://www.facebook.com/corifeus.software)
[//]: #@corifeus-footer:end
artifacts/readme/code-style.md 0000664 0000000 0000000 00000007777 15160755404 0016716 0 ustar 00root root 0000000 0000000 [//]: #@corifeus-header
# 🎮 Corifeus Matrix
[//]: #@corifeus-header:end
# Code style
## Cases we use
```camelCase = theFirstIsSmallTheRestIsCapital```
```kebab-case = meaning-only-lower-case-and-a-z-and-dash-and-numbers```
```PascalCase = JustAlphaAndAlwaysCapitalWords```
## CSS Prefix
``` kebab-case ```
**Prefix so that get away form namespace clashes.**
```.cory = corifeus```
```css
.cory-something { font-family: "Corifeus"; }
```
## HTML Prefix
``` kebab-case ```
**Prefix so that get away form namespace clashes.** It is both for tags and attributes.
``cory = corifeus``
```html
```
## Url
``` kebab-case ```
```bash
https://localhost/very-long-sentance/is/just/kebab-case.html
```
## Path
``` kebab-case ```
```bash
/module-one/love/live/path.js
/try/code-style/by/class.js
```
## Filename
``` kebab-case ```
```bash
// function
camel-case.js
// class
camel-case-is-kebab-as-well.js
// html file
kebab-case.html
// regular file
kebab-case.any
kebab-case.js
kebab-case.pdf
kebab-case.html
kebab-case.css
```
## Namespace
``` camelCase ```
The namespace = ```corifeus```
```js
// JavaScript
global.corifeus.camelCase = () => console.log('camelCase');
global.corifeus.camelCase = class camelCaseClass {};
```
## Variables
``` camelCase ```
```js
// JavaScript
const variableIsCool = 'camelCase';
let anotherVariable = false;
var oldTypeVariable = 'cool';
```
## Functions
``` camelCase ```
```js
// JavaScript
function justSimpleFunction() {
console.log('alsoCamelCase')
}
```
## Prototype based class
I prefer ``` camelCase ``` , though `PascalCase` is fine.
```js
// JavaScript
function prototypeBasedClass() {
console.log('likeAClassIsCamelCase');
}
prototypeBasedClass.staticFunction = function() {}
prototypeBasedClass.staticVariable = true;
prototypeBasedClass.prototype.instanceFunction = function() {}
prototypeBasedClass.prototype.instanceVariable = true;
```
## Classes
I rarely use classes, but sometimes it is good, I prefer `camelCase` but for classes it is ok to use `PascalCase`.
``` camelCase ```
```js
// JavaScript
class simpleClass {
constructor() {}
instanceFunctionCamelCase() {}
get instanceProperty() { return true; }
set instanceProperty(value) { this._instanceProperty = value; }
static classMethod() { console.log('camelCase'); }
static get classProperty() { return 'camelCase'; }
}
```
## Objects
``` camelCase ```
```js
// JavaScript
const objects = {
variableNow: camelCase,
methodName: camelCase,
nameOfTheClass: camelCase,
staticFuncitonName: camelCase.static,
instance: camelCase.variable
}
```
[//]: #@corifeus-footer
---
🙏 This is an open-source project. Star this repository, if you like it, or even donate to maintain the servers and the development. Thank you so much!
Possible, this server, rarely, is down, please, hang on for 15-30 minutes and the server will be back up.
All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://corifeus.com)) could have minor errors, since I am developing in my free time. However, it is usually stable.
**Note about versioning:** Versions are cut in Major.Minor.Patch schema. Major is always the current year. Minor is either 4 (January - June) or 10 (July - December). Patch is incremental by every build. If there is a breaking change, it should be noted in the readme.
---
[**CORIFEUS**](https://corifeus.com/matrix) Build v2024.4.102
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [](https://www.patrikx3.com/en/front/contact) [](https://www.facebook.com/corifeus.software)
[//]: #@corifeus-footer:end
artifacts/readme/patterns.md 0000664 0000000 0000000 00000004246 15160755404 0016472 0 ustar 00root root 0000000 0000000 [//]: #@corifeus-header
# 🎮 Corifeus Matrix
[//]: #@corifeus-header:end
# Patterns
* core - implemented in server / client
* schema
* validation
* types
* relations by schema
* json schema
* data
* query
* paginate / page
* limit / max
* sort
* count
* search / find
* delete
* disable
* id
* all
* last
* first
* auth
* login
* logout
* live / socket.io / reactivex / observable
* model
* entity
* created
* modified
* version
* disabled
* deleted
* validation
* user
* role
* category / tag
* client
* notification / growl / smack - multiple!
* angular
* virtual list / like facebook list with live update
* live / socket.io
* form
* validation
* grid / list / thumbnail
* pagination
* query / search
* sort
[//]: #@corifeus-footer
---
🙏 This is an open-source project. Star this repository, if you like it, or even donate to maintain the servers and the development. Thank you so much!
Possible, this server, rarely, is down, please, hang on for 15-30 minutes and the server will be back up.
All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://corifeus.com)) could have minor errors, since I am developing in my free time. However, it is usually stable.
**Note about versioning:** Versions are cut in Major.Minor.Patch schema. Major is always the current year. Minor is either 4 (January - June) or 10 (July - December). Patch is incremental by every build. If there is a breaking change, it should be noted in the readme.
---
[**CORIFEUS**](https://corifeus.com/matrix) Build v2024.4.102
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [](https://www.patrikx3.com/en/front/contact) [](https://www.facebook.com/corifeus.software)
[//]: #@corifeus-footer:end
corifeus-app-web-pages/ 0000775 0000000 0000000 00000000000 15160755404 0015332 5 ustar 00root root 0000000 0000000 corifeus-builder/ 0000775 0000000 0000000 00000000000 15160755404 0014330 5 ustar 00root root 0000000 0000000 corifeus-utils/ 0000775 0000000 0000000 00000000000 15160755404 0014042 5 ustar 00root root 0000000 0000000 corifeus-web-material/ 0000775 0000000 0000000 00000000000 15160755404 0015253 5 ustar 00root root 0000000 0000000 corifeus-web-material/LICENSE 0000664 0000000 0000000 00000002323 15160755404 0016260 0 ustar 00root root 0000000 0000000
@license corifeus-web-material v2019.10.456
🌴 Corifeus Web Material
https://pages.corifeus.com/corifeus-web-material
Copyright (c) 2019 Patrik Laszlo / P3X / Corifeus and contributors.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
corifeus-web-material/README.md 0000664 0000000 0000000 00000010143 15160755404 0016531 0 ustar 00root root 0000000 0000000 [//]: #@corifeus-header
[](https://paypal.me/patrikx3) [](https://www.patrikx3.com/en/front/contact) [](https://www.facebook.com/corifeus.software) [](https://travis-ci.com/patrikx3/corifeus-web-material)
[](https://uptimerobot.patrikx3.com/)
[](https://www.npmjs.com/package/corifeus-web-material/)
---
# 🌴 Corifeus Web Material v2019.10.456
**Bugs are evident™ - MATRIX️**
### Node Version Requirement
```
>=10.16.0
```
### Built on Node
```
v12.8.0
```
The ```async``` and ```await``` keywords are required.
Install NodeJs:
https://nodejs.org/en/download/package-manager/
# Built on Angular
```text
8.2.2
```
# Description
[//]: #@corifeus-header:end
Corifeus Web Material.
https://material.corifeus.com
# Error
There is in ```uglifyjs``` or ```cssminify``` is making it not working with this repo, right now it is using the ```---cory-verbose``` build (which removes the compression - uglifys and cssminfier).
# Hack
For now in beta, uses ```@angular/cdk```, required.
* Component
* Loading
* Http 404
* Theme menu button
* Translation menu button
* Themes
* Corifeus light
* Corifeus dark
* Pink blue-gray
* Purple green
* Deep-purple Amber
* Indigo pink
* Services
* Notify
* Themes
# Dev info
## Contrast color
https://github.com/angular/material2/issues/4229#issuecomment-296611188
```scss
.test {
color: mat-color($button-primary, 900-contrast)
}
```
## ElementRef Material
The default ```@ViewChild``` is not `ElementRef` with Material.
Need to use like:
```typescript
@ViewChild('elementButton', {read: ElementRef}) elementButton : ElementRef;
```
https://github.com/angular/material2/blob/master/src/lib/core/theming/_theming.scss
## Queue task
* Override ```console.error``` as a Notify error
## Colors
monochromatic, analogous, complementary, tradic
[//]: #@corifeus-footer
---
🙏 This is an open-source project. Star this repository, if you like it, or even donate to maintain the servers and the development. Thank you so much!
Possible, this server, rarely, is down, please, hang on for 15-30 minutes and the server will be back up.
All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://corifeus.com)) could have minor errors, since I am developing in my free time. However, it is usually stable.
**Note about versioning:** Versions are cut in Major.Minor.Patch schema. Major is always the current year. Minor is either 4 (January - June) or 10 (July - December). Patch is incremental by every build. If there is a breaking change, it should be noted in the readme.
---
[**CORIFEUS-WEB-MATERIAL**](https://pages.corifeus.com/corifeus-web-material) Build v2019.10.456
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [](https://www.patrikx3.com/en/front/contact) [](https://www.facebook.com/corifeus.software)
## P3X Sponsors
[IntelliJ - The most intelligent Java IDE](https://www.jetbrains.com/?from=patrikx3)
[](https://www.jetbrains.com/?from=patrikx3) [](https://www.nosqlbooster.com/)
[The Smartest IDE for MongoDB](https://www.nosqlbooster.com)
[//]: #@corifeus-footer:end
corifeus-web-material/index.ts 0000664 0000000 0000000 00000000027 15160755404 0016731 0 ustar 00root root 0000000 0000000 export * from './src';
corifeus-web-material/src/ 0000775 0000000 0000000 00000000000 15160755404 0016042 5 ustar 00root root 0000000 0000000 corifeus-web-material/src/boot.ts 0000664 0000000 0000000 00000003122 15160755404 0017353 0 ustar 00root root 0000000 0000000 import {
Injectable,
Inject,
} from '@angular/core';
require('@fortawesome/fontawesome-free/js/all')
import {
log
} from './index';
import {
ThemeService,
} from './services/theme';
import {
SettingsService,
LocaleService
} from 'corifeus-web';
//let booted = false
@Injectable()
export class Boot {
constructor(
private settings: SettingsService,
private locale: LocaleService,
private theme: ThemeService,
) {
// if (booted === true) {
// return
// }
// booted = true
log('booted');
const module = 'material';
settings.register(module, require('./json/settings.json'));
locale.register(module, {
en: require('./json/translation/english.json'),
hu: require('./json/translation/hungarian.json'),
});
this.theme.boot();
//TODO uglify breaks CSS imports
//FIXME material icons, roboto, font-awesome
// @import url(https://fonts.googleapis.com/css?family=Roboto);
// @import url(https://fonts.googleapis.com/icon?family=Material+Icons);
// @import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css);
/*
const css = `
`;
const head = document.head || document.getElementsByTagName('head')[0];
const style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode(css));
head.appendChild(style);
*/
}
}
corifeus-web-material/src/bundle.ts 0000664 0000000 0000000 00000000374 15160755404 0017667 0 ustar 00root root 0000000 0000000 import 'hammerjs';
//import '@angular/material';
//import 'font-awesome/css/font-awesome.css';
import 'roboto-fontface/css/roboto/sass/roboto-fontface.scss'
import 'material-design-icons/iconfont/material-icons.css'
import './scss/material/_all.scss';
corifeus-web-material/src/component/ 0000775 0000000 0000000 00000000000 15160755404 0020044 5 ustar 00root root 0000000 0000000 corifeus-web-material/src/component/cory-mat-http-404.ts 0000664 0000000 0000000 00000003047 15160755404 0023435 0 ustar 00root root 0000000 0000000 import {
Component,
OnDestroy
} from '@angular/core';
import {State, LocaleService, LocaleSubject} from 'corifeus-web';
@Component({
selector: 'cory-mat-http-404',
template: `
404
{{ i18n.material.http['404'] }}
{{ url }}
`,
})
export class Http404 implements OnDestroy {
url: string;
i18n: any;
letKeep404: any;
timeout: any;
constructor(
public locale: LocaleService
) {
history.replaceState({}, State.RequestPath, State.RequestPath);
const its404 = () => {
State.NotFound = true;
window.corifeus.core.http.status = 404;
}
let maxWait = 10000;
let waiter = 0;
this.letKeep404 = setInterval(() => {
its404();
if (window.corifeus.core.http.counter === 0) {
waiter++;
if (waiter > 10) {
clearInterval(this.letKeep404);
}
}
}, 100)
this.timeout = setTimeout(() => {
clearInterval(this.letKeep404);
its404();
}, maxWait);
this.locale.subscribe((data: LocaleSubject) => {
this.i18n = data.locale.data;
});
this.url = State.RequestPath
}
ngOnDestroy() {
clearInterval(this.letKeep404);
clearTimeout(this.timeout)
}
}
corifeus-web-material/src/component/cory-mat-loading.ts 0000664 0000000 0000000 00000001044 15160755404 0023561 0 ustar 00root root 0000000 0000000 import {
Input,
Component,
} from '@angular/core';
@Component({
selector: 'cory-mat-loading',
template: `
0"
color="primary"
mode="indeterminate">
`,
})
export class Loading {
@Input('cory-visible')
visible: boolean = false;
get requestCount() {
return window.corifeus.core.http.counter;
}
constructor() {
// console.log(this.visible);
}
}
corifeus-web-material/src/component/cory-mat-theme/ 0000775 0000000 0000000 00000000000 15160755404 0022677 5 ustar 00root root 0000000 0000000 corifeus-web-material/src/component/cory-mat-theme/cory-mat-theme-button.ts 0000664 0000000 0000000 00000003646 15160755404 0027424 0 ustar 00root root 0000000 0000000 import {
Component,
Input,
} from '@angular/core';
import {
LocaleService, SettingsService, LocaleSubject,
MediaQueryService, MediaQuerySettingType, MediaQuerySetting
} from "corifeus-web";
// requires to be in a mat-menu
@Component({
selector: 'cory-mat-theme-button',
template: `
format_color_fill
{{ i18n.material.title.theme }}
`,
})
export class ThemeButton {
@Input('cory-tooltip-position')
matTooltipPosition: string = "left";
@Input('color')
color: string = 'default';
i18n: any;
settings: any;
tooltip: string;
currentWidthAlias: string;
constructor(
protected locale: LocaleService,
protected settingsAll: SettingsService,
private mediaQuery: MediaQueryService
) {
this.settings = settingsAll.data.material;
this.locale.subscribe((data: LocaleSubject) => {
this.i18n = data.locale.data;
this.setTooltip();
});
this.mediaQuery.subscribe((settings: MediaQuerySetting[]) => {
settings.forEach((setting) => this.setTooltip(setting.name))
})
}
private setTooltip(alias?: string) {
if (alias !== undefined) {
this.currentWidthAlias = alias;
}
switch (this.currentWidthAlias) {
case 'small':
this.tooltip = this.locale.data.material.title.theme;
break;
case 'large':
this.tooltip = undefined;
break;
}
}
}
corifeus-web-material/src/component/cory-mat-theme/cory-mat-theme-menu.ts 0000664 0000000 0000000 00000004614 15160755404 0027051 0 ustar 00root root 0000000 0000000 import {
Component,
Inject,
} from '@angular/core';
import {
LocaleService, SettingsService, LocaleSubject
} from "corifeus-web";
import {
ThemeService
} from '../../services/theme';
import {
NotifyService
} from '../../services/notify/notify';
import {template} from 'lodash';
// requires to be in a mat-menu
@Component({
selector: 'cory-mat-theme-menu',
template: `
{{ i18n.title.theme }}
{{ i18n.themes.material[thisTheme] }}
{{ i18n.themes.material[thisTheme] }}
`,
})
export class ThemeMenu {
i18n: any;
settings: any;
constructor(
private notify: NotifyService,
public theme: ThemeService,
public locale: LocaleService,
protected settingsAll: SettingsService
) {
this.settings = settingsAll.data.material;
this.locale.subscribe((data: LocaleSubject) => {
this.i18n = data.locale.data.material;
});
}
public clickChangeTheme(theme: string) {
try {
const oldTheme = this.theme.current;
this.theme.setTheme(theme)
const parameters = ({
old: this.i18n.themes.material[oldTheme],
'current': this.i18n.themes.material[theme]
});
const templateFactory = template(this.i18n.message.theme.changed);
this.notify.info(templateFactory(parameters));
} catch (e) {
this.notify.error(e);
}
}
public get themeLight() {
return this.settings.themes.material.filter((theme: string) => {
return theme.startsWith('cory-mat-theme-light')
})
}
public get themeDark() {
return this.settings.themes.material.filter((theme: string) => {
return theme.startsWith('cory-mat-theme-dark')
})
}
}
corifeus-web-material/src/component/cory-mat-translation/ 0000775 0000000 0000000 00000000000 15160755404 0024133 5 ustar 00root root 0000000 0000000 corifeus-web-material/src/component/cory-mat-translation/cory-mat-translation-button.ts 0000664 0000000 0000000 00000003540 15160755404 0032105 0 ustar 00root root 0000000 0000000 import {
Component,
Input,
} from '@angular/core';
import {
LocaleService, SettingsService, LocaleSubject,
MediaQueryService, MediaQuerySettingType, MediaQuerySetting
} from "corifeus-web";
// requires to be in a mat-menu
@Component({
selector: 'cory-mat-translation-button',
template: `
language
{{ i18n.material.title.language }}
`,
})
export class TranslationButton {
@Input('color')
color: string = 'default';
@Input('cory-tooltip-position')
matTooltipPosition: string = 'left';
i18n: any;
settings: any;
tooltip: string;
currentWidthAlias: string;
constructor(
protected locale: LocaleService,
protected settingsAll: SettingsService,
private mediaQuery: MediaQueryService
) {
this.settings = settingsAll.data.material;
this.locale.subscribe((data: LocaleSubject) => {
this.i18n = data.locale.data;
this.setTooltip();
});
this.mediaQuery.subscribe((settings: MediaQuerySetting[]) => {
settings.forEach((setting) => this.setTooltip(setting.name))
})
}
private setTooltip(alias?: string) {
if (alias !== undefined) {
this.currentWidthAlias = alias;
}
switch (this.currentWidthAlias) {
case 'small':
this.tooltip = this.locale.data.material.title.language;
break;
case 'large':
this.tooltip = undefined;
break;
}
}
}
corifeus-web-material/src/component/cory-mat-translation/cory-mat-translation-menu.ts 0000664 0000000 0000000 00000003103 15160755404 0031531 0 ustar 00root root 0000000 0000000 import {
Component,
Inject,
} from '@angular/core';
import {
LocaleService, SettingsService, LocaleSubject
} from "corifeus-web";
import {
NotifyService
} from '../../services/notify/notify';
// requires to be in a mat-menu
@Component({
selector: 'cory-mat-translation-menu',
template: `
{{ i18n.material.title.language }}
{{ settings.translations.language[translation] }}
`,
})
export class TranslationMenu {
i18n: any;
settings: any;
constructor(
private notify: NotifyService,
public locale: LocaleService,
protected settingsAll: SettingsService
) {
this.settings = settingsAll.data.core;
this.locale.subscribe((data: LocaleSubject) => {
this.i18n = data.locale.data;
});
}
public clickChangeTranslate(translation: string) {
try {
this.locale.setTranslation(translation);
this.notify.info(this.settingsAll.data.core.translations.display[translation]);
} catch (e) {
console.error(e);
}
}
get translationKeys() {
return Object.keys(this.settings.translations.language)
}
}
corifeus-web-material/src/component/index.ts 0000664 0000000 0000000 00000000660 15160755404 0021525 0 ustar 00root root 0000000 0000000 export {
Loading
} from './cory-mat-loading';
export {
ThemeMenu
} from './cory-mat-theme/cory-mat-theme-menu';
export {
ThemeButton
} from './cory-mat-theme/cory-mat-theme-button';
export {
TranslationMenu
} from './cory-mat-translation/cory-mat-translation-menu';
export {
TranslationButton
} from './cory-mat-translation/cory-mat-translation-button';
export {
Http404
} from './cory-mat-http-404';
corifeus-web-material/src/index.ts 0000664 0000000 0000000 00000000372 15160755404 0017523 0 ustar 00root root 0000000 0000000 export * from './component';
export * from './module';
import {log} from 'corifeus-web';
export * from './services';
const logMaterial = log.factory('material');
export {logMaterial as log};
export * from './boot';
export * from './services';
corifeus-web-material/src/json/ 0000775 0000000 0000000 00000000000 15160755404 0017013 5 ustar 00root root 0000000 0000000 corifeus-web-material/src/json/settings.json 0000664 0000000 0000000 00000001267 15160755404 0021554 0 ustar 00root root 0000000 0000000 {
"cookie": {
"theme": "cory-layout-theme"
},
"themes": {
"material": [
"cory-mat-theme-light-indigo-pink",
"cory-mat-theme-light-forest",
"cory-mat-theme-light-beach",
"cory-mat-theme-light-facebook",
"cory-mat-theme-light-deeppurple-amber",
"cory-mat-theme-dark-wood",
"cory-mat-theme-dark-matrix",
"cory-mat-theme-dark-pink-bluegray",
"cory-mat-theme-dark-purple-green"
]
},
"translations": {
"interface": {
"en": "The user interface is English.",
"hu": "A felhasználói felület Magyar."
}
}
}
corifeus-web-material/src/json/translation/ 0000775 0000000 0000000 00000000000 15160755404 0021351 5 ustar 00root root 0000000 0000000 corifeus-web-material/src/json/translation/english.json 0000664 0000000 0000000 00000002450 15160755404 0023676 0 ustar 00root root 0000000 0000000 {
"http": {
"404": "Not found"
},
"themes": {
"material": {
"cory-mat-theme-light-forest": "Forest",
"cory-mat-theme-dark-wood": "Wood",
"cory-mat-theme-light-beach": "Beach",
"cory-mat-theme-dark-matrix": "Matrix",
"cory-mat-theme-light-deeppurple-amber": "Deep Purple Amber",
"cory-mat-theme-light-indigo-pink": "Indigo pink",
"cory-mat-theme-dark-pink-bluegray": "Pink bluegray",
"cory-mat-theme-dark-purple-green": "Purple green",
"cory-mat-theme-light-facebook": "Facebook"
}
},
"title": {
"menu": "Menu",
"theme": "Theme",
"language": "Language",
"ok": "OK",
"error": "Error",
"authorization": " Identification",
"username": "Username",
"password": "Password",
"autoLogin": "Keep logged in",
"save": "Save"
},
"button": {
"login": "Login"
},
"invalid": {
"required": "Required",
"username": "Invalid username",
"password": "Invalid password"
},
"message": {
"unauthorized": "Unauthorized login.",
"loggedIn": "You signed in.",
"theme": {
"changed": "Theme - ${current}."
}
}
}
corifeus-web-material/src/json/translation/hungarian.json 0000664 0000000 0000000 00000002532 15160755404 0024222 0 ustar 00root root 0000000 0000000 {
"http": {
"404": "Not found"
},
"themes": {
"material": {
"cory-mat-theme-light-forest": "Erdő",
"cory-mat-theme-dark-wood": "Fa",
"cory-mat-theme-light-beach": "Strand",
"cory-mat-theme-dark-matrix": "Matrix",
"cory-mat-theme-light-deeppurple-amber": "Mély lila borostyán",
"cory-mat-theme-light-indigo-pink": "Indigó rózsaszín",
"cory-mat-theme-dark-pink-bluegray": "Rózsaszín kék-szürke",
"cory-mat-theme-dark-purple-green": "Lila Zöld",
"cory-mat-theme-light-facebook": "Facebook"
}
},
"title": {
"menu": "Menü",
"theme": "Smink",
"language": "Nyelv",
"ok": "OK",
"error": "Hiba",
"authorization": " Azonosítás",
"username": "Felhasználó",
"password": "Jelszó",
"autoLogin": "Maradj belépve",
"save": "Mentés"
},
"button": {
"login": "Belépés"
},
"invalid": {
"required": "Kötelező",
"username": "Érvénytelen felhasználó",
"password": "Érvénytelen jelszó"
},
"message": {
"unauthorized": "Illetéktelen belépés.",
"loggedIn": "Bejelentkezett.",
"theme": {
"changed": "Smink - ${current}."
}
}
}
corifeus-web-material/src/module.ts 0000664 0000000 0000000 00000012565 15160755404 0017710 0 ustar 00root root 0000000 0000000 import {NgModule, ModuleWithProviders} from '@angular/core';
import {CorifeusModule} from 'corifeus-web';
import {MatIconModule} from '@angular/material/icon'
import {MatProgressBarModule} from '@angular/material/progress-bar'
import {MatMenuModule,} from '@angular/material/menu'
import {MatButtonModule,} from '@angular/material/button'
import {MatTooltipModule,} from '@angular/material/tooltip'
import {MatToolbarModule,} from '@angular/material/toolbar'
import {MatCardModule,} from '@angular/material/card'
import {MatSnackBarModule,} from '@angular/material/snack-bar'
import {Boot} from './boot';
import {ThemeService} from './services/theme'
import {NotifyService} from './services/notify/notify'
import {NotifyComponent} from './services/notify/notify-component'
import {Http404} from './component/cory-mat-http-404'
import {Loading} from './component/cory-mat-loading'
import {ThemeButton} from './component/cory-mat-theme/cory-mat-theme-button'
import {ThemeMenu} from './component/cory-mat-theme/cory-mat-theme-menu'
import {TranslationButton} from './component/cory-mat-translation/cory-mat-translation-button'
import {TranslationMenu} from './component/cory-mat-translation/cory-mat-translation-menu'
import { CommonModule } from '@angular/common'
/*
fix: allow users to disable the sanity checks
@NgModule({
providers: [
{provide: MATERIAL_SANITY_CHECKS, useValue: false}
]
// other config
});
https://github.com/angular/material2/issues/4125
*/
// https://github.com/angular/material2/pull/4178
// exports = component
/***
* NEVER USE A EXPORT * AS, NEED THE EXACT COMPONENT FOR INJECTABLE FUNCTION!!!!
const materialModules = [
MatAutocompleteModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatCheckboxModule,
MatChipsModule,
MatCommonModule,
MatDatepickerModule,
MatDialogModule,
MatExpansionModule,
MatGridListModule,
MatIconModule,
MatInputModule,
MatLineModule,
MatListModule,
MatMenuModule,
MatNativeDateModule,
MatOptionModule,
MatPaginatorModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSnackBarModule,
MatSortModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
// OverlayContainer,
// MatSelectionList,
]
*/
@NgModule({
imports: [
CorifeusModule,
CommonModule,
// material
/*
MatAutocompleteModule,
MatButtonToggleModule,
MatChipsModule,
MatCommonModule,
MatDatepickerModule,
MatDialogModule,
MatExpansionModule,
MatGridListModule,
MatLineModule,
MatListModule,
MatNativeDateModule,
MatOptionModule,
MatPaginatorModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSortModule,
MatTableModule,
MatTabsModule,
*/
// OverlayContainer,
// MatSelectionList,
MatIconModule,
MatProgressBarModule,
MatMenuModule,
MatButtonModule,
MatTooltipModule,
MatToolbarModule,
MatCardModule,
MatSnackBarModule,
// material modules
],
declarations: [
NotifyComponent,
// OverlayContainer,
Loading,
ThemeMenu,
ThemeButton,
TranslationMenu,
TranslationButton,
Http404,
],
// do not need export providers
providers: [
Boot,
ThemeService,
NotifyService,
],
exports: [
CorifeusModule,
// material modules
/*
MatAutocompleteModule,
MatButtonModule,
MatButtonToggleModule,
MatCardModule,
MatCheckboxModule,
MatChipsModule,
MatCommonModule,
MatDatepickerModule,
MatDialogModule,
MatExpansionModule,
MatGridListModule,
MatInputModule,
MatLineModule,
MatListModule,
MatNativeDateModule,
MatOptionModule,
MatPaginatorModule,
MatProgressSpinnerModule,
MatRadioModule,
MatRippleModule,
MatSelectModule,
MatSidenavModule,
MatSliderModule,
MatSlideToggleModule,
MatSortModule,
MatTableModule,
MatTabsModule,
MatToolbarModule,
MatTooltipModule,
// OverlayContainer,
// MatSelectionList,
// material modules
*/
MatIconModule,
MatProgressBarModule,
MatMenuModule,
MatButtonModule,
MatTooltipModule,
MatToolbarModule,
MatCardModule,
MatSnackBarModule,
Loading,
ThemeMenu,
ThemeButton,
TranslationMenu,
TranslationButton,
Http404,
],
entryComponents: [
NotifyComponent,
// OverlayContainer,
]
})
export class CorifeusMaterialModule {
constructor(boot: Boot) {
}
public static forRoot(): ModuleWithProviders {
return {
ngModule: CorifeusMaterialModule,
// providers: providers,
};
}
}
corifeus-web-material/src/scss/ 0000775 0000000 0000000 00000000000 15160755404 0017015 5 ustar 00root root 0000000 0000000 corifeus-web-material/src/scss/_all.scss 0000664 0000000 0000000 00000001013 15160755404 0020614 0 ustar 00root root 0000000 0000000 @import 'corifeus-web-material/src/scss/material/all';
.cory-shake {
animation: shake 0.82s cubic-bezier(.36, .07, .19, .97) both;
transform: translate3d(0, 0, 0);
backface-visibility: hidden;
perspective: 1000px;
}
@keyframes shake {
10%, 90% {
transform: translate3d(-1px, 0, 0);
}
20%, 80% {
transform: translate3d(2px, 0, 0);
}
30%, 50%, 70% {
transform: translate3d(-4px, 0, 0);
}
40%, 60% {
transform: translate3d(4px, 0, 0);
}
}
corifeus-web-material/src/scss/material/ 0000775 0000000 0000000 00000000000 15160755404 0020613 5 ustar 00root root 0000000 0000000 corifeus-web-material/src/scss/material/_all.scss 0000664 0000000 0000000 00000006066 15160755404 0022427 0 ustar 00root root 0000000 0000000 /*
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
@import url('https://fonts.googleapis.com/css?family=Roboto');
*/
body {
font-family: Roboto, Arial, sans-serif;
padding: 0;
margin: 0;
}
@import 'corifeus-app-web-pages/node_modules/@angular/material/theming';
@include mat-core();
@import 'variables';
@import 'mixins';
@import 'material-customization';
@import 'hover';
@import 'corifeus-web-material/src/scss/material/theme/cory-mat-theme-dark-matrix';
@import 'corifeus-web-material/src/scss/material/theme/cory-mat-theme-light-forest';
@import 'corifeus-web-material/src/scss/material/theme/cory-mat-theme-light-beach';
@import 'corifeus-web-material/src/scss/material/theme/cory-mat-theme-light-indigo-pink';
@import 'corifeus-web-material/src/scss/material/theme/cory-mat-theme-light-deeppurple-amber';
@import 'corifeus-web-material/src/scss/material/theme/cory-mat-theme-dark-wood';
@import 'corifeus-web-material/src/scss/material/theme/cory-mat-theme-dark-pink-bluegray';
@import 'corifeus-web-material/src/scss/material/theme/cory-mat-theme-dark-purple-green';
@import 'corifeus-web-material/src/scss/material/theme/cory-mat-theme-light-facebook';
@import 'toolbar';
.cory-mat-fill-horizontal {
flex: 1 1 auto;
}
body.cory-mat-theme-dark {
color: white;
}
.cory-mat-theme-dark {
color: white;
.cory-mat-menu-divider {
margin-top: 3px;
margin-bottom: 3px;
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.cory-mat-menu-item-active, .cory-mat-menu-item-active:hover {
background-color: rgba(255, 255, 255, 0.2) !important;
}
}
.cory-mat-theme-light {
color: white;
.cory-mat-menu-divider {
margin-top: 3px;
margin-bottom: 3px;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.cory-mat-menu-item-active, .cory-mat-menu-item-active:hover {
background-color: rgba(128, 128, 128, 0.2) !important;
}
}
.cory-mat-hide-xsmall {
@media screen and (max-width: $cory-mat-size-xsmall) {
display: none;
};
}
.cory-mat-container {
margin-top: 0px !important;
margin-bottom: 0px !important;
.mat-card {
margin-top: 10px;
margin-bottom: 10px;
box-shadow: 0px 0px 100px 0px rgba(0, 0, 0, 0.25) !important;
@media screen and (max-width: $cory-mat-size-xsmall) {
margin-top: 0px;
margin-bottom: 0px;
};
}
margin-left: 0;
margin-right: 0;
@media screen and (min-width: $cory-mat-size-xsmall) {
margin-top: 20px;
margin-bottom: 20px;
margin-left: 20px;
margin-right: 20px;
}
@media screen and (min-width: $cory-mat-size-medium) {
width: $cory-mat-size-medium - 100;
margin-left: auto;
margin-right: auto;
};
}
body {
height: 100vh;
min-height: 100vh;
}
.cory-mat-header {
position: fixed;
top: 0px;
left: 0px;
width: 100%;
z-index: 1;
}
.cory-mat-footer {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
z-index: 1;
}
corifeus-web-material/src/scss/material/_hover.scss 0000664 0000000 0000000 00000001116 15160755404 0022771 0 ustar 00root root 0000000 0000000 .cory-mat-theme-dark,
.cory-mat-theme-light {
a:hover mat-icon,
button:hover mat-icon,
a:hover svg,
button:hover svg,
svg:hover,
.cory-hover-rotate:hover img,
a.cory-hover-rotate:hover img,
button.cory-hover-rotate:hover img,
img.emoji:hover {
transition: all 500ms !important;
transform: scale(1.2) rotate(360deg) !important;;
}
.cory-hover-scale:hover img,
a.cory-hover-scale:hover img,
button.cory-hover-scale:hover img {
transition: all 500ms !important;;
transform: scale(1.5) !important;;
}
}
corifeus-web-material/src/scss/material/_material-customization.scss 0000664 0000000 0000000 00000000320 15160755404 0026346 0 ustar 00root root 0000000 0000000
snack-bar-container {
position: relative;
min-height: 50px;
min-width: 333px !important;
color: white !important;
background-color: rgba(0, 0, 0, 0.9) !important;
overflow: hidden;
}
corifeus-web-material/src/scss/material/_mixins.scss 0000664 0000000 0000000 00000022333 15160755404 0023161 0 ustar 00root root 0000000 0000000 @mixin cory-mat-theme-link($color, $hover) {
mat-card {
a {
color: $color;
text-decoration: none;
}
a:hover {
color: $hover;
text-decoration: underline;
}
}
}
@mixin cory-mat-theme-container($color) {
.cory-mat-header {
.mat-toolbar.mat-primary {
background: none;
}
background: linear-gradient(to left, $color, darken($color, 5%));
// background-color: black;
}
.cory-mat-footer {
.mat-toolbar.mat-primary {
background: none;
}
background: linear-gradient(to right, $color, darken($color, 5%));
// background-color: $color;
}
}
@function cory-mat-color-paletta($type, $color) {
$cory-mat-color-paletta-obj: '';
@if ($type == 'light') {
$cory-mat-color-paletta-obj: (
50: lighten($color, 50%),
100: lighten($color, 40%),
200: lighten($color, 30%),
300: lighten($color, 20%),
400: lighten($color, 10%),
500: $color,
600: darken($color, 10%),
700: darken($color, 20%),
800: darken($color, 30%),
900: darken($color, 40%),
A100: lighten($color, 40%),
A200: lighten($color, 30%),
A400: lighten($color, 10%),
A700: darken($color, 30%),
contrast: (
50: $black-87-opacity,
100: $black-87-opacity,
200: $black-87-opacity,
300: $black-87-opacity,
400: white,
500: white,
600: $white-87-opacity,
700: $white-87-opacity,
800: $white-87-opacity,
900: $white-87-opacity,
A100: $black-87-opacity,
A200: $black-87-opacity,
A400: white,
A700: $white-87-opacity,
)
);
} @else {
$cory-mat-color-paletta-obj: (
50: lighten($color, 50%),
100: lighten($color, 40%),
200: lighten($color, 30%),
300: lighten($color, 20%),
400: lighten($color, 10%),
500: $color,
600: darken($color, 10%),
700: darken($color, 20%),
800: darken($color, 30%),
900: darken($color, 40%),
A100: lighten($color, 40%),
A200: lighten($color, 30%),
A400: lighten($color, 10%),
A700: darken($color, 30%),
contrast: (
0: $black-87-opacity,
50: $black-87-opacity,
100: $black-87-opacity,
200: $black-87-opacity,
300: $black-87-opacity,
400: $black-87-opacity,
500: $black-87-opacity,
600: $white-87-opacity,
700: $white-87-opacity,
800: $white-87-opacity,
900: $white-87-opacity,
A100: $black-87-opacity,
A200: $black-87-opacity,
A400: $black-87-opacity,
A700: $white-87-opacity,
)
);
}
@return mat-palette($cory-mat-color-paletta-obj);
}
;
@mixin cory-mat-theme-button($type, $theme) {
$primary: map-get($theme, primary);
$accent: map-get($theme, accent);
$warn: map-get($theme, warn);
@include mat-button-theme($theme);
@if ($type == 'light') {
/*
// disabled
[mat-raised-button].mat-default:hover {
background-color: rgba(black, 0.05);
color: black;
}
*/
[mat-raised-button].mat-primary:not([disabled]):hover {
background-color: mat-color($primary, 800);
}
[mat-raised-button].mat-accent:not([disabled]):hover {
background-color: mat-color($accent, 800);
}
[mat-raised-button].mat-warn:not([disabled]):hover {
background-color: mat-color($warn, 800);
}
} @else {
/*
// disabled
[mat-raised-button]:hover {
background-color: mat-color($primary);
color: black;
}
*/
[mat-raised-button].mat-primary:not([disabled]):hover {
background-color: mat-color($primary, 400);
}
[mat-raised-button].mat-accent:not([disabled]):hover {
background-color: mat-color($accent, 400);
}
[mat-raised-button].mat-warn:not([disabled]):hover {
background-color: mat-color($warn, 400);
}
}
}
@mixin cory-mat-theme-toolbar($type, $theme) {
@include mat-toolbar-theme($theme);
$primary: mat-color(map-get($theme, primary));
$accent: mat-color(map-get($theme, accent));
$warn: mat-color(map-get($theme, warn));
.mat-toolbar.mat-primary {
background: linear-gradient(to right, $primary, darken($primary, 5%));
}
}
@mixin cory-mat-autofill() {
// fix webkit-autofill
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
input.webkit-autofill,
input.webkit-autofill:focus,
input.webkit-autofill:active,
input.webkit-autofill:hover {
transition: all 5000s ease-in-out 0s;
transition-property: background-color, color;
// background-color: mat-color($mat-yellow, 500);
}
}
@mixin cory-mat-theme($type, $primary, $accent) {
$theme: '';
$darker-primary: cory-mat-color-paletta($type, mat-color($primary, 700));
$darker-accent: cory-mat-color-paletta($type, mat-color($accent, 700));
$darker-theme: '';
$reverse-primary: $accent;
$reverse-accent: $primary;
$reverse-theme: '';
$reverse-darker-primary: cory-mat-color-paletta($type, mat-color($accent, 700));
$reverse-darker-accent: cory-mat-color-paletta($type, mat-color($primary, 700));
$reverse-darker-theme: '';
@if $type == "light" {
$warn: mat-palette($mat-red);
$theme: mat-light-theme($primary, $accent, $warn);
$reverse-theme: mat-light-theme($reverse-primary, $reverse-accent, $warn);
$darker-theme: mat-light-theme($darker-primary, $darker-accent, $warn);
$reverse-darker-theme: mat-light-theme($reverse-darker-primary, $reverse-darker-accent, $warn);
background-color: mat-color($primary, A100);
background: radial-gradient(circle, mat-color($primary, A100, 0.5), mat-color($primary, A400, 0.5));
$link: mat-palette($accent, 500);
$link-hover: mat-palette($accent, A700);
@include cory-mat-theme-link(mat-color($link), mat-color($link-hover));
//fixme this is something weird, to snackbar need black, but still it is not black :)
.cory-mat-bg {
background-color: map_get($mat-grey, 900);
// background: radial-gradient(circle, mat-color($mat-grey, 1000), mat-color($mat-grey, 900));
background: radial-gradient(circle, #000000, #212121);
}
} @else {
$warn: mat-palette($mat-red);
$theme: mat-dark-theme($primary, $accent, $warn);
$reverse-theme: mat-dark-theme($reverse-primary, $reverse-accent, $warn);
$darker-theme: mat-dark-theme($darker-primary, $darker-accent, $warn);
$reverse-darker-theme: mat-dark-theme($reverse-darker-primary, $reverse-darker-accent, $warn);
background-color: map_get($mat-grey, 900);
// background: radial-gradient(circle, mat-color($mat-grey, 1000), mat-color($mat-grey, 900));
background: radial-gradient(circle, #000000, #212121);
$link: mat-palette($accent, A400);
$link-hover: mat-palette($accent, A200);
@include cory-mat-theme-link(mat-color($link), mat-color($link-hover));
}
// @include angular-material-theme($theme);
@include mat-core-theme($theme);
@include mat-autocomplete-theme($theme);
// card
@include mat-card-theme($theme);
@include mat-datepicker-theme($theme);
@include mat-table-theme($theme);
@include mat-checkbox-theme($theme);
@include mat-chips-theme($theme);
@include mat-dialog-theme($theme);
@include mat-grid-list-theme($theme);
@include mat-icon-theme($theme);
@include mat-list-theme($theme);
@include mat-menu-theme($theme);
@include mat-radio-theme($theme);
@include mat-select-theme($theme);
@include mat-sidenav-theme($reverse-theme);
@include mat-slider-theme($theme);
@include mat-tabs-theme($theme);
@include mat-tooltip-theme($theme);
@include mat-expansion-panel-theme($theme);
@include mat-form-field-theme($theme);
@include mat-paginator-theme($theme);
@include mat-stepper-theme($theme);
@include mat-snack-bar-theme($theme);
// background: linear-gradient(darken($color, 10%), $color);
@include cory-mat-theme-toolbar($type, $theme);
@include cory-mat-theme-button($type, $reverse-theme);
@include mat-button-toggle-theme($reverse-theme);
@include mat-input-theme($reverse-theme);
@include mat-slide-toggle-theme($reverse-theme);
@include mat-progress-bar-theme($reverse-darker-theme);
@include mat-progress-spinner-theme($reverse-darker-theme);
@include cory-mat-theme-container(mat-color($primary));
@include cory-mat-autofill();
}
corifeus-web-material/src/scss/material/_toolbar.scss 0000664 0000000 0000000 00000000252 15160755404 0023310 0 ustar 00root root 0000000 0000000 .mat-toolbar.mat-primary.cory-mat-toolbar-clear {
background: none !important;
margin: 0px !important;
padding: 0px !important;
height: 0px !important;
}
corifeus-web-material/src/scss/material/_variables.scss 0000664 0000000 0000000 00000000350 15160755404 0023615 0 ustar 00root root 0000000 0000000 $cory-mat-size-xsmall: 600px;
$cory-mat-size-small: 960px;
$cory-mat-size-medium: 1280px;
$cory-mat-size-large: 1920px;
$cory-mat-fixed-height-top: 69px;
$cory-mat-fixed-height-bottom: 69px;
$cory-mat-fixed-height-collapsed: 60px;
corifeus-web-material/src/scss/material/theme/ 0000775 0000000 0000000 00000000000 15160755404 0021715 5 ustar 00root root 0000000 0000000 corifeus-web-material/src/scss/material/theme/_cory-mat-theme-dark-matrix.scss 0000664 0000000 0000000 00000020025 15160755404 0030024 0 ustar 00root root 0000000 0000000 @import "corifeus-web-material/src/scss/material/mixins";
.cory-mat-theme-dark-matrix {
$mat-matrix: (
50 : #e0ffe0,
100 : #b3ffb3,
200 : #80ff80,
300 : #4dff4d,
400 : #26ff26,
500 : #00ff00,
600 : #00ff00,
700 : #00ff00,
800 : #00ff00,
900 : #00ff00,
A100 : #ffffff,
A200 : #f2fff2,
A400 : #bfffbf,
A700 : #a6ffa6,
contrast: (
50 : #000000,
100 : #000000,
200 : #000000,
300 : #000000,
400 : #000000,
500 : #000000,
600 : #000000,
700 : #000000,
800 : #000000,
900 : #000000,
A100 : #000000,
A200 : #000000,
A400 : #000000,
A700 : #000000,
)
);
$mat-matrikxlow: (
50 : #e7f9e7,
100 : #c2f0c2,
200 : #99e699,
300 : #70db70,
400 : #52d452,
500 : #33cc33,
600 : #2ec72e,
700 : #27c027,
800 : #20b920,
900 : #14ad14,
A100 : #e0ffe0,
A200 : #adffad,
A400 : #7aff7a,
A700 : #60ff60,
contrast: (
50 : #000000,
100 : #000000,
200 : #000000,
300 : #000000,
400 : #000000,
500 : #000000,
600 : #000000,
700 : #000000,
800 : #ffffff,
900 : #ffffff,
A100 : #000000,
A200 : #000000,
A400 : #000000,
A700 : #000000,
)
);
$mat-matrixwarm: (
50 : #f9e0e0,
100 : #f0b3b3,
200 : #e68080,
300 : #db4d4d,
400 : #d42626,
500 : #cc0000,
600 : #c70000,
700 : #c00000,
800 : #b90000,
900 : #ad0000,
A100 : #ffd7d7,
A200 : #ffa4a4,
A400 : #ff7171,
A700 : #ff5858,
contrast: (
50 : #000000,
100 : #000000,
200 : #000000,
300 : #ffffff,
400 : #ffffff,
500 : #ffffff,
600 : #ffffff,
700 : #ffffff,
800 : #ffffff,
900 : #ffffff,
A100 : #000000,
A200 : #000000,
A400 : #000000,
A700 : #000000,
)
);
$mat-matrixaccent: (
50 : #f9e7f9,
100 : #f0c2f0,
200 : #e699e6,
300 : #db70db,
400 : #d452d4,
500 : #cc33cc,
600 : #c72ec7,
700 : #c027c0,
800 : #b920b9,
900 : #ad14ad,
A100 : #ffe0ff,
A200 : #ffadff,
A400 : #ff7aff,
A700 : #ff60ff,
contrast: (
50 : #000000,
100 : #000000,
200 : #000000,
300 : #000000,
400 : #000000,
500 : #ffffff,
600 : #ffffff,
700 : #ffffff,
800 : #ffffff,
900 : #ffffff,
A100 : #000000,
A200 : #000000,
A400 : #000000,
A700 : #000000,
)
);
$primary: mat-palette($mat-matrix);
$accent: mat-palette($mat-matrikxlow);
$warn: mat-palette($mat-matrixaccent);
$white: map_get($mat-matrix, 500);
$white2: map_get($mat-matrixaccent, 500);
$foreground: (
base: $white, //white,
divider: rgba($white, 0.12), //$white-12-opacity,
dividers: rgba($white, 0.12), //$white-12-opacity,
disabled: rgba($white, 0.8), // rgba(white, 0.3),
disabled-button: rgba($white, 0.3), // rgba(white, 0.3),
disabled-text: rgba($white, 0.3), // rgba(white, 0.3),
hint-text: rgba($white, 0.3), // rgba(white, 0.3),
secondary-text: rgba($white, 0.3), // rgba(white, 0.3),
icon: $white, // white,
icons: $white, // white,
text: $white, // white,
slider-min: white,
slider-off: $white, //rgba(white, 0.3),
slider-off-active: $white, //rgba(white, 0.3),
);
$background: (
status-bar: black,
app-bar: rgba(black, 0.90), //map_get($mat-grey, 900),
background: rgba(black, 0.80), //#303030,
hover: rgba(map_get($mat-matrix, A700), 0.4), //rgba(white, 0.04),
card: rgba(black, 0.80), //map_get($mat-grey, 800),
dialog: rgba(black, 0.80), //map_get($mat-grey, 800),
disabled-button: rgba(map_get($mat-matrix, A700), 0.12), // $white-12-opacity,
raised-button: rgba(black, 0.80), //map-get($mat-grey, 800),
focused-button: rgba(map_get($mat-matrix, A700), 0.06), //$white-6-opacity,
selected-button: rgba(black, 0.90), //map_get($mat-grey, 900),
selected-disabled-button: rgba(black, 0.80), //map_get($mat-grey, 800),
disabled-button-toggle: rgba(black, 1.00), //map_get($mat-grey, 1000),
// unselected-chip: map_get($mat-grey, 700),
// disabled-list-option: black,
unselected-chip: rgba(black, 0.90), // map_get($mat-grey, 300),
disabled-list-option: rgba(black, 0.80), // map_get($mat-grey, 200),
);
$theme_highlight: (
primary: $warn,
accent: $primary,
warn: $accent,
is-dark: true,
foreground: $foreground,
background: $background,
);
$theme: (
primary: $primary,
accent: $accent,
warn: $warn,
is-dark: true,
foreground: $foreground,
background: $background,
);
$theme_reverse: (
primary: $accent,
accent: $primary,
warn: $warn,
is-dark: true,
foreground: $foreground,
background: $background,
);
// @mixin angular-material-theme($theme) {
// this is new again
// @include mat-ripple-theme($theme_reverse);
// @include mat-option-theme($theme_reverse);
// @include mat-optgroup-theme($theme_reverse);
// @include mat-pseudo-checkbox-theme($theme_reverse);
@include mat-autocomplete-theme($theme_reverse);
// card
@include mat-card-theme($theme_reverse);
@include mat-checkbox-theme($theme_reverse);
@include mat-chips-theme($theme_reverse);
@include mat-dialog-theme($theme_reverse);
@include mat-grid-list-theme($theme_reverse);
@include mat-icon-theme($theme_reverse);
@include mat-list-theme($theme_reverse);
@include mat-menu-theme($theme_reverse);
@include mat-radio-theme($theme_reverse);
@include mat-select-theme($theme_reverse);
$background_sidenav: map-merge($background, (
card: white
));
@include mat-sidenav-theme((
primary: $accent,
accent: $primary,
warn: $warn,
is-dark: true,
foreground: $foreground,
background: $background_sidenav,
));
@include mat-slider-theme($theme_reverse);
@include mat-tabs-theme($theme_reverse);
@include mat-tooltip-theme($theme_reverse);
// background: linear-gradient(darken($color, 10%), $color);
@include mat-button-toggle-theme($theme_reverse);
@include mat-input-theme($theme_reverse);
@include mat-slide-toggle-theme($theme_reverse);
@include mat-progress-bar-theme($theme_highlight);
@include mat-progress-spinner-theme($theme_highlight);
@include mat-toolbar-theme($theme_reverse);
@include mat-button-theme($theme_reverse);
@include mat-expansion-panel-theme($theme);
@include mat-form-field-theme($theme);
@include mat-paginator-theme($theme);
@include mat-stepper-theme($theme);
@include mat-snack-bar-theme($theme_highlight);
@include mat-datepicker-theme($theme_reverse);
@include cory-mat-theme-container(mat-color($primary));
@include cory-mat-theme-toolbar('dark', $theme);
@include cory-mat-theme-button('dark', $theme_reverse);
@include cory-mat-theme-link(map_get($mat-matrixaccent, 500), map_get($mat-matrixaccent, A400));
@include cory-mat-autofill();
background-color: rgba(0, 0, 0, 0.5);
background: radial-gradient(circle, rgba(black, 0.9), rgba(black, 0.8));
// @include cory-mat-theme('dark', $primary, $accent);
}
corifeus-web-material/src/scss/material/theme/_cory-mat-theme-dark-pink-bluegray.scss 0000664 0000000 0000000 00000000415 15160755404 0031272 0 ustar 00root root 0000000 0000000 @import "corifeus-web-material/src/scss/material/mixins";
.cory-mat-theme-dark-pink-bluegray {
$primary: mat-palette($mat-pink, 700, 500, 900);
$accent: mat-palette($mat-blue-grey, A200, A100, A400);
@include cory-mat-theme('dark', $primary, $accent);
}
corifeus-web-material/src/scss/material/theme/_cory-mat-theme-dark-purple-green.scss 0000664 0000000 0000000 00000000411 15160755404 0031122 0 ustar 00root root 0000000 0000000 @import "corifeus-web-material/src/scss/material/mixins";
.cory-mat-theme-dark-purple-green {
$primary: mat-palette($mat-purple, 700, 500, 900);
$accent: mat-palette($mat-green, A200, A100, A400);
@include cory-mat-theme('dark', $primary, $accent);
}
corifeus-web-material/src/scss/material/theme/_cory-mat-theme-dark-wood.scss 0000664 0000000 0000000 00000000361 15160755404 0027471 0 ustar 00root root 0000000 0000000 @import "corifeus-web-material/src/scss/material/mixins";
.cory-mat-theme-dark-wood {
$primary: mat-palette($mat-brown);
$accent: mat-palette($mat-green, 600, 400, 700);
@include cory-mat-theme('dark', $primary, $accent);
}
corifeus-web-material/src/scss/material/theme/_cory-mat-theme-light-beach.scss 0000664 0000000 0000000 00000000402 15160755404 0027745 0 ustar 00root root 0000000 0000000 @import "corifeus-web-material/src/scss/material/mixins";
.cory-mat-theme-light-beach {
$primary: mat-palette($mat-orange, 800, 700, 900);
$accent: mat-palette($mat-brown, 800, 700, 900);
@include cory-mat-theme('light', $primary, $accent);
}
corifeus-web-material/src/scss/material/theme/_cory-mat-theme-light-deeppurple-amber.scss 0000664 0000000 0000000 00000000405 15160755404 0032137 0 ustar 00root root 0000000 0000000 @import "corifeus-web-material/src/scss/material/mixins";
.cory-mat-theme-light-deeppurple-amber {
$primary: mat-palette($mat-deep-purple);
$accent: mat-palette($mat-amber, A200, A100, A400);
@include cory-mat-theme('light', $primary, $accent);
}
corifeus-web-material/src/scss/material/theme/_cory-mat-theme-light-facebook.scss 0000664 0000000 0000000 00000002551 15160755404 0030463 0 ustar 00root root 0000000 0000000 @import "corifeus-web-material/src/scss/material/mixins";
/*
Color Hex RGB
#3b5998 (59,89,152)
#8b9dc3 (139,157,195)
#dfe3ee (223,227,238)
#f7f7f7 (247,247,247)
#ffffff (255,255,255)
*/
.cory-mat-theme-light-facebook {
$fb-dark: #3b5998;
$fb-blue: #8b9dc3;
$fb-medium: #dfe3ee;
$fb-light: #f7f7f7;
$mat-facebook: (
50: $fb-medium,
100: lighten($fb-dark, 20%),
200: lighten($fb-dark, 15%),
300: lighten($fb-dark, 10%),
400: lighten($fb-dark, 5%),
500: $fb-dark,
600: darken($fb-dark, 5%),
700: darken($fb-dark, 10%),
800: darken($fb-dark, 15%),
900: darken($fb-dark, 25%),
A100: $fb-blue,
A200: darken($fb-blue, 10%),
A400: darken($fb-blue, 20%),
A700: darken($fb-blue, 30%),
contrast: (
50: $fb-light,
100: white,
200: white,
300: white,
400: white,
500: white,
600: $fb-light,
700: $fb-light,
800: $fb-light,
900: $fb-light,
A100: $fb-light,
A200: $fb-light,
A400: $fb-light,
A700: $fb-light,
)
);
$primary: mat-palette($mat-facebook);
$accent: mat-palette($mat-facebook, A100, 400, A200);
@include cory-mat-theme('light', $primary, $accent);
}
corifeus-web-material/src/scss/material/theme/_cory-mat-theme-light-forest.scss 0000664 0000000 0000000 00000000370 15160755404 0030211 0 ustar 00root root 0000000 0000000 @import "corifeus-web-material/src/scss/material/mixins";
.cory-mat-theme-light-forest {
$primary: mat-palette($mat-green, 600);
$accent: mat-palette($mat-brown, 700, 500, 900);
@include cory-mat-theme('light', $primary, $accent);
}
corifeus-web-material/src/scss/material/theme/_cory-mat-theme-light-indigo-pink.scss 0000664 0000000 0000000 00000000373 15160755404 0031122 0 ustar 00root root 0000000 0000000 @import "corifeus-web-material/src/scss/material/mixins";
.cory-mat-theme-light-indigo-pink {
$primary: mat-palette($mat-indigo);
$accent: mat-palette($mat-pink, A200, A100, A400);
@include cory-mat-theme('light', $primary, $accent);
}
corifeus-web-material/src/services/ 0000775 0000000 0000000 00000000000 15160755404 0017665 5 ustar 00root root 0000000 0000000 corifeus-web-material/src/services/index.ts 0000664 0000000 0000000 00000000143 15160755404 0021342 0 ustar 00root root 0000000 0000000 export * from './notify/notify';
export * from './notify/notify-component'
export * from './theme'; corifeus-web-material/src/services/notify/ 0000775 0000000 0000000 00000000000 15160755404 0021175 5 ustar 00root root 0000000 0000000 corifeus-web-material/src/services/notify/notify-component.ts 0000664 0000000 0000000 00000006531 15160755404 0025062 0 ustar 00root root 0000000 0000000 import {
Injectable,
Component,
AfterViewInit,
ViewChild,
ElementRef,
HostListener,
Inject,
} from '@angular/core';
import {ThemeService} from '../theme'
import {ColorService} from 'corifeus-web'
import {MAT_SNACK_BAR_DATA, MatSnackBarRef} from '@angular/material/snack-bar';
import {
DomSanitizer
} from '@angular/platform-browser'
import {LocaleService, LocaleSubject} from 'corifeus-web';
@Component({
template: `
{{ data.options.icon }}
{{ this.i18n.title.ok }}
`,
styles: [`
.message {
position: relative;
top: -6px;
}
[mat-button]{
position: absolute;
top: 10px;
right: 4px;
min-width: auto !important;
}
`],
})
@Injectable()
export class NotifyComponent implements AfterViewInit {
@ViewChild('elementButton', {read: ElementRef, static: false}) elementButton: ElementRef;
@ViewChild('elementIcon', {read: ElementRef, static: false}) elementIcon: ElementRef;
@ViewChild('elementMessage', {read: ElementRef, static: false}) elementMessage: ElementRef;
inited: boolean = false;
public data: { message: string, options: any };
i18n: any;
constructor(
public ctx: MatSnackBarRef,
private locale: LocaleService,
private theme: ThemeService,
private color: ColorService,
@Inject(MAT_SNACK_BAR_DATA) data: any,
private _sanitizer: DomSanitizer,
) {
this.locale.subscribe((subject: LocaleSubject) => {
this.i18n = subject.locale.data.material;
});
this.data = data;
}
calculateWidth() {
const snackElement = document.getElementsByTagName('snack-bar-container')[0];
//fixme cache the colors
let backgroundColor = window.getComputedStyle(snackElement).getPropertyValue('background-color');
let color = window.getComputedStyle(snackElement).getPropertyValue('color');
let buttonColor = window.getComputedStyle(this.elementButton.nativeElement).color;
let iconColor = window.getComputedStyle(this.elementIcon.nativeElement).color;
buttonColor = this.color.getReadableColor(buttonColor, backgroundColor)
iconColor = this.color.getReadableColor(iconColor, backgroundColor);
color = this.color.getReadableColor(color, backgroundColor);
this.elementIcon.nativeElement.style.color = iconColor;
this.elementButton.nativeElement.style.color = buttonColor;
this.elementMessage.nativeElement.style.color = color;
}
ngAfterViewInit() {
this.ctx.afterOpened().subscribe(() => {
this.calculateWidth();
})
}
onResize() {
this.ctx.dismiss();
}
@HostListener('window:keydown', ['$event'])
onKeyDown(event: Event) {
// if (!isDevMode()) {
this.ctx.dismiss();
// }
}
transformHtml(html: string): any {
return this._sanitizer.bypassSecurityTrustHtml(html);
}
}
corifeus-web-material/src/services/notify/notify.ts 0000664 0000000 0000000 00000003107 15160755404 0023056 0 ustar 00root root 0000000 0000000 import {
Injectable,
} from '@angular/core';
declare var process: any;
const isDevMode = () => {
return process.env !== 'production'
}
import {MatSnackBar, MatSnackBarConfig} from '@angular/material/snack-bar';
import {LocaleService, LocaleSubject} from 'corifeus-web';
import {NotifyComponent} from './notify-component'
const duration = isDevMode() ? 100000 : 3000;
export interface NotifyOptions {
icon: string,
}
@Injectable()
export class NotifyService {
i18n: any;
constructor(
private snackBar: MatSnackBar,
private locale: LocaleService,
) {
this.locale.subscribe((subject: LocaleSubject) => {
this.i18n = subject.locale.data.material;
});
}
info(message: string, coryOptions?: NotifyOptions | string, config?: MatSnackBarConfig) {
if (config === undefined) {
config = {
duration: duration
}
}
if (typeof (coryOptions) === 'string') {
coryOptions = {
icon: coryOptions
}
}
if (coryOptions === undefined) {
coryOptions = {
icon: 'info'
}
}
config.data = config.data || {};
config.data.message = message;
config.data.options = coryOptions;
this.snackBar.openFromComponent(NotifyComponent, config);
}
error(error: Error) {
this.info(`${error.message}`, {
icon: 'error'
});
console.error(error);
}
}
corifeus-web-material/src/services/theme.ts 0000664 0000000 0000000 00000004626 15160755404 0021347 0 ustar 00root root 0000000 0000000 import {
Injectable,
} from '@angular/core';
import {kebabCase} from 'lodash';
import {SettingsService, CookieService} from 'corifeus-web';
//import {OverlayContainer} from '@angular/material';
export type ThemeType = "dark" | "light";
@Injectable()
export class ThemeService {
public current: string;
private original: string;
private all: string[];
private settings: any;
public type: ThemeType;
public usingCookie = false;
constructor(
private cookies: CookieService,
private settingsAll: SettingsService,
// private overlayContainer: OverlayContainer
) {
}
boot() {
this.settings = this.settingsAll.data.material;
this.original = this.settings.themes.material[0]
this.current = this.original;
this.all = this.settings.themes.material.map((element: string) => {
return kebabCase(element)
})
const fromCookie = this.cookies.get(this.settings.cookie.theme);
try {
if (fromCookie !== undefined) {
this.usingCookie = true;
this.setTheme(fromCookie);
} else {
this.setTheme(this.original);
}
} catch (e) {
this.setTheme(this.original);
}
}
setTheme(newTheme: string) {
newTheme = kebabCase(newTheme);
if (this.all.indexOf(newTheme) > -1) {
const body = document.getElementsByTagName("body")[0];
body.classList.remove(this.current);
// this.overlayContainer.getContainerElement().classList.remove(this.current);
this.current = newTheme;
body.classList.add(this.current);
// this.overlayContainer.getContainerElement().classList.add(this.current);
//this.overlayContainer.themeClass = newTheme;
this.cookies.set(this.settings.cookie.theme, this.current);
if (this.current.startsWith('cory-mat-theme-dark')) {
this.type = "dark";
body.classList.add('cory-mat-theme-dark');
body.classList.remove('cory-mat-theme-light');
} else {
this.type = "light";
body.classList.add('cory-mat-theme-light')
body.classList.remove('cory-mat-theme-dark');
}
return;
}
throw new Error(`undefined ${newTheme}`);
}
}
corifeus-web-material/tsconfig.aot.json 0000664 0000000 0000000 00000001427 15160755404 0020550 0 ustar 00root root 0000000 0000000 {
"compilerOptions": {
"skipLibCheck": true,
"outDir": "build/aot",
"target": "es2015",
"module": "esnext",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"lib": [
"es2018",
"dom"
]
},
"include": [
"src/angular/**/*",
"test/angular-webpack/**/*",
"node_modules/corifeus-web"
],
"exclude": [
"src/angular/bundle.ts",
"test/angular-webpack/angular/bundle.ts",
"test/angular-karma",
"build/browser"
],
"angularCompilerOptions-save": {
"annotationsAs": "decorators",
"preserveWhitespaces": false
},
"angularCompilerOptions": {
"enableIvy": true
}
}
corifeus-web-material/tsconfig.json 0000664 0000000 0000000 00000001461 15160755404 0017764 0 ustar 00root root 0000000 0000000 {
"compilerOptions": {
"skipLibCheck": true,
"baseUrl": "./",
"target": "es2015",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"lib": [
"es2018",
"dom"
],
"paths": {
"*": [
"node_modules/@types/*",
"*"
]
}
},
"includes": [
"src/angular/**/*",
"test/angular-webpack/**/*"
],
"exclude": [
"node_modules",
"src/angular/bundle.aot.ts",
"test/angular-karma",
"test/angular-webpack/angular/bundle.aot.ts"
]
}
corifeus-web/ 0000775 0000000 0000000 00000000000 15160755404 0013457 5 ustar 00root root 0000000 0000000 corifeus-web/LICENSE 0000664 0000000 0000000 00000002270 15160755404 0014465 0 ustar 00root root 0000000 0000000
@license corifeus-web v2019.10.438
🌳 Corifeus Web
https://pages.corifeus.com/corifeus-web
Copyright (c) 2019 Patrik Laszlo / P3X / Corifeus and contributors.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
corifeus-web/README.md 0000664 0000000 0000000 00000007571 15160755404 0014750 0 ustar 00root root 0000000 0000000 [//]: #@corifeus-header
[](https://paypal.me/patrikx3) [](https://www.patrikx3.com/en/front/contact) [](https://www.facebook.com/corifeus.software) [](https://travis-ci.com/patrikx3/corifeus-web)
[](https://uptimerobot.patrikx3.com/)
[](https://www.npmjs.com/package/corifeus-web/)
---
# 🌳 Corifeus Web v2019.10.439
**Bugs are evident™ - MATRIX️**
### Node Version Requirement
```
>=10.16.0
```
### Built on Node
```
v12.8.0
```
The ```async``` and ```await``` keywords are required.
Install NodeJs:
https://nodejs.org/en/download/package-manager/
# Built on Angular
```text
8.2.2
```
# Description
[//]: #@corifeus-header:end
This is the Corifeus Web Core.
# Implemented
* Service
* JSON Settings
* Router
* Http
* Locale (translation, date)
* Cookies
* Media Query
* Util
* Is bot
* Log
* State - for initial page
* Modules
* Ip Info
* Auth
* Pipes
* Keys
* Html sanitizer
# Use cases
* Abstract
* Portlet
* Badge
* List
* Status
* All
* Pages
* Pager
* Sorting
* Filters
* Header
* Template
* Pager
* Corifeus Server specific HTTP services
* Raw
* SocketIO
* Query
* Id
* Last
* First
* N'th
* All
* Save
* Spinner
* Mongoose
* SocketIO
* Lock
* Form
* View
* Editable
* Header
* Created
* Updated
* Lock
* Button
* Close
* Undo
* Cancel
* Save
* Validation
* Client (pre)
* Server (post)
# For testing Chrome with insecure content
```bash
/opt/google/chrome/google-chrome --allow-running-insecure-content --disable-web-security --ignore-certificate-errors
```
[//]: #@corifeus-footer
---
🙏 This is an open-source project. Star this repository, if you like it, or even donate to maintain the servers and the development. Thank you so much!
Possible, this server, rarely, is down, please, hang on for 15-30 minutes and the server will be back up.
All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://corifeus.com)) could have minor errors, since I am developing in my free time. However, it is usually stable.
**Note about versioning:** Versions are cut in Major.Minor.Patch schema. Major is always the current year. Minor is either 4 (January - June) or 10 (July - December). Patch is incremental by every build. If there is a breaking change, it should be noted in the readme.
---
[**CORIFEUS-WEB**](https://pages.corifeus.com/corifeus-web) Build v2019.10.439
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [](https://www.patrikx3.com/en/front/contact) [](https://www.facebook.com/corifeus.software)
## P3X Sponsors
[IntelliJ - The most intelligent Java IDE](https://www.jetbrains.com/?from=patrikx3)
[](https://www.jetbrains.com/?from=patrikx3) [](https://www.nosqlbooster.com/)
[The Smartest IDE for MongoDB](https://www.nosqlbooster.com)
[//]: #@corifeus-footer:end
corifeus-web/index.ts 0000664 0000000 0000000 00000000027 15160755404 0015135 0 ustar 00root root 0000000 0000000 export * from './src';
corifeus-web/src/ 0000775 0000000 0000000 00000000000 15160755404 0014246 5 ustar 00root root 0000000 0000000 corifeus-web/src/boot.ts 0000664 0000000 0000000 00000004146 15160755404 0015566 0 ustar 00root root 0000000 0000000 import {
Injectable,
Inject,
} from '@angular/core';
import {PlatformLocation} from '@angular/common'
import {log as defaultLog} from './util/log';
const IsBot = require("./util/is-bot.js");
const log = defaultLog.factory('boot');
declare global {
interface Window {
corifeusLoader: number,
corifeus: {
booted: boolean,
app: {
web: any,
server: any
}
core: {
http: {
counter: number,
status: number,
counterUrlMap: any,
error: Array
}
}
};
}
}
window.corifeusLoader = 0
window.corifeus = {
booted: false,
core: {
http: {
status: 200,
counter: 0,
counterUrlMap: {},
error: [],
}
},
app: {
web: {},
server: {}
}
}
let httpCounter = 0;
Object.defineProperty(window.corifeus.core.http, 'counter', {
get: () => {
return httpCounter;
},
set: (value) => {
httpCounter = value;
}
})
import {SettingsService, LocaleService} from "./index";
import {RouterService} from "./services/router";
@Injectable()
export class Boot {
constructor(
private settings: SettingsService,
private locale: LocaleService,
private routerService: RouterService,
private location: PlatformLocation
) {
}
boot() {
log('booted');
this.settings.boot();
const module = 'core';
const body = document.getElementsByTagName("body")[0];
const corySeo = document.createElement('div');
body.appendChild(corySeo)
corySeo.id = 'cory-seo';
this.settings.register(module, require('./json/settings.json'));
// after settings
this.locale.boot();
if (!IsBot()) {
corySeo.style.display = 'none';
}
window.corifeus.booted = true;
this.location.onPopState(() => {
this.routerService.scrollToTop();
});
}
}
corifeus-web/src/index.ts 0000664 0000000 0000000 00000000432 15160755404 0015724 0 ustar 00root root 0000000 0000000 // dirs
//export * from '../src-save/directive';
//export * from './forms';
export * from './modules';
//export * from '../src-save/pipe';
export * from './services';
export * from './util';
// files
export * from './boot';
export * from './module';
export * from './polyfills';
corifeus-web/src/json/ 0000775 0000000 0000000 00000000000 15160755404 0015217 5 ustar 00root root 0000000 0000000 corifeus-web/src/json/settings.json 0000664 0000000 0000000 00000000710 15160755404 0017750 0 ustar 00root root 0000000 0000000 {
"server": {
"url": ""
},
"cookie": {
"language": "cory-layout-language",
"token": "corifeus-token"
},
"header": {
"token": "Authorization"
},
"translations": {
"language": {
"en": "English",
"hu": "Magyar"
},
"display": {
"en": "The user interface is English.",
"hu": "A felhasználói felület Magyar."
}
}
}
corifeus-web/src/module.ts 0000664 0000000 0000000 00000004426 15160755404 0016111 0 ustar 00root root 0000000 0000000 import {
NgModule,
ModuleWithProviders,
} from '@angular/core';
import {RouterModule} from '@angular/router';
import {
HttpClientModule,
HTTP_INTERCEPTORS
} from '@angular/common/http';
import {Boot} from './boot';
import {ColorService} from './services/color'
//import {JsonPipe} from '../src-save/pipe/json'
//import {KeysPipe} from '../src-save/pipe/keys'
//import {HtmlPipe} from '../src-save/pipe/html'
import {HttpShareService} from './services/http/http-share'
import {AuthInterceptor} from './services/http/auth-interceptor'
import {CookieService} from './services/cookie'
import {RouterService} from './services/router'
import {SettingsService} from './services/settings'
import {LocaleService} from './services/locale'
import {MediaQueryService} from './services/media-query'
import {IpInfoService} from './modules/ip-info'
import {AuthService,} from './modules/auth'
//import {FocusDirective} from '../src-save/directive/autofocus'
/***
* NEVER USE A EXPORT * AS, NEED THE EXACT COMPONENT FOR INJECTABLE FUNCTION!!!!
*/
let booted = false
@NgModule({
imports: [
HttpClientModule,
RouterModule,
],
// export
declarations: [
// KeysPipe,
// HtmlPipe,
// JsonPipe,
// SubmittedRequired,
// FocusDirective
],
// does not need export
providers: [
RouterService,
CookieService,
SettingsService,
LocaleService,
MediaQueryService,
HttpShareService,
ColorService,
// modules
IpInfoService,
AuthService,
{
provide: HTTP_INTERCEPTORS,
useClass: AuthInterceptor,
multi: true
},
// order is important
Boot,
],
exports: [
HttpClientModule,
RouterModule,
// KeysPipe,
// HtmlPipe,
// JsonPipe,
// FocusDirective
// SubmittedRequired,
],
entryComponents: [],
})
export class CorifeusModule {
constructor(private boot: Boot) {
if (booted === true) {
return
}
booted = true
this.boot.boot();
}
public static forRoot(): ModuleWithProviders {
return {
ngModule: CorifeusModule,
// providers: providers,
};
}
}
corifeus-web/src/modules/ 0000775 0000000 0000000 00000000000 15160755404 0015716 5 ustar 00root root 0000000 0000000 corifeus-web/src/modules/auth.ts 0000664 0000000 0000000 00000004366 15160755404 0017240 0 ustar 00root root 0000000 0000000 import {
Injectable,
Inject
} from '@angular/core';
//import {
// CookieService,
//} from '../services/cookie';
import {
HttpShareService,
} from '../services/http/http-share';
import {HttpClient} from '@angular/common/http';
import {
SettingsService,
} from '../services/settings';
@Injectable()
export class AuthService {
constructor(
private settings: SettingsService,
// private cookie: CookieService,
private http: HttpClient,
private httpShare: HttpShareService,
) {
}
public async login(login: any) {
return new Promise(async (resolve, reject) => {
const observable: any = await this.http.post(`${this.settings.data.core.server.url}/api/core/auth/login`, login, {
observe: 'response'
}).subscribe((response: any) => {
try {
if (response.headers.has(this.settings.data.core.header.token)) {
this.httpShare.token = response.headers.get(this.settings.data.core.header.token);
}
} catch (e) {
window.corifeus.core.http.error.push(e);
}
const body: any = response.body;
// console.log(this.httpShare.token);
resolve(Token(body.token));
},
(err: Error) => {
this.httpShare.token = '';
reject(err)
})
});
}
public async verify() {
await this.http.get(`${this.settings.data.core.server.url}/api/core/auth/verify`).toPromise();
return Token(this.httpShare.token);
}
public async prolongate() {
const response = await this.http.get(`${this.settings.data.core.server.url}/api/core/auth/prolongate`).toPromise();
this.httpShare.token = `${response['token']}`;
return Token(this.httpShare.token);
}
}
export function Token(token: String): any {
try {
if (token === '') {
return token;
}
const data = token.split('-');
const info = JSON.parse(atob(data[0]));
return info;
} catch (e) {
console.error(e);
throw e;
}
}
corifeus-web/src/modules/index.ts 0000664 0000000 0000000 00000000062 15160755404 0017373 0 ustar 00root root 0000000 0000000 export * from './auth';
export * from './ip-info'; corifeus-web/src/modules/ip-info.ts 0000664 0000000 0000000 00000000502 15160755404 0017624 0 ustar 00root root 0000000 0000000 import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
@Injectable()
export class IpInfoService {
constructor(private http: HttpClient) {
}
public get get() {
const response = this.http.get('https://ipinfo.io/json').toPromise();
return response;
}
}
corifeus-web/src/polyfills.ts 0000664 0000000 0000000 00000000443 15160755404 0016634 0 ustar 00root root 0000000 0000000 //import 'core-js/es6';
import 'core-js/es7/reflect.js';
import 'zone.js/dist/zone.js';
declare var process: any;
if (process.env === 'production') {
// Production
} else {
// Development
Error['stackTraceLimit'] = Infinity;
require('zone.js/dist/long-stack-trace-zone');
}
corifeus-web/src/services/ 0000775 0000000 0000000 00000000000 15160755404 0016071 5 ustar 00root root 0000000 0000000 corifeus-web/src/services/color.ts 0000664 0000000 0000000 00000003215 15160755404 0017560 0 ustar 00root root 0000000 0000000 import {
Injectable,
OnInit,
ElementRef
} from '@angular/core';
const tinycolor = require('tinycolor2');
const colorCalculatorCache = {}
@Injectable()
export class ColorService {
public getReadableColor(fg: any, bg: any, step: number = 5) {
let fgColor = tinycolor(fg);
let bgColor = tinycolor(bg);
const key = `${fgColor.toHexString()}${bgColor.toHexString()}`;
if (colorCalculatorCache.hasOwnProperty(key)) {
// console.log(key)
// console.log(colorCalculatorCache)
return colorCalculatorCache[key];
}
// console.log('----------------------------------------------------')
// console.log(fgColor.toHexString())
const max = Math.ceil(100 / step);
let count = 0;
const read = () => {
while (!tinycolor.isReadable(fgColor, bgColor) && count < max) {
fgColor = fgColor[method](step);
//console.log(`${method} BG-${bgColor.toHexString()} => FG-${fgColor.toHexString()}`)
count++;
}
}
let method = 'lighten';
read();
if (count >= max) {
count = 0;
method = 'darken'
fgColor = tinycolor(fg);
read();
}
if (count >= max) {
fgColor = tinycolor(fg);
fgColor = tinycolor.mostReadable(bgColor, [fgColor]);
}
// console.log(fgColor.toHexString())
// console.log('----------------------------------------------------')
const result = fgColor.toHexString();
colorCalculatorCache[key] = result;
return result;
}
}
corifeus-web/src/services/cookie.ts 0000664 0000000 0000000 00000000740 15160755404 0017713 0 ustar 00root root 0000000 0000000 import {
Injectable
} from '@angular/core';
//import * as Cookies from 'js-cookie';
import * as cookie from 'js-cookie';
@Injectable()
export class CookieService {
public get(name: string): string {
return cookie.get(name);
}
public set(name: string, value: string | any, options?: Cookies.CookieAttributes): void {
cookie.set(name, value, options)
}
public getAll(): { [key: string]: string } {
return cookie.get();
}
}
corifeus-web/src/services/http/ 0000775 0000000 0000000 00000000000 15160755404 0017050 5 ustar 00root root 0000000 0000000 corifeus-web/src/services/http/auth-interceptor.ts 0000664 0000000 0000000 00000015413 15160755404 0022721 0 ustar 00root root 0000000 0000000 import {
Injectable
} from '@angular/core';
import {
HttpEvent,
HttpInterceptor,
HttpHeaders,
HttpHandler,
HttpRequest,
} from '@angular/common/http';
import {Observable} from 'rxjs';
//import 'rxjs/add/observable/throw'
import {tap} from 'rxjs/operators';
//import 'rxjs/add/operator/finally';
import {
HttpShareService,
} from './http-share';
import {State} from './state';
import {CookieService} from '../cookie';
import {SettingsService} from '../settings';
@Injectable()
export class AuthInterceptor implements HttpInterceptor {
cookie: CookieService = new CookieService();
settings: SettingsService = new SettingsService();
httpShare: HttpShareService = new HttpShareService()
constructor() {
}
private handleFinally(url: string) {
if (window.corifeus.core.http.counterUrlMap[url] === 1) {
delete window.corifeus.core.http.counterUrlMap[url];
} else {
window.corifeus.core.http.counterUrlMap[url]--;
}
window.corifeus.core.http.counter--
}
intercept(req: HttpRequest, next: HttpHandler): Observable> {
window.corifeus.core.http.counter++;
let interceptedRequest = req;
const url: any = req.url;
if (window.corifeus.core.http.counterUrlMap.hasOwnProperty(url)) {
window.corifeus.core.http.counterUrlMap[url]++;
} else {
window.corifeus.core.http.counterUrlMap[url] = 1;
}
State.NotFound = false;
window.corifeus.core.http.status = 200;
if (this.settings.data.core.server.url !== undefined && this.settings.data.core.server.url !== null && this.settings.data.core.server.url !== '') {
if (url.startsWith(this.settings.data.core.server.url) && !url.startsWith(`${this.settings.data.core.server.url}/api/core/auth/login`)) {
let headers = new HttpHeaders();
if (this.httpShare.token !== '') {
headers = new HttpHeaders({
[this.settings.data.core.header.token]: `${this.httpShare.token}`,
});
}
interceptedRequest = req.clone({
headers: headers
});
}
}
return next.handle(interceptedRequest).pipe(
tap(
(event: any) => {
if (event.type !== 0) {
this.handleFinally(url);
}
}, (err: any) => {
this.handleFinally(url);
}
),
)
/*
handle.do((event: any) => {
// const eventType : string = typeof event;
if (event.type !== 0) {
this.handleFinally(url);
}
}, (err: any) => {
this.handleFinally(url);
});
*/
// return handle;
}
}
/*
import { Injectable } from '@angular/core';
import {
Http,
ConnectionBackend,
RequestOptions,
RequestOptionsArgs,
Request,
Response,
Headers
} from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import { State } from './state';
import { CookieService } from '../cookie';
import { SettingsService } from '../settings';
import { HttpShareService } from './http-share';
let share : HttpShareService;
@Injectable()
export class HttpInterceptor extends Http
{
cookie: CookieService = new CookieService();
settings: SettingsService = new SettingsService();
constructor(
backend: ConnectionBackend,
defaultOptions: RequestOptions,
) {
super(backend, defaultOptions);
if (share === undefined) {
share = new HttpShareService();
}
}
/*
private handleError(err: Response, caught: Observable<{}>) {
window.corifeus.core.http.counter--;
State.NotFound = true;
window.corifeus.core.http.status = 404;
}
*/
/*
private handleFinally(urlString: string) {
if (window.corifeus.core.http.counterUrlMap[urlString] === 1) {
delete window.corifeus.core.http.counterUrlMap[urlString];
} else {
window.corifeus.core.http.counterUrlMap[urlString]--;
}
window.corifeus.core.http.counter--
}
public get data() {
return share;
}
request(url: string | Request, options?: RequestOptionsArgs): Observable {
window.corifeus.core.http.counter++;
const urlString = url instanceof Request ? url.url : url;
if (window.corifeus.core.http.counterUrlMap.hasOwnProperty(urlString)) {
window.corifeus.core.http.counterUrlMap[urlString]++;
} else {
window.corifeus.core.http.counterUrlMap[urlString] = 1;
}
State.NotFound = false;
window.corifeus.core.http.status = 200;
if (this.settings.data.core.server.url !== undefined && this.settings.data.core.server.url !== null && this.settings.data.core.server.url !== '') {
if (url instanceof Request) {
if (url.url.startsWith(this.settings.data.core.server.url)) {
url.headers = url.headers || new Headers();
url.headers.set(this.settings.data.core.header.token, share.token)
url.headers.set(this.settings.data.core.header.tokenAuto, share.tokenAuto)
}
} else {
if (url.startsWith(this.settings.data.core.server.url)) {
options.headers = options.headers || new Headers();
options.headers.set(this.settings.data.core.header.token, share.token)
options.headers.set(this.settings.data.core.header.tokenAuto, share.tokenAuto)
}
}
}
const response = super.request(url, options);
response.subscribe(
(response: Response) => {
try {
if (response.headers.has(this.settings.data.core.header.token)) {
share.token = response.headers.get(this.settings.data.core.header.token);
}
if (response.headers.has(this.settings.data.core.header.tokenAuto)) {
share.tokenAuto = response.headers.get(this.settings.data.core.header.tokenAuto);
}
} catch (e) {
window.corifeus.core.http.error.push(e);
console.error(e);
}
},
(e: any) => {
this.handleFinally(urlString);
window.corifeus.core.http.error.push(e);
},
() => {
this.handleFinally(urlString)
}
);
return response;
}
}
*/
corifeus-web/src/services/http/http-share.ts 0000664 0000000 0000000 00000002026 15160755404 0021477 0 ustar 00root root 0000000 0000000 import {Injectable} from '@angular/core';
let booted = false;
const data = {
token: '',
};
import {Token} from '../../modules/auth';
import {CookieService} from '../cookie';
import {SettingsService} from '../settings';
const cookie: CookieService = new CookieService();
const settings: SettingsService = new SettingsService();
export class HttpShareService {
constructor() {
}
public get requestCount() {
return window.corifeus.core.http.counter;
}
public get token() {
if (!booted) {
booted = true;
data.token = cookie.get(settings.data.core.cookie.token);
}
return data.token;
}
public set token(value) {
booted = true;
data.token = value;
const cookieSettings: Cookies.CookieAttributes = {};
cookieSettings.expires = new Date(this.tokenInfo.expiry);
cookie.set(settings.data.core.cookie.token, value, cookieSettings);
}
public get tokenInfo(): any {
return Token(this.token);
}
}
corifeus-web/src/services/http/index.ts 0000664 0000000 0000000 00000000133 15160755404 0020524 0 ustar 00root root 0000000 0000000 export * from './http-share';
export * from './state';
export * from './auth-interceptor';
corifeus-web/src/services/http/state.ts 0000664 0000000 0000000 00000000340 15160755404 0020535 0 ustar 00root root 0000000 0000000 export interface StateInterface {
NotFound: boolean,
RequestPath: string,
}
let State: StateInterface = {
NotFound: false,
RequestPath: location.pathname + location.search + location.hash
}
export {State};
corifeus-web/src/services/index.ts 0000664 0000000 0000000 00000000314 15160755404 0017546 0 ustar 00root root 0000000 0000000 // dirs
export * from './http';
// files
export * from './color';
export * from './cookie';
export * from './locale';
export * from './settings';
export * from './router';
export * from './media-query';
corifeus-web/src/services/locale.ts 0000664 0000000 0000000 00000006551 15160755404 0017707 0 ustar 00root root 0000000 0000000 import {
Injectable,
Inject
} from '@angular/core';
//import * as moment from 'moment';
import {CookieService,} from './cookie';
import {SettingsService} from './settings';
import {IpInfoService,} from '../modules/ip-info';
import {log as logDefault} from '../util/log'
const log = logDefault.factory('locale');
let currentLanguage = 'en';
const totalTranslations = {};
import {BehaviorSubject} from 'rxjs';
const subject = new BehaviorSubject({
action: 'empty'
});
export interface LocaleSubject {
action: string
locale: LocaleService,
}
let cookieEmpty = true;
const IsBot = require("../util/is-bot.js");
@Injectable()
export class LocaleService {
constructor(
private ipInfo: IpInfoService,
private settings: SettingsService,
private cookie: CookieService,
) {
}
public async boot() {
const fromCookie = this.cookie.get(this.settings.data.core.cookie.language);
if (fromCookie !== undefined) {
log(`using cookie language: ${fromCookie}`)
this.setTranslation(fromCookie);
} else if (!IsBot()) {
let ipLanguage;
try {
const response: any = await this.ipInfo.get;
ipLanguage = response.country.toLowerCase()
if (Object.keys(this.settings.data.core.translations.language).indexOf(ipLanguage) > -1) {
log(`using locale from IPINFO ${ipLanguage}`)
this.setTranslation(ipLanguage);
}
} catch (e) {
window.corifeus.core.http.error.push(e);
console.error(e)
}
if (ipLanguage === undefined) {
log(`using default language: ${ipLanguage}`)
this.setTranslation(currentLanguage);
}
} else {
this.setTranslation(currentLanguage);
}
}
public register(module: string, translations: any) {
log(`[ ${module.toUpperCase()} ]`)
Object.keys(translations).forEach((lang: string) => {
totalTranslations[lang] = totalTranslations[lang] || {};
// if (totalTranslations[lang][module] !== undefined) {
// throw new Error(`Already registered locale langauge module (${module})`);
// }
totalTranslations[lang][module] = translations[lang];
})
subject.next({
action: 'set-translation',
locale: this
})
}
public setTranslation(setTranslation: string) {
log(`setTranslation '${setTranslation}'`)
if (this.settings.data.core.translations.language.hasOwnProperty(setTranslation)) {
currentLanguage = setTranslation;
this.cookie.set(this.settings.data.core.cookie.language, currentLanguage);
subject.next({
action: 'set-translation',
locale: this
})
//moment.locale(currentLanguage);
cookieEmpty = false;
return true;
}
throw new Error(`setTranslation '${setTranslation}' failed`);
}
public subscribe(subscriber: any) {
return subject.subscribe({
next: subscriber
});
}
public get current() {
return currentLanguage;
}
public get data() {
return totalTranslations[currentLanguage];
}
}
corifeus-web/src/services/media-query.ts 0000664 0000000 0000000 00000007134 15160755404 0020670 0 ustar 00root root 0000000 0000000 import {
Injectable,
NgZone,
OnDestroy,
} from '@angular/core';
import {Observable, BehaviorSubject} from 'rxjs';
import {log as defaultLog} from '../util/log';
const log = defaultLog.factory('media query');
export enum MediaQuerySettingType {
Width
}
export interface MediaQuerySetting {
name: string,
min: number,
max: number,
type: MediaQuerySettingType
}
@Injectable()
export class MediaQueryService implements OnDestroy {
settings: MediaQuerySetting[] = [];
lastResult: MediaQuerySetting[] = [];
width: number;
height: number;
subject: BehaviorSubject;
onResize: EventListener;
debounce: any;
constructor(
private ngZone: NgZone
) {
this.subject = new BehaviorSubject([]);
this.register([
{
name: 'small',
min: 0,
max: 599,
type: MediaQuerySettingType.Width
},
{
name: 'large',
min: 600,
max: Infinity,
type: MediaQuerySettingType.Width
}
])
const debounceTime = 500;
this.onResize = (evt: Event) => {
clearTimeout(this.debounce);
this.debounce = setTimeout(() => {
// console.log('debounced')
this.ngZone.run(() => {
this.width = window.innerWidth;
this.height = window.innerHeight;
this.findMediaQuery()
});
}, debounceTime)
}
this.debounce = setTimeout(() => {
this.onResize(null);
}, debounceTime)
window.addEventListener('resize', this.onResize)
}
public register(settings: MediaQuerySetting[]) {
for (let setting of settings) {
let found = false;
for (let useSetting of this.settings) {
if (useSetting.name === setting.name && useSetting.type === setting.type) {
found = true;
console.warn(`corifeus-web media-query service has duplicate settings`)
break;
}
}
if (found === false) {
this.settings.push(setting);
}
}
this.findMediaQuery();
}
private findMediaQuery() {
let results: MediaQuerySetting[] = [];
this.settings.forEach((setting) => {
// console.log(setting)
switch (setting.type) {
case MediaQuerySettingType.Width:
// console.log('---------------------------');
const minFound = this.width >= setting.min;
const maxFound = this.width <= setting.max;
//console.log(setting.min, this.width, setting.max);
//console.log(minFound, this.width, maxFound);
if (minFound && maxFound) {
results.push(setting);
}
break;
}
})
if (JSON.stringify(results) !== JSON.stringify(this.lastResult)) {
this.lastResult = results;
if (this.subject !== undefined) {
this.subject.next(results);
}
}
}
public subscribe(subscriber: any) {
return this.subject.subscribe({
next: subscriber
});
}
ngOnDestroy() {
window.removeEventListener('resize', this.onResize)
clearTimeout(this.debounce);
}
}
corifeus-web/src/services/router.ts 0000664 0000000 0000000 00000005057 15160755404 0017770 0 ustar 00root root 0000000 0000000 import {
Router as AngularRouter,
NavigationExtras,
NavigationEnd,
} from '@angular/router';
import {
Injectable,
} from '@angular/core';
const IsBot = require("../util/is-bot.js");
let debounceGoogleAnalyticsTimeout: any;
import {SettingsService} from './settings';
@Injectable()
export class RouterService {
constructor(private router: AngularRouter,
private settings: SettingsService
) {
if (navigator.userAgent !== 'corifeus-server-renderer') {
const startGa = () => {
if (!IsBot()) {
window['ga']('send', 'pageview', {page: location.href});
this.router.events.subscribe((event: any) => {
if (event instanceof NavigationEnd) {
clearTimeout(debounceGoogleAnalyticsTimeout);
debounceGoogleAnalyticsTimeout = setTimeout(() => {
window['ga']('send', 'pageview', {page: event.url});
}, 333)
}
});
}
}
const loadSettings = setInterval(() => {
if (settings.data.core.hasOwnProperty('integration') && settings.data.core.integration.hasOwnProperty('google') && settings.data.core.integration.google.hasOwnProperty('analytics') && settings.data.core.integration.google.analytics !== '' && window['ga'] !== undefined) {
startGa();
clearInterval(loadSettings)
}
}, 333)
setTimeout(() => {
clearInterval(loadSettings)
}, 10000)
}
};
scrollToTop() {
window.scrollTo(0, 0);
const elements = document.querySelectorAll('[cdk-scrollable]');
for (let i = 0; i < elements.length; ++i) {
const element = elements[i];
element.scrollTop = 0;
//.scrollTo(0, 0);
}
const sideNavDivs = document.getElementsByTagName('mat-sidenav-content');
for (let i = 0; i < sideNavDivs.length; i++) {
const sideNavDiv = sideNavDivs[i];
sideNavDiv.scrollTop = 0;
}
}
navigateTop(commands: any[], extras?: NavigationExtras): Promise {
this.scrollToTop();
return this.navigate(commands, extras);
}
navigate(commands: any[], extras?: NavigationExtras): Promise {
return this.router.navigate(commands, extras);
}
get events() {
return this.router.events;
}
}
corifeus-web/src/services/settings.ts 0000664 0000000 0000000 00000012403 15160755404 0020301 0 ustar 00root root 0000000 0000000 import {
Injectable
} from '@angular/core';
import {log as defulatLog} from '../util/log';
const log = defulatLog.factory('settings');
let totalSettings: any = {};
let extendSettings: any = {};
@Injectable()
export class SettingsService {
constructor() {
}
public register(module: string, settings: any) {
log(`[${module.toUpperCase()}] register`)
// if (totalSettings[module] !== undefined) {
// throw new Error(`Already registered setting module (${module})`);
// }
totalSettings[module] = Object.assign(totalSettings[module] || {}, settings)
if (extendSettings[module] !== undefined && extendSettings[module].length > 0 ) {
for(let extendSetting of extendSettings[module]) {
totalSettings[module] = Object.assign(totalSettings[module], extendSetting)
}
}
log(`[${module.toUpperCase()}] registered`, totalSettings)
}
public extend(module: string, settings: any) {
if (totalSettings[module] === undefined) {
log(`[${module.toUpperCase()}] extend not ready, waiting for register`, settings)
extendSettings[module] = extendSettings[module] || [];
extendSettings[module].push(settings)
return;
}
log(`[${module.toUpperCase()}] extend`, settings)
totalSettings[module] = Object.assign(totalSettings[module], settings)
log(`[${module.toUpperCase()}] done`, totalSettings)
}
get data(): any {
return totalSettings;
}
boot() {
}
afterInitWaiter: any;
afterInit() {
log('afterInit');
const coreSettings = totalSettings['core'];
if (coreSettings === undefined) {
log('afterInit waiting for construction')
this.afterInitWaiter = setTimeout(() => {
this.afterInit()
})
return
}
if (coreSettings.hasOwnProperty('integration')) {
log('afterInit - integration');
const head = document.getElementsByTagName("head")[0];
// yandex
if (coreSettings.integration.hasOwnProperty('yandex')) {
log('afterInit - integration - yandex');
// yandex-verification
if (coreSettings.integration.yandex.hasOwnProperty('verification')) {
log('afterInit - integration - yandex - verification');
const meta = document.createElement('meta');
meta.name = "yandex-verification";
meta.content = coreSettings.integration.yandex['verification'];
head.appendChild(meta);
}
}
// google
if (coreSettings.integration.hasOwnProperty('google')) {
log('afterInit - integration - google');
// google-site-verification
if (coreSettings.integration.google.hasOwnProperty('site-verification')) {
log('afterInit - integration - google - site-verification');
const meta = document.createElement('meta');
meta.name = "google-site-verification";
meta.content = coreSettings.integration.google['site-verification'];
head.appendChild(meta);
}
// google-site-verification
if (coreSettings.integration.google.hasOwnProperty('analytics')) {
log('afterInit - integration - google - analytics');
const script = document.createElement("script");
script.type = 'text/javascript';
const analytics = `ga('create', '${coreSettings.integration.google.analytics}')`;
let tag = '';
if (coreSettings.integration.google.hasOwnProperty('tag')) {
log('afterInit - integration - google - analytics - tag');
tag = `ga('require', '${coreSettings.integration.google.tag}')`;
}
;
script.innerHTML = `(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');${analytics};${tag}`;
log('afterInit - integration - google - analytics - load script');
head.appendChild(script);
}
;
}
// microsoft
if (coreSettings.integration.hasOwnProperty('microsoft')) {
log('afterInit - integration - google - microsoft');
// msvalidate.01 / bing
if (coreSettings.integration.microsoft.hasOwnProperty('msvalidate.01')) {
log('afterInit - integration - google - microsoft - msvalidate');
const meta = document.createElement('meta');
meta.name = "msvalidate.01";
meta.content = coreSettings.integration.microsoft['msvalidate.01'];
head.appendChild(meta);
}
}
}
}
}
corifeus-web/src/util/ 0000775 0000000 0000000 00000000000 15160755404 0015223 5 ustar 00root root 0000000 0000000 corifeus-web/src/util/index.ts 0000664 0000000 0000000 00000000276 15160755404 0016707 0 ustar 00root root 0000000 0000000 export * from './log';
export function decodeEntities(encodedString: string) {
var div = document.createElement('div');
div.innerHTML = encodedString;
return div.textContent;
}
corifeus-web/src/util/is-bot.js 0000664 0000000 0000000 00000001544 15160755404 0016762 0 ustar 00root root 0000000 0000000 const pattern = new RegExp('spider|bot|facebook|yahoo|bing|google|yandex|wget|lynx|curl|embedly|quora|outbrain|pinterest|vkShare|W3C_Validator|crawl|borg|slurp|archiver|netresearch|lycos|scooter|altavista|teoma|oegp|charlotte|http client|htdig|ichiro|mogimogi|larbin|pompos|scrubby|searchsight|semanticdiscovery|snappy|speedy|voila|vortex|voyager|zao|zeal|dataparksearch|findlinks|yottaamonitor|browsermob|httpmonitor|bingpreview|pagepeeker|webthumb|url2png|zooshot|gomeza|google sketchup|read later|pingdom|facebook|rackspace|scan|link|ezine|preview|dig|tarantula|urllib|jakarta|wget|rget|monitor|libwww|moozilla|seer|spice|snoopy|feedfetcher|wordpress|java|netfront|archive|xenu|feed|appmanager|covario|perl|host|lwp|page speed|ptst|digext|nutch|sleuth|yottaamonitor|bubing|corifeus', 'i');
module.exports = () => {
return pattern.test(navigator.userAgent);
};
corifeus-web/src/util/log.ts 0000664 0000000 0000000 00000001460 15160755404 0016355 0 ustar 00root root 0000000 0000000 declare var process: any;
const isDevMode = () => {
return process.env !== 'production'
}
export function logFactory(module: string): any {
let log: any;
if (!isDevMode()) {
log = function (...args: any[]) {
};
} else {
log = function log(...args: any[]) {
args.unshift(`[${module.toUpperCase()}] `);
const result = {};
for (let index = 0; index < args.length; index++) {
const stringIndex: string = String(index);
result[stringIndex] = args[index];
}
console.log.apply(console.log, args);
}
}
log.factory = (innerModule: string) => {
return logFactory(`${module}] [${innerModule}`);
}
return log;
}
const log = logFactory('corifeus')
export {log};
corifeus-web/tsconfig.aot.json 0000664 0000000 0000000 00000001412 15160755404 0016746 0 ustar 00root root 0000000 0000000 {
"compilerOptions": {
"skipLibCheck": true,
"outDir": "build/aot",
"target": "es2015",
"module": "esnext",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"lib": [
"es2018",
"dom"
]
},
"include": [
"src/angular/**/*",
"test/angular-webpack/**/*"
],
"exclude": [
"node_modules",
"src/angular/bundle.ts",
"test/angular-webpack/angular/bundle.ts",
"test/angular-karma",
"build/browser"
],
"angularCompilerOptions-save": {
"annotationsAs": "decorators",
"preserveWhitespaces": false
},
"angularCompilerOptions": {
"enableIvy": true
}
}
corifeus-web/tsconfig.json 0000664 0000000 0000000 00000001315 15160755404 0016166 0 ustar 00root root 0000000 0000000 {
"compilerOptions": {
"skipLibCheck": true,
"baseUrl": "./",
"target": "es2015",
"module": "esnext",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"lib": [
"es2018",
"dom"
],
"paths": {
"*": [ "node_modules/@types/*", "*"]
}
},
"includes": [
"src/angular/**/*",
"test/angular-webpack/**/*"
],
"exclude": [
"node_modules",
"src/angular/bundle.aot.ts",
"test/angular-karma",
"test/angular-webpack/angular/bundle.aot.ts"
],
"angularCompilerOptions": {
"enableIvy": true
}
}
package.json 0000664 0000000 0000000 00000003410 15160755404 0013351 0 ustar 00root root 0000000 0000000 {
"name": "corifeus",
"version": "2024.4.102",
"corifeus": {
"icon": "fab fa-superpowers",
"inception": "12/25/2016",
"code": "Matrix",
"cdn": true,
"menu": [
{
"name": "menu-corifeus-code-style",
"link": "artifacts/readme/code-style.html"
},
{
"name": "menu-corifeus-architecture",
"link": "artifacts/readme/arthictecture/overview.html"
},
{
"name": "menu-corifeus-more-origin",
"link": "https://en.wikipedia.org/wiki/Coryphaeus"
}
],
"menu-old": [
{
"name": "menu-corifeus-patterns",
"link": "artifacts/readme/patterns.html"
}
],
"nodejs": "v20.11.0",
"opencollective": false,
"reponame": "corifeus",
"build": true
},
"description": "🎮 Corifeus Matrix",
"main": "src/index.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "grunt",
"coverage": "istanbul cover node_modules/mocha/bin/_mocha --report clover -- -R spec test/mocha/**/*.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/patrikx3/corifeus.git"
},
"keywords": [
"corifeus",
"one",
"platform"
],
"author": "Patrik Laszlo ",
"license": "MIT",
"bugs": {
"url": "https://github.com/patrikx3/corifeus/issues"
},
"homepage": "https://corifeus.com/matrix",
"devDependencies": {
"corifeus-builder": "^2024.4.103",
"corifeus-utils": "^2024.4.103"
},
"engines": {
"node": ">=12.13.0"
}
} scripts/ 0000775 0000000 0000000 00000000000 15160755404 0012554 5 ustar 00root root 0000000 0000000 scripts/init.ps1 0000664 0000000 0000000 00000000371 15160755404 0014145 0 ustar 00root root 0000000 0000000
git clone https://github.com/patrikx3/corifeus
pushd corifeus
git checkout master
git submodule update --init --recursive --remote
git submodule foreach --recursive git checkout master
#npm install
#&git submodule foreach --recursive npm install
scripts/init.sh 0000775 0000000 0000000 00000000414 15160755404 0014055 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash
git clone https://github.com/patrikx3/corifeus.git
pushd corifeus
git checkout master
git submodule update --init --recursive --remote
git submodule foreach --recursive git checkout master
npm install
git submodule foreach --recursive npm install
src/ 0000775 0000000 0000000 00000000000 15160755404 0011654 5 ustar 00root root 0000000 0000000 src/index.js 0000664 0000000 0000000 00000000043 15160755404 0013316 0 ustar 00root root 0000000 0000000 module.exports = console.log('CI');