Easy Modal - Version 1.3

Version Description

= v1.2.1 = * Fixes compatibility issues with Ultimate TinyMCE Plugin. = v1.0.0 = * This is a new build your settings will be reset. = v0.9.0.4 = * Options will be overwritten with default options. = 0.9 = * Initial Release

Download this release

Release Info

Developer danieliser
Plugin Icon 128x128 Easy Modal
Version 1.3
Comparing to
See all releases

Code changes from version 1.2.2 to 1.3

easy-modal.php CHANGED
@@ -4,23 +4,22 @@ Plugin Name: Easy Modal
4
  Plugin URI: https://easy-modal.com
5
  Description: Easily create & style modals with any content. Theme editor to quickly style your modals. Add forms, social media boxes, videos & more.
6
  Author: Wizard Internet Solutions
7
- Version: 1.2.2
8
  Author URI: http://wizardinternetsolutions.com
9
  */
10
  if (!defined('EASYMODAL'))
11
  define('EASYMODAL', 'Easy Modal');
12
-
13
  if (!defined('EASYMODAL_SLUG'))
14
  define('EASYMODAL_SLUG', trim(dirname(plugin_basename(__FILE__)), '/'));
15
-
16
  if (!defined('EASYMODAL_DIR'))
17
  define('EASYMODAL_DIR', WP_PLUGIN_DIR . '/' . EASYMODAL_SLUG);
18
-
19
  if (!defined('EASYMODAL_URL'))
20
- define('EASYMODAL_URL', WP_PLUGIN_URL . '/' . EASYMODAL_SLUG);
21
-
22
  if (!defined('EASYMODAL_VERSION'))
23
- define('EASYMODAL_VERSION', '1.2.2' );
 
 
 
24
 
