Changeset 2545236
- Timestamp:
- 06/09/2021 06:22:21 PM (5 years ago)
- Location:
- refyn-search
- Files:
-
- 16 added
- 12 edited
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-2.png (modified) (previous)
-
assets/screenshot-3.png (modified) (previous)
-
assets/screenshot-4.png (modified) (previous)
-
assets/screenshot-5.png (modified) (previous)
-
assets/screenshot-6.png (modified) (previous)
-
tags/2.1.0 (added)
-
tags/2.1.0/LICENSE.txt (added)
-
tags/2.1.0/README.txt (added)
-
tags/2.1.0/assets (added)
-
tags/2.1.0/assets/css (added)
-
tags/2.1.0/assets/css/refyn-search.css (added)
-
tags/2.1.0/assets/js (added)
-
tags/2.1.0/assets/js/refyn-search.js (added)
-
tags/2.1.0/includes (added)
-
tags/2.1.0/includes/admin (added)
-
tags/2.1.0/includes/admin/class-refyn-search-settings.php (added)
-
tags/2.1.0/includes/class-refyn-search-ajax.php (added)
-
tags/2.1.0/includes/class-refyn-search-shortcodes.php (added)
-
tags/2.1.0/includes/class-refyn-search.php (added)
-
tags/2.1.0/refyn-search.php (added)
-
tags/2.1.0/uninstall.php (added)
-
trunk/assets/js/refyn-search.js (modified) (8 diffs)
-
trunk/includes/admin/class-refyn-search-settings.php (modified) (2 diffs)
-
trunk/includes/class-refyn-search.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/refyn-search.php (modified) (1 diff)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
refyn-search/trunk/assets/js/refyn-search.js
r2541576 r2545236 5 5 let ai_settings = settings["settings"]["ai"]; 6 6 let css_trigger = settings["settings"]["trigger"]; 7 let popup = settings["settings"]["popup"]; 7 8 let wp_call = null; //admin-ajax.php ajax call 8 9 let refyn_call = null; //api.refyn.org ajax call 10 let input_focus = "#refyn-input"; 11 let overlay = "#Refyn-Overlay"; 12 13 if (no_found == '') 14 no_found = "Sorry, couldn't find anything."; 15 16 if (popup == 0){ 17 css_trigger = "[type='search']"; 18 input_focus = css_trigger; 19 overlay = "#Refyn-Dropdown"; 20 } 9 21 10 22 (function($){ … … 13 25 14 26 function new_results(results){ 15 if (results.length == 1 && results[0]["category"] == "Products" ) $("#refyn-form").attr("action",web_url + "/shop/");27 if (results.length == 1 && results[0]["category"] == "Products" && popup == 1) $("#refyn-form").attr("action",web_url + "/shop/"); 16 28 results.forEach(function(result){ 17 29 let htmlResult = '<div class="refyn-catagory panel panel-default border-bottom pb-3 pt-1">'; … … 50 62 51 63 try { $(".site-dialog-search").remove(); } catch (e) {} //remove old search from demo.refyn.org 52 64 53 65 $(css_trigger).on("click", function(){ 54 $("#Refyn-Overlay").slideDown("fast"); 55 $("#refyn-input").focus(); 66 $(overlay).slideDown("fast"); 67 if (popup == 0){ 68 $(overlay).detach().appendTo($(this).parent()); 69 } else { 70 $(input_focus).focus(); 71 } 56 72 }); 57 73 58 $("#blur").on("click", function(){ $("#Refyn-Overlay").slideUp("fast"); }); 59 60 $("#refyn-input").keyup( _.debounce(function(e){ //we use debounce just so we can wait for the user to finish typing 61 62 $("#s").val($("#refyn-input").val()); //update hidden search value 63 $("#refyn-form").attr("action",web_url); 74 $(input_focus).on("focusout", function(){ 75 $("#refyn-results").empty(); 76 $(overlay).slideUp("fast"); 77 }); 78 79 $(input_focus).keyup( _.debounce(function(e){ //we use debounce just so we can wait for the user to finish typing 80 81 if (popup == 1){ 82 $("#s").val($(input_focus).val()); //update hidden search value 83 $("#refyn-form").attr("action",web_url); 84 } 64 85 65 86 if (e.keyCode == 27){ // Esc 66 $("#Refyn-Overlay").slideUp("fast"); 87 $("#refyn-results").empty(); 88 $(overlay).slideUp("fast"); 67 89 return; 68 90 } … … 76 98 //must be [0-9 || a-z || A-Z] or backspace 77 99 78 if ( ($( "#refyn-input").val().length >= 3) && (100 if ( ($(input_focus).val().length >= 3) && ( 79 101 (e.keyCode>=48 && e.keyCode<=57) || 80 102 (e.keyCode>=65 && e.keyCode<=90) || … … 92 114 show_loading(); 93 115 }, 94 data: { action : 'refyn_search', search : $( "#refyn-input").val() },116 data: { action : 'refyn_search', search : $(input_focus).val() }, 95 117 }).done(function(results){ 96 118 … … 112 134 show_loading(); 113 135 }, 114 data: { url : web_url, key : unlock, settings : ai_settings, q : $( "#refyn-input").val() },136 data: { url : web_url, key : unlock, settings : ai_settings, q : $(input_focus).val() }, 115 137 }).done(function(out){ 116 138 … … 149 171 }).done(function(results){ 150 172 if (!$("#refyn-results").is(':empty')) return; 173 151 174 if (results.length > 0) { 152 175 new_results(results); 176 } else { 177 //no results message 178 $("#refyn-results").html( 179 '<div class="refyn-catagory panel panel-default border-bottom pb-3 pt-1">' + add_row(add_catagory(no_found)) + '</div>' 180 ); 153 181 } 154 182 }).fail(function(error){ … … 209 237 </div>\ 210 238 <div class="col product-info">\ 211 <span class="row ">' + title + '</span>\239 <span class="row font-weight-bold">' + title + '</span>\ 212 240 <span class="row pt-2 pb-2">' + display["content"] + '</span>\ 213 241 <span class="row text-primary">' + value +'</span>' + display["html"] +'\ -
refyn-search/trunk/includes/admin/class-refyn-search-settings.php
r2541608 r2545236 109 109 </tr> 110 110 <tr> 111 <th scope="row"><label for="use_popup">Display As A Pop-Up</label></th> 112 <td><input name="use_popup" type="checkbox" id="use_popup" value="1" <?php checked(get_option('use_popup')); ?>></td> 113 </tr> 114 <tr> 111 115 <th scope="row"><label for="refyn_page">Install Refyn Page</label></th> 112 116 <td><input name="refyn_page" type="checkbox" id="refyn_page" value="1" <?php checked(get_option('refyn_page')); ?>></td> … … 212 216 <td> 213 217 <input <?php if (!$member) { echo "disabled = true"; } ?> name="use_scraping" type="checkbox" id="use_scraping" value="1" <?php if ($member) { checked(get_option('use_scraping')); } ?>> 214 <p>Enabling Google Scrap will allow the AI to find solutions from Google. <b> This feature is only unlocked for premi umusers only. </b></p>218 <p>Enabling Google Scrap will allow the AI to find solutions from Google. <b> This feature is only unlocked for premire users only. </b></p> 215 219 </td> 216 220 </tr> -
refyn-search/trunk/includes/class-refyn-search.php
r2541576 r2545236 79 79 "trigger" => strval(get_option( 'trigger' )), 80 80 "no_found" => strval(get_option( 'no_found' )), 81 "popup" => strval(get_option( 'use_popup' )), 81 82 "ai" => json_encode(array( 82 83 "max" => get_option( 'num_suggestions' ), … … 105 106 function load_footer() { 106 107 $home = esc_url( home_url( '/' ) ); 107 echo 108 '<div id="Refyn-Overlay" style="display:none"> 109 <style> 110 .refyn-row:hover{ 111 background-color: '.get_option('highlight_color').' !important; 112 } 113 .form-control,.bg-white{ 114 background-color: '.get_option('background_color').' !important; 115 } 116 select.form-control:focus::-ms-value { 117 background-color: '.get_option('background_color').' !important; 118 } 119 .text-dark { 120 color: '.get_option('primary_color').' !important; 121 } 122 .text-primary { 123 color: '.get_option('second_color').' !important; 124 } 125 </style> 126 <div class="row justify-content-center align-items-middle"> 127 <div id="Refyn-Search"> 128 <form id="refyn-form" method="post" role="search" action="'.$home.'"> 108 $form = '<form id="refyn-form" method="post" role="search" action="'.$home.'"> 129 109 <div class="input-group" > 130 110 <div class="form-outline"> … … 134 114 <input type="submit" style="display:none"> 135 115 </div> 136 </form> 116 </form>'; 117 $style = ''; 118 $blur = '<div id="blur"></div>'; 119 $overlay = 'Refyn-Overlay'; 120 if (get_option('use_popup')==0){ 121 $form=''; 122 $overlay = 'Refyn-Dropdown'; 123 $style='style="width:96%;margin-top:1%;position:relative;"'; 124 $blur=''; 125 } 126 echo 127 '<div id="'.$overlay.'" style="display:none"> 128 <style> 129 .refyn-row:hover{ 130 background-color: '.get_option('highlight_color').' !important; 131 } 132 .form-control,.bg-white{ 133 background-color: '.get_option('background_color').' !important; 134 } 135 select.form-control:focus::-ms-value { 136 background-color: '.get_option('background_color').' !important; 137 } 138 .text-dark { 139 color: '.get_option('primary_color').' !important; 140 } 141 .text-primary { 142 color: '.get_option('second_color').' !important; 143 } 144 </style> 145 <div class="row justify-content-center align-items-middle"> 146 <div id="Refyn-Search" '.$style.'> 147 '.$form.' 137 148 <div class="panel panel-default border rounded mt-1"> 138 149 <div class="panel-body bg-white text-dark pt-2 pb-2"> … … 148 159 </div> 149 160 </div> 150 <div id="blur"></div>161 '.$blur.' 151 162 </div>'; 152 163 } … … 157 168 register_setting('refyn_settings','trigger', array('default'=>"[type='search'], #example-id, .example-class")); 158 169 register_setting('refyn_settings','use_refyn', array('default'=>1)); 170 register_setting('refyn_settings','use_popup', array('default'=>1)); 159 171 register_setting('refyn_settings','refyn_page', array('default'=>1)); 160 172 register_setting('refyn_settings','page_title', array('default'=>'Refyn Search')); -
refyn-search/trunk/readme.txt
r2542066 r2545236 4 4 Tags: Refyn Search, Refyn, Refyn Search, Live Search, e-commerce, wordpress e-commerce 5 5 Requires at least: 4.1 6 Tested up to: 5. 7.27 Stable tag: 2. 0.06 Tested up to: 5.5 7 Stable tag: 2.1.0 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 14 14 15 15 REFYN - New Artificial Intelligence (AI) algorithm that can search a site using only features. No keywords, no training, and no index are required! E.g. Query of "4x4" will fetch jeep and SUV even if "4x4" is not in DB at all. It will fetch all images with a certain shape, color, and so on without scanning pixels - Just by cognitively understanding that toilet paper has a shape of a cylinder. 16 17 For a deme test, please visit https://demo.refyn.org ! 16 18 17 19 == Installation == … … 33 35 * Change Log - Please Visit https://refyn.org/changelog/ 34 36 37 = 2.1.0 - 2021/06/09 = 38 39 * Option to use the plugin as a popup or a dropdown list. 40 35 41 = 2.0.0 - 2021/06/02 = 36 42 37 43 * The plugin was redesigned from scratch, plugin size decreased by 98%, and increased overall speed. 38 44 39 * New Refyn SaaS page, login at dash.refyn.org45 * New Refyn SaaS page, login at https://dash.refyn.org 40 46 41 47 = 1.2.2 - 2020/08/05 = -
refyn-search/trunk/refyn-search.php
r2541602 r2545236 7 7 * Author: REFYN 8 8 * Author URI: http://www.refyn.org 9 * WP tested up to: 5.7 .29 * WP tested up to: 5.7 10 10 * Requires PHP: 7.1 11 11 * License: GPLv2 or later -
refyn-search/trunk/uninstall.php
r2541576 r2545236 2 2 wp_delete_post( get_option('page_id'), true); 3 3 delete_option('page_id'); 4 delete_option('use_popup'); 4 5 delete_option('api_key'); 5 6 delete_option('trigger');
Note: See TracChangeset
for help on using the changeset viewer.