Sha256: b4deee25c333b064d18ffd5e0947288e96769d512d5ea17b26860e9481c820b3

Contents?: true

Size: 1.9 KB

Versions: 3

Compression:

Stored size: 1.9 KB

Contents

<div id="waitingDiv"><b>Loading Your Address Book...</b><br/><i>(Larger contact lists may take longer to load)</i></div>
<div id="contentDiv">
	<input type="button" value="Cancel" onclick="closeWindow()">
</div>

<script>
	var i = 0;
	var authReceived = false;
	var loginError = false;
	var intervalID = setInterval(checkAuth, 1000);
		
	function checkAuth(){
		i = i + 1;
		tempString = "Loading Your Address Book"
		for (j=0; j<(i%6); j++)
			tempString = tempString + ".";
		jQuery("#waitingDiv").html("<b>" + tempString + "</b><br/><i>(Larger contact lists may take longer to load)</i>");
				
		jQuery.ajax("/importCheck/<%= @importID %>", {
			complete:function(jqXHR, textStatus) {
				if (jqXHR.responseText == "true")
					authReceived = true;
				else if (jqXHR.responseText == "error")
					loginError = true;
			}
		});
		
		if (loginError){
			clearInterval(intervalID);
			alert("There was a problem with your username or password. Please try again!");
			showAOLLogin();			
		}
		
		if (authReceived){
			clearInterval(intervalID);
			jQuery("#waitingDiv").html("<b>Authorization Received!</b>");
			jQuery("#importText").html("<b>Loading Contacts. Please wait...</b>");
			jQuery.ajax("/importContacts/<%= @importID %>?service=<%= params[:service] %><% if !(params[:new_client_waiting_list_id].nil?) %>&new_client_waiting_list_id=<%= params[:new_client_waiting_list_id] %><% end %>", {
				complete:function(jqXHR, textStatus) {
					document.getElementById("waitingDiv").style.display = 'none';	
					jQuery("#contentDiv").html(jqXHR.responseText);
				}
			});
		}
	}
</script>

<script>
	function closeWindow(){
		document.getElementById("importAOLLogo").style.display = 'none';
		document.getElementById("importText").style.display = 'none';
		document.getElementById("importDiv").style.display = 'none';
		document.getElementById("addressSelectionDiv").style.display = 'block';	
		clearInterval(intervalID);
	}
</script>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_multi_share-2.2.2.1 app/views/spree/cloud_sender/importAOL.html.erb
spree_multi_share-1.3.3 app/views/spree/cloud_sender/importAOL.html.erb
spree_multi_share-1.3.2 app/views/spree/cloud_sender/importAOL.html.erb