diff --git a/assets/css/styles.css b/assets/css/styles.css index ca1d095..654f077 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -23,8 +23,8 @@ button { cursor:pointer; } a { text-decoration:none; color:var(--link); } a:hover { text-decoration:underline; } small { padding:5px 0; color:var(--meta); font-size:.8rem; } - input[type="text"]:invalid ~ input[type="submit"] { opacity:0.5; pointer-events:none; } + input[type="search"]::-webkit-search-cancel-button { -webkit-appearance:none; -webkit-mask-image:url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pjxzdmcgdmlld0JveD0iMCAwIDI0IDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xMy40MSwxMmw0LjMtNC4yOWExLDEsMCwxLDAtMS40Mi0xLjQyTDEyLDEwLjU5LDcuNzEsNi4yOUExLDEsMCwwLDAsNi4yOSw3LjcxTDEwLjU5LDEybC00LjMsNC4yOWExLDEsMCwwLDAsMCwxLjQyLDEsMSwwLDAsMCwxLjQyLDBMMTIsMTMuNDFsNC4yOSw0LjNhMSwxLDAsMCwwLDEuNDIsMCwxLDEsMCwwLDAsMC0xLjQyWiIgZmlsbD0iIzY1NjNmZiIvPjwvc3ZnPg=="); } /* Page structure */ diff --git a/engines/special/definition.php b/engines/special/definition.php index 24901f7..d16ac84 100644 --- a/engines/special/definition.php +++ b/engines/special/definition.php @@ -46,7 +46,7 @@ public function parse_results($response) { if(empty($json_response)) return $engine_result; // No results - if(array_key_exists('title', $json_response)) return $engine_result; + if(!array_key_exists('title', $json_response)) return $engine_result; // Grab first result if there are multiple $result = $json_response[0]; diff --git a/engines/special/php.php b/engines/special/php.php index a8b2042..d6723c7 100644 --- a/engines/special/php.php +++ b/engines/special/php.php @@ -12,13 +12,15 @@ class PHPnetRequest extends EngineRequest { public function get_request_url() { $query = str_replace('%22', '\"', $this->query); + + // Format query/url for php.net $query = str_replace('php ', '', $query); $query = str_replace('_', '-', $query); // Is there no query left? Bail! if(empty($query)) return false; - $url = 'https://www.php.net/manual/function.'.urlencode($query); + $url = 'https://www.php.net/manual/function.'.urlencode($query).'.php'; unset($query); @@ -61,7 +63,7 @@ public function parse_results($response) { // Required 'title' => "Function: ".sanitize($title), 'text' => "
".sanitize($php_versions)."
".sanitize($purpose)."
".highlight_string("", 1)."
".$summary."
", - 'source' => "https://www.php.net/manual/function.".urlencode($query) + 'source' => "https://www.php.net/manual/function.".urlencode($query).".php" ); } unset($response, $xpath, $scrape); diff --git a/functions/tools-update.php b/functions/tools-update.php index 2f5faee..78684fb 100644 --- a/functions/tools-update.php +++ b/functions/tools-update.php @@ -17,7 +17,7 @@ function check_update() { $cache_file = ABSPATH.'cache/version.data'; // Currently installed version - $current_version = "1.5"; + $current_version = "1.5.1"; if(!is_file($cache_file)) { // Create update cache file if it doesn't exist @@ -28,6 +28,9 @@ function check_update() { $version = unserialize(file_get_contents($cache_file)); } + // TODO: Remove in a future version + if(!isset($version['current'])) $version['current'] = "1.5.1"; + // Update check, every week if($version['checked'] < time() - 604800) { $response = do_curl_request( @@ -58,7 +61,7 @@ function show_version() { $version = unserialize(file_get_contents($cache_file)); // TODO: Remove in a future version - if(!isset($version['current'])) $version['current'] = "1.5"; + if(!isset($version['current'])) $version['current'] = "1.5.1"; // Format current version for footer $show_version = "Goosle ".$version['current']."."; diff --git a/goosle-cron.php b/goosle-cron.php index aa2b4e2..0000dcb 100644 --- a/goosle-cron.php +++ b/goosle-cron.php @@ -26,7 +26,7 @@ if(verify_hash($opts->hash_auth, $opts->hash, $auth)) { // Check for updates check_update(); - echo "Update cached updated!Most browsers ask that you add %s for the search query as shown in the examples. If your browser has a different value for this simply replace %s with what your browser requires.
Goose comes with several colorschemes. If you don't like the selected colorscheme you can override it with the c argument in your search url. For example: https://example.com/?c=dark.
-You can add this to your bookmark too to always override the colorscheme.
+Goose comes with several colorschemes, configurable through the config.php file.