Skip to content

Commit 45191a8

Browse files
committed
rm www/lib; implement vibrations
1 parent f287cf6 commit 45191a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+76
-129851
lines changed

bower.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "vibrations",
33
"private": "true",
44
"devDependencies": {
5-
"ionic": "driftyco/ionic-bower#1.0.0-rc.2"
5+
"ionic": "driftyco/ionic-bower#1.0.0-rc.2",
6+
"ngCordova": "~0.1.14-alpha"
67
}
7-
}
8+
}

config.xml

+50
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,57 @@
1313
<preference name="UIWebViewBounce" value="false"/>
1414
<preference name="DisallowOverscroll" value="true"/>
1515
<preference name="BackupWebStorage" value="none"/>
16+
<preference name="SplashScreen" value="screen"/>
17+
<preference name="SplashScreenDelay" value="3000"/>
1618
<feature name="StatusBar">
1719
<param name="ios-package" value="CDVStatusBar" onload="true"/>
1820
</feature>
21+
<platform name="ios">
22+
<icon src="resources/ios/icon/icon.png" width="57" height="57"/>
23+
<icon src="resources/ios/icon/[email protected]" width="114" height="114"/>
24+
<icon src="resources/ios/icon/icon-40.png" width="40" height="40"/>
25+
<icon src="resources/ios/icon/[email protected]" width="80" height="80"/>
26+
<icon src="resources/ios/icon/icon-50.png" width="50" height="50"/>
27+
<icon src="resources/ios/icon/[email protected]" width="100" height="100"/>
28+
<icon src="resources/ios/icon/icon-60.png" width="60" height="60"/>
29+
<icon src="resources/ios/icon/[email protected]" width="120" height="120"/>
30+
<icon src="resources/ios/icon/[email protected]" width="180" height="180"/>
31+
<icon src="resources/ios/icon/icon-72.png" width="72" height="72"/>
32+
<icon src="resources/ios/icon/[email protected]" width="144" height="144"/>
33+
<icon src="resources/ios/icon/icon-76.png" width="76" height="76"/>
34+
<icon src="resources/ios/icon/[email protected]" width="152" height="152"/>
35+
<icon src="resources/ios/icon/icon-small.png" width="29" height="29"/>
36+
<icon src="resources/ios/icon/[email protected]" width="58" height="58"/>
37+
<icon src="resources/ios/icon/[email protected]" width="87" height="87"/>
38+
<splash src="resources/ios/splash/Default-568h@2x~iphone.png" height="1136" width="640"/>
39+
<splash src="resources/ios/splash/Default-667h.png" height="1334" width="750"/>
40+
<splash src="resources/ios/splash/Default-736h.png" height="2208" width="1242"/>
41+
<splash src="resources/ios/splash/Default-Landscape-736h.png" height="1242" width="2208"/>
42+
<splash src="resources/ios/splash/Default-Landscape@2x~ipad.png" height="1536" width="2048"/>
43+
<splash src="resources/ios/splash/Default-Landscape~ipad.png" height="768" width="1024"/>
44+
<splash src="resources/ios/splash/Default-Portrait@2x~ipad.png" height="2048" width="1536"/>
45+
<splash src="resources/ios/splash/Default-Portrait~ipad.png" height="1024" width="768"/>
46+
<splash src="resources/ios/splash/Default@2x~iphone.png" height="960" width="640"/>
47+
<splash src="resources/ios/splash/Default~iphone.png" height="480" width="320"/>
48+
</platform>
49+
<platform name="android">
50+
<icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi"/>
51+
<icon src="resources/android/icon/drawable-mdpi-icon.png" density="mdpi"/>
52+
<icon src="resources/android/icon/drawable-hdpi-icon.png" density="hdpi"/>
53+
<icon src="resources/android/icon/drawable-xhdpi-icon.png" density="xhdpi"/>
54+
<icon src="resources/android/icon/drawable-xxhdpi-icon.png" density="xxhdpi"/>
55+
<icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
56+
<splash src="resources/android/splash/drawable-land-ldpi-screen.png" density="land-ldpi"/>
57+
<splash src="resources/android/splash/drawable-land-mdpi-screen.png" density="land-mdpi"/>
58+
<splash src="resources/android/splash/drawable-land-hdpi-screen.png" density="land-hdpi"/>
59+
<splash src="resources/android/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi"/>
60+
<splash src="resources/android/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>
61+
<splash src="resources/android/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>
62+
<splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi"/>
63+
<splash src="resources/android/splash/drawable-port-mdpi-screen.png" density="port-mdpi"/>
64+
<splash src="resources/android/splash/drawable-port-hdpi-screen.png" density="port-hdpi"/>
65+
<splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
66+
<splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
67+
<splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
68+
</platform>
1969
</widget>

