1;(function($) { 2 3 class PM_Pusher { 4 constructor() { 5 this.pusher = ''; 6 this.channel = ''; 7 8 this.authentication() 9 .registerChannel() 10 .registerEvents(); 11 } 12 13 authentication() { 14 if(!PM_Pusher_Vars.pusher_app_key) { 15 return this; 16 } 17 18 this.pusher = new Pusher( PM_Pusher_Vars.pusher_app_key , { 19 cluster: PM_Pusher_Vars.pusher_cluster, 20 authEndpoint: `${PM_Pusher_Vars.api_base_url}${PM_Pusher_Vars.api_namespace}/user/1/pusher/auth` 21 }); 22 23 return this; 24 } 25 26 registerChannel() { 27 if(!this.pusher) { 28 return this; 29 } 30 this.channel = this.pusher.subscribe(PM_Pusher_Vars.channel+'-'+PM_Pusher_Vars.user_id); 31 32 return this; 33 } 34 35 registerEvents() { 36 if(!this.channel) { 37 return this; 38 } 39 var self = this; 40 41 jQuery.each(PM_Pusher_Vars.events,function( key, event ) { 42 43 self.channel.bind(event, function(data) { 44 let title = typeof data.title == 'undefined' ? '' : data.title; 45 let message = typeof data.message == 'undefined' ? '' : data.message; 46 47 48 toastr.info(title, message, { 49 "closeButton": true, 50 "debug": false, 51 "newestOnTop": false, 52 "progressBar": false, 53 "positionClass": "toast-top-right", 54 "preventDuplicates": false, 55 "onclick": null, 56 "showDuration": "500", 57 "hideDuration": "1000", 58 "timeOut": "5000",//Set 0 for push 59 "extendedTimeOut": "1000",//Set 0 for push 60 "showEasing": "swing", 61 "hideEasing": "linear", 62 "showMethod": "fadeIn", 63 "hideMethod": "fadeOut", 64 "tapToDismiss": false 65 }); 66 67 jQuery('#toast-container').addClass('pm-pro-pusher-notification-wrap'); 68 }); 69 }); 70 } 71 } 72 73 var PM_Pusher_Action = new PM_Pusher(); 74 75})('jQuery')
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.