// mono me to slim jquery // to dokimasa etsi se diafora site, se merika iparxei thema.. px sto https://www.pa.martin.fl.us/ den mou anoigei ta emoticons k petaei console error .. // telika to ekana olo me pure javascript.. //testing rtl language: copy paste the following text in the chat window: // این تنها یک امتحان است var onWebChat_ = onWebChat_ || (function () { // gia na kano init kai na pernao parametrous apo to index.hmtl if (!window.console) console = {log: function() {}}; // add console.log function for IE8 .. let version = 17; //just for logging (know what file version visitor has) function getCurrentTime() { if (window.performance && window.performance.now) { return window.performance.now(); } else { return Date.now(); } } const startTime = getCurrentTime(); // when load the js chat widget code let startConnectTime; // from last socket connect let endTime; var logging=false; var isLocalhost=false; var isAgentFromAndroid=0; var isMoving=0; var onwbchtMaxX, onwbchtMaxY; var mustSendTriggerTextJs = false; //var mustSendTriggerNoReplyTextJs = false; var timerNoReply=0; let timeoutTime_userconnect; // // if (logging) console.log("inside js: ar:"+onWebChat.ar); // // if (logging) console.log(onWebChat.ar); var texts = { min_offline: { l1: 'No estamos en linea - Déjanos mensajel!', l2: 'No estamos en linea - Déjanos mensajel!' }, min_online: { l1: 'Estamos en linea!', l2: 'Estamos en linea!' }, max_title: { l1: 'Chatea con nosotros!', l2:'Chat with us!'}, max_msg: { l1: 'Chatea con nosotros!', l2:'Estamos en linea - chatea con nosotros!'}, max_served: { l1: 'Estas hablanco con {{operator}}', l2:'Estas hablanco con {{operator}}'}, max_me: { l1: 'Me:', l2: 'Me:' }, max_agent: { l1: '{{operator}}:', l2: '{{operator}}:' }, max_placeholder: { l1: 'Escribe tu mensaje aquí ...', l2: 'Escribe tu mensaje aquí...' }, max_closed: { l1: '{{operator}} ha cerrado el chat', l2: '{{operator}} ha cerrado el chat!' }, max_typing: {l1: '{{operator}} is typing..', l2: '{{operator}} is typing..'}, off_title:{l1: 'Escríbenos!', l2:'Escríbenos!'}, off_msg:{l1: 'Lo sentimos, no estamos conectados en estos momentos. Dejanos un mensaje y te contestaremos a la brevedad posible. Gracias.', l2:'Lo sentimos, no estamos conectados en estos momentos. Dejanos un mensaje y te contestaremos a la brevedad posible. Gracias.'}, off_name: { l1:'Nombre', l2: 'Nombre'}, off_email: { l1: 'Correo Electrónico', l2: 'Correo Electrónico'}, off_phone: { l1: 'phone', l2: 'phone'}, off_text: { l1: 'Mensaje', l2: 'Mensaje'}, prechat_name: { l1:'nombre', l2: 'name'}, prechat_email: { l1: 'email', l2: 'email'}, prechat_phone: { l1: 'tel.', l2: 'phone'}, prechat_text: { l1: '¿Cómo le podemos ayudar?', l2: 'how can we help you?'}, off_send: { l1:'Enviar', l2: 'Enviar'}, off_thank: { l1: 'Gracias por contactarnos. Te devolveremos el mensaje a la brevedad posible.', l2: 'Gracias por contactarnos. Te devolveremos el mensaje a la brevedad posible.'}, prechat_msg: { l1: 'Por favor denos alguna info de usted para poderle ayudar mejor! Gracias.', l2: 'Please give us some info to serve you better.'}, prechat_btn: { l1: 'Start chat!', l2: 'Start chat!'} , max_gone: { l1: 'El operador se ha ido fuera de linea!', l2: 'El Operador se ha desconectado.'} , consent_text: { l1: 'I agree that my personal data, provided via chat, to be processed for using live chat service', l2: 'I agree that my personal data, provided via chat, to be processed for using live chat service'} , menu_send_file: { l1: 'Send file', l2: 'Send file'} , menu_email: { l1: 'Email transcript', l2: 'Email transcript'} , menu_print: { l1: 'Print', l2: 'Print'} , menu_save: { l1: 'Save', l2: 'Save'} , menu_sound: { l1: 'Sound', l2: 'Sound'} , menu_end_chat: { l1: 'End chat', l2: 'End chat'} , end_chat_msg: { l1: 'Are you sure you want to close this chat?', l2: 'Are you sure you want to close this chat?'} , cancel: { l1: 'Cancel', l2: 'Cancel'} , rating_msg: { l1: 'Thank you. We would appreciate it if you could rate this chat', l2: 'Thank you. We would appreciate it if you could rate this chat'} , rating_btn: { l1: 'Submit', l2: 'Submit'} , rating_no_msg: { l1: 'No, thanks', l2: 'No, thanks'} , departments: { l1: 'Choose a department', l2: 'Choose a department'} }; // einai object, oxi string!, periexei ola ta strings pou xreiazomai // {"min_offline":{"l1":"We are offline - Send us an email","l2":"We are offline - Send us an email"},"min_online":{"l1":"We are online - chat with us!","l2":"We are online - chat with us!"},"max // if (logging) console.log("!!!:"+JSON.stringify(texts)); // if (logging) console.log(texts); var clientName="", clientEmail="", clientPhone="", clientNotes=""; var callbackOnClick = function(){}; // gia set me to api var callbackOnMaximize = function(){}; // gia set me to api var callbackOnMinimize = function(){}; // gia set me to api var callbackOnTrigger = function(){}; // gia set me to api var callbackOnStartWriting = function(){}; // gia set me to api var callbackOnUpdateOperators = function(){}; // gia set me to api // temp!!! check!!! var callbackOnNewMessage = function(){}; // gia set me to api // var callbackOnWebChatLoaded = function(){};// otan fortosei to onWebChat widget sto site! var onlineColor=""; var offlineColor=""; var hasStartedWriting=0; var endChatButtonEnabled = false; var client_ip="18.217.178.196"; var language="l2"; // l1 i l2 // if (logging) console.log("language:"+language + " client_ip:" + client_ip); //if (language != 'gr' && language != 'en') language = 'en'; var languageFile = ""; var operatorImage = ""; // // if (logging) {console.log("op.image:" + sessionStorageGet("servingOpImage") ); } if (sessionStorageGet("servingOpImage") != "" && sessionStorageGet("servingOpImage")!=undefined ){ // // if (logging) {console.log("op.image not empty!!"); } operatorImage = sessionStorageGet("servingOpImage"); // lino to bug, opou an milousa me enan agent kai edeixne to image tou, meta apo refresh mporei na edeixne image allou operator, an einai polloi sindedemenoi //tora to kratao sto sessionstorage to image me auton pou milaei. otan kleisei o dialogos to svino. } var showOperatorImages = "1"; // if (logging) console.log("showOperatorImages:" + showOperatorImages); if (showOperatorImages == 1 && operatorImage == ""){ operatorImage = "0_support_man.png"; } const volumeOnPath= ''; const volumeOffPath= ''; var showChatApi=-1; // set if use api to show or hide chat window (exei panta protereotita) (an o xeiristis milisei den tha emfanistei to chat parathiro) var alwaysOffline = 0; // set to 1 for me, to xrisimopoio mono ego sto site www.onwe.., otan thelo na fainetai mono offline to chat se kapies xores, px india var image_hide_api = -1; // set to 0 if use api to hide chat image (only hide if is set to shown from admin) var num_connected = 0; //var modern =1; // to evgala 24/9/22 giati den xreiazetai afou oloi einia sto modern //0 to classic, 1: modern (ola ta site einai sto modern.. (to classic den to xrisimopio)) //var bubbles_use = "1"; // 0 or 1 // to evgala 24/9/22 giati den xreiazetai afou oloi einia sto modern kai to bubbles_use to ekana 1 var image_use = "1"; //0 or 1 var rating_use = "0"; //0 or 1 var dialogid = 0; // mono gia ta ratings ta xrisimopoio var rating = 0; // mono gia ta ratings ta xrisimopoio var isRated = 0; // ean exei ginei rated // if (logging) console.log("rating_use:"+ rating_use); var showOnlyImage="0"; // an einai 1 , tote den emfanizetai to minimized window, mono i eikona.., prepei an einai 1 na einai k to image_use 1 //var showOnlyImage=1; if (sessionStorageGet("isRated") != "" && sessionStorageGet("isRated") != undefined ){ isRated = sessionStorageGet("isRated"); } let textAreaMaxLength = 2000; // mono ta prota 1500 apothikeuontai sto table chat.text (length: 1500) const textAreaMaxLengthWithBot = 400; // limit textarea max lenght when chat with bot, for saving money let disabledSendButton = true; // by default, kai to kano enabled molis sindethei to socket let chatWithBot = 0; // aichatbot ai bot ai chat bot aibot if (sessionStorageGet("chatWithBot") != "" && sessionStorageGet("chatWithBot") != undefined ){ chatWithBot = sessionStorageGet("chatWithBot"); } if (chatWithBot == 1){ textAreaMaxLength = textAreaMaxLengthWithBot; } //bubbles_use = 1; if (showOnlyImage==1 && image_use==0) { // if (logging) console.log("den ginetai showOnlyImage==1 && image_use==0"); showOnlyImage=0; } var imageNumberId = 0;// gia na dino ena id auxon sta images (xreiazetai) var previous_chat = ""; // keno i 'me' i 'agent' , gia na min kano round to top corner otan grafei o visitor i agent if (showOnlyImage==1) { sessionStorageSet('hideImage', 0); //sessionStorage.hideImage=0; } var isAbleToWrite = true; var nowIsShowing = ""; // offline i prechat i chat (analogos ti fainetai auti tin stigmi) if (sessionStorageGet('hideImage')!=0 && sessionStorageGet('hideImage')!=1) { sessionStorageSet('hideImage', 0); //sessionStorage.hideImage=0; // an den exei tethei to kano 0 } //sessionrandom = getCookie('onwbchtsessionrandom'); // gia browsers pou den stelnoun cookie sto socket ..(for hash) // etixe na simvainei k me orismena site, px zahlapeto.bg siteid:52580 // genika auto to site eixe ena thema me to diavasma kai apothikeusi ton cookies, opote metatrepo merika cookies se localstorage var sessionrandom = localStorageGet('onwbchtsessionrandom'); if ((sessionrandom == 'null') || (sessionrandom == null) || (sessionrandom == '') || (sessionrandom == 'undefined')) { sessionrandom = Math.floor((Math.random() * 1000000) + 1); localStorageSet("onwbchtsessionrandom", sessionrandom); } //var preConnect = "#preconnect" ; // true or false var preChatForm = "0"; // 0 i 1 var roundedCorners = "1"; // 0 i 1 var siteId = 12775; if (siteId == 0){ // 0 , enable logging on a site for debbuging-testing .. (also must comment line 17 in ./ipchange.sh, otherwise all logging is in comments) logging = true; } // console.log("siteid:" + siteId); var cssFile = ".onwebchatbox span{font-size:unset;margin:initial;padding:initial}.onwebchatbox div{padding:initial;font-size:initial;margin:initial}.onwebchatbox #offline_form{display:none;position:initial;line-height:inherit}.onwebchatbox #prechat_form{display:none;position:initial}.onwebchatbox a{margin-bottom:0 !important;border-width:0 !important;border-style:none !important;display:inline;color:#393939;letter-spacing:initial;text-decoration:underline;vertical-align:baseline !important;cursor:pointer !important}.onwebchatbox a:hover{text-shadow:0 0 1px #b1b1b1}.onwebchatbox .onweb_uploadfile{margin-right:10px;margin-bottom:-3px}.onwebchatbox .onweb_uploadimage{background:url('https://www.onwebchat.com/chatimages/loading.gif');background-repeat:no-repeat;background-position:center}#onweb_chatimage_div{position:fixed;bottom:0;right:20px;width:#chat_widthpx;z-index:2147483600}#operatorImageSmall{width:32px !important;height:32px !important;position:absolute !important;border-radius:20px !important;left:-37px !important;top:0 !important;box-shadow:0 0 7px 2px #bebebe !important;cursor:initial !important;user-drag:none !important;-webkit-user-drag:none !important;overflow:hidden}@media(max-width:480px){#operatorImageSmall{zoom:1.14 !important}}.operatorImageSmallClass{zoom:1}#operatorImage{position:absolute;z-index:100 !important;border-radius:30px;border-style:solid;border-color:#ababab;top:8px !important;left:20px !important;width:50px !important;height:50px !important;border-width:0 !important;user-drag:none !important;-webkit-user-drag:none !important;overflow:hidden;background:#fffffff7 !important}.onweb_chatimage{position:absolute !important;bottom:30px !important;left:78px !important;cursor:pointer !important;border:none !important;opacity:1 !important;width:115px !important;max-height:initial !important;max-width:initial !important;min-width:initial !important;min-height:initial !important;-webkit-filter:brightness(100%);-webkit-transition:all .7s ease;-moz-transition:all .7s ease;-o-transition:all .7s ease;-ms-transition:all .7s ease;transition:all .7s ease}.onweb_chatimage_mobile{position:absolute !important;bottom:13px !important;right:20px !important;cursor:pointer !important;border:none !important;opacity:1 !important;width:60px !important;max-height:initial !important;max-width:initial !important;min-width:initial !important;min-height:initial !important}img#onweb_chatimage:hover{opacity:1;-webkit-filter:brightness(112%);-webkit-transition:all .7s ease;-moz-transition:all .7s ease;-o-transition:all .7s ease;-ms-transition:all .7s ease;transition:all .7s ease}.onwebchatbox .onweb_chatimage:-moz-loading{visibility:hidden}.onwebchatbox .onweb_chatimage_x{position:absolute;visibility:hidden;z-index:2147483600;display:inline;cursor:pointer;border:0;opacity:.5}.onwebchatbox .wblogoimg{margin-right:10px;margin-top:7px}.onwebchatbox .wblogoimgdiv{text-align:right;width:100%}.onwebchatbox img{vertical-align:baseline;border:0;cursor:pointer;width:initial !important;margin:0;padding:0;clear:initial;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.onwebchatbox .onwcimg{vertical-align:baseline;border:0;cursor:pointer;margin:0;clear:initial;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.onwebchatbox{all:initial;*{all:unset}color:#555;box-shadow:0 0 5px 0 #777 !important;line-height:16px !important;display:none;text-align:left;position:fixed !important;bottom:0 !important;right:20px;width:#chat_widthpx !important;height:#onwebchatbox_header1_heightpx;font-family:Arial,Helvetica,sans-serif !important;background-color:#fcfcfc;font-size:12px !important;border-top-left-radius:6px !important;border-top-right-radius:6px !important;z-index:2147483610 !important;box-sizing:content-box !important;color:#545454 !important;backgroundtransition:initial !important}.onwebchatbox svg,.onwebchatbox svg *{all:revert-layer}#onwbchat_window{background-image:url(https://www.onwebchat.com/chatimages/backgrounds/back4.png);border-radius:11px !important;border-top-left-radius:13px !important;border-top-right-radius:13px !important;box-shadow:rgba(0,0,0,0.43) 0 0 1.2em !important}.onwebchatbox .webchat_header{display:block !important;white-space:nowrap !important;background-color:#8c8cff !important;height:#onwebchatbox_header_height_+_4px !important;min-height:36px !important;line-height:#onwebchatbox_header1_heightpx !important;cursor:pointer;box-sizing:content-box !important;margin:0 !important;padding:0 !important;border:0 !important;outline:0 !important;float:left !important;padding-left:12px !important;padding-right:28px !important;vertical-align:baseline !important;font-size:13px !important;font-weight:bold !important;width:#chatheader_widthpx !important;position:relative;border-top-left-radius:11px !important;border-top-right-radius:11px !important;background-image:url(https://www.onwebchat.com/chatimages/backgrounds/trans-back4.png)}.onwebchatbox .webchat_header:hover{opacity:1}.onwebchatbox .webchat_header a{float:right;text-decoration:none;color:#fff;display:block;margin-right:0;padding-left:0;padding-right:0;line-height:13px}}.onwebchatbox .webchat_header a:hover{color:#000}.onwebchatbox .chat_area{float:left;clear:left;width:#chat_widthpx;height:#chat_area_heightpx;margin-top:0;margin-bottom:0;padding:26px 0 0 0;overflow:auto;color:#a4a4a4;box-sizing:content-box;direction:ltr !important;box-shadow:inset 0 11px 17px -17px rgba(0,0,0,0.4) !important}.onwebchatbox #chat_area_id{box-sizing:initial !important}#chat_area_id::-webkit-scrollbar{width:13px !important}#chat_area_id::-webkit-scrollbar-track{-webkit-border-radius:30px;border-radius:30px !important}#chat_area_id::-webkit-scrollbar-thumb{background-clip:content-box !important;background:#cdcdcd;-webkit-border-radius:10px;border-radius:12px;border:3px solid transparent !important}#chat_area_id::-webkit-scrollbar-thumb:hover{background:#bababa !important}#chat_area_id::-webkit-scrollbar-thumb:active{background:#a5a5a5 !important}#chat_area_id::-webkit-scrollbar-thumb:hover{background-color:#bababa !important}#chat_area_id::-webkit-scrollbar-thumb:active{background-color:#a5a5a5 !important}#onwbtxtarea::-webkit-scrollbar{width:0 !important}.onwebchatbox .chat_area .me a{color:#visitor_css_text_color !important;text-decoration:underline !important;letter-spacing:normal !important;line-height:normal !important}.onwebchatbox .chat_area .agent a{color:#agent_css_text_color !important;text-decoration:underline !important;letter-spacing:normal !important;line-height:normal !important}.onwebchatbox .chat_info{clear:left;height:10px;background-color:#fcfcfc;border-top:1px solid #ddd;box-sizing:border-box;border-top:1px solid ##e2e2e2 !important;width:90% !important;float:none !important;margin:auto !important}.onwebchatbox .chat_message{position:initial;width:100%;height:55px;float:left;clear:left;padding-top:0;background-color:#fcfcfc;box-sizing:content-box}#onwc_chat_message_div{position:absolute;bottom:0;height:68px !important;border-bottom-left-radius:11px !important;border-bottom-right-radius:11px !important}.onwebchatbox #onwbtxtarea{float:none !important;padding:4px 25px 0 4px !important;font-weight:400 !important;text-align:initial !important;font-style:initial !important;box-sizing:initial !important;white-space:initial !important;position:absolute !important;left:9px !important;bottom:25px !important}.onwebchatbox input::-webkit-input-placeholder,.onwebchatbox textarea::-webkit-input-placeholder{color:#919191 !important;font-size:14px !important;font-weight:400 !important;line-height:inherit !important;font-family:inherit !important;padding:0 2px 0 2px}.onwebchatbox input::-moz-placeholder,.onwebchatbox textarea::-moz-placeholder{color:#919191 !important;font-size:14px !important;font-weight:400 !important;font-family:inherit !important;line-height:inherit !important}.onwebchatbox input:-ms-input-placeholder,.onwebchatbox textarea:-ms-input-placeholder{color:#919191 !important;font-size:14px !important;font-weight:400 !important;font-family:inherit !important;line-height:inherit !important}.onwebchatbox .chat_message .onwebtextarea{width:#textarea_widthpx !important;line-height:normal !important;min-height:initial !important;min-width:initial !important;max-height:initial !important;max-width:initial !important;font-family:Arial,Helvetica,sans-serif !important;text-transform:initial !important;letter-spacing:initial !important;color:#545454 !important;display:block;margin-left:auto !important;margin-right:auto !important;margin-bottom:initial !important;padding:2px 2px 2px 2px !important;background-image:none !important;resize:none;outline:none !important;border-radius:5px !important;box-sizing:content-box;transition:box-shadow .40s,border-color .40s ease-in-out;border:none !important;box-shadow:none !important;font-size:14px !important;height:27px !important;background-color:transparent !important}@media(max-width:480px){.onwebchatbox .chat_message .onwebtextarea{font-size:100% !important}.onwebchatbox input::-webkit-input-placeholder,.onwebchatbox textarea::-webkit-input-placeholder{font-size:15px !important}.onwebchatbox input::-moz-placeholder,.onwebchatbox textarea::-moz-placeholder{font-size:15px !important}.onwebchatbox input:-ms-input-placeholder,.onwebchatbox textarea:-ms-input-placeholder{font-size:15px !important}}.onwebchatbox .chat_message textarea:hover{border:none !important}.onwebchatbox .chat_message textarea:focus{border:none !important}.onwebchatbox #onweb-offline-icon{margin:initial !important;border:none !important;box-sizing:content-box !important;vertical-align:baseline !important;padding-top:1px !important}.onwebchatbox #onweb-online-icon{margin:initial !important;border:none !important;box-sizing:content-box !important;vertical-align:baseline !important}.onwebchatbox #onweb_chaticon{display:inline !important;position:absolute !important;right:0 !important;float:right !important;line-height:24px !important;margin-right:16px !important;margin-top:11px !important}.onwebchatbox .con:hover{opacity:.75}.onwebchatbox .onweb_minimize_btn_icon{display:initial !important;border:solid;border-width:0 3px 3px 0;position:absolute;top:#onweb_min_btn_marginpx !important;padding:4px;transform:rotate(45deg);-webkit-transform:rotate(45deg);margin-right:15px;color:#ddd;cursor:pointer;right:6px !important;zoom:01.0}.onwebchatbox .onweb_minimize_btn_icon:hover{margin-top:1px}.onwebchatbox .onweb_menu_minimize_btn{border:solid;border-width:0 2px 2px 0;padding:3px;border-color:#929292;position:relative;top:-35px;float:right;transform:rotate(45deg);-webkit-transform:rotate(45deg);margin-right:15px;color:#ddd;cursor:default;right:6px !important;zoom:01.0}.onwebchatbox div.maximize_onwebchatbox{display:inline}.onwebchatbox .chat_area p{letter-spacing:.1px !important;padding-left:12px;padding-right:12px;font-size:14px !important;font-family:Arial,Helvetica,sans-serif !important;line-height:20px;float:left;clear:left;word-wrap:break-word;max-width:max-content;margin:0;color:#agent_css_text_color;box-sizing:content-box}@media(max-width:480px){.onwebchatbox .chat_area p{font-size:115% !important;line-height:1.18 !important}}.onwebchatbox .chat_area .error{color:#c30000;font-style:italic}.onwebchatbox .chat_area .me{color:#visitor_css_text_color !important;margin-bottom:10px !important;font-family:arial,verdana,sans-serif !important;text-align:right}.onwebchatbox .spanbold{font-weight:700;margin-left:initial;float:initial;font-size:12px !important}@media(max-width:480px){.onwebchatbox .spanbold{font-size:14px !important}}.onwebchatbox .me .spanbold,.onwebchatbox .agent .spanbold{display:none}.onwebchatbox .chat_area .agent{color:#agent_css_text_color !important;margin-bottom:10px !important;min-height:10px !important;font-family:arial,verdana,sans-serif !important}.onwebchatbox .chat_area .system{font-style:italic;font-size:11px}.onwebchatbox #onwebchat-logo-span{position:absolute !important;color:#707070 !important;font-weight:500 !important;font-family:Arial,sans-serif !important;letter-spacing:0 !important;font-size:11.7px !important;font-style:normal !important;bottom:5px !important;direction:ltr !important;user-select:none !important;left:50% !important;transform:translateX(-50%) !important}.onwebchatbox #off-form-onwebchat-logo{display:none;float:right !important;position:absolute !important;margin:0 !important;right:9px !important;border:none !important;box-sizing:content-box !important;opacity:.91;bottom:7px !important}.onwebchatbox #off-form-onwebchat-logo:hover{opacity:1}.onwebchatbox .widget-logo{float:right !important;position:absolute !important;margin:0 !important;bottom:0 !important;right:4px !important;border:none !important;padding:4px 6px !important;box-sizing:content-box;height:initial !important;width:initial !important;margin:initial !important;opacity:.80}.onwebchatbox .widget-logo:hover{opacity:1}.onwebchatbox #div_chat_min_title{display:block;position:initial;margin:auto 10px auto auto;width:97%;text-align:center;overflow:hidden;margin-right:10px;line-height:inherit !important}.onwebchatbox #div_chat_min_title_span{color:#f1f1f1 !important;font-family:arial,verdana,sans-serif !important;font-weight:300 !important;letter-spacing:.3px !important;font-size:14px !important;line-height:42px !important;vertical-align:baseline !important}.onwebchatbox #div_chat_max_title{display:none;position:initial;margin:auto 10px auto auto;width:96%;text-align:center;overflow:hidden;margin-right:10px;line-height:inherit !important}.onwebchatbox #div_chat_max_title_span{padding-left:10px !important;color:#f1f1f1 !important;font-family:arial,verdana,sans-serif !important;line-height:#onwebchatbox_header1_heightpx !important;font-weight:500 !important;font-size:15px !important;vertical-align:baseline !important;letter-spacing:.3px !important}@media(max-width:480px){.onwebchatbox #div_chat_max_title_span{font-size:18px !important}}.onwebchatbox .server_messages{display:block;text-align:center;width:90%;max-width:90% !important;margin:auto;color:#727787 !important;padding:0 0 10px 15px;box-sizing:content-box}.onwebchatbox .server_messages span{color:#727787 !important}.onwebchatbox .onweboffline_msg{position:relative !important;display:block !important;font-size:14px;font-weight:400;font-family:arial,verdana,sans-serif !important;color:#393939 !important;padding:2% 10% 0 !important;margin-top:22% !important;margin-bottom:3px !important;top:initial !important;min-height:26px !important;line-height:20px !important}.onwebchatbox .ns{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.onwebchatbox .onwebchat_title2{display:block;text-align:center !important;width:54% !important;margin:auto !important;color:#737379 !important;font-family:arial,verdana,sans-serif !important;font-weight:300 !important;border-radius:13px !important;box-sizing:initial;line-height:18px !important;position:relative;margin-top:13% !important;box-shadow:1px 1px 3px 0 #c9c9c9 !important;padding:14px 19px 14px 19px !important;max-width:160px !important;background:#f2f2f2 !important;border:none !important;font-size:15px !important}@media(max-width:480px){.onwebchatbox .onwebchat_title2{zoom:1.3 !important}}.onwebchatbox .onwebchat_title2::after{content:'';width:0;height:0;position:absolute;bottom:-16px;left:18%;border-left:0 solid transparent;border-right:22px solid transparent;border-top:17px solid #f2f2f2}.onwebchatbox .onwebchat_title2::before{content:'';width:0;height:0;position:absolute;bottom:-15px;left:23%;border-left:5px solid transparent;border-right:12px solid transparent;border-top:0}.onwebchatbox .onwebchatform_div{display:block;position:initial;line-height:inherit;width:80%;margin:19px auto auto;color:#545454 !important}.onwebchatbox #onwebchatoffname,#onwebchatoffemail,#onwebchatofftel,#onwebchatemailtext,#onprechatname,#onprechatemail,#onprechattel,#onprechattext,#departments{float:initial !important;display:block;background-color:#fefefe !important;background-image:none !important;padding:7px 11px !important;font-size:14px !important;font-weight:initial !important;font-family:Arial,Helvetica,sans-serif !important;font-style:initial !important;text-transform:initial !important;text-indent:initial !important;text-align:initial !important;letter-spacing:.2px !important;color:#393939 !important;width:100% !important;max-width:initial !important;max-height:initial !important;min-width:initial !important;min-height:initial !important;resize:none !important;outline:none !important;border-radius:5px !important;line-height:inherit !important;transition:box-shadow .40s,border-color .40s ease-in-out !important;box-sizing:border-box !important;box-shadow:inset 0 1px 2px rgba(0,0,0,0.1) !important;height:36px !important;margin:12px auto 11px !important}.onwebchatbox .onwebchatform_div #onprechattext{height:68px !important;line-height:normal !important;text-align:initial !important;white-space:initial !important}.onwebchatbox .onwebchatform_div #onwebchatemailtext{height:82px !important;line-height:normal !important;text-align:initial !important;border:1px solid #ccc !important;white-space:initial !important}#prechat_btn{margin:30px auto 20px !important;color:#fff !important;background-image:inherit;background-color:#8c8cff !important;width:100% !important;font-weight:600 !important;height:40px !important;max-width:initial !important;letter-spacing:.1px !important}.onwebchatbox #onwebchatoffname:focus,#onwebchatoffemail:focus,#onwebchatemailtext:focus,#onwebchatofftel:focus,#onprechatname:focus,#onprechatemail:focus,#onprechattext:focus,#onprechattel:focus{background:inherit;box-shadow:0 0 1px !important}#offlineform_btn{background-color:#8c8cff !important;width:100% !important;font-weight:600 !important;height:40px !important;max-width:initial !important;letter-spacing:.1px !important}#offlineform_ok_btn{background-color:#8c8cff !important;min-width:100% !important;height:37px !important}.onwebchatbox .onweb_mail_btn{display:block !important;margin:30px auto 20px !important;text-align:center !important;text-transform:initial !important;text-indent:initial !important;font-family:Arial,Helvetica,sans-serif !important;font-style:normal !important;font-weight:400 !important;background-color:#8c8cff !important;cursor:pointer;padding:3px 14px !important;border-style:none !important;position:relative !important;border-radius:5px !important;float:inherit !important;min-width:80px !important;width:initial;max-width:200px !important;outline:none !important;min-height:initial !important;height:28px !important;line-height:16px !important;box-sizing:border-box !important;text-shadow:inherit !important;box-shadow:none !important;letter-spacing:inherit !important;font-size:14px !important}.onwebchatbox .onweb_mail_btn:hover{background-color:#8c8cff;opacity:.82;border-style:none;box-shadow:none !important}.onwebchatbox .me-bubble{background-color:#efeded;width:69% !important;margin-right:5% !important;padding:8px;position:relative !important;float:right !important;text-align:left;clear:both !important;border-radius:11px;border:0;margin-left:8px !important}.onwebchatbox .me-first{border-top-right-radius:2px !important}.onwebchatbox .agent-bubble{background-color:#d1d1d1;width:60% !important;margin-left:5% !important;padding:8px;position:relative;text-align:left;clear:both !important;border-radius:11px;border:0;margin-right:8px !important}.onwebchatbox .big-margin-left{margin-left:13% !important}.onwebchatbox .agent-first{border-top-left-radius:2px !important}.onwebchatbox .onwebchat-widget-settings-icon{opacity:.83 !important;position:absolute !important;bottom:1px !important;left:12px !important;height:29px !important;fill:#787878 !important;cursor:pointer !important;border-radius:34px !important;transition:transform .25s ease,background .25s ease !important;-webkit-transition:-webkit-transform .25s ease,background .25s ease !important;-webkit-tap-highlight-color:transparent}.onwebchatbox .onwebchat-widget-settings-icon:hover{opacity:1 !important;background:#e3dbdb8a !important;border-radius:34px !important}.onwebchatbox #onwebchat-emoticons-div{position:absolute;bottom:66px !important;right:4px !important;background-color:#fff !important;box-shadow:0 3px 12px 1px #b5b5b5 !important;border:1px solid #d2d2d2 !important;display:none;margin:0 !important;padding:4px 6px !important;list-style-type:none !important;box-sizing:content-box !important;line-height:initial !important;width:223px !important;width:-moz-max-content !important;width:max-content !important;border-radius:8px !important;font-size:22px !important;line-height:1.5 !important;user-select:none !important;z-index:999999 !important}#onwebchat-emoticons-div:after{display:block !important;content:'' !important;border:9px solid transparent !important;border-top-color:#fff !important;position:absolute !important;right:9px !important;bottom:-17px !important;pointer-events:none !important}.onwebchatbox #onwebchat-emoticons-div span{font-size:22px !important;box-sizing:border-box !important;margin-bottom:initial !important;padding:2px 2px !important;display:inline-block !important;text-align:center !important;width:1.53em !important;height:1.56em !important;line-height:26px !important;vertical-align:middle !important;transition:transform .12s ease !important;-webkit-transition:-webkit-transform .12s ease !important}.onwebchatbox #onwebchat-emoticons-div span img{height:1.1em !important}.onwebchatbox #onwebchat-emoticons-div span:hover{cursor:pointer !important;-webkit-transform:scale(1.21) !important;transform:scale(1.21) !important}#onwbchat_window .chat_area p>i{font-size:140% !important;line-height:1.2 !important;font-style:normal !important}.onwebchatbox .onwebchat-widget-settings-submenu{position:absolute;bottom:30px !important;left:10px !important;background-color:#fefefe !important;border:1px solid #d2d2d2 !important;opacity:1;display:none;margin:0 !important;padding:0 0 !important;list-style-type:none !important;width:initial !important;box-shadow:rgba(0,0,0,0.23) 0 2px 12px;border-radius:8px !important;overflow:hidden !important;z-index:999999 !important}.onwebchatbox .onwebchat-widget-settings-submenu li{text-align:left !important;float:initial !important;list-style-type:none !important;list-style:none !important;cursor:pointer !important;margin:0 !important;line-height:22px !important;direction:ltr !important;background:none !important;display:block !important;font-size:10px !important;padding:3px 50px 6px 10px !important}.onwebchatbox .onwebchat-widget-settings-submenu li:hover{background-color:#f4f4f4 !important;color:black !important}.onwebchatbox .onwebchat-widget-settings-submenu li:before{content:initial !important}.onwebchatbox .onwebchat-widget-settings-submenu-text{margin-right:10px;color:#484848;position:relative;bottom:4px !important;font-weight:500 !important;vertical-align:middle !important;font-family:arial,verdana,sans-serif !important;margin-left:11px !important;font-size:14px !important}.onwebchatbox .onwebchat-menu-icons{margin:0 0 0 5px !important;zoom:1.1 !important;vertical-align:baseline !important;fill:#787878 !important;position:relative !important;top:5px !important}.onwebchatbox .onwebchat-emoticons{position:relative;top:4px;cursor:initial !important}.onwebchatbox img:-moz-loading{visibility:hidden}#operator-image{position:absolute;width:46px;left:15px;border-radius:100%;border:2px solid #bbb7b7;z-index:9999999;top:-5px}#iconsdiv{width:54px !important;height:80px !important;position:absolute !important;right:0 !important;bottom:-5px !important}#wb-send-image{position:relative !important;float:right !important;z-index:initial !important;right:35px !important;top:25px !important;width:26px !important;height:26px !important;fill:#8c8cff !important;cursor:pointer !important}#wb-smile-image{position:relative !important;float:right !important;right:-14px !important;opacity:.8 !important;z-index:initial !important;fill:#707070 !important;cursor:pointer !important;top:26px !important}#wb-smile-image:hover{opacity:1 !important}#wb-send-image:hover{opacity:1 !important;transform:scale(1.06) !important;-webkit-transform:scale(1.06) !important;transition:transform .22s ease !important;-webkit-transition:-webkit-transform .22s ease !important;padding:0 !important}#uploadfileid{opacity:.84}#uploadfileid:hover{opacity:1}#onwebchat-volume-li-id{opacity:.84}#onwebchat-volume-li-id:hover{opacity:1}#onwebchat-print-li{cursor:default !important;opacity:.5}#onwebchat-savetofile-li{cursor:default !important;opacity:.5}#onwebchat-email-li{cursor:default !important;opacity:.5}#onwebchat-endchat-li{cursor:default !important;opacity:.5}.onwebchatbox .onwcmodaltext{padding:8px 13px !important;line-height:20px !important;color:#383838 !important}.onwebchatbox .onwcmodal-content .onwcmodalclose{font-size:22px !important;color:#7f7e7e;font-weight:800;cursor:pointer;position:absolute;right:11px;top:4px;width:24px}.onwcmodalclose:hover{color:#ac1616 !important;background:#c9c9c9;border-radius:46px;transition-duration:350ms}.onwcmodal{position:absolute !important;left:0 !important;top:0 !important;width:100% !important;height:100% !important;background-color:rgb(70 70 70 / 55%) !important;opacity:0;visibility:hidden;transition:visibility 0s linear .25s,opacity .25s 0s,transform .25s !important;z-index:999999 !important;border-top-right-radius:5px !important;border-top-left-radius:5px !important;user-select:none !important}.onwebchatbox .onwcmodal-content{position:relative !important;display:grid !important;margin:auto;margin-top:50%;background-color:white !important;width:84% !important;max-width:240px !important;min-width:172px !important;line-height:24px !important;min-height:30px !important;font-size:15px !important;padding:32px 18px !important;border-radius:7px !important;user-select:none;text-align:center}.onwebchatbox .onwcmodal-content div{font-size:14px !important}.show-onwcmodal{opacity:1;visibility:visible;transition:visibility 0s linear 0s,opacity .25s 0s,transform .25s}.onwc-show{transition:opacity 400ms !important;opacity:1 !important}.onwc-hide{opacity:0 !important;transition:opacity 400ms !important}.onwebchatbox .onwcbutton{width:29% !important;cursor:pointer !important;line-height:initial !important;min-width:fit-content !important;min-width:-moz-fit-content !important;min-height:initial !important;margin-left:auto !important;margin-right:auto !important;color:#383838 !important;background:#ddd !important;font-family:Arial,Helvetica,sans-serif !important;border:1px solid rgba(0,0,0,0.0) !important;padding:5px 12px !important;font-size:14px !important;border-radius:5px !important;display:inline-block !important;height:fit-content !important}.onwcbutton:focus{outline-color:lightgray !important}.onwcbutton:hover{background:#c5c5c5 !important}#onwcemailtrans{text-align:left !important;border-radius:5px !important;height:20px !important;box-sizing:content-box !important;border:1px solid #909090 !important;height:20px !important;font-size:14px !important;padding:2% 5% !important;width:89% !important;outline:none !important;max-width:189px !important;margin:10px auto 19px auto !important}.onwebchatbox .orange{background:#f5d28d !important}.onwebchatbox .orange:hover:not(:disabled){background:#eac57b !important}.onwebchatbox .disabled{opacity:.5;cursor:default !important}#onwbchtlogo-in-widget-icon{width:12px !important;height:12px !important;bottom:-2px;position:relative;fill:#747474}.onwbchtlogo-in-widget-bw2,.onwbchtsend-icon,.onwbchtonline-icon,.onwbchtoffline-icon,.onwbchtupload-icon-2,.onwbchtvolume-icon-2,.onwbchtvolume-icon-off,.onwbchtsave-icon,.onwbchtemail-icon,.onwbchtclose2,.onwbchtendchat-icon{display:inline-block;background:url('https://www.onwebchat.com/chatimages/live-chat-images-3.png?v=2') no-repeat;overflow:hidden;text-indent:-9999px;text-align:left}.onwbchtlogo-in-widget-bw2{background-position:-1px -0;width:71px;height:10px}.onwbchtonline-icon{background-position:-1px -37px;width:23px;height:18px}.onwbchtoffline-icon{background-position:-52px -11px;width:17px;height:15px}.onwbchtupload-icon-2{background-position:-25px -39px;width:17px;height:14px}.onwbchtvolume-icon-2{background-position:-43px -43px;width:17px;height:13px}.onwbchtvolume-icon-off{background-position:-25px -54px;width:17px;height:13px}.onwbchtsave-icon{background-position:-1px -56px;width:16px;height:14px}.onwbchtemail-icon{background-position:-43px -57px;width:16px;height:15px}.onwbchtclose2{background-position:-18px -68px;width:14px;height:14px}.onwbchtendchat-icon{background-position:-16px -68px;width:17px;height:14px}#onwc_consent_l_offline span{font-size:14px !important;color:#545454 !important}#onwc_consent_l_prechat span{font-size:14px !important;color:#545454 !important}#onwc_consent_l_inchat_modal{margin-bottom:24px;display:block !important}#onwc_consent_l_inchat_modal span{font-size:14px !important;color:#545454 !important;line-height:20px !important;margin-bottom:18px}#onwc_consent_checkbox_inchat_modal{margin:0 5px 2px 0 !important}.onwebchatbox .rating{unicode-bidi:bidi-override;direction:rtl;text-align:center;margin-top:20px}.onwebchatbox .rating span{font-size:23px !important;display:inline-block !important;position:relative !important;width:1.1em !important;color:#aeaeae !important}.onwebchatbox .rating span:hover,.onwebchatbox .rating span:hover ~ span{cursor:pointer !important;color:#ffb900 !important}#onwbchat_window .onwcdepartmenu{display:none !important;position:absolute !important;background:white !important;list-style:none !important;border:1px solid #ddd !important;border-radius:7px !important;margin-top:-11px !important;padding-inline-start:0 !important;z-index:999999 !important;box-shadow:0 2px 10px rgb(0 0 0 / 20%) !important;-webkit-box-shadow:0 2px 10px rgb(0 0 0 / 20%) !important;user-select:none !important}#onwbchat_window .onwcdepartmenu>li{cursor:default !important;font-size:13px !important;padding:7px 15px 5px 15px !important}#onwbchat_window .onwcdepartmenu>li span{font-size:14px !important;color:#545454 !important}#onwbchat_window .onwcdepartmenu>li:hover{background:#fee188 !important}#onwbchat_window #upload_img{display:none;position:absolute;text-align:center;top:50%;width:100%;z-index:10000}#onwbchat_window .onwctime{text-align:left;display:block;padding-top:11px;opacity:0;padding-right:11px}#onwbchat_window .onwctime span{padding:initial !important;margin:initial !important;color:grey !important;font-size:13px !important;text-align:left !important}#onwbchat_window .onwctime.me{text-align:right !important}#onwbchat_window .onwcinner{display:inline-flex;width:100%}.onwcouter{position:relative;margin-bottom:2px;margin-top:3px !important}.onwcminner{position:relative;width:100%;text-align:right}.onwcouter:last-of-type .onwctime{opacity:1 !important}.onwcinner:hover .onwctime{opacity:1 !important;transition:opacity .5s ease-out;transition-delay:.09s}#onwbchat_window .onwcouter{margin-top:9px !important}#onwbchat_window .onwcouter_agent+.onwcouter_agent{margin-top:0 !important}#onwbchat_window .onwcouter_me+.onwcouter_me{margin-top:0 !important}#agenttypingimage{display:grid !important;position:relative !important;float:left !important;width:48px !important;height:42px !important;clear:both !important;padding:0 !important;margin-top:0 !important;margin-bottom:0 !important}.onwc-typing-indicator{width:48px !important;height:32px !important;position:relative !important;margin-left:10px !important}.onwc-bubble{width:8px;height:8px;background:#555;position:absolute;bottom:0;border-radius:50%;animation:onwc-bubble 1.1s ease-in-out infinite}.onwc-bubble:nth-child(1){left:2px;animation-delay:0s}.onwc-bubble:nth-child(2){left:14px;animation-delay:.2s}.onwc-bubble:nth-child(3){left:26px;animation-delay:.4s}@keyframes onwc-bubble{0%{bottom:0;opacity:.6}50%{bottom:12px;opacity:1}100%{bottom:0;opacity:.6}}#scrollToBottomBtn{position:absolute !important;bottom:77px !important;left:50% !important;transform:translateX(-50%) !important;width:32px !important;height:32px !important;text-align:center !important;border-radius:50% !important;background-color:#fff !important;color:#0a0a0a !important;border:none !important;cursor:pointer !important;border:1px solid #ccc !important;font-size:46px !important;z-index:999998 !important;outline:none !important;-webkit-tap-highlight-color:transparent !important}#scrollToBottomBtn:hover{border:1px solid #777 !important}#onwbchat_window [type='checkbox']+span:not(.lever):before,#onwbchat_window [type='checkbox']:not(.filled-in)+span:not(.lever):after{box-sizing:border-box !important;margin-left:-3px !important}#outer_agent_bubble{box-shadow:none !important;box-sizing:border-box !important;position:fixed !important;display:none !important;bottom:139px !important;background:transparent !important;z-index:1999999999 !important;cursor:pointer !important;height:auto !important;min-width:60px !important;width:fit-content !important;max-width:#chat_widthpx !important}@media(max-width:480px){#outer_agent_bubble{right:16px !important}}#outer_agent_bubble_div{display:grid;border:1px solid #f5f5f4 !important;border-radius:5px !important;border-top-left-radius:0 !important;background-color:#fdfdfd !important;box-shadow:0 2px 3px rgba(0,0,0,.08) !important;font-family:arial,verdana,sans-serif !important;letter-spacing:.1px !important;font-size:14px !important;user-select:none !important;white-space:normal !important;word-break:break-word !important;padding:7px 11px !important;max-height:75px !important;overflow:auto}#outer_agent_bubble_x{position:absolute !important;top:-24px !important;right:3px !important;background:white !important;height:17px !important;width:17px !important;border-radius:25px !important}#bubble_x_svg{margin-left:-3px !important;margin-top:-3px !important;background:transparent !important;fill:gray !important}#bubble_x_svg:hover{fill:#5a5a5a !important}#operatorImageSmallPreview{box-shadow:none !important;top:4px !important;width:32px !important;height:32px !important;position:absolute !important;border-radius:20px !important;left:-37px !important;cursor:pointer !important;-webkit-user-drag:none !important;overflow:hidden !important;background:white !important} @keyframes onwbmoveleft { 26%, 65%, 100% { transform: translateY(0); } 0% { transform: translateY(-52px); } 45% { transform: translateY(-24px);s } 83% { transform: translateY(-13px); } } #onweb_chatimage{ animation-name: onwbmoveleft ; animation-timing-function: ease-in-out; ; animation-iteration-count: 1 ; animation-duration: 2.6s ; }"; var plan = "free"; var white_label = "0"; var showOnMobiles = "1"; // 0 i 1 // show mobiles hidemobiles hide on mobiles var agentOnline = "undefined"; // an einai chatsleft ==0 (free plan) , tote stelno 0 panta (gia na emfanizetai offline to chat as einai k online kapios) var hideOffline = 0; var realAgentOnline; // to pragmatiko agentonline giati eixa provlime sto free plan otan itan 0 chats left, ektipone polles fores ston visitor "operator has gone offline" var chatTotalHeigh = "490"; //396 var chatHeaderHeight = "63"; var chatWidth = "295"; var chatPosition = "right"; var chatMargin = "20"; var visitorTextColor = "#555555"; var agentTextColor = "#444444"; var show_offline_name_field = "1"; var mandatory_offline_name_field = "0"; var show_offline_email_field = "1"; var mandatory_offline_email_field = "1"; var show_offline_phone_field = "0"; var mandatory_offline_phone_field = "0"; var show_prechat_name_field = "1"; var mandatory_prechat_name_field = "1"; var show_prechat_email_field = "1"; var mandatory_prechat_email_field = "1"; var show_prechat_phone_field = "1"; var mandatory_prechat_phone_field = "0"; var mandatory_prechat_departments_field = "0"; var selectedDepartment = 0; // to department pou exei epilexei telika apo tin Prechat form var departments_use = "0"; // 0 or 1 var consent_use = "0"; var show_consent_checkbox = "1"; var consent_only_eu = "0"; var client_country = "us"; var eu_countries=['gr', 'cy', 'gb', 'at', 'be', 'bg', 'hr', 'cz', 'dk', 'ee', 'fi', 'fr', 'de', 'hu', 'ie', 'it', 'lv', 'lt', 'lu', 'mt', 'nl', 'pl', 'pt', 'ro', 'sk', 'si', 'es', 'se' ]; var menu_use = "1"; var show_upload_file_menu = "0"; var show_email_transcript_menu = "0"; var show_print_menu = "0"; var show_save_menu = "1"; var show_sound_menu = "1"; var show_end_chat_menu = "1"; let ai_bot_image = ""; // if (logging) console.log("ai_bot_image:" + ai_bot_image); if (ai_bot_image == '' || !ai_bot_image){ ai_bot_image = "chat-bot.png"; } // if (logging) console.log("ai_bot_image::" + ai_bot_image); // "end chat" icon const x_icon_path_d = "M337.615-298.693 480-441.078l142.385 142.385 38.922-38.922L518.922-480l142.385-142.385-38.922-38.922L480-518.922 337.615-661.307l-38.922 38.922L441.078-480 298.693-337.615l38.922 38.922Zm142.477 190.615q-77.152 0-145.066-29.325-67.914-29.324-118.152-79.595-50.238-50.27-79.517-118.055-29.279-67.785-29.279-144.855 0-77.152 29.325-145.066 29.324-67.914 79.595-118.152 50.27-50.238 118.055-79.517 67.785-29.279 144.855-29.279 77.152 0 145.066 29.325 67.914 29.324 118.152 79.595 50.238 50.27 79.517 118.055 29.279 67.785 29.279 144.855 0 77.152-29.325 145.066-29.324 67.914-79.595 118.152-50.27 50.238-118.055 79.517-67.785 29.279-144.855 29.279Zm-.105-55.96q131.898 0 223.936-92.026 92.039-92.026 92.039-223.923 0-131.898-92.026-223.936-92.026-92.039-223.923-92.039-131.898 0-223.936 92.026-92.039 92.026-92.039 223.923 0 131.898 92.026 223.936 92.026 92.039 223.923 92.039ZM480-480Z"; // if (consent_use == 1 && getCookie("consentv")==2){ // // if (logging) console.log("consentv=2"); // consent_use = 0; // } // // if (logging) console.log("client_country:" + client_country + " consent_use:" + consent_use); // // if (logging) console.log("show_offline_name_field:"+show_offline_name_field); // an to consent_only_eu einai 1 (to theto apo tin vasi pros to paron) kai consent_use=1 tote elegxo an i xora einai stin Europ. enosi. eu. if (consent_use == 1 && consent_only_eu==1 && eu_countries.indexOf(client_country)===-1) { consent_use = 0; // // if (logging) console.log(" to kano 0!!!!!!!!!! to consent_use, country"); } //var chatLeftSite = "#chatLeftSite"; //var blocked = getCookie('onwbchtblocked'); // 0 , 1 var blocked = localStorageGet('onwbchtblocked'); // 0 , 1 if ((blocked == '') || (blocked == null)||(blocked == 'null')|| (blocked == 'NaN')){ blocked = 0; localStorageSet('onwbchtblocked', 0) //setCookie("onwbchtblocked", 0, 183); // 1/2 year } var emailsSentLastHour = getCookie('onwbchtemailsSent'); if (emailsSentLastHour == "") emailsSentLastHour = 0; else emailsSentLastHour = parseInt(emailsSentLastHour); if (roundedCorners==="0"){ cssFile=cssFile.replace(/radius: 13px|radius: 11px|radius: 8px|radius: 5px|radius: 6px|radius: 2px|radius: 3px/g, "radius:0px"); //topika cssFile=cssFile.replace(/radius:13px|radius:11px|radius:8px|radius:5px|radius:6px|radius:2px|radius:3px/g, "radius:0px"); // ston server giati exo kanei minified to css } cssFile = cssFile.replace("#onweb_min_btn_margin", (chatHeaderHeight*0.36-1.36)); // //if (modern == 1){ cssFile = cssFile.replace(new RegExp('__modern', 'g'), ""); // fortono etsi ola ta css pou einai gia to modern design cssFile = cssFile.replace(/#textarea_width/g, chatWidth - 71); // (48 classic) (-71 gia modern) //} else { // cssFile = cssFile.replace(new RegExp('live-chat-images-3.png', 'g'), "live-chat-images.png"); // allo settings icon sto palio chat widget.. // cssFile = cssFile.replace(/#textarea_width/g, chatWidth - 48); // (48 classic) (-71 gia modern) //} cssFile = cssFile.replace(/#chat_width/g, chatWidth); cssFile = cssFile.replace(/#chatheader_width/g, chatWidth - 40); cssFile = cssFile.replace("#chat_area_height", chatTotalHeigh - 98 - chatHeaderHeight ); // 298 (396-298=98) (98 einai to kato meros o xoros pou einai to textarea) cssFile = cssFile.replace("#onwebchatbox_header_height_+_4", (chatHeaderHeight-0+4)); //auto gia na fainetai oraio to animation apo kato me bounce (kai to header height ginetai 4 px megalitero otan einai maxim. to chat - etsi to eixa kai prota..) cssFile = cssFile.replace(/#onwebchatbox_header1_height/g, chatHeaderHeight); // default: 34 gia to old // if (bubbles_use == 0){ // giati mporei na itan aspra ta grammata kai na min fainontai.. // // if (logging) console.log("bubbles_use = 0 "); // visitorTextColor="#595959"; // agentTextColor="#595959"; // } cssFile = cssFile.replace(/#visitor_css_text_color/g, visitorTextColor); cssFile = cssFile.replace(/#agent_css_text_color/g, agentTextColor); // // if (logging) console.log(cssFile); if (agentOnline == undefined || agentOnline == 'undefined') agentOnline = 0; /*if (chatLeftSite==0) { // if (logging) console.log("chatLeftSite == 0 so agentOnline = 0") agentOnline=0; }else // if (logging) console.log("chatLeftSite:" + chatLeftSite);*/ // if (logging) console.log("plan:"+plan+ " agentOnline:" + agentOnline+ " siteid:"+ siteId + " showOnMobiles:" + showOnMobiles + " roundedCorners:"+roundedCorners + " chatPosition:"+chatPosition + " chatMargin:"+chatMargin); var documentTitle=document.title; var windowLocationHref=window.location.href; // page url page_url // Create Element.remove() function if not exist (for Internet Explorer only) if (!('remove' in Element.prototype)) { Element.prototype.remove = function() { if (this.parentNode) { this.parentNode.removeChild(this); } }; } // screen.orientation.addEventListener('change', function (e) { // den epeze se iOS kai tin evgala.. (petouse javascript error kai den emfanize to chat window) window.addEventListener("orientationchange", function (e) { //paizei k se iOS // den iparxei provlima an to website exei orisei alli function, diatireitai kai auti // // if (logging) console.log("orientationchange.."); if (sessionStorageGet('maxChat') == 1) { setTimeout(function () { maximizeChatWindow(); }, 20); // tin xanakalo, giati etsi elegxo diastaseis othonis klp kai emfanizetai sosta, otan allazo orientation sta kinita setTimeout(function () { maximizeChatWindow(); }, 200); } }); let secretKey = (textAreaMaxLength / 20) * 30 ; // just make some manipulations to `secure` the result secretKey++; secretKey++; ///////////////////////// checking if it is mobile, browser etc... //////////////////////////////////// (function (window) { { var unknown = '-'; //browser var nVer = navigator.appVersion; var nAgt = navigator.userAgent; var browser = navigator.appName; var version = '' + parseFloat(navigator.appVersion); var majorVersion = parseInt(navigator.appVersion, 10); allUseragentInfo = nVer + " -- " + nAgt + " -- " + browser + " -- " + version + " -- " + majorVersion + " -- " + navigator.platform + " -- " + navigator.oscpu; var nameOffset, verOffset, ix; // Opera old version.. if ((verOffset = nAgt.indexOf('Opera')) != -1) { browser = 'Opera'; version = nAgt.substring(verOffset + 6); if ((verOffset = nAgt.indexOf('Version')) != -1) { version = nAgt.substring(verOffset + 8); } } else if ((verOffset = nAgt.indexOf('MSIE')) != -1) { // MSIE browser = 'Internet Explorer'; version = nAgt.substring(verOffset + 5); } else if (((verOffset = nAgt.indexOf('Edge')) != -1) || ((verOffset = nAgt.indexOf('Edg/')) != -1)) { // edge browser = 'Edge'; version = ''; } else if ((verOffset = nAgt.indexOf('Chrome')) != -1) { // Chrome browser = 'Chrome'; version = nAgt.substring(verOffset + 7); if ((verOffset = nAgt.indexOf('OPR/')) != -1) { // to Opera tora xrisimopoiei to Chromium engine k den grafei Opera, alla Chrome kai exei kai to string "OPR/" browser = 'Opera'; version = nAgt.substring(verOffset + 4); } } else if ((verOffset = nAgt.indexOf('Safari')) != -1) { // Safari browser = 'Safari'; version = nAgt.substring(verOffset + 7); if ((verOffset = nAgt.indexOf('Version')) != -1) { version = nAgt.substring(verOffset + 8); } } else if ((verOffset = nAgt.indexOf('Firefox')) != -1) { // Firefox browser = 'Firefox'; version = nAgt.substring(verOffset + 8); } else if (nAgt.indexOf('Trident/') != -1) { // MSIE 11+ browser = 'Internet Explorer'; version = nAgt.substring(nAgt.indexOf('rv:') + 3); } else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) { // Other browsers browser = nAgt.substring(nameOffset, verOffset); version = nAgt.substring(verOffset + 1); if (browser.toLowerCase() == browser.toUpperCase()) { browser = navigator.appName; } } // trim the version string if ((ix = version.indexOf(';')) != -1) version = version.substring(0, ix); if ((ix = version.indexOf(' ')) != -1) version = version.substring(0, ix); if ((ix = version.indexOf(')')) != -1) version = version.substring(0, ix); // if (logging) { console.log(" agent version: " + version); } var Fst = version.indexOf('.'); if (Fst > 0) { var Snd = version.indexOf('.', version.indexOf('.') + 1); // vrisko to deutero . // px sto chrome edine 38.0.2125.122 to kano 38.0 if (Snd > 0) version = version.substring(0, Snd); } majorVersion = parseInt('' + version, 10); if (isNaN(majorVersion)) { version = '' + parseFloat(navigator.appVersion); majorVersion = parseInt(navigator.appVersion, 10); } if (browser == 'Edge') version = ''; isMobile = false; if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(nAgt) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(nAgt.substr(0, 4))) { isMobile = true; } //isMobile = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(nVer); proigoumenos elegxos /*if (isMobile == true && showOnlyImage!=1) { // sta kinita den dixno ta chatimages.. image_use = 0; }*/ //$ (".onwebchatbox").remove(); // den xreiazetai edo, alla to vazo ekei pou kano append to chat kodika sto body : //$ ("body").append( .. // giati trexei auto prota kai meta paei na to trexei to //$ ("body").append( .. // if (logging) { console.log(" agent nVer: " + nVer); } // if (logging) { console.log(" agent nAgt: " + nAgt); } // if (logging) { console.log(" agent isMobile: " + isMobile ); } // cookie var cookieEnabled = (navigator.cookieEnabled) ? true : false; if (typeof navigator.cookieEnabled == 'undefined' && !cookieEnabled) { document.cookie = 'testcookie'; cookieEnabled = (document.cookie.indexOf('testcookie') != -1) ? true : false; } // system var os = ''; //unknown var clientStrings = [ { s: 'Windows 3.11', r: /Win16/ }, { s: 'Windows 95', r: /(Windows 95|Win95|Windows_95)/ }, { s: 'Windows ME', r: /(Win 9x 4.90|Windows ME)/ }, { s: 'Windows 98', r: /(Windows 98|Win98)/ }, { s: 'Windows CE', r: /Windows CE/ }, { s: 'Windows 2000', r: /(Windows NT 5.0|Windows 2000)/ }, { s: 'Windows XP', r: /(Windows NT 5.1|Windows XP)/ }, { s: 'Windows Server 2003', r: /Windows NT 5.2/ }, { s: 'Windows Vista', r: /Windows NT 6.0/ }, { s: 'Windows 7', r: /(Windows 7|Windows NT 6.1)/ }, { s: 'Windows 8.1', r: /(Windows 8.1|Windows NT 6.3)/ }, { s: 'Windows 8', r: /(Windows 8|Windows NT 6.2)/ }, { s: 'Windows 10', r: /(Windows 10|Windows NT 10.0)/ }, { s: 'Windows NT 4.0', r: /(Windows NT 4.0|WinNT4.0)/ }, { s: 'Windows', r: /(WinNT|Windows NT)/ }, { s: 'Windows ME', r: /Windows ME/ }, { s: 'Windows Phone', r: /Windows Phone/ }, { s: 'Android', r: /Android/ }, { s: 'Open BSD', r: /OpenBSD/ }, { s: 'Sun OS', r: /SunOS/ }, { s: 'Linux', r: /(Linux|X11)/ }, { s: 'iOS', r: /(iPhone|iPad|iPod)/ }, { s: 'Mac OS X', r: /Mac OS X/ }, { s: 'Mac OS', r: /(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/ }, { s: 'QNX', r: /QNX/ }, { s: 'UNIX', r: /UNIX/ }, { s: 'BeOS', r: /BeOS/ }, { s: 'OS/2', r: /OS\/2/ }, { s: 'BlackBerry OS', r: /BlackBerry/ }, { s: 'Search Bot', r: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/ } ]; for (var id in clientStrings) { var cs = clientStrings[id]; if (cs.r.test(nAgt)) { os = cs.s; break; } } if (os == '') { // an den to vriso apo to userAgent, to pairno apo to navigator.platform os = navigator.platform; } var osVersion = unknown; if (/Windows/.test(os)) { osVersion = /Windows (.*)/.exec(os)[1]; os = 'Windows'; } switch (os) { case 'Mac OS X': osVersion = /Mac OS X (10[\.\_\d]+)/.exec(nAgt)[1]; break; case 'Android': osVersion = /Android ([\.\_\d]+)/.exec(nAgt)[1]; break; case 'iOS': osVersion = /OS (\d+)_(\d+)_?(\d+)?/.exec(nVer); osVersion = osVersion[1] + '.' + osVersion[2] + '.' + (osVersion[3] | 0); break; } // flash (you'll need to include swfobject) /* script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" */ var flashVersion = 'no check'; if (typeof swfobject != 'undefined') { var fv = swfobject.getFlashPlayerVersion(); if (fv.major > 0) { flashVersion = fv.major + '.' + fv.minor + ' r' + fv.release; } else { flashVersion = unknown; } } } window.jscd = { browser: browser, browserVersion: version, isMobile: isMobile, os: os, osVersion: osVersion, cookies: cookieEnabled, flashVersion: flashVersion }; }(this)); os = jscd.os + ' ' + jscd.osVersion; browser = jscd.browser + ' ' + jscd.browserVersion; // if (logging) console.log("isMobile:" + isMobile + " showOnMobiles:::"+showOnMobiles + " os: " + os + " browser:" + browser); try{ var triggerNow = function(text, agentName ){ // if (logging) console.log(" triggerNow "); if (agentOnline==1) { // if (logging) console.log('hasTriggered:'+ sessionStorageGet('hasTriggered')); // if (logging) console.log('inChatC cookie:'+ getCookie('inChatC')); sessionStorageGet('chattext session :'+ sessionStorageGet('chattext')); if (typeof sessionStorage !== "undefined" && (sessionStorageGet('hasTriggered')!='1') && (getCookie('hasTriggeredC')!=1) && (getCookie('inChatC')!=1) && sessionStorageGet('chattext')=="") { // an den einai set to sessionStorage.hasTriggered epistrefei 0 // if (logging) console.log("maxchat from session::" + sessionStorageGet('maxChat')); if (sessionStorageGet('maxChat')==1 && preChatForm==1) { // an iparxei Prechat form kai o visitor exei patisei , tote den energopoio to trigger giat mporei na vazei username , email klp. An energopoiiso to trigger tha xathous auta.. 6/3/2018 // isos tha prepei na energopoitai to trigger argotera an o xristis kanei minimized to chat widget // if (logging) console.log(" triggers: maxChat 1 & preChatForm 1"); } else { callbackOnTrigger(); // gia to api - kaleitai otan agentOnline==1 , asxetos tin timi tou showChatApi (giati thelo ne mporo na emfanizo to chat window eno einai aorato sto trigger) // if (logging) console.log("showChatApi : " + showChatApi); if (showChatApi!=0) { // trigger mono otan einai online i katastasi // kai na min einai show 0 me to api (tote na min paizoun ta triggers) // an o browser den ipostirizei to sessionStorage den trexoun ta triggers! sendAnalyticsEvent('onWebChat', 'Trigger activated', ''); sessionStorageSet('hasTriggered', 1); // episis an to chattext den einai keno, exei arxisei enas dialogos, tote oxi trigger! setCookie('hasTriggeredC', 1, 0.166); // 0.166 (=4 hours) to prosthesa 6/3/2018. auto giati polloi visitors anoigan ena site se allo tab kai pali energopoioutan to trigger.. Auto itan provlima eidika an eixe idi kanei chat giati, emfanizotan to trigger text kai alli fora sto xiristi sto meso tou chat // episis evala to setCookie('inChatC', 1, 0.166); pio kato gia na min emfanizo trigger kai otan o visitor paei se allo tab , eno exei idi milise prin oxi omos apo trigger //sessionStorage.hasTriggered = 1; sessionStorageSet('mustSendTriggerText', true); mustSendTriggerTextJs = true; //sessionStorage.mustSendTriggerText = true; // an einai true tin proti fora pou tha steili keimeno o pelatis, tha prepei na steilei k to trigger text.. sessionStorageSet('triggerText', text); //sessionStorage.triggerText=text; // if (logging) console.log("before play sound"); playSoundNew(); // if (logging) console.log("after play sound"); if (getText('max_served', language)!="" && agentName!="" && agentName!="null" && agentName!=null) { // you are served by ... printChat('

