summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/openid/f')
-rw-r--r--plugins/openid/f/ajax-loader.gifbin0 -> 1849 bytes
-rw-r--r--plugins/openid/f/icon.pngbin0 -> 1604 bytes
-rw-r--r--plugins/openid/f/openid.css37
-rw-r--r--plugins/openid/f/openid.gifbin0 -> 211 bytes
-rw-r--r--plugins/openid/f/openid.js64
5 files changed, 101 insertions, 0 deletions
diff --git a/plugins/openid/f/ajax-loader.gif b/plugins/openid/f/ajax-loader.gif
new file mode 100644
index 00000000..5b33f7e5
--- /dev/null
+++ b/plugins/openid/f/ajax-loader.gif
Binary files differ
diff --git a/plugins/openid/f/icon.png b/plugins/openid/f/icon.png
new file mode 100644
index 00000000..5f539a38
--- /dev/null
+++ b/plugins/openid/f/icon.png
Binary files differ
diff --git a/plugins/openid/f/openid.css b/plugins/openid/f/openid.css
new file mode 100644
index 00000000..b1ce6b81
--- /dev/null
+++ b/plugins/openid/f/openid.css
@@ -0,0 +1,37 @@
+/* yuicompress openid.css -o openid.min.css
+ * @see http://developer.yahoo.com/yui/compressor/
+ */
+
+#openid_enabled_link, .openid_link, #openid_identifier, #commentform #openid_identifier {
+ background-image: url('openid.gif');
+ background-position: 3px 50%;
+ background-repeat: no-repeat;
+ padding-left: 21px !important;
+}
+
+.openid_loading {
+ background: url('ajax-loader.gif') right center no-repeat;
+}
+
+body.login #openid_identifier {
+ width: 92%;
+ font-size: 20px;
+ background-color: #FFF;
+ border: 1px solid #ccc;
+ padding: 3px 3px 3px 18px;
+ margin-right: 6px;
+}
+
+#openid_comment {
+ margin: 0.8em 1em;
+}
+#openid_comment input {
+ width: auto;
+}
+
+/* fix link color on wp-login.php */
+body.login form#loginform a.legacy,
+body.login form#registerform a.legacy {
+ color: #FFF;
+}
+
diff --git a/plugins/openid/f/openid.gif b/plugins/openid/f/openid.gif
new file mode 100644
index 00000000..ea14f84f
--- /dev/null
+++ b/plugins/openid/f/openid.gif
Binary files differ
diff --git a/plugins/openid/f/openid.js b/plugins/openid/f/openid.js
new file mode 100644
index 00000000..5d6cc4a7
--- /dev/null
+++ b/plugins/openid/f/openid.js
@@ -0,0 +1,64 @@
+/* yuicompress openid.js -o openid.min.js
+ * @see http://developer.yahoo.com/yui/compressor/
+ */
+
+jQuery(function() {
+ jQuery('#openid_system_status').hide();
+
+ jQuery('#openid_status_link').click( function() {
+ jQuery('#openid_system_status').toggle();
+ return false;
+ });
+});
+
+function stylize_profilelink() {
+ jQuery("#commentform a[href$='profile.php']").addClass('openid_link');
+}
+
+/**
+ * Properly integrate the 'Authenticate with OpenID' checkbox into the comment form.
+ * This will move the checkbox below the Website field, and add an AJAX hook to
+ * show/hide the checkbox depending on whether the given URL is a valid OpenID.
+ */
+function add_openid_to_comment_form(wp_url, nonce) {
+ var openid_nonce = nonce;
+
+ var openid_comment = jQuery('#openid_comment');
+ var openid_checkbox = jQuery('#login_with_openid');
+ var url = jQuery('#url');
+
+ jQuery('label[for="url"],#url').filter(':last').after(openid_comment.hide());
+
+ if ( url.val() ) check_openid( url );
+ url.blur( function() { check_openid(jQuery(this)); } );
+
+
+ /**
+ * Make AJAX call to WordPress to check if the given URL is a valid OpenID.
+ * AJAX response should be a JSON structure with two values:
+ * 'valid' - (boolean) whether or not the given URL is a valid OpenID
+ * 'nonce' - (string) new nonce to use for next AJAX call
+ */
+ function check_openid( url ) {
+ url.addClass('openid_loading');
+
+ if ( url.val() == '' ) {
+ openid_checkbox.attr('checked', '');
+ openid_comment.slideUp();
+ return;
+ }
+
+ jQuery.getJSON(wp_url + '?openid=ajax', {url: url.val(), _wpnonce: openid_nonce}, function(data, textStatus) {
+ url.removeClass('openid_loading');
+ if ( data.valid ) {
+ openid_checkbox.attr('checked', 'checked');
+ openid_comment.slideDown();
+ } else {
+ openid_checkbox.attr('checked', '');
+ openid_comment.slideUp();
+ }
+ openid_nonce = data.nonce;
+ });
+ }
+}
+