aaudio play under origami
This commit is contained in:
@@ -15,8 +15,11 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
|
||||
var active_class = "";
|
||||
if(key==0){
|
||||
active_class = "tr-active";
|
||||
if (typeof showNewOrder !== 'undefined' && $.isFunction(showNewOrder)) {
|
||||
showNewOrder(order[key],shop_code);
|
||||
if (typeof audioPlayBackground !== 'undefined' && $.isFunction(audioPlayBackground)) {
|
||||
audioPlayBackground(shop_code);
|
||||
}
|
||||
if (typeof showNewOrderAlert !== 'undefined' && $.isFunction(showNewOrderAlert)) {
|
||||
showNewOrderAlert(order[key],shop_code);
|
||||
}
|
||||
}
|
||||
var rowCount = key+1;
|
||||
|
||||
@@ -160,6 +160,7 @@ $(document).ready(function() {
|
||||
|
||||
/* start order reservation function */
|
||||
function audioPlayBackground(shop_code){
|
||||
console.log(shop_code);
|
||||
//audio play
|
||||
var audio = new Audio('/'+shop_code+'-beep.mp3'); // define your audio
|
||||
// setTimeout(function(){
|
||||
|
||||
@@ -484,13 +484,12 @@ function callback_url(callback,ref_no,order_id,status,min_type,time,exptime,reas
|
||||
});
|
||||
}
|
||||
|
||||
function showNewOrder(order_reservation,shop_code){
|
||||
function showNewOrderAlert(order_reservation,shop_code){
|
||||
if((order_reservation!=undefined) && (order_reservation!=null) && (order_reservation!="")){
|
||||
var date = new Date(order_reservation.requested_time);
|
||||
var time = timeFormat(date);
|
||||
var requested_date = date.getFullYear() + '-' + (date.getMonth() >= 10? date.getMonth() : '0' + (date.getMonth() + 1)) +'-'+ (date.getDate() >= 10? date.getDate() : '0' + date.getDate()) +' '+time;
|
||||
$('.first-1').click();
|
||||
audioPlayBackground(shop_code);
|
||||
|
||||
swal({
|
||||
title: 'Information',
|
||||
|
||||
Reference in New Issue
Block a user