Easy Modal - Version 1.3.0.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.0.3
Comparing to
See all releases

Code changes from version 1.3.0.2 to 1.3.0.3

easy-modal.php CHANGED
@@ -4,7 +4,7 @@ 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.3.0.2
8
  Author URI: http://wizardinternetsolutions.com
9
  */
10
  if (!defined('EASYMODAL'))
@@ -16,7 +16,7 @@ if (!defined('EASYMODAL_DIR'))
16
  if (!defined('EASYMODAL_URL'))
17
  define('EASYMODAL_URL', plugins_url() . '/' . EASYMODAL_SLUG);
18
  if (!defined('EASYMODAL_VERSION'))
19
- define('EASYMODAL_VERSION', '1.3.0.2' );
20
 
21
  include EASYMODAL_DIR . '/inc/classes/gravityforms.php';
22
  include EASYMODAL_DIR . '/inc/classes/shortcodes.php';
@@ -880,7 +880,8 @@ class Easy_Modal {
880
  }
881
  public function print_modals()
882
  {
883
- foreach($this->preload_modals() as $id => $modal)
 
884
  {
885
  require(EASYMODAL_DIR.'/inc/views/modal.php');
886
  }
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.0.3
8
  Author URI: http://wizardinternetsolutions.com
9
  */
10
  if (!defined('EASYMODAL'))
16
  if (!defined('EASYMODAL_URL'))
17
  define('EASYMODAL_URL', plugins_url() . '/' . EASYMODAL_SLUG);
18
  if (!defined('EASYMODAL_VERSION'))
19
+ define('EASYMODAL_VERSION', '1.3.0.3' );
20
 
21
  include EASYMODAL_DIR . '/inc/classes/gravityforms.php';
22
  include EASYMODAL_DIR . '/inc/classes/shortcodes.php';
880
  }
881
  public function print_modals()
882
  {
883
+ $modals = is_array($this->preload_modals()) ? $this->preload_modals() : array();
884
+ foreach($modals as $id => $modal)
885
  {
886
  require(EASYMODAL_DIR.'/inc/views/modal.php');
887
  }
inc/classes/shortcodes.php CHANGED
@@ -30,8 +30,8 @@ class EM_Shortcodes
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}' ".
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}' ".
inc/css/easy-modal-admin.css CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  #icon-easy-modal {
2
  background: transparent url('../images/admin/easy-modal-icon.png') no-repeat;
3
  }
1
+ .quicktags-toolbar input{
2
+ width:auto;
3
+ }
4
  #icon-easy-modal {
5
  background: transparent url('../images/admin/easy-modal-icon.png') no-repeat;
6
  }
