├── src
├── assets
│ ├── .gitkeep
│ └── scenery.png
├── app
│ ├── app.component.css
│ ├── feedback
│ │ ├── index.ts
│ │ ├── entity
│ │ │ ├── feedback.ts
│ │ │ └── rectangle.ts
│ │ ├── feedback-rectangle
│ │ │ ├── feedback-rectangle.component.css
│ │ │ ├── feedback-rectangle.component.html
│ │ │ └── feedback-rectangle.component.ts
│ │ ├── feedback.module.ts
│ │ ├── feedback-toolbar
│ │ │ ├── feedback-toolbar.component.css
│ │ │ ├── feedback-toolbar.component.html
│ │ │ └── feedback-toolbar.component.ts
│ │ ├── feedback-dialog
│ │ │ ├── feedback-dialog.component.html
│ │ │ ├── feedback-dialog.component.css
│ │ │ └── feedback-dialog.component.ts
│ │ ├── feedback.directive.ts
│ │ └── feedback.service.ts
│ ├── app.component.ts
│ ├── app.module.ts
│ ├── app.component.spec.ts
│ └── app.component.html
├── favicon.ico
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── typings.d.ts
├── styles.css
├── tsconfig.app.json
├── index.html
├── main.ts
├── tsconfig.spec.json
├── test.ts
└── polyfills.ts
├── e2e
├── app.po.ts
├── tsconfig.e2e.json
└── app.e2e-spec.ts
├── .editorconfig
├── tsconfig.json
├── .gitignore
├── protractor.conf.js
├── karma.conf.js
├── LICENSE
├── package.json
├── tslint.json
├── README.md
└── angular.json
/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/app.component.css:
--------------------------------------------------------------------------------
1 | div img {
2 | display: inline-block;
3 | }
4 |
--------------------------------------------------------------------------------
/src/app/feedback/index.ts:
--------------------------------------------------------------------------------
1 | export { FeedbackModule } from './feedback.module';
2 |
--------------------------------------------------------------------------------
/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RickonChen/feedback/HEAD/src/favicon.ico
--------------------------------------------------------------------------------
/src/assets/scenery.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/RickonChen/feedback/HEAD/src/assets/scenery.png
--------------------------------------------------------------------------------
/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/src/app/feedback/entity/feedback.ts:
--------------------------------------------------------------------------------
1 | export class Feedback {
2 | public description: string;
3 | public screenshot: string;
4 | }
5 |
--------------------------------------------------------------------------------
/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | /* SystemJS module definition */
2 | declare var module: NodeModule;
3 | interface NodeModule {
4 | id: string;
5 | }
6 |
--------------------------------------------------------------------------------
/src/styles.css:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 | @import "~@angular/material/prebuilt-themes/deeppurple-amber.css";
3 | body{
4 | background-color: white;
5 | }
6 |
--------------------------------------------------------------------------------
/e2e/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class FeedbackPage {
4 | navigateTo() {
5 | return browser.get('/');
6 | }
7 |
8 | getParagraphText() {
9 | return element(by.css('app-root h1')).getText();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "types": [],
6 | "moduleResolution": "node"
7 | },
8 | "exclude": [
9 | "test.ts",
10 | "**/*.spec.ts"
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/e2e",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "types": [
8 | "jasmine",
9 | "jasminewd2",
10 | "node"
11 | ]
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/src/app/feedback/entity/rectangle.ts:
--------------------------------------------------------------------------------
1 | export class Rectangle {
2 | public startX: number;
3 | public startY: number;
4 | public width: number;
5 | public height: number;
6 | public color: string;
7 | public windowScrollY: number = window.scrollY;
8 | public windowScrollX: number = window.scrollX;
9 | }
10 |
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-root',
5 | templateUrl: './app.component.html',
6 | styleUrls: ['./app.component.css']
7 | })
8 | export class AppComponent {
9 | title = 'app';
10 | public onSend(val) {
11 | console.log(val);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Feedback
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/e2e/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { FeedbackPage } from './app.po';
2 |
3 | describe('feedback App', () => {
4 | let page: FeedbackPage;
5 |
6 | beforeEach(() => {
7 | page = new FeedbackPage();
8 | });
9 |
10 | it('should display welcome message', () => {
11 | page.navigateTo();
12 | expect(page.getParagraphText()).toEqual('Welcome to app!!');
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic().bootstrapModule(AppModule);
12 |
--------------------------------------------------------------------------------
/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // The file contents for the current environment will overwrite these during build.
2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do
3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead.
4 | // The list of which env maps to which file can be found in `.angular-cli.json`.
5 |
6 | export const environment = {
7 | production: false
8 | };
9 |
--------------------------------------------------------------------------------
/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "baseUrl": "",
8 | "types": [
9 | "jasmine",
10 | "node"
11 | ]
12 | },
13 | "files": [
14 | "test.ts",
15 | "polyfills.ts"
16 | ],
17 | "include": [
18 | "**/*.spec.ts",
19 | "**/*.d.ts"
20 | ]
21 | }
22 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "module": "es2015",
9 | "moduleResolution": "node",
10 | "emitDecoratorMetadata": true,
11 | "experimentalDecorators": true,
12 | "target": "es5",
13 | "typeRoots": [
14 | "node_modules/@types"
15 | ],
16 | "lib": [
17 | "es2017",
18 | "dom"
19 | ],
20 | "paths": {
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import { BrowserModule } from '@angular/platform-browser';
2 | import { NgModule } from '@angular/core';
3 | import { FeedbackModule } from './feedback';
4 | import { AppComponent } from './app.component';
5 | import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
6 | import {MatButtonModule} from '@angular/material';
7 | @NgModule({
8 | declarations: [
9 | AppComponent
10 | ],
11 | imports: [
12 | BrowserModule,
13 | FeedbackModule,
14 | BrowserAnimationsModule,
15 | MatButtonModule
16 | ],
17 | providers: [],
18 | bootstrap: [AppComponent]
19 | })
20 | export class AppModule { }
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 |
8 | # dependencies
9 | /node_modules
10 |
11 | # IDEs and editors
12 | /.idea
13 | .project
14 | .classpath
15 | .c9/
16 | *.launch
17 | .settings/
18 | *.sublime-workspace
19 |
20 | # IDE - VSCode
21 | .vscode/*
22 | !.vscode/settings.json
23 | !.vscode/tasks.json
24 | !.vscode/launch.json
25 | !.vscode/extensions.json
26 |
27 | # misc
28 | /.sass-cache
29 | /connect.lock
30 | /coverage
31 | /libpeerconnection.log
32 | npm-debug.log
33 | testem.log
34 | /typings
35 |
36 | # e2e
37 | /e2e/*.js
38 | /e2e/*.map
39 |
40 | # System Files
41 | .DS_Store
42 | Thumbs.db
43 |
--------------------------------------------------------------------------------
/src/app/feedback/feedback-rectangle/feedback-rectangle.component.css:
--------------------------------------------------------------------------------
1 | .rect {
2 | position: fixed;
3 | background: none;
4 | z-index: 3;
5 | }
6 | .highlight:not(.noHover):hover {
7 | cursor: default;
8 | background: rgba(55, 131, 249, 0.2);
9 | }
10 | .hide {
11 | background-color: black;
12 | }
13 | .hide:not(.noHover):hover{
14 | background-color: rgba(31, 31, 31, 0.75);
15 | }
16 |
17 | .rect .close {
18 | width: 24px;
19 | height: 24px;
20 | background: #FFF;
21 | border-radius: 50%;
22 | justify-content: center;
23 | align-items: center;
24 | color: #999;
25 | position: absolute;
26 | right: -12px;
27 | top: -12px;
28 | cursor: pointer;
29 | display: flex;
30 | user-select: none;
31 | }
32 |
--------------------------------------------------------------------------------
/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // Protractor configuration file, see link for more information
2 | // https://github.com/angular/protractor/blob/master/lib/config.ts
3 |
4 | const { SpecReporter } = require('jasmine-spec-reporter');
5 |
6 | exports.config = {
7 | allScriptsTimeout: 11000,
8 | specs: [
9 | './e2e/**/*.e2e-spec.ts'
10 | ],
11 | capabilities: {
12 | 'browserName': 'chrome'
13 | },
14 | directConnect: true,
15 | baseUrl: 'http://localhost:4200/',
16 | framework: 'jasmine',
17 | jasmineNodeOpts: {
18 | showColors: true,
19 | defaultTimeoutInterval: 30000,
20 | print: function() {}
21 | },
22 | onPrepare() {
23 | require('ts-node').register({
24 | project: 'e2e/tsconfig.e2e.json'
25 | });
26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27 | }
28 | };
29 |
--------------------------------------------------------------------------------
/src/app/feedback/feedback-rectangle/feedback-rectangle.component.html:
--------------------------------------------------------------------------------
1 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/0.13/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client:{
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
20 | fixWebpackSourcePaths: true
21 | },
22 |
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false
30 | });
31 | };
32 |
--------------------------------------------------------------------------------
/src/app/feedback/feedback-rectangle/feedback-rectangle.component.ts:
--------------------------------------------------------------------------------
1 | import {Component, EventEmitter, HostListener, Input, Output} from '@angular/core';
2 | import {Rectangle} from '../entity/rectangle';
3 | import {FeedbackService} from '../feedback.service';
4 |
5 | @Component({
6 | selector: 'feedback-rectangle',
7 | templateUrl: './feedback-rectangle.component.html',
8 | styleUrls: ['./feedback-rectangle.component.css']
9 | })
10 |
11 | export class FeedbackRectangleComponent {
12 | @Input()
13 | public rectangle: Rectangle;
14 | @Input()
15 | public noHover: boolean;
16 | @Output()
17 | public close = new EventEmitter();
18 | public showCloseTag: boolean = false;
19 |
20 | constructor(public feedbackService: FeedbackService) {
21 | }
22 |
23 | @HostListener('mouseenter')
24 | public onMouseEnter(): void {
25 | this.showCloseTag = this.noHover === false;
26 | }
27 |
28 | @HostListener('mouseleave')
29 | public onMouseLeave(): void {
30 | this.showCloseTag = false;
31 | }
32 |
33 | public onClose(): void {
34 | this.close.emit();
35 | }
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, async } from '@angular/core/testing';
2 |
3 | import { AppComponent } from './app.component';
4 |
5 | describe('AppComponent', () => {
6 | beforeEach(async(() => {
7 | TestBed.configureTestingModule({
8 | declarations: [
9 | AppComponent
10 | ],
11 | }).compileComponents();
12 | }));
13 |
14 | it('should create the app', async(() => {
15 | const fixture = TestBed.createComponent(AppComponent);
16 | const app = fixture.debugElement.componentInstance;
17 | expect(app).toBeTruthy();
18 | }));
19 |
20 | it(`should have as title 'app'`, async(() => {
21 | const fixture = TestBed.createComponent(AppComponent);
22 | const app = fixture.debugElement.componentInstance;
23 | expect(app.title).toEqual('app');
24 | }));
25 |
26 | it('should render title in a h1 tag', async(() => {
27 | const fixture = TestBed.createComponent(AppComponent);
28 | fixture.detectChanges();
29 | const compiled = fixture.debugElement.nativeElement;
30 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!!');
31 | }));
32 | });
33 |
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Welcome to {{title}}!!
5 |
6 |

