var Fse; if( ! Fse ) Fse = {}; Fse.OA = {}; Fse.OA.loadPage = function( oUrl ){ $.mobile.loading('show'); $.ajax({ method: 'GET', url: oUrl, dataType: 'html', success: function( oHtml ){ $("#ownersapp-page-container").empty().html( oHtml ).trigger("create"); $.mobile.loading('hide'); }, failture: function( err ){ alert( err ); } }); }; //PHOTO UPLOADING Fse.photoUploadSuccess = function() { var operatorId = $("#accountPhotos").attr("FSE:operatorId") Fse.OA.LoadAccountPhotos( operatorId ); }; Fse.OA.LoadAccountPhotos = function( operatorId ) { $.mobile.loading('show'); $.ajax({ method: 'GET', url: '?view=accountPhotos&operatorId=' + operatorId, dataType: 'html', success: function( oHtml ){ $("#accountPhotos").empty().html( oHtml ).trigger("create"); $.mobile.loading('hide'); }, failture: function( err ){ alert( err ); } }); }; Fse.updateUploadStatus = function ( oIncrement ){ // Change Status for Uploading return true; }; Fse.OA.deletePhoto = function(operatorId,fileId) { $.mobile.loading('show'); if (confirm('Delete Photo?')) { $.ajax({ method: 'POST', url: '?do=deletePhoto&operatorId=' + operatorId + '&fileId=' +fileId, dataType: 'html', success: function( oHtml ){ Fse.OA.LoadAccountPhotos( operatorId ); $.mobile.loading('hide'); }, failture: function( err ){ alert( err ); } }); } }; Fse.OA.previewProfile = function( oProfileUrl ){ window.open( oProfileUrl, '_blank' ); }; Fse.OA.searchAccounts = function( oForm ){ $.mobile.loading('show'); var searchTerm = oForm.search.value; $.ajax({ method: 'POST', url: '?do=searchAccounts&searchTerm=' + searchTerm, dataType: 'html', success: function ( html ){ Fse.OA.loadPage('index.cfm?view=accountList'); $.mobile.loading('hide'); }, failture: function( err ){ alert( err ); } }); return false; } Fse.OA.updateCoordinates = function( operatorId ){ if ( confirm("Coordinates based on current operator address will be updated via Google. Continue?") ) { $.ajax({ method: 'POST', url: '?do=updateCoordinates&operatorId=' + operatorId, dataType: 'html', success: function ( html ){ alert("Coordinates have been successfully updated for this operator!"); $.mobile.loading('hide'); }, failture: function( err ){ alert( err ); } }); } else { return false; } }