1097 |
1097 |
1098 return false; |
1098 return false; |
1099 } |
1099 } |
1100 |
1100 |
1101 /* |
1101 /* |
|
1102 * Retourne vrai si la souris est sur la flèche haute dans le panneau des crédits. |
|
1103 */ |
|
1104 Mosaic.prototype.isOnCreditsUpArrow = function(x, y) |
|
1105 { |
|
1106 var creditsNotification = $('#notify_credits'), upArrow = $('#credits_upArrow'); |
|
1107 //Si les crédits ne sont pas affichés, on retourne faux. |
|
1108 if(creditsNotification.length <= 0) |
|
1109 { |
|
1110 return false; |
|
1111 } |
|
1112 |
|
1113 var margin = parseInt(creditsNotification.css('margin-left')); |
|
1114 |
|
1115 /*if($('#aa').length <= 0) |
|
1116 { |
|
1117 var a = '<div id="aa"></div>'; |
|
1118 $('body').append(a); |
|
1119 $('#aa').css( |
|
1120 { |
|
1121 position: 'absolute', |
|
1122 'background-color': '#0000FF', |
|
1123 top: +upArrow.position().top + 2 * margin, |
|
1124 left: upArrow.position().left + 2 * margin, |
|
1125 width: upArrow.width(), |
|
1126 height: upArrow.height() |
|
1127 }); |
|
1128 } |
|
1129 |
|
1130 console.log('---------------UP----------------------'); |
|
1131 console.log(x + ' > ' + (+upArrow.position().left + 2 * margin)); |
|
1132 console.log(x + ' < ' + (+upArrow.position().left + upArrow.width() + 2 * margin)); |
|
1133 console.log(y + ' > ' + (+upArrow.position().top + 2 * margin)); |
|
1134 console.log(y + ' < ' + (+upArrow.position().top + upArrow.height() + 2 * margin)); |
|
1135 console.log('---------------------------------------');*/ |
|
1136 |
|
1137 //Si la flèche est visible et si la souris est dessus, on retourne true. |
|
1138 if(upArrow.length > 0 && upArrow.css('opacity') == '1' && x > (+upArrow.position().left + margin) && x < (+upArrow.position().left + upArrow.width() + margin) && y > (+upArrow.position().top + margin) && y < (+upArrow.position().top + upArrow.height() + margin)) |
|
1139 { |
|
1140 return true; |
|
1141 } |
|
1142 |
|
1143 return false; |
|
1144 } |
|
1145 |
|
1146 /* |
|
1147 * Retourne vrai si la souris est sur la flèche basse dans le panneau des crédits. |
|
1148 */ |
|
1149 Mosaic.prototype.isOnCreditsDownArrow = function(x, y) |
|
1150 { |
|
1151 var creditsNotification = $('#notify_credits'), downArrow = $('#credits_downArrow'); |
|
1152 //Si les crédits ne sont pas affichés, on retourne faux. |
|
1153 if(creditsNotification.length <= 0) |
|
1154 { |
|
1155 return false; |
|
1156 } |
|
1157 |
|
1158 //$('#aa').remove(); |
|
1159 |
|
1160 var margin = parseInt(creditsNotification.css('margin-left')); |
|
1161 |
|
1162 /*console.log('--------------DOWN---------------------'); |
|
1163 console.log(x + ' > ' + (+downArrow.position().left + margin)); |
|
1164 console.log(x + ' < ' + (+downArrow.position().left + downArrow.width() + margin)); |
|
1165 console.log(y + ' > ' + (+downArrow.position().top + margin)); |
|
1166 console.log(y + ' < ' + (+downArrow.position().top + downArrow.height() + margin)); |
|
1167 console.log('---------------------------------------');*/ |
|
1168 |
|
1169 //Si la flèche est visible et si la souris est dessus, on retourne true. |
|
1170 if(downArrow.length > 0 && downArrow.css('opacity') == '1' && x > (+downArrow.position().left + margin) && x < (+downArrow.position().left + downArrow.width() + margin) && y > (+downArrow.position().top + margin) && y < (+downArrow.position().top + downArrow.height() + margin)) |
|
1171 { |
|
1172 return true; |
|
1173 } |
|
1174 |
|
1175 return false; |
|
1176 } |
|
1177 |
|
1178 /* |
|
1179 * Retourne vrai si la souris est sur une des flèches du panneau des crédits. |
|
1180 */ |
|
1181 Mosaic.prototype.isOnCreditsArrow = function(x, y) |
|
1182 { |
|
1183 //Si la souris est sur une flèche des crédits, on retourne vrai. |
|
1184 if(this.isOnCreditsUpArrow(x, y) || this.isOnCreditsDownArrow(x, y)) |
|
1185 { |
|
1186 return true; |
|
1187 } |
|
1188 |
|
1189 return false; |
|
1190 } |
|
1191 |
|
1192 /* |
|
1193 * Va a la page des crédits suivante. |
|
1194 */ |
|
1195 Mosaic.prototype.goToNextCreditsPage = function() |
|
1196 { |
|
1197 console.log(this.creditsPageLength); |
|
1198 //Si on est sur la dernière page, on quitte. |
|
1199 if(this.creditsPageNumber + 1 >= this.creditsPageLength) |
|
1200 { |
|
1201 return; |
|
1202 } |
|
1203 |
|
1204 this.creditsPageNumber++; |
|
1205 this.goToCreditsPageN(this.creditsPageNumber); |
|
1206 } |
|
1207 |
|
1208 /* |
|
1209 * Va a la page des crédits précédente. |
|
1210 */ |
|
1211 Mosaic.prototype.goToPreviousCreditsPage = function() |
|
1212 { |
|
1213 //Si on est sur la première page, on quitte. |
|
1214 if(this.creditsPageNumber == 0) |
|
1215 { |
|
1216 return; |
|
1217 } |
|
1218 |
|
1219 this.creditsPageNumber--; |
|
1220 this.goToCreditsPageN(this.creditsPageNumber); |
|
1221 } |
|
1222 |
|
1223 /* |
|
1224 * Va à la page N des crédits. |
|
1225 */ |
|
1226 Mosaic.prototype.goToCreditsPageN = function(N) |
|
1227 { |
|
1228 var notify_credits = $('#notify_credits'), arrowHeight = $('#credits_upArrow').height(), footer_height = $('#credits_footer').height(), margin = parseInt($('#notify_credits').css('margin-left')); |
|
1229 |
|
1230 //Si on est sur la première page, on cache la flèche haut. |
|
1231 if(this.creditsPageNumber == 0) |
|
1232 { |
|
1233 $('#credits_upArrow').css( |
|
1234 { |
|
1235 opacity: 0 |
|
1236 }); |
|
1237 $('#credits_downArrow').css( |
|
1238 { |
|
1239 opacity: 1 |
|
1240 }); |
|
1241 $('#credits_container').css( |
|
1242 { |
|
1243 top: margin, |
|
1244 height: notify_credits.height() - footer_height - arrowHeight |
|
1245 }); |
|
1246 } |
|
1247 //Si on est sur la dernière page, on cache la flèche bas. |
|
1248 else if(this.creditsPageNumber + 1 >= this.creditsPageLength) |
|
1249 { |
|
1250 $('#credits_upArrow').css( |
|
1251 { |
|
1252 opacity: 1 |
|
1253 }); |
|
1254 $('#credits_downArrow').css( |
|
1255 { |
|
1256 opacity: 0 |
|
1257 }); |
|
1258 $('#credits_container').css( |
|
1259 { |
|
1260 top: +arrowHeight + margin, |
|
1261 height: notify_credits.height() - footer_height - arrowHeight - margin |
|
1262 }); |
|
1263 } |
|
1264 //Si on est dans les autres pages, on affiche les deux flèches. |
|
1265 else |
|
1266 { |
|
1267 $('#credits_upArrow').css( |
|
1268 { |
|
1269 opacity: 1 |
|
1270 }); |
|
1271 $('#credits_downArrow').css( |
|
1272 { |
|
1273 opacity: 1 |
|
1274 }); |
|
1275 $('#credits_container').css( |
|
1276 { |
|
1277 top: +arrowHeight + margin, |
|
1278 height: notify_credits.height() - footer_height - 2 * arrowHeight - margin |
|
1279 }); |
|
1280 } |
|
1281 |
|
1282 //On déplace le texte des crédits. |
|
1283 $('#credits_container').css( |
|
1284 { |
|
1285 left: -($('#credits_container').width() * N - parseInt(notify_credits.css('margin-left')))// + this.column_gap) |
|
1286 }); |
|
1287 } |
|
1288 |
|
1289 |
|
1290 |
|
1291 /* |
1102 * Retourne vrai si le doigt est sur le bouton de lecture de video dans le mode d'interaction tablettes. |
1292 * Retourne vrai si le doigt est sur le bouton de lecture de video dans le mode d'interaction tablettes. |
1103 */ |
1293 */ |
1104 Mosaic.prototype.isOnPlayButton = function(x, y) |
1294 Mosaic.prototype.isOnPlayButton = function(x, y) |
1105 { |
1295 { |
1106 var playButton = $('#tabletPlayButton'); |
1296 var playButton = $('#tabletPlayButton'); |