- WordPress core y plugins - Tema Twenty Twenty-Four configurado - Plugin allow-unfiltered-html.php simplificado - .gitignore configurado para excluir wp-config.php y uploads 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
61 lines
1.3 KiB
JavaScript
Executable File
61 lines
1.3 KiB
JavaScript
Executable File
/**
|
|
* @description Base View
|
|
* @extends Backbone.View
|
|
*/
|
|
module.exports = Backbone.View.extend( {
|
|
|
|
events: {
|
|
'click .click': '_call',
|
|
'input .input': '_call',
|
|
'change .change': '_call',
|
|
'mousedown .mousedown': '_call',
|
|
'mouseenter .mouseenter': '_call',
|
|
'mouseup .mouseup': '_call',
|
|
'keyup .keyup-enter': '_keyup_enter'
|
|
},
|
|
|
|
initialize: function () {
|
|
|
|
this.render();
|
|
},
|
|
|
|
_call: function ( e ) {
|
|
/**
|
|
* Do not allow actions on disabled controls
|
|
*/
|
|
if ( e.currentTarget.disabled || e.currentTarget.classList.contains( 'tve-disabled' ) ) {
|
|
return false;
|
|
}
|
|
|
|
var m = e.currentTarget.getAttribute( 'data-fn-' + e.type ) || e.currentTarget.getAttribute( 'data-fn' );
|
|
|
|
if ( m && m === '__return_false' ) {
|
|
e.stopPropagation();
|
|
e.preventDefault();
|
|
return false;
|
|
}
|
|
|
|
if ( typeof this[m] === 'function' ) {
|
|
return this[m].call( this, e, e.currentTarget );
|
|
}
|
|
|
|
/**
|
|
* call external function on the base TVE object
|
|
*/
|
|
if ( m && m.indexOf( 'f:' ) === 0 ) {
|
|
var fn = TVE, parts = m.split( ':' )[1].split( '.' ), context = window;
|
|
while ( fn && parts.length ) {
|
|
context = fn;
|
|
fn = fn[parts.shift()];
|
|
}
|
|
if ( typeof fn === 'function' ) {
|
|
return fn.call( context, e );
|
|
}
|
|
}
|
|
},
|
|
|
|
render: function () {
|
|
}
|
|
|
|
} );
|