Outstanding patches from Jason
[webos-internals:justyns-modifications.git] / top-bar / top-bar-date-as-carrier-string.patch
1 Name: Date As Carrier String
2 Version: 1.3.1-2
3 Author: Jason Robitaille
4 Description: Replace the carrier string with the date.
5
6 --- .orig/usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
7 +++ /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
8 @@ -227,7 +227,7 @@
9         if (payload.title) {
10                 $('carrier').hide();
11                 if (payload.id == "com.palm.app.phone" || payload.id == "com.palm.app.firstuse"){ 
12 -                       $('appname').innerHTML = this.carrierText;
13 +                       $('appname').innerHTML = payload.appmenu || payload.title;
14                         this.phoneIsForeground = true;
15                 }
16                 else if (this.isPreferences(payload))  {
17 @@ -272,6 +272,6 @@
18                 
19         if (payload.locked != null) {
20                 if (payload.locked) {
21 +                       $('date').hide();
22                         $('clock').hide();
23 -                       $('date').show();
24                         this.deviceLocked = true;
25 @@ -457,7 +457,7 @@
26                                 $('rssi').className = "flight-mode";
27                         }
28                         else {
29 -                               this.carrierText = $L("Phone offline");
30 +                               this.carrierText = new Date().toDateString();
31                                 $('carrier').innerHTML = this.carrierText;
32                         }                                                       
33                         $('roaming').hide();
34 @@ -480,7 +480,7 @@
35         this.phoneInLimitedService = false;     
36         switch (payload.extended.state) {
37                 case 'service': 
38 -                       this.carrierText = $L(payload.extended.networkName.escapeHTML());
39 +                       this.carrierText = new Date().toDateString();
40                         $('carrier').innerHTML = this.carrierText;              
41                         if(payload.extended.registration == 'home') {                   
42                                 $('roaming').hide();
43 @@ -808,7 +808,7 @@
44                                 this.updateAirplaneModeProgress('phone');
45                         }
46                         else {
47 -                               this.carrierText = $L("Phone offline");
48 +                               this.carrierText = new Date().toDateString();
49                                 $('carrier').innerHTML = this.carrierText;
50                         }
51                         $('datanet').className = 'off';
52 @@ -829,7 +829,7 @@
53                 switch(networkMsg.state) {
54                         case 'service':
55                                 this.phoneService = "service";
56 -                               this.carrierText = $L(networkMsg.networkName.escapeHTML());
57 +                               this.carrierText = new Date().toDateString();
58                                 $('carrier').innerHTML = this.carrierText;
59                                 this.simlocked = false;
60                                 
61 @@ -2364,6 +2364,9 @@
62         var date = new Date();
63         var format = Mojo.Format.getFormatHash()['shortTime24'];
64         
65 +       this.carrierText = new Date().toDateString();
66 +       $('carrier').innerHTML = this.carrierText;
67 +       
68         if (Mojo.Format.using12HrTime()) {
69                 if (date.getHours() > 12) {
70                         date.setHours(date.getHours() % 12);