2495 lines
74 KiB
XML
2495 lines
74 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<javascript app="nexus">
|
|
<file javascript_app="nexus" javascript_location="front" javascript_path="controllers/checkout" javascript_name="ips.checkout.billingForm.js" javascript_type="controller" javascript_version="103005" javascript_position="1000150"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.checkout.billingAddress.js
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.front.checkout.billingForm', {
|
|
|
|
initialize: function () {
|
|
this.on( 'click', '[data-action="changeShippingAddress"]', this.newShippingAddress );
|
|
//this.setup();
|
|
},
|
|
|
|
setup: function () {
|
|
|
|
},
|
|
|
|
newShippingAddress: function (e) {
|
|
e.preventDefault();
|
|
var url = this.scope.attr('data-new-billing-address-url');
|
|
|
|
var dialogRef = ips.ui.dialog.create({
|
|
title: ips.getString('changeShippingAddress'),
|
|
fixed: false,
|
|
url: url,
|
|
size: 'medium'
|
|
});
|
|
dialogRef.show();
|
|
},
|
|
|
|
updateSelectedAddress: function ( val, dialogUrl ) {
|
|
if ( val == 0 ) {
|
|
|
|
var dialogRef = ips.ui.dialog.create({
|
|
title: '',
|
|
fixed: false,
|
|
url: dialogUrl
|
|
});
|
|
dialogRef.show();
|
|
|
|
} else {
|
|
window.location = window.location + '&shipping_address=' + val;
|
|
}
|
|
}
|
|
|
|
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="front" javascript_path="controllers/checkout" javascript_name="ips.checkout.register.js" javascript_type="controller" javascript_version="103005" javascript_position="1000150">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.checkout.register.js - Register form during checkout
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.front.checkout.register', {
|
|
|
|
initialize: function () {
|
|
this.on( 'click', '[data-action="newMember"]', this.showRegistrationForm );
|
|
if ( $(this.scope).attr('data-regform') ) {
|
|
this._showRegistrationForm();
|
|
}
|
|
},
|
|
|
|
showRegistrationForm: function (e) {
|
|
e.preventDefault();
|
|
this._showRegistrationForm();
|
|
},
|
|
|
|
_showRegistrationForm: function() {
|
|
this.scope.find('[data-role="memberChoice"]').hide();
|
|
this.scope.find('[data-role="newCustomerForm"]').show();
|
|
}
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="front" javascript_path="controllers/checkout" javascript_name="ips.checkout.review.js" javascript_type="controller" javascript_version="103005" javascript_position="1000150">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.checkout.review.js - Review page in checkout process
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.front.checkout.review', {
|
|
|
|
initialize: function () {
|
|
this.on( 'submit', '[data-role="couponForm"]', this.submitCoupon );
|
|
this.setup();
|
|
},
|
|
|
|
setup: function () {
|
|
var button = this.scope.find('[data-role="couponForm"] button[type="submit"]');
|
|
var textbox = this.scope.find('[data-role="couponForm"] input[type="text"]');
|
|
|
|
button.prop('disabled', !textbox.val() );
|
|
textbox.on('keyup', function (e) {
|
|
if ( textbox.val() ) {
|
|
button.prop( 'disabled', false );
|
|
} else {
|
|
button.prop( 'disabled', true );
|
|
}
|
|
});
|
|
},
|
|
|
|
submitCoupon: function (e) {
|
|
e.preventDefault();
|
|
}
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="front" javascript_path="controllers/checkout" javascript_name="ips.checkout.shippingForm.js" javascript_type="controller" javascript_version="103005" javascript_position="1000150">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.checkout.shippingForm.js - Address book for shipping form
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.front.checkout.shippingForm', {
|
|
|
|
initialize: function () {
|
|
this.on( 'change', 'select', this.selectNew );
|
|
this.on( 'keypress', 'input[type="text"]', this.selectNew );
|
|
},
|
|
|
|
selectNew: function () {
|
|
this.scope.find('[name="shipping_address"][value="0"]').prop( 'checked', true );
|
|
}
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="front" javascript_path="controllers/clients" javascript_name="ips.clients.referrals.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.clients.referrals.js - Referrals section
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.front.clients.referrals', {
|
|
|
|
initialize: function () {
|
|
this.on( 'focus', 'input[type="text"]', this.focusText );
|
|
},
|
|
|
|
/**
|
|
* Focus in a txt field
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
focusText: function (e) {
|
|
e.preventDefault();
|
|
e.currentTarget.select();
|
|
}
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="global" javascript_path="controllers/gateways" javascript_name="ips.gateways.authorizenet.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.gateways.authorizenet.js - Authorize.Net DPM controller
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.global.gateways.authorizenet', {
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
initialize: function () {
|
|
this.on( $(this.scope).closest('form')[0], 'submit', this.submitForm );
|
|
this.setup();
|
|
},
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
setup: function(){
|
|
this.scope.show();
|
|
},
|
|
|
|
/**
|
|
* Submit form action
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
submitForm: function(e) {
|
|
if ( !$(e.currentTarget).find( 'input[name="payment_method"]' ).length || $(e.currentTarget).find( 'input[name="payment_method"][value="' + $(this.scope).attr('data-id') + '"]' ).is(':checked') ) {
|
|
|
|
e.stopPropagation();
|
|
|
|
var data = $.parseJSON( $(this.scope).attr('data-fields') );
|
|
var i;
|
|
for ( i in data )
|
|
{
|
|
$( e.currentTarget ).append( $('<input type="hidden">').attr( 'name', i ).attr( 'value', data[i] ) );
|
|
}
|
|
|
|
var expmonth = $(this.scope).find('[data-card="exp_month"]').val();
|
|
if ( expmonth && expmonth.length == 1 ) {
|
|
expmonth = '0' + expmonth;
|
|
}
|
|
$( e.currentTarget ).append( $('<input type="hidden">').attr( 'name', 'x_card_num' ).attr( 'value', $(this.scope).find('[data-card="number"]').val() ) );
|
|
$( e.currentTarget ).append( $('<input type="hidden">').attr( 'name', 'x_exp_date' ).attr( 'value', expmonth + '-' + $(this.scope).find('[data-card="exp_year"]').val() ) );
|
|
$( e.currentTarget ).append( $('<input type="hidden">').attr( 'name', 'x_card_code' ).attr( 'value', $(this.scope).find('[data-card="ccv"]').val() ) );
|
|
|
|
$( e.currentTarget ).attr( 'action', $(this.scope).attr('data-url') );
|
|
}
|
|
}
|
|
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="global" javascript_path="controllers/gateways" javascript_name="ips.gateways.stripe.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.gateways.stripe.js - Stripe controller
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.global.gateways.stripe', {
|
|
|
|
stripe: null,
|
|
cardNumber: null,
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
initialize: function () {
|
|
this.on( $(this.scope).closest('form')[0], 'submit', this.submitForm );
|
|
this.setup();
|
|
},
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
setup: function(){
|
|
|
|
this.stripe = Stripe( this.scope.attr('data-key') );
|
|
|
|
var elements = this.stripe.elements()
|
|
this.cardNumber = elements.create('cardNumber', {
|
|
'placeholder': '',
|
|
'style': {
|
|
'invalid': {
|
|
'color': 'inherit'
|
|
}
|
|
}
|
|
});
|
|
this.cardNumber.mount( '#elInput_' + $(this.scope).attr('data-id') + '-' + $(this.scope).attr('data-id') + '_card-number' );
|
|
this.cardNumber.addEventListener('change', function(event) {
|
|
if ( event.error ) {
|
|
this.scope.find('[data-role="dummyCard"]').addClass('ipsFieldRow_error');
|
|
this.scope.find('[data-warning="number"]').text( event.error.message );
|
|
} else {
|
|
this.scope.find('[data-role="dummyCard"]').removeClass('ipsFieldRow_error');
|
|
this.scope.find('[data-warning="number"]').text('');
|
|
}
|
|
|
|
if ( event.brand != 'unknown' ) {
|
|
this.scope.find('.cPayment').css( 'opacity', 0.3 );
|
|
switch ( event.brand ) {
|
|
case 'visa':
|
|
this.scope.find('.cPayment_visa').css( 'opacity', 1 );
|
|
break;
|
|
case 'mastercard':
|
|
this.scope.find('.cPayment_mastercard').parent().css( 'opacity', 1 );
|
|
break;
|
|
case 'amex':
|
|
this.scope.find('.cPayment_american_express').css( 'opacity', 1 );
|
|
break;
|
|
case 'discover':
|
|
this.scope.find('.cPayment_discover').css( 'opacity', 1 );
|
|
break;
|
|
case 'diners':
|
|
this.scope.find('.cPayment_diners_club').css( 'opacity', 1 );
|
|
break;
|
|
case 'jcb':
|
|
this.scope.find('.cPayment_jcb').css( 'opacity', 1 );
|
|
break;
|
|
}
|
|
} else {
|
|
this.scope.find('.cPayment').css( 'opacity', 1 );
|
|
}
|
|
}.bind(this) );
|
|
|
|
var cardExp = elements.create('cardExpiry', {
|
|
'style': {
|
|
'invalid': {
|
|
'color': 'inherit'
|
|
}
|
|
}
|
|
});
|
|
cardExp.mount( '#elInput_' + $(this.scope).attr('data-id') + '-' + $(this.scope).attr('data-id') + '_card-exp' );
|
|
cardExp.addEventListener('change', function(event) {
|
|
if ( event.error ) {
|
|
this.scope.find('[data-role="dummyExp"]').addClass('ipsFieldRow_error');
|
|
this.scope.find('[data-warning="exp"]').text( event.error.message );
|
|
} else {
|
|
this.scope.find('[data-role="dummyExp"]').removeClass('ipsFieldRow_error');
|
|
this.scope.find('[data-warning="exp"]').text('');
|
|
}
|
|
}.bind(this) );
|
|
|
|
var cardCvc = elements.create('cardCvc', {
|
|
'placeholder': '',
|
|
'style': {
|
|
'invalid': {
|
|
'color': 'inherit'
|
|
}
|
|
}
|
|
});
|
|
cardCvc.mount( '#elInput_' + $(this.scope).attr('data-id') + '-' + $(this.scope).attr('data-id') + '_card-ccv' );
|
|
cardCvc.addEventListener('change', function(event) {
|
|
if ( event.error ) {
|
|
this.scope.find('[data-role="dummyCcv"]').addClass('ipsFieldRow_error');
|
|
this.scope.find('[data-warning="ccv"]').text( event.error.message );
|
|
} else {
|
|
this.scope.find('[data-role="dummyCcv"]').removeClass('ipsFieldRow_error');
|
|
this.scope.find('[data-warning="ccv"]').text('');
|
|
}
|
|
}.bind(this) );
|
|
|
|
this.scope.show();
|
|
},
|
|
|
|
/**
|
|
* Submit form action
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
submitForm: function(e) {
|
|
|
|
var scope = $(this.scope);
|
|
|
|
if ( !$(e.currentTarget).find( 'input[type="radio"][name="payment_method"]' ).length || $(e.currentTarget).find( 'input[name="payment_method"][value="' + $(this.scope).attr('data-id') + '"]' ).is(':checked') ) {
|
|
|
|
/* Already submitted */
|
|
if ( $(e.currentTarget).find('input[name="'+$(this.scope).attr('data-id')+'_card[token]"]').length ) {
|
|
return;
|
|
}
|
|
|
|
/* If we're using a stored card, carry on */
|
|
if ( $(this.scope).find('input[name="'+$(this.scope).attr('data-id')+'_card[stored]"]:checked').val() > 0 ) {
|
|
return;
|
|
}
|
|
|
|
/* Stop the form from actually submitting */
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
|
|
/* Hide any previous errors */
|
|
scope.find('[data-warning]').text('');
|
|
|
|
/* Show the loading icon */
|
|
var loading = scope.closest('[data-ipswizard]').find('[data-role="loading"]');
|
|
var wizardContainer = scope.closest('[data-ipswizard]').find('[data-role="wizardContent"]');
|
|
if( !loading.length ){
|
|
loading = $('<div/>').attr('data-role', 'loading').addClass('ipsLoading').hide();
|
|
scope.closest('[data-ipswizard]').append( loading );
|
|
}
|
|
var dims = {
|
|
width: wizardContainer.outerWidth(),
|
|
height: wizardContainer.outerHeight()
|
|
};
|
|
loading
|
|
.css({
|
|
width: dims.width + 'px',
|
|
height: dims.height + 'px'
|
|
})
|
|
.show();
|
|
wizardContainer
|
|
.hide()
|
|
.after( loading.show() );
|
|
|
|
/* Send to Stripe */
|
|
var data = {
|
|
type: 'card',
|
|
owner: {
|
|
address: {
|
|
city: scope.attr('data-city'),
|
|
country: scope.attr('data-country'),
|
|
line1: scope.attr('data-address1'),
|
|
line2: scope.attr('data-address2'),
|
|
postal_code: scope.attr('data-zip'),
|
|
state: scope.attr('data-state')
|
|
},
|
|
name: scope.attr('data-name')
|
|
}
|
|
};
|
|
if ( scope.attr('data-email') ) {
|
|
data.owner.email = scope.attr('data-email');
|
|
}
|
|
if ( scope.attr('data-phone') ) {
|
|
data.owner.phone = scope.attr('data-phone');
|
|
}
|
|
this.stripe.createSource( this.cardNumber, data ).then( _.bind( this.receivedCardSource, this ) );
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Callback after a Stripe source has been generated for a card
|
|
*
|
|
* @param {object} result The result
|
|
* @returns {void}
|
|
*/
|
|
receivedCardSource: function( result ) {
|
|
|
|
/* Init */
|
|
var scope = $(this.scope);
|
|
var loading = scope.closest('[data-ipswizard]').find('[data-role="loading"]');
|
|
var wizardContainer = scope.closest('[data-ipswizard]').find('[data-role="wizardContent"]');
|
|
|
|
/* If there was an error, show the form again */
|
|
if ( result.error ) {
|
|
Debug.error(result.error);
|
|
|
|
loading.remove();
|
|
wizardContainer.show();
|
|
|
|
if ( result.error.type == 'card_error' || result.error.type == 'validation_error' ) {
|
|
ips.ui.alert.show({
|
|
type: 'alert',
|
|
icon: 'warn',
|
|
message: result.error.message
|
|
});
|
|
} else {
|
|
ips.ui.alert.show({
|
|
type: 'alert',
|
|
icon: 'warn',
|
|
message: ips.getString('payment_error')
|
|
});
|
|
}
|
|
}
|
|
/* Otherwise, process... */
|
|
else {
|
|
scope.closest('form').append( $('<input type="hidden" />').attr( 'name', scope.attr('data-id') + '_card[token]' ).val( result.source.id ) );
|
|
scope.closest('form').submit();
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Callback after a Stripe source has been generated for 3D Secure
|
|
*
|
|
* @param {object} result The result
|
|
* @returns {void}
|
|
*/
|
|
received3DSource: function( result ) {
|
|
if ( result.source.status != 'pending' ) {
|
|
scope.closest('form').submit();
|
|
} else {
|
|
|
|
var scope = $(this.scope);
|
|
var loading = scope.closest('[data-ipswizard]').find('[data-role="loading"]');
|
|
var wizardContainer = scope.closest('[data-ipswizard]').find('[data-role="wizardContent"]');
|
|
|
|
scope.closest('form').append( $('<input type="hidden" />').attr( 'name', scope.attr('data-id') + '_card[token]' ).val( result.source.id ) );
|
|
|
|
window.location = result.source.redirect['url'];
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Callback when the status of a source changes (i..e the customer has paid, or too much time has passed for them to be able to pay)
|
|
*
|
|
* @param {int} status Status Code
|
|
* @param {Source} source Stripe Source object
|
|
* @returns {void}
|
|
*/
|
|
pollCallback: function( status, source ) {
|
|
if ( source.status !== 'pending' ) {
|
|
$(this.scope).closest('form').submit();
|
|
}
|
|
}
|
|
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="global" javascript_path="controllers/gateways" javascript_name="ips.gateways.stripeamex.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100">/**
|
|
* IPS Community Suite 4
|
|
* (c) 2017 Invision Power Services - http://www.invisionpower.com
|
|
*
|
|
* ips.gateways.stripeamex.js - Stripe Amex Express Checkout Controller
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
/* A global function breaks our coding standards, but it's the only way Amex will allow it */
|
|
function aecCallbackHandler(response){
|
|
jQuery( window ).trigger( 'aecCallbackHandler', response );
|
|
};
|
|
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.global.gateways.stripeamex', {
|
|
|
|
selected: false,
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
initialize: function () {
|
|
this.setup();
|
|
},
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
setup: function(){
|
|
var self = this;
|
|
ips.loader.get( ['https://icm.aexp-static.com/Internet/IMDC/US_en/RegisteredCard/AmexExpressCheckout/js/AmexExpressCheckout.js'] );
|
|
|
|
$( window ).on( 'aecCallbackHandler', function(e,response) {
|
|
$(self.scope).find('input').val( response.token );
|
|
$(self.scope).closest('form').submit();
|
|
});
|
|
}
|
|
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="global" javascript_path="controllers/gateways" javascript_name="ips.gateways.stripepaymentrequest.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100">/**
|
|
* IPS Community Suite 4
|
|
* (c) 2017 Invision Power Services - http://www.invisionpower.com
|
|
*
|
|
* ips.gateways.stripepaymentrequest.js - Stripe Apple Pay Controller
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.global.gateways.stripepaymentrequest', {
|
|
|
|
strile: null,
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
initialize: function () {
|
|
this.setup();
|
|
},
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
setup: function(){
|
|
|
|
this.stripe = Stripe( this.scope.attr('data-key') );
|
|
|
|
var data = {
|
|
country: this.scope.attr('data-country'),
|
|
currency: this.scope.attr('data-currency'),
|
|
total: {
|
|
label: $('meta[property="og:site_name"]').attr('content'),
|
|
amount: parseInt( this.scope.attr('data-amountAsCents') )
|
|
}
|
|
};
|
|
var paymentRequest = this.stripe.paymentRequest(data);
|
|
|
|
var elements = this.stripe.elements();
|
|
var prButton = elements.create('paymentRequestButton', {
|
|
paymentRequest: paymentRequest
|
|
});
|
|
|
|
var scope = this.scope;
|
|
paymentRequest.canMakePayment().then(function(result) {
|
|
if (result) {
|
|
prButton.mount( '#paymentrequest-' + scope.attr('id') );
|
|
} else {
|
|
ips.utils.cookie.set( 'PaymentRequestAPI', 0 );
|
|
|
|
var paymentMethodRadio = $( '#elRadio_payment_method_' + scope.attr('data-id') );
|
|
if ( paymentMethodRadio.length ) {
|
|
if ( paymentMethodRadio.is(':checked') ) {
|
|
paymentMethodRadio.closest('li').next('li').find('input[type="radio"]').click();
|
|
}
|
|
paymentMethodRadio.closest('li').remove();
|
|
} else {
|
|
window.location = window.location;
|
|
}
|
|
}
|
|
} );
|
|
|
|
paymentRequest.on('source', function(ev) {
|
|
ips.getAjax()( ips.getSetting('baseURL') + 'applications/nexus/interface/gateways/stripe-payrequest.php', { data: { token: ev.source.id, gateway: this.scope.attr('data-id'), currency: this.scope.attr('data-currency'), amount: this.scope.attr('data-amount'), invoice: this.scope.attr('data-invoice') } } )
|
|
.done(function(response){
|
|
if ( response.success ) {
|
|
ev.complete('success');
|
|
window.location = response.url;
|
|
} else {
|
|
ev.complete('fail');
|
|
}
|
|
})
|
|
.fail(function(){
|
|
ev.complete('fail');
|
|
});
|
|
}.bind(this));
|
|
},
|
|
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/hosting" javascript_name="ips.nexus.hosting.accountform.js" javascript_type="controller" javascript_version="103005" javascript_position="1000150">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.nexus.hosting.accountform.js
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.hosting.accountform', {
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
initialize: function () {
|
|
$( document ).on( 'nodeItemSelected', function(){
|
|
$('#form_account_server_warning').show();
|
|
});
|
|
|
|
$('[data-role="editWarning"]').hide();
|
|
$( 'input[name^="account_"], input[name^="p_"]' ).change(function(){
|
|
$(this).parent().find('[data-role="editWarning"]').show();
|
|
$('[data-role="editWarningBox"]').show();
|
|
});
|
|
|
|
$('#form_account_server_warning').hide();
|
|
},
|
|
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="global" javascript_path="controllers/misc" javascript_name="ips.misc.print.js" javascript_type="controller" javascript_version="103005" javascript_position="1000050">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.misc.print.js - Makes the page print
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.global.misc.print', {
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
initialize: function () {
|
|
window.print();
|
|
},
|
|
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/store" javascript_name="ips.store.productoptions.js" javascript_type="controller" javascript_version="103005" javascript_position="1000200"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.store.productoptions.js
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.store.productoptions', {
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
initialize: function () {
|
|
var self = this;
|
|
this.on( 'change', '[data-role="field"]', this.refresh );
|
|
$('input[name="p_renews_checkbox"]').change(function(){
|
|
self.refresh();
|
|
});
|
|
|
|
if ( $('input[name="p_images_primary_image"]').length ) {
|
|
$('input[name="p_images_primary_image"]:first').attr('checked', true);
|
|
}
|
|
|
|
this.refresh();
|
|
},
|
|
|
|
/**
|
|
* Refresh
|
|
*/
|
|
refresh: function () {
|
|
var ids = [];
|
|
$(this.scope).find('[data-role="field"]:checked').each(function(){
|
|
ids.push( $(this).attr('data-id') );
|
|
});
|
|
|
|
if ( $('input[name="p_renews_checkbox"]').is(':checked') ) {
|
|
var renews = 1;
|
|
} else {
|
|
var renews = 0;
|
|
}
|
|
|
|
var scope = $(this.scope);
|
|
ips.getAjax()( scope.attr('data-url') + '&fields=' + ids.join(',') + '&renews=' + renews )
|
|
.done(function(response){
|
|
scope.find('[data-role="table"]').html( response );
|
|
$( document ).trigger( 'contentChange', [ scope ] );
|
|
});
|
|
},
|
|
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/store" javascript_name="ips.store.productselector.js" javascript_type="controller" javascript_version="103005" javascript_position="1000200"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.store.productselector.js
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.store.productselector', {
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
initialize: function () {
|
|
this.url = $(this.scope).attr('data-url');
|
|
this.on( 'click', '[data-role="group"]', this.expandCollapse );
|
|
this.on( 'click', '[data-role="product"]', this.increaseQty );
|
|
},
|
|
|
|
/**
|
|
* Expand/Collapse Group
|
|
*/
|
|
expandCollapse: function (e) {
|
|
var row = $( e.currentTarget );
|
|
var list = row.next();
|
|
|
|
if ( row.hasClass('ipsTree_open') ) {
|
|
row.removeClass('ipsTree_open');
|
|
list.hide();
|
|
|
|
} else {
|
|
row.addClass('ipsTree_open');
|
|
list.show();
|
|
if ( !list.data('_childrenLoaded') ) {
|
|
list.html( ips.templates.render('core.trees.childWrapper', {
|
|
content: ips.templates.render('core.trees.loadingRow')
|
|
} ) );
|
|
|
|
ips.getAjax()( this.url + '&id=' + row.attr('data-groupId') ).done(function(response){
|
|
list.html(response);
|
|
list.data('_childrenLoaded', 'true');
|
|
})
|
|
}
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Increase Qty
|
|
*/
|
|
increaseQty: function (e) {
|
|
if( !$(e.target).is('input') ) {
|
|
$( e.currentTarget ).find('input').val( parseInt( $( e.currentTarget ).find('input').val() ) + 1 );
|
|
}
|
|
}
|
|
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="front" javascript_path="controllers/store" javascript_name="ips.store.cartReview.js" javascript_type="controller" javascript_version="103005" javascript_position="1000300">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.store.cartReview.js - Cart review screen
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.front.store.cartReview', {
|
|
|
|
initialize: function () {
|
|
this.on( 'click', '[data-action="removeFromCart"]', this.removeFromCart );
|
|
this.on( 'submit', '[data-role="quantityForm"]', this.quantityForm );
|
|
this.on( 'click', '[data-action="checkout"]', this.checkout );
|
|
},
|
|
|
|
/**
|
|
* Prevent checkout button being clicked more than once
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
checkout: function (e) {
|
|
if ( $(e.target).hasClass('ipsButton_disabled') ) {
|
|
e.preventDefault();
|
|
} else {
|
|
$(e.target).addClass('ipsButton_disabled');
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Removes the item from the cart
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
removeFromCart: function (e) {
|
|
e.preventDefault();
|
|
var self = this;
|
|
var url = $( e.currentTarget ).attr('href');
|
|
|
|
ips.ui.alert.show({
|
|
type: 'confirm',
|
|
message: ips.getString('confirmRemoveItem'),
|
|
icon: 'warn',
|
|
callbacks: {
|
|
ok: function () {
|
|
ips.getAjax()( url )
|
|
.done( function (response) {
|
|
self.scope.find('[data-role="cart"]').html( response );
|
|
});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
|
|
/**
|
|
* Handles submitting the quantity form
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
quantityForm: function (e) {
|
|
e.preventDefault();
|
|
var self = this;
|
|
var form = $( e.currentTarget );
|
|
var menu = form.closest('.ipsMenu');
|
|
|
|
// Set menu to loading and hide form
|
|
menu
|
|
.css({
|
|
height: menu.outerHeight() + 'px'
|
|
})
|
|
.addClass('ipsLoading');
|
|
|
|
form.hide();
|
|
|
|
// Do ajax request to update it
|
|
ips.getAjax()( form.attr('action'), {
|
|
data: form.serialize()
|
|
})
|
|
.done( function (response) {
|
|
self.scope.find('[data-role="cart"]').html( response );
|
|
})
|
|
.fail(function(response){
|
|
menu.removeClass( 'ipsLoading' );
|
|
form.show();
|
|
ips.ui.alert.show( {
|
|
type: 'alert',
|
|
icon: 'warn',
|
|
message: response.responseJSON
|
|
});
|
|
|
|
});
|
|
}
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="front" javascript_path="controllers/store" javascript_name="ips.store.currencySelect.js" javascript_type="controller" javascript_version="103005" javascript_position="1000300">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.store.currencySelect.js - Alert when changing currency
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.front.store.currencySelect', {
|
|
|
|
initialize: function () {
|
|
this.on( 'click', 'a', this.currencyChangeWarning );
|
|
},
|
|
|
|
/**
|
|
* Prevent checkout button being clicked more than once
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
currencyChangeWarning: function (e) {
|
|
e.preventDefault();
|
|
ips.ui.alert.show({
|
|
type: 'confirm',
|
|
message: ips.getString('store_currency_change_warning'),
|
|
icon: 'warn',
|
|
callbacks: {
|
|
ok: function () {
|
|
window.location = $(e.currentTarget).attr('href');
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="front" javascript_path="controllers/store" javascript_name="ips.store.giftCard.js" javascript_type="controller" javascript_version="103005" javascript_position="1000300"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.store.giftCard.js - Gift card purchase screen
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.front.store.giftCard', {
|
|
|
|
initialize: function () {
|
|
this.on( 'click', '[data-color]', this.toggleColor );
|
|
this.on( 'change', '[name="gift_voucher_amount"], [name="x_gift_voucher_amount"]', this.changeAmount );
|
|
this.setup();
|
|
},
|
|
|
|
setup: function () {
|
|
this.changeAmount();
|
|
if ( $('input[name="gift_voucher_color"]').val() ) {
|
|
this.setColor( $('input[name="gift_voucher_color"]').val() );
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Event handler for changing the amount of the gift card
|
|
*
|
|
* @returns {void}
|
|
*/
|
|
changeAmount: function () {
|
|
var amountVal = this.scope.find('[name="gift_voucher_amount"]:checked').val();
|
|
var customVal = this.scope.find('[name="x_gift_voucher_amount"]').val();
|
|
var amount = 0;
|
|
|
|
if( amountVal == 'x' ){
|
|
if( !_.isUndefined( customVal ) && customVal != '' && customVal != 'x' ){
|
|
amount = customVal;
|
|
}
|
|
|
|
var scope = this.scope;
|
|
ips.getAjax()( this.scope.attr('data-formatCurrencyUrl') + '&amount=' + amount )
|
|
.done( function (response) {
|
|
scope.find('[data-role="value"]').text( response );
|
|
});
|
|
} else {
|
|
amount = amountVal;
|
|
this.scope.find('[data-role="value"]').text( this.scope.find( 'label[for="' + this.scope.find('[name="gift_voucher_amount"]:checked').attr('id') + '"]' ).text() );
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Toggles the color being used for the gift card
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
toggleColor: function (e) {
|
|
e.preventDefault();
|
|
var swatch = $( e.currentTarget );
|
|
var color = swatch.attr('data-color');
|
|
this.setColor(color);
|
|
},
|
|
|
|
/**
|
|
* Sets being used for the gift card
|
|
*
|
|
* @param {string} color The color
|
|
* @returns {void}
|
|
*/
|
|
setColor: function (color) {
|
|
this.scope
|
|
.find('[data-role="giftCard"]').css({
|
|
backgroundColor: '#' + color
|
|
})
|
|
.end()
|
|
.find('input[type="hidden"][name="gift_voucher_color"]')
|
|
.val( '#' + color )
|
|
.end()
|
|
.find('[data-color]')
|
|
.closest('li')
|
|
.removeAttr('data-selected');
|
|
|
|
$(this.scope).find('[data-color="' + color + '"]').closest('li').attr( 'data-selected', true );
|
|
}
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="front" javascript_path="controllers/store" javascript_name="ips.store.packagePage.js" javascript_type="controller" javascript_version="103005" javascript_position="1000300"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.store.packagePage.js
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.front.store.packagePage', {
|
|
|
|
initialize: function () {
|
|
this.on( 'change', 'select, input[type="radio"], [name="quantity"], [name="renewal_term"]', this.updatePriceAndStock );
|
|
this.on( 'submit', 'form', this.submitForm );
|
|
this.on( 'click', '[data-action="toggleImage"]', this.toggleScreenshot );
|
|
this.on( document, 'addToCart.nexus', this.addToCart );
|
|
this.setup();
|
|
},
|
|
|
|
/**
|
|
* Setup method
|
|
*
|
|
* @returns {void}
|
|
*/
|
|
setup: function () {
|
|
// Select first image if it's there
|
|
this.scope.find('.cNexusProduct_images [data-action="toggleImage"]').first().addClass('cNexusProduct_imageSelected');
|
|
|
|
if ( $(this.scope).find('select,input[type="radio"]').length ) {
|
|
this.updatePriceAndStock();
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Switches the screenshot being shown for a product
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
toggleScreenshot: function (e) {
|
|
e.preventDefault();
|
|
|
|
var clickedImage = $( e.currentTarget );
|
|
var thumbImage = clickedImage.find('img').attr('src');
|
|
var fullImage = clickedImage.attr('href');
|
|
|
|
var html = ips.templates.render('nexus.store.productImage', {
|
|
fullURL: fullImage,
|
|
thumbURL: thumbImage
|
|
});
|
|
|
|
this.scope
|
|
.find('.cNexusProduct_primaryImage')
|
|
.replaceWith( html )
|
|
.end()
|
|
.find('[data-action="toggleImage"]')
|
|
.removeClass('cNexusProduct_imageSelected');
|
|
|
|
clickedImage.addClass('cNexusProduct_imageSelected');
|
|
|
|
$( document ).trigger('contentChange', [ this.scope.find('.cNexusProduct_primaryImage').parent() ] );
|
|
},
|
|
|
|
/**
|
|
* Event handler for submitting the form, triggering an event that we can capture
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
submitForm: function (e) {
|
|
|
|
var self = this;
|
|
var form = this.scope.find('form');
|
|
|
|
if ( form.attr('data-noajax') ) {
|
|
return true;
|
|
}
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
|
|
// Set form to loading
|
|
var formDims = ips.utils.position.getElemDims( form );
|
|
var formPos = ips.utils.position.getElemPosition( form );
|
|
var loadingElem = $('<div/>').addClass('ipsLoading');
|
|
form.after( loadingElem );
|
|
|
|
loadingElem.css({
|
|
top: formPos.offsetPos.top + 'px',
|
|
left: formPos.offsetPos.left + 'px',
|
|
width: formDims.outerWidth + 'px',
|
|
height: formDims.outerHeight + 'px'
|
|
});
|
|
|
|
// Trigger an event for adding to cart, so that we can capture it
|
|
// and do something else with it if necessary
|
|
this.trigger( 'addToCart.nexus', {
|
|
url: form.attr('action'),
|
|
formData: form.serialize()
|
|
});
|
|
},
|
|
|
|
/**
|
|
* Adds the item to cart via ajax, and creates a dialog to let the user know
|
|
*
|
|
* @param {event} e Event object
|
|
* @param {object} data Event data object
|
|
* @returns {void}
|
|
*/
|
|
addToCart: function (e, data) {
|
|
|
|
var self = this;
|
|
|
|
ips.getAjax()( data.url, {
|
|
data: data.formData,
|
|
type: 'post'
|
|
})
|
|
.done( function (response) {
|
|
// Are we already running inside of a dialog?
|
|
if( self.scope.closest('.ipsDialog').length ){
|
|
var dialogContent = self.scope.closest('.ipsDialog').find('.ipsDialog_content');
|
|
// We need to destroy this controller before updating the content so that event handlers are unregistered,
|
|
// otherwise this controller will continue listening for addToCart events and trigger multiple dialogs.
|
|
self.trigger('destroy');
|
|
dialogContent.html( response.dialog ).show();
|
|
$( document ).trigger( 'contentChange', [ dialogContent ] );
|
|
} else {
|
|
var contentElem = $('<div/>').html( response.dialog );
|
|
var loadingElem = self.scope.find('form').next('.ipsLoading');
|
|
|
|
ips.getContainer().append( contentElem );
|
|
|
|
// Show a dialog
|
|
var dialogRef = ips.ui.dialog.create({
|
|
title: $(self.scope).attr('data-itemTitle'),
|
|
content: contentElem,
|
|
forceReload: true,
|
|
size: 'medium'
|
|
});
|
|
|
|
dialogRef.show();
|
|
|
|
$( document ).trigger( 'contentChange', [ contentElem ] );
|
|
|
|
// Remove loading elem
|
|
loadingElem.remove();
|
|
self.updatePriceAndStock();
|
|
}
|
|
|
|
if ( response.cart ) {
|
|
$('#elCart_container').replaceWith( $( '<div>' + response.cart + '</div>' ).find('.cUserNav_icon') );
|
|
$('#elCart_sep').removeClass('ipsHide');
|
|
}
|
|
})
|
|
.fail(function(response){
|
|
|
|
var loadingElem = self.scope.find('form').next('.ipsLoading');
|
|
loadingElem.remove();
|
|
|
|
if ( response.responseJSON ) {
|
|
ips.ui.alert.show({
|
|
type: 'alert',
|
|
message: response.responseJSON,
|
|
icon: 'warn'
|
|
});
|
|
} else {
|
|
var form = $(e.target).find('form');
|
|
try {
|
|
var newForm = $(response.responseText);
|
|
} catch (err) {
|
|
form.attr('data-noajax', 'true');
|
|
form.submit();
|
|
}
|
|
form.replaceWith( newForm );
|
|
$( document ).trigger('contentChange' );
|
|
}
|
|
});
|
|
},
|
|
|
|
/**
|
|
* Updates the stock and price information when custom fields change
|
|
*
|
|
* @returns {void}
|
|
*/
|
|
updatePriceAndStock: function () {
|
|
|
|
var self = this;
|
|
var form = this.scope.find('form');
|
|
|
|
ips.getAjax()( form.attr('action'), {
|
|
dataType: 'json',
|
|
data: form.serialize() + '&stockCheck=1',
|
|
type: 'post'
|
|
})
|
|
.done( function (response) {
|
|
|
|
self.scope.find('[data-role="price"]').html( response.price );
|
|
self.scope.find('[data-role="stock"]').html( response.stock );
|
|
self.scope.find('[data-role="renewalTerm"]').html( response.renewal );
|
|
|
|
if( response.okay ){
|
|
self.scope.find('button').removeAttr('disabled').text( ips.getString('add_to_cart_js') );
|
|
} else {
|
|
self.scope.find('button').attr( 'disabled','disabled' ).text( ips.getString('out_of_stock') );
|
|
}
|
|
})
|
|
.fail(function(response){
|
|
Debug.error(response);
|
|
});
|
|
}
|
|
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="front" javascript_path="controllers/store" javascript_name="ips.store.register.js" javascript_type="controller" javascript_version="103005" javascript_position="1000300"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.store.register.js - Register screen in Nexus
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.front.store.register', {
|
|
|
|
_infoPaneWrapper: null,
|
|
_infoPane: null,
|
|
|
|
initialize: function () {
|
|
this.on( 'click', '[data-role="productCarousel"] .cNexusProduct', this.selectProduct );
|
|
this.on( 'click', '[data-action="closeInfo"]', this.closeInfo );
|
|
this.on( 'addToCart.nexus', this.addToCart );
|
|
this.setup();
|
|
},
|
|
|
|
/**
|
|
* Setup method
|
|
*
|
|
* @returns {void}
|
|
*/
|
|
setup: function () {
|
|
this._infoPaneWrapper = this.scope.find('[data-role="productInformationWrapper"]');
|
|
this._infoPane = this.scope.find('[data-role="productInformation"]');
|
|
},
|
|
|
|
/**
|
|
* Event handler for closing the info panel
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
closeInfo: function (e) {
|
|
e.preventDefault();
|
|
|
|
this.scope.find('[data-role="productCarousel"] .cNexusProduct').removeClass('cNexusProduct_selected');
|
|
|
|
this._infoPaneWrapper
|
|
.hide()
|
|
.find('[data-action="closeInfo"]')
|
|
.hide();
|
|
},
|
|
|
|
/**
|
|
* Highlights a product on the registration screen and loads its overview to display
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
selectProduct: function (e) {
|
|
e.preventDefault();
|
|
var selectedProduct = $( e.currentTarget );
|
|
var self = this;
|
|
|
|
this.scope.find('[data-role="productCarousel"] .cNexusProduct').removeClass('cNexusProduct_selected');
|
|
selectedProduct.addClass('cNexusProduct_selected');
|
|
|
|
// Get the URL of the selected product
|
|
var url = selectedProduct.find('[data-role="productLink"]').attr('href');
|
|
var height = 200;
|
|
|
|
// Set info area to loading
|
|
if( this._infoPaneWrapper.is(':visible') ){
|
|
height = this._infoPane.height();
|
|
}
|
|
|
|
this._infoPaneWrapper
|
|
.show()
|
|
.find('[data-action="closeInfo"]')
|
|
.hide();
|
|
|
|
this._infoPane
|
|
.css({
|
|
height: height + 'px'
|
|
})
|
|
.html('')
|
|
.addClass('ipsLoading');
|
|
|
|
// Now load
|
|
ips.getAjax()( url )
|
|
.done( function (response) {
|
|
|
|
self._infoPaneWrapper
|
|
.find('[data-action="closeInfo"]')
|
|
.show();
|
|
|
|
self._infoPane
|
|
.removeClass('ipsLoading')
|
|
.css({
|
|
height: 'auto'
|
|
})
|
|
.html( response );
|
|
|
|
$( document ).trigger( 'contentChange', [ self._infoPane ] );
|
|
});
|
|
},
|
|
|
|
/**
|
|
* Adds the item to cart via ajax, and creates a dialog to let the user know
|
|
*
|
|
* @param {event} e Event object
|
|
* @param {object} data Event data object
|
|
* @returns {void}
|
|
*/
|
|
addToCart: function (e, data) {
|
|
e.stopPropagation();
|
|
var self = this;
|
|
|
|
ips.getAjax()( data.url, {
|
|
data: data.formData + '®isterCheckout=1',
|
|
type: 'post'
|
|
})
|
|
.done( function (response) {
|
|
self._infoPane.html( response.dialog );
|
|
$( document ).trigger( 'contentChange', [ self._infoPane ] );
|
|
})
|
|
.fail(function(response){
|
|
|
|
var loadingElem = self.scope.find('form').next('.ipsLoading');
|
|
loadingElem.remove();
|
|
|
|
if ( response.responseJSON ) {
|
|
ips.ui.alert.show({
|
|
type: 'alert',
|
|
message: response.responseJSON,
|
|
icon: 'warn'
|
|
});
|
|
} else {
|
|
var form = $(e.target).find('form');
|
|
try {
|
|
var newForm = $(response.responseText);
|
|
} catch (err) {
|
|
form.attr('data-noajax', 'true');
|
|
form.submit();
|
|
}
|
|
form.replaceWith( newForm );
|
|
$( document ).trigger('contentChange' );
|
|
}
|
|
});
|
|
},
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="front" javascript_path="controllers/subscriptions" javascript_name="ips.subscriptions.main.js" javascript_type="controller" javascript_version="103005" javascript_position="1000200">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.subscriptions.main.js - Register form during checkout
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.front.subscriptions.main', {
|
|
|
|
initialize: function () {
|
|
this.on( 'click', '[data-change-subscription]', this.showAlert );
|
|
if ( $(this.scope).attr('data-regform') ) {
|
|
this._showRegistrationForm();
|
|
}
|
|
},
|
|
|
|
showAlert: function (e) {
|
|
e.preventDefault();
|
|
ips.ui.alert.show({
|
|
type: 'confirm',
|
|
message: $( e.currentTarget ).attr('data-change-message'),
|
|
icon: 'warn',
|
|
callbacks: {
|
|
ok: function () {
|
|
window.location = $( e.currentTarget ).attr('href');
|
|
},
|
|
cancel: function () {
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/support" javascript_name="ips.support.emailsetup.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.support.emailsetup.js
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.support.emailsetup', {
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
initialize: function () {
|
|
var self = this;
|
|
var scope = $(this.scope);
|
|
scope.find('[data-role="toggleView"]').click(function(e){
|
|
e.preventDefault();
|
|
var height = scope.height();
|
|
scope.html('').css( 'min-height', height ).addClass('ipsLoading');
|
|
ips.getAjax()( $(e.currentTarget).attr('href') )
|
|
.done(function( response ){
|
|
scope.removeClass('ipsLoading').css( 'min-height', 0 ).html( response );
|
|
self.initialize();
|
|
})
|
|
.fail(function(){
|
|
window.location = $(e.currentTarget).attr('href');
|
|
});
|
|
});
|
|
},
|
|
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/support" javascript_name="ips.support.filterCheckboxSet.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.support.filterForm.js
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.support.filterCheckboxSet', {
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
initialize: function () {
|
|
this.on( 'click', '[data-action="checkAll"]', this.checkAll );
|
|
this.on( 'click', '[data-action="checkNone"]', this.checkNone );
|
|
},
|
|
|
|
/**
|
|
* Check all
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
checkAll: function (e) {
|
|
e.preventDefault();
|
|
this.scope
|
|
.find('input[type="checkbox"]')
|
|
.prop( 'checked', true )
|
|
.closest('.ipsSideMenu_item')
|
|
.addClass('ipsSideMenu_itemActive');
|
|
},
|
|
|
|
/**
|
|
* Uncheck all
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
checkNone: function (e) {
|
|
e.preventDefault();
|
|
this.scope
|
|
.find('input[type="checkbox"]')
|
|
.prop( 'checked', false )
|
|
.closest('.ipsSideMenu_item')
|
|
.removeClass('ipsSideMenu_itemActive');
|
|
}
|
|
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/support" javascript_name="ips.support.list.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.support.list.js - Controller for main support request list
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.support.list', {
|
|
|
|
_ajaxObj: null,
|
|
_editAjaxObj: null,
|
|
_storedCustomForm: '',
|
|
|
|
initialize: function () {
|
|
this.on( 'click', '[data-action="reloadTable"]', this.reloadTableClick );
|
|
this.on( 'menuItemSelected', this.itemSelected );
|
|
this.on( 'click', '[data-action="quickToggleCount"]', this.streamCountClicked );
|
|
this.on( 'change', '[data-action="quickToggle"]', this.toggleStream );
|
|
this.on( 'click', '[data-action="editStream"]', this.editStream );
|
|
this.on( 'click', 'tr.cNexusSupportTable_row', this.rowClick );
|
|
},
|
|
|
|
/**
|
|
* Event handler for menu selections
|
|
*
|
|
* @param {event} e Event object
|
|
* @param {data} data Data
|
|
* @returns {void}
|
|
*/
|
|
itemSelected: function (e,data) {
|
|
if ( $(data.menuElem).attr('id') === 'elSortMenu_menu' || $(data.menuElem).attr('id') === 'elOrderMenu_menu' ) {
|
|
this._reloadTable( data.menuElem.find( '[data-ipsMenuValue="' + data.selectedItemID + '"] a' ).attr('href') );
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Event handler for a link which should reload the table
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
reloadTableClick: function (e) {
|
|
e.preventDefault();
|
|
this._reloadTable( $(e.target).attr('href') );
|
|
},
|
|
|
|
/**
|
|
* Event handler to toggle stream when count is clicked
|
|
*
|
|
* @param {event} e Event object
|
|
* @return {void}
|
|
*/
|
|
streamCountClicked: function(e) {
|
|
$(e.target).next('label').click();
|
|
},
|
|
|
|
/**
|
|
* Event handler for toggling a stream radio
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
toggleStream: function (e) {
|
|
if ( $(e.target).attr('value') != 'custom' ) {
|
|
this.scope.find('[data-role="mainTable"]').show();
|
|
this._reloadTable( $(e.target).attr('data-url') );
|
|
} else {
|
|
if ( this._storedCustomForm ) {
|
|
var form = $(this.scope).find('[data-role="filterForm"]');
|
|
form.html( this._storedCustomForm );
|
|
this._storedCustomForm = '';
|
|
$( document ).trigger( 'contentChange', [ form ] );
|
|
$('#elRadio_stream_custom').click();
|
|
}
|
|
|
|
$( e.target )
|
|
.closest('.ipsTabs')
|
|
.find('.ipsTabs_item')
|
|
.removeClass('ipsTabs_activeItem')
|
|
.end()
|
|
.end()
|
|
.closest('.ipsTabs_item')
|
|
.addClass('ipsTabs_activeItem');
|
|
|
|
this.scope.find('[data-role="mainTable"]').hide();
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Event handler for edit stream click
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
editStream: function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
this.scope.find('[data-role="mainTable"]').hide();
|
|
|
|
var url = $(e.target).attr('href');
|
|
var form = $(this.scope).find('[data-role="filterForm"]');
|
|
this._storedCustomForm = form.html();
|
|
form.append( '<div class="ipsLoading ipsLoading_small cNexusFormLoading"></div>' );
|
|
|
|
if( this._ajaxObj && _.isFunction( this._ajaxObj.abort ) ){
|
|
this._ajaxObj.abort();
|
|
}
|
|
|
|
var self = this;
|
|
this._ajaxObj = ips.getAjax()( url )
|
|
.done( function ( response, status, jqxhr ) {
|
|
form.html( response );
|
|
$( document ).trigger( 'contentChange', [ form ] );
|
|
$('#elFilterFormFull').show();
|
|
})
|
|
.fail( function () {
|
|
window.location = url;
|
|
});
|
|
|
|
},
|
|
|
|
/**
|
|
* Reload the table
|
|
*
|
|
* @param {string} url The URL
|
|
* @returns {void}
|
|
*/
|
|
_reloadTable: function (url) {
|
|
|
|
var scope = $(this.scope);
|
|
var mainTable = scope.find('[data-role="mainTable"]');
|
|
var resultsTable = scope.find('[data-role="resultsTable"]');
|
|
var form = scope.find('[data-role="filterForm"]');
|
|
|
|
resultsTable.addClass('ipsLoading').css( { opacity: 0.4 } );
|
|
|
|
if( this._ajaxObj && _.isFunction( this._ajaxObj.abort ) ){
|
|
this._ajaxObj.abort();
|
|
}
|
|
|
|
this._ajaxObj = ips.getAjax()( url )
|
|
.done( function ( response, status, jqxhr ) {
|
|
|
|
form.html(response.form);
|
|
mainTable.html(response.results);
|
|
resultsTable.removeClass('ipsLoading').css( { opacity: 1 } );
|
|
$( document ).trigger( 'contentChange', [ scope ] );
|
|
|
|
})
|
|
.fail( function () {
|
|
window.location = url;
|
|
});
|
|
},
|
|
|
|
/**
|
|
* Event handler for clicking a clickable row
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
rowClick: function (e) {
|
|
var target = $( e.target );
|
|
|
|
// Ignore if we clicked something clickable (besides the row)
|
|
if ( target.is('a') || target.is('i') || target.is('input') || target.is('textarea') || target.closest('a').length || target.closest('.ipsMenu').length ) {
|
|
return;
|
|
}
|
|
|
|
// Ignore if we didn't use the left mouse button. 1 is left mouse button, 2 is middle
|
|
// We allow 2 through here because we'll treat it differently shortly
|
|
if( e.which !== 1 && e.which !== 2 ){
|
|
return;
|
|
}
|
|
|
|
// Ignore if special keys are pressed
|
|
if( e.altKey || e.shiftKey ){
|
|
return;
|
|
}
|
|
|
|
// If we clicked into a cell with a checkbox, check that checkbox rather than redirect
|
|
if ( target.is('td') ) {
|
|
var checkbox = target.find('input[type="checkbox"]');
|
|
if ( checkbox.length ) {
|
|
checkbox.prop( 'checked', !checkbox.prop( 'checked' ) ).trigger('change');
|
|
return;
|
|
}
|
|
}
|
|
|
|
var link = $( e.currentTarget ).find('[data-role="supportLink"]');
|
|
|
|
// If we are using the meta key or middle mouse button, we're going to adjust the link
|
|
// to include _blank, so that it opens in a new tab
|
|
if( e.metaKey || e.ctrlKey || e.which == 2 ){
|
|
link.attr('target', '_blank');
|
|
link.get(0).click();
|
|
link.attr('target', '');
|
|
} else {
|
|
// Okay, we can go...
|
|
link.get(0).click();
|
|
}
|
|
}
|
|
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/support" javascript_name="ips.support.message.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.support.staffreply.js - Support reply processing
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.support.message', {
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
initialize: function () {
|
|
this.setup();
|
|
},
|
|
|
|
/**
|
|
* Setup method
|
|
*
|
|
* @returns {void}
|
|
*/
|
|
setup: function () {
|
|
this.scope.find('a').each( this._obscureLink );
|
|
},
|
|
|
|
/**
|
|
* Takes a link and makes it safe to show in the AdminCP, adding an icon to text links
|
|
*
|
|
* @returns {void}
|
|
*/
|
|
_obscureLink: function () {
|
|
var elem = $( this );
|
|
var realUrl = decodeURIComponent( ips.utils.url.getParam( 'url', elem.attr('href') ) );
|
|
elem.attr('target', '_blank');
|
|
|
|
if( realUrl !== 'undefined' && realUrl != elem.text() ){
|
|
|
|
var icon = $('<i class="fa fa-external-link ipsCursor_pointer ipsType_medium" title="' + ips.getString('click_to_show_url') + '" data-ipsTooltip></i>');
|
|
|
|
icon.on( 'click', function () {
|
|
ips.ui.alert.show( {
|
|
type: 'alert',
|
|
icon: 'info',
|
|
message: _.escape( realUrl ),
|
|
});
|
|
});
|
|
|
|
elem.after( icon ).after(' ');
|
|
}
|
|
}
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/support" javascript_name="ips.support.metamenu.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.support.metamenu.js - Makes the page print
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.support.metamenu', {
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
initialize: function () {
|
|
var scope = this.scope;
|
|
this.scope.parent().find('li a').on( 'click', function(e){
|
|
e.preventDefault();
|
|
var target = $( e.currentTarget );
|
|
|
|
if ( !target.parent().attr('data-noSet') ) {
|
|
scope.find('[data-role="title"]').text( target.find('[data-role="title"]').text() );
|
|
}
|
|
|
|
if ( target.parent().attr('data-group') ) {
|
|
var siblings = target.parent().parent().find( 'li[data-group="'+target.parent().attr('data-group')+'"]' );
|
|
} else {
|
|
var siblings = target.parent().parent().find( 'li' );
|
|
}
|
|
|
|
siblings.removeClass( 'ipsMenu_itemChecked' );
|
|
target.parent().addClass( 'ipsMenu_itemChecked' );
|
|
|
|
ips.getAjax()( target.attr('href') )
|
|
.done(function(response){
|
|
console.log(response);
|
|
var i;
|
|
for ( i in response ) {
|
|
if ( i == 'alert' ) {
|
|
ips.ui.alert.show( {
|
|
type: 'alert',
|
|
icon: 'warn',
|
|
message: response[i],
|
|
});
|
|
} else if ( i == 'staff' ) {
|
|
var staffMenu = $('[data-role="staffMenu"]');
|
|
staffMenu.find('[data-role="title"]').text( response[i].name );
|
|
$( 'li[data-group="staff"]' ).removeClass('ipsMenu_itemChecked');
|
|
$( 'li[data-group="staff"][data-id="'+response[i].id+'"]' ).addClass('ipsMenu_itemChecked');
|
|
} else if ( i == 'staffBadge' ) {
|
|
if ( response[i] ) {
|
|
$('[data-role="requestAssignedToBadge"]').css( 'display', 'inline-block' );
|
|
} else {
|
|
$('[data-role="requestAssignedToBadge"]').hide();
|
|
}
|
|
$('[data-role="requestAssignedToText"]').text( response[i] );
|
|
} else if ( i == 'severityBadge' ) {
|
|
if ( response[i] ) {
|
|
$('[data-role="requestSeverityBadge"]').css( 'display', 'inline-block' ).html( response[i] );
|
|
} else {
|
|
$('[data-role="requestSeverityBadge"]').hide();
|
|
}
|
|
} else if ( i == 'statusBadge' ) {
|
|
$('[data-role="requestStatusBadge"]').html( response[i] );
|
|
} else if ( i == 'stockActions' ) {
|
|
$('#elSelect_stock_action').children().remove();
|
|
var j;
|
|
for ( j in response[i] ) {
|
|
$('#elSelect_stock_action').append( $('<option>').attr( 'value', j ).text( response[i][j] ) );
|
|
}
|
|
} else if ( i == 'purchaseWarning' ) {
|
|
$('[data-role="purchaseWarning"]').hide();
|
|
if ( response[i] ) {
|
|
$('[data-purchaseWarning="' + response[i] + '"]').show();
|
|
}
|
|
} else if ( i.substr( 0, 5 ) == 'note_' ) {
|
|
$('#elNoteForm_form [name="' + i.substr( 5 ) + '"]').val( response[i] );
|
|
} else {
|
|
$('#elSupportReplyForm [name="' + i + '"]').val( response[i] );
|
|
}
|
|
}
|
|
})
|
|
.fail(function(){
|
|
ips.ui.alert.show( {
|
|
type: 'alert',
|
|
icon: 'info',
|
|
message: ips.getString('support_ajax_error')
|
|
});
|
|
})
|
|
} );
|
|
this.on( 'menuOpened', this.startListeningForKeyPress );
|
|
this.on( 'menuClosed', this.stopListeningForKeyPress );
|
|
},
|
|
|
|
/**
|
|
* Start listening for key presses
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
startListeningForKeyPress: function (e) {
|
|
$( '#' + $(this.scope).attr('id') + '_menu ul' ).find('.ipsMenu_hover').removeClass('ipsMenu_hover');
|
|
this._boundKeyPress = _.bind( this.keyPress, this );
|
|
$( document ).on( 'keydown', this._boundKeyPress );
|
|
},
|
|
|
|
/**
|
|
* Stop listening for key presses
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
stopListeningForKeyPress: function (e) {
|
|
$( '#' + $(this.scope).attr('id') + '_menu ul' ).removeClass('ipsMenu_keyNav');
|
|
$( '#' + $(this.scope).attr('id') + '_menu ul' ).find('.ipsMenu_hover').removeClass('ipsMenu_hover');
|
|
$( document ).off( 'keydown', this._boundKeyPress );
|
|
},
|
|
|
|
/**
|
|
* Handles key press
|
|
*
|
|
* @param {event} e Event object
|
|
* @param {obj} data Data object
|
|
* @returns {void}
|
|
*/
|
|
keyPress: function (e, data) {
|
|
e.preventDefault();
|
|
|
|
var menuList = $( '#' + $(this.scope).attr('id') + '_menu ul' );
|
|
menuList.addClass('ipsMenu_keyNav');
|
|
var active = menuList.find('.ipsMenu_hover');
|
|
|
|
switch ( e.which ) {
|
|
case 38: // up
|
|
if ( active.length ) {
|
|
active.removeClass('ipsMenu_hover');
|
|
var prev = active.prev();
|
|
if ( prev.length ) {
|
|
prev.addClass('ipsMenu_hover');
|
|
} else {
|
|
menuList.children().last().addClass('ipsMenu_hover');
|
|
}
|
|
} else {
|
|
menuList.children().last().addClass('ipsMenu_hover');
|
|
}
|
|
break;
|
|
case 40: // down
|
|
if ( active.length ) {
|
|
active.removeClass('ipsMenu_hover');
|
|
var next = active.next();
|
|
if ( next.length ) {
|
|
next.addClass('ipsMenu_hover');
|
|
} else {
|
|
menuList.children().first().addClass('ipsMenu_hover');
|
|
}
|
|
} else {
|
|
menuList.children().first().addClass('ipsMenu_hover');
|
|
}
|
|
break;
|
|
case 13: // enter
|
|
if ( active.length ) {
|
|
active.find('a').click();
|
|
}
|
|
break;
|
|
case 27: // esc
|
|
$(this.scope).click();
|
|
break;
|
|
}
|
|
}
|
|
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/support" javascript_name="ips.support.multimod.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.support.multimod.js - Controller for moderation actions in support requests
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.support.multimod', {
|
|
|
|
initialize: function () {
|
|
this.on( 'submit', '[data-role="moderationTools"]', this.moderationSubmit );
|
|
},
|
|
|
|
/**
|
|
* Event handler called when the moderation bar submits
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
moderationSubmit: function (e) {
|
|
|
|
var action = this.scope.find('[data-role="moderationAction"]').val();
|
|
|
|
switch (action) {
|
|
case 'delete':
|
|
this._modActionDelete(e);
|
|
break;
|
|
case 'split':
|
|
this._modActionDialog(e, 'split', 'wide');
|
|
break;
|
|
default:
|
|
$( document ).trigger('moderationSubmitted');
|
|
break;
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Handles a delete action from the moderation bar
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
_modActionDelete: function (e) {
|
|
var self = this;
|
|
var form = this.scope.find('[data-role="moderationTools"]');
|
|
|
|
if( self._bypassDeleteCheck ){
|
|
return;
|
|
}
|
|
|
|
e.preventDefault();
|
|
|
|
// How many are we deleting?
|
|
var count = parseInt( this.scope.find('[data-role="moderation"]:checked').length );
|
|
|
|
ips.ui.alert.show( {
|
|
type: 'confirm',
|
|
icon: 'warn',
|
|
message: ( count > 1 ) ? ips.pluralize( ips.getString( 'delete_confirm_many' ), count ) : ips.getString('delete_confirm'),
|
|
callbacks: {
|
|
ok: function () {
|
|
$( document ).trigger('moderationSubmitted');
|
|
self._bypassDeleteCheck = true;
|
|
self.scope.find('[data-role="moderationTools"]').submit();
|
|
}
|
|
}
|
|
});
|
|
},
|
|
|
|
/**
|
|
* Handles a move/split action from the moderation bar
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
_modActionDialog: function (e, title, size) {
|
|
e.preventDefault();
|
|
|
|
var form = this.scope.find('[data-role="moderationTools"]');
|
|
|
|
// Create dialog to show the form
|
|
var moveDialog = ips.ui.dialog.create({
|
|
url: form.attr('action') + '&' + form.serialize().replace( /%5B/g, '[' ).replace( /%5D/g, ']' ),
|
|
modal: true,
|
|
title: ips.getString(title),
|
|
forceReload: true,
|
|
remoteVerify: false,
|
|
size: size
|
|
});
|
|
$( form ).data('_dialog', moveDialog );
|
|
|
|
moveDialog.show();
|
|
$( document ).trigger('moderationSubmitted');
|
|
}
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/support" javascript_name="ips.support.packageInfo.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.support.packageInfo.js - Support packageInfo area
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.support.packageInfo', {
|
|
|
|
initialize: function () {
|
|
this.on( 'click', '[data-action="showMoreRows"]', this.showRows );
|
|
this.on( 'click', '[data-action="showFewerRows"]', this.hideRows );
|
|
},
|
|
|
|
showRows: function (e) {
|
|
e.preventDefault();
|
|
this.scope
|
|
.find('.cNexusSupportHeader_optional')
|
|
.show()
|
|
.end()
|
|
.find('[data-action="showMoreRows"]')
|
|
.hide()
|
|
.end()
|
|
.find('[data-action="showFewerRows"]')
|
|
.show();
|
|
|
|
ips.utils.cookie.set('showAllPackageInfo', true);
|
|
},
|
|
|
|
hideRows: function (e) {
|
|
e.preventDefault();
|
|
this.scope
|
|
.find('.cNexusSupportHeader_optional')
|
|
.hide()
|
|
.end()
|
|
.find('[data-action="showMoreRows"]')
|
|
.show()
|
|
.end()
|
|
.find('[data-action="showFewerRows"]')
|
|
.hide();
|
|
|
|
ips.utils.cookie.unset('showAllPackageInfo');
|
|
}
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/support" javascript_name="ips.support.pendingalert.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.support.pendingalert.js - Shows an alert
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.support.pendingalert', {
|
|
|
|
/**
|
|
* Init
|
|
*/
|
|
initialize: function () {
|
|
ips.ui.alert.show( {
|
|
type: 'alert',
|
|
icon: 'warn',
|
|
message: $(this.scope).text(),
|
|
});
|
|
$(this.scope).remove();
|
|
},
|
|
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/support" javascript_name="ips.support.replyArea.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.support.replyArea.js - Support request reply area
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.support.replyArea', {
|
|
|
|
initialize: function () {
|
|
this.on( 'tabChanged', this.tabChanged );
|
|
this.on( 'click', '[data-action="showCCForm"]', this.showCCForm );
|
|
this.on( 'change', '#elSelect_stock_action', this.stockAction );
|
|
},
|
|
|
|
/**
|
|
* Shows the form fields for to/cc/bcc
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
showCCForm: function (e) {
|
|
e.preventDefault();
|
|
this.scope.find('[data-role="sendToInfo"]').hide();
|
|
this.scope.find('[data-role="sendToForm"]').show();
|
|
this.scope.find('#elInput_cc_wrapper').click();
|
|
},
|
|
|
|
/**
|
|
* When the reply form tabs are toggled between reply/note, toggles a class to enable styling on the nore form
|
|
*
|
|
* @param {event} e Event object
|
|
* @param {object} e Event data object from the tab widget
|
|
* @returns {void}
|
|
*/
|
|
tabChanged: function (e, data) {
|
|
if( data.tab.attr('data-role') == 'noteTab' ){
|
|
this.scope.addClass('cNexusSupportForm_note');
|
|
} else {
|
|
this.scope.removeClass('cNexusSupportForm_note');
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Stock action event handler - adds a reply and/or changes the form controls automatically
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
stockAction: function (e) {
|
|
var self = this;
|
|
var val = $( e.currentTarget ).val();
|
|
var action = this.scope.find('#elSupportReplyForm').attr('action');
|
|
|
|
ips.getAjax()( action + '&stockActionData=' + val, { showLoading: true } )
|
|
.done( function (response) {
|
|
if( _.isObject( response ) ){
|
|
_.each( response, function (value, key) {
|
|
if( key === 'message' ){
|
|
CKEDITOR.instances.message.setData( value );
|
|
} else {
|
|
self.scope.find( '[name="' + key + '"]' ).val( value );
|
|
}
|
|
});
|
|
|
|
// Set the focus to the submit button for ease of use
|
|
self.scope.find('[data-role="primarySubmit"]').focus();
|
|
}
|
|
})
|
|
.fail( function (response) {
|
|
ips.ui.alert.show( {
|
|
type: 'alert',
|
|
icon: 'warn',
|
|
message: ips.getString('support_ajax_error'),
|
|
});
|
|
});
|
|
|
|
}
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/support" javascript_name="ips.support.request.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100"><![CDATA[/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.support.request.js - Support request controller for keyboard shortcuts
|
|
*
|
|
* Author: Rikki Tissier
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.support.request', {
|
|
|
|
initialize: function () {
|
|
this.on( document, 'keypress', this.keyPress );
|
|
this.on( 'quoteBuilt.quote', '.ipsQuote', this.quoteBuilt );
|
|
this.on( window, 'resize', this.resizeInfo );
|
|
|
|
this.setup();
|
|
},
|
|
|
|
setup: function () {
|
|
var self = this;
|
|
|
|
if ( navigator.userAgent.indexOf('Mac OS X') != -1 ) {
|
|
this.scope.find('[data-role="replyForm"] [data-role="primarySubmit"]').attr( { 'title': ips.getString('cmd_and_enter'), 'data-ipsTooltip': '' } );
|
|
this.scope.find('[data-role="noteForm"] button[type="submit"]').attr( { 'title': ips.getString('cmd_and_enter'), 'data-ipsTooltip': '' } );
|
|
} else {
|
|
this.scope.find('[data-role="replyForm"] [data-role="primarySubmit"]').attr( { 'title': ips.getString('ctrl_and_enter'), 'data-ipsTooltip': '' } );
|
|
this.scope.find('[data-role="noteForm"] button[type="submit"]').attr( { 'title': ips.getString('ctrl_and_enter'), 'data-ipsTooltip': '' } );
|
|
}
|
|
|
|
this.scope.find('.ipsQuote:not([data-commerceHandled])').each( function () {
|
|
self._handleQuote( $( this ) );
|
|
});
|
|
|
|
this.resizeInfo();
|
|
},
|
|
|
|
resizeInfo: function () {
|
|
// Set height of ticket info panel
|
|
if( ips.utils.responsive.currentIs('phone') ){
|
|
this.scope.find('#elNexusRequestInfo').css({
|
|
height: 'auto'
|
|
});
|
|
} else {
|
|
this.scope.find('#elNexusRequestInfo').css({
|
|
height: $( window ).height() + 'px'
|
|
});
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Responds to quote being built
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
quoteBuilt: function (e) {
|
|
this._handleQuote( $( e.currentTarget ) );
|
|
},
|
|
|
|
/**
|
|
* Checks if quote is open, and closes it if so
|
|
*
|
|
* @param {element} quote Quote to be checked
|
|
* @returns {void}
|
|
*/
|
|
_handleQuote: function (quote) {
|
|
quote.attr('data-commerceHandled', true);
|
|
var cite = quote.find('.ipsQuote_citation');
|
|
|
|
if( !cite.hasClass('ipsQuote_closed') ){
|
|
var height = quote.height();
|
|
|
|
if( height > 500 ){
|
|
cite.siblings().hide();
|
|
cite.removeClass('ipsQuote_open').addClass('ipsQuote_closed');
|
|
}
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Handles key press
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
keyPress: function (e) {
|
|
|
|
var tag = e.target.tagName.toLowerCase();
|
|
if ( tag != 'body' ) {
|
|
return;
|
|
}
|
|
|
|
switch ( e.which ) {
|
|
case 114: // r
|
|
e.preventDefault();
|
|
this.scope.find('[data-role="replyTab"]').click();
|
|
var editor = ips.ui.editor.getObj( this.scope.find('[data-role="replyForm"] [data-ipsEditor]') );
|
|
editor.unminimize();
|
|
editor.focus();
|
|
break;
|
|
case 110: // n
|
|
e.preventDefault();
|
|
this.scope.find('[data-role="noteTab"]').click();
|
|
var editor = ips.ui.editor.getObj( this.scope.find('[data-role="noteForm"] [data-ipsEditor]') );
|
|
editor.unminimize();
|
|
editor.focus();
|
|
break;
|
|
case 115: // s
|
|
this.scope.find('[data-role="statusMenu"]').click();
|
|
break;
|
|
case 118: // v
|
|
this.scope.find('[data-role="severityMenu"]').click();
|
|
break;
|
|
case 100: // d
|
|
this.scope.find('[data-role="departmentMenu"]').click();
|
|
break;
|
|
case 97: // a
|
|
this.scope.find('[data-role="staffMenu"]').click();
|
|
break;
|
|
case 116: // t
|
|
this.scope.find('[data-role="trackMenu"]').click();
|
|
break;
|
|
case 112: // p
|
|
this.scope.find('[data-role="associatePurchaseMenu"]').click();
|
|
break;
|
|
case 107: // k
|
|
var next = this.scope.find('[data-role="nextRequestLink"]');
|
|
if ( next.length ) {
|
|
window.location = next.attr('href');
|
|
}
|
|
break;
|
|
case 106: // j
|
|
var prev = this.scope.find('[data-role="prevRequestLink"]');
|
|
if ( prev.length ) {
|
|
window.location = prev.attr('href');
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
});
|
|
}(jQuery, _));]]></file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="controllers/support" javascript_name="ips.support.splitForm.js" javascript_type="controller" javascript_version="103005" javascript_position="1000100">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.support.splitForm.js - Controller for link panel in editor
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.admin.support.splitForm', {
|
|
|
|
initialize: function () {
|
|
this.on( 'submit', this.formSubmit );
|
|
},
|
|
|
|
/**
|
|
* Event handler for submitting the form
|
|
*
|
|
* @param {event} e Event object
|
|
* @returns {void}
|
|
*/
|
|
formSubmit: function (e) {
|
|
e.preventDefault();
|
|
|
|
var form = $(this.scope);
|
|
if( form.attr('data-bypassValidation') ){
|
|
return false;
|
|
}
|
|
|
|
var dialog = ips.ui.dialog.getObj( $('[data-role="moderationTools"]') );
|
|
dialog.setLoading(true);
|
|
|
|
var newWindow = window.open( '', '_blank' );
|
|
newWindow.blur();
|
|
window.focus();
|
|
|
|
ips.getAjax()( form.attr('action'), {
|
|
data: form.serialize(),
|
|
type: 'post'
|
|
} )
|
|
.done( function (response, status, jqXHR) {
|
|
if( jqXHR.getAllResponseHeaders().indexOf('X-IPS-FormError: true') !== -1 || jqXHR.getAllResponseHeaders().indexOf('X-IPS-FormNoSubmit: true') !== -1 || jqXHR.getAllResponseHeaders().indexOf('x-ips-formerror: true') !== -1 || jqXHR.getAllResponseHeaders().indexOf('x-ips-formnosubmit: true') !== -1 ){
|
|
dialog.setLoading( false );
|
|
dialog.updateContent( response );
|
|
} else {
|
|
try {
|
|
var json = $.parseJSON( jqXHR.responseText );
|
|
|
|
newWindow.location = json.newUrl;
|
|
window.location = json.oldUrl;
|
|
|
|
} catch (err) {
|
|
newWindow.close();
|
|
dialog.setLoading( false );
|
|
dialog.updateContent( response );
|
|
}
|
|
}
|
|
})
|
|
.fail(function(response){
|
|
newWindow.close();
|
|
form.attr( 'data-bypassValidation', true ).submit();
|
|
});
|
|
|
|
|
|
}
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="front" javascript_path="controllers/support" javascript_name="ips.support.rate.js" javascript_type="controller" javascript_version="103005" javascript_position="1000250">/**
|
|
* Invision Community
|
|
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
|
*
|
|
* ips.support.rate.js
|
|
*
|
|
* Author: Mark Wade
|
|
*/
|
|
;( function($, _, undefined){
|
|
"use strict";
|
|
|
|
ips.controller.register('nexus.front.support.rate', {
|
|
|
|
initialize: function () {
|
|
this.on( 'submitDialog', this.update );
|
|
},
|
|
|
|
update: function (e, data) {
|
|
$(this.scope).html( data.response );
|
|
}
|
|
});
|
|
}(jQuery, _));</file>
|
|
<file javascript_app="nexus" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.store.js" javascript_type="template" javascript_version="103005" javascript_position="1000050"><![CDATA[ips.templates.set('nexus.store.images', " \
|
|
<div class='ipsGrid_span3 ipsAttach ipsImageAttach ipsPad_half ipsAreaBackground_light' id='{{id}}' data-role='file' data-fileid='{{id}}' data-fullsizeurl='{{imagesrc}}' data-thumbnailurl='{{thumbnail}}' data-fileType='image'>\
|
|
<ul class='ipsList_inline ipsImageAttach_controls'>\
|
|
<li><input type='radio' name='{{field_name}}_primary_image' value='{{id}}' title='{{#lang}}makePrimaryProductImage{{/lang}}' data-ipsTooltip></li>\
|
|
<li class='ipsPos_right' data-role='deleteFileWrapper'>\
|
|
<input type='hidden' name='{{field_name}}_keep[{{id}}]' value='1'>\
|
|
<a href='#' data-role='deleteFile' class='ipsButton ipsButton_verySmall ipsButton_light' data-ipsTooltip title='{{#lang}}removeProductImage{{/lang}}'><i class='fa fa-trash-o'></i></a>\
|
|
</li>\
|
|
</ul>\
|
|
<div class='ipsImageAttach_thumb ipsType_center' data-role='preview' data-grid-ratio='65' data-action='insertFile' {{#thumb}}style='background-image: url( {{thumbnail_for_css}} )'{{/thumb}}>\
|
|
{{#status}}\
|
|
<span class='ipsImageAttach_status ipsType_light' data-role='status'>{{{status}}}</span>\
|
|
<span class='ipsAttachment_progress'><span data-role='progressbar'></span></span>\
|
|
{{/status}}\
|
|
{{#thumb}}\
|
|
{{{thumb}}}\
|
|
{{/thumb}}\
|
|
</div>\
|
|
<h2 class='ipsType_reset ipsAttach_title ipsType_medium ipsTruncate ipsTruncate_line' data-role='title'>{{title}}</h2>\
|
|
<p class='ipsType_light'>{{size}} · <span data-role='status'>{{statusText}}</span></p>\
|
|
</div>\
|
|
");
|
|
]]></file>
|
|
<file javascript_app="nexus" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.store.js" javascript_type="template" javascript_version="103005" javascript_position="1000050"><![CDATA[ips.templates.set('nexus.store.productImage', " \
|
|
<a href='{{fullURL}}' data-fullURL='{{fullURL}}' class='cNexusProduct_primaryImage ipsContained' data-ipsLightbox data-ipsLightbox-group='product' data-ipsProductZoom>\
|
|
<img src='{{thumbURL}}' class='ipsImage ipsImage_thumb'>\
|
|
</a>\
|
|
");]]></file>
|
|
<order app="global" path="/dev/js//framework/">templates
|
|
common/ips.loader.js
|
|
common/ui
|
|
common/utils
|
|
common
|
|
controllers</order>
|
|
<order app="global" path="/dev/js//library/">underscore
|
|
jquery
|
|
mustache
|
|
jstz
|
|
Debug.js
|
|
app.js</order>
|
|
<order app="global" path="/dev/js//library//jquery">jquery.js
|
|
jquery.history.js
|
|
jquery.transform.js</order>
|
|
<order app="global" path="/dev/js//library//linkify">linkify.min.js
|
|
linkify-jquery.min.js</order>
|
|
</javascript>
|