The more submitted via script.
[webos-internals:adamrmcd-modifications.git] / calculator / calculator-enable-vibration.patch
1 Index: /usr/palm/applications/com.palm.app.calculator/app/controllers/calculator-assistant.js
2 ===================================================================
3 --- /usr/palm/applications/com.palm.app.calculator/app/controllers/~calculator-assistant.orig
4 +++ /usr/palm/applications/com.palm.app.calculator/app/controllers/calculator-assistant.js
5 @@ -160,12 +160,14 @@
6         onNumberPress: function(event, number) {
7                 this.calculator.enterDigit(number);
8                 this.updateResults();
9 +               this.vibrate();
10                 event.stop();
11         },
12         
13         onDecimalPress: function(event) {
14                 this.calculator.enterDecimal();
15                 this.updateResults();
16 +               this.vibrate();
17                 event.stop();
18         },
19         
20 @@ -178,6 +180,7 @@
21                         this.calculator.divide();
22                 }
23                 this.updateResults();
24 +               this.vibrate();
25                 event.stop();
26         },
27         
28 @@ -189,6 +192,7 @@
29                         this.calculator.multiply();
30                 }
31                 this.updateResults();
32 +               this.vibrate();
33                 event.stop();
34         },
35         
36 @@ -200,6 +204,7 @@
37                         this.calculator.subtract();
38                 }
39                 this.updateResults();
40 +               this.vibrate();
41                 event.stop();
42         },
43         
44 @@ -211,6 +216,7 @@
45                         this.calculator.add();
46                 }
47                 this.updateResults();
48 +               this.vibrate();
49                 event.stop();
50         },
51         
52 @@ -218,12 +224,14 @@
53  
54                 this.calculator.equals();
55                 this.updateResults();
56 +               this.vibrate();
57                 event.stop();
58         },
59         
60         onClearPress: function(event) {
61                 this.calculator.clear();
62                 this.updateResults();
63 +               this.vibrate();
64                 event.stop();
65         },
66         
67 @@ -231,18 +239,21 @@
68                 this.calculator.memPlus();
69                 this.showMemoryIndicator();
70                 this.updateResults();
71 +               this.vibrate();
72                 event.stop();
73         },
74         
75         onMemRecallPress: function(event) {
76                 this.calculator.memRecall();
77                 this.updateResults();
78 +               this.vibrate();
79                 event.stop();
80         },
81         
82         onBackspacePress: function(event) {
83                 this.calculator.backspace();
84                 this.updateResults();
85 +               this.vibrate();
86                 event.stop();
87         },
88         
89 @@ -250,6 +261,7 @@
90                 this.calculator.memClear();
91                 this.hideMemoryIndicator();
92                 this.updateResults();
93 +               this.vibrate();
94                 event.stop();
95         },
96         
97 @@ -297,6 +309,16 @@
98                 } else if (event.type == Mojo.Event.commandEnable && event.command == Mojo.Menu.helpCmd) {
99                         event.stopPropagation();
100                 }
101 +       },
102 +       
103 +       vibrate: function() {
104 +               this.controller.serviceRequest(
105 +                       "palm://com.palm.vibrate", {
106 +                               method: 'vibrate', parameters: {
107 +                                        'period': 0,'duration': 50
108 +                               }
109 +                       }
110 +               );
111         },
112  });
113