Skip to content

Commit 4ef478a

Browse files
committed
Test stuff
1 parent 18499c3 commit 4ef478a

File tree

7 files changed

+297
-0
lines changed

7 files changed

+297
-0
lines changed

test/html/jan/app.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Ionic Starter App
2+
3+
// angular.module is a global place for creating, registering and retrieving Angular modules
4+
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
5+
// the 2nd parameter is an array of 'requires'
6+
// 'starter.controllers' is found in controllers.js
7+
angular.module('starter', [
8+
'ionic',
9+
'ngIOS9UIWebViewPatch',
10+
])
11+
12+
.config(function ($stateProvider, $urlRouterProvider, $ionicConfigProvider) {
13+
$stateProvider
14+
.state('app', {
15+
url: "/app",
16+
abstract: true,
17+
templateUrl: "menu.html",
18+
controller: 'AppCtrl'
19+
})
20+
.state('app.contact', {
21+
cache: false,
22+
url: "/contact",
23+
views: {
24+
'menuContent': {
25+
templateUrl: "contact.html",
26+
controller: 'ContactCtrl'
27+
}
28+
}
29+
})
30+
.state('app.info', {
31+
cache: false,
32+
url: "/info",
33+
views: {
34+
'menuContent': {
35+
templateUrl: "info.html",
36+
controller: 'InfoCtrl'
37+
}
38+
}
39+
});
40+
// if none of the above states are matched, use this as the fallback
41+
$urlRouterProvider.otherwise('/app/info');
42+
$ionicConfigProvider.views.swipeBackEnabled(false);
43+
})
44+
.controller('AppCtrl', function ($scope, $http, $timeout, $rootScope, $ionicSideMenuDelegate, $state, $ionicHistory, $ionicPopup, $window) {
45+
})
46+
.controller('ContactCtrl', function ($scope, $http, $state, $ionicPopup) {
47+
})
48+
49+
.controller('InfoCtrl', function ($scope, $http, $ionicPlatform) {
50+
})

test/html/jan/contact.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<ion-view view-title="Contact">
2+
<ion-content class="has-footer">
3+
<form id="contact-form" name="contactForm" ng-submit="send(contactForm)" novalidate>
4+
<div class="list">
5+
<label class="item item-input item-floating-label" ng-class="{ 'has-error' : contactForm.name.$invalid }">
6+
<span class="input-label">Name</span>
7+
<input type="text" name="name" placeholder="Name" ng-model="contactData.name" required>
8+
</label>
9+
<label class="item item-input item-floating-label" ng-class="{ 'has-error' : contactForm.email.$invalid }">
10+
<span class="input-label">E-Mail</span>
11+
<input type="text" name="email" placeholder="E-Mail" ng-model="contactData.email" required>
12+
</label>
13+
</div>
14+
<div class="padding-left padding-right">
15+
<button class="button button-block button-positive">
16+
Submit
17+
</button>
18+
</div>
19+
</form>
20+
</ion-view>

test/html/jan/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html ng-app="starter">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Side Menus</title>
6+
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
7+
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
8+
<script src="../../../../dist/js/ionic.bundle.js"></script>
9+
<script src="patch.js"></script>
10+
<script src="app.js"></script>
11+
</head>
12+
<body>
13+
<ion-nav-view></ion-nav-view>
14+
<ion-footer-bar>
15+
</ion-footer-bar>
16+
</body>
17+
</html>

test/html/jan/info.html

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<ion-view view-title="Info">
2+
<ion-content class="has-footer">
3+
<div class="card">
4+
<div class="item item-divider">
5+
Was ist MeldungenKreis?
6+
</div>
7+
<div class="item item-text-wrap">
8+
TEXT TEXT TEXT TEXT TEXT TEXT
9+
TEXT TEXT TEXT TEXT TEXT TEXT
10+
TEXT TEXT TEXT TEXT TEXT TEXT
11+
TEXT TEXT TEXT TEXT TEXT TEXT
12+
TEXT TEXT TEXT TEXT TEXT TEXT
13+
TEXT TEXT TEXT TEXT TEXT TEXT
14+
TEXT TEXT TEXT TEXT TEXT TEXT
15+
</div>
16+
</div>
17+
<div class="card">
18+
<div class="item item-divider">
19+
TEXT TEXT TEXT TEXT TEXT TEXT
20+
</div>
21+
<div class="item item-text-wrap">
22+
TEXT TEXT TEXT TEXT TEXT TEXT
23+
</div>
24+
<div class="row text-center">
25+
<div class="col">
26+
<br /> Me
27+
</div>
28+
<div class="col">
29+
<br /> METWO
30+
</div>
31+
</div>
32+
</div>
33+
<div class="card">
34+
<div class="item item-divider">
35+
TEXT TEXT TEXT TEXT TEXT TEXT
36+
</div>
37+
<div class="item item-text-wrap">
38+
TEXT TEXT TEXT TEXT TEXT TEXT
39+
TEXT TEXT TEXT TEXT TEXT TEXT
40+
TEXT TEXT TEXT TEXT TEXT TEXT
41+
TEXT TEXT TEXT TEXT TEXT TEXT
42+
TEXT TEXT TEXT TEXT TEXT TEXT
43+
TEXT TEXT TEXT TEXT TEXT TEXT
44+
TEXT TEXT TEXT TEXT TEXT TEXT
45+
TEXT TEXT TEXT TEXT TEXT TEXT
46+
</div>
47+
</div>
48+
<div class="card">
49+
<div class="item item-divider">
50+
TEXT TEXT TEXT TEXT TEXT TEXT
51+
</div>
52+
<div class="item item-text-wrap">
53+
<div class="list">
54+
<a class="item item-icon-left" href="#" ng-click="share()">
55+
<i class="icon ion-share" id="share"></i> p1
56+
</a>
57+
<a class="item item-icon-left" href="#" ng-click="shareWhatsApp()">
58+
<i class="icon ion-social-whatsapp-outline" id="share-whatsapp"></i> Whatsapp
59+
</a>
60+
<a class="item item-icon-left" href="#" ng-click="shareTwitter()">
61+
<i class="icon ion-social-twitter-outline" id="share-twitter"></i> Twitter
62+
</a>
63+
<a class="item item-icon-left" href="#" ng-click="shareEMail()">
64+
<i class="icon ion-ios-email-outline" id="share-email"></i> email
65+
</a>
66+
</div>
67+
</div>
68+
</div>
69+
<div class="card">
70+
<div class="item item-divider">
71+
Yes
72+
</div>
73+
<div class="item item-text-wrap">
74+
<div class="list">
75+
<div class="item">
76+
77+
</div>
78+
<div class="item">
79+
80+
</div>
81+
<div class="item">
82+
83+
</div>
84+
</div>
85+
</div>
86+
</div>
87+
</ion-content>
88+
</ion-view>