inc/css/easy-modal-admin.min.css CHANGED
@@ -1 +1 @@
1
- #icon-easy-modal{background:transparent url(../images/admin/easy-modal-icon.png) no-repeat}#poststuff h2#em-tabs{margin-bottom:0}.em-tab{display:none}.em-tab.active{display:block;padding:.5em .9em;border:1px solid #ddd;background-color:#fff;border-radius:0 3px 3px}.colorSelect{width:100px!important;display:inline-block}.color-swatch{margin-top:1px;margin-right:10px;width:1.75em;height:1.75em;display:block;float:left;border-style:solid;border-width:1px;border-radius:3px;cursor:pointer}#userHeight,#userWidth,#duration{width:100px}.share-buttons{margin:0;width:100%;display:block;clear:both}.share-buttons li{text-align:center;width:32%;display:inline-block;float:left;margin-right:1%;margin-bottom:0}.share-buttons li:last-child{margin-right:0}ul.bullets{padding-left:1em;list-style:circle}ul.bullets li{margin-bottom:.125em}.postbox .inside p,.postbox .inside ul{margin-top:0}.postbox .inside h2,.postbox .inside h3,.postbox .inside h4,.postbox .inside h5,.postbox .inside h6{margin-bottom:0}.modal h2,.modal h3,.modal h4,.modal h5,.modal h6{margin-bottom:.5em}.modal img.left{margin-right:.5em}.modal img.right{margin-left:.5em}.modal p{margin-top:0}.value-slider{margin-right:10px;min-width:75%;display:inline-block}.slider-value{display:inline-block}.nav-tab{margin-right:0}.empreview{width:42%;float:left;position:relative;border:1px solid #666}.empreview h2{text-align:center;color:#fff;margin:0 7px;font-size:30px;position:relative}#eModal-Preview .example-modal{position:relative;width:300px;top:10px;margin:auto;font-size:16px;position:relative;z-index:99;-webkit-box-shadow:0 0 10px rgba(0,0,0,.4);box-shadow:0 0 10px rgba(0,0,0,.4)}#eModal-Preview .example-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:700;cursor:pointer}#eModal-Preview .example-modal,#eModal-Preview .example-modal-overlay{display:block}.empreview #eModal-Preview{height:450px;width:100%;position:relative}.example-modal-overlay{position:absolute;width:100%;height:100%;top:0;left:0}.emthemes{display:inline-block;float:left;width:57%;margin-right:.5%}.colorpicker{width:356px;height:176px;overflow:hidden;position:absolute;background:url(../images/admin/colorpicker_background.png);font-family:Arial,Helvetica,sans-serif;display:none;z-index:1000}.colorpicker_color{width:150px;height:150px;left:14px;top:13px;position:absolute;background:red;overflow:hidden;cursor:crosshair}.colorpicker_color div{position:absolute;top:0;left:0;width:150px;height:150px;background:url(../images/admin/colorpicker_overlay.png)}.colorpicker_color div div{position:absolute;top:0;left:0;width:11px;height:11px;overflow:hidden;background:url(../images/admin/colorpicker_select.gif);margin:-5px 0 0 -5px}.colorpicker_hue{position:absolute;top:13px;left:171px;width:35px;height:150px;cursor:n-resize}.colorpicker_hue div{position:absolute;width:35px;height:9px;overflow:hidden;background:url(../images/admin/colorpicker_indic.gif) left top;left:0;margin:-4px 0 0}.colorpicker_new_color{position:absolute;width:60px;height:30px;left:213px;top:13px;background:red}.colorpicker_current_color{position:absolute;width:60px;height:30px;left:283px;top:13px;background:red}.colorpicker input{background-color:transparent;border:1px solid transparent;position:absolute;font-size:10px;font-family:Arial,Helvetica,sans-serif;color:#898989;top:4px;right:11px;text-align:right;height:11px;margin:0;padding:0}.colorpicker_hex{position:absolute;width:72px;height:22px;background:url(../images/admin/colorpicker_hex.png) top;left:212px;top:142px}.colorpicker_hex input{right:6px}.colorpicker_field{height:22px;width:62px;background-position:top;position:absolute}.colorpicker_field span{position:absolute;width:12px;height:22px;overflow:hidden;top:0;right:0;cursor:n-resize}.colorpicker_rgb_r{background-image:url(../images/admin/colorpicker_rgb_r.png);top:52px;left:212px}.colorpicker_rgb_g{background-image:url(../images/admin/colorpicker_rgb_g.png);top:82px;left:212px}.colorpicker_rgb_b{background-image:url(../images/admin/colorpicker_rgb_b.png);top:112px;left:212px}.colorpicker_hsb_h{background-image:url(../images/admin/colorpicker_hsb_h.png);top:52px;left:282px}.colorpicker_hsb_s{background-image:url(../images/admin/colorpicker_hsb_s.png);top:82px;left:282px}.colorpicker_hsb_b{background-image:url(../images/admin/colorpicker_hsb_b.png);top:112px;left:282px}.colorpicker_submit{position:absolute;width:22px;height:22px;background:url(../images/admin/colorpicker_submit.png) top;left:322px;top:142px;overflow:hidden}.colorpicker_focus{background-position:center}.colorpicker_hex.colorpicker_focus,.colorpicker_submit.colorpicker_focus,.colorpicker_slider{background-position:bottom}.ui-widget{font-family:Lucida Grande,Lucida Sans,Arial,sans-serif;font-size:1.1em}.ui-widget-content{border:1px solid #a6c9e2;background:#fcfdfd url(../images/admin/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #4297d7;background:#5c9ccc url(../images/admin/ui-bg_gloss-wave_55_5c9ccc_500x100.png) 50% 50% repeat-x;color:#fff;font-weight:700}.ui-state-default,.ui-widget-content .ui-state-default{border:1px solid #c5dbec;background:#dfeffc url(../images/admin/ui-bg_glass_85_dfeffc_1x400.png) 50% 50% repeat-x;font-weight:700;color:#2e6e9e}.ui-corner-all{-moz-border-radius-topleft:5px;-webkit-border-top-left-radius:5px;-khtml-border-top-left-radius:5px;border-top-left-radius:5px}.ui-corner-all{-moz-border-radius-topright:5px;-webkit-border-top-right-radius:5px;-khtml-border-top-right-radius:5px;border-top-right-radius:5px}.ui-corner-all{-moz-border-radius-bottomleft:5px;-webkit-border-bottom-left-radius:5px;-khtml-border-bottom-left-radius:5px;border-bottom-left-radius:5px}.ui-corner-all{-moz-border-radius-bottomright:5px;-webkit-border-bottom-right-radius:5px;-khtml-border-bottom-right-radius:5px;border-bottom-right-radius:5px}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.cb-enable,.cb-disable,.cb-enable span,.cb-disable span{background:url(../images/admin/switch.gif) repeat-x;display:block;float:left}.cb-enable span,.cb-disable span{line-height:30px;display:block;background-repeat:no-repeat;font-weight:700}.cb-enable span{background-position:left -90px;padding:0 10px}.cb-disable span{background-position:right -180px;padding:0 10px}.cb-disable.selected{background-position:0 -30px}.cb-disable.selected span{background-position:right -210px;color:#fff}.cb-enable.selected{background-position:0 -60px}.cb-enable.selected span{background-position:left -150px;color:#fff}.switch label{cursor:pointer}.switch input{display:none}
1
+ .quicktags-toolbar input{width:auto;}#icon-easy-modal{background:transparent url(../images/admin/easy-modal-icon.png) no-repeat}#poststuff h2#em-tabs{margin-bottom:0}.em-tab{display:none}.em-tab.active{display:block;padding:.5em .9em;border:1px solid #ddd;background-color:#fff;border-radius:0 3px 3px}.colorSelect{width:100px!important;display:inline-block}.color-swatch{margin-top:1px;margin-right:10px;width:1.75em;height:1.75em;display:block;float:left;border-style:solid;border-width:1px;border-radius:3px;cursor:pointer}#userHeight,#userWidth,#duration{width:100px}.share-buttons{margin:0;width:100%;display:block;clear:both}.share-buttons li{text-align:center;width:32%;display:inline-block;float:left;margin-right:1%;margin-bottom:0}.share-buttons li:last-child{margin-right:0}ul.bullets{padding-left:1em;list-style:circle}ul.bullets li{margin-bottom:.125em}.postbox .inside p,.postbox .inside ul{margin-top:0}.postbox .inside h2,.postbox .inside h3,.postbox .inside h4,.postbox .inside h5,.postbox .inside h6{margin-bottom:0}.modal h2,.modal h3,.modal h4,.modal h5,.modal h6{margin-bottom:.5em}.modal img.left{margin-right:.5em}.modal img.right{margin-left:.5em}.modal p{margin-top:0}.value-slider{margin-right:10px;min-width:75%;display:inline-block}.slider-value{display:inline-block}.nav-tab{margin-right:0}.empreview{width:42%;float:left;position:relative;border:1px solid #666}.empreview h2{text-align:center;color:#fff;margin:0 7px;font-size:30px;position:relative}#eModal-Preview .example-modal{position:relative;width:300px;top:10px;margin:auto;font-size:16px;position:relative;z-index:99;-webkit-box-shadow:0 0 10px rgba(0,0,0,.4);box-shadow:0 0 10px rgba(0,0,0,.4)}#eModal-Preview .example-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:700;cursor:pointer}#eModal-Preview .example-modal,#eModal-Preview .example-modal-overlay{display:block}.empreview #eModal-Preview{height:450px;width:100%;position:relative}.example-modal-overlay{position:absolute;width:100%;height:100%;top:0;left:0}.emthemes{display:inline-block;float:left;width:57%;margin-right:.5%}.colorpicker{width:356px;height:176px;overflow:hidden;position:absolute;background:url(../images/admin/colorpicker_background.png);font-family:Arial,Helvetica,sans-serif;display:none;z-index:1000}.colorpicker_color{width:150px;height:150px;left:14px;top:13px;position:absolute;background:red;overflow:hidden;cursor:crosshair}.colorpicker_color div{position:absolute;top:0;left:0;width:150px;height:150px;background:url(../images/admin/colorpicker_overlay.png)}.colorpicker_color div div{position:absolute;top:0;left:0;width:11px;height:11px;overflow:hidden;background:url(../images/admin/colorpicker_select.gif);margin:-5px 0 0 -5px}.colorpicker_hue{position:absolute;top:13px;left:171px;width:35px;height:150px;cursor:n-resize}.colorpicker_hue div{position:absolute;width:35px;height:9px;overflow:hidden;background:url(../images/admin/colorpicker_indic.gif) left top;left:0;margin:-4px 0 0}.colorpicker_new_color{position:absolute;width:60px;height:30px;left:213px;top:13px;background:red}.colorpicker_current_color{position:absolute;width:60px;height:30px;left:283px;top:13px;background:red}.colorpicker input{background-color:transparent;border:1px solid transparent;position:absolute;font-size:10px;font-family:Arial,Helvetica,sans-serif;color:#898989;top:4px;right:11px;text-align:right;height:11px;margin:0;padding:0}.colorpicker_hex{position:absolute;width:72px;height:22px;background:url(../images/admin/colorpicker_hex.png) top;left:212px;top:142px}.colorpicker_hex input{right:6px}.colorpicker_field{height:22px;width:62px;background-position:top;position:absolute}.colorpicker_field span{position:absolute;width:12px;height:22px;overflow:hidden;top:0;right:0;cursor:n-resize}.colorpicker_rgb_r{background-image:url(../images/admin/colorpicker_rgb_r.png);top:52px;left:212px}.colorpicker_rgb_g{background-image:url(../images/admin/colorpicker_rgb_g.png);top:82px;left:212px}.colorpicker_rgb_b{background-image:url(../images/admin/colorpicker_rgb_b.png);top:112px;left:212px}.colorpicker_hsb_h{background-image:url(../images/admin/colorpicker_hsb_h.png);top:52px;left:282px}.colorpicker_hsb_s{background-image:url(../images/admin/colorpicker_hsb_s.png);top:82px;left:282px}.colorpicker_hsb_b{background-image:url(../images/admin/colorpicker_hsb_b.png);top:112px;left:282px}.colorpicker_submit{position:absolute;width:22px;height:22px;background:url(../images/admin/colorpicker_submit.png) top;left:322px;top:142px;overflow:hidden}.colorpicker_focus{background-position:center}.colorpicker_hex.colorpicker_focus,.colorpicker_submit.colorpicker_focus,.colorpicker_slider{background-position:bottom}.ui-widget{font-family:Lucida Grande,Lucida Sans,Arial,sans-serif;font-size:1.1em}.ui-widget-content{border:1px solid #a6c9e2;background:#fcfdfd url(../images/admin/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #4297d7;background:#5c9ccc url(../images/admin/ui-bg_gloss-wave_55_5c9ccc_500x100.png) 50% 50% repeat-x;color:#fff;font-weight:700}.ui-state-default,.ui-widget-content .ui-state-default{border:1px solid #c5dbec;background:#dfeffc url(../images/admin/ui-bg_glass_85_dfeffc_1x400.png) 50% 50% repeat-x;font-weight:700;color:#2e6e9e}.ui-corner-all{-moz-border-radius-topleft:5px;-webkit-border-top-left-radius:5px;-khtml-border-top-left-radius:5px;border-top-left-radius:5px}.ui-corner-all{-moz-border-radius-topright:5px;-webkit-border-top-right-radius:5px;-khtml-border-top-right-radius:5px;border-top-right-radius:5px}.ui-corner-all{-moz-border-radius-bottomleft:5px;-webkit-border-bottom-left-radius:5px;-khtml-border-bottom-left-radius:5px;border-bottom-left-radius:5px}.ui-corner-all{-moz-border-radius-bottomright:5px;-webkit-border-bottom-right-radius:5px;-khtml-border-bottom-right-radius:5px;border-bottom-right-radius:5px}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.cb-enable,.cb-disable,.cb-enable span,.cb-disable span{background:url(../images/admin/switch.gif) repeat-x;display:block;float:left}.cb-enable span,.cb-disable span{line-height:30px;display:block;background-repeat:no-repeat;font-weight:700}.cb-enable span{background-position:left -90px;padding:0 10px}.cb-disable span{background-position:right -180px;padding:0 10px}.cb-disable.selected{background-position:0 -30px}.cb-disable.selected span{background-position:right -210px;color:#fff}.cb-enable.selected{background-position:0 -60px}.cb-enable.selected span{background-position:left -150px;color:#fff}.switch label{cursor:pointer}.switch input{display:none}
inc/js/easy-modal.js CHANGED
@@ -21,10 +21,18 @@
21
 
