Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -25,10 +25,7 @@
|
||||
<option value="">- wszystkie grupy -</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="filter-group">
|
||||
<label for="phrase_search"><i class="fa-solid fa-magnifying-glass"></i> Szukaj frazy</label>
|
||||
<input type="text" id="phrase_search" class="form-control" placeholder="Wpisz fragment frazy..." />
|
||||
</div>
|
||||
|
||||
<div class="filter-group terms-columns-group">
|
||||
<label><i class="fa-solid fa-table-columns"></i> Kolumny</label>
|
||||
<div class="terms-columns-box">
|
||||
@@ -87,6 +84,7 @@
|
||||
<i class="fa-solid fa-magnifying-glass"></i> Frazy wyszukiwane (klikniecia >= 1)
|
||||
</div>
|
||||
<div class="terms-search-toolbar">
|
||||
<input type="text" id="phrase_search_search" class="form-control terms-table-search-input" placeholder="Szukaj frazy..." />
|
||||
<label class="terms-search-toolbar-label"><i class="fa-solid fa-filter"></i> Klik. all</label>
|
||||
<input type="number" id="terms_min_clicks_all" class="form-control" min="0" step="1" placeholder=">= np. 100" />
|
||||
<input type="number" id="terms_max_clicks_all" class="form-control" min="0" step="1" placeholder="<= np. 500" />
|
||||
@@ -132,6 +130,7 @@
|
||||
<i class="fa-solid fa-ban"></i> Frazy wykluczajace
|
||||
</div>
|
||||
<div class="terms-negative-toolbar">
|
||||
<input type="text" id="phrase_search_negative" class="form-control terms-table-search-input" placeholder="Szukaj frazy..." />
|
||||
<button type="button" id="terms_delete_selected_negative" class="terms-negative-bulk-btn" disabled>
|
||||
<i class="fa-solid fa-trash"></i> Usun zaznaczone (<span id="terms_negative_selected_count">0</span>)
|
||||
</button>
|
||||
@@ -161,6 +160,7 @@
|
||||
<i class="fa-solid fa-key"></i> Frazy dodane do kampanii/grup reklam
|
||||
</div>
|
||||
<div class="terms-keywords-toolbar">
|
||||
<input type="text" id="phrase_search_keywords" class="form-control terms-table-search-input" placeholder="Szukaj frazy..." />
|
||||
<button type="button" id="terms_add_keyword_btn" class="terms-negative-bulk-btn">
|
||||
<i class="fa-solid fa-plus"></i> Dodaj fraze
|
||||
</button>
|
||||
@@ -1510,7 +1510,7 @@ function build_search_terms_table( rows, negative_keywords )
|
||||
terms_update_search_selection_ui();
|
||||
} );
|
||||
|
||||
var q = $( '#phrase_search' ).val();
|
||||
var q = $( '#phrase_search_search' ).val();
|
||||
terms_search_table.search( q ).draw();
|
||||
terms_restore_saved_page( 'search', terms_search_table );
|
||||
terms_sync_search_row_checkboxes();
|
||||
@@ -1585,7 +1585,7 @@ function build_negative_terms_table( rows )
|
||||
terms_update_negative_selection_ui();
|
||||
} );
|
||||
|
||||
var q = $( '#phrase_search' ).val();
|
||||
var q = $( '#phrase_search_negative' ).val();
|
||||
terms_negative_table.search( q ).draw();
|
||||
terms_restore_saved_page( 'negative', terms_negative_table );
|
||||
terms_sync_negative_row_checkboxes();
|
||||
@@ -1606,7 +1606,7 @@ function build_keywords_table( rows )
|
||||
processing: false,
|
||||
serverSide: false,
|
||||
autoWidth: false,
|
||||
searching: false,
|
||||
searching: true,
|
||||
lengthChange: false,
|
||||
pageLength: 15,
|
||||
pagingType: 'simple_numbers',
|
||||
@@ -1650,7 +1650,7 @@ function build_keywords_table( rows )
|
||||
}
|
||||
});
|
||||
|
||||
var q = $( '#phrase_search' ).val();
|
||||
var q = $( '#phrase_search_keywords' ).val();
|
||||
terms_keywords_table.search( q ).draw();
|
||||
apply_header_titles( '#terms_keywords_table' );
|
||||
terms_render_columns_picker( 'keywords', terms_keywords_table );
|
||||
@@ -2307,13 +2307,23 @@ $( function()
|
||||
});
|
||||
});
|
||||
|
||||
$( 'body' ).on( 'input', '#phrase_search', function()
|
||||
$( 'body' ).on( 'input', '#phrase_search_search', function()
|
||||
{
|
||||
var q = $( this ).val();
|
||||
if ( terms_search_table )
|
||||
terms_search_table.search( q ).draw();
|
||||
});
|
||||
|
||||
$( 'body' ).on( 'input', '#phrase_search_negative', function()
|
||||
{
|
||||
var q = $( this ).val();
|
||||
if ( terms_negative_table )
|
||||
terms_negative_table.search( q ).draw();
|
||||
});
|
||||
|
||||
$( 'body' ).on( 'input', '#phrase_search_keywords', function()
|
||||
{
|
||||
var q = $( this ).val();
|
||||
if ( terms_keywords_table )
|
||||
terms_keywords_table.search( q ).draw();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user