'+ getText('max_served', language).replace('{{operator}}',agentName) +'

'); previous_chat =""; //sessionStorage.hasWrSeByTr = true; // har written served by (trigger)... sessionStorageSet('hasWrSeByTr', true); } var bubble_st = ""; //if (bubbles_use == 1) bubble_st = " agent-bubble "; var rtlCss = ""; var operatorImageStTemp=''; var bigMarginLeft=""; if (previous_chat != 'agent') { bubble_st = bubble_st+ " agent-first "; if (showOperatorImages == 1){ operatorImageStTemp = ''; } } if (showOperatorImages == 1){ bigMarginLeft=" big-margin-left "; } if (isRTLlanguage(text.substr(0,1))==true){ rtlCss = ' style="direction: rtl;text-align:right;" '; } // if (logging) console.log("will call printchat.."); //the third parameter is true, as it will display the text in the outer agent bubble (preview message) printChat('

' + operatorImageStTemp + ''+getText('max_agent', language).replace('{{operator}}',agentName)+' '+ (escapeHtml(text)).replace(/({{newline}})/gm,"
") +'

', "", true); previous_chat="agent"; // if (logging) console.log("i!!!!:"+sessionStorageGet('maxChat')+ " - " + preChatForm + " - " + sessionStorageGet('chattext').length); /*if (sessionStorageGet('maxChat')==1 && preChatForm==1) { // if (logging) console.log("ix!!!!!!"); MaximizeWindowInit(); }*/ if (sessionStorageGet('maxChat')!=1) { // window is not maximized //MaximizeWindowInit(); // to evela se comments gia testing outer agent bubble 25/5/24 with triggers } if (isConnected) { // an socket anoixto socket.emit('setclientstatus', 'triggered'); } } } } } }; function enableNoReplyTrigger(){ // beta - otan o visitor stelnei ena minima, k argei na apantisei o operator clearTimeout(timerNoReply); if (siteId==1){ // for testing //timerNoReply = setTimeout(triggerNowNoReply, 10*1000, "Sorry, our operators are busy.. please write us your email and we will contact you.."); //timerNoReply = setTimeout(triggerNowNoReply, 4*1000, "Бихте ли ни дали телефон за връзка, за да уточним детайли?"); } else if (siteId==27254){ // to exei zitisei o eclima.bg user timerNoReply = setTimeout(triggerNowNoReply, 3*1000, "Бихте ли ни дали телефон за връзка, за да уточним детайли?"); } else if (siteId==3322){ // to exei zitisei o Craig Shaw 11-08-2022 timerNoReply = setTimeout(triggerNowNoReply, 10*1000, "Right now all our operators are busy. Please wait a few minutes or give us your email, so we can contact you."); } } //var triggerNowNoReply = function(text){ function triggerNowNoReply(text){ // gia ta triggers pou emfanizontai otan den apantisei o operator se merika sec.. // if (logging) console.log(" triggerNowNoReply "); if (typeof sessionStorage !== "undefined" && (sessionStorageGet('hasTriggeredNoReply')!='1') && (getCookie('hasTriggeredNoReplyC')!=1) && (getCookie('inChatC')!=1) ) { // //callbackOnTrigger(); // gia to api - kaleitai otan agentOnline==1 , asxetos tin timi tou showChatApi (giati thelo ne mporo na emfanizo to chat window eno einai aorato sto trigger) if (showChatApi!=0) { // trigger mono otan einai online i katastasi // kai na min einai show 0 me to api (tote na min paizoun ta triggers) // an o browser den ipostirizei to sessionStorage den trexoun ta triggers! sendAnalyticsEvent('onWebChat', 'Trigger (no reply) activated', ''); sessionStorageSet('hasTriggeredNoReply', 1); // episis an to chattext den einai keno, exei arxisei enas dialogos, tote oxi trigger! setCookie('hasTriggeredNoReplyC', 1, 0.166); // 0.166 (=4 hours) to prosthesa 6/3/2018. auto giati polloi visitors anoigan ena site se allo tab kai pali energopoioutan to trigger.. Auto itan provlima eidika an eixe idi kanei chat giati, emfanizotan to trigger text kai alli fora sto xiristi sto meso tou chat // episis evala to setCookie('inChatC', 1, 0.166); pio kato gia na min emfanizo trigger kai otan o visitor paei se allo tab , eno exei idi milise prin oxi omos apo trigger sessionStorageSet('mustSendTriggerNoReplyText', true); //mustSendTriggerNoReplyTextJs = true; //sessionStorage.mustSendTriggerText = true; // an einai true tin proti fora pou tha steili keimeno o pelatis, tha prepei na steilei k to trigger text.. //sessionStorageSet('triggerTextNoReply', text); //socket.emit('sendchat', "", sessionStorageGet('triggerTextNoReply')); endTime = getCurrentTime(); obj={}; obj.vesrion = version; obj.durationInSeconds = (endTime - startTime) / 1000; obj.socketDurationInSeconds = (endTime - startConnectTime) / 1000; obj.isConnected = isConnected; obj.firstConnection = firstConnection; obj.timeoutTime_userconnect = timeoutTime_userconnect; obj.tryToReconnect = tryToReconnect; obj.pos = 624; //obj.sendChatDelay = sendChatDelay; if (sessionStorageGet('chattext')){ obj.chattext = sessionStorageGet('chattext').substring(0,20); // mallon auto den exei noima! } socket.emit('sendchat', "", text, 0, 0, 624, num_connected, clientId, secretKey, obj); // chatserver.js -> sendchat', function(data, triggerText, isInsights) //sessionStorage.triggerText=text; playSoundNew(); var bubble_st = ""; //if (bubbles_use == 1) bubble_st = " agent-bubble "; var rtlCss = ""; var operatorImageStTemp=''; var bigMarginLeft=""; if (previous_chat != 'agent') { bubble_st = bubble_st+ " agent-first "; if (showOperatorImages == 1){ operatorImageStTemp = ''; } } if (showOperatorImages == 1){ bigMarginLeft=" big-margin-left "; } if (isRTLlanguage(text.substr(0,1))==true){ rtlCss = ' style="direction: rtl;text-align:right;" '; } var agentName=""; // if (logging) console.log('