22
  var $this = $(this);
23
 
24
- var opts = $this.data('emodal');
25
  $this.removeClass('active').fadeOut(options.speed,function(){
26
  if(options.overlay)
27
  $('#modal-overlay').fadeOut(options.speed,function(){
 
 
 
 
 
 
 
 
28
  options.onClose();
29
  });
30
  })
@@ -59,7 +67,7 @@
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,14 +78,14 @@
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)
@@ -232,9 +240,9 @@
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,9 +250,9 @@
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,13 +314,12 @@
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
@@ -604,14 +611,14 @@
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;
21
 
22
  var $this = $(this);
23
 
24
+ var opts = $this.data('emodal');
25
  $this.removeClass('active').fadeOut(options.speed,function(){
26
  if(options.overlay)
27
  $('#modal-overlay').fadeOut(options.speed,function(){
28
+ var vids = $('iframe',$this).filter('[src*="youtube"],[src*="vimeo"]');
29
+ if (vids.length > 0 )
30
+ {
31
+ vids.each(function(){
32
+ var src = $(this).attr('src');
33
+ $(this).attr('src', '').attr('src', src);
34
+ })
35
+ }
36
  options.onClose();
37
  });
38
  })
67
  $this.addClass('active');
68
  // Modal Clos Button
69
 
