This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "math/rand" | |
| "time" | |
| ) | |
| func boring(msg string) <-chan string { | |
| c := make(chan string) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(lpTag && lpTag.events && lpTag.events.bind) { | |
| lpTag.events.bind('lpUnifiedWindow','conversationInfo', (data,eventInfo) => { | |
| // push to GTM once event is interactive. | |
| if ( data.state && data.state == 'interactive') { | |
| dataLayer.push( | |
| { | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from "react"; | |
| import logo from "./logo.svg"; | |
| import "./App.css"; | |
| const Child = ({ onClick }) => <button onClick={onClick}>Click me</button>; | |
| class Parent extends Component { | |
| field = "hello"; | |
| handleClick = e => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var idleTimer:Timer? // a timer | |
| var refreshTokenInProgress:Bool = false // a bool to track if you are already in the process of refreshing a token when the timer ticks over again | |
| // function registered in your delegate handler class for monitoring connnection state changed from the SDK | |
| func LPMessagingSDKConnectionStateChanged(_ isReady: Bool, brandID: String) { | |
| // isReady = true = connected on conversation screen = then start your timer | |
| if(isReady) { | |
| print("@@@ connection state changed to \(isReady)") | |
| if( idleTimer?.isValid == false) { | |
| runTimer() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript"> | |
| window.lpTag = window.lpTag || {}; // REQUIRED to ensure lpTag {} exists prior to SDE push | |
| window.lpTag.autoStart = false; // disable AUTOSTART | |
| window.lpTag.site = "90233546"; // replace with your desired account number | |
| window.lpTag=window.lpTag||{},"undefined"==typeof window.lpTag._tagCount?(window.lpTag={site:lpTag.site||"90233546",section:lpTag.section||"",tagletSection:lpTag.tagletSection||null,autoStart:lpTag.autoStart!==!1,ovr:lpTag.ovr||{},_v:"1.7.0",_tagCount:1,protocol:"https:",events:{bind:function(t,e,i){lpTag.defer(function(){lpTag.events.bind(t,e,i)},0)},trigger:function(t,e,i){lpTag.defer(function(){lpTag.events.trigger(t,e,i)},1)}},defer:function(t,e){0==e?(this._defB=this._defB||[],this._defB.push(t)):1==e?(this._defT=this._defT||[],this._defT.push(t)):(this._defL=this._defL||[],this._defL.push(t))},load:function(t,e,i){var n=this;setTimeout(function(){n._load(t,e,i)},0)},_load:function(t,e,i){var n=t;t||(n=this.protocol+"//"+(this.ovr&&this.ovr.domain?this.o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| PLEASE NOTE: | |
| This sameple DOES NOT include the standard liveperson tag which should already be included on all pages you wish to start, | |
| continue cobrowse live sharing on | |
| --> | |
| <a href="#" onclick="enterServiceNumber();">Live Share</a> | |
| <script type='text/javascript'> | |
| function requestCobrowse(serviceId) { | |
| console.log('requestCoBrowse function ... ',serviceId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| *************** PLEASE NOTE ************* | |
| * This code is POC -- should be TESTED BEFORE BEING ADDED TO PRODUCTION WEBSITE | |
| * Assumes will only be added to specific pages (logout) where you want this behaviour | |
| * Assumes the page is already tagged with liveperson general code and account number | |
| */ | |
| var LP_CHAT_WINDOW_PARENT_ELEMENT_ID = "lpChat"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (this.postData != null) { | |
| OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream()); | |
| Iterator<?> keys = postData.keys(); // get the object keys | |
| // loop through them | |
| while( keys.hasNext() ) { | |
| String key = (String)keys.next(); //get the postData key | |
| if ( postData.get(key) instanceof JSONObject ) { | |
| // do something else | |
| } else if( postData.get(key) instanceof String) { | |
| writer.write(key+"="+postData.get(key)+"&"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private class JSONTask extends AsyncTask<String,String, String > { | |
| // This is the JSON body of the post | |
| JSONObject postData; | |
| // This is a constructor that allows you to pass in the JSON body | |
| public JSONTask(Map<String, String> postData) { | |
| if (postData != null) { | |
| this.postData = new JSONObject(postData); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Map<String, String> postData = new HashMap<>(); | |
| postData.put("sub", user.sub); | |
| postData.put("exp", user.tokenExpirationInMinutes); | |
| postData.put("fname", user.firstname); | |
| postData.put("lname", user.lastname); | |
| postData.put("email", user.email); | |
| new JSONTask(postData).execute("/api/token/"); |
NewerOlder