' + operatorImageStTemp + ''+getText('max_agent', language).replace('{{operator}}',agentName)+' '+ (escapeHtml(text)).replace(/({{newline}})/gm,"
") +'

'); printChat('

' + operatorImageStTemp + ''+getText('max_agent', language).replace('{{operator}}',agentName)+' '+ (escapeHtml(text)).replace(/({{newline}})/gm,"
") +'

'); // previous_chat="agent"; // if (logging) console.log("i!!!!:"+sessionStorageGet('maxChat')+ " - " + preChatForm + " - " + sessionStorageGet('chattext').length); if (isConnected) { // an socket anoixto //socket.emit('setclientstatus', 'triggered'); } } } }; }catch(e){ console.log(e); } //var b=JSON.parse('[{"id":2,"name":"asdfasd","description":"test","text":"τί","urls":[],"isFullSite":1,"whole":0}]'); var triggersStr = '[]'; // if (logging) console.log(triggersStr); triggersStr = triggersStr.replace(/(\r\n|\n|\r)/gm,"{{newline}}"); // allios den to parsarei an exei allagi grammis (error).. episis meta pou to ektipono to kalo: (escapeHtml(text)).replace(/({newline})/gm,"
") var triggers = JSON.parse(triggersStr); // if (logging) console.log("triggers"); // if (logging) console.log(triggers); var secOnPage =0; var hasWholeSiteTriggers = false; // // if (logging) console.log("triggers: sessionstorage get:"+sessionStorageGet('secOnSite')); if (sessionStorageGet('secOnSite')=== undefined || sessionStorageGet('secOnSite')== "NaN") { sessionStorageSet('secOnSite', 0); } let enableSendButtonTimer; function disableSendButton(from){ disabledSendButton = true; document.getElementById('wb-send-image').style.pointerEvents = 'none'; // for not be clickable document.getElementById("wb-send-image").style.opacity="0.42"; if (from=='aibot'){ enableSendButtonTimer = setTimeout(function() { enableSendButton(); } , 10000); // se periptosi pou den apatnisei to bot, na to kano pali enabled automata 10 sec } } function enableSendButton(){ clearTimeout(enableSendButtonTimer); disabledSendButton = false; document.getElementById('wb-send-image').style.pointerEvents = 'auto'; document.getElementById("wb-send-image").style.opacity="0.90"; // k allou to 0.90 } function disableWriting(){ //o visitor den mporei na grapsei sto textarea oute na patisei ta koumpia :) kai send (an einai oloi oi agents offline) // if (logging) console.log("call disableWriting..."); if (sessionStorageGet('chattext') && sessionStorageGet('chattext').endsWith( getText('max_gone', language) +"

