Git pull made with camera and file system chnages

This commit is contained in:
Eudes Inácio
2021-11-09 17:54:52 +01:00
58 changed files with 1279 additions and 318 deletions
+9
View File
@@ -0,0 +1,9 @@
App/build
App/Pods
App/Podfile.lock
App/App/public
DerivedData
xcuserdata
# Cordova plugins for Capacitor
capacitor-cordova-ios-plugins
+402
View File
@@ -0,0 +1,402 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objects = {
/* Begin PBXBuildFile section */
2FAD9763203C412B000D30F8 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = 2FAD9762203C412B000D30F8 /* config.xml */; };
50379B232058CBB4000EE86E /* capacitor.config.json in Resources */ = {isa = PBXBuildFile; fileRef = 50379B222058CBB4000EE86E /* capacitor.config.json */; };
504EC3081FED79650016851F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504EC3071FED79650016851F /* AppDelegate.swift */; };
504EC30D1FED79650016851F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30B1FED79650016851F /* Main.storyboard */; };
504EC30F1FED79650016851F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30E1FED79650016851F /* Assets.xcassets */; };
504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; };
50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; };
A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
2FAD9762203C412B000D30F8 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = "<group>"; };
50379B222058CBB4000EE86E /* capacitor.config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = capacitor.config.json; sourceTree = "<group>"; };
504EC3041FED79650016851F /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; };
504EC3071FED79650016851F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
504EC30C1FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
504EC30E1FED79650016851F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
504EC3111FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
504EC3131FED79650016851F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
50B271D01FEDC1A000F3C39B /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = "<group>"; };
AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.release.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.release.xcconfig"; sourceTree = "<group>"; };
FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.debug.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
504EC3011FED79650016851F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
27E2DDA53C4D2A4D1A88CE4A /* Frameworks */ = {
isa = PBXGroup;
children = (
AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
504EC2FB1FED79650016851F = {
isa = PBXGroup;
children = (
504EC3061FED79650016851F /* App */,
504EC3051FED79650016851F /* Products */,
7F8756D8B27F46E3366F6CEA /* Pods */,
27E2DDA53C4D2A4D1A88CE4A /* Frameworks */,
);
sourceTree = "<group>";
};
504EC3051FED79650016851F /* Products */ = {
isa = PBXGroup;
children = (
504EC3041FED79650016851F /* App.app */,
);
name = Products;
sourceTree = "<group>";
};
504EC3061FED79650016851F /* App */ = {
isa = PBXGroup;
children = (
50379B222058CBB4000EE86E /* capacitor.config.json */,
504EC3071FED79650016851F /* AppDelegate.swift */,
504EC30B1FED79650016851F /* Main.storyboard */,
504EC30E1FED79650016851F /* Assets.xcassets */,
504EC3101FED79650016851F /* LaunchScreen.storyboard */,
504EC3131FED79650016851F /* Info.plist */,
2FAD9762203C412B000D30F8 /* config.xml */,
50B271D01FEDC1A000F3C39B /* public */,
);
path = App;
sourceTree = "<group>";
};
7F8756D8B27F46E3366F6CEA /* Pods */ = {
isa = PBXGroup;
children = (
FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */,
AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
504EC3031FED79650016851F /* App */ = {
isa = PBXNativeTarget;
buildConfigurationList = 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */;
buildPhases = (
6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */,
504EC3001FED79650016851F /* Sources */,
504EC3011FED79650016851F /* Frameworks */,
504EC3021FED79650016851F /* Resources */,
9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = App;
productName = App;
productReference = 504EC3041FED79650016851F /* App.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
504EC2FC1FED79650016851F /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0920;
TargetAttributes = {
504EC3031FED79650016851F = {
CreatedOnToolsVersion = 9.2;
LastSwiftMigration = 1100;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */;
compatibilityVersion = "Xcode 8.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 504EC2FB1FED79650016851F;
productRefGroup = 504EC3051FED79650016851F /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
504EC3031FED79650016851F /* App */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
504EC3021FED79650016851F /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */,
50B271D11FEDC1A000F3C39B /* public in Resources */,
504EC30F1FED79650016851F /* Assets.xcassets in Resources */,
50379B232058CBB4000EE86E /* capacitor.config.json in Resources */,
504EC30D1FED79650016851F /* Main.storyboard in Resources */,
2FAD9763203C412B000D30F8 /* config.xml in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-App-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-App/Pods-App-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
504EC3001FED79650016851F /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
504EC3081FED79650016851F /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
504EC30B1FED79650016851F /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
504EC30C1FED79650016851F /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
504EC3101FED79650016851F /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
504EC3111FED79650016851F /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
504EC3141FED79650016851F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
504EC3151FED79650016851F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
504EC3171FED79650016851F /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.gpr.gabinetedigital;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
504EC3181FED79650016851F /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.gpr.gabinetedigital;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */ = {
isa = XCConfigurationList;
buildConfigurations = (
504EC3141FED79650016851F /* Debug */,
504EC3151FED79650016851F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */ = {
isa = XCConfigurationList;
buildConfigurations = (
504EC3171FED79650016851F /* Debug */,
504EC3181FED79650016851F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 504EC2FC1FED79650016851F /* Project object */;
}
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:App.xcodeproj">
</FileRef>
</Workspace>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:App.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
+60
View File
@@ -0,0 +1,60 @@
import UIKit
import Capacitor
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
// Called when the app was launched with a url. Feel free to add additional processing here,
// but if you want the App API to support tracking app url opens, make sure to keep this call
return ApplicationDelegateProxy.shared.application(app, open: url, options: options)
}
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
// Called when the app was launched with an activity, including Universal Links.
// Feel free to add additional processing here, but if you want the App API to support
// tracking app url opens, make sure to keep this call
return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler)
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
let statusBarRect = UIApplication.shared.statusBarFrame
guard let touchPoint = event?.allTouches?.first?.location(in: self.window) else { return }
if statusBarRect.contains(touchPoint) {
NotificationCenter.default.post(name: .capacitorStatusBarTapped, object: nil)
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@@ -0,0 +1,116 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "AppIcon-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "AppIcon-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "AppIcon-29x29@2x-1.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "AppIcon-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "AppIcon-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "AppIcon-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "AppIcon-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "AppIcon-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "AppIcon-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "AppIcon-20x20@2x-1.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "AppIcon-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "AppIcon-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "AppIcon-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "AppIcon-40x40@2x-1.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "AppIcon-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "AppIcon-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "AppIcon-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "AppIcon-512@2x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "splash-2732x2732-2.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "splash-2732x2732-1.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "splash-2732x2732.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17132" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17105"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<imageView key="view" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Splash" id="snD-IY-ifK">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</imageView>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="Splash" width="1366" height="1366"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
+19
View File
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14111" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
</dependencies>
<scenes>
<!--Bridge View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="CAPBridgeViewController" customModule="Capacitor" sceneMemberID="viewController"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
+56
View File
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>gabinete-digital</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>NSMicrophoneUsageDescription</key>
<string>We want to record some audio from you</string>
</dict>
</plist>
+22
View File
@@ -0,0 +1,22 @@
{
"appId": "com.gpr.gabinetedigital",
"appName": "gabinete-digital",
"webDir": "www",
"npmClient": "npm",
"linuxAndroidStudioPath": "/snap/android-studio/current/android-studio/bin/studio.sh",
"cordova": {
"preferences": {
"ScrollEnabled": "false",
"BackupWebStorage": "none",
"SplashMaintainAspectRatio": "true",
"FadeSplashScreenDuration": "300",
"SplashShowOnlyFirstTime": "false",
"SplashScreen": "screen",
"SplashScreenDelay": "3000"
}
},
"android": {
"allowMixedContent": true
},
"bundledWebRuntime": false
}
+63
View File
@@ -0,0 +1,63 @@
<?xml version='1.0' encoding='utf-8'?>
<widget version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<access origin="*" />
<feature name="sqlDB">
<param name="ios-package" value="sqlDB"/>
</feature>
<feature name="SQLitePlugin">
<param name="ios-package" value="SQLitePlugin"/>
</feature>
<feature name="PhotoViewer">
<param name="ios-package" value="PhotoViewer"/>
</feature>
<feature name="Device">
<param name="ios-package" value="CDVDevice"/>
</feature>
<feature name="Notification">
<param name="ios-package" value="CDVNotification"/>
</feature>
<feature name="File">
<param name="ios-package" value="CDVFile"/>
<param name="onload" value="true"/>
</feature>
<feature name="Fingerprint">
<param name="ios-package" value="Fingerprint"/>
</feature>
<feature name="Globalization">
<param name="ios-package" value="CDVGlobalization"/>
</feature>
<feature name="InAppBrowser">
<param name="ios-package" value="CDVWKInAppBrowser"/>
<param name="onload" value="true"/>
</feature>
<feature name="Media">
<param name="ios-package" value="CDVSound"/>
</feature>
<feature name="Capture">
<param name="ios-package" value="CDVCapture"/>
</feature>
<feature name="NetworkStatus">
<param name="ios-package" value="CDVConnection"/>
</feature>
<preference name="ScrollEnabled" value="false" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
</widget>
+27
View File
@@ -0,0 +1,27 @@
platform :ios, '12.0'
use_frameworks!
# workaround to avoid Xcode caching of Pods that requires
# Product -> Clean Build Folder after new Cordova plugins installed
# Requires CocoaPods 1.6 or newer
install! 'cocoapods', :disable_input_output_paths => true
def capacitor_pods
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorApp', :path => '..\..\node_modules\@capacitor\app'
pod 'CapacitorCamera', :path => '..\..\node_modules\@capacitor\camera'
pod 'CapacitorHaptics', :path => '..\..\node_modules\@capacitor\haptics'
pod 'CapacitorKeyboard', :path => '..\..\node_modules\@capacitor\keyboard'
pod 'CapacitorNetwork', :path => '..\..\node_modules\@capacitor\network'
pod 'CapacitorFilesystem', :path => '..\..\node_modules\@capacitor\filesystem'
pod 'CapacitorPushNotifications', :path => '..\..\node_modules\@capacitor\push-notifications'
pod 'CapacitorVoiceRecorder', :path => '..\..\node_modules\capacitor-voice-recorder'
pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins'
pod 'CordovaPluginsResources', :path => '../capacitor-cordova-ios-plugins'
end
target 'App' do
capacitor_pods
# Add your Pods here
end
+51 -28
View File
@@ -2031,15 +2031,20 @@
"dev": true "dev": true
}, },
"@capacitor/android": { "@capacitor/android": {
"version": "3.3.0", "version": "3.3.1",
"resolved": "https://registry.npmjs.org/@capacitor/android/-/android-3.3.0.tgz", "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-3.3.1.tgz",
"integrity": "sha512-dzbzdN7KjjwpUbg7mZKVkgAVytEwGyXUL4Z1t9c12UhViJaNjU7/nSlTXjb+IiauwVg9oI2LHtSVrp1NIjUycw==" "integrity": "sha512-TB9UJh6/e6CV6KDpu/lNHKhgVvnDL2d3crNYtfKzp64CzeZhttQGIQShXSdMb3DG4kk7Zi/qBlfSaWBBD95NhQ=="
}, },
"@capacitor/app": { "@capacitor/app": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/@capacitor/app/-/app-1.0.5.tgz", "resolved": "https://registry.npmjs.org/@capacitor/app/-/app-1.0.5.tgz",
"integrity": "sha512-U0dAw1CAjKyguSRxKDabszsQ4dj679RnxaUZrSHDR5Jnt5x308oQuKXFP++wnMBbw72D02iqjG0a+/Ujye7C9g==" "integrity": "sha512-U0dAw1CAjKyguSRxKDabszsQ4dj679RnxaUZrSHDR5Jnt5x308oQuKXFP++wnMBbw72D02iqjG0a+/Ujye7C9g=="
}, },
"@capacitor/camera": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@capacitor/camera/-/camera-1.2.0.tgz",
"integrity": "sha512-NAIGWnyHBGQ/dgla/D4KDkAeQ2f3fzw+D+DIkGNH3f1ciX4bXC7lNbDVU67SMOuNt+CmcTJF64q3nVXcpv5JvQ=="
},
"@capacitor/cli": { "@capacitor/cli": {
"version": "3.3.0", "version": "3.3.0",
"resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-3.3.0.tgz", "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-3.3.0.tgz",
@@ -2152,15 +2157,25 @@
"tslib": "^2.1.0" "tslib": "^2.1.0"
} }
}, },
"@capacitor/filesystem": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/@capacitor/filesystem/-/filesystem-1.0.6.tgz",
"integrity": "sha512-8xqUbDZFGBMhgqoBSn9wEd9OBPdHIRegQ9zCCZcpHNf3FFAIby1ck+aDFnoq+Da49xhD6ks1SKCBSxz/26qWTw=="
},
"@capacitor/haptics": { "@capacitor/haptics": {
"version": "1.1.2", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/@capacitor/haptics/-/haptics-1.1.2.tgz", "resolved": "https://registry.npmjs.org/@capacitor/haptics/-/haptics-1.1.3.tgz",
"integrity": "sha512-h7uAK/iTSDYfvMY2aaZJ5tlGyIOOdH17mzHHED4jgP3TSXbsmeYU839u56hNGi9vb4Q00Jsb0YzsDMzSjv4Nag==" "integrity": "sha512-ui2mY/riK1Y4bxnJKJfclWO61obZ0RHmtErPhpmt4wIEVjG1segYdFop45R2PxyEwoUJgzEsAxnviM/T6k8seQ=="
},
"@capacitor/ios": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-3.3.0.tgz",
"integrity": "sha512-KImT4hVoQJuAfe01wUYiMLnutMu7PxVCv4c8HVWiW+OuyyOua3lC8wQ5gAauGDugAo6mdM7fVva5a0Vtyhnbdg=="
}, },
"@capacitor/keyboard": { "@capacitor/keyboard": {
"version": "1.1.2", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/@capacitor/keyboard/-/keyboard-1.1.2.tgz", "resolved": "https://registry.npmjs.org/@capacitor/keyboard/-/keyboard-1.1.3.tgz",
"integrity": "sha512-EUduhQzrHma4PlGfdSxVeGIwxR2+/xLRDbjQH5Q4cXqrlYssIX2UyQrL4wNpDaAOg1Z4VD8EzzVolC81LG6Q+A==" "integrity": "sha512-WpD1f/3HH6IpADiRaFTDGdhrqYhZDikybXXhUdGAEEwHbErHt9zS5RQgbeROjGmkXcurVvQsalQ59YuKU0VzwA=="
}, },
"@capacitor/network": { "@capacitor/network": {
"version": "1.0.6", "version": "1.0.6",
@@ -2172,11 +2187,6 @@
"resolved": "https://registry.npmjs.org/@capacitor/push-notifications/-/push-notifications-1.0.7.tgz", "resolved": "https://registry.npmjs.org/@capacitor/push-notifications/-/push-notifications-1.0.7.tgz",
"integrity": "sha512-vbvAptFq5cI6xKYYWMb7tsWvA88/PTG4v6ptxN0Ygtc1fQ4l/AzONQiYqdtFpbBhF2fML2kXQ/5eSAfn8HY9aw==" "integrity": "sha512-vbvAptFq5cI6xKYYWMb7tsWvA88/PTG4v6ptxN0Ygtc1fQ4l/AzONQiYqdtFpbBhF2fML2kXQ/5eSAfn8HY9aw=="
}, },
"@capacitor/status-bar": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/@capacitor/status-bar/-/status-bar-1.0.5.tgz",
"integrity": "sha512-SZuxjaN5Nr8FKUVlkVH3l0X2JWey0yVMfMhyE3RG7ryUSAesgs3bvkAEXSfjphsHOpt4A/rEeCJb2ZbeCBwroA=="
},
"@cnakazawa/watch": { "@cnakazawa/watch": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz",
@@ -6681,6 +6691,14 @@
"integrity": "sha512-feylzsbDxi1gPZ1IjystzIQZagYYLvfKrSuygUCgf7z6x790VEzze5QEkdSV1U58RA7Hi0+v6fv4K54atOzATg==", "integrity": "sha512-feylzsbDxi1gPZ1IjystzIQZagYYLvfKrSuygUCgf7z6x790VEzze5QEkdSV1U58RA7Hi0+v6fv4K54atOzATg==",
"dev": true "dev": true
}, },
"capacitor-voice-recorder": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/capacitor-voice-recorder/-/capacitor-voice-recorder-2.0.0.tgz",
"integrity": "sha512-YU0tN8+A963sCYjL9du6jbUqOh5w5dJf++8IFBkuV0sDQZuuLaK//1RypJi0MQLifQESZSjhTVWoXTViIthA/w==",
"requires": {
"get-blob-duration": "^1.2.0"
}
},
"capture-exit": { "capture-exit": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz",
@@ -7888,18 +7906,6 @@
"integrity": "sha512-ThmXzl6QIKWFXf4wWw7Q/zpB+VKkz3VM958+5A0sXD4jmR++u7KnGttLksXshVwWr6lvGwUebLYtIyXwS4Ovcg==", "integrity": "sha512-ThmXzl6QIKWFXf4wWw7Q/zpB+VKkz3VM958+5A0sXD4jmR++u7KnGttLksXshVwWr6lvGwUebLYtIyXwS4Ovcg==",
"dev": true "dev": true
}, },
"cordova-plugin-streaming-media": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/cordova-plugin-streaming-media/-/cordova-plugin-streaming-media-2.3.0.tgz",
"integrity": "sha512-og7UmXbaWoSrOmo/mZu/c7vKDdUMu2eVrdRMvIJY6qqZ6Fv2BrJvOXm8prVt0xjWqWOMJpQs3DAajX8+N39Cqw==",
"dev": true
},
"cordova-plugin-telerik-imagepicker": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/cordova-plugin-telerik-imagepicker/-/cordova-plugin-telerik-imagepicker-2.3.6.tgz",
"integrity": "sha512-guf+BHB7O3g1ll3++d+aOvTGHXwBmqdxBFJTCKKMIGqazlf+Sq3Bsd1tRRswPRxy1MZRlJIe6Arz4pdCCmOigA==",
"dev": true
},
"cordova-plugin-whitelist": { "cordova-plugin-whitelist": {
"version": "1.3.5", "version": "1.3.5",
"resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.5.tgz", "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.5.tgz",
@@ -10389,6 +10395,24 @@
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
"integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==" "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="
}, },
"get-blob-duration": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/get-blob-duration/-/get-blob-duration-1.2.0.tgz",
"integrity": "sha512-2xNJa+oKznR21eC2ThMzw4a1931a3ogA8aHoY92xruZufc/02G7pl/P793GJZytkyI8xMJ2DepEQ7MWvg/tn/Q==",
"requires": {
"@babel/runtime": "7.11.2"
},
"dependencies": {
"@babel/runtime": {
"version": "7.11.2",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz",
"integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==",
"requires": {
"regenerator-runtime": "^0.13.4"
}
}
}
},
"get-caller-file": { "get-caller-file": {
"version": "2.0.5", "version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
@@ -19336,8 +19360,7 @@
"regenerator-runtime": { "regenerator-runtime": {
"version": "0.13.9", "version": "0.13.9",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
"integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
"dev": true
}, },
"regenerator-transform": { "regenerator-transform": {
"version": "0.14.5", "version": "0.14.5",
+5 -4
View File
@@ -31,14 +31,16 @@
"@angular/platform-browser": "~12.1.2", "@angular/platform-browser": "~12.1.2",
"@angular/platform-browser-dynamic": "~12.1.2", "@angular/platform-browser-dynamic": "~12.1.2",
"@angular/router": "~12.1.2", "@angular/router": "~12.1.2",
"@capacitor/android": "^3.3.0", "@capacitor/android": "^3.3.1",
"@capacitor/app": "^1.0.5", "@capacitor/app": "^1.0.5",
"@capacitor/camera": "^1.2.0",
"@capacitor/core": "^3.3.0", "@capacitor/core": "^3.3.0",
"@capacitor/haptics": "^1.1.2", "@capacitor/haptics": "^1.1.2",
"@capacitor/keyboard": "^1.1.2", "@capacitor/keyboard": "^1.1.2",
"@capacitor/network": "^1.0.6", "@capacitor/network": "^1.0.6",
"@capacitor/filesystem": "^1.0.6",
"@capacitor/ios": "3.3.0",
"@capacitor/push-notifications": "^1.0.7", "@capacitor/push-notifications": "^1.0.7",
"@capacitor/status-bar": "^1.0.5",
"@fortawesome/angular-fontawesome": "^0.9.0", "@fortawesome/angular-fontawesome": "^0.9.0",
"@fortawesome/fontawesome-free": "^5.15.3", "@fortawesome/fontawesome-free": "^5.15.3",
"@fortawesome/fontawesome-svg-core": "^1.2.35", "@fortawesome/fontawesome-svg-core": "^1.2.35",
@@ -85,6 +87,7 @@
"angular-tag-cloud-module": "^5.2.2", "angular-tag-cloud-module": "^5.2.2",
"bootstrap": "^4.5.0", "bootstrap": "^4.5.0",
"build": "0.1.4", "build": "0.1.4",
"capacitor-voice-recorder": "^2.0.0",
"ci": "^2.1.1", "ci": "^2.1.1",
"cordova": "^10.0.0", "cordova": "^10.0.0",
"cordova-plugin-dbcopy": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git", "cordova-plugin-dbcopy": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git",
@@ -163,8 +166,6 @@
"cordova-plugin-network-information": "^3.0.0", "cordova-plugin-network-information": "^3.0.0",
"cordova-plugin-splashscreen": "^5.0.2", "cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2", "cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-streaming-media": "^2.3.0",
"cordova-plugin-telerik-imagepicker": "^2.3.6",
"cordova-plugin-whitelist": "^1.3.4", "cordova-plugin-whitelist": "^1.3.4",
"es6-promise-plugin": "^4.2.2", "es6-promise-plugin": "^4.2.2",
"jasmine-core": "~3.6.0", "jasmine-core": "~3.6.0",
+17 -4
View File
@@ -48,7 +48,6 @@
<ion-refresher-content> <ion-refresher-content>
</ion-refresher-content> </ion-refresher-content>
</ion-refresher> --> </ion-refresher> -->
<div (click)="handleClick()" class="messages" #scrollMe> <div (click)="handleClick()" class="messages" #scrollMe>
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last" <div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last"
[class.messages-list-item-wrapper-active]="msg._id == selectedMsgId"> [class.messages-list-item-wrapper-active]="msg._id == selectedMsgId">
@@ -124,6 +123,19 @@
</ion-footer> --> </ion-footer> -->
<ion-footer> <ion-footer>
<ion-list hidden>
<ion-item (click)="playFile(storedFileNames)">
{{storedFileNames}}
</ion-item>
<ion-item (click)="playFile(storedFileNames)">
{{storedFileNames}}
</ion-item>
</ion-list>
<audio hidden controls>
<source src="https://www.tabularium.pt/file-upload/5g6DkyMC4MHcuaDyp/Audio%20record.mp3" type="audio/mpeg">
</audio>
<!-- <button (click)="startRecording()">Start Recording</button>
<button (click)="stopRecording()">Stop Recording</button> -->
<div class="container width-100 d-flex"> <div class="container width-100 d-flex">
<div> <div>
<button class="btn-no-color" (click)="openChatOptions()"> <button class="btn-no-color" (click)="openChatOptions()">
@@ -133,9 +145,10 @@
</div> </div>
<div class="width-70"> <div class="width-70">
<ion-item class="ion-no-padding ion-no-margin type-message" lines="none"> <ion-item class="ion-no-padding ion-no-margin type-message" lines="none">
<ion-textarea clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="message"></ion-textarea> <ion-textarea *ngIf="!recording" clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="message"></ion-textarea>
<button hidden class="btn-no-color" (click)="notImplemented()"> <ion-textarea *ngIf="recording" clearOnEdit="true" placeholder="Escrever uma mensagem" auto-grow class="message-input" rows="1" [(ngModel)]="durationDisplay"></ion-textarea>
<!-- <ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon> --> <button hidden #recordbtn class="btn-no-color" (click)="notImplemented()">
<ion-icon slot="end" src="assets/icon/icons-chat-mic.svg"></ion-icon>
</button> </button>
</ion-item> </ion-item>
</div> </div>
+104 -62
View File
@@ -20,6 +20,9 @@ import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service'; import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder';
import { Haptics, ImpactStyle } from '@capacitor/haptics';
@Component({ @Component({
selector: 'app-messages', selector: 'app-messages',
@@ -44,8 +47,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
members:any; members:any;
scrollingOnce:boolean = true; scrollingOnce:boolean = true;
chatMessageStore = ChatMessageStore chatMessageStore = ChatMessageStore;
chatUserStorage = ChatUserStorage chatUserStorage = ChatUserStorage;
private scrollChangeCallback: () => void; private scrollChangeCallback: () => void;
currentPosition: any; currentPosition: any;
@@ -60,6 +63,13 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
task: ExpedientTaskModalPageNavParamsTask; task: ExpedientTaskModalPageNavParamsTask;
LoadedDocument:any = null; LoadedDocument:any = null;
recording = false;
storedFileNames = [];
durationDisplay = '';
duration = 0;
@ViewChild('recordbtn', { read: ElementRef }) recordBtn: ElementRef;
myAudio: any;
constructor( constructor(
public popoverController: PopoverController, public popoverController: PopoverController,
private modalController: ModalController, private modalController: ModalController,
@@ -75,11 +85,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
private processes: ProcessesService, private processes: ProcessesService,
public ThemeService: ThemeService public ThemeService: ThemeService
) { ) {
/* this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
this.roomId = params["params"].roomId;
}
}); */
this.loggedUser = authService.ValidatedUserChat['data']; this.loggedUser = authService.ValidatedUserChat['data'];
this.roomId = this.navParams.get('roomId'); this.roomId = this.navParams.get('roomId');
@@ -91,57 +96,110 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
/* setInterval(()=>{ */
this.load(); this.load();
/* }, 9000); */
/* this.el = document.getElementById("scrollToBottom");
this.el.scrollTop = this.el.scrollHeight - this.el.scrollTop; */
this.setStatus('online'); this.setStatus('online');
//this.onPressingMessage();
/* setInterval(()=>{
const gesture = this.gestureController.create({
el: this.rectangle.nativeElement,
gestureName:'my-gesture',
onMove: (detail) => { this.onMove(detail); }
})
gesture.enable();
}, 9000); */
this.loadFiles();
VoiceRecorder.requestAudioRecordingPermission();
} }
ngAfterViewInit() { ngAfterViewInit() {
this.scrollChangeCallback = () => this.onContentScrolled(event); this.scrollChangeCallback = () => this.onContentScrolled(event);
window.addEventListener('scroll', this.scrollChangeCallback, true); window.addEventListener('scroll', this.scrollChangeCallback, true);
// const gesture = this.gestureController.create({ const longpress = this.gestureController.create({
// el: this.rectangle.nativeElement, el: this.recordBtn.nativeElement,
// gestureName:'long-press', threshold: 0,
// onStart: () => { alert('OP') }, gestureName: 'long-press',
// /* onMove () => { onStart: ev => {
// console.log('Move'); Haptics.impact({ style: ImpactStyle.Light })
// }, */ this.startRecording();
// onEnd: () => { this.calculateDuration();
// console.log('ENNNNNDS'); },
// }, onEnd: ev =>{
// }) Haptics.impact({ style: ImpactStyle.Light })
this.stopRecording();
}
}, true);
longpress.enable();
}
calculateDuration(){
if(!this.recording){
this.duration = 0;
this.durationDisplay = '';
return;
}
this.duration += 1;
const minutes = Math.floor(this.duration / 60);
const seconds = (this.duration % 60).toString().padStart(2,'0');
this.durationDisplay = `${minutes}:${seconds}`;
setTimeout(()=>{
this.calculateDuration();
}, 1000)
}
async loadFiles(){
Filesystem.readdir({
path: '',
directory: Directory.Data
}).then(result =>{
console.log(result);
const temp:any[] = result.files.reverse();
this.storedFileNames = temp[0];
console.log(this.storedFileNames);
})
}
startRecording(){
if(this.recording){
return;
}
this.recording = true;
VoiceRecorder.startRecording();
}
stopRecording(){
if(!this.recording){
return;
}
this.recording = false;
VoiceRecorder.stopRecording().then(async (result: RecordingData) =>{
this.recording = false;
if(result.value && result.value.recordDataBase64){
const recordData = result.value.recordDataBase64;
console.log(recordData);
this.myAudio = recordData;
const fileName = new Date().getTime() + ".wav";
await Filesystem.writeFile({
path: fileName,
directory: Directory.Data,
data: recordData,
})
}
})
}
async playFile(fileName?:any){
const audioFile = await Filesystem.readFile({
path: fileName,
directory: Directory.Data
})
console.log(audioFile);
const base64sound = audioFile.data;
const audioRef = new Audio(`data:audio/aac;base64,${base64sound}`)
audioRef.oncanplaythrough = () => audioRef.play();
audioRef.load();
// gesture.enable();
} }
handlePress(id?:string){ handlePress(id?:string){
this.selectedMsgId = id; this.selectedMsgId = id;
this.showMessageOptions = true; this.showMessageOptions = true;
/* if(!this.showMessageOptions){
this.showMessageOptions = true;
}
else{
this.showMessageOptions = false;
} */
} }
handleClick(){ handleClick(){
@@ -149,22 +207,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.selectedMsgId = ""; this.selectedMsgId = "";
} }
/* onPressingMessage(){
const gesture = this.gestureController.create({
el: this.messageContainer.nativeElement,
gestureName: 'long-press',
onStart: ev =>{
this.longPressActive = true;
console.log('Pressing');
},
onEnd: ev => {
this.longPressActive = false;
console.log('Stop pressing');
}
});
gesture.enable(true);
} */
deleteMessage(msgId:string){ deleteMessage(msgId:string){
let body = { let body = {
"roomId": this.roomId, "roomId": this.roomId,
@@ -273,7 +315,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const roomId = this.roomId; const roomId = this.roomId;
this.chatService.getRoomMessages(this.roomId).subscribe(res => { this.chatService.getRoomMessages(this.roomId).subscribe(res => {
/* console.log(res); */ console.log(res);
this.messages = res['messages'].reverse(); this.messages = res['messages'].reverse();
this.chatMessageStore.add(roomId, this.messages) this.chatMessageStore.add(roomId, this.messages)
console.log(this.messages); console.log(this.messages);
@@ -519,7 +561,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.messages = res['messages'].reverse(); this.messages = res['messages'].reverse();
this.chatMessageStore.add(roomId, this.messages) this.chatMessageStore.add(roomId, this.messages)
console.log(this.messages); //console.log(this.messages);
// Reconnect in one second // Reconnect in one second
if(this.route.url != "/home/chat"){ if(this.route.url != "/home/chat"){
console.log("Timer message stop") console.log("Timer message stop")
@@ -528,7 +570,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
if(document.querySelector('.isMessagesChatOpened')){ if(document.querySelector('.isMessagesChatOpened')){
await new Promise(resolve => setTimeout(resolve, 5000)); await new Promise(resolve => setTimeout(resolve, 5000));
await this.serverLongPull(); await this.serverLongPull();
console.log('Timer message running') //console.log('Timer message running')
} }
} }
+3 -2
View File
@@ -493,12 +493,13 @@ export class EventsPage implements OnInit {
} }
goToExpediente(SerialNumber: any) { goToExpediente(SerialNumber: any) {
if (this.loggeduser.Profile == 'MDGPR') { this.router.navigate(['/home/events/expediente', SerialNumber, 'events']);
/* if (this.loggeduser.Profile == 'MDGPR') {
this.router.navigate(['/home/events/expediente', SerialNumber, 'events']); this.router.navigate(['/home/events/expediente', SerialNumber, 'events']);
} }
else if (this.loggeduser.Profile == 'PR') { else if (this.loggeduser.Profile == 'PR') {
this.router.navigate(['/home/events/expedientes-pr', SerialNumber, 'events']); this.router.navigate(['/home/events/expedientes-pr', SerialNumber, 'events']);
} } */
} }
viewExpedientListPage() { viewExpedientListPage() {
@@ -104,7 +104,7 @@
<button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button> <button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button> <button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Inicair Conversa</button> <button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
<div class="solid"></div> <div class="solid"></div>
</div> </div>
</div> </div>
@@ -118,8 +118,10 @@
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
<div hidden class="solid"></div> <div hidden class="solid"></div>
<button hidden class="btn-cancel" shape="round" >Delegar</button> <button hidden class="btn-cancel" shape="round" >Delegar</button>
</div> </div>
</div> </div>
@@ -35,7 +35,7 @@
<ion-list> <ion-list>
<div <div
class="expediente ion-no-padding ion-no-margin cursor-pointer" class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of listToPresent" *ngFor = "let task of expedientegbstore.list"
(click)="goToExpediente(task.SerialNumber)" (click)="goToExpediente(task.SerialNumber)"
> >
<div class="item width-100"> <div class="item width-100">
@@ -67,13 +67,13 @@
</ion-list> </ion-list>
<div <div
*ngIf="!skeletonLoader && listToPresent.length == 0 && listToPresent.length == 0" *ngIf="!skeletonLoader && expedientegbstore.list.length == 0 && expedientegbstore.list.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center" class="empty-list d-flex height-100 align-center justify-content-center"
> >
<span>Lista vazia</span> <span>Lista vazia</span>
</div> </div>
<div *ngIf="skeletonLoader && listToPresent.length == 0"> <div *ngIf="skeletonLoader && expedientegbstore.list.length == 0">
<ion-list> <ion-list>
<ion-item> <ion-item>
@@ -25,7 +25,8 @@ export class ExpedientePage implements OnInit {
taskslist = []; taskslist = [];
serialNumber: string; serialNumber: string;
expedienteGdStore = ExpedienteGdStore //expedienteGdStore = ExpedienteGdStore;
expedientegbstore = ExpedienteGdStore
expedienteTaskPipe = new ExpedienteTaskPipe() expedienteTaskPipe = new ExpedienteTaskPipe()
onlinecheck: boolean; onlinecheck: boolean;
@@ -60,10 +61,9 @@ export class ExpedientePage implements OnInit {
this.backgroundservice.registerBackService('Online', () => { this.backgroundservice.registerBackService('Online', () => {
this.LoadList(); this.LoadList();
}); });
} }
async LoadList() { LoadList() {
this.processes.GetTaskListExpediente(false).subscribe(async res => { this.processes.GetTaskListExpediente(false).subscribe(async res => {
this.skeletonLoader = true this.skeletonLoader = true
@@ -85,7 +85,6 @@ export class ExpedientePage implements OnInit {
}, (error) => { }, (error) => {
this.getEventsFromLocalDb(); this.getEventsFromLocalDb();
}) })
} }
async refreshing() { async refreshing() {
@@ -99,7 +99,8 @@ export class ExpedientesPrPage implements OnInit {
} }
goToExpediente(serialNumber:any){ goToExpediente(serialNumber:any){
this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']); //this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']);
this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']);
} }
async viewExpedientDetail(serialNumber:any) { async viewExpedientDetail(serialNumber:any) {
@@ -34,7 +34,9 @@
<p>{{capturedImageTitle}}</p> <p>{{capturedImageTitle}}</p>
<p hidden>size</p> <p hidden>size</p>
</ion-label> </ion-label>
<ion-icon (click)="clear()" name="close"></ion-icon> <div (click)="clear()">
<ion-icon name="close"></ion-icon>
</div>
</ion-item> </ion-item>
@@ -51,7 +53,6 @@
<div class="flex-grow-1 d-flex align-center justify-end" *ngIf="publication.FileBase64"> <div class="flex-grow-1 d-flex align-center justify-end" *ngIf="publication.FileBase64">
<div style="color: red;">X</div> <div style="color: red;">X</div>
</div> </div>
</div> </div>
<div class="ion-item-container-no-border"> <div class="ion-item-container-no-border">
@@ -9,15 +9,14 @@ import { Image } from 'src/app/models/image';
import { PhotoService } from 'src/app/services/photo.service'; import { PhotoService } from 'src/app/services/photo.service';
//Capacitor //Capacitor
//Cordova
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { FormControl, FormGroup, Validators } from '@angular/forms'; import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ThemePalette } from '@angular/material/core'; import { ThemePalette } from '@angular/material/core';
import { formatDate } from 'src/plugin/momentG.js' import { formatDate } from 'src/plugin/momentG.js'
import { FileLoaderService } from 'src/app/services/file/file-loader.service'; import { FileLoaderService } from 'src/app/services/file/file-loader.service';
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service'; import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service';
import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera';
@Component({ @Component({
selector: 'app-new-publication', selector: 'app-new-publication',
@@ -59,15 +58,15 @@ export class NewPublicationPage implements OnInit {
guestPicture:any; guestPicture:any;
capturedImage:any; capturedImage:any = '';
capturedImageTitle:any; capturedImageTitle:any;
public photos: any[] = [];
constructor( constructor(
private modalController: ModalController, private modalController: ModalController,
public photoService: PhotoService, public photoService: PhotoService,
private navParams: NavParams, private navParams: NavParams,
private publications: PublicationsService, private publications: PublicationsService,
private camera: Camera,
private toastService: ToastService, private toastService: ToastService,
private fileLoaderService: FileLoaderService, private fileLoaderService: FileLoaderService,
private fileToBase64Service: FileToBase64Service, private fileToBase64Service: FileToBase64Service,
@@ -81,34 +80,66 @@ export class NewPublicationPage implements OnInit {
ngOnInit() { ngOnInit() {
this.setTitle(); this.setTitle();
this.clear(); console.log(this.folderId);
// this.takePicture(); // this.takePicture();
} }
takePicture() { async takePicture() {
const options: CameraOptions = { const capturedImage = await Camera.getPhoto({
quality: 50, quality: 90,
destinationType: this.camera.DestinationType.DATA_URL, // allowEditing: true,
encodingType: this.camera.EncodingType.JPEG, resultType: CameraResultType.Uri,
mediaType: this.camera.MediaType.PICTURE, source: CameraSource.Camera
targetWidth: 720,
targetHeight: 720,
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL): m
//let base64Image = 'data:image/jpeg;base64,' + imageData;
this.capturedImage = 'data:image/png;base64,'+imageData;
this.capturedImageTitle = new Date().getTime() + '.jpeg';
}, (err) => {
/* console.log(err); */
}); });
const response = await fetch(capturedImage.webPath!);
const blob = await response.blob();
this.photos.unshift({
filepath: "soon...",
webviewPath: capturedImage.webPath
});
this.capturedImage = await this.convertBlobToBase64(blob);
this.capturedImageTitle = new Date().getTime() + '.jpeg';
//console.log(this.capturedImage);
} }
convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
const reader = new FileReader;
reader.onerror = reject;
reader.onload = () => {
resolve(reader.result);
};
reader.readAsDataURL(blob);
});
laodPicture() {
async laodPicture() {
const capturedImage = await Camera.getPhoto({
resultType: CameraResultType.Uri,
source: CameraSource.Photos,
quality: 90,
width: 1080,
height: 720,
});
const response = await fetch(capturedImage.webPath!);
const blob = await response.blob();
this.photos.unshift({
filepath: "soon...",
webviewPath: capturedImage.webPath
});
this.capturedImage = await this.convertBlobToBase64(blob);
this.capturedImageTitle = new Date().getTime() + '.jpeg';
}
/* laodPicture() {
const input = this.fileLoaderService.createInput({ const input = this.fileLoaderService.createInput({
accept: ['image/apng', 'image/jpeg', 'image/png'] accept: ['image/apng', 'image/jpeg', 'image/png']
}) })
@@ -123,29 +154,9 @@ export class NewPublicationPage implements OnInit {
console.log(this.capturedImage) console.log(this.capturedImage)
}; };
} } */
getPicture() {
const options: CameraOptions = {
quality: 90,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
targetWidth: 720,
targetHeight: 720,
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL):
let base64Image = 'data:image/jpeg;base64,' + imageData;
this.capturedImage = imageData;
this.capturedImageTitle = new Date().getTime() + '.jpeg';
}, (err) => {
/* console.log(err); */
});
}
runValidation() { runValidation() {
this.validateFrom = true this.validateFrom = true
@@ -181,7 +192,7 @@ export class NewPublicationPage implements OnInit {
if(this.publicationType == '3') { if(this.publicationType == '3') {
console.log(this.navParams.get('publication')); console.log(this.navParams.get('publication'));
if(this.capturedImage != '') { if(this.capturedImage != ''){
this.publication = { this.publication = {
DateIndex: this.publication.DateIndex, DateIndex: this.publication.DateIndex,
DocumentId:this.publication.DocumentId, DocumentId:this.publication.DocumentId,
@@ -200,11 +211,11 @@ export class NewPublicationPage implements OnInit {
console.log(this.publication); console.log(this.publication);
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService.successMessage("Publicação criado") this.toastService.successMessage("Publicação editada")
this.close(); this.close();
} catch (error) { } catch (error) {
this.toastService.badRequest("Publicação não criado") this.toastService.badRequest("Publicação não editada")
} finally { } finally {
loader.remove() loader.remove()
} }
@@ -273,7 +284,9 @@ export class NewPublicationPage implements OnInit {
else { else {
const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss') const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
console.log(date) console.log(date);
console.log(this.folderId);
this.publication = { this.publication = {
DateIndex: date, DateIndex: date,
@@ -196,7 +196,7 @@ export class ViewPublicationsPage implements OnInit {
component: NewPublicationPage, component: NewPublicationPage,
componentProps: { componentProps: {
publicationType: publicationType, publicationType: publicationType,
folderId: folderId, folderId: this.folderId,
}, },
cssClass: 'new-publication modal modal-desktop', cssClass: 'new-publication modal modal-desktop',
backdropDismiss: false backdropDismiss: false
+3 -2
View File
@@ -352,12 +352,13 @@ export class EventsPage implements OnInit {
} }
goToExpediente(SerialNumber:any) { goToExpediente(SerialNumber:any) {
if(this.loggeduser.Profile == 'MDGPR'){ this.router.navigate(['/home/events/expediente', SerialNumber, 'events']);
/* if(this.loggeduser.Profile == 'MDGPR'){
this.router.navigate(['/home/events/expediente', SerialNumber, 'events']); this.router.navigate(['/home/events/expediente', SerialNumber, 'events']);
} }
else if(this.loggeduser.Profile == 'PR'){ else if(this.loggeduser.Profile == 'PR'){
this.router.navigate(['/home/events/expedientes-pr', SerialNumber, 'events']); this.router.navigate(['/home/events/expedientes-pr', SerialNumber, 'events']);
} } */
} }
viewExpedientListPage(){ viewExpedientListPage(){
+63 -62
View File
@@ -2,14 +2,14 @@ import { Injectable } from '@angular/core';
import { FileLoaderService } from '../file/file-loader.service'; import { FileLoaderService } from '../file/file-loader.service';
import { FileToBase64Service } from '../file/file-to-base64.service'; import { FileToBase64Service } from '../file/file-to-base64.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
//Cordova
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
import { ChatService } from '../chat.service'; import { ChatService } from '../chat.service';
import { ModalController } from '@ionic/angular'; import { ModalController } from '@ionic/angular';
import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchList } from 'src/app/models/search-document'; import { SearchList } from 'src/app/models/search-document';
import { ProcessesService } from '../processes.service'; import { ProcessesService } from '../processes.service';
import { ToastService } from '../toast.service'; import { ToastService } from '../toast.service';
import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -22,9 +22,9 @@ export class FileService {
showLoader: boolean; showLoader: boolean;
files: Set<File>; files: Set<File>;
photos: any[] = [];
constructor( constructor(
private camera: Camera,
private fileLoaderService: FileLoaderService, private fileLoaderService: FileLoaderService,
private fileToBase64Service: FileToBase64Service, private fileToBase64Service: FileToBase64Service,
private iab: InAppBrowser, private iab: InAppBrowser,
@@ -34,26 +34,25 @@ export class FileService {
private toastService: ToastService, private toastService: ToastService,
) { } ) { }
takePicture() { async takePicture() {
const options: CameraOptions = { const capturedImage = await Camera.getPhoto({
quality: 50, quality: 90,
destinationType: this.camera.DestinationType.DATA_URL, // allowEditing: true,
encodingType: this.camera.EncodingType.JPEG, resultType: CameraResultType.Uri,
mediaType: this.camera.MediaType.PICTURE, source: CameraSource.Camera
targetWidth: 720,
targetHeight: 720,
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL): m
//let base64Image = 'data:image/jpeg;base64,' + imageData;
this.capturedImage = 'data:image/png;base64,'+imageData;
this.capturedImageTitle = new Date().getTime() + '.jpeg';
}, (err) => {
/* console.log(err); */
}); });
const response = await fetch(capturedImage.webPath!);
const blob = await response.blob();
this.photos.unshift({
filepath: "soon...",
webviewPath: capturedImage.webPath
});
this.capturedImage = await this.convertBlobToBase64(blob);
this.capturedImageTitle = new Date().getTime() + '.jpeg';
let data = { let data = {
image:this.capturedImage, image:this.capturedImage,
name: this.capturedImageTitle name: this.capturedImageTitle
@@ -62,6 +61,15 @@ export class FileService {
return data; return data;
} }
convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
const reader = new FileReader;
reader.onerror = reject;
reader.onload = () => {
resolve(reader.result);
};
reader.readAsDataURL(blob);
});
loadPicture() { loadPicture() {
const input = this.fileLoaderService.createInput({ const input = this.fileLoaderService.createInput({
accept: ['image/apng', 'image/jpeg', 'image/png'] accept: ['image/apng', 'image/jpeg', 'image/png']
@@ -85,19 +93,24 @@ export class FileService {
}; };
} }
addCameraPictureToChat(roomId){ async addCameraPictureToChat(roomId){
const options: CameraOptions = { const capturedImage = await Camera.getPhoto({
quality: 50, quality: 90,
destinationType: this.camera.DestinationType.DATA_URL, // allowEditing: true,
encodingType: this.camera.EncodingType.JPEG, resultType: CameraResultType.Uri,
mediaType: this.camera.MediaType.PICTURE, source: CameraSource.Camera
targetWidth: 720,
targetHeight: 720,
}
this.camera.getPicture(options).then((imageData) => { });
this.capturedImage = 'data:image/png;base64,'+imageData; const response = await fetch(capturedImage.webPath!);
const blob = await response.blob();
this.photos.unshift({
filepath: "soon...",
webviewPath: capturedImage.webPath
});
this.capturedImage = await this.convertBlobToBase64(blob);
this.capturedImageTitle = new Date().getTime() + '.jpeg'; this.capturedImageTitle = new Date().getTime() + '.jpeg';
let body = { let body = {
@@ -121,29 +134,26 @@ export class FileService {
this.toastService.badRequest("Não foi possível adicionar a fotografia!"); this.toastService.badRequest("Não foi possível adicionar a fotografia!");
}); });
}, (err) => { }
this.toastService.badRequest("Não foi possível adicionar a fotografia!");
async addPictureToChatMobile(roomId) {
const capturedImage = await Camera.getPhoto({
quality: 90,
// allowEditing: true,
resultType: CameraResultType.Uri,
source: CameraSource.Photos
});
const response = await fetch(capturedImage.webPath!);
const blob = await response.blob();
this.photos.unshift({
filepath: "soon...",
webviewPath: capturedImage.webPath
}); });
} this.capturedImage = await this.convertBlobToBase64(blob);
addPictureToChatMobile(roomId) {
alert('Here')
const options: CameraOptions = {
quality: 90,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
targetWidth: 720,
targetHeight: 720,
correctOrientation: true
}
this.camera.getPicture(options).then((imageData) => {
let base64Image = 'data:image/jpeg;base64,' + imageData;
this.capturedImage = imageData;
this.capturedImageTitle = new Date().getTime() + '.jpeg'; this.capturedImageTitle = new Date().getTime() + '.jpeg';
//const loader = this.toastService.loading(); //const loader = this.toastService.loading();
@@ -161,21 +171,12 @@ export class FileService {
}] }]
} }
} }
console.log(this.capturedImage)
this.chatService.sendMessage(body).subscribe(res=> { this.chatService.sendMessage(body).subscribe(res=> {
//loader.remove(); //loader.remove();
//console.log(res); //console.log(res);
},(error) => { },(error) => {
//loader.remove(); //loader.remove();
}); });
}, (err) => {
//console.log(err);
});
} }
addPictureToChat(roomId) { addPictureToChat(roomId) {
@@ -117,13 +117,13 @@
<ion-fab-button (click)="bookMeeting()" color="light"> <ion-fab-button (click)="bookMeeting()" color="light">
<ion-icon name="calendar"></ion-icon> <ion-icon name="calendar"></ion-icon>
</ion-fab-button> </ion-fab-button>
<ion-fab-button (click)="addFile()" color="light"> <ion-fab-button hidden (click)="addFile()" color="light">
<ion-icon name="document"></ion-icon> <ion-icon name="document"></ion-icon>
</ion-fab-button> </ion-fab-button>
<ion-fab-button (click)="addImage()" color="light"> <ion-fab-button (click)="addImage()" color="light">
<ion-icon name="image"></ion-icon> <ion-icon name="image"></ion-icon>
</ion-fab-button> </ion-fab-button>
<ion-fab-button class="hide-desktop" (click)="takePicture()" color="light"> <ion-fab-button (click)="takePicture()" color="light">
<ion-icon name="camera"></ion-icon> <ion-icon name="camera"></ion-icon>
</ion-fab-button> </ion-fab-button>
<ion-fab-button (click)="addFileWebtrix()" color="light"> <ion-fab-button (click)="addFileWebtrix()" color="light">
@@ -97,7 +97,8 @@ export class ExpedientesPrPage implements OnInit {
} }
goToExpediente(serialNumber:any){ goToExpediente(serialNumber:any){
this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']); /* this.router.navigate(['/home/gabinete-digital/expedientes-pr',serialNumber,'gabinete-digital']); */
this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']);
} }
} }
@@ -6,9 +6,9 @@
</button> </button>
</div> </div>
<div class="buttons"> <div class="buttons">
<button hidden (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button> <button (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
<button hidden (click)="addFile()" class="btn-ok" shape="round" >Anexar Documento</button> <button hidden (click)="addFile()" class="btn-ok" shape="round" >Anexar Documento</button>
<button hidden (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button> <button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Gestão Documental</button> <button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Gestão Documental</button>
<div class="solid"></div> <div class="solid"></div>
<button (click)="bookMeeting()" class="btn-ok" shape="round" >Novo Evento</button> <button (click)="bookMeeting()" class="btn-ok" shape="round" >Novo Evento</button>
@@ -14,6 +14,7 @@
<button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button> <button (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
<button class="btn-cancel desk" shape="round">Outras opções </button> <button class="btn-cancel desk" shape="round">Outras opções </button>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
</div> </div>
<div class="flex-grow-1"> <div class="flex-grow-1">
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
@@ -22,18 +23,21 @@
<button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button> <button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button> <button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
</div> </div>
</div> </div>
<div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100"> <div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
<div class="flex-grow-1"> <div class="flex-grow-1">
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> <button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >11Efetuar Despacho</button>
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >11Efetuar Despacho</button>
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button> <button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
<div class="solid"></div> <div class="solid"></div>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button> <button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button> <button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes11</button>
<div hidden class="solid"></div> <div hidden class="solid"></div>
<button hidden class="btn-cancel" shape="round" >Delegar</button> <button hidden class="btn-cancel" shape="round" >Delegar</button>
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
</div> </div>
</div> </div>
@@ -66,6 +66,10 @@ export class OptsExpedientePage implements OnInit {
}; };
} }
openNewGroupPage(){
}
close() { close() {
if( window.innerWidth < 801) { if( window.innerWidth < 801) {
this.popoverController.dismiss(); this.popoverController.dismiss();
@@ -27,8 +27,6 @@
</div> </div>
</div> </div>
<div class="container-title py-10 hide-desktop">Fotografia Anexada</div>
<div class="picture d-flex pb-5 hide-desktop" *ngIf="publication.FileBase64 && capturedImage ==''"> <div class="picture d-flex pb-5 hide-desktop" *ngIf="publication.FileBase64 && capturedImage ==''">
<div class="post-img"> <div class="post-img">
<img src="{{publication.FileBase64}}" alt="image" > <img src="{{publication.FileBase64}}" alt="image" >
@@ -40,18 +38,6 @@
<div class="flex-grow-1 d-flex align-center justify-end"> <div class="flex-grow-1 d-flex align-center justify-end">
<div style="color: red;">X</div> <div style="color: red;">X</div>
</div> </div>
</div>
<div class="ion-item-container-no-border">
<ion-label (click)="laodPicture()" class="cursor-pointer">
<div class="attach-icon">
<ion-icon src="assets/images/icons-add-photos.svg"></ion-icon>
</div>
<div class="attach-document cursor-pointer">
<ion-label>Anexar Fotografia</ion-label>
</div>
</ion-label>
</div> </div>
<div *ngIf="capturedImage != ''" class="ion-item-container-no-border"> <div *ngIf="capturedImage != ''" class="ion-item-container-no-border">
@@ -65,7 +51,9 @@
<p>{{capturedImageTitle}}</p> <p>{{capturedImageTitle}}</p>
<p hidden>size</p> <p hidden>size</p>
</ion-label> </ion-label>
<ion-icon (click)="clear()" name="close"></ion-icon> <button class="btn-no-color" (click)="clear()">
<ion-icon name="close"></ion-icon>
</button>
</ion-item> </ion-item>
</div> </div>
@@ -82,7 +70,7 @@
</div> </div>
<div class="ion-item-container-no-border hide-desktop"> <div class="ion-item-container-no-border hide-desktop">
<ion-label (click)="getPicture()" class="cursor-pointer"> <ion-label (click)="laodPicture()" class="cursor-pointer">
<div class="attach-icon"> <div class="attach-icon">
<ion-icon src="assets/images/icons-add-photos.svg"></ion-icon> <ion-icon src="assets/images/icons-add-photos.svg"></ion-icon>
</div> </div>
@@ -95,7 +83,6 @@
</ion-content> </ion-content>
<ion-footer class="ion-no-border"> <ion-footer class="ion-no-border">
<ion-toolbar class="footer-toolbar width-100 px-20"> <ion-toolbar class="footer-toolbar width-100 px-20">
<ion-buttons slot="start"> <ion-buttons slot="start">
@@ -4,11 +4,11 @@ import { PublicationsService } from 'src/app/services/publications.service';
import { Publication } from 'src/app/models/publication'; import { Publication } from 'src/app/models/publication';
import { Image } from 'src/app/models/image'; import { Image } from 'src/app/models/image';
import { PhotoService } from 'src/app/services/photo.service'; import { PhotoService } from 'src/app/services/photo.service';
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { FormControl, FormGroup, Validators } from '@angular/forms'; import { FormControl, FormGroup, Validators } from '@angular/forms';
import { FileLoaderService } from 'src/app/services/file/file-loader.service' import { FileLoaderService } from 'src/app/services/file/file-loader.service'
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service'; import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera';
@Component({ @Component({
selector: 'app-new-publication', selector: 'app-new-publication',
templateUrl: './new-publication.page.html', templateUrl: './new-publication.page.html',
@@ -41,13 +41,13 @@ export class NewPublicationPage implements OnInit {
guestPicture:any; guestPicture:any;
capturedImage:any; capturedImage:any = '';
capturedImageTitle:any; capturedImageTitle:any;
photos: any[] = [];
constructor( constructor(
public photoService: PhotoService, public photoService: PhotoService,
private publications: PublicationsService, private publications: PublicationsService,
private camera: Camera,
private toastService: ToastService, private toastService: ToastService,
private fileLoaderService: FileLoaderService, private fileLoaderService: FileLoaderService,
private fileToBase64Service: FileToBase64Service private fileToBase64Service: FileToBase64Service
@@ -60,8 +60,8 @@ export class NewPublicationPage implements OnInit {
this.getPublicationDetail(); this.getPublicationDetail();
} }
this.setTitle(); this.setTitle();
this.clear(); //this.clear();
this.takePicture(); //this.takePicture();
} }
getPublicationDetail() { getPublicationDetail() {
@@ -88,26 +88,56 @@ export class NewPublicationPage implements OnInit {
} }
takePicture() { async takePicture() {
const options: CameraOptions = { const capturedImage = await Camera.getPhoto({
quality: 90, quality: 90,
destinationType: this.camera.DestinationType.DATA_URL, // allowEditing: true,
encodingType: this.camera.EncodingType.JPEG, resultType: CameraResultType.Uri,
mediaType: this.camera.MediaType.PICTURE, source: CameraSource.Camera
targetWidth: 720,
targetHeight: 720,
}
this.camera.getPicture(options).then((imageData) => {
this.capturedImage = imageData;
this.capturedImageTitle = new Date().getTime() + '.jpeg';
}, (err) => {
console.log(err);
}); });
const response = await fetch(capturedImage.webPath!);
const blob = await response.blob();
this.photos.unshift({
filepath: "soon...",
webviewPath: capturedImage.webPath
});
this.capturedImage = await this.convertBlobToBase64(blob);
this.capturedImageTitle = new Date().getTime() + '.jpeg';
//console.log(this.capturedImage);
} }
laodPicture() { convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
const reader = new FileReader;
reader.onerror = reject;
reader.onload = () => {
resolve(reader.result);
};
reader.readAsDataURL(blob);
});
async laodPicture() {
const capturedImage = await Camera.getPhoto({
resultType: CameraResultType.Uri,
source: CameraSource.Photos,
quality: 90,
width: 1080,
height: 720,
});
const response = await fetch(capturedImage.webPath!);
const blob = await response.blob();
this.photos.unshift({
filepath: "soon...",
webviewPath: capturedImage.webPath
});
this.capturedImage = await this.convertBlobToBase64(blob);
this.capturedImageTitle = new Date().getTime() + '.jpeg';
}
/* laodPicture() {
const input = this.fileLoaderService.createInput({ const input = this.fileLoaderService.createInput({
accept: ['image/apng', 'image/jpeg', 'image/png'] accept: ['image/apng', 'image/jpeg', 'image/png']
}) })
@@ -119,8 +149,7 @@ export class NewPublicationPage implements OnInit {
this.capturedImage = imageData; this.capturedImage = imageData;
this.capturedImageTitle = file.name this.capturedImageTitle = file.name
}; };
} */
}
runValidation() { runValidation() {
@@ -270,28 +299,6 @@ export class NewPublicationPage implements OnInit {
} }
} }
getPicture() {
const options: CameraOptions = {
quality: 90,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
targetWidth: 720,
targetHeight: 720,
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL):
let base64Image = 'data:image/jpeg;base64,' + imageData;
this.capturedImage = imageData;
this.capturedImageTitle = new Date().getTime() + '.jpeg';
}, (err) => {
/* console.log(err); */
});
}
close(){ close(){
this.goBack(); this.goBack();
} }