Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions client/components/modal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 ) {
Expand Down
27 changes: 13 additions & 14 deletions client/components/notice/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions client/components/password-box/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../scss/calypso-colors";
@import '../../scss/extends';
@import '../../scss/akismet-colors';
@import '../../scss/calypso-form';

Expand Down
2 changes: 1 addition & 1 deletion client/components/payment/new-card-form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 />

Expand Down
32 changes: 19 additions & 13 deletions client/lib/paygate-loader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

/**
Expand All @@ -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;
Expand All @@ -54,11 +58,13 @@ 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 ) );
};

/**
* Expose `PaygateLoader`
*/
module.exports = new PaygateLoader();
module.exports = PaygateLoader;