change query for credit payment and add sound effect for ordering
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||
@@ -28,6 +28,7 @@
|
||||
//= require raphael/raphael.min
|
||||
//= require Chart.bundle
|
||||
//= require chartkick
|
||||
//= require cable
|
||||
//= require fileinput.min.js
|
||||
//= require settings/processing_items
|
||||
//= require BSBMaterial/admin.js
|
||||
|
||||
@@ -5,8 +5,8 @@ App.order = App.cable.subscriptions.create('OrderChannel', {
|
||||
|
||||
received: function(data) {
|
||||
var hostname = location.hostname.trim();
|
||||
console.log(hostname)
|
||||
console.log(data.from)
|
||||
// console.log(hostname)
|
||||
// console.log(data.from)
|
||||
if(data.from == "" || hostname == data.from)
|
||||
{
|
||||
if (data.type == 'order') {
|
||||
|
||||
36
app/assets/javascripts/channels/sound_effect.js
Normal file
36
app/assets/javascripts/channels/sound_effect.js
Normal file
@@ -0,0 +1,36 @@
|
||||
App.sound_effect = App.cable.subscriptions.create('SoundEffectChannel', {
|
||||
connected: function() {},
|
||||
|
||||
disconnected: function() {},
|
||||
|
||||
received: function(data) {
|
||||
var hostname = location.hostname.trim();
|
||||
if(data.from == "" || hostname == data.from){
|
||||
var shop_code = data.shop_code;
|
||||
var audio = data.audio;
|
||||
var data = data.data;
|
||||
|
||||
if(data.status){
|
||||
var audio = new Audio('/'+audio); // define your audio
|
||||
audio.play();
|
||||
}
|
||||
|
||||
if(data.status && ((data.message != undefined) && (data.message!=""))){
|
||||
swal({
|
||||
title: 'Information',
|
||||
text: data.message,
|
||||
type: 'success',
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function (isConfirm) {
|
||||
if(isConfirm){
|
||||
swal.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user