package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
"cordovaPlugins": [
1818
"org.apache.cordova.device",
1919
"org.apache.cordova.console",
20-
"com.ionic.keyboard"
20+
"com.ionic.keyboard",
21+
"org.apache.cordova.vibration"
2122
],
22-
"cordovaPlatforms": []
23+
"cordovaPlatforms": [
24+
"ios",
25+
"android"
26+
]
2327
}

www/index.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<!-- ionic/angularjs js -->
1313
<script src="lib/ionic/js/ionic.bundle.js"></script>
1414

15+
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
1516
<!-- cordova script (this will be a 404 during development) -->
1617
<script src="cordova.js"></script>
1718

@@ -23,7 +24,7 @@
2324
<ion-header-bar class="bar-stable">
2425
<div class="buttons">
2526
<button class="button button-icon ion-ios-minus-outline"
26-
ng-click="list.showDelete=!list.showDelete"></button>
27+
ng-click="listConfig.showDelete=!listConfig.showDelete"></button>
2728
</div>
2829
<h1 class="title">PHPmagazin: Vibrations</h1>
2930
<div class="buttons">
@@ -33,7 +34,7 @@ <h1 class="title">PHPmagazin: Vibrations</h1>
3334
</ion-header-bar>
3435
<ion-content>
3536
<ion-list show-delete="list.showDelete">
36-
<ion-item ng-repeat="vibration in vibrations">
37+
<ion-item ng-repeat="vibration in vibrations" ng-click="vibrate(vibration)">
3738
<ion-delete-button class="ion-minus-circled"
3839
ng-click="delete(vibration)">
3940
</ion-delete-button>

www/js/app.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// angular.module is a global place for creating, registering and retrieving Angular modules
44
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
55
// the 2nd parameter is an array of 'requires'
6-
angular.module('starter', ['ionic'])
6+
angular.module('starter', ['ionic', 'ngCordova'])
77

88
.run(function($ionicPlatform) {
99
$ionicPlatform.ready(function() {
@@ -18,7 +18,7 @@ angular.module('starter', ['ionic'])
1818
});
1919
})
2020

21-
.controller('VibrationsCtrl', function($scope, $ionicPopup, $ionicModal){
21+
.controller('VibrationsCtrl', function($scope, $ionicPopup, $ionicModal, $cordovaVibration, $timeout){
2222
$scope.vibrations = [
2323
{
2424
name: 'Foo',
@@ -34,7 +34,7 @@ angular.module('starter', ['ionic'])
3434
}
3535
];
3636

37-
$scope.list = {
37+
$scope.listConfig = {
3838
showDelete: false
3939
};
4040

@@ -75,4 +75,15 @@ angular.module('starter', ['ionic'])
7575
$scope.createModal.hide();
7676
vibration.name = vibration.duration = '';
7777
};
78+
79+
$scope.vibrate = function(vibration) {
80+
var alert = $ionicPopup.alert({
81+
title: 'Vibrations',
82+
template: vibration.name
83+
});
84+
$timeout(function(){
85+
alert.close();
86+
}, vibration.duration);
87+
$cordovaVibration.vibrate(parseInt(vibration.duration));
88+
};
7889
});

www/lib/ionic/css/ionic.css

-7,600
This file was deleted.

www/lib/ionic/css/ionic.min.css

-23
This file was deleted.

www/lib/ionic/fonts/ionicons.eot

-118 KB
Binary file not shown.

0 commit comments

Comments
 (0)