7 |
8 | Here are some links to help you start:
9 |
10 | -
11 |
12 |
13 | -
14 |
15 |
16 | -
17 |
18 |
19 |
22 |
23 |
24 |
25 |

26 |

27 |

28 |

29 |

30 |

31 |
32 |
33 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | The MIT License (MIT)
3 |
4 | Copyright (c) 2017 RickonChen
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in all
14 | copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 |
--------------------------------------------------------------------------------
/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/long-stack-trace-zone';
4 | import 'zone.js/dist/proxy.js';
5 | import 'zone.js/dist/sync-test';
6 | import 'zone.js/dist/jasmine-patch';
7 | import 'zone.js/dist/async-test';
8 | import 'zone.js/dist/fake-async-test';
9 | import { getTestBed } from '@angular/core/testing';
10 | import {
11 | BrowserDynamicTestingModule,
12 | platformBrowserDynamicTesting
13 | } from '@angular/platform-browser-dynamic/testing';
14 |
15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
16 | declare const __karma__: any;
17 | declare const require: any;
18 |
19 | // Prevent Karma from running prematurely.
20 | __karma__.loaded = function () {};
21 |
22 | // First, initialize the Angular testing environment.
23 | getTestBed().initTestEnvironment(
24 | BrowserDynamicTestingModule,
25 | platformBrowserDynamicTesting()
26 | );
27 | // Then we find all the tests.
28 | const context = require.context('./', true, /\.spec\.ts$/);
29 | // And load the modules.
30 | context.keys().map(context);
31 | // Finally, start Karma to run the tests.
32 | __karma__.start();
33 |
--------------------------------------------------------------------------------
/src/app/feedback/feedback.module.ts:
--------------------------------------------------------------------------------
1 | import {NgModule} from '@angular/core';
2 | import {CommonModule} from '@angular/common';
3 | import {FormsModule} from '@angular/forms';
4 | import {FeedbackDialogComponent} from './feedback-dialog/feedback-dialog.component';
5 | import {FeedbackToolbarComponent} from './feedback-toolbar/feedback-toolbar.component';
6 | import {FeedbackRectangleComponent} from './feedback-rectangle/feedback-rectangle.component';
7 | import {
8 | MatDialogModule,
9 | MatButtonModule,
10 | MatIconModule,
11 | MatInputModule,
12 | MatTooltipModule,
13 | MatCheckboxModule,
14 | MatProgressSpinnerModule
15 | } from '@angular/material';
16 | import {FeedbackService} from './feedback.service';
17 | import {FeedbackDirective} from './feedback.directive';
18 |
19 | @NgModule({
20 | declarations: [
21 | FeedbackDialogComponent,
22 | FeedbackToolbarComponent,
23 | FeedbackRectangleComponent,
24 | FeedbackDirective
25 | ],
26 | imports: [
27 | MatDialogModule,
28 | MatButtonModule,
29 | MatIconModule,
30 | MatInputModule,
31 | MatTooltipModule,
32 | CommonModule,
33 | FormsModule,
34 | MatCheckboxModule,
35 | MatProgressSpinnerModule
36 | ],
37 | exports: [
38 | FeedbackDirective
39 | ],
40 | entryComponents: [
41 | FeedbackDialogComponent
42 | ],
43 | providers: [
44 | FeedbackService
45 | ]
46 | })
47 | export class FeedbackModule {
48 | }
49 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "feedback",
3 | "version": "0.0.0",
4 | "license": "MIT",
5 | "scripts": {
6 | "ng": "ng",
7 | "start": "ng serve",
8 | "test": "ng test",
9 | "lint": "ng lint",
10 | "e2e": "ng e2e"
11 | },
12 | "private": true,
13 | "dependencies": {
14 | "@angular/animations": "^6.1.10",
15 | "@angular/common": "^6.1.10",
16 | "@angular/compiler": "^6.1.10",
17 | "@angular/core": "^6.1.10",
18 | "@angular/forms": "^6.1.10",
19 | "@angular/http": "^6.1.10",
20 | "@angular/platform-browser": "^6.1.10",
21 | "@angular/platform-browser-dynamic": "^6.1.10",
22 | "@angular/router": "^6.1.10",
23 | "@angular/material": "^6.4.7",
24 | "@angular/cdk": "^6.4.7",
25 | "core-js": "^2.4.1",
26 | "html2canvas": "^1.0.0-alpha.12",
27 | "rxjs": "^6.3.3",
28 | "zone.js": "^0.8.26"
29 | },
30 | "devDependencies": {
31 | "@angular-devkit/build-angular": "^0.10.5",
32 | "@angular-devkit/build-ng-packagr": "^0.10.5",
33 | "@angular/cli": "~6.2.4",
34 | "@angular/compiler-cli": "^6.1.0",
35 | "@angular/language-service": "^6.1.0",
36 | "@types/jasmine": "~2.8.8",
37 | "@types/jasminewd2": "~2.0.3",
38 | "@types/node": "~8.9.4",
39 | "codelyzer": "~4.3.0",
40 | "jasmine-core": "~2.99.1",
41 | "jasmine-spec-reporter": "~4.2.1",
42 | "karma": "^3.1.1",
43 | "karma-chrome-launcher": "~2.2.0",
44 | "karma-coverage-istanbul-reporter": "~2.0.1",
45 | "karma-jasmine": "~1.1.2",
46 | "karma-jasmine-html-reporter": "^0.2.2",
47 | "ng-packagr": "^4.4.0",
48 | "protractor": "~5.4.0",
49 | "ts-node": "~7.0.0",
50 | "tsickle": ">=0.29.0",
51 | "tslib": "^1.9.0",
52 | "tslint": "~5.11.0",
53 | "typescript": "~2.9.2"
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/app/feedback/feedback-toolbar/feedback-toolbar.component.css:
--------------------------------------------------------------------------------
1 | .toolbar {
2 | align-items: center;
3 | background-color: white;
4 | border-radius: 2px;
5 | box-shadow: rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px, rgba(0, 0, 0, 0.2) 0px 11px 15px -7px;
6 | cursor: pointer;
7 | display: -webkit-inline-flex;
8 | flex-direction: row;
9 | height: 56px;
10 | min-width: 232px;
11 | pointer-events: auto;
12 | overflow: visible;
13 | position: absolute;
14 | margin: 0 auto;
15 | width: 228px;
16 | bottom: 0;
17 | top: 25%;
18 | left: 0;
19 | right: 0;
20 | z-index: 999;
21 | }
22 |
23 | .move-toolbar {
24 | cursor: -webkit-grab;
25 | height: 56px;
26 | padding: 0px 12px;
27 | position: relative;
28 | }
29 |
30 | .move-toolbar:active {
31 | cursor: -webkit-grabbing;
32 | }
33 |
34 | .toggle {
35 | display: inline-block;
36 | position: relative;
37 | height: 36px;
38 | width: 36px;
39 | }
40 |
41 | .toggle-decorator {
42 | left: 0px;
43 | position: absolute;
44 | top: 0px;
45 | }
46 |
47 | .highlight-toggle {
48 | align-items: center;
49 | background-color: rgb(255, 255, 255);
50 | border: none;
51 | box-sizing: border-box;
52 | cursor: pointer;
53 | display: -webkit-flex;
54 | justify-content: center;
55 | outline: none;
56 | padding: 10px;
57 | pointer-events: auto;
58 | position: relative;
59 | height: 56px;
60 | width: 56px;
61 | }
62 |
63 | .deepen-color {
64 | background-color: rgb(224, 224, 224) !important;
65 | }
66 |
67 | .hide-toggle {
68 | align-items: center;
69 | background-color: rgb(255, 255, 255);
70 | border: none;
71 | box-sizing: border-box;
72 | cursor: pointer;
73 | display: -webkit-flex;
74 | justify-content: center;
75 | outline: none;
76 | padding: 10px;
77 | pointer-events: auto;
78 | position: relative;
79 | height: 56px;
80 | width: 56px;
81 | }
82 |
83 | .merge-button {
84 | padding: 0 !important;
85 | margin: 0 10px 0 10px !important;
86 | min-width: 56px;
87 | color: #4285f4;
88 | }
89 |
--------------------------------------------------------------------------------
/src/app/feedback/feedback-dialog/feedback-dialog.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{vars['title']}}
5 |
6 |
7 |
8 |
9 |
{{vars['placeholder']}}
10 |
11 |
16 |
17 |
18 | {{vars['checkboxLabel']}}
19 |
20 |
21 |
22 |
23 |
24 |
25 |
29 |
{{vars['editTip']}}
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | {{vars['drawRectTip']}}
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/src/app/feedback/feedback.directive.ts:
--------------------------------------------------------------------------------
1 | import {Directive, HostListener, EventEmitter, Output, Input, OnInit} from '@angular/core';
2 | import {MatDialog} from '@angular/material';
3 | import {FeedbackDialogComponent} from './feedback-dialog/feedback-dialog.component';
4 | import {FeedbackService} from './feedback.service';
5 | import {Overlay} from '@angular/cdk/overlay';
6 |
7 | @Directive({selector: '[feedback]'})
8 | export class FeedbackDirective implements OnInit {
9 | private overlay: Overlay;
10 | @Input() title: string = 'Send feedback';
11 | @Input() placeholder: string = 'Describe your issue or share your ideas';
12 | @Input() editTip = 'Click to highlight or hide info';
13 | @Input() checkboxLabel = 'Include screenshot';
14 | @Input() cancelLabel = 'CANCEL';
15 | @Input() sendLabel = 'SEND';
16 | @Input() moveToolbarTip = 'move toolbar';
17 | @Input() drawRectTip = 'Draw using yellow to highlight issues or black to hide sensitive info';
18 | @Input() highlightTip = 'highlight issues';
19 | @Input() hideTip = 'hide sensitive info';
20 | @Input() editDoneLabel = 'DONE';
21 | @Output() public send = new EventEmitter