| 1 |
// (function($) { |
| 2 |
// window.qcld_openrouter = { |
| 3 |
// open_ai_message_callback: function(msg) { |
| 4 |
// if(wp_chatbot_obj.openrouter_enabled == "1"){ |
| 5 |
// console.log('openrouterx'); |
| 6 |
|
| 7 |
// var data = { |
| 8 |
// 'action': 'openrouter_response', |
| 9 |
// 'name': globalwpw.hasNameCookie, |
| 10 |
// 'keyword': msg, |
| 11 |
// 'nonce': wp_chatbot_obj.ajax_nonce |
| 12 |
// }; |
| 13 |
|
| 14 |
// console.log(data); |
| 15 |
|
| 16 |
// var $container = $(globalwpw.settings.messageContainer); |
| 17 |
// var $lastChild = $(globalwpw.settings.messageLastChild); |
| 18 |
|
| 19 |
// if($lastChild.find('.wp-chatbot-comment-loader').length==0){ |
| 20 |
// $container.append(wpwKits.botPreloader()); |
| 21 |
// } |
| 22 |
|
| 23 |
// $.ajax({ |
| 24 |
// url: wp_chatbot_obj.ajax_url, |
| 25 |
// type: 'POST', |
| 26 |
// data: data, |
| 27 |
// success: function(res) { |
| 28 |
// var json = $.parseJSON(res); |
| 29 |
// if(json.status == 'success'){ |
| 30 |
// var serviceOffer = wpwKits.randomMsg(globalwpw.settings.obj.support_option_again); |
| 31 |
// setTimeout(function(){ |
| 32 |
// wpwMsg.single(json.message); |
| 33 |
// if(globalwpw.settings.obj.disable_repeatative != 1){ |
| 34 |
// setTimeout(function(){ |
| 35 |
// var serviceOffer = wpwKits.randomMsg(globalwpw.settings.obj.support_option_again); |
| 36 |
|
| 37 |
// if((globalwpw.settings.obj.qcld_disable_start_menu != "1")){ |
| 38 |
// if(typeof(globalwpw.wildcards) != 'undefined' && (globalwpw.wildcards != '')){ |
| 39 |
// wpwMsg.double_nobg(serviceOffer, globalwpw.wildcards); |
| 40 |
// }else{ |
| 41 |
// wpwMsg.single(serviceOffer); |
| 42 |
// } |
| 43 |
// } |
| 44 |
// }, globalwpw.settings.preLoadingTime) |
| 45 |
// }else{ |
| 46 |
// setTimeout(function(){ |
| 47 |
// if((globalwpw.settings.obj.qcld_disable_repited_startmenu != "1")){ |
| 48 |
// wpwMsg.single_nobg('<span class="qcld-chatbot-wildcard qcld_back_to_start" data-wildcart="back">' + wpwKits.randomMsg(globalwpw.settings.obj.back_to_start) + '</span>'); |
| 49 |
// } |
| 50 |
// }, globalwpw.settings.preLoadingTime*2); |
| 51 |
// } |
| 52 |
// }, globalwpw.settings.preLoadingTime) |
| 53 |
// } |
| 54 |
// } |
| 55 |
// }); |
| 56 |
// } |
| 57 |
// } |
| 58 |
// }; |
| 59 |
// })(jQuery); |