")){ // mono an grafei kato kato "o agent einai offline" // xrisimo otan o agent exei vgei offline, milaei ston visitor kai o visitor allazei selida isAbleToWrite = false; // if (logging) console.log("isAbleToWrite to false!"); document.getElementById('onwbtxtarea').style.pointerEvents = 'none'; document.getElementById("onwbtxtarea").disabled = true; document.getElementById('wb-send-image').style.pointerEvents = 'none'; document.getElementById('wb-smile-image').style.pointerEvents = 'none'; document.getElementById("onwbtxtarea").style.opacity="0.42"; document.getElementById("wb-send-image").style.opacity="0.42"; document.getElementById("wb-smile-image").style.opacity="0.42"; document.getElementById("onwbtxtarea").setAttribute("placeholder", ""); disableMenuItem("uploadfileid"); } } function enableWriting(){ isAbleToWrite = true; // if (logging) console.log("isAbleToWrite to true!"); try{ document.getElementById('onwbtxtarea').style.pointerEvents = 'auto'; document.getElementById("onwbtxtarea").disabled = false; document.getElementById('wb-send-image').style.pointerEvents = 'auto'; document.getElementById('wb-smile-image').style.pointerEvents = 'auto'; } catch(e){} document.getElementById("onwbtxtarea").style.opacity="1"; document.getElementById("wb-send-image").style.opacity="0.90"; // kai allou to 0.90 document.getElementById("wb-smile-image").style.opacity="0.78"; document.getElementById("onwbtxtarea").setAttribute("placeholder", getText('max_placeholder', language)); enableMenuItem("uploadfileid"); //document.getElementById("onwbtxtarea").disabled="true"; //document.getElementById("onwebchat-emoticons-div").style.display="none"; } var triggersLength = triggers.length; if (isMobile == 1 && showOnMobiles == 0) { //afou den deixno to chat widget sta mobiles, min energopoio ta triggers sta mobiles! } else { for (var i = 0; i < triggersLength; i++) { // if (logging) console.log("trigger i :: "+ i + " text:" + triggers[i].text + " mobiledisabled:" + triggers[i].mobileDisabled + " isMobile:" + isMobile); if (triggers[i].mobileDisabled == 1 && isMobile){ // if (logging) console.log(" is isMobile ane mobileDisabled so skip this trigger!"); continue; // Skip to the next iteration } if (triggers[i].isFullSite==1 && triggers[i].whole==0) { // se oles tis selides kai o xronos reset se kathe selida // if (logging) console.log(" trigger isFullsite 1 kai whole 0"); setTimeout(triggerNow, triggers[i].delay*1000, triggers[i].text, triggers[i].agentName); }else if (triggers[i].isFullSite==1 && triggers[i].whole==1) { // se oles tis selides kai o xronos metra apo tin proti selida hasWholeSiteTriggers = true; // if (logging) console.log("trigger isFullsite 1 kai whole 1"); try{ var delay = triggers[i].delay - sessionStorageGet('secOnSite'); }catch(e){ console.log(e); } // if (logging) console.log("trigger delay :: "+ delay); if (delay>=0) { // if (logging) console.log("setTimeout(triggerNow,.."); setTimeout(triggerNow, delay*1000, triggers[i].text, triggers[i].agentName); } }else if (triggers[i].isFullSite==0) { // se orismenes mono selides // if (logging) console.log("triggers[i].isFullSite==0"); var urls=triggers[i].urls; var contains = false; var urlsLength = urls.length; for (var j = 0; j < urlsLength; j++) { if (window.location.href.indexOf(urls[j]) > -1) { // if (logging) console.log(":::::::::::"+urls[j]); contains = true; break; } } if (contains) { setTimeout(triggerNow, triggers[i].delay*1000, triggers[i].text, triggers[i].agentName); } } } } if (hasWholeSiteTriggers){ // mono tote xreiazetai.. (kano update tin var secOnSite sto session storage ) setInterval(function(){ if (sessionStorageGet('secOnSite')===undefined || sessionStorageGet('secOnSite')=='NaN') sessionStorageSet('secOnSite',0); secOnPage++; sessionStorageSet('secOnSite', (parseInt(sessionStorageGet('secOnSite'))+1)); }, 1000); } function escapeHtml(text) { return text .replace(/&/g, "&") .replace(//g, ">") .replace(/"/g, """) .replace(/'/g, "'"); } var sendAnalyticsEvent = function(category, action, label){ try{ if (typeof gtag === 'function') { // to gtag prepei na mpei proto (prin to ga), giati me to teleutaio tracking code (gtag.js), fainontai kai ta 2 san functions alla mono me to gtag douleuei.. gtag('event', action, { 'event_category' : category, 'event_label' : label }); // for tracking code on May 2019 (gtag.js) } else { ga('send', 'event', { eventCategory: category, eventAction: action, eventLabel: label}); // for previous tracking code (2016?) } }catch(e){} } function playSoundNew() { // // if (logging) console.log("playSoundNew soundOn: " + soundOn); if (soundOn){ //document.getElementById("onwebsoundspan").innerHTML=""; //$ ("").appendTo('body'); if (document.getElementById("onwebchataudio").innerHTML.trim()==""){ // alert("adeio"); // den to exo valei , opote to vazo mono tin proti fora pou kaleitai i playSoundNew document.getElementById("onwebchataudio").innerHTML=''; } var audio = document.getElementById("onwebchataudio"); try { audio.play(); } catch(e) { // if (logging) { console.log("exception in audio.play:" + e); } } // if (logging) console.log("soundOn, play sound!!! : "); } else { // if (logging) console.log("in else.. soundOn: " + soundOn); } } var getText = function (pos, lang) { if (texts[pos] && texts[pos][lang]){ // if (logging) { console.log(pos + " , " + lang + " :" + texts[pos][lang]); } return texts[pos][lang]; // } else if (pos == 'end_chat_msg'){ // return "Are you sure you want to close this chat?"; } else if (pos == 'email_text') { return "Send chat transcript to your email:"; // cannot be updated by the user at the moment } else if (pos == 'email_sent') { return "Transcript sent!"; // } else if (pos == 'cancel') { // return "Cancel"; } else if (pos == 'send') { return "Send"; } else { if (texts[pos]==undefined) return ""; else return texts[pos]['l1']; } }; try{ // set api for chrome, firefox, ie.. for (var j=0; j" + onWebChat.ar[j][1]); if (onWebChat.ar[j][0]=="name") { clientName=onWebChat.ar[j][1]; // // if (logging) console.log("okk!!!"); } else if (onWebChat.ar[j][0]=="email") { clientEmail=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="phone") { clientPhone=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="notes") { clientNotes=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="pageUrl") { windowLocationHref=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="pageTitle") { documentTitle=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="max") { if (onWebChat.ar[j][1] == 1) { sessionStorageSet('maxChat',1); }else if (onWebChat.ar[j][1] == 0) { sessionStorageSet('maxChat',0); } } else if (onWebChat.ar[j][0]=="show") { if (onWebChat.ar[j][1] == 1) { showChatApi=1; }else if (onWebChat.ar[j][1] == 0) { // if (logging) console.log(" showchatapi set to 0 !!"); showChatApi=0; } } else if (onWebChat.ar[j][0]=="hideImage") { if (onWebChat.ar[j][1] == 1) { image_hide_api=1; }else if (onWebChat.ar[j][1] == 0) { image_hide_api=0; } } else if (onWebChat.ar[j][0]=="alwaysOffline") { // to xrisimopoio mono ego sto site.. if (onWebChat.ar[j][1] == 1) { // if (logging) console.log("alwaysOffline = 1"); alwaysOffline = 1; agentOnline = 0; //$ ("#div_chat_min_title_span").text(getText('min_offline', language)); document.getElementById("div_chat_min_title_span").textContent=getText('min_offline', language); //$ ('#onweb-offline-icon').show(); document.getElementById('onweb-offline-icon').style.display = 'block'; //$ ('#onweb-online-icon').hide(); document.getElementById('onweb-online-icon').style.display = 'none'; if (offlineColor!="") document.getElementById("webchat_header").style.setProperty('background-color',offlineColor, 'important'); if (offlineColor!="") document.getElementById("offlineform_btn").style.setProperty('background-color',offlineColor, 'important'); }else if (onWebChat.ar[j][1] == 0) { // if (logging) console.log("alwaysOffline = 0"); alwaysOffline = 0; } } else if (onWebChat.ar[j][0]=="language") { language=onWebChat.ar[j][1]; // if (logging) console.log("language set ok with ar array! : " + language); } else if (onWebChat.ar[j][0]=="languageFile") { languageFile=onWebChat.ar[j][1]; // if (logging) console.log("languageFile set ok with ar array! : " + languageFile); } else if (onWebChat.ar[j][0]=="onClick") { callbackOnClick=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="onMaximize") { callbackOnMaximize=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="onMinimize") { callbackOnMinimize=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="onTrigger") { callbackOnTrigger=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="onStartWriting") { callbackOnStartWriting=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="onUpdateOperators") { // temp!!! check!!! callbackOnUpdateOperators=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="onNewMessage") { // temp!!! check!!! callbackOnNewMessage=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="onWebChatLoaded") { // callbackOnWebChatLoaded=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="onlineColor") { // gia na orizo to online color tis baras tou chat widget onlineColor=onWebChat.ar[j][1]; } else if (onWebChat.ar[j][0]=="offlineColor") { // gia na orizo to offline color tis baras tou chat widget offlineColor=onWebChat.ar[j][1]; } } } }catch(e){ // if (logging) { console.log(e); } // panta se mia grammi, giati meta vazo sxolia prin to // if (logging) me to ./ipchange ston server! } if (languageFile=="") { // den mporei na mpei pio pano, ginetai set me to api if (language == 'gr' || language == 'el') language = 'l1'; if (language == 'en') language = 'l2'; if (language!='l1' && language != 'l2') // apo lathos! language= 'l1'; // if (logging) console.log("final language:"+language); } if(typeof String.prototype.trim !== 'function') { // giati sto ie8 den iparxei i trim() function String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }; } if (!String.prototype.endsWith) { String.prototype.endsWith = function(searchString, position) { var subjectString = this.toString(); if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { position = subjectString.length; } position -= searchString.length; var lastIndex = subjectString.indexOf(searchString, position); return lastIndex !== -1 && lastIndex === position; }; } function setCookie(cname,cvalue,exdays){ // if (logging) console.log("set cookie! cname:"+cname + " value:" + cvalue + " exdays:" + exdays); var d = new Date(); d.setTime(d.getTime()+(exdays*24*60*60*1000)); var expires = "expires="+d.toGMTString(); document.cookie = cname + "=" + cvalue + "; " + expires +";path=/"; //prospathia gia to Notice pou emfanizei o Chrome, sxetika me ta cookies: " without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`.." //document.cookie = cname + "=" + cvalue + "; " + expires +";path=/;Secure;SameSite=None"; mallon edo den voithaei, giati to vazei sta cookies pou ftiaxnontai sto site k exoun Domain to domain tou website } function deleteCookie(name){ setCookie(name, '', -1); } function getCookie(cname){ var name = cname + "="; // // if (logging) console.log('cc'+document.cookie); var ca = document.cookie.split(';'); for(var i=0; i 0) { // IE 10 or older.. return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false; // epistrefei px 8 (san integer) } else if (trident > 0){ return true; } else if (edge > 0) { return true; } else { return false; } } // if (logging) console.log("isIE: "+isIE()); function validateEmail(email) { //var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; // not for unicode.. var re = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i; // support unicode return re.test(email); } var loadJS = function(src, callback) { //load socket.io, ... , me callback function otan fortosei // // if (logging) console.log("in loadJS src:" + src); // // if (logging) console.log("in loadJS callback: " + callback); // eixa provlima me to siteid 19758 ( https://www.shelvingdirect.co.uk/ , kaasuvalo.fi/verkkokauppa , https://www.kazuuk.com ) me to Magento2 // telika otan vlepo oti iparxei to require.js, fortono to chat widget meta apo ligo xrono.. Otan fortone amesos, petouse diafora errors to magento stin console, opos: $.widget is not a function k merikes fores espage to site.. // an exei fortosei olo to site, k meta fortoso jquery, socket klp, tote ola kala (k me pure Javascript pali ekane to idio provlima..(28/1/2022)) // allios kanonika, to fortono amesos jdelay = 0; // // if (logging) console.log("typeof window['define'] " + typeof window['define'] ); // if (src.indexOf("jquery")>0){ if (typeof window['define'] !== "undefined"){ ///edo logika den mpaino pote, afou exo idi apergopoiisei to require.js parapano.. (hasRequirejs_delay) console.log("define.."); // jdelay = 1200; // to eixa jdelay = 6200;, 28/1/2022 to ekana 1200 } // } setTimeout(function(){ var scr = document.createElement('script'); scr.src = src; scr.async = true; // optionally scr.onreadystatechange = scr.onload = function() { var state = scr.readyState; if ( !callback.done && (!state || /loaded|complete/.test(state))) { callback.done = true; // if (logging) console.log("now will call callback from loadJS function.., src:" + src); callback(); } }; var head = document.getElementsByTagName('head')[0]; head.insertBefore(scr, head.firstChild); }, jdelay); } // if (logging) console.log("serverip:"+serverIP); //console.log("protocol2:"+protocol); //console.log(protocol + '//code.jquery.com/jquery-1.11.0.min.js'); // ola auta ta evgala tin 19/10/2021 gia na min fortono to jquery an to exo idi fortomeno apo tin selida tou website.. // // if (logging) { // if (window.jQuery) { // console.log("$ jquery already loaded from the webpage, version: " + $.fn.jquery); // loadAllAfterJquery(); // } // else { // console.log(" jquery not loaded from the page, so I will load it now..."); // loadJS(protocol + '//cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js', loadAllAfterJquery() ); // } // } //loadJS(protocol + '//code.jquery.com/jquery-1.11.0.min.js', function() { // callback function, trexei (oli i selida) molis fortosei to jquery 1.11.0 //loadJS(protocol + '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js', function() { // callback function, trexei (oli i selida) molis fortosei to jquery 2.1.1 (update to jQuery 2.1.1 22/2/20) //loadJS(protocol + '//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js', function() { // callback function, trexei (oli i selida) molis fortosei to jquery 2.1.1 (allagi se cdn cloudflare tin 1/12/2020) //var $; //var loadAllAfterJquery = function() { // if (window.jQuery) { // // if (logging) console.log("jquery is loaded"); //$ = jQuery.noConflict(true); //to evgala 20/10/2021 giati den fortono to diko mou jquery, alla kratao tis selidas an iparxei, opote den exo pote 2 diaforetika jquery //$ = $; //} // else { // // if (logging) console.log("no window.jQuery loaded"); //} // // if (logging) { if ($ && $.fn) console.log("$ jquery (other) version: " + $.fn.jquery); } //var dialogid=0; //var ip=""; if (typeof JSON === 'undefined') { // i typeof JSON === 'undefined' (ie8 me html 4...) // if (logging) console.log(" JSON: undefined!!! mallon ie8 me html 4 ?"); //loadJS( protocol + "://"+serverIP+":81/client_lib/json2.js", function(){ // if (logging) console.log("json2.js loaded!!!!!"); }); //preshowChat=0; // giati den emfanizetai sosta... ie8html4 = true; } var doNotLoadChatWidget = false; //if (siteId==10705 && inIframe() ){ // do not load and do not show chat widget for these sites , giati emfanizotan kai mesa sta modals, iframes .. (isos prepei na to elexgo gia ola ta site.., pros to paron tha to elexgo mono gia auta pou mou exoun provlima!) if (inIframe()) { // telika 12/4/2021 to kano gia ola ta iframes.. (giati mou esteile k allos oti eixe provlima.. ) doNotLoadChatWidget = true; } function inIframe() { try { return window.self !== window.top; } catch (e) { return false; } } // if (logging) console.log(" getName at begining :" + clientName); // " setNameApi: " + setNameApi); // // if (logging) console.log(" name : "+ clientName); // undefined //if (clientName == '') // an o xristis valei stin index to webLiveChat.setName("xxxxx"); tote den einai '' ??? opote to exei kanei set , ara na min parei apo to cookie //clientName = getCookie('onwbchtclientname'); if (typeof String.prototype.trim !== 'function') { // add trim function for string (for IE8) String.prototype.trim = function () { return this.replace(/^\s+|\s+$/g, ''); } } function socketReconnect() { // if (logging) console.log(" call function socketReconnect"); tryToReconnect = true; //socket.io.reconnect(); socket.connect(); // if (logging) console.log("after call socket.io.reconnect()"); if (isIE() != 8) { // to socket.close ston ie8 petaei ena error ston browser (stack overflow, out of memory..), isos o server na mporei na kleisei to connection.. // if (logging) console.log("not ie .."); socketTimeoutTimer = setTimeout(function () { // if (logging) console.log("socketTimeoutTimer, will disconnect now.."); socket.io.disconnect(); minimizeChatWindow(); }, socketTimeOutmsec); //socketTimeOutmsec //close socket if client is more than x hours on the same page } } //maximizeChatWindow(); //maximizeChatWindow = function (){ // prosoxi!! etsi ginetai global function maximizeChatWindow(){ // etsi den einai global.. // if (logging) console.log(" maximizeChatWindow() .. showOnlyImage: " + showOnlyImage + " isMobile:" + isMobile); document.getElementById("onwbchat_window").style.setProperty("animation-iteration-count", "0"); // auto xreiazetai an exei valei css transitions (animations, px na erxetai apo dexia..) document.getElementById("onwbchat_window").style.setProperty("box-shadow", "rgba(0, 0, 0, 0.43) 0px 0em 1.2em", "important"); if (showOnlyImage == 1 || isMobile) { // if (logging) console.log(" if --> showOnlyImage: " + showOnlyImage + " isMobile:" + isMobile); //$ ("#onwbchat_window").fadeIn(100, 'swing'); document.getElementById("onwbchat_window").style.setProperty("display","block"); } //if (//$ ("#onwbchat_window #div_chat_max_title").css("display") == "none") { // mono an itan minimized k ginetai maximized if (document.getElementById("div_chat_max_title").style.display == "none") { // mono an itan minimized k ginetai maximized callbackOnMaximize(); // gia to api } //$ ("#onweb_chatimage_div #onweb_chatimage").css("display", "none"); // otan o operator exei valei use image if (document.getElementById("onweb_chatimage")) document.getElementById("onweb_chatimage").style.setProperty("display", "none"); if (document.getElementById("outer_agent_bubble")) document.getElementById("outer_agent_bubble").style.setProperty("display", "none", "important"); //$ ("#onwbchat_window .onweb_chatimage_x").css("display", "none"); // otan o operator exei valei use image if (document.getElementById("onweb_chatimage_x")) document.getElementById("onweb_chatimage_x").style.setProperty("display", "none"); if (document.getElementById("onweb_chatimage")) document.getElementById("onweb_chatimage").style.setProperty("display", "none"); // otan o operator exei valei use image if (hideOffline != 1 && agentOnline == 0 && (sessionStorageGet('chattext') == null || sessionStorageGet('chattext') == '')) { // show offline form // ( ...( .. || !sessionStorageGet('chattext').includes("me-bubble") )) to vazo gia na min dixno ton dialogo, otan px itan online, irthe ena trigger, den egrapse tipota o visitor kai meta vgike offline, ekleise k anoixe to chat win. [telika to evgala giati mou dimiourgise ena bug, otan itan offline i forma k estelne enas offline operator minima se visitor, den emfanizotan to minima!, alla i offline form!] nowIsShowing = "offline"; // gia na emfanistei to palio chat, otan einai offline, tha prepei na exei grapsei kati kapoios... //$ ("#onwbchat_window").find(".chat_area,.chat_message,.chat_info").css("display", "none"); document.getElementById('chat_area_id').style.display = 'none'; document.getElementById('onwc_chat_message_div').style.display = 'none'; document.getElementById('chat_info_id').style.display = 'none'; //$ ("#onwbchat_window").find("#offline_form").css("display", "block"); document.getElementById('offline_form').style.display = 'block'; //$ ("#onwbchat_window #div_chat_max_title_span").text(getText('off_title', language)); // Email us! document.getElementById("div_chat_max_title_span").textContent=getText('off_title', language); //$ ("#onwbchat_window").find("#prechat_form").css("display", "none"); document.getElementById('prechat_form').style.display = 'none'; } else { if (preChatForm == 1 && sessionStorageGet('chattext').length === 0) { // dixe tin prechat forma nowIsShowing = "prechat"; //$ ("#onwbchat_window").find(".chat_area,.chat_message,.chat_info").css("display", "none"); // show prechat form document.getElementById('chat_area_id').style.display = 'none'; document.getElementById('onwc_chat_message_div').style.display = 'none'; document.getElementById('chat_info_id').style.display = 'none'; //$ ("#onwbchat_window").find("#offline_form").css("display", "none"); document.getElementById('offline_form').style.display = 'none'; //$ ("#onwbchat_window").find("#prechat_form").css("display", "block"); document.getElementById('prechat_form').style.display = 'block'; //$ ("#onwbchat_window #div_chat_max_title_span").text(getText('max_title', language)); // Chat with us! document.getElementById("div_chat_max_title_span").textContent=getText('max_title', language); } else { // show chat form nowIsShowing = "chat"; //$ ("#onwbchat_window").find(".chat_area,.chat_message,.chat_info").css("display", "block"); document.getElementById('chat_area_id').style.display = 'block'; document.getElementById('onwc_chat_message_div').style.display = 'block'; document.getElementById('chat_info_id').style.display = 'block'; //$ ("#onwbchat_window").find("#offline_form").css("display", "none"); document.getElementById('offline_form').style.display = 'none'; //$ ("#onwbchat_window").find("#prechat_form").css("display", "none"); document.getElementById('prechat_form').style.display = 'none'; //$ ("#onwbchat_window #div_chat_max_title_span").text(getText('max_title', language)); // Chat with us! document.getElementById("div_chat_max_title_span").textContent=getText('max_title', language); } } if (isMobile) { //document.getElementById("onwbchat_window").style.setProperty("height", "95%"); //396 mobile_customization document.getElementById("onwbchat_window").style.setProperty("height", "100%"); document.getElementById("onwbchat_window").style.setProperty("max-height", "100%"); document.getElementById("onwbchat_window").style.setProperty("border-radius", "0px", "important"); document.getElementById("webchat_header").style.setProperty("border-radius", "0px", "important"); //var chatWidthTemp = //$ ("#onwbchat_window").width(); var chatWidthTemp = document.getElementById("onwbchat_window").clientWidth; // if (logging) console.log("var chatWidthTemp:: " + chatWidthTemp); document.getElementById("onwbtxtarea").style.setProperty("width", (chatWidthTemp - 48 - (23)) + "px", "important"); document.getElementById("chat_area_id").style.setProperty("width", (chatWidthTemp - 0) + "px", "important"); document.getElementById("webchat_header").style.setProperty("width", (chatWidthTemp - 40) + "px", "important"); } else { //$ ("#onwbchat_window").css("height", chatTotalHeigh+"px"); // eixa auti, anti tin kato, alla eixe sovaro provlima emfanisis tou chat window ston Internet Explorer 11 document.getElementById("onwbchat_window").style.setProperty("height", chatTotalHeigh + "px", "important"); document.getElementById("onwbchat_window").style.setProperty("top", onwbchtMaxY + "px"); // an to exei kanei move o xristis, na epistrefei stin arxiki thesei otan ginetai min. document.getElementById("onwbchat_window").style.setProperty("left", onwbchtMaxX + "px"); // an to exei kanei move o xristis, na epistrefei stin arxiki thesei otan ginetai min. //if (modern == 1) { document.getElementById("onwbchat_window").style.setProperty("bottom", "20px", "important"); // sto modern na min akoumpaei kato to parathiro otan einai anoixto // auta mpainoun k otan fortonei to chat widget peripou grammi 2065 //} } //if (modern == 1) { document.getElementById("div_chat_min_title").style.setProperty("line-height", (42) + "px", "important"); document.getElementById("webchat_header").style.setProperty("height", (chatHeaderHeight) + "px", "important"); // giati otan einai minimized kai fainetai to title bar, einai mikrotero se height //} else { // document.getElementById("webchat_header").style.setProperty("height", (chatHeaderHeight - 0 + 4) + "px", "important"); // giati otan einai minimized kai fainetai to title bar, einai mikrotero se height // } // try { //$ (this).css( "cursor", "move" ); // auto??, xreiazetai? sto https://www.floristeriaelcapricho.co/index.php (stin offline form) erixne exeption k eskage to chat! // } catch(e){ console.log(e); } document.getElementById("webchat_header").style.setProperty("cursor", "move"); document.getElementById("div_chat_max_title").style.setProperty("display", "block"); document.getElementById("div_chat_min_title").style.setProperty("display", "none"); //$ ("#onwbchat_window #off-form-onwebchat-logo").css("display", "block"); if (document.getElementById('off-form-onwebchat-logo')) document.getElementById('off-form-onwebchat-logo').style.display = 'block'; //$ ("#onwbchat_window #onwebchat-logo-span").css("display", "block"); if (document.getElementById('onwebchat-logo-span')) document.getElementById('onwebchat-logo-span').style.display = 'block'; //todo telika xreiazetai auto? //$ ("#onwbchat_window .webchat_header").hover(function () { //addEventListener("mouseover", changeDef); //$ ("#onwbchat_window .webchat_header").css("opacity", "1"); //}, function () { //$ ("#onwbchat_window .webchat_header").css("opacity", "1"); //}); // // if (logging) console.log("sessionStorage.maxChat:"+sessionStorageGet('maxChat')); //if (sessionStorage.maxChat!=1) {// && isIE()!=8) // // if (logging) console.log("fadein.."); //$ ("#onwbchat_window").fadeIn(200);// dimiourgei provlima an einai hide.. (tin emfanizei..) //} sessionStorageSet('maxChat', 1); // save it, so that on a new page it will be max when page loads loadEmoticons(); // ta fortono edo giati kathisterouse na ta fortosei sto click pano sto emotiocn icon checkBottomOfButton(); checkHeaderTitlePosition(); updateScrollToBottomButtonVisibility(); return false; } // maximizeChatWindow function checkHeaderTitlePosition() { if ((nowIsShowing == 'chat') && (showOperatorImages == 1)) {// // an deixno to operator image sto header, to text prepei na paei pio dexia.. //$ ("#onwbchat_window #div_chat_max_title_span")[0].style.setProperty("padding-left", "50px", "important"); document.getElementById("div_chat_max_title_span").style.setProperty("padding-left", "50px", "important"); // if (logging) console.log("50px nowIsShowing: " + nowIsShowing + " showOperatorImages:" + showOperatorImages); } else { //$ ("#onwbchat_window #div_chat_max_title_span")[0].style.setProperty("padding-left", "10px", "important"); document.getElementById("div_chat_max_title_span").style.setProperty("padding-left", "10px", "important"); // if (logging) console.log("10px nowIsShowing: " + nowIsShowing + " showOperatorImages:" + showOperatorImages); } } function updateScrollToBottomButtonVisibility() { const chat_area_div = document.getElementById('chat_area_id'); let isScrolledToBottom = chat_area_div.scrollHeight - chat_area_div.clientHeight <= chat_area_div.scrollTop + 100; // +1 for just 1 pixel up from bottom document.getElementById('scrollToBottomBtn').style.display = isScrolledToBottom ? 'none' : 'block'; } //minimizeChatWindow = function () { function minimizeChatWindow() { if (showOnlyImage == 1 || isMobile) { // if (logging) console.log("showOnlyImage:" + showOnlyImage + " isMobile:" + isMobile); //$ ("#onwbchat_window").fadeOut(0); document.getElementById("onwbchat_window").style.setProperty("display", "none"); } if (document.getElementById('div_chat_max_title').style.display == "block") { // mono an itan minimized k ginetai maximized callbackOnMinimize(); // gia to api } // if (logging) console.log("minimizeChatWindow.."); sessionStorageSet('maxChat', 0); // if (logging) console.log("sessionStorage.maxChat:" + sessionStorageGet('maxChat') + " sessionStorage.hideImage:" + sessionStorageGet('hideImage')); //if (isIE()!=8) //$ ("#onwbchat_window").fadeOut(100); setTimeout(function () { //$ ("#onwbchat_window").find(".chat_area,.chat_message,.chat_info").hide(); document.getElementById('chat_area_id').style.display = 'none'; document.getElementById('onwc_chat_message_div').style.display = 'none'; document.getElementById('chat_info_id').style.display = 'none'; document.getElementById('scrollToBottomBtn').style.display = 'none'; if (document.getElementById("prechat_form")) document.getElementById('prechat_form').style.display = 'none'; //$ (".onwebchatbox").css("height", "63px"); // auto einai to header height, (default: 32px) // to idio me //$ ("#onwbchat_window") document.getElementById("onwbchat_window").style.setProperty("height", "#chat_heightpx"); //$ ("#onwbchat_window .webchat_header").css("cursor", "pointer"); document.getElementById('webchat_header').style.cursor = 'pointer'; if (sessionStorageGet('hideImage') == 0 && document.getElementById("onweb_chatimage")) {// oxi === document.getElementById("onweb_chatimage").style.setProperty("display", "inline"); document.getElementById("onweb_chatimage").style.setProperty("cursor", "pointer"); // but ston ie (otan ekana max k pali min to chat, den mporousa na kano click stin ikona.. den to elisa - bug mallon tou edge) document.getElementById("onweb_chatimage").style.setProperty("animation-iteration-count", "0"); // auto xreiazetai an exei valei css transitions (animations, px na erxetai apo dexia..) } if (showChatApi == 0) { // den dixno tin eikona an exo thesei me to api: set('show',0) if (document.getElementById("onweb_chatimage")) document.getElementById("onweb_chatimage").style.setProperty("display", "none"); } //$ ("#onwbchat_window .onweb_chatimage_x").css("display", "inline"); if (document.getElementById('onweb_chatimage_x')){ document.getElementById('onweb_chatimage_x').style.display = 'inline'; onweb_chatimage_loaded(); } document.getElementById("div_chat_min_title").style.setProperty("display", "block"); document.getElementById("div_chat_max_title").style.setProperty("display", "none"); //$ ("#onwbchat_window #off-form-onwebchat-logo").css("display", "none"); if (document.getElementById('off-form-onwebchat-logo')) document.getElementById('off-form-onwebchat-logo').style.display = 'none'; //$ ("#onwbchat_window #onwebchat-logo-span").css("display", "none"); if (document.getElementById('onwebchat-logo-span')) document.getElementById('onwebchat-logo-span').style.display = 'none'; document.getElementById("onwbchat_window").style.setProperty("box-shadow", "0px 0px 5px 0px #777", "important"); /*//$ (".webchat_header").hover(function(){ //$ (".webchat_header").css("opacity","0.85"); },function(){ //$ (".webchat_header").css("opacity","1"); });*/ //$ ("#onwbchat_window").find(".onweb_maximize_btn").css("display", "inline"); if (!isMobile) { document.getElementById("onwbchat_window").style.setProperty("top", "initial"); // an to exei kanei move o xristis, na epistrefei stin arxiki thesei otan ginetai min. document.getElementById("onwbchat_window").style.setProperty("left", "initial"); // an to exei kanei move o xristis, na epistrefei stin arxiki thesei otan ginetai min. document.getElementById("onwbchat_window").style.setProperty(chatPosition, chatMargin + "px"); // an to exei kanei move o xristis, na epistrefei stin arxiki thesei otan ginetai min. document.getElementById("webchat_header").style.setProperty("height", "40px", "important"); document.getElementById("onwbchat_window").style.setProperty("height", "40px", "important"); document.getElementById("onwbchat_window").style.setProperty("bottom", "0px", "important"); } //$ ("#onwbchat_window").fadeIn(200); // dimiourgouse provlima sto minimizeChatWindow otan itan hide (to emfanize eno itan hide) }, 100); return false; }; // minimizeChatWindow //hideChatWindow = function () { function hideChatWindow(){ //document.getElementById("onwbchat_window").style.setProperty("display", "none"); //$ (".onweb_chatimage").css("display", "none"); //$ ("#onwbchat_window").fadeOut(300, 'swing'); myFadeOut(document.getElementById("onwbchat_window")); //$ ("#onweb_chatimage_div #onweb_chatimage").fadeOut(300, 'swing'); myFadeOut(document.getElementById("onweb_chatimage")); // if (logging) console.log("hideChatWindow.."); }; function myFadeOut(elem){ //if (elem.classList.contains('onwc-show')) { // if (logging) console.log("myFadetoggle... contains once-show"); if (elem){ elem.classList.remove('onwc-show'); elem.classList.add('onwc-hide'); fadeTimout = setTimeout(function(){elem.style.setProperty("display", "none")}, 400); } //} } function showChatWindow() { //loadchatwindow //showChatWindow = function () { document.getElementById("onwbchat_window").classList.remove('onwc-hide'); if (document.getElementById("onweb_chatimage")) document.getElementById("onweb_chatimage").classList.remove('onwc-hide'); try { // if (logging) console.log("showChatWindow.. hideOffline:" + hideOffline + " sessionStorage.hideImage:" + sessionStorageGet('hideImage')); } catch (e) { console.log(e); } //if (isIE()!=8) //if ((showOnlyImage==0 && isMobile==false) || (isMobile==false) ) {// bug!! 9/9/17 if ((showOnlyImage == 0 && isMobile == false)) {// oxi === // if (logging) { console.log("showOnlyImage:::: " + showOnlyImage + " isMobile:" + isMobile); } //$ ("#onwbchat_window").fadeIn(0, 'swing'); //swing 300 to emfanizo // to evgala otan evala ta animations, opou iparxei fade in document.getElementById("onwbchat_window").style.setProperty("display", "block"); // gia na emfanizo tin mpara otan showOnlyImage==0 (sta kinita den tin emfanizo pote) } //else //$ ("#onwbchat_window").css("display", "inline"); if (sessionStorageGet('hideImage') == 1) { // if (logging) console.log("hide image..."); if (document.getElementById("onweb_chatimage")) document.getElementById("onweb_chatimage").style.setProperty("display", "none"); } if (sessionStorageGet('hideImage') == 0) { // oxi === // if (logging) console.log("show image now.."); if (document.getElementById("onweb_chatimage")) document.getElementById("onweb_chatimage").style.setProperty("display", "inline"); //$ ("#onweb_chatimage_div .onweb_chatimage").css("display", "inline"); } if (isMobile){ // on mobiles when i load a new page always the chat widget should be min. (eg. when user click on a link in the chat, if the chat wid. is max, it is annoying) sessionStorageSet('maxChat', 0 ); } if (sessionStorageGet('maxChat') == 1) { // || sessionStorage.chattext.length>0 to evgala giati den mporouse o visitor na kanei minimized to chat.. // if (logging) console.log("sessionStorage.maxChat==1"); maximizeChatWindow(); // to perno apo to sessionStorage, giati an perimeno apo to server, argei ligo, kai fainetai stin arxi kleisto kai meta anoigei } else { // if (logging) console.log("sessionStorage.maxChat!=1"); //$ ("#onwbchat_window").find(".chat_area,.chat_message,.chat_info").hide(); document.getElementById('chat_area_id').style.display = 'none'; document.getElementById('onwc_chat_message_div').style.display = 'none'; document.getElementById('chat_info_id').style.display = 'none'; } setTimeout(function () { // to calc the pos of outer_agent_bubble // need to add a delay for the image to load and display let dist1 = getDistanceFromBottomOfViewport(document.getElementById('onweb_chatimage')); // if (logging) console.log("the distance from bottom img: " + dist1); // if (logging) console.log("the distance from bottom window: " + getDistanceFromBottomOfViewport(document.getElementById('onwbchat_window'))); if (dist1 == 0){ // there is no image onweb_chatimage dist1 = 60; } else { dist1 = dist1 +16; // give a margin from image } let outer_agent_bubble_obj = document.getElementById("outer_agent_bubble"); if (document.getElementById("outer_agent_bubble_span")){ outer_agent_bubble_obj.style.setProperty("bottom", dist1 + "px", "important"); // // if (logging) console.log("_agent_bubble_span').textContent:" + document.getElementById('outer_agent_bubble_span').textContent+ '.'); // // if (logging) console.log("sessionStorageGet outeragentbubbletext' " + sessionStorageGet('outeragentbubbletext')+'.'); if (sessionStorageGet('outeragentbubbletext') && sessionStorageGet('outeragentbubbletext')!='' && document.getElementById('outer_agent_bubble_span').textContent==""){ // // if (logging) console.log("sessionStorageGet('outeragentbubbletext'):" + sessionStorageGet('outeragentbubbletext')); if (document.getElementById("outer_agent_bubble_span")) { document.getElementById('outer_agent_bubble_span').insertAdjacentHTML("beforeend", sessionStorageGet('outeragentbubbletext')); } if (sessionStorageGet('maxChat') != 1){ // not show if chat widget is max outer_agent_bubble_obj.style.setProperty("display", "grid", "important"); } } } outer_agent_bubble_obj.addEventListener('click', maximizeChatWindow); document.getElementById("outer_agent_bubble_x").addEventListener('click', function(event){ event.stopPropagation(); // Prevents the event from bubbling up, (prevents maximize the chat widget) outer_agent_bubble_obj.style.setProperty("display", "none", "important"); sessionStorageRemove('outeragentbubbletext'); // prevents show again when opening a new page } ); }, 500); };//showChatWindow // Function to get the distance from the bottom of the viewport to the top of the element function getDistanceFromBottomOfViewport(element) { // Get the element's top position relative to the viewport if (element != null) { const elementTop = element.getBoundingClientRect().top; // Get the height of the viewport const viewportHeight = window.innerHeight; // Calculate the distance from the bottom of the viewport to the top of the element const distanceFromBottom = viewportHeight - elementTop; return distanceFromBottom; } else return 0; } //var sessionid; //var dialog=0; //var socket; //var agentSocket=""; var browser; var os; var allUseragentInfo; var isMobile; /*if (typeof(Storage) != "undefined"){ // web storage gia to history.. //alert(typeof(Storage)); // function i object clientname=localStorage.getItem("clientname"); //alert('clientname:'+clientname); if ((clientname=='null')||(clientname==null)) { localStorage.setItem("clientname", "testClient_"+Math.floor((Math.random()*1000)+1)); clientname=localStorage.getItem("clientname"); //alert('clientname 2 :'+clientname); } } else{ alert("Sorry, your browser does not support Web Storage..."); }*/ //cache (default: true, false for dataType 'script' and 'jsonp') Type: Boolean If set to false, it will force requested pages not to be cached by the browser. //Note: Setting cache to false will only work correctly with HEAD and GET requests. //auta ta evgala 22/1/2022 , otan evgala to jquery, den xero an telika to xreiazomai.. // if ($.ajaxSetup) { // $.ajaxSetup({ // cache: true // }); // } if (isMobile == 1 && showOnMobiles == 0) { return; // stamatao edo, den fortono tipota... an einai kinito kai den to deixno sta kinita // giati allios kaloutan i showchatwindow() kai petouse polla javascript errors sta kinita otan showOnMobiles=0 } hasRequirejs_delay = 100; if (typeof window['define'] !== "undefined") { //console.log("define."); hasRequirejs_delay = 5000; // to eixa 0, 28/1/2022 to ekana 5000 // telika otan vlepo oti iparxei to require.js, fortono to chat widget meta apo ligo xrono.. } // allios kanonika, to fortono amesos setTimeout(function () { //giati otan to frontsite xrisimopoiouse to require.js (Px magento 2 websites) den fortone to socket.io // kai petouse to error : "Uncaught ReferenceError: io is not defined" // to provlime mallon itan sto window['define'] // pio kato to epanafero (ta kano gia ligo undefined, na fortoso to socket.io k meta ta epanafero) // https://www.npmjs.com/package/requirejs-toggle/v/1.0.2 // if (logging) console.log('Disabling requirejs'); //disable requirejs window.__requirejsToggleBackup = { define: window.define, require: window.require, requirejs: window.requirejs } window['define'] = undefined; window['require'] = undefined; window['requirejs'] = undefined; if (!ie8html4 && !doNotLoadChatWidget) { // to (siteId!=10705 || window.top==window.self) to vazo giati sto siteid 10705 emfanizotan to chat kai sta modal if (languageFile != "") { // den mporesa na ta valo se ene k etsi perno 2 periptoseis, an iparxei i oxi to languageFile - prosoxi diplos kodikas //loadJS(protocol + '//cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js', runWhenLoadAllFiles ); //loadJS(protocol + '//cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js', loadLanguageFile ); loadJS(protocol + '//cdnjs.cloudflare.com/ajax/libs/socket.io/4.5.4/socket.io.min.js', loadLanguageFile ); function loadLanguageFile(){ function httpGet(url, error, callback) { var xhr = new XMLHttpRequest(); xhr.open('GET', url); xhr.withCredentials = true; xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.onreadystatechange = function() { if (xhr.readyState === 4) { if (xhr.status === 200 || (xhr.status === 0 && xhr.responseText !== '')) { callback({ url: url, status: 200, body: xhr.responseText || '' }); } else { error({ url: url, status: xhr.status, body: xhr.responseText || '' }); } } }; xhr.send(); } httpGet(languageFile, function (param) { // error loading file // if (logging) console.log("error loading language file, url:" + param.url + " status:" + param.status ); // + " body:" + param.body); console.log("Error: language file failed to load! filename: " + languageFile); // edo thelo logging - na to dei o xristis an den mporei na vrei to arxeio console.log("Ensure that language file url is correct and is not blocked as cross-origin request."); // edo thelo logging if (language != 'l1' && language != 'l2') language = 'l1'; // if (logging) console.log(" ****final language::" + language); runWhenLoadAllFiles(); }, function (param) { // get file successfully // if (logging) console.log("url:" + param.url + " status:" + param.status); // + " body:" + param.body); try { //$.extend(true, texts, JSON.parse(param.body)); // true for recursive copy.. // prosteto ta pedia tou neou pinaka (data ) sto object texts var myJsonOjb = JSON.parse(param.body); // prosteto ta pedia tou neou pinaka (data ) sto object texts for(var key in myJsonOjb) if(myJsonOjb.hasOwnProperty(key)) texts[key] = myJsonOjb[key]; } catch (e) { console.log("exception parsing lang text file : " + e); // edo thelo logging console.log("lang text file data: " + param.body.substring(0, 100) + " ..."); // edo thelo logging } runWhenLoadAllFiles(); } ); // $.get(languageFile, function (data) { // // if (logging) console.log("onwebchatLanguages.txt Load was performed. "); // data:" + data + " file:");// + languageFile); // if (data != "") { // try { // $.extend(true, texts, JSON.parse(data)); // true for recursive copy.. // prosteto ta pedia tou neou pinaka (data ) sto object texts // } catch (e) { // console.log("exception parsing lang text file : " + e); // console.log("lang text file data: " + data.substring(0, 100) + " ..."); // } // } // // if (logging) console.log(texts); // runWhenLoadAllFiles(); // }).fail(function () { // console.log("Error: language file failed to load! filename: " + languageFile); // edo thelo logging - na to dei o xristis an den mporei na vrei to arxeio // console.log("Ensure that language file url is correct and is not blocked as cross-origin request."); // if (language != 'l1' && language != 'l2') // language = 'l1'; // // if (logging) console.log(" ****final language::" + language); // runWhenLoadAllFiles(); // }) } /*$.when( //################################## TA IDIA MPAINOUN K LIGO PIO KATO!! ################################## // (EDO EINAI OTAN TO languageFile DEN EINAI KENO!) //$.getScript( protocol + "//cdn-orig.socket.io/socket.io-1.4.5.js", function( data, textStatus, jqxhr ) { //to pairno apo to web, einai to min version, fainetai ok $.getScript(protocol + "//cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js", function (data, textStatus, jqxhr) { // to dokimasa me cdn ston ie11 1/12/2020 k den eixe provlima opote to vazo pali // to evala apo to diko mou xana tin 30/5/2020 , giati me to cdn.. eixa provlima me ton internet explorer 11, den sindeotan..] // to evala to cdnjs.cloudflare.. stin 3/8/2018 gia ikonomia sto data transfer tis amazon (to evgala 30/5/2020) //$.getScript( protocol + "//www.onwebchat.com/lib/socket.io-1.4.5.min.js", function( data, textStatus, jqxhr ) { // //auto einai min (peripou 25kb - giati to /socket.io/socket.io.js apo ton server den itan min k itan 180 kb! => poli xreosi sto diktio stin amazon //$.getScript( protocol + "//www.onwebchat.com/lib/socket.io-2.3.0.min.js", function( data, textStatus, jqxhr ) { // 11/7/20 update to socket.io 2.3.0 ) //$.getScript( protocol + "//www.onwebchat.com/socket.io/socket.io.js", function( data, textStatus, jqxhr ) { // auto to dinei o server, den einai minified .. einai poli megalo se megethos!!!! sinistatai mono gia development // if (logging) console.log(textStatus); // Success // if (logging) console.log( jqxhr.status ); // 200 // if (logging) console.log(" just now (with lang file) load file socket.js , data:" + data); // load but not necesary executed yet.. }).done(function (script, textStatus) { // if (logging) console.log("just load socket.io ... "); }).fail(function () { // if (logging) console.log("fail loading socket.io .. ...: " + exception); }), $.get(languageFile, function (data) { // if (logging) console.log("onwebchatLanguages.txt Load was performed. "); // data:" + data + " file:");// + languageFile); if (data != "") { try { $.extend(true, texts, JSON.parse(data)); // true for recursive copy.. // prosteto ta pedia tou neou pinaka (data ) sto object texts } catch (e) { console.log("exception parsing lang text file : " + e); console.log("lang text file data: " + data.substring(0, 100) + " ..."); } } // if (logging) console.log(texts); }).fail(function () { console.log("Error: language file failed to load! filename: " + languageFile); // edo thelo logging - na to dei o xristis an den mporei na vrei to arxeio console.log("Ensure that language file url is correct and is not blocked as cross-origin request."); if (language != 'l1' && language != 'l2') language = 'l1'; // if (logging) console.log(" ****final language::" + language); //runWhenLoadAllFiles(); }), //$ ('head').append("") ).done(function () { // me to done an ginei ena fail (to lang px ) den ekteleitai to done runWhenLoadAllFiles(); //, runWhenLoadAllFiles });*/ } else { // languageFile =="", opote fortono mono to socket.io //loadJS(protocol + '//cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js', runWhenLoadAllFiles ); // // if (logging) console.log("now will load socket.io.js.."); loadJS(protocol + '//cdnjs.cloudflare.com/ajax/libs/socket.io/4.5.4/socket.io.min.js', runWhenLoadAllFiles ); /*$.when( // ####################TA IDIA MPAINOUN K LIGO PIO PANO!! ################################## //$.getScript( protocol + "//cdn-orig.socket.io/socket.io-1.4.5.js", function( data, textStatus, jqxhr ) { //to pairno apo to web, einai to min version, fainetai ok //$.getScript( protocol + "//www.onwebchat.com/socket.io/socket.io.js", function( data, textStatus, jqxhr ) { // auto to dinei o server, den einai minified kai sinistatai mallon mono gia development $.getScript(protocol + "//cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js", function (data, textStatus, jqxhr) { // $.getScript( protocol + "//www.onwebchat.com/lib/socket.io-1.4.5.min.js", function( data, textStatus, jqxhr ) { //to arxeio einai sto visitor/src/assets/lib/ ///$.getScript( protocol + "//www.onwebchat.com/lib/socket.io-2.3.0.min.js", function( data, textStatus, jqxhr ) { // 11/7/20 update to socket.io 2.3.0 ) //$.getScript( protocol + "//www.onwebchat.com/socket.io/socket.io.js", function( data, textStatus, jqxhr ) { // auto to dinei o server, den einai minified .. poli megalo megethos!!! // if (logging) console.log(textStatus); // Success // if (logging) console.log( jqxhr.status ); // 200 // if (logging) console.log(" just now ( no lang file) load file socket.js , data:" + data); // load but not necesary executed yet.. }).done(function (script, textStatus) { // if (logging) console.log("just load socket.io ... "); }).fail(function () { // if (logging) console.log("fail loading socket.io .. ...: " + exception); }), // loadJS(protocol + "//cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.5/socket.io.min.js", function(){ // // if (logging) console.log("just now loaded the socket.io file.."); // }), //$ ('head').append("") ).done(function () { // if (logging) console.log(" now load runWhenLoadAllFiles will run.."); runWhenLoadAllFiles(); }); */ } //else // languageFile !="" } // !ie8html4 }, hasRequirejs_delay); //setTimeout enableMenuItem = function (item) { // activate menu item xoris to # Kano na fainetai energi i epilogi auti (menu item) //$ ("#" + item).css("opacity", 0.84); if (document.getElementById(item)) { document.getElementById(item).style.opacity = 0.84; //$ ("#" + item).hover(function (e) { $ (this).css("opacity", e.type === "mouseenter" ? 1 : 0.84) }); document.getElementById(item).onmouseenter = function(e) { this.style.opacity = 1; } document.getElementById(item).onmouseleave = function(e) { this.style.opacity = 0.84; } document.getElementById(item).style.setProperty("cursor", "pointer", "important"); //document.getElementById(item).style.pointerEvents = 'none'; } } disableMenuItem = function (item) { // disable menu item xoris to # Kano na fainetai anenergi i epilogi auti (menu item) if (document.getElementById(item)) { //$ ("#" + item).css("opacity", 0.5); document.getElementById(item).style.opacity = 0.5; //$ ("#" + item).hover(function (e) { $ (this).css("opacity", e.type === "mouseenter" ? 0.5 : 0.5) }); document.getElementById(item).onmouseenter = function(e) { this.style.opacity = 0.5; } document.getElementById(item).onmouseleave = function(e) { this.style.opacity = 0.5; } document.getElementById(item).style.setProperty("cursor", "initial", "important"); //document.getElementById(item).style.pointerEvents = 'auto'; } } // addEndChat2Menu = function(){ //$ ("#onwebchat-widget-settings-submenu-ul").append('
  • End chat
  • '); // } function checkBottomOfButton() { // calculate margins for auto-adjust elements if big texts.. // if (logging) console.log("checkBottomOfButton.."); let buttonElement; if (document.getElementById("prechat_form").style.getPropertyValue('display') == 'block') { buttonElement = document.getElementById('prechat_btn'); } else { buttonElement = document.getElementById('offlineform_btn'); } if (sessionStorageGet('maxChat') == 1){ if (buttonElement != null) { let compStyle = getComputedStyle(buttonElement); // an to koumpi einai aspro(offline k prechat form), den fainetai katholou, opote to kano gkri. Einai aspro otan o Xristis epilexei sta general to aspro xroma. const backgroundColor = compStyle.backgroundColor; if (backgroundColor == "rgb(255, 255, 255)") buttonElement.style.setProperty("background-color", "#ababab", "important"); let spaceBelow = checkSpaceBelowButton(); // poso apexei to kato meros tou koumpiou apo to kato meros tou chat window // if (logging) console.log("spaceBelow 1:"+ spaceBelow + " onwebchatform_div_id.style.margin:" + document.getElementById("onwebchatform_div_id").style.margin); const m1 = 16, m2 = 25, mb = 30, mb2 = 26, top = 10; if ((spaceBelow < 40 && document.getElementById("onwebchatform_div_id").style.margin == '') || spaceBelow < 0) { // if (logging) console.log("margin:" + document.getElementById("onwebchatform_div_id").style.margin); // alert("<30") const divide = (40 - spaceBelow) / 9; // alert(divide); let offline_prechat_btn_margin = (mb - divide * 3); if (offline_prechat_btn_margin < 0) offline_prechat_btn_margin = 0; if (document.getElementById("onwebchatoffname")) document.getElementById("onwebchatoffname").style.setProperty("margin", (m1 - divide) + "px auto 5px", "important"); if (document.getElementById("onwebchatoffemail")) document.getElementById("onwebchatoffemail").style.setProperty("margin", (m1 - divide) + "px auto 5px", "important"); if (document.getElementById("onwebchatofftel")) document.getElementById("onwebchatofftel").style.setProperty("margin", (m1 - divide) + "px auto 5px", "important"); if (document.getElementById("onwebchatemailtext")) document.getElementById("onwebchatemailtext").style.setProperty("margin", (m1 - divide) + "px auto 5px", "important"); if (document.getElementById("onprechatname")) document.getElementById("onprechatname").style.setProperty("margin", (m1 - divide) + "px auto 5px", "important"); if (document.getElementById("onprechatemail")) document.getElementById("onprechatemail").style.setProperty("margin", (m1 - divide) + "px auto 5px", "important"); if (document.getElementById("onprechattel")) document.getElementById("onprechattel").style.setProperty("margin", (m1 - divide) + "px auto 5px", "important"); if (document.getElementById("onprechattext")) document.getElementById("onprechattext").style.setProperty("margin", (m1 - divide) + "px auto 5px", "important"); document.getElementById("prechat_btn").style.setProperty("margin", offline_prechat_btn_margin + "px auto 20px", "important"); document.getElementById("offlineform_btn").style.setProperty("margin", offline_prechat_btn_margin + "px auto 20px", "important"); let onwebchatform_div_id_items = document.getElementsByClassName("onwebchatform_div"); //onwebchatform_div_id_items is array (giati to id onwebchatform_div_id to exo 2 fores ston kodika!, opote prepei na paro k ta 2) let formMargin = m2 - divide * 2; // if (logging) console.log("formMargin:" + formMargin + " spaceBelow:" + spaceBelow); if (formMargin < 4) formMargin = 4; onwebchatform_div_id_items[0].style.setProperty("margin", (formMargin) + "px auto auto", "important"); // gia tin offline form onwebchatform_div_id_items[1].style.setProperty("margin", (formMargin) + "px auto auto", "important"); // gia tin prechat form document.getElementById("onweboffline_msg_id").style.setProperty("margin-bottom", (mb2 - divide * 2) + "px", "important"); document.getElementById("onweboffline_msg_id").style.setProperty("top", (top - divide) + "px", "important"); document.getElementById("onwebprechat_msg_id").style.setProperty("margin-bottom", (mb2 - divide * 2) + "px", "important"); document.getElementById("onwebprechat_msg_id").style.setProperty("top", (top - divide) + "px", "important"); spaceBelow = checkSpaceBelowButton(); // if (logging) console.log("spaceBelow 2:"+ spaceBelow ); // if (spaceBelow < 22) { // to koumpi pali einai poli xamila i ektos tou window // if (document.getElementById("onwebchatoffname")) // document.getElementById("onwebchatoffname").style.setProperty("height", "31px", "important"); // if (document.getElementById("onwebchatoffemail")) // document.getElementById("onwebchatoffemail").style.setProperty("height", "31px", "important"); // if (document.getElementById("onwebchatofftel")) // document.getElementById("onwebchatofftel").style.setProperty("height", "31px", "important"); // // if (document.getElementById("onwebchatemailtext")) // // document.getElementById("onwebchatemailtext").style.setProperty("height", "60px", "important"); // if (document.getElementById("onprechatname")) // document.getElementById("onprechatname").style.setProperty("height", "29px", "important"); // if (document.getElementById("onprechatemail")) // document.getElementById("onprechatemail").style.setProperty("height", "29px", "important"); // if (document.getElementById("onprechattel")) // document.getElementById("onprechattel").style.setProperty("height", "29px", "important"); // // if (document.getElementById("onprechattext")) // // document.getElementById("onprechattext").style.setProperty("height", "60px", "important"); // } } spaceBelow = checkSpaceBelowButton(); // if (logging) console.log("spaceBelow 3:"+ spaceBelow ); const limit = 28; if (spaceBelow" + cssFile + ""); document.getElementsByTagName('head')[0].insertAdjacentHTML('beforeend', ""); // // if (logging) console.log("isMobile:" + isMobile + " showOnMobiles::"+showOnMobiles); appendChatWidget(); // vazo ton html code sto document.. if (blocked == 1) { // ton elegxo edo ton evala gia na min emfanizetai gia ligo i eikona, otan enas vis. einai blocked #7/8/2021 // episis merikes fores an emfanizotan i eikona isos prolavene na tin patisei kai na steilei minimata.. document.getElementById("onweb_chatimage").style.setProperty('display', 'none'); } // // if (logging) console.log("os..:" + os.substring(0,7)); // if (os.substring(0,7)=='Windows'){ //Telika evala icon (image - keraunos) anti gia keimeno, giati se diafora site/browsers fainonta diaforetika.. // // an to os arxizei me Windows, tote kano to character "poweredby" pio axno (giati sta windows fainotan poli entona) // //if (os.substring(0,5)!='Linux'){ // an to os arxizei me Windows, tote kano to character "poweredby" pio axno (giati sta windows fainotan poli entona) // // // if (logging) console.log("os.. Windows!"); // try { // xoris ta try catch, den emfanizetai to chat window sta windows.. // document.getElementById("poweredbyspan").style.setProperty("opacity", "0.6", "important"); // }catch(e){} // try{ // document.getElementById("poweredbyspan2").style.setProperty("opacity", "0.6", "important"); // }catch(e){} // } setTimeout(function () { checkBottomOfButton() }, 5) // if (logging) { console.log(" isMobile: " + isMobile + " screenWidth: " + screen.width + " margin:" + chatMargin); } // if ( (screen.width-chatMargin)<300){ // elegxos an to margin einai megalo kai to chat widget vgainei ektos othonis! auto kirios gia kinita. // // if (logging) { console.log(" isos to chat na vgainei ekots othonis, opote midenizo to margin"); } // chatMargin=0; //$ ("#onwbchat_window").css(chatPosition,chatMargin+"px"); // prepei na ta kano auta edo, giati iparxei kai i metavliti chat_marginpx sto css //$ ("#onweb_chatimage_div").css(chatPosition,chatMargin+"px"); // } if (!ie8html4) { if (sessionStorageGet('chattext') == null) sessionStorageSet('chattext', ''); // if (logging) console.log("runWhenLoadAllFiles-> showchatapi: " + showChatApi + " blocked:" + blocked + " agentOnline:" + agentOnline); if ((showChatApi == 1 || agentOnline == 1 || hideOffline != 1 || sessionStorageGet('chattext') !== '') && blocked == 0 && showChatApi !== 0) { // if (logging) console.log("not ie8html4 and (agentonline=1 or hideoffline!=1...) blocked:" + blocked); showChatWindow(); } } var isBot = 0; var userAg = navigator.userAgent; if (userAg.indexOf("Googlebot") > -1 || userAg.indexOf("yandex.com/bot") > -1 || userAg.indexOf("YandexBot") > -1 || userAg.indexOf("Yahoo! Slurp") > -1 || userAg.indexOf("Baiduspider") > -1 || userAg.indexOf("BaiDuSpider") > -1 || userAg.indexOf("bingbot") > -1 || userAg.indexOf("msnbot") > -1) { isBot = 1; // einai bot, opote den kano connect to socket // if (logging) console.log(" I am bot!"); } if (isBot == 0) { // palia: preConnect && isBot==0 ioconnect(); } else { // if (logging) console.log("is a bot!!"); } //setTimeout(function(){ //set bigger texts etc on mobile devices! if (isMobile) { //document.getElementById("div_chat_max_title_span").style.setProperty("font-size", "145%", "important"); //$ (".onwebchatbox .spanbold").attr("style", "font-size:100% !important"); //$ ("#offline_form").attr("style", "zoom:120% !important"); // offline form document.getElementById("offline_form").setAttribute("style", "zoom:120% !important"); //$ ("#onwebchat-logo-span").attr("style", "zoom:90% !important"); // offline form onwebchat logo if (document.getElementById("onwebchat-logo-span")) document.getElementById("onwebchat-logo-span").setAttribute("style", "zoom:90% !important"); // offline form onwebchat logo //$ ("#onwc_welcome_message").attr("style", "zoom:125% !important"); // to welcome message, mesa sto booble document.getElementById("onwc_welcome_message").setAttribute("style", "zoom:125% !important"); // to welcome message, mesa sto booble //$ ("#chat_area_id").attr("style", "font-size:120% !important"); //online form , chats texts document.getElementById("chat_area_id").setAttribute("style", "font-size:120% !important"); //online form , chats texts //$ ("#onwebchat-widget-settings-submenu-ul").attr("style", "zoom:110% !important"); //menu document.getElementById("onwebchat-widget-settings-submenu-ul").setAttribute("style", "zoom:110% !important"); //menu //$ ("#onwc_chat_message_div").attr("style", "zoom:120% !important"); // online form to kato div (text area + koumpia) document.getElementById("onwc_chat_message_div").setAttribute("style", "zoom:120% !important"); // online form to kato div (text area + koumpia) document.getElementById("onwc_chat_message_div").setAttribute("style", "height:64px !important"); // online form to kato div (text area + koumpia) //$ ("#onwbtxtarea").attr("style", "max-width:83% !important"); // online form to text area, giati ta grammata epeftan pano sto koumpi "send" document.getElementById("onwbtxtarea").setAttribute("style","max-width:83% !important"); // online form to text area, giati ta grammata epeftan pano sto koumpi "send" document.getElementById("onwbchat_window").style.setProperty("max-height", "650px", "important"); // sta mobile na min ginetai poli megalo sto ipsos } } // runWhenLoadAllFiles //, function() { // if (logging) { console.log("fail loading scripts...: "); }} ) // function my_animate(elem, step, stop, ms) { // //var left = 0; // var start = elem.scrollTop; // var stop = start + stop; // // // if (logging) console.log("start scrolltop : + " + start + " clientHeight:" + elem.clientHeight + " scrollHeight:" + elem.scrollHeight); // var i = 0; // function frame() { // start = start + step; // update parameters // // // if (logging) console.log("new start :: + " + start); // //elem.style.left = left + 'px' // show frame // elem.scrollTop = start; // i ++; // if (start >= stop){ // check finish condition // clearInterval(id) // // if (logging) console.log("now ended my_animate etrexe fores:" + i); // } // } // var id = setInterval(frame, ms) // draw every (10) ms msec // } //exo ftiaxei kai tin startSmoothScroll function my_animate2(elem, steps, ms) { // smooth scroll document.getElementById('scrollToBottomBtn').style.visibility = 'hidden'; // not show the button on animation, make again visible when animation finishes //var left = 0; var start = elem.scrollTop; var stop = start + stop; var maxScrollPosition = elem.scrollHeight - elem.clientHeight; var i = 0; var step = (maxScrollPosition - start) / steps; // if (logging) console.log("start scrolltop : + " + start + " clientHeight:" + elem.clientHeight + " scrollHeight:" + elem.scrollHeight + " maxScrollPosition:" + maxScrollPosition + " step:" + step); function frame() { start = start + step; // update parameters // // if (logging) console.log("new start :: + " + start); //elem.style.left = left + 'px' // show frame elem.scrollTop = start; i ++; if (start >= maxScrollPosition){ // check finish condition clearInterval(id) // if (logging) console.log("now ended my_animate2 etrexe fores:" + i); document.getElementById('scrollToBottomBtn').style.visibility = 'visible'; } } var id = setInterval(frame, ms) // draw every (10) ms msec } function appendChatWidget() { //if ($ (".onwebchatbox").length == 0) { if (document.querySelectorAll(".onwebchatbox").length == 0) { /* var textName, textMessage, textButtonSend; if (language=='gr') { textName = 'Όνομα'; textMessage = 'Μήνυμα'; textButtonSend = 'Αποστολή'; }else{ textName = 'Name'; textMessage = 'Message'; textButtonSend = 'Send'; }*/ //var div_chat_min_title = ""; //var div_chat_max_title = ""; if (agentOnline == 1) { div_chat_min_title = getText('min_online', language); } else { div_chat_min_title = getText('min_offline', language); } //var logo_st_online = ' by onWebChat'; var logo_st_online = ' by onWebChat'; var logo_st = logo_st_online.replace("l=2&", ""); //var logo_st = ' by onWebChat'; if (white_label == 1) { logo_st = ""; // offline/prechat logo_st_online = ""; //online (chat maximized, chatting) } // if (logging) { console.log("to isMobile einai:::: " + isMobile + " to showOnMobiles:" + showOnMobiles + " agentOnline:" + agentOnline); } //isMobile = true; // only for testing.. if (isMobile) { // mobile_customization if (agentOnline == 1) image_name = image_name_mobile; else image_name = image_name_mobile_offline; } else { if (agentOnline == 1) image_name = image_name_desktop; else image_name = image_name_desktop_offline; } let operatorImageSt = ''; let operatorImageSmallPreviewSt = ''; if (showOperatorImages == 1) { operatorImageSt = ''; operatorImageSmallPreviewSt = ''; } var maxmsgDivSt = '
    ' + getText('max_msg', language) + '' + '
    '; if (getText('max_msg', language) == '') { // an exei valei to keno , tote na min to emfanizo to chat bubble katholou! maxmsgDivSt = ''; } tempSaveSt = ''; if (!isIE()) // den douleuei ston IE kai edge.. tempSaveSt = '
  • ' + getText('menu_save', language) + '
  • '; //tempSaveSt = '
  • ' + getText('menu_save', language) + '
  • '; var consent_label_offline = ""; var consent_label_prechat = ""; var consent_label_inchat_modal = ""; if (consent_use == 1) { var checkboxSt = ""; var cssSt = ""; if (show_consent_checkbox == 1) { checkboxSt = ''; cssSt = 'padding-left: 0px;text-indent:-17px;'; } consent_label_offline = ''; consent_label_prechat = consent_label_offline.replace(/_offline/g, '_prechat'); // giati den mporo na exo 2 elements me to idio id! //#onwc_consent_checkbox_prechat onwc_consent_l_prechat consent_label_inchat_modal = consent_label_offline.replace(/_offline/g, '_inchat_modal'); // giati den mporo na exo 2 elements me to idio id! // #onwc_consent_checkbox_inchat_modal onwc_consent_l_inchat_modal } if (isMobile != 1 || showOnMobiles == 1) { // if (logging) console.log("isMobile !=1 OR showOnMobiles==1 isMobile:" + isMobile + " showOnMobiles:" + showOnMobiles); if (isIE() != 8) { // provlima sto internet explorer 8 (den to emfanizo katholou), den fainetai kala , den emfanizei to header kai ta koumpia exoun paei se lathos thesi.. // to .ogg einai gia ton Opera //$ ("body").append('