Easy Modal - Version 0.9.0.3

Version Description

  • Overlay Click to Close Option
  • Auto Position Option
  • Position Top Option
  • Position Left Option
  • Auto Resize Option
Download this release

Release Info

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

Version 0.9.0.3

content/content.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Easy Modal
4
+ * http://wizardinternetsolutions.com/project/easy-modal/
5
+ */
6
+
7
+ require( '../../../../wp-load.php' );
8
+ global $eM;
9
+ $options = $eM->getAdminOptions();
10
+
11
+ ?>
12
+ <div>
13
+ <div class='eM-content'>
14
+ <h1 class='eM-title'><?php echo $options['title'] ?></h1>
15
+
16
+ <?php echo do_shortcode($options['content']) ?>
17
+ </div>
18
+ </div>
19
+ <?php if(strstr($options['content'],'[contact-form')!= NULL){ ?>
20
+ <?php } ?>
css/easy-modal-admin.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSS Document */
2
+
3
+ .full{width:100%;}
4
+ .half{width:49%;float:left;}
5
+ .half.last{float:right;}
6
+ span.desc{font-weight:normal;font-size:.9em;margin-top:2px;display:block;}
7
+ input[type=radio]{margin:0 5px;}
8
+ input[type=radio]+h5{margin-right: 15px;}
9
+ .submit{border:none; padding:0;margin:5px 0;display:block;clear:both;overflow:auto;}
10
+ input[type=submit]{float:right;}
11
+ h5{display:inline-block;margin:0;}
12
+ h4{margin:10px 0 5px;}
css/easy-modal.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Easy Modal
3
+ * http://wizardinternetsolutions.com/project/easy-modal/
4
+ */
5
+
6
+ /* Overlay */
7
+ #eM-overlay {background-color:#000; cursor:wait;}
8
+
9
+ /* Container */
10
+ #eM-container {font: 16px/22px 'Trebuchet MS', Verdana, Arial; text-align:left; width:450px;}
11
+ .eM-content {background-color:#333; color:#ddd;}
12
+ .eM-title {color:#d76300; font-size:20px; line-height:20px; margin:0; padding:0 0 6px 12px; text-align:left;}
css/easy-modal.css.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ header("Content-type: text/css; charset: UTF-8");
4
+ /*
5
+
6
+ * Easy Modal
7
+
8
+ * http://wizardinternetsolutions.com/project/easy-modal/
9
+
10
+ */
11
+
12
+
13
+
14
+ /* Overlay */
15
+
16
+ echo '#eM-overlay {background-color:#000; cursor:wait;}';
17
+
18
+
19
+
20
+ /* Container */
21
+
22
+ #eM-container {font: 16px/22px 'Trebuchet MS', Verdana, Arial; text-align:left; width:450px;}
23
+
24
+ echo '.eM-content {background-color:#333; color:#ddd;}';
25
+
26
+ echo '.eM-title {color:#d76300; font-size:20px; line-height:20px; margin:0; padding:0 0 6px 12px; text-align:left;}';
27
+
28
+ ?>
easy-modal.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+
5
+ Plugin Name: Easy Modal
6
+
7
+ Plugin URI: http://wizardinternetsolutions.com/plugins/easy-modal/
8
+
9
+ Description: Easy Modal allows you to easily add just about any shortcodes or other content into a modal window. This includes forms such as CF7.
10
+
11
+ Author: Wizard Internet Solutions
12
+
13
+ Version: 0.9.0.3
14
+
15
+ Author URI: http://wizardinternetsolutions.com
16
+
17
+ */
18
+ require_once('includes/easy-modal.class.php');
19
+
20
+ $eM = new easy_modal;
21
+
22
+ add_action('wp_print_styles', 'easy_modal_styles');
23
+ add_action( 'admin_init', 'easy_modal_styles' );
24
+
25
+ function easy_modal_styles()
26
+
27
+ {
28
+
29
+ $em_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
30
+
31
+
32
+
33
+ if (!is_admin()) {
34
+
35
+ //wp_enqueue_style('easy-modal-style', $em_plugin_url.'/css/easy-modal.css');
36
+ wp_enqueue_style('easy-modal-style', $em_plugin_url.'/css/easy-modal.css.php');
37
+
38
+ } else {
39
+
40
+ //wp_enqueue_style('farbtastic');
41
+ wp_enqueue_style('easy-modal-admin-style', $em_plugin_url.'/css/easy-modal-admin.css');
42
+
43
+ }
44
+
45
+ }
46
+
47
+ add_action('wp_print_scripts', 'easy_modal_scripts');
48
+
49
+ add_action( 'admin_init', 'easy_modal_styles' );
50
+
51
+ function easy_modal_scripts()
52
+
53
+ {
54
+
55
+ global $eM;
56
+
57
+ $options = $eM->getAdminOptions();
58
+
59
+ $em_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
60
+
61
+ if (!is_admin()) {
62
+
63
+ wp_enqueue_script('jquery');
64
+
65
+ wp_enqueue_script('jquery-form', array('jquery'));
66
+
67
+ wp_enqueue_script('jquery-simplemodal', $em_plugin_url.'/js/jquery.simplemodal.js', array('jquery'));
68
+
69
+ //wp_enqueue_script('easy-modal-script', $em_plugin_url.'/js/easy-modal.js', array('jquery','jquery-simplemodal'));
70
+
71
+ wp_enqueue_script('easy-modal-script', $em_plugin_url.'/js/easy-modal.js.php', array('jquery','jquery-simplemodal'));
72
+
73
+ wp_localize_script( 'easy-modal-script', 'eMSettings', array(
74
+
75
+ 'plugin_url' => $em_plugin_url,
76
+
77
+ // Overlay Options
78
+
79
+ 'overlayId' => $options['overlayId'],
80
+
81
+ 'overlayColor' => $options['overlayColor'],
82
+
83
+ 'overlayCss' => $options['overlayCss'],
84
+
85
+ 'opacity' => $options['opacity'],
86
+
87
+ 'overlayClose' => $options['overlayClose'],
88
+
89
+ // Container Options
90
+
91
+ 'containerId' => $options['containerId'],
92
+
93
+ 'autoResize' => $options['autoResize'],
94
+
95
+ 'autoPosition' => $options['autoPosition'],
96
+
97
+ 'positionX' => $options['positionX'],
98
+
99
+ 'positionY' => $options['positionY'],
100
+
101
+ 'minHeight' => $options['minHeight'],
102
+
103
+ 'maxHeight' => $options['maxHeight'],
104
+
105
+ 'minWidth' => $options['minWidth'],
106
+
107
+ 'maxWidth' => $options['maxWidth'],
108
+
109
+ // Content Options
110
+
111
+ 'cf7form' => $options['cf7form'],
112
+
113
+
114
+
115
+ ));
116
+
117
+ } else {
118
+
119
+ wp_enqueue_script( 'farbtastic' );
120
+
121
+ }
122
+
123
+ }
124
+
125
+
126
+ //Initialize the admin panel
127
+ add_action('admin_menu', 'easy_modal_ap');
128
+
129
+ if (!function_exists("easy_modal_ap")) {
130
+
131
+ function easy_modal_ap() {
132
+
133
+ global $eM;
134
+
135
+ if (!isset($eM)) {
136
+
137
+ return;
138
+
139
+ }
140
+
141
+ if (function_exists('add_options_page')) {
142
+
143
+ add_options_page('Easy Modal', 'Easy Modal', 10, basename(__FILE__), array(&$eM, 'printAdminPage'));
144
+
145
+ }
146
+
147
+ }
148
+
149
+ }
150
+
151
+ // Display a Settings link on the main Plugins page
152
+
153
+ add_filter( 'plugin_action_links', 'easy_modal_plugin_action_links', 10, 2 );
154
+
155
+ function easy_modal_plugin_action_links( $links, $file ) {
156
+
157
+ if ( $file == plugin_basename( __FILE__ ) ) {
158
+
159
+ $posk_links = '<a href="'.get_admin_url().'options-general.php?page=easy-modal.php">'.__('Settings').'</a>';
160
+
161
+ // make the 'Settings' link appear first
162
+
163
+ array_unshift( $links, $posk_links );
164
+
165
+ }
166
+
167
+ return $links;
168
+
169
+ }
170
+
171
+
172
+ // Initialize i18n Support
173
+
174
+ add_action( 'init', 'easy_modal_i18n' );
175
+
176
+ if(!function_exists(easy_modal_i18n)){
177
+
178
+ function easy_modal_i18n() {
179
+
180
+ load_plugin_textdomain( 'easy-modal', false, 'easy-modal/languages' );
181
+
182
+ }
183
+
184
+ }
185
+
186
+ register_activation_hook(__FILE__, array(&$eM, 'init'));
187
+
188
+ ?>
images/admin/color_selector.png ADDED
Binary file
includes/easy-modal.class.php ADDED
@@ -0,0 +1,396 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ global $wp;
4
+
5
+ class easy_modal {
6
+
7
+ var $adminOptionsName = "easy_modalOptions";
8
+
9
+ //Returns an array of admin options
10
+
11
+ function getAdminOptions() {
12
+
13
+ $easy_modalAdminOptions = array(
14
+
15
+ 'title' => '',
16
+
17
+ 'content' => '',
18
+
19
+ 'overlayId' => 'eM-overlay',
20
+
21
+ 'overlayColor' => '#000000',
22
+
23
+ 'opacity' => '50',
24
+
25
+ 'overlayCss' => '',
26
+
27
+ 'overlayClose' => true,
28
+
29
+ 'containerId' => 'eM-container',
30
+
31
+ 'autoResize' => false,
32
+
33
+ 'autoPosition' => true,
34
+
35
+ 'positionX' => '',
36
+
37
+ 'positionY' => '',
38
+
39
+ 'minHeight' => '50%',
40
+
41
+ 'maxHeight' => '75%',
42
+
43
+ 'minWidth' => '30%',
44
+
45
+ 'maxWidth' => '50%',
46
+
47
+ 'cf7form' => false,
48
+
49
+ );
50
+
51
+ $eMOptions = get_option($this->adminOptionsName);
52
+
53
+ if (!empty($eMOptions)) {
54
+
55
+ foreach ($eMOptions as $key => $option)
56
+
57
+ $easy_modalAdminOptions[$key] = $option;
58
+
59
+ }
60
+
61
+ update_option($this->adminOptionsName, $easy_modalAdminOptions);
62
+
63
+ return $easy_modalAdminOptions;
64
+
65
+ }
66
+
67
+ // Plugin Initialization
68
+
69
+ function init() {
70
+
71
+ $this->getAdminOptions();
72
+
73
+ }
74
+
75
+ //Prints out the admin page
76
+
77
+ function printAdminPage() {
78
+
79
+ $eM_Options = $this->getAdminOptions();
80
+
81
+ if (isset($_POST['update_eM_settings'])) {
82
+
83
+ if (isset($_POST['eM_title'])) {
84
+
85
+ $eM_Options['title'] = apply_filters('content_save_pre', $_POST['eM_title']);
86
+
87
+ }
88
+
89
+ if (isset($_POST['eM_content'])) {
90
+
91
+ if(strstr($_POST['eM_content'],'[contact-form')!= NULL){ $eM_Options['cf7form'] = true; }
92
+
93
+ else { $eM_Options['cf7form'] = false; }
94
+
95
+ $eM_Options['content'] = $_POST['eM_content'];
96
+
97
+ }
98
+ // Validate Overlay Options
99
+ if (isset($_POST['eM_overlayId'])) {
100
+
101
+ $eM_Options['overlayId'] = $_POST['eM_overlayId'];
102
+
103
+ }
104
+
105
+ if (isset($_POST['eM_overlayColor'])) {
106
+
107
+ //hex color is valid
108
+
109
+ if(preg_match('/^#[a-f0-9]{6}$/i', $_POST['eM_overlayColor'])){
110
+
111
+ $eM_Options['overlayColor'] = $_POST['eM_overlayColor'];
112
+
113
+ }
114
+
115
+ }
116
+
117
+ if (isset($_POST['eM_opacity'])) {
118
+
119
+ if ($_POST['eM_opacity']>=0 && $_POST['eM_opacity']<=100){
120
+
121
+ $eM_Options['opacity'] = $_POST['eM_opacity'];
122
+
123
+ }
124
+
125
+ }
126
+
127
+ if (isset($_POST['eM_overlayCss'])) {
128
+
129
+ $eM_Options['overlayCss'] = $_POST['eM_overlayCss'];
130
+
131
+ }
132
+
133
+ if (isset($_POST['eM_overlayClose'])) {
134
+
135
+ if ($_POST['eM_overlayClose'] == 'true') $eM_Options['overlayClose'] = true;
136
+ else $eM_Options['overlayClose'] = false;
137
+
138
+ }
139
+
140
+ // Validate Container Options
141
+ if (isset($_POST['eM_containerId'])) {
142
+
143
+ $eM_Options['containerId'] = $_POST['eM_containerId'];
144
+
145
+ }
146
+
147
+ if (isset($_POST['eM_autoResize'])) {
148
+
149
+ if ($_POST['eM_autoResize'] == 'true') $eM_Options['autoResize'] = true;
150
+ else $eM_Options['autoResize'] = false;
151
+
152
+ }
153
+
154
+
155
+ if (isset($_POST['eM_autoPosition'])) {
156
+
157
+ if ($_POST['eM_autoPosition'] == 'true') $eM_Options['autoPosition'] = true;
158
+ else $eM_Options['autoPosition'] = false;
159
+
160
+ }
161
+
162
+ if (isset($_POST['eM_positionX'])) {
163
+
164
+ $eM_Options['positionX'] = $_POST['eM_positionX'];
165
+
166
+ }
167
+
168
+
169
+ if (isset($_POST['eM_positionY'])) {
170
+
171
+ $eM_Options['positionY'] = $_POST['eM_positionY'];
172
+
173
+ }
174
+
175
+ if (isset($_POST['eM_minHeight'])) {
176
+
177
+ if(($_POST['eM_minHeight']!='')){
178
+
179
+ $eM_Options['minHeight'] = $_POST['eM_minHeight'];
180
+
181
+ } else {
182
+
183
+ $eM_Options['minHeight'] = '50%';
184
+
185
+ }
186
+
187
+
188
+ }
189
+
190
+ if (isset($_POST['eM_maxHeight'])) {
191
+
192
+ if(($_POST['eM_maxHeight']!='')){
193
+
194
+ $eM_Options['maxHeight'] = $_POST['eM_maxHeight'];
195
+
196
+ } else {
197
+
198
+ $eM_Options['maxHeight'] = '75%';
199
+
200
+ }
201
+
202
+
203
+ }
204
+
205
+ if (isset($_POST['eM_minWidth'])) {
206
+
207
+ if(($_POST['eM_minWidth']!='')){
208
+
209
+ $eM_Options['minWidth'] = $_POST['eM_minWidth'];
210
+
211
+ } else {
212
+
213
+ $eM_Options['minWidth'] = '30%';
214
+
215
+ }
216
+
217
+
218
+ }
219
+
220
+ if (isset($_POST['eM_maxWidth'])) {
221
+
222
+ if(($_POST['eM_maxWidth']!='')){
223
+
224
+ $eM_Options['maxWidth'] = $_POST['eM_maxWidth'];
225
+
226
+ } else {
227
+
228
+ $eM_Options['maxWidth'] = '50%';
229
+
230
+ }
231
+
232
+
233
+ }
234
+
235
+ $eM_Options = stripslashes_deep($eM_Options);
236
+
237
+ update_option($this->adminOptionsName, $eM_Options);?>
238
+
239
+ <div class="updated"><strong><?php _e('Settings Updated','easy-modal')?>.</strong></div><?php
240
+
241
+ } ?>
242
+
243
+ <div id="poststuff" class="metabox-holder has-right-sidebar wrap">
244
+
245
+ <div id="side-info-column" class="inner-sidebar">
246
+
247
+ </div>
248
+
249
+ <div id="post-body">
250
+
251
+ <div id="post-body-content">
252
+
253
+ <form method="post" action="<?php echo $_SERVER["REQUEST_URI"];?>">
254
+
255
+ <h2><?php _e('Easy Modal','easy-modal')?></h2>
256
+
257
+ <div class="postbox full">
258
+
259
+ <h3><?php _e('Modal','easy-modal')?></h3>
260
+
261
+ <div class="inside">
262
+
263
+ <label for="eM_title"><h4><?php _e('Title','easy-modal')?><span class="desc"><?php _e('The title that appears in the modal window.','easy-modal')?></span></h4></label>
264
+
265
+ <input type="text" id="eM_title" name="eM_title" value="<?php echo $eM_Options['title'];?>" />
266
+
267
+ <label for="eM_content"><h4><?php _e('Content','easy-modal');?><span class="desc"><?php _e('Modal content. Can contain shortcodes.','easy-modal')?></span></h4></label>
268
+
269
+ <textarea id="eM_content" name="eM_content" style="width: 100%; height: auto;"><?php echo $eM_Options['content']?></textarea>
270
+
271
+ <div class="submit">
272
+
273
+ <input type="submit" name="update_eM_settings" class="button-primary" value="<?php _e('Save Settings','easy-modal')?>" />
274
+
275
+ </div>
276
+
277
+ </div>
278
+
279
+ </div>
280
+
281
+ <div class="postbox half">
282
+
283
+ <h3><?php _e('Container Options','easy-modal')?></h3>
284
+
285
+ <div class="inside">
286
+
287
+ <h4><label for="eM_containerId"><?php _e('Container Id','easy-modal')?><span class="desc"><?php _e('The CSS Id for the container.','easy-modal')?></span></label></h4>
288
+ <input type="text" id="eM_containerId" name="eM_containerId" value="<?php echo $eM_Options['containerId']?>" />
289
+
290
+ <h4><?php _e('Auto Position','easy-modal')?><span class="desc"><?php _e('Automatically position the container upon creation and on window resize?','easy-modal')?></span></h4>
291
+ <input type="radio" id="eM_autoPosition1" name="eM_autoPosition" value="false" <?php echo $eM_Options['autoPosition'] == false ? 'checked="checked"' : '' ?> />
292
+ <h5><label for="eM_autoPosition1"><?php _e('False','easy-modal')?></label></h5>
293
+ <input type="radio" id="eM_autoPosition2" name="eM_autoPosition" value="true" <?php echo $eM_Options['autoPosition'] == true ? 'checked="checked"' : '' ?> />
294
+ <h5><label for="eM_autoPosition2"><?php _e('True','easy-modal')?></span></label></h5>
295
+
296
+ <h4><?php _e('Position','easy-modal')?><span class="desc"><?php _e('Position of container. Can be number of pixels (px) or percentage (%).','easy-modal')?></span></h4>
297
+ <h5><label for="eM_positionX"><?php _e('Top','easy-modal')?>:</label></h5>
298
+ <input type="text" id="eM_positionX" name="eM_positionX" value="<?php echo $eM_Options['positionX']?>" />
299
+ <h5><label for="eM_positionY"><?php _e('Left','easy-modal')?>:</label></h5>
300
+ <input type="text" id="eM_positionY" name="eM_positionY" value="<?php echo $eM_Options['positionY']?>" />
301
+
302
+ <h4><?php _e('Auto Resize','easy-modal')?><span class="desc"><?php _e('Resize the container if it exceeds the browser window dimensions?','easy-modal')?></span></h4>
303
+ <input type="radio" id="eM_autoResize1" name="eM_autoResize" value="false" <?php echo $eM_Options['autoResize'] == false ? 'checked="checked"' : '' ?> />
304
+ <h5><label for="eM_autoResize1"><?php _e('False','easy-modal')?></label></h5>
305
+ <input type="radio" id="eM_autoResize2" name="eM_autoResize" value="true" <?php echo $eM_Options['autoResize'] == true ? 'checked="checked"' : '' ?> />
306
+ <h5><label for="eM_autoResize2"><?php _e('True','easy-modal')?></label></h5>
307
+
308
+ <h4><?php _e('Height','easy-modal')?><span class="desc"><?php _e('The height for the container.','easy-modal')?></span></h4>
309
+ <h5><label for="eM_minHeight"><?php _e('Min','easy-modal')?>:</label></h5>
310
+ <input type="text" id="eM_minHeight" name="eM_minHeight" value="<?php echo $eM_Options['minHeight']?>" />
311
+ <h5><label for="eM_maxHeight"><?php _e('Max','easy-modal')?>:</label></h5>
312
+ <input type="text" id="eM_maxHeight" name="eM_maxHeight" value="<?php echo $eM_Options['maxHeight']?>" />
313
+
314
+ <h4><?php _e('Width','easy-modal')?><span class="desc"><?php _e('The width of the container.','easy-modal')?></span></h4>
315
+ <h5><label for="eM_minWidth"><?php _e('Min','easy-modal')?>:</label></h5>
316
+ <input type="text" id="eM_minWidth" name="eM_minWidth" value="<?php echo $eM_Options['minWidth']?>" />
317
+ <h5><label for="eM_maxWidth"><?php _e('Max','easy-modal')?>:</label></h5>
318
+ <input type="text" id="eM_maxWidth" name="eM_maxWidth" value="<?php echo $eM_Options['maxWidth']?>" />
319
+
320
+ <div class="submit">
321
+
322
+ <input type="submit" name="update_eM_settings" class="button-primary" value="<?php _e('Save Settings','easy-modal')?>" />
323
+
324
+ </div>
325
+
326
+ </div>
327
+
328
+ </div>
329
+
330
+ <div class="postbox half last">
331
+
332
+ <h3><?php _e('Overlay Options','easy-modal')?></h3>
333
+
334
+ <div class="inside">
335
+
336
+ <h4><label for="eM_overlayId"><?php _e('Overlay Id','easy-modal')?><span class="desc"><?php _e('Choose the CSS Id for the overlay.','easy-modal')?></span></label></h4>
337
+ <input type="text" id="eM_overlayId" name="eM_overlayId" value="<?php echo $eM_Options['overlayId']?>" />
338
+
339
+ <h4><label for="colorSelector"><?php _e('Overlay Color', 'easy-modal');?><span class="desc"><?php _e('Choose the overlay color.','easy-modal')?></span></label></h4>
340
+ <input type="hidden" name="eM_overlayColor" value="<?php echo $eM_Options['overlayColor']?>" />
341
+ <div id="colorSelector" style="height:28px;position:relative;width:28px;">
342
+ <div style="background: url('<?php echo WP_PLUGIN_URL.'/' ?>easy-modal/images/admin/color_selector.png') no-repeat center center transparent;background-color:<?php echo $eM_Options['overlayColor']?>;height: 28px;width: 28px;"></div>
343
+ </div>
344
+ <script type="text/javascript">
345
+ jQuery(document).ready(function() {
346
+ jQuery('#colorSelector').ColorPicker({
347
+ color: '<?php echo $eM_Options['overlayColor']?>',
348
+ onShow: function (colpkr) {
349
+ jQuery(colpkr).fadeIn(500);
350
+ return false;
351
+ },
352
+ onHide: function (colpkr) {
353
+ jQuery(colpkr).fadeOut(500);
354
+ return false;
355
+ },
356
+ onChange: function (hsb, hex, rgb) {
357
+ jQuery('#colorSelector div').css('backgroundColor', '#' + hex);
358
+ jQuery('input[name=eM_overlayColor]').val('#' + hex);
359
+ }
360
+ });
361
+ });
362
+ </script>
363
+
364
+ <h4><label for="eM_opacity"><?php _e('Opacity', 'easy-modal');?><span class="desc"><?php _e('The opacity value for the overlay, from 0 - 100.','easy-modal')?></span></label></h4>
365
+ <input type="text" id="eM_opacity" name="eM_opacity" value="<?php echo $eM_Options['opacity']?>" />
366
+
367
+ <h4><?php _e('Close on Click','easy-modal')?><span class="desc"><?php _e('Allow click on overlay to close the dialog?','easy-modal')?></span></h4>
368
+ <input type="radio" id="eM_overlayClose1" name="eM_overlayClose" value="false" <?php echo $eM_Options['overlayClose'] == false ? 'checked="checked"' : '' ?> />
369
+ <label for="eM_overlayClose1"><?php _e('False','easy-modal')?></label>
370
+ <input type="radio" id="eM_overlayClose2" name="eM_overlayClose" value="true" <?php echo $eM_Options['overlayClose'] == true ? 'checked="checked"' : '' ?> />
371
+ <label for="eM_overlayClose2"><?php _e('True','easy-modal')?></label>
372
+
373
+ <div class="submit">
374
+
375
+ <input type="submit" name="update_eM_settings" class="button-primary" value="<?php _e('Save Settings','easy-modal')?>" />
376
+
377
+ </div>
378
+
379
+ </div>
380
+
381
+ </div>
382
+
383
+ </form>
384
+
385
+ </div>
386
+
387
+ </div>
388
+
389
+ </div><?php
390
+
391
+ }//End function printAdminPage()
392
+
393
+
394
+ }
395
+
396
+ ?>
js/easy-modal.js.php ADDED
@@ -0,0 +1,497 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ header("content-type: application/x-javascript");
4
+
5
+ /*
6
+
7
+ * Easy Modal
8
+
9
+ * http://wizardinternetsolutions.com/project/easy-modal/
10
+
11
+ */
12
+
13
+
14
+ echo <<<JS
15
+
16
+ eM_plugin_url = convertEntities(eMSettings.plugin_url);
17
+
18
+ eM_overlayId = convertEntities(eMSettings.overlayId);
19
+
20
+ eM_overlayColor = convertEntities(eMSettings.overlayColor);
21
+
22
+ eM_opacity = convertEntities(eMSettings.opacity);
23
+
24
+ eM_overlayClose = convertEntities(eMSettings.overlayClose);
25
+
26
+ eM_containerId = convertEntities(eMSettings.containerId);
27
+
28
+ eM_autoResize = convertEntities(eMSettings.autoResize);
29
+
30
+ eM_autoPosition = convertEntities(eMSettings.autoPosition);
31
+
32
+ eM_positionX = convertEntities(eMSettings.positionX);
33
+
34
+ eM_positionY = convertEntities(eMSettings.positionY);
35
+
36
+ eM_minHeight = convertEntities(eMSettings.minHeight);
37
+
38
+ eM_maxHeight = convertEntities(eMSettings.maxHeight);
39
+
40
+ eM_minWidth = convertEntities(eMSettings.minWidth);
41
+
42
+ eM_maxWidth = convertEntities(eMSettings.maxWidth);
43
+
44
+
45
+
46
+
47
+
48
+ eM_cf7form = convertEntities(eMSettings.cf7form);
49
+
50
+
51
+
52
+
53
+
54
+ jQuery(function ($) {
55
+
56
+ var contact = {
57
+
58
+ message: null,
59
+
60
+ init: function () {
61
+
62
+ $('.eModal').click(function (e) {
63
+
64
+ e.preventDefault();
65
+
66
+ // load the contact form using ajax
67
+
68
+
69
+
70
+ $.get("/wp-content/plugins/easy-modal/content/content.php?plugin_url=" + eM_plugin_url, function(data){
71
+
72
+ // create a modal dialog with the data
73
+
74
+ $(data).modal({
75
+
76
+ closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>",
77
+
78
+ position: ["15%",],
79
+
80
+ overlayId: eM_overlayId,
81
+
82
+ overlayCss: {backgroundColor:eM_overlayColor},
83
+
84
+ opacity : eM_opacity,
85
+
86
+ overlayClose: eM_overlayClose,
87
+
88
+ containerId: eM_containerId,
89
+
90
+ autoResize: eM_autoResize,
91
+
92
+ autoPosition: eM_autoPosition,
93
+
94
+ position: [eM_positionX, eM_positionY],
95
+
96
+ minHeight: eM_minHeight,
97
+
98
+ maxHeight: eM_maxHeight,
99
+
100
+ minWidth: eM_minWidth,
101
+
102
+ maxWidth: eM_maxWidth,
103
+
104
+ onOpen: contact.open,
105
+
106
+ onShow: contact.show,
107
+
108
+ onClose: contact.close
109
+
110
+ });
111
+
112
+ });
113
+
114
+ });
115
+
116
+ },
117
+
118
+ open: function (dialog) {
119
+
120
+ // add padding to the buttons in firefox/mozilla
121
+
122
+ if ($.browser.mozilla) {
123
+
124
+ $('#eM-container .contact-button').css({
125
+
126
+ 'padding-bottom': '2px'
127
+
128
+ });
129
+
130
+ }
131
+
132
+ // input field font size
133
+
134
+ if ($.browser.safari) {
135
+
136
+ $('#eM-container .contact-input').css({
137
+
138
+ 'font-size': '.9em'
139
+
140
+ });
141
+
142
+ }
143
+
144
+
145
+
146
+ // dynamically determine height
147
+
148
+ var h = 280;
149
+
150
+ if ($('#eM-subject').length) {
151
+
152
+ h += 26;
153
+
154
+ }
155
+
156
+ if ($('#eM-cc').length) {
157
+
158
+ h += 22;
159
+
160
+ }
161
+
162
+
163
+
164
+ var title = $('#eM-container .contact-title').html();
165
+
166
+ $('#eM-container .contact-title').html('Loading...');
167
+
168
+ dialog.overlay.fadeIn(200, function () {
169
+
170
+ dialog.container.fadeIn(200, function () {
171
+
172
+ dialog.data.fadeIn(200, function () {
173
+
174
+ $('#eM-container .contact-content').animate({
175
+
176
+ height: h
177
+
178
+ }, function () {
179
+
180
+ $('#eM-container .contact-title').html(title);
181
+
182
+ $('#eM-container form').fadeIn(200, function () {
183
+
184
+ $('#eM-container #eM-name').focus();
185
+
186
+
187
+
188
+ $('#eM-container .contact-cc').click(function () {
189
+
190
+ var cc = $('#eM-container #eM-cc');
191
+
192
+ cc.is(':checked') ? cc.attr('checked', '') : cc.attr('checked', 'checked');
193
+
194
+ });
195
+
196
+
197
+
198
+ // fix png's for IE 6
199
+
200
+ if ($.browser.msie && $.browser.version < 7) {
201
+
202
+ $('#eM-container .contact-button').each(function () {
203
+
204
+ if ($(this).css('backgroundImage').match(/^url[("']+(.*\.png)[)"']+$/i)) {
205
+
206
+ var src = RegExp.$1;
207
+
208
+ $(this).css({
209
+
210
+ backgroundImage: 'none',
211
+
212
+ filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src + '", sizingMethod="crop")'
213
+
214
+ });
215
+
216
+ }
217
+
218
+ });
219
+
220
+ }
221
+
222
+ });
223
+
224
+ });
225
+
226
+ });
227
+
228
+ });
229
+
230
+ });
231
+
232
+ },
233
+
234
+ show: function (dialog) {
235
+
236
+ if(eM_cf7form == true){
237
+
238
+ $('div.wpcf7 > form').ajaxForm({
239
+
240
+
241
+
242
+ beforeSubmit: function(formData, jqForm, options) {
243
+
244
+
245
+
246
+ jqForm.wpcf7ClearResponseOutput();
247
+
248
+
249
+
250
+ jqForm.find('img.ajax-loader').css({ visibility: 'visible' });
251
+
252
+
253
+
254
+ return true;
255
+
256
+
257
+
258
+ },
259
+
260
+
261
+
262
+ beforeSerialize: function(jqForm, options) {
263
+
264
+
265
+
266
+ jqForm.find('.wpcf7-use-title-as-watermark.watermark').each(function(i, n) {
267
+
268
+
269
+
270
+ $(n).val('');
271
+
272
+
273
+
274
+
275
+ });
276
+
277
+
278
+
279
+ return true;
280
+
281
+
282
+
283
+ },
284
+
285
+
286
+
287
+ data: { '_wpcf7_is_ajax_call': 1 },
288
+
289
+
290
+
291
+ dataType: 'json',
292
+
293
+
294
+
295
+ success: function(data) {
296
+
297
+
298
+
299
+ var ro = $(data.into).find('div.wpcf7-response-output');
300
+
301
+
302
+
303
+ $(data.into).wpcf7ClearResponseOutput();
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+ if (data.invalids) {
312
+
313
+
314
+
315
+ $.each(data.invalids, function(i, n) {
316
+
317
+
318
+
319
+ $(data.into).find(n.into).wpcf7NotValidTip(n.message);
320
+
321
+
322
+
323
+ });
324
+
325
+
326
+
327
+ ro.addClass('wpcf7-validation-errors');
328
+
329
+
330
+
331
+ }
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+ if (data.captcha)
340
+
341
+
342
+
343
+ $(data.into).wpcf7RefillCaptcha(data.captcha);
344
+
345
+
346
+
347
+
348
+
349
+
350
+
351
+ if (data.quiz)
352
+
353
+
354
+
355
+ $(data.into).wpcf7RefillQuiz(data.quiz);
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+ if (1 == data.spam)
364
+
365
+
366
+
367
+ ro.addClass('wpcf7-spam-blocked');
368
+
369
+
370
+
371
+
372
+
373
+
374
+
375
+ if (1 == data.mailSent) {
376
+
377
+
378
+
379
+ $(data.into).find('form').resetForm().clearForm();
380
+
381
+
382
+
383
+ ro.addClass('wpcf7-mail-sent-ok');
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+ if (data.onSentOk)
392
+
393
+
394
+
395
+ $.each(data.onSentOk, function(i, n) { eval(n) });
396
+
397
+
398
+
399
+ } else {
400
+
401
+
402
+
403
+ ro.addClass('wpcf7-mail-sent-ng');
404
+
405
+
406
+
407
+ }
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+ if (data.onSubmit)
416
+
417
+
418
+
419
+ $.each(data.onSubmit, function(i, n) { eval(n) });
420
+
421
+
422
+
423
+
424
+
425
+
426
+
427
+ $(data.into).find('.wpcf7-use-title-as-watermark.watermark').each(function(i, n) {
428
+
429
+
430
+
431
+ $(n).val($(n).attr('title'));
432
+
433
+
434
+
435
+ });
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+ ro.append(data.message).slideDown('fast');
444
+
445
+
446
+
447
+ }
448
+
449
+
450
+
451
+ });
452
+
453
+ }
454
+
455
+ },
456
+
457
+ close: function (dialog) {
458
+
459
+ $('#eM-container').fadeOut();
460
+
461
+ $('#eM-container .eM-content').animate({
462
+
463
+ height: 40
464
+
465
+ }, function () {
466
+
467
+ dialog.data.fadeOut(200, function () {
468
+
469
+ dialog.container.fadeOut(200, function () {
470
+
471
+ dialog.overlay.fadeOut(200, function () {
472
+
473
+ $.modal.close();
474
+
475
+ });
476
+
477
+ });
478
+
479
+ });
480
+
481
+ });
482
+
483
+ },
484
+
485
+ };
486
+
487
+
488
+
489
+ contact.init();
490
+
491
+
492
+
493
+ });
494
+
495
+ JS;
496
+
497
+ ?>
js/jquery.simplemodal.js ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * SimpleModal 1.4.1 - jQuery Plugin
3
+ * http://www.ericmmartin.com/projects/simplemodal/
4
+ * Copyright (c) 2010 Eric Martin (http://twitter.com/ericmmartin)
5
+ * Dual licensed under the MIT and GPL licenses
6
+ * Revision: $Id: jquery.simplemodal.js 259 2010-11-05 05:53:13Z emartin24 $
7
+ */
8
+ (function(d){var k=d.browser.msie&&parseInt(d.browser.version)===6&&typeof window.XMLHttpRequest!=="object",m=d.browser.msie&&parseInt(d.browser.version)===7,l=null,f=[];d.modal=function(a,b){return d.modal.impl.init(a,b)};d.modal.close=function(){d.modal.impl.close()};d.modal.focus=function(a){d.modal.impl.focus(a)};d.modal.setContainerDimensions=function(){d.modal.impl.setContainerDimensions()};d.modal.setPosition=function(){d.modal.impl.setPosition()};d.modal.update=function(a,b){d.modal.impl.update(a,
9
+ b)};d.fn.modal=function(a){return d.modal.impl.init(this,a)};d.modal.defaults={appendTo:"body",focus:true,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:false,autoPosition:true,zIndex:1E3,close:true,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",escClose:true,overlayClose:false,position:null,
10
+ persist:false,modal:true,onOpen:null,onShow:null,onClose:null};d.modal.impl={d:{},init:function(a,b){var c=this;if(c.d.data)return false;l=d.browser.msie&&!d.boxModel;c.o=d.extend({},d.modal.defaults,b);c.zIndex=c.o.zIndex;c.occb=false;if(typeof a==="object"){a=a instanceof jQuery?a:d(a);c.d.placeholder=false;if(a.parent().parent().size()>0){a.before(d("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"}));c.d.placeholder=true;c.display=a.css("display");if(!c.o.persist)c.d.orig=
11
+ a.clone(true)}}else if(typeof a==="string"||typeof a==="number")a=d("<div></div>").html(a);else{alert("SimpleModal Error: Unsupported data type: "+typeof a);return c}c.create(a);c.open();d.isFunction(c.o.onShow)&&c.o.onShow.apply(c,[c.d]);return c},create:function(a){var b=this;f=b.getDimensions();if(b.o.modal&&k)b.d.iframe=d('<iframe src="javascript:false;"></iframe>').css(d.extend(b.o.iframeCss,{display:"none",opacity:0,position:"fixed",height:f[0],width:f[1],zIndex:b.o.zIndex,top:0,left:0})).appendTo(b.o.appendTo);
12
+ b.d.overlay=d("<div></div>").attr("id",b.o.overlayId).addClass("simplemodal-overlay").css(d.extend(b.o.overlayCss,{display:"none",opacity:b.o.opacity/100,height:b.o.modal?f[0]:0,width:b.o.modal?f[1]:0,position:"fixed",left:0,top:0,zIndex:b.o.zIndex+1})).appendTo(b.o.appendTo);b.d.container=d("<div></div>").attr("id",b.o.containerId).addClass("simplemodal-container").css(d.extend(b.o.containerCss,{display:"none",position:"fixed",zIndex:b.o.zIndex+2})).append(b.o.close&&b.o.closeHTML?d(b.o.closeHTML).addClass(b.o.closeClass):
13
+ "").appendTo(b.o.appendTo);b.d.wrap=d("<div></div>").attr("tabIndex",-1).addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(b.d.container);b.d.data=a.attr("id",a.attr("id")||b.o.dataId).addClass("simplemodal-data").css(d.extend(b.o.dataCss,{display:"none"})).appendTo("body");b.setContainerDimensions();b.d.data.appendTo(b.d.wrap);if(k||l)b.fixIE()},bindEvents:function(){var a=this;d("."+a.o.closeClass).bind("click.simplemodal",function(b){b.preventDefault();a.close()});
14
+ a.o.modal&&a.o.close&&a.o.overlayClose&&a.d.overlay.bind("click.simplemodal",function(b){b.preventDefault();a.close()});d(document).bind("keydown.simplemodal",function(b){if(a.o.modal&&b.keyCode===9)a.watchTab(b);else if(a.o.close&&a.o.escClose&&b.keyCode===27){b.preventDefault();a.close()}});d(window).bind("resize.simplemodal",function(){f=a.getDimensions();a.o.autoResize?a.setContainerDimensions():a.o.autoPosition&&a.setPosition();if(k||l)a.fixIE();else if(a.o.modal){a.d.iframe&&a.d.iframe.css({height:f[0],
15
+ width:f[1]});a.d.overlay.css({height:f[0],width:f[1]})}})},unbindEvents:function(){d("."+this.o.closeClass).unbind("click.simplemodal");d(document).unbind("keydown.simplemodal");d(window).unbind("resize.simplemodal");this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var a=this,b=a.o.position;d.each([a.d.iframe||null,!a.o.modal?null:a.d.overlay,a.d.container],function(c,h){if(h){var g=h[0].style;g.position="absolute";if(c<2){g.removeExpression("height");g.removeExpression("width");g.setExpression("height",
16
+ 'document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight + "px"');g.setExpression("width",'document.body.scrollWidth > document.body.clientWidth ? document.body.scrollWidth : document.body.clientWidth + "px"')}else{var e;if(b&&b.constructor===Array){c=b[0]?typeof b[0]==="number"?b[0].toString():b[0].replace(/px/,""):h.css("top").replace(/px/,"");c=c.indexOf("%")===-1?c+' + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"':
17
+ parseInt(c.replace(/%/,""))+' * ((document.documentElement.clientHeight || document.body.clientHeight) / 100) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"';if(b[1]){e=typeof b[1]==="number"?b[1].toString():b[1].replace(/px/,"");e=e.indexOf("%")===-1?e+' + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"':parseInt(e.replace(/%/,""))+' * ((document.documentElement.clientWidth || document.body.clientWidth) / 100) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"'}}else{c=
18
+ '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"';e='(document.documentElement.clientWidth || document.body.clientWidth) / 2 - (this.offsetWidth / 2) + (t = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) + "px"'}g.removeExpression("top");g.removeExpression("left");g.setExpression("top",
19
+ c);g.setExpression("left",e)}}})},focus:function(a){var b=this;a=a&&d.inArray(a,["first","last"])!==-1?a:"first";var c=d(":input:enabled:visible:"+a,b.d.wrap);setTimeout(function(){c.length>0?c.focus():b.d.wrap.focus()},10)},getDimensions:function(){var a=d(window);return[d.browser.opera&&d.browser.version>"9.5"&&d.fn.jquery<"1.3"||d.browser.opera&&d.browser.version<"9.5"&&d.fn.jquery>"1.2.6"?a[0].innerHeight:a.height(),a.width()]},getVal:function(a,b){return a?typeof a==="number"?a:a==="auto"?0:
20
+ a.indexOf("%")>0?parseInt(a.replace(/%/,""))/100*(b==="h"?f[0]:f[1]):parseInt(a.replace(/px/,"")):null},update:function(a,b){var c=this;if(!c.d.data)return false;c.d.origHeight=c.getVal(a,"h");c.d.origWidth=c.getVal(b,"w");c.d.data.hide();a&&c.d.container.css("height",a);b&&c.d.container.css("width",b);c.setContainerDimensions();c.d.data.show();c.o.focus&&c.focus();c.unbindEvents();c.bindEvents()},setContainerDimensions:function(){var a=this,b=k||m,c=a.d.origHeight?a.d.origHeight:d.browser.opera?
21
+ a.d.container.height():a.getVal(b?a.d.container[0].currentStyle.height:a.d.container.css("height"),"h");b=a.d.origWidth?a.d.origWidth:d.browser.opera?a.d.container.width():a.getVal(b?a.d.container[0].currentStyle.width:a.d.container.css("width"),"w");var h=a.d.data.outerHeight(true),g=a.d.data.outerWidth(true);a.d.origHeight=a.d.origHeight||c;a.d.origWidth=a.d.origWidth||b;var e=a.o.maxHeight?a.getVal(a.o.maxHeight,"h"):null,i=a.o.maxWidth?a.getVal(a.o.maxWidth,"w"):null;e=e&&e<f[0]?e:f[0];i=i&&i<
22
+ f[1]?i:f[1];var j=a.o.minHeight?a.getVal(a.o.minHeight,"h"):"auto";c=c?a.o.autoResize&&c>e?e:c<j?j:c:h?h>e?e:a.o.minHeight&&j!=="auto"&&h<j?j:h:j;e=a.o.minWidth?a.getVal(a.o.minWidth,"w"):"auto";b=b?a.o.autoResize&&b>i?i:b<e?e:b:g?g>i?i:a.o.minWidth&&e!=="auto"&&g<e?e:g:e;a.d.container.css({height:c,width:b});a.d.wrap.css({overflow:h>c||g>b?"auto":"visible"});a.o.autoPosition&&a.setPosition()},setPosition:function(){var a=this,b,c;b=f[0]/2-a.d.container.outerHeight(true)/2;c=f[1]/2-a.d.container.outerWidth(true)/
23
+ 2;if(a.o.position&&Object.prototype.toString.call(a.o.position)==="[object Array]"){b=a.o.position[0]||b;c=a.o.position[1]||c}else{b=b;c=c}a.d.container.css({left:c,top:b})},watchTab:function(a){var b=this;if(d(a.target).parents(".simplemodal-container").length>0){b.inputs=d(":input:enabled:visible:first, :input:enabled:visible:last",b.d.data[0]);if(!a.shiftKey&&a.target===b.inputs[b.inputs.length-1]||a.shiftKey&&a.target===b.inputs[0]||b.inputs.length===0){a.preventDefault();b.focus(a.shiftKey?"last":
24
+ "first")}}else{a.preventDefault();b.focus()}},open:function(){var a=this;a.d.iframe&&a.d.iframe.show();if(d.isFunction(a.o.onOpen))a.o.onOpen.apply(a,[a.d]);else{a.d.overlay.show();a.d.container.show();a.d.data.show()}a.o.focus&&a.focus();a.bindEvents()},close:function(){var a=this;if(!a.d.data)return false;a.unbindEvents();if(d.isFunction(a.o.onClose)&&!a.occb){a.occb=true;a.o.onClose.apply(a,[a.d])}else{if(a.d.placeholder){var b=d("#simplemodal-placeholder");if(a.o.persist)b.replaceWith(a.d.data.removeClass("simplemodal-data").css("display",
25
+ a.display));else{a.d.data.hide().remove();b.replaceWith(a.d.orig)}}else a.d.data.hide().remove();a.d.container.hide().remove();a.d.overlay.hide();a.d.iframe&&a.d.iframe.hide().remove();setTimeout(function(){a.d.overlay.remove();a.d={}},10)}}}})(jQuery);
readme.txt ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Easy Modal ===
2
+ Contributors: danieliser
3
+ Donate link: http://wizardinternetsolutions.com/
4
+ Tags: modal, contact form 7, ajax
5
+ Requires at least: 3.0.1
6
+ Tested up to: 3.1.3
7
+ Stable tag: 0.9.0.3
8
+
9
+ This plugin allows you to easily add a Modal window with just about any content. It accepts shortcodes and has been tested to work with Contact Form 7 custom forms using ajax submission.
10
+
11
+
12
+
13
+ == Description ==
14
+
15
+ This plugin allows you to easily add a Modal window with just about any content. It accepts shortcodes and has been tested to work with Contact Form 7 custom forms using ajax submission.
16
+
17
+ v0.9.0.4 comes with a basic theme to style default CF7 Form. See Screenshots.
18
+
19
+ If you like the plugin please rate it.
20
+
21
+
22
+ [easyModal Page](http://wizardinternetsolutions.com/plugins/easy-modal/ "easyModal Page - Info, Demo and Discussion") - Info, Demo and Feature Discussion
23
+
24
+ [Wizard Internet Solutions](http://wizardinternetsolutions.com/ "Website Design & Development") - Developers Site
25
+
26
+ == Installation ==
27
+
28
+ 1. Upload `easy-Modal` folder to the `/wp-content/plugins/` directory
29
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
30
+ 3. Add `eModal` class to the object you want to make activate the modal window. Will work on divs, links, list elements and just about anything else.
31
+ 4. You will also need to add a minimum height and width in the settings. This will be fixed shortly.
32
+
33
+ == Frequently Asked Questions ==
34
+
35
+ = The screen changes but my modal never shows. =
36
+
37
+ This is usually because the width and height are not set. Try checking the settings page in the admin area to see if there is a minimum width and height.
38
+
39
+ = Does this work with CF7 =
40
+
41
+ Yes, this will work with any custom form shortcode and uses ajax submit features.
42
+
43
+ = Is the form styled =
44
+
45
+ We have only included some basic styling for the modal at this point. We will be adding more features to customize the look and feel of the plugin and modal windows in upcoming versions. For now you can add styles to your themes styles.css or add them to the head via plugin.
46
+
47
+ == Screenshots ==
48
+
49
+ 1. Easy Modal with default "Contact Fom 7" form.
50
+ 2. Shows CF7 Inline validation used during ajax submit
51
+
52
+ == Changelog ==
53
+
54
+ = 0.9.0.3 =
55
+ * Overlay Click to Close Option
56
+ * Auto Position Option
57
+ * Position Top Option
58
+ * Position Left Option
59
+ * Auto Resize Option
60
+
61
+ = 0.9.0.2 =
62
+ * Added Overlay Color Picker.
63
+
64
+ = 0.9.0.1 =
65
+ * Added Height & Width options.
66
+
67
+ = 0.9 =
68
+ * Initial Release
69
+
70
+
71
+ == Upgrade Notice ==
72
+
73
+ = 0.9 =
74
+ * Initial Release
themes/default/close.png ADDED
Binary file