-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
487 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
(function($) { | ||
|
||
$( document ).ready( function() { | ||
|
||
// Copy the url | ||
|
||
var merge_tag_clipboard = new Clipboard( '#notification-story code' ); | ||
|
||
merge_tag_clipboard.on( 'success', function(e) { | ||
|
||
var $code = $( e.trigger ), | ||
copy_text = $code.find( 'span' ).text(); | ||
|
||
$code.find( 'span' ).text( notification.i18n.copied ); | ||
|
||
setTimeout( function() { | ||
$code.find( 'span' ).text( copy_text ); | ||
}, 800 ); | ||
|
||
} ); | ||
|
||
} ); | ||
|
||
})(jQuery); |
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,93 @@ | ||
/** | ||
* The story styles | ||
*/ | ||
|
||
.notification_page_the-story #wpcontent { | ||
padding-right: 10px; | ||
} | ||
|
||
#notification-story { | ||
max-width: 600px; | ||
margin: 80px auto 0 auto; | ||
|
||
h1 { | ||
font-size: 3rem; | ||
color: #696969; | ||
line-height: 3rem; | ||
} | ||
|
||
p { | ||
font-size: 1.1rem; | ||
} | ||
|
||
.founder { | ||
margin-top: 2rem; | ||
|
||
img { | ||
float: left; | ||
border-radius: 80px; | ||
margin-right: 20px; | ||
} | ||
|
||
.name { | ||
padding-top: 20px; | ||
font-size: 1.1rem; | ||
font-weight: 500; | ||
} | ||
|
||
} | ||
|
||
.skip { | ||
clear: both; | ||
padding-top: 1rem; | ||
text-align: center; | ||
|
||
a { | ||
color: #a0a0a0; | ||
text-decoration: none; | ||
|
||
&:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
code { | ||
font-size: 1.1rem; | ||
position: relative; | ||
padding: 6px 10px; | ||
cursor: pointer; | ||
white-space: nowrap; | ||
max-width: 100%; | ||
|
||
span { | ||
display: none; | ||
position: absolute; | ||
right: -60px; | ||
top: 3px; | ||
font-size: 1rem; | ||
background: #797979; | ||
padding: 4px 4px; | ||
line-height: 1rem; | ||
border-radius: 5px; | ||
color: white; | ||
} | ||
|
||
&:hover span { | ||
display: block; | ||
} | ||
|
||
@media (max-width: 782px) { | ||
overflow-x: auto; | ||
display: block; | ||
|
||
span { | ||
display: none; | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
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
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,106 @@ | ||
<?php | ||
/** | ||
* Share class | ||
* | ||
* @package notification | ||
*/ | ||
|
||
namespace BracketSpace\Notification\Admin; | ||
|
||
use BracketSpace\Notification\Utils\View; | ||
|
||
/** | ||
* Share class | ||
*/ | ||
class Share { | ||
|
||
/** | ||
* Story page hook. | ||
* | ||
* @var string | ||
*/ | ||
public $page_hook = 'none'; | ||
|
||
/** | ||
* Share class constructor. | ||
* | ||
* @since 5.2.2 | ||
* @param View $view View class. | ||
*/ | ||
public function __construct( View $view ) { | ||
$this->view = $view; | ||
} | ||
|
||
/** | ||
* Register Share page under plugin's menu. | ||
* | ||
* @action admin_menu 30 | ||
* | ||
* @return void | ||
*/ | ||
public function register_page() { | ||
|
||
if ( ! notification_display_story() || isset( $_GET['notification-story-skip'] ) ) { | ||
return; | ||
} | ||
|
||
$this->page_hook = add_submenu_page( | ||
'edit.php?post_type=notification', | ||
'', | ||
__( 'The story', 'notification' ), | ||
'manage_options', | ||
'the-story', | ||
array( $this, 'story_page' ) | ||
); | ||
|
||
} | ||
|
||
/** | ||
* Redirects the user to story screen. | ||
* | ||
* @action current_screen | ||
* | ||
* @return void | ||
*/ | ||
public function maybe_redirect() { | ||
|
||
if ( ! notification_display_story() ) { | ||
return; | ||
} | ||
|
||
$screen = get_current_screen(); | ||
|
||
if ( isset( $screen->post_type ) && $screen->post_type == 'notification' && $screen->id != 'notification_page_the-story' ) { | ||
wp_safe_redirect( admin_url( 'edit.php?post_type=notification&page=the-story' ) ); | ||
exit; | ||
} | ||
|
||
} | ||
|
||
/** | ||
* Saves the dismiss action in the options. | ||
* | ||
* @action admin_init | ||
* | ||
* @return void | ||
*/ | ||
public function dismiss_story() { | ||
|
||
if ( isset( $_GET['notification-story-skip'] ) ) { | ||
update_option( 'notification_story_dismissed', true ); | ||
} | ||
|
||
} | ||
|
||
/** | ||
* Displays the Story page. | ||
* | ||
* @return void | ||
*/ | ||
public function story_page() { | ||
|
||
$this->view->get_view( 'story' ); | ||
|
||
} | ||
|
||
} |
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
Oops, something went wrong.