Skip to content

Commit

Permalink
Update CDVThemeableBrowser.m
Browse files Browse the repository at this point in the history
  • Loading branch information
tien271 authored and Tien Nguyen committed Jun 14, 2020
1 parent 1394383 commit 7f09187
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 16 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#If ignorance is bliss, then somebody knock the smile off my face
#If ignorance is bliss, then somebody knock the smile off my face

*.csproj.user
*.suo
Expand All @@ -20,4 +20,5 @@ Thumbs.db





package-lock.json
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
under the License.
-->

cordova-plugin-themeablebrowser
cordova-plugin-themeablebrowser-wkwebview
===============================

This plugin is a fork of [org.apache.cordova.inappbrowser](https://github.com/apache/cordova-plugin-inappbrowser). It attempts to retain most of the features of the InAppBrowser. In fact, for the full list of features inherited from InAppBrowser, please refer to [InAppBrowser's documentation](https://github.com/apache/cordova-plugin-inappbrowser/blob/master/README.md).
Expand Down Expand Up @@ -128,7 +128,7 @@ Sample call/config:
Installation
------------

cordova plugin add cordova-plugin-themeablebrowser
cordova plugin add cordova-plugin-themeablebrowser-wkwebview

Additional Properties
---------------------
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "firefly-cordova-plugin-themeablebrowser",
"version": "0.4.0",
"name": "cordova-plugin-themeablebrowser-wkwebview",
"version": "2.0.0",
"description": "Cordova ThemeableBrowser Plugin",
"cordova": {
"id": "firefly-cordova-plugin-themeablebrowser",
"id": "cordova-plugin-themeablebrowser-wkwebview",
"platforms": [
"android",
"amazon-fireos",
Expand All @@ -18,7 +18,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/imloama/cordova-plugin-themeablebrowser.git"
"url": "git+https://github.com/tien271/cordova-plugin-themeablebrowser-wkwebview.git"
},
"keywords": [
"cordova",
Expand All @@ -44,7 +44,7 @@
"readme": "",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/imloama/cordova-plugin-themeablebrowser/issues"
"url": "https://github.com/tien271/cordova-plugin-themeablebrowser-wkwebview/issues"
},
"homepage": "https://github.com/imloama/cordova-plugin-themeablebrowser#readme"
"homepage": "https://github.com/tien271/cordova-plugin-themeablebrowser-wkwebview#readme"
}
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

<plugin
xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="firefly-cordova-plugin-themeablebrowser"
version="0.5.0">
id="cordova-plugin-themeablebrowser-wkwebview"
version="2.0.0">

<name>ThemeableBrowser</name>
<description>Cordova ThemeableBrowser Plugin</description>
Expand Down
18 changes: 15 additions & 3 deletions src/ios/CDVThemeableBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
// //#import <Cordova/CDVWebViewDelegate.h>
//#endif

@class CDVWKInAppBrowserViewController;

@interface CDVThemeableBrowserOptions : NSObject {}

@property (nonatomic) BOOL location;
Expand All @@ -43,6 +45,7 @@
@property (nonatomic) NSString* transitionstyle;

@property (nonatomic) BOOL zoom;
@property (nonatomic) BOOL enableviewportscale;
@property (nonatomic) BOOL mediaplaybackrequiresuseraction;
@property (nonatomic) BOOL allowinlinemediaplayback;
@property (nonatomic) BOOL keyboarddisplayrequiresuseraction;
Expand All @@ -53,23 +56,27 @@
@property (nonatomic) NSDictionary* statusbar;
@property (nonatomic) NSDictionary* toolbar;
@property (nonatomic) NSDictionary* title;
@property (nonatomic) NSDictionary* browserProgress;
@property (nonatomic) NSDictionary* backButton;
@property (nonatomic) NSDictionary* reloadButton;
@property (nonatomic) NSDictionary* forwardButton;
@property (nonatomic) NSDictionary* closeButton;
@property (nonatomic) NSDictionary* menu;
@property (nonatomic) NSArray* customButtons;
@property (nonatomic) BOOL backButtonCanClose;
@property (nonatomic) BOOL disableAnimation;
@property (nonatomic) BOOL fullscreen;
@property (nonatomic) BOOL allowsBackForwardNavigationGestures;
@property (nonatomic) NSString* customUserAgent;

@end

@class CDVThemeableBrowserViewController;

@interface CDVThemeableBrowser : CDVPlugin <WKNavigationDelegate> {
BOOL _injectedIframeBridge;
}


@property (nonatomic, retain) CDVThemeableBrowserViewController* themeableBrowserViewController;
@property (nonatomic, copy) NSString* callbackId;
@property (nonatomic, copy) NSRegularExpression *callbackIdPattern;
Expand All @@ -80,11 +87,13 @@
- (void)injectScriptCode:(CDVInvokedUrlCommand*)command;
- (void)show:(CDVInvokedUrlCommand*)command;
- (void)show:(CDVInvokedUrlCommand*)command withAnimation:(BOOL)animated;
- (void)hide:(CDVInvokedUrlCommand*)command;
- (void)reload:(CDVInvokedUrlCommand*)command;
- (void)changeButtonImage:(CDVInvokedUrlCommand*)command;

@end

@interface CDVThemeableBrowserViewController : UIViewController <WKNavigationDelegate,CDVScreenOrientationDelegate, UIActionSheetDelegate>{
@interface CDVThemeableBrowserViewController : UIViewController <WKNavigationDelegate,CDVScreenOrientationDelegate, UIActionSheetDelegate, UIGestureRecognizerDelegate, WKScriptMessageHandler, WKUIDelegate>{
@private
NSString* _userAgent;
NSString* _prevUserAgent;
Expand All @@ -109,10 +118,12 @@
@property (nonatomic, strong) IBOutlet UILabel* addressLabel;
@property (nonatomic, strong) IBOutlet UILabel* titleLabel;
@property (nonatomic, strong) IBOutlet UIButton* backButton;
@property (nonatomic, strong) IBOutlet UIButton* reloadButton;
@property (nonatomic, strong) IBOutlet UIButton* forwardButton;
@property (nonatomic, strong) IBOutlet UIButton* menuButton;
@property (nonatomic, strong) IBOutlet UIActivityIndicatorView* spinner;
@property (nonatomic, strong) IBOutlet UIView* toolbar;
@property (nonatomic, strong) IBOutlet UIProgressView* progressView;

@property (nonatomic, strong) NSArray* leftButtons;
@property (nonatomic, strong) NSArray* rightButtons;
Expand All @@ -121,6 +132,8 @@
@property (nonatomic, weak) CDVThemeableBrowser* navigationDelegate;
@property (nonatomic) NSURL* currentURL;
@property (nonatomic) CGFloat titleOffset;
@property (nonatomic , readonly , getter=loadProgress) CGFloat currentProgress;
- (void)changeButtonImage:(int)buttonIndex buttonProps:(NSDictionary*)buttonProps;

- (void)close;
- (void)reload;
Expand All @@ -140,4 +153,3 @@
@property (nonatomic, weak) id <CDVScreenOrientationDelegate> orientationDelegate;

@end

2 changes: 1 addition & 1 deletion src/ios/CDVThemeableBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -2033,4 +2033,4 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
}


@end
@end

0 comments on commit 7f09187

Please sign in to comment.