├── .gitignore ├── README.md ├── appinfo.json ├── css └── browser.css ├── db ├── kinds │ ├── com.palm.browserbookmarks │ ├── com.palm.browserhistory │ └── com.palm.browserpreferences └── permissions │ ├── com.palm.browserbookmarks │ ├── com.palm.browserhistory │ └── com.palm.browserpreferences ├── debian ├── README.Debian ├── README.source ├── changelog ├── compat ├── control ├── copyright ├── docs ├── emacsen-install.ex ├── emacsen-remove.ex ├── emacsen-startup.ex ├── files ├── init.d.ex ├── isisbrowser.cron.d.ex ├── isisbrowser.debhelper.log ├── isisbrowser.default.ex ├── isisbrowser.doc-base.EX ├── isisbrowser.install ├── isisbrowser.substvars ├── manpage.1.ex ├── manpage.sgml.ex ├── manpage.xml.ex ├── menu.ex ├── postinst.ex ├── postrm.ex ├── preinst.ex ├── prerm.ex ├── rules ├── source │ └── format └── watch.ex ├── depends.js ├── icon-256x256.png ├── icon.png ├── images ├── background-bookmarks-grid.png ├── background-startpage.png ├── bookmark-icon-default.png ├── bookmark-icon-frame.png ├── bookmark-info-icon.png ├── bookmark-overlay.png ├── chrome │ ├── button-menu.png │ ├── drag-handle.png │ ├── filter-search-highlight.png │ ├── list-divider.png │ ├── menu-icon-add.png │ ├── menu-icon-back.png │ ├── menu-icon-bookmark.png │ ├── menu-icon-forward.png │ ├── menu-icon-newcard.png │ ├── menu-icon-refresh.png │ ├── menu-icon-share.png │ ├── menu-icon-stop.png │ ├── palm-popup-background.png │ ├── progress-bar-inner.png │ ├── progress-bar.png │ ├── radiobutton.png │ ├── search-results-background.png │ ├── secure-lock.png │ ├── toaster-icon-bookmarks.png │ ├── toaster-icon-downloads.png │ ├── toaster-icon-history.png │ └── url-pill.png ├── header-icon-bookmarks.png ├── header-icon-history.png ├── header-icon-prefs.png ├── icons │ ├── download-icon.png │ ├── email-32x32.png │ ├── facebook-32x32.png │ └── messaging-32x32.png ├── list-icon-bing.png ├── list-icon-google.png ├── list-icon-wikipedia.png ├── mime-icon-audio.png ├── mime-icon-download.png ├── mime-icon-image.png ├── mime-icon-pdf.png ├── mime-icon-ppt.png ├── mime-icon-txt.png ├── mime-icon-vcard.png ├── mime-icon-video.png ├── mime-icon-word.png ├── mime-icon-xls.png ├── palm-popup-background.png └── startpage-placeholder.png ├── index.html ├── mock ├── browserApp_bookmarksService.json ├── browserApp_bookmarks_bookmarksService.json ├── browserApp_browserPrefsService.json ├── browserApp_findBookmarks.json ├── browserApp_findHistory.json ├── browserApp_historyService.json ├── browserApp_history_historyService.json ├── browserApp_startPage_actionbar_search_bookmarksService.json ├── browserApp_startPage_actionbar_search_historyService.json ├── browserApp_startPage_addressbar_bookmarksService.json └── browserApp_startPage_addressbar_historyService.json └── source ├── AcceptCancelPopup.js ├── ActionBar.js ├── AddressInput.js ├── BookmarkDialog.js ├── BookmarkList.js ├── Browser.js ├── BrowserApp.js ├── BrowserContextMenu.js ├── BrowserPrompt.js ├── CertificateDetail.js ├── DownloadList.js ├── FindBar.js ├── HistoryList.js ├── MimeIcon.js ├── NoFocusButton.js ├── Preferences.js ├── ProgressItem.js ├── ShareLinkDialog.js ├── StartPage.js ├── URLSearch.js ├── VerticalAcceptCancelPopup.js ├── clipboard.js ├── tld.js └── util.js /.gitignore: -------------------------------------------------------------------------------- 1 | resources/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | isis-browser 2 | ============ 3 | 4 | isis-browser is the enyo browser app for webOS. 5 | 6 | It uses the enyo WebView control to display web content which in turn 7 | uses BrowserAdapter and BrowserServer to talk to webOS webkit. 8 | 9 | # Copyright and License Information 10 | 11 | All content, including all source code files and documentation files in this repository are: 12 | Copyright (c) 2012 Hewlett-Packard Development Company, L.P. 13 | 14 | All content, including all source code files and documentation files in this repository are: 15 | Licensed under the Apache License, Version 2.0 (the "License"); 16 | you may not use this content except in compliance with the License. 17 | You may obtain a copy of the License at 18 | 19 | http://www.apache.org/licenses/LICENSE-2.0 20 | 21 | Unless required by applicable law or agreed to in writing, software 22 | distributed under the License is distributed on an "AS IS" BASIS, 23 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | See the License for the specific language governing permissions and 25 | limitations under the License. 26 | 27 | # end Copyright and License Information 28 | -------------------------------------------------------------------------------- /appinfo.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "com.palm.app.browser", 3 | "version": "1.0.0", 4 | "vendor": "HP", 5 | "type": "web", 6 | "main": "index.html", 7 | "title": "Web", 8 | "keywords" : [ "web", "Browser", "Blazer", "Internet" ], 9 | "icon": "icon.png", 10 | "splashicon": "icon-256x256.png", 11 | "uiRevision": 2, 12 | "tapToShareSupported":true, 13 | "universalSearch": { 14 | "dbsearch": { 15 | "displayName":"Bookmarks & History", 16 | "url":"com.palm.app.browser", 17 | "launchParam":"url", 18 | "launchParamDbField":"url", 19 | "displayFields": ["title", "url"], 20 | "dbQuery": [{"method":"search","params":{"query":{"from":"com.palm.browserbookmarks:1","where":[{"prop":"searchText","op":"?","val":"","collate":"primary"}],"limit":20}}},{"method":"search","params":{"query":{"from":"com.palm.browserhistory:1","where":[{"prop":"searchText","op":"?","val":"","collate":"primary"}],"limit":50}}}], 21 | "batchQuery":true 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /css/browser.css: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /* Start Page */ 16 | 17 | .startpage-list .enyo-datalist-client { 18 | display: inline-block; 19 | vertical-align: middle; 20 | } 21 | 22 | .startpage-list-item: { 23 | display: inline-block; 24 | } 25 | 26 | .startpage { 27 | background: #313131 url(../images/background-startpage.png) center center no-repeat ; 28 | -webkit-background-size: 100% 100%; 29 | height: 1024px; 30 | /* 31 | background-color: #323232; 32 | background: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 250, from(#5c5d5f), color-stop(0.1, #3c3c3c), to(#101010)); 33 | */ 34 | } 35 | 36 | .startpage .startpage-placeholder { 37 | background: url(../images/startpage-placeholder.png) 50% 50% no-repeat; 38 | } 39 | 40 | .startpage .startpage-placeholder-tall { 41 | height: 1024px; 42 | } 43 | 44 | /* AddressBar */ 45 | 46 | .actionbar.enyo-toolbar { 47 | height: 54px; 48 | border-width: 2px 0; 49 | } 50 | 51 | .actionbar .enyo-tool-button .enyo-button-icon { 52 | margin: 2px; 53 | } 54 | 55 | .actionbar .menu-container { 56 | padding: 1px 4px 0; 57 | } 58 | 59 | .actionbar-tool-button { 60 | padding: 0; 61 | } 62 | 63 | .page-title { 64 | width: 620px; 65 | margin: 0 auto; 66 | padding-right: 10px; 67 | text-align: center; 68 | color: white; 69 | font-size: .65em; 70 | font-weight: bold; 71 | } 72 | 73 | .addressbar { 74 | margin: 0 10px; 75 | } 76 | 77 | .addressbar input { 78 | font-size: 15px; 79 | color: #ccc; 80 | } 81 | 82 | .addressbar .enyo-tool-input-focus input { 83 | color: #333; 84 | } 85 | 86 | .addressbar .enyo-input.enyo-tool-input .enyo-input-input:focus { 87 | color: #e5e5e5; 88 | } 89 | 90 | .addressbar .enyo-tool-input-spacing { 91 | margin: -7px 0; 92 | } 93 | 94 | .search-button.enyo-button-down { 95 | background-position: 0 -34px; 96 | } 97 | 98 | .addressbar-button { 99 | width: 32px; 100 | height: 32px; 101 | position: relative; 102 | right: -6px; 103 | } 104 | 105 | .go-button { 106 | background: url(../images/chrome/menu-icon-go.png) 0 0 no-repeat; 107 | } 108 | 109 | .go-button.enyo-button-down { 110 | background-position: 0 32px; 111 | } 112 | 113 | .refresh-button { 114 | background: url(../images/chrome/menu-icon-refresh.png) 0 1px no-repeat; 115 | } 116 | 117 | .refresh-button.enyo-button-down { 118 | background-position: 0 -31px; 119 | } 120 | 121 | .stop-button { 122 | background: url(../images/chrome/menu-icon-stop.png) 0 1px no-repeat; 123 | } 124 | 125 | .stop-button.enyo-button-down { 126 | background-position: 0 -31px; 127 | } 128 | 129 | .secure-lock { 130 | background: url(../images/chrome/secure-lock.png) center center no-repeat; 131 | width: 32px; 132 | height: 32px; 133 | position: relative; 134 | left: -3px; 135 | } 136 | 137 | .enyo-button-disabled .enyo-button-icon { 138 | opacity: .5; 139 | } 140 | 141 | .addressbar-popup { 142 | position: absolute; 143 | width: 100%; 144 | margin: -36px 0; 145 | border-width: 24px; 146 | -webkit-border-image: url(../images/chrome/search-results-background.png) 24 24 24 24 repeat; 147 | -webkit-box-sizing: border-box; 148 | } 149 | 150 | .addressbar-popup-inner { 151 | margin: 0 -16px -15px -16px; 152 | padding-bottom: 12px; 153 | } 154 | 155 | .transparent-scrim { 156 | opacity: 0; 157 | } 158 | 159 | .addressbar-providerslist { 160 | min-height: 10px; 161 | } 162 | 163 | .addressbar-provider-title, 164 | .addressbar-search-title { 165 | text-overflow: ellipsis; 166 | overflow: hidden; 167 | white-space: nowrap; 168 | line-height: 32px; 169 | padding: 0 12px; 170 | } 171 | 172 | .addressbar-providerslist .enyo-item { 173 | border: 0; 174 | } 175 | 176 | .addressbar-popup-divider { 177 | background: silver; 178 | height: 2px; 179 | border-bottom: 1px solid #fff; 180 | } 181 | 182 | .addressbar-highlight { 183 | background: url(../images/chrome/filter-search-highlight.png) bottom left repeat-x; 184 | } 185 | 186 | /* Progress bar */ 187 | 188 | .url-progress.enyo-progress-bar { 189 | -webkit-border-image: none; 190 | border-width: 0; 191 | height: 4px; 192 | background: url(../images/chrome/progress-bar.png) 0 0 repeat-x; 193 | width: 100%; 194 | z-index: 10; 195 | top: 2px; 196 | 197 | -webkit-transition: opacity 1s; 198 | opacity: 1; 199 | } 200 | .progress-bar.completed { 201 | opacity: 0; 202 | display: none; 203 | } 204 | .url-progress .enyo-progress-bar-inner { 205 | -webkit-border-image: none; 206 | margin: 0; 207 | height: 4px; 208 | background: url(../images/chrome/progress-bar-inner.png) 0 0 repeat-x; 209 | } 210 | .url-progress.invisible { 211 | opacity: 0; 212 | } 213 | 214 | /* Browser */ 215 | 216 | .browser-dialog-body enyo-text-body { 217 | word-wrap: break-word; 218 | } 219 | 220 | /* Toaster */ 221 | 222 | .enyo-toaster .enyo-header { 223 | height: 54px; 224 | } 225 | 226 | .enyo-toaster .enyo-header-inner { 227 | padding: 5px 13px; 228 | } 229 | 230 | .enyo-toaster .basic-back { 231 | background-color: #e5e5e5; 232 | } 233 | 234 | .enyo-toaster .enyo-toolbar { 235 | height: 56px; /* avoid the toolbar w/ no buttons gets a few px shorter */ 236 | } 237 | 238 | .enyo-toaster .enyo-radiobutton.enyo-button-depressed .enyo-button-icon, 239 | .enyo-toaster .enyo-radiobutton.enyo-button-down .enyo-button-icon, 240 | .enyo-toaster .enyo-tabbutton.enyo-button-depressed .enyo-button-icon, 241 | .enyo-toaster .enyo-tabbutton.enyo-button-down .enyo-button-icon { 242 | background-position: 0 -32px; 243 | } 244 | 245 | .toaster-item { 246 | padding: 8px 3px 8px 11px; 247 | } 248 | 249 | .toaster-item .enyo-confirmprompt .enyo-button { 250 | min-width:100px; 251 | } 252 | 253 | .item-image { 254 | width: 46px; 255 | height: 46px; 256 | margin: 4px; 257 | } 258 | 259 | .item-thumb-container { 260 | position: relative; 261 | width: 52px; 262 | height: 52px; 263 | } 264 | 265 | .item-image-frame { 266 | position: absolute; 267 | top: 0; 268 | left: 0; 269 | width: 52px; 270 | height: 52px; 271 | background: url(../images/bookmark-icon-frame.png) 1px 2px no-repeat; 272 | } 273 | 274 | .bookmark-edit { 275 | padding: 11px; /* make the tappable area to 48x48 */ 276 | } 277 | 278 | /* Share Link */ 279 | .box-center { 280 | width:180px; 281 | margin:30px auto 0; 282 | margin-bottom: 30px; 283 | } 284 | .icon-image { 285 | display:block; 286 | margin-right:10px; 287 | } 288 | .app-exists-spinner { 289 | margin-left: 5px; 290 | } 291 | .download-button { 292 | background: url("../images/icons/download-icon.png") 0px 0px no-repeat; 293 | width: 32px; 294 | height: 32px; 295 | } 296 | /* History */ 297 | 298 | /* Downloads */ 299 | 300 | .dl-toaster-item { 301 | padding: 8px 11px; 302 | min-height: 60px; 303 | } 304 | 305 | .dl-item-image { 306 | width: 36px; 307 | height: 36px; 308 | margin-top: 4px; 309 | } 310 | .dl-item-title { 311 | padding: 0 8px 0 6px; 312 | } 313 | .dl-toaster-item .enyo-progress-button { 314 | font-size: .8em; 315 | min-height: 30px; 316 | } 317 | 318 | .dl-toaster-item .enyo-progress-button-cancel { 319 | margin-top: 0; 320 | } 321 | 322 | .item-progress { 323 | margin-right: 2px; 324 | } 325 | 326 | /* List Items for Site Titles and URLs (search pop and bookmarks) */ 327 | 328 | .url-item-title { 329 | padding: 0 0 0 12px; 330 | } 331 | 332 | .url-item-url { 333 | padding: 0 0 0 12px; 334 | line-height: 18px; 335 | } 336 | 337 | .url-item-image { 338 | vertical-align: middle; 339 | margin-top: 6px; 340 | } 341 | 342 | /* Progress Menu Button */ 343 | 344 | .progress-menu-button-icon { 345 | display: inline-block; 346 | margin: -5px -24px 0px -24px; 347 | width: 48px; 348 | height: 48px; 349 | vertical-align: middle; 350 | } 351 | 352 | /* Preferences */ 353 | 354 | .preferences-header { 355 | height: 58px; 356 | max-height: 58px; 357 | } 358 | 359 | .preferences-header .enyo-header-inner { 360 | padding: 3px 12px; 361 | } 362 | 363 | .preferences-header-image { 364 | padding-right: 10px; 365 | } 366 | 367 | .enyo-preferences-box .enyo-button, 368 | .preference-prompt .enyo-button { 369 | margin: 6px 3px; 370 | } 371 | 372 | /* Misc */ 373 | 374 | .launch-popup { 375 | margin-top: 5px; 376 | } 377 | 378 | .enyo-gemstone.enyo-item.enyo-held { 379 | background-repeat: repeat-x; 380 | } 381 | -------------------------------------------------------------------------------- /db/kinds/com.palm.browserbookmarks: -------------------------------------------------------------------------------- 1 | { 2 | "id":"com.palm.browserbookmarks:1", 3 | "owner":"com.palm.app.browser", 4 | "indexes":[ {"name":"rev","props":[{"name":"_rev"}]}, 5 | {"name": "url", "props": [{"name": "url"}] }, 6 | {"name": "title", "props": [{"name": "title"}] }, 7 | {"name": "search", "props": [{"name":"searchText", "type":"multi","collate":"primary","include":[{"name":"title","tokenize":"all"},{"name":"url","tokenize":"all"}]}]}, 8 | {"name": "defaultEntry", "props": [{"name": "defaultEntry"}] }, 9 | {"name": "idx", "props": [{"name": "idx"}] }], 10 | "sync": true 11 | } -------------------------------------------------------------------------------- /db/kinds/com.palm.browserhistory: -------------------------------------------------------------------------------- 1 | { 2 | "id":"com.palm.browserhistory:1", 3 | "owner":"com.palm.app.browser", 4 | "indexes":[ {"name": "url", "props": [{"name": "url"}] }, 5 | {"name": "title", "props": [{"name": "title"}] }, 6 | {"name": "search", "props": [{"name":"searchText", "type":"multi", "collate":"primary","include":[{"name":"title","tokenize":"all"}, 7 | {"name":"url","tokenize":"all"}]}]}, 8 | {"name": "date", "props": [{"name": "date"}] }, 9 | {"name": "revision", "props": [{"name": "_rev"}] }], 10 | "sync": true 11 | } -------------------------------------------------------------------------------- /db/kinds/com.palm.browserpreferences: -------------------------------------------------------------------------------- 1 | { 2 | "id":"com.palm.browserpreferences:1", 3 | "owner":"com.palm.app.browser", 4 | "indexes": [ 5 | {"name":"key", "props":[{"name":"key"}]} 6 | ], 7 | "sync": true 8 | } 9 | -------------------------------------------------------------------------------- /db/permissions/com.palm.browserbookmarks: -------------------------------------------------------------------------------- 1 | [ 2 | { "type" : "db.kind" 3 | , "object" : "com.palm.browserbookmarks:1" 4 | , "caller" : "com.palm.app.enyo-browser" 5 | , "operations": 6 | { "create": "allow" 7 | , "read" : "allow" 8 | , "update": "allow" 9 | , "delete": "allow" 10 | } 11 | }, 12 | { "type" : "db.kind" 13 | , "object" : "com.palm.browserbookmarks:1" 14 | , "caller" : "com.palm.launcher" 15 | , "operations": 16 | { "read" : "allow" 17 | } 18 | }, 19 | { "type" : "db.kind" 20 | , "object" : "com.palm.browserbookmarks:1" 21 | , "caller" : "com.palm.service.customization" 22 | , "operations": 23 | { "create": "allow" 24 | , "read" : "allow" 25 | , "update": "allow" 26 | , "delete": "allow" 27 | } 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /db/permissions/com.palm.browserhistory: -------------------------------------------------------------------------------- 1 | [ { "type" : "db.kind" 2 | , "object" : "com.palm.browserhistory:1" 3 | , "caller" : "com.palm.app.enyo-browser" 4 | , "operations": 5 | { "create": "allow" 6 | , "read" : "allow" 7 | , "update": "allow" 8 | , "delete": "allow" 9 | } 10 | }, 11 | { "type" : "db.kind" 12 | , "object" : "com.palm.browserhistory:1" 13 | , "caller" : "com.palm.launcher" 14 | , "operations": 15 | { "read" : "allow" 16 | } 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /db/permissions/com.palm.browserpreferences: -------------------------------------------------------------------------------- 1 | [ 2 | { "type" : "db.kind" 3 | , "object" : "com.palm.browserpreferences:1" 4 | , "caller" : "com.palm.app.enyo-browser" 5 | , "operations": 6 | { "create": "allow" 7 | , "read" : "allow" 8 | , "update": "allow" 9 | , "delete": "allow" 10 | } 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /debian/README.Debian: -------------------------------------------------------------------------------- 1 | isisbrowser for Debian 2 | ---------------------- 3 | 4 | 5 | 6 | -- Anupam Wed, 18 Apr 2012 17:51:50 -0700 7 | -------------------------------------------------------------------------------- /debian/README.source: -------------------------------------------------------------------------------- 1 | isisbrowser for Debian 2 | ---------------------- 3 | 4 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | isisbrowser (1.0.0-1) unstable; urgency=low 2 | 3 | * Initial release (Closes: #nnnn) 4 | 5 | -- Anupam Wed, 18 Apr 2012 17:51:50 -0700 6 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: isisbrowser 2 | Section: webOS 3 | Priority: extra 4 | Maintainer: Anupam 5 | Build-Depends: debhelper (>= 8.0.0) 6 | Standards-Version: 3.9.2 7 | Homepage: https://github.com/isis-project/isis-browser 8 | #Vcs-Git: git://git.debian.org/collab-maint/isisbrowser.git 9 | #Vcs-Browser: http://git.debian.org/?p=collab-maint/isisbrowser.git;a=summary 10 | 11 | Package: isisbrowser 12 | Architecture: any 13 | Depends: ${shlibs:Depends}, ${misc:Depends} 14 | Description: isis-browser is the enyo browser app for webOS 15 | 16 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | License 2 | ------- 3 | This code is released under the Apache 2.0 license. 4 | 5 | #### Copyright and License Information 6 | 7 | All content, including all source code files and documentation files in this repository are: 8 | Copyright (c) 2012 Hewlett-Packard Development Company, L.P. 9 | 10 | All content, including all source code files and documentation files in this repository are: 11 | Licensed under the Apache License, Version 2.0 (the "License"); 12 | you may not use this content except in compliance with the License. 13 | You may obtain a copy of the License at 14 | 15 | http://www.apache.org/licenses/LICENSE-2.0 16 | 17 | Unless required by applicable law or agreed to in writing, software 18 | distributed under the License is distributed on an "AS IS" BASIS, 19 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | See the License for the specific language governing permissions and 21 | limitations under the License. 22 | 23 | #### end Copyright and License Information 24 | 25 | -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- 1 | README.md 2 | -------------------------------------------------------------------------------- /debian/emacsen-install.ex: -------------------------------------------------------------------------------- 1 | #! /bin/sh -e 2 | # /usr/lib/emacsen-common/packages/install/isisbrowser 3 | 4 | # Written by Jim Van Zandt , borrowing heavily 5 | # from the install scripts for gettext by Santiago Vila 6 | # and octave by Dirk Eddelbuettel . 7 | 8 | FLAVOR=$1 9 | PACKAGE=isisbrowser 10 | 11 | if [ ${FLAVOR} = emacs ]; then exit 0; fi 12 | 13 | echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} 14 | 15 | #FLAVORTEST=`echo $FLAVOR | cut -c-6` 16 | #if [ ${FLAVORTEST} = xemacs ] ; then 17 | # SITEFLAG="-no-site-file" 18 | #else 19 | # SITEFLAG="--no-site-file" 20 | #fi 21 | FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" 22 | 23 | ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} 24 | ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} 25 | 26 | # Install-info-altdir does not actually exist. 27 | # Maybe somebody will write it. 28 | if test -x /usr/sbin/install-info-altdir; then 29 | echo install/${PACKAGE}: install Info links for ${FLAVOR} 30 | install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/share/info/${PACKAGE}.info.gz 31 | fi 32 | 33 | install -m 755 -d ${ELCDIR} 34 | cd ${ELDIR} 35 | FILES=`echo *.el` 36 | cp ${FILES} ${ELCDIR} 37 | cd ${ELCDIR} 38 | 39 | cat << EOF > path.el 40 | (setq load-path (cons "." load-path) byte-compile-warnings nil) 41 | EOF 42 | ${FLAVOR} ${FLAGS} ${FILES} 43 | rm -f *.el path.el 44 | 45 | exit 0 46 | -------------------------------------------------------------------------------- /debian/emacsen-remove.ex: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # /usr/lib/emacsen-common/packages/remove/isisbrowser 3 | 4 | FLAVOR=$1 5 | PACKAGE=isisbrowser 6 | 7 | if [ ${FLAVOR} != emacs ]; then 8 | if test -x /usr/sbin/install-info-altdir; then 9 | echo remove/${PACKAGE}: removing Info links for ${FLAVOR} 10 | install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/share/info/isisbrowser.info.gz 11 | fi 12 | 13 | echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} 14 | rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} 15 | fi 16 | -------------------------------------------------------------------------------- /debian/emacsen-startup.ex: -------------------------------------------------------------------------------- 1 | ;; -*-emacs-lisp-*- 2 | ;; 3 | ;; Emacs startup file, e.g. /etc/emacs/site-start.d/50isisbrowser.el 4 | ;; for the Debian isisbrowser package 5 | ;; 6 | ;; Originally contributed by Nils Naumann 7 | ;; Modified by Dirk Eddelbuettel 8 | ;; Adapted for dh-make by Jim Van Zandt 9 | 10 | ;; The isisbrowser package follows the Debian/GNU Linux 'emacsen' policy and 11 | ;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, 12 | ;; xemacs19, emacs20, xemacs20...). The compiled code is then 13 | ;; installed in a subdirectory of the respective site-lisp directory. 14 | ;; We have to add this to the load-path: 15 | (let ((package-dir (concat "/usr/share/" 16 | (symbol-name flavor) 17 | "/site-lisp/isisbrowser"))) 18 | ;; If package-dir does not exist, the isisbrowser package must have 19 | ;; removed but not purged, and we should skip the setup. 20 | (when (file-directory-p package-dir) 21 | (setq load-path (cons package-dir load-path)) 22 | (autoload 'isisbrowser-mode "isisbrowser-mode" 23 | "Major mode for editing isisbrowser files." t) 24 | (add-to-list 'auto-mode-alist '("\\.isisbrowser$" . isisbrowser-mode)))) 25 | 26 | -------------------------------------------------------------------------------- /debian/files: -------------------------------------------------------------------------------- 1 | isisbrowser_1.0.0-1_amd64.deb webOS extra 2 | -------------------------------------------------------------------------------- /debian/init.d.ex: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ### BEGIN INIT INFO 3 | # Provides: isisbrowser 4 | # Required-Start: $network $local_fs 5 | # Required-Stop: 6 | # Default-Start: 2 3 4 5 7 | # Default-Stop: 0 1 6 8 | # Short-Description: 9 | # Description: 10 | # <...> 11 | # <...> 12 | ### END INIT INFO 13 | 14 | # Author: Anupam 15 | 16 | # PATH should only include /usr/* if it runs after the mountnfs.sh script 17 | PATH=/sbin:/usr/sbin:/bin:/usr/bin 18 | DESC=isisbrowser # Introduce a short description here 19 | NAME=isisbrowser # Introduce the short server's name here 20 | DAEMON=/usr/sbin/isisbrowser # Introduce the server's location here 21 | DAEMON_ARGS="" # Arguments to run the daemon with 22 | PIDFILE=/var/run/$NAME.pid 23 | SCRIPTNAME=/etc/init.d/$NAME 24 | 25 | # Exit if the package is not installed 26 | [ -x $DAEMON ] || exit 0 27 | 28 | # Read configuration variable file if it is present 29 | [ -r /etc/default/$NAME ] && . /etc/default/$NAME 30 | 31 | # Load the VERBOSE setting and other rcS variables 32 | . /lib/init/vars.sh 33 | 34 | # Define LSB log_* functions. 35 | # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. 36 | . /lib/lsb/init-functions 37 | 38 | # 39 | # Function that starts the daemon/service 40 | # 41 | do_start() 42 | { 43 | # Return 44 | # 0 if daemon has been started 45 | # 1 if daemon was already running 46 | # 2 if daemon could not be started 47 | start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ 48 | || return 1 49 | start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ 50 | $DAEMON_ARGS \ 51 | || return 2 52 | # Add code here, if necessary, that waits for the process to be ready 53 | # to handle requests from services started subsequently which depend 54 | # on this one. As a last resort, sleep for some time. 55 | } 56 | 57 | # 58 | # Function that stops the daemon/service 59 | # 60 | do_stop() 61 | { 62 | # Return 63 | # 0 if daemon has been stopped 64 | # 1 if daemon was already stopped 65 | # 2 if daemon could not be stopped 66 | # other if a failure occurred 67 | start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME 68 | RETVAL="$?" 69 | [ "$RETVAL" = 2 ] && return 2 70 | # Wait for children to finish too if this is a daemon that forks 71 | # and if the daemon is only ever run from this initscript. 72 | # If the above conditions are not satisfied then add some other code 73 | # that waits for the process to drop all resources that could be 74 | # needed by services started subsequently. A last resort is to 75 | # sleep for some time. 76 | start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON 77 | [ "$?" = 2 ] && return 2 78 | # Many daemons don't delete their pidfiles when they exit. 79 | rm -f $PIDFILE 80 | return "$RETVAL" 81 | } 82 | 83 | # 84 | # Function that sends a SIGHUP to the daemon/service 85 | # 86 | do_reload() { 87 | # 88 | # If the daemon can reload its configuration without 89 | # restarting (for example, when it is sent a SIGHUP), 90 | # then implement that here. 91 | # 92 | start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME 93 | return 0 94 | } 95 | 96 | case "$1" in 97 | start) 98 | [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" 99 | do_start 100 | case "$?" in 101 | 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 102 | 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; 103 | esac 104 | ;; 105 | stop) 106 | [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" 107 | do_stop 108 | case "$?" in 109 | 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 110 | 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; 111 | esac 112 | ;; 113 | status) 114 | status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? 115 | ;; 116 | #reload|force-reload) 117 | # 118 | # If do_reload() is not implemented then leave this commented out 119 | # and leave 'force-reload' as an alias for 'restart'. 120 | # 121 | #log_daemon_msg "Reloading $DESC" "$NAME" 122 | #do_reload 123 | #log_end_msg $? 124 | #;; 125 | restart|force-reload) 126 | # 127 | # If the "reload" option is implemented then remove the 128 | # 'force-reload' alias 129 | # 130 | log_daemon_msg "Restarting $DESC" "$NAME" 131 | do_stop 132 | case "$?" in 133 | 0|1) 134 | do_start 135 | case "$?" in 136 | 0) log_end_msg 0 ;; 137 | 1) log_end_msg 1 ;; # Old process is still running 138 | *) log_end_msg 1 ;; # Failed to start 139 | esac 140 | ;; 141 | *) 142 | # Failed to stop 143 | log_end_msg 1 144 | ;; 145 | esac 146 | ;; 147 | *) 148 | #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 149 | echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 150 | exit 3 151 | ;; 152 | esac 153 | 154 | : 155 | -------------------------------------------------------------------------------- /debian/isisbrowser.cron.d.ex: -------------------------------------------------------------------------------- 1 | # 2 | # Regular cron jobs for the isisbrowser package 3 | # 4 | 0 4 * * * root [ -x /usr/bin/isisbrowser_maintenance ] && /usr/bin/isisbrowser_maintenance 5 | -------------------------------------------------------------------------------- /debian/isisbrowser.debhelper.log: -------------------------------------------------------------------------------- 1 | dh_auto_configure 2 | dh_auto_build 3 | dh_auto_test 4 | dh_prep 5 | dh_installdirs 6 | dh_auto_install 7 | dh_install 8 | dh_installdocs 9 | dh_installchangelogs 10 | dh_installexamples 11 | dh_installman 12 | dh_installcatalogs 13 | dh_installcron 14 | dh_installdebconf 15 | dh_installemacsen 16 | dh_installifupdown 17 | dh_installinfo 18 | dh_pysupport 19 | dh_installinit 20 | dh_installmenu 21 | dh_installmime 22 | dh_installmodules 23 | dh_installlogcheck 24 | dh_installlogrotate 25 | dh_installpam 26 | dh_installppp 27 | dh_installudev 28 | dh_installwm 29 | dh_installxfonts 30 | dh_installgsettings 31 | dh_bugfiles 32 | dh_ucf 33 | dh_lintian 34 | dh_gconf 35 | dh_icons 36 | dh_perl 37 | dh_usrlocal 38 | dh_link 39 | dh_compress 40 | dh_fixperms 41 | dh_strip 42 | dh_makeshlibs 43 | dh_shlibdeps 44 | dh_installdeb 45 | dh_gencontrol 46 | dh_md5sums 47 | dh_builddeb 48 | -------------------------------------------------------------------------------- /debian/isisbrowser.default.ex: -------------------------------------------------------------------------------- 1 | # Defaults for isisbrowser initscript 2 | # sourced by /etc/init.d/isisbrowser 3 | # installed at /etc/default/isisbrowser by the maintainer scripts 4 | 5 | # 6 | # This is a POSIX shell fragment 7 | # 8 | 9 | # Additional options that are passed to the Daemon. 10 | DAEMON_OPTS="" 11 | -------------------------------------------------------------------------------- /debian/isisbrowser.doc-base.EX: -------------------------------------------------------------------------------- 1 | Document: isisbrowser 2 | Title: Debian isisbrowser Manual 3 | Author: 4 | Abstract: This manual describes what isisbrowser is 5 | and how it can be used to 6 | manage online manuals on Debian systems. 7 | Section: unknown 8 | 9 | Format: debiandoc-sgml 10 | Files: /usr/share/doc/isisbrowser/isisbrowser.sgml.gz 11 | 12 | Format: postscript 13 | Files: /usr/share/doc/isisbrowser/isisbrowser.ps.gz 14 | 15 | Format: text 16 | Files: /usr/share/doc/isisbrowser/isisbrowser.text.gz 17 | 18 | Format: HTML 19 | Index: /usr/share/doc/isisbrowser/html/index.html 20 | Files: /usr/share/doc/isisbrowser/html/*.html 21 | -------------------------------------------------------------------------------- /debian/isisbrowser.install: -------------------------------------------------------------------------------- 1 | /usr/openwebos/applications/isisbrowser/* /usr/openwebos/applications/isisbrowser/ 2 | -------------------------------------------------------------------------------- /debian/isisbrowser.substvars: -------------------------------------------------------------------------------- 1 | misc:Depends= 2 | -------------------------------------------------------------------------------- /debian/manpage.1.ex: -------------------------------------------------------------------------------- 1 | .\" Hey, EMACS: -*- nroff -*- 2 | .\" First parameter, NAME, should be all caps 3 | .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection 4 | .\" other parameters are allowed: see man(7), man(1) 5 | .TH ISISBROWSER SECTION "April 18, 2012" 6 | .\" Please adjust this date whenever revising the manpage. 7 | .\" 8 | .\" Some roff macros, for reference: 9 | .\" .nh disable hyphenation 10 | .\" .hy enable hyphenation 11 | .\" .ad l left justify 12 | .\" .ad b justify to both left and right margins 13 | .\" .nf disable filling 14 | .\" .fi enable filling 15 | .\" .br insert line break 16 | .\" .sp insert n+1 empty lines 17 | .\" for manpage-specific macros, see man(7) 18 | .SH NAME 19 | isisbrowser \- program to do something 20 | .SH SYNOPSIS 21 | .B isisbrowser 22 | .RI [ options ] " files" ... 23 | .br 24 | .B bar 25 | .RI [ options ] " files" ... 26 | .SH DESCRIPTION 27 | This manual page documents briefly the 28 | .B isisbrowser 29 | and 30 | .B bar 31 | commands. 32 | .PP 33 | .\" TeX users may be more comfortable with the \fB\fP and 34 | .\" \fI\fP escape sequences to invode bold face and italics, 35 | .\" respectively. 36 | \fBisisbrowser\fP is a program that... 37 | .SH OPTIONS 38 | These programs follow the usual GNU command line syntax, with long 39 | options starting with two dashes (`-'). 40 | A summary of options is included below. 41 | For a complete description, see the Info files. 42 | .TP 43 | .B \-h, \-\-help 44 | Show summary of options. 45 | .TP 46 | .B \-v, \-\-version 47 | Show version of program. 48 | .SH SEE ALSO 49 | .BR bar (1), 50 | .BR baz (1). 51 | .br 52 | The programs are documented fully by 53 | .IR "The Rise and Fall of a Fooish Bar" , 54 | available via the Info system. 55 | .SH AUTHOR 56 | isisbrowser was written by . 57 | .PP 58 | This manual page was written by Anupam , 59 | for the Debian project (and may be used by others). 60 | -------------------------------------------------------------------------------- /debian/manpage.sgml.ex: -------------------------------------------------------------------------------- 1 | manpage.1'. You may view 5 | the manual page with: `docbook-to-man manpage.sgml | nroff -man | 6 | less'. A typical entry in a Makefile or Makefile.am is: 7 | 8 | manpage.1: manpage.sgml 9 | docbook-to-man $< > $@ 10 | 11 | 12 | The docbook-to-man binary is found in the docbook-to-man package. 13 | Please remember that if you create the nroff version in one of the 14 | debian/rules file targets (such as build), you will need to include 15 | docbook-to-man in your Build-Depends control field. 16 | 17 | --> 18 | 19 | 20 | FIRSTNAME"> 21 | SURNAME"> 22 | 23 | April 18, 2012"> 24 | 26 | SECTION"> 27 | anupam.kaul@palm.com"> 28 | 29 | ISISBROWSER"> 30 | 31 | 32 | Debian"> 33 | GNU"> 34 | GPL"> 35 | ]> 36 | 37 | 38 | 39 |
40 | &dhemail; 41 |
42 | 43 | &dhfirstname; 44 | &dhsurname; 45 | 46 | 47 | 2003 48 | &dhusername; 49 | 50 | &dhdate; 51 |
52 | 53 | &dhucpackage; 54 | 55 | &dhsection; 56 | 57 | 58 | &dhpackage; 59 | 60 | program to do something 61 | 62 | 63 | 64 | &dhpackage; 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | DESCRIPTION 73 | 74 | This manual page documents briefly the 75 | &dhpackage; and bar 76 | commands. 77 | 78 | This manual page was written for the &debian; distribution 79 | because the original program does not have a manual page. 80 | Instead, it has documentation in the &gnu; 81 | Info format; see below. 82 | 83 | &dhpackage; is a program that... 84 | 85 | 86 | 87 | OPTIONS 88 | 89 | These programs follow the usual &gnu; command line syntax, 90 | with long options starting with two dashes (`-'). A summary of 91 | options is included below. For a complete description, see the 92 | Info files. 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | Show summary of options. 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | Show version of program. 109 | 110 | 111 | 112 | 113 | 114 | SEE ALSO 115 | 116 | bar (1), baz (1). 117 | 118 | The programs are documented fully by The Rise and 119 | Fall of a Fooish Bar available via the 120 | Info system. 121 | 122 | 123 | AUTHOR 124 | 125 | This manual page was written by &dhusername; &dhemail; for 126 | the &debian; system (and may be used by others). Permission is 127 | granted to copy, distribute and/or modify this document under 128 | the terms of the &gnu; General Public License, Version 2 any 129 | later version published by the Free Software Foundation. 130 | 131 | 132 | On Debian systems, the complete text of the GNU General Public 133 | License can be found in /usr/share/common-licenses/GPL. 134 | 135 | 136 | 137 |
138 | 139 | 155 | -------------------------------------------------------------------------------- /debian/manpage.xml.ex: -------------------------------------------------------------------------------- 1 | 2 | .
will be generated. You may view the 15 | manual page with: nroff -man .
| less'. A typical entry 16 | in a Makefile or Makefile.am is: 17 | 18 | DB2MAN = /usr/share/sgml/docbook/stylesheet/xsl/docbook-xsl/manpages/docbook.xsl 19 | XP = xsltproc -''-nonet -''-param man.charmap.use.subset "0" 20 | 21 | manpage.1: manpage.xml 22 | $(XP) $(DB2MAN) $< 23 | 24 | The xsltproc binary is found in the xsltproc package. The XSL files are in 25 | docbook-xsl. A description of the parameters you can use can be found in the 26 | docbook-xsl-doc-* packages. Please remember that if you create the nroff 27 | version in one of the debian/rules file targets (such as build), you will need 28 | to include xsltproc and docbook-xsl in your Build-Depends control field. 29 | Alternatively use the xmlto command/package. That will also automatically 30 | pull in xsltproc and docbook-xsl. 31 | 32 | Notes for using docbook2x: docbook2x-man does not automatically create the 33 | AUTHOR(S) and COPYRIGHT sections. In this case, please add them manually as 34 | ... . 35 | 36 | To disable the automatic creation of the AUTHOR(S) and COPYRIGHT sections 37 | read /usr/share/doc/docbook-xsl/doc/manpages/authors.html. This file can be 38 | found in the docbook-xsl-doc-html package. 39 | 40 | Validation can be done using: `xmllint -''-noout -''-valid manpage.xml` 41 | 42 | General documentation about man-pages and man-page-formatting: 43 | man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/ 44 | 45 | --> 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 56 | 57 | 59 | 60 | 61 | 62 | ]> 63 | 64 | 65 | 66 | &dhtitle; 67 | &dhpackage; 68 | 69 | 70 | &dhfirstname; 71 | &dhsurname; 72 | Wrote this manpage for the Debian system. 73 |
74 | &dhemail; 75 |
76 |
77 |
78 | 79 | 2007 80 | &dhusername; 81 | 82 | 83 | This manual page was written for the Debian system 84 | (and may be used by others). 85 | Permission is granted to copy, distribute and/or modify this 86 | document under the terms of the GNU General Public License, 87 | Version 2 or (at your option) any later version published by 88 | the Free Software Foundation. 89 | On Debian systems, the complete text of the GNU General Public 90 | License can be found in 91 | /usr/share/common-licenses/GPL. 92 | 93 |
94 | 95 | &dhucpackage; 96 | &dhsection; 97 | 98 | 99 | &dhpackage; 100 | program to do something 101 | 102 | 103 | 104 | &dhpackage; 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | this 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | this 122 | that 123 | 124 | 125 | 126 | 127 | &dhpackage; 128 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | DESCRIPTION 148 | This manual page documents briefly the 149 | &dhpackage; and bar 150 | commands. 151 | This manual page was written for the Debian distribution 152 | because the original program does not have a manual page. 153 | Instead, it has documentation in the GNU 154 | info 155 | 1 156 | format; see below. 157 | &dhpackage; is a program that... 158 | 159 | 160 | OPTIONS 161 | The program follows the usual GNU command line syntax, 162 | with long options starting with two dashes (`-'). A summary of 163 | options is included below. For a complete description, see the 164 | 165 | info 166 | 1 167 | files. 168 | 169 | 172 | 173 | 174 | 175 | 176 | Does this and that. 177 | 178 | 179 | 180 | 181 | 182 | 183 | Show summary of options. 184 | 185 | 186 | 187 | 188 | 189 | 190 | Show version of program. 191 | 192 | 193 | 194 | 195 | 196 | FILES 197 | 198 | 199 | /etc/foo.conf 200 | 201 | The system-wide configuration file to control the 202 | behaviour of &dhpackage;. See 203 | 204 | foo.conf 205 | 5 206 | for further details. 207 | 208 | 209 | 210 | ${HOME}/.foo.conf 211 | 212 | The per-user configuration file to control the 213 | behaviour of &dhpackage;. See 214 | 215 | foo.conf 216 | 5 217 | for further details. 218 | 219 | 220 | 221 | 222 | 223 | ENVIONMENT 224 | 225 | 226 | FOO_CONF 227 | 228 | If used, the defined file is used as configuration 229 | file (see also ). 230 | 231 | 232 | 233 | 234 | 235 | DIAGNOSTICS 236 | The following diagnostics may be issued 237 | on stderr: 238 | 239 | 240 | Bad configuration file. Exiting. 241 | 242 | The configuration file seems to contain a broken configuration 243 | line. Use the option, to get more info. 244 | 245 | 246 | 247 | 248 | &dhpackage; provides some return codes, that can 249 | be used in scripts: 250 | 251 | Code 252 | Diagnostic 253 | 254 | 0 255 | Program exited successfully. 256 | 257 | 258 | 1 259 | The configuration file seems to be broken. 260 | 261 | 262 | 263 | 264 | 265 | BUGS 266 | The program is currently limited to only work 267 | with the foobar library. 268 | The upstreams BTS can be found 269 | at . 270 | 271 | 272 | SEE ALSO 273 | 274 | 275 | bar 276 | 1 277 | , 278 | baz 279 | 1 280 | , 281 | foo.conf 282 | 5 283 | 284 | The programs are documented fully by The Rise and 285 | Fall of a Fooish Bar available via the 286 | info 287 | 1 288 | system. 289 | 290 |
291 | 292 | -------------------------------------------------------------------------------- /debian/menu.ex: -------------------------------------------------------------------------------- 1 | ?package(isisbrowser):needs="X11|text|vc|wm" section="Applications/see-menu-manual"\ 2 | title="isisbrowser" command="/usr/bin/isisbrowser" 3 | -------------------------------------------------------------------------------- /debian/postinst.ex: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postinst script for isisbrowser 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `configure' 10 | # * `abort-upgrade' 11 | # * `abort-remove' `in-favour' 12 | # 13 | # * `abort-remove' 14 | # * `abort-deconfigure' `in-favour' 15 | # `removing' 16 | # 17 | # for details, see http://www.debian.org/doc/debian-policy/ or 18 | # the debian-policy package 19 | 20 | 21 | case "$1" in 22 | configure) 23 | ;; 24 | 25 | abort-upgrade|abort-remove|abort-deconfigure) 26 | ;; 27 | 28 | *) 29 | echo "postinst called with unknown argument \`$1'" >&2 30 | exit 1 31 | ;; 32 | esac 33 | 34 | # dh_installdeb will replace this with shell code automatically 35 | # generated by other debhelper scripts. 36 | 37 | #DEBHELPER# 38 | 39 | exit 0 40 | -------------------------------------------------------------------------------- /debian/postrm.ex: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postrm script for isisbrowser 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `purge' 11 | # * `upgrade' 12 | # * `failed-upgrade' 13 | # * `abort-install' 14 | # * `abort-install' 15 | # * `abort-upgrade' 16 | # * `disappear' 17 | # 18 | # for details, see http://www.debian.org/doc/debian-policy/ or 19 | # the debian-policy package 20 | 21 | 22 | case "$1" in 23 | purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 24 | ;; 25 | 26 | *) 27 | echo "postrm called with unknown argument \`$1'" >&2 28 | exit 1 29 | ;; 30 | esac 31 | 32 | # dh_installdeb will replace this with shell code automatically 33 | # generated by other debhelper scripts. 34 | 35 | #DEBHELPER# 36 | 37 | exit 0 38 | -------------------------------------------------------------------------------- /debian/preinst.ex: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # preinst script for isisbrowser 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `install' 10 | # * `install' 11 | # * `upgrade' 12 | # * `abort-upgrade' 13 | # for details, see http://www.debian.org/doc/debian-policy/ or 14 | # the debian-policy package 15 | 16 | 17 | case "$1" in 18 | install|upgrade) 19 | ;; 20 | 21 | abort-upgrade) 22 | ;; 23 | 24 | *) 25 | echo "preinst called with unknown argument \`$1'" >&2 26 | exit 1 27 | ;; 28 | esac 29 | 30 | # dh_installdeb will replace this with shell code automatically 31 | # generated by other debhelper scripts. 32 | 33 | #DEBHELPER# 34 | 35 | exit 0 36 | -------------------------------------------------------------------------------- /debian/prerm.ex: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # prerm script for isisbrowser 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `upgrade' 11 | # * `failed-upgrade' 12 | # * `remove' `in-favour' 13 | # * `deconfigure' `in-favour' 14 | # `removing' 15 | # 16 | # for details, see http://www.debian.org/doc/debian-policy/ or 17 | # the debian-policy package 18 | 19 | 20 | case "$1" in 21 | remove|upgrade|deconfigure) 22 | ;; 23 | 24 | failed-upgrade) 25 | ;; 26 | 27 | *) 28 | echo "prerm called with unknown argument \`$1'" >&2 29 | exit 1 30 | ;; 31 | esac 32 | 33 | # dh_installdeb will replace this with shell code automatically 34 | # generated by other debhelper scripts. 35 | 36 | #DEBHELPER# 37 | 38 | exit 0 39 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | export DH_VERBOSE=1 11 | export DEB_APP_DIR=debian/isisbrowser/usr/openwebos/applications/isisbrowser 12 | 13 | %: 14 | dh $@ 15 | 16 | .PHONY: override_dh_auto_build override_dh_auto_test override_dh_install 17 | 18 | override_dh_auto_build: 19 | 20 | override_dh_auto_test: 21 | 22 | override_dh_auto_clean: 23 | 24 | override_dh_install: 25 | 26 | override_dh_auto_install: 27 | 28 | override_dh_installdirs: 29 | install -d $(DEB_APP_DIR) 30 | install -m 444 ./*.json $(DEB_APP_DIR) 31 | install -m 444 ./*.js $(DEB_APP_DIR) 32 | install -m 444 ./*.png $(DEB_APP_DIR) 33 | install -m 444 ./*.html $(DEB_APP_DIR) 34 | install -m 444 ./*.md $(DEB_APP_DIR) 35 | install -d $(DEB_APP_DIR)/css 36 | install -m 444 ./css/* $(DEB_APP_DIR)/css 37 | install -d $(DEB_APP_DIR)/images 38 | install -m 444 ./images/*.png $(DEB_APP_DIR)/images 39 | install -d $(DEB_APP_DIR)/images/chrome 40 | install -m 444 ./images/chrome/* $(DEB_APP_DIR)/images/chrome 41 | install -d $(DEB_APP_DIR)/images/icons 42 | install -m 444 ./images/icons/* $(DEB_APP_DIR)/images/icons 43 | install -d $(DEB_APP_DIR)/source 44 | install -m 444 ./source/* $(DEB_APP_DIR)/source 45 | install -d $(DEB_APP_DIR)/db/kinds 46 | install -m 444 ./db/kinds/* $(DEB_APP_DIR)/db/kinds 47 | install -d $(DEB_APP_DIR)/db/permissions 48 | install -m 444 ./db/permissions/* $(DEB_APP_DIR)/db/permissions 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /debian/watch.ex: -------------------------------------------------------------------------------- 1 | # Example watch control file for uscan 2 | # Rename this file to "watch" and then you can run the "uscan" command 3 | # to check for upstream updates and more. 4 | # See uscan(1) for format 5 | 6 | # Compulsory line, this is a version 3 file 7 | version=3 8 | 9 | # Uncomment to examine a Webpage 10 | # 11 | #http://www.example.com/downloads.php isisbrowser-(.*)\.tar\.gz 12 | 13 | # Uncomment to examine a Webserver directory 14 | #http://www.example.com/pub/isisbrowser-(.*)\.tar\.gz 15 | 16 | # Uncommment to examine a FTP server 17 | #ftp://ftp.example.com/pub/isisbrowser-(.*)\.tar\.gz debian uupdate 18 | 19 | # Uncomment to find new files on sourceforge, for devscripts >= 2.9 20 | # http://sf.net/isisbrowser/isisbrowser-(.*)\.tar\.gz 21 | 22 | # Uncomment to find new files on GooglePages 23 | # http://example.googlepages.com/foo.html isisbrowser-(.*)\.tar\.gz 24 | -------------------------------------------------------------------------------- /depends.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.depends( 16 | "$enyo-lib/printdialog/", 17 | "css/browser.css", 18 | "source/ActionBar.js", 19 | "source/URLSearch.js", 20 | "source/AddressInput.js", 21 | "source/FindBar.js", 22 | "source/StartPage.js", 23 | "source/Preferences.js", 24 | "source/Browser.js", 25 | "source/BookmarkList.js", 26 | "source/CertificateDetail.js", 27 | "source/HistoryList.js", 28 | "source/MimeIcon.js", 29 | "source/DownloadList.js", 30 | "source/ProgressItem.js", 31 | "source/BrowserApp.js", 32 | "source/BrowserContextMenu.js", 33 | "source/AcceptCancelPopup.js", 34 | "source/VerticalAcceptCancelPopup.js", 35 | "source/BrowserPrompt.js", 36 | "source/BookmarkDialog.js", 37 | "source/ShareLinkDialog.js", 38 | "source/NoFocusButton.js", 39 | "source/clipboard.js", 40 | "source/util.js", 41 | "source/tld.js" 42 | ); 43 | -------------------------------------------------------------------------------- /icon-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/icon-256x256.png -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/icon.png -------------------------------------------------------------------------------- /images/background-bookmarks-grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/background-bookmarks-grid.png -------------------------------------------------------------------------------- /images/background-startpage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/background-startpage.png -------------------------------------------------------------------------------- /images/bookmark-icon-default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/bookmark-icon-default.png -------------------------------------------------------------------------------- /images/bookmark-icon-frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/bookmark-icon-frame.png -------------------------------------------------------------------------------- /images/bookmark-info-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/bookmark-info-icon.png -------------------------------------------------------------------------------- /images/bookmark-overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/bookmark-overlay.png -------------------------------------------------------------------------------- /images/chrome/button-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/button-menu.png -------------------------------------------------------------------------------- /images/chrome/drag-handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/drag-handle.png -------------------------------------------------------------------------------- /images/chrome/filter-search-highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/filter-search-highlight.png -------------------------------------------------------------------------------- /images/chrome/list-divider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/list-divider.png -------------------------------------------------------------------------------- /images/chrome/menu-icon-add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/menu-icon-add.png -------------------------------------------------------------------------------- /images/chrome/menu-icon-back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/menu-icon-back.png -------------------------------------------------------------------------------- /images/chrome/menu-icon-bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/menu-icon-bookmark.png -------------------------------------------------------------------------------- /images/chrome/menu-icon-forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/menu-icon-forward.png -------------------------------------------------------------------------------- /images/chrome/menu-icon-newcard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/menu-icon-newcard.png -------------------------------------------------------------------------------- /images/chrome/menu-icon-refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/menu-icon-refresh.png -------------------------------------------------------------------------------- /images/chrome/menu-icon-share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/menu-icon-share.png -------------------------------------------------------------------------------- /images/chrome/menu-icon-stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/menu-icon-stop.png -------------------------------------------------------------------------------- /images/chrome/palm-popup-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/palm-popup-background.png -------------------------------------------------------------------------------- /images/chrome/progress-bar-inner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/progress-bar-inner.png -------------------------------------------------------------------------------- /images/chrome/progress-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/progress-bar.png -------------------------------------------------------------------------------- /images/chrome/radiobutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/radiobutton.png -------------------------------------------------------------------------------- /images/chrome/search-results-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/search-results-background.png -------------------------------------------------------------------------------- /images/chrome/secure-lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/secure-lock.png -------------------------------------------------------------------------------- /images/chrome/toaster-icon-bookmarks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/toaster-icon-bookmarks.png -------------------------------------------------------------------------------- /images/chrome/toaster-icon-downloads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/toaster-icon-downloads.png -------------------------------------------------------------------------------- /images/chrome/toaster-icon-history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/toaster-icon-history.png -------------------------------------------------------------------------------- /images/chrome/url-pill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/chrome/url-pill.png -------------------------------------------------------------------------------- /images/header-icon-bookmarks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/header-icon-bookmarks.png -------------------------------------------------------------------------------- /images/header-icon-history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/header-icon-history.png -------------------------------------------------------------------------------- /images/header-icon-prefs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/header-icon-prefs.png -------------------------------------------------------------------------------- /images/icons/download-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/icons/download-icon.png -------------------------------------------------------------------------------- /images/icons/email-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/icons/email-32x32.png -------------------------------------------------------------------------------- /images/icons/facebook-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/icons/facebook-32x32.png -------------------------------------------------------------------------------- /images/icons/messaging-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/icons/messaging-32x32.png -------------------------------------------------------------------------------- /images/list-icon-bing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/list-icon-bing.png -------------------------------------------------------------------------------- /images/list-icon-google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/list-icon-google.png -------------------------------------------------------------------------------- /images/list-icon-wikipedia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/list-icon-wikipedia.png -------------------------------------------------------------------------------- /images/mime-icon-audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/mime-icon-audio.png -------------------------------------------------------------------------------- /images/mime-icon-download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/mime-icon-download.png -------------------------------------------------------------------------------- /images/mime-icon-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/mime-icon-image.png -------------------------------------------------------------------------------- /images/mime-icon-pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/mime-icon-pdf.png -------------------------------------------------------------------------------- /images/mime-icon-ppt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/mime-icon-ppt.png -------------------------------------------------------------------------------- /images/mime-icon-txt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/mime-icon-txt.png -------------------------------------------------------------------------------- /images/mime-icon-vcard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/mime-icon-vcard.png -------------------------------------------------------------------------------- /images/mime-icon-video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/mime-icon-video.png -------------------------------------------------------------------------------- /images/mime-icon-word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/mime-icon-word.png -------------------------------------------------------------------------------- /images/mime-icon-xls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/mime-icon-xls.png -------------------------------------------------------------------------------- /images/palm-popup-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/palm-popup-background.png -------------------------------------------------------------------------------- /images/startpage-placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isis-project/isis-browser/0f2a339d30023018d1d0d435b2aa0350a32c83e4/images/startpage-placeholder.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Web 20 | 21 | 22 | 23 | 24 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /mock/browserApp_bookmarksService.json: -------------------------------------------------------------------------------- 1 | { 2 | "results": [ 3 | { 4 | "title": "Google", 5 | "url": "http://www.google.com", 6 | "thumbnailFile": "images/bookmark-icon-default.png" 7 | }, 8 | { 9 | "title": "CNN", 10 | "url": "http://www.cnn.com", 11 | "thumbnailFile": "images/bookmark-icon-default.png" 12 | } 13 | ], 14 | "returnValue": true 15 | } 16 | -------------------------------------------------------------------------------- /mock/browserApp_bookmarks_bookmarksService.json: -------------------------------------------------------------------------------- 1 | { 2 | "returnValue": true, 3 | "results": [ 4 | { 5 | "title": "Google", 6 | "url": "http://www.google.com", 7 | "thumbnailFile": "images/bookmark-icon-default.png" 8 | }, 9 | { 10 | "title": "CNN", 11 | "url": "http://www.cnn.com", 12 | "thumbnailFile": "images/bookmark-icon-default.png" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /mock/browserApp_browserPrefsService.json: -------------------------------------------------------------------------------- 1 | { 2 | "returnValue": true, 3 | "results": [ 4 | { 5 | "key": "blockPopups", 6 | "value": true 7 | }, 8 | { 9 | "key": "acceptCookies", 10 | "value": true 11 | }, 12 | { 13 | "key": "enableJavascript", 14 | "value": true 15 | }, 16 | { 17 | "key": "rememberPasswords", 18 | "value": true 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /mock/browserApp_findBookmarks.json: -------------------------------------------------------------------------------- 1 | {results: [ 2 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 3 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 4 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 5 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 6 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 7 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 8 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 9 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 10 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 11 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 12 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 13 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 14 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 15 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 16 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 17 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 18 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 19 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 20 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 21 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 22 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 23 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 24 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 25 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 26 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 27 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 28 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 29 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 30 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 31 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 32 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 33 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"} 34 | ]} 35 | -------------------------------------------------------------------------------- /mock/browserApp_findHistory.json: -------------------------------------------------------------------------------- 1 | { 2 | "returnValue": true, 3 | "results": [ 4 | { 5 | "title": "Google", 6 | "url": "http://www.google.com", 7 | "thumbnailFile": "images/header-icon-history.png", 8 | "date": 1300224386683 9 | }, 10 | { 11 | "title": "CNN", 12 | "url": "http://www.cnn.com", 13 | "thumbnailFile": "images/header-icon-history.png", 14 | "date": 1300138094718 15 | }, 16 | { 17 | "title": "Google", 18 | "url": "http://www.google.com", 19 | "thumbnailFile": "images/header-icon-history.png", 20 | "date": 1299878924431 21 | }, 22 | { 23 | "title": "CNN", 24 | "url": "http://www.cnn.com", 25 | "thumbnailFile": "images/header-icon-history.png", 26 | "date": 1297459724431 27 | }, 28 | { 29 | "title": "Google", 30 | "url": "http://www.google.com", 31 | "thumbnailFile": "images/header-icon-history.png", 32 | "date": 1294781324431 33 | }, 34 | { 35 | "title": "CNN", 36 | "url": "http://www.cnn.com", 37 | "thumbnailFile": "images/header-icon-history.png", 38 | "date": 0 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /mock/browserApp_historyService.json: -------------------------------------------------------------------------------- 1 | { 2 | "returnValue": true, 3 | "results": [ 4 | { 5 | "title": "Google", 6 | "url": "http://www.google.com", 7 | "thumbnailFile": "images/header-icon-history.png", 8 | "date": 1300224386683 9 | }, 10 | { 11 | "title": "CNN", 12 | "url": "http://www.cnn.com", 13 | "thumbnailFile": "images/header-icon-history.png", 14 | "date": 1300138094718 15 | }, 16 | { 17 | "title": "Google", 18 | "url": "http://www.google.com", 19 | "thumbnailFile": "images/header-icon-history.png", 20 | "date": 1299878924431 21 | }, 22 | { 23 | "title": "CNN", 24 | "url": "http://www.cnn.com", 25 | "thumbnailFile": "images/header-icon-history.png", 26 | "date": 1297459724431 27 | }, 28 | { 29 | "title": "Google", 30 | "url": "http://www.google.com", 31 | "thumbnailFile": "images/header-icon-history.png", 32 | "date": 1294781324431 33 | }, 34 | { 35 | "title": "CNN", 36 | "url": "http://www.cnn.com", 37 | "thumbnailFile": "images/header-icon-history.png", 38 | "date": 0 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /mock/browserApp_history_historyService.json: -------------------------------------------------------------------------------- 1 | { 2 | "returnValue": true, 3 | "results": [ 4 | { 5 | "title": "Google", 6 | "url": "http://www.google.com", 7 | "thumbnailFile": "images/header-icon-history.png", 8 | "date": 1300224386683 9 | }, 10 | { 11 | "title": "CNN", 12 | "url": "http://www.cnn.com", 13 | "thumbnailFile": "images/header-icon-history.png", 14 | "date": 1300138094718 15 | }, 16 | { 17 | "title": "Google", 18 | "url": "http://www.google.com", 19 | "thumbnailFile": "images/header-icon-history.png", 20 | "date": 1299878924431 21 | }, 22 | { 23 | "title": "CNN", 24 | "url": "http://www.cnn.com", 25 | "thumbnailFile": "images/header-icon-history.png", 26 | "date": 1297459724431 27 | }, 28 | { 29 | "title": "Google", 30 | "url": "http://www.google.com", 31 | "thumbnailFile": "images/header-icon-history.png", 32 | "date": 1294781324431 33 | }, 34 | { 35 | "title": "CNN", 36 | "url": "http://www.cnn.com", 37 | "thumbnailFile": "images/header-icon-history.png", 38 | "date": 0 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /mock/browserApp_startPage_actionbar_search_bookmarksService.json: -------------------------------------------------------------------------------- 1 | { 2 | "results": [ 3 | { 4 | "title": "Google", 5 | "url": "http://www.google.com", 6 | "thumbnailFile": "images/bookmark-icon-default.png" 7 | }, 8 | { 9 | "title": "CNN", 10 | "url": "http://www.cnn.com", 11 | "thumbnailFile": "images/bookmark-icon-default.png" 12 | } 13 | ], 14 | "returnValue": true 15 | } 16 | -------------------------------------------------------------------------------- /mock/browserApp_startPage_actionbar_search_historyService.json: -------------------------------------------------------------------------------- 1 | { 2 | "returnValue": true, 3 | "results": [ 4 | { 5 | "title": "Google", 6 | "url": "http://www.google.com", 7 | "thumbnailFile": "images/header-icon-history.png" 8 | }, 9 | { 10 | "title": "CNN", 11 | "url": "http://www.cnn.com", 12 | "thumbnailFile": "images/header-icon-history.png" 13 | }, 14 | { 15 | "title": "Google", 16 | "url": "http://www.google.com", 17 | "thumbnailFile": "images/header-icon-history.png" 18 | }, 19 | { 20 | "title": "CNN", 21 | "url": "http://www.cnn.com", 22 | "thumbnailFile": "images/header-icon-history.png" 23 | }, 24 | { 25 | "title": "Google", 26 | "url": "http://www.google.com", 27 | "thumbnailFile": "images/header-icon-history.png" 28 | }, 29 | { 30 | "title": "CNN", 31 | "url": "http://www.cnn.com", 32 | "thumbnailFile": "images/header-icon-history.png" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /mock/browserApp_startPage_addressbar_bookmarksService.json: -------------------------------------------------------------------------------- 1 | {results: [ 2 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 3 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"}, 4 | {title: "Google", url: "http://www.google.com", thumbnailFile: "images/bookmark-icon-default.png"}, 5 | {title: "CNN", url: "http://www.cnn.com", thumbnailFile: "images/bookmark-icon-default.png"} 6 | ]} 7 | -------------------------------------------------------------------------------- /mock/browserApp_startPage_addressbar_historyService.json: -------------------------------------------------------------------------------- 1 | { 2 | results: [ 3 | { 4 | title: "Google", 5 | url: "http://www.google.com", 6 | thumbnailFile: "images/header-icon-history.png" 7 | }, 8 | { 9 | title: "CNN", 10 | url: "http://www.cnn.com", 11 | thumbnailFile: "images/header-icon-history.png" 12 | }, 13 | { 14 | title: "Google", 15 | url: "http://www.google.com", 16 | thumbnailFile: "images/header-icon-history.png" 17 | }, 18 | { 19 | title: "CNN", 20 | url: "http://www.cnn.com", 21 | thumbnailFile: "images/header-icon-history.png" 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /source/AcceptCancelPopup.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "AcceptCancelPopup", 17 | kind: "ModalDialog", 18 | published: { 19 | acceptCaption: $L("OK"), 20 | cancelCaption: $L("Cancel") 21 | }, 22 | events: { 23 | onAccept: "", 24 | onResponse: "" 25 | }, 26 | chrome: [ 27 | {className: "enyo-modaldialog-container", components: [ 28 | {name: "modalDialogTitle", className: "enyo-modaldialog-title"}, 29 | {name: "client"}, 30 | {kind: enyo.HFlexBox, components: [ 31 | {name: "cancel", kind: "NoFocusButton", flex: 1, onclick: "cancelClick"}, 32 | {name: "accept", kind: "NoFocusButton", className: "enyo-button-dark", flex: 1, onclick: "acceptClick"} 33 | ]} 34 | ]} 35 | ], 36 | //* @protected 37 | accepted: false, 38 | componentsReady: function() { 39 | this.inherited(arguments); 40 | this.acceptCaptionChanged(); 41 | this.cancelCaptionChanged(); 42 | }, 43 | acceptCaptionChanged: function() { 44 | if (this.acceptCaption) { 45 | this.$.accept.setCaption(this.acceptCaption); 46 | this.$.accept.show(); 47 | } else { 48 | this.$.accept.hide(); 49 | } 50 | }, 51 | cancelCaptionChanged: function() { 52 | if (this.cancelCaption) { 53 | this.$.cancel.setCaption(this.cancelCaption); 54 | this.$.cancel.show(); 55 | } else { 56 | this.$.cancel.hide(); 57 | } 58 | }, 59 | acceptClick: function() { 60 | this.accepted = true; 61 | this.doAccept(); 62 | this.close(); 63 | }, 64 | cancelClick: function() { 65 | this.accepted = false; 66 | this.close(); 67 | }, 68 | prepareClose: function() { 69 | this.inherited(arguments); 70 | this.sendResponse(this.accepted); 71 | }, 72 | sendResponse: function(inAccepted) { 73 | this.doResponse(this.accepted); 74 | }, 75 | //* @public 76 | openPopup: function(inMsg) { 77 | this.accepted = false; 78 | this.openAtCenter(); 79 | }, 80 | }); 81 | -------------------------------------------------------------------------------- /source/ActionBar.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "ActionBar", 17 | kind: enyo.VFlexBox, 18 | defaultKind: "ToolButton", 19 | pack: "center", 20 | className: "enyo-toolbar actionbar", 21 | published: { 22 | url: "", 23 | title: "", 24 | canGoBack: false, 25 | canGoForward: false, 26 | canShare: true, 27 | searchPreferences: {}, 28 | defaultSearch: "", 29 | progress: 0, 30 | loading: false 31 | }, 32 | events: { 33 | onBack: "", 34 | onForward: "", 35 | onLoad: "", 36 | onStopLoad: "", 37 | onRefresh: "", 38 | onAddBookmark: "", 39 | onAddToLauncher: "", 40 | onShareLink: "", 41 | onOpenBookmarks: "", 42 | onNewCard: "" 43 | }, 44 | components: [ 45 | {kind: "Control", showing: false, name: "title", className: "page-title enyo-text-ellipsis", content: "Untitled"}, 46 | {kind: enyo.HFlexBox, className: "menu-container", align: "center", components: [ 47 | {kind: "ToolButton", name: "back", className: "actionbar-tool-button", icon: "images/chrome/menu-icon-back.png", onclick: "doBack"}, 48 | {kind: "ToolButton", name: "forward", className: "actionbar-tool-button", icon: "images/chrome/menu-icon-forward.png", onclick: "doForward"}, 49 | {kind: "ToolButton", name: "search", className: "actionbar-tool-button", flex: 1, kind: "URLSearch", onLoad: "doLoad", onStopLoad: "doStopLoad", onRefresh: "doRefresh"}, 50 | {kind: "ToolButton", name: "share", className: "actionbar-tool-button", icon: "images/chrome/menu-icon-share.png", onclick: "showSharePopup"}, 51 | {kind: "ToolButton", className: "actionbar-tool-button", icon: "images/chrome/menu-icon-newcard.png", onclick: "doNewCard"}, 52 | {kind: "ToolButton", className: "actionbar-tool-button", icon: "images/chrome/menu-icon-bookmark.png", onclick: "doOpenBookmarks"}, 53 | ]}, 54 | {name: "sharePopup", className: "launch-popup", kind: "Menu", components: [ 55 | {caption: $L("Add Bookmark"), onclick: "doAddBookmark"}, 56 | {caption: $L("Share Link"), onclick: "doShareLink"}, 57 | {caption: $L("Add to Launcher"), onclick: "doAddToLauncher"} 58 | ]}, 59 | {name: "progressBar", kind: "ProgressBar", className: "url-progress invisible", animatePosition: false}, 60 | ], 61 | //* @public 62 | resize: function() { 63 | this.$.search.resize(); 64 | }, 65 | forceFocus: function() { 66 | this.$.search.forceFocus(); 67 | }, 68 | forceBlur: function() { 69 | this.$.search.closeSearchPopup(); 70 | }, 71 | //* @protected 72 | create: function() { 73 | this.inherited(arguments); 74 | this.urlChanged(); 75 | this.titleChanged(); 76 | this.canGoBackChanged(); 77 | this.canGoForwardChanged(); 78 | this.canShareChanged(); 79 | this.loadingChanged(); 80 | }, 81 | urlChanged: function() { 82 | this.$.search.setUrl(this.url); 83 | }, 84 | titleChanged: function() { 85 | this.$.title.setContent(this.title || $L("Untitled")); 86 | }, 87 | canGoBackChanged: function() { 88 | this.$.back.setDisabled(!this.canGoBack); 89 | }, 90 | canGoForwardChanged: function() { 91 | this.$.forward.setDisabled(!this.canGoForward); 92 | }, 93 | canShareChanged: function() { 94 | this.$.share.setDisabled(!this.canShare); 95 | }, 96 | searchPreferencesChanged: function() { 97 | this.$.search.setSearchPreferences(this.searchPreferences); 98 | }, 99 | defaultSearchChanged: function() { 100 | this.$.search.setDefaultSearch(this.defaultSearch); 101 | }, 102 | showSharePopup: function(inSender, inEvent) { 103 | this.$.sharePopup.openAt({top: -1000}); 104 | var pop = this.$.sharePopup.getBounds(); 105 | this.$.sharePopup.close(); 106 | this.$.sharePopup.openAtControl(this.$.share, {left: -pop.width+10, top: 26}); 107 | }, 108 | progressChanged: function() { 109 | this.$.progressBar.setPosition(this.progress); 110 | }, 111 | loadingChanged: function() { 112 | this.$.search.setLoading(this.loading); 113 | if (this.loading) { 114 | if (this.$.progressBar.hasClass("invisible")) { 115 | this.$.progressBar.removeClass("invisible"); 116 | } 117 | } else { 118 | if (!this.$.progressBar.hasClass("invisible")) { 119 | this.$.progressBar.addClass("invisible"); 120 | } 121 | } 122 | }, 123 | }); 124 | -------------------------------------------------------------------------------- /source/AddressInput.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "AddressInput", 17 | kind: enyo.HFlexBox, 18 | align: "center", 19 | published: { 20 | url: "", 21 | loading: false 22 | }, 23 | events: { 24 | onBlur: "", 25 | onInputChange: "", 26 | onGo: "", 27 | onStop: "", 28 | onRefresh: "" 29 | }, 30 | chrome: [ 31 | 32 | {kind: "InputBox", layoutKind: "HFlexLayout", flex: 1, className: "enyo-tool-input", focusClassName: "enyo-tool-input-focus", spacingClassName: "enyo-tool-input-spacing", components: [ 33 | {name: "secureLock", kind: enyo.CustomButton, showing: false, className: "secure-lock"}, 34 | 35 | {name: "userinput", kind: "Input", flex: 1, styled: false, inputType: "url", width: "100%", spellcheck: false, autocorrect: false, autoCapitalize: "lowercase", autoWordComplete: false, hint: $L("Enter URL or search terms"), selectAllOnFocus: true, 36 | onfocus: "selectInput", 37 | onblur: "deselectInput", 38 | onkeydown: "inputKeydown", 39 | oninput: "inputChange", 40 | }, 41 | {name: "refreshButton", kind: "CustomButton", showing: false, className: "addressbar-button refresh-button", onclick: "doRefresh"}, 42 | {name: "clearButton", kind: "CustomButton", showing: true, className: "addressbar-button stop-button", onmousedown: "clearInput"}, 43 | {name: "stopButton", kind: "CustomButton", showing: false, className: "addressbar-button stop-button", onclick: "doStop"} 44 | ]} 45 | ], 46 | //* @protected 47 | _leftButton: "", 48 | _rightButton: "clearButton", 49 | selectInput: function() { 50 | this.changeButtons(); 51 | }, 52 | deselectInput: function() { 53 | if (this.$.userinput.getValue() === "") { 54 | this.$.userinput.setValue(this.url); 55 | } 56 | this.changeButtons(); 57 | this.doBlur(); 58 | }, 59 | inputChange: function(inSender, inEvent, inValue) { 60 | this.changeButtons(); 61 | this.doInputChange(inValue); 62 | }, 63 | inputKeydown: function(inSender, inEvent) { 64 | if (inEvent.keyCode == 13) { 65 | this.go(); 66 | } 67 | }, 68 | urlChanged: function() { 69 | if (this.url) { 70 | if (!this.hasFocus()) { 71 | this.$.userinput.setValue(this.url); 72 | } 73 | this.changeButtons(); 74 | } 75 | }, 76 | loadingChanged: function() { 77 | this.changeButtons(); 78 | }, 79 | changeButtons: function() { 80 | this.showLeftButton(""); 81 | if (this.hasFocus() && this.$.userinput.getValue().length >= 0) { 82 | this.showRightButton("clearButton"); 83 | } else { 84 | if (this.url.toLowerCase().substring(0, 8) === "https://") { 85 | this.showLeftButton("secureLock"); 86 | } 87 | if (this.loading) { 88 | this.showRightButton("stopButton"); 89 | } else { 90 | this.showRightButton("refreshButton"); 91 | } 92 | } 93 | }, 94 | 95 | // need an IxD for secure lock icon (wireframe b5) 96 | showLeftButton: function(inButton) { 97 | this.showButton(inButton, this._leftButton); 98 | this._leftButton = inButton; 99 | }, 100 | 101 | showRightButton: function(inButton) { 102 | this.showButton(inButton, this._rightButton); 103 | this._rightButton = inButton; 104 | }, 105 | showButton: function(inButton, inOldButton) { 106 | if (inOldButton !== "") { 107 | this.$[inOldButton].hide(); 108 | } 109 | if (inButton !== "") { 110 | this.$[inButton].show(); 111 | } 112 | }, 113 | go: function() { 114 | this.setLoading(true); 115 | var value = this.getUserInput(true); 116 | this.doGo(value); 117 | document.activeElement.blur(); 118 | }, 119 | getUserInput: function(inRaw) { 120 | var value = enyo.string.trim(this.$.userinput.getValue()); 121 | if (!inRaw) { 122 | return enyo.string.escapeHtml(value); 123 | } else { 124 | return value; 125 | } 126 | }, 127 | clearInput: function() { 128 | this.$.userinput.setValue(""); 129 | // input is blurred here causing the keyboard to reappear 130 | this.$.userinput.forceFocus(); 131 | }, 132 | forceFocus: function() { 133 | this.$.userinput.forceFocus(); 134 | }, 135 | //* public 136 | hasFocus: function() { 137 | return document.activeElement.tagName == "INPUT"; 138 | } 139 | }); 140 | -------------------------------------------------------------------------------- /source/BookmarkDialog.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "BookmarkDialog", 17 | kind: "ModalDialog", 18 | published: { 19 | title: "", 20 | url: "", 21 | icons: {}, 22 | id: "", 23 | acceptCaption: "" 24 | }, 25 | events: { 26 | onAccept: "" 27 | }, 28 | components: [ 29 | {components: [ 30 | {className: "item-thumb-container", style: "margin: 0 auto 8px", components: [ 31 | {name: "icon", className: "item-image", kind: "Image"}, 32 | {className: "item-image-frame"} 33 | ]}, 34 | ]}, 35 | {name: "titleInput", kind: "Input", hint: " ", insetClass: "enyo-flat-shadow", onkeydown: "inputKeydown", selectAllOnFocus: true}, 36 | {name: "urlInput", kind: "Input", inputType: "url", hint: " ", insetClass: "enyo-flat-shadow", selectAllOnFocus: true, autoCapitalize:"lowercase"}, 37 | {kind: enyo.VFlexBox, components: [ 38 | {name: "acceptButton", flex: 1, kind: "NoFocusButton", className: "enyo-button-dark", onclick: "acceptClick"}, 39 | {kind: "NoFocusButton", flex: 1, caption: $L("Cancel"), onclick: "cancelClick"} 40 | ]} 41 | ], 42 | componentsReady: function() { 43 | this.inherited(arguments); 44 | this.titleChanged(); 45 | this.iconsChanged(); 46 | this.urlChanged(); 47 | this.acceptCaptionChanged(); 48 | }, 49 | inputKeydown: function(inSender, inEvent) { 50 | if (inEvent.keyCode == 13) { 51 | this.acceptClick(); 52 | return true; 53 | } 54 | }, 55 | titleChanged: function() { 56 | if (!this.lazy) { 57 | this.$.titleInput.setValue(this.title); 58 | } 59 | }, 60 | urlChanged: function() { 61 | if (!this.lazy) { 62 | this.$.urlInput.setValue(this.url); 63 | } 64 | }, 65 | iconsChanged: function() { 66 | if (!this.lazy) { 67 | if (this.icons.iconFile64) { 68 | this.$.icon.setSrc(this.icons.iconFile64); 69 | } else { 70 | this.$.icon.setSrc("images/bookmark-icon-default.png"); 71 | } 72 | } 73 | }, 74 | acceptCaptionChanged: function() { 75 | if (!this.lazy) { 76 | this.$.acceptButton.setCaption(this.acceptCaption); 77 | } 78 | }, 79 | getTitle: function() { 80 | return this.$.titleInput.getValue(); 81 | }, 82 | getUrl: function() { 83 | return this.$.urlInput.getValue(); 84 | }, 85 | acceptClick: function() { 86 | var t = enyo.string.escapeHtml(this.getTitle()); 87 | var u = enyo.string.escapeHtml(this.getUrl()); 88 | this.doAccept(t, u, this.icons, this.getId()); 89 | this.close(); 90 | }, 91 | cancelClick: function() { 92 | this.close(); 93 | }, 94 | close: function() { 95 | this.inherited(arguments); 96 | this.$.titleInput.forceBlur(); 97 | this.$.urlInput.forceBlur(); 98 | } 99 | }); 100 | -------------------------------------------------------------------------------- /source/BookmarkList.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "BookmarkList", 17 | kind: enyo.VFlexBox, 18 | flex: 1, 19 | className: "basic-back", 20 | events: { 21 | onSelectItem: "", 22 | onEditItem: "", 23 | onDeleteItem: "", 24 | onAddBookmark: "", 25 | onClose: "", 26 | }, 27 | components: [ 28 | {name: "bookmarksService", kind: "DbService", dbKind: "com.palm.browserbookmarks:1", reCallWatches: true, method: "find", onSuccess: "gotBookmarksData", subscribe: true, onWatch:"refreshList"}, 29 | {name: "list", kind: "DbList", flex: 1, desc: true, onQuery:"bookmarksQuery", onSetupRow: "listSetupRow", components: [ 30 | {name: "item", kind: "SwipeableItem", className: "toaster-item", layoutKind: "HFlexLayout", align: "center", tapHighlight: true, onclick: "itemClick", onConfirm: "deleteItem", components: [ 31 | {className: "item-thumb-container", components: [ 32 | {name: "icon", className: "item-image", kind: "Image"}, 33 | {className: "item-image-frame"} 34 | ]}, 35 | {kind: "VFlexBox", flex: 1, pack: "center", components: [ 36 | {name: "title", className: "url-item-title enyo-text-ellipsis"}, 37 | {name: "url", className: "url-item-url enyo-item-ternary enyo-text-ellipsis"} 38 | ]}, 39 | {name: "infoIcon", className: "bookmark-edit", kind: "Image", src: "images/bookmark-info-icon.png", onclick: "itemEdit"} 40 | ]} 41 | ]}, 42 | {kind: "Toolbar", components: [ 43 | {kind: "GrabButton", onclick: "doClose"}, 44 | {flex: 1, kind: "Control"}, 45 | {icon: "images/chrome/menu-icon-add.png", onclick: "doAddBookmark", style: "margin-right:10px; top:1px"} 46 | ]} 47 | ], 48 | listSetupRow: function(inSender, inRowItem, inIndex) { 49 | this.$.item.domStyles["border-top"] = inIndex == 0 ? "0" : null; 50 | var icon = inRowItem.iconFile32 || inRowItem.thumbnailFile; 51 | this.$.icon.showing = Boolean(icon); 52 | this.$.icon.domAttributes.src = icon; 53 | this.$.title.content = inRowItem.title || ""; 54 | this.$.url.content = inRowItem.url || ""; 55 | }, 56 | itemClick: function(inSender, inEvent, inIndex) { 57 | var msg = this.$.list.fetch(inIndex); 58 | this.doSelectItem(msg); 59 | }, 60 | itemEdit: function(inSender, inEvent) { 61 | var msg = this.$.list.fetch(inEvent.rowIndex); 62 | this.doEditItem(msg); 63 | return true; 64 | }, 65 | deleteItem: function(inSender, inIndex) { 66 | var msg = this.$.list.fetch(inIndex); 67 | this.doDeleteItem(msg); 68 | }, 69 | gotBookmarksData: function(inSender, inResponse, inRequest) { 70 | this.$.list.queryResponse(inResponse,inRequest); 71 | }, 72 | bookmarksQuery: function(inSender, inQuery) { 73 | return this.$.bookmarksService.call({query:inQuery}); 74 | }, 75 | refreshList: function(inSender, inWatch) { 76 | this.$.list.refresh(); 77 | } 78 | }); 79 | -------------------------------------------------------------------------------- /source/Browser.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "Browser", 17 | kind: enyo.VFlexBox, 18 | className: "basic-back", 19 | published: { 20 | url: "", 21 | searchPreferences: {}, 22 | defaultSearch: "" 23 | }, 24 | events: { 25 | onPageTitleChanged: "", 26 | onPageLoadStopped: "", 27 | onFileLoad: "", 28 | onAddBookmark: "", 29 | onAddToLauncher: "", 30 | onShareLink: "", 31 | onOpenBookmarks: "", 32 | onPrint: "", 33 | onUrlRedirected: "", 34 | // called when user wants to leave the browser 35 | onClose: "" 36 | }, 37 | components: [ 38 | {name: "launchApplicationService", kind: enyo.PalmService, service: enyo.palmServices.application, method: "open"}, 39 | {name: "importWallpaperService", kind: enyo.PalmService, service: enyo.palmServices.system, method: "wallpaper/importWallpaper", onSuccess: "importedWallpaper", onFailure: "wallpaperError"}, 40 | {name: "setWallpaperService", kind: enyo.PalmService, service: enyo.palmServices.system, method: "setPreferences", onFailure: "wallpaperError"}, 41 | {name: "actionbar", kind: "ActionBar", 42 | onBack: "goBack", 43 | onForward: "goForward", 44 | onLoad: "goClick", 45 | onStopLoad: "stopClick", 46 | onRefresh: "reloadClick", 47 | onAddBookmark: "doAddBookmark", 48 | onAddToLauncher: "doAddToLauncher", 49 | onShareLink: "doShareLink", 50 | onOpenBookmarks: "doOpenBookmarks", 51 | onNewCard: "openNewCard" 52 | }, 53 | {name: "view", kind: "WebView", flex: 1, height: "100%", 54 | onMousehold: "openContextMenu", 55 | onPageTitleChanged: "pageTitleChanged", 56 | onUrlRedirected: "doUrlRedirected", 57 | onLoadStarted: "loadStarted", 58 | onLoadProgress: "loadProgress", 59 | onLoadStopped: "loadStopped", 60 | onLoadComplete: "loadCompleted", 61 | onFileLoad: "doFileLoad", 62 | onError: "browserError", 63 | onSingleTap: "browserTap", 64 | onAlertDialog: "showAlertDialog", 65 | onConfirmDialog: "showConfirmDialog", 66 | onPromptDialog: "showPromptDialog", 67 | onSSLConfirmDialog: "showSSLConfirmDialog", 68 | onUserPasswordDialog: "showUserPasswordDialog", 69 | onNewPage: "openNewCardWithIdentifier", 70 | onPrint: "doPrint", 71 | minFontSize: 2, 72 | }, 73 | {kind: "FindBar", showing: false, onFind: "find", onGoToPrevious: "goToPrevious", onGoToNext: "goToNext"}, 74 | {name: "context", kind: "BrowserContextMenu", onItemClick: "contextItemClick"}, 75 | {name: "dialog", kind: "VerticalAcceptCancelPopup", cancelCaption: "", components: [ 76 | {name: "dialogTitle", className: "enyo-dialog-prompt-title"}, 77 | {name: "dialogMessage", className: "browser-dialog-body enyo-text-body "} 78 | ]}, 79 | {name: "alertDialog", kind: "AcceptCancelPopup", cancelCaption: "", onResponse: "sendDialogResponse", components: [ 80 | {name: "alertMessage", className: "browser-dialog-body enyo-text-body "} 81 | ]}, 82 | {name: "confirmDialog", kind: "VerticalAcceptCancelPopup", onResponse: "sendDialogResponse", components: [ 83 | {name: "confirmMessage", className: "browser-dialog-body enyo-text-body "} 84 | ]}, 85 | {name: "promptDialog", kind: "AcceptCancelPopup", cancelCaption: "", onResponse: "promptResponse", onClose: "closePrompt", components: [ 86 | {name: "promptMessage", className: "browser-dialog-body enyo-text-body "}, 87 | {name: "promptInput", kind: "Input", spellcheck: false, autocorrect: false, autoCapitalize: "lowercase"} 88 | ]}, 89 | {name: "shareLinkDialog", kind: "ShareLinkDialog"}, 90 | {name: "loginDialog", kind: "AcceptCancelPopup", onResponse: "loginResponse", onClose: "closeLogin", components: [ 91 | {name: "loginMessage", className: "browser-dialog-body enyo-text-body "}, 92 | {name: "userInput", kind: "Input", spellcheck: false, autocorrect: false, autoCapitalize: "lowercase", hint: $L("Username...")}, 93 | {name: "passwordInput", kind: "PasswordInput", hint: $L("Password...")} 94 | ]}, 95 | {name: "sslDialog", kind: "Popup", onClose: "sslConfirmResponse", components: [ 96 | {name: "sslConfirmMessage", className: "browser-dialog-body enyo-text-body "}, 97 | {kind: enyo.HFlexBox, components: [ 98 | {kind: "Button", name: "viewCertButton", flex: 1, caption: $L("View Certificate"), className: "enyo-button-dark", onclick: "viewSSLCertificate"}, 99 | {kind: "Button", flex: 1, caption: $L("Trust Always"), response: "1", className: "enyo-button-dark", onclick: "closeSSLConfirmBox"}, 100 | {kind: "Button", flex: 1, caption: $L("Trust Once"), response: "2", className: "enyo-button-dark", onclick: "closeSSLConfirmBox"}, 101 | {kind: "Button", flex: 1, caption: $L("Don't Trust"), response: "0", className: "enyo-button-dark", onclick: "closeSSLConfirmBox"} 102 | ]} 103 | ]}, 104 | {name: "sslCertDialog", kind: "CertificateDialog", onCertLoad: "enableViewSSLCertificate", onClose: "closeSSLCertificate"} 105 | ], 106 | WebKitErrors: { 107 | ERR_SYS_FILE_DOESNT_EXIST: 14, 108 | ERR_WK_FLOADER_CANCELLED: 1000, 109 | ERR_WK_NOINTERNET:1005, 110 | ERR_CURL_FAILURE: 2000, 111 | ERR_CURL_COULDNT_RESOLVE_HOST: 2006, 112 | ERR_CURL_SSL_CACERT: 2060 113 | }, 114 | create: function() { 115 | this.inherited(arguments); 116 | this.$.context.setView(this.$.view); 117 | this.urlChanged(); 118 | this.searchPreferencesChanged(); 119 | this.defaultSearchChanged(); 120 | if (window.PalmSystem) { 121 | this.$.view.setIdentifier(enyo.windowParams.webviewId); 122 | } 123 | }, 124 | resize: function() { 125 | this.$.actionbar.resize(); 126 | this.$.view.resize(); 127 | }, 128 | showingChanged: function() { 129 | this.inherited(arguments); 130 | if (!this.showing) { 131 | this.$.actionbar.forceBlur(); 132 | } 133 | }, 134 | //* @public 135 | printFrame: function(inJobID, inPrintParams) { 136 | this.viewCall("printFrame", ["", inJobID, inPrintParams.width, inPrintParams.height, inPrintParams.pixelUnits, false, inPrintParams.renderInReverseOrder]); 137 | }, 138 | showFind: function() { 139 | this.$.findBar.show(); 140 | }, 141 | //* @protected 142 | find: function(inSender, inString) { 143 | this.log(inString); 144 | this.$.view.callBrowserAdapter("findInPage", [inString]); 145 | }, 146 | goToPrevious: function() { 147 | }, 148 | goToNext: function() { 149 | }, 150 | setEnableJavascript: function(inEnable) { 151 | this.viewCall("setEnableJavascript", [inEnable]); 152 | }, 153 | setBlockPopups: function(inBlock) { 154 | this.viewCall("setBlockPopups", [inBlock]); 155 | }, 156 | setAcceptCookies: function(inAccept) { 157 | this.viewCall("setAcceptCookies", [inAccept]); 158 | }, 159 | clearHistory: function() { 160 | this.viewCall("clearHistory"); 161 | }, 162 | clearCookies: function() { 163 | new PalmServiceBridge().call('palm://com.palm.browserServer/clearCookies', '{}'); 164 | }, 165 | clearCache: function() { 166 | new PalmServiceBridge().call('palm://com.palm.browserServer/clearCache', '{}'); 167 | }, 168 | isLoading: function() { 169 | return this.$.actionbar.getProgress() != 0; 170 | }, 171 | viewCall: function(inMethod, inArgs) { 172 | if (window.PalmSystem) { 173 | var v = this.$.view; 174 | if (v[inMethod]) { 175 | v[inMethod].apply(v, inArgs); 176 | } else { 177 | v.callBrowserAdapter(inMethod, inArgs); 178 | } 179 | } 180 | }, 181 | urlChanged: function() { 182 | this.log(this.url); 183 | this.$.view.setUrl(this.url); 184 | this.$.actionbar.setLoading(true); 185 | this.$.actionbar.setUrl(this.url); 186 | }, 187 | searchPreferencesChanged: function() { 188 | this.$.actionbar.setSearchPreferences(this.searchPreferences); 189 | }, 190 | defaultSearchChanged: function() { 191 | this.$.actionbar.setDefaultSearch(this.defaultSearch); 192 | }, 193 | pageTitleChanged: function(inSender, inTitle, inUrl, inBack, inForward) { 194 | this.log(inUrl, inTitle, inBack, inForward); 195 | this.url = inUrl; 196 | this.title = inTitle || $L("Untitled"); 197 | if (!this.$.dialog.isOpen) { 198 | this.$.actionbar.setUrl(this.url); 199 | this.$.actionbar.setTitle(this.title); 200 | } 201 | this.gotHistoryState(inBack, inForward); 202 | this.doPageTitleChanged(this.title, this.url); 203 | }, 204 | gotHistoryState: function(inBack, inForward) { 205 | this.canGoBack = inBack; 206 | this.$.actionbar.setCanGoBack(inBack); 207 | this.$.actionbar.setCanGoForward(inForward); 208 | }, 209 | goClick: function(inSender, inUrl) { 210 | //this.$.popup.openAtTap({centerX: 100, centerY: 100}); 211 | this.setUrl(inUrl); 212 | //this.showHideTitle(true); 213 | }, 214 | browserTap: function(inSender, inPosition, inEvent, inTapInfo) { 215 | }, 216 | showPopup: function(inPopup) { 217 | var w = enyo.fetchControlSize(this).w; 218 | inPopup.applyStyle("max-width", w - 100); 219 | inPopup.openPopup(); 220 | }, 221 | showAlertDialog: function(inSender, inMsg) { 222 | this.$.alertDialog.validateComponents(); 223 | this.$.alertMessage.setContent(inMsg); 224 | this.showPopup(this.$.alertDialog); 225 | }, 226 | showConfirmDialog: function(inSender, inMsg) { 227 | this.$.confirmDialog.validateComponents(); 228 | this.$.confirmMessage.setContent(inMsg); 229 | this.showPopup(this.$.confirmDialog); 230 | }, 231 | showPromptDialog: function(inSender, inMsg, inDefaultValue) { 232 | this.$.promptDialog.validateComponents(); 233 | this.$.promptMessage.setContent(inMsg); 234 | this.$.promptInput.setValue(""); 235 | this.$.promptInput.setHint(inDefaultValue); 236 | this.showPopup(this.$.promptDialog); 237 | }, 238 | showShareLinkDialog: function(inUrl, inTitle) { 239 | this.$.shareLinkDialog.init(inUrl, inTitle); 240 | this.showPopup(this.$.shareLinkDialog); 241 | }, 242 | promptResponse: function(inAccept) { 243 | this.sendDialogResponse(this, inAccept, this.$.promptInput.getValue() || this.$.promptInput.getHint()); 244 | }, 245 | closePrompt: function() { 246 | this.$.promptInput.forceBlur(); 247 | }, 248 | showSSLConfirmDialog: function(inSender, inHost, inErrorCode, inCertFile) { 249 | this.$.sslDialog.validateComponents(); 250 | this.$.viewCertButton.setDisabled(true); 251 | this.$.sslCertDialog.setCertFile(inCertFile); 252 | var msg; 253 | if (inErrorCode == 0) { 254 | msg = $L("The security certificate #{websiteName} sent is expired. Connecting to this site might put your confidential information at risk."); 255 | } else if (inErrorCode >= 2 && inErrorCode < 5) { 256 | msg = $L("The website #{websiteName} didn't send a security certificate to identify itself. Connecting to this site might put your confidential information at risk."); 257 | } else if (inErrorCode >= 5 && inErrorCode < 10) { 258 | msg = $L("The security certificate #{websiteName} sent could not be read completely. Connecting to this site might put your confidential information at risk."); 259 | } else if (inErrorCode >= 10 && inErrorCode < 18) { 260 | msg = $L("The security certificate #{websiteName} sent has some invalid information. Connecting to this site might put your confidential information at risk."); 261 | } else if (inErrorCode >= 18 && inErrorCode < 24) { 262 | msg = $L("The security certificate #{websiteName} sent has questionable signatures. Connecting to this site might put your confidential information at risk."); 263 | } else if (inErrorCode >= 24 && inErrorCode < 30) { 264 | msg = $L("The security certificate #{websiteName} sent is invalid. Connecting to this site might put your confidential information at risk."); 265 | } else if (inErrorCode == 30 || inErrorCode == 31 || inErrorCode == 50) { 266 | msg = $L("The security certificate #{websiteName} sent has inconsistent information in it. Connecting to this site might put your confidential information at risk."); 267 | } 268 | if (msg) { 269 | var m = msg.replace("#{websiteName}", inHost); 270 | this.$.sslConfirmMessage.setContent(m); 271 | } 272 | this.$.sslDialog.response = "0"; 273 | this.$.sslDialog.openAtCenter(); 274 | }, 275 | closeSSLConfirmBox: function(inSender) { 276 | this.$.sslDialog.response = inSender.response; 277 | this.$.sslDialog.close(); 278 | }, 279 | sslConfirmResponse: function(inSender) { 280 | this.viewCall("sendDialogResponse", [inSender.response]); 281 | }, 282 | enableViewSSLCertificate: function() { 283 | this.$.viewCertButton.setDisabled(false); 284 | }, 285 | viewSSLCertificate: function(inSender) { 286 | this.$.sslCertDialog.validateComponents(); 287 | this.$.sslCertDialog.openAtCenter(); 288 | }, 289 | closeSSLCertificate: function(inSender) { 290 | this.$.sslCertDialog.close(); 291 | }, 292 | showUserPasswordDialog: function(inSender, inMsg) { 293 | this.$.loginDialog.validateComponents(); 294 | var msg = $L("The server {$serverName} requires a username and password"); 295 | msg = enyo.macroize(msg, {serverName: inMsg}); 296 | this.$.loginMessage.setContent(msg); 297 | this.showPopup(this.$.loginDialog); 298 | }, 299 | loginResponse: function(inSender, inAccept) { 300 | this.sendDialogResponse(this, inAccept, this.$.userInput.getValue(), this.$.passwordInput.getValue()); 301 | }, 302 | sendDialogResponse: function(inSender, inAccepted) { 303 | this.log(inAccepted); 304 | if (inAccepted) { 305 | this.viewCall("acceptDialog", [].slice.call(arguments, 2)); 306 | } else { 307 | this.viewCall("cancelDialog"); 308 | } 309 | }, 310 | closeLogin: function() { 311 | this.$.userInput.forceBlur(); 312 | this.$.passwordInput.forceBlur(); 313 | }, 314 | openContextMenu: function(inSender, inEvent, inTapInfo) { 315 | if (inTapInfo.isLink || inTapInfo.isImage) { 316 | this.$.context.openAtTap(inEvent, inTapInfo); 317 | return true; 318 | } 319 | }, 320 | contextItemClick: function(inSender, inValue, inTapInfo, inPosition) { 321 | if (this[inValue]) { 322 | this[inValue](inTapInfo, inPosition); 323 | } 324 | }, 325 | newCardClick: function(inTapInfo) { 326 | enyo.windows.openWindow("index.html", null, {url: inTapInfo.linkUrl}); 327 | }, 328 | openNewCard: function() { 329 | enyo.windows.openWindow("index.html", null, null); 330 | }, 331 | openNewCardWithIdentifier: function(inSender, inIdentifier) { 332 | enyo.windows.openWindow("index.html", null, {webviewId: inIdentifier}); 333 | }, 334 | copyLinkClick: function(inTapInfo) { 335 | enyo.dom.setClipboard(inTapInfo.linkUrl); 336 | var params = enyo.json.stringify({dontLaunch:true}); 337 | enyo.windows.addBannerMessage($L("Link Copied to clipboard"), params); 338 | }, 339 | //handler for the context menu shareLinkClick in BrowserContextMenu.js. 340 | //TODO: refactor these for a clearer abstraction. So you don't have to hunt 341 | //to see where it is being called. 342 | shareLinkClick: function(inTapInfo) { 343 | this.shareLink(inTapInfo.linkUrl, inTapInfo.linkText || inTapInfo.linkUrl); 344 | }, 345 | shareLink: function(inUrl, inTitle) { 346 | this.showShareLinkDialog(inUrl, inTitle); 347 | }, 348 | copyToPhotosClick: function(inTapInfo, inPosition) { 349 | this.viewCall("saveImageAtPoint", [inPosition.left, inPosition.top, "/media/internal", 350 | enyo.hitch(this, "finishCopyToPhotos", inTapInfo)]); 351 | }, 352 | shareImageClick: function(inTapInfo, inPosition) { 353 | this.viewCall("saveImageAtPoint", [inPosition.left, inPosition.top, "/tmp", 354 | enyo.hitch(this, "finishShareImage", inTapInfo)]); 355 | }, 356 | setWallpaperClick: function(inTapInfo, inPosition) { 357 | this.viewCall("saveImageAtPoint", [inPosition.left, inPosition.top, "/media/internal", 358 | enyo.hitch(this, "finishSetWallpaper", inTapInfo)]); 359 | }, 360 | openDialog: function(inTitle, inMessage) { 361 | this.$.dialog.validateComponents(); 362 | this.$.dialogTitle.setContent(inTitle); 363 | this.$.dialogMessage.setContent(inMessage); 364 | this.$.dialog.openPopup(); 365 | }, 366 | finishCopyToPhotos: function(inTapInfo, inSuccess, inPath) { 367 | var params = enyo.json.stringify({dontLaunch:true}); 368 | if (inSuccess) { 369 | enyo.windows.addBannerMessage($L("Image Saved to Photos"),params); 370 | } else { 371 | enyo.windows.addBannerMessage($L("Error Saving Image"),params); 372 | } 373 | }, 374 | finishShareImage: function(inTapInfo, inSuccess, inPath) { 375 | if (inSuccess) { 376 | var url = inTapInfo.imageUrl; 377 | var defaultTitle = url.indexOf("data:") >= 0 ? $L("Picture Link") : $L("Picture at ") + url; 378 | var title = inTapInfo.title || inTapInfo.altText || defaultTitle; 379 | var msg = $L("Here's a picture I think you'll like: {$title}"); 380 | msg = enyo.macroize(msg, {src: url, title: title}); 381 | var s = url.lastIndexOf("/") + 1; 382 | var params = { 383 | summary: $L("Check out this picture..."), 384 | text: msg, 385 | attachments: [{name: url.substring(s), path: inPath}] 386 | }; 387 | this.$.launchApplicationService.call({id: "com.palm.app.email", params: params}); 388 | } else { 389 | var p = enyo.json.stringify({dontLaunch:true}); 390 | enyo.windows.addBannerMessage($L("Error Sharing Image"),p); 391 | } 392 | }, 393 | finishSetWallpaper: function(inTapInfo, inSuccess, inPath) { 394 | if (inSuccess) { 395 | this.$.importWallpaperService.call({target: inPath, scale: 1.0}); 396 | } else { 397 | var p = enyo.json.stringify({dontLaunch:true}); 398 | enyo.windows.addBannerMessage($L("Error Setting Wallpaper"),p); 399 | } 400 | }, 401 | importedWallpaper: function(inSender, inResponse) { 402 | this.$.setWallpaperService.call({wallpaper: inResponse.wallpaper}); 403 | }, 404 | wallpaperError: function(inSender, inResponse) { 405 | this.openDialog($L("Error"), $L("Failed to set wallpaper")); 406 | }, 407 | goBack: function() { 408 | if (this.canGoBack) { 409 | this.$.view.callBrowserAdapter("goBack"); 410 | } else { 411 | this.doClose(); 412 | } 413 | }, 414 | goForward: function() { 415 | this.$.view.callBrowserAdapter("goForward"); 416 | }, 417 | reloadClick: function() { 418 | if(this.isErrorLoadFailed === true) { 419 | this.isErrorLoadFailed = false; 420 | this.setUrl(this.failedLoadUrl); 421 | } 422 | else 423 | this.$.view.callBrowserAdapter("reloadPage"); 424 | //this.$.view.setZoom(this.$.view.getZoom() + 0.1); 425 | }, 426 | stopClick: function() { 427 | this.log(); 428 | this.$.view.callBrowserAdapter("stopLoad"); 429 | this.$.actionbar.setProgress(0); 430 | }, 431 | loadStarted: function() { 432 | this._lastProgress = 0; 433 | if (this._timeoutHandle != null) { 434 | clearTimeout(this._timeoutHandle); 435 | this._timeoutHandle = null; 436 | } 437 | this.isErrorLoadFailed = false; 438 | this.$.actionbar.setLoading(true); 439 | }, 440 | loadProgress: function(inSender, inProgress) { 441 | if (this._lastProgress < inProgress) { 442 | this.$.actionbar.setProgress(inProgress); 443 | this._lastProgress = inProgress; 444 | 445 | if (inProgress === 100) { 446 | this._timeoutHandle = setTimeout(enyo.hitch(this, "clearProgress"), 1000); 447 | } 448 | } 449 | }, 450 | loadStopped: function() { 451 | this.doPageLoadStopped(this.url); 452 | }, 453 | loadCompleted: function() { 454 | // empty 455 | }, 456 | clearProgress: function() { 457 | this.$.actionbar.setProgress(0); 458 | this.$.actionbar.setLoading(false); 459 | this._timeoutHandle = null; 460 | }, 461 | browserError: function(inSender, inErrorCode, inMsg) { 462 | 463 | switch(inErrorCode){ 464 | case this.WebKitErrors.ERR_SYS_FILE_DOESNT_EXIST: 465 | this.openDialog($L("Error"), $L('File does not exist.')); 466 | break; 467 | case this.WebKitErrors.ERR_CURL_COULDNT_RESOLVE_HOST: 468 | this.isErrorLoadFailed = true; 469 | this.failedLoadUrl = this.url; 470 | this.openDialog($L("Error"), $L('Unable to resolve host.')); 471 | break; 472 | case this.WebKitErrors.ERR_WK_NOINTERNET: 473 | this.isErrorLoadFailed = true; 474 | this.failedLoadUrl = this.url; 475 | this.openDialog($L("Error"), $L('No Internet Connection.')); 476 | break; 477 | case this.WebKitErrors.ERR_WK_FLOADER_CANCELLED: 478 | break; 479 | default: 480 | this.openDialog($L("Error"), $L("Unable to Load Page")); 481 | this.log("Unknown Handled Error: " + inMsg); 482 | break; 483 | 484 | } 485 | this.clearProgress(); 486 | }, 487 | createPageImages: function() { 488 | var t = (new Date()).getTime(); 489 | var w = 90; 490 | var h = 120; 491 | var p = "/var/luna/data/browser/icons/"; 492 | var thumbnail = p + "thumbnail-" + t + ".png"; 493 | var icon32 = p + "icon32-" + t + ".png"; 494 | var icon64 = p + "icon64-" + t + ".png"; 495 | this.viewCall("saveViewToFile", [thumbnail, 0, 0, w, h]); 496 | this.viewCall("generateIconFromFile", [thumbnail, icon64, 0, 0, w, h]); 497 | //FIXME: resize the icon or thumbnail? 498 | this.viewCall("resizeImage", [icon64, icon32, 32, 32]); 499 | return {thumbnailFile: thumbnail, iconFile32: icon32, iconFile64: icon64}; 500 | return {}; 501 | }, 502 | deleteImages: function(inImages) { 503 | for (var i=0, image; image=inImages[i]; i++) { 504 | this.log(image); 505 | this.viewCall("deleteImage", [image]); 506 | } 507 | } 508 | }) 509 | -------------------------------------------------------------------------------- /source/BrowserApp.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "enyo.BrowserApp", 17 | kind: enyo.VFlexBox, 18 | className: "basic-back", 19 | published: { 20 | url: "", 21 | systemPreferences: {}, 22 | browserPreferences: {}, 23 | searchPreferences: [], 24 | defaultSearch: "" 25 | }, 26 | components: [ 27 | {kind: "ApplicationEvents", onWindowActivated: "windowActivatedHandler", onWindowDeactivated: "windowDeactivatedHandler", onApplicationRelaunch: "applicationRelaunchHandler"}, 28 | {name: "downloadService", kind: enyo.PalmService, service: "palm://com.palm.downloadmanager/", method: "download", onSuccess: "gotDownloadStatus", onFailure: "gotDownloadFailure", subscribe: true, resubscribe: true}, 29 | {name: "cancelDownloadService", kind: enyo.PalmService, service: "palm://com.palm.downloadmanager/", method: "cancelDownload"}, 30 | {name: "downloadHistoryService", kind: enyo.PalmService, service: "palm://com.palm.downloadmanager/", method: "getAllHistory", onSuccess: "gotDownloadHistory"}, 31 | {name: "clearDownloadsService", kind: enyo.PalmService, service: "palm://com.palm.downloadmanager/", method: "clearHistory"}, 32 | {name: "bookmarksService", kind: "DbService", dbKind: "com.palm.browserbookmarks:1", reCallWatches: true}, 33 | {name: "historyService", kind: "DbService", dbKind: "com.palm.browserhistory:1", reCallWatches: true}, 34 | {name: "systemPrefsService", kind: "SystemService"}, 35 | {name: "browserPrefsService", kind: "DbService", dbKind: "com.palm.browserpreferences:1", reCallWatches: true}, 36 | {name: "universalSearchService", kind: enyo.PalmService, service: "palm://com.palm.universalsearch/", method: "getUniversalSearchList", onSuccess: "gotUniversalSearchList", subscribe: true, resubscribe: true}, 37 | {name: "setSearchPreferenceService", kind: enyo.PalmService, service: "palm://com.palm.universalsearch/", method: "setSearchPreference"}, 38 | {name: "clearOptionalSearchListService", kind: enyo.PalmService, service: "palm://com.palm.universalsearch/", method: "clearOptionalSearchList"}, 39 | {name: "stService", kind: "PalmService", service: "palm://com.palm.stservice/", timeout: 500}, 40 | {name: "launchApplicationService", kind: "PalmService", service: enyo.palmServices.application, method: "open", onFailure: "gotResourceError"}, 41 | {name: "addToLauncherService", kind: "PalmService", service: enyo.palmServices.application, method: "addLaunchPoint"}, 42 | {name: "resourceInfoService", kind: "PalmService", service: enyo.palmServices.application, method: "getResourceInfo", onSuccess: "gotResourceInfo", onFailure: "gotResourceError"}, 43 | {kind: enyo.Pane, flex: 1, height: "100%", lazyViews: [ 44 | {name: "startPage", kind: "StartPage", 45 | onUrlChange: "processUrlChange", 46 | onOpenBookmarks: "bookmarksClick", 47 | onNewCard: "newCardClick", 48 | onShow: "startPageShown" 49 | }, 50 | {name: "browser", kind: "Browser", 51 | onPageTitleChanged: "pageTitleChanged", 52 | onPageLoadStopped: "pageLoadStopped", 53 | onFileLoad: "handleResource", 54 | onAddBookmark: "addBookmark", 55 | onAddToLauncher: "showAddtoLauncherDialog", 56 | onShareLink: "shareClick", 57 | onOpenBookmarks: "bookmarksClick", 58 | onPrint: "printClick", 59 | onUrlRedirected: "openResource", 60 | onClose: "browserClosed", 61 | onShow: "browserShown", 62 | onHide: "browserHidden" 63 | }, 64 | {name: "preferences", kind: "Preferences", 65 | onPreferenceChanged: "preferenceChanged", 66 | onShow: "preferencesShown", 67 | onClose: "backHandler" 68 | } 69 | ]}, 70 | {kind: enyo.Toaster, flyInFrom: "right", style: "top: 0px; bottom: 0px", lazy: false, components: [ 71 | {className: "enyo-sliding-view-shadow"}, 72 | {kind: enyo.VFlexBox, flex: 1, width: "320px", height: "100%", components: [ 73 | {kind: "Header", className: "enyo-header-dark", components: [ 74 | {kind: "RadioGroup", flex: 1, components: [ 75 | {kind: "RadioButton", value: "bookmarks", className: "enyo-radiobutton-dark", icon: "images/chrome/toaster-icon-bookmarks.png", onclick: "showBookmarks"}, 76 | {kind: "RadioButton", value: "history", className: "enyo-radiobutton-dark", icon: "images/chrome/toaster-icon-history.png", onclick: "showHistory"}, 77 | {kind: "RadioButton", value: "downloads", className: "enyo-radiobutton-dark", icon: "images/chrome/toaster-icon-downloads.png", onclick: "showDownloads"} 78 | ]} 79 | ]}, 80 | {name: "drawerPane", kind: "Pane", flex: 1, lazyViews: [ 81 | {name: "bookmarks", kind: "BookmarkList", 82 | onSelectItem: "selectItem", 83 | onEditItem: "showEditBookmarkDialog", 84 | onDeleteItem: "deleteBookmark", 85 | onAddBookmark: "addBookmark", 86 | onClose: "closeToaster" 87 | }, 88 | {name: "history", kind: "HistoryList", 89 | onSelectItem: "selectItem", 90 | onDeleteItem: "deleteHistory", 91 | onClose: "closeToaster", 92 | }, 93 | {name: "downloads", kind: "DownloadList", 94 | onOpenItem: "openDownloadedFile", 95 | onCancelItem: "cancelDownload", 96 | onRetryItem: "retryDownload", 97 | onDeleteItem: "deleteDownload", 98 | onClearAll: "showClearDownloadsDialog", 99 | onClose: "closeToaster", 100 | onShow: "downloadListShown" 101 | } 102 | ]} 103 | ]} 104 | ]}, 105 | {kind: "BookmarkDialog", onAccept: "bookmarkAccept", onBeforeOpen: "setupBookmarkDialog"}, 106 | {name: "downloadError", kind: "BrowserPrompt", caption: $L("Cannot open MIME type"), message: ""}, 107 | {name: "clearDownloadsDialog", kind: "BrowserPrompt", 108 | caption: $L("Are you sure you want to clear the Downloads list?"), 109 | message: $L("This will not delete the file(s). Plug your device into a computer and use USB mode."), 110 | acceptCaption: $L("Clear List"), 111 | onAccept: "clearDownloads" 112 | }, 113 | {kind: "PrintDialog", lazy: false, duplexOption: true, colorOption: true, onRenderDocument: "renderDocument", appName: "Browser"}, 114 | {kind: "AppMenu", onBeforeOpen: "toggleAppMenuItems", components: [ 115 | //{caption: $L("Find on Page"), onclick: "showFindOnPage"}, 116 | {name: "preferencesItem", caption: $L("Preferences"), onclick: "preferencesClick"}, 117 | {name: "printMenuItem", caption: $L("Print"), onclick: "printClick"}, 118 | {caption: $L("Help"), onclick: "helpClick"} 119 | ]} 120 | ], 121 | //* @protected 122 | constructor: function() { 123 | this.inherited(arguments); 124 | this.downloads = []; 125 | this.preferences = {}; 126 | }, 127 | create: function() { 128 | this.inherited(arguments); 129 | this.fetchInitialPreferences(); 130 | this.log(enyo.json.stringify(enyo.windowParams)); 131 | }, 132 | applicationRelaunchHandler: function(inSender) { 133 | var c = enyo.windows.getActiveWindow(); 134 | var params = enyo.windowParams; 135 | // squelch needless banner clicks 136 | if (params.dontLaunch) return true; 137 | if (params.sendDataToShare !== undefined) { 138 | this.$.stService.call({data: {target: c.enyo.$.browserApp.getUrl(), type: "rawdata", mimetype: "text/html"}}, {method: "shareData"}); 139 | return true; 140 | } else if (params.toasterOpen) { 141 | this.$.toaster.open(); 142 | this.$.radioGroup.setValue(params.toasterOpen); 143 | this.$.drawerPane.selectViewByPane(params.toasterOpen); 144 | } else { 145 | enyo.windows.openWindow("index.html", null, params); 146 | return true; 147 | } 148 | }, 149 | rendered: function() { 150 | this.inherited(arguments); 151 | this.log(); 152 | var p = window.PalmSystem ? enyo.windowParams : this.processQueryString(); 153 | var url = p.target || p.url; 154 | if (url) { 155 | this.setUrl(url); // this opens the browser view 156 | } else if (p.webviewId) { 157 | this.$.pane.selectViewByName("browser"); 158 | } else { 159 | this.$.pane.selectViewByName("startPage"); 160 | } 161 | this.showBookmarks(); 162 | //this.showAppMenu(); 163 | //this.resize(); 164 | }, 165 | processQueryString: function() { 166 | var q = location.search.slice(1), queryArgs = {}; 167 | if (q) { 168 | var args = q.split("&"); 169 | for (var i=0, a, nv; a=args[i]; i++) { 170 | var nv = args[i] = a.split("="); 171 | if (nv) { 172 | queryArgs[nv[0]] = unescape(nv[1]); 173 | } 174 | } 175 | } 176 | if (queryArgs.query) { 177 | queryArgs.url = "http://www.google.com/search?q=" + queryArgs.query; 178 | } 179 | return queryArgs; 180 | }, 181 | isBrowserShowing: function() { 182 | return this.$.pane.getViewName() === "browser"; 183 | }, 184 | isStartPageShowing: function() { 185 | return this.$.pane.getViewName() === "startPage"; 186 | }, 187 | isPreferencesShowing: function() { 188 | return this.$.pane.getViewName() === "preferences"; 189 | }, 190 | isDownloadListShowing: function() { 191 | return this.$.toaster.isOpen && this.$.drawerPane.getViewName() === "downloads"; 192 | }, 193 | isBrowserLoading: function() { 194 | if (this.$.browser) { 195 | return this.$.browser.isLoading(); 196 | } else { 197 | return false; 198 | } 199 | }, 200 | resizeHandler: function() { 201 | this.inherited(arguments); 202 | if (this.isBrowserShowing()) { 203 | this.$.browser.resize(); 204 | } else if (this.isStartPageShowing()) { 205 | this.$.startPage.resize(); 206 | } 207 | }, 208 | windowActivatedHandler: function() { 209 | //this.$.browser.hasKind(); 210 | if (this.isBrowserShowing()) { 211 | this.$.browser.viewCall("activate"); 212 | } 213 | this.refreshDownloads(); 214 | }, 215 | windowDeactivatedHandler: function() { 216 | if (this.isBrowserShowing()) { 217 | this.$.browser.viewCall("deactivate"); 218 | } 219 | }, 220 | refreshPanes: function() { 221 | this.inherited(arguments); 222 | var i = this.$.drawerPane.getViewByIndex(); 223 | this.$.drawerPane.selectViewByIndex(i); 224 | }, 225 | browserShown: function(inSender, inShowing, inRefresh) { 226 | enyo.keyboard.setResizesWindow(false); 227 | // FIXME: there's a transition skag. trying to eliminate. 228 | setTimeout(enyo.hitch(this, function() { 229 | this.$.browser.viewCall("activate"); 230 | if (inRefresh || !this.$.browser.getUrl()) { 231 | this.$.browser.setUrl(this.url); 232 | } 233 | }), 1); 234 | }, 235 | browserHidden: function() { 236 | enyo.keyboard.setResizesWindow(true); 237 | this.$.browser.viewCall("deactivate"); 238 | }, 239 | browserClosed: function() { 240 | this.gotoView("startPage"); 241 | }, 242 | downloadListShown: function(inSender) { 243 | this.$.downloads.setDownloads(this.downloads); 244 | }, 245 | preferencesShown: function(inSender) { 246 | this.$.preferences.updatePreferences(this.preferences); 247 | }, 248 | startPageShown: function() { 249 | this.$.startPage.setUrl(""); 250 | }, 251 | toggleAppMenuItems: function() { 252 | var browser = this.isBrowserShowing(); 253 | this.$.printMenuItem.setDisabled(!browser || this.isBrowserLoading()); 254 | this.$.preferencesItem.setDisabled(this.isPreferencesShowing()); 255 | }, 256 | applyPreference: function(inPreference, inValue) { 257 | this.log(inPreference, inValue); 258 | var preferenceMap = { 259 | enableJavascript: "setEnableJavascript", 260 | blockPopups: "setBlockPopups", 261 | acceptCookies: "setAcceptCookies", 262 | } 263 | this.$.pane.viewByName("browser"); 264 | var o = inPreference == "clearHistory" || inPreference == "clearBookmarks" ? this : this.$.browser; 265 | this.log(preferenceMap[inPreference] || inPreference); 266 | this.log(o); 267 | this.log(o[preferenceMap[inPreference] || inPreference]); 268 | if (o[preferenceMap[inPreference] || inPreference]) { 269 | this.log(preferenceMap[inPreference || inPreference], inValue); 270 | o[preferenceMap[inPreference] || inPreference](inValue); 271 | } 272 | }, 273 | systemPreferencesChanged: function() { 274 | for (var key in this.systemPreferences) { 275 | this.log(key, this.systemPreferences[key]); 276 | this.applyPreference(key, this.systemPreferences[key]); 277 | } 278 | this.$.pane.viewByName("preferences").setSystemPreferences(this.systemPreferences); 279 | }, 280 | browserPreferencesChanged: function() { 281 | for (var key in this.browserPreferences) { 282 | this.applyPreference(key, this.browserPreferences[key]); 283 | } 284 | this.$.pane.viewByName("preferences").setBrowserPreferences(this.browserPreferences); 285 | }, 286 | searchPreferencesChanged: function() { 287 | var views = ["browser", "startPage", "preferences"]; 288 | for (var i=0, v;v=views[i];i++) { 289 | this.$.pane.viewByName(v).setSearchPreferences(this.searchPreferences); 290 | } 291 | }, 292 | defaultSearchChanged: function() { 293 | this.log(this.defaultSearch); 294 | var views = ["browser", "startPage", "preferences"]; 295 | for (var i=0, v;v=views[i];i++) { 296 | this.$.pane.viewByName(v).setDefaultSearch(this.defaultSearch); 297 | } 298 | }, 299 | gotSystemPreferences: function(inSender, inResponse) { 300 | delete inResponse.returnValue; 301 | this.setSystemPreferences(inResponse); 302 | }, 303 | gotBrowserPreferences: function(inSender, inResponse) { 304 | for (var i=0,p;p=inResponse.results[i];i++) { 305 | this.browserPreferences[p.key] = p.value; 306 | } 307 | this.browserPreferencesChanged(); 308 | }, 309 | gotInitialBrowserPreferences: function(inSender, inResponse) { 310 | var kind = this.$.browserPrefsService.dbKind; 311 | var defaultBrowserPreferences = [ 312 | {_kind: kind, key: "blockPopups", value: true}, 313 | {_kind: kind, key: "acceptCookies", value: true}, 314 | {_kind: kind, key: "enableJavascript", value: true}, 315 | {_kind: kind, key: "rememberPasswords", value: true} 316 | ]; 317 | if (inResponse.results.length == 0) { 318 | this.$.browserPrefsService.call({objects: defaultBrowserPreferences}, {method: "put", onSuccess: "fetchPreferences"}); 319 | } else { 320 | this.fetchPreferences(); 321 | } 322 | }, 323 | fetchInitialPreferences: function() { 324 | this.$.browserPrefsService.call(undefined, {method: "find", onSuccess: "gotInitialBrowserPreferences"}); 325 | }, 326 | fetchPreferences: function(inSuccessCallback, inSubscribe) { 327 | var systemPreferences = [ 328 | "flashplugins", 329 | "click2play" 330 | ]; 331 | this.$.systemPrefsService.call({keys: systemPreferences}, {method: "getPreferences", onSuccess: "gotSystemPreferences", subscribe: true}); 332 | this.$.browserPrefsService.call(undefined, {method: "find", onSuccess: "gotBrowserPreferences", subscribe: true}); 333 | this.$.universalSearchService.call(); 334 | }, 335 | gotUniversalSearchList: function(inSender, inResponse) { 336 | this.searchPreferences = []; 337 | for (var i=0, s;s=inResponse.UniversalSearchList[i];i++) { 338 | if (s.type === "web" && s.enabled) { 339 | this.searchPreferences.push(s); 340 | } 341 | } 342 | this.searchPreferencesChanged(); 343 | this.setDefaultSearch(inResponse.defaultSearchEngine); 344 | }, 345 | preferenceChanged: function(inSender, inPreference, inType, inValue) { 346 | if (inType === "System") { 347 | this.systemPreferences[inPreference] = inValue; 348 | var p = {}; 349 | p[inPreference] = inValue; 350 | this.$.systemPrefsService.call(p, {method: "setPreferences"}); 351 | this.applyPreference(inPreference, inValue); 352 | } else if (inType === "Browser") { 353 | this.browserPreferences[inPreference] = inValue; 354 | this.$.browserPrefsService.call({props: {value: inValue}, query: {from: this.$.browserPrefsService.dbKind, where: [{prop:"key","op":"=","val":inPreference}]}}, {method: "merge"}); 355 | this.applyPreference(inPreference, inValue); 356 | } else if (inType === "Search") { 357 | this.$.setSearchPreferenceService.call({key: "defaultSearchEngine", value: inValue}); 358 | this.setDefaultSearch(inValue); 359 | } else { 360 | this.applyPreference(inPreference, inValue); 361 | } 362 | }, 363 | processUrlChange: function(inSender, inUrl) { 364 | this.setUrl(inUrl); 365 | }, 366 | urlChanged: function() { 367 | if (this.isBrowserShowing()) { 368 | this.browserShown(this, true, true); 369 | } else { 370 | this.gotoView("browser"); 371 | } 372 | }, 373 | selectItem: function(inSender, inItem) { 374 | this.setUrl(inItem.url); 375 | this.closeToaster(); 376 | }, 377 | gotoView: function(inName) { 378 | this.closeToaster(); 379 | this.$.pane.selectViewByName(inName); 380 | }, 381 | pageTitleChanged: function(inSender, inTitle, inUrl) { 382 | this.url = inUrl; 383 | this.title = inTitle; 384 | }, 385 | pageLoadStopped: function(inSender, inUrl) { 386 | this.updateHistory(this.title, this.url); 387 | }, 388 | handleResource: function(inSender, inMimeType, inUrl) { 389 | this.$.resourceInfoService.call({uri: inUrl, mime: inMimeType}); 390 | }, 391 | gotResourceInfo: function(inSender, inResponse, inRequest) { 392 | var uri = enyo.uri.parseUri(inResponse.uri); 393 | if (inResponse.appIdByExtension == enyo.fetchAppId()) { 394 | this.downloadResource(inResponse.uri, inRequest.params.mime); 395 | } else if (inResponse.canStream) { 396 | this.openResourceWithApp(inResponse.appIdByExtension, inResponse.uri, inRequest.params.mime); 397 | } else if (uri.scheme != "http" && uri.scheme != "https" && uri.scheme != "ftp") { 398 | this.openResource(inResponse.uri); 399 | } else { 400 | this.downloadResource(inResponse.uri, inRequest.params.mime); 401 | } 402 | }, 403 | gotResourceError: function(inSender, inResponse) { 404 | this.$.toaster.close(); 405 | this.$.downloadError.openPopup(); 406 | }, 407 | downloadResource: function(inUrl, inMime) { 408 | this.downloads.unshift({url: inUrl, mimetype: inMime}); 409 | this.$.downloadService.call({target: inUrl, mime: inMime}); 410 | this.showDownloads(); 411 | this.$.toaster.open(); 412 | }, 413 | openDownloadedFile: function(inSender, inIndex) { 414 | var d = this.downloads[inIndex]; 415 | if (d.completed && !d.aborted && !d.interrupted) { 416 | this.$.launchApplicationService.call({target: d.destPath + d.destFile}); 417 | } 418 | }, 419 | cancelDownload: function(inSender, inIndex) { 420 | var d = this.downloads[inIndex]; 421 | this.$.cancelDownloadService.call({ticket: d.ticket}); 422 | }, 423 | retryDownload: function(inSender, inIndex) { 424 | var u = this.downloads[inIndex].url; 425 | this.downloads[inIndex] = {url: u}; 426 | this.$.downloadService.call({target: u}); 427 | }, 428 | deleteDownload: function(inSender, inIndex) { 429 | }, 430 | showClearDownloadsDialog: function() { 431 | this.$.clearDownloadsDialog.openAtCenter(); 432 | }, 433 | clearDownloads: function() { 434 | var newDownloads = []; 435 | for (var i=0,d;d=this.downloads[i];i++) { 436 | if (!d.completed) { 437 | newDownloads.push(d); 438 | } 439 | } 440 | this.downloads = newDownloads; 441 | this.$.downloads.setDownloads(this.downloads); 442 | this.$.clearDownloadsService.call({owner: enyo.fetchAppId()}); 443 | }, 444 | findDownload: function(inObj, inSkipUrl) { 445 | for (var i=0, d; d=this.downloads[i]; i++) { 446 | if (d.ticket && d.ticket == inObj.ticket) { 447 | return d; 448 | } 449 | if (!inSkipUrl && d.url && d.url == inObj.url) { 450 | return d; 451 | } 452 | } 453 | }, 454 | gotDownloadStatus: function(inSender, inResponse) { 455 | var d = this.findDownload(inResponse); 456 | if (d) { 457 | // download manager returns the wrong mimetype 458 | inResponse.mimetype = d.mimetype; 459 | enyo.mixin(d, inResponse); 460 | if (!this.$.downloads.showing && d.completed) { 461 | var filename = d.destFile.replace(/%20/g, " "); 462 | var params = enyo.json.stringify({toasterOpen:"downloads"}); 463 | if (d.completionStatusCode == 200) { 464 | enyo.windows.addBannerMessage(filename + ' ' + $L("finished downloading"), params); 465 | } else { 466 | enyo.windows.addBannerMessage($L("There was a problem downloading ") + filename, params); 467 | } 468 | } 469 | if (this.$.downloads.showing) { 470 | this.$.downloads.setDownloads(this.downloads); 471 | } 472 | } 473 | }, 474 | gotDownloadFailure: function(inSender, inResponse) { 475 | this.log(inResponse); 476 | }, 477 | refreshDownloads: function() { 478 | this.$.downloadHistoryService.call({owner: enyo.fetchAppId()}); 479 | }, 480 | gotDownloadHistory: function(inSender, inResponse) { 481 | // inResponse is sorted by ticket in ascending order 482 | var iidx = this.downloads.length; 483 | for (var i=0,d;d=inResponse.items[i];i++) { 484 | if (d.state == "completed" && d.fileExistsOnFilesys) { 485 | iidx = this.insertIntoDownloads(enyo.json.parse(d.recordString), iidx); 486 | } 487 | } 488 | if (this.isDownloadListShowing()) { 489 | this.$.downloads.setDownloads(this.downloads); 490 | } 491 | }, 492 | insertIntoDownloads: function(inObj, inStartIndex) { 493 | for (var i=inStartIndex,d;d=this.downloads[i-1];i--) { 494 | if (d.ticket == inObj.ticket) { 495 | return i; 496 | } 497 | if (d.ticket > inObj.ticket) { 498 | this.downloads.splice(i, 0, inObj); 499 | return i; 500 | } 501 | } 502 | this.downloads.unshift(inObj); 503 | return 0; 504 | }, 505 | openResource: function(inSender, inUrl) { 506 | this.$.launchApplicationService.call({target: inUrl}); 507 | }, 508 | openResourceWithApp: function(inAppId, inUrl, inMime) { 509 | this.$.launchApplicationService.call({id: inAppId, params: {target: inUrl, mime: inMime}}); 510 | }, 511 | updateHistory: function(inTitle, inUrl) { 512 | this.$.historyService.call( 513 | {query: {where: [{prop:"url",op:"=",val:inUrl}]}}, 514 | {method: "delByQuery"}); 515 | var history = { 516 | _kind: this.$.historyService.dbKind, 517 | url: inUrl, 518 | title: inTitle, 519 | date: (new Date()).getTime() 520 | } 521 | this.$.historyService.call({objects: [history]}, {method: "put"}); 522 | }, 523 | deleteHistory: function(inSender, inHistory) { 524 | this.$.historyService.call({ids: [inHistory._id]}, {method: "del"}); 525 | }, 526 | clearHistory: function() { 527 | this.$.historyService.call(undefined, {method: "delByQuery"}); 528 | if (this.$.browser) { 529 | this.$.browser.clearHistory(); 530 | } 531 | // remove when open search is redesigned - clearing history 532 | // also clears user added search engines 533 | this.$.clearOptionalSearchListService.call(); 534 | }, 535 | showFindOnPage: function() { 536 | if (this.isBrowserShowing()) { 537 | this.$.browser.showFind(); 538 | } 539 | }, 540 | printClick: function() { 541 | this.$.printDialog.openAtCenter(); 542 | }, 543 | renderDocument: function(inSender, inJobID, inPrintParams) { 544 | if (this.isBrowserShowing()) { 545 | this.$.browser.printFrame(inJobID, inPrintParams); 546 | } 547 | }, 548 | setupBookmarkDialog: function() { 549 | }, 550 | showAddtoLauncherDialog: function() { 551 | this.$.bookmarkDialog.setTitle(this.$.browser.title); 552 | this.$.bookmarkDialog.setUrl(this.$.browser.url); 553 | this.$.bookmarkDialog.setIcons(this.$.browser.createPageImages()); 554 | this.$.bookmarkDialog.setAcceptCaption($L("Add to Launcher")); 555 | this.$.bookmarkDialog.acceptAction = "addToLauncher"; 556 | this.$.bookmarkDialog.openAtCenter(); 557 | }, 558 | addToLauncher: function(inTitle, inUrl, inIcons, inId) { 559 | this.$.addToLauncherService.call({id: enyo.fetchAppId(), icon: inIcons.iconFile64, title: inTitle, params: {url: inUrl}}); 560 | }, 561 | showEditBookmarkDialog: function(inSender, inBookmark) { 562 | this.$.bookmarkDialog.setTitle(inBookmark.title); 563 | this.$.bookmarkDialog.setUrl(inBookmark.url); 564 | this.$.bookmarkDialog.setIcons({thumbnailFile: inBookmark.thumbnailFile, iconFile32: inBookmark.iconFile32, iconFile64: inBookmark.iconFile64}); 565 | this.$.bookmarkDialog.setId(inBookmark._id); 566 | this.$.bookmarkDialog.setAcceptCaption($L("Save")); 567 | this.$.bookmarkDialog.acceptAction = "editBookmark"; 568 | this.$.bookmarkDialog.openAtCenter(); 569 | }, 570 | bookmarkAccept: function(inSender, inTitle, inUrl, inIcons, inId) { 571 | var a = inSender.acceptAction; 572 | if (this[a]) { 573 | this[a](inTitle, inUrl, inIcons, inId); 574 | } 575 | }, 576 | addBookmark: function() { 577 | var date = (new Date()).getTime(); 578 | var b = { 579 | _kind: this.$.bookmarksService.dbKind, 580 | title: this.$.browser.title, 581 | url: this.$.browser.url, 582 | date: date, 583 | lastVisited: date, 584 | defaultEntry: false, 585 | visitCount: 0, 586 | idx: null 587 | }; 588 | enyo.mixin(b, this.$.browser.createPageImages()); 589 | this.$.bookmarksService.call({objects: [b]}, {method: "put"}); 590 | }, 591 | editBookmark: function(inTitle, inUrl, inIcons, inId) { 592 | var date = (new Date()).getTime(); 593 | var b = { 594 | _id: inId, 595 | title: inTitle, 596 | url: inUrl, 597 | date: date, 598 | }; 599 | enyo.mixin(b, inIcons); 600 | this.$.bookmarksService.call({objects: [b]}, {method: "merge"}); 601 | }, 602 | deleteBookmark: function(inSender, inBookmark) { 603 | this.$.bookmarksService.call({ids: [inBookmark._id]}, {method: "del"}); 604 | }, 605 | clearBookmarks: function() { 606 | this.$.bookmarksService.call(undefined,{method:"delByQuery"}); 607 | }, 608 | newCardClick: function() { 609 | enyo.windows.openWindow("index.html"); 610 | }, 611 | shareClick: function() { 612 | this.$.browser.shareLink(this.url, this.title); 613 | }, 614 | bookmarksClick: function() { 615 | this.$.toaster.open(); 616 | this.$.drawerPane.selectView(this.$.drawerPane.getView()); 617 | }, 618 | preferencesClick: function() { 619 | this.gotoView("preferences"); 620 | }, 621 | helpClick: function() { 622 | this.$.launchApplicationService.call({params: {target: "http://help.palm.com/web/index.html"}, id: "com.palm.app.help"}); 623 | }, 624 | showBookmarks: function() { 625 | this.$.radioGroup.setValue("bookmarks"); 626 | this.$.drawerPane.selectViewByName("bookmarks"); 627 | }, 628 | showHistory: function() { 629 | this.$.radioGroup.setValue("history"); 630 | this.$.drawerPane.selectViewByName("history"); 631 | }, 632 | showDownloads: function() { 633 | this.$.radioGroup.setValue("downloads"); 634 | this.$.drawerPane.selectViewByName("downloads"); 635 | }, 636 | closeToaster: function() { 637 | this.$.toaster.close(); 638 | }, 639 | backHandler: function(inSender, e) { 640 | var n = this.$.pane.getViewName(); 641 | switch (n) { 642 | case "browser": 643 | this.$.browser.goBack(); 644 | e.preventDefault(); 645 | break; 646 | case "startPage": 647 | break; 648 | default: 649 | this.$.pane.back(e); 650 | } 651 | } 652 | }); 653 | -------------------------------------------------------------------------------- /source/BrowserContextMenu.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "BrowserContextMenu", 17 | kind: "PopupSelect", 18 | published: { 19 | view: "" 20 | }, 21 | events: { 22 | onItemClick: "" 23 | }, 24 | tapInfo: {link: true, image: true}, 25 | linkItems: [ 26 | {caption: $L("Open In New Card"), value:"newCardClick"}, 27 | {caption: $L("Share Link"), value:"shareLinkClick"}, 28 | {caption: $L("Copy URL"), value:"copyLinkClick"} 29 | ], 30 | imageItems: [ 31 | {caption: $L("Copy To Photos"), value: "copyToPhotosClick"}, 32 | {caption: $L("Share Image"), value: "shareImageClick"}, 33 | {caption: $L("Set Wallpaper"), value: "setWallpaperClick"} 34 | ], 35 | openAtTap: function(inEvent, inTapInfo) { 36 | this.tapPosition = {left: inEvent.pageX, top: inEvent.pageY}; 37 | this.tapInfo = inTapInfo; 38 | if (!this.view) { 39 | return; 40 | } 41 | var items = this.makeItems(); 42 | if (items) { 43 | this.setItems(items); 44 | this.openNear(this.tapPosition); 45 | } 46 | }, 47 | makeItems: function() { 48 | var items; 49 | if (this.tapInfo.isLink) { 50 | var uri = enyo.uri.parseUri(this.tapInfo.linkUrl); 51 | if (uri.scheme && enyo.uri.isValidScheme(uri)) { 52 | items = [].concat(this.linkItems); 53 | } 54 | } 55 | if (this.tapInfo.isImage) { 56 | items = (items || []).concat(this.imageItems); 57 | } 58 | return items; 59 | }, 60 | menuItemClick: function(inSender) { 61 | this.doItemClick(inSender.getValue(), this.tapInfo, this.tapPosition); 62 | this.close(); 63 | } 64 | }); 65 | -------------------------------------------------------------------------------- /source/BrowserPrompt.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "BrowserPrompt", 17 | kind: "VerticalAcceptCancelPopup", 18 | published: { 19 | message: "" 20 | }, 21 | components: [ 22 | {name: "message", className: "browser-dialog-body enyo-text-body"} 23 | ], 24 | componentsReady: function() { 25 | this.inherited(arguments); 26 | this.messageChanged(); 27 | }, 28 | messageChanged: function() { 29 | this.$.message.setShowing(this.message); 30 | this.$.message.setContent(this.message); 31 | } 32 | }); 33 | 34 | enyo.kind({ 35 | name: "BrowserPreferencePrompt", 36 | kind: "BrowserPrompt", 37 | chrome: [ 38 | {className: "enyo-modaldialog-container preference-prompt", components: [ 39 | {name: "modalDialogTitle", className: "enyo-modaldialog-title"}, 40 | {name: "client"}, 41 | {name: "accept", kind: "NoFocusButton", flex: 1, onclick: "acceptClick", className: "enyo-button-negative"}, 42 | {name: "cancel", kind: "NoFocusButton", flex: 1, onclick: "cancelClick"} 43 | ]} 44 | ] 45 | }); -------------------------------------------------------------------------------- /source/CertificateDetail.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "CertificateDetail", 17 | kind: enyo.VFlexBox, 18 | published: { 19 | cert: "" 20 | }, 21 | components: [ 22 | {name: "commonName"}, 23 | {kind:"RowGroup", caption:$L("Issued By"), components:[ 24 | {name:"displayIssuerCommonName"} 25 | ]}, 26 | {kind:"RowGroup", caption:$L("Start Date"), components:[ 27 | {name:"startDate"} 28 | ]}, 29 | {kind:"RowGroup", caption:$L("Expiration Date"), components:[ 30 | {name:"expirationDate"} 31 | ]}, 32 | {kind: "Divider", caption: $L("Subject information")}, 33 | {kind:"RowGroup", name:"subjectAltNameGroup", caption:$L("Subject Alt Name"), components:[ 34 | {name:"subjectAltName"} 35 | ]}, 36 | {kind:"RowGroup", name:"subjectCountryGroup", caption:$L("Country"), components:[ 37 | {name:"subjectCountry"} 38 | ]}, 39 | {kind:"RowGroup", name:"subjectStateGroup", caption:$L("State/Province"), components:[ 40 | {name:"subjectState"} 41 | ]}, 42 | {kind:"RowGroup", name:"subjectLocationGroup", caption:$L("Location"), components:[ 43 | {name:"subjectLocation"} 44 | ]}, 45 | {kind:"RowGroup", name:"subjectOrganizationGroup", caption:$L("Organization"), components:[ 46 | {name:"subjectOrganization"} 47 | ]}, 48 | {kind:"RowGroup", name:"subjectCommonNameGroup", caption:$L("Common Name"), components:[ 49 | {name:"subjectCommonName"} 50 | ]}, 51 | {kind: "Divider", caption: $L("Issuer Information")}, 52 | {kind:"RowGroup", name:"issuerCountryGroup", caption:$L("Country"), components:[ 53 | {name:"issuerCountry"} 54 | ]}, 55 | {kind:"RowGroup", name:"issuerStateGroup", caption:$L("State/Province"), components:[ 56 | {name:"issuerState"} 57 | ]}, 58 | {kind:"RowGroup", name:"issuerLocationGroup", caption:$L("Location"), components:[ 59 | {name:"issuerLocation"} 60 | ]}, 61 | {kind:"RowGroup", name:"issuerOrganizationGroup", caption:$L("Organization"), components:[ 62 | {name:"issuerOrganization"} 63 | ]}, 64 | {kind:"RowGroup", name:"issuerCommonNameGroup", caption:$L("Common Name"), components:[ 65 | {name:"issuerCommonName"} 66 | ]}, 67 | {kind:"RowGroup", caption:$L("Serial Number"), components:[ 68 | {name:"serialNumber"} 69 | ]}, 70 | {kind:"RowGroup", caption:$L("Version"), components:[ 71 | {name:"version"} 72 | ]}, 73 | {kind:"RowGroup", caption:$L("Signature Algorithm"), components:[ 74 | {name:"signatureAlgorithm"} 75 | ]}, 76 | // {kind:"RowGroup", caption:$L("Signature"), components:[ 77 | // {name:"signature", kind: "RichText", richContent: false} 78 | // ]}, 79 | {kind:"RowGroup", caption:$L("Public Key Algorithm"), components:[ 80 | {name:"publicKeyAlgorithm"} 81 | ]} 82 | // {kind:"RowGroup", caption:$L("Public Key"), components:[ 83 | // {name:"publicKey", kind: "RichText", richContent: false} 84 | // ]} 85 | ], 86 | certChanged: function() { 87 | var alternate_name=""; 88 | this.cert.displayCommonName = ""; 89 | this.cert.displayIssuerCommonName = ""; 90 | 91 | if(this.cert.subject) { 92 | this.cert.displayCommonName = this.cert.subject.commonname ? this.cert.subject.commonname : this.cert.subject.organization; 93 | } 94 | if(this.cert.issuer) { 95 | this.cert.displayIssuerCommonName = this.cert.issuer.commonname ? this.cert.issuer.commonname : this.cert.issuer.organization; 96 | } 97 | 98 | if(this.cert.displayCommonName) { 99 | this.$.commonName.setContent(enyo.string.escapeHtml(this.cert.displayCommonName)); 100 | } 101 | else { 102 | for(var j in this.cert.subject.altname){ 103 | alternate_name += this.cert.subject.altname[j] + ' '; 104 | } 105 | this.$.certName.setContent(enyo.string.escapeHtml(alternate_name)); 106 | } 107 | 108 | if(this.cert.displayIssuerCommonName) { 109 | this.$.displayIssuerCommonName.setContent(enyo.string.escapeHtml(this.cert.displayIssuerCommonName)); 110 | } 111 | 112 | if(this.cert.startdate) { 113 | var dateFormatter = new enyo.g11n.DateFmt({date:'long'}); 114 | this.$.startDate.setContent(dateFormatter.format(new Date(this.cert.startdate))); 115 | } 116 | 117 | if(this.cert.expiredate) { 118 | var dateFormatter = new enyo.g11n.DateFmt({date:'long'}); 119 | this.$.expirationDate.setContent(dateFormatter.format(new Date(this.cert.expiredate))); 120 | } 121 | 122 | if(this.cert.subject) { 123 | 124 | alternate_name=""; 125 | for(var j in this.cert.subject.altname) { 126 | alternate_name += this.cert.subject.altname[j] + ' '; 127 | } 128 | this.$.subjectAltNameGroup.setShowing(alternate_name ? true : false); 129 | this.$.subjectAltName.setContent(enyo.string.escapeHtml(alternate_name)); 130 | 131 | this.$.subjectCountryGroup.setShowing(this.cert.subject.country ? true : false) 132 | this.$.subjectCountry.setContent(enyo.string.escapeHtml(this.cert.subject.country)); 133 | 134 | this.$.subjectStateGroup.setShowing(this.cert.subject.state ? true : false); 135 | this.$.subjectState.setContent(enyo.string.escapeHtml(this.cert.subject.state)); 136 | 137 | this.$.subjectLocationGroup.setShowing(this.cert.subject.location ? true : false); 138 | this.$.subjectLocation.setContent(enyo.string.escapeHtml(this.cert.subject.location)); 139 | 140 | this.$.subjectOrganizationGroup.setShowing(this.cert.subject.organization); 141 | this.$.subjectOrganization.setContent(enyo.string.escapeHtml(this.cert.subject.organization)); 142 | 143 | this.$.subjectCommonNameGroup.setShowing(this.cert.subject.commonname ? true : false); 144 | this.$.subjectCommonName.setContent(enyo.string.escapeHtml(this.cert.subject.commonname)); 145 | } 146 | 147 | if(this.cert.issuer) { 148 | this.$.issuerCountryGroup.setShowing(this.cert.issuer.country ? true : false); 149 | this.$.issuerCountry.setContent(enyo.string.escapeHtml(this.cert.issuer.country)); 150 | 151 | this.$.issuerStateGroup.setShowing(this.cert.issuer.state ? true : false); 152 | this.$.issuerState.setContent(enyo.string.escapeHtml(this.cert.issuer.state)); 153 | 154 | this.$.issuerLocationGroup.setShowing(this.cert.issuer.location ? true : false); 155 | this.$.issuerLocation.setContent(enyo.string.escapeHtml(this.cert.issuer.location)); 156 | 157 | this.$.issuerOrganizationGroup.setShowing(this.cert.issuer.organization ? true : false); 158 | this.$.issuerOrganization.setContent(enyo.string.escapeHtml(this.cert.issuer.organization)); 159 | 160 | this.$.issuerCommonNameGroup.setShowing(this.cert.issuer.commonname ? true : false); 161 | this.$.issuerCommonName.setContent(enyo.string.escapeHtml(this.cert.issuer.commonname)); 162 | } 163 | 164 | this.$.serialNumber.setContent(enyo.string.escapeHtml(this.cert.serialNumber)); 165 | this.$.version.setContent(enyo.string.escapeHtml(this.cert.version)); 166 | 167 | if(this.cert.signature) { 168 | if(this.cert.signature.algorithm) { 169 | this.$.signatureAlgorithm.setContent(enyo.string.escapeHtml(this.cert.signature.algorithm)); 170 | } 171 | // this.$.signature.setValue(enyo.string.escapeHtml(this.cert.signature.hexValue)); 172 | } 173 | 174 | if(this.cert.publicKey) { 175 | if(this.cert.publicKey.algorithm) { 176 | this.$.publicKeyAlgorithm.setContent(enyo.string.escapeHtml(this.cert.publicKey.algorithm)); 177 | } 178 | // this.$.publicKey.setValue(enyo.string.escapeHtml(this.cert.publicKey.hexValue)); 179 | } 180 | } 181 | }); 182 | 183 | 184 | enyo.kind({ 185 | name: "CertificateDialog", 186 | kind: "ModalDialog", 187 | caption: $L("View Certificate"), 188 | width: "450px", 189 | layoutKind: "VFlexLayout", 190 | published: { 191 | certFile: "" 192 | }, 193 | events: { 194 | onCertLoad: "", 195 | onClose: "" 196 | }, 197 | components: [ 198 | {name: "getCertificateDetails", kind:"PalmService", service:"palm://com.palm.certificatemanager/", 199 | method:"getcertificatedetails", 200 | onResponse:"handleCertificate" 201 | }, 202 | {kind: "Scroller", height: "500px", flex: 1, horizontal: false, autoHorizontal: false, components: [ 203 | {name: "certDetail", kind: "CertificateDetail"} 204 | ]}, 205 | {kind: "HFlexBox", pack: "justify", align: "center", components: [ 206 | {kind: "Button", caption: $L("Done"), flex: 1, className: "enyo-button-dark", onclick: "doClose"} 207 | ]} 208 | ], 209 | certFileChanged: function() { 210 | // this.warn("cert file: ", this.certFile); 211 | this.validateComponents(); 212 | if(this.certFile) { 213 | this.$.getCertificateDetails.call({'certificateFilename': this.certFile}); 214 | } 215 | }, 216 | handleCertificate: function(inSender, inResponse) { 217 | // this.warn("cert details: ", enyo.json.stringify(inResponse)); 218 | if(inResponse.returnValue) { 219 | this.$.certDetail.setCert(inResponse); 220 | this.doCertLoad(); 221 | } 222 | } 223 | }); 224 | -------------------------------------------------------------------------------- /source/DownloadList.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "ItemButton", 17 | kind: enyo.Button, 18 | mouseholdHandler: function() { 19 | return true; 20 | } 21 | }); 22 | 23 | enyo.kind({ 24 | name: "DownloadList", 25 | kind: enyo.VFlexBox, 26 | flex: 1, 27 | className: "basic-back", 28 | published: { 29 | downloads: [], 30 | }, 31 | events: { 32 | onOpenItem: "", 33 | onRetryItem: "", 34 | onCancelItem: "", 35 | onDeleteItem: "", 36 | onClearAll: "", 37 | onClose: "" 38 | }, 39 | components: [ 40 | {kind: enyo.Scroller, flex: 1, components: [ 41 | {name: "list", kind: enyo.VirtualRepeater, flex: 1, onSetupRow: "listSetupRow", components: [ 42 | {name: "item", kind: "Item", className: "dl-toaster-item", layoutKind: "HFlexLayout", align: "center", tapHighlight: true, onConfirm: "itemDelete", components: [ 43 | {name: "icon", kind: "MimeIcon", className: "dl-item-image"}, 44 | {name: "filename", className: "dl-item-title enyo-text-ellipsis", flex: 1}, 45 | {name: "progressItem", kind: "ProgressButton", flex: 1, className: "item-progress blue", animatePosition: false, onCancel: "itemCancel", components: [ 46 | {name: "progressContent", flex: 1, className: "enyo-text-ellipsis"} 47 | ]}, 48 | 49 | {name: "openButton", kind: "ItemButton", caption: $L("Open"), className: "enyo-button-dark", onclick: "itemOpen", onMousehold: "consumeEvent", showing: false}, 50 | {name: "refreshButton", kind: "ItemButton", caption: $L("Download"), onclick: "itemRetry", onMousehold: "consumeEvent", showing: false} 51 | ]} 52 | 53 | ]} 54 | ]}, 55 | {kind: "Toolbar", align: "center", components: [ 56 | {kind: "GrabButton", onclick: "doClose"}, 57 | {flex: 1, kind: "Control"}, 58 | {name: "clear", kind: "ToolButton", content: $L("Clear"), disabled: true, onclick: "doClearAll", style: "margin-right: 10px"} 59 | ]} 60 | ], 61 | //* @protected 62 | downloadsChanged: function() { 63 | this.$.list.render(); 64 | this.$.clear.setDisabled(this.downloads == null || this.downloads.length == 0); 65 | }, 66 | renderItem: function(inObject) { 67 | var d = inObject; 68 | var c = d.target || d.url; 69 | var s = c.lastIndexOf("/") + 1; 70 | this.$.filename.setContent(c.substring(s).replace(/%20/g, " ")); 71 | this.$.icon.setMimeType(d.mimetype); 72 | if (d.ticket) { 73 | if (d.aborted || d.completed && d.completionStatusCode != 200) { 74 | this.$.progressItem.setShowing(false); 75 | this.$.filename.setShowing(true); 76 | this.$.refreshButton.setShowing(true); 77 | } else if (d.completed) { 78 | this.$.filename.setContent(d.destFile.replace(/%20/g, " ")); 79 | this.$.filename.setShowing(true); 80 | this.$.progressItem.setShowing(false); 81 | this.$.openButton.setShowing(true); 82 | this.$.refreshButton.setShowing(false); 83 | } else { 84 | this.$.progressItem.setMaximum(d.amountTotal || 100); 85 | this.$.progressItem.setPosition(d.amountReceived || 0); 86 | this.$.progressContent.setContent(c.substring(s).replace(/%20/g, " ")); 87 | this.$.filename.setShowing(false); 88 | this.$.refreshButton.setShowing(false); 89 | } 90 | } else { 91 | this.$.progressItem.setMaximum(100); 92 | this.$.progressItem.setPosition(1); 93 | this.$.refreshButton.setShowing(false); 94 | } 95 | }, 96 | listSetupRow: function(inSender, inIndex) { 97 | var d = this.downloads[inIndex]; 98 | if (d) { 99 | this.renderItem(d); 100 | return true; 101 | } 102 | }, 103 | itemClick: function(inSender, inEvent, inIndex) { 104 | this.doOpenItem(inIndex); 105 | return true; 106 | }, 107 | itemCancel: function(inSender, inEvent) { 108 | this.doCancelItem(this.$.list.fetchRowIndex()); 109 | this.$.progressItem.setShowing(false); 110 | this.$.filename.setShowing(true); 111 | this.$.refreshButton.setShowing(true); 112 | return true; 113 | }, 114 | itemDelete: function() { 115 | this.doDeleteItem(this.$.list.fetchRowIndex()); 116 | }, 117 | itemRetry: function(inSender, inEvent) { 118 | this.$.progressItem.setShowing(true); 119 | this.$.filename.setShowing(false); 120 | this.$.refreshButton.setShowing(false); 121 | this.doRetryItem(this.$.list.fetchRowIndex()); 122 | }, 123 | itemOpen: function(inSender, inEvent) { 124 | this.doOpenItem(this.$.list.fetchRowIndex()); 125 | return true; 126 | }, 127 | consumeEvent: function() { 128 | return true; 129 | } 130 | }); 131 | -------------------------------------------------------------------------------- /source/FindBar.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "FindBar", 17 | kind: enyo.HFlexBox, 18 | events: { 19 | onFind: "", 20 | onGoToPrevious: "", 21 | onGoToNext: "" 22 | }, 23 | components: [ 24 | {kind: "Input", name: "input", flex: 2, autoCapitalize: "lowercase", changeOnKeypress: true, onchange: "inputChange"}, 25 | {flex: 1}, 26 | {kind: "NoFocusButton", name: "prev", caption: $L("prev"), disabled: true, onclick: "findPrevious"}, 27 | {kind: "NoFocusButton", name: "next", caption: $L("next"), disabled: true, onclick: "findNext"}, 28 | {kind: "NoFocusButton", caption: "done", onclick: "close"} 29 | ], 30 | //* @protected 31 | showingChanged: function() { 32 | this.inherited(arguments); 33 | if (this.showing) { 34 | this.$.input.forceFocus(); 35 | } 36 | }, 37 | inputChange: function() { 38 | var value = this.$.input.getValue(); 39 | var disabled = value.length < 2; 40 | this.$.prev.setDisabled(disabled); 41 | this.$.next.setDisabled(disabled); 42 | if (!disabled) { 43 | this.doFind(value); 44 | } 45 | }, 46 | findPrevious: function() { 47 | this.doGoToPrevious(); 48 | }, 49 | findNext: function() { 50 | this.doGoToNext(); 51 | }, 52 | close: function() { 53 | this.log(); 54 | this.$.input.forceBlur(); 55 | this.hide(); 56 | } 57 | }); 58 | -------------------------------------------------------------------------------- /source/HistoryList.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "HistoryList", 17 | kind: enyo.VFlexBox, 18 | className: "basic-back", 19 | dayInMilli:86400000, 20 | events: { 21 | onSelectItem: "", 22 | onDeleteItem: "", 23 | onClose: "" 24 | }, 25 | components: [ 26 | {name: "historyService", kind: "DbService", dbKind: "com.palm.browserhistory:1", reCallWatches: true, method: "find", onSuccess: "gotHistoryData", subscribe: true, onWatch:"refreshList"}, 27 | {name:"list", kind:"DbList", flex:1, onQuery:"historyQuery", onSetupRow: "listSetupRow", desc:true, components: [ 28 | {name: "divider", kind: "Divider", showing: false}, 29 | {name: "item", kind: "SwipeableItem", layoutKind: "HFlexLayout", tapHighlight: true, onclick: "itemClick", onConfirm: "deleteItem", components: [ 30 | {name: "icon", kind: "Image", src: "images/header-icon-history.png"}, 31 | {flex: 1, components: [ 32 | {name: "title", className: "url-item-title enyo-text-ellipsis"}, 33 | {name: "url", className: "url-item-url enyo-item-ternary enyo-text-ellipsis"} 34 | ]} 35 | ]} 36 | ]}, 37 | {kind: "Toolbar", components: [ 38 | {kind: "GrabButton", onclick: "doClose"}, 39 | {flex: 1, kind: "Control"} 40 | ]} 41 | ], 42 | historyQuery: function(inSender, inQuery) { 43 | inQuery.orderBy = "date"; 44 | return this.$.historyService.call({query:inQuery}); 45 | }, 46 | gotHistoryData: function(inSender, inResponse, inRequest) { 47 | this.$.list.queryResponse(inResponse,inRequest); 48 | }, 49 | getDivider: function(inItem) { 50 | var now = new Date(), then = new Date(inItem.date),ago; 51 | this.zeroDate(now); 52 | this.zeroDate(then); 53 | // days ago 54 | ago = Math.ceil((now.getTime() - then.getTime()) / this.dayInMilli); 55 | if (ago < 7) { 56 | return {divider:'d', ago:ago}; 57 | } 58 | // weeks ago 59 | ago = Math.ceil((now.getTime() - then.getTime()) / (this.dayinMilli*7)); 60 | ago = (now.getMonth() == then.getMonth()) ? ago : 4; 61 | if (ago < 4) { 62 | return {divider:'w', ago:ago}; 63 | } 64 | // months ago 65 | ago = (now.getMonth() - then.getMonth()); 66 | ago = (now.getFullYear() === then.getFullYear()) ? ago : 12; 67 | if (ago < 12) { 68 | return {divider:'m', ago:ago}; 69 | } 70 | // years ago 71 | ago = (now.getFullYear() - then.getFullYear()); 72 | return {divider:'y', ago:ago}; 73 | }, 74 | getCurrentDivider: function(inPrev, inCur) { 75 | var divCur = this.getDivider(inCur); 76 | var divPrev; 77 | if (inPrev) { 78 | divPrev = this.getDivider(inPrev); 79 | } 80 | if (!divPrev || divPrev.ago != divCur.ago || divPrev.divider != divCur.divider) { 81 | return divCur; 82 | } 83 | }, 84 | listSetupRow: function(inSender, inItem, inIndex) { 85 | var prev = this.$.list.fetch(inIndex - 1); 86 | var divider = this.getCurrentDivider(prev,inItem); 87 | if (divider) { 88 | this.$.divider.show(); 89 | this.$.divider.setCaption(this.formatDivider(divider).toUpperCase()); 90 | this.$.item.domStyles["border-top"] = "0"; 91 | } else { 92 | this.$.divider.hide(); 93 | this.$.item.domStyles["border-top"] = null; 94 | } 95 | this.$.icon.showing = Boolean(inItem.title); 96 | this.$.title.content = inItem.title || ""; 97 | this.$.url.content = inItem.url; 98 | }, 99 | itemClick: function(inSender, inEvent, inIndex) { 100 | var item = this.$.list.fetch(inIndex); 101 | this.doSelectItem(item); 102 | }, 103 | deleteItem: function(inSender, inIndex) { 104 | var item = this.$.list.fetch(inIndex); 105 | this.doDeleteItem(item); 106 | }, 107 | // make a date represent a rounded down day 108 | zeroDate: function(inDate) { 109 | inDate.setHours(0); 110 | inDate.setMinutes(0); 111 | inDate.setSeconds(0); 112 | inDate.setMilliseconds(0); 113 | return inDate; 114 | }, 115 | formatDivider: function(inDivider) { 116 | if (!this._formatter) { 117 | this._formatter = { 118 | day:new enyo.g11n.DateFmt(), 119 | week:new enyo.g11n.Template($L('1#Last Week|##{num} Weeks Ago')), 120 | month:new enyo.g11n.DateFmt('MMMM') 121 | }; 122 | } 123 | var now = new Date(), then = new Date(); 124 | this.zeroDate(now); 125 | if (inDivider.divider === 'd') { 126 | then.setTime(now.getTime() - (inDivider.ago * this.dayInMilli)); 127 | this.zeroDate(then); 128 | return this._formatter.day.formatRelativeDate(then,{relativeDate:now}); 129 | } else if (inDivider.divider === 'w') { 130 | return this._formatter.week.formatChoice(inDivider.ago,{num: inDivider.ago}); 131 | } else if (inDivider.divider === 'm') { 132 | then.setMonth(now.getMonth() - inDivider.ago); 133 | this.zeroDate(then); 134 | return this._formatter.month.format(then); 135 | } else { 136 | return String(now.getFullYear() - inDivider.ago); 137 | } 138 | }, 139 | refreshList: function(inSender, inWatch) { 140 | this.$.list.refresh(); 141 | } 142 | }); 143 | -------------------------------------------------------------------------------- /source/MimeIcon.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "MimeIcon", 17 | kind: enyo.Image, 18 | published: { 19 | mimeType: "" 20 | }, 21 | //* @protected 22 | create: function() { 23 | this.inherited(arguments); 24 | this.mimeTypeChanged(); 25 | }, 26 | iconsByMimeType: { 27 | "audio": "audio", 28 | "image": "image", 29 | "video": "video", 30 | "text": { 31 | "x-vcard": "vcard" 32 | }, 33 | "application": { 34 | "msword": "word", 35 | "pdf": "pdf", 36 | "vnd.openxmlformats-officedocument.wordprocessingml.document": "word", 37 | "excel": "xls", 38 | "x-excel": "xls", 39 | "x-msexcel": "xls", 40 | "vnd.ms-excel": "xls", 41 | "vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xls", 42 | "vnd.openxmlformats": "xls", 43 | "powerpoint": "ppt", 44 | "mspowerpoint": "ppt", 45 | "x-mspowerpoint": "ppt", 46 | "vnd.ms-powerpoint": "ppt", 47 | "vnd.openxmlformats-officedocument.presentationml.presentation": "ppt" 48 | } 49 | }, 50 | mimeTypeChanged: function() { 51 | if (this.mimeType) { 52 | var m = this.mimeType.split("/", 2); 53 | var r = this.iconsByMimeType[m[0]]; 54 | if (r && typeof r !== "string") { 55 | r = r[m[1]]; 56 | } 57 | if (r) { 58 | this.setSrc("images/mime-icon-" + r + ".png"); 59 | } else { 60 | this.setSrc("images/mime-icon-download.png"); 61 | } 62 | } else { 63 | this.setSrc("images/mime-icon-download.png"); 64 | } 65 | } 66 | }); 67 | -------------------------------------------------------------------------------- /source/NoFocusButton.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "NoFocusButton", 17 | kind: "Button", 18 | requiresDomMousedown: true, 19 | //* @protected 20 | mousedownHandler: function(inSender, inEvent) { 21 | this.inherited(arguments); 22 | inEvent.preventDefault(); 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /source/Preferences.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "Preferences", 17 | kind: enyo.VFlexBox, 18 | className: "basic-back", 19 | published: { 20 | browserPreferences: {}, 21 | systemPreferences: {}, 22 | searchPreferences: [], 23 | defaultSearch: "" 24 | }, 25 | events: { 26 | onPreferenceChanged: "", 27 | onClose: "" 28 | }, 29 | components: [ 30 | {name: "header", kind: "PageHeader", className: "preferences-header", pack: "center", components: [ 31 | {kind: "Image", src: "images/header-icon-prefs.png", className: "preferences-header-image"}, 32 | {content: $L("Preferences")} 33 | ]}, 34 | {kind: "Scroller", flex: 1, components: [ 35 | {kind: "Control", className: "enyo-preferences-box", components: [ 36 | {kind: "RowGroup", caption: $L("Default Web Search Engine"), components: [ 37 | {kind: "ListSelector", name: "searchPreference", value: $L("Google"), onChange: "searchPreferenceChange"} 38 | ]}, 39 | {kind: "RowGroup", caption: $L("Content"), style: "margin-bottom: 10px", components: [ 40 | {kind: "LabeledContainer", caption: $L("Block Popups"), components: [ 41 | {kind: "ToggleButton", name: "blockPopups", onChange: "togglePreferenceClick", preference: "blockPopups", type: "Browser"} 42 | ]}, 43 | {kind: "LabeledContainer", caption: $L("Accept Cookies"), components: [ 44 | {kind: "ToggleButton", name: "acceptCookies", onChange: "togglePreferenceClick", preference: "acceptCookies", type: "Browser"} 45 | ]}, 46 | {kind: "LabeledContainer", caption: $L("Enable JavaScript"), components: [ 47 | {kind: "ToggleButton", name: "enableJavascript", onChange: "togglePreferenceClick", preference: "enableJavascript", type: "Browser"} 48 | ]}, 49 | {kind: "LabeledContainer", caption: $L("Enable Flash"), components: [ 50 | {kind: "ToggleButton", name: "flashplugins", onChange: "togglePreferenceClick", preference: "flashplugins", type: "System"} 51 | ]}, 52 | ]}, 53 | {kind: "Button", caption: $L("Clear Bookmarks"), onclick: "promptButtonClick", dialog: "clearBookmarksPrompt"}, 54 | {kind: "Button", caption: $L("Clear History"), onclick: "promptButtonClick", dialog: "clearHistoryPrompt"}, 55 | {kind: "Button", caption: $L("Clear Cookies"), onclick: "promptButtonClick", dialog: "clearCookiesPrompt"}, 56 | {kind: "Button", caption: $L("Clear Cache"), onclick: "promptButtonClick", dialog: "clearCachePrompt"}, 57 | /* 58 | {kind: "RowGroup", caption: $L("Autofill"), components: [ 59 | {kind: "LabeledContainer", caption: $L("Names and Passwords"), components: [ 60 | {kind: "ToggleButton", name: "rememberPasswords", onChange: "togglePreferenceClick", preference: "rememberPasswords"} 61 | ]} 62 | ]}, 63 | {kind: "Button", caption: $L("Clear Autofill Information"), onclick: "", dialog: ""}, 64 | */ 65 | ]}, 66 | ]}, 67 | {kind: "Toolbar", pack: "center", className: "enyo-toolbar-light", components: [ 68 | {kind: "Button", caption: $L("Done"), onclick: "doClose", className: "enyo-preference-button enyo-button-dark"} 69 | ]}, 70 | {name: "clearBookmarksPrompt", kind: "BrowserPreferencePrompt", 71 | caption: $L("Would you like to clear your bookmarks?"), 72 | message: "", 73 | acceptCaption: $L("Clear Bookmarks"), 74 | onAccept: "completePrompt", 75 | preference: "clearBookmarks" 76 | }, 77 | {name: "clearHistoryPrompt", kind: "BrowserPreferencePrompt", 78 | caption: $L("Would you like to clear your browser history?"), 79 | message: "", 80 | acceptCaption: $L("Clear History"), 81 | onAccept: "completePrompt", 82 | preference: "clearHistory" 83 | }, 84 | {name: "clearCookiesPrompt", kind: "BrowserPreferencePrompt", 85 | caption: $L("Would you like to clear your browser cookies and local plug-in data?"), 86 | message: "", 87 | acceptCaption: $L("Clear All"), 88 | onAccept: "completePrompt", 89 | preference: "clearCookies" 90 | }, 91 | {name: "clearCachePrompt", kind: "BrowserPreferencePrompt", 92 | caption: $L("Would you like to clear your browser cache?"), 93 | message: "", 94 | acceptCaption: $L("Clear Cache"), 95 | onAccept: "completePrompt", 96 | preference: "clearCache" 97 | } 98 | ], 99 | create: function() { 100 | this.inherited(arguments); 101 | }, 102 | browserPreferencesChanged: function() { 103 | this.log(); 104 | this.updatePreferences(this.browserPreferences); 105 | }, 106 | systemPreferencesChanged: function() { 107 | this.log(); 108 | this.updatePreferences(this.systemPreferences); 109 | }, 110 | searchPreferencesChanged: function() { 111 | var items = []; 112 | for (var i=0,s;s=this.searchPreferences[i];i++) { 113 | items.push({caption: s.displayName, value: s.id}); 114 | this.$.searchPreference.setItems(items); 115 | } 116 | }, 117 | defaultSearchChanged: function() { 118 | this.$.searchPreference.setValue(this.defaultSearch); 119 | }, 120 | updatePreferences: function(inPreferences) { 121 | for (key in inPreferences) { 122 | var value = inPreferences[key]; 123 | if (this.$[key] !== undefined) { 124 | if (this.$[key].inverted) { 125 | this.$[key].setState(!value); 126 | } else { 127 | this.$[key].setState(value); 128 | } 129 | } 130 | } 131 | }, 132 | togglePreferenceClick: function(inSender, inState) { 133 | if (inSender.inverted) { 134 | this.fireChange(inSender.preference, inSender.type, !inState); 135 | } else { 136 | this.fireChange(inSender.preference, inSender.type, inState); 137 | } 138 | }, 139 | promptButtonClick: function(inSender) { 140 | this.$[inSender.dialog].openAtCenter(); 141 | }, 142 | completePrompt: function(inSender) { 143 | this.fireChange(inSender.preference); 144 | }, 145 | searchPreferenceChange: function(inSender, inValue) { 146 | this.fireChange("defaultSearch", "Search", inSender.getValue()); 147 | }, 148 | fireChange: function(inPreference, inType, inValue) { 149 | this.doPreferenceChanged(inPreference, inType, inValue); 150 | } 151 | }); 152 | -------------------------------------------------------------------------------- /source/ProgressItem.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "ProgressItem", 17 | kind: enyo.ProgressBar, 18 | className: "", 19 | layoutKind: "VFlexLayout", 20 | create: function() { 21 | this.inherited(arguments); 22 | this.$.bar.setClassName("download-progress-item-inner"); 23 | this.$.client.setLayoutKind("HFlexLayout"); 24 | this.$.client.addClass("enyo-progress-pill-client"); 25 | this.$.client.addClass("download-progress-item-client"); 26 | this.$.client.flex = 1; 27 | this.$.client.align = "center"; 28 | } 29 | }); 30 | -------------------------------------------------------------------------------- /source/ShareLinkDialog.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "ShareLinkDialog", 17 | kind: "AcceptCancelPopup", 18 | acceptCaption: "", // Don't want the accept button, set caption to "" 19 | events: { 20 | onShareClicked: "" 21 | }, 22 | SHARE_LINK_LIST: [{ 23 | title: $L("Email"), 24 | image: "images/icons/email-32x32.png", 25 | type: "email", 26 | exists: true 27 | },{ 28 | title: $L("Messaging"), 29 | image: "images/icons/messaging-32x32.png", 30 | type: "messaging", 31 | exists: true 32 | },{ 33 | title: "Facebook", 34 | image: "images/icons/facebook-32x32.png", 35 | type: "facebook", 36 | checkExistance: true 37 | }], 38 | components: [{ 39 | name: "appCatalogService", 40 | kind: enyo.PalmService, 41 | service: "palm://com.palm.applicationManager", 42 | method: "launch", 43 | onSuccess: "launchAppCatalogSuccess", 44 | onFailure: "launchAppCatalogError" 45 | },{ 46 | name: "listApplicationsService", 47 | kind: enyo.PalmService, 48 | service: enyo.palmServices.application, 49 | onSuccess: "listApplicationsSuccess", 50 | onFailure: "listApplicationsError", 51 | method: "listApps" 52 | }, { 53 | name: "launchApplicationService", 54 | kind: enyo.PalmService, 55 | service: enyo.palmServices.application, 56 | method: "open" 57 | },{ 58 | name: "shareMessage", 59 | content: $L("Share Link"), 60 | className: "enyo-modaldialog-title" 61 | },{ 62 | kind: "Control", 63 | className:"box-center", 64 | style:"margin-top:24px", 65 | components: [{ 66 | name: "shareList", 67 | kind: "VirtualRepeater", 68 | onclick: "shareButtonClicked", 69 | onSetupRow: "getItem", 70 | layoutKind: "HFlexLayout", 71 | align: "center", 72 | components: [{ 73 | name: "item", 74 | kind: "Control", 75 | layoutKind: "HFlexLayout", 76 | align: "center", 77 | components: [{ 78 | name: "button", 79 | kind: "Button", 80 | layoutKind: "HFlexLayout", 81 | align:"center", 82 | flex: 1, 83 | components: [{ 84 | name: "icon", 85 | kind: "Image", 86 | className: "icon-image" 87 | }, { 88 | name: "caption", 89 | }, { 90 | name: "spinner", 91 | kind: "Spinner", 92 | className: "app-exists-spinner" 93 | }] 94 | }, { 95 | name: "downloadButton", 96 | kind: "CustomButton", 97 | showing: false, 98 | className: "download-button" 99 | }] 100 | }] 101 | }] 102 | }], 103 | url: "", 104 | title: "", 105 | init: function (url, title) { 106 | this.url = url; 107 | this.title = title; 108 | }, 109 | open: function () { 110 | this.inherited(arguments); 111 | this.getListApplications(); 112 | }, 113 | getListApplications: function () { 114 | this.$.listApplicationsService.call(); 115 | }, 116 | getItem: function (inSender, inIndex) { 117 | if (inIndex < this.SHARE_LINK_LIST.length) { 118 | if (!this.$.shareMessage.getContent()) { 119 | this.$.shareMessage.setContent("Share link via"); 120 | } 121 | 122 | this.$.downloadButton.hide(); 123 | 124 | var itemDefinition = this.SHARE_LINK_LIST[inIndex]; 125 | this.$.icon.setSrc(itemDefinition.image); 126 | if (itemDefinition.checkExistance) { 127 | this.$.button.setDisabled(true); 128 | this.$.spinner.show(); 129 | } else { 130 | this.$.button.setDisabled(!itemDefinition.exists); 131 | if (!itemDefinition.exists) { 132 | this.$.downloadButton.show(); 133 | } 134 | this.$.spinner.hide(); 135 | } 136 | this.$.caption.setContent(itemDefinition.title); 137 | return true; 138 | } 139 | }, 140 | shareButtonClicked: function (inSender, inEvent) { 141 | var shareService = this.SHARE_LINK_LIST[inEvent.rowIndex]; 142 | var shareServiceType = shareService.type; 143 | 144 | if (!shareService.exists) { 145 | if (shareServiceType === "facebook") { 146 | this.downloadFacebookApp(); 147 | } 148 | return true; 149 | } 150 | 151 | if (shareServiceType === "email") { 152 | this.shareLinkViaEmail(); 153 | } else if (shareServiceType === "messaging") { 154 | this.shareLinkViaMessaging(); 155 | } else if (shareServiceType === "facebook") { 156 | this.shareLinkViaFacebook(); 157 | } 158 | this.close(); 159 | }, 160 | shareLinkViaEmail: function () { 161 | var msg = $L("Here's a website I think you'll like: {$title}"); 162 | msg = enyo.macroize(msg, {src: this.url, title: this.title || this.url}); 163 | var params = { 164 | summary: $L("Check out this web page..."), 165 | text: msg 166 | }; 167 | this.$.launchApplicationService.call({id: "com.palm.app.email", params: params}); 168 | }, 169 | shareLinkViaMessaging: function () { 170 | var params = { 171 | compose: { 172 | messageText: $L("Check out this web page: ") + this.url 173 | } 174 | }; 175 | this.$.launchApplicationService.call({id: "com.palm.app.messaging", params: params}); 176 | }, 177 | shareLinkViaFacebook: function () { 178 | var params = { 179 | type: "status", 180 | statusText: $L("Check out this web page: ") + this.url 181 | }; 182 | this.$.launchApplicationService.call({id: "com.palm.app.enyo-facebook", params: params}); 183 | }, 184 | downloadFacebookApp: function () { 185 | this.log("Launching app catalog to download facebook"); 186 | this.$.appCatalogService.call({id: "com.palm.app.enyo-findapps", params: { 187 | target: "http://developer.palm.com/appredirect/?packageid=com.palm.app.enyo-facebook" 188 | }}); 189 | }, 190 | listApplicationsSuccess: function (inSender, inResponse) { 191 | var apps = inResponse.apps; 192 | foundFacebook = apps.some(function (app) { 193 | this.log(enyo.json.stringify(app)); 194 | if (app.id === "com.palm.app.enyo-facebook") { 195 | 196 | this.SHARE_LINK_LIST.some(function (shareService, index) { 197 | if (shareService.title === "Facebook") { 198 | shareService.exists = true; 199 | shareService.checkExistance = false; 200 | this.$.shareList.renderRow(index); 201 | } 202 | }, this); 203 | return true; 204 | } 205 | }, this); 206 | 207 | if (!foundFacebook) { 208 | this.SHARE_LINK_LIST.some(function (shareService, index) { 209 | if (shareService.title === "Facebook") { 210 | shareService.exists = false; 211 | shareService.checkExistance = false; 212 | this.$.shareList.renderRow(index); 213 | } 214 | }, this); 215 | } 216 | }, 217 | launchAppCatalogSuccess: function (inSender, inResponse) { 218 | this.close(); 219 | } 220 | }); 221 | -------------------------------------------------------------------------------- /source/StartPage.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "StartPage", 17 | kind: enyo.VFlexBox, 18 | className: "startpage", 19 | published: { 20 | url: "", 21 | searchPreferences: {}, 22 | defaultSearch: "" 23 | }, 24 | events: { 25 | onUrlChange: "", 26 | onOpenBookmarks: "", 27 | onNewCard: "" 28 | }, 29 | components: [ 30 | {name: "actionbar", kind: "ActionBar", canShare: false, onLoad: "addressSelect", onOpenBookmarks: "doOpenBookmarks", onNewCard: "doNewCard"}, 31 | {name: "tall", className: "startpage-placeholder-tall", components: [ 32 | {name: "placeholder", className: "startpage-placeholder"} 33 | ]} 34 | ], 35 | //* @protected 36 | create: function() { 37 | this.inherited(arguments); 38 | this.searchPreferencesChanged(); 39 | this.defaultSearchChanged(); 40 | }, 41 | addressSelect: function(inSender, inUrl) { 42 | this.doUrlChange(inUrl); 43 | }, 44 | showingChanged: function() { 45 | this.inherited(arguments); 46 | // Always focus the action bar when start page is shown. 47 | if (this.showing) { 48 | this.$.actionbar.forceFocus(); 49 | } else { 50 | this.$.actionbar.forceBlur(); 51 | } 52 | }, 53 | urlChanged: function() { 54 | this.$.actionbar.setUrl(this.url); 55 | }, 56 | searchPreferencesChanged: function() { 57 | this.$.actionbar.setSearchPreferences(this.searchPreferences); 58 | }, 59 | defaultSearchChanged: function() { 60 | this.$.actionbar.setDefaultSearch(this.defaultSearch); 61 | }, 62 | //* @public 63 | resize: function() { 64 | this.$.actionbar.resize(); 65 | // Workaround a repaint issue where the area behind 66 | // the keyboard does not get repainted when switch cards, if the 67 | // keyboard resizes the window. This is temporary until the native 68 | // issue is fixed. 69 | var b = enyo.calcModalControlBounds(this.$.tall); 70 | this.$.placeholder.applyStyle("height", b.height + "px"); 71 | }, 72 | getUrl: function() { 73 | return this.$.actionBar.getUrl(); 74 | } 75 | }); 76 | -------------------------------------------------------------------------------- /source/URLSearch.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "URLSearch", 17 | kind: enyo.Control, 18 | published: { 19 | url: "", 20 | searchPreferences: [], 21 | defaultSearch: "", 22 | loading: false 23 | }, 24 | maxSearchResults: 32, 25 | className: "addressbar", 26 | events: { 27 | onLoad: "", 28 | onStopLoad: "", 29 | onRefresh: "" 30 | }, 31 | components: [ 32 | {name: "bookmarksService", kind: "DbService", method: "search", dbKind: "com.palm.browserbookmarks:1", onSuccess: "gotBookmarksData", onFailure: "finishShowSearchResults"}, 33 | {name: "historyService", kind: "DbService", method: "search", dbKind: "com.palm.browserhistory:1", onSuccess: "gotHistoryData", onFailure: "finishShowSearchResults"}, 34 | {name: "address", kind: "AddressInput", flex: 1, hint: $L("Enter URL or search terms"), 35 | onInputChange: "startSearch", 36 | onGo: "go", 37 | onStop: "doStopLoad", 38 | onRefresh: "doRefresh" 39 | }, 40 | {name: "searchPopup", kind: "Menu", lazy: false, modal: false, className: "addressbar-popup", components: [ 41 | {name: "providersList", className: "addressbar-providerslist", kind: "VirtualRepeater", onSetupRow: "providersListGetItem", components: [ 42 | {name: "providerItem", kind: "Item", layoutKind: "HFlexLayout", tapHighlight: true, onclick: "providerClick", components: [ 43 | {name: "providerTitle", width: "100%", className: "addressbar-provider-title"}, 44 | {name: "providerIcon", kind: "Image", style: "height:35px; width 35px;"} 45 | ]} 46 | ]}, 47 | {name: "popDivider", kind: "Control", className: "addressbar-popup-divider", showing: false}, 48 | {name: "resultsList", className: "addressbar-resultslist", kind: "VirtualRepeater", onSetupRow: "resultsListGetItem", components: [ 49 | {name: "resultsItem", kind: "Item", layoutKind: "HFlexLayout", tapHighlight: true, onclick: "resultClick", components: [ 50 | {width: "100%", components: [ 51 | {name: "resultsTitle", className: "url-item-title enyo-text-ellipsis"}, 52 | {name: "resultsUrl", className: "url-item-url enyo-item-ternary enyo-text-ellipsis"} 53 | ]}, 54 | {name: "resultsImage", className: "url-item-image", kind: "Image" , style: "height:35px; width 35px;" }, 55 | ]} 56 | ]} 57 | ]} 58 | ], 59 | //* @protected 60 | defaultSearchPreferences: [{ 61 | title: "Google", 62 | url: "http://www.google.com/search?q={$query}", 63 | icon: "list-icon-google.png" 64 | }, { 65 | title: "Wikipedia", 66 | url: "http://en.m.wikipedia.org/wiki/Special:Search?search={$query}", 67 | icon: "list-icon-wikipedia.png" 68 | }], 69 | _boxSize: {}, 70 | _searchResults: [], 71 | //* @protected 72 | rendered: function() { 73 | this.cacheBoxSize(); 74 | }, 75 | cacheBoxSize: function() { 76 | this._boxSize = enyo.fetchControlSize(this); 77 | }, 78 | urlChanged: function() { 79 | this.$.address.setUrl(this.url); 80 | }, 81 | startSearch: function() { 82 | this._value = this.$.address.getUserInput(true); 83 | if (this._value.length > 1) { 84 | enyo.job(this.id + "search", enyo.bind(this, "showSearchResults"), 150); 85 | } else { 86 | enyo.job.stop(this.id + "search"); 87 | this.closeSearchPopup(true); 88 | } 89 | }, 90 | showSearchResults: function() { 91 | var uri = enyo.uri.parseUri(this._value); 92 | if (uri.scheme && enyo.uri.isValidScheme(uri)) { 93 | this.$.providersList.setShowing(false); 94 | } else { 95 | this.$.providersList.render(); 96 | this.$.providersList.setShowing(true); 97 | } 98 | this._searchResults = []; 99 | this.fetchSearchResults("bookmarksService", {limit:32}); 100 | }, 101 | finishShowSearchResults: function() { 102 | this.$.resultsList.render(); 103 | var empty = !this.$.providersList.showing && this._searchResults.length == 0; 104 | if (!this.$.searchPopup.isOpen && this.$.address.hasFocus() && !empty) { 105 | var n = this.$.address.hasNode(); 106 | var o = enyo.dom.calcNodeOffset(n); 107 | this.$.searchPopup.scrollIntoView(0, 0); 108 | this.$.searchPopup.applyStyle("width", n.offsetWidth+10 + "px"); 109 | this.$.searchPopup.openAtControl(this.$.address, {left: -5, top: n.offsetHeight + 29}); 110 | } else if (empty && this.$.searchPopup.isOpen) { 111 | this.closeSearchPopup(true); 112 | } 113 | }, 114 | fetchSearchResults: function(inServiceName, inMixin) { 115 | var query = { 116 | where:[{prop:"searchText", op:"?", val:this._value, collate:"primary"}], 117 | orderBy: "_rev", 118 | desc:true 119 | }; 120 | enyo.mixin(query, inMixin); 121 | this.$[inServiceName].call({query:query}); 122 | }, 123 | gotBookmarksData: function(inSender, inResponse) { 124 | this._searchResults = inResponse.results; 125 | if (this._searchResults.length >= this.maxSearchResults) { 126 | this.finishShowSearchResults(); 127 | } else { 128 | this.fetchSearchResults("historyService", {orderBy:"date", limit:50}); 129 | } 130 | }, 131 | gotHistoryData: function(inSender, inResponse) { 132 | this._searchResults = this._searchResults.concat(inResponse.results); 133 | if(this._searchResults.length > 0) { 134 | this.$.popDivider.show(); 135 | } else { 136 | this.$.popDivider.hide(); 137 | } 138 | this.finishShowSearchResults(); 139 | }, 140 | searchPreferencesChanged: function() { 141 | for (var i=0,s;s=this.searchPreferences[i];i++) { 142 | var url = s.url.replace(/\#\{searchTerms\}/, "{$query}"); 143 | enyo.mixin(s, {url: url}); 144 | } 145 | }, 146 | defaultSearchChanged: function() { 147 | var sp = []; 148 | for (var i=0,s;s=this.searchPreferences[i];i++) { 149 | if (s.id === this.defaultSearch) { 150 | sp.unshift(s); 151 | } else { 152 | sp.push(s); 153 | } 154 | } 155 | this.searchPreferences = sp; 156 | }, 157 | loadingChanged: function() { 158 | this.$.address.setLoading(this.loading); 159 | }, 160 | providersListGetItem: function(inSender, inIndex) { 161 | if (inIndex == 0) { 162 | var list = this.searchPreferences; 163 | var provider = list[inIndex]; 164 | if (!provider) { 165 | return; 166 | } 167 | // FIXME: set top-bottom item styling 168 | var s = inIndex == 0 ? "border-top: 0;" : (inIndex == list.length-1 ? "border-bottom: 0;" : ""); 169 | // title 170 | var v = this.$.address.getUserInput(true); 171 | var t = provider.displayName + (v ? ' "' + v + '"' : ""); 172 | this.$.providerItem.setStyle(s); 173 | this.$.providerTitle.setContent(t); 174 | this.$.providerIcon.setSrc(provider.iconFilePath); 175 | return true; 176 | } 177 | }, 178 | providerClick: function(inSender, inEvent, inRowIndex) { 179 | var provider = this.defaultSearchPreferences[0]; 180 | if (window.PalmSystem) { 181 | provider = this.searchPreferences[inRowIndex]; 182 | } 183 | this.closeSearchPopup(); 184 | this.log(this.$.address.getUserInput(true)); 185 | this.doLoad(enyo.macroize(provider.url, {query: escape(this.$.address.getUserInput(true))})); 186 | }, 187 | resultsListGetItem: function(inSender, inIndex) { 188 | var item = this._searchResults[inIndex]; 189 | if ((!item) || (!item.title)) { 190 | enyo.log("No item or item.title found in history DB"); 191 | return; 192 | } 193 | var s = ""; 194 | if (inIndex == 0) s += "border-top: 0;"; 195 | if (inIndex == this._searchResults.length - 1) s += "border-bottom: 0;"; 196 | this.$.resultsItem.style = s; 197 | var icon = item.iconFile32 || item.thumbnailFile || "images/header-icon-history.png"; 198 | this.$.resultsImage.showing = Boolean(icon); 199 | this.$.resultsImage.domAttributes.src = icon; 200 | this.$.resultsTitle.content = enyo.string.applyFilterHighlight(item.title, this._value, "addressbar-highlight"); 201 | this.$.resultsUrl.content = enyo.string.applyFilterHighlight(item.url, this._value, "addressbar-highlight"); 202 | return true; 203 | }, 204 | highlightResultText: function(inText) { 205 | var i = inText.search(new RegExp(this._value, "i")); 206 | if (i <=0) { 207 | return inText; 208 | } 209 | var l = this._value.length; 210 | var b = inText.slice(0, i); 211 | var m = inText.slice(i, i+l); 212 | var e = inText.slice(i+l); 213 | return b + "" + m + "" + e; 214 | }, 215 | resultClick: function(inSender, inEvent, inRowIndex) { 216 | var i = this._searchResults[inRowIndex]; 217 | this.closeSearchPopup(); 218 | document.activeElement.blur(); 219 | this.doLoad(i.url); 220 | }, 221 | go: function(inSender, inValue) { 222 | var uri = enyo.uri.parseUri(inValue); 223 | if ((enyo.uri.isValidScheme(uri) && this.isUri(inValue, uri)) || (enyo.windowParams.allowAllSchemes && uri.scheme)) { 224 | this.doLoad(inValue); 225 | } else { 226 | this.providerClick(null, null, 0); 227 | } 228 | this.closeSearchPopup(); 229 | }, 230 | isUri: function(inText, inUri) { 231 | // probably a search term if there is a space 232 | if (inText.match(/\s/)) { 233 | return false; 234 | } 235 | return enyo.uri.isValidUri(inUri); 236 | }, 237 | //* public 238 | resize: function() { 239 | // need to handle resize manually here because the 240 | // search dropdown needs to match the width of the 241 | // address bar, and Popup doesn't have a minSize 242 | // setting yet 243 | var s = enyo.fetchControlSize(this); 244 | if (s.w != this._boxSize.w && this.$.searchPopup.isOpen) { 245 | this.$.searchPopup.close(); 246 | this.finishShowSearchResults(); 247 | } 248 | this.cacheBoxSize(); 249 | }, 250 | forceFocus: function() { 251 | this.$.address.forceFocus(); 252 | }, 253 | closeSearchPopup: function(inKeepFocus) { 254 | this.log(inKeepFocus); 255 | // FIXME: eliminate transition artifact 256 | setTimeout(enyo.hitch(this, function() { 257 | if (this.$.searchPopup.isOpen) { 258 | this.$.searchPopup.close(); 259 | if (!inKeepFocus) { 260 | document.activeElement.blur(); 261 | } 262 | } 263 | }), 1); 264 | } 265 | }); 266 | -------------------------------------------------------------------------------- /source/VerticalAcceptCancelPopup.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.kind({ 16 | name: "VerticalAcceptCancelPopup", 17 | kind: "AcceptCancelPopup", 18 | chrome: [ 19 | {className: "enyo-modaldialog-container", components: [ 20 | {name: "modalDialogTitle", className: "enyo-modaldialog-title"}, 21 | {name: "client"}, 22 | {kind: enyo.VFlexBox, components: [ 23 | {name: "accept", kind: "NoFocusButton", className: "enyo-button-dark", flex: 1, onclick: "acceptClick"}, 24 | {name: "cancel", kind: "NoFocusButton", flex: 1, onclick: "cancelClick"} 25 | ]} 26 | ]} 27 | ] 28 | }); 29 | -------------------------------------------------------------------------------- /source/clipboard.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.setClipboard = function(inText) { 16 | var n = document.createElement("textarea"); 17 | n.style.cssText = "position: absolute; height: 0px; width: 0px;"; 18 | n.value = inText; 19 | document.body.appendChild(n); 20 | n.select(); 21 | document.execCommand("cut"); 22 | document.body.removeChild(n); 23 | } -------------------------------------------------------------------------------- /source/tld.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // auto-generated by tld_generate.pl 16 | // from http://data.iana.org/TLD/tlds-alpha-by-domain.txt 17 | enyo.uri.tld = [ 18 | "ac", 19 | "ad", 20 | "ae", 21 | "aero", 22 | "af", 23 | "ag", 24 | "ai", 25 | "al", 26 | "am", 27 | "an", 28 | "ao", 29 | "aq", 30 | "ar", 31 | "arpa", 32 | "as", 33 | "asia", 34 | "at", 35 | "au", 36 | "aw", 37 | "ax", 38 | "az", 39 | "ba", 40 | "bb", 41 | "bd", 42 | "be", 43 | "bf", 44 | "bg", 45 | "bh", 46 | "bi", 47 | "biz", 48 | "bj", 49 | "bm", 50 | "bn", 51 | "bo", 52 | "br", 53 | "bs", 54 | "bt", 55 | "bv", 56 | "bw", 57 | "by", 58 | "bz", 59 | "ca", 60 | "cat", 61 | "cc", 62 | "cd", 63 | "cf", 64 | "cg", 65 | "ch", 66 | "ci", 67 | "ck", 68 | "cl", 69 | "cm", 70 | "cn", 71 | "co", 72 | "com", 73 | "coop", 74 | "cr", 75 | "cu", 76 | "cv", 77 | "cx", 78 | "cy", 79 | "cz", 80 | "de", 81 | "dj", 82 | "dk", 83 | "dm", 84 | "do", 85 | "dz", 86 | "ec", 87 | "edu", 88 | "ee", 89 | "eg", 90 | "er", 91 | "es", 92 | "et", 93 | "eu", 94 | "fi", 95 | "fj", 96 | "fk", 97 | "fm", 98 | "fo", 99 | "fr", 100 | "ga", 101 | "gb", 102 | "gd", 103 | "ge", 104 | "gf", 105 | "gg", 106 | "gh", 107 | "gi", 108 | "gl", 109 | "gm", 110 | "gn", 111 | "gov", 112 | "gp", 113 | "gq", 114 | "gr", 115 | "gs", 116 | "gt", 117 | "gu", 118 | "gw", 119 | "gy", 120 | "hk", 121 | "hm", 122 | "hn", 123 | "hr", 124 | "ht", 125 | "hu", 126 | "id", 127 | "ie", 128 | "il", 129 | "im", 130 | "in", 131 | "info", 132 | "int", 133 | "io", 134 | "iq", 135 | "ir", 136 | "is", 137 | "it", 138 | "je", 139 | "jm", 140 | "jo", 141 | "jobs", 142 | "jp", 143 | "ke", 144 | "kg", 145 | "kh", 146 | "ki", 147 | "km", 148 | "kn", 149 | "kp", 150 | "kr", 151 | "kw", 152 | "ky", 153 | "kz", 154 | "la", 155 | "lb", 156 | "lc", 157 | "li", 158 | "lk", 159 | "lr", 160 | "ls", 161 | "lt", 162 | "lu", 163 | "lv", 164 | "ly", 165 | "ma", 166 | "mc", 167 | "md", 168 | "me", 169 | "mg", 170 | "mh", 171 | "mil", 172 | "mk", 173 | "ml", 174 | "mm", 175 | "mn", 176 | "mo", 177 | "mobi", 178 | "mp", 179 | "mq", 180 | "mr", 181 | "ms", 182 | "mt", 183 | "mu", 184 | "museum", 185 | "mv", 186 | "mw", 187 | "mx", 188 | "my", 189 | "mz", 190 | "na", 191 | "name", 192 | "nc", 193 | "ne", 194 | "net", 195 | "nf", 196 | "ng", 197 | "ni", 198 | "nl", 199 | "no", 200 | "np", 201 | "nr", 202 | "nu", 203 | "nz", 204 | "om", 205 | "org", 206 | "pa", 207 | "pe", 208 | "pf", 209 | "pg", 210 | "ph", 211 | "pk", 212 | "pl", 213 | "pm", 214 | "pn", 215 | "pr", 216 | "pro", 217 | "ps", 218 | "pt", 219 | "pw", 220 | "py", 221 | "qa", 222 | "re", 223 | "ro", 224 | "rs", 225 | "ru", 226 | "rw", 227 | "sa", 228 | "sb", 229 | "sc", 230 | "sd", 231 | "se", 232 | "sg", 233 | "sh", 234 | "si", 235 | "sj", 236 | "sk", 237 | "sl", 238 | "sm", 239 | "sn", 240 | "so", 241 | "sr", 242 | "st", 243 | "su", 244 | "sv", 245 | "sy", 246 | "sz", 247 | "tc", 248 | "td", 249 | "tel", 250 | "tf", 251 | "tg", 252 | "th", 253 | "tj", 254 | "tk", 255 | "tl", 256 | "tm", 257 | "tn", 258 | "to", 259 | "tp", 260 | "tr", 261 | "travel", 262 | "tt", 263 | "tv", 264 | "tw", 265 | "tz", 266 | "ua", 267 | "ug", 268 | "uk", 269 | "us", 270 | "uy", 271 | "uz", 272 | "va", 273 | "vc", 274 | "ve", 275 | "vg", 276 | "vi", 277 | "vn", 278 | "vu", 279 | "wf", 280 | "ws", 281 | "xn--0zwm56d", 282 | "xn--11b5bs3a9aj6g", 283 | "xn--3e0b707e", 284 | "xn--45brj9c", 285 | "xn--80akhbyknj4f", 286 | "xn--9t4b11yi5a", 287 | "xn--clchc0ea0b2g2a9gcd", 288 | "xn--deba0ad", 289 | "xn--fiqs8s", 290 | "xn--fiqz9s", 291 | "xn--fpcrj9c3d", 292 | "xn--fzc2c9e2c", 293 | "xn--g6w251d", 294 | "xn--gecrj9c", 295 | "xn--h2brj9c", 296 | "xn--hgbk6aj7f53bba", 297 | "xn--hlcj6aya9esc7a", 298 | "xn--j6w193g", 299 | "xn--jxalpdlp", 300 | "xn--kgbechtv", 301 | "xn--kprw13d", 302 | "xn--kpry57d", 303 | "xn--mgbaam7a8h", 304 | "xn--mgbayh7gpa", 305 | "xn--mgbbh1a71e", 306 | "xn--mgberp4a5d4ar", 307 | "xn--o3cw4h", 308 | "xn--ogbpf8fl", 309 | "xn--p1ai", 310 | "xn--pgbs0dh", 311 | "xn--s9brj9c", 312 | "xn--wgbh1c", 313 | "xn--wgbl6a", 314 | "xn--xkc2al3hye2a", 315 | "xn--xkc2dl3a5ee0h", 316 | "xn--yfro4i67o", 317 | "xn--ygbi2ammx", 318 | "xn--zckzah", 319 | "ye", 320 | "yt", 321 | "za", 322 | "zm", 323 | "zw", 324 | ]; 325 | -------------------------------------------------------------------------------- /source/util.js: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Hewlett-Packard Development Company, L.P. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | enyo.uri = { 16 | parseUri: function(inText) { 17 | var keys = ["source","scheme","authority","userinfo","host","tld","port","path","query","fragment"]; 18 | var re = /^(?:([^:\/\?#@\d]+):)?(?:\/\/)?((?:([^\/\?#]*)@)?([^\/\?#:]*\.([^\/\?#:]*))(?::(\d*))?)?([^\?#]*)(?:\\\?([^#]*))?(?:#(.*))?/; 19 | var a = re.exec(inText); 20 | var parsed = {}; 21 | for (var i=0; i