70
+ if(!opts.closeDisabled && $('.close-modal',$this).length)
71
  {
72
  $('.close-modal',$this)
73
  .unbind('click')
78
  .unbind('click')
79
  .click(function()
80
  {
81
+ if (opts.overlayClose == true)
82
  {
83
  $this.emodal('close');
84
  }
85
  })
86
  .themeOverlay(opts);
87
 
88
+ if(opts.overlayClose == true)
89
  {
90
  $(window).bind('keyup.emodal',function(e){
91
  if($('.modal.active').length && e.keyCode == 27)
240
  content.css({maxHeight: (opts.maxHeight - 60) + 'px'});
241
  }
242
 
243
+ if(opts.userHeight > 0)
244
  {
245
+ content.css({height: opts.userHeight + 'px'});
246
  }
247
 
248
  if(opts.userMaxWidth > 0)
250
  content.css({maxWidth: $(window).width() * (opts.userMaxWidth / 100) + 'px'});
251
  }
252
 
253
+ if(opts.userWidth > 0)
254
  {
255
+ content.css({width: opts.userWidth + 'px'});
256
  }
257
  var title = content
258
  .find("#eModal-Title")
314
  {
315
  var theme = themes[opts.theme];
316
  }
 
317
  if(opts.size == 'custom')
318
  {
319
  $this.css({
320
+ 'height': opts.userHeight ? opts.userHeight + opts.userHeightUnit : $this.css('height'),
321
+ 'width': opts.userWidth ? opts.userWidth + opts.userWidthUnit : $this.css('width'),
322
+ 'margin-left': opts.userWidth ? -(opts.userWidth / 2) + opts.userWidthUnit : $this.css('margin-left')
323
  });
324
  }
325
  $this
611
  onLoad: function (){},
612
  onClose: function (){},
613
  type: null,
614
+ userHeight: null,
615
+ userWidth: null,
616
  animation: 'fadeAndSlide',
617
  direction: 'bottom',
618
  duration: 350,
619
+ overlayClose: false,
620
+ escClose: false,
621
+ closeDisabled: false
622
  };
623
  var modals = easymodal.modals;
624
  var themes = easymodal.themes;
inc/js/easy-modal.min.js CHANGED
@@ -1 +1,871 @@
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);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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)
16
+ {
17
+ var options = $.extend({
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)
27
+ $('#modal-overlay').fadeOut(options.speed,function(){
28
+ var vids = $('iframe',$this).filter('[src*="youtube"],[src*="vimeo"]');
29
+ if (vids.length > 0 )
30
+ {
31
+ vids.each(function(){
32
+ var src = $(this).attr('src');
33
+ $(this).attr('src', '').attr('src', src);
34
+ })
35
+ }
36
+ options.onClose();
37
+ });
38
+ })
39
+ $(window).unbind('scroll.emodal').unbind('keyup.emodal');
40
+ return this;
41
+ },
42
+ open: function()
43
+ {
44
+ var $this = $(this);
45
+ var opts = $this.data('emodal');
46
+ if(themes[opts.theme] === undefined)
47
+ {
48
+ var theme = themes[1];
49
+ }
50
+ else
51
+ {
52
+ var theme = themes[opts.theme];
53
+ }
54
+ // Check for and create Modal Overlay
55
+ if(!$('#modal-overlay').length){ $('<div id="modal-overlay">').appendTo('body'); }
56
+
57
+ // If not stackable close all other modals.
58
+ if($('.modal.active').length)
59
+ {
60
+ $('.modal.active').each(function(){$(this).emodal('close',{speed:100,overlay:false})});
61
+ }
62
+ else
63
+ {
64
+ $('#modal-overlay').css('opacity',0).show(0);
65
+ }
66
+
67
+ $this.addClass('active');
68
+ // Modal Clos Button
69
+
70
+ if(!opts.closeDisabled && $('.close-modal',$this).length)
71
+ {
72
+ $('.close-modal',$this)
73
+ .unbind('click')
74
+ .click(function(){ $this.emodal('close'); })
75
+ .themeClose(opts);
76
+ }
77
+ $('#modal-overlay')
78
+ .unbind('click')
79
+ .click(function()
80
+ {
81
+ if (opts.overlayClose == true)
82
+ {
83
+ $this.emodal('close');
84
+ }
85
+ })
86
+ .themeOverlay(opts);
87
+
88
+ if(opts.overlayClose == true)
89
+ {
90
+ $(window).bind('keyup.emodal',function(e){
91
+ if($('.modal.active').length && e.keyCode == 27)
92
+ {
93
+ $this.emodal('close');
94
+ }
95
+ });
96
+ }
97
+ $this.themeModal(opts);
98
+ $this.animation(opts.animation,opts);
99
+ return $this;
100
+ }/*,
101
+ show: function ()
102
+ {
103
+ if (opts.type === 'Image')
104
+ {
105
+ container.css(
106
+ {
107
+ maxWidth: opts.maxWidth,
108
+ maxHeight: opts.maxHeight
109
+ });
110
+ var abcs = $("a.eModal-Image")
111
+ var prevButton = $('<a>')
112
+ .attr('id',opts.prevId)
113
+ .click(function (){
114
+ var current = $('.eModal-Opened')
115
+ var prev = abcs.eq(abcs.index(current) - 1)
116
+ current.removeClass('eModal-Opened')
117
+ if (prev.length <= 0) prev = abcs.eq(abcs.length)
118
+ prev.addClass('eModal-Opened')
119
+ container
120
+ .animate({opacity: '.01'}, function (){
121
+ var img = $("<img/>")
122
+ .attr('src', prev.attr('href'))
123
+ .css({
124
+ maxWidth: '100%',
125
+ maxHeight: '100%'
126
+ })
127
+ .load(function (){
128
+ if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0)
129
+ {
130
+ alert('broken image!')
131
+ }
132
+ else
133
+ {
134
+ if (this.naturalWidth > opts.maxWidth) img.attr('width', opts.maxWidth)
135
+ if (this.naturalHeight > opts.maxHeight) img.attr('height', opts.maxHeight)
136
+ content
137
+ .html(img)
138
+ .css({opacity:'.01'})
139
+
140
+ container
141
+ .emodal('center')
142
+ .animate({opacity:'.01'})
143
+ .animate({opacity:'1'})
144
+
145
+ content.animate({opacity: '1'})
146
+ }
147
+ })
148
+ })
149
+ return false
150
+ })
151
+ var nextButton = $('<a>')
152
+ .attr('id',opts.nextId)
153
+ .click(function (){
154
+ var current = $('.eModal-Opened')
155
+
156
+ var next = abcs.eq(abcs.index(current) + 1)
157
+ current.removeClass('eModal-Opened')
158
+ if (next.length == 0) next = abcs.eq(0)
159
+ next.addClass('eModal-Opened')
160
+ container
161
+ .animate({opacity: '.01'}, function (){
162
+ var img = $("<img/>")
163
+ .attr('src', next.attr('href'))
164
+ .css({
165
+ maxWidth: '100%',
166
+ maxHeight: '100%'
167
+ })
168
+ .load(function (){
169
+ if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0)
170
+ {
171
+ alert('broken image!')
172
+ }
173
+ else
174
+ {
175
+ if (this.naturalWidth > opts.maxWidth) img.attr('width', opts.maxWidth)
176
+ if (this.naturalHeight > opts.maxHeight) img.attr('height', opts.maxHeight)
177
+ content
178
+ .html(img)
179
+ .css({opacity:'.01'})
180
+
181
+ container
182
+ .emodal('center')
183
+ .animate({opacity:'.01'})
184
+ .animate({opacity:'1'})
185
+
186
+ content.animate({opacity: '1'})
187
+ }
188
+ })
189
+ })
190
+ return false
191
+ })
192
+ var buttons = $('<div>')
193
+ .attr('id',opts.buttonsId)
194
+ .append(prevButton, nextButton)
195
+ .appendTo(container)
196
+ }
197
+ if (opts.type === 'Link')
198
+ {
199
+ opts.requestData.url = $(this).attr('href')
200
+ opts.requestData.iframeWidth = opts.maxWidth
201
+ opts.requestData.iframeHeight = opts.maxHeight
202
+ }
203
+ var loaded = false
204
+ if (opts.url != null){
205
+ if (opts.type === 'Image'){
206
+ var img = $("<img/>")
207
+ .attr('src', opts.url)
208
+ .css({
209
+ maxWidth: '100%',
210
+ maxHeight: '100%'
211
+ })
212
+ .load(function (){
213
+ if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) alert('broken image!')
214
+ else {
215
+ if (this.naturalWidth > opts.maxWidth) img.attr('width', opts.maxWidth)
216
+ if (this.naturalHeight > opts.maxHeight) img.attr('height', opts.maxHeight)
217
+ content.append(img)
218
+ loaded = true
219
+ }
220
+ })
221
+ }
222
+ else
223
+ {
224
+ $.post(opts.url, opts.requestData, function (data){
225
+ content.prepend(data)
226
+ if($('form',content).length)
227
+ {
228
+ $orig_action = $('form',content).attr('action').split('#');
229
+ $('form',content).attr('action',"#" + $orig_action[1]).attr('action')
230
+ }
231
+ container
232
+ .show()
233
+ .css({opacity: '.01'});
234
+ if(opts.userMaxHeight > 0)
235
+ {
236
+ content.css({maxHeight: $(window).height() * (opts.userMaxHeight / 100) + 'px'});
237
+ }
238
+ else if(content.innerHeight() > opts.maxHeight && opts.type != 'Link')
239
+ {
240
+ content.css({maxHeight: (opts.maxHeight - 60) + 'px'});
241
+ }
242
+
243
+ if(opts.userHeight > 0)
244
+ {
245
+ content.css({height: opts.userHeight + 'px'});
246
+ }
247
+
248
+ if(opts.userMaxWidth > 0)
249
+ {
250
+ content.css({maxWidth: $(window).width() * (opts.userMaxWidth / 100) + 'px'});
251
+ }
252
+
253
+ if(opts.userWidth > 0)
254
+ {
255
+ content.css({width: opts.userWidth + 'px'});
256
+ }
257
+ var title = content
258
+ .find("#eModal-Title")
259
+ .css({
260
+ color: theme.contentTitleFontColor,
261
+ fontFamily: theme.contentTitleFontFamily,
262
+ fontSize: theme.contentTitleFontSize + 'px'
263
+ })
264
+ if(title) title.attr('title', title.text()).appendTo(controls)
265
+ opts.onLoad()
266
+ if(opts.cf7form == true) loadCf7()
267
+ if(opts.gravityform == true) loadGravityForms()
268
+ loaded = true
269
+ })
270
+ }
271
+ }
272
+ },*/
273
+ };
274
+ $.fn.emodal = function(method)
275
+ {
276
+ // Method calling logic
277
+ if (methods[method])
278
+ {
279
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
280
+ }
281
+ else if (typeof method === 'object' || !method)
282
+ {
283
+ return methods.init.apply(this, arguments);
284
+ }
285
+ else
286
+ {
287
+ $.error('Method ' + method + ' does not exist on jQuery.emodal');
288
+ }
289
+ };
290
+ $.fn.themeOverlay = function(opts)
291
+ {
292
+ var $this = $(this);
293
+ if(themes[opts.theme] === undefined)
294
+ {
295
+ var theme = themes[1];
296
+ }
297
+ else
298
+ {
299
+ var theme = themes[opts.theme];
300
+ }
301
+ return $this.addClass('theme-'+opts.theme).animate({
302
+ backgroundColor: theme.overlayColor,
303
+ opacity: theme.overlayOpacity / 100
304
+ },opts.duration);
305
+ };
306
+ $.fn.themeModal = function(opts)
307
+ {
308
+ var $this = $(this);
309
+ if(themes[opts.theme] === undefined)
310
+ {
311
+ var theme = themes[1];
312
+ }
313
+ else
314
+ {
315
+ var theme = themes[opts.theme];
316
+ }
317
+ if(opts.size == 'custom')
318
+ {
319
+ $this.css({
320
+ 'height': opts.userHeight ? opts.userHeight + opts.userHeightUnit : $this.css('height'),
321
+ 'width': opts.userWidth ? opts.userWidth + opts.userWidthUnit : $this.css('width'),
322
+ 'margin-left': opts.userWidth ? -(opts.userWidth / 2) + opts.userWidthUnit : $this.css('margin-left')
323
+ });
324
+ }
325
+ $this
326
+ .addClass(opts.size)
327
+ .addClass('theme-'+opts.theme)
328
+ .css({
329
+ color: theme.contentFontColor,
330
+ backgroundColor: theme.containerBgColor,
331
+ padding: theme.containerPadding + 'px',
332
+ border: theme.containerBorderColor + ' ' + theme.containerBorderStyle + ' ' + theme.containerBorderWidth + 'px',
333
+ "-webkit-border-radius": theme.containerBorderRadius + 'px',
334
+ "border-radius": theme.containerBorderRadius + 'px'
335
+ });
336
+ $('.title', $this).css({
337
+ color: theme.contentTitleFontColor,
338
+ fontFamily: theme.contentTitleFontFamily,
339
+ fontSize: theme.contentTitleFontSize
340
+ });
341
+ return $this;
342
+ };
343
+ $.fn.themeClose = function(opts)
344
+ {
345
+ var $this = $(this);
346
+ if(themes[opts.theme] === undefined)
347
+ {
348
+ var theme = themes[1];
349
+ }
350
+ else
351
+ {
352
+ var theme = themes[opts.theme];
353
+ }
354
+ if(theme.closeLocation == 'outside')
355
+ {
356
+ var val = theme.closeSize;
357
+ var top = bottom = left = right = 'auto';
358
+ switch (theme.closePosition)
359
+ {
360
+ case 'topright':
361
+ top = -(val / 2) + 'px';
362
+ right = -(val / 2) + 'px';
363
+ break;
364
+ case 'topleft':
365
+ top = -(val / 2) + 'px';
366
+ left = -(val / 2) + 'px';
367
+ break;
368
+ case 'bottomright':
369
+ bottom = -(val / 2) + 'px';
370
+ right = -(val / 2) + 'px';
371
+ break;
372
+ case 'bottomleft':
373
+ bottom = -(val / 2) + 'px';
374
+ left = -(val / 2) + 'px';
375
+ break;
376
+ }
377
+ $this
378
+ .addClass('outside')
379
+ .css({
380
+ left: left,
381
+ right: right,
382
+ top: top,
383
+ bottom: bottom,
384
+ height: theme.closeSize + 'px',
385
+ fontSize: theme.closeFontSize + 'px',
386
+ width: theme.closeSize + 'px',
387
+ backgroundColor: theme.closeBgColor,
388
+ "-webkit-border-radius": theme.closeBorderRadius + 'px',
389
+ "border-radius": theme.closeBorderRadius + 'px',
390
+ lineHeight: theme.closeSize + 'px'
391
+ });
392
+ }
393
+ return $this.addClass('theme-'+opts.theme)
394
+ .html(theme.closeText)
395
+ .css({
396
+ color: theme.closeFontColor,
397
+ });
398
+ };
399
+
400
+ var animations = {
401
+ fade: function(options)
402
+ {
403
+ var $this = $(this).show(0).css({'opacity':0,'top':$(window).scrollTop() + 100 +'px'});
404
+ var opts = $.extend($.fn.animation.defaults, options);
405
+ $this.animate({
406
+ opacity: 1
407
+ },parseInt(opts.duration),opts.easing,function(){
408
+ $this
409
+ .removeAttr('style')
410
+ .css({'display':'block','visibility':'visible','top': ($(window).scrollTop() + 100) +'px'})
411
+ .themeModal(opts);
412
+ });
413
+ },
414
+ fadeAndSlide: function(options)
415
+ {
416
+ var $this = $(this).show(0).css('opacity',0);
417
+ var opts = $.extend($.fn.animation.defaults, options);
418
+ switch(opts.direction)
419
+ {
420
+ case 'mouse': $this.css({'top': currentMousePos.y + 'px','left': currentMousePos.x +'px'}); break;
421
+ case 'top': $this.css({'top': $(window).scrollTop() - $this.outerHeight(true) + 'px'}); break;
422
+ case 'left': $this.css({'left': '-'+$this.outerWidth(true)+'px','top':$(window).scrollTop() + 100 +'px'}); break;
423
+ case 'bottom': $this.css({'top': $(window).innerHeight() + $(window).scrollTop() + 'px'}); break;
424
+ case 'right': $this.css({'left': $(window).innerWidth()+'px','top':$(window).scrollTop() + 100 +'px'}); break;
425
+ case 'topleft': $this.css({'left': '-'+$this.outerWidth(true)+'px','top':$(window).scrollTop() + 100 +'px','top': $(window).scrollTop() - $this.outerHeight(true) + 'px'}); break;
426
+ case 'topright': $this.css({'left': $(window).innerWidth()+'px','top': $(window).scrollTop() - $this.outerHeight(true) + 'px'}); break;
427
+ case 'bottomleft': $this.css({'left': '-'+$this.outerWidth(true)+'px','top':$(window).scrollTop() + 100 +'px','top': $(window).innerHeight() + $(window).scrollTop() + 'px'}); break;
428
+ case 'bottomright': $this.css({'left': $(window).innerWidth()+'px','top': $(window).innerHeight() + $(window).scrollTop() + 'px'}); break;
429
+ }
430
+ $('html').css('overflow-x','hidden');
431
+ $this.animate({
432
+ 'left': '50%',
433
+ 'top': $(window).scrollTop() + 100 +'px'
434
+ },{duration: opts.duration , queue:false},opts.easing);
435
+ setTimeout(function()
436
+ {
437
+ $this.animate({
438
+ 'opacity': 1
439
+ },opts.duration * .75,opts.easing,function(){
440
+ $this
441
+ .removeAttr('style')
442
+ .css({'display':'block','visibility':'visible','top': ($(window).scrollTop() + 100) +'px'})
443
+ .themeModal(opts);
444
+ $('html').css('overflow-x','inherit');
445
+ });
446
+ },opts.duration * .25);
447
+ },
448
+ grow: function(options)
449
+ {
450
+ var $this = $(this).show(0);
451
+ var opts = $.extend($.fn.animation.defaults, options);
452
+ var currently = {
453
+ width: parseInt($this.css('width')) / parseInt($this.parent().innerWidth()) * 100 + '%',
454
+ height: parseInt($this.css('height')),
455
+ marginLeft: '-' + parseInt($this.css('width')) / parseInt($this.parent().innerWidth()) * 100 / 2 + '%',
456
+ padding: parseInt($this.css('padding-left')) / parseInt($this.css('font-size')) + 'em'
457
+ };
458
+ $('*',$this).fadeOut(0);
459
+ $this.css({
460
+ 'top': (currently.height/10) * 5 + $(window).scrollTop() + 100 +'px',
461
+ 'left': (currently.width/10) * 5 + ($(window).innerWidth() / 2) +'px',
462
+ 'height': 0,
463
+ 'width': 0,
464
+ 'padding': 0,
465
+ 'margin-left': 0
466
+ }).animate({
467
+ 'top': $(window).scrollTop() + 100 +'px',
468
+ 'left': '50%',
469
+ 'padding': currently.padding,
470
+ 'height': currently.height,
471
+ 'width': currently.width,
472
+ 'margin-left': currently.marginLeft
473
+ },opts.duration,function(){
474
+ $this
475
+ .removeAttr('style')
476
+ .css({'display':'block','visibility':'visible','top': ($(window).scrollTop() + 100) +'px'})
477
+ .themeModal(opts);
478
+ $('*',$this).fadeIn('fast');
479
+ });
480
+ },
481
+ growAndSlide: function(options)
482
+ {
483
+ var $this = $(this).show(0);
484
+ var opts = $.extend($.fn.animation.defaults, options);
485
+ var currently = {
486
+ width: parseInt($this.css('width')) / parseInt($this.parent().innerWidth()) * 100 + '%',
487
+ height: parseInt($this.css('height')),
488
+ marginLeft: '-' + parseInt($this.css('width')) / parseInt($this.parent().innerWidth()) * 100 / 2 + '%',
489
+ padding: parseInt($this.css('padding-left')) / parseInt($this.css('font-size')) + 'em'
490
+ };
491
+ $('html,body').css('overflow-x','hidden');
492
+ $('*',$this).fadeOut(0);
493
+ $this.css({
494
+ 'opacity': 1,
495
+ 'height': 0,
496
+ 'width': 0,
497
+ 'padding': 0,
498
+ 'margin-left': 0
499
+ });
500
+ switch(opts.direction)
501
+ {
502
+ case 'mouse': $this.css({'top': currentMousePos.y + 'px','left': currentMousePos.x +'px'}); break;
503
+ case 'top': $this.css({'top': $(window).scrollTop() + $this.outerHeight(true) + 'px'}); break;
504
+ case 'left': $this.css({'left': 0,'top':$(window).scrollTop() + 100 +'px'}); break;
505
+ case 'bottom': $this.css({'top': $(window).innerHeight() + $(window).scrollTop() + 'px'}); break;
506
+ case 'right': $this.css({'left': $(window).innerWidth()+'px','top':$(window).scrollTop() + 100 +'px'}); break;
507
+ case 'topleft': $this.css({'left': 0,'top':$(window).scrollTop() + 100 +'px','top': $(window).scrollTop() - $this.outerHeight(true) + 'px'}); break;
508
+ case 'topright': $this.css({'left': $(window).innerWidth()+'px','top': $(window).scrollTop() - $this.outerHeight(true) + 'px'}); break;
509
+ case 'bottomleft': $this.css({'left': 0,'top':$(window).scrollTop() + 100 +'px','top': $(window).innerHeight() + $(window).scrollTop() + 'px'}); break;
510
+ case 'bottomright': $this.css({'left': $(window).innerWidth()+'px','top': $(window).innerHeight() + $(window).scrollTop() + 'px'}); break;
511
+ }
512
+ $this.animate({
513
+ 'height': currently.height,
514
+ 'padding': currently.padding,
515
+ 'width': currently.width,
516
+ 'margin-left': currently.marginLeft
517
+ },{duration: opts.duration , queue:false},opts.easing);
518
+ setTimeout(function()
519
+ {
520
+ $this.animate({
521
+ 'height': 'auto',
522
+ 'top': ($(window).scrollTop() + 100) +'px',
523
+ 'left': '50%'
524
+ },opts.duration * .95,opts.easing,function(){
525
+ $this
526
+ .removeAttr('style')
527
+ .css({'display':'block','visibility':'visible','top': ($(window).scrollTop() + 100) +'px'})
528
+ .themeModal(opts);
529
+ $('*',$this).fadeIn('fast');
530
+ $('html').css('overflow-x','inherit');
531
+ });
532
+ },opts.duration * .05);
533
+ }/*,
534
+ canvas: function(options)
535
+ {
536
+ var $this = $(this)
537
+ $this.css('top',$(document).height() + $this.height()).show(0);
538
+ html2canvas($this, {
539
+ onrendered: function(canvas) {
540
+ var canvas = canvas;
541
+ //$('body').append(canvas);
542
+ var x = 4,
543
+ y = 3,
544
+ random = true,
545
+ width = parseInt($this.css('width')) / parseInt($this.parent().innerWidth()) * 100,
546
+ height = parseInt($this.css('height')),
547
+ marginLeft = '-' + parseInt($this.css('width')) / parseInt($this.parent().innerWidth()) * 100 / 2 + '%',
548
+ $img = canvas.toDataURL(),
549
+ n_tiles = x * y, // total number of tiles
550
+ tiles = [],
551
+ $tiles = {};
552
+
553
+ for ( var i = 0; i < n_tiles; i++ ) {
554
+ tiles.push('<div class="tile"/>');
555
+ }
556
+
557
+ $tiles = $( tiles.join('') );
558
+ // Hide original image and insert tiles in DOM
559
+ $this.hide().after(
560
+ $('<div class="modal-placeholder"/>').attr('style', $this.attr('style')).css({
561
+ 'opacity': 1,
562
+ 'height': height,
563
+ 'margin-left': '-' + (parseInt(width) / 2) + '%',
564
+ 'padding': 0,
565
+ 'width': parseInt(width) + '%',
566
+ 'top': $(window).scrollTop() + 100
567
+ })
568
+ .show(0)
569
+ .append( $tiles )
570
+ );
571
+ // Adjust position
572
+ $tiles.each(function(){
573
+ var pos = $(this).position();
574
+
575
+ console.log($this.outerHeight() / y + 'px');
576
+ $(this).css({
577
+ 'border': 0,
578
+ 'backgroundPosition': -pos.left +'px ' + -pos.top + 'px',
579
+ 'width': $this.outerWidth() / x + 'px',
580
+ 'height': $this.outerHeight() / y + 'px',
581
+ 'background-image': 'url('+ $img +')'
582
+ });
583
+ });
584
+
585
+ }
586
+ });
587
+ //$this.hide(0);
588
+ var opts = $.extend($.fn.animation.defaults, options);
589
+ }*/
590
+ };
591
+ $.fn.animation = function(style)
592
+ {
593
+ // Method calling logic
594
+ if (animations[style])
595
+ {
596
+ return animations[style].apply(this, Array.prototype.slice.call(arguments, 1));
597
+ }
598
+ else
599
+ {
600
+ $.error('Animation style ' + animations + ' does not exist on jQuery.animation');
601
+ }
602
+ };
603
+
604
+ $.fn.animation.defaults = {
605
+ duration:350,
606
+ direction: 'top',
607
+ easing: 'swing'
608
+ };
609
+ $.fn.emodal.defaults = {
610
+ theme: 1,
611
+ onLoad: function (){},
612
+ onClose: function (){},
613
+ type: null,
614
+ userHeight: null,
615
+ userWidth: null,
616
+ animation: 'fadeAndSlide',
617
+ direction: 'bottom',
618
+ duration: 350,
619
+ overlayClose: false,
620
+ escClose: false,
621
+ closeDisabled: false
622
+ };
623
+ var modals = easymodal.modals;
624
+ var themes = easymodal.themes;
625
+ var settings = easymodal.settings;
626
+
627
+ $(document).ready(function()
628
+ {
629
+ $('.modal').each(function()
630
+ {
631
+ var $this = $(this).css({visibility:'visible'}).hide(0);
632
+ var modalId = $this.attr('id').split("-")[1];
633
+ $this.emodal(modals[modalId]);
634
+ $(document).on('click','.'+$this.attr('id'),function(e){
635
+ e.preventDefault();
636
+ e.stopPropagation();
637
+ currentMousePos.x = e.pageX;
638
+ currentMousePos.y = e.pageY;
639
+ $this.emodal('open');
640
+ });
641
+ $('.'+$this.attr('id')).css('cursor','pointer');
642
+ });
643
+ if(easymodal.force_user_login)
644
+ {
645
+ $('#eModal-Login .close-modal, #eModal-Register .close-modal, #eModal-Forgot .close-modal').hide();
646
+ $('#eModal-Register, #eModal-Forgot').append($('<a class="eModal-Login">Back to Login Form</a>').css('cursor','pointer'));
647
+ }
648
+ if(easymodal.autoOpen && !$.cookie("eModal-autoOpen-"+easymodal.autoOpen.id))
649
+ {
650
+ setTimeout(function(){
651
+ $('#eModal-'+easymodal.autoOpen.id).emodal('open');
652
+ var date = new Date();
653
+ date.setTime(date.getTime() + (easymodal.autoOpen.timer * 24 * 60 * 1000));
654
+ $.cookie("eModal-autoOpen-"+easymodal.autoOpen.id, true, { expires : date });
655
+ },easymodal.autoOpen.delay);
656
+ }
657
+ if(easymodal.autoExit && !$.cookie("eModal-autoExit-"+easymodal.autoExit.id))
658
+ {
659
+ $('body').one('mouseleave',function(){
660
+ if(easymodal.force_user_login)
661
+ {
662
+ return false;
663
+ }
664
+ $this = $('#eModal-'+easymodal.autoExit.id).emodal('open');
665
+ var date = new Date();
666
+ date.setTime(date.getTime() + (easymodal.autoExit.timer * 24 * 60 * 1000));
667
+ $.cookie("eModal-autoExit-"+easymodal.autoExit.id, true, { expires : date });
668
+ });
669
+ }
670
+
671
+ // Run our login ajax
672
+ $('#eModal-Login form').on('submit', function(e) {
673
+ $form = $(this);
674
+ // Stop the form from submitting so we can use ajax.
675
+ e.preventDefault();
676
+ // Check what form is currently being submitted so we can return the right values for the ajax request.
677
+ // Display our loading message while we check the credentials.
678
+ $form.append('<p class="message notice">' + easymodal.loadingtext + '</p>');
679
+ // Check if we are trying to login. If so, process all the needed form fields and return a faild or success message.
680
+ $.ajax({
681
+ type: 'POST',
682
+ dataType: 'json',
683
+ url: easymodal.ajaxLogin,
684
+ data: {
685
+ 'action' : 'ajaxlogin', // Calls our wp_ajax_nopriv_ajaxlogin
686
+ 'username' : $('#user_login',$form).val(),
687
+ 'password' : $('#user_pass',$form).val(),
688
+ 'rememberme' : $('#rememberme',$form).is(':checked') ? true : false,
689
+ 'login' : true,
690
+ 'easy-modal' : $('#safe_csrf_nonce_easy_modal',$form).val()
691
+ },
692
+ success: function(results) {
693
+ // Check the returned data message. If we logged in successfully, then let our users know and remove the modal window.
694
+ if(results.loggedin === true) {
695
+ $('p.message',$form).removeClass('notice').addClass('success').text(results.message).show();
696
+ setTimeout(function(){
697
+ $('#eModal-Login').emodal('close',{onClose: function(){
698
+ window.location.href = easymodal.redirecturl;
699
+ }});
700
+
701
+ },2000);
702
+
703
+ } else {
704
+ $('p.message',$form).removeClass('notice').addClass('error').text(results.message).show();
705
+ }
706
+ }
707
+ });
708
+ });
709
+ // Run our register ajax
710
+ $('#eModal-Register form').on('submit', function(e) {
711
+ $form = $(this);
712
+ // Stop the form from submitting so we can use ajax.
713
+ e.preventDefault();
714
+ // Check what form is currently being submitted so we can return the right values for the ajax request.
715
+ // Display our loading message while we check the credentials.
716
+ if(!$('p.message',$form).length)
717
+ {
718
+ $form.append('<p class="message notice">' + easymodal.loadingtext + '</p>');
719
+ }
720
+ // Check if we are trying to login. If so, process all the needed form fields and return a faild or success message.
721
+ if($('#reg_pass',$form).length)
722
+ {
723
+ if($('#reg_pass',$form).val() != $('#reg_confirm',$form).val())
724
+ {
725
+ $('p.message',$form).removeClass('notice').addClass('error').html('Passwords don\'t match.');
726
+ return;
727
+ }
728
+ }
729
+ $.ajax({
730
+ type: 'POST',
731
+ dataType: 'json',
732
+ url: easymodal.ajaxLogin,
733
+ data: {
734
+ 'action' : 'ajaxlogin', // Calls our wp_ajax_nopriv_ajaxlogin
735
+ 'user_login' : $('#reg_user',$form).val(),
736
+ 'user_email' : $('#reg_email',$form).val(),
737
+ 'user_pass' : $('#reg_pass',$form).val(),
738
+ 'register' : true,
739
+ 'easy-modal' : $('#safe_csrf_nonce_easy_modal',$form).val()
740
+ },
741
+ success: function(results) {
742
+ // Check the returned data message. If we logged in successfully, then let our users know and remove the modal window.
743
+ if(results.loggedin === true) {
744
+ $('p.message',$form).removeClass('notice').addClass('success').html(results.message);
745
+ setTimeout(function(){
746
+ $('#eModal-Login').emodal('close',{onClose: function(){
747
+ window.location.href = easymodal.redirecturl;
748
+ }});
749
+
750
+ },2000);
751
+
752
+ } else {
753
+ $('p.message',$form).removeClass('notice').addClass('error').html(results.message);
754
+ }
755
+ }
756
+ });
757
+ });
758
+ // Run our forgot password ajax
759
+ $('#eModal-Forgot form').on('submit', function(e) {
760
+ $form = $(this);
761
+ // Stop the form from submitting so we can use ajax.
762
+ e.preventDefault();
763
+ // Check what form is currently being submitted so we can return the right values for the ajax request.
764
+ // Display our loading message while we check the credentials.
765
+ $form.append('<p class="message notice">' + easymodal.loadingtext + '</p>');
766
+ // Check if we are trying to login. If so, process all the needed form fields and return a faild or success message.
767
+ $.ajax({
768
+ type: 'POST',
769
+ dataType: 'json',
770
+ url: easymodal.ajaxLogin,
771
+ data: {
772
+ 'action' : 'ajaxlogin', // Calls our wp_ajax_nopriv_ajaxlogin
773
+ 'username' : $('#forgot_login',$form).val(),
774
+ 'forgotten' : true,
775
+ 'easy-modal' : $('#safe_csrf_nonce_easy_modal',$form).val()
776
+ },
777
+ success: function(results) {
778
+ // Check the returned data message. If we logged in successfully, then let our users know and remove the modal window.
779
+ if(results.loggedin === true) {
780
+ $('p.message',$form).removeClass('notice').addClass('success').text(results.message).show();
781
+ setTimeout(function(){
782
+ $('#eModal-Login').emodal('close',{onClose: function(){
783
+ window.location.href = easymodal.redirecturl;
784
+ }});
785
+
786
+ },2000);
787
+
788
+ } else {
789
+ $('p.message',$form).removeClass('notice').addClass('error').text(results.message).show();
790
+ }
791
+ }
792
+ });
793
+ });
794
+ /*
795
+ } else if ( form_id === 'register' ) {
796
+ $.ajax({
797
+ type: 'GET',
798
+ dataType: 'json',
799
+ url: wpml_script.ajax,
800
+ data: {
801
+ 'action' : 'ajaxlogin', // Calls our wp_ajax_nopriv_ajaxlogin
802
+ 'username' : $('#form #reg_user').val(),
803
+ 'email' : $('#form #reg_email').val(),
804
+ 'register' : $('#form input[name="register"]').val(),
805
+ 'security' : $('#form #security').val()
806
+ },
807
+ success: function(results) {
808
+ if(results.registerd === true) {
809
+ $('.wpml-content > p.message').removeClass('notice').addClass('success').text(results.message).show();
810
+ $('#register #form input:not(#user-submit)').val('');
811
+ } else {
812
+ $('.wpml-content > p.message').removeClass('notice').addClass('error').text(results.message).show();
813
+ }
814
+ }
815
+ });
816
+ } else if ( form_id === 'forgotten' ) {
817
+ $.ajax({
818
+ type: 'GET',
819
+ dataType: 'json',
820
+ url: wpml_script.ajax,
821
+ data: {
822
+ 'action' : 'ajaxlogin', // Calls our wp_ajax_nopriv_ajaxlogin
823
+ 'username' : $('#form #forgot_login').val(),
824
+ 'forgotten' : $('#form input[name="register"]').val(),
825
+ 'security' : $('#form #security').val()
826
+ },
827
+ success: function(results) {
828
+ if(results.reset === true) {
829
+ $('.wpml-content > p.message').removeClass('notice').addClass('success').text(results.message).show();
830
+ $('#forgotten #form input:not(#user-submit)').val('');
831
+ } else {
832
+ $('.wpml-content > p.message').removeClass('notice').addClass('error').text(results.message).show();
833
+ }
834
+ }
835
+ });
836
+ } else {
837
+ // if all else fails and we've hit here... something strange happen and notify the user.
838
+ $('.wpml-content > p.message').text('Something Please refresh your window and try again.');
839
+ }
840
+ });
841
+
842
+
843
+
844
+
845
+
846
+ /*
847
+ $.expr[':'].external = function (obj)
848
+ {
849
+ return !obj.href.match(/^mailto\:/) && (obj.hostname != location.hostname);
850
+ };
851
+ $('a:external').addClass('external eModal-Link').emodal(easymodal.modals['Link']);
852
+ $('a[href$=".gif"], a[href$=".jpg"], a[href$=".png"], a[href$=".bmp"]').children('img').each(function ()
853
+ {
854
+ var anch = $(this).parents('a').addClass('eModal-Image');
855
+ var url = $(anch).attr('href');
856
+ $(anch).emodal(
857
+ {
858
+ url: url,
859
+ theme: '1',
860
+ type: 'Image'
861
+ });
862
+ });
863
+ if(settings.autoOpen == 'true')
864
+ {
865
+ setTimeout(function(){
866
+ $('#emModal-'+settings.autoOpenId).emodal('open');
867
+ }, settings.autoOpenDelay);
868
+ }
869
+ */
870
+ })
871
+ })(jQuery);
readme.txt CHANGED
@@ -5,8 +5,8 @@ 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.0.2
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.
@@ -22,42 +22,46 @@ Create modals in minutes. Add your favorite shortcodes for contact forms, social
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
28
- * Disable close icon
29
  * Ajax Login, Registration & Forgot Your Password Modals
