.browserslistrc000066400000000000000000000015251516074440300141550ustar00rootroot00000000000000# This file is used by the build system to adjust CSS and JS output to support the specified browsers below. # For additional information regarding the format and rule options, please see: # https://github.com/browserslist/browserslist#queries # For the full list of supported browsers by the Angular framework, please see: # https://angular.io/guide/browser-support # You can see what browsers were selected by your queries by running: # npx browserslist last 1 Chrome version last 1 Firefox version last 2 Edge major versions last 2 Safari major versions last 2 iOS major versions Firefox ESR not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line. not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line. .editorconfig000066400000000000000000000006371516074440300135450ustar00rootroot00000000000000# EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # Change these settings to your own preference indent_style = space indent_size = 4 # We recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false .eslintrc.json000066400000000000000000000020741516074440300136610ustar00rootroot00000000000000{ "root": true, "ignorePatterns": [ "projects/**/*" ], "overrides": [ { "files": [ "*.ts" ], "parserOptions": { "project": [ "tsconfig.json", "e2e/tsconfig.json" ], "createDefaultProgram": true }, "extends": [ "plugin:@angular-eslint/ng-cli-compat", "plugin:@angular-eslint/ng-cli-compat--formatting-add-on", "plugin:@angular-eslint/template/process-inline-templates" ], "rules": { "@angular-eslint/component-selector": [ "error", { "type": "element", "prefix": "app", "style": "kebab-case" } ], "@angular-eslint/directive-selector": [ "error", { "type": "attribute", "prefix": "app", "style": "camelCase" } ] } }, { "files": [ "*.html" ], "extends": [ "plugin:@angular-eslint/template/recommended" ], "rules": {} } ] } .github/000077500000000000000000000000001516074440300124225ustar00rootroot00000000000000.github/workflows/000077500000000000000000000000001516074440300144575ustar00rootroot00000000000000.github/workflows/nodejs.yml000066400000000000000000000016441516074440300164710ustar00rootroot00000000000000# 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: nodejs on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [10.x, 12.x, 14.x, 15.x] # 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@v1 with: node-version: ${{ matrix.node-version }} - run: npm i -g grunt-cli - run: npm install - run: grunt .gitignore000066400000000000000000000003661516074440300130570ustar00rootroot00000000000000/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 .npmrc yarn.lock dist .idea/000077500000000000000000000000001516074440300120425ustar00rootroot00000000000000.idea/codeStyleSettings.xml000066400000000000000000000004251516074440300162410ustar00rootroot00000000000000 .idea/corifeus-app-web-pages.iml000066400000000000000000000005201516074440300170070ustar00rootroot00000000000000 .idea/modules.xml000066400000000000000000000004501516074440300142330ustar00rootroot00000000000000 .idea/php.xml000066400000000000000000000003301516074440300133470ustar00rootroot00000000000000 .idea/vcs.xml000066400000000000000000000002471516074440300133620ustar00rootroot00000000000000 .ncurc.json000066400000000000000000000002711516074440300131450ustar00rootroot00000000000000{ "reject": [ "core-js", "reflect-metadata", "rxjs", "tslib", "zone.js", "typescript", "karma", "ng-packagr" ] } .npmignore000066400000000000000000000002711516074440300130610ustar00rootroot00000000000000/.idea /artifacts /build /Gemfile /_layouts /_site /_includes /test /node_modules /*.iml /*.ipr /*.iws /.travis.yml /.scrutinizer.yml /Gruntfile.js /corifeus-boot.json /assets /.github .travis.yml000066400000000000000000000015601516074440300131750ustar00rootroot00000000000000sudo: required cache: npm: false language: node_js node_js: - lts/* before_install: npm install -g npm before_script: - npm install -g grunt-cli npm - npm install env: global: secure: DfHvi6Jg6vXSCsdiB29pb1l315BEla5Pbfmr3t30n8p1OU2qeu1+PfaGwXv+vUvN3dQ81q7W9eN6aF1nPD+npibF8wd+xhSrLUE81wHIGfEWk7ZNO4p1t6Lx19PjYTCJLo5Oq+j6ceWrW2M9Vn4udvH2BkTrwjBSRTOIZQYHFw91R8MKT6jadKmnnb7bEWpjm7MBeTdf0jxcJIYlR4ydPHmE6+UEMYxa4RvM8GnBnbFwxygl+G9cduh8kPo/QgHFRBtEfdCjHpn5RooWz+xCvobgY3znvnrEZlj5f/AUxTdFjkdkfesA5IfgWqtaNwFBlvHtIwam8+9tLjBElbgVjVxoUiH+qB6atZshlOTbfSktH5pAdcHLNqan2nl/iHw7FsahWb1IzrZNBA/aEna2NqsEzuNjYz/68u7S//qQc6XR67wh6WBrR844uC1WF3DRGqkqtUmlVWA3wbKq61mksBtTtp+yGXQhklr5tz4nDfFwB6gkgKjSwJpt2SpTyp67Ce1mhJDHqVtlV1JgTNHCua/nw4k50tNeFCTZByL5o7V7ys0a7nAE0g7cvy6cCM0x9ihe+ZKyQvjHsBfKdYRTR2zIWMYzUtrOEwrAZl8cR5ITplXH0d6pRTmpaHh2JiT2wM9NHIcqSIQBGXtZtCrnshLChY3lg2n1OFdpGWjoUJE= Gruntfile.js000066400000000000000000000042331516074440300133610ustar00rootroot00000000000000module.exports = (grunt) => { const builder = require(`corifeus-builder`); const gruntUtil = builder.utils; const loader = new builder.loader(grunt); loader.js({ replacer: { type: 'p3x', npmio: false, }, config: { copy: { tweomji: { files: [ { cwd: 'node_modules/twemoji/2/svg', expand: true, src: [ '**', ], dest: `./dist/corifeus-app-web-pages/assets/twemoji/svg` }, ] }, }, 'cory-inject': { sass: { files: [ 'src/app/**/*.scss', '!src/app/modules/material/scss/**/*.**' ], dest: 'src/artifacts/style.scss', template: '@import \'${file}\';' } }, } }); grunt.registerTask('build', async function() { const done = this.async() const cwd = process.cwd() try { await gruntUtil.spawn({ grunt: grunt, gruntThis: this, }, { cmd: `${cwd}/node_modules/.bin/ng${gruntUtil.commandAddon}`, args: [ 'build', '--source-map=false', '--output-hashing=all', '--configuration=production', '--deploy-url=/', '--base-href=/', '--aot=true', '--build-optimizer=true', '--optimization=true' ] }); done() } catch(e) { done(e) } }) const defaults = [ 'cory-inject', 'cory-raw-npm-angular', 'build', 'copy', ]; const defaultTask = builder.config.task.build.js.concat(defaults) grunt.registerTask('default', defaultTask); } LICENSE000066400000000000000000000023221516074440300120660ustar00rootroot00000000000000 @license corifeus-app-web-pages v2021.4.102 🕸️ Corifeus App Web Pages https://corifeus.com/corifeus-app-web-pages Copyright (c) 2021 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.md000066400000000000000000000065621516074440300123520ustar00rootroot00000000000000[//]: #@corifeus-header [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://paypal.me/patrikx3) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Corifeus @ Facebook](https://img.shields.io/badge/Facebook-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) [![Build Status](https://github.com/patrikx3/corifeus-app-web-pages/workflows/nodejs/badge.svg)](https://github.com/patrikx3/corifeus-app-web-pages/actions?query=workflow%3Anodejs) [![Uptime Robot ratio (30 days)](https://img.shields.io/uptimerobot/ratio/m780749701-41bcade28c1ea8154eda7cca.svg)](https://uptimerobot.patrikx3.com/) # 🕸️ Corifeus App Web Pages v2021.4.102 **Bugs are evident™ - MATRIX️** ### NodeJs LTS Version Requirement ```txt >=12.13.0 ``` ### Built on NodeJs ```txt v14.15.5 ``` The ```async``` and ```await``` keywords are required. Only the latest LTS variant is supported. Install NodeJs: https://nodejs.org/en/download/package-manager/ # Built on Angular ```text 11.2.0 ``` # Description [//]: #@corifeus-header:end It is the common GitHub pages for all Corifeus projects. The Markdown rendering is off-loaded via a web worker. Non-blocking rendering, good for mobile clients. The code is splitted into multiple js chunks and using the script defer (deferred) loading. # More info [API](https://api.github.com/) [Repositories](https://api.github.com/users/patrikx3/repos) There is an error in TypeScript. The workaround is in ```tsconfig.json```: ```json { "compilerOptions": { "skipLibCheck": true } } ``` Should remove once it works. # `@Host()` decorator not working in Ivy https://github.com/angular/angular/issues/31539 Actually, I can inject the component without the `@Host` decorator. [//]: #@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-APP-WEB-PAGES**](https://corifeus.com/corifeus-app-web-pages) Build v2021.4.102 [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) ## P3X Sponsor [IntelliJ - The most intelligent Java IDE](https://www.jetbrains.com/?from=patrikx3) [![JetBrains](https://cdn.corifeus.com/assets/svg/jetbrains-logo.svg)](https://www.jetbrains.com/?from=patrikx3) [//]: #@corifeus-footer:end angular.json000066400000000000000000000073251516074440300134150ustar00rootroot00000000000000{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "corifeus-app-web-pages": { "projectType": "application", "schematics": { "@schematics/angular:component": { "style": "scss" } }, "root": "", "sourceRoot": "src", "prefix": "app", "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "allowedCommonJsDependencies": [ "js-cookie", "lodash" ], "outputPath": "dist/corifeus-app-web-pages", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", "aot": true, "assets": [ "src/favicon.ico", "src/assets" ], "styles": [ "src/styles.scss" ], "scripts": [], "webWorkerTsConfig": "tsconfig.worker.json" }, "configurations": { "production": { "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.prod.ts" } ], "optimization": true, "outputHashing": "all", "sourceMap": false, "namedChunks": false, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, "budgets": [ { "type": "initial", "maximumWarning": "2mb", "maximumError": "5mb" }, { "type": "anyComponentStyle", "maximumWarning": "6kb", "maximumError": "10kb" } ] } } }, "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { "browserTarget": "corifeus-app-web-pages:build" }, "configurations": { "production": { "browserTarget": "corifeus-app-web-pages:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { "browserTarget": "corifeus-app-web-pages:build" } }, "test": { "builder": "@angular-devkit/build-angular:karma", "options": { "main": "src/test.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.spec.json", "karmaConfig": "karma.conf.js", "assets": [ "src/favicon.ico", "src/assets" ], "styles": [ "src/styles.scss" ], "scripts": [] } }, "lint": { "builder": "@angular-eslint/builder:lint", "options": { "lintFilePatterns": [ "src/**/*.ts", "src/**/*.html" ] } }, "e2e": { "builder": "@angular-devkit/build-angular:protractor", "options": { "protractorConfig": "e2e/protractor.conf.js", "devServerTarget": "corifeus-app-web-pages:serve" }, "configurations": { "production": { "devServerTarget": "corifeus-app-web-pages:serve:production" } } } } } }, "defaultProject": "corifeus-app-web-pages" } artifacts/000077500000000000000000000000001516074440300130425ustar00rootroot00000000000000artifacts/reducing-bundle-size.txt000066400000000000000000000022031516074440300176170ustar00rootroot00000000000000ll public/ | grep "js\|css" 2020 May 16 - self built since 2016-2017 -r--r----- 1 www-data www-data 891K May 16 05:45 749937b58a89faf21170.worker.js -r--r----- 1 www-data www-data 150K May 16 05:45 2.5fedf88395f370ead8f9.chunk.js -r--r----- 1 www-data www-data 42K May 16 05:45 3.5fedf88395f370ead8f9.chunk.js -r--r----- 1 www-data www-data 2.0M May 16 05:45 bundle.5fedf88395f370ead8f9.js -r--r----- 1 www-data www-data 622K May 16 05:45 bundle.5fedf88395f370ead8f9.css -r--r----- 1 www-data www-data 58K May 16 05:45 polyfills.5fedf88395f370ead8f9.js 3811kb 2020 Okt 17 - convert using angular cli and removed a lot of unused code -rw-rw-r-- 1 patrikx3 patrikx3 90K Oct 17 19:48 0.171ca369b9bb50570d5a.worker.js -rw-rw-r-- 1 patrikx3 patrikx3 364K Oct 17 19:48 4.a7ac884577972514b424.js -rw-rw-r-- 1 patrikx3 patrikx3 347K Oct 17 19:48 main.5a7378c21d6cd947e41b.js -rw-rw-r-- 1 patrikx3 patrikx3 2,3K Oct 17 19:48 runtime.529f1c23827c0ef5c953.js -rw-rw-r-- 1 patrikx3 patrikx3 328K Oct 17 19:48 styles.a59bcada134f21237d00.css -rw-rw-r-- 1 patrikx3 patrikx3 37K Oct 17 19:48 polyfills.35a5ca1855eb057f016a.js 1168,3kb ~2642,7kb savings corifeus-app-web-pages.iml000066400000000000000000000005171516074440300160350ustar00rootroot00000000000000 e2e/000077500000000000000000000000001516074440300115355ustar00rootroot00000000000000e2e/protractor.conf.js000066400000000000000000000015451516074440300152230ustar00rootroot00000000000000// @ts-check // Protractor configuration file, see link for more information // https://github.com/angular/protractor/blob/master/lib/config.ts const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter'); /** * @type { import("protractor").Config } */ exports.config = { allScriptsTimeout: 11000, specs: [ './src/**/*.e2e-spec.ts' ], capabilities: { browserName: 'chrome' }, directConnect: true, baseUrl: 'http://localhost:4200/', framework: 'jasmine', jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 30000, print: function() {} }, onPrepare() { require('ts-node').register({ project: require('path').join(__dirname, './tsconfig.json') }); jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: StacktraceOption.PRETTY } })); } };e2e/src/000077500000000000000000000000001516074440300123245ustar00rootroot00000000000000e2e/src/app.e2e-spec.ts000066400000000000000000000012171516074440300150570ustar00rootroot00000000000000import { AppPage } from './app.po'; import { browser, logging } from 'protractor'; describe('workspace-project App', () => { let page: AppPage; beforeEach(() => { page = new AppPage(); }); it('should display welcome message', () => { page.navigateTo(); expect(page.getTitleText()).toEqual('corifeus-app-web-pages app is running!'); }); afterEach(async () => { // Assert that there are no errors emitted from the browser const logs = await browser.manage().logs().get(logging.Type.BROWSER); expect(logs).not.toContain(jasmine.objectContaining({ level: logging.Level.SEVERE, } as logging.Entry)); }); }); e2e/src/app.po.ts000066400000000000000000000004551516074440300140750ustar00rootroot00000000000000import { browser, by, element } from 'protractor'; export class AppPage { navigateTo(): Promise { return browser.get(browser.baseUrl) as Promise; } getTitleText(): Promise { return element(by.css('app-root .content span')).getText() as Promise; } } e2e/tsconfig.json000066400000000000000000000004461516074440300142500ustar00rootroot00000000000000/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/e2e", "module": "commonjs", "target": "es2018", "types": [ "jasmine", "jasminewd2", "node" ] } } karma.conf.js000066400000000000000000000020121516074440300134320ustar00rootroot00000000000000// Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), require('@angular-devkit/build-angular/plugins/karma') ], client: { clearContext: false // leave Jasmine Spec Runner output visible in browser }, coverageIstanbulReporter: { dir: require('path').join(__dirname, './coverage/corifeus-app-web-pages'), reports: ['html', 'lcovonly', 'text-summary'], fixWebpackSourcePaths: true }, reporters: ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], singleRun: false, restartOnFileChange: true }); }; package.json000066400000000000000000000061751516074440300133610ustar00rootroot00000000000000{ "name": "corifeus-app-web-pages", "version": "2021.4.102", "corifeus": { "icon": "fas fa-sitemap", "code": "Support", "cdn": true, "nodejs": "v14.15.4", "opencollective": false, "reponame": "corifeus-app-web-pages", "build": true, "angular": "11.1.1" }, "description": "🕸️ Corifeus App Web Pages", "scripts": { "ng": "ng", "start": "ng serve --hmr", "build": "grunt", "stats": "ng build --stats-json && webpack-bundle-analyzer dist/corifeus-app-web-pages/stats.json", "test": "npm run build", "lint": "ng lint", "e2e": "ng e2e", "postinstall": "node node_modules/corifeus-builder/src/utils/twemoji-install.js" }, "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/patrikx3/corifeus-app-web-pages.git" }, "keywords": [ "corifeus", "pages" ], "author": "Patrik Laszlo ", "bugs": { "url": "https://github.com/patrikx3/corifeus-app-web-pages/issues" }, "homepage": "https://corifeus.com/corifeus-app-web-pages", "dependencies": { "@angular/animations": "~11.2.0", "@angular/cdk": "^11.2.0", "@angular/common": "~11.2.0", "@angular/compiler": "~11.2.0", "@angular/core": "~11.2.0", "@angular/forms": "~11.2.0", "@angular/material": "^11.2.0", "@angular/platform-browser": "~11.2.0", "@angular/platform-browser-dynamic": "~11.2.0", "@angular/router": "~11.2.0", "@fortawesome/fontawesome-free": "^5.15.2", "@types/marked": "^1.2.2", "@types/node": "^14.14.27", "emoji-regex": "^9.2.1", "highlight.js": "^10.6.0", "js-cookie": "^2.2.1", "lodash": "^4.17.20", "marked": "=2.0.0", "material-design-icons": "^3.0.1", "mobile-detect": "^1.4.4", "rxjs": "~6.6.3", "tslib": "^2.0.3", "twemoji": "=13.0.1", "zone.js": "~0.10.3" }, "devDependencies": { "@angular-devkit/build-angular": "~0.1102.0", "@angular-eslint/builder": "1.2.0", "@angular-eslint/eslint-plugin": "1.2.0", "@angular-eslint/eslint-plugin-template": "1.2.0", "@angular-eslint/schematics": "1.2.0", "@angular-eslint/template-parser": "1.2.0", "@angular/cli": "~11.2.0", "@angular/compiler-cli": "~11.2.0", "@fontsource/roboto": "^4.2.1", "@fontsource/roboto-mono": "^4.2.1", "@types/jasmine": "~3.6.3", "@types/jasminewd2": "~2.0.8", "@types/js-cookie": "^2.2.6", "@types/lodash": "^4.14.168", "@types/node": "^14.14.27", "@typescript-eslint/eslint-plugin": "4.15.0", "@typescript-eslint/parser": "4.15.0", "codelyzer": "^6.0.1", "corifeus-builder": "^2021.4.106", "eslint": "^7.20.0", "eslint-plugin-import": "2.22.1", "eslint-plugin-jsdoc": "31.6.1", "eslint-plugin-prefer-arrow": "1.2.3", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~6.0.0", "karma": "~5.2.3", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.3", "karma-jasmine": "~4.0.1", "karma-jasmine-html-reporter": "^1.5.4", "protractor": "~7.0.0", "ts-node": "~9.1.1", "typescript": "~4.0.3" }, "engines": { "node": ">=12.13.0" } } src-save/000077500000000000000000000000001516074440300126055ustar00rootroot00000000000000src-save/app/000077500000000000000000000000001516074440300133655ustar00rootroot00000000000000src-save/app/modules/000077500000000000000000000000001516074440300150355ustar00rootroot00000000000000src-save/app/modules/material/000077500000000000000000000000001516074440300166335ustar00rootroot00000000000000src-save/app/modules/material/component/000077500000000000000000000000001516074440300206355ustar00rootroot00000000000000src-save/app/modules/material/component/cory-mat-http-404.ts000066400000000000000000000034331516074440300242250ustar00rootroot00000000000000import { Component, OnDestroy } from '@angular/core'; import { Subscription } from 'rxjs' import {LocaleService, LocaleSubject} from '../../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; subscriptions$: Array = [] 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.subscriptions$.push( this.locale.subscribe((data: LocaleSubject) => { this.i18n = data.locale.data; }) ) //this.url = State.RequestPath } ngOnDestroy() { this.subscriptions$.forEach(subs$ => subs$.unsubscribe()) clearInterval(this.letKeep404); clearTimeout(this.timeout) } } src-save/app/modules/material/component/cory-mat-translation/000077500000000000000000000000001516074440300247245ustar00rootroot00000000000000src-save/app/modules/material/component/cory-mat-translation/cory-mat-translation-button.ts000066400000000000000000000042531516074440300327000ustar00rootroot00000000000000import { Component, Input, OnDestroy, } from '@angular/core'; import { LocaleService, SettingsService, LocaleSubject, MediaQueryService, MediaQuerySettingType, MediaQuerySetting } from "../../../web"; import { Subscription } from 'rxjs' // requires to be in a mat-menu @Component({ selector: 'cory-mat-translation-button', template: ` `, }) export class TranslationButton implements OnDestroy { subscriptions$: Array = [] @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.subscriptions$.push( this.locale.subscribe((data: LocaleSubject) => { this.i18n = data.locale.data; this.setTooltip(); }) ) this.subscriptions$.push( 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; } } ngOnDestroy(): void { this.subscriptions$.forEach(subs$ => subs$.unsubscribe()) } } src-save/app/modules/material/component/cory-mat-translation/cory-mat-translation-menu.ts000066400000000000000000000035201516074440300323250ustar00rootroot00000000000000import { Component, Inject, OnDestroy, } from '@angular/core'; import { LocaleService, SettingsService, LocaleSubject } from "../../../web"; import { NotifyService } from '../../services/notify/notify'; import { Subscription } from 'rxjs' // requires to be in a mat-menu @Component({ selector: 'cory-mat-translation-menu', template: `
`, }) export class TranslationMenu implements OnDestroy { subscriptions$: Array = [] i18n: any; settings: any; constructor( private notify: NotifyService, public locale: LocaleService, protected settingsAll: SettingsService ) { this.settings = settingsAll.data.core; this.subscriptions$.push( 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) } ngOnDestroy(): void { this.subscriptions$.forEach(subs$ => subs$.unsubscribe()) } } src-save/app/modules/web/000077500000000000000000000000001516074440300156125ustar00rootroot00000000000000src-save/app/modules/web/modules/000077500000000000000000000000001516074440300172625ustar00rootroot00000000000000src-save/app/modules/web/modules/auth-token.ts000066400000000000000000000004471516074440300217160ustar00rootroot00000000000000export 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; } } src-save/app/modules/web/modules/auth.ts000066400000000000000000000037661516074440300206070ustar00rootroot00000000000000import { 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'; import { Token } from "./auth-token"; @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); } } src-save/app/modules/web/modules/index.ts000066400000000000000000000000671516074440300207440ustar00rootroot00000000000000//export * from './auth'; //export * from './ip-info'; src-save/app/modules/web/modules/ip-info.ts000066400000000000000000000005371516074440300212000ustar00rootroot00000000000000import {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://server.patrikx3.com/api/patrikx3/ipinfo/get').toPromise(); return response; } } src-save/app/modules/web/services/000077500000000000000000000000001516074440300174355ustar00rootroot00000000000000src-save/app/modules/web/services/http/000077500000000000000000000000001516074440300204145ustar00rootroot00000000000000src-save/app/modules/web/services/http/auth-interceptor.ts000066400000000000000000000154131516074440300242650ustar00rootroot00000000000000import { 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; } } */ src-save/app/modules/web/services/http/http-share.ts000066400000000000000000000020341516074440300230420ustar00rootroot00000000000000import {Injectable} from '@angular/core'; let booted = false; const data = { token: '', }; import {Token} from '../../modules/auth-token'; 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); } } src-save/app/modules/web/services/http/index.ts000066400000000000000000000001331516074440300220700ustar00rootroot00000000000000export * from './http-share'; export * from './state'; export * from './auth-interceptor'; src-save/app/modules/web/services/http/state.ts000066400000000000000000000003401516074440300221010ustar00rootroot00000000000000export interface StateInterface { NotFound: boolean, RequestPath: string, } let State: StateInterface = { NotFound: false, RequestPath: location.pathname + location.search + location.hash } export {State}; src/000077500000000000000000000000001516074440300116515ustar00rootroot00000000000000src/app/000077500000000000000000000000001516074440300124315ustar00rootroot00000000000000src/app/app.component.ts000066400000000000000000000002641516074440300155640ustar00rootroot00000000000000import { Component, } from '@angular/core'; @Component({ selector: 'cory-web-pages-app', template: ` ` }) export class Application { } src/app/app.module.ts000066400000000000000000000047361516074440300150570ustar00rootroot00000000000000import {NgModule, Injectable} from '@angular/core'; import {RouterModule} from '@angular/router'; import {Layout, Header, Footer} from './layout'; import {Status} from './component/cory-web-pages-build-status'; import {Page } from './page'; import {CdnService, MarkdownService} from './service'; import { appRoutes } from './app.routes'; import { GlobalService } from "./service/global.service"; import {LocaleService, SettingsService} from './modules/web'; import {CorifeusMaterialModule} from "./modules/material/index"; import { environment } from '../environments/environment'; import {HTTP_INTERCEPTORS} from "@angular/common/http"; import {HttpRequestCounterInterceptor} from "./http-request-counter.interceptor"; import {BrowserAnimationsModule} from "@angular/platform-browser/animations"; import { Application } from "./app.component"; import {BrowserModule} from "@angular/platform-browser"; import { PreloadAllModules } from '@angular/router'; import twemoji from 'twemoji' /*** * NEVER USE A EXPORT * AS, NEED THE EXACT COMPONENT FOR INJECTABLE FUNCTION!!!! */ @NgModule({ imports: [ BrowserModule, BrowserAnimationsModule, CorifeusMaterialModule, RouterModule.forRoot(appRoutes, { preloadingStrategy: PreloadAllModules, }), ], entryComponents: [], declarations: [ Application, Layout, Header, Footer, Page, // OpenCollective, Status ], providers: [ GlobalService, { provide: HTTP_INTERCEPTORS, useClass: HttpRequestCounterInterceptor, multi: true }, CdnService, MarkdownService, ], bootstrap: [ Application, ] }) export class AppModule { constructor( private loc: LocaleService, private settings: SettingsService, ) { twemoji.folder = 'svg'; twemoji.ext = '.svg'; if (environment.production) { twemoji.base = '/assets/twemoji/'; } let settingsExtendJson = require('./json/settings.core.json'); settings.extend('core', settingsExtendJson); settings.afterInit(); const module = 'pages'; const settingsJson = require('./json/settings.json'); settings.register(module, settingsJson); loc.register(module, { en: require('./json/translation/english.json'), // hu: require('./json/translation/hungarian.json'), }) } } src/app/app.routes.ts000066400000000000000000000015371516074440300151070ustar00rootroot00000000000000import {Routes} from '@angular/router'; import {Layout} from './layout'; import {Page} from './page/cory-page'; //import {OpenCollective} from './page/cory-open-collective'; //import {Http404} from './modules/material'; export const appRoutes: Routes = [ { path: ':repo', component: Layout, children: [ /* { path: '404', component: Http404 }, */ /* { path: 'open-collective', component: OpenCollective }, */ { path: '**', component: Page } ] }, { path: '', redirectTo: `/matrix`, // redirectTo: `/github/${settings.github.defaultRepo}`, pathMatch: 'full' }, ]; src/app/component/000077500000000000000000000000001516074440300144335ustar00rootroot00000000000000src/app/component/cory-web-pages-build-status.ts000066400000000000000000000111411516074440300222430ustar00rootroot00000000000000import { Component, Input, OnDestroy, } from '@angular/core'; import { Subscription } from 'rxjs' import {LocaleService, LocaleSubject} from "../modules/web"; @Component({ selector: 'cory-web-pages-build-status', styles: [` .cory-web-pages-build-status { position: relative; top: 3px; } `], template: ` {{ pkg.description }}     {{ i18n.pages.title.uptime }}       ` }) export class Status implements OnDestroy { subscriptions$: Array = [] @Input('cory-pkg') pkg: any; tooltipPosition: string = 'above' i18n: any constructor( protected locale: LocaleService, ) { this.subscriptions$.push( this.locale.subscribe((subject: LocaleSubject) => { this.i18n = subject.locale.data }) ) } ngOnDestroy(): void { this.subscriptions$.forEach(subs$ => subs$.unsubscribe()) } } src/app/http-request-counter.interceptor.ts000066400000000000000000000017021516074440300214600ustar00rootroot00000000000000import {Injectable, Injector, NgZone} from '@angular/core'; import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse} from '@angular/common/http'; import {Observable, of} from 'rxjs'; import {tap} from "rxjs/operators"; import { GlobalService } from "./service/global.service"; @Injectable() export class HttpRequestCounterInterceptor implements HttpInterceptor { constructor( private globalService: GlobalService ) { } intercept(httpRequest: HttpRequest, next: HttpHandler): Observable> { this.globalService.HttpCounter++; return next.handle(httpRequest).pipe( tap( (event: any) => { if (event.type !== 0) { this.globalService.HttpCounter--; } }, (err: any) => { this.globalService.HttpCounter--; } ) ) } } src/app/json/000077500000000000000000000000001516074440300134025ustar00rootroot00000000000000src/app/json/settings.core.json000066400000000000000000000002531516074440300170640ustar00rootroot00000000000000{ "server": { "url": "https://server.patrikx3.com" }, "integration": { "google": { "analytics": "UA-102164992-1" } } } src/app/json/settings.json000066400000000000000000000005251516074440300161370ustar00rootroot00000000000000{ "debounce": { "default": 250 }, "defaultDomain": [ "corifeus.com", "www.corifeus.com" ], "p3x": { "git": { "url": "https://server.patrikx3.com/api/patrikx3/git/repos" } }, "github": { "defaultRepo": "corifeus", "repoNames": "corifeus" } } src/app/json/translation/000077500000000000000000000000001516074440300157405ustar00rootroot00000000000000src/app/json/translation/english.json000066400000000000000000000043511516074440300202670ustar00rootroot00000000000000{ "title": { "searchNotFound": "No packages found for the query.", "ready": "Bugs are evident™ - MATRIX", "search": "Search", "developer": "Patrik Laszlo © ", "packages": "Packages", "sponsor": { "jetbrains": "JetBrains" }, "opencollective": { "label": "\uD83D\uDE4F️ With your donation you may support our development. Become a backer or a sponsor on Open Collective ... ", "backers": "Backers on Open Collective", "sponsors": "Sponsors on Open Collective" }, "home": "Matrix", "travis": "Travis Build status", "uptime": "Uptime Robot ratio (30 days)", "githubStars": "GitHub Stars", "scrunitizer": { "quality": "Scrutinizer Code Quality", "coverage": "Scrutinizer Code Coverage", "build": "Scrutinizer Build Status" }, "donate": "Donate to Corifeus / P3X", "contact": "Contact", "facebook": "Facebook" }, "url": { "contact": "https://www.patrikx3.com/en/front/contact" }, "badge": { "contact": "https://img.shields.io/badge/Contact-P3X-ff9900.svg", "donate": "https://img.shields.io/badge/Donate-Corifeus-003087.svg", "facebook": "https://img.shields.io/badge/Facebook-Corifeus-3b5998.svg" }, "opencollective": { "contributors": "Contributors", "contributorsMessage": "This project exists thanks to all the people who contribute.", "backers": "Backers", "backersMessage": "Thank you to all our backers!", "backersLink": "Become a backer", "sponsors": "Sponsors", "sponsorsMessage": "Support this project by becoming a sponsor. Your logo will show up here with a link to your website.", "sponsorsMessageLink": "Become a sponsor" }, "menu": { "menu-corifeus-code-style": "Code style", "menu-corifeus-architecture": "Architecture", "menu-corifeus-architecture-overview": "Overview", "menu-corifeus-patterns": "Patterns", "menu-corifeus-more": "More", "menu-corifeus-more-github": "Github pages", "menu-corifeus-more-origin": "Corifeus name origin" } } src/app/json/translation/hungarian.json000066400000000000000000000044011516074440300206060ustar00rootroot00000000000000{ "title": { "searchNotFound": "A lekérdezéshez nincsenek talált csomagok.", "ready": "A hibák eredetiek™ - MATRIX", "search": "Keresés", "developer": "Laszlo Patrik © ", "packages": "Csomagok", "sponsor": { "jetbrains": "JetBrains" }, "opencollective": { "label": "\uD83D\uDE4F️ Adományával támogathatja a fejlesztésünket. Legyen támogató vagy szponzor az Open Collective-on ...", "backers": "Backers az Open Collective-on", "sponsors": "Szponzorok az Open Collective-on" }, "home": "Matrix", "travis": "Travis Kiépítettség", "uptime": "Uptime Robot hányados (30 nap)", "githubStars": "GitHub Csillagok", "scrunitizer": { "quality": "Scrutinizer kód minőség", "coverage": "Scrutinizer Kódlefedettséget", "build": "Scrutinizer Kiépítettség" }, "donate": "Adományozzon a Corifeus / P3X-nak", "contact": "Kapcsolat", "facebook": "Facebook" }, "url": { "contact": "https://www.patrikx3.com/hu/ajto/kapcsolat" }, "badge": { "contact": "https://img.shields.io/badge/Kapcsolat-P3X-ff9900.svg", "donate": "https://img.shields.io/badge/Adományozzon-Corifeus-003087.svg", "facebook": "https://img.shields.io/badge/Facebook-Corifeus-3b5998.svg" }, "opencollective": { "contributors": "Közreműködők", "contributorsMessage": "Az alábbi emberek dolgoztak ebben a projektben.", "backers": "Támogatók", "backersMessage": "Köszönjük a támogatást!", "backersLink": "Legyél támogató", "sponsors": "Szponzorok", "sponsorsMessage": "Legyél szponzor és a logódat megjelentítjük.", "sponsorsMessageLink": "Legyél szponzor" }, "menu": { "menu-corifeus-code-style": "Kód stílus", "menu-corifeus-architecture": "Szerkezet", "menu-corifeus-architecture-overview": "Áttekintés", "menu-corifeus-patterns": "Minták", "menu-corifeus-more": "Több", "menu-corifeus-more-github": "Github oldalok", "menu-corifeus-more-origin": "Corifeus név eredete " } } src/app/layout/000077500000000000000000000000001516074440300137465ustar00rootroot00000000000000src/app/layout/cory-layout.html000066400000000000000000000131001516074440300171160ustar00rootroot00000000000000
v{{ packageJson.version }}
 {{ extractStars(packageJson.corifeus.stargazers_count) }}


Built on Angular v{{packageJson.corifeus.angular}}

src/app/layout/cory-layout.scss000066400000000000000000000010511516074440300171270ustar00rootroot00000000000000#cory-pages-layout-menu-main-icon { float: left; min-width: 24px !important; display: inline-block; text-align: center; position: relative; left: -7px; } .cory-pages-layout-menu-main-title { display: inline-block; max-width: 240px !important; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; } #cory-pages-layout-menu-main-close { position: fixed; top: 5px; right: 15px; z-index: 3 } .cory-layout-search-field .mat-form-field-infix { border-top: 0px solid transparent; } src/app/layout/cory-layout.ts000066400000000000000000000262521516074440300166140ustar00rootroot00000000000000import { Component, Injectable, ViewEncapsulation, ViewChild, NgZone, OnInit, ElementRef, ChangeDetectorRef, OnDestroy, } from '@angular/core'; import { ActivatedRoute, } from '@angular/router'; import debounce from 'lodash/debounce' import { Subscription } from 'rxjs' import { MatSidenav } from '@angular/material/sidenav' import { RouterService, } from '../modules/web'; import {HttpClient} from '@angular/common/http'; const emojiRegex = require('emoji-regex/es2015/index.js'); import {LocaleService, LocaleSubject, SettingsService} from '../modules/web'; import {NotifyService} from '../modules/material'; import {extractStars, extractTitle} from '../utils/extrac-title'; import {extractTitleWithStars} from '../utils/extrac-title'; import {isMobile} from '../utils/is-mobile'; //import {clearTimeout} from "timers"; /* import { DomSanitizer, } from '@angular/platform-browser'; */ import twemoji from 'twemoji' //FIXME corifeus - matrix const regexFixCorifeusMatrix = /^(\/)?(corifeus)([^-])(\/)?(.*)/ declare global { interface Window { coryAppWebPagesNavigate: any, coryAppWebPagesNavigateHash: any, } } @Component({ selector: 'cory-layout', templateUrl: 'cory-layout.html', encapsulation: ViewEncapsulation.None }) @Injectable() export class Layout implements OnInit, OnDestroy { subscriptions$: Array = [] private debounceSearchText: Function; menuMenuActive: any; menuRepoActive: any searchText: string; extractTitle = extractTitle; @ViewChild('menuSidenav', {read: MatSidenav, static: true}) public menuSidenav: MatSidenav; @ViewChild('searchText', {read: ElementRef, static: true}) public searchTextInputRefRead: ElementRef; currentRepo: string; body = document.getElementsByTagName('body')[0]; i18n: any; config: any; repos: any[]; packages: any; settings: any; packageJson: any = { version: undefined, corifeus: { ['time-stamp']: undefined, code: '', publish: false, } } title: string; icon: string; noScript: any; public isMobile: boolean = false; constructor( private router: RouterService, private route: ActivatedRoute, protected notify: NotifyService, private http: HttpClient, protected locale: LocaleService, protected settingsAll: SettingsService, private zone: NgZone, // private sanitizer: DomSanitizer, private ref: ChangeDetectorRef ) { this.isMobile = isMobile(); this.settings = settingsAll.data.pages; this.currentRepo = this.settings.github.defaultRepo; this.subscriptions$.push( this.locale.subscribe((data: LocaleSubject) => { this.i18n = data.locale.data.pages; }) ) this.noScript = document.getElementById('cory-seo'); this.subscriptions$.push( this.route.params.subscribe((params) => { let repo = params.repo if (repo === 'corifeus' && repo === location.pathname.slice(1)) { return this.navigate('matrix') } this.currentRepo = repo if (params.repo === undefined) { this.currentRepo = this.settings.github.defaultRepo; } this.load(); /* if (!location.pathname.endsWith('.html')) { this.navigate(); } */ }) ) } ngOnInit() { this.debounceSearchText = debounce(this.handleSearch, this.settings.debounce.default) } handleSearch(searchText: string) { this.searchText = searchText.trim(); } get reposSearch(): Array { if (this.searchText === '' || this.searchText === undefined) { return this.repos; } const regexes: Array = []; this.searchText.split(/[\s,]+/).forEach(search => { if (search === '') { return; } regexes.push( new RegExp('.*' + search + '.*', 'i') ) }) return Object.values(this.packages).filter( (pkg: any) => { let found = false; for (let regex of regexes) { if (regex.test(pkg.name) || regex.test(pkg.corifeus.reponame) || regex.test(pkg.corifeus.code)) { found = true; break; } } return found; }).map((pkg : any) => pkg.corifeus.reponame) } async load() { if (this.packages === undefined) { const response: any = await this.http.get(this.settings.p3x.git.url).toPromise() this.packages = response.repo; let sortedObject = {} sortedObject = Object.keys(this.packages).sort((a, b) => { return this.packages[b].corifeus.stargazers_count - this.packages[a].corifeus.stargazers_count }).reduce((prev, curr, i) => { prev[i] = this.packages[curr] return prev }, {}) this.packages = {}; Object.keys(sortedObject).forEach(key => { const item = sortedObject[key] if (item.corifeus.prefix !== undefined) { this.packages[item.name.substr(item.corifeus.prefix.length)] = item; } else { this.packages[item.name] = item; } }) this.ref.markForCheck() this.repos = Object.keys(this.packages); } if (!this.packages.hasOwnProperty(this.currentRepo)) { this.currentRepo = 'corifeus'; } this.packageJson = this.packages[this.currentRepo]; this.title = this.packageJson.description; this.icon = this.packageJson.corifeus.icon !== undefined ? `${this.packageJson.corifeus.icon}` : 'fas fa-bolt'; document.title = this.title.replace(emojiRegex(), ''); this.noScript.innerHTML = ''; this.repos.forEach((repo: any) => { const a = document.createElement('a'); a.href = `/${repo === 'corifeus' ? 'matrix' : repo}`; a.innerText = repo; this.noScript.appendChild(a) const a2 = document.createElement('a'); a2.href = `https://github.com/patrikx3/${repo}`; a2.innerText = 'Github ' + repo; this.noScript.appendChild(a2) }) window.coryAppWebPagesNavigate = (path?: string) => { this.zone.run(() => { if (path.includes('#')) { const hashIndex = path.indexOf('#') const pathMainPath = path.substring(0, hashIndex) const hash = path.substring(hashIndex + 1) this.navigate(pathMainPath); window.coryAppWebPagesNavigateHash(hash) } else { this.navigate(path); } }); }; window.coryAppWebPagesNavigateHash = (id: any) => { const scroll = (id: string) => { const el = document.getElementById(id); if (el === null) { return; } el.scrollIntoView({ block: "center", }) } if (typeof id === 'string') { const hash = `#${id.replace(/-parent$/, '')}`; if (history.pushState) { history.pushState(null, null, `${location.pathname}${hash}`); } else { location.hash = hash; } scroll(id); } else { id = `${id.id}`; setTimeout(() => { scroll(id) }, 500) } return false; } document.getElementById('cory-mat-pages-title').innerHTML = this.renderTwemoji(this.packageJson.description) } async navigate(path?: string) { if (path === undefined) { path = `${this.currentRepo}/index.html`; } //FIXME corifeus - matrix //console.log(' ') //console.log(path) if (regexFixCorifeusMatrix.test(path)) { path = path.replace(regexFixCorifeusMatrix, 'matrix$3$5') //console.log(1, RegExp.$1, 2, RegExp.$2, 3, RegExp.$3, 4, RegExp.$4, 5, RegExp.$5, 6, RegExp.$6, 7, RegExp.$7) //console.log('match', path) } this.menuMenuActive = ''; //console.log('cory-layout', path); this.router.navigateTop([path]); } isOpenWrt() { return this.packageJson !== undefined && this.packageJson.corifeus !== undefined && this.packageJson.corifeus.hasOwnProperty('type') && this.packageJson.corifeus.type === 'openwrt'; } packageMenuClose() { // this.body.style.overflowY = 'auto'; this.menuSidenav.close(); } packageMenuOpen() { // this.body.style.overflowY = 'hidden'; this.menuSidenav.open(); setTimeout(() => { if (this.isMobile) { this.searchTextInputRefRead.nativeElement.blur() } // /** const e = document.querySelector('.cory-mat-menu-item-active') if (e) { // e.scrollIntoView(true); // const viewportH = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); // window.scrollBy(0, (e.getBoundingClientRect().height-viewportH)/2); e.scrollIntoView({ block: "center", }); } // **/ }, 500) } search(searchText: string) { this.debounceSearchText(searchText); } renderTwemoji(text: string) { return !text ? text : twemoji.parse(text, { folder: 'svg', ext: '.svg', }) } keyDownFunction(event: any) { const repos = this.reposSearch; if (event.keyCode == 13 && repos.length === 1) { this.zone.run(() => { const navigate = `/${repos[0]}/index.html` this.debounceSearchText(''); this.searchTextInputRefRead.nativeElement.blur() this.searchTextInputRefRead.nativeElement.value = ''; this.packageMenuClose(); this.navigate(navigate); }); } } get showTitle() { const pathname = location.pathname.toLowerCase() const pieces = pathname.split('/') // console.log(pieces) const showTitle = pieces.length === 2 || (pieces.length === 3 && pieces[2] === 'index.html') // const showTitle = pathname.endsWith('index.html') || (!pathname.includes('.') && !pathname.includes('open-collective')); return showTitle; } extractTitleWithStars(pkg: any) { const title = extractTitleWithStars(pkg); return title; } extractStars(stars: number) { return extractStars(stars) } ngOnDestroy(): void { this.subscriptions$.forEach(subs$ => subs$.unsubscribe()) } } src/app/layout/footer/000077500000000000000000000000001516074440300152445ustar00rootroot00000000000000src/app/layout/footer/cory-layout-footer.html000066400000000000000000000047731516074440300217300ustar00rootroot00000000000000 src/app/layout/footer/cory-layout-footer.scss000066400000000000000000000007521516074440300217300ustar00rootroot00000000000000cory-layout-footer { .cory-mat-footer { .cory-layout-footer-container { position: relative; top: -3px; } } .cory-pages-footer-shrink-text { @media screen and (min-width: 600px) and (max-width: 840px) { display: none !important; } } .cory-pages-footer-shrink-icon { @media screen and (min-width: 600px) and (max-width: 840px) { min-width: 0px !important; } } } src/app/layout/footer/cory-layout-footer.ts000066400000000000000000000107751516074440300214110ustar00rootroot00000000000000import { Component, Injectable, Host, OnDestroy, } from '@angular/core'; import { DomSanitizer, SafeUrl, } from '@angular/platform-browser'; import { Subscription } from 'rxjs' import { LocaleService, SettingsService, LocaleSubject, decodeEntities, MediaQueryService, MediaQuerySettingType, MediaQuerySetting } from "../../modules/web"; import {NotifyService, ThemeService} from '../../modules/material'; import {Layout} from "../cory-layout"; class Tooltip { GitHub: string = ''; Npm: string = ''; Translation: string = ''; Theme: string = ''; Developer: string = ''; JetBrains: string = ''; } @Component({ selector: 'cory-layout-footer', templateUrl: 'cory-layout-footer.html', }) @Injectable() export class Footer implements OnDestroy { subscriptions$: Array = [] unsubscribeMediaQuery : Function npmSvg: SafeUrl; jetbrainsSvg: SafeUrl; settings: any; i18n: any; linkJetBrains: string = "https://www.jetbrains.com/?from=patrikx3" decodeEntities: Function = decodeEntities; tooltip: Tooltip = new Tooltip() tooltipPosition: string = 'left' currentWidthAlias: string; currentYear = new Date().getFullYear(); constructor( private notify: NotifyService, private theme: ThemeService, protected locale: LocaleService, protected settingsAll: SettingsService, private mediaQuery: MediaQueryService, private domSanitizer: DomSanitizer, public parent: Layout, ) { this.settings = settingsAll.data.pages; const npmSvg = require('../../../artifacts/npm-logo.svg') const jetbrainsSvg = require('../../../artifacts/jetbrains-logo.svg') this.npmSvg = this.domSanitizer.bypassSecurityTrustUrl(npmSvg.default) this.jetbrainsSvg = this.domSanitizer.bypassSecurityTrustUrl(jetbrainsSvg.default) this.subscriptions$.push( this.locale.subscribe((data: LocaleSubject) => { this.i18n = data.locale.data; this.setTooltip(); }) ) this.unsubscribeMediaQuery = this.mediaQuery.register([ { name: 'pages-small', min: 0, max: 599, type: MediaQuerySettingType.Width }, { name: 'pages-medium', min: 600, max: 840, type: MediaQuerySettingType.Width }, { name: 'pages-large', min: 841, max: Infinity, type: MediaQuerySettingType.Width }, ]) this.subscriptions$.push( 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 'pages-small': this.tooltip.GitHub = 'GitHub'; this.tooltip.Npm = 'NPM'; this.tooltip.Developer = decodeEntities(this.i18n.pages.title.developer + ' ' + this.currentYear); this.tooltip.JetBrains = decodeEntities(this.i18n.pages.title.sponsor.jetbrains); break; case 'pages-medium': this.tooltip.GitHub = ""; this.tooltip.Npm = ""; this.tooltip.Developer = decodeEntities(this.i18n.pages.title.developer + ' ' + this.currentYear); this.tooltip.JetBrains = decodeEntities(this.i18n.pages.title.sponsor.jetbrains); break; case 'pages-large': default: this.tooltip.GitHub = ""; this.tooltip.Npm = ""; this.tooltip.Developer = ""; this.tooltip.JetBrains = ""; break; } } public get linkDeveloper() { return `http://patrikx3.com/${this.locale.current}`; } public get linkNpm() { return `https://www.npmjs.com/package/${this.parent.packageJson.name}`; } public get linkGithub() { return `https://github.com/patrikx3/${this.parent.currentRepo}`; } ngOnDestroy(): void { this.unsubscribeMediaQuery() this.subscriptions$.forEach(subs$ => subs$.unsubscribe()) } } src/app/layout/header/000077500000000000000000000000001516074440300151765ustar00rootroot00000000000000src/app/layout/header/cory-layout-header.html000066400000000000000000000110561516074440300216040ustar00rootroot00000000000000
{{ this.settings.github.repoNames }} {{ parent.packageJson.corifeus.type }} {{ parent.packageJson.corifeus.code }}
src/app/layout/header/cory-layout-header.scss000066400000000000000000000017261516074440300216160ustar00rootroot00000000000000.cory-layout-header-top { opacity: 0.25; font-size: 12px; position: relative; top: 15px; left: -45px; z-index: 10; .cory-layout-header-top-p3x { text-transform: uppercase; } @media screen and (max-width: $cory-mat-size-small) { top: 15px; } } .cory-layout-header-title { font-size: 30px !important; overflow: hidden; text-overflow: ellipsis; position: relative; top: -5px; @media screen and (max-width: 800px) { font-size: 16px !important; } } /* @media screen and (max-width: 700px) { font-size: 16px !important; } */ .cory-pages-layout-header-title { margin-left: 5px; display: inline-block; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; @media screen and (min-width: 400px) and (max-width: 1000px) { max-width: 500px !important; } @media screen and (max-width: 399px) { max-width: 220px !important; } } src/app/layout/header/cory-layout-header.ts000066400000000000000000000032321516074440300212630ustar00rootroot00000000000000import { Component, Host, OnDestroy, } from '@angular/core'; import capitalize from 'lodash/capitalize'; import { Router, } from '@angular/router'; import {LocaleService, SettingsService, LocaleSubject} from "../../modules/web"; import {extractTitle} from '../../utils/extrac-title'; import {Layout} from "../cory-layout"; import { Subscription } from 'rxjs' @Component({ selector: 'cory-layout-header', templateUrl: 'cory-layout-header.html', }) export class Header implements OnDestroy { subscriptions$: Array = [] header: string; i18n: any; settings: any; extractTitle = extractTitle; constructor( private router: Router, protected locale: LocaleService, protected settingsAll: SettingsService, public parent: Layout, ) { this.settings = settingsAll.data.pages; this.subscriptions$.push( this.locale.subscribe((data: LocaleSubject) => { this.i18n = data.locale.data; }) ) this.header = capitalize(this.settings.github.repoNames); } linkExternal(link: string) { return link.startsWith('http'); } navigateMenu(link: string) { if (this.linkExternal(link)) { return window.open(link); } this.parent.navigate('/' + this.parent.currentRepo + '/' + link); } generateIcon() { return ``; } extractTitleWithStars(pkg: any) { return this.parent.extractTitleWithStars(pkg); } ngOnDestroy(): void { this.subscriptions$.forEach(subs$ => subs$.unsubscribe()) } } src/app/layout/index.ts000066400000000000000000000002161516074440300154240ustar00rootroot00000000000000export {Header} from "./header/cory-layout-header"; export {Footer} from "./footer/cory-layout-footer"; export {Layout} from "./cory-layout"; src/app/modules/000077500000000000000000000000001516074440300141015ustar00rootroot00000000000000src/app/modules/material/000077500000000000000000000000001516074440300156775ustar00rootroot00000000000000src/app/modules/material/boot.ts000066400000000000000000000030221516074440300172070ustar00rootroot00000000000000import { Injectable, Inject, } from '@angular/core'; import { log } from './log'; import { ThemeService, } from './services/theme'; import { SettingsService, LocaleService } from '../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); */ } } src/app/modules/material/component/000077500000000000000000000000001516074440300177015ustar00rootroot00000000000000src/app/modules/material/component/cory-mat-loading.ts000066400000000000000000000011221516074440300234130ustar00rootroot00000000000000import { Input, Component, } from '@angular/core'; import { GlobalService} from "../../../service/global.service"; @Component({ selector: 'cory-mat-loading', template: ` `, }) export class Loading { @Input('cory-visible') visible: boolean = false; constructor( public globalService: GlobalService ) { // console.log(this.visible); } } src/app/modules/material/component/cory-mat-theme/000077500000000000000000000000001516074440300225345ustar00rootroot00000000000000src/app/modules/material/component/cory-mat-theme/cory-mat-theme-button.ts000066400000000000000000000043521516074440300272540ustar00rootroot00000000000000import { Component, Input, OnDestroy, } from '@angular/core'; import { Subscription } from 'rxjs' import { LocaleService, SettingsService, LocaleSubject, MediaQueryService, MediaQuerySettingType, MediaQuerySetting } from "../../../web"; // requires to be in a mat-menu @Component({ selector: 'cory-mat-theme-button', template: ` `, }) export class ThemeButton implements OnDestroy { subscriptions$: Array = [] @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.subscriptions$.push( this.locale.subscribe((data: LocaleSubject) => { this.i18n = data.locale.data; this.setTooltip(); }) ) this.subscriptions$.push( 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; } } ngOnDestroy(): void { this.subscriptions$.forEach(subs$ => subs$.unsubscribe()) } } src/app/modules/material/component/cory-mat-theme/cory-mat-theme-menu.ts000066400000000000000000000052331516074440300267040ustar00rootroot00000000000000import { Component, Inject, OnDestroy, } from '@angular/core'; import { LocaleService, SettingsService, LocaleSubject } from "../../../web"; import { ThemeService } from '../../services/theme'; import { NotifyService } from '../../services/notify/notify'; import template from 'lodash/template'; import { Subscription } from 'rxjs' // requires to be in a mat-menu @Component({ selector: 'cory-mat-theme-menu', template: `
`, }) export class ThemeMenu implements OnDestroy { subscriptions$: Array = [] i18n: any; settings: any; constructor( private notify: NotifyService, public theme: ThemeService, public locale: LocaleService, protected settingsAll: SettingsService ) { this.settings = settingsAll.data.material; this.subscriptions$.push( 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') }) } ngOnDestroy(): void { this.subscriptions$.forEach(subs$ => subs$.unsubscribe()) } } src/app/modules/material/component/index.ts000066400000000000000000000006761516074440300213710ustar00rootroot00000000000000export { 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'; */ src/app/modules/material/index.ts000066400000000000000000000002441516074440300173560ustar00rootroot00000000000000export * from './component'; export * from './module'; export * from './services'; export * from './log'; export * from './boot'; export * from './services'; src/app/modules/material/json/000077500000000000000000000000001516074440300166505ustar00rootroot00000000000000src/app/modules/material/json/settings.json000066400000000000000000000012671516074440300214110ustar00rootroot00000000000000{ "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." } } } src/app/modules/material/json/translation/000077500000000000000000000000001516074440300212065ustar00rootroot00000000000000src/app/modules/material/json/translation/english.json000066400000000000000000000024501516074440300235330ustar00rootroot00000000000000{ "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}." } } } src/app/modules/material/json/translation/hungarian.json000066400000000000000000000025321516074440300240570ustar00rootroot00000000000000{ "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}." } } } src/app/modules/material/log.ts000066400000000000000000000001471516074440300170320ustar00rootroot00000000000000import {log} from '../web'; const logMaterial = log.factory('material'); export {logMaterial as log}; src/app/modules/material/module.ts000066400000000000000000000133161516074440300175400ustar00rootroot00000000000000import {NgModule, ModuleWithProviders} from '@angular/core'; import {CorifeusModule} from '../web/module'; 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 { MatSidenavModule, } from '@angular/material/sidenav'; import {MatInputModule,} from '@angular/material/input' 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' import { GlobalService} from "../../service/global.service"; /* 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, MatInputModule, MatSidenavModule, // material modules ], declarations: [ NotifyComponent, // OverlayContainer, Loading, ThemeMenu, ThemeButton, // TranslationMenu, // TranslationButton, // Http404, ], // do not need export providers providers: [ GlobalService, 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, MatInputModule, MatSidenavModule, Loading, ThemeMenu, ThemeButton, // TranslationMenu, // TranslationButton, // Http404, ], entryComponents: [ NotifyComponent, // OverlayContainer, ] }) export class CorifeusMaterialModule { constructor(boot: Boot) { } public static forRoot(): ModuleWithProviders { return { ngModule: CorifeusMaterialModule, // providers: providers, }; } } src/app/modules/material/scss/000077500000000000000000000000001516074440300166525ustar00rootroot00000000000000src/app/modules/material/scss/_all.scss000066400000000000000000000007541516074440300204640ustar00rootroot00000000000000@import '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); } } src/app/modules/material/scss/material/000077500000000000000000000000001516074440300204505ustar00rootroot00000000000000src/app/modules/material/scss/material/_all.scss000066400000000000000000000045441516074440300222630ustar00rootroot00000000000000$mat-theme-ignore-duplication-warnings: true; /* @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 '~@fortawesome/fontawesome-free/css/all.css'; @import '~@angular/material/theming'; @include mat-core(); @import 'variables'; @import 'mixins'; @import 'material-customization'; @import 'hover'; @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; } src/app/modules/material/scss/material/_hover.scss000066400000000000000000000014431516074440300226310ustar00rootroot00000000000000.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, mat-icon:hover, .fa:hover, .fas:hover, .fab:hover, .far:hover, button:hover .fa, button:hover .fas, button:hover .fab, button:hover .far, a:hover .fa, a:hover .fas, a:hover .fab, a:hover .far { 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;; } } src/app/modules/material/scss/material/_material-customization.scss000066400000000000000000000003201516074440300262030ustar00rootroot00000000000000 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; } src/app/modules/material/scss/material/_mixins.scss000066400000000000000000000237061516074440300230230ustar00rootroot00000000000000@mixin cory-mat-theme-link($color, $hover) { mat-card { a { position: relative; color: $color; text-decoration: none; } a:hover { color: $hover; text-decoration: underline; } a.cory-md-link:hover { text-decoration: none; } a.cory-md-link::before { content: ""; position: absolute; width: 100%; height: 1px; bottom: -1px; left: 0; background-color: $hover; visibility: hidden; transform: scaleX(0); transition: all 0.3s ease-in-out 0s; } a.cory-md-link:hover::before { visibility: visible; transform: scaleX(1); } } } @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(); .mat-tooltip { /* your own custom styles here */ /* e.g. */ background-color: rgba(0, 0, 0, 0.8); } } src/app/modules/material/scss/material/_toolbar.scss000066400000000000000000000002521516074440300231450ustar00rootroot00000000000000.mat-toolbar.mat-primary.cory-mat-toolbar-clear { background: none !important; margin: 0px !important; padding: 0px !important; height: 0px !important; } src/app/modules/material/scss/material/_variables.scss000066400000000000000000000003501516074440300234520ustar00rootroot00000000000000$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; src/app/modules/material/scss/material/theme/000077500000000000000000000000001516074440300215525ustar00rootroot00000000000000src/app/modules/material/scss/material/theme/_cory-mat-theme-dark-matrix.scss000066400000000000000000000217621516074440300276720ustar00rootroot00000000000000@import '~@angular/material/theming'; @import "../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, ) ); $mat-matrixaccent: $mat-lime; $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, 500), 0.1), //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, ); $theme_reverse2: mat-light-theme($accent, $primary, $warn); // @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_reverse2); @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)); /* background-image: url("/assets/wallpaper-matrix.jpg"); background-repeat: repeat; */ // @include cory-mat-theme('dark', $primary, $accent); .mat-tooltip { /* your own custom styles here */ /* e.g. */ background-color: rgba(map_get($mat-green, 900), 0.5); } /* .mat-button:focus { outline: -webkit-focus-ring-color auto 1px; } */ /* .mat-button:focus { background-color: rgba(map_get($mat-green, 900), 0.25); } */ .cory-mat-menu-item-active, .cory-mat-menu-item-active:hover { background-color: rgba(map_get($mat-matrix, 700), 0.25) !important; } } #cory-pages-layout-theme-matrix { // $toolbar-height: 62px; position: absolute; // top: $toolbar-height; top: 0px; left: 0px; width: 100%; height: 100%; z-index: -1; pointer-events: none; } src/app/modules/material/scss/material/theme/_cory-mat-theme-dark-pink-bluegray.scss000066400000000000000000000004171516074440300311310ustar00rootroot00000000000000@import '~@angular/material/theming'; @import "../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); } src/app/modules/material/scss/material/theme/_cory-mat-theme-dark-purple-green.scss000066400000000000000000000004131516074440300307610ustar00rootroot00000000000000@import '~@angular/material/theming'; @import "../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); } src/app/modules/material/scss/material/theme/_cory-mat-theme-dark-wood.scss000066400000000000000000000003521516074440300273260ustar00rootroot00000000000000@import '~@angular/material/theming'; @import "../mixins"; .cory-mat-theme-dark-wood { $primary: mat-palette($mat-brown); $accent: mat-palette($mat-orange, 700); @include cory-mat-theme('dark', $primary, $accent); } src/app/modules/material/scss/material/theme/_cory-mat-theme-light-beach.scss000066400000000000000000000004041516074440300276040ustar00rootroot00000000000000@import '~@angular/material/theming'; @import "../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); } src/app/modules/material/scss/material/theme/_cory-mat-theme-light-deeppurple-amber.scss000066400000000000000000000004071516074440300317760ustar00rootroot00000000000000@import '~@angular/material/theming'; @import "../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); } src/app/modules/material/scss/material/theme/_cory-mat-theme-light-facebook.scss000066400000000000000000000025531516074440300303220ustar00rootroot00000000000000@import '~@angular/material/theming'; @import "../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); } src/app/modules/material/scss/material/theme/_cory-mat-theme-light-forest.scss000066400000000000000000000003721516074440300300500ustar00rootroot00000000000000@import '~@angular/material/theming'; @import "../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); } src/app/modules/material/scss/material/theme/_cory-mat-theme-light-indigo-pink.scss000066400000000000000000000003751516074440300307610ustar00rootroot00000000000000@import '~@angular/material/theming'; @import "../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); } src/app/modules/material/services/000077500000000000000000000000001516074440300175225ustar00rootroot00000000000000src/app/modules/material/services/index.ts000066400000000000000000000001431516074440300211770ustar00rootroot00000000000000export * from './notify/notify'; export * from './notify/notify-component' export * from './theme';src/app/modules/material/services/notify/000077500000000000000000000000001516074440300210325ustar00rootroot00000000000000src/app/modules/material/services/notify/notify-component.ts000066400000000000000000000045561516074440300247240ustar00rootroot00000000000000import { Injectable, Component, AfterViewInit, ViewChild, ElementRef, HostListener, Inject, OnDestroy, } from '@angular/core'; import {ThemeService} from '../theme' import {MAT_SNACK_BAR_DATA, MatSnackBarRef} from '@angular/material/snack-bar'; import { Subscription } from 'rxjs' import { DomSanitizer } from '@angular/platform-browser' import {LocaleService, LocaleSubject} from '../../../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 OnDestroy { // @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; subscriptions$: Array = [] constructor( public ctx: MatSnackBarRef, private locale: LocaleService, private theme: ThemeService, @Inject(MAT_SNACK_BAR_DATA) data: any, private _sanitizer: DomSanitizer, ) { this.subscriptions$.push( this.locale.subscribe((subject: LocaleSubject) => { this.i18n = subject.locale.data.material; }) ) this.data = data; } @HostListener('window:keydown', ['$event']) onKeyDown(event: Event) { // if (!isDevMode()) { this.ctx.dismiss(); // } } transformHtml(html: string): any { return this._sanitizer.bypassSecurityTrustHtml(html); } ngOnDestroy(): void { this.subscriptions$.forEach(subs$ => subs$.unsubscribe()) } } src/app/modules/material/services/notify/notify.ts000066400000000000000000000036001516074440300227110ustar00rootroot00000000000000import { Injectable, OnDestroy, } from '@angular/core'; import { environment } from '../../../../../environments/environment'; const isDevMode = () => { return !environment.production } import {MatSnackBar, MatSnackBarConfig} from '@angular/material/snack-bar'; import {LocaleService, LocaleSubject} from '../../../web'; import {NotifyComponent} from './notify-component' const duration = isDevMode() ? 100000 : 3000; export interface NotifyOptions { icon: string, } import { Subscription } from 'rxjs' @Injectable() export class NotifyService implements OnDestroy { i18n: any; subscriptions$: Array = [] constructor( private snackBar: MatSnackBar, private locale: LocaleService, ) { this.subscriptions$.push( 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); } ngOnDestroy(): void { this.subscriptions$.forEach(subs$ => subs$.unsubscribe()) } } src/app/modules/material/services/theme.ts000066400000000000000000000333331516074440300212010ustar00rootroot00000000000000import {Injectable,} from '@angular/core'; import kebabCase from 'lodash/kebabCase'; import {CookieService, SettingsService} from '../../web'; //import {OverlayContainer} from '@angular/material'; export type ThemeType = "dark" | "light"; import debounce from 'lodash/debounce' const MobileDetect = require('mobile-detect') const md = new MobileDetect(window.navigator.userAgent); const isMobile = md.mobile() !== null || md.phone() !== null || md.tablet() !== null @Injectable() export class ThemeService { private firstThemeImport = true 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 ) { this.firstThemeImport = true this.windowResize = debounce(this.windowResizeRaw.bind(this), 250) } boot() { this.settings = this.settingsAll.data.material; this.original = this.settings.themes.material[6] 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) { const body = document.body; newTheme = kebabCase(newTheme); if (newTheme === this.current && this.firstThemeImport === false) { return } if (this.all.indexOf(newTheme) > -1) { if (this.firstThemeImport) { document.body.style.visibility = 'hidden' } import( /* webpackPrefetch: true */ `../scss/material/theme/_${newTheme}.scss` ).then((module) => { /* */ if (this.firstThemeImport) { window.addEventListener('resize', this.windowResize.bind(this)) } document.getElementById("cory-pages-layout-theme-matrix").style.display = 'none' //console.warn('current', this.current, 'newTheme', newTheme) if (newTheme === 'cory-mat-theme-dark-matrix' && (this.current !== 'cory-mat-theme-dark-matrix' || this.firstThemeImport)) { //console.warn('run matrix effect') this.runMatrixEffect() } let style : any = document.getElementById('cory-web-app-pages-theme-style') if (style) { style.remove() } style = document.createElement('style'); style.id = 'cory-web-app-pages-theme-style' style.type = 'text/css'; let scrollbar = '' if (!isMobile && newTheme.startsWith('cory-mat-theme-dark')) { scrollbar = ` ::-webkit-scrollbar { width: 16px; height: 16px; } ::-webkit-scrollbar-corner, ::-webkit-scrollbar-track { background-color: rgb(64, 64, 64); } ::-webkit-scrollbar-thumb { background-color: rgb(96, 96, 96); background-clip: padding-box; border: 2px solid transparent; } ::-webkit-scrollbar-thumb:hover { background-color: rgb(112, 112, 112); } ::-webkit-scrollbar-thumb:active { background-color: rgb(128, 128, 128); } /* Buttons */ ::-webkit-scrollbar-button:single-button { background-color: rgb(64, 64, 64); display: block; background-size: 10px; background-repeat: no-repeat; } /* Up */ ::-webkit-scrollbar-button:single-button:vertical:decrement { height: 12px; width: 16px; background-position: center 4px; background-image: url("data:image/svg+xml;utf8,"); } ::-webkit-scrollbar-button:single-button:vertical:decrement:hover { background-image: url("data:image/svg+xml;utf8,"); } ::-webkit-scrollbar-button:single-button:vertical:decrement:active { background-image: url("data:image/svg+xml;utf8,"); } /* Down */ ::-webkit-scrollbar-button:single-button:vertical:increment { height: 12px; width: 16px; background-position: center 2px; background-image: url("data:image/svg+xml;utf8,"); } ::-webkit-scrollbar-button:single-button:vertical:increment:hover { background-image: url("data:image/svg+xml;utf8,"); } ::-webkit-scrollbar-button:single-button:vertical:increment:active { background-image: url("data:image/svg+xml;utf8,"); } /* Left */ ::-webkit-scrollbar-button:single-button:horizontal:decrement { height: 12px; width: 12px; background-position: 3px 3px; background-image: url("data:image/svg+xml;utf8,"); } ::-webkit-scrollbar-button:single-button:horizontal:decrement:hover { background-image: url("data:image/svg+xml;utf8,"); } ::-webkit-scrollbar-button:single-button:horizontal:decrement:active { background-image: url("data:image/svg+xml;utf8,"); } /* Right */ ::-webkit-scrollbar-button:single-button:horizontal:increment { height: 12px; width: 12px; background-position: 3px 3px; background-image: url("data:image/svg+xml;utf8,"); } ::-webkit-scrollbar-button:single-button:horizontal:increment:hover { background-image: url("data:image/svg+xml;utf8,"); } ::-webkit-scrollbar-button:single-button:horizontal:increment:active { background-image: url("data:image/svg+xml;utf8,"); } ` } const styleTxt = ` ${module.default} ${scrollbar} ` style.appendChild(document.createTextNode(styleTxt)); document.head.appendChild(style) 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'); } if (this.firstThemeImport) { this.firstThemeImport = false document.body.style.visibility = 'visible' } }) } else { throw new Error(`undefined ${newTheme}`); } } matrixEffectData: any clearMatrixEffect() { // geting canvas by Boujjou Achraf const c: any = document.getElementById("cory-pages-layout-theme-matrix"); c.style.display = 'block' const ctx = c.getContext("2d"); //making the canvas full screen //c.height = window.innerHeight - 124; c.height = window.innerHeight c.width = window.innerWidth; let matrix: any = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789@#$%^&*()*&^%+-/~{[|`]}"; //chinese characters - taken from the unicode charset // https://www.chinese-tools.com/learn/characters/list.html //let matrix: any = "安吧八爸百北不大岛的弟地东都对多儿二方港哥个关贵国过海好很会家见叫姐京九可老李零六吗妈么没美妹们名明哪那南你您朋七起千去人认日三上谁什生师十识是四他她台天湾万王我五西息系先香想小谢姓休学也一亿英友月再张这中字" //let matrix: any = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789@#$%^&*()*&^%+-/~{[|`]}安吧八爸百北不大岛的弟地东都对多儿二方港哥个关贵国过海好很会家见叫姐京九可老李零六吗妈么没美妹们名明哪那南你您朋七起千去人认日三上谁什生师十识是四他她台天湾万王我五西息系先香想小谢姓休学也一亿英友月再张这中字" //converting the string into an array of single characters matrix = matrix.split(""); const font_size = 10; ctx.font = font_size + "px Roboto Mono"; const columns = c.width / font_size; //number of columns for the rain //an array of drops - one per column const drops = []; //x below is the x coordinate //1 = y co-ordinate of the drop(same for every drop initially) for (let x = 0; x < columns; x++) drops[x] = 1; //drawing the characters return { c, ctx, font_size, drops, matrix, start: true, } } runMatrixEffectTimeout: any; runMatrixEffect() { const fps = 18; this.matrixEffectData = this.clearMatrixEffect() const colors = ['#27c027', '#00ff00', '#20b920', '#000000'] //const fps = 1000 / 6 const draw = () => { if (this.current === 'cory-mat-theme-dark-matrix') { // console.info('request draw') //window.requestAnimationFrame(draw); /* const deltaTime = Date.now() - delta; if (deltaTime >= fps) { requestAnimationFrame(draw); } else { setTimeout(function () { requestAnimationFrame(draw); }, fps - deltaTime); } */ setTimeout(() => { requestAnimationFrame(draw); }, 1000 / fps); //setTimeout(draw, fps) } const { c, ctx, font_size, drops, matrix } = this.matrixEffectData ///console.info('draw', self.current) const inlineDraw = () => { //Black BG for the canvas //translucent BG to show trail ctx.fillStyle = "rgba(0, 0, 0, 0.04)"; ctx.fillRect(0, 0, c.width, c.height); //looping over drops for (let i = 0; i < drops.length; i++) { ctx.fillStyle = colors[Math.floor(Math.random() * colors.length)] //a random chinese character to print //x = i*font_size, y = value of drops[i]*font_size ctx.fillText(matrix[Math.floor(Math.random() * matrix.length)], i * font_size, drops[i] * font_size); //sending the drop back to the top randomly after it has crossed the screen //adding a randomness to the reset to make the drops scattered on the Y axis if (drops[i] * font_size > c.height && Math.random() > 0.975) drops[i] = 0; //incrementing Y coordinate drops[i]++; } } //const delta = Date.now(); if (this.matrixEffectData.start === false) { inlineDraw() } else { for (let i = 0; i < 200; i++) { inlineDraw() } this.matrixEffectData.start = false } } setTimeout(() => requestAnimationFrame(draw)) //setTimeout(draw, fps) //draw() } windowResize: any windowResizeRaw() { if (this.current === 'cory-mat-theme-dark-matrix') { this.matrixEffectData = this.clearMatrixEffect() } } /* */ } src/app/modules/web/000077500000000000000000000000001516074440300146565ustar00rootroot00000000000000src/app/modules/web/boot.ts000066400000000000000000000041411516074440300161710ustar00rootroot00000000000000import { 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 "./"; 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(); }); } } src/app/modules/web/index.ts000066400000000000000000000003401516074440300163320ustar00rootroot00000000000000// dirs //export * from '../src-save/directive'; //export * from './forms'; //export * from './modules'; //export * from '../src-save/pipe'; export * from './services'; export * from './util'; //export * from './module'; src/app/modules/web/json/000077500000000000000000000000001516074440300156275ustar00rootroot00000000000000src/app/modules/web/json/settings.json000066400000000000000000000007101516074440300203600ustar00rootroot00000000000000{ "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." } } } src/app/modules/web/module.ts000066400000000000000000000045121516074440300165150ustar00rootroot00000000000000import { NgModule, ModuleWithProviders, } from '@angular/core'; import {RouterModule} from '@angular/router'; import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; import {Boot} from './boot'; //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 {CommonModule} from "@angular/common"; //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, CommonModule, ], // export declarations: [ // KeysPipe, // HtmlPipe, // JsonPipe, // SubmittedRequired, // FocusDirective ], // does not need export providers: [ RouterService, CookieService, SettingsService, LocaleService, MediaQueryService, // HttpShareService, // 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, }; } } src/app/modules/web/services/000077500000000000000000000000001516074440300165015ustar00rootroot00000000000000src/app/modules/web/services/cookie.ts000066400000000000000000000007371516074440300203310ustar00rootroot00000000000000import { Injectable } from '@angular/core'; //import * as Cookies from 'js-cookie'; import Cookies from 'js-cookie'; @Injectable() export class CookieService { public get(name: string): string { return Cookies.get(name); } public set(name: string, value: string | any, options?: Cookies.CookieAttributes): void { Cookies.set(name, value, options) } public getAll(): { [key: string]: string } { return Cookies.get(); } } src/app/modules/web/services/index.ts000066400000000000000000000002651516074440300201630ustar00rootroot00000000000000// dirs //export * from './http'; // files export * from './cookie'; export * from './locale'; export * from './settings'; export * from './router'; export * from './media-query'; src/app/modules/web/services/locale.ts000066400000000000000000000071531516074440300203160ustar00rootroot00000000000000import { Injectable, Inject } from '@angular/core'; //import * as moment from 'moment'; import {CookieService,} from '../services/cookie'; import {SettingsService} from '../services/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; if (!response.hasOwnProperty('country')) { this.setTranslation(currentLanguage); return; } 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); } */ 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]; } } src/app/modules/web/services/media-query.ts000066400000000000000000000110261516074440300212730ustar00rootroot00000000000000import { 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 } let mediaQuerySettingId = 0 export interface MediaQuerySetting { name: string, min: number, max: number, type: MediaQuerySettingType, _id: number, } @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[]) { const unregisterIds : Array = [] 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) { mediaQuerySettingId++ unregisterIds.push(mediaQuerySettingId) setting._id = mediaQuerySettingId this.settings.push(setting); } } this.findMediaQuery(); const self = this return ((unregisterIds: Array) => { return function() { const newSettings : MediaQuerySetting[] = [] for(let setting of self.settings) { let keep = true for(let unregisterId of unregisterIds) { if (setting._id === unregisterId) { keep = false break; } } if (keep) { newSettings.push(setting) } } self.settings = newSettings } })(unregisterIds); } 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); } } src/app/modules/web/services/router.ts000066400000000000000000000074561516074440300204050ustar00rootroot00000000000000import { Injectable, OnDestroy } from '@angular/core'; import { Router as AngularRouter, NavigationExtras, NavigationEnd, } from '@angular/router'; const IsBot = require("../util/is-bot.js"); let debounceGoogleAnalyticsTimeout: any; import {SettingsService} from './settings'; import { Subscription } from 'rxjs' @Injectable() export class RouterService implements OnDestroy { subscriptions$: Array = [] analytics = false constructor(private router: AngularRouter, private settings: SettingsService ) { if (navigator.userAgent !== 'corifeus-server-renderer') { const startGa = () => { if (!IsBot()) { window['gtag']('config', settings.data.core.integration.google.analytics, { 'page_path': location.pathname } ); this.subscriptions$.push( this.router.events.subscribe((event: any) => { if (event instanceof NavigationEnd) { clearTimeout(debounceGoogleAnalyticsTimeout); debounceGoogleAnalyticsTimeout = setTimeout(() => { //console.log(event.urlAfterRedirects) window['gtag']('config', settings.data.core.integration.google.analytics, { 'page_path': event.urlAfterRedirects } ); }, 333) } }) ) } } setTimeout(() => { 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 !== '') { const loadSettings = setInterval(() => { if (window['gtag'] !== undefined) { this.analytics = true clearInterval(loadSettings) startGa(); } else { console.info('corifeus-web is waiting for gtag to be available') } }, 333) } }) } }; 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; } ngOnDestroy(): void { this.subscriptions$.forEach(subs$ => subs$.unsubscribe()) } public collectAnalytics(pagePath: string) { if (this.analytics) { window['gtag']('config', this.settings.data.core.integration.google.analytics, { 'page_path': pagePath } ); } } } src/app/modules/web/services/settings.ts000066400000000000000000000117721516074440300207210ustar00rootroot00000000000000import { 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 analytics if (coreSettings.integration.google.hasOwnProperty('analytics')) { log('afterInit - integration - google - analytics'); const script = document.createElement("script"); script.type = 'text/javascript'; script.async = true script.src = `https://www.googletagmanager.com/gtag/js?id=${coreSettings.integration.google.analytics}` head.appendChild(script); const scriptInline =document.createElement("script"); scriptInline.type = 'text/javascript'; scriptInline.innerHTML = ` window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '${coreSettings.integration.google.analytics}'); ` head.appendChild(scriptInline); log('afterInit - integration - google - analytics - load 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); } } } } } src/app/modules/web/util/000077500000000000000000000000001516074440300156335ustar00rootroot00000000000000src/app/modules/web/util/index.ts000066400000000000000000000002761516074440300173170ustar00rootroot00000000000000export * from './log'; export function decodeEntities(encodedString: string) { var div = document.createElement('div'); div.innerHTML = encodedString; return div.textContent; } src/app/modules/web/util/is-bot.js000066400000000000000000000015101516074440300173630ustar00rootroot00000000000000const pattern = new RegExp('spider|bot|yahoo|bing|google|yandex|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|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); }; src/app/modules/web/util/log.ts000066400000000000000000000015261516074440300167700ustar00rootroot00000000000000import { environment } from '../../../../environments/environment'; const isDevMode = () => { return !environment.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}; src/app/page/000077500000000000000000000000001516074440300133455ustar00rootroot00000000000000src/app/page/cory-page.ts000066400000000000000000000131321516074440300156030ustar00rootroot00000000000000import { Component, Host, NgZone, AfterViewChecked, OnDestroy, } from '@angular/core'; /* import { DomSanitizer } from '@angular/platform-browser' */ import { Subscription } from 'rxjs' import { ActivatedRoute, NavigationStart, NavigationEnd, } from '@angular/router'; import {HttpClient} from '@angular/common/http'; import {RouterService} from '../modules/web'; import { Layout} from "../layout"; import {CdnService, MarkdownService} from '../service'; import {SettingsService, LocaleService} from '../modules/web'; import twemoji from 'twemoji' //import {State} from '../../web'; import { NotifyService } from '../modules/material'; const cache = {} let testing = false @Component({ selector: 'cory-page', template: ` ` }) export class Page implements AfterViewChecked, OnDestroy { subscriptions$: Array = [] loaded: boolean = false; content: any; //parent: any; constructor( private markdown: MarkdownService, private cdn: CdnService, private router: RouterService, private activatedRoute: ActivatedRoute, public http: HttpClient, private settings: SettingsService, private zone: NgZone, protected notify: NotifyService, protected locale: LocaleService, // private _sanitizer: DomSanitizer, private parent: Layout, ) { this.markdown.context = this; // this.parent = Globals.layout let currentUrlPathTimeout: any; let usingActivatedUrl = true; this.subscriptions$.push( this.router.events.subscribe(event => { if (event instanceof NavigationStart) { usingActivatedUrl = false; //const urlPath = event.url.substr(1) clearTimeout(currentUrlPathTimeout); currentUrlPathTimeout = setTimeout(() => { // console.log('router', urlPath, 'usingActivatedUrl', usingActivatedUrl); if (usingActivatedUrl === false) { usingActivatedUrl = true; // console.log('have to navigate', urlPath) this.navigate() } }, 250) } }) ) this.subscriptions$.push( this.activatedRoute.url.subscribe((segment) => { usingActivatedUrl = true; const path = segment.join('/'); // console.log('update activated route', path) this.navigate(path); }) ) } async navigate(path?: string) { if (path === undefined || path === '') { path = `index.html`; } try { const cacheKey = JSON.stringify({ repo: this.parent.currentRepo, path: path }) if (cache.hasOwnProperty(cacheKey)) { this.content = cache[cacheKey] return } // State.NotFound = false; // window.corifeus.core.http.status = 200; let text = await this.cdn.file(this.parent.currentRepo, path); const pathLower = path.toLowerCase() if (pathLower.endsWith('.json')) { text = ` \`\`\`json ${text} \`\`\` ` } else if (pathLower.endsWith('.yml')) { text = ` \`\`\`yaml ${text} \`\`\` ` } else if (pathLower.endsWith('.conf')) { text = ` \`\`\`nginxconf ${text} \`\`\` ` } const html = await this.markdown.render(text, this.parent, pathLower); cache[cacheKey] = html this.content = html } catch (e) { //this.router.navigateTop(['/github/corifeus/404']); // State.NotFound = true; // window.corifeus.core.http.status = 404; this.content = `
404
${this.locale.data.material.http['404']}
${location.toString()}

