-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate Oauth helper into SC (#562)
* Interate Oauth helper into SC * feedback changes * Make oauth helper compatible with Appointment * version, changelog and formatting
- Loading branch information
1 parent
890ace5
commit 8415bd0
Showing
14 changed files
with
618 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
.simcal-auth-tabs { | ||
width: 600px; | ||
border-radius: 5px 5px 5px 5px; | ||
} | ||
ul#simcal-auth-tabs-nav { | ||
list-style: none; | ||
margin: 0; | ||
padding: 5px; | ||
overflow: auto; | ||
} | ||
ul#simcal-auth-tabs-nav li { | ||
float: left; | ||
font-weight: bold; | ||
margin-right: 2px; | ||
padding: 8px 10px; | ||
border-radius: 5px 5px 5px 5px; | ||
cursor: pointer; | ||
background-color: #d9d9d9; | ||
} | ||
ul#simcal-auth-tabs-nav li:hover, | ||
ul#simcal-auth-tabs-nav li.active { | ||
background-color: #60bc4e; | ||
} | ||
#simcal-auth-tabs-nav li a { | ||
text-decoration: none; | ||
color: #fff; | ||
} | ||
.simcal-auth-tab-content { | ||
padding: 10px; | ||
} | ||
.hide { | ||
display: none; | ||
} | ||
.afterauth-via-xtendify-cta, | ||
.auth-via-xtendify-cta { | ||
text-align: center; | ||
} | ||
|
||
.simcal-auth-tabs-content a#oauth_deauthentication:hover, | ||
.simcal-auth-tabs-content .auth-via-xtendify-cta .action_auth_via_xtendify:hover { | ||
color: rgb(96 188 78 1); | ||
background: rgb(255 255 255 1); | ||
border: 1px solid rgb(96 188 78 1); | ||
} | ||
#simcal-settings-page-form .auth-via-xtendify-cta a:active, | ||
#simcal-settings-page-form .auth-via-xtendify-cta a:hover, | ||
#simcal-settings-page-form .afterauth-via-xtendify-cta a:active, | ||
#simcal-settings-page-form .afterauth-via-xtendify-cta a:hover, | ||
#simcal-settings-page-form .afterauth-via-xtendify-cta a:focus, | ||
#simcal-settings-page-form .afterauth-via-xtendify-cta a:focus { | ||
color: #fff; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
(function ($) { | ||
'use strict'; | ||
|
||
/** | ||
* All of the code for your admin-facing JavaScript source | ||
* should reside in this file. | ||
* | ||
* Note: It has been assumed you will write jQuery code here, so the | ||
* $ function reference has been prepared for usage within the scope | ||
* of this function. | ||
* | ||
* This enables you to define handlers, for when the DOM is ready: | ||
*/ | ||
$(function (e) { | ||
/* ========================= * | ||
* De auth from xtendify* | ||
* ========================= */ | ||
$('#oauth_deauthentication').on('click', function (e) { | ||
e.preventDefault(); | ||
var spinner = $(this).find('i'), | ||
dialog = $(this).data('dialog'), | ||
reply = confirm(dialog); | ||
|
||
if (true !== reply) { | ||
return; | ||
} | ||
|
||
$.ajax({ | ||
url: oauth_admin.ajax_url, | ||
method: 'POST', | ||
data: { | ||
action: 'oauth_deauthenticate_site', | ||
nonce: $('#oauth_action_deauthentication').val(), | ||
}, | ||
beforeSend: function () { | ||
spinner.toggle(); | ||
}, | ||
success: function (response) { | ||
if (response.data) { | ||
var curUrl = window.location.href; | ||
var newURL = curUrl.replace('status=1', 'status=0'); | ||
newURL = newURL.replace('auth_token=', ''); | ||
window.location.href = newURL; | ||
} else { | ||
console.log(response); | ||
spinner.fadeToggle(); | ||
} | ||
}, | ||
error: function (response) { | ||
console.log(response); | ||
spinner.fadeToggle(); | ||
}, | ||
}); | ||
}); | ||
}); | ||
|
||
$(window).load(function () { | ||
/* ========================= * | ||
* Auth Via xtendify Tab* | ||
* ========================= */ | ||
|
||
$('#simcal-auth-tabs-nav li:first-child').addClass('active'); | ||
$('.simcal-auth-tab-content').hide(); | ||
$('.simcal-auth-tab-content:first').show(); | ||
|
||
// Click function | ||
$('#simcal-auth-tabs-nav li').click(function () { | ||
$('#simcal-auth-tabs-nav li').removeClass('active'); | ||
$(this).addClass('active'); | ||
$('.simcal-auth-tab-content').hide(); | ||
|
||
var activeTab = $(this).find('a').attr('href'); | ||
$(activeTab).fadeIn(); | ||
return false; | ||
}); | ||
}); | ||
})(jQuery); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.