diff --git a/ios/capacitor-cordova-ios-plugins/CordovaPlugins.podspec b/ios/capacitor-cordova-ios-plugins/CordovaPlugins.podspec deleted file mode 100644 index 79b4ae24e..000000000 --- a/ios/capacitor-cordova-ios-plugins/CordovaPlugins.podspec +++ /dev/null @@ -1,18 +0,0 @@ - - Pod::Spec.new do |s| - s.name = 'CordovaPlugins' - s.version = '3.3.0' - s.summary = 'Autogenerated spec' - s.license = 'Unknown' - s.homepage = 'https://example.com' - s.authors = { 'Capacitor Generator' => 'hi@example.com' } - s.source = { :git => 'https://github.com/ionic-team/does-not-exist.git', :tag => '3.3.0' } - s.source_files = 'sources/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '12.0' - s.xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1 WK_WEB_VIEW_ONLY=1' } - s.dependency 'CapacitorCordova' - s.swift_version = '5.1' - s.weak_frameworks = 'AudioToolbox', 'SystemConfiguration' - s.frameworks = 'AssetsLibrary', 'MobileCoreServices', 'CoreGraphics', 'CoreTelephony' - s.compiler_flags = '-w -w -DSQLITE_THREADSAFE=1 -DSQLITE_DEFAULT_SYNCHRONOUS=3 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_TEMP_STORE=2 -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE -DSQLITE_DEFAULT_PAGE_SIZE=4096' - end \ No newline at end of file diff --git a/ios/capacitor-cordova-ios-plugins/CordovaPluginsStatic.podspec b/ios/capacitor-cordova-ios-plugins/CordovaPluginsStatic.podspec deleted file mode 100644 index 424541041..000000000 --- a/ios/capacitor-cordova-ios-plugins/CordovaPluginsStatic.podspec +++ /dev/null @@ -1,16 +0,0 @@ - - Pod::Spec.new do |s| - s.name = 'CordovaPluginsStatic' - s.version = '3.3.0' - s.summary = 'Autogenerated spec' - s.license = 'Unknown' - s.homepage = 'https://example.com' - s.authors = { 'Capacitor Generator' => 'hi@example.com' } - s.source = { :git => 'https://github.com/ionic-team/does-not-exist.git', :tag => '3.3.0' } - s.source_files = 'sourcesstatic/**/*.{swift,h,m,c,cc,mm,cpp}' - s.ios.deployment_target = '12.0' - s.xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1 WK_WEB_VIEW_ONLY=1' } - s.dependency 'CapacitorCordova' - s.swift_version = '5.1' - s.static_framework = true - end \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d8f24c38a..878a7078f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2958,6 +2958,21 @@ "@types/cordova": "^0.0.34" } }, + "@ionic-native/crop": { + "version": "5.36.0", + "resolved": "https://registry.npmjs.org/@ionic-native/crop/-/crop-5.36.0.tgz", + "integrity": "sha512-wRO8J9oSHl4klvPMti7MTYjFCl6dYHYlbe56gzImf1pwfKQ7gmusskeedABfZggPV1NHruMBKUNALdatJf603A==", + "requires": { + "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } + } + }, "@ionic-native/fcm": { "version": "5.36.0", "resolved": "https://registry.npmjs.org/@ionic-native/fcm/-/fcm-5.36.0.tgz", @@ -7842,6 +7857,11 @@ "integrity": "sha1-C8ZXVyduvZIMASzpIOJ0F3V2Nz4=", "dev": true }, + "cordova-plugin-crop": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cordova-plugin-crop/-/cordova-plugin-crop-0.4.0.tgz", + "integrity": "sha1-TZ6Jgsz7OOBPqQnIe0vsBuLR2Ss=" + }, "cordova-plugin-dbcopy": { "version": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git#861f585e4313db828d6b8c7d354c32c83373d0d2", "from": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git" diff --git a/package.json b/package.json index 6bc660e48..8affa6bb6 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "@fullcalendar/interaction": "^5.3.0", "@ionic-native/camera": "^5.31.1", "@ionic-native/core": "^5.0.7", + "@ionic-native/crop": "^5.36.0", "@ionic-native/fcm": "^5.36.0", "@ionic-native/file": "^5.36.0", "@ionic-native/file-path": "^5.30.0", @@ -93,6 +94,7 @@ "capacitor-voice-recorder": "^2.0.0", "ci": "^2.1.1", "cordova": "^10.0.0", + "cordova-plugin-crop": "^0.4.0", "cordova-plugin-dbcopy": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git", "cordova-plugin-filepath": "^1.5.8", "cordova-plugin-okhttp": "^2.0.0", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 692c31663..9e8e8372a 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -9,6 +9,7 @@ import { NgxMatDateFormats } from '@angular-material-components/datetime-picker' const moment = _rollupMoment || _moment; import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker'; import { SqliteService } from 'src/app/services/sqlite.service'; +import { BackgroundService } from 'src/app/services/background.service'; import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx'; @@ -39,7 +40,8 @@ export class AppComponent { /* private splashScreen: SplashScreen, */ private statusBar: StatusBar, private screenOrientation: ScreenOrientation, - private sqliteservice: SqliteService + private sqliteservice: SqliteService, + private backgroundservice: BackgroundService ) { this.initializeApp(); } @@ -65,6 +67,18 @@ export class AppComponent { console.log("Error creating local database: ", error) } } + + window.addEventListener('online', () => { + console.log('Became online') + this.backgroundservice.online() + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { + } else { + } + }); + window.addEventListener('offline', () => { + console.log('Became offline') + this.backgroundservice.offline() + }); }); } diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 9056c7ef8..c864de07c 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -30,6 +30,7 @@ import { environment } from 'src/environments/environment'; import { TimeService } from 'src/app/services/functions/time.service'; import { ThemeService } from 'src/app/services/theme.service' import { DataService } from 'src/app/services/data.service'; +import { Crop } from '@ionic-native/crop/ngx'; @Component({ @@ -119,6 +120,7 @@ export class ChatPage implements OnInit { public ThemeService: ThemeService, private dataService:DataService, private router: Router, + private crop: Crop, ){ this.loggedUserChat = authService.ValidatedUserChat['data']; this.headers = new HttpHeaders(); @@ -549,4 +551,10 @@ hideRefreshButton(){ modal.onDidDismiss(); } -} +// this.crop.crop('path/to/image.jpg', {quality: 75}) +// .then( +// newImage => console.log('new image path is: ' + newImage), +// error => console.error('Error cropping image', error) +// ); + + } diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index 8721ef716..4a347baf5 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -414,7 +414,8 @@ export class NewPublicationPage implements OnInit { directory: Directory.Data }); - this.loadFiles(); + //this.loadFiles(fileName); + this.loadFileData(fileName); } private async readAsBase64(photo: Photo) { @@ -434,7 +435,7 @@ export class NewPublicationPage implements OnInit { } } - async loadFiles() { + async loadFiles(fileName) { this.images = []; const loading = await this.loadingCtrl.create({ @@ -442,11 +443,11 @@ export class NewPublicationPage implements OnInit { }); await loading.present(); - Filesystem.readdir({ - path: IMAGE_DIR, + /* Filesystem.readdir({ + path: `${IMAGE_DIR}/${fileName}`, directory: Directory.Data, }).then(result => { - console.log('ALL RESULTS', result.files[0]) + console.log('ALL RESULTS', result.files) let lastphoto = result.files[result.files.length - 1] this.loadFileData(lastphoto); }, @@ -461,12 +462,17 @@ export class NewPublicationPage implements OnInit { } ).then(_ => { loading.dismiss(); - }); + }); */ } async loadFileData(fileName: string) { console.log('ALL PHOTOT FILE', fileName) - // for (let f of fileNames) { + + const loading = await this.loadingCtrl.create({ + message: 'Loading data...', + }); + await loading.present(); + const filePath = `${IMAGE_DIR}/${fileName}`; const readFile = await Filesystem.readFile({ @@ -483,7 +489,9 @@ export class NewPublicationPage implements OnInit { console.log('ALL IMAGE', this.images) this.capturedImage = this.images[0].data - //} + + loading.dismiss(); + } diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index c0e2309f1..1916b987a 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -16,6 +16,7 @@ import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-f import { SqliteService } from 'src/app/services/sqlite.service'; import { BackgroundService } from 'src/app/services/background.service'; import { ThemeService } from 'src/app/services/theme.service' +import { Crop } from '@ionic-native/crop/ngx'; @Component({ selector: 'app-publications', @@ -68,7 +69,8 @@ export class PublicationsPage implements OnInit { private sqliteservice: SqliteService, private backgroundservice: BackgroundService, private platform: Platform, - public ThemeService: ThemeService + public ThemeService: ThemeService, + private crop: Crop, ) { this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]; this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"]; @@ -91,6 +93,8 @@ export class PublicationsPage implements OnInit { } + + hideRefreshButton() { window.onresize = (event) => { if (window.innerWidth < 801) { @@ -452,4 +456,12 @@ export class PublicationsPage implements OnInit { }); } + // this.crop.crop('path/to/image.jpg', {quality: 75}) + // .then( + // newImage => console.log('new image path is: ' + newImage), + // error => console.error('Error cropping image', error) + // ); + + + } diff --git a/src/global.scss b/src/global.scss index b12d9d99f..e59d967e6 100644 --- a/src/global.scss +++ b/src/global.scss @@ -1355,4 +1355,7 @@ ngx-mat-datetime-content{ --background:transparent; } + .transparent-modal .modal-wrapper { + --background: rgba(44, 39, 45, 0.7); + } } \ No newline at end of file