${e.message}
` console.error(e); } finally { document.getElementById('cory-page-content').innerHTML = twemoji.parse(this.content, { folder: 'svg', ext: '.svg', }) } } ngAfterViewChecked() { // const e = document.querySelector(`${decodeURI(location.hash)}-parent`); const e = document.querySelector(`${location.hash}-parent`); if (!this.loaded && e) { this.loaded = true; e.scrollIntoView({ block: "center", }) } if (!testing) { testing = true; this.notify.info(this.parent.i18n.title.ready) } } /* currentHtml: any transformedHtml: any transformHtml(html: string): any { if (this.currentHtml !== html) { this.currentHtml = html this.transformedHtml = this._sanitizer.bypassSecurityTrustHtml(html); } return this.transformedHtml } */ ngOnDestroy(): void { this.subscriptions$.forEach(subs$ => subs$.unsubscribe()) } } src/app/page/index.ts000066400000000000000000000001071516074440300150220ustar00rootroot00000000000000export * from "./cory-page"; //export * from "./cory-open-collective"; src/app/service/000077500000000000000000000000001516074440300140715ustar00rootroot00000000000000src/app/service/cdn.ts000066400000000000000000000017731516074440300152150ustar00rootroot00000000000000import {Injectable} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {SettingsService} from '../modules/web'; @Injectable() export class CdnService { private settings: any; constructor(private http: HttpClient, private settingsAll: SettingsService) { this.settings = settingsAll.data.pages; } async file(repo: string, path: string) { const postfix = '.html'; //FIXME corifeus - matrix if (repo === 'matrix') { repo = 'corifeus' } const index = `index${postfix}`; if (path.endsWith(index)) { path = path.substr(0, path.length - index.length) + 'README.md'; } if (path.endsWith(postfix)) { path = path.substr(0, path.length - postfix.length) + '.md'; } const url = `https://cdn.corifeus.com/git/${repo}/${path}`; const text = await this.http.get(url, {responseType: 'text'}).toPromise(); return text; } } src/app/service/global.service.ts000066400000000000000000000005671516074440300173500ustar00rootroot00000000000000import {Injectable} from '@angular/core'; let httpCounter = 0 @Injectable({ providedIn: 'root' }) export class GlobalService { public get HttpCounter() { // console.log('httpCounter get', httpCounter) return httpCounter }; public set HttpCounter(value) { // console.log('httpCounter set', value) httpCounter = value } } src/app/service/index.ts000066400000000000000000000001201516074440300155410ustar00rootroot00000000000000export {CdnService} from "./cdn"; export {MarkdownService} from "./markdown"; src/app/service/markdown.ts000066400000000000000000000034511516074440300162660ustar00rootroot00000000000000import {Injectable} from '@angular/core'; import {Layout} from '../layout/cory-layout'; const worker = new Worker('../../worker/markdown.worker', { type: 'module' }); const nextId = require('../utils/next-id.js') @Injectable() export class MarkdownService { public context: any; layout: Layout; constructor() { } public render(md: string, layout: Layout, path: string) { this.layout = layout; return new Promise(async(resolve, reject) => { const requestId = nextId() const message = (event: any) => { if (event.data.requestId === requestId) { worker.removeEventListener('message', message) if (event.data.success === true) { resolve(event.data.html) } else { reject(new Error(event.data.errorMessage)); } } } worker.addEventListener('message', message) if (this.layout.packages === undefined) { await new Promise(resolve => { const wait = () => { console.info('waiting for github repo packages') if (this.layout.packages === undefined) { setTimeout(wait, 100) } else { resolve() } } wait() }) } worker.postMessage({ md: md, settings: this.context.settings.data, currentRepo: this.layout.currentRepo, packages: this.layout.packages, requestId: requestId, path: path, }); }) } } src/app/utils/000077500000000000000000000000001516074440300135715ustar00rootroot00000000000000src/app/utils/extrac-title.ts000066400000000000000000000034761516074440300165600ustar00rootroot00000000000000const cache = {}; const { extractStars } = require("../../helper/extract-stars.function.js"); export function extractTitle(pkg: any): string { if (pkg === undefined) { return ''; } if (pkg.name === undefined) { return ''; } if (cache.hasOwnProperty(pkg.name)) { return cache[pkg.name]; } if (pkg.name === 'corifeus') { cache[pkg.name] = 'Corifeus'; return cache[pkg.name]; } if (pkg.name.startsWith('grunt')) { let result = pkg.name.split('-').map((word: string) => { return word[0].toUpperCase() + word.substr(1) }); result = result.slice(); result.splice(1, 1); cache[pkg.name] = result.join(' '); return cache[pkg.name]; } else { let result: string = pkg.name.split('-').map((word: string) => { return word[0].toUpperCase() + word.substr(1) }).slice(1).join(' '); if (result !== undefined && result.startsWith('Openwrt')) { result = result.replace('Openwrt', 'OpenWrt') } result = result.split(' ').map((elem: string) => { if (elem.length === 2) { elem = elem.toUpperCase() } else if (elem.toLowerCase() === 'pdf') { elem = elem.toUpperCase() } else if (elem.endsWith('db')) { elem = elem.substr(0, elem.length - 2) + 'DB' } return elem }).join(' ') cache[pkg.name] = result; return cache[pkg.name]; } } export function extractTitleWithStars(pkg: any): string { let title = extractTitle(pkg); if (pkg !== undefined && pkg !== null && pkg.corifeus.stargazers_count < 1) { return title } return `${title} ⭐${extractStars(pkg.corifeus.stargazers_count)}`; } export { extractStars } src/app/utils/is-mobile.ts000066400000000000000000000002301516074440300160140ustar00rootroot00000000000000export function isMobile() { try { document.createEvent("TouchEvent"); return true; } catch (e) { return false; } } src/app/utils/next-id.js000066400000000000000000000014211516074440300154750ustar00rootroot00000000000000let currentId = 0 let currentIdTime = Date.now() const random = () => { return (Math.floor(Math.random() * (99999999999999999 - 10000000000000000)) + 10000000000000000).toString(16) } const reverse = function (str) { return str.split('').reverse().join('') } const nextId = () => { const now = Date.now(); if (currentIdTime !== now) { currentId = 0; currentIdTime = now } const comingId = ++currentId; const randomHex = reverse(random()).padStart(15, '0'); const timeHex = reverse(currentIdTime.toString(16).padStart(12, '0')) const comingIdHex = reverse(comingId.toString(16).padStart(3, '0')); const newId = `P3Xid${timeHex}${comingIdHex}${randomHex}`; //console.log(newId) return newId } module.exports = nextId src/artifacts/000077500000000000000000000000001516074440300136315ustar00rootroot00000000000000src/artifacts/_variables.scss000066400000000000000000000002101516074440300166260ustar00rootroot00000000000000$cory-layout-fixed-zindex: 0; $cory-layout-fixed-height: 85px; $cory-layout-fixed-height-collapsed: 45px; $cory-layout-padding: 20px; src/artifacts/jetbrains-logo.svg000066400000000000000000000100531516074440300172700ustar00rootroot00000000000000 src/artifacts/npm-logo.svg000066400000000000000000000012111516074440300160750ustar00rootroot00000000000000 src/artifacts/style.scss000066400000000000000000000105641516074440300156740ustar00rootroot00000000000000@import '~@fontsource/roboto/latin.css'; @import '~@fontsource/roboto-mono/latin.css'; @import '~material-design-icons/iconfont/material-icons.css'; @import "_variables"; @import '../app/modules/material/scss/all'; //@import '~@angular/material/theming'; img.emoji { height: 1em; width: 1em; margin: 0 .05em 0 .1em; vertical-align: -0.1em; } .cory-layout-title { font-size: 250%; font-weight: bold; } .cory-mat-theme-light { @import 'CSS:../../node_modules/highlight.js/styles/github'; .cory-layout-title { text-shadow: 2px 2px rgba(0, 0, 0, 0.5); } } .cory-mat-theme-dark { @import 'CSS:../../node_modules/highlight.js/styles/vs2015'; .cory-layout-title { text-shadow: 2px 2px rgba(255, 255, 255, 0.5); } } .cory-mat-theme-dark-matrix { .cory-layout-title { text-shadow: 2px 2px rgba(0, 255, 0, 0.5); } } img { max-width: 100%; height: auto; } .mat-toolbar { @media screen and (max-width: $cory-mat-size-xsmall) { padding-left: 0px !important; padding-right: 0px !important; } } a code { font-weight: bold; } .cory-layout-fa { font-size: 23px !important; } .cory-mat-footer { .mat-button { text-overflow: ellipsis; // overflow: hidden; } } .cory-mat-header, .cory-mat-footer { height: 56px !important; @media screen and (max-width: $cory-mat-size-xsmall) { .mat-button { $padding: 8px; min-width: 24px !important; padding-left: $padding; padding-right: $padding; } }; } .cory-mat-theme-light { .cory-mat-header { border-bottom: 5px solid rgba(0, 0, 0, 0.1); } .cory-mat-footer { border-top: 5px solid rgba(0, 0, 0, 0.1); } .cory-mat-header, .cory-mat-footer { box-shadow: 0px 0px 100px 10px rgba(0, 0, 0, 0.25); } } .cory-mat-theme-dark { .cory-mat-header { border-bottom: 5px solid rgba(255, 255, 255, 0.1); } .cory-mat-footer { border-top: 5px solid rgba(255, 255, 255, 0.1); } .cory-mat-header, .cory-mat-footer { box-shadow: 0px 0px 100px 10px rgba(255, 255, 255, 0.15); } } .cory-mat-theme-dark-matrix { .cory-mat-header { border-bottom: 5px solid rgba(0, 0, 0, 0.4); } .cory-mat-footer { border-top: 5px solid rgba(0, 0, 0, 0.4); } } .cory-layout-link-external { .fa, .fas, .fab, .far { opacity: 0.5; } &:hover { .fa, .fas, .fab, .far { opacity: 1; } } } /* .cory-layout-container-fixed { margin-top: $cory-mat-fixed-height-collapsed; margin-bottom: $cory-mat-fixed-height-collapsed; @media screen and (min-width: $cory-mat-size-xsmall) { margin-top: $cory-mat-fixed-height; margin-bottom: $cory-mat-fixed-height; } @media screen and (min-width: $cory-mat-size-medium) { width: $cory-mat-size-medium - 100; margin-left: auto; margin-right: auto; }; } */ .cory-layout-markdown-reference { /// float: right; display: none; } .cory-layout-markdown-header:hover > a { display: inline; } .cory-layout-sidenav-search { $padding: 15px; padding-left: $padding; padding-right: $padding; } .cory-layout-sidenav-container { background: none !important; position: absolute; z-index: 1; top: 0px; left: 0px; width: 100%; height: 100%; padding-top: $cory-mat-fixed-height-collapsed; padding-bottom: $cory-mat-fixed-height-collapsed; @media screen and (min-width: $cory-mat-size-xsmall) { // padding-top: $cory-mat-fixed-height-top; // padding-bottom: $cory-mat-fixed-height-bottom; } @media screen and (min-width: $cory-mat-size-medium) { margin-left: auto; margin-right: auto; padding-left: auto; padding-right: auto; }; } .cory-pages-menu-effect { opacity: 0.75; } .cory-pages-menu-effect:hover { opacity: 1; } hr { border-style: solid; opacity: 0.2; } .cory-layout-markdown-header:hover .emoji { transition: all 500ms !important; transform: scale(1.2) rotate(360deg) !important;; } //corifeus-inject @import '../app/layout/cory-layout.scss'; @import '../app/layout/footer/cory-layout-footer.scss'; @import '../app/layout/header/cory-layout-header.scss'; //corifeus-inject:end src/assets/000077500000000000000000000000001516074440300131535ustar00rootroot00000000000000src/assets/.gitkeep000066400000000000000000000000001516074440300145720ustar00rootroot00000000000000src/environments/000077500000000000000000000000001516074440300144005ustar00rootroot00000000000000src/environments/environment.prod.ts000066400000000000000000000000631516074440300202560ustar00rootroot00000000000000export const environment = { production: true }; src/environments/environment.ts000066400000000000000000000012261516074440300173150ustar00rootroot00000000000000// This file can be replaced during build by using the `fileReplacements` array. // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. // The list of file replacements can be found in `angular.json`. export const environment = { production: false }; /* * For easier debugging in development mode, you can import the following file * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. * * This import should be commented out in production mode because it will have a negative impact * on performance if an error is thrown. */ // import 'zone.js/dist/zone-error'; // Included with Angular CLI. src/favicon.ico000066400000000000000000000764461516074440300140130ustar00rootroot00000000000000 hF 00 %V@@ (B:(  @]KI]KI;]KI\JI]KI]KIc]KI]KI]KIq]KI]KI]KI\JH]KI]KI]KI]KI7]KI]KI]KI-]KI]KI]KHM]KI]KI]KI]KI]KI]KIC]KI]KI]KI]KIi]KI]KI]KI]KI]KI]KI]KI]KI\KI]KI]KI]KH]KI]KI]KI]KI9]KI]KI]KI\KH\KHw\KI]KI]KI]KI\KI1]JI]KI]KI]KI]KH]KI]KI]KI \KI]KI]KI]KI5]KI'\KI]KI%]KI \KI]KI]KI+\KI]KI( @ ]KIC]KH]KI-]KI]KH]KI]KI]KI]KIQ]KI_]KI]KH]KI \JI]KI]KI]KI]JI]KI]KI]KI;]KI]KI]KI7]KI]KI]KI]KI]KI]KI]KI]KI ]KI ]KI]KI]KI]KI]KI{]KI]KH]KIc]KIc]KI]KI]KI]KI)]KI%]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]JI\JI]KI]KI]KI]KI]KI]KIk]KIM]KI]KI]KI]KI]KI]KI]KI9]KI7]KI]KI]KI]KI]KI]KI ]KI]KI]KI]KI]KI]KI]KI]KI]KH ]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KH]KI]KI]KI]KH]KIW]KI+]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]JH\JH]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KIW]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KH]KIE]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI ]KI]KI]KI]KI]KI]KI]KI]KI]KI\KI]]KI]KI]KI]KI]KI\KI]KI1]KI]KI]KI]KI]KI]KI]KI\KI]KI]KI]KI]KI]KI]KI]KI3]KH]KI]KI]KI]KI]KI]KI]KI\KI#]KI/]KI]KI]KI\KI]KI]KI]KI]KI]KI]KI]KI]KI\KI]JH]KI\KI\KIq]KI]KI]KI]KI]KI]KH]KI3]KI ]KI]KI]KI!]KI]KI]KI]KI]KI]JI=]KIo]KI]KI]KI]KIC\KI]KI_\JI(0` %\KHM]JI]KI]KI!\JH\JH]KI]]KI]KI]JH\JH]KIC]KIK]KI\KI]KI]KI]KI]KI\JH]KI]KH]KI]KI]KH]JH]KI-]KI)\KH]KI\KI\KI]KI]KI]KI\JH\JH\KHm]KIU]KI]KI]KI]JH]KI]KH]KI+]KI]KI\KH]JI\JH\JH]KH\JI\KI=\JH]JI]KI']KI]KI]KI\JH\JH]KI]KHU\KI ]JI]KI]KH]KI]KI]JH5\KH]KI]KI]KI]KI\KI]KIa]KI]KI]KI\JI]KIE]KH ]KI\JH]KI\JH\JH\JI]KI]KI]KI]KI]KI]KH\JH]KI]KI]KH]]JI\JH]KI]KI]KH]KIE]KI]KI]KI\KI]KI]KI\JH]KI]KHs\KI]KI]KI]KI\JH]KH]KI]KI\KH]KI;]KI]KH]KI]KI]KI]KI]KI]KI]KI%\KI]KI]KI]KI]KI]KI]KI]KI]KI]KI ]KI]KI]KH]KI]KI]KI]KI]JH]KI]KI\KI]KI1\KH]KI]KI]KI]KI]KI\KI3]KIc]JH]KH\JH\JH]KH]KI\KI\JH\JH\KH]JHE]KH ]KI\JH\JH]KH\JH\KI]KI]KI ]JI]JI]KI]KI]JI]KI]KI]KI]KI]KI]KI]KI]KI]KI \KI_]KI]JI]KI]KI]KI]KI]KIu]KI]KI]KH]KI]JH]KI]KI]KI]KI]KI]KI]KI]KI]KI\KI]KI]JH]KI]KI]KI\KI]KH%]KI?\JI\KH]KI]KI\JH]KI]KI]KI\KH]KI]KI\JH\JH\JH\JH\JH\JH]KI]KI\KH]KI]KI ]KI ]JI]KI]KI]KI]KI]KH]KI]KH]KI\JH]KI]KI]KI]KI]KI]KI]KI]KH]KI]KH]JI]KI_\KIo]KI]KI\JH]KH]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI%\KH]KI\KH\KH]KI\KH]KH\JH]KI]KI]KI]KI]KH\JH]KI\JH\KI]KI]KH\JH]KI\KI]JH]JI]KI\JI]JH]KI\JH]KI]KI]KI]KI]KH]JH]KI]JH]JH]KI]KI]KH]KI]KI]KI]KI]KH]KIQ]KIM]KI]KI]KI]KI\JH]JH]KI]KI]KI]KI]KH]KI]KI]KH\JH]KI]KH]KI]KI]KI]KI]KI]KI]KI]JI\KH\JH]KI\JH\JH]KI\JH]KI\KI]KI]KI[]KI#]KI]KI]KI]KI]KH]KI\JH]KI\KI]KI\KIw]KI]KI]KI]KH]KI]KI]KI]KI]KH]KI]KI\JI]JIg]KH\JH]KI]JI]KI]KI]KH\JH]KI?]KI+\JH\JI]KI\JH]KI]KI]JH\JH]KI\JH\JH]KIm]KH \KH\JH]KI\JH]KH]KI\JH]KH]KI ]KI]JI]KI]KI\KH\JH]KI]KI\JH]KI\JH]JH]KI\KH\KI9]KI]KH]KH]KH]JI]JH]KH}]KI\JI]KI\KH]KI]KI\JH]KI]JI]JI]KI]KI\KI\JI]KI]KI]KI]KI]JH]KI1]KIA]KH]KI]KI]KI]KI]KI]KI]KI]KI\KI]JH#]KI]KI\JH\KH]KI]KI]KI]KIC]KI]KI]KI]KI]KI\JH]KI\KI]JH]KIY]JI]KI\JI\KHi\JIE\KI\JH]KI]KI\JH]KI]JH]KH3\KI]JI]KI]KH]KI]KIE\KI]KI]KI\JH]KI]KI]KI-\KI]KH\JIE]KI]KI\JI]KI]KI?]KIC]KH]KI\JH]KI]JI=]KI]KI7(@ B\KIQ]JH]KIo]KI ]KI]KI]KI]KI]KI-]KI ]JH]KI]KI]KI]KI-]KIG]KI]KI]KI\KI]KI]KI]KI]KI]KI]KI]KIo]KH]KIm]KI]KI]KI]KI]KI']KI+\JI]KI]KI]KI]KI]KI]KI]JI]KI]KI\KI]KIY]JHC]KI]KI]KI]KI]KI]KI+]KI]KI]KI]KI]KI]KI]KI]JI]KI\KIg]KI]KI]KI]KI]KI]KIK\KI1]KI]KI]KI]KI]KI]KI]KI]KI ]KIE]KI3]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KIo]KI]KI]JII]KIC]KI]KI]KI]KI]KI]KI\KIA\KI5]KI]KI]KI\KI]KI!]KI]KI]KI]KI]KI]KI]KI]KI]KI\KI]KI]KI]KI]KI\KIu]KIy]KI]KI]KI]KI]KI]KI]KI{]KI]KIU]KH]KI]KI]KI]KI]KI\KI1\JH%]KI]KI]KI]KI]KI]KI]KI\KI%]KI]KI\JI]KI]KI]KI]KI]KI]KI]KI]KH ]KI]KI]KI]KI]KI]KI]KI\JH]KI ]KI}]KI]KI]KI]KI]KI]KI]KI]KI]KIU]JHW]KI]KI]KI]KI]KI]KI]KI]KIe]KI1]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI\KH]KI]KI]KI]KI]KI]KI]KI]KI\JH]KI)]JH ]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI\JI]KI\KH]KI]KI]KI]KI]KI]KI]KI]KI]KI\JIS]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI\KI]KI-]KI1]KI]KI]KI]KI]KI]KI]KI]KI]KIM]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI ]KI]KI]KI]KI]KI]KI]KI]KI]KH]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KH]KIa]KI]KI_]KI]KI]KI]KI]KI]KI]KI]KI\KH]KI]KI#]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KII]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]JI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]]JI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI\KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KH1]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]JI]KI]JI9]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KIk\JH ]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI_]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI%]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KH]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI[]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KH]KI}]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]JI]JI']KIG]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI ]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI\KHI]KI)]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KIE]KIa]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KIm]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI ]KI-]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI\KI]JHM]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI\KI]KI ]KII]KI]KI]KI]KI]KI]KI]KI]KI]KI]KHC]KI)]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]JI]KIg]KI ]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI ]KI-]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI#]KI]KI]KI]KI]KI]KI]KI]KHu]KIk]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]JIm]KIc]KI]KI]KI]KI]KI]KI]KI!]KI \KIk]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI]KI%]KI]KI]KI]KI]KI]KI]KI]KI ]KI]KIo\KI]KI]KI]KI]KI]KI]KI]KI]KI]KH]KI]KI]KI/]JI]KI]KI\JH]KHa]KH ]KIk]KI]KI]KI]KI]KI]KI]KI]KI]KH]KI5]KI]KI]KI]KI]KI]KI\JH]KIo]KI]KI]KI]KI]KI]KI]KI]KH]JH%]KI]KI]KI\JH]KIk\KI]KI]KI]KI]KI]KI]KI;]KI]KI]KI ]KH ]KIo]KI]KI]KI]KI]KI\KH]KI\KIk]KI]KI]KI]KIG]KI ]KIc\KI]KI\JI src/helper/000077500000000000000000000000001516074440300131305ustar00rootroot00000000000000src/helper/extract-stars.function.js000066400000000000000000000004131516074440300201140ustar00rootroot00000000000000module.exports.extractStars = (stars) => { if (stars >= 1000) { const starsCount = parseFloat((stars / 1000).toFixed(1)) return ( starsCount === Math.ceil(starsCount) ? starsCount.toFixed(0) : starsCount.toFixed(1)) + 'k' } return stars } src/index.html000066400000000000000000000032251516074440300136500ustar00rootroot00000000000000 Corifeus Matrix
src/main.ts000066400000000000000000000005641516074440300131520ustar00rootroot00000000000000import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; if (environment.production) { enableProdMode(); } platformBrowserDynamic().bootstrapModule(AppModule) .catch(err => console.error(err)); src/polyfills.ts000066400000000000000000000054231516074440300142420ustar00rootroot00000000000000/** * This file includes polyfills needed by Angular and is loaded before the app. * You can add your own extra polyfills to this file. * * This file is divided into 2 sections: * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. * 2. Application imports. Files imported after ZoneJS that should be loaded before your main * file. * * The current setup is for so-called "evergreen" browsers; the last versions of browsers that * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. * * Learn more in https://angular.io/guide/browser-support */ /*************************************************************************************************** * BROWSER POLYFILLS */ /** IE10 and IE11 requires the following for NgClass support on SVG elements */ // import 'classlist.js'; // Run `npm install --save classlist.js`. /** * Web Animations `@angular/platform-browser/animations` * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). */ // import 'web-animations-js'; // Run `npm install --save web-animations-js`. /** * By default, zone.js will patch all possible macroTask and DomEvents * user can disable parts of macroTask/DomEvents patch by setting following flags * because those flags need to be set before `zone.js` being loaded, and webpack * will put import in the top of bundle, so user need to create a separate file * in this directory (for example: zone-flags.ts), and put the following flags * into that file, and then add the following code before importing zone.js. * import './zone-flags'; * * The flags allowed in zone-flags.ts are listed here. * * The following flags will work for all browsers. * * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames * * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js * with the following flag, it will bypass `zone.js` patch for IE/Edge * * (window as any).__Zone_enable_cross_context_check = true; * */ /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ import 'zone.js/dist/zone'; // Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS */ src/styles.scss000066400000000000000000000001551516074440300140720ustar00rootroot00000000000000/* You can add global styles to this file, and also import other style files */ @import "./artifacts/style"; src/test.ts000066400000000000000000000013611516074440300132010ustar00rootroot00000000000000// This file is required by karma.conf.js and loads recursively all the .spec and framework files import 'zone.js/dist/zone-testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; declare const require: { context(path: string, deep?: boolean, filter?: RegExp): { keys(): string[]; (id: string): T; }; }; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, platformBrowserDynamicTesting() ); // Then we find all the tests. const context = require.context('./', true, /\.spec\.ts$/); // And load the modules. context.keys().map(context); src/worker/000077500000000000000000000000001516074440300131625ustar00rootroot00000000000000src/worker/markdown.worker.ts000066400000000000000000000246541516074440300166770ustar00rootroot00000000000000/// import kebabCase from 'lodash/kebabCase'; const { extractStars} = require('../helper/extract-stars.function.js'); let currentRepo, settings, currentRepoPath let locationOrigin, locationPathname, locationHref, locationHostname function htmlStrip(html) { // const tmp = document.createElement("DIV"); // tmp.innerHTML = html; // return tmp.textContent || tmp.innerText || ""; return html.replace(/<\/?[^>]+(>|$)/g, ""); } const notifyMissingMarkdownCode = ({ code, language, currentRepo, currentRepoPath, coreUrl}) => { const url = `${coreUrl}/api/patrikx3/git/notify-markdown-error` fetch(url, { method: 'POST', // *GET, POST, PUT, DELETE, etc. // mode: 'cors', // no-cors, *cors, same-origin // cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached // credentials: 'same-origin', // include, *same-origin, omit headers: { 'Content-Type': 'application/json' // 'Content-Type': 'application/x-www-form-urlencoded', }, // redirect: 'follow', // manual, *follow, error // referrerPolicy: 'no-referrer', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url body: JSON.stringify({ info: ` Repo: ${currentRepo}
Path: ${currentRepoPath}
Code:
${code}

