Permalink
Browse files

Upgrade browserid plugin 0.45 -> 0.48

  • Loading branch information...
1 parent cc4e59f commit 1bbe181b10db0ea687844309737deef5503b51f9 @craigcook craigcook committed Sep 19, 2013
Showing with 2,900 additions and 1,159 deletions.
  1. +8 −7 plugins/browserid/README.md
  2. +89 −0 plugins/browserid/browserid-settings.js
  3. +3 −0 plugins/browserid/browserid-settings.min.js
  4. +13 −7 plugins/browserid/browserid.css
  5. +5 −2 plugins/browserid/browserid.js
  6. +1 −0 plugins/browserid/browserid.min.css
  7. +1 −0 plugins/browserid/browserid.min.js
  8. +253 −1,118 plugins/browserid/browserid.php
  9. +89 −0 plugins/browserid/changelog
  10. +239 −0 plugins/browserid/languages/browserid-ja_JP.po
  11. BIN plugins/browserid/languages/browserid-nl_NL.mo
  12. +43 −0 plugins/browserid/lib/browserid-activation.php
  13. +109 −0 plugins/browserid/lib/browserid-admin.php
  14. +82 −0 plugins/browserid/lib/browserid-assertion-handler.php
  15. +60 −0 plugins/browserid/lib/browserid-bbpress.php
  16. +126 −0 plugins/browserid/lib/browserid-comments.php
  17. +34 −0 plugins/browserid/lib/browserid-constants.php
  18. +218 −0 plugins/browserid/lib/browserid-login.php
  19. +81 −0 plugins/browserid/lib/browserid-lostpassword.php
  20. +958 −0 plugins/browserid/lib/browserid-options.php
  21. +164 −0 plugins/browserid/lib/browserid-registration.php
  22. +45 −0 plugins/browserid/lib/browserid-shortcode.php
  23. +134 −0 plugins/browserid/lib/browserid-verifier.php
  24. +77 −0 plugins/browserid/lib/browserid-widget.php
  25. +68 −25 plugins/browserid/readme.txt
  26. BIN plugins/browserid/screenshot-1.png
  27. BIN plugins/browserid/screenshot-2.png
  28. BIN plugins/browserid/screenshot-3.png
  29. BIN plugins/browserid/screenshot-4.png
  30. BIN plugins/browserid/screenshot-5.png
