From ede2d1b46de45122c5cc81cd6e7e1131007ce93d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 7 May 2010 21:21:04 -0400 Subject: [PATCH] adapt to ikiwiki Upstream ships a collection of icons, but the licences of them are very unclear, since most seem to be taken from the various openid provider websites. That can't be included in ikiwiki. So, instead hotlink to favicons of sites, and for large display, include the site name. Removed vidoop.com, which is gone. If an url is passed to init as the second parameter, add a "Local Login" provider, which just links to do=signin. --- .../ikiwiki/openid/openid-jquery.js | 99 ++++++++++++------- 1 file changed, 63 insertions(+), 36 deletions(-) diff --git a/underlays/openid-selector/ikiwiki/openid/openid-jquery.js b/underlays/openid-selector/ikiwiki/openid/openid-jquery.js index 1d96555a8..43d2ef668 100644 --- a/underlays/openid-selector/ikiwiki/openid/openid-jquery.js +++ b/underlays/openid-selector/ikiwiki/openid/openid-jquery.js @@ -8,69 +8,76 @@ This code is licenced under the New BSD License. var providers_large = { google: { name: 'Google', + icon: 'http://google.com/favicon.ico', url: 'https://www.google.com/accounts/o8/id' }, yahoo: { name: 'Yahoo', + icon: 'http://yahoo.com/favicon.ico', url: 'http://me.yahoo.com/' }, - aol: { - name: 'AOL', - label: 'Enter your AOL screenname:', - url: 'http://openid.aol.com/{username}' - }, - verisign: { - name: 'Verisign', - label: 'Enter your Verisign username:', - url: 'http://{username}.pip.verisignlabs.com/' - }, openid: { name: 'OpenID', + icon: 'wikiicons/openidlogin-bg.gif', label: 'Enter your OpenID:', url: null - } + }, }; var providers_small = { - myopenid: { - name: 'MyOpenID', - label: 'Enter your MyOpenID username:', - url: 'http://{username}.myopenid.com/' - }, livejournal: { name: 'LiveJournal', + icon: 'http://livejournal.com/favicon.ico', label: 'Enter your Livejournal username:', url: 'http://{username}.livejournal.com/' }, flickr: { name: 'Flickr', + icon: 'http://flickr.com/favicon.ico', label: 'Enter your Flickr username:', url: 'http://flickr.com/{username}/' }, - technorati: { - name: 'Technorati', - label: 'Enter your Technorati username:', - url: 'http://technorati.com/people/technorati/{username}/' - }, wordpress: { name: 'Wordpress', + icon: 'https://ddgw.s3.amazonaws.com/wordpress.org.ico', label: 'Enter your Wordpress.com username:', url: 'http://{username}.wordpress.com/' }, blogger: { name: 'Blogger', + icon: 'http://blogger.com/favicon.ico', label: 'Enter your Blogger account:', url: 'http://{username}.blogspot.com/' }, - vidoop: { - name: 'Vidoop', - label: 'Enter your Vidoop username:', - url: 'http://{username}.myvidoop.com/' + technorati: { + name: 'Technorati', + icon: 'http://technorati.com/favicon.ico', + label: 'Enter your Technorati username:', + url: 'http://technorati.com/people/technorati/{username}/' + }, + myopenid: { + name: 'MyOpenID', + icon: 'http://myopenid.com/favicon.ico', + label: 'Enter your MyOpenID username:', + url: 'http://{username}.myopenid.com/' }, claimid: { name: 'ClaimID', + icon: 'http://claimid.com/favicon.ico', label: 'Enter your ClaimID username:', url: 'http://claimid.com/{username}' - } + }, + aol: { + name: 'AOL', + icon: 'http://aol.com/favicon.ico', + label: 'Enter your AOL screenname:', + url: 'http://openid.aol.com/{username}' + }, + verisign: { + name: 'Verisign', + icon: 'http://verisign.com/favicon.ico', + label: 'Enter your Verisign username:', + url: 'http://{username}.pip.verisignlabs.com/' + }, }; var providers = $.extend({}, providers_large, providers_small); @@ -88,7 +95,7 @@ var openid = { provider_url: null, provider_id: null, - init: function(input_id) { + init: function(input_id, localloginurl) { var openid_btns = $('#openid_btns'); @@ -99,15 +106,25 @@ var openid = { // add box for each provider for (id in providers_large) { - - openid_btns.append(this.getBoxHTML(providers_large[id], 'large', '.gif')); + openid_btns.append(this.getBoxHTML(providers_large[id], 'large')); } + + if (localloginurl != "") { + openid_btns.append( + '' + + '' + + ' Local Account' + + '' + ); + } if (providers_small) { openid_btns.append('
'); for (id in providers_small) { - openid_btns.append(this.getBoxHTML(providers_small[id], 'small', '.ico')); + openid_btns.append(this.getBoxHTML(providers_small[id], 'small')); } } @@ -118,12 +135,22 @@ var openid = { this.signin(box_id, true); } }, - getBoxHTML: function(provider, box_size, image_ext) { - + getBoxHTML: function(provider, box_size) { + var label=""; + var title="" + if (box_size == 'large') { + label=' ' + provider["name"]; + } + else { + title=' title="'+provider["name"]+'"'; + } var box_id = provider["name"].toLowerCase(); - return ''; + return '' + + '' + + label + + ''; }, /* Provider image click */ @@ -224,7 +251,7 @@ var openid = { style = 'background:#FFF url(wikiicons/openidlogin-bg.gif) no-repeat scroll 0 50%; padding-left:18px;'; } html += '' + - ''; + ''; input_area.empty(); input_area.append(html); -- 2.26.2