/** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.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(); } else { console.log(this.scope); } }, showRegistrationForm: function (e) { e.preventDefault(); this._showRegistrationForm(); }, _showRegistrationForm: function() { this.scope.find('[data-role="memberChoice"]').hide(); this.scope.find('[data-role="newCustomerForm"]').show(); } }); }(jQuery, _)); /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.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', true); textbox.on('keyup', function (e) { button.prop( 'disabled', false ); }); }, submitCoupon: function (e) { e.preventDefault(); } }); }(jQuery, _)); /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.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, _)); /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.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, _)); ').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( $('').attr( 'name', 'x_card_num' ).attr( 'value', $(this.scope).find('[data-card="number"]').val() ) ); $( e.currentTarget ).append( $('').attr( 'name', 'x_exp_date' ).attr( 'value', expmonth + '-' + $(this.scope).find('[data-card="exp_year"]').val() ) ); $( e.currentTarget ).append( $('').attr( 'name', 'x_card_code' ).attr( 'value', $(this.scope).find('[data-card="ccv"]').val() ) ); $( e.currentTarget ).attr( 'action', $(this.scope).attr('data-url') ); } } }); }(jQuery, _));]]> ').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 expmonth = scope.find('[data-card="exp_month"]').val(); if ( expmonth && expmonth.length == 1 ) { expmonth = '0' + expmonth; } Stripe.setPublishableKey( scope.attr('data-key') ); Stripe.card.createToken({ number: scope.find('[data-card="number"]').val(), cvc: scope.find('[data-card="ccv"]').val(), exp_month: expmonth, exp_year: scope.find('[data-card="exp_year"]').val(), }, function(status,response){ loading.remove(); wizardContainer.show(); if ( response.error ) { if ( response.error.type == 'card_error' ) { if ( response.error.param ) { switch ( response.error.param ) { case 'number': scope.find('[data-warning="number"]').text( response.error.message ); break; case 'exp_month': case 'exp_year': scope.find('[data-warning="exp"]').text( response.error.message ); break; case 'cvc': scope.find('[data-warning="ccv"]').text( response.error.message ); break; } } else { ips.ui.alert.show({ type: 'alert', icon: 'warn', message: response.error.message, }); } } else { ips.ui.alert.show({ type: 'alert', icon: 'warn', message: ips.getString('payment_error') }); } } else { scope.closest('form').append( $('').attr( 'name', scope.attr('data-id') + '_card[token]' ).val( response.id ) ); scope.closest('form').submit(); } }); } } }); }(jQuery, _));]]> /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.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, _)); /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.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, _)); /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.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, _)); ').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'); dialogContent.html( response ).show(); $( document ).trigger( 'contentChange', [ dialogContent ] ); } else { var contentElem = $('
').html( response ); var loadingElem = self.scope.find('form').next('.ipsLoading'); ips.getContainer().append( contentElem ); // Show a dialog var dialogRef = ips.ui.dialog.create({ title: ips.getString('cartReview'), content: contentElem, forceReload: true, size: 'medium' }); dialogRef.show(); $( document ).trigger( 'contentChange', [ contentElem ] ); // Remove loading elem loadingElem.remove(); self.updatePriceAndStock(); } }) .fail(function(a){ var form = $(e.target).find('form'); form.attr('data-noajax', 'true'); form.submit(); }); }, /** * 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') ); } }); } }); }(jQuery, _));]]> /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.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, _)); '); icon.on( 'click', function () { ips.ui.alert.show( { type: 'alert', icon: 'info', message: realUrl, }); }); elem.after( icon ).after(' '); } } }); }(jQuery, _));]]> ').attr( 'value', j ).text( response[i][j] ) ); } } else if ( i == 'requiresPurchase' ) { if ( response[i] ) { $('[data-role="noPurchaseWarning"]').addClass('ipsType_warning ipsType_bold'); } else { $('[data-role="noPurchaseWarning"]').removeClass('ipsType_warning ipsType_bold'); } } else { $('[name="' + i + '"]').val( response[i] ); } } }) .fail(function(){ window.href = target.attr('href'); }) } ); }, }); }(jQuery, _));]]> /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.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, _)); /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.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, _)); /** * IPS Social Suite 4 * (c) 2013 Invision Power Services - http://www.invisionpower.com * * ips.support.requestTable.js - Mixin for support request table * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.mixin('support.requestTable', 'core.global.core.table', false, function () { /** * Before setup, add our two custom filters to the params list so they are built into URLs * * @returns {void} */ this.before('setup', function () { this._otherParams.push('department'); this._otherParams.push('statuses'); this._sideMenu = this.scope.find('#elSupport_menu'); }); /** * Before setup, add our two custom filters to the params list so they are built into URLs * * @returns {void} */ this.after('initialize', function () { this.on( 'itemClicked.sideMenu', this.changeRequestView ); }); /** * Returns the current sort by and sort order value * * @returns {object} Object containing by and order keys */ this._getSortValue = function () { return { by: $('#elSortMenu_menu .ipsMenu_itemChecked').attr('data-ipsmenuvalue'), order: $('#elOrderMenu_menu .ipsMenu_itemChecked').attr('data-ipsmenuvalue') }; }; this.changeRequestView = function (e, data) { // Get the selected departments var types = { department: [], status: [], assigned: false, tracked: false, replied: false }; if( data.selectedElem.attr('data-filter') ){ // Unselect everything else this._sideMenu.find('.ipsSideMenu_itemActive').not( data.selectedElem ).removeClass('ipsSideMenu_itemActive'); } var selected = this._sideMenu.find('.ipsSideMenu_itemActive'); if( selected.length ){ selected.each( function (i, elem) { var elem = $( elem ); if( elem.attr('data-type') ){ types[ elem.attr('data-type') ].push( elem.attr('data-ipsMenuValue') ); } else if( elem.attr('data-support-filter') ){ types[ elem.attr('data-support-filter') ] = true; } }); } this.updateURL( { departments: types.department.join(','), statuses: types.status.join(','), assigned: types.assigned, tracked: types.tracked, replied: types.replied, page: 1 }); } }); }(jQuery, _)); \ \ \ ");]]> \
    \
  • \
  • \ \ \
  • \
\
\ {{#status}}\ {{{status}}}\ \ {{/status}}\ {{#thumb}}\ {{{thumb}}}\ {{/thumb}}\
\

{{title}}

\

{{size}} · {{statusText}}

\
\ "); ]]>
templates common/ui common/utils common controllers underscore jquery mustache jstz Debug.js app.js jquery.js jquery.history.js jquery.transform.js xregexp-all.js xregexp-lookbehind.js