-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
22 lines (20 loc) · 765 Bytes
/
main.js
File metadata and controls
22 lines (20 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Install the app, on loading the page
var request = navigator.mozApps.install(location.protocol + "//" + location.host + "/manifest.webapp");
request.onsuccess = function() {
console.log('Installed successfully');
};
request.onerror = function() {
console.log('Failed Installing! ' + this.error.name);
};
// Setup angular controller
var app = angular.module('main', []);
app.controller('mainCtrl', function($scope) {
$scope.vibrate = function() {
// Vibrate the morse code for whatever is in the textbox
window.navigator.vibrate(getVibrationPattern($scope.textToEncode));
};
$scope.playSounds = function() {
// Play (as sound) the morse code for whatever is in the textbox
playSounds(getVibrationPattern($scope.textToEncode));
};
});