Changeset 2916047
- Timestamp:
- 05/22/2023 06:35:10 PM (3 years ago)
- Location:
- wdv-ajax-search/trunk
- Files:
-
- 9 edited
-
admin/js/wdv-ajax-search-admin.js (modified) (1 diff)
-
admin/partials/wdv-ajax-search-admin-dashboard-display.php (modified) (4 diffs)
-
includes/class-wdv-ajax-search-activator.php (modified) (1 diff)
-
public/class-wdv-ajax-search-public.php (modified) (2 diffs)
-
public/css/wdv-ajax-search-public.css (modified) (5 diffs)
-
public/js/wdv-ajax-search-public.js (modified) (6 diffs)
-
public/partials/wdv-ajax-search-public-shortcode-display.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
wdv-ajax-search.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wdv-ajax-search/trunk/admin/js/wdv-ajax-search-admin.js
r2716038 r2916047 50 50 /*GENERAL*/ 51 51 var general_no_records='No record found'; 52 var general_result=10 ;52 var general_result=1000000; 53 53 var general_search_by='title'; 54 54 var general_type='post,page'; -
wdv-ajax-search/trunk/admin/partials/wdv-ajax-search-admin-dashboard-display.php
r2716038 r2916047 172 172 <input type="text" id="norecord" name="general_no_records" value="No record found"><br> 173 173 174 < label for="results"><?php _e('4. How many search result show on one table page:', 'wdv-ajax-search'); ?></label><br>175 <input type="text" id="results" name="general_result" value="10"><br> 174 <!--<label for="results"><?php _e('4. How many search result show on one table page:', 'wdv-ajax-search'); ?></label><br> 175 <input type="text" id="results" name="general_result" value="10"><br>--> 176 176 177 177 </div> … … 325 325 //**************************** PHP for btn Edit (general) *************************** 326 326 //****************************************************************************************** 327 327 328 //Save form GENERAL options 328 329 if (isset($_POST["editgeneral"])) { … … 332 333 333 334 $general_no_records="No record found"; 334 $general_result=10 ;335 $general_result=1000000; 335 336 $general_type=""; 336 337 $general_search_by="title"; … … 348 349 if(isset($_POST['submit'])){//to run PHP script on submit 349 350 $general_no_records = wdv_ajax_search_test_input($_POST['general_no_records']); 350 $general_result = wdv_ajax_search_test_input($_POST['general_result']); 351 //$general_result = wdv_ajax_search_test_input($_POST['general_result']); 352 $general_result = 1000000; 351 353 if(!empty($_POST['general_search_by'])){ 352 354 $general_search_by = wdv_ajax_search_test_input($_POST['general_search_by']); -
wdv-ajax-search/trunk/includes/class-wdv-ajax-search-activator.php
r2716038 r2916047 50 50 `general_search_by` varchar(250) DEFAULT 'content', 51 51 `general_no_records` varchar(250) DEFAULT 'No record found', 52 `general_result` int(11) DEFAULT 10 ,52 `general_result` int(11) DEFAULT 1000000, 53 53 54 54 `image_show` varchar(250) DEFAULT 'on', -
wdv-ajax-search/trunk/public/class-wdv-ajax-search-public.php
r2907080 r2916047 237 237 <thead> 238 238 <tr> 239 <th width=". $image_width . ">".$introwcount.esc_html__( ' results', 'wdv-ajax-search' ). '<br>'.'('.$pages_count_numb.esc_html__( ' pages)', 'wdv-ajax-search' )."</th>240 241 <th> ".esc_html__( 'page ', 'wdv-ajax-search' ).$carrent_page."</th>239 <th width=". $image_width . ">".$introwcount.esc_html__( ' results', 'wdv-ajax-search' ). "</th> 240 241 <th></th> 242 242 </tr> 243 243 </thead><tbody>"; … … 388 388 <thead> 389 389 <tr> 390 <th width=". $image_width . ">".$introwcount.esc_html__( ' results', 'wdv-ajax-search' ). '<br>'.'('.$pages_count_numb.esc_html__( ' pages)', 'wdv-ajax-search' )."</th>391 392 <th> ".esc_html__( 'page ', 'wdv-ajax-search' ).$carrent_page."</th>390 <th width=". $image_width . ">".$introwcount.esc_html__( ' results', 'wdv-ajax-search' )."</th> 391 392 <th></th> 393 393 </tr> 394 394 </thead><tbody>"; -
wdv-ajax-search/trunk/public/css/wdv-ajax-search-public.css
r2716038 r2916047 20 20 font-size: smaller; 21 21 } 22 /*Search on all site*/23 .wdv-site-search .spinn {24 position: absolute;25 top: 50px;26 right: 20px;27 width: 16px;28 height: 16px;29 }30 22 31 23 .wdv-site-search .wrapper { … … 89 81 .wdv-site-search input[type="text"] { 90 82 color: #666; 83 background: transparent; 91 84 border-radius: 0; 92 width: 100%;85 width: 100%; 93 86 border-left: 1px solid #333; 94 87 border-top: 1px solid #333; 95 88 border-bottom: 1px solid #333; 89 border-color: transparent; 90 vertical-align: middle; 96 91 } 97 92 .wdv-site-search { … … 108 103 } 109 104 .wdv-site-search { 110 position: relative;105 /*position: relative;*/ 111 106 } 112 107 113 108 .wdv-site-search .input-group #search{ 114 109 float:right; 110 } 111 .wdv-site-search .input-group input{ 112 /* position: relative;*/ 113 float:right; 114 width: 85%; 115 height: 3em; 116 padding-left: 1em; 117 } 118 119 .wdv-site-search .cont { 120 position: relative; 121 } 122 /*Search on all site*/ 123 .spinn { 124 position: absolute; 125 top: 1em; 126 right: 1em; 127 width: 1em; 128 height: 1em; 115 129 } 116 130 .wdv-site-search .input-group-addon { … … 138 152 border-right-width: 0; 139 153 border-left-width: 0; 154 height: 3em; 140 155 } 141 156 .wdv-site-search #search { … … 152 167 153 168 .wdv-site-search .fa-search { 154 font-size: 1 6px;155 padding: 1 8px;169 font-size: 1em; 170 padding: 1em; 156 171 } 157 172 -
wdv-ajax-search/trunk/public/js/wdv-ajax-search-public.js
r2716038 r2916047 26 26 $(document).ready(function(){ 27 27 28 let inputs = document.getElementsByTagName('input'); 28 29 30 var newinputs=[]; 31 for (let input of inputs) { 32 if(input.id){ 33 newinputs.push(input); 34 } 35 } 36 37 for (let newinput of newinputs) { 29 38 // fetch data from table without reload/refresh page 30 if(document.getElementById("search")){ 31 loadData(); 32 } 39 loadData(); 40 33 41 34 42 function loadData(query){ 35 var getId=document.getElementById( "search");43 var getId=document.getElementById( newinput.id ); 36 44 var formname = getId.getAttribute("name"); 37 45 $.ajax({ … … 45 53 chache :false, 46 54 success:function(response){ 47 $(".wdv-site-search .result").html(response); 48 $(".wdv-site-search .spinn").remove(); 55 var newres = ".wdv-site-search #result-" + newinput.id.substring(16); 56 $( newres ).html(response); 57 var newspinn = " #spinn-" + newinput.id.substring(16); 58 var addhere = ".wdv-site-search .input-group" + newspinn; 59 $( newspinn ).remove(); 49 60 } 50 61 }); … … 54 65 55 66 // live search data from table without reload/refresh page 56 $(".wdv-site-search #search").keyup(function(){ 67 var wdvsearch = ".wdv-site-search "+ "#" + newinput.id; 68 $( wdvsearch ).keyup(function(){ 57 69 var search = $(this).val(); 58 70 … … 62 74 loadData(); 63 75 //unbind event after first use: 64 $('.wdv-site-search #search').one('keyup',function(){ 65 $(".wdv-site-search").append('<div class="spinn"><i class="fas fa-sync fa-spin"></i></div>'); 76 $( wdvsearch ).one('keyup',function(){ 77 var nspinn = "spinn-" + newinput.id.substring(16); 78 var addhere = ".wdv-site-search .input-group #wdv-ajax-search-" + newinput.id.substring(16); 79 $(addhere).after('<div class="spinn" id=' + nspinn +'><i class="fas fa-sync fa-spin"></i></div>'); 66 80 }); 67 81 } 68 82 }); 69 83 84 if(document.getElementById( newinput.id )){ 85 var inputfocus = document.getElementById( newinput.id ); 86 inputfocus.addEventListener('focus', (event) => { 87 var resultid = 'result-' + newinput.id.substring(16); 88 var result=document.getElementById( resultid ); 89 result.style.display = "block"; 90 }); 91 } 70 92 71 //unbind event after first use:72 $('.wdv-site-search #search').one('keyup',function(){73 $(".wdv-site-search").append('<div class="spinn"><i class="fas fa-sync fa-spin"></i></div>');74 });75 93 76 //show table 77 $('.wdv-site-search #search').click(function() { 78 $('.wdv-site-search .result').css('display', 'block'); 79 80 }); 81 //close table 82 $(document).mouseup(function (e) { 83 var container = $(".wdv-site-search .result"); 84 if (container.has(e.target).length === 0){ 85 container.css('display', 'none'); 86 } 87 }); 94 //unbind event after first use: 95 $( wdvsearch ).one('keyup',function(){ 96 var nspinn = "spinn-" + newinput.id.substring(16); 97 var addhere = ".wdv-site-search .input-group #wdv-ajax-search-" + newinput.id.substring(16); 98 $( addhere ).after('<div class="spinn" id=' + nspinn + '><i class="fas fa-sync fa-spin"></i></div>'); 99 }); 100 101 //show table 102 $( wdvsearch ).click(function() { 103 var res = '.wdv-site-search #result-' + newinput.id; 104 $( res ).css('display', 'block'); 105 }); 106 107 //close table 108 $(document).mouseup(function (e) { 109 var resul = '.wdv-site-search #result-' + newinput.id; 110 var container = $( resul ); 111 if (container.has(e.target).length === 0){ 112 container.css('display', 'none'); 113 } 114 }); 115 116 117 118 } 119 88 120 89 121 … … 105 137 //show next page 106 138 $(document).on('click','.wrapper .wdv-next',function(){ 107 var findid= $(this).parent().attr("id");108 findid='#'+findid;109 $( findid ).css( "display", "none" );139 var findid= $(this).parent().attr("id"); 140 findid='#'+findid; 141 $( findid ).css( "display", "none" ); 110 142 111 143 var newid=Number(findid.slice(5))+1; … … 119 151 }); 120 152 121 if(document.getElementById('search')){122 var inputfocus = document.getElementById('search');123 inputfocus.addEventListener('focus', (event) => {124 var result=document.getElementById('result');125 result.style.display = "block";126 });127 }128 153 129 154 // Close tab by ESC 130 155 $(document).keyup(function(e) { 131 if (e.keyCode==27) {132 var result=document.getElementById('result');156 if (e.keyCode==27) { 157 var result=document.getElementById('result'); 133 158 result.style.display = "none"; 134 }159 } 135 160 }); 161 162 163 164 165 166 167 136 168 137 169 -
wdv-ajax-search/trunk/public/partials/wdv-ajax-search-public-shortcode-display.php
r2716038 r2916047 46 46 box-shadow: 2px 2px 18px 5px rgba(64,148,255,0.45);'";} ?> <?php if($layout_theme==='with-btn'){echo "style='border: 0 solid #ccc;'";} ?>> 47 47 <span class="input-group-addon"><i class="fa fa-search" <?php if($layout_theme==='with-btn'){echo "style='background:#eee;'";} ?>></i></span> 48 <span class="input-group"><input type="text" id="search" class="form-control" autocomplete="off" placeholder="<?php echo $layout_placeholder; ?>" name="<?php echo $wdvajaxsearch_atts['form_name']; ?>" <?php if($layout_theme==='with-btn'){echo "style=' border-top-width: 1px; border-bottom-width: 1px;'";} ?>></span> 48 <span class="input-group"> 49 <input type="text" id='<?php echo "wdv-ajax-search-" . $wdvajaxsearch_atts["form_name"]; ?>' class="form-control" autocomplete="off" placeholder="<?php echo $layout_placeholder; ?>" name="<?php echo $wdvajaxsearch_atts["form_name"]; ?>" <?php if($layout_theme==='with-btn'){echo "style=' border-top-width: 1px; border-bottom-width: 1px;'";} ?>> 50 </span> 49 51 </div> 50 52 51 <div id=" result" class="result"></div>52 <div class="alert">Too many results found. Use a search phrase instead of a search word for a more precise search.</div>53 <div id="<?php echo "result-" . $wdvajaxsearch_atts["form_name"]; ?>" class="result"></div> 54 <div id="<?php echo "alert-" . $wdvajaxsearch_atts["form_name"]; ?>" class="alert">Too many results found. Use a search phrase instead of a search word for a more precise search.</div> 53 55 </form> 54 56 </div> -
wdv-ajax-search/trunk/readme.txt
r2907080 r2916047 85 85 = 1.0.1 = 86 86 = 1.0.2 = 87 = 1.0.3 = 87 88 88 89 == Upgrade Notice == … … 91 92 = 1.0.1 = 92 93 = 1.0.2 = 94 = 1.0.3 = -
wdv-ajax-search/trunk/wdv-ajax-search.php
r2907080 r2916047 16 16 * Plugin Name: WDV Ajax Search 17 17 * Plugin URI: https://wdvillage.com/product/wdv-ajax-search/ 18 * Description: With this plugin you can create different search forms for different post types and put their shortcode on the corresponding page. 19 * Version: 1.0.2 18 * Description: With this plugin you can create different search forms for different post types and put their shortcode on the corresponding page. ATTENTION! After updating to version 1.0.3, you need to open the plugin properties and click on the "Add / Edit Settings" button for each of the shortcodes you created and click on the "Save" button in the modal window that opens. If this is your first time installing this plugin, then just follow the documentation. 19 * 20 * Version: 1.0.3 20 21 * Author: wdvillage 21 22 * Author URI: https://wdvillage.com/
Note: See TracChangeset
for help on using the changeset viewer.