From cf85f8dd781a7dfefcb2d6e1b538caa997774210 Mon Sep 17 00:00:00 2001 From: subhahu Date: Sat, 2 Feb 2019 15:35:55 +0530 Subject: [PATCH] adding webp image using webp images instead of jpg,png Update search-bar.component.html Update results.component.html Update help.component.html Update dropdown.component.html Update contact.component.html Update styles.css Update styles.css Fix #1388 : did you mean content is now clickable Adding rel="noopener" for fixing cross-link links Fixing not found result page Update results.component.ts Update results.component.ts Update results.component.html Update results.component.html Refactors Theme Component and added tests for coverage Merge branch 'development' into patch-17 Update contact.component.html Merge branch 'development' into patch-17 Update dropdown.component.html Update dropdown.component.html Update help.component.html Update results.component.html Update results.component.html Update search-bar.component.html Update search-bar.component.html Update results.component.html Update help.component.html Update dropdown.component.html --- src/app/actions/knowledge.ts | 4 + src/app/actions/query.ts | 2 - src/app/actions/search.ts | 4 - src/app/actions/speech.ts | 1 - src/app/contact/contact.component.css | 21 - src/app/contact/contact.component.html | 436 ++++++------------- src/app/contact/contact.component.spec.ts | 41 +- src/app/contact/contact.component.ts | 119 ++--- src/app/dropdown/dropdown.component.html | 64 +-- src/app/help/help.component.html | 26 +- src/app/reducers/index.ts | 13 +- src/app/reducers/knowledge.ts | 27 +- src/app/reducers/query.ts | 29 +- src/app/reducers/search.ts | 53 +-- src/app/reducers/speech.ts | 22 +- src/app/results/results.component.html | 24 +- src/app/results/results.component.spec.ts | 53 ++- src/app/results/results.component.ts | 3 +- src/app/search-bar/search-bar.component.html | 2 +- src/app/theme/theme.component.html | 54 ++- src/app/theme/theme.component.spec.ts | 106 +++++ src/app/theme/theme.component.ts | 12 +- src/app/utils.ts | 251 +++++++++++ src/assets/images/16x9.webp | Bin 0 -> 44 bytes src/assets/images/JsonGreen.webp | Bin 0 -> 386 bytes src/assets/images/Pslab.webp | Bin 0 -> 4706 bytes src/assets/images/RssOrange.webp | Bin 0 -> 428 bytes src/assets/images/YaCyLogo2011_60.webp | Bin 0 -> 2632 bytes src/assets/images/badgeyay.webp | Bin 0 -> 5994 bytes src/assets/images/blog.webp | Bin 0 -> 606 bytes src/assets/images/boat.webp | Bin 0 -> 194778 bytes src/assets/images/bug.webp | Bin 0 -> 926 bytes src/assets/images/code.webp | Bin 0 -> 648 bytes src/assets/images/contact.webp | Bin 0 -> 392 bytes src/assets/images/eventyay.webp | Bin 0 -> 1238 bytes src/assets/images/external.webp | Bin 0 -> 216 bytes src/assets/images/fossasia.webp | Bin 0 -> 4240 bytes src/assets/images/loading.webp | Bin 0 -> 92810 bytes src/assets/images/loklak.webp | Bin 0 -> 8518 bytes src/assets/images/meilix.webp | Bin 0 -> 1816 bytes src/assets/images/microphone.webp | Bin 0 -> 598 bytes src/assets/images/mountain.webp | Bin 0 -> 300092 bytes src/assets/images/not-found-bg.webp | Bin 0 -> 11616 bytes src/assets/images/phimp.webp | Bin 0 -> 1638 bytes src/assets/images/search.webp | Bin 0 -> 626 bytes src/assets/images/susi_60x12.webp | Bin 0 -> 7924 bytes src/assets/images/susimagicmirror.webp | Bin 0 -> 5608 bytes src/assets/images/susper.webp | Bin 0 -> 4354 bytes src/assets/images/terminal.webp | Bin 0 -> 1050 bytes src/assets/images/yaydoc.webp | Bin 0 -> 4694 bytes src/styles.css | 2 +- 51 files changed, 769 insertions(+), 600 deletions(-) create mode 100644 src/assets/images/16x9.webp create mode 100644 src/assets/images/JsonGreen.webp create mode 100644 src/assets/images/Pslab.webp create mode 100644 src/assets/images/RssOrange.webp create mode 100644 src/assets/images/YaCyLogo2011_60.webp create mode 100644 src/assets/images/badgeyay.webp create mode 100644 src/assets/images/blog.webp create mode 100644 src/assets/images/boat.webp create mode 100644 src/assets/images/bug.webp create mode 100644 src/assets/images/code.webp create mode 100644 src/assets/images/contact.webp create mode 100644 src/assets/images/eventyay.webp create mode 100644 src/assets/images/external.webp create mode 100644 src/assets/images/fossasia.webp create mode 100644 src/assets/images/loading.webp create mode 100644 src/assets/images/loklak.webp create mode 100644 src/assets/images/meilix.webp create mode 100644 src/assets/images/microphone.webp create mode 100644 src/assets/images/mountain.webp create mode 100644 src/assets/images/not-found-bg.webp create mode 100644 src/assets/images/phimp.webp create mode 100644 src/assets/images/search.webp create mode 100644 src/assets/images/susi_60x12.webp create mode 100644 src/assets/images/susimagicmirror.webp create mode 100644 src/assets/images/susper.webp create mode 100644 src/assets/images/terminal.webp create mode 100644 src/assets/images/yaydoc.webp diff --git a/src/app/actions/knowledge.ts b/src/app/actions/knowledge.ts index 841bbaf2de..22d8321a7f 100644 --- a/src/app/actions/knowledge.ts +++ b/src/app/actions/knowledge.ts @@ -1,18 +1,22 @@ import { Action } from '@ngrx/store'; import { type } from '../utils'; + export const ActionTypes = { CONTENT_CHANGE: type('[Knowledge] Content Change'), IMAGE_CHANGE: type('[Knowledge] Image Change'), DESCRIPTION_CHANGE: type('[Knowledge] Description Change') }; + export class SearchContentAction implements Action { type = ActionTypes.CONTENT_CHANGE; constructor(public payload: object) {} } + export class SearchImageAction implements Action { type = ActionTypes.IMAGE_CHANGE; constructor(public payload: object) {} } + export class DescriptionAction implements Action { type = ActionTypes.DESCRIPTION_CHANGE; constructor(public payload: object) {} diff --git a/src/app/actions/query.ts b/src/app/actions/query.ts index 487726d4ec..871830ef26 100644 --- a/src/app/actions/query.ts +++ b/src/app/actions/query.ts @@ -8,13 +8,11 @@ export const ActionTypes = { export class QueryAction implements Action { type = ActionTypes.QUERYCHANGE; - constructor(public payload: any) {} } export class QueryServerAction implements Action { type = ActionTypes.QUERYSERVER; - constructor(public payload: any) {} } diff --git a/src/app/actions/search.ts b/src/app/actions/search.ts index 691ba2ba5c..45c77f8da3 100644 --- a/src/app/actions/search.ts +++ b/src/app/actions/search.ts @@ -10,25 +10,21 @@ export const ActionTypes = { export class SearchAction implements Action { type = ActionTypes.CHANGE; - constructor(public payload: any) {} } export class ItemsAction implements Action { type = ActionTypes.ITEMS; - constructor(public payload: any) {} } export class TotalResultsAction implements Action { type = ActionTypes.TOTALRESULTS; - constructor(public payload: any) {} } export class NavigationAction implements Action { type = ActionTypes.NAVIGATION; - constructor(public payload: any) {} } diff --git a/src/app/actions/speech.ts b/src/app/actions/speech.ts index f63ed4d86e..910b1d4063 100644 --- a/src/app/actions/speech.ts +++ b/src/app/actions/speech.ts @@ -7,7 +7,6 @@ export const ActionTypes = { export class SearchAction implements Action { type = ActionTypes.CHANGE; - constructor(public payload: any) {} } diff --git a/src/app/contact/contact.component.css b/src/app/contact/contact.component.css index c5526c6e17..9dc173bad3 100644 --- a/src/app/contact/contact.component.css +++ b/src/app/contact/contact.component.css @@ -34,17 +34,6 @@ padding-left: 20px; } -.navbar-text { - padding-right: 30px; - font-size: 20px; - margin-top: 6px; -} - -.text-center { - text-align: center; - font-family: "Quicksand", sans-serif; -} - .bold { font-weight: 700; } @@ -68,12 +57,6 @@ footer{ } } - -.about-navbar { - position: relative; - top: -5px; -} - .navbar { margin-bottom: 0px !important; } @@ -131,10 +114,6 @@ footer{ font-size: 24px; } -.navbar-fixed-bottom, .navbar-fixed-top{ - position: relative !important; -} - .contact-title{ border-bottom: 1px solid #eee; } diff --git a/src/app/contact/contact.component.html b/src/app/contact/contact.component.html index 3c2e45565d..cda46cfb00 100644 --- a/src/app/contact/contact.component.html +++ b/src/app/contact/contact.component.html @@ -4,17 +4,15 @@
- - + +
-
-
+