30
  * Force User Login Modal ( Per Page / Post or Site Wide )
31
  * Set Modal to Auto Open ( Per Page / Post and/or Site Wide )
32
  * Set Modal to Open on Exit ( Per Page / Post and/or Site Wide )
33
  * Export / Import Settings, Modals & Themes
34
- = Premium Support =
35
- * Premium User Support Forum
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
 
45
- To be notified of plugin updates, [follow us on Twitter](http://twitter.com/EasyModal "Wizard Internet Solutions on Twitter")!
46
 
47
  == Installation ==
48
  1. Upload `Easy-Modal` folder to the `/wp-content/plugins/` directory
49
  2. Activate the plugin through the 'Plugins' menu in WordPress
50
  3. Create and customize a modal in the Easy Modal settings page.
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.0.1 =
58
  * Bug
59
  * [EM-63] - Path issue for gravityforms.php and shortcodes.php
60
-
61
  = v1.3 =
62
  * Bug
63
  * [EM-5] - Modal is offcenter on mobile screens
@@ -69,7 +73,6 @@ To be notified of plugin updates, [follow us on Twitter](http://twitter.com/Easy
69
  * [EM-4] - Added Shortcodes
70
  * [EM-48] - Add modal display setting on modal list. Sitewide etc.
71
  * [EM-52] - Move jquery animate color script to its own file and enqueue.
72
-
73
  = v1.2.5 =
74
  * Several changes to the pro version and import from older versions.
75
  = v1.2.2 =
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.9
9
+ Stable tag: 1.3.0.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.
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
+ * Premium User Support Forum
29
+ * Expedited Feature Requests
30
+ * Setup Assistance
31
  * Unlimited Themes
32
+ * Disable Close Icon
33
  * Ajax Login, Registration & Forgot Your Password Modals
34
  * Force User Login Modal ( Per Page / Post or Site Wide )
35
  * Set Modal to Auto Open ( Per Page / Post and/or Site Wide )
36
  * Set Modal to Open on Exit ( Per Page / Post and/or Site Wide )
37
  * Export / Import Settings, Modals & Themes
 
 
 
 
38
 
39
  If you like the plugin please rate it.
40
 
41
+ [Easy Modal Website](http://easy-modal.com "Easy Modal Website") - Examples, Documentation & Pricing
42
 
43
+ [Plugin Developers Site](http://wizardinternetsolutions.com "Web & Plugin Development") - Wizard Internet Solutions
44
 
45
+ To be notified of plugin updates, [follow us on Twitter](https://twitter.com/EasyModal "Easy Modal on Twitter")!
46
 
47
  == Installation ==
48
  1. Upload `Easy-Modal` folder to the `/wp-content/plugins/` directory
49
  2. Activate the plugin through the 'Plugins' menu in WordPress
50
  3. Create and customize a modal in the Easy Modal settings page.
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 element you want to make open the modal window. Will work on divs, links, images, list elements and just about anything else.
 
 
53
 
54
  == Changelog ==
55
+ = v1.3.0.3 =
56
+ * Bug
57
+ * [EM-67] - Modal Custom Height Not Working
58
+ * [EM-69] - Undefined variable: user_login
59
+
60
+ * Improvement
61
+ * [EM-51] - Videos play when modals are closed
62
  = v1.3.0.1 =
63
  * Bug
64
  * [EM-63] - Path issue for gravityforms.php and shortcodes.php
 
65
  = v1.3 =
66
  * Bug
67
  * [EM-5] - Modal is offcenter on mobile screens
73
  * [EM-4] - Added Shortcodes
74
  * [EM-48] - Add modal display setting on modal list. Sitewide etc.
75
  * [EM-52] - Move jquery animate color script to its own file and enqueue.
 
76
  = v1.2.5 =
77
  * Several changes to the pro version and import from older versions.
78
  = v1.2.2 =