X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/3a1d81bd9c5a866aed0dd7890a4174f0ff6b1e78..370261e715ab53e9630e2c209e478c4b87bf14c6:/underlays/openid-selector/ikiwiki/openid/openid-jquery.js diff --git a/underlays/openid-selector/ikiwiki/openid/openid-jquery.js b/underlays/openid-selector/ikiwiki/openid/openid-jquery.js index 8137f232f..2c72f19fb 100644 --- a/underlays/openid-selector/ikiwiki/openid/openid-jquery.js +++ b/underlays/openid-selector/ikiwiki/openid/openid-jquery.js @@ -6,14 +6,15 @@ 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' + verisign: { + name: 'Verisign', + icon: 'ikiwiki/openid/verisign.png', + label: 'Enter your Verisign username:', + url: 'http://{username}.pip.verisignlabs.com/' }, yahoo: { name: 'Yahoo', - icon: 'http://yahoo.com/favicon.ico', + icon: 'ikiwiki/openid/goa-account-yahoo.png', url: 'http://me.yahoo.com/' }, openid: { @@ -21,63 +22,9 @@ var providers_large = { icon: 'wikiicons/openidlogin-bg.gif', label: 'Enter your OpenID:', url: null - }, + } }; var providers_small = { - 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}/' - }, - 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/' - }, - 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); @@ -94,8 +41,9 @@ var openid = { input_id: null, provider_url: null, provider_id: null, + localsignin_id: null, - init: function(input_id, localloginurl) { + init: function(input_id, localsignin_id, localsignin_label) { var openid_btns = $('#openid_btns'); @@ -108,17 +56,25 @@ var openid = { for (id in providers_large) { openid_btns.append(this.getBoxHTML(providers_large[id], 'large')); } - - if (localloginurl != "") { + if (localsignin_label != "") { + this.localsignin_label=localsignin_label; + } + else { + this.localsignin_label="other"; + } + if (localsignin_id != "") { + this.localsignin_id=localsignin_id; openid_btns.append( - '' + + 'class="localsignin openid_large_btn">' + '' + - ' Local Account' + + ' ' + this.localsignin_label + '' ); + $('#'+this.localsignin_id).hide(); } + if (providers_small) { openid_btns.append('
'); @@ -133,7 +89,7 @@ var openid = { var box_id = this.readCookie(); if (box_id) { this.signin(box_id, true); - } + } }, getBoxHTML: function(provider, box_size) { var label=""; @@ -155,22 +111,36 @@ var openid = { }, /* Provider image click */ signin: function(box_id, onload) { - + + if (box_id == 'localsignin') { + this.highlight(box_id); + $('#openid_input_area').empty(); + $('#'+this.localsignin_id).show(); + this.setCookie(box_id); + return; + } + else { + if (this.localsignin_id) { + $('#'+this.localsignin_id).hide(); + } + } + var provider = providers[box_id]; if (! provider) { return; } this.highlight(box_id); - this.setCookie(box_id); this.provider_id = box_id; this.provider_url = provider['url']; // prompt user for input? if (provider['label']) { + this.setCookie(box_id); this.useInputBox(provider); } else { + this.setCookie(''); $('#openid_input_area').empty(); if (! onload) { $('#openid_form').submit(); @@ -242,14 +212,14 @@ var openid = { var label = provider['label']; var style = ''; - if (label) { - html = '

' + label + '

'; - } if (provider['name'] == 'OpenID') { id = this.input_id; value = ''; style = 'background:#FFF url(wikiicons/openidlogin-bg.gif) no-repeat scroll 0 50%; padding-left:18px;'; } + if (label) { + html = ''; + } html += '' + '';