-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Added support for the Custom Search JSON API.
- Loading branch information
Showing
9 changed files
with
216 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
.switch-wrapper { | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-start; | ||
gap: 14px; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.switch { | ||
position: relative; | ||
display: inline-block; | ||
width: 50px; | ||
height: 24px; | ||
} | ||
|
||
.switch input { | ||
opacity: 0; | ||
width: 0; | ||
height: 0; | ||
overflow: hidden; | ||
} | ||
|
||
.slider { | ||
position: absolute; | ||
cursor: pointer; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
display: flex; | ||
align-items: center; | ||
background-color: #ccc; | ||
-webkit-transition: transform .4s; | ||
transition: transform .4s; | ||
border-radius: 34px; | ||
} | ||
|
||
.slider::before { | ||
position: absolute; | ||
content: ""; | ||
height: 18px; | ||
width: 18px; | ||
left: 2px; | ||
background-color: white; | ||
-webkit-transition: .4s; | ||
transition: .4s; | ||
border-radius: 50%; | ||
} | ||
|
||
input[name="gcs_search_type"]:checked ~ .slider:before { | ||
-webkit-transform: translateX(calc(50px - 20px - 2px)); | ||
-ms-transform: translateX(calc(50px - 20px - 2px)); | ||
transform: translateX(calc(50px - 20px - 2px)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* Assets class. | ||
* | ||
* @package search-with-google | ||
*/ | ||
|
||
namespace RT\Search_With_Google\Inc; | ||
|
||
use RT\Search_With_Google\Inc\Traits\Singleton; | ||
|
||
/** | ||
* Class Assets | ||
*/ | ||
class Assets { | ||
|
||
use Singleton; | ||
|
||
/** | ||
* Construct method. | ||
*/ | ||
protected function __construct() { | ||
|
||
$this->setup_hooks(); | ||
|
||
} | ||
|
||
/** | ||
* Action / Filters to be declare here. | ||
* | ||
* @return void | ||
*/ | ||
protected function setup_hooks() { | ||
|
||
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ) ); | ||
|
||
} | ||
|
||
/** | ||
* Enqueue admin assets. | ||
* | ||
* @param string $hook_suffix Hook suffix. | ||
* | ||
* @return void | ||
*/ | ||
public function enqueue_admin_assets( $hook_suffix ) { | ||
|
||
if ( 'options-reading.php' === $hook_suffix ) { | ||
wp_enqueue_style( | ||
'search-with-google-settings-style', | ||
SEARCH_WITH_GOOGLE_URL . '/assets/css/settings.css', | ||
array(), | ||
filemtime( SEARCH_WITH_GOOGLE_PATH . '/assets/css/settings.css' ) | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters