]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
rename openid selector files to login-selector
authorJoey Hess <joeyh@joeyh.name>
Wed, 13 May 2015 21:56:36 +0000 (17:56 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 13 May 2015 21:58:59 +0000 (17:58 -0400)
19 files changed:
IkiWiki/Plugin/openid.pm
debian/copyright
doc/basewiki.mdwn
doc/templates.mdwn
templates/login-selector.tmpl [new file with mode: 0644]
templates/openid-selector.tmpl [deleted file]
underlays/login-selector/ikiwiki/login-selector/aol.png [new file with mode: 0644]
underlays/login-selector/ikiwiki/login-selector/goa-account-flickr.png [new file with mode: 0644]
underlays/login-selector/ikiwiki/login-selector/goa-account-yahoo.png [new file with mode: 0644]
underlays/login-selector/ikiwiki/login-selector/login-selector.js [new file with mode: 0644]
underlays/login-selector/ikiwiki/login-selector/verisign.png [new file with mode: 0644]
underlays/login-selector/ikiwiki/login-selector/wordpress.png [new file with mode: 0644]
underlays/openid-selector/ikiwiki/openid/aol.png [deleted file]
underlays/openid-selector/ikiwiki/openid/goa-account-flickr.png [deleted file]
underlays/openid-selector/ikiwiki/openid/goa-account-yahoo.png [deleted file]
underlays/openid-selector/ikiwiki/openid/livejournal.png [deleted file]
underlays/openid-selector/ikiwiki/openid/openid-jquery.js [deleted file]
underlays/openid-selector/ikiwiki/openid/verisign.png [deleted file]
underlays/openid-selector/ikiwiki/openid/wordpress.png [deleted file]

index b8ebbe22854dc293564855f293655e5ba49e7876..a12c83b8cada4547ed31c27e5fa86490454f6bac 100644 (file)
@@ -7,7 +7,7 @@ use strict;
 use IkiWiki 3.00;
 
 sub import {
-       add_underlay("openid-selector");
+       add_underlay("login-selector");
        add_underlay("jquery");
        hook(type => "checkconfig", id => "openid", call => \&checkconfig);
        hook(type => "getsetup", id => "openid", call => \&getsetup);
@@ -68,7 +68,7 @@ sub openid_selector {
         my $q=shift;
         my $session=shift;
 
-       my $template=IkiWiki::template("openid-selector.tmpl");
+       my $template=IkiWiki::template("login-selector.tmpl");
        my $openid_url=$q->param('openid_identifier');
 
        if (! load_openid_module()) {
index a73d1ccff4ad579ffea2e5345edb52d8950df20e..35fadf56b0b5bcecfa79a88ff8fef2e6a0fd0da4 100644 (file)
@@ -201,20 +201,20 @@ Comment:
  Republished with permission.
 License: GPL-2+
 
-Files: underlays/openid-selector/ikiwiki/openid/*
+Files: underlays/openid-selector/ikiwiki/login-selector/*
 Copyright: © 2008-2010 andyjm, david.j.boden
 Comment: 
  From http://code.google.com/p/openid-selector/
 License: BSD-2-clause
 
-Files: underlays/openid-selector/ikiwiki/openid/goa-*
+Files: underlays/openid-selector/ikiwiki/login-selector/goa-*
 Copyright:
  © 2011 Red Hat, Inc.
 License: LGPL-2.1+
 Comment:
  taken from data/icons/16x16/ in gnome-online-accounts git
 
-Files: underlays/openid-selector/ikiwiki/openid/wordpress.png
+Files: underlays/openid-selector/ikiwiki/login-selector/wordpress.png
 Copyright:
  © 2003-2013 "the contributors"
 License: GPL-2+
@@ -226,9 +226,8 @@ Files:
  icons/aol.svg
  icons/livejournal.svg
  icons/verisign.svg
- underlays/openid-selector/ikiwiki/openid/aol.png
- underlays/openid-selector/ikiwiki/openid/livejournal.png
- underlays/openid-selector/ikiwiki/openid/verisign.png
+ underlays/openid-selector/ikiwiki/login-selector/aol.png
+ underlays/openid-selector/ikiwiki/login-selector/verisign.png
 Copyright:
  © 2014 Simon McVittie
 License: other
index 8392884ebc6c62d9d58a5819f35c1efaadeb9be8..b4aa60c785c10bdffc4865b53ae67cecc70bf243 100644 (file)
@@ -10,7 +10,7 @@ It currently includes these pages:
 * [[templates]]
 * [[ikiwiki/formatting]]
 * [[ikiwiki/markdown]]
-* [[ikiwiki/openid]]
+* [[ikiwiki/login-selector]]
 * [[ikiwiki/pagespec]]
 * [[ikiwiki/directive]]
 * [[ikiwiki/subpage]]
index 80372fcb7742ff17d87ce969d40bb31e7c0f8d36..525b4f8fca6c3cbf79ecadcf097597d4f5dd0027 100644 (file)
@@ -92,7 +92,7 @@ Here is a full list of the template files used:
 * `editpage.tmpl`, `editconflict.tmpl`, `editcreationconflict.tmpl`,
   `editfailedsave.tmpl`, `editpagegone.tmpl`, `pocreatepage.tmpl`,
   `editcomment.tmpl` `commentmoderation.tmpl`, `renamesummary.tmpl`,
-  `passwordmail.tmpl`, `openid-selector.tmpl`, `revert.tmpl` - Parts of ikiwiki's user
+  `passwordmail.tmpl`, `login-selector.tmpl`, `revert.tmpl` - Parts of ikiwiki's user
   interface; do not normally need to be customised.
 
 
diff --git a/templates/login-selector.tmpl b/templates/login-selector.tmpl
new file mode 100644 (file)
index 0000000..e3a91fe
--- /dev/null
@@ -0,0 +1,62 @@
+<script type="text/javascript" src="ikiwiki/jquery.min.js"></script>
+<script type="text/javascript" src="ikiwiki/login-selector/login-selector.js"></script>
+<script type="text/javascript">
+$(document).ready(function() {
+       selector.init(
+               'openid_identifier',
+               {
+                       <TMPL_IF LOGIN_SELECTOR_OPENID>'openid': 1,</TMPL_IF>
+                       <TMPL_IF LOGIN_SELECTOR_EMAIL>'email': 1,</TMPL_IF>
+               },
+               '<TMPL_IF OTHERFORM>otherform</TMPL_IF>',
+               '<TMPL_VAR OTHERFORM_LABEL>'
+       );
+});
+</script>
+
+<form action="<TMPL_VAR CGIURL>" method="get" id="login_selector_form">
+       <div>
+               <script>
+               $('fieldset').append("<legend>Select login method</legend>");
+               </script>
+               
+               <input type="hidden" name="do" value="signin" />
+               <input type="hidden" name="action" value="verify" />
+               <div id="login_choice">
+                       <div id="login_btns"></div>
+               </div>
+
+               <div id="login_input_area">
+               <div>
+               <h3>OpenId login:</h3>
+               <TMPL_IF LOGIN_SELECTOR_OPENID>
+                       <label for="openid_identifier" class="block">Enter your OpenID:</label>
+                       <input id="openid_identifier" name="openid_identifier" type="text" value="<TMPL_VAR ESCAPE=HTML OPENID_URL>"/>
+                       <input id="openid_submit" type="submit" value="Login"/>
+               </TMPL_IF>
+               </div>
+               <div>
+               <h3>Email login:</h3>
+               <TMPL_IF LOGIN_SELECTOR_EMAIL>
+                       <label for="email_address" class="block">Enter your email address:</label>
+                       <input id="email_address" name="Email_entry" type="text" value="<TMPL_VAR ESCAPE=HTML EMAIL_ADDRESS>"/>
+                       <input id="email_submit" type="submit" value="Login"/>
+               </TMPL_IF>
+               </div>
+               </div>
+
+               <TMPL_IF LOGIN_ERROR>
+               <div class="error"><TMPL_VAR LOGIN_ERROR></div>
+               </TMPL_IF>
+       </div>
+</form>
+
+<div id="otherform">
+<TMPL_IF OTHERFORM>
+<br />
+<noscript>
+<h3><TMPL_VAR OTHERFORM_LABEL> login:</h3>
+</noscript>
+</TMPL_IF>
+<TMPL_VAR OTHERFORM>
+</div>
diff --git a/templates/openid-selector.tmpl b/templates/openid-selector.tmpl
deleted file mode 100644 (file)
index a055203..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<script type="text/javascript" src="ikiwiki/jquery.min.js"></script>
-<script type="text/javascript" src="ikiwiki/openid/openid-jquery.js"></script>
-<script type="text/javascript">
-$(document).ready(function() {
-       selector.init(
-               'openid_identifier',
-               {
-                       <TMPL_IF LOGIN_SELECTOR_OPENID>'openid': 1,</TMPL_IF>
-                       <TMPL_IF LOGIN_SELECTOR_EMAIL>'email': 1,</TMPL_IF>
-               },
-               '<TMPL_IF OTHERFORM>otherform</TMPL_IF>',
-               '<TMPL_VAR OTHERFORM_LABEL>'
-       );
-});
-</script>
-
-<form action="<TMPL_VAR CGIURL>" method="get" id="login_selector_form">
-       <div>
-               <script>
-               $('fieldset').append("<legend>Select login method</legend>");
-               </script>
-               
-               <input type="hidden" name="do" value="signin" />
-               <input type="hidden" name="action" value="verify" />
-               <div id="login_choice">
-                       <div id="login_btns"></div>
-               </div>
-
-               <div id="login_input_area">
-               <div>
-               <h3>OpenId login:</h3>
-               <TMPL_IF LOGIN_SELECTOR_OPENID>
-                       <label for="openid_identifier" class="block">Enter your OpenID:</label>
-                       <input id="openid_identifier" name="openid_identifier" type="text" value="<TMPL_VAR ESCAPE=HTML OPENID_URL>"/>
-                       <input id="openid_submit" type="submit" value="Login"/>
-               </TMPL_IF>
-               </div>
-               <div>
-               <h3>Email login:</h3>
-               <TMPL_IF LOGIN_SELECTOR_EMAIL>
-                       <label for="email_address" class="block">Enter your email address:</label>
-                       <input id="email_address" name="Email_entry" type="text" value="<TMPL_VAR ESCAPE=HTML EMAIL_ADDRESS>"/>
-                       <input id="email_submit" type="submit" value="Login"/>
-               </TMPL_IF>
-               </div>
-               </div>
-
-               <TMPL_IF LOGIN_ERROR>
-               <div class="error"><TMPL_VAR LOGIN_ERROR></div>
-               </TMPL_IF>
-       </div>
-</form>
-
-<div id="otherform">
-<TMPL_IF OTHERFORM>
-<br />
-<noscript>
-<h3><TMPL_VAR OTHERFORM_LABEL> login:</h3>
-</noscript>
-</TMPL_IF>
-<TMPL_VAR OTHERFORM>
-</div>
diff --git a/underlays/login-selector/ikiwiki/login-selector/aol.png b/underlays/login-selector/ikiwiki/login-selector/aol.png
new file mode 100644 (file)
index 0000000..d47f5fa
Binary files /dev/null and b/underlays/login-selector/ikiwiki/login-selector/aol.png differ
diff --git a/underlays/login-selector/ikiwiki/login-selector/goa-account-flickr.png b/underlays/login-selector/ikiwiki/login-selector/goa-account-flickr.png
new file mode 100644 (file)
index 0000000..5321642
Binary files /dev/null and b/underlays/login-selector/ikiwiki/login-selector/goa-account-flickr.png differ
diff --git a/underlays/login-selector/ikiwiki/login-selector/goa-account-yahoo.png b/underlays/login-selector/ikiwiki/login-selector/goa-account-yahoo.png
new file mode 100644 (file)
index 0000000..51e1c11
Binary files /dev/null and b/underlays/login-selector/ikiwiki/login-selector/goa-account-yahoo.png differ
diff --git a/underlays/login-selector/ikiwiki/login-selector/login-selector.js b/underlays/login-selector/ikiwiki/login-selector/login-selector.js
new file mode 100644 (file)
index 0000000..71ae046
--- /dev/null
@@ -0,0 +1,264 @@
+/*
+Based on the Simple OpenID Plugin
+http://code.google.com/p/openid-selector/
+
+This code is licenced under the New BSD License.
+*/
+
+var selections_email_large = {
+    email: {
+        name: 'Email',
+       icon: 'wikiicons/email.png',
+        label: 'Enter your email address:',
+        url: null
+    }
+};
+var selections_openid_large = {
+    openid: {
+        name: 'OpenID',
+       icon: 'wikiicons/openidlogin-bg.gif',
+        label: 'Enter your OpenID:',
+        url: null
+    }
+};
+var selections_openid_small = {
+    verisign: {
+        name: 'Verisign',
+        icon: 'ikiwiki/login-selector/verisign.png',
+        label: 'Enter your Verisign username:',
+        url: 'http://{username}.pip.verisignlabs.com/'
+    },
+    yahoo: {
+        name: 'Yahoo',
+        icon: 'ikiwiki/login-selector/goa-account-yahoo.png',
+        url: 'http://me.yahoo.com/'
+    },
+    flickr: {
+       name: 'Flickr',        
+       icon: 'ikiwiki/login-selector/goa-account-flickr.png',
+       label: 'Enter your Flickr username:',
+       url: 'http://flickr.com/photos/{username}/'
+    },
+    wordpress: {
+        name: 'Wordpress',
+       icon: 'ikiwiki/login-selector/wordpress.png',
+        label: 'Enter your Wordpress.com username:',
+        url: 'http://{username}.wordpress.com/'
+    },
+    aol: {
+        name: 'AOL',     
+        icon: 'ikiwiki/login-selector/aol.png',
+        label: 'Enter your AOL username:',
+        url: 'http://openid.aol.com/{username}'
+    }
+};
+var selections = $.extend({}, selections_email_large, selections_openid_large, selections_openid_small);
+
+var selector = {
+
+       ajaxHandler: null,
+       cookie_expires: 6*30,   // 6 months.
+       cookie_name: 'openid_selection', // historical name
+       cookie_path: '/',
+       
+       img_path: 'images/',
+       
+       input_id: null,
+       selection_url: null,
+       selection_id: null,
+       othersignin_id: null,
+       
+    init: function(input_id, login_methods, othersignin_id, othersignin_label) {
+        
+        var selector_btns = $('#login_btns');
+        
+        this.input_id = input_id;
+        
+        $('#login_choice').show();
+        $('#login_input_area').empty();
+        
+        // add box for each selection
+       if (login_methods['openid']) {
+               for (id in selections_openid_large) {
+                       selector_btns.append(this.getBoxHTML(selections_openid_large[id], 'large'));
+               }
+       }
+       if (login_methods['email']) {
+               for (id in selections_email_large) {
+                       selector_btns.prepend(this.getBoxHTML(selections_email_large[id], 'large'));
+               }
+       }
+
+       if (othersignin_label != "") {
+               this.othersignin_label=othersignin_label;
+       }
+       else {
+               this.othersignin_label="other";
+       }
+       if (othersignin_id != "") {
+               this.othersignin_id=othersignin_id;
+               selector_btns.prepend(
+                       '<a href="javascript: selector.signin(\'othersignin\');"' +
+                       ' style="background: #FFF" ' +
+                       'class="othersignin login_large_btn">' +
+                       '<img alt="" width="16" height="16" src="favicon.ico" />' +
+                       ' ' + this.othersignin_label +
+                       '</a>'
+               );
+               $('#'+this.othersignin_id).hide();
+       }
+
+        if (login_methods['openid'] && selections_openid_small) {
+               selector_btns.append('<br/>');
+               
+               for (id in selections_openid_small) {
+                       selector_btns.append(this.getBoxHTML(selections_openid_small[id], 'small'));
+               }
+        }
+        
+        $('#login_selector_form').submit(this.submit);
+        
+        var box_id = this.readCookie();
+        if (box_id) {
+               this.signin(box_id, true);
+        }
+    },
+    getBoxHTML: function(selection, box_size) {
+       var label="";
+       var title=""
+       if (box_size == 'large') {
+               label=' ' + selection["name"];
+       }
+       else {
+               title=' title="'+selection["name"]+'"';
+       }
+        var box_id = selection["name"].toLowerCase();
+        return '<a' + title +' href="javascript: selector.signin(\''+ box_id +'\');"' +
+                       ' style="background: #FFF" ' + 
+                       'class="' + box_id + ' login_' + box_size + '_btn">' +
+                       '<img alt="" width="16" height="16" src="' + selection["icon"] + '" />' +
+                       label +
+                       '</a>';
+    
+    },
+    /* selection image click */
+    signin: function(box_id, onload) {
+
+       if (box_id == 'othersignin') {
+               this.highlight(box_id);
+               $('#login_input_area').empty();
+               $('#'+this.othersignin_id).show();
+               this.setCookie(box_id);
+               return;
+       }
+       else {
+               if (this.othersignin_id) {
+                       $('#'+this.othersignin_id).hide();
+               }
+       }
+
+       var selection = selections[box_id];
+               if (! selection) {
+                       return;
+               }
+               
+               this.highlight(box_id);
+               
+               this.selection_id = box_id;
+               this.selection_url = selection['url'];
+               
+               // prompt user for input?
+               if (selection['label']) {
+                       this.setCookie(box_id);
+                       this.useInputBox(selection);
+               } else {
+                       this.setCookie('');
+                       $('#login_input_area').empty();
+                       if (! onload) {
+                               $('#login_selector_form').submit();
+                       }
+               }
+    },
+    /* Sign-in button click */
+    submit: function() {
+       var url = selector.selection_url; 
+       if (url) {
+               url = url.replace('{username}', $('#entry').val());
+               selector.setOpenIdUrl(url);
+       }
+       else {
+               selector.setOpenIdUrl("");
+       }
+       if (selector.ajaxHandler) {
+               selector.ajaxHandler(selector.selection_id, document.getElementById(selector.input_id).value);
+               return false;
+       }
+       return true;
+    },
+    setOpenIdUrl: function (url) {
+    
+       var hidden = $('#'+this.input_id);
+       if (hidden.length > 0) {
+               hidden.value = url;
+       } else {
+               $('#login_selector_form').append('<input style="display:none" id="' + this.input_id + '" name="' + this.input_id + '" value="'+url+'"/>');
+       }
+    },
+    highlight: function (box_id) {
+       
+       // remove previous highlight.
+       var highlight = $('#login_highlight');
+       if (highlight) {
+               highlight.replaceWith($('#login_highlight a')[0]);
+       }
+       // add new highlight.
+       $('.'+box_id).wrap('<div id="login_highlight"></div>');
+    },
+    setCookie: function (value) {
+    
+               var date = new Date();
+               date.setTime(date.getTime()+(this.cookie_expires*24*60*60*1000));
+               var expires = "; expires="+date.toGMTString();
+               
+               document.cookie = this.cookie_name+"="+value+expires+"; path=" + this.cookie_path;
+    },
+    readCookie: function () {
+               var nameEQ = this.cookie_name + "=";
+               var ca = document.cookie.split(';');
+               for(var i=0;i < ca.length;i++) {
+                       var c = ca[i];
+                       while (c.charAt(0)==' ') c = c.substring(1,c.length);
+                       if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
+               }
+               return null;
+    },
+    useInputBox: function (selection) {
+       
+               var input_area = $('#login_input_area');
+               
+               var html = '';
+               var id = selection['name']+'_entry';
+               var value = '';
+               var label = selection['label'];
+               var style = '';
+               
+               if (selection['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 = '<label for="'+ id +'" class="block">' + label + '</label>';
+               }
+               html += '<input id="'+id+'" type="text" style="'+style+'" name="'+id+'" value="'+value+'" />' + 
+                                       '<input id="selector_submit" type="submit" value="Login"/>';
+               
+               input_area.empty();
+               input_area.append(html);
+
+               $('#'+id).focus();
+    },
+    setAjaxHandler: function (ajaxFunction) {
+       this.ajaxHandler = ajaxFunction;
+    }
+};
diff --git a/underlays/login-selector/ikiwiki/login-selector/verisign.png b/underlays/login-selector/ikiwiki/login-selector/verisign.png
new file mode 100644 (file)
index 0000000..5120812
Binary files /dev/null and b/underlays/login-selector/ikiwiki/login-selector/verisign.png differ
diff --git a/underlays/login-selector/ikiwiki/login-selector/wordpress.png b/underlays/login-selector/ikiwiki/login-selector/wordpress.png
new file mode 100644 (file)
index 0000000..96e08bd
Binary files /dev/null and b/underlays/login-selector/ikiwiki/login-selector/wordpress.png differ
diff --git a/underlays/openid-selector/ikiwiki/openid/aol.png b/underlays/openid-selector/ikiwiki/openid/aol.png
deleted file mode 100644 (file)
index d47f5fa..0000000
Binary files a/underlays/openid-selector/ikiwiki/openid/aol.png and /dev/null differ
diff --git a/underlays/openid-selector/ikiwiki/openid/goa-account-flickr.png b/underlays/openid-selector/ikiwiki/openid/goa-account-flickr.png
deleted file mode 100644 (file)
index 5321642..0000000
Binary files a/underlays/openid-selector/ikiwiki/openid/goa-account-flickr.png and /dev/null differ
diff --git a/underlays/openid-selector/ikiwiki/openid/goa-account-yahoo.png b/underlays/openid-selector/ikiwiki/openid/goa-account-yahoo.png
deleted file mode 100644 (file)
index 51e1c11..0000000
Binary files a/underlays/openid-selector/ikiwiki/openid/goa-account-yahoo.png and /dev/null differ
diff --git a/underlays/openid-selector/ikiwiki/openid/livejournal.png b/underlays/openid-selector/ikiwiki/openid/livejournal.png
deleted file mode 100644 (file)
index d86ee5e..0000000
Binary files a/underlays/openid-selector/ikiwiki/openid/livejournal.png and /dev/null differ
diff --git a/underlays/openid-selector/ikiwiki/openid/openid-jquery.js b/underlays/openid-selector/ikiwiki/openid/openid-jquery.js
deleted file mode 100644 (file)
index eaac503..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
-Based on the Simple OpenID Plugin
-http://code.google.com/p/openid-selector/
-
-This code is licenced under the New BSD License.
-*/
-
-var selections_email_large = {
-    email: {
-        name: 'Email',
-       icon: 'wikiicons/email.png',
-        label: 'Enter your email address:',
-        url: null
-    }
-};
-var selections_openid_large = {
-    openid: {
-        name: 'OpenID',
-       icon: 'wikiicons/openidlogin-bg.gif',
-        label: 'Enter your OpenID:',
-        url: null
-    }
-};
-var selections_openid_small = {
-    verisign: {
-        name: 'Verisign',
-        icon: 'ikiwiki/openid/verisign.png',
-        label: 'Enter your Verisign username:',
-        url: 'http://{username}.pip.verisignlabs.com/'
-    },
-    yahoo: {
-        name: 'Yahoo',
-        icon: 'ikiwiki/openid/goa-account-yahoo.png',
-        url: 'http://me.yahoo.com/'
-    },
-    flickr: {
-       name: 'Flickr',        
-       icon: 'ikiwiki/openid/goa-account-flickr.png',
-       label: 'Enter your Flickr username:',
-       url: 'http://flickr.com/photos/{username}/'
-    },
-    wordpress: {
-        name: 'Wordpress',
-       icon: 'ikiwiki/openid/wordpress.png',
-        label: 'Enter your Wordpress.com username:',
-        url: 'http://{username}.wordpress.com/'
-    },
-    aol: {
-        name: 'AOL',     
-        icon: 'ikiwiki/openid/aol.png',
-        label: 'Enter your AOL username:',
-        url: 'http://openid.aol.com/{username}'
-    }
-};
-var selections = $.extend({}, selections_email_large, selections_openid_large, selections_openid_small);
-
-var selector = {
-
-       ajaxHandler: null,
-       cookie_expires: 6*30,   // 6 months.
-       cookie_name: 'openid_selection', // historical name
-       cookie_path: '/',
-       
-       img_path: 'images/',
-       
-       input_id: null,
-       selection_url: null,
-       selection_id: null,
-       othersignin_id: null,
-       
-    init: function(input_id, login_methods, othersignin_id, othersignin_label) {
-        
-        var selector_btns = $('#login_btns');
-        
-        this.input_id = input_id;
-        
-        $('#login_choice').show();
-        $('#login_input_area').empty();
-        
-        // add box for each selection
-       if (login_methods['openid']) {
-               for (id in selections_openid_large) {
-                       selector_btns.append(this.getBoxHTML(selections_openid_large[id], 'large'));
-               }
-       }
-       if (login_methods['email']) {
-               for (id in selections_email_large) {
-                       selector_btns.prepend(this.getBoxHTML(selections_email_large[id], 'large'));
-               }
-       }
-
-       if (othersignin_label != "") {
-               this.othersignin_label=othersignin_label;
-       }
-       else {
-               this.othersignin_label="other";
-       }
-       if (othersignin_id != "") {
-               this.othersignin_id=othersignin_id;
-               selector_btns.prepend(
-                       '<a href="javascript: selector.signin(\'othersignin\');"' +
-                       ' style="background: #FFF" ' +
-                       'class="othersignin login_large_btn">' +
-                       '<img alt="" width="16" height="16" src="favicon.ico" />' +
-                       ' ' + this.othersignin_label +
-                       '</a>'
-               );
-               $('#'+this.othersignin_id).hide();
-       }
-
-        if (login_methods['openid'] && selections_openid_small) {
-               selector_btns.append('<br/>');
-               
-               for (id in selections_openid_small) {
-                       selector_btns.append(this.getBoxHTML(selections_openid_small[id], 'small'));
-               }
-        }
-        
-        $('#login_selector_form').submit(this.submit);
-        
-        var box_id = this.readCookie();
-        if (box_id) {
-               this.signin(box_id, true);
-        }
-    },
-    getBoxHTML: function(selection, box_size) {
-       var label="";
-       var title=""
-       if (box_size == 'large') {
-               label=' ' + selection["name"];
-       }
-       else {
-               title=' title="'+selection["name"]+'"';
-       }
-        var box_id = selection["name"].toLowerCase();
-        return '<a' + title +' href="javascript: selector.signin(\''+ box_id +'\');"' +
-                       ' style="background: #FFF" ' + 
-                       'class="' + box_id + ' login_' + box_size + '_btn">' +
-                       '<img alt="" width="16" height="16" src="' + selection["icon"] + '" />' +
-                       label +
-                       '</a>';
-    
-    },
-    /* selection image click */
-    signin: function(box_id, onload) {
-
-       if (box_id == 'othersignin') {
-               this.highlight(box_id);
-               $('#login_input_area').empty();
-               $('#'+this.othersignin_id).show();
-               this.setCookie(box_id);
-               return;
-       }
-       else {
-               if (this.othersignin_id) {
-                       $('#'+this.othersignin_id).hide();
-               }
-       }
-
-       var selection = selections[box_id];
-               if (! selection) {
-                       return;
-               }
-               
-               this.highlight(box_id);
-               
-               this.selection_id = box_id;
-               this.selection_url = selection['url'];
-               
-               // prompt user for input?
-               if (selection['label']) {
-                       this.setCookie(box_id);
-                       this.useInputBox(selection);
-               } else {
-                       this.setCookie('');
-                       $('#login_input_area').empty();
-                       if (! onload) {
-                               $('#login_selector_form').submit();
-                       }
-               }
-    },
-    /* Sign-in button click */
-    submit: function() {
-       var url = selector.selection_url; 
-       if (url) {
-               url = url.replace('{username}', $('#entry').val());
-               selector.setOpenIdUrl(url);
-       }
-       else {
-               selector.setOpenIdUrl("");
-       }
-       if (selector.ajaxHandler) {
-               selector.ajaxHandler(selector.selection_id, document.getElementById(selector.input_id).value);
-               return false;
-       }
-       return true;
-    },
-    setOpenIdUrl: function (url) {
-    
-       var hidden = $('#'+this.input_id);
-       if (hidden.length > 0) {
-               hidden.value = url;
-       } else {
-               $('#login_selector_form').append('<input style="display:none" id="' + this.input_id + '" name="' + this.input_id + '" value="'+url+'"/>');
-       }
-    },
-    highlight: function (box_id) {
-       
-       // remove previous highlight.
-       var highlight = $('#login_highlight');
-       if (highlight) {
-               highlight.replaceWith($('#login_highlight a')[0]);
-       }
-       // add new highlight.
-       $('.'+box_id).wrap('<div id="login_highlight"></div>');
-    },
-    setCookie: function (value) {
-    
-               var date = new Date();
-               date.setTime(date.getTime()+(this.cookie_expires*24*60*60*1000));
-               var expires = "; expires="+date.toGMTString();
-               
-               document.cookie = this.cookie_name+"="+value+expires+"; path=" + this.cookie_path;
-    },
-    readCookie: function () {
-               var nameEQ = this.cookie_name + "=";
-               var ca = document.cookie.split(';');
-               for(var i=0;i < ca.length;i++) {
-                       var c = ca[i];
-                       while (c.charAt(0)==' ') c = c.substring(1,c.length);
-                       if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
-               }
-               return null;
-    },
-    useInputBox: function (selection) {
-       
-               var input_area = $('#login_input_area');
-               
-               var html = '';
-               var id = selection['name']+'_entry';
-               var value = '';
-               var label = selection['label'];
-               var style = '';
-               
-               if (selection['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 = '<label for="'+ id +'" class="block">' + label + '</label>';
-               }
-               html += '<input id="'+id+'" type="text" style="'+style+'" name="'+id+'" value="'+value+'" />' + 
-                                       '<input id="selector_submit" type="submit" value="Login"/>';
-               
-               input_area.empty();
-               input_area.append(html);
-
-               $('#'+id).focus();
-    },
-    setAjaxHandler: function (ajaxFunction) {
-       this.ajaxHandler = ajaxFunction;
-    }
-};
diff --git a/underlays/openid-selector/ikiwiki/openid/verisign.png b/underlays/openid-selector/ikiwiki/openid/verisign.png
deleted file mode 100644 (file)
index 5120812..0000000
Binary files a/underlays/openid-selector/ikiwiki/openid/verisign.png and /dev/null differ
diff --git a/underlays/openid-selector/ikiwiki/openid/wordpress.png b/underlays/openid-selector/ikiwiki/openid/wordpress.png
deleted file mode 100644 (file)
index 96e08bd..0000000
Binary files a/underlays/openid-selector/ikiwiki/openid/wordpress.png and /dev/null differ