Skip to content
This repository has been archived by the owner on Aug 31, 2019. It is now read-only.

Commit

Permalink
Merge pull request #197 from umts/redirect
Browse files Browse the repository at this point in the history
Enable Redirecting to External URLs
  • Loading branch information
Aaron Kaplowitz authored Sep 13, 2016
2 parents 2a1a7cb + cd39003 commit 5fe0a91
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
plugins

platforms/android/*

platforms/ios/*
Expand Down
1 change: 1 addition & 0 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<content src="index.html"/>
<access origin="*"/>
<access origin="mailto:*" launch-external="yes"/>
<allow-intent href="mailto:*"/>
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard",
"cordova-plugin-whitelist"
"cordova-plugin-whitelist",
"cordova-plugin-inappbrowser"
],
"cordovaPlatforms": [
"ios",
Expand Down
4 changes: 2 additions & 2 deletions platforms/platforms.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"ios": "3.9.2",
"android": "4.1.1"
"ios": "4.1.1",
"android": "5.1.1"
}
11 changes: 7 additions & 4 deletions plugins/android.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
},
"installed_plugins": {
"cordova-plugin-geolocation": {
"PACKAGE_NAME": "com.umts.pvta_multiplaform"
"PACKAGE_NAME": "com.umts.pvta-multiplaform"
},
"cordova-plugin-statusbar": {
"PACKAGE_NAME": "com.umts.pvta_multiplaform"
"PACKAGE_NAME": "com.umts.pvta-multiplaform"
},
"cordova-plugin-whitelist": {
"PACKAGE_NAME": "com.umts.pvta_multiplaform"
"PACKAGE_NAME": "com.umts.pvta-multiplaform"
},
"cordova-plugin-inappbrowser": {
"PACKAGE_NAME": "com.umts.pvta-multiplaform"
}
},
"dependent_plugins": {}
}
}
9 changes: 9 additions & 0 deletions plugins/fetch.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,14 @@
},
"is_top_level": true,
"variables": {}
},
"cordova-plugin-inappbrowser": {
"source": {
"type": "git",
"url": "https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git",
"subdir": "."
},
"is_top_level": true,
"variables": {}
}
}
3 changes: 3 additions & 0 deletions plugins/ios.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
},
"cordova-plugin-whitelist": {
"PACKAGE_NAME": "com.umts.pvta-multiplaform"
},
"cordova-plugin-inappbrowser": {
"PACKAGE_NAME": "com.umts.pvta-multiplaform"
}
},
"dependent_plugins": {}
Expand Down
3 changes: 3 additions & 0 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<meta name="google-site-verification" content="fl6hMTOUVgBkFwN8ivRVWGS5p-vPqF2qluCwanrhKDQ" />
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

<meta http-equiv="Content-Security-Policy" content="">

<title></title>

<!-- compiled css output -->
Expand Down
22 changes: 21 additions & 1 deletion www/pages/about/about-controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
angular.module('pvta.controllers').controller('AboutController', function ($scope, Info) {
angular.module('pvta.controllers').controller('AboutController', function ($scope, $window, Info) {
ga('set', 'page', '/about.html');
ga('send', 'pageview');
$scope.vNum = Info.versionNum;
$scope.vName = Info.versionName;
/*
Opens a given URL in the browser.
*/
$scope.openLink = function (url) {
console.log('Opening ' + url + ' in the browser');
// If we're on a device, we have to use cordova
// to open the default browser
if ($window.cordova) {
// We have to make sure that cordova is properly loaded before
// using one of its plugins.
document.addEventListener('deviceready', function () {
cordova.InAppBrowser.open(url, '_system');
}, false);
}
// If we're running as a web-app in a standard browser,
// we can just open the link in a new tab.
else {
$window.open(url);
}
};
});
21 changes: 14 additions & 7 deletions www/pages/about/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,25 @@
Version: {{vNum}}, {{vName}}
</div>
<div class="item">
Made with <a class="icon ion-ionic" href="http://ionicframework.com"></a>,
<a class="ion-social-angular" href="https://angularjs.org"></a>,
and <a class="ion-ios-heart" href="https://en.wikipedia.org/wiki/Love"></a>
Made with
<a class="icon ion-ionic" href="#"
ng-click="openLink('https://ionicframework.com')"></a>,
<a class="ion-social-angular" href="#"
ng-click="openLink('https://angular.io')"></a>,
and
<a class="ion-ios-heart" href="#"
ng-click="openLink('https://en.wikipedia.org/wiki/Compassion')"></a>
by UMass Transit's student developers in Amherst, MA
</div>
<a href="http://github.com/umts/pvta-multiplatform" class="item item-icon-left">
Contribute to pvta-multiplatform<i class="icon ion-social-github"></i>
<a class="item item-icon-left" href="#"
ng-click="openLink('https://github.com/umts/pvta-multiplatform')">
Contribute to pvta-multiplatform
<i class="icon ion-social-github"></i>
</a>
<a class="item item-icon-left" href="mailto:transit-it@admin.umass.edu" target="_blank">
<a class="item item-icon-left" href="mailto:programmers@admin.umass.edu" target="_blank">
<i class="icon ion-bug"></i>
Find a bug? Let us know!
</a>
</div>
</ion-content>
</ion-view>
</ion-view>

0 comments on commit 5fe0a91

Please sign in to comment.