Commit inicial - WordPress Análisis de Precios Unitarios

- 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>
This commit is contained in:
root
2025-11-03 21:04:30 -06:00
commit a22573bf0b
24068 changed files with 4993111 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
/**
* Backbone view for rendering and managing the tools category select dropdown.
*/
( function ( $ ) {
module.exports = Backbone.View.extend( {
// Template for the select dropdown
template: _.template( '<select id="tools-category-select" class="tools-category-select"></select>' ),
// Element to which the view is bound
el: '.tvd-filter-tools',
// DOM events handled by the view
events: {
'change #tools-category-select': 'filterTools' // Change event for category selection
},
/**
* Initialize the view.
* @param {object} options - Options for the view.
* @param {object} options.growthToolsView - Reference to the growth tools view.
*/
initialize: function ( options ) {
this.toolsCategory = JSON.parse( TVD_AM_CONST.tools_category ); // Parse tools category JSON
this.growthToolsView = options.growthToolsView; // Reference to the growth tools view
this.render(); // Render the view
},
// Filter tools based on the selected category
filterTools: function () {
this.growthToolsView.filterTools(); // Call the filterTools method of the growth tools view
},
// Render the view
render: function () {
var $select = $( this.template() ); // Create a select element using the template
$select.append( '<option value="">All Tools</option>' ); // Add default "All Tools" option
_.each( this.toolsCategory, function ( category ) {
$select.append( '<option value="' + category + '">' + category + '</option>' ); // Add options for each category
} );
this.$el.html( $select ); // Add the select element to the view's element
this.$( '#tools-category-select' ).select2( {
minimumResultsForSearch: Infinity
} ); // Initialize select2 plugin for the dropdown
return this; // Return the view instance for chaining
}
} );
} )( jQuery );

View File

@@ -0,0 +1,87 @@
( function( $ ) {
/**
* Backbone view for the growth tools search.
*/
module.exports = Backbone.View.extend( {
// Template for the search input
template: _.template( '<input type="search" id="tvd-search-growth-tools" name="tvd-search" placeholder="Search"><button type="button" class="tvd-tools-search-icon" aria-label="Search"><svg class="td-icon"><use xlink:href="#icon-tvd-search"></use></svg></button><button type="button" class="tvd-clear-search-icon" aria-label="Clear" style="display: none;"><svg class="td-icon"><use xlink:href="#icon-tvd-cross"></use></svg></button>' ),
// Element where the view will be rendered
el: '.tvd-search-elem',
// Events handled by the view
events: {
'click .tvd-clear-search-icon': 'clearSearch',
'keyup #tvd-search-growth-tools': 'handleSearchKeyPress',
'input #tvd-search-growth-tools': 'toggleClearIcon'
},
/**
* Initialize the view.
*
* @param {Object} options Options for the view.
*/
initialize(options) {
this.growthToolsView = options.growthToolsView;
},
/**
* Handle search button click.
*/
searchTools: function() {
this.growthToolsView.filterTools();
},
/**
* Handle clear search button click.
*/
clearSearch: function() {
// Clear the search input
$( '#tvd-search-growth-tools' ).val('');
// Call the API to fetch data
this.growthToolsView.filterTools();
// Hide the clear icon
$( '.tvd-clear-search-icon' ).hide();
// Show the search icon
$( '.tvd-tools-search-icon' ).show();
},
/**
* Handle key press event for search input.
*
* @param {Event} event The keyup event.
*/
handleSearchKeyPress: function(event) {
if ( event.keyCode === 13 ) { // Enter key code
this.growthToolsView.filterTools();
}
},
/**
* Toggle the visibility of the clear icon based on input value.
*/
toggleClearIcon: function() {
let inputVal = $( '#tvd-search-growth-tools' ).val();
if ( inputVal.trim().length > 0 ) {
// Hide the search icon
$( '.tvd-tools-search-icon' ).hide();
// Show the clear icon
$( '.tvd-clear-search-icon' ).show();
} else {
// Hide the clear icon
$( '.tvd-clear-search-icon' ).hide();
// Show the search icon
$( '.tvd-tools-search-icon' ).show();
}
},
/**
* Render the view.
*
* @returns {Object} The rendered view element.
*/
render() {
this.$el.html( this.template() );
return this.$el;
},
} );
} )( jQuery );