@@ -44,13 +44,14 @@ Please report any issues on the plugin's [issue tracker](https://github.com/shan
## Acknowledgments
-[Marcel Bokhorst](http://blog.bokhorst.biz/) is the original author of this plugin. His awesome work has allowed me to continue.
-[Guillermo Movia](mailto://deimidis@mozilla-hispano.org) for Spanish translations.
-[Ruslan Bekenev - @KryDos](https://github.com/KryDos) for Russian translations, bug fixes, and continued support.
-[Fabian Rodriguez - @MagicFab](https://github.com/MagicFab) for French and Canadian French translations as well as man bug reports.
-[Edwin Wong @edmoz](http://www.edwinsf.com/blog/) for continued testing.
-[@janw-oostendorp](https://github.com/janw-oostendorp) for updated Dutch translations.
-[David Murdoch @davidmurdoch](https://github.com/davidmurdoch/) fixing jQuery 1.9+ compatability
+* [Marcel Bokhorst](http://blog.bokhorst.biz/) is the original author of this plugin. His awesome work has allowed me to continue.
+* [Guillermo Movia](mailto://deimidis@mozilla-hispano.org) for Spanish translations.
+* [Ruslan Bekenev - @KryDos](https://github.com/KryDos) for Russian translations, bug fixes, and continued support.
+* [Fabian Rodriguez - @MagicFab](https://github.com/MagicFab) for French and Canadian French translations as well as man bug reports.
+* [Edwin Wong @edmoz](http://www.edwinsf.com/blog/) for continued testing.
+* [@janw-oostendorp](https://github.com/janw-oostendorp) for updated Dutch translations and backgroundColor color picker.
+* [David Murdoch @davidmurdoch](https://github.com/davidmurdoch/) fixing jQuery 1.9+ compatability
+* [Makoto Kato @makotokato](https://github.com/makotokato) for Japanese translations.
This plugin uses:
@@ -0,0 +1,89 @@
+/*jshint browser: true*/
+/*global jQuery, wp*/
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+(function() {
+ "use strict";
+ var $ = jQuery;
+
+ // add color picker to the background setting
+ $('.js-persona__color-picker').wpColorPicker();
+
+ // Add a filepicker where it is needed
+ var mediaUploaderFrames = {};
+ $('.js-persona__file-picker').click(function(event) {
+ event.preventDefault();
+
+ var target = $(event.target);
+ var id = target.attr('for');
+ var mediaUploaderFrame = mediaUploaderFrames[id];
+ if (mediaUploaderFrame) {
+ return mediaUploaderFrame.open();
+ }
+
+ var mediaUploaderConfig = {
+ className: 'media-frame js-persona__media-frame',
+ frame: 'select',
+ multiple: false,
+ title: target.attr('data-title') || '',
+ input: $('#' + target.attr('for'))
+ };
+
+ var mediaType = target.attr('data-type');
+ if (mediaType) {
+ mediaUploaderConfig.library = {
+ type: mediaType
+ };
+ }
+
+ mediaUploaderFrame = mediaUploaderFrames[id] =
+ wp.media(mediaUploaderConfig);
+
+ mediaUploaderFrame.on('select', function() {
+ var attachment =
+ mediaUploaderFrame.state().get('selection').first().toJSON();
+
+ var url = attachment.url;
+ if (mediaType === "image")
+ url = getBase64ImageIfHttpSite(url);
+
+ mediaUploaderConfig.input.val(url);
+ });
+
+ mediaUploaderFrame.open();
+ });
+
+ function getBase64ImageIfHttpSite(imgURL) {
+ // based on
+ // http://stackoverflow.com/questions/5420384/convert-an-image-into-binary-data-in-javascript
+ // Create an empty canvas element
+ if (document.location.protocol === "https://") return imgURL;
+
+ var canvas = document.createElement("canvas");
+ // if canvas could not be created, abort.
+ if (!canvas) return imgURL;
+
+ var img = document.createElement("img");
+ img.src = imgURL;
+ document.body.appendChild(img);
+
+
+ canvas.width = img.width;
+ canvas.height = img.height;
+
+ // Copy the image contents to the canvas
+ var ctx = canvas.getContext("2d");
+ ctx.drawImage(img, 0, 0);
+
+ // Get the data-URL formatted image
+ // Firefox supports PNG and JPEG. You could check img.src to guess the
+ // original format, but be aware the using "image/jpg" will re-encode the image.
+ var dataURL = canvas.toDataURL("image/png");
+
+ document.body.removeChild(img);
+
+ return dataURL;
+ }
+}());
+
Oops, something went wrong.
@@ -281,13 +281,16 @@ input[type=radio].persona-button--select-color-radio {
display: inline-block;
}
-/**
- * Admin screen.
- *
- * Do not display the ugly password nag in persona only auth
- */
-.persona--persona-only-auth .default-password-nag {
- display: none;
+.persona__warning {
+ padding: 12px;
+ background-color: #ffebe8;
+ color: #333;
+ border: 1px solid #cc0000;
+ font-size: 12px;
+}
+
+.persona__warning-heading {
+ display: inline-block;
}
/**
@@ -397,4 +400,7 @@ input[type=radio].persona-button--select-color-radio {
}
+.persona__widget-button-container {
+ list-style-type: none;
+}
@@ -26,6 +26,8 @@
// effect if the user types "enter" into one of the commentor info fields.
var enableCommentSubmit = browserid_common.loggedInUser || false;
+ var state;
+
$(".js-persona__login").click(function(event) {
event.preventDefault();
@@ -118,7 +120,7 @@
// load the state into the form to reduce flicker. The form data may not be
// needed, but load it anyways.
- var state = loadCommentState();
+ state = loadCommentState();
// If there is no state, the other window has already submitted the comment.
// navigator.id.logout has already been called and no assertion will be
@@ -141,7 +143,7 @@
// load the state into the form to reduce flicker. The form data may not be
// needed, but load it anyways.
- var state = loadRegistrationState();
+ state = loadRegistrationState();
// If there is no state, the other window has already submitted the registration.
// Wait for the signal from the other window which causes a refresh. When
@@ -274,6 +276,7 @@
rememberme: rememberme
};
+ // XXX is this necessary? Won't it be fetched from options?
if (browserid_common.urlLoginRedirect !== null)
fields.redirect_to = browserid_common.urlLoginRedirect;
Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 1bbe181

Please sign in to comment.