Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes UIWebView #185

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Release notes

## 0.6.6

* Removed support for Windows Phone 8
* Fixed iOS version for Apple's ITMS-90809: UIWebView API Deprecation
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
## Native Page Transitions Cordova / PhoneGap Plugin
by [Telerik](http://www.telerik.com)
# Native Page Transitions Cordova / PhoneGap Plugin

> **WARNING**: This plugin is no longer maintained, and we now recommend using [NativeScript](https://www.nativescript.org/) as you get native transitions (and UI) out of the box.
## Aknowledgments

This is a fork of now unmaintained plugin by [Telerik](https://github.com/Telerik-Verified-Plugins/NativePageTransitions)

## Fixes since Telerik last version (0.6.5)

* ITMS-90809: UIWebView API Deprecation

## Installation

Using the Cordova CLI?

```
cordova plugin add com.telerik.plugins.nativepagetransitions
cordova plugin add cordova-plugin-nativepagetransitions
```

Using PGB?

```xml
<plugin name="com.telerik.plugins.nativepagetransitions" source="npm" />
<plugin name="cordova-plugin-nativepagetransitions" source="npm" />
```

[The MIT License (MIT)](http://www.opensource.org/licenses/mit-license.html)
17 changes: 6 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"version": "0.6.5",
"name": "com.telerik.plugins.nativepagetransitions",
"version": "0.6.6",
"name": "cordova-plugin-nativepagetransitions",
"cordova_name": "Native Page Transitions",
"description": "Slide out the current page to reveal the next one. By a native transitions.",
"license": "MIT",
"author": "Telerik / Eddy Verbruggen <[email protected]> (https://github.com/EddyVerbruggen)",
"repo": "https://github.com/Telerik-Verified-Plugins/WKWebView.git",
"issue": "https://github.com/Telerik-Verified-Plugins/WKWebView/issues",
"author": "Original version by Telerik / Eddy Verbruggen <[email protected]> (https://github.com/EddyVerbruggen)",
"repo": "https://github.com/tlacroix/NativePageTransitions.git",
"keywords": [
"Native transitions",
"Native page transitions",
Expand All @@ -17,15 +16,11 @@
"Curl",
"ecosystem:cordova",
"cordova-android",
"cordova-ios",
"cordova-wp8",
"cordova-windows"
"cordova-ios"
],
"platforms": [
"ios",
"android",
"wp8",
"windows"
"android"
],
"engines": [
{
Expand Down
47 changes: 18 additions & 29 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="com.telerik.plugins.nativepagetransitions"
version="0.6.5">

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-nativepagetransitions" version="0.6.6">
<name>Native Page Transitions</name>

<description>
Slide out the current page to reveal the next one. By a native transitions.
</description>

<author>Eddy Verbruggen / Telerik</author>

<description>Slide out the current page to reveal the next one. By a native transitions.</description>
<author>
Eddy Verbruggen / Telerik
Tommy Lacroix / NuageLab
</author>
<license>MIT</license>

<keywords>Native transitions, Native page transitions, Slide, Flip, Drawer, Menu, Curl</keywords>

<repo>https://github.com/Telerik-Verified-Plugins/NativePageTransitions.git</repo>

<issue>https://github.com/Telerik-Verified-Plugins/NativePageTransitions/issues</issue>

<repo>https://github.com/tlacroix/NativePageTransitions.git</repo>
<engines>
<engine name="cordova" version=">=3.0.0"/>
</engines>

<js-module src="www/NativePageTransitions.js" name="NativePageTransitions">
<clobbers target="window.plugins.nativepagetransitions"/>
</js-module>
Expand All @@ -45,22 +34,22 @@
<config-file target="res/xml/config.xml" parent="/*">
<feature name="NativePageTransitions">
<param name="android-package" value="com.telerik.plugins.nativepagetransitions.NativePageTransitions"/>
<param name="onload" value="true" />
<param name="onload" value="true" />
</feature>
</config-file>
<source-file src="src/android/NativePageTransitions.java" target-dir="src/com/telerik/plugins/nativepagetransitions"/>
<source-file src="src/android/lib/FlipAnimation.java" target-dir="src/com/telerik/plugins/nativepagetransitions/lib"/>
<source-file src="src/android/lib/AnimationFactory.java" target-dir="src/com/telerik/plugins/nativepagetransitions/lib"/>
</platform>

<!-- windows phone -->
<platform name="wp8">
<config-file target="config.xml" parent="/*">
<feature name="NativePageTransitions">
<param name="wp-package" value="NativePageTransitions"/>
<param name="onload" value="true" />
</feature>
</config-file>
<source-file src="src/winphone/NativePageTransitions.cs" />
</platform>
<!-- windows phone -->
<platform name="wp8">
<config-file target="config.xml" parent="/*">
<feature name="NativePageTransitions">
<param name="wp-package" value="NativePageTransitions"/>
<param name="onload" value="true" />
</feature>
</config-file>
<source-file src="src/winphone/NativePageTransitions.cs" />
</platform>
</plugin>
29 changes: 4 additions & 25 deletions src/ios/NativePageTransitions.m
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,6 @@ - (UIImage*) grabScreenshot {
}

- (BOOL) loadHrefIfPassed:(NSString*) href {
UIWebView *uiwebview = nil;
if ([self.webView isKindOfClass:[UIWebView class]]) {
uiwebview = ((UIWebView*)self.webView);
}
if (href != nil && ![href isEqual:[NSNull null]]) {
if (![href hasPrefix:@"#"]) {
// strip any params when looking for the file on the filesystem
Expand All @@ -735,11 +731,7 @@ - (BOOL) loadHrefIfPassed:(NSString*) href {
}
NSURL *url;
NSURL *origUrl;
if (self.wkWebView != nil) {
origUrl = self.wkWebView.URL;
} else {
origUrl = uiwebview.request.URL;
}
origUrl = self.wkWebView.URL;
if([origUrl.scheme isEqualToString:@"file"]) {
NSString *currentUrl = origUrl.absoluteString;
NSRange lastSlash = [currentUrl rangeOfString:@"/" options:NSBackwardsSearch];
Expand All @@ -761,24 +753,15 @@ - (BOOL) loadHrefIfPassed:(NSString*) href {

NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];

// Utilize WKWebView for request if it exists
if (self.wkWebView != nil) {
[self.wkWebView loadRequest: urlRequest];
} else {
[uiwebview loadRequest: urlRequest];
}
[self.wkWebView loadRequest: urlRequest];
} else if (![href hasPrefix:@"#"]) {
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"href must be null, a .html file or a #navigationhash"];
[self.commandDelegate sendPluginResult:pluginResult callbackId:_command.callbackId];
return NO;
} else {
// it's a hash, so load the url without any possible current hash
NSString *url = nil;
if (self.wkWebView != nil) {
url = self.wkWebView.URL.absoluteString;
} else {
url = uiwebview.request.URL.absoluteString;
}
url = self.wkWebView.URL.absoluteString;

// remove the # if it's still there
if ([url rangeOfString:@"#"].location != NSNotFound) {
Expand All @@ -790,11 +773,7 @@ - (BOOL) loadHrefIfPassed:(NSString*) href {
// and load it
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];

if (self.wkWebView != nil) {
[self.wkWebView loadRequest: urlRequest];
} else {
[uiwebview loadRequest: urlRequest];
}
[self.wkWebView loadRequest: urlRequest];
}
}
return YES;
Expand Down
Loading