Skip to content
Permalink
Browse files

remove '/kahla' form path

  • Loading branch information...
xxyzz committed Nov 11, 2018
2 parents 264dae1 + c210e9b commit 82f7a51a11e4476c9a33824ffcfbb3cbf23aa8b3
@@ -8,7 +8,7 @@
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8001",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}"
}
]
@@ -54,8 +54,7 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "kahla:build",
"port": 8001
"browserTarget": "kahla:build"
},
"configurations": {
"production": {
@@ -97,4 +96,4 @@
"prefix": "app"
}
}
}
}
@@ -86,6 +86,6 @@ export class AddFriendComponent implements OnInit {
}

public detail(id: number): void {
this.router.navigate(['/kahla/user', id]);
this.router.navigate(['/user', id]);
}
}
@@ -23,7 +23,7 @@ export class ConversationsComponent implements OnInit, OnDestroy {
this.headerService.title = 'Kahla';
this.headerService.returnButton = false;
this.headerService.button = true;
this.headerService.routerLink = '/kahla/addfriend';
this.headerService.routerLink = '/addfriend';
this.headerService.buttonIcon = 'search';
}

@@ -40,20 +40,22 @@ export class ConversationsComponent implements OnInit, OnDestroy {
});
}
});
this.cacheService.autoUpdateConversation(null);
if (this.messaageService.me) {
this.cacheService.autoUpdateConversation(null);
}
}

public detail(info: ContactInfo): void {
if (info.userId == null) {
this.router.navigate(['/kahla/group', info.conversationId]);
this.router.navigate(['/group', info.conversationId]);
} else {
this.router.navigate(['/kahla/user', info.userId]);
this.router.navigate(['/user', info.userId]);
}
}

public talk(id: number): void {
PullToRefresh.destroyAll();
this.router.navigate(['/kahla/talking', id]);
this.router.navigate(['/talking', id]);
}