25
  class Easy_Modal {
26
  protected $api_url = 'http://easy-modal.com/api';
@@ -29,7 +28,7 @@ class Easy_Modal {
29
  {
30
  if (is_admin())
31
  {
32
- add_action('admin_init', array(&$this,'_migrate'),1);
33
  add_action('admin_init', array(&$this,'_messages'),10);
34
 
35
  add_action('admin_init', array(&$this,'process_get'),9);
@@ -38,7 +37,7 @@ class Easy_Modal {
38
  {
39
  add_action('init', array(&$this,'process_post'),9);
40
  }
41
- register_activation_hook(__FILE__, array(&$this, '_migrate'));
42
  add_action('admin_menu', array(&$this, '_menus') );
43
  if(isset($_GET['pages']) && $_GET['pages'] == 'easy-modal')
44
  {
@@ -69,16 +68,20 @@ class Easy_Modal {
69
  add_filter( 'em_modal_content', 'wpautop' );
70
  add_filter( 'em_modal_content', 'shortcode_unautop' );
71
  add_filter( 'em_modal_content', 'prepend_attachment' );
 
72
  add_filter( 'em_modal_content', 'do_shortcode', 11 );
73
- add_filter( 'em_modal_content', array(&$this,'filters'), 100, 1);
74
- add_action('wp_footer', array(&$this, 'preload_modals'),1000);
 
 
 
75
  }
76
  $this->_styles_scripts();
77
 
78
- add_action( "in_plugin_update_message-".EASYMODAL_SLUG .'/'. EASYMODAL_SLUG .'.php', array(&$this,'your_update_message_cb'), 20, 2 );
79
  // License Check & Updates
80
  $all_options = wp_load_alloptions();
81
- if(array_key_exists('EasyModal_License_Status', $all_options) && $license_status = get_option('EasyModal_License_Status'))
82
  {
83
  if(is_array($license_status) && in_array($license_status['status'], array(2000,2001,3002,3003)))
84
  {
@@ -113,14 +116,12 @@ class Easy_Modal {
113
  }
114
  public function save_easy_modal_post_modals( $post_id, $post )
115
  {
116
-
117
  /* Verify the nonce before proceeding. */
118
  if ( !isset( $_POST['safe_csrf_nonce_easy_modal'] ) || !wp_verify_nonce( $_POST['safe_csrf_nonce_easy_modal'], "safe_csrf_nonce_easy_modal" ) )
119
  return $post_id;
120
  $post_type = get_post_type_object( $post->post_type );
121
  if ( !current_user_can( $post_type->cap->edit_post, $post_id ) )
122
  return $post_id;
123
-
124
  $post_modals = ( !empty( $_POST['easy_modal_post_modals']) && $this->all_numeric($_POST['easy_modal_post_modals']) ) ? $_POST['easy_modal_post_modals'] : array() ;
125
  $current_post_modals = get_post_meta( $post_id, 'easy_modal_post_modals', true );
126
  if ( $post_modals && '' == $current_post_modals )
@@ -135,14 +136,7 @@ class Easy_Modal {
135
  $post_types = apply_filters('em_post_types', array('post','page'));
136
  foreach($post_types as $post_types)
137
  {
138
- add_meta_box(
139
- 'easy-modal', // Unique ID
140
- esc_html__( 'Easy Modal', 'easy-modal' ), // Title
141
- array(&$this,'easy_modal_post_modals'), // Callback function
142
- $post_types // Admin page (or post type)
143
- //'side', // Context
144
- //'default' // Priority
145
- );
146
  }
147
  }
148
  public function editor_admin_head()
@@ -186,7 +180,7 @@ class Easy_Modal {
186
  $modal['sitewide'] = !empty($modal['sitewide']) ? $modal['sitewide'] : true;
187
  $modal['overlayClose'] = !empty($modal['overlayClose']) && ($modal['overlayClose'] == 'true' || $modal['overlayClose'] == true) ? true : false;
188
  $modal['overlayEscClose'] = !empty($modal['overlayEscClose']) && ($modal['overlayEscClose'] == 'true' || $modal['overlayEscClose'] == true) ? true : false;
189
- $this->updateModalSettings($key, $modal);
190
  }
191
  }
192
  }
@@ -223,11 +217,11 @@ class Easy_Modal {
223
  $Modal = unserialize($Modal);
224
  }
225
  $Modal['name'] = $Modal['title'];
226
- $this->updateModalSettings('new',$Modal);
227
- delete_option('EasyModal_'.$id);
228
  }
229
- delete_option('eM_version');
230
- delete_option('EasyModal');
231
  }
232
  protected function _migrate_EM_Lite()
233
  {
@@ -244,26 +238,32 @@ class Easy_Modal {
244
  {
245
  $Modal = unserialize($Modal);
246
  }
247
- $this->updateModalSettings('new',$Modal);
248
- delete_option('EasyModalLite_Modal-'.$id);
 
249
  }
250
  $Theme = get_option('EasyModalLite_Theme-1');
251
  if(!is_array($Theme))
252
  {
253
  $Theme = unserialize($Theme);
254
  }
255
- $this->updateThemeSettings(1,$Theme);
256
- delete_option('EasyModalLite_Theme-1');
257
  $o_settings = get_option('EasyModalLite_Settings');
258
  if(!is_array($o_settings))
259
  {
260
  $o_settings = unserialize($o_settings);
 
 
 
 
261
  }
262
- $this->updateSettings($o_settings);
263
- delete_option('EasyModalLite_Settings');
264
- delete_option('EasyModalLite_Version');
265
- delete_option('EasyModalLite_ModalList');
266
- delete_option('EasyModalLite_ThemeList');
 
267
  }
268
  protected function _migrate_EM_Pro()
269
  {
@@ -280,14 +280,12 @@ class Easy_Modal {
280
  {
281
  $Theme = unserialize($Theme);
282
  }
283
- $theme = $this->updateThemeSettings('new',$Theme);
284
- delete_option('EasyModalPro_Theme-'.$id);
285
  $themes[$id] = $theme['theme_id'];
286
  }
287
- delete_option('EasyModalPro_ThemeList');
288
-
289
  $themes = $this->getThemeList();
290
-
291
  $o_modal_list = get_option('EasyModalPro_ModalList');
292
  if(!is_array($o_modal_list))
293
  {
@@ -301,21 +299,27 @@ class Easy_Modal {
301
  $Modal = unserialize($Modal);
302
  }
303
  $Modal['theme'] = isset($themes[$id]) ? $theme[$id] : 1;
304
- $this->updateModalSettings('new',$Modal);
305
- delete_option('EasyModalPro_Modal-'.$id);
 
306
  }
307
- delete_option('EasyModalPro_ModalList');
308
-
309
  $o_settings = get_option('EasyModalPro_Settings');
310
  if(!is_array($o_settings))
311
  {
312
  $o_settings = unserialize($o_settings);
 
 
 
 
313
  }
314
- $o_settings['license'] = get_option('EasyModalPro_License');
315
- delete_option('EasyModalPro_License');
316
- delete_option('EasyModalPro_Settings');
317
- delete_option('EasyModalPro_Version');
318
- $this->updateSettings($o_settings);
 
 
319
  }
320
  public function resetOptions()
321
  {
@@ -340,7 +344,8 @@ class Easy_Modal {
340
  }
341
  public function scripts()
342
  {
343
- wp_enqueue_script(EASYMODAL_SLUG.'-scripts', EASYMODAL_URL.'/inc/js/easy-modal.min.js', array('jquery'));
 
344
  $data = array(
345
  'modals' => $this->enqueue_modals(),
346
  'themes' => $this->enqueue_themes()
@@ -350,14 +355,12 @@ class Easy_Modal {
350
  );
351
  wp_localize_script( EASYMODAL_SLUG.'-scripts', 'easymodal', $params );
352
  }
353
-
354
  public function admin_styles()
355
  {
356
  $this->styles();
357
  wp_register_style(EASYMODAL_SLUG.'-admin-styles',EASYMODAL_URL.'/inc/css/easy-modal-admin.min.css',false,0.1);
358
  wp_enqueue_style(EASYMODAL_SLUG.'-admin-styles');
359
  }
360
-
361
  public function admin_scripts()
362
  {
363
  wp_enqueue_script('word-count');
@@ -370,7 +373,6 @@ class Easy_Modal {
370
  wp_enqueue_script('jquery-colorpicker', EASYMODAL_URL.'/inc/js/colorpicker.min.js', array('jquery'));
371
  wp_enqueue_script('easy-modal-admin', EASYMODAL_URL.'/inc/js/easy-modal-admin.min.js', array('jquery', 'jquery-ui-core', 'jquery-ui-slider', 'jquery-colorpicker'));
372
  add_action('admin_print_footer_scripts', array(&$this,'admin_footer'),1000);
373
-
374
  }
375
  public function _menus()
376
  {
@@ -412,7 +414,7 @@ class Easy_Modal {
412
  $initArray['style_formats'] = json_encode($styles);
413
  return $initArray;
414
  }
415
- private $_accepted_modal_ids = array('new');
416
  protected $views = array(
417
  'admin_footer' => '/inc/views/admin_footer.php',
418
  'help' => '/inc/views/help.php',
@@ -429,7 +431,6 @@ class Easy_Modal {
429
  {
430
  if($view) return EASYMODAL_DIR.$this->views[$view];
431
  }
432
-
433
  public function settings_page()
434
  {
435
  require $this->load_view('settings');
@@ -493,7 +494,6 @@ class Easy_Modal {
493
  {
494
  require $this->load_view('help');
495
  }
496
-
497
  public function getModalList()
498
  {
499
  return get_option('EasyModal_ModalList',array());
@@ -554,16 +554,16 @@ class Easy_Modal {
554
  }
555
  update_option('EasyModal_License_Status', $license_status);
556
  update_option('EasyModal_License_LastChecked', strtotime(date("Y-m-d H:i:s")));
557
- return true;
558
  }
559
  elseif(empty($key))
560
  {
561
  delete_option('EasyModal_License');
562
  delete_option('EasyModal_License_Status');
563
  delete_option('EasyModal_License_LastChecked');
564
- return true;
565
  }
566
- return false;
567
  }
568
  public function process_post()
569
  {
@@ -582,7 +582,19 @@ class Easy_Modal {
582
  }
583
  }
584
  }
585
- public function updateSettings($post = NULL)
 
 
 
 
 
 
 
 
 
 
 
 
586
  {
587
  $settings = $this->getSettings();
588
  if($post)
@@ -591,17 +603,18 @@ class Easy_Modal {
591
  $this->message('Settings Updated');
592
  if(array_key_exists('license',$post))
593
  {
594
- if($this->process_license($post['license']))
595
  {
596
- wp_redirect('admin.php?page='.EASYMODAL_SLUG.'-settings',302);
 
597
  exit;
598
  }
599
  }
600
- $this->message('Settings Updated');
601
  }
602
  return $settings;
603
  }
604
- public function updateModalSettings($modal_id, $post = NULL, $redirect = false)
605
  {
606
  $modals = $this->getModalList();
607
  if(!is_numeric($modal_id))
@@ -679,7 +692,7 @@ class Easy_Modal {
679
  break;
680
  }
681
  }
682
- isset($clone) ? $this->message('Modal cloned successfully') : $this->message('Modal Updated Successfully');
683
  }
684
  $modals[$settings['id']] = $settings['name'];
685
  update_option('EasyModal_ModalList', $modals);
@@ -687,7 +700,7 @@ class Easy_Modal {
687
  if($redirect) wp_redirect('admin.php?page='.EASYMODAL_SLUG.'&modal_id='.$settings['id'],302);
688
  return $settings;
689
  }
690
- public function updateThemeSettings($theme_id = 1, $post = NULL, $redirect = false)
691
  {
692
  $settings = $this->getThemeSettings(1);
693
  if($post)
@@ -752,13 +765,12 @@ class Easy_Modal {
752
  break;
753
  }
754
  }
755
- $this->message('Theme Updated');
756
  }
757
  update_option('EasyModal_ThemeList', array(1 => $settings['name']));
758
  update_option('EasyModal_Theme-1', $settings);
759
  return $settings;
760
  }
761
-
762
  public function defaultSettings()
763
  {
764
  return array();
@@ -801,7 +813,6 @@ class Easy_Modal {
801
  'containerBorderStyle' => 'solid',
802
  'containerBorderWidth' => '1',
803
  'containerBorderRadius' => '8',
804
-
805
  'closeLocation' => 'inside',
806
  'closeBgColor' => '#000000',
807
  'closeFontColor' => '#F0532B',
@@ -838,50 +849,47 @@ class Easy_Modal {
838
  return $this->loadedModals;
839
  }
840
  public function enqueue_modals()
 
 
 
 
841
  {
842
  $load_modals = $this->loadModals();
843
- $modals = array();
844
- foreach($this->getModalList() as $id => $name)
845
  {
846
- $modal = $this->getModalSettings($id);
847
- $return = false;
848
- if($modal['sitewide'] == true)
849
- {
850
- $return = true;
851
- }
852
- elseif(in_array($id,$load_modals))
853
- {
854
- $return = true;
855
- }
856
- if($return) $modals[$id] = $modal;
857
-
858
- }
859
- return $modals;
860
  }
861
  public function preload_modals()
862
  {
863
- $load_modals = $this->loadModals();
864
- $modals = array();
865
- foreach($this->getModalList() as $id => $name)
866
  {
867
- $modal = $this->getModalSettings($id);
868
- $return = false;
869
- if($modal['sitewide'] == true)
870
  {
871
- $return = true;
872
- }
873
- elseif(in_array($id,$load_modals))
874
- {
875
- $return = true;
876
- }
877
- if($return) require(EASYMODAL_DIR.'/inc/views/modal.php');
 
 
 
 
 
878
  }
879
  }
880
  public function enqueue_themes()
881
  {
882
  return array(1 => $this->getThemeSettings(1));
883
  }
884
-
885
  public function message($message,$type = 'updated')
886
  {
887
  if ( !session_id() )
@@ -972,6 +980,10 @@ class Easy_Modal {
972
  }
973
  return;
974
  }
 
 
 
 
975
  public function prepare_request($action, $args = array())
976
  {
977
  global $wp_version;
@@ -1009,6 +1021,7 @@ class Easy_Modal {
1009
  if (!is_wp_error($request) && ($request['response']['code'] == 200))
1010
  {
1011
  $response = unserialize($request['body']);
 
1012
  }
1013
  if (!empty($response) && is_object($response) && strpos($response->version,'p') !== false) // Feed the update data into WP updater
1014
  {
@@ -1028,6 +1041,7 @@ class Easy_Modal {
1028
  {
1029
  $request_string = $this->prepare_request($action, $args);
1030
  $request = wp_remote_post($this->api_url, $request_string);
 
1031
  if (is_wp_error($request))
1032
  {
1033
  $response = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occurred during the API request.</p> <p><a href="?" onclick="document.location.reload(); return false;">Try again</a>'), $request->get_error_message());
@@ -1056,7 +1070,6 @@ if(!isset($EM))
1056
  {
1057
  $EM = new Easy_Modal;
1058
  }
1059
-
1060
  add_action('admin_init', 'easymodal_disable_older_versions', 1 );
1061
  function easymodal_disable_older_versions()
1062
  {
4
  Plugin URI: https://easy-modal.com
5
  Description: Easily create & style modals with any content. Theme editor to quickly style your modals. Add forms, social media boxes, videos & more.
6
  Author: Wizard Internet Solutions
7
+ Version: 1.3
8
  Author URI: http://wizardinternetsolutions.com
9
  */
10
  if (!defined('EASYMODAL'))
11
  define('EASYMODAL', 'Easy Modal');
 
12
  if (!defined('EASYMODAL_SLUG'))
13
  define('EASYMODAL_SLUG', trim(dirname(plugin_basename(__FILE__)), '/'));
 
14
  if (!defined('EASYMODAL_DIR'))
15
  define('EASYMODAL_DIR', WP_PLUGIN_DIR . '/' . EASYMODAL_SLUG);
 
16
  if (!defined('EASYMODAL_URL'))
17
+ define('EASYMODAL_URL', plugins_url() . '/' . EASYMODAL_SLUG);
 
18
  if (!defined('EASYMODAL_VERSION'))
19
+ define('EASYMODAL_VERSION', '1.3' );
20
+
21
+ include '/inc/classes/gravityforms.php';
22
+ include '/inc/classes/shortcodes.php';
23
 
24
  class Easy_Modal {
25
  protected $api_url = 'http://easy-modal.com/api';
28
  {
29
  if (is_admin())
30
  {
31
+ //add_action('admin_init', array(&$this,'_migrate'),1);
32
  add_action('admin_init', array(&$this,'_messages'),10);
33
 
34
  add_action('admin_init', array(&$this,'process_get'),9);
37
  {
38
  add_action('init', array(&$this,'process_post'),9);
39
  }
40
+ register_activation_hook(__FILE__, array(&$this, '_migrate'));
41
  add_action('admin_menu', array(&$this, '_menus') );
42
  if(isset($_GET['pages']) && $_GET['pages'] == 'easy-modal')
43
  {
68
  add_filter( 'em_modal_content', 'wpautop' );
69
  add_filter( 'em_modal_content', 'shortcode_unautop' );
70
  add_filter( 'em_modal_content', 'prepend_attachment' );
71
+ add_filter( 'em_modal_content', array(&$this,'filters'), 10, 1);
72
  add_filter( 'em_modal_content', 'do_shortcode', 11 );
73
+
74
+ add_filter('em_preload_modals_single', array(&$this,'preload_modal_filter'),1000);
75
+
76
+ add_action('wp_head', array(&$this, 'preload_modals'),1);
77
+ add_action('wp_footer', array(&$this, 'print_modals'),1000);
78
  }
79
  $this->_styles_scripts();
80
 
81
+ //add_action( "in_plugin_update_message-".EASYMODAL_SLUG .'/'. EASYMODAL_SLUG .'.php', array(&$this,'your_update_message_cb'), 20, 2 );
82
  // License Check & Updates
83
  $all_options = wp_load_alloptions();
84
+ if(array_key_exists('EasyModal_License', $all_options) && array_key_exists('EasyModal_License_Status', $all_options) && $license_status = get_option('EasyModal_License_Status'))
85
  {
86
  if(is_array($license_status) && in_array($license_status['status'], array(2000,2001,3002,3003)))
87
  {
116
  }
117
  public function save_easy_modal_post_modals( $post_id, $post )
118
  {
 
119
  /* Verify the nonce before proceeding. */
120
  if ( !isset( $_POST['safe_csrf_nonce_easy_modal'] ) || !wp_verify_nonce( $_POST['safe_csrf_nonce_easy_modal'], "safe_csrf_nonce_easy_modal" ) )
121
  return $post_id;
122
  $post_type = get_post_type_object( $post->post_type );
123
  if ( !current_user_can( $post_type->cap->edit_post, $post_id ) )
124
  return $post_id;
 
125
  $post_modals = ( !empty( $_POST['easy_modal_post_modals']) && $this->all_numeric($_POST['easy_modal_post_modals']) ) ? $_POST['easy_modal_post_modals'] : array() ;
126
  $current_post_modals = get_post_meta( $post_id, 'easy_modal_post_modals', true );
127
  if ( $post_modals && '' == $current_post_modals )
136
  $post_types = apply_filters('em_post_types', array('post','page'));
137
  foreach($post_types as $post_types)
138
  {
139
+ add_meta_box('easy-modal', esc_html__( 'Easy Modal', 'easy-modal' ), array(&$this,'easy_modal_post_modals'), $post_types);
 
 
 
 
 
 
 
140
  }
141
  }
142
  public function editor_admin_head()
180
  $modal['sitewide'] = !empty($modal['sitewide']) ? $modal['sitewide'] : true;
181
  $modal['overlayClose'] = !empty($modal['overlayClose']) && ($modal['overlayClose'] == 'true' || $modal['overlayClose'] == true) ? true : false;
182
  $modal['overlayEscClose'] = !empty($modal['overlayEscClose']) && ($modal['overlayEscClose'] == 'true' || $modal['overlayEscClose'] == true) ? true : false;
183
+ $this->updateModalSettings($key, $modal, false, true);
184
  }
185
  }
186
  }
217
  $Modal = unserialize($Modal);
218
  }
219
  $Modal['name'] = $Modal['title'];
220
+ $this->updateModalSettings('new',$Modal, false, true);
221
+ //delete_option('EasyModal_'.$id);
222
  }
223
+ //delete_option('eM_version');
224
+ //delete_option('EasyModal');
225
  }
226
  protected function _migrate_EM_Lite()
227
  {
238
  {
239
  $Modal = unserialize($Modal);
240
  }
241
+ $Modal['name'] = !empty($Modal['title']) ? $Modal['title'] : 'change_me';
242
+ $this->updateModalSettings($id, $Modal, false, true);
243
+ //delete_option('EasyModalLite_Modal-'.$id);
244
  }
245
  $Theme = get_option('EasyModalLite_Theme-1');
246
  if(!is_array($Theme))
247
  {
248
  $Theme = unserialize($Theme);
249
  }
250
+ $this->updateThemeSettings(1,$Theme,false,true);
251
+ //delete_option('EasyModalLite_Theme-1');
252
  $o_settings = get_option('EasyModalLite_Settings');
253
  if(!is_array($o_settings))
254
  {
255
  $o_settings = unserialize($o_settings);
256
+ if(!is_array($o_settings))
257
+ {
258
+ $o_settings = array();
259
+ }
260
  }
261
+ unset($o_settings['license']);
262
+ $this->updateSettings($o_settings,true);
263
+ //delete_option('EasyModalLite_Settings');
264
+ //delete_option('EasyModalLite_Version');
265
+ //delete_option('EasyModalLite_ModalList');
266
+ //delete_option('EasyModalLite_ThemeList');
267
  }
268
  protected function _migrate_EM_Pro()
269
  {
280
  {
281
  $Theme = unserialize($Theme);
282
  }
283
+ $theme = $this->updateThemeSettings('new',$Theme,false,true);
284
+ //delete_option('EasyModalPro_Theme-'.$id);
285
  $themes[$id] = $theme['theme_id'];
286
  }
287
+ //delete_option('EasyModalPro_ThemeList');
 
288
  $themes = $this->getThemeList();
 
289
  $o_modal_list = get_option('EasyModalPro_ModalList');
290
  if(!is_array($o_modal_list))
291
  {
299
  $Modal = unserialize($Modal);
300
  }
301
  $Modal['theme'] = isset($themes[$id]) ? $theme[$id] : 1;
302
+ $Modal['name'] = !empty($Modal['title']) ? $Modal['title'] : 'change_me';
303
+ $this->updateModalSettings($id, $Modal, false, true);
304
+ //delete_option('EasyModalPro_Modal-'.$id);
305
  }
306
+ //delete_option('EasyModalPro_ModalList');
 
307
  $o_settings = get_option('EasyModalPro_Settings');
308
  if(!is_array($o_settings))
309
  {
310
  $o_settings = unserialize($o_settings);
311
+ if(!is_array($o_settings))
312
+ {
313
+ $o_settings = array();
314
+ }
315
  }
316
+ $license = get_option('EasyModalPro_License');
317
+ $this->process_license($license);
318
+ unset($o_settings['license']);
319
+ $this->updateSettings($o_settings,true);
320
+ //delete_option('EasyModalPro_License');
321
+ //delete_option('EasyModalPro_Settings');
322
+ //delete_option('EasyModalPro_Version');
323
  }
324
  public function resetOptions()
325
  {
344
  }
345
  public function scripts()
346
  {
347
+ wp_enqueue_script('animate-colors', EASYMODAL_URL.'/inc/js/jquery.animate-colors-min.js', array('jquery'));
348
+ wp_enqueue_script(EASYMODAL_SLUG.'-scripts', EASYMODAL_URL.'/inc/js/easy-modal.min.js', array('jquery','animate-colors'));
349
  $data = array(
350
  'modals' => $this->enqueue_modals(),
351
  'themes' => $this->enqueue_themes()
355
  );
356
  wp_localize_script( EASYMODAL_SLUG.'-scripts', 'easymodal', $params );
357
  }
 
358
  public function admin_styles()
359
  {
360
  $this->styles();
361
  wp_register_style(EASYMODAL_SLUG.'-admin-styles',EASYMODAL_URL.'/inc/css/easy-modal-admin.min.css',false,0.1);
362
  wp_enqueue_style(EASYMODAL_SLUG.'-admin-styles');
363
  }
 
364
  public function admin_scripts()
365
  {
366
  wp_enqueue_script('word-count');
373
  wp_enqueue_script('jquery-colorpicker', EASYMODAL_URL.'/inc/js/colorpicker.min.js', array('jquery'));
374
  wp_enqueue_script('easy-modal-admin', EASYMODAL_URL.'/inc/js/easy-modal-admin.min.js', array('jquery', 'jquery-ui-core', 'jquery-ui-slider', 'jquery-colorpicker'));
375
  add_action('admin_print_footer_scripts', array(&$this,'admin_footer'),1000);
 
376
  }
377
  public function _menus()
378
  {
414
  $initArray['style_formats'] = json_encode($styles);
415
  return $initArray;
416
  }
417
+ protected $_accepted_modal_ids = array('new');
418
  protected $views = array(
419
  'admin_footer' => '/inc/views/admin_footer.php',
420
  'help' => '/inc/views/help.php',
431
  {
432
  if($view) return EASYMODAL_DIR.$this->views[$view];
433
  }
 
434
  public function settings_page()
435
  {
436
  require $this->load_view('settings');
494
  {
495
  require $this->load_view('help');
496
  }
 
497
  public function getModalList()
498
  {
499
  return get_option('EasyModal_ModalList',array());
554
  }
555
  update_option('EasyModal_License_Status', $license_status);
556
  update_option('EasyModal_License_LastChecked', strtotime(date("Y-m-d H:i:s")));
557
+ return 1;
558
  }
559
  elseif(empty($key))
560
  {
561
  delete_option('EasyModal_License');
562
  delete_option('EasyModal_License_Status');
563
  delete_option('EasyModal_License_LastChecked');
564
+ return 2;
565
  }
566
+ return 0;
567
  }
568
  public function process_post()
569
  {
582
  }
583
  }
584
  }
585
+ public function upgrade()
586
+ {
587
+ include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
588
+ include_once( ABSPATH . 'wp-admin/includes/update.php' );
589
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
590
+ include_once( ABSPATH . 'wp-admin/includes/file.php' );
591
+
592
+ include '/inc/classes/updater_skin.php';
593
+ $skin = new EM_Updater_Skin();
594
+ $upgrader = new Plugin_Upgrader( $skin );
595
+ return $upgrader->bulk_upgrade( array('easy-modal/easy-modal.php') );
596
+ }
597
+ public function updateSettings($post = NULL, $silent = false)
598
  {
599
  $settings = $this->getSettings();
600
  if($post)
603
  $this->message('Settings Updated');
604
  if(array_key_exists('license',$post))
605
  {
606
+ if($this->process_license($post['license']) == 1)
607
  {
608
+ wp_redirect('update-core.php',302);
609
+ //wp_redirect('admin.php?page='.EASYMODAL_SLUG.'-settings',302);
610
  exit;
611
  }
612
  }
613
+ if(!$silent) $this->message('Settings Updated');
614
  }
615
  return $settings;
616
  }
617
+ public function updateModalSettings($modal_id, $post = NULL, $redirect = false, $silent = false)
618
  {
619
  $modals = $this->getModalList();
620
  if(!is_numeric($modal_id))
692
  break;
693
  }
694
  }
695
+ if(!$silent) isset($clone) ? $this->message('Modal cloned successfully') : $this->message('Modal Updated Successfully');
696
  }
697
  $modals[$settings['id']] = $settings['name'];
698
  update_option('EasyModal_ModalList', $modals);
700
  if($redirect) wp_redirect('admin.php?page='.EASYMODAL_SLUG.'&modal_id='.$settings['id'],302);
701
  return $settings;
702
  }
703
+ public function updateThemeSettings($theme_id = 1, $post = NULL, $redirect = false, $silent = false)
704
  {
705
  $settings = $this->getThemeSettings(1);
706
  if($post)
765
  break;
766
  }
767
  }
768
+ if(!$silent) $this->message('Theme Updated');
769
  }
770
  update_option('EasyModal_ThemeList', array(1 => $settings['name']));
771
  update_option('EasyModal_Theme-1', $settings);
772
  return $settings;
773
  }
 
774
  public function defaultSettings()
775
  {
776
  return array();
813
  'containerBorderStyle' => 'solid',
814
  'containerBorderWidth' => '1',
815
  'containerBorderRadius' => '8',
 
816
  'closeLocation' => 'inside',
817
  'closeBgColor' => '#000000',
818
  'closeFontColor' => '#F0532B',
849
  return $this->loadedModals;
850
  }
851
  public function enqueue_modals()
852
+ {
853
+ return $this->preload_modals();
854
+ }
855
+ public function preload_modal_filter($modal)
856
  {
857
  $load_modals = $this->loadModals();
858
+ if($modal['sitewide'] == true)
 
859
  {
860
+ return $modal;
861
+ }
862
+ elseif(in_array($modal['id'],$load_modals))
863
+ {
864
+ return $modal;
865
+ }
866
+ return false;
 
 
 
 
 
 
 
867
  }
868
  public function preload_modals()
869
  {
870
+ if(empty($this->preloaded_modals))
 
 
871
  {
872
+ $modals = array();
873
+ foreach($this->getModalList() as $id => $name)
 
874
  {
875
+ $modal = apply_filters('em_preload_modals_single', $this->getModalSettings($id));
876
+ if($modal) $modals[$id] = $modal;
877
+ }
878
+ $this->preloaded_modals = $modals;
879
+ }
880
+ return $this->preloaded_modals;
881
+ }
882
+ public function print_modals()
883
+ {
884
+ foreach($this->preload_modals() as $id => $modal)
885
+ {
886
+ require(EASYMODAL_DIR.'/inc/views/modal.php');
887
  }
888
  }
889
  public function enqueue_themes()
890
  {
891
  return array(1 => $this->getThemeSettings(1));
892
  }
 
893
  public function message($message,$type = 'updated')
894
  {
895
  if ( !session_id() )
980
  }
981
  return;
982
  }
983
+
984
+
985
+
986
+
987
  public function prepare_request($action, $args = array())
988
  {
989
  global $wp_version;
1021
  if (!is_wp_error($request) && ($request['response']['code'] == 200))
1022
  {
1023
  $response = unserialize($request['body']);
1024
+
1025
  }
1026
  if (!empty($response) && is_object($response) && strpos($response->version,'p') !== false) // Feed the update data into WP updater
1027
  {
1041
  {
1042
  $request_string = $this->prepare_request($action, $args);
1043
  $request = wp_remote_post($this->api_url, $request_string);
1044
+
1045
  if (is_wp_error($request))
1046
  {
1047
  $response = new WP_Error('plugins_api_failed', __('An Unexpected HTTP Error occurred during the API request.</p> <p><a href="?" onclick="document.location.reload(); return false;">Try again</a>'), $request->get_error_message());
1070
  {
1071
  $EM = new Easy_Modal;
1072
  }
 
1073
  add_action('admin_init', 'easymodal_disable_older_versions', 1 );
1074
  function easymodal_disable_older_versions()
1075
  {
inc/classes/gravityforms.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class EM_GravityForms {
3
+ public function __construct()
4
+ {
5
+ add_filter('em_preload_modals_single', array(&$this,'preload_modals'));
6
+ }
7
+
8
+ public function preload_modals($modal)
9
+ {
10
+ if(has_shortcode( $modal['content'], 'gravityform' ))
11
+ {
12
+ $regex = "/\[gravityform.*? id=[\"\']?([0-9]*)[\"\']?.*/";
13
+ preg_match_all($regex, $modal['content'],$matches);
14
+ foreach($matches[1] as $form_id)
15
+ {
16
+ add_filter("gform_confirmation_anchor_{$form_id}", create_function("","return false;"));
17
+ gravity_form_enqueue_scripts($form_id, true);
18
+ }
19
+ }
20
+ return $modal;
21
+ }
22
+ }
23
+ $EM_GravityForms = new EM_GravityForms;
inc/classes/shortcodes.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class EM_Shortcodes
3
+ {
4
+ public function __construct()
5
+ {
6
+ add_shortcode( 'modal', array(&$this, 'modal'));
7
+ }
8
+ public function modal($atts, $content = NULL)
9
+ {
10
+ extract( shortcode_atts( array(
11
+ 'id' => "",
12
+ 'title' => "",
13
+ 'theme' => 1,
14
+ 'size' => "normal",
15
+ 'width' => "",
16
+ 'widthUnit' => "px",
17
+ 'height' => "",
18
+ 'heightUnit' => "px",
19
+ 'animation' => "fade",
20
+ 'duration' => 350,
21
+ 'direction' => "down",
22
+ 'overlayClose' => false,
23
+ 'overlayEscClose' => false,
24
+ 'closeDisabled' => false,
25
+ ), $atts ) );
26
+ $output = "<div ".
27
+ "id='eModal-" . esc_attr($id) . "' ".
28
+ "class='modal " . esc_attr($size != 'custom' ? "{$size} " : ""). "theme-{$theme}' ".
29
+ "data-Theme='{$theme}' ".
30
+ "data-size='{$size}' ".
31
+ ($size == 'custom' ?
32
+ "style='width:{$width}{$widthUnit};height:{$height}{$heightUnit};margin-left:-".($width/2)."{$widthUnit}' ".
33
+ "data-userheight='{$height}{$heightUnit}' ".
34
+ "data-userwidth='{$width}{$widthUnit}' "
35
+ : "").
36
+ "data-Animation='{$animation}' ".
37
+ "data-direction='{$direction}' ".
38
+ "data-duration='{$duration}' ".
39
+ ($overlayClose ? "data-overlaylose='true' " : "") .
40
+ ($overlayEscClose ? "data-escclose='true' " : "") .
41
+ ($closeDisabled ? "data-closedisabled='true' " : "") .
42
+ ">";
43
+ if($title != '')
44
+ {
45
+ $output .= "<div class='title'>" . esc_html($title) . "</div>";
46
+ }
47
+ $output .= apply_filters('em_modal_content', $content);
48
+ if(!$closeDisabled)
49
+ {
50
+ $output .= "<a class='close-modal'>&#215;</a>";
51
+ }
52
+ $output .= "</div>";
53
+ return $output;
54
+ }
55
+ }
56
+ $EM_Shortcodes = new EM_Shortcodes;
inc/classes/updater_skin.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
4
+
5
+ class EM_Updater_Skin extends WP_Upgrader_Skin {
6
+ var $messages = array();
7
+
8
+ function __construct( $args = array() ) {
9
+ parent::__construct( $args );
10
+ }
11
+
12
+ function feedback( $data ) {
13
+ if ( is_wp_error( $data ) )
14
+ $string = $data->get_error_message();
15
+ else if ( is_array( $data ) )
16
+ return;
17
+ else
18
+ $string = $data;
19
+
20
+ if ( ! empty( $this->upgrader->strings[ $string ] ) )
21
+ $string = $this->upgrader->strings[ $string ];
22
+
23
+ if ( strpos( $string, '%' ) !== false ) {
24
+ $args = func_get_args();
25
+ $args = array_splice( $args, 1 );
26
+ if ( ! empty( $args ) )
27
+ $string = vsprintf( $string, $args );
28
+ }
29
+
30
+ $string = trim( $string );
31
+
32
+ // Only allow basic HTML in the messages
33
+ $string = wp_kses( $string, array( 'a' => array( 'href' => array() ), 'br' => array(), 'em' => array(), 'strong' => array() ) );
34
+
35
+ if ( empty( $string ) )
36
+ return;
37
+
38
+ $this->messages[] = $string;
39
+ }
40
+
41
+ function header() {
42
+ ob_start();
43
+ }
44
+
45
+ function footer() {
46
+ $output = ob_get_contents();
47
+ if ( ! empty( $output ) )
48
+ $this->feedback( $output );
49
+ ob_end_clean();
50
+ }
51
+ function bulk_header() {}
52
+ function bulk_footer() {}
53
+ function before() {}
54
+ function after() {}
55
+ }
inc/css/easy-modal.css CHANGED
@@ -9,9 +9,9 @@
9
  top: 0;
10
  left: 0;
11
  }
12
- .modal, .modal:before, .modal:after, .modal * {
13
  -moz-box-sizing: border-box;
14
- }
15
  .modal {
16
  font-size: 16px;
17
  display: none;
@@ -60,6 +60,10 @@
60
  padding: 1.875em;
61
  top: 6.25em;
62
  }
 
 
 
 
63
  .modal.tiny {
64
  margin-left: -15%;
65
  width: 30%;
9
  top: 0;
10
  left: 0;
11
  }
12
+ /*.modal, .modal:before, .modal:after, .modal * {
13
  -moz-box-sizing: border-box;
14
+ }*/
15
  .modal {
16
  font-size: 16px;
17
  display: none;
60
  padding: 1.875em;
61
  top: 6.25em;
62
  }
63
+ .modal.nano {
64
+ margin-left: -10%;
65
+ width: 20%;
66
+ }
67
  .modal.tiny {
68
  margin-left: -15%;
69
  width: 30%;
inc/css/easy-modal.min.css CHANGED
@@ -1 +1 @@
1
- #modal-overlay { position: fixed; height: 100%; width: 100%; background: #000; background: rgba(0,0,0,0.45); z-index: 998; display: none; top: 0; left: 0;}.modal, .modal:before, .modal:after, .modal * { -moz-box-sizing: border-box;}.modal { font-size: 16px; display: none; visibility: hidden; top: 100px; left: 50%; margin-left: -40%; width: 80%; height: auto; background-color: white; border: solid 1px #666; overflow:visible; position: absolute; z-index: 999; padding: 1.25em; -webkit-border-radius: 5px; border-radius: 5px; -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); transform: scale(1, 1); transform-origin: 0;}.modal .close-modal { text-decoration: none; text-align: center; font-size: 1.375em; line-height: 1; position: absolute; top: .5em; right: .6875em; color: #aaa; text-shadow: 0 -1px 1px rbga(0, 0, 0, .6); font-weight: bold; cursor: pointer;}.modal .title { display: block;}.modal-placeholder { z-index: 100; left: 50%; position: absolute;} @media only screen and (min-width: 768px){.modal { padding: 1.875em; top: 6.25em;}.modal.tiny { margin-left: -15%; width: 30%;}.modal.small { margin-left: -20%; width: 40%;}.modal.medium { margin-left: -30%; width: 60%;}.modal.large { margin-left: -35%; width: 70%;}.modal.xlarge { margin-left: -47.5%; width: 95%;}.modal>:first-child { margin-top: 0;}.modal>:last-child { margin-bottom: 0;}} @media print{.modal { background: white!important;}}
1
+ #modal-overlay{position:fixed;height:100%;width:100%;background:#000;background:rgba(0,0,0,0.45);z-index:998;display:none;top:0;left:0}.modal{font-size:16px;display:none;visibility:hidden;top:100px;left:50%;margin-left:-40%;width:80%;height:auto;background-color:white;border:solid 1px #666;overflow:visible;position:absolute;z-index:999;padding:1.25em;-webkit-border-radius:5px;border-radius:5px;-webkit-box-shadow:0 0 10px rgba(0,0,0,0.4);box-shadow:0 0 10px rgba(0,0,0,0.4);transform:scale(1,1);transform-origin:0 0}.modal .close-modal{text-decoration:none;text-align:center;font-size:1.375em;line-height:1;position:absolute;top:.5em;right:.6875em;color:#aaa;text-shadow:0 -1px 1px rbga(0,0,0,.6);font-weight:bold;cursor:pointer}.modal .title{display:block}.modal-placeholder{z-index:100;left:50%;position:absolute}@media only screen and (min-width:768px){.modal{padding:1.875em;top:6.25em}.modal.nano{margin-left:-10%;width:20%}.modal.tiny{margin-left:-15%;width:30%}.modal.small{margin-left:-20%;width:40%}.modal.medium{margin-left:-30%;width:60%}.modal.large{margin-left:-35%;width:70%}.modal.xlarge{margin-left:-47.5%;width:95%}.modal>:first-child{margin-top:0}.modal>:last-child{margin-bottom:0}}@media print{.modal{background:white !important}}
inc/functions.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(!function_exists('modal_open'))
3
+ {
4
+ function modal_open($atts)
5
+ {
6
+ global $EM_Shortcodes;
7
+ $EM_Shortcodes
8
+ }
9
+ }
10
+ if(!function_exists('modal_close'))
11
+ {
12
+ function modal_close()
13
+ {
14
+
15
+ }
16
+ }
inc/js/easy-modal-admin.js CHANGED
@@ -13,7 +13,6 @@ jQuery(document).ready(function(){
13
  jQuery('#'+id).addClass('active');
14
  jQuery(this).addClass('nav-tab-active');
15
  });
16
-
17
  /* Value Sliders */
18
  jQuery("#overlayOpacitySlider")
19
  .slider({value: 0,range: "min",min: 0,max: 100,step: 1,slide: function(t, n){
13
  jQuery('#'+id).addClass('active');
14
  jQuery(this).addClass('nav-tab-active');
15
  });
 
16
  /* Value Sliders */
17
  jQuery("#overlayOpacitySlider")
18
  .slider({value: 0,range: "min",min: 0,max: 100,step: 1,slide: function(t, n){
inc/js/easy-modal.js CHANGED
@@ -1,11 +1,15 @@
1
- // Easy Modal v1.2
2
  (function ($)
3
  {
4
  var currentMousePos = { x: -1, y: -1 };
5
  var methods = {
6
  init: function (options)
7
  {
8
- var opts = $.extend({}, $.fn.emodal.defaults, options);
 
 
 
 
9
  return $(this).data('emodal', opts);
10
  },
11
  close: function (options)
@@ -14,8 +18,9 @@
14
  speed: 'fast',
15
  overlay: true
16
  }, $.fn.emodal.defaults, options);
17
-
18
  var $this = $(this);
 
19
  var opts = $this.data('emodal');
20
  $this.removeClass('active').fadeOut(options.speed,function(){
21
  if(options.overlay)
@@ -54,7 +59,7 @@
54
  $this.addClass('active');
55
  // Modal Clos Button
56
 
57
- if(!opts.closeDisabled && $('.close-modal',$this).length)
58
  {
59
  $('.close-modal',$this)
60
  .unbind('click')
@@ -65,14 +70,14 @@
65
  .unbind('click')
66
  .click(function()
67
  {
68
- if (opts.overlayClose == true)
69
  {
70
  $this.emodal('close');
71
  }
72
  })
73
  .themeOverlay(opts);
74
 
75
- if(opts.overlayEscClose == true)
76
  {
77
  $(window).bind('keyup.emodal',function(e){
78
  if($('.modal.active').length && e.keyCode == 27)
@@ -139,6 +144,7 @@
139
  .attr('id',opts.nextId)
140
  .click(function (){
141
  var current = $('.eModal-Opened')
 
142
  var next = abcs.eq(abcs.index(current) + 1)
143
  current.removeClass('eModal-Opened')
144
  if (next.length == 0) next = abcs.eq(0)
@@ -226,9 +232,9 @@
226
  content.css({maxHeight: (opts.maxHeight - 60) + 'px'});
227
  }
228
 
229
- if(opts.userHeight > 0)
230
  {
231
- content.css({height: opts.userHeight + 'px'});
232
  }
233
 
234
  if(opts.userMaxWidth > 0)
@@ -236,9 +242,9 @@
236
  content.css({maxWidth: $(window).width() * (opts.userMaxWidth / 100) + 'px'});
237
  }
238
 
239
- if(opts.userWidth > 0)
240
  {
241
- content.css({width: opts.userWidth + 'px'});
242
  }
243
  var title = content
244
  .find("#eModal-Title")
@@ -300,15 +306,16 @@
300
  {
301
  var theme = themes[opts.theme];
302
  }
 
303
  if(opts.size == 'custom')
304
  {
305
  $this.css({
306
- 'height': opts.userHeight ? opts.userHeight + opts.userHeightUnit : $this.css('height'),
307
- 'width': opts.userWidth ? opts.userWidth + opts.userWidthUnit : $this.css('width'),
308
- 'margin-left': opts.userWidth ? -(opts.userWidth / 2) + opts.userWidthUnit : $this.css('margin-left')
309
  });
310
  }
311
- return $this
312
  .addClass(opts.size)
313
  .addClass('theme-'+opts.theme)
314
  .css({
@@ -318,7 +325,13 @@
318
  border: theme.containerBorderColor + ' ' + theme.containerBorderStyle + ' ' + theme.containerBorderWidth + 'px',
319
  "-webkit-border-radius": theme.containerBorderRadius + 'px',
320
  "border-radius": theme.containerBorderRadius + 'px'
321
- })
 
 
 
 
 
 
322
  };
323
  $.fn.themeClose = function(opts)
324
  {
@@ -582,8 +595,8 @@
582
  };
583
 
584
  $.fn.animation.defaults = {
585
- duration:750,
586
- direction: 'mouse',
587
  easing: 'swing'
588
  };
589
  $.fn.emodal.defaults = {
@@ -591,14 +604,14 @@
591
  onLoad: function (){},
592
  onClose: function (){},
593
  type: null,
594
- maxHeight: null,
595
- maxWidth: null,
596
- userHeight: null,
597
- userWidth: null,
598
  animation: 'fadeAndSlide',
599
  direction: 'bottom',
600
- overlayClose: false,
601
- overlayEscClose: false
 
 
602
  };
603
  var modals = easymodal.modals;
604
  var themes = easymodal.themes;
@@ -611,7 +624,6 @@
611
  var $this = $(this).css({visibility:'visible'}).hide(0);
612
  var modalId = $this.attr('id').split("-")[1];
613
  $this.emodal(modals[modalId]);
614
-
615
  $(document).on('click','.'+$this.attr('id'),function(e){
616
  e.preventDefault();
617
  e.stopPropagation();
@@ -621,11 +633,18 @@
621
  });
622
  $('.'+$this.attr('id')).css('cursor','pointer');
623
  });
 
 
 
 
 
624
  if(easymodal.autoOpen && !$.cookie("eModal-autoOpen-"+easymodal.autoOpen.id))
625
  {
626
  setTimeout(function(){
627
  $('#eModal-'+easymodal.autoOpen.id).emodal('open');
628
- $.cookie("eModal-autoOpen-"+easymodal.autoOpen.id, true, { expires : parseInt(easymodal.autoOpen.timer) });
 
 
629
  },easymodal.autoOpen.delay);
630
  }
631
  if(easymodal.autoExit && !$.cookie("eModal-autoExit-"+easymodal.autoExit.id))
@@ -636,12 +655,12 @@
636
  return false;
637
  }
638
  $this = $('#eModal-'+easymodal.autoExit.id).emodal('open');
639
- $.cookie("eModal-autoExit-"+easymodal.autoExit.id, true, { expires : parseInt(easymodal.autoExit.timer) });
 
 
640
  });
641
  }
642
 
643
-
644
-
645
  // Run our login ajax
646
  $('#eModal-Login form').on('submit', function(e) {
647
  $form = $(this);
@@ -687,23 +706,35 @@
687
  e.preventDefault();
688
  // Check what form is currently being submitted so we can return the right values for the ajax request.
689
  // Display our loading message while we check the credentials.
690
- $form.append('<p class="message notice">' + easymodal.loadingtext + '</p>');
 
 
 
691
  // Check if we are trying to login. If so, process all the needed form fields and return a faild or success message.
 
 
 
 
 
 
 
 
692
  $.ajax({
693
  type: 'POST',
694
  dataType: 'json',
695
  url: easymodal.ajaxLogin,
696
  data: {
697
  'action' : 'ajaxlogin', // Calls our wp_ajax_nopriv_ajaxlogin
698
- 'username' : $('#forgot_login',$form).val(),
699
- 'email' : $('#reg_email',$form).val(),
 
700
  'register' : true,
701
  'easy-modal' : $('#safe_csrf_nonce_easy_modal',$form).val()
702
  },
703
  success: function(results) {
704
  // Check the returned data message. If we logged in successfully, then let our users know and remove the modal window.
705
  if(results.loggedin === true) {
706
- $('p.message',$form).removeClass('notice').addClass('success').text(results.message).show();
707
  setTimeout(function(){
708
  $('#eModal-Login').emodal('close',{onClose: function(){
709
  window.location.href = easymodal.redirecturl;
@@ -712,7 +743,7 @@
712
  },2000);
713
 
714
  } else {
715
- $('p.message',$form).removeClass('notice').addClass('error').text(results.message).show();
716
  }
717
  }
718
  });
@@ -830,97 +861,4 @@
830
  }
831
  */
832
  })
833
- })(jQuery);
834
- /*!
835
- * jQuery Cookie Plugin v1.3.1
836
- * https://github.com/carhartl/jquery-cookie
837
- *
838
- * Copyright 2013 Klaus Hartl
839
- * Released under the MIT license
840
- */
841
-
842
- (function (factory) {
843
- if (typeof define === 'function' && define.amd) {
844
- // AMD. Register as anonymous module.
845
- define(['jquery'], factory);
846
- } else {
847
- // Browser globals.
848
- factory(jQuery);
849
- }
850
- }(function ($) {
851
- var pluses = /\+/g;
852
- function raw(s) {
853
- return s;
854
- }
855
- function decoded(s) {
856
- return decodeURIComponent(s.replace(pluses, ' '));
857
- }
858
- function converted(s) {
859
- if (s.indexOf('"') === 0) {
860
- // This is a quoted cookie as according to RFC2068, unescape
861
- s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
862
- }
863
- try {
864
- return config.json ? JSON.parse(s) : s;
865
- } catch(er) {}
866
- }
867
- var config = $.cookie = function (key, value, options) {
868
- // write
869
- if (value !== undefined) {
870
- options = $.extend({}, config.defaults, options);
871
- if (typeof options.expires === 'number') {
872
- var days = options.expires, t = options.expires = new Date();
873
- t.setDate(t.getDate() + days);
874
- }
875
- value = config.json ? JSON.stringify(value) : String(value);
876
- return (document.cookie = [
877
- config.raw ? key : encodeURIComponent(key),
878
- '=',
879
- config.raw ? value : encodeURIComponent(value),
880
- options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
881
- options.path ? '; path=' + options.path : '',
882
- options.domain ? '; domain=' + options.domain : '',
883
- options.secure ? '; secure' : ''
884
- ].join(''));
885
- }
886
- // read
887
- var decode = config.raw ? raw : decoded;
888
- var cookies = document.cookie.split('; ');
889
- var result = key ? undefined : {};
890
- for (var i = 0, l = cookies.length; i < l; i++) {
891
- var parts = cookies[i].split('=');
892
- var name = decode(parts.shift());
893
- var cookie = decode(parts.join('='));
894
- if (key && key === name) {
895
- result = converted(cookie);
896
- break;
897
- }
898
- if (!key) {
899
- result[name] = converted(cookie);
900
- }
901
- }
902
- return result;
903
- };
904
- config.defaults = {};
905
- $.removeCookie = function (key, options) {
906
- if ($.cookie(key) !== undefined) {
907
- // Must not alter options, thus extending a fresh object...
908
- $.cookie(key, '', $.extend({}, options, { expires: -1 }));
909
- return true;
910
- }
911
- return false;
912
- };
913
- }));
914
- (function(h,m){function n(a,b,c){var d=r[b.type]||{};if(null==a)return c||!b.def?null:b.def;a=d.floor?~~a:parseFloat(a);return isNaN(a)?b.def:d.mod?(a+d.mod)%d.mod:0>a?0:d.max<a?d.max:a}function s(a){var b=f(),c=b._rgba=[],a=a.toLowerCase();j(v,function(d,g){var e,i=g.re.exec(a);e=i&&g.parse(i);i=g.space||"rgba";if(e)return e=b[i](e),b[k[i].cache]=e[k[i].cache],c=b._rgba=e._rgba,!1});return c.length?("0,0,0,0"===c.join()&&h.extend(c,o.transparent),b):o[a]}function p(a,b,c){c=(c+1)%1;return 1>6*c?
915
- a+6*(b-a)*c:1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}var w=/^([\-+])=\s*(\d+\.?\d*)/,v=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(a){return[a[1],a[2],a[3],a[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(a){return[2.55*a[1],2.55*a[2],2.55*a[3],a[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(a){return[parseInt(a[1],16),parseInt(a[2],16),
916
- parseInt(a[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(a){return[a[1],a[2]/100,a[3]/100,a[4]]}}],f=h.Color=function(a,b,c,d){return new h.Color.fn.parse(a,b,c,d)},k={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,
917
- type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},r={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},t=f.support={},u=h("<p>")[0],o,j=h.each;u.style.cssText="background-color:rgba(1,1,1,.5)";t.rgba=-1<u.style.backgroundColor.indexOf("rgba");j(k,function(a,b){b.cache="_"+a;b.props.alpha={idx:3,type:"percent",def:1}});f.fn=h.extend(f.prototype,{parse:function(a,b,c,d){if(a===m)return this._rgba=[null,null,null,null],this;if(a.jquery||a.nodeType)a=
918
- h(a).css(b),b=m;var g=this,e=h.type(a),i=this._rgba=[];b!==m&&(a=[a,b,c,d],e="array");if("string"===e)return this.parse(s(a)||o._default);if("array"===e)return j(k.rgba.props,function(d,c){i[c.idx]=n(a[c.idx],c)}),this;if("object"===e)return a instanceof f?j(k,function(c,d){a[d.cache]&&(g[d.cache]=a[d.cache].slice())}):j(k,function(d,c){var b=c.cache;j(c.props,function(d,e){if(!g[b]&&c.to){if(d==="alpha"||a[d]==null)return;g[b]=c.to(g._rgba)}g[b][e.idx]=n(a[d],e,true)});if(g[b]&&h.inArray(null,g[b].slice(0,
919
- 3))<0){g[b][3]=1;if(c.from)g._rgba=c.from(g[b])}}),this},is:function(a){var b=f(a),c=!0,d=this;j(k,function(a,e){var i,h=b[e.cache];h&&(i=d[e.cache]||e.to&&e.to(d._rgba)||[],j(e.props,function(a,d){if(null!=h[d.idx])return c=h[d.idx]===i[d.idx]}));return c});return c},_space:function(){var a=[],b=this;j(k,function(c,d){b[d.cache]&&a.push(c)});return a.pop()},transition:function(a,b){var c=f(a),d=c._space(),g=k[d],e=0===this.alpha()?f("transparent"):this,i=e[g.cache]||g.to(e._rgba),h=i.slice(),c=c[g.cache];
920
- j(g.props,function(a,d){var g=d.idx,e=i[g],f=c[g],j=r[d.type]||{};null!==f&&(null===e?h[g]=f:(j.mod&&(f-e>j.mod/2?e+=j.mod:e-f>j.mod/2&&(e-=j.mod)),h[g]=n((f-e)*b+e,d)))});return this[d](h)},blend:function(a){if(1===this._rgba[3])return this;var b=this._rgba.slice(),c=b.pop(),d=f(a)._rgba;return f(h.map(b,function(a,b){return(1-c)*d[b]+c*a}))},toRgbaString:function(){var a="rgba(",b=h.map(this._rgba,function(a,d){return null==a?2<d?1:0:a});1===b[3]&&(b.pop(),a="rgb(");return a+b.join()+")"},toHslaString:function(){var a=
921
- "hsla(",b=h.map(this.hsla(),function(a,d){null==a&&(a=2<d?1:0);d&&3>d&&(a=Math.round(100*a)+"%");return a});1===b[3]&&(b.pop(),a="hsl(");return a+b.join()+")"},toHexString:function(a){var b=this._rgba.slice(),c=b.pop();a&&b.push(~~(255*c));return"#"+h.map(b,function(a){a=(a||0).toString(16);return 1===a.length?"0"+a:a}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}});f.fn.parse.prototype=f.fn;k.hsla.to=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,
922
- null,null,a[3]];var b=a[0]/255,c=a[1]/255,d=a[2]/255,a=a[3],g=Math.max(b,c,d),e=Math.min(b,c,d),i=g-e,h=g+e,f=0.5*h;return[Math.round(e===g?0:b===g?60*(c-d)/i+360:c===g?60*(d-b)/i+120:60*(b-c)/i+240)%360,0===f||1===f?f:0.5>=f?i/h:i/(2-h),f,null==a?1:a]};k.hsla.from=function(a){if(null==a[0]||null==a[1]||null==a[2])return[null,null,null,a[3]];var b=a[0]/360,c=a[1],d=a[2],a=a[3],c=0.5>=d?d*(1+c):d+c-d*c,d=2*d-c;return[Math.round(255*p(d,c,b+1/3)),Math.round(255*p(d,c,b)),Math.round(255*p(d,c,b-1/3)),
923
- a]};j(k,function(a,b){var c=b.props,d=b.cache,g=b.to,e=b.from;f.fn[a]=function(a){g&&!this[d]&&(this[d]=g(this._rgba));if(a===m)return this[d].slice();var b,q=h.type(a),k="array"===q||"object"===q?a:arguments,l=this[d].slice();j(c,function(a,d){var b=k["object"===q?a:d.idx];null==b&&(b=l[d.idx]);l[d.idx]=n(b,d)});return e?(b=f(e(l)),b[d]=l,b):f(l)};j(c,function(d,b){f.fn[d]||(f.fn[d]=function(c){var e=h.type(c),g="alpha"===d?this._hsla?"hsla":"rgba":a,f=this[g](),j=f[b.idx];if("undefined"===e)return j;
924
- "function"===e&&(c=c.call(this,j),e=h.type(c));if(null==c&&b.empty)return this;"string"===e&&(e=w.exec(c))&&(c=j+parseFloat(e[2])*("+"===e[1]?1:-1));f[b.idx]=c;return this[g](f)})})});f.hook=function(a){a=a.split(" ");j(a,function(a,c){h.cssHooks[c]={set:function(a,b){var e,i="";if("string"!==h.type(b)||(e=s(b))){b=f(e||b);if(!t.rgba&&1!==b._rgba[3]){for(e="backgroundColor"===c?a.parentNode:a;(""===i||"transparent"===i)&&e&&e.style;)try{i=h.css(e,"backgroundColor"),e=e.parentNode}catch(j){}b=b.blend(i&&
925
- "transparent"!==i?i:"_default")}b=b.toRgbaString()}try{a.style[c]=b}catch(k){}}};h.fx.step[c]=function(a){a.colorInit||(a.start=f(a.elem,c),a.end=f(a.end),a.colorInit=!0);h.cssHooks[c].set(a.elem,a.start.transition(a.end,a.pos))}})};f.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor");h.cssHooks.borderColor={expand:function(a){var b={};j(["Top","Right","Bottom","Left"],function(c,d){b["border"+
926
- d+"Color"]=a});return b}};o=h.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}})(jQuery);
1
+ // Easy Modal v1.3
2
  (function ($)
3
  {
4
  var currentMousePos = { x: -1, y: -1 };
5
  var methods = {
6
  init: function (options)
7
  {
8
+ if(!$(this).parent().is('body'))
9
+ {
10
+ $(this).appendTo('body');
11
+ }
12
+ var opts = $.extend({}, $.fn.emodal.defaults, $(this).data(), options);
13
  return $(this).data('emodal', opts);
14
  },
15
  close: function (options)
18
  speed: 'fast',
19
  overlay: true
20
  }, $.fn.emodal.defaults, options);
21
+
22
  var $this = $(this);
23
+
24
  var opts = $this.data('emodal');
25
  $this.removeClass('active').fadeOut(options.speed,function(){
26
  if(options.overlay)
59
  $this.addClass('active');
60
  // Modal Clos Button
61
 
62
+ if(!opts.closedisabled && $('.close-modal',$this).length)
63
  {
64
  $('.close-modal',$this)
65
  .unbind('click')
70
  .unbind('click')
71
  .click(function()
72
  {
73
+ if (opts.overlayclose == true)
74
  {
75
  $this.emodal('close');
76
  }
77
  })
78
  .themeOverlay(opts);
79
 
80
+ if(opts.escclose == true)
81
  {
82
  $(window).bind('keyup.emodal',function(e){
83
  if($('.modal.active').length && e.keyCode == 27)
144
  .attr('id',opts.nextId)
145
  .click(function (){
146
  var current = $('.eModal-Opened')
147
+
148
  var next = abcs.eq(abcs.index(current) + 1)
149
  current.removeClass('eModal-Opened')
150
  if (next.length == 0) next = abcs.eq(0)
232
  content.css({maxHeight: (opts.maxHeight - 60) + 'px'});
233
  }
234
 
235
+ if(opts.userheight > 0)
236
  {
237
+ content.css({height: opts.userheight + 'px'});
238
  }
239
 
240
  if(opts.userMaxWidth > 0)
242
  content.css({maxWidth: $(window).width() * (opts.userMaxWidth / 100) + 'px'});
243
  }
244
 
245
+ if(opts.userwidth > 0)
246
  {
247
+ content.css({width: opts.userwidth + 'px'});
248
  }
249
  var title = content
250
  .find("#eModal-Title")
306
  {
307
  var theme = themes[opts.theme];
308
  }
309
+ console.log(theme);
310
  if(opts.size == 'custom')
311
  {
312
  $this.css({
313
+ 'height': opts.userheight ? opts.userheight + opts.userheightunit : $this.css('height'),
314
+ 'width': opts.userwidth ? opts.userwidth + opts.userwidthunit : $this.css('width'),
315
+ 'margin-left': opts.userwidth ? -(opts.userwidth / 2) + opts.userwidthunit : $this.css('margin-left')
316
  });
317
  }
318
+ $this
319
  .addClass(opts.size)
320
  .addClass('theme-'+opts.theme)
321
  .css({
325
  border: theme.containerBorderColor + ' ' + theme.containerBorderStyle + ' ' + theme.containerBorderWidth + 'px',
326
  "-webkit-border-radius": theme.containerBorderRadius + 'px',
327
  "border-radius": theme.containerBorderRadius + 'px'
328
+ });
329
+ $('.title', $this).css({
330
+ color: theme.contentTitleFontColor,
331
+ fontFamily: theme.contentTitleFontFamily,
332
+ fontSize: theme.contentTitleFontSize
333
+ });
334
+ return $this;
335
  };
336
  $.fn.themeClose = function(opts)
337
  {
595
  };
596
 
597
  $.fn.animation.defaults = {
598
+ duration:350,
599
+ direction: 'top',
600
  easing: 'swing'
601
  };
602
  $.fn.emodal.defaults = {
604
  onLoad: function (){},
605
  onClose: function (){},
606
  type: null,
607
+ userheight: null,
608
+ userwidth: null,
 
 
609
  animation: 'fadeAndSlide',
610
  direction: 'bottom',
611
+ duration: 350,
612
+ overlayclose: false,
613
+ escclose: false,
614
+ closedisabled: false
615
  };
616
  var modals = easymodal.modals;
617
  var themes = easymodal.themes;
624
  var $this = $(this).css({visibility:'visible'}).hide(0);
625
  var modalId = $this.attr('id').split("-")[1];
626
  $this.emodal(modals[modalId]);
 
627
  $(document).on('click','.'+$this.attr('id'),function(e){
628
  e.preventDefault();
629
  e.stopPropagation();
633
  });
634
  $('.'+$this.attr('id')).css('cursor','pointer');
635
  });
636
+ if(easymodal.force_user_login)
637
+ {
638
+ $('#eModal-Login .close-modal, #eModal-Register .close-modal, #eModal-Forgot .close-modal').hide();
639
+ $('#eModal-Register, #eModal-Forgot').append($('<a class="eModal-Login">Back to Login Form</a>').css('cursor','pointer'));
640
+ }
641
  if(easymodal.autoOpen && !$.cookie("eModal-autoOpen-"+easymodal.autoOpen.id))
642
  {
643
  setTimeout(function(){
644
  $('#eModal-'+easymodal.autoOpen.id).emodal('open');
645
+ var date = new Date();
646
+ date.setTime(date.getTime() + (easymodal.autoOpen.timer * 24 * 60 * 1000));
647
+ $.cookie("eModal-autoOpen-"+easymodal.autoOpen.id, true, { expires : date });
648
  },easymodal.autoOpen.delay);
649
  }
650
  if(easymodal.autoExit && !$.cookie("eModal-autoExit-"+easymodal.autoExit.id))
655
  return false;
656
  }
657
  $this = $('#eModal-'+easymodal.autoExit.id).emodal('open');
658
+ var date = new Date();
659
+ date.setTime(date.getTime() + (easymodal.autoExit.timer * 24 * 60 * 1000));
660
+ $.cookie("eModal-autoExit-"+easymodal.autoExit.id, true, { expires : date });
661
  });
662
  }
663
 
 
 
664
  // Run our login ajax
665
  $('#eModal-Login form').on('submit', function(e) {
666
  $form = $(this);
706
  e.preventDefault();
707
  // Check what form is currently being submitted so we can return the right values for the ajax request.
708
  // Display our loading message while we check the credentials.
709
+ if(!$('p.message',$form).length)
710
+ {
711
+ $form.append('<p class="message notice">' + easymodal.loadingtext + '</p>');
712
+ }
713
  // Check if we are trying to login. If so, process all the needed form fields and return a faild or success message.
714
+ if($('#reg_pass',$form).length)
715
+ {
716
+ if($('#reg_pass',$form).val() != $('#reg_confirm',$form).val())
717
+ {
718
+ $('p.message',$form).removeClass('notice').addClass('error').html('Passwords don\'t match.');
719
+ return;
720
+ }
721
+ }
722
  $.ajax({
723
  type: 'POST',
724
  dataType: 'json',
725
  url: easymodal.ajaxLogin,
726
  data: {
727
  'action' : 'ajaxlogin', // Calls our wp_ajax_nopriv_ajaxlogin
728
+ 'user_login' : $('#reg_user',$form).val(),
729
+ 'user_email' : $('#reg_email',$form).val(),
730
+ 'user_pass' : $('#reg_pass',$form).val(),
731
  'register' : true,
732
  'easy-modal' : $('#safe_csrf_nonce_easy_modal',$form).val()
733
  },
734
  success: function(results) {
735
  // Check the returned data message. If we logged in successfully, then let our users know and remove the modal window.
736
  if(results.loggedin === true) {
737
+ $('p.message',$form).removeClass('notice').addClass('success').html(results.message);
738
  setTimeout(function(){
739
  $('#eModal-Login').emodal('close',{onClose: function(){
740
  window.location.href = easymodal.redirecturl;
743
  },2000);
744
 
745
  } else {
746
+ $('p.message',$form).removeClass('notice').addClass('error').html(results.message);
747
  }
748
  }
749
  });
861
  }
862
  */
863
  })
864
+ })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/js/easy-modal.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){var e={x:-1,y:-1},i={init:function(e){var i=t.extend({},t.fn.emodal.defaults,e);return t(this).data("emodal",i)},close:function(e){var e=t.extend({speed:"fast",overlay:!0},t.fn.emodal.defaults,e),i=t(this);return i.data("emodal"),i.removeClass("active").fadeOut(e.speed,function(){e.overlay&&t("#modal-overlay").fadeOut(e.speed,function(){e.onClose()})}),t(window).unbind("scroll.emodal").unbind("keyup.emodal"),this},open:function(){var e=t(this),i=e.data("emodal");return void 0===s[i.theme]?s[1]:s[i.theme],t("#modal-overlay").length||t('<div id="modal-overlay">').appendTo("body"),t(".modal.active").length?t(".modal.active").each(function(){t(this).emodal("close",{speed:100,overlay:!1})}):t("#modal-overlay").css("opacity",0).show(0),e.addClass("active"),!i.closeDisabled&&t(".close-modal",e).length&&t(".close-modal",e).unbind("click").click(function(){e.emodal("close")}).themeClose(i),t("#modal-overlay").unbind("click").click(function(){1==i.overlayClose&&e.emodal("close")}).themeOverlay(i),1==i.overlayEscClose&&t(window).bind("keyup.emodal",function(i){t(".modal.active").length&&27==i.keyCode&&e.emodal("close")}),e.themeModal(i),e.animation(i.animation,i),e}};t.fn.emodal=function(e){return i[e]?i[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?(t.error("Method "+e+" does not exist on jQuery.emodal"),void 0):i.init.apply(this,arguments)},t.fn.themeOverlay=function(e){var i=t(this);if(void 0===s[e.theme])var n=s[1];else var n=s[e.theme];return i.addClass("theme-"+e.theme).animate({backgroundColor:n.overlayColor,opacity:n.overlayOpacity/100},e.duration)},t.fn.themeModal=function(e){var i=t(this);if(void 0===s[e.theme])var n=s[1];else var n=s[e.theme];return"custom"==e.size&&i.css({height:e.userHeight?e.userHeight+e.userHeightUnit:i.css("height"),width:e.userWidth?e.userWidth+e.userWidthUnit:i.css("width"),"margin-left":e.userWidth?-(e.userWidth/2)+e.userWidthUnit:i.css("margin-left")}),i.addClass(e.size).addClass("theme-"+e.theme).css({color:n.contentFontColor,backgroundColor:n.containerBgColor,padding:n.containerPadding+"px",border:n.containerBorderColor+" "+n.containerBorderStyle+" "+n.containerBorderWidth+"px","-webkit-border-radius":n.containerBorderRadius+"px","border-radius":n.containerBorderRadius+"px"})},t.fn.themeClose=function(e){var i=t(this);if(void 0===s[e.theme])var n=s[1];else var n=s[e.theme];if("outside"==n.closeLocation){var o=n.closeSize,r=bottom=left=right="auto";switch(n.closePosition){case"topright":r=-(o/2)+"px",right=-(o/2)+"px";break;case"topleft":r=-(o/2)+"px",left=-(o/2)+"px";break;case"bottomright":bottom=-(o/2)+"px",right=-(o/2)+"px";break;case"bottomleft":bottom=-(o/2)+"px",left=-(o/2)+"px"}i.addClass("outside").css({left:left,right:right,top:r,bottom:bottom,height:n.closeSize+"px",fontSize:n.closeFontSize+"px",width:n.closeSize+"px",backgroundColor:n.closeBgColor,"-webkit-border-radius":n.closeBorderRadius+"px","border-radius":n.closeBorderRadius+"px",lineHeight:n.closeSize+"px"})}return i.addClass("theme-"+e.theme).html(n.closeText).css({color:n.closeFontColor})};var n={fade:function(e){var i=t(this).show(0).css({opacity:0,top:t(window).scrollTop()+100+"px"}),n=t.extend(t.fn.animation.defaults,e);i.animate({opacity:1},parseInt(n.duration),n.easing,function(){i.removeAttr("style").css({display:"block",visibility:"visible",top:t(window).scrollTop()+100+"px"}).themeModal(n)})},fadeAndSlide:function(i){var n=t(this).show(0).css("opacity",0),o=t.extend(t.fn.animation.defaults,i);switch(o.direction){case"mouse":n.css({top:e.y+"px",left:e.x+"px"});break;case"top":n.css({top:t(window).scrollTop()-n.outerHeight(!0)+"px"});break;case"left":n.css({left:"-"+n.outerWidth(!0)+"px",top:t(window).scrollTop()+100+"px"});break;case"bottom":n.css({top:t(window).innerHeight()+t(window).scrollTop()+"px"});break;case"right":n.css({left:t(window).innerWidth()+"px",top:t(window).scrollTop()+100+"px"});break;case"topleft":n.css({left:"-"+n.outerWidth(!0)+"px",top:t(window).scrollTop()+100+"px",top:t(window).scrollTop()-n.outerHeight(!0)+"px"});break;case"topright":n.css({left:t(window).innerWidth()+"px",top:t(window).scrollTop()-n.outerHeight(!0)+"px"});break;case"bottomleft":n.css({left:"-"+n.outerWidth(!0)+"px",top:t(window).scrollTop()+100+"px",top:t(window).innerHeight()+t(window).scrollTop()+"px"});break;case"bottomright":n.css({left:t(window).innerWidth()+"px",top:t(window).innerHeight()+t(window).scrollTop()+"px"})}t("html").css("overflow-x","hidden"),n.animate({left:"50%",top:t(window).scrollTop()+100+"px"},{duration:o.duration,queue:!1},o.easing),setTimeout(function(){n.animate({opacity:1},.75*o.duration,o.easing,function(){n.removeAttr("style").css({display:"block",visibility:"visible",top:t(window).scrollTop()+100+"px"}).themeModal(o),t("html").css("overflow-x","inherit")})},.25*o.duration)},grow:function(e){var i=t(this).show(0),n=t.extend(t.fn.animation.defaults,e),o={width:100*(parseInt(i.css("width"))/parseInt(i.parent().innerWidth()))+"%",height:parseInt(i.css("height")),marginLeft:"-"+100*(parseInt(i.css("width"))/parseInt(i.parent().innerWidth()))/2+"%",padding:parseInt(i.css("padding-left"))/parseInt(i.css("font-size"))+"em"};t("*",i).fadeOut(0),i.css({top:5*(o.height/10)+t(window).scrollTop()+100+"px",left:5*(o.width/10)+t(window).innerWidth()/2+"px",height:0,width:0,padding:0,"margin-left":0}).animate({top:t(window).scrollTop()+100+"px",left:"50%",padding:o.padding,height:o.height,width:o.width,"margin-left":o.marginLeft},n.duration,function(){i.removeAttr("style").css({display:"block",visibility:"visible",top:t(window).scrollTop()+100+"px"}).themeModal(n),t("*",i).fadeIn("fast")})},growAndSlide:function(i){var n=t(this).show(0),o=t.extend(t.fn.animation.defaults,i),s={width:100*(parseInt(n.css("width"))/parseInt(n.parent().innerWidth()))+"%",height:parseInt(n.css("height")),marginLeft:"-"+100*(parseInt(n.css("width"))/parseInt(n.parent().innerWidth()))/2+"%",padding:parseInt(n.css("padding-left"))/parseInt(n.css("font-size"))+"em"};switch(t("html,body").css("overflow-x","hidden"),t("*",n).fadeOut(0),n.css({opacity:1,height:0,width:0,padding:0,"margin-left":0}),o.direction){case"mouse":n.css({top:e.y+"px",left:e.x+"px"});break;case"top":n.css({top:t(window).scrollTop()+n.outerHeight(!0)+"px"});break;case"left":n.css({left:0,top:t(window).scrollTop()+100+"px"});break;case"bottom":n.css({top:t(window).innerHeight()+t(window).scrollTop()+"px"});break;case"right":n.css({left:t(window).innerWidth()+"px",top:t(window).scrollTop()+100+"px"});break;case"topleft":n.css({left:0,top:t(window).scrollTop()+100+"px",top:t(window).scrollTop()-n.outerHeight(!0)+"px"});break;case"topright":n.css({left:t(window).innerWidth()+"px",top:t(window).scrollTop()-n.outerHeight(!0)+"px"});break;case"bottomleft":n.css({left:0,top:t(window).scrollTop()+100+"px",top:t(window).innerHeight()+t(window).scrollTop()+"px"});break;case"bottomright":n.css({left:t(window).innerWidth()+"px",top:t(window).innerHeight()+t(window).scrollTop()+"px"})}n.animate({height:s.height,padding:s.padding,width:s.width,"margin-left":s.marginLeft},{duration:o.duration,queue:!1},o.easing),setTimeout(function(){n.animate({height:"auto",top:t(window).scrollTop()+100+"px",left:"50%"},.95*o.duration,o.easing,function(){n.removeAttr("style").css({display:"block",visibility:"visible",top:t(window).scrollTop()+100+"px"}).themeModal(o),t("*",n).fadeIn("fast"),t("html").css("overflow-x","inherit")})},.05*o.duration)}};t.fn.animation=function(e){return n[e]?n[e].apply(this,Array.prototype.slice.call(arguments,1)):(t.error("Animation style "+n+" does not exist on jQuery.animation"),void 0)},t.fn.animation.defaults={duration:750,direction:"mouse",easing:"swing"},t.fn.emodal.defaults={theme:1,onLoad:function(){},onClose:function(){},type:null,maxHeight:null,maxWidth:null,userHeight:null,userWidth:null,animation:"fadeAndSlide",direction:"bottom",overlayClose:!1,overlayEscClose:!1};var o=easymodal.modals,s=easymodal.themes;easymodal.settings,t(document).ready(function(){t(".modal").each(function(){var i=t(this).css({visibility:"visible"}).hide(0),n=i.attr("id").split("-")[1];i.emodal(o[n]),t(document).on("click","."+i.attr("id"),function(t){t.preventDefault(),t.stopPropagation(),e.x=t.pageX,e.y=t.pageY,i.emodal("open")}),t("."+i.attr("id")).css("cursor","pointer")}),easymodal.autoOpen&&!t.cookie("eModal-autoOpen-"+easymodal.autoOpen.id)&&setTimeout(function(){t("#eModal-"+easymodal.autoOpen.id).emodal("open"),t.cookie("eModal-autoOpen-"+easymodal.autoOpen.id,!0,{expires:parseInt(easymodal.autoOpen.timer)})},easymodal.autoOpen.delay),easymodal.autoExit&&!t.cookie("eModal-autoExit-"+easymodal.autoExit.id)&&t("body").one("mouseleave",function(){return easymodal.force_user_login?!1:($this=t("#eModal-"+easymodal.autoExit.id).emodal("open"),t.cookie("eModal-autoExit-"+easymodal.autoExit.id,!0,{expires:parseInt(easymodal.autoExit.timer)}),void 0)}),t("#eModal-Login form").on("submit",function(e){$form=t(this),e.preventDefault(),$form.append('<p class="message notice">'+easymodal.loadingtext+"</p>"),t.ajax({type:"POST",dataType:"json",url:easymodal.ajaxLogin,data:{action:"ajaxlogin",username:t("#user_login",$form).val(),password:t("#user_pass",$form).val(),rememberme:t("#rememberme",$form).is(":checked")?!0:!1,login:!0,"easy-modal":t("#safe_csrf_nonce_easy_modal",$form).val()},success:function(e){e.loggedin===!0?(t("p.message",$form).removeClass("notice").addClass("success").text(e.message).show(),setTimeout(function(){t("#eModal-Login").emodal("close",{onClose:function(){window.location.href=easymodal.redirecturl}})},2e3)):t("p.message",$form).removeClass("notice").addClass("error").text(e.message).show()}})}),t("#eModal-Register form").on("submit",function(e){$form=t(this),e.preventDefault(),$form.append('<p class="message notice">'+easymodal.loadingtext+"</p>"),t.ajax({type:"POST",dataType:"json",url:easymodal.ajaxLogin,data:{action:"ajaxlogin",username:t("#forgot_login",$form).val(),email:t("#reg_email",$form).val(),register:!0,"easy-modal":t("#safe_csrf_nonce_easy_modal",$form).val()},success:function(e){e.loggedin===!0?(t("p.message",$form).removeClass("notice").addClass("success").text(e.message).show(),setTimeout(function(){t("#eModal-Login").emodal("close",{onClose:function(){window.location.href=easymodal.redirecturl}})},2e3)):t("p.message",$form).removeClass("notice").addClass("error").text(e.message).show()}})}),t("#eModal-Forgot form").on("submit",function(e){$form=t(this),e.preventDefault(),$form.append('<p class="message notice">'+easymodal.loadingtext+"</p>"),t.ajax({type:"POST",dataType:"json",url:easymodal.ajaxLogin,data:{action:"ajaxlogin",username:t("#forgot_login",$form).val(),forgotten:!0,"easy-modal":t("#safe_csrf_nonce_easy_modal",$form).val()},success:function(e){e.loggedin===!0?(t("p.message",$form).removeClass("notice").addClass("success").text(e.message).show(),setTimeout(function(){t("#eModal-Login").emodal("close",{onClose:function(){window.location.href=easymodal.redirecturl}})},2e3)):t("p.message",$form).removeClass("notice").addClass("error").text(e.message).show()}})})})}(jQuery),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){function e(t){return t}function i(t){return decodeURIComponent(t.replace(o," "))}function n(t){0===t.indexOf('"')&&(t=t.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return s.json?JSON.parse(t):t}catch(e){}}var o=/\+/g,s=t.cookie=function(o,r,a){if(void 0!==r){if(a=t.extend({},s.defaults,a),"number"==typeof a.expires){var l=a.expires,c=a.expires=new Date;c.setDate(c.getDate()+l)}return r=s.json?JSON.stringify(r):String(r),document.cookie=[s.raw?o:encodeURIComponent(o),"=",s.raw?r:encodeURIComponent(r),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}for(var u=s.raw?e:i,d=document.cookie.split("; "),h=o?void 0:{},p=0,f=d.length;f>p;p++){var m=d[p].split("="),g=u(m.shift()),v=u(m.join("="));if(o&&o===g){h=n(v);break}o||(h[g]=n(v))}return h};s.defaults={},t.removeCookie=function(e,i){return void 0!==t.cookie(e)?(t.cookie(e,"",t.extend({},i,{expires:-1})),!0):!1}}),function(t,e){function i(t,e,i){var n=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=n.floor?~~t:parseFloat(t),isNaN(t)?e.def:n.mod?(t+n.mod)%n.mod:0>t?0:n.max<t?n.max:t)}function n(e){var i=l(),n=i._rgba=[],e=e.toLowerCase();return p(a,function(t,o){var s,r=o.re.exec(e);return s=r&&o.parse(r),r=o.space||"rgba",s?(s=i[r](s),i[c[r].cache]=s[c[r].cache],n=i._rgba=s._rgba,!1):void 0}),n.length?("0,0,0,0"===n.join()&&t.extend(n,s.transparent),i):s[e]}function o(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var s,r=/^([\-+])=\s*(\d+\.?\d*)/,a=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,n,o){return new t.Color.fn.parse(e,i,n,o)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},h=t("<p>")[0],p=t.each;h.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=-1<h.style.backgroundColor.indexOf("rgba"),p(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(o,r,a,u){if(o===e)return this._rgba=[null,null,null,null],this;(o.jquery||o.nodeType)&&(o=t(o).css(r),r=e);var d=this,h=t.type(o),f=this._rgba=[];return r!==e&&(o=[o,r,a,u],h="array"),"string"===h?this.parse(n(o)||s._default):"array"===h?(p(c.rgba.props,function(t,e){f[e.idx]=i(o[e.idx],e)}),this):"object"===h?(o instanceof l?p(c,function(t,e){o[e.cache]&&(d[e.cache]=o[e.cache].slice())}):p(c,function(e,n){var s=n.cache;p(n.props,function(t,e){if(!d[s]&&n.to){if("alpha"===t||null==o[t])return;d[s]=n.to(d._rgba)}d[s][e.idx]=i(o[t],e,!0)}),d[s]&&t.inArray(null,d[s].slice(0,3))<0&&(d[s][3]=1,n.from&&(d._rgba=n.from(d[s])))}),this):void 0},is:function(t){var e=l(t),i=!0,n=this;return p(c,function(t,o){var s,r=e[o.cache];return r&&(s=n[o.cache]||o.to&&o.to(n._rgba)||[],p(o.props,function(t,e){return null!=r[e.idx]?i=r[e.idx]===s[e.idx]:void 0})),i}),i},_space:function(){var t=[],e=this;return p(c,function(i,n){e[n.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var n=l(t),o=n._space(),s=c[o],r=0===this.alpha()?l("transparent"):this,a=r[s.cache]||s.to(r._rgba),d=a.slice(),n=n[s.cache];return p(s.props,function(t,o){var s=o.idx,r=a[s],l=n[s],c=u[o.type]||{};null!==l&&(null===r?d[s]=l:(c.mod&&(l-r>c.mod/2?r+=c.mod:r-l>c.mod/2&&(r-=c.mod)),d[s]=i((l-r)*e+r,o)))}),this[o](d)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),n=i.pop(),o=l(e)._rgba;return l(t.map(i,function(t,e){return(1-n)*o[e]+n*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),n=i.pop();return e&&i.push(~~(255*n)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/255,i=t[1]/255,n=t[2]/255,t=t[3],o=Math.max(e,i,n),s=Math.min(e,i,n),r=o-s,a=o+s,l=.5*a;return[Math.round(s===o?0:e===o?60*(i-n)/r+360:i===o?60*(n-e)/r+120:60*(e-i)/r+240)%360,0===l||1===l?l:.5>=l?r/a:r/(2-a),l,null==t?1:t]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],n=t[2],t=t[3],i=.5>=n?n*(1+i):n+i-n*i,n=2*n-i;return[Math.round(255*o(n,i,e+1/3)),Math.round(255*o(n,i,e)),Math.round(255*o(n,i,e-1/3)),t]},p(c,function(n,o){var s=o.props,a=o.cache,c=o.to,u=o.from;l.fn[n]=function(n){if(c&&!this[a]&&(this[a]=c(this._rgba)),n===e)return this[a].slice();var o,r=t.type(n),d="array"===r||"object"===r?n:arguments,h=this[a].slice();return p(s,function(t,e){var n=d["object"===r?t:e.idx];null==n&&(n=h[e.idx]),h[e.idx]=i(n,e)}),u?(o=l(u(h)),o[a]=h,o):l(h)},p(s,function(e,i){l.fn[e]||(l.fn[e]=function(o){var s=t.type(o),a="alpha"===e?this._hsla?"hsla":"rgba":n,l=this[a](),c=l[i.idx];return"undefined"===s?c:("function"===s&&(o=o.call(this,c),s=t.type(o)),null==o&&i.empty?this:("string"===s&&(s=r.exec(o))&&(o=c+parseFloat(s[2])*("+"===s[1]?1:-1)),l[i.idx]=o,this[a](l)))})})}),l.hook=function(e){e=e.split(" "),p(e,function(e,i){t.cssHooks[i]={set:function(e,o){var s,r="";if("string"!==t.type(o)||(s=n(o))){if(o=l(s||o),!d.rgba&&1!==o._rgba[3]){for(s="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&s&&s.style;)try{r=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}o=o.blend(r&&"transparent"!==r?r:"_default")}o=o.toRgbaString()}try{e.style[i]=o}catch(c){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),t.cssHooks.borderColor={expand:function(t){var e={};return p(["Top","Right","Bottom","Left"],function(i,n){e["border"+n+"Color"]=t}),e}},s=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery);
1
+ (function($){var currentMousePos={x:-1,y:-1};var methods={init:function(options){if(!$(this).parent().is("body")){$(this).appendTo("body")}var opts=$.extend({},$.fn.emodal.defaults,$(this).data(),options);return $(this).data("emodal",opts)},close:function(options){var options=$.extend({speed:"fast",overlay:true},$.fn.emodal.defaults,options);var $this=$(this);var opts=$this.data("emodal");$this.removeClass("active").fadeOut(options.speed,function(){if(options.overlay){$("#modal-overlay").fadeOut(options.speed,function(){options.onClose()})}});$(window).unbind("scroll.emodal").unbind("keyup.emodal");return this},open:function(){var $this=$(this);var opts=$this.data("emodal");if(themes[opts.theme]===undefined){var theme=themes[1]}else{var theme=themes[opts.theme]}if(!$("#modal-overlay").length){$('<div id="modal-overlay">').appendTo("body")}if($(".modal.active").length){$(".modal.active").each(function(){$(this).emodal("close",{speed:100,overlay:false})})}else{$("#modal-overlay").css("opacity",0).show(0)}$this.addClass("active");if(!opts.closedisabled&&$(".close-modal",$this).length){$(".close-modal",$this).unbind("click").click(function(){$this.emodal("close")}).themeClose(opts)}$("#modal-overlay").unbind("click").click(function(){if(opts.overlayclose==true){$this.emodal("close")}}).themeOverlay(opts);if(opts.escclose==true){$(window).bind("keyup.emodal",function(e){if($(".modal.active").length&&e.keyCode==27){$this.emodal("close")}})}$this.themeModal(opts);$this.animation(opts.animation,opts);return $this}};$.fn.emodal=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof method==="object"||!method){return methods.init.apply(this,arguments)}else{$.error("Method "+method+" does not exist on jQuery.emodal")}}};$.fn.themeOverlay=function(opts){var $this=$(this);if(themes[opts.theme]===undefined){var theme=themes[1]}else{var theme=themes[opts.theme]}return $this.addClass("theme-"+opts.theme).animate({backgroundColor:theme.overlayColor,opacity:theme.overlayOpacity/100},opts.duration)};$.fn.themeModal=function(opts){var $this=$(this);if(themes[opts.theme]===undefined){var theme=themes[1]}else{var theme=themes[opts.theme]}console.log(theme);if(opts.size=="custom"){$this.css({height:opts.userheight?opts.userheight+opts.userheightunit:$this.css("height"),width:opts.userwidth?opts.userwidth+opts.userwidthunit:$this.css("width"),"margin-left":opts.userwidth?-(opts.userwidth/2)+opts.userwidthunit:$this.css("margin-left")})}$this.addClass(opts.size).addClass("theme-"+opts.theme).css({color:theme.contentFontColor,backgroundColor:theme.containerBgColor,padding:theme.containerPadding+"px",border:theme.containerBorderColor+" "+theme.containerBorderStyle+" "+theme.containerBorderWidth+"px","-webkit-border-radius":theme.containerBorderRadius+"px","border-radius":theme.containerBorderRadius+"px"});$(".title",$this).css({color:theme.contentTitleFontColor,fontFamily:theme.contentTitleFontFamily,fontSize:theme.contentTitleFontSize});return $this};$.fn.themeClose=function(opts){var $this=$(this);if(themes[opts.theme]===undefined){var theme=themes[1]}else{var theme=themes[opts.theme]}if(theme.closeLocation=="outside"){var val=theme.closeSize;var top=bottom=left=right="auto";switch(theme.closePosition){case"topright":top=-(val/2)+"px";right=-(val/2)+"px";break;case"topleft":top=-(val/2)+"px";left=-(val/2)+"px";break;case"bottomright":bottom=-(val/2)+"px";right=-(val/2)+"px";break;case"bottomleft":bottom=-(val/2)+"px";left=-(val/2)+"px";break}$this.addClass("outside").css({left:left,right:right,top:top,bottom:bottom,height:theme.closeSize+"px",fontSize:theme.closeFontSize+"px",width:theme.closeSize+"px",backgroundColor:theme.closeBgColor,"-webkit-border-radius":theme.closeBorderRadius+"px","border-radius":theme.closeBorderRadius+"px",lineHeight:theme.closeSize+"px"})}return $this.addClass("theme-"+opts.theme).html(theme.closeText).css({color:theme.closeFontColor})};var animations={fade:function(options){var $this=$(this).show(0).css({opacity:0,top:$(window).scrollTop()+100+"px"});var opts=$.extend($.fn.animation.defaults,options);$this.animate({opacity:1},parseInt(opts.duration),opts.easing,function(){$this.removeAttr("style").css({display:"block",visibility:"visible",top:($(window).scrollTop()+100)+"px"}).themeModal(opts)})},fadeAndSlide:function(options){var $this=$(this).show(0).css("opacity",0);var opts=$.extend($.fn.animation.defaults,options);switch(opts.direction){case"mouse":$this.css({top:currentMousePos.y+"px",left:currentMousePos.x+"px"});break;case"top":$this.css({top:$(window).scrollTop()-$this.outerHeight(true)+"px"});break;case"left":$this.css({left:"-"+$this.outerWidth(true)+"px",top:$(window).scrollTop()+100+"px"});break;case"bottom":$this.css({top:$(window).innerHeight()+$(window).scrollTop()+"px"});break;case"right":$this.css({left:$(window).innerWidth()+"px",top:$(window).scrollTop()+100+"px"});break;case"topleft":$this.css({left:"-"+$this.outerWidth(true)+"px",top:$(window).scrollTop()+100+"px",top:$(window).scrollTop()-$this.outerHeight(true)+"px"});break;case"topright":$this.css({left:$(window).innerWidth()+"px",top:$(window).scrollTop()-$this.outerHeight(true)+"px"});break;case"bottomleft":$this.css({left:"-"+$this.outerWidth(true)+"px",top:$(window).scrollTop()+100+"px",top:$(window).innerHeight()+$(window).scrollTop()+"px"});break;case"bottomright":$this.css({left:$(window).innerWidth()+"px",top:$(window).innerHeight()+$(window).scrollTop()+"px"});break}$("html").css("overflow-x","hidden");$this.animate({left:"50%",top:$(window).scrollTop()+100+"px"},{duration:opts.duration,queue:false},opts.easing);setTimeout(function(){$this.animate({opacity:1},opts.duration*0.75,opts.easing,function(){$this.removeAttr("style").css({display:"block",visibility:"visible",top:($(window).scrollTop()+100)+"px"}).themeModal(opts);$("html").css("overflow-x","inherit")})},opts.duration*0.25)},grow:function(options){var $this=$(this).show(0);var opts=$.extend($.fn.animation.defaults,options);var currently={width:parseInt($this.css("width"))/parseInt($this.parent().innerWidth())*100+"%",height:parseInt($this.css("height")),marginLeft:"-"+parseInt($this.css("width"))/parseInt($this.parent().innerWidth())*100/2+"%",padding:parseInt($this.css("padding-left"))/parseInt($this.css("font-size"))+"em"};$("*",$this).fadeOut(0);$this.css({top:(currently.height/10)*5+$(window).scrollTop()+100+"px",left:(currently.width/10)*5+($(window).innerWidth()/2)+"px",height:0,width:0,padding:0,"margin-left":0}).animate({top:$(window).scrollTop()+100+"px",left:"50%",padding:currently.padding,height:currently.height,width:currently.width,"margin-left":currently.marginLeft},opts.duration,function(){$this.removeAttr("style").css({display:"block",visibility:"visible",top:($(window).scrollTop()+100)+"px"}).themeModal(opts);$("*",$this).fadeIn("fast")})},growAndSlide:function(options){var $this=$(this).show(0);var opts=$.extend($.fn.animation.defaults,options);var currently={width:parseInt($this.css("width"))/parseInt($this.parent().innerWidth())*100+"%",height:parseInt($this.css("height")),marginLeft:"-"+parseInt($this.css("width"))/parseInt($this.parent().innerWidth())*100/2+"%",padding:parseInt($this.css("padding-left"))/parseInt($this.css("font-size"))+"em"};$("html,body").css("overflow-x","hidden");$("*",$this).fadeOut(0);$this.css({opacity:1,height:0,width:0,padding:0,"margin-left":0});switch(opts.direction){case"mouse":$this.css({top:currentMousePos.y+"px",left:currentMousePos.x+"px"});break;case"top":$this.css({top:$(window).scrollTop()+$this.outerHeight(true)+"px"});break;case"left":$this.css({left:0,top:$(window).scrollTop()+100+"px"});break;case"bottom":$this.css({top:$(window).innerHeight()+$(window).scrollTop()+"px"});break;case"right":$this.css({left:$(window).innerWidth()+"px",top:$(window).scrollTop()+100+"px"});break;case"topleft":$this.css({left:0,top:$(window).scrollTop()+100+"px",top:$(window).scrollTop()-$this.outerHeight(true)+"px"});break;case"topright":$this.css({left:$(window).innerWidth()+"px",top:$(window).scrollTop()-$this.outerHeight(true)+"px"});break;case"bottomleft":$this.css({left:0,top:$(window).scrollTop()+100+"px",top:$(window).innerHeight()+$(window).scrollTop()+"px"});break;case"bottomright":$this.css({left:$(window).innerWidth()+"px",top:$(window).innerHeight()+$(window).scrollTop()+"px"});break}$this.animate({height:currently.height,padding:currently.padding,width:currently.width,"margin-left":currently.marginLeft},{duration:opts.duration,queue:false},opts.easing);setTimeout(function(){$this.animate({height:"auto",top:($(window).scrollTop()+100)+"px",left:"50%"},opts.duration*0.95,opts.easing,function(){$this.removeAttr("style").css({display:"block",visibility:"visible",top:($(window).scrollTop()+100)+"px"}).themeModal(opts);$("*",$this).fadeIn("fast");$("html").css("overflow-x","inherit")})},opts.duration*0.05)}};$.fn.animation=function(style){if(animations[style]){return animations[style].apply(this,Array.prototype.slice.call(arguments,1))}else{$.error("Animation style "+animations+" does not exist on jQuery.animation")}};$.fn.animation.defaults={duration:350,direction:"top",easing:"swing"};$.fn.emodal.defaults={theme:1,onLoad:function(){},onClose:function(){},type:null,userheight:null,userwidth:null,animation:"fadeAndSlide",direction:"bottom",duration:350,overlayclose:false,escclose:false,closedisabled:false};var modals=easymodal.modals;var themes=easymodal.themes;var settings=easymodal.settings;$(document).ready(function(){$(".modal").each(function(){var $this=$(this).css({visibility:"visible"}).hide(0);var modalId=$this.attr("id").split("-")[1];$this.emodal(modals[modalId]);$(document).on("click","."+$this.attr("id"),function(e){e.preventDefault();e.stopPropagation();currentMousePos.x=e.pageX;currentMousePos.y=e.pageY;$this.emodal("open")});$("."+$this.attr("id")).css("cursor","pointer")});if(easymodal.force_user_login){$("#eModal-Login .close-modal, #eModal-Register .close-modal, #eModal-Forgot .close-modal").hide();$("#eModal-Register, #eModal-Forgot").append($('<a class="eModal-Login">Back to Login Form</a>').css("cursor","pointer"))}if(easymodal.autoOpen&&!$.cookie("eModal-autoOpen-"+easymodal.autoOpen.id)){setTimeout(function(){$("#eModal-"+easymodal.autoOpen.id).emodal("open");var date=new Date();date.setTime(date.getTime()+(easymodal.autoOpen.timer*24*60*1000));$.cookie("eModal-autoOpen-"+easymodal.autoOpen.id,true,{expires:date})},easymodal.autoOpen.delay)}if(easymodal.autoExit&&!$.cookie("eModal-autoExit-"+easymodal.autoExit.id)){$("body").one("mouseleave",function(){if(easymodal.force_user_login){return false}$this=$("#eModal-"+easymodal.autoExit.id).emodal("open");var date=new Date();date.setTime(date.getTime()+(easymodal.autoExit.timer*24*60*1000));$.cookie("eModal-autoExit-"+easymodal.autoExit.id,true,{expires:date})})}$("#eModal-Login form").on("submit",function(e){$form=$(this);e.preventDefault();$form.append('<p class="message notice">'+easymodal.loadingtext+"</p>");$.ajax({type:"POST",dataType:"json",url:easymodal.ajaxLogin,data:{action:"ajaxlogin",username:$("#user_login",$form).val(),password:$("#user_pass",$form).val(),rememberme:$("#rememberme",$form).is(":checked")?true:false,login:true,"easy-modal":$("#safe_csrf_nonce_easy_modal",$form).val()},success:function(results){if(results.loggedin===true){$("p.message",$form).removeClass("notice").addClass("success").text(results.message).show();setTimeout(function(){$("#eModal-Login").emodal("close",{onClose:function(){window.location.href=easymodal.redirecturl}})},2000)}else{$("p.message",$form).removeClass("notice").addClass("error").text(results.message).show()}}})});$("#eModal-Register form").on("submit",function(e){$form=$(this);e.preventDefault();if(!$("p.message",$form).length){$form.append('<p class="message notice">'+easymodal.loadingtext+"</p>")}if($("#reg_pass",$form).length){if($("#reg_pass",$form).val()!=$("#reg_confirm",$form).val()){$("p.message",$form).removeClass("notice").addClass("error").html("Passwords don't match.");return}}$.ajax({type:"POST",dataType:"json",url:easymodal.ajaxLogin,data:{action:"ajaxlogin",user_login:$("#reg_user",$form).val(),user_email:$("#reg_email",$form).val(),user_pass:$("#reg_pass",$form).val(),register:true,"easy-modal":$("#safe_csrf_nonce_easy_modal",$form).val()},success:function(results){if(results.loggedin===true){$("p.message",$form).removeClass("notice").addClass("success").html(results.message);setTimeout(function(){$("#eModal-Login").emodal("close",{onClose:function(){window.location.href=easymodal.redirecturl}})},2000)}else{$("p.message",$form).removeClass("notice").addClass("error").html(results.message)}}})});$("#eModal-Forgot form").on("submit",function(e){$form=$(this);e.preventDefault();$form.append('<p class="message notice">'+easymodal.loadingtext+"</p>");$.ajax({type:"POST",dataType:"json",url:easymodal.ajaxLogin,data:{action:"ajaxlogin",username:$("#forgot_login",$form).val(),forgotten:true,"easy-modal":$("#safe_csrf_nonce_easy_modal",$form).val()},success:function(results){if(results.loggedin===true){$("p.message",$form).removeClass("notice").addClass("success").text(results.message).show();setTimeout(function(){$("#eModal-Login").emodal("close",{onClose:function(){window.location.href=easymodal.redirecturl}})},2000)}else{$("p.message",$form).removeClass("notice").addClass("error").text(results.message).show()}}})})})})(jQuery);
inc/js/jquery.animate-colors-min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Color animation 20120928
3
+ http://www.bitstorm.org/jquery/color-animation/
4
+ Copyright 2011, 2012 Edwin Martin <edwin@bitstorm.org>
5
+ Released under the MIT and GPL licenses.
6
+ */
7
+ (function(d){function m(){var b=d("script:first"),a=b.css("color"),c=false;if(/^rgba/.test(a))c=true;else try{c=a!=b.css("color","rgba(0, 0, 0, 0.5)").css("color");b.css("color",a)}catch(e){}return c}function j(b,a,c){var e="rgb"+(d.support.rgba?"a":"")+"("+parseInt(b[0]+c*(a[0]-b[0]),10)+","+parseInt(b[1]+c*(a[1]-b[1]),10)+","+parseInt(b[2]+c*(a[2]-b[2]),10);if(d.support.rgba)e+=","+(b&&a?parseFloat(b[3]+c*(a[3]-b[3])):1);e+=")";return e}function g(b){var a,c;if(a=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(b))c=
8
+ [parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),1];else if(a=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(b))c=[parseInt(a[1],16)*17,parseInt(a[2],16)*17,parseInt(a[3],16)*17,1];else if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))c=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),1];else if(a=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(b))c=[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10),parseFloat(a[4])];return c}
9
+ d.extend(true,d,{support:{rgba:m()}});var k=["color","backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","outlineColor"];d.each(k,function(b,a){d.Tween.propHooks[a]={get:function(c){return d(c.elem).css(a)},set:function(c){var e=c.elem.style,i=g(d(c.elem).css(a)),h=g(c.end);c.run=function(f){e[a]=j(i,h,f)}}}});d.Tween.propHooks.borderColor={set:function(b){var a=b.elem.style,c=[],e=k.slice(2,6);d.each(e,function(h,f){c[f]=g(d(b.elem).css(f))});var i=g(b.end);
10
+ b.run=function(h){d.each(e,function(f,l){a[l]=j(c[l],i,h)})}}}})(jQuery);
inc/js/jquery.cookie.js ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Cookie Plugin v1.3.1
3
+ * https://github.com/carhartl/jquery-cookie
4
+ *
5
+ * Copyright 2013 Klaus Hartl
6
+ * Released under the MIT license
7
+ */
8
+ (function (factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ // AMD. Register as anonymous module.
11
+ define(['jquery'], factory);
12
+ } else {
13
+ // Browser globals.
14
+ factory(jQuery);
15
+ }
16
+ }(function ($) {
17
+ var pluses = /\+/g;
18
+ function raw(s) {
19
+ return s;
20
+ }
21
+ function decoded(s) {
22
+ return decodeURIComponent(s.replace(pluses, ' '));
23
+ }
24
+ function converted(s) {
25
+ if (s.indexOf('"') === 0) {
26
+ // This is a quoted cookie as according to RFC2068, unescape
27
+ s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
28
+ }
29
+ try {
30
+ return config.json ? JSON.parse(s) : s;
31
+ } catch(er) {}
32
+ }
33
+ var config = $.cookie = function (key, value, options) {
34
+ // write
35
+ if (value !== undefined) {
36
+ options = $.extend({}, config.defaults, options);
37
+ if (typeof options.expires === 'number') {
38
+ var days = options.expires, t = options.expires = new Date();
39
+ t.setDate(t.getDate() + days);
40
+ }
41
+ value = config.json ? JSON.stringify(value) : String(value);
42
+ return (document.cookie = [
43
+ config.raw ? key : encodeURIComponent(key),
44
+ '=',
45
+ config.raw ? value : encodeURIComponent(value),
46
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
47
+ options.path ? '; path=' + options.path : '',
48
+ options.domain ? '; domain=' + options.domain : '',
49
+ options.secure ? '; secure' : ''
50
+ ].join(''));
51
+ }
52
+ // read
53
+ var decode = config.raw ? raw : decoded;
54
+ var cookies = document.cookie.split('; ');
55
+ var result = key ? undefined : {};
56
+ for (var i = 0, l = cookies.length; i < l; i++) {
57
+ var parts = cookies[i].split('=');
58
+ var name = decode(parts.shift());
59
+ var cookie = decode(parts.join('='));
60
+ if (key && key === name) {
61
+ result = converted(cookie);
62
+ break;
63
+ }
64
+ if (!key) {
65
+ result[name] = converted(cookie);
66
+ }
67
+ }
68
+ return result;
69
+ };
70
+ config.defaults = {};
71
+ $.removeCookie = function (key, options) {
72
+ if ($.cookie(key) !== undefined) {
73
+ // Must not alter options, thus extending a fresh object...
74
+ $.cookie(key, '', $.extend({}, options, { expires: -1 }));
75
+ return true;
76
+ }
77
+ return false;
78
+ };
79
+ }));
inc/views/admin_footer.php CHANGED
@@ -2,7 +2,7 @@
2
  <h2>Let others know</h2>
3
  <p>If you found Easy Modal useful, let others know by writing a review or about your experiences and uses for the plugin.</p>
4
  <h3>Affiliates - Earn Extra Cash.<img class="right" src="<?php echo EASYMODAL_URL?>/inc/images/admin/affiliate.png" alt="Affiliate"/></h3>
5
- <p>Interested in making money with Easy Modal? Earn a 40% commission on every sale you generate. <a href="https://easy-modal.com/affiliatesutm_source=em&utm_medium=dashboard+link&utm_campaign=affiliate+modal" target="_blank">Find out more</a></p>
6
  <p>It's really that easy. We will pay you a 40% commission on every sale you generate using your affiliate referral URL! It's as easy as signing up and promoting the program on your website, blog, Facebook, Twitter or other social networks.</p>
7
  <!--
8
  <h3>Bonus - Free Pro License <small> ($15 Value)</small><img class="right" src="<?php echo EASYMODAL_URL?>/inc/images/admin/bonus.png" alt="Free Bonus"/></h3>
2
  <h2>Let others know</h2>
3
  <p>If you found Easy Modal useful, let others know by writing a review or about your experiences and uses for the plugin.</p>
4
  <h3>Affiliates - Earn Extra Cash.<img class="right" src="<?php echo EASYMODAL_URL?>/inc/images/admin/affiliate.png" alt="Affiliate"/></h3>
5
+ <p>Interested in making money with Easy Modal? Earn a 40% commission on every sale you generate. <a href="http://easy-modal.com/affiliates?utm_source=em&utm_medium=dashboard+link&utm_campaign=affiliate+modal" target="_blank">Find out more</a></p>
6
  <p>It's really that easy. We will pay you a 40% commission on every sale you generate using your affiliate referral URL! It's as easy as signing up and promoting the program on your website, blog, Facebook, Twitter or other social networks.</p>
7
  <!--
8
  <h3>Bonus - Free Pro License <small> ($15 Value)</small><img class="right" src="<?php echo EASYMODAL_URL?>/inc/images/admin/bonus.png" alt="Free Bonus"/></h3>
inc/views/modal_list.php CHANGED
@@ -12,20 +12,24 @@
12
  <?php if( $modals && count($modals) > 0 ){?>
13
  <table class="wp-list-table widefat fixed posts" style="width:100%">
14
  <thead>
15
- <th width="40">ID</th>
16
- <th width="100">Class</th>
17
  <th>Name</th>
 
18
  <th width="100" style="text-align:center">Actions</th>
19
  </thead>
20
  <tbody>
21
- <?php foreach($modals as $id => $name){?>
22
  <tr>
23
- <td><?php echo intval($id)?></td>
24
- <td>eModal-<?php echo intval($id)?></td>
25
- <td><a href="admin.php?page=<?php echo EASYMODAL_SLUG?>&modal_id=<?php echo intval($id)?>"><?php echo ucfirst(esc_html($name))?></a></td>
 
26
  <td align="center">
27
- <a style="margin-right:10px;" href="admin.php?page=<?php echo EASYMODAL_SLUG?>&modal_id=<?php echo intval($id)?>&action=clone&safe_csrf_nonce_easy_modal=<?php echo wp_create_nonce("safe_csrf_nonce_easy_modal")?>">Clone</a>
28
- <a style="color:red" href="admin.php?page=<?php echo EASYMODAL_SLUG?>&modal_id=<?php echo intval($id)?>&action=delete&safe_csrf_nonce_easy_modal=<?php echo wp_create_nonce("safe_csrf_nonce_easy_modal")?>">Delete</a>
 
 
29
  </td>
30
  </tr>
31
  <?php }?>
12
  <?php if( $modals && count($modals) > 0 ){?>
13
  <table class="wp-list-table widefat fixed posts" style="width:100%">
14
  <thead>
15
+ <th width="60">ID</th>
16
+ <th width="120">Class</th>
17
  <th>Name</th>
18
+ <th>Display Mode</th>
19
  <th width="100" style="text-align:center">Actions</th>
20
  </thead>
21
  <tbody>
22
+ <?php foreach($modals as $id => $name){ $modal = $this->getModalSettings($id);?>
23
  <tr>
24
+ <td><a href="admin.php?page=<?php echo EASYMODAL_SLUG?>&modal_id=<?php esc_attr_e($id)?>"><?php esc_attr_e($id)?></a></td>
25
+ <td><a href="admin.php?page=<?php echo EASYMODAL_SLUG?>&modal_id=<?php esc_attr_e($id)?>">eModal-<?php esc_html_e($id)?></a></td>
26
+ <td><a href="admin.php?page=<?php echo EASYMODAL_SLUG?>&modal_id=<?php esc_attr_e($id)?>"><?php echo ucfirst(esc_html($name))?></a></td>
27
+ <td><?php if($modal['sitewide']) echo 'Sitewide'; else 'Page / Post';?></td>
28
  <td align="center">
29
+ <?php if(!in_array($id, array('Login','Register','Forgot'))){?>
30
+ <a style="margin-right:10px;" href="admin.php?page=<?php echo EASYMODAL_SLUG?>&modal_id=<?php esc_attr_e($id)?>&action=clone&safe_csrf_nonce_easy_modal=<?php echo wp_create_nonce("safe_csrf_nonce_easy_modal")?>">Clone</a>
31
+ <a style="color:red" href="admin.php?page=<?php echo EASYMODAL_SLUG?>&modal_id=<?php esc_attr_e($id)?>&action=delete&safe_csrf_nonce_easy_modal=<?php echo wp_create_nonce("safe_csrf_nonce_easy_modal")?>">Delete</a>
32
+ <?php }?>
33
  </td>
34
  </tr>
35
  <?php }?>
inc/views/settings.php CHANGED
@@ -34,10 +34,10 @@
34
  <tbody>
35
  <tr class="form-field form-required">
36
  <th scope="row">
37
- <label for="name"><?php _e('License Key', 'easy-modal');?> <span class="description">(required)</span></label>
38
  </th>
39
  <td>
40
- <input <?php echo $valid ? 'style="background-color:#0f0;border-color:#090;"' : '' ?> type="text" id="license" name="license" value="<?php esc_attr_e(get_option('EasyModal_License'))?>"/>
41
  <p class="description"><?php _e( is_array($license_status) && !empty($license_status['message']) ? $license_status['message'] : 'Enter a key to unlock Easy Modal Pro.','easy-modal')?></p>
42
  </td>
43
  </tr>
34
  <tbody>
35
  <tr class="form-field form-required">
36
  <th scope="row">
37
+ <label for="name"><?php _e('License Key', 'easy-modal');?></label>
38
  </th>
39
  <td>
40
+ <input <?php echo $valid ? 'style="background-color:#0f0;border-color:#090;"' : '' ?> type="password" id="license" name="license" value="<?php esc_attr_e(get_option('EasyModal_License'))?>"/>
41
  <p class="description"><?php _e( is_array($license_status) && !empty($license_status['message']) ? $license_status['message'] : 'Enter a key to unlock Easy Modal Pro.','easy-modal')?></p>
42
  </td>
43
  </tr>
inc/views/sidebar.php CHANGED
@@ -2,9 +2,9 @@
2
  <div title="Click to toggle" class="handlediv"><br></div><h3 style="text-align:center" class="hndle"><span>Love It? Share It!</span></h3>
3
  <div class="inside">
4
  <ul class="share-buttons">
5
- <li><div class="fb-like" data-href="https://easy-modal.com" data-width="100" data-layout="box_count" data-action="like" data-show-faces="false" data-send="true"></div></li>
6
- <li><a href="https://twitter.com/intent/tweet" class="twitter-share-button" data-count="vertical" data-url="https://easy-modal.com" data-via="wizard_is" data-related="wizard_is">Tweet</a></li>
7
- <li><div class="g-plusone" data-href="https://easy-modal.com" data-size="tall"></div></li>
8
  </ul>
9
  <br class="clear" />
10
  <h4>Show Some Love</h4>
@@ -18,18 +18,18 @@
18
  <div class="postbox " id="upgrade">
19
  <div title="Click to toggle" class="handlediv"><br></div><h3 style="text-align:center" class="hndle"><span>Upgrade - Go Pro Now</span></h3>
20
  <div class="inside">
21
- <h4>Increase Conversions & Newsletter Sign Ups</h4>
22
  <p>The pro version aims to take your modals to the next level. With a great set of additional features coupled with our first class support make this a great value.</p>
23
  <h4>Features</h4>
24
  <ul class="bullets">
25
  <li>Unlimited Themes</li>
26
  <li>Auto show modals on page load &amp; exit.</li>
27
- <li>Import & Export Modals, Themes & Settings</li>
28
  <li>Premium Support</li>
29
  <li>and More...</li>
30
  </ul>
31
  <h4>Try it out for yourself!</h4>
32
- <p><a href="https://easy-modal.com/demo" target="_blank">Demo Site</a></p>
33
  <h4>Upgrading is Easy</h4>
34
  <p>Simply go <a href="https://easy-modal.com/pricing-purchase?utm_source=em-lite&utm_medium=dashboard+link&utm_campaign=get+premium">here</a> and click buy now. Once you recieve your key simply enter it on the settings page and then update your plugin.</p>
35
  </div>
2
  <div title="Click to toggle" class="handlediv"><br></div><h3 style="text-align:center" class="hndle"><span>Love It? Share It!</span></h3>
3
  <div class="inside">
4
  <ul class="share-buttons">
5
+ <li><div class="fb-like" data-href="http://easy-modal.com" data-width="100" data-layout="box_count" data-action="like" data-show-faces="false" data-send="true"></div></li>
6
+ <li><a href="https://twitter.com/intent/tweet" class="twitter-share-button" data-count="vertical" data-url="http://easy-modal.com" data-via="wizard_is" data-related="wizard_is">Tweet</a></li>
7
+ <li><div class="g-plusone" data-href="http://easy-modal.com" data-size="tall"></div></li>
8
  </ul>
9
  <br class="clear" />
10
  <h4>Show Some Love</h4>
18
  <div class="postbox " id="upgrade">
19
  <div title="Click to toggle" class="handlediv"><br></div><h3 style="text-align:center" class="hndle"><span>Upgrade - Go Pro Now</span></h3>
20
  <div class="inside">
21
+ <h4>Increase Conversions &amp; Newsletter Sign Ups</h4>
22
  <p>The pro version aims to take your modals to the next level. With a great set of additional features coupled with our first class support make this a great value.</p>
23
  <h4>Features</h4>
24
  <ul class="bullets">
25
  <li>Unlimited Themes</li>
26
  <li>Auto show modals on page load &amp; exit.</li>
27
+ <li>Import &amp; Export Modals, Themes &amp; Settings</li>
28
  <li>Premium Support</li>
29
  <li>and More...</li>
30
  </ul>
31
  <h4>Try it out for yourself!</h4>
32
+ <p><a href="http://easy-modal.com/demo" target="_blank">Demo Site</a></p>
33
  <h4>Upgrading is Easy</h4>
34
  <p>Simply go <a href="https://easy-modal.com/pricing-purchase?utm_source=em-lite&utm_medium=dashboard+link&utm_campaign=get+premium">here</a> and click buy now. Once you recieve your key simply enter it on the settings page and then update your plugin.</p>
35
  </div>
readme.txt CHANGED
@@ -1,19 +1,19 @@
1
  === Easy Modal ===
2
  Contributors: danieliser
3
  Author URI: http://wizardinternetsolutions.com
4
- Plugin URI: https://easy-modal.com
5
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PQTG2JYUKSLFW
6
  Tags: modal,modal box,modal form,modal window,popup,popup box,popup form,popup window,ajax forms
7
  Requires at least: 3.2
8
  Tested up to: 3.6
9
- Stable tag: 1.2.2
10
- Easily create & style modals with any content. Theme editor to quickly style your modals. Add forms, social media boxes, videos, slideshows & more.
11
-
12
  == Description ==
13
- This plugin allows you to easily add unlimited Modal windows with just about any content. It accepts shortcodes and has been tested to work with Contact Form 7 custom forms using ajax submission.
14
 
15
  = Core Features =
16
  * Unlimited Customizable Modals
 
17
  * Visual Theme Editor
18
  * Responsive or Custom Width Modals
19
  * 19 Customizable Animations
@@ -22,7 +22,6 @@ This plugin allows you to easily add unlimited Modal windows with just about any
22
  * Load modals on every page or just certain pages.
23
  * Quickly add modals to any highlighted text in editor.
24
  * Allows custom JS functions to open & close modals.
25
-
26
  = Pro Features =
27
  * Premium Support*
28
  * Unlimited Themes
@@ -37,10 +36,9 @@ This plugin allows you to easily add unlimited Modal windows with just about any
37
  * Expedited Feature Requests
38
  * Setup Assistance
39
 
40
-
41
  If you like the plugin please rate it.
42
 
43
- [Easy Modal Page](http://easy-modal.com "Easy Modal Page - Info, Demo and Discussion") - Info, Demo and Feature Discussion
44
 
45
  [Wizard Internet Solutions](http://wizardinternetsolutions.com "Website Design & Development") - Developers Site
46
 
@@ -53,18 +51,31 @@ To be notified of plugin updates, [follow us on Twitter](http://twitter.com/Easy
53
  4. Customize the theme to match your website on the theme settings page.
54
  5. Copy and Add ``eModal-#` class from the modals settings page to the object you want to make activate the modal window. Will work on divs, links, list elements and just about anything else.
55
 
 
 
56
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  = v1.2.2 =
58
  * Added filter to add meta boxes and em options to custom post types.
59
-
60
  = v1.2.1 =
61
  * Fixes compatibility issues with Ultimate TinyMCE Plugin.
62
  * Added plugin update notes to plugin page when updates are available.
63
-
64
  = v1.2.0.9 =
65
  * Fixed CSS z-index issues ( set modal z-index to 999, and overlay to 998 to make sure they are above other elements )
66
  * Fixed an issue with upgrading from previous versions.
67
-
68
  = v1.2.0.4 =
69
  * Fixed data migration issue ( wasn't setting sites to sitewide )
70
  * Added filters for modal content. Use add_filter('em_modal_content', 'your_custom_function'); function your_custom_function($content);
@@ -115,7 +126,6 @@ To be notified of plugin updates, [follow us on Twitter](http://twitter.com/Easy
115
  * Added Height & Width options.
116
  = v0.9 =
117
  * Initial Release
118
-
119
  == Upgrade Notice ==
120
  = v1.2.1 =
121
  * Fixes compatibility issues with Ultimate TinyMCE Plugin.
@@ -124,4 +134,8 @@ To be notified of plugin updates, [follow us on Twitter](http://twitter.com/Easy
124
  = v0.9.0.4 =
125
  * Options will be overwritten with default options.
126
  = 0.9 =
127
- * Initial Release
 
 
 
 
1
  === Easy Modal ===
2
  Contributors: danieliser
3
  Author URI: http://wizardinternetsolutions.com
4
+ Plugin URI: http://easy-modal.com
5
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PQTG2JYUKSLFW
6
  Tags: modal,modal box,modal form,modal window,popup,popup box,popup form,popup window,ajax forms
7
  Requires at least: 3.2
8
  Tested up to: 3.6
9
+ Stable tag: 1.3
10
+ Create modals in minutes. Add your favorite shortcodes for contact forms, social media, videos and other multimedia or your own content.
 
11
  == Description ==
12
+ Create modals in minutes. Add your favorite shortcodes for contact forms, social media, videos and other multimedia or your own content. Open them from anywhere including menus, sidebars, templates and anywhere else you can add css classes.
13
 
14
  = Core Features =
15
  * Unlimited Customizable Modals
16
+ * Modal Shortcodes
17
  * Visual Theme Editor
18
  * Responsive or Custom Width Modals
19
  * 19 Customizable Animations
22
  * Load modals on every page or just certain pages.
23
  * Quickly add modals to any highlighted text in editor.
24
  * Allows custom JS functions to open & close modals.
 
25
  = Pro Features =
26
  * Premium Support*
27
  * Unlimited Themes
36
  * Expedited Feature Requests
37
  * Setup Assistance
38
 
 
39
  If you like the plugin please rate it.
40
 
41
+ [Easy Modal Page](https://easy-modal.com "Easy Modal Page - Info, Demo and Discussion") - Info, Demo and Feature Discussion
42
 
43
  [Wizard Internet Solutions](http://wizardinternetsolutions.com "Website Design & Development") - Developers Site
44
 
51
  4. Customize the theme to match your website on the theme settings page.
52
  5. Copy and Add ``eModal-#` class from the modals settings page to the object you want to make activate the modal window. Will work on divs, links, list elements and just about anything else.
53
 
54
+
55
+
56
  == Changelog ==
57
+ = v1.3 =
58
+ * Bug
59
+ * [EM-5] - Modal is offcenter on mobile screens
60
+ * [EM-6] - Fatal error: easy-modal-pro.php:122
61
+ * [EM-7] - Modal title styles not applied
62
+ * [EM-8] - Registration modal not working properly.
63
+ * [EM-19] - GF Form detection and auto load scripts.
64
+ * Improvement
65
+ * [EM-4] - Added Shortcodes
66
+ * [EM-48] - Add modal display setting on modal list. Sitewide etc.
67
+ * [EM-52] - Move jquery animate color script to its own file and enqueue.
68
+
69
+ = v1.2.5 =
70
+ * Several changes to the pro version and import from older versions.
71
  = v1.2.2 =
72
  * Added filter to add meta boxes and em options to custom post types.
 
73
  = v1.2.1 =
74
  * Fixes compatibility issues with Ultimate TinyMCE Plugin.
75
  * Added plugin update notes to plugin page when updates are available.
 
76
  = v1.2.0.9 =
77
  * Fixed CSS z-index issues ( set modal z-index to 999, and overlay to 998 to make sure they are above other elements )
78
  * Fixed an issue with upgrading from previous versions.
 
79
  = v1.2.0.4 =
80
  * Fixed data migration issue ( wasn't setting sites to sitewide )
81
  * Added filters for modal content. Use add_filter('em_modal_content', 'your_custom_function'); function your_custom_function($content);
126
  * Added Height & Width options.
127
  = v0.9 =
128
  * Initial Release
 
129
  == Upgrade Notice ==
130
  = v1.2.1 =
131
  * Fixes compatibility issues with Ultimate TinyMCE Plugin.
134
  = v0.9.0.4 =
135
  * Options will be overwritten with default options.
136
  = 0.9 =
137
+ * Initial Release
138
+
139
+ == Upgrade Notice ==
140
+ = 1.3 =
141
+ Added modal shortcode, full plugin support for gravity forms. A few minor code, updated readme.txt file.