Gigya Job Openings

Page History

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

HTML
<div id="runningCodeExample" style="border: 1px solid skyblue; padding: 15px; width: 400px; display: block; height: auto;">
	<script>  
        function onLoad()
        {
            // get user info
            gigya.socialize.getUserInfo({callback:renderUI});	    
            
            // register for connect status changes
            gigya.socialize.addEventHandlers({ onConnectionAdded: renderUI, onConnectionRemoved: renderUI }); 
            
        }
		function renderUI(res)
		{
		    document.getElementById('btnUpdateStatus').disabled = (res.user==null || !res.user.isConnected);
		}
		
		// Update the user's status
		function setStatus()
		{
			var params = 
			{
			    status: "This is a Status update test with a link. "
					+ "Check out Gigya's RaaS Demo, here is the link: raas-demogigyademo.gigya.com",
			    callback:setStatus_callback
			};
			
			gigya.socialize.setStatus(params);
		}
		// Display a status message according to the response from reportAction.
		function setStatus_callback(response)
		{
			switch (response.errorCode )
			{
				case 0:
					document.getElementById('status').style.color = "green";
					document.getElementById('status').innerHTML = "Status Updated.";
					break;
				default:
					document.getElementById('status').style.color = "red";
					document.getElementById('status').innerHTML = "Unable to update status. response=" 
					+ response.errorCode + "; " + response.errorMessage;
			}
		}
		onLoad();
    </script>
	<h5 >Step 1: Connect</h5>
	    <div id="divConnect"></div>
    <script type="text/javascript">
	    // show 'Add Connections' Plugin in "divConnect"
	    gigya.socialize.showAddConnectionsUI({ 
			height:65
			,width:175
			,showTermsLink:false // remove 'Terms' link
			,hideGigyaLink:true // remove 'Gigya' link
			,cid: "Status Example page"
			,enabledProviders:  "facebook, twitter, yahoo, google, linkedin"
			,containerID: "divConnect" // The component will embed itself inside the divConnect Div 
		});
    </script>    
    <br />
    <h5>Step 2: Update Status</h5>
    <div >
    <span style="color:#6e6e6e" >Click the button below to update your status</span>
    </div><br />
    <input type=button id="btnUpdateStatus" onclick="javascript:setStatus()" value="post" />
    <div id="status"></div>
</div>

...

Code Block
languagejavascript
linenumberstrue
<html>
<head>
    <title>Gigya Demo  - update status</title>
	<SCRIPT type="text/javascript" lang="javascript" 
	   src="https://cdns.gigya.com/js/gigya.js?apikey=3_mK2cmEzLkzhqe4MUrtPncxbv4wKsYAhsew0iVwhVUls3c_Jx_HLX434jAVpq5M_W">
	   </SCRIPT>
</head>
<body>
<div id="runningCodeExample" style="border: 1px solid skyblue; padding: 15px; width: 400px; display: block; height: auto;">
	<script>  
        function onLoad()
        {
            // get user info
            gigya.socialize.getUserInfo({callback:renderUI});	    
            
            // register for connect status changes
            gigya.socialize.addEventHandlers({ onConnectionAdded: renderUI, onConnectionRemoved: renderUI }); 
            
        }
		function renderUI(res)
		{
		    document.getElementById('btnUpdateStatus').disabled = (res.user==null || !res.user.isConnected);
		}
		
		// Update the user's status
		function setStatus()
		{
			var params = 
			{
			    status: "This is a Status update test with a link. "
					+ "Check out Gigya's RaaS Demo, here is the link: demogigyademo.gigya.com",
			    callback:setStatus_callback
			};
			
			gigya.socialize.setStatus(params);
		}
		// Display a status message according to the response from reportAction.
		function setStatus_callback(response)
		{
			switch (response.errorCode )
			{
				case 0:
					document.getElementById('status').style.color = "green";
					document.getElementById('status').innerHTML = "Status Updated.";
					break;
				default:
					document.getElementById('status').style.color = "red";
					document.getElementById('status').innerHTML = "Unable to update status. response=" 
					+ response.errorCode + "; " + response.errorMessage;
			}
		}
		onLoad();
    </script>
	<h5 >Step 1: Connect</h5>
	    <div id="divConnect"></div>
    <script type="text/javascript">
	    // show 'Add Connections' Plugin in "divConnect"
	    gigya.socialize.showAddConnectionsUI({ 
			height:65
			,width:175
			,showTermsLink:false // remove 'Terms' link
			,cid: "Status Example page"
			,enabledProviders:  "facebook, twitter, yahoo, google, linkedin"
			,containerID: "divConnect" // The component will embed itself inside the divConnect Div 
		});
    </script>    
    <br />
    <h5>Step 2: Update Status</h5>
    <div >
    <span style="color:#6e6e6e" >Click the button below to update your status</span>
    </div><br />
    <input type=button id="btnUpdateStatus" onclick="javascript:setStatus()" value="post" />
    <div id="status"></div>
</div>
</body>
</html>

...