public ngOnDestroy(): void {
@@ -29,7 +29,7 @@ export class CreateGroupComponent {
public createGroup(): void {
this.groupsApiService.CreateGroup(this.groupName.trim()).subscribe((response) => {
if (response.code === 0) {
this.router.navigate(['/kahla/talking', response.value]);
this.router.navigate(['/talking', response.value]);
} else if (response.code === -7) {
Swal('Can not create group', response.message, 'error');
} else if (response.code === -10) {
@@ -23,7 +23,7 @@ export class FriendsComponent implements OnInit, OnDestroy {
this.headerService.title = 'Friends';
this.headerService.returnButton = false;
this.headerService.button = true;
this.headerService.routerLink = '/kahla/addfriend';
this.headerService.routerLink = '/addfriend';
this.headerService.buttonIcon = 'plus';
}
public ngOnInit(): void {
@@ -44,9 +44,9 @@ export class FriendsComponent implements OnInit, OnDestroy {

public detail(info: ContactInfo): void {
if (info.userId == null) {
this.router.navigate(['/kahla/group', info.conversationId]);
this.router.navigate(['/group', info.conversationId]);
} else {
this.router.navigate(['/kahla/user', info.userId]);
this.router.navigate(['/user', info.userId]);
}
}

@@ -63,7 +63,7 @@ export class GroupComponent implements OnInit {
if (response.code === 0) {
Swal('Success', response.message, 'success');
this.cache.autoUpdateConversation(null);
this.router.navigate(['/kahla/friends']);
this.router.navigate(['/friends']);
} else {
Swal('Error', response.message, 'error');
}
@@ -73,10 +73,10 @@ export class GroupComponent implements OnInit {
}

public talk(id: number): void {
this.router.navigate(['/kahla/talking', id]);
this.router.navigate(['/talking', id]);
}

public user(id: string): void {
this.router.navigate(['kahla/user', id]);
this.router.navigate(['/user', id]);
}
}
@@ -39,7 +39,7 @@ export class RegisterComponent {
this.authApiService.AuthByPassword(this.email, this.password)
.subscribe(p => {
if (p.code === 0) {
this.router.navigate(['/kahla/conversations']);
this.router.navigate(['/conversations']);
this.initService.init();
} else {
Swal('Sign in failed', 'An error occured while signing in.', 'error');
@@ -32,7 +32,7 @@ export class SettingsComponent {
public SignOut(): void {
this.authApiService.LogOff().subscribe(() => {
this.initSerivce.destory();
this.router.navigate(['/kahla/signin']);
this.router.navigate(['/signin']);
});
}
}
@@ -39,7 +39,7 @@ export class SignInComponent implements OnInit {
}))
.subscribe(t => {
if (t.code === 0) {
this.router.navigate(['/kahla/conversations']);
this.router.navigate(['/conversations']);
this.initService.init();
} else if (t.code === -10) {
Swal('Sign in failed', (t as AiurProtocal as AiurCollection<string>).items[0], 'error');
@@ -62,10 +62,10 @@ export class TalkingComponent implements OnInit, OnDestroy {
this.headerService.button = true;
if (conversation.anotherUserId) {
this.headerService.buttonIcon = 'user';
this.headerService.routerLink = `/kahla/user/${conversation.anotherUserId}`;
this.headerService.routerLink = `/user/${conversation.anotherUserId}`;
} else {
this.headerService.buttonIcon = `users`;
this.headerService.routerLink = `/kahla/group/${conversation.id}`;
this.headerService.routerLink = `/group/${conversation.id}`;
}
});
}
@@ -55,7 +55,7 @@ export class UserComponent implements OnInit {
.subscribe(response => {
Swal('Success', response.message, 'success');
this.cacheService.autoUpdateConversation(null);
this.router.navigate(['/kahla/friends']);
this.router.navigate(['/friends']);
});
} else {
}
@@ -75,6 +75,6 @@ export class UserComponent implements OnInit {
}

public talk(id: number): void {
this.router.navigate(['/kahla/talking', id]);
this.router.navigate(['/talking', id]);
}
}
@@ -59,7 +59,7 @@ export class UserDetailComponent implements OnInit {
.subscribe((t) => {
if (t.code === 0) {
this.messageService.me = Object.assign({}, this.user);
this.router.navigate(['/kahla/settings']);
this.router.navigate(['/settings']);
} else if (t.code === -10) {
Swal(t.message, (t as AiurProtocal as AiurCollection<string>).items[0], 'error');
} else {
@@ -17,22 +17,22 @@ import { GroupComponent } from '../Controllers/group.component';
import { ChangePasswordComponent } from '../Controllers/changePassword.component';

const routes: Routes = [
{ path: '', redirectTo: '/kahla/conversations', pathMatch: 'full' },
{ path: 'kahla/conversations', component: ConversationsComponent },
{ path: 'kahla/friends', component: FriendsComponent },
{ path: 'kahla/addfriend', component: AddFriendComponent },
{ path: 'kahla/settings', component: SettingsComponent },
{ path: 'kahla/friendrequests', component: FriendRequestsComponent },
{ path: 'kahla/talking/:id', component: TalkingComponent },
{ path: 'kahla/user/:id', component: UserComponent },
{ path: 'kahla/signin', component: SignInComponent },
{ path: 'kahla/register', component: RegisterComponent },
{ path: 'kahla/about', component: AboutComponent },
{ path: 'kahla/userInforDet', component: UserDetailComponent },
{ path: 'kahla/create-group', component: CreateGroupComponent },
{ path: 'kahla/join-group', component: JoinGroupComponent },
{ path: 'kahla/group/:id', component: GroupComponent },
{ path: 'kahla/changepassword', component: ChangePasswordComponent }
{ path: '', redirectTo: '/conversations', pathMatch: 'full' },
{ path: 'conversations', component: ConversationsComponent },
{ path: 'friends', component: FriendsComponent },
{ path: 'addfriend', component: AddFriendComponent },
{ path: 'settings', component: SettingsComponent },
{ path: 'friendrequests', component: FriendRequestsComponent },
{ path: 'talking/:id', component: TalkingComponent },
{ path: 'user/:id', component: UserComponent },
{ path: 'signin', component: SignInComponent },
{ path: 'register', component: RegisterComponent },
{ path: 'about', component: AboutComponent },
{ path: 'userInforDet', component: UserDetailComponent },
{ path: 'create-group', component: CreateGroupComponent },
{ path: 'join-group', component: JoinGroupComponent },
{ path: 'group/:id', component: GroupComponent },
{ path: 'changepassword', component: ChangePasswordComponent }
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
@@ -56,7 +56,7 @@ export class FilesApiService {
}

public UploadIcon(formData: FormData): Observable<number | UploadFile> {
const req = new HttpRequest('POST', `${ApiService.serverAddress + FilesApiService.serverPath}/UploadMedia`, formData, {
const req = new HttpRequest('POST', `${ApiService.serverAddress + FilesApiService.serverPath}/UploadIcon`, formData, {
reportProgress: true,
withCredentials: true
});
@@ -23,7 +23,7 @@ export class InitService {
this.checkService.checkVersion(false);
this.authApiService.SignInStatus().subscribe(signInStatus => {
if (signInStatus.value === false) {
this.router.navigate(['/kahla/signin']);
this.router.navigate(['/signin']);
} else {
this.authApiService.Me().subscribe(p => {
if (p.code === 0) {
@@ -51,7 +51,7 @@ export class Notify {
}

public ShowNewMessage(evt: NewMessageEvent, myId: string): void {
const openUrl = `/kahla/talking/${evt.conversationId}`;
const openUrl = `/talking/${evt.conversationId}`;
if (evt.sender.id !== myId) {
evt.content = AES.decrypt(evt.content, evt.aesKey).toString(enc.Utf8);
if (evt.content.startsWith('[img]')) {
@@ -45,9 +45,19 @@ export class UploadService {
}

private encryptThenSend(response: number | UploadFile, fileType: number, conversationID: number, aesKey: string): void {
let interval;
if (Number(response)) {
UploadService.progress = <number>response;
interval = setInterval(() => {
if (<number>response > UploadService.progress) {
UploadService.progress = <number>response;
}
}, 100);
if (<number>response === 100) {
UploadService.progress = 100;
clearInterval(interval);
}
} else if (response != null) {
clearInterval(interval);
if ((<UploadFile>response).code === 0) {
let encedMessages;
switch (fileType) {
@@ -257,7 +257,7 @@
}

i {
font-size: 2.5em;
font-size: 1.5rem;
}

.inputfile:focus + label,
@@ -286,7 +286,14 @@ progress {

.chat-text a {
text-decoration: none;
color: #000;
}

.left .chat-text a {
color: #9baec8;
}

.right .chat-text a {
color: #d9e1e8;
}

a h5 {
@@ -302,6 +309,7 @@ a h5 {
.file {
display: grid;
grid-template-columns: 40px 2fr;
align-items: center;
}

.file div {
@@ -314,4 +322,4 @@ a h5 {
grid-column-start: 2;
text-align: right;
word-break: break-all;
}
}
@@ -1,4 +1,4 @@
<app-header title="Kahla" i18n-title="@@Kahla" Button="true" ButtonIcon="search" RouterLink="/kahla/addfriend"></app-header>
<app-header title="Kahla" i18n-title="@@Kahla" Button="true" ButtonIcon="search" RouterLink="/addfriend"></app-header>
<div id="main">
<div class="conversation" *ngFor="let inf of cacheService.cachedData.conversations" (click)="talk(inf.conversationId)">
<img class="user-img" src="{{inf.avatarURL ? inf.avatarURL : loadingImgURL}}?w=100&h=100" (click)="detail(inf)"/>
@@ -1,15 +1,15 @@
<app-header title="Friends" i18n-title="@@Friends" Button="true" ButtonIcon="plus" RouterLink="/kahla/addfriend"></app-header>
<app-header title="Friends" i18n-title="@@Friends" Button="true" ButtonIcon="plus" RouterLink="/addfriend"></app-header>

<div class="friends-header" id="main">
<a class="friends-button" routerLink="/kahla/addfriend">
<a class="friends-button" routerLink="/addfriend">
<div class="icon">
<i class="fa fa-user-plus"></i>
</div>
<div class="words" i18n="@@SearchFriend">
Search Friend
</div>
</a>
<a class="friends-button" routerLink="/kahla/friendrequests">
<a class="friends-button" routerLink="/friendrequests">
<div class="icon">
<i class="fa fa-check-square-o"></i>
<div class="reddot" *ngIf="cacheService.totalRequests > 0 && cacheService.totalRequests < 100">
@@ -23,15 +23,15 @@
Requests
</div>
</a>
<a class="friends-button" routerLink="/kahla/join-group">
<a class="friends-button" routerLink="/join-group">
<div class="icon">
<i class="fa fa-user-plus"></i>
</div>
<div class="words" i18n="@@JoinGroup">
Join Group
</div>
</a>
<a class="friends-button" routerLink="/kahla/create-group">
<a class="friends-button" routerLink="/create-group">
<div class="icon">
<i class="fa fa-users"></i>
</div>
@@ -1,7 +1,7 @@

<div class="nav-bar-holder"></div>
<div class="nav-bar">
<a class="nav-item" routerLink="/kahla/conversations" routerLinkActive="current">
<a class="nav-item" routerLink="/conversations" routerLinkActive="current">
<div class="icon">
<i class="fa fa-comment-o"></i>
<div *ngIf="cacheService.totalUnread > 0 && cacheService.totalUnread < 100" class="reddot">
@@ -15,7 +15,7 @@
Kahla
</div>
</a>
<a class="nav-item" routerLink="/kahla/friends" routerLinkActive="current">
<a class="nav-item" routerLink="/friends" routerLinkActive="current">
<div class="icon">
<i class="fa fa-address-book-o"></i>
<div *ngIf="cacheService.totalRequests > 0 && cacheService.totalRequests < 100" class="reddot">
@@ -29,12 +29,12 @@
Friends
</div>
</a>
<a class="nav-item" routerLink="/kahla/settings" routerLinkActive="current">
<a class="nav-item" routerLink="/settings" routerLinkActive="current">
<div class="icon">
<i class="fa fa-user-o"></i>
</div>
<div class="words" i18n="@@Me">
Me
</div>
</a>
</div>
</div>

0 comments on commit 82f7a51

Please sign in to comment.
You can’t perform that action at this time.