Version Description
- Added - Giveaway Link to Submenu
Download this release
Release Info
Developer | seedprod |
Plugin | Coming Soon Page & Maintenance Mode by SeedProd |
Version | 5.0.26 |
Comparing to | |
See all releases |
Code changes from version 5.0.25 to 5.0.26
- README.txt +7 -1
- coming-soon.php +2 -2
- framework/coming-soon-pro-sidebar.png +0 -0
- framework/framework.php +65 -0
- framework/skin.php +104 -0
- public/images/home-video-teaser.png +0 -0
- public/images/johnturnerpic-300x300.jpg +0 -0
- public/images/jt-compressor.png +0 -0
- public/images/rafflepress-logo.png +0 -0
- public/vendor/tingle/tingle.css +285 -0
- public/vendor/tingle/tingle.js +440 -0
- public/vendor/tingle/tingle.min.css +1 -0
- public/vendor/tingle/tingle.min.js +1 -0
- resources/views/giveaways.php +180 -0
README.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.seedprod.com
|
|
4 |
Tags: maintenance mode, coming soon page, coming soon, under construction, landing page, launch, maintenance, construction, offline, unavailable, under construction page, launch page
|
5 |
Requires at least: 3.5.1
|
6 |
Tested up to: 5.2
|
7 |
-
Stable tag: 5.0.
|
8 |
Text Domain: coming-soon
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -115,6 +115,9 @@ This is always a caching issue. Go to the caching plugin's setting page and clea
|
|
115 |
4. Design Page
|
116 |
|
117 |
== Changelog ==
|
|
|
|
|
|
|
118 |
= 5.0.25 =
|
119 |
* Fixed - Documentation Link
|
120 |
* Tweak - Removed plugin recommendation
|
@@ -228,6 +231,9 @@ This is always a caching issue. Go to the caching plugin's setting page and clea
|
|
228 |
* Initial Commit
|
229 |
|
230 |
== Upgrade Notice ==
|
|
|
|
|
|
|
231 |
= 5.0.25 =
|
232 |
* Fixed - Documentation Link
|
233 |
* Tweak - Removed plugin recommendation
|
4 |
Tags: maintenance mode, coming soon page, coming soon, under construction, landing page, launch, maintenance, construction, offline, unavailable, under construction page, launch page
|
5 |
Requires at least: 3.5.1
|
6 |
Tested up to: 5.2
|
7 |
+
Stable tag: 5.0.26
|
8 |
Text Domain: coming-soon
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
115 |
4. Design Page
|
116 |
|
117 |
== Changelog ==
|
118 |
+
= 5.0.26 =
|
119 |
+
* Added - Giveaway Link to Submenu
|
120 |
+
|
121 |
= 5.0.25 =
|
122 |
* Fixed - Documentation Link
|
123 |
* Tweak - Removed plugin recommendation
|
231 |
* Initial Commit
|
232 |
|
233 |
== Upgrade Notice ==
|
234 |
+
= 5.0.26 =
|
235 |
+
* Added - Giveaway Link to Submenu
|
236 |
+
|
237 |
= 5.0.25 =
|
238 |
* Fixed - Documentation Link
|
239 |
* Tweak - Removed plugin recommendation
|
coming-soon.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Coming Soon Page & Maintenance Mode by SeedProd
|
4 |
* Plugin URI: http://www.seedprod.com
|
5 |
* Description: The #1 Coming Soon Page, Under Construction & Maintenance Mode plugin for WordPress.
|
6 |
-
* Version: 5.0.
|
7 |
* Author: SeedProd
|
8 |
* Author URI: http://www.seedprod.com
|
9 |
* Text Domain: coming-soon
|
@@ -20,7 +20,7 @@ define('SEED_CSP4_SHORTNAME', 'seed_csp4'); // Used to reference namespace funct
|
|
20 |
define('SEED_CSP4_SLUG', 'coming-soon/coming-soon.php'); // Used for settings link.
|
21 |
define('SEED_CSP4_TEXTDOMAIN', 'coming-soon'); // Your textdomain
|
22 |
define('SEED_CSP4_PLUGIN_NAME', __('Coming Soon Page & Maintenance Mode by SeedProd', 'coming-soon')); // Plugin Name shows up on the admin settings screen.
|
23 |
-
define('SEED_CSP4_VERSION', '5.0.
|
24 |
define('SEED_CSP4_PLUGIN_PATH', plugin_dir_path(__FILE__)); // Example output: /Applications/MAMP/htdocs/wordpress/wp-content/plugins/seed_csp4/
|
25 |
define('SEED_CSP4_PLUGIN_URL', plugin_dir_url(__FILE__)); // Example output: http://localhost:8888/wordpress/wp-content/plugins/seed_csp4/
|
26 |
define('SEED_CSP4_TABLENAME', 'seed_csp4_subscribers');
|
3 |
* Plugin Name: Coming Soon Page & Maintenance Mode by SeedProd
|
4 |
* Plugin URI: http://www.seedprod.com
|
5 |
* Description: The #1 Coming Soon Page, Under Construction & Maintenance Mode plugin for WordPress.
|
6 |
+
* Version: 5.0.26
|
7 |
* Author: SeedProd
|
8 |
* Author URI: http://www.seedprod.com
|
9 |
* Text Domain: coming-soon
|
20 |
define('SEED_CSP4_SLUG', 'coming-soon/coming-soon.php'); // Used for settings link.
|
21 |
define('SEED_CSP4_TEXTDOMAIN', 'coming-soon'); // Your textdomain
|
22 |
define('SEED_CSP4_PLUGIN_NAME', __('Coming Soon Page & Maintenance Mode by SeedProd', 'coming-soon')); // Plugin Name shows up on the admin settings screen.
|
23 |
+
define('SEED_CSP4_VERSION', '5.0.26'); // Plugin Version Number. Recommend you use Semantic Versioning http://semver.org/
|
24 |
define('SEED_CSP4_PLUGIN_PATH', plugin_dir_path(__FILE__)); // Example output: /Applications/MAMP/htdocs/wordpress/wp-content/plugins/seed_csp4/
|
25 |
define('SEED_CSP4_PLUGIN_URL', plugin_dir_url(__FILE__)); // Example output: http://localhost:8888/wordpress/wp-content/plugins/seed_csp4/
|
26 |
define('SEED_CSP4_TABLENAME', 'seed_csp4_subscribers');
|
framework/coming-soon-pro-sidebar.png
CHANGED
Binary file
|
framework/framework.php
CHANGED
@@ -158,6 +158,7 @@ class SEED_CSP4_ADMIN
|
|
158 |
wp_enqueue_script('wp-lists');
|
159 |
wp_enqueue_script('seed_csp4-framework-js', SEED_CSP4_PLUGIN_URL . 'framework/settings-scripts.js', array( 'jquery' ), $this->plugin_version);
|
160 |
wp_enqueue_script('seed_csp4-magnific-popup-js', SEED_CSP4_PLUGIN_URL . 'public/vendor/magnific-popup/jquery.magnific-popup.min.js', array( 'jquery' ), $this->plugin_version);
|
|
|
161 |
wp_enqueue_script('theme-preview');
|
162 |
wp_enqueue_style('thickbox');
|
163 |
wp_enqueue_style('media-upload');
|
@@ -166,6 +167,7 @@ class SEED_CSP4_ADMIN
|
|
166 |
wp_enqueue_style('font-awesome-solid', SEED_CSP4_PLUGIN_URL . 'public/vendor/fontawesome/css/solid.min.css', false, $this->plugin_version, false, $this->plugin_version);
|
167 |
wp_enqueue_style('font-awesome', SEED_CSP4_PLUGIN_URL . 'public/vendor/fontawesome/css/fontawesome.min.css', false, $this->plugin_version, false, $this->plugin_version);
|
168 |
wp_enqueue_style('seed_csp4-magnific-popup-js', SEED_CSP4_PLUGIN_URL . 'public/vendor/magnific-popup/magnific-popup.css', false, $this->plugin_version, false, $this->plugin_version);
|
|
|
169 |
}
|
170 |
|
171 |
/**
|
@@ -213,6 +215,8 @@ class SEED_CSP4_ADMIN
|
|
213 |
'seed_csp4_stockimages',
|
214 |
array( &$this , 'stockimages_page' )
|
215 |
);
|
|
|
|
|
216 |
|
217 |
add_submenu_page(
|
218 |
'seed_csp4',
|
@@ -222,6 +226,18 @@ class SEED_CSP4_ADMIN
|
|
222 |
'seed_csp4_subscribers',
|
223 |
array( &$this , 'subscribers_page' )
|
224 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
|
226 |
add_submenu_page(
|
227 |
'seed_csp4',
|
@@ -243,6 +259,11 @@ class SEED_CSP4_ADMIN
|
|
243 |
include SEED_CSP4_PLUGIN_PATH.'resources/views/stockimages.php';
|
244 |
}
|
245 |
|
|
|
|
|
|
|
|
|
|
|
246 |
public function subscribers_page()
|
247 |
{
|
248 |
include SEED_CSP4_PLUGIN_PATH.'resources/views/subscribers.php';
|
@@ -859,4 +880,48 @@ function seed_csp4_set_user_settings()
|
|
859 |
update_user_option($user_id, 'user-settings', http_build_query($user_settings), false);
|
860 |
update_user_option($user_id, 'user-settings-time', time(), false);
|
861 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
862 |
}
|
158 |
wp_enqueue_script('wp-lists');
|
159 |
wp_enqueue_script('seed_csp4-framework-js', SEED_CSP4_PLUGIN_URL . 'framework/settings-scripts.js', array( 'jquery' ), $this->plugin_version);
|
160 |
wp_enqueue_script('seed_csp4-magnific-popup-js', SEED_CSP4_PLUGIN_URL . 'public/vendor/magnific-popup/jquery.magnific-popup.min.js', array( 'jquery' ), $this->plugin_version);
|
161 |
+
wp_enqueue_script('seed_csp4-tingle', SEED_CSP4_PLUGIN_URL . 'public/vendor/tingle/tingle.min.js', array(), $this->plugin_version);
|
162 |
wp_enqueue_script('theme-preview');
|
163 |
wp_enqueue_style('thickbox');
|
164 |
wp_enqueue_style('media-upload');
|
167 |
wp_enqueue_style('font-awesome-solid', SEED_CSP4_PLUGIN_URL . 'public/vendor/fontawesome/css/solid.min.css', false, $this->plugin_version, false, $this->plugin_version);
|
168 |
wp_enqueue_style('font-awesome', SEED_CSP4_PLUGIN_URL . 'public/vendor/fontawesome/css/fontawesome.min.css', false, $this->plugin_version, false, $this->plugin_version);
|
169 |
wp_enqueue_style('seed_csp4-magnific-popup-js', SEED_CSP4_PLUGIN_URL . 'public/vendor/magnific-popup/magnific-popup.css', false, $this->plugin_version, false, $this->plugin_version);
|
170 |
+
wp_enqueue_style('seed_csp4-tingle-css', SEED_CSP4_PLUGIN_URL . 'public/vendor/tingle/tingle.min.css', false, $this->plugin_version, false, $this->plugin_version);
|
171 |
}
|
172 |
|
173 |
/**
|
215 |
'seed_csp4_stockimages',
|
216 |
array( &$this , 'stockimages_page' )
|
217 |
);
|
218 |
+
|
219 |
+
|
220 |
|
221 |
add_submenu_page(
|
222 |
'seed_csp4',
|
226 |
'seed_csp4_subscribers',
|
227 |
array( &$this , 'subscribers_page' )
|
228 |
);
|
229 |
+
|
230 |
+
$plugins = seed_csp4_plugins_active();
|
231 |
+
if($plugins['rafflepress-pro'] == 'Not Installed'){
|
232 |
+
add_submenu_page(
|
233 |
+
'seed_csp4',
|
234 |
+
__("Giveaways", 'coming-soon'),
|
235 |
+
__("Giveaways", 'coming-soon'),
|
236 |
+
'manage_options',
|
237 |
+
'seed_csp4_giveaways',
|
238 |
+
array( &$this , 'giveaways_page' )
|
239 |
+
);
|
240 |
+
}
|
241 |
|
242 |
add_submenu_page(
|
243 |
'seed_csp4',
|
259 |
include SEED_CSP4_PLUGIN_PATH.'resources/views/stockimages.php';
|
260 |
}
|
261 |
|
262 |
+
public function giveaways_page()
|
263 |
+
{
|
264 |
+
include SEED_CSP4_PLUGIN_PATH.'resources/views/giveaways.php';
|
265 |
+
}
|
266 |
+
|
267 |
public function subscribers_page()
|
268 |
{
|
269 |
include SEED_CSP4_PLUGIN_PATH.'resources/views/subscribers.php';
|
880 |
update_user_option($user_id, 'user-settings', http_build_query($user_settings), false);
|
881 |
update_user_option($user_id, 'user-settings-time', time(), false);
|
882 |
}
|
883 |
+
}
|
884 |
+
|
885 |
+
|
886 |
+
function seed_csp4_plugins_active(){
|
887 |
+
// check if plugin is installed
|
888 |
+
$am_plugins = array(
|
889 |
+
'rafflepress/rafflepress.php' => 'rafflepress' ,
|
890 |
+
'rafflepress-pro/rafflepress-pro.php' => 'rafflepress-pro' ,
|
891 |
+
);
|
892 |
+
$all_plugins = get_plugins();
|
893 |
+
|
894 |
+
$response = array();
|
895 |
+
|
896 |
+
foreach ($am_plugins as $slug => $label) {
|
897 |
+
if (array_key_exists($slug, $all_plugins)) {
|
898 |
+
if (is_plugin_active($slug)) {
|
899 |
+
$response[$label] = 'Active';
|
900 |
+
} else {
|
901 |
+
$response[$label] = 'Inactive';
|
902 |
+
}
|
903 |
+
} else {
|
904 |
+
$response[$label]= 'Not Installed';
|
905 |
+
}
|
906 |
+
}
|
907 |
+
return $response;
|
908 |
+
}
|
909 |
+
|
910 |
+
|
911 |
+
function seed_csp4_disable_admin_notices()
|
912 |
+
{
|
913 |
+
global $wp_filter;
|
914 |
+
if (is_user_admin()) {
|
915 |
+
if (isset($wp_filter['user_admin_notices'])) {
|
916 |
+
unset($wp_filter['user_admin_notices']);
|
917 |
+
}
|
918 |
+
} elseif (isset($wp_filter['admin_notices'])) {
|
919 |
+
unset($wp_filter['admin_notices']);
|
920 |
+
}
|
921 |
+
if (isset($wp_filter['all_admin_notices'])) {
|
922 |
+
unset($wp_filter['all_admin_notices']);
|
923 |
+
}
|
924 |
+
}
|
925 |
+
if (!empty($_GET['page']) && strpos($_GET['page'], 'seed_csp4') !== false) {
|
926 |
+
add_action('admin_print_scripts', 'seed_csp4_disable_admin_notices');
|
927 |
}
|
framework/skin.php
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Skin class.
|
4 |
+
*
|
5 |
+
* @since 6.0.0
|
6 |
+
*
|
7 |
+
* @package ComingSoon
|
8 |
+
* @subpackage Upgrader Skin
|
9 |
+
* @author Chris Christoff
|
10 |
+
*/
|
11 |
+
|
12 |
+
// Exit if accessed directly
|
13 |
+
if (! defined('ABSPATH')) {
|
14 |
+
exit;
|
15 |
+
}
|
16 |
+
|
17 |
+
class ComingSoon_Skin extends WP_Upgrader_Skin
|
18 |
+
{
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Primary class constructor.
|
22 |
+
*
|
23 |
+
* @since 6.0.0
|
24 |
+
*
|
25 |
+
* @param array $args Empty array of args (we will use defaults).
|
26 |
+
*/
|
27 |
+
public function __construct($args = array())
|
28 |
+
{
|
29 |
+
parent::__construct();
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Set the upgrader object and store it as a property in the parent class.
|
34 |
+
*
|
35 |
+
* @since 6.0.0
|
36 |
+
*
|
37 |
+
* @param object $upgrader The upgrader object (passed by reference).
|
38 |
+
*/
|
39 |
+
public function set_upgrader(&$upgrader)
|
40 |
+
{
|
41 |
+
if (is_object($upgrader)) {
|
42 |
+
$this->upgrader =& $upgrader;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Set the upgrader result and store it as a property in the parent class.
|
48 |
+
*
|
49 |
+
* @since 6.0.0
|
50 |
+
*
|
51 |
+
* @param object $result The result of the install process.
|
52 |
+
*/
|
53 |
+
public function set_result($result)
|
54 |
+
{
|
55 |
+
$this->result = $result;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Empty out the header of its HTML content and only check to see if it has
|
60 |
+
* been performed or not.
|
61 |
+
*
|
62 |
+
* @since 6.0.0
|
63 |
+
*/
|
64 |
+
public function header()
|
65 |
+
{
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Empty out the footer of its HTML contents.
|
70 |
+
*
|
71 |
+
* @since 6.0.0
|
72 |
+
*/
|
73 |
+
public function footer()
|
74 |
+
{
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Instead of outputting HTML for errors, json_encode the errors and send them
|
79 |
+
* back to the Ajax script for processing.
|
80 |
+
*
|
81 |
+
* @since 6.0.0
|
82 |
+
*
|
83 |
+
* @param array $errors Array of errors with the install process.
|
84 |
+
*/
|
85 |
+
public function error($errors)
|
86 |
+
{
|
87 |
+
if (! empty($errors)) {
|
88 |
+
echo json_encode(array( 'error' => esc_html__('There was an error installing the addon. Please try again.', 'coming-soon') ));
|
89 |
+
die;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Empty out the feedback method to prevent outputting HTML strings as the install
|
95 |
+
* is progressing.
|
96 |
+
*
|
97 |
+
* @since 6.0.0
|
98 |
+
*
|
99 |
+
* @param string $string The feedback string.
|
100 |
+
*/
|
101 |
+
public function feedback($string)
|
102 |
+
{
|
103 |
+
}
|
104 |
+
}
|
public/images/home-video-teaser.png
ADDED
Binary file
|
public/images/johnturnerpic-300x300.jpg
ADDED
Binary file
|
public/images/jt-compressor.png
ADDED
Binary file
|
public/images/rafflepress-logo.png
ADDED
Binary file
|
public/vendor/tingle/tingle.css
ADDED
@@ -0,0 +1,285 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* ----------------------------------------------------------- */
|
2 |
+
/* == tingle v0.15.1 */
|
3 |
+
/* ----------------------------------------------------------- */
|
4 |
+
|
5 |
+
.tingle-modal * {
|
6 |
+
box-sizing: border-box;
|
7 |
+
}
|
8 |
+
|
9 |
+
.tingle-modal {
|
10 |
+
position: fixed;
|
11 |
+
top: 0;
|
12 |
+
right: 0;
|
13 |
+
bottom: 0;
|
14 |
+
left: 0;
|
15 |
+
z-index: 1000;
|
16 |
+
display: -ms-flexbox;
|
17 |
+
display: flex;
|
18 |
+
visibility: hidden;
|
19 |
+
-ms-flex-direction: column;
|
20 |
+
flex-direction: column;
|
21 |
+
-ms-flex-align: center;
|
22 |
+
align-items: center;
|
23 |
+
overflow: hidden;
|
24 |
+
-webkit-overflow-scrolling: touch;
|
25 |
+
background: rgba(0, 0, 0, .85);
|
26 |
+
opacity: 0;
|
27 |
+
-webkit-user-select: none;
|
28 |
+
-moz-user-select: none;
|
29 |
+
-ms-user-select: none;
|
30 |
+
user-select: none;
|
31 |
+
cursor: pointer;
|
32 |
+
}
|
33 |
+
|
34 |
+
/* confirm and alerts
|
35 |
+
-------------------------------------------------------------- */
|
36 |
+
|
37 |
+
.tingle-modal--confirm .tingle-modal-box {
|
38 |
+
text-align: center;
|
39 |
+
}
|
40 |
+
|
41 |
+
/* modal
|
42 |
+
-------------------------------------------------------------- */
|
43 |
+
|
44 |
+
.tingle-modal--noOverlayClose {
|
45 |
+
cursor: default;
|
46 |
+
}
|
47 |
+
|
48 |
+
.tingle-modal--noClose .tingle-modal__close {
|
49 |
+
display: none;
|
50 |
+
}
|
51 |
+
|
52 |
+
.tingle-modal__close {
|
53 |
+
position: fixed;
|
54 |
+
top: 2rem;
|
55 |
+
right: 2rem;
|
56 |
+
z-index: 1000;
|
57 |
+
padding: 0;
|
58 |
+
width: 2rem;
|
59 |
+
height: 2rem;
|
60 |
+
border: none;
|
61 |
+
background-color: transparent;
|
62 |
+
color: #fff;
|
63 |
+
cursor: pointer;
|
64 |
+
}
|
65 |
+
|
66 |
+
.tingle-modal__close svg * {
|
67 |
+
fill: currentColor;
|
68 |
+
}
|
69 |
+
|
70 |
+
.tingle-modal__closeLabel {
|
71 |
+
display: none;
|
72 |
+
}
|
73 |
+
|
74 |
+
.tingle-modal__close:hover {
|
75 |
+
color: #fff;
|
76 |
+
}
|
77 |
+
|
78 |
+
.tingle-modal-box {
|
79 |
+
position: relative;
|
80 |
+
-ms-flex-negative: 0;
|
81 |
+
flex-shrink: 0;
|
82 |
+
margin-top: auto;
|
83 |
+
margin-bottom: auto;
|
84 |
+
width: 60%;
|
85 |
+
border-radius: 4px;
|
86 |
+
background: #fff;
|
87 |
+
opacity: 1;
|
88 |
+
cursor: auto;
|
89 |
+
will-change: transform, opacity;
|
90 |
+
}
|
91 |
+
|
92 |
+
.tingle-modal-box__content {
|
93 |
+
padding: 3rem 3rem;
|
94 |
+
}
|
95 |
+
|
96 |
+
.tingle-modal-box__footer {
|
97 |
+
padding: 1.5rem 2rem;
|
98 |
+
width: auto;
|
99 |
+
border-bottom-right-radius: 4px;
|
100 |
+
border-bottom-left-radius: 4px;
|
101 |
+
background-color: #f5f5f5;
|
102 |
+
cursor: auto;
|
103 |
+
}
|
104 |
+
|
105 |
+
.tingle-modal-box__footer::after {
|
106 |
+
display: table;
|
107 |
+
clear: both;
|
108 |
+
content: "";
|
109 |
+
}
|
110 |
+
|
111 |
+
.tingle-modal-box__footer--sticky {
|
112 |
+
position: fixed;
|
113 |
+
bottom: -200px; /* TODO : find a better way */
|
114 |
+
z-index: 10001;
|
115 |
+
opacity: 1;
|
116 |
+
transition: bottom .3s ease-in-out .3s;
|
117 |
+
}
|
118 |
+
|
119 |
+
/* state
|
120 |
+
-------------------------------------------------------------- */
|
121 |
+
|
122 |
+
.tingle-enabled {
|
123 |
+
position: fixed;
|
124 |
+
right: 0;
|
125 |
+
left: 0;
|
126 |
+
overflow: hidden;
|
127 |
+
}
|
128 |
+
|
129 |
+
.tingle-modal--visible .tingle-modal-box__footer {
|
130 |
+
bottom: 0;
|
131 |
+
}
|
132 |
+
|
133 |
+
.tingle-enabled .tingle-content-wrapper {
|
134 |
+
filter: blur(8px);
|
135 |
+
}
|
136 |
+
|
137 |
+
.tingle-modal--visible {
|
138 |
+
visibility: visible;
|
139 |
+
opacity: 1;
|
140 |
+
}
|
141 |
+
|
142 |
+
.tingle-modal--visible .tingle-modal-box {
|
143 |
+
animation: scale .2s cubic-bezier(.68, -.55, .265, 1.55) forwards;
|
144 |
+
}
|
145 |
+
|
146 |
+
.tingle-modal--overflow {
|
147 |
+
overflow-y: scroll;
|
148 |
+
padding-top: 8vh;
|
149 |
+
}
|
150 |
+
|
151 |
+
/* btn
|
152 |
+
-------------------------------------------------------------- */
|
153 |
+
|
154 |
+
.tingle-btn {
|
155 |
+
display: inline-block;
|
156 |
+
margin: 0 .5rem;
|
157 |
+
padding: 1rem 2rem;
|
158 |
+
border: none;
|
159 |
+
background-color: grey;
|
160 |
+
box-shadow: none;
|
161 |
+
color: #fff;
|
162 |
+
vertical-align: middle;
|
163 |
+
text-decoration: none;
|
164 |
+
font-size: inherit;
|
165 |
+
font-family: inherit;
|
166 |
+
line-height: normal;
|
167 |
+
cursor: pointer;
|
168 |
+
transition: background-color .4s ease;
|
169 |
+
}
|
170 |
+
|
171 |
+
.tingle-btn--primary {
|
172 |
+
background-color: #3498db;
|
173 |
+
}
|
174 |
+
|
175 |
+
.tingle-btn--danger {
|
176 |
+
background-color: #e74c3c;
|
177 |
+
}
|
178 |
+
|
179 |
+
.tingle-btn--default {
|
180 |
+
background-color: #34495e;
|
181 |
+
}
|
182 |
+
|
183 |
+
.tingle-btn--pull-left {
|
184 |
+
float: left;
|
185 |
+
}
|
186 |
+
|
187 |
+
.tingle-btn--pull-right {
|
188 |
+
float: right;
|
189 |
+
}
|
190 |
+
|
191 |
+
/* responsive
|
192 |
+
-------------------------------------------------------------- */
|
193 |
+
|
194 |
+
@media (max-width : 540px) {
|
195 |
+
.tingle-modal {
|
196 |
+
top: 0px;
|
197 |
+
display: block;
|
198 |
+
padding-top: 60px;
|
199 |
+
width: 100%;
|
200 |
+
}
|
201 |
+
|
202 |
+
.tingle-modal-box {
|
203 |
+
width: auto;
|
204 |
+
border-radius: 0;
|
205 |
+
}
|
206 |
+
|
207 |
+
.tingle-modal-box__content {
|
208 |
+
overflow-y: scroll;
|
209 |
+
}
|
210 |
+
|
211 |
+
.tingle-modal--noClose {
|
212 |
+
top: 0;
|
213 |
+
}
|
214 |
+
|
215 |
+
.tingle-modal--noOverlayClose {
|
216 |
+
padding-top: 0;
|
217 |
+
}
|
218 |
+
|
219 |
+
.tingle-modal-box__footer .tingle-btn {
|
220 |
+
display: block;
|
221 |
+
float: none;
|
222 |
+
margin-bottom: 1rem;
|
223 |
+
width: 100%;
|
224 |
+
}
|
225 |
+
|
226 |
+
.tingle-modal__close {
|
227 |
+
top: 0;
|
228 |
+
right: 0;
|
229 |
+
left: 0;
|
230 |
+
display: block;
|
231 |
+
width: 100%;
|
232 |
+
height: 60px;
|
233 |
+
border: none;
|
234 |
+
background-color: #2c3e50;
|
235 |
+
box-shadow: none;
|
236 |
+
color: #fff;
|
237 |
+
}
|
238 |
+
|
239 |
+
.tingle-modal__closeLabel {
|
240 |
+
display: inline-block;
|
241 |
+
vertical-align: middle;
|
242 |
+
font-size: 1.6rem;
|
243 |
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
244 |
+
}
|
245 |
+
|
246 |
+
.tingle-modal__closeIcon {
|
247 |
+
display: inline-block;
|
248 |
+
margin-right: .8rem;
|
249 |
+
width: 1.6rem;
|
250 |
+
vertical-align: middle;
|
251 |
+
font-size: 0;
|
252 |
+
}
|
253 |
+
}
|
254 |
+
|
255 |
+
@supports ((-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px))) {
|
256 |
+
.tingle-modal {
|
257 |
+
-webkit-backdrop-filter: blur(20px);
|
258 |
+
backdrop-filter: blur(20px);
|
259 |
+
}
|
260 |
+
|
261 |
+
@media (max-width : 540px) {
|
262 |
+
.tingle-modal {
|
263 |
+
-webkit-backdrop-filter: blur(8px);
|
264 |
+
backdrop-filter: blur(8px);
|
265 |
+
}
|
266 |
+
}
|
267 |
+
|
268 |
+
.tingle-enabled .tingle-content-wrapper {
|
269 |
+
filter: none;
|
270 |
+
}
|
271 |
+
}
|
272 |
+
|
273 |
+
/* animations
|
274 |
+
-------------------------------------------------------------- */
|
275 |
+
|
276 |
+
@keyframes scale {
|
277 |
+
0% {
|
278 |
+
opacity: 0;
|
279 |
+
transform: scale(.9);
|
280 |
+
}
|
281 |
+
100% {
|
282 |
+
opacity: 1;
|
283 |
+
transform: scale(1);
|
284 |
+
}
|
285 |
+
}
|
public/vendor/tingle/tingle.js
ADDED
@@ -0,0 +1,440 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* !
|
2 |
+
* tingle.js
|
3 |
+
* @author robin_parisi
|
4 |
+
* @version 0.15.1
|
5 |
+
* @url
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* global define,module*/
|
9 |
+
(function(root, factory) {
|
10 |
+
if (typeof define === 'function' && define.amd) {
|
11 |
+
define(factory)
|
12 |
+
} else if (typeof exports === 'object') {
|
13 |
+
module.exports = factory()
|
14 |
+
} else {
|
15 |
+
root.tingle = factory()
|
16 |
+
}
|
17 |
+
}(this, function() {
|
18 |
+
|
19 |
+
/* ----------------------------------------------------------- */
|
20 |
+
/* == modal */
|
21 |
+
/* ----------------------------------------------------------- */
|
22 |
+
|
23 |
+
var isBusy = false
|
24 |
+
|
25 |
+
function Modal(options) {
|
26 |
+
var defaults = {
|
27 |
+
onClose: null,
|
28 |
+
onOpen: null,
|
29 |
+
beforeOpen: null,
|
30 |
+
beforeClose: null,
|
31 |
+
stickyFooter: false,
|
32 |
+
footer: false,
|
33 |
+
cssClass: [],
|
34 |
+
closeLabel: 'Close',
|
35 |
+
closeMethods: ['overlay', 'button', 'escape']
|
36 |
+
}
|
37 |
+
|
38 |
+
// extends config
|
39 |
+
this.opts = extend({}, defaults, options)
|
40 |
+
|
41 |
+
// init modal
|
42 |
+
this.init()
|
43 |
+
}
|
44 |
+
|
45 |
+
Modal.prototype.init = function() {
|
46 |
+
if (this.modal) {
|
47 |
+
return
|
48 |
+
}
|
49 |
+
|
50 |
+
_build.call(this)
|
51 |
+
_bindEvents.call(this)
|
52 |
+
|
53 |
+
// insert modal in dom
|
54 |
+
document.body.insertBefore(this.modal, document.body.firstChild)
|
55 |
+
|
56 |
+
if (this.opts.footer) {
|
57 |
+
this.addFooter()
|
58 |
+
}
|
59 |
+
|
60 |
+
return this
|
61 |
+
}
|
62 |
+
|
63 |
+
Modal.prototype._busy = function(state) {
|
64 |
+
isBusy = state
|
65 |
+
}
|
66 |
+
|
67 |
+
Modal.prototype._isBusy = function() {
|
68 |
+
return isBusy
|
69 |
+
}
|
70 |
+
|
71 |
+
Modal.prototype.destroy = function() {
|
72 |
+
if (this.modal === null) {
|
73 |
+
return
|
74 |
+
}
|
75 |
+
|
76 |
+
// restore scrolling
|
77 |
+
if (this.isOpen()) {
|
78 |
+
this.close(true)
|
79 |
+
}
|
80 |
+
|
81 |
+
// unbind all events
|
82 |
+
_unbindEvents.call(this)
|
83 |
+
|
84 |
+
// remove modal from dom
|
85 |
+
this.modal.parentNode.removeChild(this.modal)
|
86 |
+
|
87 |
+
this.modal = null
|
88 |
+
}
|
89 |
+
|
90 |
+
Modal.prototype.isOpen = function() {
|
91 |
+
return !!this.modal.classList.contains('tingle-modal--visible')
|
92 |
+
}
|
93 |
+
|
94 |
+
Modal.prototype.open = function() {
|
95 |
+
if(this._isBusy()) return
|
96 |
+
this._busy(true)
|
97 |
+
|
98 |
+
var self = this
|
99 |
+
|
100 |
+
// before open callback
|
101 |
+
if (typeof self.opts.beforeOpen === 'function') {
|
102 |
+
self.opts.beforeOpen()
|
103 |
+
}
|
104 |
+
|
105 |
+
if (this.modal.style.removeProperty) {
|
106 |
+
this.modal.style.removeProperty('display')
|
107 |
+
} else {
|
108 |
+
this.modal.style.removeAttribute('display')
|
109 |
+
}
|
110 |
+
|
111 |
+
// prevent double scroll
|
112 |
+
this._scrollPosition = window.pageYOffset
|
113 |
+
document.body.classList.add('tingle-enabled')
|
114 |
+
document.body.style.top = -this._scrollPosition + 'px'
|
115 |
+
|
116 |
+
// sticky footer
|
117 |
+
this.setStickyFooter(this.opts.stickyFooter)
|
118 |
+
|
119 |
+
// show modal
|
120 |
+
this.modal.classList.add('tingle-modal--visible')
|
121 |
+
|
122 |
+
// onOpen callback
|
123 |
+
if (typeof self.opts.onOpen === 'function') {
|
124 |
+
self.opts.onOpen.call(self)
|
125 |
+
}
|
126 |
+
|
127 |
+
self._busy(false)
|
128 |
+
|
129 |
+
// check if modal is bigger than screen height
|
130 |
+
this.checkOverflow()
|
131 |
+
|
132 |
+
return this
|
133 |
+
}
|
134 |
+
|
135 |
+
Modal.prototype.close = function(force) {
|
136 |
+
if(this._isBusy()) return
|
137 |
+
this._busy(true)
|
138 |
+
force = force || false
|
139 |
+
|
140 |
+
// before close
|
141 |
+
if (typeof this.opts.beforeClose === 'function') {
|
142 |
+
var close = this.opts.beforeClose.call(this)
|
143 |
+
if (!close) {
|
144 |
+
this._busy(false)
|
145 |
+
return
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
document.body.classList.remove('tingle-enabled')
|
150 |
+
window.scrollTo(0, this._scrollPosition)
|
151 |
+
document.body.style.top = null
|
152 |
+
|
153 |
+
this.modal.classList.remove('tingle-modal--visible')
|
154 |
+
|
155 |
+
// using similar setup as onOpen
|
156 |
+
var self = this
|
157 |
+
|
158 |
+
self.modal.style.display = 'none'
|
159 |
+
|
160 |
+
// onClose callback
|
161 |
+
if (typeof self.opts.onClose === 'function') {
|
162 |
+
self.opts.onClose.call(this)
|
163 |
+
}
|
164 |
+
|
165 |
+
// release modal
|
166 |
+
self._busy(false)
|
167 |
+
|
168 |
+
}
|
169 |
+
|
170 |
+
Modal.prototype.setContent = function(content) {
|
171 |
+
// check type of content : String or Node
|
172 |
+
if (typeof content === 'string') {
|
173 |
+
this.modalBoxContent.innerHTML = content
|
174 |
+
} else {
|
175 |
+
this.modalBoxContent.innerHTML = ''
|
176 |
+
this.modalBoxContent.appendChild(content)
|
177 |
+
}
|
178 |
+
|
179 |
+
if (this.isOpen()) {
|
180 |
+
// check if modal is bigger than screen height
|
181 |
+
this.checkOverflow()
|
182 |
+
}
|
183 |
+
|
184 |
+
return this
|
185 |
+
}
|
186 |
+
|
187 |
+
Modal.prototype.getContent = function() {
|
188 |
+
return this.modalBoxContent
|
189 |
+
}
|
190 |
+
|
191 |
+
Modal.prototype.addFooter = function() {
|
192 |
+
// add footer to modal
|
193 |
+
_buildFooter.call(this)
|
194 |
+
|
195 |
+
return this
|
196 |
+
}
|
197 |
+
|
198 |
+
Modal.prototype.setFooterContent = function(content) {
|
199 |
+
// set footer content
|
200 |
+
this.modalBoxFooter.innerHTML = content
|
201 |
+
|
202 |
+
return this
|
203 |
+
}
|
204 |
+
|
205 |
+
Modal.prototype.getFooterContent = function() {
|
206 |
+
return this.modalBoxFooter
|
207 |
+
}
|
208 |
+
|
209 |
+
Modal.prototype.setStickyFooter = function(isSticky) {
|
210 |
+
// if the modal is smaller than the viewport height, we don't need sticky
|
211 |
+
if (!this.isOverflow()) {
|
212 |
+
isSticky = false
|
213 |
+
}
|
214 |
+
|
215 |
+
if (isSticky) {
|
216 |
+
if (this.modalBox.contains(this.modalBoxFooter)) {
|
217 |
+
this.modalBox.removeChild(this.modalBoxFooter)
|
218 |
+
this.modal.appendChild(this.modalBoxFooter)
|
219 |
+
this.modalBoxFooter.classList.add('tingle-modal-box__footer--sticky')
|
220 |
+
_recalculateFooterPosition.call(this)
|
221 |
+
this.modalBoxContent.style['padding-bottom'] = this.modalBoxFooter.clientHeight + 20 + 'px'
|
222 |
+
}
|
223 |
+
} else if (this.modalBoxFooter) {
|
224 |
+
if (!this.modalBox.contains(this.modalBoxFooter)) {
|
225 |
+
this.modal.removeChild(this.modalBoxFooter)
|
226 |
+
this.modalBox.appendChild(this.modalBoxFooter)
|
227 |
+
this.modalBoxFooter.style.width = 'auto'
|
228 |
+
this.modalBoxFooter.style.left = ''
|
229 |
+
this.modalBoxContent.style['padding-bottom'] = ''
|
230 |
+
this.modalBoxFooter.classList.remove('tingle-modal-box__footer--sticky')
|
231 |
+
}
|
232 |
+
}
|
233 |
+
|
234 |
+
return this
|
235 |
+
}
|
236 |
+
|
237 |
+
|
238 |
+
Modal.prototype.addFooterBtn = function(label, cssClass, callback) {
|
239 |
+
var btn = document.createElement('button')
|
240 |
+
|
241 |
+
// set label
|
242 |
+
btn.innerHTML = label
|
243 |
+
|
244 |
+
// bind callback
|
245 |
+
btn.addEventListener('click', callback)
|
246 |
+
|
247 |
+
if (typeof cssClass === 'string' && cssClass.length) {
|
248 |
+
// add classes to btn
|
249 |
+
cssClass.split(' ').forEach(function(item) {
|
250 |
+
btn.classList.add(item)
|
251 |
+
})
|
252 |
+
}
|
253 |
+
|
254 |
+
this.modalBoxFooter.appendChild(btn)
|
255 |
+
|
256 |
+
return btn
|
257 |
+
}
|
258 |
+
|
259 |
+
Modal.prototype.resize = function() {
|
260 |
+
// eslint-disable-next-line no-console
|
261 |
+
console.warn('Resize is deprecated and will be removed in version 1.0')
|
262 |
+
}
|
263 |
+
|
264 |
+
Modal.prototype.isOverflow = function() {
|
265 |
+
var viewportHeight = window.innerHeight
|
266 |
+
var modalHeight = this.modalBox.clientHeight
|
267 |
+
|
268 |
+
return modalHeight >= viewportHeight
|
269 |
+
}
|
270 |
+
|
271 |
+
Modal.prototype.checkOverflow = function() {
|
272 |
+
// only if the modal is currently shown
|
273 |
+
if (this.modal.classList.contains('tingle-modal--visible')) {
|
274 |
+
if (this.isOverflow()) {
|
275 |
+
this.modal.classList.add('tingle-modal--overflow')
|
276 |
+
} else {
|
277 |
+
this.modal.classList.remove('tingle-modal--overflow')
|
278 |
+
}
|
279 |
+
|
280 |
+
// tODO: remove offset
|
281 |
+
// _offset.call(this);
|
282 |
+
if (!this.isOverflow() && this.opts.stickyFooter) {
|
283 |
+
this.setStickyFooter(false)
|
284 |
+
} else if (this.isOverflow() && this.opts.stickyFooter) {
|
285 |
+
_recalculateFooterPosition.call(this)
|
286 |
+
this.setStickyFooter(true)
|
287 |
+
}
|
288 |
+
}
|
289 |
+
}
|
290 |
+
|
291 |
+
|
292 |
+
/* ----------------------------------------------------------- */
|
293 |
+
/* == private methods */
|
294 |
+
/* ----------------------------------------------------------- */
|
295 |
+
|
296 |
+
function closeIcon() {
|
297 |
+
return '<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.3 9.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3L5 6.4l3.3 3.3c.2.2.5.3.7.3.2 0 .5-.1.7-.3.4-.4.4-1 0-1.4L6.4 5l3.3-3.3c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0L5 3.6 1.7.3C1.3-.1.7-.1.3.3c-.4.4-.4 1 0 1.4L3.6 5 .3 8.3c-.4.4-.4 1 0 1.4z" fill="#000" fill-rule="nonzero"/></svg>'
|
298 |
+
}
|
299 |
+
|
300 |
+
function _recalculateFooterPosition() {
|
301 |
+
if (!this.modalBoxFooter) {
|
302 |
+
return
|
303 |
+
}
|
304 |
+
this.modalBoxFooter.style.width = this.modalBox.clientWidth + 'px'
|
305 |
+
this.modalBoxFooter.style.left = this.modalBox.offsetLeft + 'px'
|
306 |
+
}
|
307 |
+
|
308 |
+
function _build() {
|
309 |
+
|
310 |
+
// wrapper
|
311 |
+
this.modal = document.createElement('div')
|
312 |
+
this.modal.classList.add('tingle-modal')
|
313 |
+
|
314 |
+
// remove cusor if no overlay close method
|
315 |
+
if (this.opts.closeMethods.length === 0 || this.opts.closeMethods.indexOf('overlay') === -1) {
|
316 |
+
this.modal.classList.add('tingle-modal--noOverlayClose')
|
317 |
+
}
|
318 |
+
|
319 |
+
this.modal.style.display = 'none'
|
320 |
+
|
321 |
+
// custom class
|
322 |
+
this.opts.cssClass.forEach(function(item) {
|
323 |
+
if (typeof item === 'string') {
|
324 |
+
this.modal.classList.add(item)
|
325 |
+
}
|
326 |
+
}, this)
|
327 |
+
|
328 |
+
// close btn
|
329 |
+
if (this.opts.closeMethods.indexOf('button') !== -1) {
|
330 |
+
this.modalCloseBtn = document.createElement('button')
|
331 |
+
this.modalCloseBtn.type = 'button'
|
332 |
+
this.modalCloseBtn.classList.add('tingle-modal__close')
|
333 |
+
|
334 |
+
this.modalCloseBtnIcon = document.createElement('span')
|
335 |
+
this.modalCloseBtnIcon.classList.add('tingle-modal__closeIcon')
|
336 |
+
this.modalCloseBtnIcon.innerHTML = closeIcon()
|
337 |
+
|
338 |
+
this.modalCloseBtnLabel = document.createElement('span')
|
339 |
+
this.modalCloseBtnLabel.classList.add('tingle-modal__closeLabel')
|
340 |
+
this.modalCloseBtnLabel.innerHTML = this.opts.closeLabel
|
341 |
+
|
342 |
+
this.modalCloseBtn.appendChild(this.modalCloseBtnIcon)
|
343 |
+
this.modalCloseBtn.appendChild(this.modalCloseBtnLabel)
|
344 |
+
}
|
345 |
+
|
346 |
+
// modal
|
347 |
+
this.modalBox = document.createElement('div')
|
348 |
+
this.modalBox.classList.add('tingle-modal-box')
|
349 |
+
|
350 |
+
// modal box content
|
351 |
+
this.modalBoxContent = document.createElement('div')
|
352 |
+
this.modalBoxContent.classList.add('tingle-modal-box__content')
|
353 |
+
|
354 |
+
this.modalBox.appendChild(this.modalBoxContent)
|
355 |
+
|
356 |
+
if (this.opts.closeMethods.indexOf('button') !== -1) {
|
357 |
+
this.modal.appendChild(this.modalCloseBtn)
|
358 |
+
}
|
359 |
+
|
360 |
+
this.modal.appendChild(this.modalBox)
|
361 |
+
|
362 |
+
}
|
363 |
+
|
364 |
+
function _buildFooter() {
|
365 |
+
this.modalBoxFooter = document.createElement('div')
|
366 |
+
this.modalBoxFooter.classList.add('tingle-modal-box__footer')
|
367 |
+
this.modalBox.appendChild(this.modalBoxFooter)
|
368 |
+
}
|
369 |
+
|
370 |
+
function _bindEvents() {
|
371 |
+
|
372 |
+
this._events = {
|
373 |
+
clickCloseBtn: this.close.bind(this),
|
374 |
+
clickOverlay: _handleClickOutside.bind(this),
|
375 |
+
resize: this.checkOverflow.bind(this),
|
376 |
+
keyboardNav: _handleKeyboardNav.bind(this)
|
377 |
+
}
|
378 |
+
|
379 |
+
if (this.opts.closeMethods.indexOf('button') !== -1) {
|
380 |
+
this.modalCloseBtn.addEventListener('click', this._events.clickCloseBtn)
|
381 |
+
}
|
382 |
+
|
383 |
+
this.modal.addEventListener('mousedown', this._events.clickOverlay)
|
384 |
+
window.addEventListener('resize', this._events.resize)
|
385 |
+
document.addEventListener('keydown', this._events.keyboardNav)
|
386 |
+
}
|
387 |
+
|
388 |
+
function _handleKeyboardNav(event) {
|
389 |
+
// escape key
|
390 |
+
if (this.opts.closeMethods.indexOf('escape') !== -1 && event.which === 27 && this.isOpen()) {
|
391 |
+
this.close()
|
392 |
+
}
|
393 |
+
}
|
394 |
+
|
395 |
+
function _handleClickOutside(event) {
|
396 |
+
// if click is outside the modal
|
397 |
+
if (this.opts.closeMethods.indexOf('overlay') !== -1 && !_findAncestor(event.target, 'tingle-modal') &&
|
398 |
+
event.clientX < this.modal.clientWidth) {
|
399 |
+
this.close()
|
400 |
+
}
|
401 |
+
}
|
402 |
+
|
403 |
+
function _findAncestor(el, cls) {
|
404 |
+
while ((el = el.parentElement) && !el.classList.contains(cls));
|
405 |
+
return el
|
406 |
+
}
|
407 |
+
|
408 |
+
function _unbindEvents() {
|
409 |
+
if (this.opts.closeMethods.indexOf('button') !== -1) {
|
410 |
+
this.modalCloseBtn.removeEventListener('click', this._events.clickCloseBtn)
|
411 |
+
}
|
412 |
+
this.modal.removeEventListener('mousedown', this._events.clickOverlay)
|
413 |
+
window.removeEventListener('resize', this._events.resize)
|
414 |
+
document.removeEventListener('keydown', this._events.keyboardNav)
|
415 |
+
}
|
416 |
+
|
417 |
+
/* ----------------------------------------------------------- */
|
418 |
+
/* == helpers */
|
419 |
+
/* ----------------------------------------------------------- */
|
420 |
+
|
421 |
+
function extend() {
|
422 |
+
for (var i = 1; i < arguments.length; i++) {
|
423 |
+
for (var key in arguments[i]) {
|
424 |
+
if (arguments[i].hasOwnProperty(key)) {
|
425 |
+
arguments[0][key] = arguments[i][key]
|
426 |
+
}
|
427 |
+
}
|
428 |
+
}
|
429 |
+
return arguments[0]
|
430 |
+
}
|
431 |
+
|
432 |
+
/* ----------------------------------------------------------- */
|
433 |
+
/* == return */
|
434 |
+
/* ----------------------------------------------------------- */
|
435 |
+
|
436 |
+
return {
|
437 |
+
modal: Modal
|
438 |
+
}
|
439 |
+
|
440 |
+
}))
|
public/vendor/tingle/tingle.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.tingle-modal *{box-sizing:border-box}.tingle-modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;display:-ms-flexbox;display:flex;visibility:hidden;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;overflow:hidden;-webkit-overflow-scrolling:touch;background:rgba(0,0,0,.85);opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.tingle-modal--noClose .tingle-modal__close,.tingle-modal__closeLabel{display:none}.tingle-modal--confirm .tingle-modal-box{text-align:center}.tingle-modal--noOverlayClose{cursor:default}.tingle-modal__close{position:fixed;top:2rem;right:2rem;z-index:1000;padding:0;width:2rem;height:2rem;border:none;background-color:transparent;color:#fff;cursor:pointer}.tingle-modal__close svg *{fill:currentColor}.tingle-modal__close:hover{color:#fff}.tingle-modal-box{position:relative;-ms-flex-negative:0;flex-shrink:0;margin-top:auto;margin-bottom:auto;width:60%;border-radius:4px;background:#fff;opacity:1;cursor:auto;will-change:transform,opacity}.tingle-modal-box__content{padding:3rem}.tingle-modal-box__footer{padding:1.5rem 2rem;width:auto;border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#f5f5f5;cursor:auto}.tingle-modal-box__footer::after{display:table;clear:both;content:""}.tingle-modal-box__footer--sticky{position:fixed;bottom:-200px;z-index:10001;opacity:1;transition:bottom .3s ease-in-out .3s}.tingle-enabled{position:fixed;right:0;left:0;overflow:hidden}.tingle-modal--visible .tingle-modal-box__footer{bottom:0}.tingle-enabled .tingle-content-wrapper{filter:blur(8px)}.tingle-modal--visible{visibility:visible;opacity:1}.tingle-modal--visible .tingle-modal-box{animation:scale .2s cubic-bezier(.68,-.55,.265,1.55) forwards}.tingle-modal--overflow{overflow-y:scroll;padding-top:8vh}.tingle-btn{display:inline-block;margin:0 .5rem;padding:1rem 2rem;border:none;background-color:grey;box-shadow:none;color:#fff;vertical-align:middle;text-decoration:none;font-size:inherit;font-family:inherit;line-height:normal;cursor:pointer;transition:background-color .4s ease}.tingle-btn--primary{background-color:#3498db}.tingle-btn--danger{background-color:#e74c3c}.tingle-btn--default{background-color:#34495e}.tingle-btn--pull-left{float:left}.tingle-btn--pull-right{float:right}@media (max-width :540px){.tingle-modal{top:0;display:block;padding-top:60px;width:100%}.tingle-modal-box{width:auto;border-radius:0}.tingle-modal-box__content{overflow-y:scroll}.tingle-modal--noClose{top:0}.tingle-modal--noOverlayClose{padding-top:0}.tingle-modal-box__footer .tingle-btn{display:block;float:none;margin-bottom:1rem;width:100%}.tingle-modal__close{top:0;right:0;left:0;display:block;width:100%;height:60px;border:none;background-color:#2c3e50;box-shadow:none;color:#fff}.tingle-modal__closeLabel{display:inline-block;vertical-align:middle;font-size:1.6rem;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif}.tingle-modal__closeIcon{display:inline-block;margin-right:.8rem;width:1.6rem;vertical-align:middle;font-size:0}}@supports ((-webkit-backdrop-filter:blur(12px)) or (backdrop-filter:blur(12px))){.tingle-modal{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}@media (max-width :540px){.tingle-modal{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}}.tingle-enabled .tingle-content-wrapper{filter:none}}@keyframes scale{0%{opacity:0;transform:scale(.9)}100%{opacity:1;transform:scale(1)}}
|
public/vendor/tingle/tingle.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(t,o){"function"==typeof define&&define.amd?define(o):"object"==typeof exports?module.exports=o():t.tingle=o()}(this,function(){function t(t){var o={onClose:null,onOpen:null,beforeOpen:null,beforeClose:null,stickyFooter:!1,footer:!1,cssClass:[],closeLabel:"Close",closeMethods:["overlay","button","escape"]};this.opts=r({},o,t),this.init()}function o(){return'<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"><path d="M.3 9.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3L5 6.4l3.3 3.3c.2.2.5.3.7.3.2 0 .5-.1.7-.3.4-.4.4-1 0-1.4L6.4 5l3.3-3.3c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0L5 3.6 1.7.3C1.3-.1.7-.1.3.3c-.4.4-.4 1 0 1.4L3.6 5 .3 8.3c-.4.4-.4 1 0 1.4z" fill="#000" fill-rule="nonzero"/></svg>'}function e(){this.modalBoxFooter&&(this.modalBoxFooter.style.width=this.modalBox.clientWidth+"px",this.modalBoxFooter.style.left=this.modalBox.offsetLeft+"px")}function s(){this.modal=document.createElement("div"),this.modal.classList.add("tingle-modal"),0!==this.opts.closeMethods.length&&-1!==this.opts.closeMethods.indexOf("overlay")||this.modal.classList.add("tingle-modal--noOverlayClose"),this.modal.style.display="none",this.opts.cssClass.forEach(function(t){"string"==typeof t&&this.modal.classList.add(t)},this),-1!==this.opts.closeMethods.indexOf("button")&&(this.modalCloseBtn=document.createElement("button"),this.modalCloseBtn.type="button",this.modalCloseBtn.classList.add("tingle-modal__close"),this.modalCloseBtnIcon=document.createElement("span"),this.modalCloseBtnIcon.classList.add("tingle-modal__closeIcon"),this.modalCloseBtnIcon.innerHTML=o(),this.modalCloseBtnLabel=document.createElement("span"),this.modalCloseBtnLabel.classList.add("tingle-modal__closeLabel"),this.modalCloseBtnLabel.innerHTML=this.opts.closeLabel,this.modalCloseBtn.appendChild(this.modalCloseBtnIcon),this.modalCloseBtn.appendChild(this.modalCloseBtnLabel)),this.modalBox=document.createElement("div"),this.modalBox.classList.add("tingle-modal-box"),this.modalBoxContent=document.createElement("div"),this.modalBoxContent.classList.add("tingle-modal-box__content"),this.modalBox.appendChild(this.modalBoxContent),-1!==this.opts.closeMethods.indexOf("button")&&this.modal.appendChild(this.modalCloseBtn),this.modal.appendChild(this.modalBox)}function i(){this.modalBoxFooter=document.createElement("div"),this.modalBoxFooter.classList.add("tingle-modal-box__footer"),this.modalBox.appendChild(this.modalBoxFooter)}function n(){this._events={clickCloseBtn:this.close.bind(this),clickOverlay:d.bind(this),resize:this.checkOverflow.bind(this),keyboardNav:l.bind(this)},-1!==this.opts.closeMethods.indexOf("button")&&this.modalCloseBtn.addEventListener("click",this._events.clickCloseBtn),this.modal.addEventListener("mousedown",this._events.clickOverlay),window.addEventListener("resize",this._events.resize),document.addEventListener("keydown",this._events.keyboardNav)}function l(t){-1!==this.opts.closeMethods.indexOf("escape")&&27===t.which&&this.isOpen()&&this.close()}function d(t){-1!==this.opts.closeMethods.indexOf("overlay")&&!a(t.target,"tingle-modal")&&t.clientX<this.modal.clientWidth&&this.close()}function a(t,o){for(;(t=t.parentElement)&&!t.classList.contains(o););return t}function h(){-1!==this.opts.closeMethods.indexOf("button")&&this.modalCloseBtn.removeEventListener("click",this._events.clickCloseBtn),this.modal.removeEventListener("mousedown",this._events.clickOverlay),window.removeEventListener("resize",this._events.resize),document.removeEventListener("keydown",this._events.keyboardNav)}function r(){for(var t=1;t<arguments.length;t++)for(var o in arguments[t])arguments[t].hasOwnProperty(o)&&(arguments[0][o]=arguments[t][o]);return arguments[0]}var c=!1;return t.prototype.init=function(){if(!this.modal)return s.call(this),n.call(this),document.body.insertBefore(this.modal,document.body.firstChild),this.opts.footer&&this.addFooter(),this},t.prototype._busy=function(t){c=t},t.prototype._isBusy=function(){return c},t.prototype.destroy=function(){null!==this.modal&&(this.isOpen()&&this.close(!0),h.call(this),this.modal.parentNode.removeChild(this.modal),this.modal=null)},t.prototype.isOpen=function(){return!!this.modal.classList.contains("tingle-modal--visible")},t.prototype.open=function(){if(!this._isBusy()){this._busy(!0);var t=this;return"function"==typeof t.opts.beforeOpen&&t.opts.beforeOpen(),this.modal.style.removeProperty?this.modal.style.removeProperty("display"):this.modal.style.removeAttribute("display"),this._scrollPosition=window.pageYOffset,document.body.classList.add("tingle-enabled"),document.body.style.top=-this._scrollPosition+"px",this.setStickyFooter(this.opts.stickyFooter),this.modal.classList.add("tingle-modal--visible"),"function"==typeof t.opts.onOpen&&t.opts.onOpen.call(t),t._busy(!1),this.checkOverflow(),this}},t.prototype.close=function(t){if(!this._isBusy()){if(this._busy(!0),t=t||!1,"function"==typeof this.opts.beforeClose){if(!this.opts.beforeClose.call(this))return void this._busy(!1)}document.body.classList.remove("tingle-enabled"),window.scrollTo(0,this._scrollPosition),document.body.style.top=null,this.modal.classList.remove("tingle-modal--visible");var o=this;o.modal.style.display="none","function"==typeof o.opts.onClose&&o.opts.onClose.call(this),o._busy(!1)}},t.prototype.setContent=function(t){return"string"==typeof t?this.modalBoxContent.innerHTML=t:(this.modalBoxContent.innerHTML="",this.modalBoxContent.appendChild(t)),this.isOpen()&&this.checkOverflow(),this},t.prototype.getContent=function(){return this.modalBoxContent},t.prototype.addFooter=function(){return i.call(this),this},t.prototype.setFooterContent=function(t){return this.modalBoxFooter.innerHTML=t,this},t.prototype.getFooterContent=function(){return this.modalBoxFooter},t.prototype.setStickyFooter=function(t){return this.isOverflow()||(t=!1),t?this.modalBox.contains(this.modalBoxFooter)&&(this.modalBox.removeChild(this.modalBoxFooter),this.modal.appendChild(this.modalBoxFooter),this.modalBoxFooter.classList.add("tingle-modal-box__footer--sticky"),e.call(this),this.modalBoxContent.style["padding-bottom"]=this.modalBoxFooter.clientHeight+20+"px"):this.modalBoxFooter&&(this.modalBox.contains(this.modalBoxFooter)||(this.modal.removeChild(this.modalBoxFooter),this.modalBox.appendChild(this.modalBoxFooter),this.modalBoxFooter.style.width="auto",this.modalBoxFooter.style.left="",this.modalBoxContent.style["padding-bottom"]="",this.modalBoxFooter.classList.remove("tingle-modal-box__footer--sticky"))),this},t.prototype.addFooterBtn=function(t,o,e){var s=document.createElement("button");return s.innerHTML=t,s.addEventListener("click",e),"string"==typeof o&&o.length&&o.split(" ").forEach(function(t){s.classList.add(t)}),this.modalBoxFooter.appendChild(s),s},t.prototype.resize=function(){console.warn("Resize is deprecated and will be removed in version 1.0")},t.prototype.isOverflow=function(){var t=window.innerHeight;return this.modalBox.clientHeight>=t},t.prototype.checkOverflow=function(){this.modal.classList.contains("tingle-modal--visible")&&(this.isOverflow()?this.modal.classList.add("tingle-modal--overflow"):this.modal.classList.remove("tingle-modal--overflow"),!this.isOverflow()&&this.opts.stickyFooter?this.setStickyFooter(!1):this.isOverflow()&&this.opts.stickyFooter&&(e.call(this),this.setStickyFooter(!0)))},{modal:t}});
|
resources/views/giveaways.php
ADDED
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
// handle postback
|
5 |
+
if(!empty($_POST['action']) && $_POST['action'] == 'install-rafflepress'){
|
6 |
+
$post_nonce = $_POST['_wpnonce'];
|
7 |
+
|
8 |
+
// Check for permissions.
|
9 |
+
if (! current_user_can('install_plugins')) {
|
10 |
+
wp_die('You do not have permisson to install a plugin');
|
11 |
+
}
|
12 |
+
|
13 |
+
if ( !wp_verify_nonce( $post_nonce, 'seedprod-rafflepress' ) ) {
|
14 |
+
wp_die('Please try again.');
|
15 |
+
}
|
16 |
+
|
17 |
+
$download_url = 'https://downloads.wordpress.org/plugin/rafflepress.zip';
|
18 |
+
|
19 |
+
|
20 |
+
global $hook_suffix;
|
21 |
+
|
22 |
+
// Set the current screen to avoid undefined notices.
|
23 |
+
set_current_screen();
|
24 |
+
|
25 |
+
// Prepare variables.
|
26 |
+
$method = '';
|
27 |
+
$url = add_query_arg(
|
28 |
+
array(
|
29 |
+
'page' => 'seed_csp4_giveaways'
|
30 |
+
),
|
31 |
+
admin_url('admin.php')
|
32 |
+
);
|
33 |
+
$url = esc_url($url);
|
34 |
+
|
35 |
+
// Start output bufferring to catch the filesystem form if credentials are needed.
|
36 |
+
ob_start();
|
37 |
+
if (false === ($creds = request_filesystem_credentials($url, $method, false, false, null))) {
|
38 |
+
$form = ob_get_clean();
|
39 |
+
echo json_encode(array( 'form' => $form ));
|
40 |
+
wp_die();
|
41 |
+
}
|
42 |
+
|
43 |
+
// If we are not authenticated, make it happen now.
|
44 |
+
if (! WP_Filesystem($creds)) {
|
45 |
+
ob_start();
|
46 |
+
request_filesystem_credentials($url, $method, true, false, null);
|
47 |
+
$form = ob_get_clean();
|
48 |
+
echo json_encode(array( 'form' => $form ));
|
49 |
+
wp_die();
|
50 |
+
}
|
51 |
+
|
52 |
+
// We do not need any extra credentials if we have gotten this far, so let's install the plugin.
|
53 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
54 |
+
|
55 |
+
require_once SEED_CSP4_PLUGIN_PATH . 'framework/skin.php';
|
56 |
+
|
57 |
+
// Create the plugin upgrader with our custom skin.
|
58 |
+
$installer = new Plugin_Upgrader($skin = new ComingSoon_Skin());
|
59 |
+
$installer->install($download_url);
|
60 |
+
|
61 |
+
// Flush the cache and return the newly installed plugin basename.
|
62 |
+
wp_cache_flush();
|
63 |
+
if ($installer->plugin_info()) {
|
64 |
+
$plugin_basename = $installer->plugin_info();
|
65 |
+
//echo json_encode(array( 'plugin' => $plugin_basename ));
|
66 |
+
//wp_die();
|
67 |
+
}else{
|
68 |
+
//$install_plugin_nonce = wp_create_nonce('install-plugin_rafflepress'));
|
69 |
+
// window.open(
|
70 |
+
// "update.php?action=install-plugin&plugin=" +
|
71 |
+
// self.plugins[gplugin]
|
72 |
+
// .slug_base +
|
73 |
+
// "&_wpnonce=" +
|
74 |
+
// response.data,
|
75 |
+
// "_blank"
|
76 |
+
// );
|
77 |
+
}
|
78 |
+
|
79 |
+
// now try to activate
|
80 |
+
$activate = activate_plugins($plugin_basename);
|
81 |
+
|
82 |
+
|
83 |
+
|
84 |
+
|
85 |
+
}
|
86 |
+
|
87 |
+
if(!empty($_POST['action']) && $_POST['action'] == 'activate-rafflepress'){
|
88 |
+
$post_nonce = $_POST['_wpnonce'];
|
89 |
+
if ( wp_verify_nonce( $post_nonce, 'seedprod-rafflepress' ) ) {
|
90 |
+
$activate = activate_plugins('rafflepress/rafflepress.php');
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
|
97 |
+
// check if plugin is installed
|
98 |
+
$plugins = seed_csp4_plugins_active();
|
99 |
+
|
100 |
+
|
101 |
+
$nonce = wp_create_nonce( 'seedprod-rafflepress' );
|
102 |
+
|
103 |
+
?>
|
104 |
+
<div class="wrap columns-2 seed-csp4">
|
105 |
+
<div id="seed_csp4_header" style="margin:22px 0">
|
106 |
+
<h1 style=" display: flex;
|
107 |
+
align-items: center;
|
108 |
+
justify-content: center;">
|
109 |
+
<img style="width:290px;margin-right:10px;margin-bottom: -2px;vertical-align: text-bottom;" src="<?php echo SEED_CSP4_PLUGIN_URL ?>public/images/rafflepress-logo.png">
|
110 |
+
<span style="padding:0 20px;font-size:32px">+</span>
|
111 |
+
<img style="width:230px;margin-right:10px;margin-bottom: -2px;vertical-align: text-bottom;" src="<?php echo SEED_CSP4_PLUGIN_URL ?>public/images/seedprod-logo.png">
|
112 |
+
|
113 |
+
</h1>
|
114 |
+
|
115 |
+
</div>
|
116 |
+
<br><br>
|
117 |
+
|
118 |
+
<div id="seed_csp4_body" style="text-align:center;background:#fff;max-width:1200px;padding:50px">
|
119 |
+
<h1 style="font-size:28px; font-weight:bold">The Best WordPress Giveaway Plugin by the SeedProd Team</h1>
|
120 |
+
<p style="font-size:20px;"> Did you know that giveaways / contests are one of the fastest ways to increase your website traffic, get more social media followers, and grow your email list?</p><p style="font-size:20px;margin:30px 0 40px">This is why we built, RafflePress, to help you grow your website, FASTER!
|
121 |
+
</p>
|
122 |
+
|
123 |
+
<?php if($plugins['rafflepress']== 'Not Installed'){ ?>
|
124 |
+
<form action="admin.php?page=seed_csp4_giveaways" method="POST">
|
125 |
+
<input type="hidden" name="_wpnonce" value="<?php echo $nonce ?>">
|
126 |
+
<input type="hidden" name="action" value="install-rafflepress">
|
127 |
+
<button style="background-color:#f3470e; color:#fff; padding: 25px 60px; border-radius:4px; border:none; font-size: 24px ">Install RafflePress Plugin (Free)</button>
|
128 |
+
</form>
|
129 |
+
<?php } ?>
|
130 |
+
<?php if($plugins['rafflepress']== 'Inactive'){ ?>
|
131 |
+
<form action="admin.php?page=seed_csp4_giveaways" method="POST">
|
132 |
+
<input type="hidden" name="_wpnonce" value="<?php echo $nonce ?>">
|
133 |
+
<input type="hidden" name="action" value="activate-rafflepress">
|
134 |
+
<button style="background-color:#f3470e; color:#fff; padding: 25px 60px; border-radius:4px; border:none; font-size: 24px ">Activate RafflePress</button>
|
135 |
+
<form>
|
136 |
+
<?php } ?>
|
137 |
+
<?php if($plugins['rafflepress']== 'Active'){ ?>
|
138 |
+
|
139 |
+
|
140 |
+
<!-- <a href="admin.php?page=rafflepress_lite#/welcome" style="background-color:#f3470e; color:#fff; padding: 20px 40px; border-radius:4px; border:none; font-size: 22px ">Visit RafflePress Settings</a> -->
|
141 |
+
<script>location.href = 'admin.php?page=rafflepress_lite#/welcome'</script>
|
142 |
+
|
143 |
+
<?php } ?>
|
144 |
+
|
145 |
+
<p style="font-size:20px;margin:60px 0 40px">Want to learn more about RafflePress? Watch the video below!</p>
|
146 |
+
|
147 |
+
<a href="#" class="js-tingle-rafflepress"><img style="max-width:100%" src="<?php echo SEED_CSP4_PLUGIN_URL ?>public/images/home-video-teaser.png"></a>
|
148 |
+
|
149 |
+
<div style="">
|
150 |
+
<p style="font-size:20px;margin:60px 0 30px">To your continued success,</p>
|
151 |
+
<img style="margin-right:10px;margin-bottom: -2px;vertical-align: text-bottom;" src="<?php echo SEED_CSP4_PLUGIN_URL ?>public/images/jt-compressor.png">
|
152 |
+
<p style="font-size:20px;margin:30px 0 0px">John Turner</p>
|
153 |
+
|
154 |
+
<p style="font-size:20px;margin:5px 0 40px">Founder of SeedProd</p>
|
155 |
+
</div>
|
156 |
+
|
157 |
+
|
158 |
+
</div>
|
159 |
+
</div>
|
160 |
+
|
161 |
+
<style>
|
162 |
+
.tingle-modal{
|
163 |
+
z-index:10000;
|
164 |
+
}
|
165 |
+
</style>
|
166 |
+
|
167 |
+
<script>
|
168 |
+
var btn6 = document.querySelector('.js-tingle-rafflepress');
|
169 |
+
btn6.addEventListener('click', function () {
|
170 |
+
var modalSurprise = new tingle.modal({
|
171 |
+
onClose: function () {
|
172 |
+
modalSurprise.destroy();
|
173 |
+
}
|
174 |
+
});
|
175 |
+
modalSurprise.setContent('<div class="video-responsive"><iframe width="100%" height="400" src="https://www.youtube.com/embed/r62HgG6wzQw?autoplay=1" frameborder="0" allowfullscreen></iframe></div>');
|
176 |
+
modalSurprise.open();
|
177 |
+
});
|
178 |
+
</script>
|
179 |
+
|
180 |
+
|