test/html/jan/jan.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html ng-app="sideMenuTest">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Side Menus</title>
6+
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
7+
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
8+
<script src="../../../../dist/js/ionic.bundle.js"></script>
9+
<script src="patch.js"></script>
10+
<script src="app.js"></script>
11+
</head>
12+
<body>
13+
<ion-nav-view></ion-nav-view>
14+
<ion-footer-bar>
15+
</ion-footer-bar>
16+
</body>
17+
</html>

test/html/jan/menu.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<ion-side-menus enable-menu-with-back-views="false">
2+
<ion-side-menu-content>
3+
<ion-nav-bar class="bar-stable">
4+
<ion-nav-back-button>
5+
</ion-nav-back-button>
6+
<ion-nav-buttons side="left">
7+
<button class="button button-icon button-clear ion-navicon" menu-toggle="left" style="color: #fff"></button>
8+
</ion-nav-buttons>
9+
</ion-nav-bar>
10+
<ion-nav-view name="menuContent"></ion-nav-view>
11+
</ion-side-menu-content>
12+
<ion-side-menu side="left">
13+
<ion-header-bar class="bar-stable">
14+
<h1 class="title">Menu</h1>
15+
</ion-header-bar>
16+
<ion-content class="has-footer">
17+
<ion-list>
18+
<ion-item ng-click="refreshAdvertisement()" menu-close href="#/app/contact">
19+
Kontakt
20+
</ion-item>
21+
<ion-item ng-click="refreshAdvertisement()" menu-close href="#/app/info">
22+
Info
23+
</ion-item>
24+
</ion-list>
25+
</ion-content>
26+
</ion-side-menu>
27+
</ion-side-menus>

test/html/jan/patch.js

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/**
2+
* ============================ angular-ios9-uiwebview.patch.js v1.0.3 ============================
3+
*
4+
* This patch works around iOS9 UIWebView regression that causes infinite digest errors in Angular.
5+
*
6+
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular have the workaround baked in.
7+
*
8+
* To apply this patch load/bundle this file with your application and add a dependency on the "ngIOS9Patch" module
9+
* to your main app module.
10+
*
11+
* For example:
12+
*
13+
* ```
14+
* angular.module('myApp', ['ngRoute'])`
15+
* ```
16+
*
17+
* becomes
18+
*
19+
* ```
20+
* angular.module('myApp', ['ngRoute', 'ngIOS9UIWebViewPatch'])
21+
* ```
22+
*
23+
*
24+
* More info:
25+
* - https://openradar.appspot.com/22186109
26+
* - https://github.com/angular/angular.js/issues/12241
27+
* - https://github.com/driftyco/ionic/issues/4082
28+
*
29+
*
30+
* @license AngularJS
31+
* (c) 2010-2015 Google, Inc. http://angularjs.org
32+
* License: MIT
33+
*/
34+
35+
angular.module('ngIOS9UIWebViewPatch', ['ng']).config(function($provide) {
36+
37+
$provide.decorator('$browser', ['$delegate', '$window', function($delegate, $window) {
38+
39+
if (isIOS9UIWebView($window.navigator.userAgent)) {
40+
return applyIOS9Shim($delegate);
41+
}
42+
43+
return $delegate;
44+
45+
function isIOS9UIWebView (userAgent) {
46+
47+
return true;
48+
// return /(iPhone|iPad|iPod).* OS 9_\d/.test(userAgent) && !/Version\/9\./.test(userAgent);
49+
50+
}
51+
52+
function applyIOS9Shim (browser) {
53+
54+
var pendingLocationUrl = null;
55+
var patchedBrowser = Object.create(browser);
56+
57+
patchedBrowser.url = function() {
58+
if (arguments.length) {
59+
pendingLocationUrl = arguments[0];
60+
return browser.url.apply(patchedBrowser, arguments);
61+
}
62+
return pendingLocationUrl || browser.url();
63+
};
64+
65+
window.addEventListener('popstate', clearPendingLocationUrl, false);
66+
window.addEventListener('hashchange', clearPendingLocationUrl, false);
67+
68+
function clearPendingLocationUrl () {
69+
pendingLocationUrl = null;
70+
}
71+
72+
return patchedBrowser;
73+
74+
}
75+
76+
}]);
77+
78+
});

0 commit comments

Comments
 (0)