├── App-Launcher ├── .metadata ├── App-Launcher.pml ├── applauncher_pages_names_topic │ ├── applauncher_pages_names_topic.dlg │ ├── applauncher_pages_names_topic_arw.top │ ├── applauncher_pages_names_topic_czc.top │ ├── applauncher_pages_names_topic_dad.top │ ├── applauncher_pages_names_topic_dun.top │ ├── applauncher_pages_names_topic_enu.top │ ├── applauncher_pages_names_topic_fif.top │ ├── applauncher_pages_names_topic_frf.top │ ├── applauncher_pages_names_topic_ged.top │ ├── applauncher_pages_names_topic_grg.top │ ├── applauncher_pages_names_topic_iti.top │ ├── applauncher_pages_names_topic_jpj.top │ ├── applauncher_pages_names_topic_kok.top │ ├── applauncher_pages_names_topic_mnc.top │ ├── applauncher_pages_names_topic_mnt.top │ ├── applauncher_pages_names_topic_non.top │ ├── applauncher_pages_names_topic_plp.top │ ├── applauncher_pages_names_topic_ptb.top │ ├── applauncher_pages_names_topic_ptp.top │ ├── applauncher_pages_names_topic_rur.top │ ├── applauncher_pages_names_topic_spe.top │ ├── applauncher_pages_names_topic_sws.top │ └── applauncher_pages_names_topic_trt.top ├── html │ ├── change_screen.ogg │ ├── css │ │ ├── bootstrap.min.css │ │ └── main.css │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── images │ │ ├── Pepper-white.png │ │ ├── background.jpg │ │ ├── conversation-active.png │ │ ├── conversation-inactive.png │ │ ├── generic_package_icon.png │ │ ├── loading.gif │ │ ├── sleeping.gif │ │ ├── volume-down.png │ │ └── volume-up.png │ ├── index.html │ └── js │ │ ├── bootstrap.min.js │ │ ├── fastclick.js │ │ ├── jquery-3.1.1.min.js │ │ ├── main.js │ │ └── robotutils.js ├── icon.png ├── lib │ ├── app_launcher.py │ ├── app_list_manager.py │ ├── defaultPreferences.json │ ├── dialog_manager.py │ ├── helpers.py │ ├── preferences_manager.py │ ├── storage.py │ └── view_manager.py └── manifest.xml ├── COPYING.md ├── README.md ├── adjust.js ├── background.xcf └── resources ├── App-Launcher.json ├── LOGO_SB-Robotics_white.png ├── defaultPreferences.json ├── pepper.png ├── softBank.png └── whitePage.png /App-Launcher/.metadata: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/.metadata -------------------------------------------------------------------------------- /App-Launcher/App-Launcher.pml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic.dlg: -------------------------------------------------------------------------------- 1 | multilanguage:applauncher_pages_names_topic 2 | arw:applauncher_pages_names_topic_arw.top 3 | czc:applauncher_pages_names_topic_czc.top 4 | dad:applauncher_pages_names_topic_dad.top 5 | ged:applauncher_pages_names_topic_ged.top 6 | grg:applauncher_pages_names_topic_grg.top 7 | enu:applauncher_pages_names_topic_enu.top 8 | spe:applauncher_pages_names_topic_spe.top 9 | fif:applauncher_pages_names_topic_fif.top 10 | frf:applauncher_pages_names_topic_frf.top 11 | iti:applauncher_pages_names_topic_iti.top 12 | jpj:applauncher_pages_names_topic_jpj.top 13 | kok:applauncher_pages_names_topic_kok.top 14 | dun:applauncher_pages_names_topic_dun.top 15 | non:applauncher_pages_names_topic_non.top 16 | plp:applauncher_pages_names_topic_plp.top 17 | ptb:applauncher_pages_names_topic_ptb.top 18 | ptp:applauncher_pages_names_topic_ptp.top 19 | rur:applauncher_pages_names_topic_rur.top 20 | sws:applauncher_pages_names_topic_sws.top 21 | trt:applauncher_pages_names_topic_trt.top 22 | mnc:applauncher_pages_names_topic_mnc.top 23 | mnt:applauncher_pages_names_topic_mnt.top 24 | -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_arw.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: arw 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_czc.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: czc 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 6 | -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_dad.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: dad 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_dun.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: dun 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_enu.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: enu 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 6 | u:(["Home {page}" "go back"]) $AppLauncher/PageRequired="homepage" -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_fif.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: fif 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_frf.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: frf 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 6 | u:(["{"page d'" accueil" "retour"]) $AppLauncher/PageRequired="homepage" -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_ged.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: ged 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_grg.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: grg 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_iti.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: iti 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_jpj.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: jpj 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_kok.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: kok 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_mnc.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: mnc 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_mnt.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: mnt 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_non.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: non 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_plp.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: plp 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_ptb.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: ptb 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_ptp.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: ptp 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_rur.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: rur 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_spe.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: spe 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_sws.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: sws 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/applauncher_pages_names_topic/applauncher_pages_names_topic_trt.top: -------------------------------------------------------------------------------- 1 | topic: ~applauncher_pages_names_topic() 2 | language: trt 3 | 4 | dynamic:applauncher_pages_names 5 | u:(_~applauncher_pages_names) $AppLauncher/PageRequired=$1 -------------------------------------------------------------------------------- /App-Launcher/html/change_screen.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/change_screen.ogg -------------------------------------------------------------------------------- /App-Launcher/html/css/main.css: -------------------------------------------------------------------------------- 1 | html,body{ 2 | height: 100%; 3 | margin: 0; 4 | overflow:hidden; 5 | background-color: #aecbd6; 6 | background-image: url(../images/background.jpg); 7 | background-size: contain; 8 | -webkit-touch-callout: none; /* iOS Safari */ 9 | -webkit-user-select: none; /* Chrome/Safari/Opera */ 10 | -khtml-user-select: none; /* Konqueror */ 11 | -moz-user-select: none; /* Firefox */ 12 | -ms-user-select: none; /* Internet Explorer/Edge */ 13 | user-select: none; 14 | } 15 | 16 | /*** 17 | COMMON 18 | ***/ 19 | 20 | .float_left { 21 | float:left; 22 | } 23 | .float_right { 24 | float:right; 25 | } 26 | .to_hide_when_not_ready { 27 | display:none; 28 | } 29 | 30 | /*** 31 | COMMON BUTTONS DESCRIPTION 32 | ***/ 33 | 34 | button{ 35 | border: none; 36 | color:white; 37 | background: transparent; 38 | font-size: 35px; 39 | height: 80px; 40 | width: 80px; 41 | } 42 | button:active{ 43 | color: lime; 44 | } 45 | button:focus { 46 | outline:0; 47 | } 48 | ::-webkit-scrollbar { 49 | display:none; 50 | } 51 | 52 | /*** 53 | HEADER BAR 54 | ***/ 55 | 56 | #header_div{ 57 | position:relative; 58 | top:0; 59 | height:180px; 60 | } 61 | #header_logo{ 62 | position:relative; 63 | height:80%; 64 | top:20%; 65 | background-image: url(../images/Pepper-white.png); 66 | background-size: contain; 67 | background-repeat: no-repeat; 68 | background-position-x: center; 69 | background-position-y: center; 70 | } 71 | #header_audio_dropdown{ 72 | width: 270px; 73 | top:0; 74 | margin-top:57px; 75 | margin-right: 20px; 76 | background-color:white; 77 | border:none; 78 | border-radius: 0px; 79 | text-align: center; 80 | } 81 | #header_audio_dropdown>button{ 82 | color: #607a84; 83 | } 84 | #button_unmute{ 85 | background-image: url(../images/conversation-active.png); 86 | background-size: 48px; 87 | background-repeat: no-repeat; 88 | background-position-x: center; 89 | background-position-y: center; 90 | } 91 | #button_mute{ 92 | background-image: url(../images/conversation-inactive.png); 93 | background-size: 48px; 94 | background-repeat: no-repeat; 95 | background-position-x: center; 96 | background-position-y: center; 97 | } 98 | #button_volume_up{ 99 | background-image: url(../images/volume-up.png); 100 | background-size: 48px; 101 | background-repeat: no-repeat; 102 | background-position-x: center; 103 | background-position-y: center; 104 | } 105 | #button_volume_down{ 106 | background-image: url(../images/volume-down.png); 107 | background-size: 48px; 108 | background-repeat: no-repeat; 109 | background-position-x: center; 110 | background-position-y: center; 111 | } 112 | /*** 113 | MAIN BUTTONS BAR 114 | ***/ 115 | 116 | #content_div { 117 | width: 80%; 118 | margin: 50px 10%; 119 | height: 520px; 120 | } 121 | #content_loading_div{ 122 | height: 100%; 123 | background-image: url(../images/loading.gif); 124 | background-size: 120px; 125 | background-repeat: no-repeat; 126 | background-position-x: center; 127 | background-position-y: center; 128 | } 129 | #content_sleeping_div{ 130 | height: 280px; 131 | width: 470px; 132 | margin: 110px auto; 133 | background-image: url(../images/sleeping.gif); 134 | background-size: contain; 135 | background-repeat: no-repeat; 136 | background-position-x: center; 137 | background-position-y: center; 138 | } 139 | #content_ready_div { 140 | height:100%; 141 | text-align:center; 142 | } 143 | #content_ready_div>div { 144 | height:100%; 145 | } 146 | .dynamic_pageHome_line1_div { 147 | margin-top: 90px; 148 | } 149 | .dynamic_pageHome_line2_div { 150 | margin-top: -40px; 151 | } 152 | .line2_div_right { 153 | margin-left:110px; 154 | margin-right:-110px; 155 | } 156 | #dynamic_pageHome_div { 157 | margin-top:60px; 158 | } 159 | .dynamic_pageHome_app_button { 160 | margin:10px; 161 | display: inline-block; 162 | } 163 | .dynamic_pageHome_app_button>div{ 164 | font-size: 40px; 165 | width: 200px; 166 | color: white; 167 | height: 200px; 168 | text-align: center; 169 | border-radius: 100px; 170 | white-space: normal; 171 | display: table-cell; 172 | vertical-align: middle; 173 | } 174 | .dynamic_page_line1_div { 175 | /* margin-top: -35px; */ 176 | } 177 | .dynamic_page_line2_div { 178 | margin-top: -42px; 179 | } 180 | .dynamic_page_app_button { 181 | margin:10px; 182 | display: inline-block; 183 | vertical-align: top; 184 | width: 200px; 185 | text-align: center; 186 | } 187 | .dynamic_page_app_button>img{ 188 | height: 200px; 189 | width: 200px; 190 | } 191 | .dynamic_page_app_button>div{ 192 | font-size:25px; 193 | color:white; 194 | } 195 | 196 | /*** 197 | FOOTER BAR 198 | ***/ 199 | 200 | #footer_div { 201 | position: absolute; 202 | bottom: 0; 203 | width: 100%; 204 | height: 90px; 205 | } 206 | #footer_all_apps_dropdown { 207 | width: 1240px; 208 | right: 20px; 209 | bottom: 60px; 210 | max-height: 710px; 211 | border-radius: 0px; 212 | overflow-y: scroll; 213 | text-align: center; 214 | } 215 | .dynamic_all_apps_dropdown_app_div { 216 | width: 215px; 217 | margin: 10px; 218 | text-align: center; 219 | display: inline-table; 220 | } 221 | .dynamic_all_apps_dropdown_app_div>img { 222 | border: none; 223 | background: transparent; 224 | outline-style:none; 225 | height: 150px; 226 | width: 150px; 227 | } 228 | .dynamic_all_apps_dropdown_app_div>div{ 229 | font-size:20px; 230 | } 231 | -------------------------------------------------------------------------------- /App-Launcher/html/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /App-Launcher/html/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /App-Launcher/html/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /App-Launcher/html/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /App-Launcher/html/images/Pepper-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/images/Pepper-white.png -------------------------------------------------------------------------------- /App-Launcher/html/images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/images/background.jpg -------------------------------------------------------------------------------- /App-Launcher/html/images/conversation-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/images/conversation-active.png -------------------------------------------------------------------------------- /App-Launcher/html/images/conversation-inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/images/conversation-inactive.png -------------------------------------------------------------------------------- /App-Launcher/html/images/generic_package_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/images/generic_package_icon.png -------------------------------------------------------------------------------- /App-Launcher/html/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/images/loading.gif -------------------------------------------------------------------------------- /App-Launcher/html/images/sleeping.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/images/sleeping.gif -------------------------------------------------------------------------------- /App-Launcher/html/images/volume-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/images/volume-down.png -------------------------------------------------------------------------------- /App-Launcher/html/images/volume-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/html/images/volume-up.png -------------------------------------------------------------------------------- /App-Launcher/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 23 |
24 | 35 | 36 |
37 | 38 |
39 |
40 | 41 | 42 |
43 | 44 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /App-Launcher/html/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.5 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under the MIT license 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.5",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); -------------------------------------------------------------------------------- /App-Launcher/html/js/fastclick.js: -------------------------------------------------------------------------------- 1 | ;(function () { 2 | 'use strict'; 3 | 4 | /** 5 | * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs. 6 | * 7 | * @codingstandard ftlabs-jsv2 8 | * @copyright The Financial Times Limited [All Rights Reserved] 9 | * @license MIT License (see LICENSE.txt) 10 | */ 11 | 12 | /*jslint browser:true, node:true*/ 13 | /*global define, Event, Node*/ 14 | 15 | 16 | /** 17 | * Instantiate fast-clicking listeners on the specified layer. 18 | * 19 | * @constructor 20 | * @param {Element} layer The layer to listen on 21 | * @param {Object} [options={}] The options to override the defaults 22 | */ 23 | function FastClick(layer, options) { 24 | var oldOnClick; 25 | 26 | options = options || {}; 27 | 28 | /** 29 | * Whether a click is currently being tracked. 30 | * 31 | * @type boolean 32 | */ 33 | this.trackingClick = false; 34 | 35 | 36 | /** 37 | * Timestamp for when click tracking started. 38 | * 39 | * @type number 40 | */ 41 | this.trackingClickStart = 0; 42 | 43 | 44 | /** 45 | * The element being tracked for a click. 46 | * 47 | * @type EventTarget 48 | */ 49 | this.targetElement = null; 50 | 51 | 52 | /** 53 | * X-coordinate of touch start event. 54 | * 55 | * @type number 56 | */ 57 | this.touchStartX = 0; 58 | 59 | 60 | /** 61 | * Y-coordinate of touch start event. 62 | * 63 | * @type number 64 | */ 65 | this.touchStartY = 0; 66 | 67 | 68 | /** 69 | * ID of the last touch, retrieved from Touch.identifier. 70 | * 71 | * @type number 72 | */ 73 | this.lastTouchIdentifier = 0; 74 | 75 | 76 | /** 77 | * Touchmove boundary, beyond which a click will be cancelled. 78 | * 79 | * @type number 80 | */ 81 | this.touchBoundary = options.touchBoundary || 10; 82 | 83 | 84 | /** 85 | * The FastClick layer. 86 | * 87 | * @type Element 88 | */ 89 | this.layer = layer; 90 | 91 | /** 92 | * The minimum time between tap(touchstart and touchend) events 93 | * 94 | * @type number 95 | */ 96 | this.tapDelay = options.tapDelay || 200; 97 | 98 | /** 99 | * The maximum time for a tap 100 | * 101 | * @type number 102 | */ 103 | this.tapTimeout = options.tapTimeout || 700; 104 | 105 | if (FastClick.notNeeded(layer)) { 106 | return; 107 | } 108 | 109 | // Some old versions of Android don't have Function.prototype.bind 110 | function bind(method, context) { 111 | return function() { return method.apply(context, arguments); }; 112 | } 113 | 114 | 115 | var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel']; 116 | var context = this; 117 | for (var i = 0, l = methods.length; i < l; i++) { 118 | context[methods[i]] = bind(context[methods[i]], context); 119 | } 120 | 121 | // Set up event handlers as required 122 | if (deviceIsAndroid) { 123 | layer.addEventListener('mouseover', this.onMouse, true); 124 | layer.addEventListener('mousedown', this.onMouse, true); 125 | layer.addEventListener('mouseup', this.onMouse, true); 126 | } 127 | 128 | layer.addEventListener('click', this.onClick, true); 129 | layer.addEventListener('touchstart', this.onTouchStart, false); 130 | layer.addEventListener('touchmove', this.onTouchMove, false); 131 | layer.addEventListener('touchend', this.onTouchEnd, false); 132 | layer.addEventListener('touchcancel', this.onTouchCancel, false); 133 | 134 | // Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2) 135 | // which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick 136 | // layer when they are cancelled. 137 | if (!Event.prototype.stopImmediatePropagation) { 138 | layer.removeEventListener = function(type, callback, capture) { 139 | var rmv = Node.prototype.removeEventListener; 140 | if (type === 'click') { 141 | rmv.call(layer, type, callback.hijacked || callback, capture); 142 | } else { 143 | rmv.call(layer, type, callback, capture); 144 | } 145 | }; 146 | 147 | layer.addEventListener = function(type, callback, capture) { 148 | var adv = Node.prototype.addEventListener; 149 | if (type === 'click') { 150 | adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) { 151 | if (!event.propagationStopped) { 152 | callback(event); 153 | } 154 | }), capture); 155 | } else { 156 | adv.call(layer, type, callback, capture); 157 | } 158 | }; 159 | } 160 | 161 | // If a handler is already declared in the element's onclick attribute, it will be fired before 162 | // FastClick's onClick handler. Fix this by pulling out the user-defined handler function and 163 | // adding it as listener. 164 | if (typeof layer.onclick === 'function') { 165 | 166 | // Android browser on at least 3.2 requires a new reference to the function in layer.onclick 167 | // - the old one won't work if passed to addEventListener directly. 168 | oldOnClick = layer.onclick; 169 | layer.addEventListener('click', function(event) { 170 | oldOnClick(event); 171 | }, false); 172 | layer.onclick = null; 173 | } 174 | } 175 | 176 | /** 177 | * Windows Phone 8.1 fakes user agent string to look like Android and iPhone. 178 | * 179 | * @type boolean 180 | */ 181 | var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0; 182 | 183 | /** 184 | * Android requires exceptions. 185 | * 186 | * @type boolean 187 | */ 188 | var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0 && !deviceIsWindowsPhone; 189 | 190 | 191 | /** 192 | * iOS requires exceptions. 193 | * 194 | * @type boolean 195 | */ 196 | var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone; 197 | 198 | 199 | /** 200 | * iOS 4 requires an exception for select elements. 201 | * 202 | * @type boolean 203 | */ 204 | var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent); 205 | 206 | 207 | /** 208 | * iOS 6.0-7.* requires the target element to be manually derived 209 | * 210 | * @type boolean 211 | */ 212 | var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS [6-7]_\d/).test(navigator.userAgent); 213 | 214 | /** 215 | * BlackBerry requires exceptions. 216 | * 217 | * @type boolean 218 | */ 219 | var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0; 220 | 221 | /** 222 | * Determine whether a given element requires a native click. 223 | * 224 | * @param {EventTarget|Element} target Target DOM element 225 | * @returns {boolean} Returns true if the element needs a native click 226 | */ 227 | FastClick.prototype.needsClick = function(target) { 228 | switch (target.nodeName.toLowerCase()) { 229 | 230 | // Don't send a synthetic click to disabled inputs (issue #62) 231 | case 'button': 232 | case 'select': 233 | case 'textarea': 234 | if (target.disabled) { 235 | return true; 236 | } 237 | 238 | break; 239 | case 'input': 240 | 241 | // File inputs need real clicks on iOS 6 due to a browser bug (issue #68) 242 | if ((deviceIsIOS && target.type === 'file') || target.disabled) { 243 | return true; 244 | } 245 | 246 | break; 247 | case 'label': 248 | case 'iframe': // iOS8 homescreen apps can prevent events bubbling into frames 249 | case 'video': 250 | return true; 251 | } 252 | 253 | return (/\bneedsclick\b/).test(target.className); 254 | }; 255 | 256 | 257 | /** 258 | * Determine whether a given element requires a call to focus to simulate click into element. 259 | * 260 | * @param {EventTarget|Element} target Target DOM element 261 | * @returns {boolean} Returns true if the element requires a call to focus to simulate native click. 262 | */ 263 | FastClick.prototype.needsFocus = function(target) { 264 | switch (target.nodeName.toLowerCase()) { 265 | case 'textarea': 266 | return true; 267 | case 'select': 268 | return !deviceIsAndroid; 269 | case 'input': 270 | switch (target.type) { 271 | case 'button': 272 | case 'checkbox': 273 | case 'file': 274 | case 'image': 275 | case 'radio': 276 | case 'submit': 277 | return false; 278 | } 279 | 280 | // No point in attempting to focus disabled inputs 281 | return !target.disabled && !target.readOnly; 282 | default: 283 | return (/\bneedsfocus\b/).test(target.className); 284 | } 285 | }; 286 | 287 | 288 | /** 289 | * Send a click event to the specified element. 290 | * 291 | * @param {EventTarget|Element} targetElement 292 | * @param {Event} event 293 | */ 294 | FastClick.prototype.sendClick = function(targetElement, event) { 295 | var clickEvent, touch; 296 | 297 | // On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24) 298 | if (document.activeElement && document.activeElement !== targetElement) { 299 | document.activeElement.blur(); 300 | } 301 | 302 | touch = event.changedTouches[0]; 303 | 304 | // Synthesise a click event, with an extra attribute so it can be tracked 305 | clickEvent = document.createEvent('MouseEvents'); 306 | clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null); 307 | clickEvent.forwardedTouchEvent = true; 308 | targetElement.dispatchEvent(clickEvent); 309 | }; 310 | 311 | FastClick.prototype.determineEventType = function(targetElement) { 312 | 313 | //Issue #159: Android Chrome Select Box does not open with a synthetic click event 314 | if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') { 315 | return 'mousedown'; 316 | } 317 | 318 | return 'click'; 319 | }; 320 | 321 | 322 | /** 323 | * @param {EventTarget|Element} targetElement 324 | */ 325 | FastClick.prototype.focus = function(targetElement) { 326 | var length; 327 | 328 | // Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724. 329 | if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') { 330 | length = targetElement.value.length; 331 | targetElement.setSelectionRange(length, length); 332 | } else { 333 | targetElement.focus(); 334 | } 335 | }; 336 | 337 | 338 | /** 339 | * Check whether the given target element is a child of a scrollable layer and if so, set a flag on it. 340 | * 341 | * @param {EventTarget|Element} targetElement 342 | */ 343 | FastClick.prototype.updateScrollParent = function(targetElement) { 344 | var scrollParent, parentElement; 345 | 346 | scrollParent = targetElement.fastClickScrollParent; 347 | 348 | // Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the 349 | // target element was moved to another parent. 350 | if (!scrollParent || !scrollParent.contains(targetElement)) { 351 | parentElement = targetElement; 352 | do { 353 | if (parentElement.scrollHeight > parentElement.offsetHeight) { 354 | scrollParent = parentElement; 355 | targetElement.fastClickScrollParent = parentElement; 356 | break; 357 | } 358 | 359 | parentElement = parentElement.parentElement; 360 | } while (parentElement); 361 | } 362 | 363 | // Always update the scroll top tracker if possible. 364 | if (scrollParent) { 365 | scrollParent.fastClickLastScrollTop = scrollParent.scrollTop; 366 | } 367 | }; 368 | 369 | 370 | /** 371 | * @param {EventTarget} targetElement 372 | * @returns {Element|EventTarget} 373 | */ 374 | FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) { 375 | 376 | // On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node. 377 | if (eventTarget.nodeType === Node.TEXT_NODE) { 378 | return eventTarget.parentNode; 379 | } 380 | 381 | return eventTarget; 382 | }; 383 | 384 | 385 | /** 386 | * On touch start, record the position and scroll offset. 387 | * 388 | * @param {Event} event 389 | * @returns {boolean} 390 | */ 391 | FastClick.prototype.onTouchStart = function(event) { 392 | var targetElement, touch, selection; 393 | 394 | // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111). 395 | if (event.targetTouches.length > 1) { 396 | return true; 397 | } 398 | 399 | targetElement = this.getTargetElementFromEventTarget(event.target); 400 | touch = event.targetTouches[0]; 401 | 402 | if (deviceIsIOS) { 403 | 404 | // Only trusted events will deselect text on iOS (issue #49) 405 | selection = window.getSelection(); 406 | if (selection.rangeCount && !selection.isCollapsed) { 407 | return true; 408 | } 409 | 410 | if (!deviceIsIOS4) { 411 | 412 | // Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23): 413 | // when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched 414 | // with the same identifier as the touch event that previously triggered the click that triggered the alert. 415 | // Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an 416 | // immediately preceeding touch event (issue #52), so this fix is unavailable on that platform. 417 | // Issue 120: touch.identifier is 0 when Chrome dev tools 'Emulate touch events' is set with an iOS device UA string, 418 | // which causes all touch events to be ignored. As this block only applies to iOS, and iOS identifiers are always long, 419 | // random integers, it's safe to to continue if the identifier is 0 here. 420 | if (touch.identifier && touch.identifier === this.lastTouchIdentifier) { 421 | event.preventDefault(); 422 | return false; 423 | } 424 | 425 | this.lastTouchIdentifier = touch.identifier; 426 | 427 | // If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and: 428 | // 1) the user does a fling scroll on the scrollable layer 429 | // 2) the user stops the fling scroll with another tap 430 | // then the event.target of the last 'touchend' event will be the element that was under the user's finger 431 | // when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check 432 | // is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42). 433 | this.updateScrollParent(targetElement); 434 | } 435 | } 436 | 437 | this.trackingClick = true; 438 | this.trackingClickStart = event.timeStamp; 439 | this.targetElement = targetElement; 440 | 441 | this.touchStartX = touch.pageX; 442 | this.touchStartY = touch.pageY; 443 | 444 | // Prevent phantom clicks on fast double-tap (issue #36) 445 | if ((event.timeStamp - this.lastClickTime) < this.tapDelay) { 446 | event.preventDefault(); 447 | } 448 | 449 | return true; 450 | }; 451 | 452 | 453 | /** 454 | * Based on a touchmove event object, check whether the touch has moved past a boundary since it started. 455 | * 456 | * @param {Event} event 457 | * @returns {boolean} 458 | */ 459 | FastClick.prototype.touchHasMoved = function(event) { 460 | var touch = event.changedTouches[0], boundary = this.touchBoundary; 461 | 462 | if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) { 463 | return true; 464 | } 465 | 466 | return false; 467 | }; 468 | 469 | 470 | /** 471 | * Update the last position. 472 | * 473 | * @param {Event} event 474 | * @returns {boolean} 475 | */ 476 | FastClick.prototype.onTouchMove = function(event) { 477 | if (!this.trackingClick) { 478 | return true; 479 | } 480 | 481 | // If the touch has moved, cancel the click tracking 482 | if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) { 483 | this.trackingClick = false; 484 | this.targetElement = null; 485 | } 486 | 487 | return true; 488 | }; 489 | 490 | 491 | /** 492 | * Attempt to find the labelled control for the given label element. 493 | * 494 | * @param {EventTarget|HTMLLabelElement} labelElement 495 | * @returns {Element|null} 496 | */ 497 | FastClick.prototype.findControl = function(labelElement) { 498 | 499 | // Fast path for newer browsers supporting the HTML5 control attribute 500 | if (labelElement.control !== undefined) { 501 | return labelElement.control; 502 | } 503 | 504 | // All browsers under test that support touch events also support the HTML5 htmlFor attribute 505 | if (labelElement.htmlFor) { 506 | return document.getElementById(labelElement.htmlFor); 507 | } 508 | 509 | // If no for attribute exists, attempt to retrieve the first labellable descendant element 510 | // the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label 511 | return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea'); 512 | }; 513 | 514 | 515 | /** 516 | * On touch end, determine whether to send a click event at once. 517 | * 518 | * @param {Event} event 519 | * @returns {boolean} 520 | */ 521 | FastClick.prototype.onTouchEnd = function(event) { 522 | var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement; 523 | 524 | if (!this.trackingClick) { 525 | return true; 526 | } 527 | 528 | // Prevent phantom clicks on fast double-tap (issue #36) 529 | if ((event.timeStamp - this.lastClickTime) < this.tapDelay) { 530 | this.cancelNextClick = true; 531 | return true; 532 | } 533 | 534 | if ((event.timeStamp - this.trackingClickStart) > this.tapTimeout) { 535 | return true; 536 | } 537 | 538 | // Reset to prevent wrong click cancel on input (issue #156). 539 | this.cancelNextClick = false; 540 | 541 | this.lastClickTime = event.timeStamp; 542 | 543 | trackingClickStart = this.trackingClickStart; 544 | this.trackingClick = false; 545 | this.trackingClickStart = 0; 546 | 547 | // On some iOS devices, the targetElement supplied with the event is invalid if the layer 548 | // is performing a transition or scroll, and has to be re-detected manually. Note that 549 | // for this to function correctly, it must be called *after* the event target is checked! 550 | // See issue #57; also filed as rdar://13048589 . 551 | if (deviceIsIOSWithBadTarget) { 552 | touch = event.changedTouches[0]; 553 | 554 | // In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null 555 | targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement; 556 | targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent; 557 | } 558 | 559 | targetTagName = targetElement.tagName.toLowerCase(); 560 | if (targetTagName === 'label') { 561 | forElement = this.findControl(targetElement); 562 | if (forElement) { 563 | this.focus(targetElement); 564 | if (deviceIsAndroid) { 565 | return false; 566 | } 567 | 568 | targetElement = forElement; 569 | } 570 | } else if (this.needsFocus(targetElement)) { 571 | 572 | // Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through. 573 | // Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37). 574 | if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) { 575 | this.targetElement = null; 576 | return false; 577 | } 578 | 579 | this.focus(targetElement); 580 | this.sendClick(targetElement, event); 581 | 582 | // Select elements need the event to go through on iOS 4, otherwise the selector menu won't open. 583 | // Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others) 584 | if (!deviceIsIOS || targetTagName !== 'select') { 585 | this.targetElement = null; 586 | event.preventDefault(); 587 | } 588 | 589 | return false; 590 | } 591 | 592 | if (deviceIsIOS && !deviceIsIOS4) { 593 | 594 | // Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled 595 | // and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42). 596 | scrollParent = targetElement.fastClickScrollParent; 597 | if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) { 598 | return true; 599 | } 600 | } 601 | 602 | // Prevent the actual click from going though - unless the target node is marked as requiring 603 | // real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted. 604 | if (!this.needsClick(targetElement)) { 605 | event.preventDefault(); 606 | this.sendClick(targetElement, event); 607 | } 608 | 609 | return false; 610 | }; 611 | 612 | 613 | /** 614 | * On touch cancel, stop tracking the click. 615 | * 616 | * @returns {void} 617 | */ 618 | FastClick.prototype.onTouchCancel = function() { 619 | this.trackingClick = false; 620 | this.targetElement = null; 621 | }; 622 | 623 | 624 | /** 625 | * Determine mouse events which should be permitted. 626 | * 627 | * @param {Event} event 628 | * @returns {boolean} 629 | */ 630 | FastClick.prototype.onMouse = function(event) { 631 | 632 | // If a target element was never set (because a touch event was never fired) allow the event 633 | if (!this.targetElement) { 634 | return true; 635 | } 636 | 637 | if (event.forwardedTouchEvent) { 638 | return true; 639 | } 640 | 641 | // Programmatically generated events targeting a specific element should be permitted 642 | if (!event.cancelable) { 643 | return true; 644 | } 645 | 646 | // Derive and check the target element to see whether the mouse event needs to be permitted; 647 | // unless explicitly enabled, prevent non-touch click events from triggering actions, 648 | // to prevent ghost/doubleclicks. 649 | if (!this.needsClick(this.targetElement) || this.cancelNextClick) { 650 | 651 | // Prevent any user-added listeners declared on FastClick element from being fired. 652 | if (event.stopImmediatePropagation) { 653 | event.stopImmediatePropagation(); 654 | } else { 655 | 656 | // Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2) 657 | event.propagationStopped = true; 658 | } 659 | 660 | // Cancel the event 661 | event.stopPropagation(); 662 | event.preventDefault(); 663 | 664 | return false; 665 | } 666 | 667 | // If the mouse event is permitted, return true for the action to go through. 668 | return true; 669 | }; 670 | 671 | 672 | /** 673 | * On actual clicks, determine whether this is a touch-generated click, a click action occurring 674 | * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or 675 | * an actual click which should be permitted. 676 | * 677 | * @param {Event} event 678 | * @returns {boolean} 679 | */ 680 | FastClick.prototype.onClick = function(event) { 681 | var permitted; 682 | 683 | // It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early. 684 | if (this.trackingClick) { 685 | this.targetElement = null; 686 | this.trackingClick = false; 687 | return true; 688 | } 689 | 690 | // Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target. 691 | if (event.target.type === 'submit' && event.detail === 0) { 692 | return true; 693 | } 694 | 695 | permitted = this.onMouse(event); 696 | 697 | // Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through. 698 | if (!permitted) { 699 | this.targetElement = null; 700 | } 701 | 702 | // If clicks are permitted, return true for the action to go through. 703 | return permitted; 704 | }; 705 | 706 | 707 | /** 708 | * Remove all FastClick's event listeners. 709 | * 710 | * @returns {void} 711 | */ 712 | FastClick.prototype.destroy = function() { 713 | var layer = this.layer; 714 | 715 | if (deviceIsAndroid) { 716 | layer.removeEventListener('mouseover', this.onMouse, true); 717 | layer.removeEventListener('mousedown', this.onMouse, true); 718 | layer.removeEventListener('mouseup', this.onMouse, true); 719 | } 720 | 721 | layer.removeEventListener('click', this.onClick, true); 722 | layer.removeEventListener('touchstart', this.onTouchStart, false); 723 | layer.removeEventListener('touchmove', this.onTouchMove, false); 724 | layer.removeEventListener('touchend', this.onTouchEnd, false); 725 | layer.removeEventListener('touchcancel', this.onTouchCancel, false); 726 | }; 727 | 728 | 729 | /** 730 | * Check whether FastClick is needed. 731 | * 732 | * @param {Element} layer The layer to listen on 733 | */ 734 | FastClick.notNeeded = function(layer) { 735 | var metaViewport; 736 | var chromeVersion; 737 | var blackberryVersion; 738 | var firefoxVersion; 739 | 740 | // Devices that don't support touch don't need FastClick 741 | if (typeof window.ontouchstart === 'undefined') { 742 | return true; 743 | } 744 | 745 | // Chrome version - zero for other browsers 746 | chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1]; 747 | 748 | if (chromeVersion) { 749 | 750 | if (deviceIsAndroid) { 751 | metaViewport = document.querySelector('meta[name=viewport]'); 752 | 753 | if (metaViewport) { 754 | // Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89) 755 | if (metaViewport.content.indexOf('user-scalable=no') !== -1) { 756 | return true; 757 | } 758 | // Chrome 32 and above with width=device-width or less don't need FastClick 759 | if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) { 760 | return true; 761 | } 762 | } 763 | 764 | // Chrome desktop doesn't need FastClick (issue #15) 765 | } else { 766 | return true; 767 | } 768 | } 769 | 770 | if (deviceIsBlackBerry10) { 771 | blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/); 772 | 773 | // BlackBerry 10.3+ does not require Fastclick library. 774 | // https://github.com/ftlabs/fastclick/issues/251 775 | if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) { 776 | metaViewport = document.querySelector('meta[name=viewport]'); 777 | 778 | if (metaViewport) { 779 | // user-scalable=no eliminates click delay. 780 | if (metaViewport.content.indexOf('user-scalable=no') !== -1) { 781 | return true; 782 | } 783 | // width=device-width (or less than device-width) eliminates click delay. 784 | if (document.documentElement.scrollWidth <= window.outerWidth) { 785 | return true; 786 | } 787 | } 788 | } 789 | } 790 | 791 | // IE10 with -ms-touch-action: none or manipulation, which disables double-tap-to-zoom (issue #97) 792 | if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') { 793 | return true; 794 | } 795 | 796 | // Firefox version - zero for other browsers 797 | firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1]; 798 | 799 | if (firefoxVersion >= 27) { 800 | // Firefox 27+ does not have tap delay if the content is not zoomable - https://bugzilla.mozilla.org/show_bug.cgi?id=922896 801 | 802 | metaViewport = document.querySelector('meta[name=viewport]'); 803 | if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) { 804 | return true; 805 | } 806 | } 807 | 808 | // IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version 809 | // http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx 810 | if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') { 811 | return true; 812 | } 813 | 814 | return false; 815 | }; 816 | 817 | 818 | /** 819 | * Factory method for creating a FastClick object 820 | * 821 | * @param {Element} layer The layer to listen on 822 | * @param {Object} [options={}] The options to override the defaults 823 | */ 824 | FastClick.attach = function(layer, options) { 825 | return new FastClick(layer, options); 826 | }; 827 | 828 | 829 | if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) { 830 | 831 | // AMD. Register as an anonymous module. 832 | define(function() { 833 | return FastClick; 834 | }); 835 | } else if (typeof module !== 'undefined' && module.exports) { 836 | module.exports = FastClick.attach; 837 | module.exports.FastClick = FastClick; 838 | } else { 839 | window.FastClick = FastClick; 840 | } 841 | }()); 842 | -------------------------------------------------------------------------------- /App-Launcher/html/js/main.js: -------------------------------------------------------------------------------- 1 | var audio = new Audio('change_screen.ogg'); 2 | var color = ['#ee6675','#00979a','#e64d40','#009667','#85c553','#814a74','#f58239'];var current_color=0; 3 | 4 | $(document).ready( 5 | function() { 6 | FastClick.attach(document.body); 7 | } 8 | ); 9 | 10 | /*** 11 | DISPLAY MANAGER: displays the right content 12 | ***/ 13 | var current_displayed_state = "Loading"; 14 | function display_state(new_state){ 15 | if(new_state == current_displayed_state) { 16 | console.log("Display state "+new_state+" which is already displayed, doing nothing.") 17 | } 18 | console.info("display state: "+new_state); 19 | $("#content_div").children().hide(); 20 | if(new_state == "content_ready_div") { 21 | $(".to_hide_when_not_ready").show(); 22 | } else { 23 | $(".to_hide_when_not_ready").hide(); 24 | } 25 | $("#"+new_state).show(); 26 | } 27 | var current_page_displayed = "Home"; 28 | function display_page(new_page) { 29 | if(new_page == current_page_displayed) { 30 | console.log("Display page "+new_page+" which is already displayed, doing nothing.") 31 | } 32 | console.info("display page: "+new_page); 33 | $("#content_ready_div").children().hide(); 34 | if(new_page != "dynamic_pageHome_div") { 35 | $("#button_home").show(); 36 | } else { 37 | $("#button_home").hide(); 38 | } 39 | $("#"+new_page).show(); 40 | } 41 | function display_mute_button() { 42 | $("#button_unmute").hide(); 43 | $("#button_mute").show(); 44 | } 45 | function display_unmute_button() { 46 | $("#button_mute").hide(); 47 | $("#button_unmute").show(); 48 | } 49 | function display_apps_names(display) { 50 | if(display){ 51 | $(".dynamic_page_app_button>div").show(); 52 | } else { 53 | $(".dynamic_page_app_button>div").hide(); 54 | } 55 | } 56 | 57 | /*** 58 | PAGES MANAGER: creates the pages 59 | ***/ 60 | 61 | function make_color(){ 62 | //To get color from the list in random order 63 | // var new_color = color[Math.floor(Math.random() * color.length)]; 64 | var new_color = color[current_color]; 65 | current_color += 1; 66 | if(current_color==color.length) current_color=0; 67 | return new_color; 68 | } 69 | function add_app_to_full_apps_list(id, launch_path, icon, name) { 70 | var element_id = "dynamic_all_apps_app_"+id; 71 | var div_id = element_id+'_div' 72 | var image_id = element_id+'_img' 73 | var name_id = element_id+'_name' 74 | 75 | // Add containers for app's name and app's icon 76 | $("#footer_all_apps_dropdown").append( 77 | '
'+ 78 | ''+ 79 | '
'+name+'
'+ 80 | '
'); 81 | $("#"+div_id).off('click'); 82 | $("#"+div_id).on('click', function(){ 83 | $("#"+div_id).blur(); 84 | audio.play(); 85 | requestRunBehavior(launch_path); 86 | }); 87 | } 88 | function add_app_to_page(page_div_id, app_id, name, launch_path, icon) { 89 | // Add app button 90 | var nbApps = $("#"+page_div_id).find(".dynamic_page_app_button").length; 91 | var line=1; 92 | if(nbApps%2 == 1) line=2; 93 | var parent_div_class = "#"+page_div_id+" .dynamic_page_line"+line+"_div" 94 | var app_button_id = page_div_id+"_button"+app_id 95 | $(parent_div_class).append(''+ 96 | '
'+ 97 | ''+ 98 | '
'+name+'
'+ 99 | '
'); 100 | 101 | // add button action on click 102 | $("#"+app_button_id).off('touchmove click'); 103 | $("#"+app_button_id).on('touchmove click', function(){ 104 | $("#"+app_button_id).blur(); 105 | audio.play(); 106 | requestRunBehavior(launch_path); 107 | }); 108 | 109 | // make sure icons are aligned correctly depending on how many are on each line 110 | var nbButtonsLine1 = $("#"+page_div_id+" .dynamic_page_line1_div").children().length; 111 | var nbButtonsLine2 = $("#"+page_div_id+" .dynamic_page_line2_div").children().length; 112 | if((nbButtonsLine1-nbButtonsLine2)%2 == 0) { 113 | $("#"+page_div_id+" .dynamic_page_line2_div").addClass("line2_div_right"); 114 | } else { 115 | $("#"+page_div_id+" .dynamic_page_line2_div").removeClass("line2_div_right"); 116 | } 117 | } 118 | function add_page(id, name, apps) { 119 | //console.log("Adding page "+id) 120 | var identifier = "dynamic_page"+id 121 | 122 | // Add the page div 123 | var page_div_id = identifier+'_div'; 124 | $("#content_ready_div").append( 125 | ''); 129 | 130 | // Add apps to the page 131 | for(var app_id in apps) { 132 | var app_name = apps[app_id]["name"]; 133 | var launch_path = apps[app_id]["uuid"]+"/"+apps[app_id]["behavior_path"]; 134 | var icon = apps[app_id]["icon"]; 135 | add_app_to_page(page_div_id, app_id, app_name, launch_path, icon); 136 | } 137 | 138 | // Add page button on home page 139 | var nbButtons = $(".dynamic_pageHome_app_button").length; 140 | var line=1; 141 | if(nbButtons%2 == 1) line=2; 142 | var parent_div_class = "#dynamic_pageHome_div .dynamic_pageHome_line"+line+"_div" 143 | var button_div_id = "content_ready_pageHome_button_"+id 144 | $(parent_div_class).append( 145 | '
'+ 146 | '
'+name+'
'+ 147 | '
'); 148 | $('#'+button_div_id).children().css('background-color', make_color()); 149 | 150 | // add home button action on click 151 | $("#"+button_div_id).off('touchmove click'); 152 | $("#"+button_div_id).on('touchmove click', function(){ 153 | $("#"+button_div_id).blur(); 154 | audio.play(); 155 | requestPage(id); 156 | }); 157 | 158 | // make sure icons are aligned correctly depending on how many are on each line 159 | var nbButtonsLine1 = $("#dynamic_pageHome_div .dynamic_pageHome_line1_div").children().length; 160 | var nbButtonsLine2 = $("#dynamic_pageHome_div .dynamic_pageHome_line2_div").children().length; 161 | if((nbButtonsLine1-nbButtonsLine2)%2 == 0) { 162 | $("#dynamic_pageHome_div .dynamic_pageHome_line2_div").addClass("line2_div_right"); 163 | } else { 164 | $("#dynamic_pageHome_div .dynamic_pageHome_line2_div").removeClass("line2_div_right"); 165 | } 166 | 167 | 168 | } 169 | 170 | /*** 171 | CALLBACKS TO REACT TO APPLAUNCHER SIGNALS 172 | ***/ 173 | 174 | // Declare all callbacks 175 | function onCurrentStateChanged(state, behaviorName) { 176 | // AppLauncher state can be ready, running, sleeping 177 | // if no state, display a spinner. 178 | console.log("State changed: " + state); 179 | if (state == "ready") display_state("content_ready_div"); 180 | else if (state == "running") { } 181 | else if (state == "sleeping") display_state("content_sleeping_div"); 182 | else display_state("content_loading_div"); 183 | } 184 | function onCurrentPageChanged(new_page_displayed) { 185 | console.info("Page to display: "+new_page_displayed); 186 | display_page("dynamic_page"+new_page_displayed+"_div") 187 | } 188 | function onAppFullListChanged(new_app_list) { 189 | console.info("New app list") 190 | //console.info(new_app_list) 191 | $("#footer_all_apps_dropdown").html(""); 192 | for (var id in new_app_list) { 193 | var launch_path = new_app_list[id]["uuid"]+"/"+new_app_list[id]["behavior_path"] 194 | var name = new_app_list[id]["name"] 195 | var icon_url = new_app_list[id]["icon"] 196 | add_app_to_full_apps_list(id, launch_path, icon_url, name); 197 | } 198 | } 199 | function onPagesDefinitionChanged(new_page_definition) { 200 | console.info("New pages definition") 201 | //console.info(new_page_definition) 202 | $("#content_ready_div").html( 203 | '
'+ 204 | '
'+ 205 | '
'+ 206 | '
'); 207 | for (var id in new_page_definition) { 208 | var name = new_page_definition[id]["title"] 209 | var apps = new_page_definition[id]["apps"] 210 | add_page(id, name, apps); 211 | } 212 | } 213 | function onAutonomousEnabledChanged(state) { 214 | console.log("Robot is proactive:"+state); 215 | if(state) { 216 | display_mute_button(); 217 | } else { 218 | display_unmute_button(); 219 | } 220 | } 221 | function onDisplayAppNameChanged(state) { 222 | display_apps_names(state); 223 | } 224 | function onPingRequired(max_delay) { 225 | console.log("Ping required before "+max_delay+"s."); 226 | ping(); 227 | 228 | } 229 | 230 | // Connect signals with callbacks 231 | session.service("AppLauncher").then( 232 | function(ap) { 233 | ap.current_state.connect(onCurrentStateChanged); 234 | ap.current_page.connect(onCurrentPageChanged); 235 | ap.apps_full_list.connect(onAppFullListChanged); 236 | ap.pages_definition.connect(onPagesDefinitionChanged); 237 | ap.autonomous_enabled.connect(onAutonomousEnabledChanged); 238 | ap.display_app_name.connect(onDisplayAppNameChanged); 239 | ap.ping_required.connect(onPingRequired); 240 | } 241 | ); 242 | 243 | // Initialize all states 244 | $(document).ready( 245 | function(){ 246 | session.service("AppLauncher").then( function(ap) { 247 | ap.current_state.value().then(onCurrentStateChanged); 248 | ap.current_page.value().then(onCurrentPageChanged); 249 | ap.apps_full_list.value().then(onAppFullListChanged); 250 | ap.pages_definition.value().then(onPagesDefinitionChanged); 251 | ap.autonomous_enabled.value().then(onAutonomousEnabledChanged); 252 | ap.display_app_name.value().then(onDisplayAppNameChanged); 253 | onPingRequired(2); 254 | }); 255 | } 256 | ); 257 | 258 | /*** 259 | FUNCTIONS TO CALL APPLAUNCHER METHODS 260 | ***/ 261 | 262 | // Declare all functions 263 | function ping() { 264 | console.log("Ping AppLauncher service asking a 5s delay before next request."); 265 | session.service("AppLauncher").then( function(ap) { 266 | ap.ping(5); 267 | }); 268 | } 269 | function requestPage(page_id){ 270 | console.log("Requesting page change to page: "+page_id); 271 | session.service("AppLauncher").then( function(ap) { 272 | ap.current_page.setValue(page_id); 273 | }); 274 | } 275 | function requestVolumeChange(diff){ 276 | console.log("Requesting volume change: "+diff); 277 | session.service("AppLauncher").then( function(ap) { 278 | ap.adjustVolume(diff); 279 | }); 280 | } 281 | function requestAutonomousEnabled(state){ 282 | console.log("Request autonomous to be: ", state); 283 | session.service("AppLauncher").then( function(ap) { 284 | ap.autonomous_enabled.setValue(state); 285 | }); 286 | } 287 | function requestRunBehavior(launch_path) { 288 | console.info("Request run behavior: "+launch_path); 289 | session.service("AppLauncher").then( function(ap) { 290 | ap.runBehavior(launch_path); 291 | }); 292 | } 293 | 294 | // Connect buttons with functions 295 | $(document).ready( 296 | function() { 297 | $('#button_home').on('touchmove click', function(){ 298 | requestPage("Home"); 299 | }); 300 | $('#button_volume_up').on('touchmove click', function(e){ 301 | requestVolumeChange(20); 302 | e.stopPropagation(); 303 | }); 304 | $('#button_volume_down').on('touchmove click', function(e){ 305 | requestVolumeChange(-20); 306 | e.stopPropagation(); 307 | }); 308 | $('#button_unmute').on('touchmove click', function(e){ 309 | requestAutonomousEnabled(true); 310 | e.stopPropagation(); 311 | }); 312 | $('#button_mute').on('touchmove click', function(e){ 313 | requestAutonomousEnabled(false); 314 | e.stopPropagation(); 315 | }); 316 | $('button').on("click", function(){ 317 | this.blur(); 318 | audio.play(); 319 | }); 320 | } 321 | ); 322 | -------------------------------------------------------------------------------- /App-Launcher/html/js/robotutils.js: -------------------------------------------------------------------------------- 1 | session = (function(self, $) { 2 | 3 | self = new Promise(function(resolve, reject) { 4 | // Private helper functions 5 | function _getRobotIp() { 6 | var regex = new RegExp("[\\?&]robot=([^&#]*)"); 7 | var results = regex.exec(location.search); 8 | return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ").replace("/", "")); 9 | } 10 | var robotIp = _getRobotIp(); 11 | // Session promise 12 | var robotAddress = ""; 13 | var qimAddress = null; 14 | if (robotIp) { 15 | // Special case: we're doing remote debugging on a robot. 16 | robotAddress = "http://" + robotIp; 17 | qimAddress = robotIp + ":80"; 18 | } 19 | $.getScript(robotAddress + '/libs/qimessaging/2/qimessaging.js', function() { 20 | QiSession( resolve, reject, qimAddress ); 21 | }).fail(function() { 22 | var error = "Failed to get qimessaging.js"; 23 | if (robotIp) { 24 | error = error + " from robot: " + robotIp; 25 | } else { 26 | error = error + " from local domain; host this app on a robot or add a ?robot=MY-ROBOT-IP to the URL."; 27 | } 28 | reject(error); 29 | }); 30 | }); 31 | 32 | self._servicePromises = {}; 33 | self.service = function(s) { 34 | return new Promise(function(resolve, reject) { 35 | if ( s in self._servicePromises ) { 36 | resolve( self._servicePromises[s] ); 37 | } else { 38 | self.then(function(session) { 39 | self._servicePromises[s] = session.service(s); 40 | resolve( self._servicePromises[s] ); 41 | }, function() { 42 | reject("Failed getting " + s); 43 | }); 44 | } 45 | }); 46 | }; 47 | 48 | function MemoryEventSubscription(event) { 49 | this._event = event; 50 | this._internalId = null; 51 | this._sub = null; 52 | this._unsubscribe = false; 53 | } 54 | 55 | MemoryEventSubscription.prototype.setId = function(id) { 56 | this._internalId = id; 57 | // as id can be receveid after unsubscribe call, defere 58 | if (this._unsubscribe) this.unsubscribe(this._unsubscribeCallback) 59 | } 60 | 61 | MemoryEventSubscription.prototype.setSubscriber = function(sub) { 62 | this._sub = sub; 63 | // as sub can be receveid after unsubscribe call, defere 64 | if (this._unsubscribe) this.unsubscribe(this._unsubscribeCallback) 65 | } 66 | 67 | MemoryEventSubscription.prototype.unsubscribe = function(unsubscribeDoneCallback) 68 | { 69 | if (this._internalId != null && this._sub != null) { 70 | evtSubscription = this; 71 | evtSubscription._sub.signal.disconnect(evtSubscription._internalId).then(function() { 72 | if (unsubscribeDoneCallback) unsubscribeDoneCallback(); 73 | }, self.onQimError); 74 | } 75 | else 76 | { 77 | this._unsubscribe = true; 78 | this._unsubscribeCallback = unsubscribeDoneCallback; 79 | } 80 | } 81 | 82 | 83 | self.subscribeToEvent = function(event, eventCallback) { 84 | return new Promise(function(resolve, reject) { 85 | var evt = new MemoryEventSubscription(event); 86 | self.service("ALMemory").then( function(ALMemory) { 87 | ALMemory.subscriber(event).then( function (sub) { 88 | evt.setSubscriber(sub); 89 | sub.signal.connect(eventCallback).then( function(id) { 90 | evt.setId(id); 91 | resolve(evt); 92 | }, reject); 93 | }, reject); 94 | }); 95 | }); 96 | } 97 | 98 | self.raiseEvent = function (event, data) { 99 | return new Promise(function(resolve, reject) { 100 | self.service("ALMemory").then( function(proxy) { 101 | proxy.raiseEvent(event, data).catch(reject); 102 | }).catch(reject); 103 | }); 104 | } 105 | 106 | 107 | self.getData = function(key) { 108 | return new Promise(function(resolve, reject) { 109 | session.service("ALMemory").then( function(proxy) { 110 | proxy.getData(key).then(resolve, reject); 111 | }); 112 | }); 113 | } 114 | 115 | return self; 116 | 117 | 118 | })(window.QimSession || {}, jQuery); 119 | -------------------------------------------------------------------------------- /App-Launcher/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/App-Launcher/icon.png -------------------------------------------------------------------------------- /App-Launcher/lib/app_launcher.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import qi 3 | import sys 4 | from app_list_manager import AppListManager 5 | from view_manager import ViewManager 6 | from preferences_manager import PreferencesManager 7 | from dialog_manager import DialogManager 8 | import helpers 9 | 10 | 11 | class AppLauncher: 12 | 13 | @qi.nobind 14 | def __init__(self, session=None): 15 | self._session = session 16 | self._module_name = self.__class__.__name__ 17 | self.__name__ = self._module_name 18 | self._logger = qi.Logger(self._module_name) 19 | self._logger.info(":::: Starting {} ::::".format(self._module_name)) 20 | self._pref_domain = "tool.applauncher" # @TODO: "com.sbr.apps.app-launcher" 21 | 22 | # public variables 23 | self._logger.info("Initializing public variables...") 24 | self.current_state = qi.Property("s") 25 | self.current_state.setValue("") 26 | self.current_page = qi.Property("s") 27 | self.current_page.setValue("Home") 28 | self.apps_full_list = qi.Property() 29 | self.apps_full_list.setValue({}) 30 | self.pages_definition = qi.Property() 31 | self.pages_definition.setValue({}) 32 | self.autonomous_enabled = qi.Property("b") 33 | self.autonomous_enabled.setValue(True) 34 | self.display_app_name = qi.Property("b") 35 | self.display_app_name.setValue(True) 36 | self.ping_required = qi.Signal("(i)") 37 | 38 | # internal variables 39 | self._logger.info("Initializing internal variables...") 40 | self._app_uuid = helpers.find_app_name(self._logger) 41 | self._current_app = "" 42 | self._preferences_manager = PreferencesManager(self._logger, self._session, self._pref_domain) 43 | self._app_list_manager = AppListManager(self._logger, self._session, self._preferences_manager, 44 | self._app_uuid, self.apps_full_list, self.pages_definition) 45 | self._view_manager = ViewManager(self._logger, self._session, self._preferences_manager, 46 | self._app_uuid, self.current_state, self.ping_required) 47 | self._dialog_manager = DialogManager(self._logger, self._session, self._preferences_manager, 48 | self.pages_definition, self.autonomous_enabled, self.current_page) 49 | 50 | _pref_display_app_name = self._preferences_manager.get_value('behaviorNameDisplayed', True) 51 | if _pref_display_app_name: 52 | self.display_app_name.setValue(True) 53 | else: 54 | self.display_app_name.setValue(False) 55 | 56 | self._logger.info(":::: Ready! ::::") 57 | 58 | @qi.nobind 59 | def cleanup(self): 60 | try: 61 | self._logger.info(":::: Stopping app launcher... ::::") 62 | except NameError: 63 | print "╔══════════════════════════╦══════════════════════════╗" 64 | print "║ End of automatic logging ║ was the app uninstalled? ║" 65 | print "╚══════════════════════════╩══════════════════════════╝" 66 | 67 | class DummyLog: 68 | def __init__(self): 69 | pass 70 | 71 | @staticmethod 72 | def verbose(*args): 73 | for a in args: 74 | print "verbose: {}".format(a) 75 | 76 | @staticmethod 77 | def info(*args): 78 | for a in args: 79 | print "info: {}".format(a) 80 | 81 | @staticmethod 82 | def warning(*args): 83 | for a in args: 84 | print "warning: {}".format(a) 85 | 86 | @staticmethod 87 | def error(*args): 88 | for a in args: 89 | print "error: {}".format(a) 90 | 91 | self._logger = DummyLog() 92 | self._dialog_manager._logger = self._logger 93 | self._view_manager._logger = self._logger 94 | self._app_list_manager._logger = self._logger 95 | self._app_list_manager._icons_storage._logger = self._logger 96 | self._preferences_manager._logger = self._logger 97 | try: 98 | # clean variables 99 | self._dialog_manager.cleanup() 100 | self._view_manager.cleanup() 101 | self._app_list_manager.cleanup() 102 | self._preferences_manager.cleanup() 103 | except Exception as e: 104 | self._logger.info("error while stopping app launcher: {}".format(e)) 105 | 106 | # Reset states 107 | try: 108 | basic = self._session.service("ALBasicAwareness") 109 | basic.setEnabled(True) 110 | except Exception as e: 111 | self._logger.info("error while configuring ALBasicAwareness: {}".format(e)) 112 | 113 | self._logger.info(":::: Stopped! ::::") 114 | 115 | """ 116 | Public bound functions 117 | """ 118 | @qi.bind(paramsType=[qi.Int32], returnType=qi.Void, methodName="ping") 119 | def ping(self, seconds_before_next_ping_request): 120 | """ This function should be called by the web page to signal that it is still alive. 121 | When the signal ping_required is raised, the web page should call this function. 122 | In case ping is not called in time, the tablet will be reset. 123 | 124 | Argument: delay in seconds before next ping will be asked.""" 125 | self._view_manager.ping(seconds_before_next_ping_request) 126 | 127 | @qi.bind(paramsType=[], returnType=qi.Void, methodName="_updateAppList") 128 | def _update_app_list(self): 129 | """ Reload the list of applications and pages.""" 130 | self._app_list_manager.update_app_lists(None, True) 131 | 132 | @qi.bind(paramsType=[qi.String], returnType=qi.Void, methodName="runBehavior") 133 | def run_behavior(self, behavior): 134 | """ Ask autonomous life to start a given behavior and check if the launch was ok after 15s. 135 | 136 | Argument: behavior to launch.""" 137 | try: 138 | # If an error occurs during launch, the tablet will be displayed again 139 | app_launched_check = qi.async(self._view_manager.display_view, delay=15000000) 140 | # Life switch focus to the chosen app 141 | life = self._session.service("ALAutonomousLife") 142 | life.switchFocus(behavior) 143 | self._logger.info("Switch focus") 144 | app_launched_check.cancel() 145 | self._logger.info("Application launch end") 146 | 147 | except Exception as e: 148 | self._logger.error("Run behavior error: " + str(e)) 149 | 150 | @qi.bind(paramsType=[], returnType=qi.Void, methodName="stopBehavior") 151 | def stop_behavior(self): 152 | """ Stop the current running behavior. """ 153 | self._session.service('ALBehaviorManager').stop_behavior(self._current_app) 154 | self._logger.info("Stop behavior: {}" .format(self._current_app)) 155 | 156 | @qi.bind(paramsType=[qi.Int32], returnType=qi.Void, methodName="adjustVolume") 157 | def adjust_volume(self, diff): 158 | """ Change the robot volume. The volume will not go higher than 100% or lower than 20%. 159 | 160 | Argument: delta (positive or negative) to add to the volume. """ 161 | audio = self._session.service('ALAudioDevice') 162 | current_volume = audio.getOutputVolume() 163 | new_volume = current_volume + diff 164 | if new_volume > 100: 165 | new_volume = 100 166 | elif new_volume < 20: 167 | new_volume = 20 168 | audio.setOutputVolume(new_volume) 169 | self._logger.info("New volume: {}" .format(new_volume)) 170 | 171 | 172 | # ---------------------------------------------------------------------------------------------------------- 173 | # ---------------------------------------------------------------------------------------------------------- 174 | def register_as_service(service_class, session): 175 | """ 176 | Registers a service in naoqi 177 | """ 178 | service_name = service_class.__name__ 179 | service_instance = service_class(session) 180 | try: 181 | session.registerService(service_name, service_instance) 182 | print 'Successfully registered service: {}'.format(service_name) 183 | return service_instance 184 | except RuntimeError: 185 | print '{} already registered, attempt re-register'.format(service_name) 186 | for info in session.services(): 187 | try: 188 | if info['name'] == service_name: 189 | session.unregisterService(info['serviceId']) 190 | print "Unregistered {} as {}".format(service_name, info['serviceId']) 191 | break 192 | except (KeyError, IndexError): 193 | pass 194 | session.registerService(service_name, service_instance) 195 | print 'Successfully registered service: {}'.format(service_name) 196 | return service_instance 197 | 198 | if __name__ == "__main__": 199 | """ 200 | Registers AppLauncher as a naoqi service. 201 | """ 202 | app = qi.Application(sys.argv) 203 | app.start() 204 | instance = register_as_service(AppLauncher, app.session) 205 | app.run() 206 | instance.cleanup() 207 | # ---------------------------------------------------------------------------------------------------------- 208 | # ---------------------------------------------------------------------------------------------------------- 209 | -------------------------------------------------------------------------------- /App-Launcher/lib/app_list_manager.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from storage import IconsStorage 3 | import os.path 4 | import json 5 | 6 | 7 | class AppListManager: 8 | 9 | _LANGUAGE_FORMAT_CONVERSION = dict(en_US="English", fr_FR="French", ja_JP="Japanese", zh_CN="Chinese", 10 | es_ES="Spanish", de_DE="German", ko_KR="Korean", it_IT="Italian", nl_NL="Dutch", 11 | fi_FI="Finnish", pl_PL="Polish", ru_RU="Russian", tr_TR="Turkish", 12 | ar_SA="Arabic", cs_CZ="Czech", pt_PT="Portuguese", pt_BR="Brazilian", 13 | sv_SE="Swedish", da_DK="Danish", nn_NO="Norwegian", el_GR="Greek") 14 | 15 | def __init__(self, logger, session, pref_manager, app_uuid, apps_full_list_prop, apps_by_page_prop): 16 | self._logger = logger 17 | self._session = session 18 | self._logger.info("+ Creating app list manager...") 19 | 20 | # connect services 21 | self._session.waitForService("PackageManager") 22 | self._package_manager = self._session.service("PackageManager") 23 | self._session.waitForService("ALTextToSpeech") 24 | self._tts = self._session.service("ALTextToSpeech") 25 | 26 | # public variables 27 | self.apps_full_list = apps_full_list_prop 28 | self.apps_by_page = apps_by_page_prop 29 | 30 | # private variables 31 | self._app_uuid = app_uuid 32 | self._current_language = None 33 | self._current_language_pkg = None 34 | self._pref_hide_system_apps = None 35 | self._pref_hide_crg_app = None 36 | self._preferences_manager = pref_manager 37 | self._icons_storage = IconsStorage(self._logger, self._app_uuid) 38 | self.pref_pages_definition = {} 39 | temp_pref = self._preferences_manager.get_subdomain_value_list("page") 40 | if temp_pref: 41 | # For each page in preferences 42 | for page in temp_pref: 43 | # Double quote are not allowed in cloud preferences, so we use 44 | # simple quote and they are replaced here to stick to json format 45 | self.pref_pages_definition[page[0]] = json.loads(page[1].replace('\'', '"')) 46 | else: 47 | # Get the path of the file "defaultPreferences.json" 48 | url = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(__file__)), 49 | 'defaultPreferences.json')) 50 | with open(url) as openUrl: 51 | # Load the json 52 | self.pref_pages_definition = json.load(openUrl) 53 | self._logger.info("+ Pages definition is: {}".format(self.pref_pages_definition)) 54 | 55 | # init vars 56 | self._on_language_changed(self._tts.locale()) 57 | self._on_hide_system_apps_changed(self._preferences_manager.get_value("hideSystemApps", False)) 58 | self._on_hide_crg_app_changed(self._preferences_manager.get_value("hideChoregrapheTestApp", True)) 59 | self.update_app_lists(None, update_icons=True) 60 | 61 | # connect callbacks 62 | self._preferences_manager.add_callback("hideSystemApps", self._on_hide_system_apps_changed) 63 | self._preferences_manager.add_callback("hideChoregrapheTestApp", self._on_hide_crg_app_changed) 64 | 65 | self._con_package_installed = self._package_manager.onPackageInstalled.connect(self.update_app_lists) 66 | self._con_package_removed = self._package_manager.onPackageRemoved.connect(self.update_app_lists) 67 | self._con_language = self._tts.languageTTS.connect(self._on_language_changed) 68 | 69 | self._logger.info("+ ... App list manager is ready!") 70 | 71 | def cleanup(self): 72 | self._logger.info("+ Cleaning app list manager...") 73 | 74 | try: 75 | # disconnect from signals 76 | self._tts.languageTTS.disconnect(self._con_language) 77 | self._package_manager.onPackageRemoved.disconnect(self._con_package_removed) 78 | self._package_manager.onPackageInstalled.disconnect(self._con_package_installed) 79 | 80 | # clean variables 81 | self._icons_storage.cleanup() 82 | 83 | self._logger.info("+ ... App list manager is clean!") 84 | 85 | except Exception as e: 86 | self._logger.info("+ error while cleaning app list manager: {}".format(e)) 87 | 88 | 89 | """ 90 | CALLBACK FUNCTIONS 91 | """ 92 | 93 | def _on_hide_system_apps_changed(self, new_value): 94 | self._pref_hide_system_apps = new_value 95 | 96 | def _on_hide_crg_app_changed(self, new_value): 97 | self._pref_hide_crg_app = new_value 98 | 99 | def _on_language_changed(self, new_language): 100 | self._logger.info("+ Language is now: {}".format(new_language)) 101 | self._current_language_pkg = new_language 102 | self._current_language = self._LANGUAGE_FORMAT_CONVERSION[self._current_language_pkg] 103 | self.update_app_lists(None) 104 | 105 | """ 106 | HELPERS 107 | """ 108 | 109 | def _get_app_icon(self, uuid, create_icon=True): 110 | name = "{}.png".format(uuid) 111 | file_path = self._icons_storage.get_folder_path(name) 112 | if not os.path.isfile(file_path) or create_icon: 113 | icon = self._package_manager.packageIcon(uuid) 114 | if len(icon) > 0: 115 | with open(file_path, "wb") as fh: 116 | fh.write(icon) 117 | else: 118 | name = "generic_package_icon.png" 119 | 120 | return "/apps/{}/icons/{}".format(self._app_uuid, name) 121 | 122 | """ 123 | PUBLIC (to applauncher) FUNCTIONS 124 | """ 125 | 126 | def update_app_lists(self, useless_package_info, update_icons=False): 127 | """Reloads the list of applications to display. 128 | This method will update the property: apps_full_list""" 129 | full_list = [] 130 | pkg_list = self._package_manager.packages() 131 | for pkg in pkg_list: 132 | if pkg["installer"] == "system" and self._pref_hide_system_apps: 133 | continue 134 | if pkg["uuid"] == ".lastUploadedChoregrapheBehavior" and self._pref_hide_crg_app: 135 | continue 136 | for behavior in pkg["behaviors"]: 137 | if behavior["userRequestable"]: 138 | behavior_name = pkg["uuid"] 139 | if len(pkg["supportedLanguages"]) == 0 or self._current_language_pkg in pkg["supportedLanguages"]: 140 | if self._current_language_pkg in behavior["langToName"].keys(): 141 | behavior_name = behavior["langToName"][self._current_language_pkg] 142 | elif self._current_language_pkg in pkg["langToName"].keys(): 143 | behavior_name = pkg["langToName"][self._current_language_pkg] 144 | elif self._current_language_pkg in behavior["langToTriggerSentences"].keys(): 145 | for trigger in behavior["langToTriggerSentences"][self._current_language_pkg]: 146 | if len(trigger) > 0: 147 | behavior_name = trigger 148 | break 149 | else: 150 | behavior_name = "# {} not supported #".format(self._current_language) 151 | icon_url = self._get_app_icon(pkg["uuid"], update_icons) 152 | full_list.append({"uuid": pkg["uuid"], 153 | "behavior_path": behavior["path"], 154 | "name": behavior_name, 155 | "icon": icon_url}) 156 | 157 | apps_full_list = sorted(full_list, key=lambda app: app["name"].lower()) 158 | 159 | page_list = {} 160 | 161 | for page_id in self.pref_pages_definition.keys(): 162 | page_title = "# {} title missing #".format(self._current_language) 163 | page_apps = {} 164 | 165 | if self._current_language in self.pref_pages_definition[page_id]["title"].keys(): 166 | page_title = self.pref_pages_definition[page_id]['title'][self._current_language] 167 | elif 'English' in self.pref_pages_definition[page_id]['title'].keys(): 168 | page_title = self.pref_pages_definition[page_id]['title']['English'] 169 | 170 | for uuid in self.pref_pages_definition[page_id]["apps"]: 171 | for app_desc in [ad for ad in apps_full_list if ad["uuid"] == uuid]: 172 | page_apps[len(page_apps)] = app_desc 173 | 174 | page_list[page_id] = {"title": page_title, "apps": page_apps} 175 | 176 | self.apps_full_list.setValue(apps_full_list) 177 | self.apps_by_page.setValue(page_list) 178 | -------------------------------------------------------------------------------- /App-Launcher/lib/defaultPreferences.json: -------------------------------------------------------------------------------- 1 | { 2 | "0":{ 3 | "title":{ 4 | "English":"Retail", 5 | "French":"Vente" 6 | },"apps":[ 7 | "product-information","shop-orientation","loyalty-program","satisfaction-survey"] 8 | }, 9 | "1":{ 10 | "title":{ 11 | "English":"Tourism", 12 | "French":"Tourisme" 13 | },"apps": 14 | ["check-in-7b9a99", "loyalty-program", "satisfaction-survey"] 15 | }, 16 | "2":{ 17 | "title":{ 18 | "English":"Office", 19 | "French":"Bureau" 20 | },"apps":[ 21 | "bank-welcome", "loyalty-program", "satisfaction-survey"] 22 | } 23 | } -------------------------------------------------------------------------------- /App-Launcher/lib/dialog_manager.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import qi 3 | 4 | 5 | class DialogManager: 6 | 7 | _LANGUAGE_FORMAT_CONVERSION = dict(en_US="enu", fr_FR="frf", ja_JP="jpj", zh_CN="mnc", 8 | es_ES="spe", de_DE="ged", ko_KR="kok", it_IT="iti", nl_NL="dun", 9 | fi_FI="fif", pl_PL="plp", ru_RU="rur", tr_TR="trt", 10 | ar_SA="arw", cs_CZ="czc", pt_PT="ptp", pt_BR="ptb", 11 | sv_SE="sws", da_DK="dad", nn_NO="nor", el_GR="grg") 12 | 13 | def __init__(self, logger, session, pref_manager, pages_definition_property, autonomous_enabled_property, 14 | current_page_property): 15 | self._logger = logger 16 | self._session = session 17 | self._logger.info("@ Creating Dialog manager...") 18 | self._pref_manager = pref_manager 19 | self._pages_definition = pages_definition_property 20 | self._current_language = None 21 | self._current_language_dlg = None 22 | self._current_page = current_page_property 23 | self._autonomous_enabled = autonomous_enabled_property 24 | self._connection_pagedef = self._pages_definition.connect(self._create_pages_triggers_dialog) 25 | self._session.waitForService("ALTextToSpeech") 26 | self._tts = self._session.service("ALTextToSpeech") 27 | 28 | self._on_language_changed(self._tts.locale()) 29 | self._con_language = self._tts.languageTTS.connect(self._on_language_changed) 30 | 31 | qi.async(self._create_pages_triggers_dialog, self._pages_definition.value(), delay=1000000) 32 | self._pref_dialog_always_running = self._pref_manager.get_value('dialogAlwaysRunning', True) 33 | self.connection_autoena = self._autonomous_enabled.connect(self._on_autonomous_enabled_changed) 34 | self._session.waitForService("ALMemory") 35 | self.page_subscriber = self._session.service("ALMemory").subscriber("AppLauncher/PageRequired") 36 | self.page_connection = self.page_subscriber.signal.connect(self.on_page_required) 37 | self._logger.info("@ Dialog manager created!") 38 | 39 | def cleanup(self): 40 | self._logger.info("@ Cleaning dialog manager...") 41 | try: 42 | self._tts.languageTTS.disconnect(self._con_language) 43 | self.page_subscriber.signal.disconnect(self.page_connection) 44 | self._pages_definition.disconnect(self._connection_pagedef) 45 | self._autonomous_enabled.disconnect(self.connection_autoena) 46 | except Exception as e: 47 | self._logger.info("@ Error while cleaning dialog manager: {}".format(e)) 48 | self._logger.info("@ Dialog manager is clean!") 49 | 50 | def _create_pages_triggers_dialog(self, pages_definition): 51 | self._logger.info("@ Updating dialog concept for pages") 52 | page_name_list = [] 53 | for page_id in pages_definition.keys(): 54 | page_name = pages_definition[page_id]["title"] 55 | page_name_list.append(page_name) 56 | 57 | self._session.waitForService("ALDialog") 58 | dialog = self._session.service("ALDialog") 59 | dialog.setConcept("applauncher_pages_names", self._current_language_dlg, page_name_list) 60 | self._logger.info("@ Pages are: {}".format(page_name_list)) 61 | 62 | def _on_language_changed(self, new_language): 63 | self._logger.info("@ Language is now: {}".format(new_language)) 64 | self._current_language_pkg = new_language 65 | self._current_language_dlg = self._LANGUAGE_FORMAT_CONVERSION[self._current_language_pkg] 66 | 67 | def _on_autonomous_enabled_changed(self, enabled): 68 | try: 69 | forbidden = True 70 | life = self._session.service("ALAutonomousLife") 71 | if enabled: 72 | forbidden = False 73 | self._logger.info("@ Autonomous: {} (forbidden: {})".format(enabled, forbidden)) 74 | life._forbidAutonomousInteractiveStateChange(forbidden) 75 | if forbidden: 76 | self._stop_dialog() 77 | else: 78 | self._start_dialog() 79 | except Exception as e: 80 | self._logger.info("@ Error while changing automous mode: {}".format(e)) 81 | 82 | def _start_dialog(self): 83 | try: 84 | if self._pref_dialog_always_running: 85 | self._logger.info("@ dialogAlwaysRunning: True -> starting dialog") 86 | life = self._session.service("ALAutonomousLife") 87 | mem = self._session.service("ALMemory") 88 | mem.insertData("Dialog/DoNotStop", 1) 89 | life.switchFocus("run_dialog_dev/.") 90 | except Exception as e: 91 | self._logger.error("@ Run dialog error: " + str(e)) 92 | 93 | def _stop_dialog(self): 94 | try: 95 | bm = self._session.service("ALBehaviorManager") 96 | bm.stopBehavior("run_dialog_dev/.") 97 | except Exception as e: 98 | self._logger.error("@ Stop dialog error: " + str(e)) 99 | 100 | def on_page_required(self, page_request): 101 | if page_request == "homepage": 102 | self._current_page.setValue("Home") 103 | return 104 | list_page = self._pages_definition.value() 105 | for page_id in list_page.keys(): 106 | if page_request in list_page[page_id]["title"]: 107 | self._current_page.setValue(page_id) 108 | return 109 | -------------------------------------------------------------------------------- /App-Launcher/lib/helpers.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import os.path 3 | 4 | 5 | def find_app_name(logger): 6 | import re 7 | path = os.path.dirname(os.path.realpath(__file__)) 8 | match = re.search("(?<=/PackageManager/apps/)(?P[\w\._-]+)", path) 9 | if match: 10 | app_name = match.group(0) 11 | logger.info("App uuid is {} ".format(app_name)) 12 | return app_name 13 | else: 14 | app_name = "app-launcher" 15 | logger.warning("Unable to find app uuid in path: {}. Defaulting to: {}".format(path, app_name)) 16 | return app_name 17 | -------------------------------------------------------------------------------- /App-Launcher/lib/preferences_manager.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | 4 | class PreferencesManager: 5 | 6 | def __init__(self, logger, session, domain): 7 | self._logger = logger 8 | self._session = session 9 | self._domain = domain 10 | self._logger.info("= Creating preferences manager for domain {}...".format(self._domain)) 11 | self._callbacks_list = {} 12 | self._session.waitForService("ALPreferenceManager") 13 | self._preference_manager = self._session.service("ALPreferenceManager") 14 | self._con_preference_added = self._preference_manager.preferenceAdded.connect(self._on_pref_added_or_updated) 15 | self._con_preference_updated = self._preference_manager.preferenceUpdated.connect(self._on_pref_added_or_updated) 16 | self._con_preference_removed = self._preference_manager.preferenceRemoved.connect(self._on_pref_removed) 17 | self._con_domain_removed = self._preference_manager.preferenceDomainRemoved.connect(self._on_domain_removed) 18 | self._con_preferences_synchronized = self._preference_manager.preferencesSynchronized.connect(self._on_preferences_synchronized) 19 | self._logger.info("= ... Preferences manager is ready!") 20 | 21 | def cleanup(self): 22 | self._logger.info("= Cleaning preferences manager...") 23 | try: 24 | self._preference_manager.preferencesSynchronized.disconnect(self._con_preferences_synchronized) 25 | self._preference_manager.preferenceAdded.disconnect(self._con_preference_added) 26 | self._preference_manager.preferenceUpdated.disconnect(self._con_preference_updated) 27 | self._preference_manager.preferenceRemoved.disconnect(self._con_preference_removed) 28 | self._preference_manager.preferenceDomainRemoved.disconnect(self._con_domain_removed) 29 | self._logger.info("= ... Preferences manager is clean!") 30 | 31 | except Exception as e: 32 | self._logger.info("error while cleaning preferences manager: {}".format(e)) 33 | 34 | def _on_pref_added_or_updated(self, domain, name, value): 35 | self._logger.info("= Pref added or updated: {}, {}, {}".format(domain, name, value)) 36 | if domain != self._domain: 37 | return 38 | try: 39 | for callback in self._callbacks_list[domain][name]: 40 | # self._logger.info("Calling {}".format(callback.__name__)) 41 | callback(value) 42 | except KeyError as e: 43 | self._logger.warning("= Error: {}".format(e)) 44 | 45 | def _on_pref_removed(self, domain, name): 46 | self._logger.info("= Pref removed: {}, {}".format(domain, name)) 47 | if domain != self._domain: 48 | return 49 | try: 50 | for callback in self._callbacks_list[domain][name]: 51 | # self._logger.info("Calling {}".format(callback.__name__)) 52 | callback(None) 53 | except KeyError as e: 54 | self._logger.warning("= Error: {}".format(e)) 55 | 56 | def _on_domain_removed(self, domain): 57 | self._logger.info("= Pref domain removed: {}".format(domain)) 58 | if domain != self._domain: 59 | return 60 | try: 61 | for name in self._callbacks_list.keys(): 62 | for callback in self._callbacks_list[name]: 63 | # self._logger.info("= Calling {}".format(callback.__name__)) 64 | callback(None) 65 | except KeyError as e: 66 | self._logger.warning("= Error: {}".format(e)) 67 | 68 | def _on_preferences_synchronized(self): 69 | self._logger.info("= Pref synchronized!") 70 | try: 71 | for name in self._callbacks_list.keys(): 72 | for callback in self._callbacks_list[name]: 73 | # self._logger.info("= Calling {}".format(callback.__name__)) 74 | callback(self._preference_manager.getValue(self._domain, name)) 75 | except KeyError as e: 76 | self._logger.warning("= Error: {}".format(e)) 77 | 78 | def add_callback(self, name, callback): 79 | self._logger.info("= Adding callback {} to preference {}".format(callback.__name__, name)) 80 | if not (name in self._callbacks_list.keys()): 81 | self._callbacks_list[name] = [] 82 | self._callbacks_list[name].append(callback) 83 | 84 | def get_value(self, name, default): 85 | domain = self._domain 86 | v = False 87 | try: 88 | v = self._preference_manager.getValue(domain, name) 89 | except Exception as e: 90 | self._logger.error("= Error getting preference {}: {}".format(name, e)) 91 | if v: 92 | return v 93 | else: 94 | return default 95 | 96 | def get_subdomain_value_list(self, subdomain): 97 | return self._preference_manager.getValueList(self._domain+"."+subdomain) 98 | -------------------------------------------------------------------------------- /App-Launcher/lib/storage.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import qi 3 | import os 4 | from shutil import copyfile 5 | 6 | 7 | class IconsStorage: 8 | 9 | def __init__(self, logger, uuid): 10 | self._logger = logger 11 | self.icons_path = "" 12 | self.package_html_upload_folder = "" 13 | 14 | self._logger.info("* Creating icon storage...") 15 | 16 | self.icons_path = qi.path.userWritableDataPath(uuid, "icons") 17 | self._logger.info("* - icons path is {}".format(self.icons_path)) 18 | if not os.path.isdir(self.icons_path): 19 | os.mkdir(self.icons_path) 20 | 21 | copyfile(os.path.join(os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "html")), "images", "generic_package_icon.png"), os.path.join(self.icons_path, "generic_package_icon.png")) 22 | 23 | self.package_html_upload_folder = os.path.join(os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "html")),"icons") 24 | self._logger.info("* - html icons folder is {}".format(self.package_html_upload_folder)) 25 | if not os.path.islink(self.package_html_upload_folder): 26 | if not os.path.exists(self.package_html_upload_folder): 27 | os.symlink(self.icons_path, self.package_html_upload_folder) 28 | elif os.path.isdir(self.package_html_upload_folder): 29 | self.icons_path = self.package_html_upload_folder 30 | 31 | # @TODO: copy "generic_package_icon.png" into icons_path 32 | 33 | self._logger.info("* ... Icon storage is ready!") 34 | 35 | def cleanup(self): 36 | self._logger.info("* Cleaning icon storage...") 37 | 38 | if os.path.islink(self.package_html_upload_folder): 39 | os.unlink(self.package_html_upload_folder) 40 | elif os.path.isdir(self.package_html_upload_folder): 41 | os.remove(self.package_html_upload_folder) 42 | 43 | for the_file in os.listdir(self.icons_path): 44 | file_path = os.path.join(self.icons_path, the_file) 45 | try: 46 | if os.path.isfile(file_path): 47 | os.unlink(file_path) 48 | except: 49 | pass 50 | if os.path.isdir(self.icons_path): 51 | try: 52 | os.remove(self.icons_path) 53 | except Exception as e: 54 | self._logger.warning("* {}".format(e)) 55 | self._logger.info("* ... Icon storage is clean!") 56 | 57 | def get_folder_path(self, name): 58 | return os.path.join(self.icons_path, name) 59 | -------------------------------------------------------------------------------- /App-Launcher/lib/view_manager.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | import qi 3 | import time 4 | 5 | 6 | class ViewManager: 7 | def __init__(self, logger, session, pref_manager, app_uuid, current_state_prop, ping_required_sig): 8 | self._logger = logger 9 | self._session = session 10 | self._logger.info("> Creating view manager...") 11 | 12 | # Private variables 13 | self._app_uuid = app_uuid 14 | self._robot_is_booting = True 15 | self._previous_state = "" 16 | self._watchdog = None 17 | self._launch_async = None 18 | self._preferences_manager = pref_manager 19 | 20 | # Public variables 21 | self.pref_view_uuid = app_uuid 22 | self.change_view_uuid(pref_manager.get_value('displayedApplication', app_uuid)) 23 | pref_manager.add_callback('displayedApplication', self.change_view_uuid) 24 | self.pref_force_watchdog = False 25 | self.current_state = current_state_prop 26 | self.ping_required = ping_required_sig 27 | 28 | # Connect AutonomousLife State 29 | self._logger.info("> Connecting ALMemory (waiting indefinitely)") 30 | self._session.waitForService("ALMemory") 31 | self._memory = self._session.service("ALMemory") 32 | 33 | self._logger.info("> Connecting to ALife State") 34 | self._life_state_sig = self._memory.subscriber('AutonomousLife/State').signal 35 | self._life_state_con = self._life_state_sig.connect(self._on_life_state_changed) 36 | self._current_state_con = self.current_state.connect(self._on_current_state_changed) 37 | 38 | self._logger.info("> Initializing ALife State") 39 | self._on_life_state_changed(self._memory.getData("AutonomousLife/State")) 40 | 41 | ## prepare tablet 42 | #self._logger.info("> Connecting Tablet (waiting indefinitely)") 43 | #self._session.waitForService("ALTabletService") 44 | 45 | #self._logger.info("> Preparing Tablet") 46 | #tablet = self._session.service("ALTabletService") 47 | #tablet._enableResetTablet(0) 48 | ## tablet.setVolume(10) # @TODO: only in naoqi 2.4 49 | 50 | self._logger.info("> ... View manager is ready!") 51 | 52 | def cleanup(self): 53 | self._logger.info("> Cleaning app list manager...") 54 | 55 | try: 56 | self.current_state.disconnect(self._current_state_con) 57 | self._life_state_sig.disconnect(self._life_state_con) 58 | 59 | # reset tablet 60 | tablet = self._session.service("ALTabletService") 61 | tablet._enableResetTablet(1) 62 | tablet.resetTablet() 63 | 64 | self._logger.info("> ... View manager is clean!") 65 | except Exception as e: 66 | self._logger.info("error while cleaning app list manager: {}".format(e)) 67 | 68 | def change_view_uuid(self, view_uuid): 69 | if view_uuid: 70 | self.pref_view_uuid = view_uuid 71 | self._logger.info("> App view is now: {}".format(self.pref_view_uuid)) 72 | 73 | def _on_life_state_changed(self, autonomous_life_state): 74 | try: 75 | if autonomous_life_state == "solitary": 76 | asleep = False 77 | try: 78 | asleep = self._memory.getData("AutonomousLife/Asleep") 79 | except: 80 | self._logger.info("> could not read AutonomousLife/Asleep") 81 | if asleep: 82 | self._set_current_state("sleeping") 83 | else: 84 | self._set_current_state("ready") 85 | 86 | elif autonomous_life_state == "interactive": 87 | try: 88 | self._current_app = self._memory.getData("AutonomousLife/NextActivity") 89 | self._logger.info("> Running {}".format(self._current_app)) 90 | except: 91 | self._logger.info("> could not read AutonomousLife/NextActivity") 92 | 93 | if self._current_app != "run_dialog_dev/.": 94 | self._set_current_state("running") 95 | else: 96 | self._set_current_state("ready") 97 | 98 | elif autonomous_life_state == "disabled": 99 | self._set_current_state("sleeping") 100 | 101 | elif autonomous_life_state == "safeguard": 102 | self._set_current_state("sleeping") 103 | 104 | except Exception, e: 105 | self._logger.error("> Set AppLauncher state error: " + str(e)) 106 | 107 | def _set_current_state(self, new_state): 108 | """This method checks whether the state is part of the 109 | permitted states and is different from the current state 110 | """ 111 | try: 112 | if new_state not in ["sleeping", "ready", "running"]: 113 | raise RuntimeError("> View state cannot be {}, it must be sleeping, running or ready.".format(new_state)) 114 | if new_state != self.current_state.value(): 115 | self.current_state.setValue(new_state) 116 | except Exception, e: 117 | self._logger.error("> Set current state error: " + str(e)) 118 | 119 | def _on_current_state_changed(self, current_state): 120 | """Each time 'current_state' is modified, this method is called 121 | If the robot is booting, first time current_state change to ready 122 | it will launch the first display_tablet and the dialog. 123 | Each time current_state change from "running" to another state 124 | display_tablet is called. 125 | """ 126 | try: 127 | if self._robot_is_booting and current_state == "ready": 128 | self._robot_is_booting = False 129 | self._logger.info("> Robot has finished boot sequence.") 130 | self.display_view() 131 | elif current_state == self._previous_state: 132 | pass 133 | elif current_state == "running": 134 | self._stop_watchdog() 135 | elif self._previous_state == "running": 136 | self._logger.info("> The running app has finished. ") 137 | self.display_view() 138 | 139 | self._previous_state = current_state 140 | 141 | except Exception, e: 142 | self._logger.error("> States changed error: " + str(e)) 143 | 144 | def display_view(self): 145 | self._logger.info("> Displaying {} ".format(self.pref_view_uuid)) 146 | try: 147 | tablet = self._session.service("ALTabletService") 148 | self._logger.verbose("> - clean Web view") 149 | tablet.cleanWebview() 150 | self._logger.verbose("> - clear Web view Cache") 151 | tablet._clearWebviewCache(1) 152 | self._logger.verbose("> - disable reset tablet") 153 | tablet._enableResetTablet(0) 154 | self._logger.verbose("> - display web view") 155 | tablet.loadApplication(self.pref_view_uuid) 156 | tablet.showWebview() 157 | if self.pref_force_watchdog: 158 | self._logger.verbose("> - force watchdog") 159 | self._require_ping(10) 160 | except Exception as e: 161 | self._logger.error("> error: " + str(e)) 162 | 163 | def _require_ping(self, acceptable_delay_s): 164 | """ Asks the web page displayed on the tablet for a ping. This will trigger the signal ping_required.""" 165 | self._logger.verbose("> Require ping (within {}s)".format(acceptable_delay_s)) 166 | try: 167 | self._watchdog.cancel() 168 | except: 169 | pass 170 | self._watchdog = qi.async(self._watchdog_emergency, delay=acceptable_delay_s * 1000000) 171 | self.ping_required(1) 172 | 173 | def ping(self, seconds_before_next_ping_request): 174 | """ This method checks if the page on the Tablet is loaded and the javascript responding. 175 | This method is called by the tablet, each time it is called, it stops all the scheduled display_tablet and plan 176 | a display_tablet in delay+10 seconds. 177 | If no other ping come after, it means the javascript is no longer available. 178 | So when the delay has elapsed, it will try to display again the tablet. 179 | """ 180 | self._logger.verbose("> Ping received (next in {}s)".format(seconds_before_next_ping_request)) 181 | self._stop_watchdog() 182 | self._logger.verbose("> ... Setting next ping in {}s".format(seconds_before_next_ping_request)) 183 | self._watchdog = qi.async(self._require_ping, 3, delay=seconds_before_next_ping_request * 1000000) 184 | self._logger.verbose("> ... all done. ") 185 | 186 | def _watchdog_emergency(self): 187 | """ If 10 seconds after the display_tablet, 188 | the page doesn't ping this service, this method is called 189 | the tablet will be automaticaly restarted and the page reloaded 190 | """ 191 | self._logger.info("> Watchdog emergency") 192 | try: 193 | self._watchdog.cancel() 194 | except: 195 | pass 196 | 197 | if self.current_state.value() == "running": 198 | self._logger.info("> !!! An app is running, abort the emergency to leave it a chance!") 199 | return 200 | 201 | self._logger.info("> Waiting for ALTabletService") 202 | self._session.waitForService("ALTabletService") 203 | self._logger.info("> Connecting to ALTabletService") 204 | tablet = self._session.service('ALTabletService') 205 | self._logger.info("> Restarting browser") 206 | tablet._restart() 207 | self._logger.info("> Opening web view in 3s") 208 | self._watchdog = qi.async(self.display_view, delay=3000000) 209 | 210 | def _stop_watchdog(self): 211 | """This method stops all the scheduled display_tablet""" 212 | self._logger.verbose("> ... calling the dogs back") 213 | if self._watchdog: 214 | self._watchdog.cancel() 215 | while not (self._watchdog.isCanceled() or self._watchdog.isFinished()): 216 | self._logger.verbose("> ... waiting for the dogs to be back") 217 | time.sleep(1) 218 | self._logger.verbose("> ... dogs are back. ") 219 | 220 | 221 | 222 | -------------------------------------------------------------------------------- /App-Launcher/manifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | App-Launcher 5 | App-Launcher 6 | 7 | 8 | Launcher for applications 9 | Create a set of pages, each containing the desired applications. 10 | Preferences for customization in domain tool.applauncher.page: 11 | Create your own pages configuration 12 | key: 13 | page1(2,3,4...) 14 | format value: 15 | {'title':{'English':'Retail','French':'Vente'},'apps':['product-information','shop-orientation','loyalty-program','satisfaction-survey']} 16 | Preferences for customization in domain tool.applauncher: 17 | keys: 18 | - logo : changes the front page logo on tablet (ex: Pepper-white.png) 19 | - behaviorNameDisplayed : 1 to show apps' name 20 | - attachedApplication : another app is displayed on tablet instead of the default page 21 | - conditionExpression : launch trigger condition for tablet to be displayed 22 | - dialogAlwaysRunning : boolean default False : bypass run_dialog and run the dialog automatically. 23 | Preferences you have to add in domain com.aldebaran.system.tablet: 24 | - MainActivity : image 25 | - MainResourceURL : http://198.18.0.1/apps/app-launcher/resources/background.jpg 26 | Launcher for applications 27 | Create a set of pages, each containing the desired applications. 28 | Preferences for customization in domain tool.applauncher.page: 29 | Create your own pages configuration 30 | key: 31 | page1(2,3,4...) 32 | format value: 33 | {'title':{'English':'Retail','French':'Vente'},'apps':['product-information','shop-orientation','loyalty-program','satisfaction-survey']} 34 | Preferences for customization in domain tool.applauncher: 35 | keys: 36 | - logo : changes the front page logo on tablet (ex: Pepper-white.png) 37 | - behaviorNameDisplayed : 1 to show apps' name 38 | - attachedApplication : another app is displayed on tablet instead of the default page 39 | - conditionExpression : launch trigger condition for tablet to be displayed 40 | - dialogAlwaysRunning : boolean default False : bypass run_dialog and run the dialog automatically. 41 | Preferences you have to add in domain com.aldebaran.system.tablet: 42 | - MainActivity : image 43 | - MainResourceURL : http://198.18.0.1/apps/app-launcher/resources/background.jpg 44 | 45 | 46 | en_US 47 | ar_SA 48 | da_DK 49 | cs_CZ 50 | de_DE 51 | el_GR 52 | es_ES 53 | fr_FR 54 | fi_FI 55 | it_IT 56 | ja_JP 57 | ko_KR 58 | nl_NL 59 | nn_NO 60 | pl_PL 61 | pt_BR 62 | pt_PT 63 | ru_RU 64 | sv_SE 65 | tr_TR 66 | zh_CN 67 | zh_TW 68 | 69 | 70 | en_US 71 | ar_SA 72 | da_DK 73 | cs_CZ 74 | de_DE 75 | el_GR 76 | es_ES 77 | fr_FR 78 | fi_FI 79 | it_IT 80 | ja_JP 81 | ko_KR 82 | nl_NL 83 | nn_NO 84 | pl_PL 85 | pt_BR 86 | pt_PT 87 | ru_RU 88 | sv_SE 89 | tr_TR 90 | zh_CN 91 | zh_TW 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /COPYING.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2019, SoftBank Robotics Europe 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of the SoftBank Robotics Europe nor the 13 | names of its contributors may be used to endorse or promote products 14 | derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL SoftBank Robotics Europe BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # App-launcher 2 | 3 | This is a configurable applications launcher for Pepper. 4 | 5 | ## Pages 6 | You can organise the apps in pages and dispose them as you wish on the home page. 7 | 8 | This is configured using preferences: 9 | * Domain : tool.applauncher.page 10 | * key : page1(2,3,4...) 11 | * Values : 12 | 13 | { 14 | 'title': { 15 | 'English':'Name of my page', 16 | 'French':'Nom de ma page', 17 | ... 18 | }, 19 | 'apps': [ 20 | 'app-uuid-1', 21 | 'app-uuid-2', 22 | ... 23 | ] 24 | } 25 | 26 | Example of values : 27 | {'title':{'English':'Retail','French':'Vente'},'apps':['product-information','shop-orientation','loyalty-program','satisfaction-survey']} 28 | 29 | {'title':{'English':'Tourism','French':'Tourisme'},'apps':['check-in-7b9a99','check-in-7b9a99', 'loyalty-program', 'satisfaction-survey']} 30 | 31 | {'title':{'English':'Office','French':'Bureau'},'apps':['bank-welcome','bank-welcome', 'loyalty-program', 'satisfaction-survey']} 32 | 33 | 34 | ## Configuration 35 | 36 | Domain: tool.applauncher: 37 | 38 | * Key: logo / Value : pepper.png 39 | * Key: behaviorNameDisplayed / Value : 1 to show apps names, or 0 to hide them. 40 | * Key : dialogAlwaysRunning / Value : boolean default False : bypass run_dialog and run the dialog automatically. 41 | * Key : hideSystemApps / Value : 1 to filter system apps so they are not displayed in the app list 42 | * Key : hideChoregrapheTestApp / Value : 1 to filter the Choregraphe ".lastUploadedChoregrapheBehavior" so it is no displayed in the app list 43 | 44 | Domain 45 | com.aldebaran.system.tablet 46 | 47 | * Key : MainActivity / Value : image.png 48 | * Key : MainResourceURL / Value : http://198.18.0.1/apps/app-launcher/resources/background.jpg 49 | 50 | Default file of preferences : "defaultPreferences.json" 51 | Located in : html/resources 52 | 53 | [ 54 | { 55 | "title":{ 56 | "English":"Retail", 57 | "French":"Retail" 58 | },"apps":[ 59 | "product-information","shop-orientation","loyalty-program","satisfaction-survey"] 60 | }, 61 | { 62 | "title":{ 63 | "English":"Games", 64 | "French":"Jeux" 65 | },"apps": 66 | ["pepper-play","musicboxes","pepperdetective","seeandlisten","strike_the_pose"] 67 | }, 68 | { 69 | "title":{ 70 | "English":"Office", 71 | "French":"Bureau" 72 | },"apps":[ 73 | "bank-welcome","loyalty-program","satisfaction-survey"] 74 | }, 75 | { 76 | "title":{ 77 | "English":"Pepper", 78 | "French":"Pepper" 79 | },"apps":[ 80 | "pepper-presentation","languages-demonstration","mood-mirror","locomotion-dialog"] 81 | } 82 | ] 83 | 84 | 85 | ### How to get the icon of an app ? 86 | 87 | 1) Using SSH 88 | 89 | import qi 90 | s = qi.Session() 91 | s.connect("tcp://127.0.0.1:9559") 92 | pm = s.service("PackageManager") 93 | i = pm.packageIcon("bank-welcome") 94 | import base64 95 | imgEnString = base64.encodestring(i) 96 | 97 | unefois l'image png base64 convertie en string, pour l'afficher en html 98 | 99 | 100 | 101 | 2) Using python et JS 102 | 103 | python: 104 | 105 | import base64 106 | 107 | def package_icon(self, uuid): 108 | """Get the icon of a package. 109 | :param uuid: (str) uuid of the package 110 | 111 | :return: (str) a base64-encoded package icon. 112 | """ 113 | return base64.encodestring(self.pacman.packageIcon(uuid)) 114 | 115 | JS: 116 | 117 | //id_div, (str) id of the div where you want to add the icon 118 | //uuid, (str) application id of the app from which you want to get the icon 119 | 120 | function get_icon_app(id_div, uuid){ 121 | session.service("DemoLauncher").then( function(dm) { // Replace "DemoLauncher" by the name of your service 122 | dm.package_icon(uuid).then(function (iconApp){ 123 | $("#"+id_div).append('
'); 124 | }); 125 | }); 126 | } 127 | 128 | ## License 129 | 130 | This project is licensed under the BSD 3-Clause "New" or "Revised" License - see the [COPYING](COPYING.md) file for details. 131 | -------------------------------------------------------------------------------- /adjust.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | viewport = document.querySelector("meta[name=viewport]"); 3 | if (viewport != null) { 4 | var legacyWidth = 1280; 5 | var windowWidth = window.screen.width; 6 | var scale = (windowWidth/legacyWidth).toFixed(3); 7 | init_str = "initial-scale=".concat(scale.toString()); 8 | min_str = "minimum-scale=".concat(scale.toString()); 9 | max_str = "maximum-scale=".concat(scale.toString()); 10 | viewport.setAttribute("content", init_str.concat(",").concat(min_str).concat(",").concat(max_str)); 11 | } 12 | }); -------------------------------------------------------------------------------- /background.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/background.xcf -------------------------------------------------------------------------------- /resources/App-Launcher.json: -------------------------------------------------------------------------------- 1 | [{"domain": "com.aldebaran.robotwebpage", "values": {"WizardNextNoAppList": "0", "MenuNoName": "0"}}, {"domain": "com.aldebaran.settings", "values": {"UpdatePolicy": "Ignore"}}, {"domain": "com.aldebaran.system.tablet", "values": {"MainActivity": "image", "MainResourceURL": "http://198.18.0.1/apps/demo-launcher/resources/background.jpg"}}, {"domain": "salesdemo.demo-launcher", "values": {"logo": "Pepper-white.png"}}, {"domain": "salesdemo.demo-launcher.pages", "values": {"4": "{'title':{'English':'More','French':'Divers'},'apps':['musicboxes','pepper-play','pepperdetective','seeandlisten','pose-photo']}", "5": "{'title':{'English':'About me','French':'Qui suis-je?'},'apps':['pepper-presentation','languages-demonstration','mood-mirror','locomotion-dialog']}", "2": "{'title':{'English':'Tourism','French':'Tourisme'},'apps':['check-in-7b9a99','loyalty-program','satisfaction-survey']}", "3": "{'title':{'English':'Office','French':'Bureau'},'apps':['bank-welcome','loyalty-program','satisfaction-survey']}", "1": "{'title':{'English':'Retail','French':'Vente'},'apps':['product-information','shop-orientation','loyalty-program','satisfaction-survey']}"}}] -------------------------------------------------------------------------------- /resources/LOGO_SB-Robotics_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/resources/LOGO_SB-Robotics_white.png -------------------------------------------------------------------------------- /resources/defaultPreferences.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "title":{ 4 | "English":"Retail", 5 | "French":"Retail" 6 | },"apps":[ 7 | "product-information","shop-orientation","loyalty-program","satisfaction-survey"] 8 | }, 9 | { 10 | "title":{ 11 | "English":"Games", 12 | "French":"Jeux" 13 | },"apps": 14 | ["pepper-play","musicboxes","pepperdetective","seeandlisten","strike_the_pose"] 15 | }, 16 | { 17 | "title":{ 18 | "English":"Office", 19 | "French":"Bureau" 20 | },"apps":[ 21 | "bank-welcome","loyalty-program","satisfaction-survey"] 22 | }, 23 | { 24 | "title":{ 25 | "English":"Pepper", 26 | "French":"Pepper" 27 | },"apps":[ 28 | "pepper-presentation","languages-demonstration","mood-mirror","locomotion-dialog"] 29 | } 30 | ] -------------------------------------------------------------------------------- /resources/pepper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/resources/pepper.png -------------------------------------------------------------------------------- /resources/softBank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/resources/softBank.png -------------------------------------------------------------------------------- /resources/whitePage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softbankrobotics-labs/app-launcher/a708bb45b750c5fc31ea0dc5087b372a45a58bea/resources/whitePage.png --------------------------------------------------------------------------------