Skip to content

Commit

Permalink
Minor syntax cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Frique committed Sep 25, 2014
1 parent 8926de5 commit 54fbab9
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions media/js/connect.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
(function($) {
(function($) {
$(function() {
// ready to roll
if (social_connect_data.wordpress_enabled) {
var _social_connect_wordpress_form = $($('.social_connect_wordpress_form')[0]);
_social_connect_wordpress_form.dialog({
'dialogClass' : 'wp-dialog',
'modal' : true,
'autoOpen' : false,
'autoOpen' : false
});
}

Expand Down Expand Up @@ -78,8 +78,8 @@
var top = (screen.height / 2) - (height / 2);
var left = (screen.width / 2 ) - (width / 2);

if(client_id == "") {
alert("Social Connect plugin has not been configured for this provider")
if(client_id === "") {
alert("Social Connect plugin has not been configured for this provider");
} else {
window.open('https://graph.facebook.com/oauth/authorize?client_id=' + client_id + '&redirect_uri=' + redirect_uri + '&scope=email',
'', 'scrollbars=no,menubar=no,height=' + height + ',width=' + width + ',resizable=yes,toolbar=no,status=no,top=' + top + ',left=' + left);
Expand Down Expand Up @@ -123,7 +123,7 @@
});

$(".social_connect_login_wordpress").on("click", function() {
_social_connect_wordpress_form.dialog('open');
_social_connect_wordpress_form.dialog('open');
});

$(".social_connect_wordpress_proceed").on("click", function(e) {
Expand All @@ -132,7 +132,6 @@
});
})(jQuery);


window.wp_social_connect = function(config) {
jQuery('#loginform').unbind('submit.simplemodal-login');

Expand All @@ -152,10 +151,10 @@ window.wp_social_connect = function(config) {
}
}

jQuery.each(config, function(key, value) {
jQuery.each(config, function(key, value) {
jQuery("#" + key).remove();
jQuery(form_id).append("<input type='hidden' id='" + key + "' name='" + key + "' value='" + value + "'>");
});
});

if(jQuery("#simplemodal-login-form").length) {
var current_url = window.location.href;
Expand All @@ -164,4 +163,4 @@ window.wp_social_connect = function(config) {
}

jQuery(form_id).submit();
}
};

0 comments on commit 54fbab9

Please sign in to comment.