diff --git a/client/components/modal/index.jsx b/client/components/modal/index.jsx index 238676c..f5debf2 100644 --- a/client/components/modal/index.jsx +++ b/client/components/modal/index.jsx @@ -3,8 +3,6 @@ var React = require( 'react' ), classNames = require( 'classnames' ), assign = require( 'lodash/object/assign' ); -var focusTrap = require('focus-trap'); - // this flag will prevent ANY modals from closing. // use with caution! // e.g. Modal.preventClose(); @@ -48,24 +46,11 @@ let Modal = React.createClass( { componentDidMount: function() { jQuery( 'body' ).addClass( 'dops-modal-showing' ); jQuery( document ).keyup( this.handleEscapeKey ); - try { - focusTrap.activate(this.getDOMNode(), { - // onDeactivate: this.maybeClose, - initialFocus: this.props.initialFocus, - }); - } catch( e ) { - //noop - } }, componentWillUnmount: function() { jQuery( 'body' ).removeClass( 'dops-modal-showing' ); jQuery( document ).unbind( 'keyup', this.handleEscapeKey ); - try { - focusTrap.deactivate(); - } catch( e ) { - //noop - } }, handleEscapeKey: function( e ) { diff --git a/client/components/notice/style.scss b/client/components/notice/style.scss index 7da33fd..76fb6eb 100644 --- a/client/components/notice/style.scss +++ b/client/components/notice/style.scss @@ -11,10 +11,13 @@ border-radius: 1px; background: $gray-light; box-sizing: border-box; - font-size: 14px; line-height: 1.4285; animation: appear .3s ease-in-out; + @include breakpoint( "<660px" ) { + font-size: 14px; + } + .notice__text { flex-grow: 1; flex-basis: 100px; @@ -27,19 +30,15 @@ } } - @include breakpoint( ">660px" ) { - font-size: inherit; - - &::before { - @extend %noticon; - content: '\f456'; - position: absolute; - top: 26px; - left: 20px; - margin: -12px 0px 0 -8px; - font-size: 24px; - line-height: 1; - } + &::before { + @extend %noticon; + content: '\f456'; + position: absolute; + top: 26px; + left: 20px; + margin: -12px 0px 0 -8px; + font-size: 24px; + line-height: 1; } .notice__dismiss:focus { diff --git a/client/components/password-box/style.scss b/client/components/password-box/style.scss index 3e89113..ba67d9f 100644 --- a/client/components/password-box/style.scss +++ b/client/components/password-box/style.scss @@ -1,4 +1,5 @@ @import "../../scss/calypso-colors"; +@import '../../scss/extends'; @import '../../scss/akismet-colors'; @import '../../scss/calypso-form'; diff --git a/client/components/payment/new-card-form.jsx b/client/components/payment/new-card-form.jsx index 0a3c25b..64f01ca 100644 --- a/client/components/payment/new-card-form.jsx +++ b/client/components/payment/new-card-form.jsx @@ -87,7 +87,7 @@ module.exports = React.createClass( { name="expiration-date" className="expiration-date" formatter="cardExpiry" - label={this.translate( 'MM/YY' )} + label={this.translate( 'MM/YYYY' )} floatingLabel required /> diff --git a/client/lib/paygate-loader/index.js b/client/lib/paygate-loader/index.js index f6f1411..ef6cd21 100644 --- a/client/lib/paygate-loader/index.js +++ b/client/lib/paygate-loader/index.js @@ -7,31 +7,35 @@ var debug = require( 'debug' )( 'calypso:paygate' ); * Internal dependencies */ var loadScript = require( 'load-script' ), - config = require( 'config' ); + config = require( 'config' ), + paygateUrl = false; -var PAYGATE_URL = 'https://pay-js.automattic.com/v1/paygate.js'; /** * PaygateLoader component * * @api public */ -function PaygateLoader() { - var isDevelopment, isSandboxed; +function PaygateLoader( settings ) { if ( ! ( this instanceof PaygateLoader ) ) { - return new PaygateLoader(); + return new PaygateLoader( settings ); } + debug( 'paygate config settings: ' + settings ); - isDevelopment = 'development' === config( 'env' ); - isSandboxed = document.cookie.indexOf( 'store_sandbox=' ) !== -1; + paygateUrl = settings.jsUrl; + this._publicKey = settings.publicKey; + this._processor = settings.processor; + this._apiUrl = settings.apiUrl; + this._environment = settings.environment; - if ( isDevelopment || isSandboxed ) { + //sandbox paygate request if in development or if store_sandbox cookie is set + if ( 'development' === config( 'env' ) || + document.cookie.indexOf( 'store_sandbox=' ) !== -1 + ) { this._environment = 'sandbox'; this._publicKey = config( 'paygate_keys' ).sandbox; - } else { - this._environment = 'production'; - this._publicKey = config( 'paygate_keys' ).production; } + debug( 'paygateLoader: ' + this ); } /** @@ -45,7 +49,7 @@ PaygateLoader.prototype.ready = function( callback ) { return callback( null, window.Paygate ); } - loadScript.loadjQueryDependentScript( PAYGATE_URL, function( error ) { + loadScript.loadjQueryDependentScript( paygateUrl, function( error ) { if ( error ) { callback( error ); return; @@ -54,6 +58,8 @@ PaygateLoader.prototype.ready = function( callback ) { debug( 'Paygate loaded for the first time' ); window.Paygate.setPublicKey( this._publicKey ); window.Paygate.setEnvironment( this._environment ); + window.Paygate.setProcessor( this._processor ); + window.Paygate.setApiUrl( this._apiUrl ); callback( null, window.Paygate ); }.bind( this ) ); }; @@ -61,4 +67,4 @@ PaygateLoader.prototype.ready = function( callback ) { /** * Expose `PaygateLoader` */ -module.exports = new PaygateLoader(); +module.exports = PaygateLoader;