Submit
Path:
~
/
/
usr
/
local
/
sitepad
/
editor
/
site-data
/
plugins
/
kkart-pro
/
assets
/
js
/
admin
/
File Content:
api-keys.js
/*global jQuery, Backbone, _, kkart_admin_api_keys, wcSetClipboard, wcClearClipboard */ (function( $ ) { var APIView = Backbone.View.extend({ /** * Element * * @param {Object} '#key-fields' */ el: $( '#key-fields' ), /** * Events * * @type {Object} */ events: { 'click input#update_api_key': 'saveKey' }, /** * Initialize actions */ initialize: function(){ _.bindAll( this, 'saveKey' ); }, /** * Init jQuery.BlockUI */ block: function() { $( this.el ).block({ message: null, overlayCSS: { background: '#fff', opacity: 0.6 } }); }, /** * Remove jQuery.BlockUI */ unblock: function() { $( this.el ).unblock(); }, /** * Init TipTip */ initTipTip: function( css_class ) { $( document.body ) .on( 'click', css_class, function( evt ) { evt.preventDefault(); if ( ! document.queryCommandSupported( 'copy' ) ) { $( css_class ).parent().find( 'input' ).focus().select(); $( '#copy-error' ).text( kkart_admin_api_keys.clipboard_failed ); } else { $( '#copy-error' ).text( '' ); wcClearClipboard(); wcSetClipboard( $.trim( $( this ).prev( 'input' ).val() ), $( css_class ) ); } } ) .on( 'aftercopy', css_class, function() { $( '#copy-error' ).text( '' ); $( css_class ).tipTip( { 'attribute': 'data-tip', 'activation': 'focus', 'fadeIn': 50, 'fadeOut': 50, 'delay': 0 } ).focus(); } ) .on( 'aftercopyerror', css_class, function() { $( css_class ).parent().find( 'input' ).focus().select(); $( '#copy-error' ).text( kkart_admin_api_keys.clipboard_failed ); } ); }, /** * Create qrcode * * @param {string} consumer_key * @param {string} consumer_secret */ createQRCode: function( consumer_key, consumer_secret ) { $( '#keys-qrcode' ).qrcode({ text: consumer_key + '|' + consumer_secret, width: 120, height: 120 }); }, /** * Save API Key using ajax * * @param {Object} e */ saveKey: function( e ) { e.preventDefault(); var self = this; self.block(); Backbone.ajax({ method: 'POST', dataType: 'json', url: kkart_admin_api_keys.ajax_url, data: { action: 'kkart_update_api_key', security: kkart_admin_api_keys.update_api_nonce, key_id: $( '#key_id', self.el ).val(), description: $( '#key_description', self.el ).val(), user: $( '#key_user', self.el ).val(), permissions: $( '#key_permissions', self.el ).val() }, success: function( response ) { $( '.kkart-api-message', self.el ).remove(); if ( response.success ) { var data = response.data; $( 'h2, h3', self.el ).first().append( '<div class="kkart-api-message updated"><p>' + data.message + '</p></div>' ); if ( 0 < data.consumer_key.length && 0 < data.consumer_secret.length ) { $( '#api-keys-options', self.el ).remove(); $( 'p.submit', self.el ).empty().append( data.revoke_url ); var template = wp.template( 'api-keys-template' ); $( 'p.submit', self.el ).before( template({ consumer_key: data.consumer_key, consumer_secret: data.consumer_secret }) ); self.createQRCode( data.consumer_key, data.consumer_secret ); self.initTipTip( '.copy-key' ); self.initTipTip( '.copy-secret' ); } else { $( '#key_description', self.el ).val( data.description ); $( '#key_user', self.el ).val( data.user_id ); $( '#key_permissions', self.el ).val( data.permissions ); } } else { $( 'h2, h3', self.el ) .first() .append( '<div class="kkart-api-message error"><p>' + response.data.message + '</p></div>' ); } self.unblock(); } }); } }); new APIView(); })( jQuery );
Submit
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