Language: ${language}
` }) // body data type must match "Content-Type" header }).then(response => { if (response.status !== 200) { console.error('notifyMissingMarkdownCode invalid response', response) } else { console.info('notifyMissingMarkdownCode info response', response) } }).catch(e => { console.error('notifyMissingMarkdownCode error', e) }) } const IsBot = require('../app/modules/web/util/is-bot.js') const hljs = require('highlight.js/lib/core'); // this is for HTML as well hljs.registerLanguage('conf', require('highlight.js/lib/languages/nginx.js')); hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml.js')); hljs.registerLanguage('css', require('highlight.js/lib/languages/css.js')); hljs.registerLanguage('scss', require('highlight.js/lib/languages/scss.js')); hljs.registerLanguage('yaml', require('highlight.js/lib/languages/yaml.js')); hljs.registerLanguage('yml', require('highlight.js/lib/languages/yaml.js')); hljs.registerLanguage('powershell', require('highlight.js/lib/languages/powershell.js')); hljs.registerLanguage('javascript', require('highlight.js/lib/languages/javascript.js')); hljs.registerLanguage('js', require('highlight.js/lib/languages/javascript.js')); hljs.registerLanguage('json', require('highlight.js/lib/languages/json.js')); hljs.registerLanguage('bash', require('highlight.js/lib/languages/shell.js')); hljs.registerLanguage('sh', require('highlight.js/lib/languages/shell.js')); hljs.registerLanguage('typescript', require('highlight.js/lib/languages/typescript.js')); hljs.registerLanguage('ts', require('highlight.js/lib/languages/typescript.js')); hljs.registerLanguage('ini', require('highlight.js/lib/languages/ini.js')); /* import { environment } from '../environments/environment'; const twemoji = require('twemoji').default; if (environment.production) { twemoji.base = '/assets/twemoji/'; } */ const marked = require('marked') const markdownRenderer = new marked.Renderer(); const extract = (template, area) => { // [//]: #@corifeus-header // [//]: #corifeus-header:end // [//]: #@corifeus-footer // [//]: #@corifeus-footer:end const start = `[//]: #@${area}`; const end = `[//]: #@${area}:end`; const startIndex = template.indexOf(start); const endIndex = template.indexOf(end); //console.log('start', start, startIndex) //console.log('end', end, endIndex) let result = template.substring(0, startIndex + start.length); result += template.substring(endIndex + end.length); return result; } markdownRenderer.heading = (text, level, raw) => { // console.log('text', text,) // console.log('raw', raw) const ref = kebabCase(htmlStrip(raw)).replace(/[^\x00-\xFF]/g, ""); // console.log('ref', ref) const id = `${ref}-parent`; //console.log(ref); let navClick = '' if (!IsBot()) { navClick = `onclick="return window.coryAppWebPagesNavigateHash('${id}');"`; } let element = `${text} `; // console.log('ref', ref) return element } markdownRenderer.image = (href, title, text) => { title = title || ''; text = text || ''; if (!href.startsWith('http')) { href = `https://cdn.corifeus.com/git/${currentRepo}/${href}`; } let result if (text.toLowerCase().trim() === 'link') { result = ``; } else { result = ` ${title} ${text} `; } return result; }; markdownRenderer.link = (href, title, text) => { let a; let tooltip = ''; if (title !== null && title !== undefined) { tooltip = `tooltip="${title}"`; } let fixed = false; let path; const testHref = href.toLowerCase(); const fixedUrl = () => { const url = new URL(href); href = url.pathname; path = `${href}`; fixed = true; //console.log('fixed') } if ((typeof testHref === 'string' && (testHref.startsWith('https://') || testHref.startsWith('http://'))) ) { const testUrl = new URL(testHref) for(let defaultDomain of settings.pages.defaultDomain) { if (testUrl.hostname === defaultDomain) { fixedUrl(); break; } } } else if (testHref.includes('localhost:8080')) { fixedUrl() } // console.log('href', href) if (!href.startsWith(locationOrigin) && (href.startsWith('https:/') || href.startsWith('http:/') || href.startsWith('mailto:'))) { /* if (href.startsWith('mailto:')) { console.log(href) } */ if (href.endsWith('#cory-non-external')) { a = `${text}`; } else { a = `${text} `; } } else { if (!fixed) { if (href.endsWith('.md')) { href = href.substr(0, href.length - 3) + '.html'; } if (href.startsWith(locationOrigin)) { path = `/${href.substring(locationOrigin.length + 1)}`; } else if (href.startsWith('./')) { let base = locationHref if (!base.includes('.')) { base = locationHref + '/'; } path = `${new URL(href, base).pathname}`; // console.log(path) } else { path = `/${currentRepo}/${href}`; } } // console.log(path) // this.context.parent.navigate const navClick = !IsBot() ? `onclick="window.coryAppWebPagesNavigate('${path}'); return false;"` : ''; a = `${text}`; // console.log(path); // console.log(a); } return a; } markdownRenderer.code = (code, language) => { if (language === undefined) { language = 'text'; } language = language.toLowerCase() // console.log('TEST', language, currentRepo, currentRepoPath, settings.core.server) if ((hljs.getLanguage(language) === 'undefined' || hljs.getLanguage(language) === undefined) && language !== 'text' && language !== 'txt') { console.error(`Please add highlight.js as a language (could be a marked error as well, sometimes it thinks a language): ${language} We are not loading everything, since it is about 500kb`) notifyMissingMarkdownCode({ code, language, currentRepo, currentRepoPath, coreUrl: settings.core.server.url }) } // language = language === 'text' || language === 'txt' || language === undefined ? 'html' : language; const validLang = !!(language && hljs.getLanguage(language)); const highlighted = validLang ? hljs.highlight(language, code).value : code; return `
${highlighted}
`; }; markdownRenderer.codespan = (code) => { const lang = 'html'; const highlighted = hljs.highlight(lang, code).value; return `${highlighted}`; } const construct = (data) => { currentRepo = data.currentRepo settings = data.settings locationOrigin = location.origin currentRepoPath = data.path locationPathname = location.pathname locationHref = location.href locationHostname = location.hostname let { md, packages, path } = data md = md.trim() md = extract(md, 'corifeus-header'); md = extract(md, 'corifeus-footer'); /* md = twemoji.parse(md, { folder: 'svg', ext: '.svg', }) */ let html = marked(md, { renderer: markdownRenderer }); html = html.replace(/{/g, '{').replace(/}/g, '}'); html = html.replace(/&/g, '&'); if (currentRepo === 'corifeus' && path === 'index.html') { //console.info('decorated corifeus index.html') for(let pkgName of Object.keys(packages)) { const pkg = packages[pkgName] if (pkg.corifeus.stargazers_count > 0) { const hiddenStars = ``; const stars = ` ${extractStars(pkg.corifeus.stargazers_count)}` const re = new RegExp(RegexpEscape(hiddenStars)); html = html.replace(re, stars) } } } else { //console.info('not decorated', currentRepo, path) } return html; } const RegexpEscape = function (s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); }; onmessage = function (e) { const data : any = { requestId: e.data.requestId } try { data.html = construct(e.data); data.success = true } catch (e) { console.error(e) data.success = false data.errorMessage = e.message } postMessage(data) } tsconfig.app.json000066400000000000000000000004611516074440300143510ustar00rootroot00000000000000/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", "types": [ "node" ] }, "files": [ "src/main.ts", "src/polyfills.ts" ], "include": [ "src/**/*.d.ts" ] } tsconfig.json000066400000000000000000000007641516074440300136000ustar00rootroot00000000000000/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "compileOnSave": false, "compilerOptions": { "allowSyntheticDefaultImports": true, "baseUrl": "./", "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "downlevelIteration": true, "experimentalDecorators": true, "moduleResolution": "node", "importHelpers": true, "target": "es2015", "module": "es2020", "lib": [ "es2018", "dom" ] } } tsconfig.spec.json000066400000000000000000000005151516074440300145230ustar00rootroot00000000000000/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/spec", "types": [ "jasmine" ] }, "files": [ "src/test.ts", "src/polyfills.ts" ], "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" ] } tsconfig.worker.json000066400000000000000000000004631516074440300151040ustar00rootroot00000000000000/* To learn more about this file see: https://angular.io/config/tsconfig. */ { "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/worker", "lib": [ "es2018", "webworker" ], "types": [ "node" ] }, "include": [ "src/**/*.worker.ts" ] }