Skip to content

Commit

Permalink
spacing fixes and sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
mehanix committed Mar 15, 2021
1 parent a473d3a commit a674534
Show file tree
Hide file tree
Showing 11 changed files with 182 additions and 184 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>MyApp</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content original-src="index.html" src="https://localhost:8100" />
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
Expand Down
59 changes: 29 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@capacitor/core": "1.0.0",
"@ionic-native/core": "^5.0.0",
"@ionic-native/local-notifications": "^5.10.0",
"@ionic-native/social-sharing": "^5.10.0",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/sqlite": "^5.10.0",
"@ionic-native/sqlite-porter": "^5.10.0",
Expand All @@ -34,8 +35,10 @@
"cordova-android": "8.0.0",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-local-notification": "git+https://github.com/katzer/cordova-plugin-local-notifications.git",
"cordova-plugin-x-socialsharing": "^5.4.7",
"cordova-sqlite-storage": "3.2.0",
"core-js": "^2.5.4",
"es6-promise-plugin": "^4.2.2",
"firebase": "^5.9.3",
"rxjs": "~6.3.3",
"uk.co.workingedge.cordova.plugin.sqliteporter": "^1.1.0",
Expand Down Expand Up @@ -83,7 +86,10 @@
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-local-notification": {}
"cordova-plugin-local-notification": {},
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
}
},
"platforms": [
"android"
Expand Down
59 changes: 30 additions & 29 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';

const routes: Routes = [
{ path: '', redirectTo: 'welcome', pathMatch: 'full' },

{ path: 'welcome', loadChildren: './setup/welcome/welcome.module#WelcomePageModule' },
{ path: 'topics', loadChildren: './setup/topics/topics.module#TopicsPageModule' },
{ path: 'timeset', loadChildren: './setup/timeset/timeset.module#TimesetPageModule' },
{ path: 'lesson-select', loadChildren: './main/lesson-select/lesson-select.module#LessonSelectPageModule' },
{ path: 'lesson-view', loadChildren: './main/lesson-view/lesson-view.module#LessonViewPageModule' },
{ path: 'topic-select', loadChildren: './main/topic-select/topic-select.module#TopicSelectPageModule' },
{ path: 'settings', loadChildren: './main/settings/settings.module#SettingsPageModule' },
{ path: 'about', loadChildren: './main/about/about.module#AboutPageModule' },
{ path: 'main-tabs', loadChildren: './main/main-tabs/main-tabs.module#MainTabsPageModule' }, { path: 'bookmarks', loadChildren: './main/bookmarks/bookmarks.module#BookmarksPageModule' },
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';




];

@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
],
exports: [RouterModule]
})
export class AppRoutingModule {

}
const routes: Routes = [
// { path: '', redirectTo: 'welcome', pathMatch: 'full' },

{ path: 'welcome', loadChildren: './setup/welcome/welcome.module#WelcomePageModule' },
{ path: 'topics', loadChildren: './setup/topics/topics.module#TopicsPageModule' },
{ path: 'timeset', loadChildren: './setup/timeset/timeset.module#TimesetPageModule' },
{ path: 'lesson-select', loadChildren: './main/lesson-select/lesson-select.module#LessonSelectPageModule' },
{ path: 'lesson-view', loadChildren: './main/lesson-view/lesson-view.module#LessonViewPageModule' },
{ path: 'topic-select', loadChildren: './main/topic-select/topic-select.module#TopicSelectPageModule' },
{ path: 'settings', loadChildren: './main/settings/settings.module#SettingsPageModule' },
{ path: 'about', loadChildren: './main/about/about.module#AboutPageModule' },
{ path: 'main-tabs', loadChildren: './main/main-tabs/main-tabs.module#MainTabsPageModule' },
{ path: 'bookmarks', loadChildren: './main/bookmarks/bookmarks.module#BookmarksPageModule' },




];

@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
],
exports: [RouterModule]
})
export class AppRoutingModule {

}
4 changes: 3 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { SQLitePorter } from '@ionic-native/sqlite-porter/ngx';
import { SQLite } from '@ionic-native/sqlite/ngx';

import { HttpClientModule } from '@angular/common/http';
import { SocialSharing } from '@ionic-native/social-sharing/ngx';


@NgModule({
Expand All @@ -36,7 +37,8 @@ import { HttpClientModule } from '@angular/common/http';
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
LocalNotifications,
SQLite,
SQLitePorter
SQLitePorter,
SocialSharing
],
bootstrap: [AppComponent]

Expand Down
2 changes: 1 addition & 1 deletion src/app/main/bookmarks/bookmarks.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h2>{{item.headerTitle}}</h2>
</ion-item>

<ion-item-options side="end">
<ion-item-option color="secondary" (click)="removeBookmark(item)"><ion-icon size="large" name="star" style="padding-left:5pt; padding-right:5pt"></ion-icon></ion-item-option>
<ion-item-option color="secondary" (click)="removeBookmark(item)"><ion-icon size="large" name="trash" style="padding-left:5pt; padding-right:5pt"></ion-icon></ion-item-option>
</ion-item-options>

</ion-item-sliding>
Expand Down
39 changes: 32 additions & 7 deletions src/app/main/bookmarks/bookmarks.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Storage } from '@ionic/storage';
import { Lesson } from 'src/app/services/database.service';
import { DataService } from 'src/app/services/data.service';
import { Router } from '@angular/router';
import { AlertController } from '@ionic/angular';

@Component({
selector: 'app-bookmarks',
Expand All @@ -12,7 +13,7 @@ import { Router } from '@angular/router';
export class BookmarksPage implements OnInit {

bookmarks:Lesson[];
constructor(private storage:Storage, private data:DataService, private router:Router) {
constructor(private storage:Storage, private data:DataService, private router:Router, public alertController:AlertController) {

this.storage.get('bookmarks').then(b => {
this.bookmarks = b;
Expand All @@ -27,15 +28,39 @@ export class BookmarksPage implements OnInit {
})

}
removeBookmark(b:Lesson) {
this.bookmarks.splice(this.bookmarks.findIndex((val) => {
return val.categoryId == b.categoryId && val.id == b.id;
}), 1);
this.storage.set('bookmarks',this.bookmarks)



async removeBookmark(b:Lesson) {
const alert = await this.alertController.create({
header: 'Stai asa!',
message: 'Esti sigur ca vrei sa stergi lectia ' + b.headerTitle + ' de la favorite?',
buttons: [
{
text: 'Cancel',
role: 'cancel',
cssClass: 'secondary',
handler: (blah) => {
console.log('Confirm Cancel: blah');
}
}, {
text: 'Sterge',
handler: () => {
this.bookmarks.splice(this.bookmarks.findIndex((val) => {
return val.categoryId == b.categoryId && val.id == b.id;
}), 1);
this.storage.set('bookmarks',this.bookmarks)


}
}
]
});

await alert.present();
}



startLesson(l:Lesson) {
this.data.setLesson(l);
this.router.navigate(['/lesson-view'])
Expand Down
Loading

0 comments on commit a674534

Please sign in to comment.