Renamed more-icons-per-row-5x4-flare576
[webos-internals:adamrmcd-modifications.git] / luna / keytoss-keyword-search.patch
1 diff --git a/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js b/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
2 index 7d94506..1c90d5e 100644
3 --- a/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
4 +++ b/usr/lib/luna/system/luna-applauncher/app/controllers/global-search-assistant.js
5 @@ -48,6 +48,7 @@ GlobalSearchAssistant = Class.create({
6                 this.offset=0;
7                 this.limit=40;
8                 this.URLs = {
9 +                       'keytoss':$L("http://pre.keytoss.com/parse.php5?term="),
10                         'google':$L("www.google.com/m/search?client=ms-palm-webOS&channel=iss&q="),
11                         'wikipedia':$L("http://en.m.wikipedia.org/wiki/Special:Search?search="),
12                         'twitter': $L("http://search.twitter.com/search?q=")
13 @@ -1656,6 +1657,7 @@ GlobalSearchAssistant = Class.create({
14                 this.expandedSearchDrawer.showExpanded = false;
15                 this.controller.modelChanged(this.expandedSearchDrawer);
16                 this.searchApps.clear();
17 +               $('keytoss').removeClassName('selected');
18                 $('google').removeClassName('selected');
19                 $('map').removeClassName('selected');
20                 $('wikipedia').removeClassName('selected');
21 @@ -1761,6 +1763,7 @@ GlobalSearchAssistant = Class.create({
22         }
23         //clear search':
24         $('google').removeClassName('palm-focus');
25 +       $('keytoss').removeClassName('palm-focus');
26         $('web').removeClassName('palm-focus');
27    },
28    highlightSelection: function() {
29 @@ -1819,19 +1822,23 @@ GlobalSearchAssistant = Class.create({
30                         break;
31                 case 'search':
32                         if (this.webDrawer.showWeb == true) {
33 -                               $('google').removeClassName('palm-focus');
34 +                               //$('google').removeClassName('palm-focus');
35 +                               $('keytoss').removeClassName('palm-focus');
36                                 $('web').addClassName('palm-focus');
37                                 this.highlightTarget = $('web');
38                         }
39                         else if(this.expandedSearchDrawer.showExpanded == true){
40 -                               $('google').addClassName('palm-focus');
41 +                               //$('google').addClassName('palm-focus');
42 +                               $('keytoss').addClassName('palm-focus');
43                                 $('web').removeClassName('palm-focus');
44 -                               this.highlightTarget = $('google');
45 +                               //this.highlightTarget = $('google');
46 +                               this.highlightTarget = $('keytoss');
47                         }
48                         break;          
49         }
50         if (this.enterKeyActionItem != "search") {
51                 $('google').removeClassName('palm-focus');
52 +               $('keytoss').removeClassName('palm-focus');
53                 $('web').removeClassName('palm-focus');
54         }
55    },
56 @@ -1923,7 +1930,8 @@ GlobalSearchAssistant = Class.create({
57                         if (this.webDrawer.showWeb == true)
58                                 this.launchBrowser(this.currentFilter);
59                         else {
60 -                               this.launchBrowser(this.URLs['google'] + encodeURIComponent(this.currentFilter));
61 +                               //this.launchBrowser(this.URLs['google'] + encodeURIComponent(this.currentFilter));
62 +                               this.launchBrowser(this.URLs['keytoss'] + encodeURIComponent(this.currentFilter));
63                         }
64                         break;
65         }
66 diff --git a/usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html b/usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html
67 index 7bfc200..00cc1cc 100644
68 --- a/usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html
69 +++ b/usr/lib/luna/system/luna-applauncher/app/views/global-search/expanded-searches-div.html
70 @@ -9,6 +9,11 @@
71  </div>
72  
73  <div id='expanded_searches_drawer' x-mojo-element="Drawer">
74 +       <div class="palm-row" id="keytoss" name="search-identifier" x-mojo-tap-highlight="persistent">
75 +               <div class="palm-row-wrapper">
76 +                       <div class="search-keytoss"></div>
77 +               </div>
78 +       </div>
79         <div class="palm-row" id="google" name="search-identifier" x-mojo-tap-highlight="persistent">
80                 <div class="palm-row-wrapper">
81                         <div class="search-google"></div>
82 diff --git a/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css b/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css
83 index 1f10209..5887f9c 100644
84 --- a/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css
85 +++ b/usr/lib/luna/system/luna-applauncher/stylesheets/global-search.css
86 @@ -119,6 +119,12 @@ Copyright 2009 Palm, Inc.  All rights reserved.
87                 background: url(../images/search-add.png) center center no-repeat;
88  }
89  
90 +.palm-group.search .search-keytoss {   
91 +               width: 100%;
92 +               height: 52px;       
93 +               background: url(../images/search-keytoss.png) center center no-repeat;
94 +}
95 +
96  .palm-group.search .search-google {   
97                 width: 100%;
98                 height: 52px;       
99 diff --git a/usr/palm/applications/com.palm.app.browser/app/controllers/urlsearch-controller.js b/usr/palm/applications/com.palm.app.browser/app/controllers/urlsearch-controller.js
100 index 986f0bb..61d4d0c 100644
101 --- a/usr/palm/applications/com.palm.app.browser/app/controllers/urlsearch-controller.js
102 +++ b/usr/palm/applications/com.palm.app.browser/app/controllers/urlsearch-controller.js
103 @@ -58,6 +58,12 @@ function UrlSearchController(controller){
104  
105  // Our search providers
106  UrlSearchController.SearchProviders = {
107 +       keytoss: {
108 +               searchTitle: $L('Search KeyToss'),
109 +               searchTemplate: $L('KeyToss "#{search}"'),
110 +               urlTemplate: $L('http://pre.keytoss.com/parse.php5?term=#{query}')
111 +       },
112 +                               
113         google: {
114                 searchTitle: $L('Search Google'),
115                 searchTemplate: $L('Google "#{search}"'),
116 @@ -218,14 +224,18 @@ UrlSearchController.prototype._addStockSearchItems = function(searchText, withDi
117         this.urlSearchListModel.unshift(item);
118  
119         // Google block....
120 -       url   = UrlSearchController.SearchProviders.google.urlTemplate.interpolate({query: encodedUriComponent});
121 -       title = UrlSearchController.SearchProviders.google.searchTemplate.interpolate({search: escapedSearchText});
122 +       //url   = UrlSearchController.SearchProviders.google.urlTemplate.interpolate({query: encodedUriComponent});
123 +       //title = UrlSearchController.SearchProviders.google.searchTemplate.interpolate({search: escapedSearchText});
124 +       url   = UrlSearchController.SearchProviders.keytoss.urlTemplate.interpolate({query: encodedUriComponent});
125 +       title = UrlSearchController.SearchProviders.keytoss.searchTemplate.interpolate({search: escapedSearchText});
126  
127         item = new UrlReference(url, title);
128 -       item.subTitle = UrlSearchController.SearchProviders.google.searchTitle;
129 +       //item.subTitle = UrlSearchController.SearchProviders.google.searchTitle;
130 +       item.subTitle = UrlSearchController.SearchProviders.keytoss.searchTitle;
131         item.iconclass = 'search-image';
132         item.rowclass = 'search first';
133 -       item.iconUrl = Mojo.appPath + 'images/list-icon-google.png';
134 +       //item.iconUrl = Mojo.appPath + 'images/list-icon-google.png';
135 +       item.iconUrl = Mojo.appPath + 'images/list-icon-keytoss.png';
136         
137         this.urlSearchListModel.unshift(item);
138  
139 @@ -382,7 +392,8 @@ UrlSearchController.prototype._handleSelection = function(event) {
140  
141  UrlSearchController.formatDefaultSearchUrl = function(query) {
142         
143 -       return UrlSearchController.SearchProviders.google.urlTemplate.interpolate({query: encodeURIComponent(query)});
144 +       //return UrlSearchController.SearchProviders.google.urlTemplate.interpolate({query: encodeURIComponent(query)});
145 +       return UrlSearchController.SearchProviders.keytoss.urlTemplate.interpolate({query: encodeURIComponent(query)});
146  };
147  
148  /**