Submit
Path:
~
/
/
usr
/
local
/
sitepad
/
editor
/
site-data
/
plugins
/
kkart-pro
/
assets
/
js
/
admin
/
File Content:
backbone-modal.js
/*global jQuery, Backbone, _ */ ( function( $, Backbone, _ ) { 'use strict'; /** * Kkart Backbone Modal plugin * * @param {object} options */ $.fn.KKARTBackboneModal = function( options ) { return this.each( function() { ( new $.KKARTBackboneModal( $( this ), options ) ); }); }; /** * Initialize the Backbone Modal * * @param {object} element [description] * @param {object} options [description] */ $.KKARTBackboneModal = function( element, options ) { // Set settings var settings = $.extend( {}, $.KKARTBackboneModal.defaultOptions, options ); if ( settings.template ) { new $.KKARTBackboneModal.View({ target: settings.template, string: settings.variable }); } }; /** * Set default options * * @type {object} */ $.KKARTBackboneModal.defaultOptions = { template: '', variable: {} }; /** * Create the Backbone Modal * * @return {null} */ $.KKARTBackboneModal.View = Backbone.View.extend({ tagName: 'div', id: 'kkart-backbone-modal-dialog', _target: undefined, _string: undefined, events: { 'click .modal-close': 'closeButton', 'click #btn-ok' : 'addButton', 'touchstart #btn-ok': 'addButton', 'keydown' : 'keyboardActions' }, resizeContent: function() { var $content = $( '.kkart-backbone-modal-content' ).find( 'article' ); var max_h = $( window ).height() * 0.75; $content.css({ 'max-height': max_h + 'px' }); }, initialize: function( data ) { var view = this; this._target = data.target; this._string = data.string; _.bindAll( this, 'render' ); this.render(); $( window ).resize(function() { view.resizeContent(); }); }, render: function() { var template = wp.template( this._target ); this.$el.append( template( this._string ) ); $( document.body ).css({ 'overflow': 'hidden' }).append( this.$el ); this.resizeContent(); this.$( '.kkart-backbone-modal-content' ).attr( 'tabindex' , '0' ).focus(); $( document.body ).trigger( 'init_tooltips' ); $( document.body ).trigger( 'kkart_backbone_modal_loaded', this._target ); }, closeButton: function( e ) { e.preventDefault(); $( document.body ).trigger( 'kkart_backbone_modal_before_remove', this._target ); this.undelegateEvents(); $( document ).off( 'focusin' ); $( document.body ).css({ 'overflow': 'auto' }); this.remove(); $( document.body ).trigger( 'kkart_backbone_modal_removed', this._target ); }, addButton: function( e ) { $( document.body ).trigger( 'kkart_backbone_modal_response', [ this._target, this.getFormData() ] ); this.closeButton( e ); }, getFormData: function() { var data = {}; $( document.body ).trigger( 'kkart_backbone_modal_before_update', this._target ); $.each( $( 'form', this.$el ).serializeArray(), function( index, item ) { if ( item.name.indexOf( '[]' ) !== -1 ) { item.name = item.name.replace( '[]', '' ); data[ item.name ] = $.makeArray( data[ item.name ] ); data[ item.name ].push( item.value ); } else { data[ item.name ] = item.value; } }); return data; }, keyboardActions: function( e ) { var button = e.keyCode || e.which; // Enter key if ( 13 === button && ! ( e.target.tagName && ( e.target.tagName.toLowerCase() === 'input' || e.target.tagName.toLowerCase() === 'textarea' ) ) ) { this.addButton( e ); } // ESC key if ( 27 === button ) { this.closeButton( e ); } } }); }( jQuery, Backbone, _ ));
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
api-keys.js
3907 bytes
0644
api-keys.min.js
2203 bytes
0644
backbone-modal.js
3564 bytes
0644
backbone-modal.min.js
2245 bytes
0644
kkart-clipboard.js
858 bytes
0644
kkart-clipboard.min.js
327 bytes
0644
kkart-enhanced-select.js
9265 bytes
0644
kkart-enhanced-select.min.js
5366 bytes
0644
kkart-orders.js
1988 bytes
0644
kkart-orders.min.js
1153 bytes
0644
kkart-product-export.js
3627 bytes
0644
kkart-product-export.min.js
1973 bytes
0644
kkart-product-import.js
2643 bytes
0644
kkart-product-import.min.js
1484 bytes
0644
kkart-setup.js
10238 bytes
0644
kkart-setup.min.js
6519 bytes
0644
kkart-shipping-classes.js
8147 bytes
0644
kkart-shipping-classes.min.js
4565 bytes
0644
kkart-shipping-zone-methods.js
15463 bytes
0644
kkart-shipping-zone-methods.min.js
8723 bytes
0644
kkart-shipping-zones.js
9138 bytes
0644
kkart-shipping-zones.min.js
4852 bytes
0644
kkart_admin.js
13768 bytes
0644
kkart_admin.min.js
8261 bytes
0644
marketplace-suggestions.js
15910 bytes
0644
marketplace-suggestions.min.js
6252 bytes
0644
meta-boxes-coupon.js
2029 bytes
0644
meta-boxes-coupon.min.js
1177 bytes
0644
meta-boxes-order.js
46662 bytes
0644
meta-boxes-order.min.js
28628 bytes
0644
meta-boxes-product-variation.js
33142 bytes
0644
meta-boxes-product-variation.min.js
17982 bytes
0644
meta-boxes-product.js
22161 bytes
0644
meta-boxes-product.min.js
13440 bytes
0644
meta-boxes.js
2532 bytes
0644
meta-boxes.min.js
1750 bytes
0644
network-orders.js
2340 bytes
0644
network-orders.min.js
1217 bytes
0644
product-ordering.js
2306 bytes
0644
product-ordering.min.js
1510 bytes
0644
quick-edit.js
6895 bytes
0644
quick-edit.min.js
4435 bytes
0644
reports.js
6463 bytes
0644
reports.min.js
3251 bytes
0644
settings-views-html-settings-tax.js
12267 bytes
0644
settings-views-html-settings-tax.min.js
6142 bytes
0644
settings.js
5488 bytes
0644
settings.min.js
3633 bytes
0644
system-status.js
3577 bytes
0644
system-status.min.js
1967 bytes
0644
term-ordering.js
4268 bytes
0644
term-ordering.min.js
2245 bytes
0644
users.js
3855 bytes
0644
users.min.js
1881 bytes
0644
N4ST4R_ID | Naxtarrr