Contact Us

-
+
- -
+ +
Susper
-

93 Mau Than Street
Can Tho
Viet Nam
Phone +84 (0) 907 65 29 27
Email: support@susper.net
Board - of Directors: Hong Phuc Dang
Susper Ltd. is registered in Can Tho, Viet Nam.

+

+ 93 Mau Than Street
+ Can Tho
+ Viet Nam
+ Phone +84 (0) 907 65 29 27
+ Email: support@susper.net
Board of Directors: Hong Phuc Dang
+ Susper Ltd. is registered in Can Tho, Viet Nam. +

-
- -
- + +
+
-
-

Report a safety or abuse issue affecting our products.
If you know of a safety or abuse problem with any of Susper's - services, we'd like to hear about it right away. Please use our contact form to report the - issue. +

+ Report a safety or abuse issue affecting our products.
+ If you know of a safety or abuse problem with any of Susper's services, we'd like to + hear about it right away. Please use our contact form to + report the issue.

-
-
- - - + + + + + +
+
- - -
- -
- -
+ +
- Contact Form - -
- - -
- + Contact Form + +
+ + +
+ +
-
- -
- - -
- + +
+ + +
+ +
-
- -
- - -
- - - - + +
+ + +
+ + + +
-
- -
- - -
- + +
+ + +
+ +
- -
- -
- - -
- + +
+ + +
+ +
- -
-
-
- -
+ +
diff --git a/src/app/contact/contact.component.spec.ts b/src/app/contact/contact.component.spec.ts index 01223d2b24..0071cafd00 100644 --- a/src/app/contact/contact.component.spec.ts +++ b/src/app/contact/contact.component.spec.ts @@ -8,9 +8,10 @@ import { HttpModule } from '@angular/http'; import { FormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; -import { ContactComponent } from '../contact/contact.component'; +import { ContactComponent } from './contact.component'; import { FooterNavbarComponent } from '../footer-navbar/footer-navbar.component'; import { ModalComponent } from 'ng2-bs3-modal/ng2-bs3-modal'; +import { validateMessage, validatePhone, validateEmail, validateName } from '../utils'; describe('Component: Contact', () => { let component: ContactComponent; @@ -18,18 +19,9 @@ describe('Component: Contact', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [ - HttpModule, - RouterTestingModule, - FormsModule - ], - declarations: [ - FooterNavbarComponent, - ContactComponent, - ModalComponent, - ] - }) - .compileComponents(); + imports: [HttpModule, RouterTestingModule, FormsModule], + declarations: [FooterNavbarComponent, ContactComponent, ModalComponent], + }).compileComponents(); })); beforeEach(() => { @@ -68,4 +60,27 @@ describe('Component: Contact', () => { expect(compiled.querySelector('app-footer-navbar')).toBeTruthy(); }); + it('validates messages correctly', () => { + expect(validateMessage('abc')).toBe(false); + expect( + validateMessage( + 'fdasfdasfsdaffffffffffffffffffffffffffffffasdfsafasdfadfdasfdasfsdaffffffffffffffffffffffffffffffasdfsafasdfad' + ) + ).toBe(true); + }); + + it('validates phone number correctly', () => { + expect(validatePhone('1234567890')).toBe(true); + expect(validatePhone('123450')).toBe(false); + }); + + it('validates name correctly', () => { + expect(validateName('susper')).toBe(true); + expect(validateName('')).toBe(false); + }); + + it('validates email correctly', () => { + expect(validateEmail('susper@gmail.com')).toBe(true); + expect(validateEmail('fdasfdasf')).toBe(false); + }); }); diff --git a/src/app/contact/contact.component.ts b/src/app/contact/contact.component.ts index 05dfda9285..c0002db0fb 100644 --- a/src/app/contact/contact.component.ts +++ b/src/app/contact/contact.component.ts @@ -1,78 +1,49 @@ -import { Component, ViewChild, OnInit, DoCheck } from '@angular/core'; +import { Component, ViewChild, OnInit } from '@angular/core'; import { ModalComponent } from 'ng2-bs3-modal/ng2-bs3-modal'; +import { validatePhone, validateEmail, validateMessage, validateName, countryCodeList } from '../utils'; + @Component({ - selector: 'app-contact', - templateUrl: './contact.component.html', - styleUrls: ['./contact.component.css'] + selector: 'app-contact', + templateUrl: './contact.component.html', + styleUrls: ['./contact.component.css'], }) -export class ContactComponent implements OnInit, DoCheck { - - @ViewChild('submitButton') submitButton; - - emailInput: string; - nameInput: string; - tpnoInput: number; - contactMessage: string = ''; - - @ViewChild('myModal') - modal: ModalComponent; - - constructor() { } - - ngOnInit() { - } - - close() { - this.modal.close(); - } - - open() { - this.modal.open(); - } - - ngDoCheck() { - this.checkValidity(); - } - - checkValidity() { - if (this.validateEmail(this.emailInput) && this.validatePhone(this.tpnoInput) && this.validateMessage(this.contactMessage) && this.validateName(this.nameInput)) { - this.submitButton.nativeElement.disabled = false; - } else { - this.submitButton.nativeElement.disabled = true; - } - } - - validateMessage(message) { - if (message && (message.length >= 100)) { - return true; - } else { - return false; - } - } - - validatePhone(phone) { - if (phone && (phone.toString().length >= 10)) { - return true; - } else { - return false; - } - } - - validateEmail(email) { - if (email) { - let re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; - return re.test(email); - } else { - return false; - } - } - - validateName(name) { - if (name && (name.length > 0)) { - return true; - } else { - return false; - } - } - +export class ContactComponent implements OnInit { + @ViewChild('submitButton') submitButton; + + emailInput: string; + nameInput: string; + phoneNumberInput: number; + contactMessage: string; + countryCodeList: any; + + @ViewChild('ContactUsModal') + modal: ModalComponent; + + constructor() {} + + ngOnInit() { + this.contactMessage = ''; + this.countryCodeList = countryCodeList; + } + + closeModal() { + this.modal.close(); + } + + openModal() { + this.modal.open(); + } + + checkValidity() { + if ( + validateEmail(this.emailInput) && + validatePhone(this.phoneNumberInput) && + validateMessage(this.contactMessage) && + validateName(this.nameInput) + ) { + this.submitButton.nativeElement.disabled = false; + } else { + this.submitButton.nativeElement.disabled = true; + } + } } diff --git a/src/app/dropdown/dropdown.component.html b/src/app/dropdown/dropdown.component.html index 3f9ee43a6c..689c8d1097 100644 --- a/src/app/dropdown/dropdown.component.html +++ b/src/app/dropdown/dropdown.component.html @@ -8,13 +8,14 @@ diff --git a/src/app/help/help.component.html b/src/app/help/help.component.html index 9c7afd6336..0661d5f11d 100644 --- a/src/app/help/help.component.html +++ b/src/app/help/help.component.html @@ -147,21 +147,21 @@

- +
- +
- +
- +
- +
- +
- +
- +
- +