Embed Any Document - Version 2.2.1

Version Description

Download this release

Release Info

Developer awsmin
Plugin Icon Embed Any Document
Version 2.2.1
Comparing to
See all releases

Code changes from version 1.0.1 to 2.2.1

aswm-embed.php CHANGED
@@ -3,10 +3,12 @@
3
  Plugin Name: Embed Any Document
4
  Plugin URI: http://awsm.in/embed-any-documents
5
  Description: Embed Any Document WordPress plugin lets you upload and embed your documents easily in your WordPress website without any additional browser plugins like Flash or Acrobat reader. The plugin lets you choose between Google Docs Viewer and Microsoft Office Online to display your documents.
6
- Version: 1.0.1
7
  Author: Awsm Innovations
8
  Author URI: http://awsm.in
9
  License: GPL V3
 
 
10
  */
11
  require_once( dirname( __FILE__ ) . '/inc/functions.php');
12
  class Awsm_embed {
@@ -15,8 +17,9 @@ class Awsm_embed {
15
  private $plugin_url;
16
  private $plugin_base;
17
  private $plugin_file;
 
18
  private $settings_slug;
19
- private $text_domain = 'ead';
20
  /**
21
  * Creates or returns an instance of this class.
22
  */
@@ -38,6 +41,7 @@ class Awsm_embed {
38
  $this->plugin_base = dirname( plugin_basename( __FILE__ ) );
39
  $this->plugin_file = __FILE__ ;
40
  $this->settings_slug = 'ead-settings';
 
41
 
42
  load_plugin_textdomain($this->text_domain, false,$this->plugin_base . '/language' );
43
 
@@ -54,13 +58,15 @@ class Awsm_embed {
54
  add_action( 'wp_ajax_validateurl',array( $this, 'validateurl' ));
55
  //ajax Contact Form
56
  add_action( 'wp_ajax_supportform',array( $this, 'supportform' ));
 
 
57
  $this->run_plugin();
58
  }
59
  /**
60
  * Register admin Settings style
61
  */
62
  function setting_styles(){
63
- wp_register_style( 'embed-settings', plugins_url( 'css/settings.css', $this->plugin_file ), false, '1.0', 'all' );
64
  wp_enqueue_style('embed-settings');
65
  }
66
  /**
@@ -107,43 +113,100 @@ class Awsm_embed {
107
  * Embed Form popup
108
  */
109
  function embedpopup(){
110
- if (!current_user_can('manage_options')) {
111
- wp_die(__('You do not have sufficient permissions to access this page.'));
112
- }
113
  include($this->plugin_path.'inc/popup.php');
114
  }
115
  /**
116
  * Register admin scripts
117
  */
118
  function embed_helper(){
119
- wp_register_style( 'magnific-popup', plugins_url( 'css/magnific-popup.css', $this->plugin_file ), false, '0.9.9', 'all' );
120
- wp_register_style( 'embed-css', plugins_url( 'css/embed.css', $this->plugin_file ), false, '1.0', 'all' );
121
- wp_register_script( 'magnific-popup', plugins_url( 'js/magnific-popup.js', $this->plugin_file ), array( 'jquery' ), '0.9.9', true );
122
- wp_register_script( 'embed', plugins_url( 'js/embed.js', $this->plugin_file ), array( 'jquery' ), '0.9.9', true );
123
  wp_localize_script('embed','emebeder', array(
124
- 'default_height' => get_option('ead_height', '500px' ),
125
- 'default_width' => get_option('ead_width', '100%' ),
126
- 'download' => get_option('ead_download', 'none' ),
127
- 'provider' => get_option('ead_provider', 'none' ),
128
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
129
  'validtypes' => ead_validembedtypes(),
 
 
130
  'nocontent' => __('Nothing to insert', $this->text_domain),
 
131
  'addurl' => __('Add URL', $this->text_domain),
132
  'verify' => __('Verifying...', $this->text_domain),
133
  ) );
134
- wp_enqueue_style('magnific-popup');
135
- wp_enqueue_script( 'magnific-popup' );
136
  wp_enqueue_style('embed-css');
137
  wp_enqueue_script( 'embed' );
138
  }
139
  /**
140
  * Shortcode Functionality
141
  */
142
- function embed_shortcode( $atts){
143
- $embedcode = "";
144
- $embedcode = ead_getprovider($atts);
145
- return $embedcode;
146
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
 
148
  /**
149
  * Admin menu setup
@@ -164,16 +227,14 @@ class Awsm_embed {
164
  function register_eadsettings() {
165
  register_setting( 'ead-settings-group', 'ead_width' ,'ead_sanitize_dims');
166
  register_setting( 'ead-settings-group', 'ead_height','ead_sanitize_dims' );
167
- register_setting( 'ead-settings-group', 'ead_download' );
168
  register_setting( 'ead-settings-group', 'ead_provider' );
 
 
169
  }
170
  /**
171
  * Ajax validate file url
172
  */
173
  function validateurl(){
174
- if (!current_user_can('manage_options')) {
175
- wp_die(__('You do not have sufficient permissions to access this page.'));
176
- }
177
  $fileurl = $_POST['furl'];
178
  echo json_encode(ead_validateurl($fileurl));
179
  die(0);
@@ -198,20 +259,9 @@ class Awsm_embed {
198
  */
199
  function adminfunctions(){
200
  if(is_admin()){
201
- add_filter('media_send_to_editor', array($this,'ead_media_insert'), 10, 3 );
202
  add_filter('upload_mimes', array($this,'additional_mimes'));
203
  }
204
  }
205
- /**
206
- * Adds shortcode for supported media
207
- */
208
- function ead_media_insert( $html, $id, $attachment ) {
209
- if ( ead_validType( $attachment['url'] )) {
210
- return '[embeddoc url="' . $attachment['url'] . '"]';
211
- } else {
212
- return $html;
213
- }
214
- }
215
  /**
216
  * Adds additional mimetype for meadi uploader
217
  */
@@ -221,6 +271,34 @@ class Awsm_embed {
221
  'ai' => 'application/postscript',
222
  ));
223
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  }
225
 
226
  Awsm_embed::get_instance();
3
  Plugin Name: Embed Any Document
4
  Plugin URI: http://awsm.in/embed-any-documents
5
  Description: Embed Any Document WordPress plugin lets you upload and embed your documents easily in your WordPress website without any additional browser plugins like Flash or Acrobat reader. The plugin lets you choose between Google Docs Viewer and Microsoft Office Online to display your documents.
6
+ Version: 2.2.1
7
  Author: Awsm Innovations
8
  Author URI: http://awsm.in
9
  License: GPL V3
10
+ Text Domain: embed-any-document
11
+ Domain Path: /language
12
  */
13
  require_once( dirname( __FILE__ ) . '/inc/functions.php');
14
  class Awsm_embed {
17
  private $plugin_url;
18
  private $plugin_base;
19
  private $plugin_file;
20
+ private $plugin_version;
21
  private $settings_slug;
22
+ private $text_domain = 'embed-any-document';
23
  /**
24
  * Creates or returns an instance of this class.
25
  */
41
  $this->plugin_base = dirname( plugin_basename( __FILE__ ) );
42
  $this->plugin_file = __FILE__ ;
43
  $this->settings_slug = 'ead-settings';
44
+ $this->plugin_version = '2.2.1';
45
 
46
  load_plugin_textdomain($this->text_domain, false,$this->plugin_base . '/language' );
47
 
58
  add_action( 'wp_ajax_validateurl',array( $this, 'validateurl' ));
59
  //ajax Contact Form
60
  add_action( 'wp_ajax_supportform',array( $this, 'supportform' ));
61
+ //default options
62
+ register_activation_hook($this->plugin_file, array( $this, 'ead_defaults' ));
63
  $this->run_plugin();
64
  }
65
  /**
66
  * Register admin Settings style
67
  */
68
  function setting_styles(){
69
+ wp_register_style( 'embed-settings', plugins_url( 'css/settings.css', $this->plugin_file ), false,$this->plugin_version, 'all' );
70
  wp_enqueue_style('embed-settings');
71
  }
72
  /**
113
  * Embed Form popup
114
  */
115
  function embedpopup(){
116
+ add_thickbox();
 
 
117
  include($this->plugin_path.'inc/popup.php');
118
  }
119
  /**
120
  * Register admin scripts
121
  */
122
  function embed_helper(){
123
+ wp_register_style( 'embed-css', plugins_url( 'css/embed.css', $this->plugin_file ), false, $this->plugin_version, 'all' );
124
+ wp_register_script( 'embed', plugins_url( 'js/embed.js', $this->plugin_file ), array( 'jquery' ),$this->plugin_version, true );
 
 
125
  wp_localize_script('embed','emebeder', array(
126
+ 'height' => get_option('ead_height', '500px'),
127
+ 'width' => get_option('ead_width', '100%'),
128
+ 'download' => get_option('ead_download', 'none'),
129
+ 'provider' => get_option('ead_provider', 'google'),
130
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
131
  'validtypes' => ead_validembedtypes(),
132
+ 'msextension' => ead_validextensions('ms'),
133
+ 'drextension' => ead_validextensions('all'),
134
  'nocontent' => __('Nothing to insert', $this->text_domain),
135
+ 'invalidurl' => __('Invalid URL', $this->text_domain),
136
  'addurl' => __('Add URL', $this->text_domain),
137
  'verify' => __('Verifying...', $this->text_domain),
138
  ) );
 
 
139
  wp_enqueue_style('embed-css');
140
  wp_enqueue_script( 'embed' );
141
  }
142
  /**
143
  * Shortcode Functionality
144
  */
145
+ function embed_shortcode($atts) {
146
+ $embed = "";
147
+ $durl = "";
148
+ $default_width = ead_sanitize_dims(get_option('ead_width', '100%'));
149
+ $default_height = ead_sanitize_dims(get_option('ead_height', '500px'));
150
+ $default_provider = get_option('ead_provider', 'google');
151
+ $default_download = get_option('ead_download', 'none');
152
+ $show = false;
153
+ extract(shortcode_atts(array('url' => '',
154
+ 'drive' => '',
155
+ 'width' => $default_width,
156
+ 'height' => $default_height,
157
+ 'language' => 'en',
158
+ 'viewer' => $default_provider,
159
+ 'download' => $default_download), $atts));
160
+ if(isset($atts['provider']))
161
+ $viewer = $atts['provider'];
162
+ if(!isset($atts['provider']) AND !isset($atts['viewer']))
163
+ $viewer = 'google';
164
+ if ($url):
165
+ $filedata = wp_remote_head($url);
166
+ $durl = '';
167
+ $privatefile = '';
168
+ if (ead_allowdownload($viewer)) if ($download == 'alluser' or $download == 'all') {
169
+ $show = true;
170
+ } elseif ($download == 'logged' AND is_user_logged_in()) {
171
+ $show = true;
172
+ }
173
+ if ($show) {
174
+ $filesize = 0;
175
+ $url = esc_url($url, array('http', 'https'));
176
+ if (!is_wp_error($filedata) && isset($filedata['headers']['content-length'])) {
177
+ $filesize = ead_human_filesize($filedata['headers']['content-length']);
178
+ } else {
179
+ $filesize = 0;
180
+ }
181
+ $fileHtml = '';
182
+ if ($filesize) $fileHtml = ' [' . $filesize . ']';
183
+ $durl = '<p class="embed_download"><a href="' . $url . '" download >' . __('Download', $this->text_domain) . $fileHtml . ' </a></p>';
184
+ }
185
+
186
+ $url = esc_url($url, array('http', 'https'));
187
+ $providerList = array('google', 'microsoft');
188
+ if (!in_array($viewer, $providerList)) $viewer = 'google';
189
+ switch ($viewer) {
190
+ case 'google':
191
+ $embedsrc = '//docs.google.com/viewer?url=%1$s&embedded=true&hl=%2$s';
192
+ $iframe = sprintf($embedsrc, urlencode($url), esc_attr($language));
193
+ break;
194
+
195
+ case 'microsoft':
196
+ $embedsrc = '//view.officeapps.live.com/op/embed.aspx?src=%1$s';
197
+ $iframe = sprintf($embedsrc, urlencode($url));
198
+ break;
199
+ }
200
+ $style = 'style="width:%1$s; height:%2$s; border: none;"';
201
+ $stylelink = sprintf($style, ead_sanitize_dims($width), ead_sanitize_dims($height));
202
+ $iframe = '<iframe src="' . $iframe . '" ' . $stylelink . '></iframe>';
203
+ $show = false;
204
+ $embed = '<div class="ead-document">' . $iframe . $privatefile . $durl . '</div>';
205
+ else:
206
+ $embed = __('No Url Found', $this->text_domain);
207
+ endif;
208
+ return $embed;
209
+ }
210
 
211
  /**
212
  * Admin menu setup
227
  function register_eadsettings() {
228
  register_setting( 'ead-settings-group', 'ead_width' ,'ead_sanitize_dims');
229
  register_setting( 'ead-settings-group', 'ead_height','ead_sanitize_dims' );
 
230
  register_setting( 'ead-settings-group', 'ead_provider' );
231
+ register_setting( 'ead-settings-group', 'ead_download' );
232
+ register_setting( 'ead-settings-group', 'ead_mediainsert' );
233
  }
234
  /**
235
  * Ajax validate file url
236
  */
237
  function validateurl(){
 
 
 
238
  $fileurl = $_POST['furl'];
239
  echo json_encode(ead_validateurl($fileurl));
240
  die(0);
259
  */
260
  function adminfunctions(){
261
  if(is_admin()){
 
262
  add_filter('upload_mimes', array($this,'additional_mimes'));
263
  }
264
  }
 
 
 
 
 
 
 
 
 
 
265
  /**
266
  * Adds additional mimetype for meadi uploader
267
  */
271
  'ai' => 'application/postscript',
272
  ));
273
  }
274
+ /**
275
+ * To get Overlay link
276
+ */
277
+ function providerlink($keys, $id, $provider) {
278
+ $link = 'http://goo.gl/wJTQlc';
279
+ $id = "";
280
+ $configure = '<span class="overlay"><strong>' . __('Buy Pro Version', $this->text_domain) . '</strong><i></i></span>';
281
+ $target = 'target="_blank"';
282
+ echo '<a href="' . $link . '" id="' . $id . '" ' . $target . '><span><img src="' . $this->plugin_url . 'images/icon-' . strtolower($provider) . '.png" alt="Add From ' . $provider . '" />' . __('Add from ' . $provider, $this->text_domain) . $configure . '</span></a>';
283
+ }
284
+ /**
285
+ * To initialize default options
286
+ */
287
+ function ead_defaults()
288
+ {
289
+ $o = array(
290
+ 'ead_width' => '100%',
291
+ 'ead_height' => '500px',
292
+ 'ead_download' => 'none',
293
+ 'ead_provider' => 'google',
294
+ 'ead_mediainsert' => '1',
295
+ );
296
+ foreach ( $o as $k => $v )
297
+ {
298
+ if(!get_option($k)) update_option($k, $v);
299
+ }
300
+ return;
301
+ }
302
  }
303
 
304
  Awsm_embed::get_instance();
css/embed.css CHANGED
@@ -1,140 +1,268 @@
1
- .clear{
2
- clear: both;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  }
4
- #embed-popup-wrap { display: none;
5
- width: 85%;
6
- margin:0 auto; }
7
  #embed-popup {
8
- position: relative;
9
- width: 100%;
10
- max-width: 1000px;
11
- margin: 28px auto 100px;
12
- padding: 20px;
13
- background: #fff;
14
- -webkit-box-shadow: 0 2px 25px #000;
15
- -moz-box-shadow: 0 2px 25px #000;
16
- box-shadow: 0 2px 25px #000;
17
- -webkit-transition: max-width .2s;
18
- -moz-transition: max-width .2s;
19
- transition: max-width .2s;
20
- -moz-box-sizing: border-box;
21
- -webkit-box-sizing: border-box;
22
- box-sizing: border-box;
23
- }
24
-
25
- .section {
26
- margin: 0 0 30px;
27
- }
28
- ul.tabs {
29
- height: 33px;
30
- line-height: 25px;
31
- list-style: none;
32
- border-bottom: 1px solid #DDD;
33
- background: none;
34
- padding: 0px;
35
- margin: 20px 0 0;
36
- }
37
- .tabs li {
38
- float: left;
39
- display: inline;
40
- margin: 0 1px 0 0;
41
- padding: 4px 13px;
42
- color: #777;
43
- cursor: pointer;
44
- background: #F9F9F9;
45
- border: 1px solid #E4E4E4;
46
- border-bottom: 0 solid #F9F9F9;
47
- position: relative;
48
- height: auto !important ;
49
- line-height: inherit !important;
50
- }
51
- .tabs li:hover,
52
- .vertical .tabs li:hover {
53
- }
54
- .tabs li.current {
55
- color: #444;
56
- background: #EFEFEF;
57
- border: 1px solid #D4D4D4;
58
- border-bottom: 0 solid #EFEFEF;
59
- }
60
- .upload-success{border: 1px solid #D4D4D4;background: #EFEFEF;
61
-
62
- min-height: 70px;}
63
- .upload-success .inner{padding: 30px;}
64
- .box {
65
- display: none;
66
- border: 1px solid #D4D4D4;
67
- border-width: 0 1px 1px;
68
- background: #EFEFEF;
69
- padding: 30px;
70
- min-height: 70px;
71
- }
72
- .box.visible {
73
- display: block;
74
- }
75
- .box label{
76
- display: block;
77
- font-size: 12px;
78
- margin-bottom: 5px;
79
- }
80
- .uploaded-doccument{
81
- padding:5px 0 5px 70px;
82
- background: url(../images/icon-success.png) no-repeat 0 0;
83
- color: #454545;
84
- font-size: 13px;
85
- float: left; margin-right: 20px;
86
- }
87
- .wp-core-ui .button#adv_options{ float: right; height: 40px; line-height: 38px; font-size: 13px; padding:0 20px; }
88
- .uploaded-doccument p{
89
- font-weight: bold; font-size: 16px; margin: 0 0 3px;
90
- }
91
- input.input-group-text{ padding:5px 8px; height: 40px; min-width: 60%; }
92
- .wp-core-ui .button-primary.input-group-btn{ padding:5px 10px; height: 40px; }
93
- .advanced_options{display: none; border-top:1px solid #ccc; padding: 0 30px }
94
- body.mfp-shown .mfp-bg { z-index: 101000 !important; }
95
- body.mfp-shown .mfp-wrap { z-index: 101001 !important; }
96
- body.mfp-shown .mfp-preloader { z-index: 101002 !important; }
97
- body.mfp-shown .mfp-content { z-index: 101003 !important; }
98
- body.mfp-shown button.mfp-close,
99
- body.mfp-shown button.mfp-arrow { z-index: 101004 !important; }
100
- .wp-core-ui .ead-btn.button-large{
101
- padding: 0 30px;
102
- height: 54px;
103
- line-height: 52px;
104
- font-size: 16px;
105
- }
106
- .wp-core-ui .ead-btn.button-medium{
107
- padding:0 15px;
108
- height: 36px;
109
- line-height: 34px;
110
- font-size: 14px;
111
- }
112
- .text-center{
113
- text-align: center;
114
- }
115
- .mfp-close{
116
- position: absolute;
117
- right: 10px;
118
- top:10px;
119
- font-weight: bold;
120
- background: url(../images/icon-close.png)!important;
121
- width: 22px;
122
- height: 22px;
123
- display: block;
124
- text-indent: -9999999px;
125
- }
126
- .mfp-close{
127
 
128
  }
129
- .upload-success{
130
- display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  }
132
  div.awsm-error, div.awsm-updated {
133
  margin: 5px 0 2px;
134
  border-width: 1px 1px 1px 4px;
135
  border-style: solid;
136
  -webkit-border-radius: 4px;
137
- border-radius: 4px;
138
  }
139
  div.awsm-updated {
140
  background-color: #fff;
@@ -150,28 +278,84 @@ div.awsm-error p, div.awsm-updated p {
150
  margin: 0.5em 0;
151
  padding: 2px;
152
  }
153
- .hidden{
154
- display:none;
155
  }
156
- .mceActionPanel{ margin:20px 0 0;}
157
-
158
- .option-fields{
159
- list-style-type: none;
160
- margin:0;
161
- padding:30px 0 0;
162
- }
163
- .option-fields li{
164
- padding-bottom: 15px;
165
- }
166
- .option-fields label{ display:block; margin-bottom: 5px; font-weight: bold;}
167
- .f-left{
168
- float:left;
169
- }
170
- .f-left.middle{ margin:0 25px; }
171
- .clear{ clear:both;}
172
- .input-small{ width:60px;}
173
- .box .urlerror{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  border-color: #D95B5B;
175
  -webkit-box-shadow: 0 0 2px rgba(190, 30, 30, 0.8);
176
  box-shadow: 0 0 2px rgba(190, 30, 30, 0.8);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  }
1
+ #embed-popup-wrap {
2
+ display: none;
3
+ width: 85%;
4
+ margin: 0 auto;
5
+ }
6
+ .ead-popup-on #TB_window{
7
+ background: none;
8
+ box-shadow: none;
9
+ -webkit-box-shadow: none;
10
+ }
11
+ .ead-popup-on #TB_ajaxContent{
12
+ text-align: center;
13
+ }
14
+ .ead-popup-on #TB_ajaxContent:after{
15
+ content: "";
16
+ display: inline-block;
17
+ width: 1px;
18
+ height: 100%;
19
+ vertical-align: middle;
20
  }
 
 
 
21
  #embed-popup {
22
+ position: relative;
23
+ width: 99%;
24
+ max-width: 1000px;
25
+ background: #fff;
26
+ -moz-box-sizing: border-box;
27
+ -webkit-box-sizing: border-box;
28
+ box-sizing: border-box;
29
+ display: inline-block;
30
+ vertical-align: middle;
31
+ -webkit-box-shadow: 0 2px 25px #000;
32
+ -moz-box-shadow: 0 2px 25px #000;
33
+ box-shadow: 0 2px 25px #000;
34
+ text-align: left;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  }
37
+ .ead-popup-header{
38
+ padding: 20px 30px;
39
+ }
40
+ .ead-popup-header h1{
41
+ margin: 0;
42
+ line-height: 1.3;
43
+ }
44
+ .ead-section {
45
+ padding: 0 30px;
46
+ border-top: 1px solid #ebebeb;
47
+ }
48
+ .ead-action-panel{
49
+ padding: 20px 30px;
50
+ background: #f5f5f5;
51
+ border-top: 1px solid #ebebeb;
52
+ }
53
+ ul.ead-options {
54
+ padding: 30px 0;
55
+ overflow: hidden;
56
+ margin: 0px;
57
+ }
58
+ .ead-options li {
59
+ float: left;
60
+ width: 20%;
61
+ padding: 0 10px;
62
+ -moz-box-sizing: border-box;
63
+ -webkit-box-sizing: border-box;
64
+ box-sizing: border-box;
65
+ }
66
+ .ead-options li a {
67
+ display: block;
68
+ text-decoration: none;
69
+ color: rgb(33, 33, 33);
70
+ }
71
+ .ead-options li span {
72
+ border: 2px dotted #ccc;
73
+ -webkit-border-radius: 4px;
74
+ border-radius: 4px;
75
+ display: block;
76
+ padding: 30px 10px 20px;
77
+ text-align: center;
78
+ position: relative;
79
+ }
80
+ .ead-options li img {
81
+ display: block;
82
+ margin: 0 auto 10px;
83
+ }
84
+ .ead-options li span span.overlay {
85
+ border: none;
86
+ -webkit-border-radius: 0;
87
+ border-radius: 0;
88
+ padding: 0;
89
+ width: 100%;
90
+ height: 100%;
91
+ position: absolute;
92
+ left: 0;
93
+ top: 0;
94
+ background: rgba(255, 255, 255, 0.7);
95
+ }
96
+ .ead-options .overlay strong {
97
+ display: inline-block;
98
+ max-width: 97%;
99
+ vertical-align: middle;
100
+ opacity: 0;
101
+ -webkit-transition: all 0.3s ease;
102
+ -moz-transition: all 0.3s ease;
103
+ -ms-transition: all 0.3s ease;
104
+ -o-transition: all 0.3s ease;
105
+ transition: all 0.3s ease;
106
+ }
107
+ .ead-options li span:hover {
108
+ box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
109
+ -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
110
+ }
111
+ .ead-options li:hover .overlay strong {
112
+ opacity: 1;
113
+ }
114
+ .ead-options .overlay i {
115
+ display: inline-block;
116
+ height: 100%;
117
+ width: 1px;
118
+ vertical-align: middle;
119
+ }
120
+ .upload-success {
121
+ min-height: 70px;
122
+ overflow: hidden;
123
+ }
124
+ .upload-success .inner {
125
+ padding: 30px 10px;
126
+ -moz-box-sizing: border-box;
127
+ -webkit-box-sizing: border-box;
128
+ box-sizing: border-box;
129
+ float: left;
130
+ width: 20%;
131
+ }
132
+ .box {
133
+ display: none;
134
+ border: 2px dotted #ccc;
135
+ -webkit-border-radius: 4px;
136
+ border-radius: 4px;
137
+ padding: 20px;
138
+ margin: 30px 0;
139
+ }
140
+ a.go-back {
141
+ display: inline-block;
142
+ margin-top: 20px;
143
+ text-decoration: none;
144
+ }
145
+ .box label {
146
+ display: block;
147
+ font-size: 12px;
148
+ margin-bottom: 5px;
149
+ }
150
+ .uploaded-doccument {
151
+ padding: 75px 0 5px;
152
+ color: #454545;
153
+ font-size: 13px;
154
+ word-wrap: break-word;
155
+ text-align: center;
156
+ }
157
+ .uploaded-doccument.ead-link {
158
+ background: url(../images/icon-link.png) no-repeat center 5px / 36px 49px;
159
+ }
160
+ .uploaded-doccument.ead-upload {
161
+ background: url(../images/icon-upload.png) no-repeat center 5px / 54px 49px;
162
+ }
163
+ .uploaded-doccument.ead-dropbox {
164
+ background: url(../images/icon-dropbox.png) no-repeat center 5px / 51px 49px;
165
+ }
166
+ .uploaded-doccument.ead-drive {
167
+ background: url(../images/icon-drive.png) no-repeat center 5px / 48px 49px;
168
+ }
169
+ .uploaded-doccument.ead-box {
170
+ background: url(../images/icon-box.png) no-repeat center 5px / 54px 49px;
171
+ }
172
+ .wp-core-ui .button#adv_options {
173
+ float: right;
174
+ height: 40px;
175
+ line-height: 38px;
176
+ font-size: 13px;
177
+ padding: 0 20px;
178
+ }
179
+ .uploaded-doccument p {
180
+ font-weight: bold;
181
+ font-size: 16px;
182
+ margin: 0 0 3px;
183
+ }
184
+ input.input-group-text {
185
+ padding: 5px 8px;
186
+ height: 40px;
187
+ min-width: 88%;
188
+ }
189
+ .wp-core-ui .button-primary.input-group-btn {
190
+ padding: 5px 10px;
191
+ height: 40px;
192
+ }
193
+ .advanced_options {
194
+ padding: 30px;
195
+ -moz-box-sizing: border-box;
196
+ -webkit-box-sizing: border-box;
197
+ box-sizing: border-box;
198
+ float: left;
199
+ width: 70%;
200
+ border-left: 1px solid #ebebeb;
201
+ }
202
+ .advanced_options h3 {
203
+ margin-top: 0px
204
+ }
205
+ .advanced_options h3 span {
206
+ color: #aaa;
207
+ font-weight: normal;
208
+ }
209
+ body.mfp-shown .mfp-bg {
210
+ z-index: 1010;
211
+ }
212
+ body.mfp-shown .mfp-wrap {
213
+ z-index: 1011;
214
+ }
215
+ body.mfp-shown .mfp-preloader {
216
+ z-index: 1012;
217
+ }
218
+ body.mfp-shown .mfp-content {
219
+ z-index: 1013;
220
+ }
221
+ body.mfp-shown button.mfp-close, body.mfp-shown button.mfp-arrow {
222
+ z-index: 1014;
223
+ }
224
+ .wp-core-ui .ead-btn.button-large {
225
+ padding: 0 30px;
226
+ height: 54px;
227
+ line-height: 52px;
228
+ font-size: 16px;
229
+ }
230
+ .wp-core-ui .ead-btn.button-medium {
231
+ padding: 0 15px;
232
+ height: 36px;
233
+ line-height: 34px;
234
+ font-size: 14px;
235
+ }
236
+ .text-center {
237
+ text-align: center;
238
+ }
239
+ .mfp-close {
240
+ position: absolute;
241
+ right: 30px;
242
+ top: 30px;
243
+ font-weight: bold;
244
+ background: url(../images/icon-close.png)!important;
245
+ width: 22px;
246
+ height: 22px;
247
+ display: block;
248
+ text-indent: -9999999px;
249
+ border: none;
250
+ cursor: pointer;
251
+ opacity: 0.65;
252
+ padding: 0;
253
+ }
254
+ .mfp-close:hover{
255
+ opacity: 1;
256
+ }
257
+ .mfp-close .upload-success {
258
+ display: none;
259
  }
260
  div.awsm-error, div.awsm-updated {
261
  margin: 5px 0 2px;
262
  border-width: 1px 1px 1px 4px;
263
  border-style: solid;
264
  -webkit-border-radius: 4px;
265
+ border-radius: 4px;
266
  }
267
  div.awsm-updated {
268
  background-color: #fff;
278
  margin: 0.5em 0;
279
  padding: 2px;
280
  }
281
+ .hidden {
282
+ display: none;
283
  }
284
+ .mceActionPanel {
285
+ margin: 0;
286
+ }
287
+ .option-fields {
288
+ list-style-type: none;
289
+ margin: 0;
290
+ padding: 20px 0 0;
291
+ }
292
+ .option-fields li {
293
+ padding-bottom: 15px;
294
+ overflow: hidden;
295
+ }
296
+ .option-fields label {
297
+ display: block;
298
+ margin-bottom: 5px;
299
+ font-weight: bold;
300
+ }
301
+ .option-fields li.checkbox input{ float: left; margin: 2px 10px 0 0;}
302
+ .option-fields li.checkbox label{ float: left; margin: 0 0 0; font-weight: normal;}
303
+ .f-left {
304
+ float: left;
305
+ }
306
+ .option-fields .f-left {
307
+ margin-right: 25px;
308
+ }
309
+ .option-fields .f-left.last {
310
+ margin: 0;
311
+ }
312
+ .clear {
313
+ clear: both;
314
+ }
315
+ .input-small {
316
+ width: 60px;
317
+ }
318
+ .box .urlerror {
319
  border-color: #D95B5B;
320
  -webkit-box-shadow: 0 0 2px rgba(190, 30, 30, 0.8);
321
  box-shadow: 0 0 2px rgba(190, 30, 30, 0.8);
322
+ }
323
+ .picker-dialog {
324
+ z-index: 100091;
325
+ }
326
+ .picker-dialog-bg {
327
+ z-index: 100090;
328
+ }
329
+ .ead-popon #adminmenuwrap{
330
+ z-index: 999!important;
331
+ }
332
+ @media (max-width: 915px) {
333
+ .ead-options li {
334
+ width: 33.33%;
335
+ padding-bottom: 20px;
336
+ margin-bottom: 0;
337
+ }
338
+ .ead-popup-on #TB_window{
339
+ background: #fff;
340
+ -webkit-box-shadow: 0 2px 25px #000;
341
+ -moz-box-shadow: 0 2px 25px #000;
342
+ box-shadow: 0 2px 25px #000;
343
+
344
+
345
+ }
346
+
347
+ #embed-popup {
348
+ box-shadow: none;
349
+ -webkit-box-shadow: none;
350
+ }
351
+ }
352
+ @media (max-width: 600px) {
353
+ .ead-options li {
354
+ width: 50%;
355
+ }
356
+ }
357
+ @media (max-width: 440px) {
358
+ .ead-options li {
359
+ width: 100%;
360
+ }
361
  }
css/settings.css CHANGED
@@ -5,16 +5,16 @@ img {
5
  .clear {
6
  clear: both;
7
  }
8
- .f-left{
9
  float: left;
10
  }
11
- .fl-right{
12
  float: right;
13
  }
14
  .tabs {
15
  display: none;
16
  background: #fff;
17
- padding: 10px 20px 10px 35px;
18
  }
19
  .tabs.visible {
20
  display: block;
@@ -23,8 +23,8 @@ img {
23
  background: none;
24
  border: none;
25
  }
26
- .nav-tab-wrapper a:hover{
27
- border: none;
28
  }
29
  .nav-tab-wrapper a.nav-tab-active {
30
  background: #fff;
@@ -32,6 +32,7 @@ img {
32
  .form-table {
33
  margin-top: 0;
34
  padding-top: 0.5em;
 
35
  }
36
  h2.nav-tab-wrapper {
37
  border: none;
@@ -46,35 +47,78 @@ h2.ead-title {
46
  float: left;
47
  width: 100%;
48
  -moz-box-sizing: border-box;
49
- -webkit-box-sizing: border-box;
50
- box-sizing: border-box;
51
- padding-right:340px;
52
- margin-right: -340px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  }
54
  .ead-right-wrap {
55
  float: right;
56
  max-width: 300px;
57
- background: #fff;
58
- padding-bottom: 15px;
59
  color: #372e2e;
60
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  .author-info {
62
- padding: 25px 15px;
63
  text-align: center;
64
  }
65
  .awsm-social {
66
  text-align: center;
67
  list-style-type: none;
68
  padding: 15px;
69
- border-top: 1px solid #dadada;
70
  border-bottom: 1px solid #dadada;
71
- margin-bottom: 20px;
72
  }
73
  .awsm-social li {
74
  display: inline-block;
75
  margin: 0 6px;
76
  }
77
- .awsm-icon{
78
  background: url(../images/ead-icon-sprite.jpg) no-repeat;
79
  display: block;
80
  width: 21px;
@@ -82,50 +126,77 @@ margin-right: -340px;
82
  text-indent: -999999px;
83
  opacity: 0.46;
84
  }
85
- .awsm-icon:hover{
86
  opacity: 1;
87
  }
88
- .awsm-icon-facebook{
89
-
90
- }
91
- .awsm-icon-twitter{
92
  background-position: -26px 0;
93
  }
94
- .awsm-icon-github{
95
  background-position: -52px 0;
96
  }
97
- .awsm-icon-behance{
98
  background-position: -78px 0;
99
  width: 28px;
100
  }
101
- .awsm-icon-dribbble{
102
  background-position: right 0;
103
  }
104
-
105
- .paypal{ text-align: center;}
106
- .paypal input.small{ vertical-align:top; margin-right: 20px;}
107
- .paypal .donate-btn{ vertical-align: top; padding:0; }
 
 
 
 
 
 
 
108
  input.small {
109
  max-width: 60px;
110
  }
111
- .ead-frame-width{
112
  margin-right: 15px;
113
  margin-bottom: 10px;
114
  }
115
- .ead-frame-height{
116
  margin-bottom: 10px;
117
  }
118
- span.note, .ead_supported {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  font-size: 12px;
120
  color: #999;
121
  }
122
-
123
  div.awsm-error, div.awsm-updated {
124
  margin: 5px 0 2px;
125
  border-width: 1px 1px 1px 4px;
126
  border-style: solid;
127
  -webkit-border-radius: 4px;
128
- border-radius: 4px;
129
  }
130
  div.awsm-updated {
131
  background-color: #fff;
@@ -141,27 +212,65 @@ div.awsm-error p, div.awsm-updated p {
141
  margin: 0.5em 0;
142
  padding: 2px;
143
  }
144
- .ead_doller{
145
  display: inline-block;
146
  vertical-align: top;
147
  margin: 5px 5px 0 0;
148
  font-weight: bold;
149
  }
150
- #supportform label{ display: block; margin-bottom: 5px; font-weight: bold;}
151
- .text-input{ width: 100%; height: 40px; -moz-box-sizing: border-box;
152
- -webkit-box-sizing: border-box;
153
- box-sizing: border-box;}
154
- #supportform textarea{-moz-box-sizing: border-box;
155
- -webkit-box-sizing: border-box;
156
- box-sizing: border-box; width:100%;}
157
- .ead_supported span{ display:block; font-weight: bold; margin-top: 10px;}
158
- .supportedlist ul{ margin-top: 5px;}
159
- .supportedlist li{ padding-left:17px; position: relative; }
160
- .supportedlist li span{ position:absolute; left:0; top:3px; width:11px; height:11px; margin: 0;}
161
- .supportedlist li span.ead-check{ background:url(../images/icon-yes.png) no-repeat;}
162
- .supportedlist li span.ead-close{ background:url(../images/icon-no.png) no-repeat;}
163
- .col-left{float: left;width: 47%;margin-right: 6%;}
164
- .col-right{float: right;width: 47%;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  @media (max-width: 800px) {
166
  .ead-left-wrap {
167
  float: none;
@@ -169,14 +278,16 @@ box-sizing: border-box; width:100%;}
169
  margin-bottom: 30px;
170
  padding-right: 0;
171
  margin-right: 0;
172
- }
173
- .ead-right-wrap {
174
- float: none;
175
- width: 100%;
176
- }
177
-
178
  }
179
  @media (max-width: 980px) {
180
- .col-left,.col-right{float: none;width:100%;margin-right:0%;}
181
-
182
- }
 
 
 
5
  .clear {
6
  clear: both;
7
  }
8
+ .f-left {
9
  float: left;
10
  }
11
+ .fl-right {
12
  float: right;
13
  }
14
  .tabs {
15
  display: none;
16
  background: #fff;
17
+ padding: 20px 20px 0;
18
  }
19
  .tabs.visible {
20
  display: block;
23
  background: none;
24
  border: none;
25
  }
26
+ .nav-tab-wrapper a:hover {
27
+ border: none;
28
  }
29
  .nav-tab-wrapper a.nav-tab-active {
30
  background: #fff;
32
  .form-table {
33
  margin-top: 0;
34
  padding-top: 0.5em;
35
+ margin-bottom: 20px;
36
  }
37
  h2.nav-tab-wrapper {
38
  border: none;
47
  float: left;
48
  width: 100%;
49
  -moz-box-sizing: border-box;
50
+ -webkit-box-sizing: border-box;
51
+ box-sizing: border-box;
52
+ padding-right: 340px;
53
+ margin-right: -340px;
54
+ }
55
+ .ead-left-wrap h3{
56
+ font-weight: 300;
57
+ font-size: 20px;
58
+ margin: 0 0 20px;
59
+ }
60
+ .ead-form-footer{
61
+ margin: 0 -20px;
62
+ padding: 20px;
63
+ background: #f5f5f5;
64
+ border-top: 1px solid #ddd;
65
+ -webkit-box-shadow: 0 1px 2px 0 rgba(0,0,0,0.1);
66
+ box-shadow: 0 1px 2px 0 rgba(0,0,0,0.1);
67
+ overflow: hidden;
68
+ }
69
+ .ead-form-footer p{
70
+ margin: 0;
71
+ float: right;
72
+ padding: 0;
73
+ }
74
+ .ead-form-footer .button{
75
+ height: 42px;
76
  }
77
  .ead-right-wrap {
78
  float: right;
79
  max-width: 300px;
 
 
80
  color: #372e2e;
81
  }
82
+ .ead-banner{
83
+ text-align: center;
84
+ padding-top: 20px;
85
+ }
86
+ .ead-right-inner {
87
+ background: #fff;
88
+ margin-bottom: 10px;
89
+ }
90
+ .ead-right-inner h3{
91
+ margin: 0;
92
+ padding: 15px 20px;
93
+ border-bottom: 1px solid #ddd;
94
+ margin-bottom: 15px;
95
+ font-size: 14px;
96
+ color: #5b5b5b;
97
+ font-weight: normal;
98
+ }
99
+ .ead-right-inner ol{
100
+ padding: 0 20px 15px;
101
+ margin: 0 0 0 20px;
102
+ }
103
+ .ead-right-inner ol a{
104
+ text-decoration: none;
105
+ }
106
  .author-info {
107
+ padding: 10px 15px;
108
  text-align: center;
109
  }
110
  .awsm-social {
111
  text-align: center;
112
  list-style-type: none;
113
  padding: 15px;
 
114
  border-bottom: 1px solid #dadada;
115
+ margin: 0;
116
  }
117
  .awsm-social li {
118
  display: inline-block;
119
  margin: 0 6px;
120
  }
121
+ .awsm-icon {
122
  background: url(../images/ead-icon-sprite.jpg) no-repeat;
123
  display: block;
124
  width: 21px;
126
  text-indent: -999999px;
127
  opacity: 0.46;
128
  }
129
+ .awsm-icon:hover {
130
  opacity: 1;
131
  }
132
+ .awsm-icon-facebook {} .awsm-icon-twitter {
 
 
 
133
  background-position: -26px 0;
134
  }
135
+ .awsm-icon-github {
136
  background-position: -52px 0;
137
  }
138
+ .awsm-icon-behance {
139
  background-position: -78px 0;
140
  width: 28px;
141
  }
142
+ .awsm-icon-dribbble {
143
  background-position: right 0;
144
  }
145
+ .paypal {
146
+ text-align: center;
147
+ }
148
+ .paypal input.small {
149
+ vertical-align: top;
150
+ margin-right: 20px;
151
+ }
152
+ .paypal .donate-btn {
153
+ vertical-align: top;
154
+ padding: 0;
155
+ }
156
  input.small {
157
  max-width: 60px;
158
  }
159
+ .ead-frame-width {
160
  margin-right: 15px;
161
  margin-bottom: 10px;
162
  }
163
+ .ead-frame-height {
164
  margin-bottom: 10px;
165
  }
166
+ .row-col{
167
+ margin: 0 -5px 10px;
168
+ overflow: hidden;
169
+ }
170
+ .col-2{
171
+ float: left;
172
+ padding: 0 5px;
173
+ width: 50%;
174
+ -moz-box-sizing: border-box;
175
+ -webkit-box-sizing: border-box;
176
+ box-sizing: border-box;
177
+ }
178
+ .col-2 a{
179
+ background: #fff;
180
+ display: block;
181
+ text-align: center;
182
+ padding: 25px 10px;
183
+ text-decoration: none;
184
+ }
185
+
186
+ .col-2 a img{
187
+ display: block;
188
+ margin: 0 auto 10px;
189
+ }
190
+ span.note, .ead_supported {
191
  font-size: 12px;
192
  color: #999;
193
  }
 
194
  div.awsm-error, div.awsm-updated {
195
  margin: 5px 0 2px;
196
  border-width: 1px 1px 1px 4px;
197
  border-style: solid;
198
  -webkit-border-radius: 4px;
199
+ border-radius: 4px;
200
  }
201
  div.awsm-updated {
202
  background-color: #fff;
212
  margin: 0.5em 0;
213
  padding: 2px;
214
  }
215
+ .ead_doller {
216
  display: inline-block;
217
  vertical-align: top;
218
  margin: 5px 5px 0 0;
219
  font-weight: bold;
220
  }
221
+ #supportform label {
222
+ display: block;
223
+ margin-bottom: 5px;
224
+ font-weight: bold;
225
+ }
226
+ .text-input {
227
+ width: 100%;
228
+ height: 40px;
229
+ -moz-box-sizing: border-box;
230
+ -webkit-box-sizing: border-box;
231
+ box-sizing: border-box;
232
+ }
233
+ #supportform textarea {
234
+ -moz-box-sizing: border-box;
235
+ -webkit-box-sizing: border-box;
236
+ box-sizing: border-box;
237
+ width: 100%;
238
+ }
239
+ .ead_supported span {
240
+ display: block;
241
+ font-weight: bold;
242
+ margin-top: 10px;
243
+ }
244
+ .supportedlist ul {
245
+ margin-top: 5px;
246
+ }
247
+ .supportedlist li {
248
+ padding-left: 17px;
249
+ position: relative;
250
+ }
251
+ .supportedlist li span {
252
+ position: absolute;
253
+ left: 0;
254
+ top: 3px;
255
+ width: 11px;
256
+ height: 11px;
257
+ margin: 0;
258
+ }
259
+ .supportedlist li span.ead-check {
260
+ background: url(../images/icon-yes.png) no-repeat;
261
+ }
262
+ .supportedlist li span.ead-close {
263
+ background: url(../images/icon-no.png) no-repeat;
264
+ }
265
+ .col-left {
266
+ float: left;
267
+ width: 47%;
268
+ margin-right: 6%;
269
+ }
270
+ .col-right {
271
+ float: right;
272
+ width: 47%;
273
+ }
274
  @media (max-width: 800px) {
275
  .ead-left-wrap {
276
  float: none;
278
  margin-bottom: 30px;
279
  padding-right: 0;
280
  margin-right: 0;
281
+ }
282
+ .ead-right-wrap {
283
+ float: none;
284
+ width: 100%;
285
+ }
 
286
  }
287
  @media (max-width: 980px) {
288
+ .col-left, .col-right {
289
+ float: none;
290
+ width: 100%;
291
+ margin-right: 0%;
292
+ }
293
+ }
images/ead-small.png CHANGED
Binary file
images/eadplus-banner.png ADDED
Binary file
images/icon-box.png ADDED
Binary file
images/icon-drive.png ADDED
Binary file
images/icon-dropbox.png ADDED
Binary file
images/icon-link.png ADDED
Binary file
images/icon-upload.png ADDED
Binary file
images/star.gif ADDED
Binary file
images/ticket.gif ADDED
Binary file
inc/functions.php CHANGED
@@ -1,28 +1,29 @@
1
  <?php
 
2
  /**
3
  * Dropdown Builder
4
  *
5
  * @since 1.0
6
  * @return String select html
7
  */
8
- function ead_selectbuilder( $name, $options,$selected="",$class="") {
9
- if(is_array($options)):
10
- echo "<select name=\"$name\" id=\"$name\" class=\"$class\">";
11
- foreach ($options as $key => $option) {
12
- echo "<option value=\"$key\"";
13
- if ( ! empty( $helptext ) ) {
14
- echo " title=\"$helptext\"";
15
- }
16
- if ( $key == $selected ) {
17
- echo ' selected="selected"';
 
 
18
  }
19
- echo ">$option</option>\n";
20
- }
21
- echo '</select>';
22
  else:
23
-
24
  endif;
25
  }
 
26
  /**
27
  * Human Readable filesize
28
  *
@@ -31,7 +32,7 @@ function ead_selectbuilder( $name, $options,$selected="",$class="") {
31
  * @note Replaces old gde_sanitizeOpts function
32
  */
33
  function ead_human_filesize($bytes, $decimals = 2) {
34
- $size = array('B','KB','MB','GB','TB','PB','EB','ZB','YB');
35
  $factor = floor((strlen($bytes) - 1) / 3);
36
  return sprintf("%.{$decimals}f ", $bytes / pow(1024, $factor)) . @$size[$factor];
37
  }
@@ -43,146 +44,92 @@ function ead_human_filesize($bytes, $decimals = 2) {
43
  * @return string Sanitized dimensions, or false if value is invalid
44
  * @note Replaces old gde_sanitizeOpts function
45
  */
46
- function ead_sanitize_dims( $dim ) {
 
47
  // remove any spacing junk
48
- $dim = trim( str_replace( " ", "", $dim ) );
49
 
50
- if ( ! strstr( $dim, '%' ) ) {
51
  $type = "px";
52
- $dim = preg_replace( "/[^0-9]*/", '', $dim );
53
  } else {
54
  $type = "%";
55
- $dim = preg_replace( "/[^0-9]*/", '', $dim );
56
- if ( (int) $dim > 100 ) {
57
  $dim = "100";
58
  }
59
  }
60
 
61
- if ( $dim ) {
62
- return $dim.$type;
63
  } else {
64
  return false;
65
  }
66
  }
67
-
68
  /**
69
  * Validate File url
70
  *
71
  * @since 1.0
72
- * @return string Download link
73
  */
74
- function ead_validateurl($url){
75
- $types = ead_validmimeTypes();
76
- $url = esc_url( $url, array( 'http', 'https' ));
77
- $remote = wp_remote_head($url);
78
- $json['status'] = false;
79
- $json['message'] = '';
80
- if ( is_array( $remote ) ) {
81
- if ( isset( $remote['headers']['content-length'] ) ) {
82
- if(in_array($remote['headers']['content-type'], $types)){
83
- $json['message'] = __("Done",'ead');
84
- $filename = pathinfo($url);
85
- if(isset($filename)){
86
- $json['file']['filename'] = $filename['basename'];
87
- }else{
88
- $json['file']['filename'] = __("Document",'ead');
89
- }
90
- $json['file']['filesizeHumanReadable'] = ead_human_filesize($remote['headers']['content-length']);
91
- $json['status'] =true;
92
- }else{
93
- $json['message'] = __("File format is not supported.",'ead');
94
- $json['status'] = false;
95
- }
96
-
97
  } else {
98
- $json['message'] = __('Not a valid URL. Please try again.','ead');
99
- $json['status'] =false;
100
  }
101
- }elseif(is_wp_error( $result )){
102
- $json['message'] = $result->get_error_message();
103
- $json['status'] =false;
104
- }else{
105
- $json['message'] = __('Sorry, the file URL is not valid.','ead');
106
- $json['status'] =false;
 
 
 
 
107
  }
108
- return $json;
109
  }
 
110
  /**
111
- * Get Provider url
112
  *
113
  * @since 1.0
114
- * @return string iframe embed html
115
  */
116
- function ead_getprovider($atts){
117
- $embed = "";
118
- $durl = "";
119
- $default_width = ead_sanitize_dims( get_option('ead_width','100%') );
120
- $default_height = ead_sanitize_dims( get_option('ead_height','500px') );
121
- $default_provider = get_option('ead_provider','google');
122
- $default_download = get_option('ead_download','none');
123
-
124
- extract(shortcode_atts( array(
125
- 'url' => '',
126
- 'width' => $default_width,
127
- 'height' => $default_height,
128
- 'language' => 'en',
129
- 'provider' => $default_provider,
130
- 'download' => $default_download
131
- ), $atts ) );
132
- if($url):
133
- $filedata = wp_remote_head( $url );
134
- if(isset($filedata['headers']['content-length'])){
135
- if($provider == 'microsoft'){
136
- $micromime = microsoft_mimes();
137
- if(!in_array($filedata['headers']['content-type'], $micromime)){
138
- $provider = 'google';
139
- }
140
- }
141
- $url = esc_url( $url, array( 'http', 'https' ));
142
- switch ($provider) {
143
- case 'google':
144
- $embedsrc = '//docs.google.com/viewer?url=%1$s&embedded=true&hl=%2$s';
145
- $iframe = sprintf( $embedsrc,
146
- urlencode( $url ),
147
- esc_attr( $language )
148
- );
149
- break;
150
- case 'microsoft':
151
- $embedsrc ='//view.officeapps.live.com/op/embed.aspx?src=%1$s';
152
- $iframe = sprintf( $embedsrc,
153
- urlencode( $url )
154
- );
155
- break;
156
- }
157
- $style = 'style="width:%1$s; height:%2$s; border: none;"';
158
- $stylelink = sprintf($style,
159
- ead_sanitize_dims($width) ,
160
- ead_sanitize_dims($height)
161
- );
162
-
163
- $iframe = '<iframe src="'.$iframe.'" '.$stylelink.'></iframe>';
164
- $show = false;
165
- if($download=='alluser'){
166
- $show = true;
167
- }elseif($download=='logged' AND is_user_logged_in()){
168
- $show = true;
169
- }
170
- if($show){
171
- $filesize ="";
172
- $url = esc_url( $url, array( 'http', 'https' ));
173
- if(isset($filedata['headers']['content-length']))
174
- $filesize = ead_human_filesize($filedata['headers']['content-length']);
175
- $durl = '<p class="embed_download"><a href="'.$url.'" download >'.__('Download','ead'). ' ['.$filesize.']</a></p>';
176
- }
177
-
178
- $embed = $iframe.$durl;
179
- }else{
180
- $embed = __('File Not Found','ead');
181
  }
182
- else:
183
- $embed = __('No Url Found','ead');
184
- endif;
185
- return $embed;
186
  }
187
  /**
188
  * Get Email node
@@ -190,77 +137,117 @@ function ead_getprovider($atts){
190
  * @since 1.0
191
  * @return string email html
192
  */
193
- function ead_getemailnode($emaildata,$postdata){
194
  $emailhtml = "";
195
  foreach ($emaildata as $key => $label) {
196
- if($postdata[$key]){
197
- $emailhtml .= '<tr bgcolor="#EAF2FA">
198
- <td colspan="2"><font style="font-family:sans-serif;font-size:12px"><strong>'.$label.'</strong></font></td>
199
  </tr>
200
  <tr bgcolor="#FFFFFF">
201
  <td width="20">&nbsp;</td>
202
- <td><font style="font-family:sans-serif;font-size:12px">'.$postdata[$key] .'</font></td>
203
  </tr>';
 
204
  }
205
- }
206
- return $emailhtml;
207
  }
 
208
  /**
209
  * Validate Source mime type
210
  *
211
  * @since 1.0
212
- * @return boolean
213
  */
214
- function ead_validmimeTypes(){
215
- include('mime_types.php');
216
  return $mimetypes;
217
  }
 
218
  /**
219
  * Checks Url Validity
220
  *
221
  * @since 1.0
222
- * @return boolean
223
  */
224
- function ead_validType( $url ) {
225
- $doctypes=ead_validmimeTypes();
226
- if ( is_array( $doctypes ) ) {
227
- $allowed_ext = implode( "|", array_keys( $doctypes ) );
228
- if ( preg_match( "/\.($allowed_ext)$/i", $url ) ) {
229
  return true;
230
  }
231
  } else {
232
  return false;
233
  }
234
  }
 
235
  /**
236
  * Get allowed Mime Types
237
  *
238
  * @since 1.0
239
- * @return array Mimetypes
240
  */
241
- function ead_validembedtypes(){
242
- $doctypes=ead_validmimeTypes();
243
- return $allowedtype = implode(',',$doctypes);
 
244
 
 
 
 
 
 
 
 
 
 
245
  }
 
246
  /**
247
  * Get allowed Mime Types for microsoft
248
  *
249
  * @since 1.0
250
- * @return array Mimetypes
251
  */
252
- function microsoft_mimes(){
253
- $micro_mime=array(
254
- 'doc' => 'application/msword',
255
- 'pot|pps|ppt' => 'application/vnd.ms-powerpoint',
256
- 'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',
257
- 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
258
- 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
259
- 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
260
- 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
261
- 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
262
- 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
263
- );
264
- return $micro_mime;
265
  }
266
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+
3
  /**
4
  * Dropdown Builder
5
  *
6
  * @since 1.0
7
  * @return String select html
8
  */
9
+ function ead_selectbuilder($name, $options, $selected = "", $class = "") {
10
+ if (is_array($options)):
11
+ echo "<select name=\"$name\" id=\"$name\" class=\"$class\">";
12
+ foreach ($options as $key => $option) {
13
+ echo "<option value=\"$key\"";
14
+ if (!empty($helptext)) {
15
+ echo " title=\"$helptext\"";
16
+ }
17
+ if ($key == $selected) {
18
+ echo ' selected="selected"';
19
+ }
20
+ echo ">$option</option>\n";
21
  }
22
+ echo '</select>';
 
 
23
  else:
 
24
  endif;
25
  }
26
+
27
  /**
28
  * Human Readable filesize
29
  *
32
  * @note Replaces old gde_sanitizeOpts function
33
  */
34
  function ead_human_filesize($bytes, $decimals = 2) {
35
+ $size = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
36
  $factor = floor((strlen($bytes) - 1) / 3);
37
  return sprintf("%.{$decimals}f ", $bytes / pow(1024, $factor)) . @$size[$factor];
38
  }
44
  * @return string Sanitized dimensions, or false if value is invalid
45
  * @note Replaces old gde_sanitizeOpts function
46
  */
47
+ function ead_sanitize_dims($dim) {
48
+
49
  // remove any spacing junk
50
+ $dim = trim(str_replace(" ", "", $dim));
51
 
52
+ if (!strstr($dim, '%')) {
53
  $type = "px";
54
+ $dim = preg_replace("/[^0-9]*/", '', $dim);
55
  } else {
56
  $type = "%";
57
+ $dim = preg_replace("/[^0-9]*/", '', $dim);
58
+ if ((int)$dim > 100) {
59
  $dim = "100";
60
  }
61
  }
62
 
63
+ if ($dim) {
64
+ return $dim . $type;
65
  } else {
66
  return false;
67
  }
68
  }
69
+
70
  /**
71
  * Validate File url
72
  *
73
  * @since 1.0
74
+ * @return string Download link
75
  */
76
+ function ead_validateurl($url) {
77
+ $types = ead_validmimeTypes();
78
+ $url = esc_url($url, array('http', 'https'));
79
+ $remote = wp_remote_head($url);
80
+ $json['status'] = false;
81
+ $json['message'] = '';
82
+ if (wp_remote_retrieve_response_code($remote) == 200) {
83
+
84
+ //Gzip Support
85
+ $filename = pathinfo($url);
86
+ $doctypes = ead_validmimeTypes();
87
+ if (ead_validType($url, $doctypes)) {
88
+ $json['status'] = true;
89
+ $json['message'] = __("Done", 'embed-any-document');
90
+ $json['file']['url'] = $url;
91
+ if (isset($filename)) {
92
+ $json['file']['filename'] = $filename['basename'];
93
+ } else {
94
+ $json['file']['filename'] = __("Document", 'embed-any-document');
95
+ }
96
+ if (!is_wp_error($filedata) && isset($filedata['headers']['content-length'])) {
97
+ $json['file']['filesizeHumanReadable'] = ead_human_filesize($remote['headers']['content-length']);
 
98
  } else {
99
+ $json['file']['filesizeHumanReadable'] = 0;
 
100
  }
101
+ } else {
102
+ $json['message'] = __("File format is not supported.", 'embed-any-document');
103
+ $json['status'] = false;
104
+ }
105
+ } elseif (is_wp_error($remote)) {
106
+ $json['message'] = $remote->get_error_message();
107
+ $json['status'] = false;
108
+ } else {
109
+ $json['message'] = __('Sorry, the file URL is not valid.', 'embed-any-document');
110
+ $json['status'] = false;
111
  }
112
+ return $json;
113
  }
114
+
115
  /**
116
+ * Validate google url
117
  *
118
  * @since 1.0
119
+ * @return string Download link
120
  */
121
+ function ead_ValidateDriveUrl($url) {
122
+ $remote = wp_remote_head($url);
123
+ $json['status'] = false;
124
+ $json['message'] = '';
125
+ if (wp_remote_retrieve_response_code($remote) == 200) {
126
+ $json['message'] = __("Done", 'embed-any-document');
127
+ $json['status'] = true;
128
+ } else {
129
+ $json['message'] = __('The document you have chosen is a not public.', 'embed-any-document') . __(' Only the owner and explicitly shared collaborators will be able to view it.', 'embed-any-document');
130
+ $json['status'] = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  }
132
+ return $json;
 
 
 
133
  }
134
  /**
135
  * Get Email node
137
  * @since 1.0
138
  * @return string email html
139
  */
140
+ function ead_getemailnode($emaildata, $postdata) {
141
  $emailhtml = "";
142
  foreach ($emaildata as $key => $label) {
143
+ if ($postdata[$key]) {
144
+ $emailhtml.= '<tr bgcolor="#EAF2FA">
145
+ <td colspan="2"><font style="font-family:sans-serif;font-size:12px"><strong>' . $label . '</strong></font></td>
146
  </tr>
147
  <tr bgcolor="#FFFFFF">
148
  <td width="20">&nbsp;</td>
149
+ <td><font style="font-family:sans-serif;font-size:12px">' . $postdata[$key] . '</font></td>
150
  </tr>';
151
+ }
152
  }
153
+ return $emailhtml;
 
154
  }
155
+
156
  /**
157
  * Validate Source mime type
158
  *
159
  * @since 1.0
160
+ * @return boolean
161
  */
162
+ function ead_validmimeTypes() {
163
+ include ('mime_types.php');
164
  return $mimetypes;
165
  }
166
+
167
  /**
168
  * Checks Url Validity
169
  *
170
  * @since 1.0
171
+ * @return boolean
172
  */
173
+ function ead_validType($url) {
174
+ $doctypes = ead_validmimeTypes();
175
+ if (is_array($doctypes)) {
176
+ $allowed_ext = implode("|", array_keys($doctypes));
177
+ if (preg_match("/\.($allowed_ext)$/i", $url)) {
178
  return true;
179
  }
180
  } else {
181
  return false;
182
  }
183
  }
184
+
185
  /**
186
  * Get allowed Mime Types
187
  *
188
  * @since 1.0
189
+ * @return string Mimetypes
190
  */
191
+ function ead_validembedtypes() {
192
+ $doctypes = ead_validmimeTypes();
193
+ return $allowedtype = implode(',', $doctypes);
194
+ }
195
 
196
+ /**
197
+ * Get allowed Extensions
198
+ *
199
+ * @since 1.0
200
+ * @return string Extenstion
201
+ */
202
+ function ead_validextensions($list = 'all') {
203
+ include ('mime_types.php');
204
+ return $allowedtype = implode(',', $extensions[$list]);
205
  }
206
+
207
  /**
208
  * Get allowed Mime Types for microsoft
209
  *
210
  * @since 1.0
211
+ * @return array Mimetypes
212
  */
213
+ function ead_microsoft_mimes() {
214
+ $micro_mime = array(
215
+ 'doc' => 'application/msword',
216
+ 'pot|pps|ppt' => 'application/vnd.ms-powerpoint',
217
+ 'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',
218
+ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
219
+ 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
220
+ 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
221
+ 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
222
+ 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
223
+ 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
224
+ );
225
+ return $micro_mime;
226
  }
227
+
228
+ /**
229
+ * Check Allow Download
230
+ *
231
+ * @since 1.0
232
+ * @return Boolean
233
+ */
234
+ function ead_allowdownload($provider) {
235
+ $blacklist = array('drive', 'box');
236
+ if (in_array($provider, $blacklist)) {
237
+ return false;
238
+ } else {
239
+ return true;
240
+ }
241
+ }
242
+
243
+ /**
244
+ * Get Active Menu Class
245
+ *
246
+ * @since 1.0
247
+ * @return string Class name
248
+ */
249
+ function ead_getactiveMenu($tab, $needle) {
250
+ if ($tab == $needle) {
251
+ echo 'nav-tab-active';
252
+ }
253
+ }
inc/mime_types.php CHANGED
@@ -24,5 +24,7 @@
24
  'pages' => 'application/vnd.apple.pages',
25
  //Additional Mime Types
26
  'svg' => 'image/svg+xml',
27
- );
28
- ?>
 
 
24
  'pages' => 'application/vnd.apple.pages',
25
  //Additional Mime Types
26
  'svg' => 'image/svg+xml',
27
+ );
28
+ $extensions['all'] = array('.css','.js','.pdf','.ai','.tif','.tiff','.doc','.txt','.asc','.c','.cc','.h','.pot','.pps','.ppt','.xla','.xls','.xlt','.xlw','.docx','.dotx','.dotm','.xlsx','.xlsm','.pptx','.pages','.svg');
29
+ $extensions['ms'] = array('.doc','.pot','.pps','.ppt','.xla','.xls','.xlt','.xlw','.docx','.dotx','.dotm','.xlsx','.xlsm','.pptx');
30
+ ?>
inc/popup.php CHANGED
@@ -1,27 +1,28 @@
1
  <?php if ( ! defined( 'ABSPATH' ) ) { exit; } ?>
2
  <div id="embed-popup-wrap">
3
  <div id="embed-popup">
4
- <button title="Close (Esc)" type="button" class="mfp-close">×</button>
5
- <div id="popup-header">
6
- <h1><?php _e('Add Document','ead');?></h1>
7
  </div>
8
- <div class="section">
9
  <div id="embed_message" class="awsm-error" style="display:none;"><p></p></div>
10
  <div class="ead_container">
11
- <ul class="tabs">
12
- <li class="current"><?php _e('Upload and Embed','ead');?></li>
13
- <li><?php _e('Add From URL','ead');?></li>
14
- </ul>
15
  <form action="" onSubmit="return false" method="post" enctype="multipart/form-data" id="Docuploader">
16
- <div class="box visible">
17
- <div class="text-center"><input type="button" value="Upload Document" class="ead-btn button-primary button-large" id="upload_doc"/></div>
18
-
19
- </div>
20
- <div class="box">
21
- <label for="awsm_url"><?php _e('Enter document URL','ead');?></label>
22
- <input name="awsm_url" type="text" class="opt dwl input-group-text" id="awsm_url"/>
 
 
 
23
  <input type="button" value="Add URL" class="ead-btn button-primary input-group-btn" id="add_url"/>
24
- </div>
 
 
25
  </form>
26
  </div><!--ead_container-->
27
  <div class="upload-success">
@@ -30,43 +31,56 @@
30
  <p id="ead_filename"></p>
31
  <span id="ead_filesize"></span>
32
  </div>
33
- <a class="ead-btn button" id="adv_options"><?php _e('Advanced Options','ead');?></a>
34
  <div class="clear"></div>
35
- </div>
36
- <div class="advanced_options">
37
- <ul class="option-fields">
38
-
39
- <li>
40
- <div class="f-left"><label>Width</label> <input type="text" name="width" class="embedval input-small" id="ead_width" value="<?php echo get_option('ead_width', '100%' );?>"></div>
41
- <div class="f-left middle"><label>Height</label> <input type="text" name="height" class="embedval input-small" id="ead_height" value="<?php echo get_option('ead_height', '500px' );?>"></div>
42
- <div class="f-left">
43
- <label><?php _e('Show Download Link','ead');?></label>
44
- <?php
45
- $downoptions= array('alluser' => __('For all users',$this->text_domain),'logged' => __('For Logged-in users',$this->text_domain),'none' => __('None',$this->text_domain));
46
- ead_selectbuilder('ead_download', $downoptions,esc_attr( get_option('ead_download')),'embed_download');
47
- ?>
48
- </div>
49
- <div class="clear"></div>
50
- </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
- <li>
53
- <label><?php _e('Shortcode Preview', 'ead'); ?></label>
54
- <textarea name="shortcode" style="width:100%" id="shortcode" readonly="readonly"></textarea>
55
- </li>
56
  </ul>
57
  </div>
58
- </div>
59
-
60
- <div class="mceActionPanel">
61
  <div style="float: right">
62
- <input type="button" id="insert_doc" name="insert" class="ead-btn button button-primary button-medium" value="<?php _e('Insert', 'ead'); ?>" disabled/>
63
  </div>
64
 
65
  <div style="float: left">
66
- <input type="button" name="cancel" class="ead-btn button cancel_embed button-medium" value="<?php _e('Cancel', 'ead'); ?>" />
67
  </div>
68
  <div class="clear"></div>
69
  </div>
70
- </div>
71
  </div>
72
- </div>
1
  <?php if ( ! defined( 'ABSPATH' ) ) { exit; } ?>
2
  <div id="embed-popup-wrap">
3
  <div id="embed-popup">
4
+ <button title="Close" type="button" class="mfp-close">×</button>
5
+ <div id="popup-header" class="ead-popup-header">
6
+ <h1><?php _e('Add Document',$this->text_domain);?></h1>
7
  </div>
8
+ <div class="ead-section">
9
  <div id="embed_message" class="awsm-error" style="display:none;"><p></p></div>
10
  <div class="ead_container">
 
 
 
 
11
  <form action="" onSubmit="return false" method="post" enctype="multipart/form-data" id="Docuploader">
12
+ <ul class="ead-options">
13
+ <li><a href="#" id="upload_doc"><span><img src="<?php echo $this->plugin_url;?>images/icon-upload.png" alt="Upload document" /><?php _e('Upload Document',$this->text_domain);?></span></a></li>
14
+ <li><a href="#" id="addDocUrl"><span><img src="<?php echo $this->plugin_url;?>images/icon-link.png" alt="Add From URL" /><?php _e('Add from URL',$this->text_domain);?></span></a></li>
15
+ <li><?php echo $this->providerlink('ead_dropbox','DropBoxUpload','Dropbox') ;?></li>
16
+ <li><?php echo $this->providerlink(array('ead_drivekey','ead_driveClient'),'GooglePicker','Drive') ;?></li>
17
+ <li><?php echo $this->providerlink('ead_box','boxPicker','Box') ;?></li>
18
+ </ul>
19
+ <div class="box addurl_box">
20
+ <label for="awsm_url"><?php _e('Enter document URL',$this->text_domain);?></label>
21
+ <input name="awsm_url" type="text" class="opt dwl input-group-text" placeholder="Eg: http://www.yoursite.com/file.pdf" id="awsm_url"/>
22
  <input type="button" value="Add URL" class="ead-btn button-primary input-group-btn" id="add_url"/>
23
+ <div class="clear"></div>
24
+ <a href="#" class="go-back">&larr; back</a>
25
+ </div>
26
  </form>
27
  </div><!--ead_container-->
28
  <div class="upload-success">
31
  <p id="ead_filename"></p>
32
  <span id="ead_filesize"></span>
33
  </div>
 
34
  <div class="clear"></div>
35
+ </div>
36
+ <div class="advanced_options">
37
+ <h3><?php _e('Advanced Options',$this->text_domain);?></span></h3>
38
+ <ul class="option-fields">
39
+ <li>
40
+ <div class="f-left"><label>Width</label> <input type="text" name="width" class="embedval input-small" id="ead_width" value="<?php echo get_option('ead_width', '100%' );?>"></div>
41
+ <div class="f-left"><label>Height</label> <input type="text" name="height" class="embedval input-small" id="ead_height" value="<?php echo get_option('ead_height', '500px' );?>"></div>
42
+ <div class="f-left" id="ead_downloadc">
43
+ <label><?php _e('Show Download Link',$this->text_domain);?></label>
44
+ <?php
45
+ $downoptions= array('all' => __('For all users',$this->text_domain),'logged' => __('For Logged-in users',$this->text_domain),'none' => __('No Download',$this->text_domain));
46
+ ead_selectbuilder('ead_download', $downoptions,esc_attr( get_option('ead_download')),'ead_usc');
47
+ ?>
48
+ </div>
49
+ <div class="f-left last" id="new_provider">
50
+ <label><?php _e('Viewer',$this->text_domain);?></label>
51
+ <?php
52
+ $providers = array('google' => __('Google Docs Viewer',$this->text_domain),'microsoft' => __('Microsoft Office Online',$this->text_domain));
53
+ ead_selectbuilder('ead_provider', $providers,esc_attr( get_option('ead_provider','google')),'ead_usc');
54
+ ?>
55
+ </div>
56
+ <div class="f-left last" id="ead_pseudo" style="display:none">
57
+ <label><?php _e('Viewer',$this->text_domain);?></label>
58
+ <select name="ead_pseudo" disabled>
59
+ <option value="box">Box</option>
60
+ <option value="drive">Drive</option>
61
+ </select>
62
+ </div>
63
+ <div class="clear"></div>
64
+ </li>
65
 
66
+ <li>
67
+ <label><?php _e('Shortcode Preview',$this->text_domain); ?></label>
68
+ <textarea name="shortcode" style="width:100%" id="shortcode" readonly="readonly"></textarea>
69
+ </li>
70
  </ul>
71
  </div>
72
+ </div>
73
+ </div>
74
+ <div class="mceActionPanel ead-action-panel">
75
  <div style="float: right">
76
+ <input type="button" id="insert_doc" name="insert" data-txt="<?php _e('Insert', $this->text_domain); ?>" data-loading="<?php _e('Loading...', $this->text_domain); ?>" class="ead-btn button button-primary button-medium" value="<?php _e('Insert', $this->text_domain); ?>" disabled/>
77
  </div>
78
 
79
  <div style="float: left">
80
+ <input type="button" name="cancel" class="ead-btn button cancel_embed button-medium" value="<?php _e('Cancel', $this->text_domain); ?>" />
81
  </div>
82
  <div class="clear"></div>
83
  </div>
84
+
85
  </div>
86
+ </div>
inc/settings.php CHANGED
@@ -1,52 +1,13 @@
1
  <?php if ( ! defined( 'ABSPATH' ) ) { exit; } ?>
2
  <div class="wrap">
3
  <h2 class="ead-title"><?php _e('Embed Any Document by AWSM.in',$this->text_domain);?></h2>
4
- <h2 class="nav-tab-wrapper">
5
- <a class="nav-tab nav-tab-active" href="#" data-tab="general"><?php _e( 'General Settings', $this->text_domain); ?></a>
6
- <a class="nav-tab " href="#" data-tab="support"><?php _e( 'Support', $this->text_domain); ?></a>
7
- </h2>
8
  <div class="ead-left-wrap">
9
 
10
  <div class="tabs visible" id="general">
 
11
  <form method="post" action="options.php">
12
  <?php settings_fields( 'ead-settings-group' ); ?>
13
  <table class="form-table">
14
- <tr valign="top">
15
- <th scope="row"><?php _e('Embed Using',$this->text_domain);?></th>
16
- <td>
17
- <?php
18
- $providers= array('google' => __('Google Docs Viewer',$this->text_domain),'microsoft' => __('Microsoft Office Online',$this->text_domain));
19
- ead_selectbuilder('ead_provider', $providers,esc_attr( get_option('ead_provider','google')));
20
- ?>
21
- <div class="ead_supported">
22
- <span><?php _e('Supported file formats',$this->text_domain);?></span>
23
- <div class="supportedlist hidden" id="ead_google">
24
- <ul>
25
- <li><span class="ead-check"></span>Microsoft Word (docx, docm, dotm, dotx)</li>
26
- <li><span class="ead-check"></span>Microsoft Excel (xlsx, xlsb, xls, xlsm)</li>
27
- <li><span class="ead-check"></span>Microsoft PowerPoint (pptx, ppsx, ppt, pps, pptm, potm, ppam, potx, ppsm)</li>
28
- <li><span class="ead-check"></span>Adobe Portable Document Format (pdf)</li>
29
- <li><span class="ead-check"></span>Text files (txt)</li>
30
- <li><span class="ead-check"></span>TIFF Images (tif, tiff)</li>
31
- <li><span class="ead-check"></span>Adobe Illustrator (ai)</li>
32
- <li><span class="ead-check"></span>Scalable Vector Graphics (svg)</li>
33
- </ul>
34
- </div>
35
- <div class="supportedlist hidden" id="ead_microsoft">
36
- <ul>
37
- <li><span class="ead-check"></span>Microsoft Word (docx, docm, dotm, dotx)</li>
38
- <li><span class="ead-check"></span>Microsoft Excel (xlsx, xlsb, xls, xlsm)</li>
39
- <li><span class="ead-check"></span>Microsoft PowerPoint (pptx, ppsx, ppt, pps, pptm, potm, ppam, potx, ppsm)</li>
40
- <li><span class="ead-close"></span>Adobe Portable Document Format (pdf)</li>
41
- <li><span class="ead-close"></span>Text files (txt)</li>
42
- <li><span class="ead-close"></span>TIFF Images (tif, tiff)</li>
43
- <li><span class="ead-close"></span>Adobe Illustrator (ai)</li>
44
- <li><span class="ead-close"></span>Scalable Vector Graphics (svg)</li>
45
- </ul>
46
- </div>
47
- </div>
48
- </td>
49
- </tr>
50
  <tr valign="top">
51
  <th scope="row"><?php _e('Default Size', $this->text_domain); ?></th>
52
  <td>
@@ -65,129 +26,52 @@
65
  <th scope="row"><?php _e('Show Download Link',$this->text_domain);?></th>
66
  <td>
67
  <?php
68
- $downoptions= array('alluser' => __('For all users',$this->text_domain),'logged' => __('For Logged-in users',$this->text_domain),'none' => __('None',$this->text_domain));
69
  ead_selectbuilder('ead_download', $downoptions,esc_attr( get_option('ead_download','none')));
70
  ?>
71
  </td>
72
  </tr>
73
  </table>
 
74
  <?php submit_button(); ?>
 
75
  </form>
76
  </div><!-- #general-->
77
- <div class="tabs" id="support">
78
- <div id="embed_message"><p></p></div>
79
- <div class="col-left">
80
- <?php $current_user = wp_get_current_user(); ?>
81
- <form id="supportform" action="">
82
- <p>
83
- <label><?php _e('Name', $this->text_domain); ?><span class="required">*</span></label>
84
- <input type="text" name="site_name" value="<?php echo $current_user->display_name; ?>" class="text-input" />
85
- </p>
86
- <p>
87
- <label><?php _e('Email ID', $this->text_domain); ?><span class="required">*</span></label>
88
- <input type="email" name="email_id" value="<?php echo $current_user->user_email; ?>" class="text-input"/>
89
- </p>
90
- <p>
91
- <label><?php _e('Problem', $this->text_domain); ?><span class="required">*</span></label>
92
- <textarea name="problem"></textarea>
93
- </p>
94
- <p class="submit">
95
- <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e('Submit', $this->text_domain); ?>">
96
- </p>
97
- </form>
98
- </div>
99
- <div class="col-right">
100
- <p><strong>Frequently Reported Issues</strong></p>
101
- <p>
102
- <strong>1. File not found error in my localhost site.</strong><br/>
103
- The viewers (Google Docs Viewer and Microsoft Office Online) do not support locally hosted files. <span style="border-bottom: 1px solid;">Your document has to be available online for the viewers to access.</span>
104
- </p>
105
- <p>
106
- <strong>2. Google Docs Viewer shows bandwidth exceeded error.</strong><br/>
107
- The issue is caused by Google Docs Viewer, not the plugin. Google Docs Viewer is a standalone documents viewer which doesn't limit bandwidth. When the problem occurs, usually reloading the page will result in the document loading properly. So it looks more like a bug from their side. Many developers reported the same issue in Google Developer Forums. Hope it will be fixed soon.
108
- </p>
109
- </div>
110
- <div class="clear"></div>
111
- </div><!-- #support-->
112
  </div><!-- .ead-left-wrap -->
113
  <div class="ead-right-wrap">
114
- <a href="http://awsm.in" target="_blank" title="AWSM Innovations"><img src="http://awsm.in/innovations/ead/logo.png" alt="AWSM!"></a>
115
- <div class="author-info">
116
- This plugin is developed <br/>by <a href="http://awsm.in" target="_blank" title="AWSM Innovations">AWSM Innovations.</a>
117
- </div><!-- .author-info -->
118
  <ul class="awsm-social">
119
  <li><a href="https://www.facebook.com/awsminnovations" target="_blank" title="AWSM Innovations"><span class="awsm-icon awsm-icon-facebook">Facebook</span></a></li>
120
  <li><a href="https://twitter.com/awsmin" target="_blank" title="AWSM Innovations"><span class="awsm-icon awsm-icon-twitter">Twitter</span></a></li>
121
  <li><a href="https://github.com/awsmin" target="_blank" title="AWSM Innovations"><span class="awsm-icon awsm-icon-github">Github</span></a></li>
122
  <li><a href="https://www.behance.net/awsmin" target="_blank" title="AWSM Innovations"><span class="awsm-icon awsm-icon-behance">Behance</span></a></li>
123
  </ul>
124
- <div class="paypal">
125
- <p>Liked the plugin? You can support our Open Source projects with a donation</p>
126
-
127
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
128
- <input type="hidden" name="cmd" value="_xclick">
129
- <input type="hidden" name="business" value="pay@fidiz.com">
130
- <input type="hidden" name="lc" value="IN">
131
- <input type="hidden" name="item_name" value="Donation For Embed Any Document">
132
- <input type="hidden" name="currency_code" value="USD">
133
- <input type="hidden" name="button_subtype" value="services">
134
- <input type="hidden" name="no_note" value="0">
135
- <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest">
136
- <span class="ead_doller">$</span><input type="text" name="amount" value="10.00" class="small">
137
- <input type='hidden' name='cancel_return' value='<?php echo admin_url('options-general.php?page='.$this->settings_slug);?>'>
138
- <input type='hidden' name='return' value='http://awsm.in/paypal/thankyou'>
139
- <input type="image" src="<?php echo $this->plugin_url . 'images/donate.gif';?>" border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">
140
- <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
141
- </form>
 
 
 
142
  </div>
143
  </div><!-- .ead-right-wrap -->
144
  <div class="clear"></div>
145
- </div><!-- .wrap -->
146
- <script type="text/javascript">
147
- jQuery(document).ready(function ($) {
148
-
149
- jQuery( ".nav-tab" ).click(function(event) {
150
- event.preventDefault();
151
- $('.nav-tab').removeClass('nav-tab-active');
152
- $(this).addClass('nav-tab-active');
153
- var tab = '#'+ $(this).data('tab');
154
- $(".tabs").hide();
155
- $(tab).show();
156
- });
157
- $( "#supportform" ).submit(function( event ) {
158
- event.preventDefault();
159
- $.ajax({
160
- type: "POST",
161
- url:"<?php echo get_option('home')?>/wp-admin/admin-ajax.php",
162
- dataType: 'json',
163
- data: { action: 'supportform' , contact : $("#supportform").serialize()},
164
- success: function(data)
165
- {
166
- supportmessage(data.status,data.message);
167
- },
168
- error: function(jqXHR, textStatus, errorThrown)
169
- {
170
- supportmessage(false,'Request failed');
171
- }
172
- });
173
- });
174
- function supportmessage(status,message){
175
- if(status){
176
- $('#embed_message').removeClass('awsm-error').addClass('awsm-updated');
177
- $('#embed_message p').html(message);
178
- } else{
179
- $('#embed_message').removeClass('awsm-updated').addClass('awsm-error');
180
- $('#embed_message p').html(message);
181
- }
182
- }
183
- suppportedlist();
184
- function suppportedlist(){
185
- var provider = '#ead_'+$('#ead_provider').val();
186
- $('.supportedlist').hide();
187
- $(provider).show();
188
- }
189
- $('#ead_provider').live('change', function(e) {
190
- suppportedlist();
191
- });
192
- });
193
- </script>
1
  <?php if ( ! defined( 'ABSPATH' ) ) { exit; } ?>
2
  <div class="wrap">
3
  <h2 class="ead-title"><?php _e('Embed Any Document by AWSM.in',$this->text_domain);?></h2>
 
 
 
 
4
  <div class="ead-left-wrap">
5
 
6
  <div class="tabs visible" id="general">
7
+ <h3>General Settings</h3>
8
  <form method="post" action="options.php">
9
  <?php settings_fields( 'ead-settings-group' ); ?>
10
  <table class="form-table">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  <tr valign="top">
12
  <th scope="row"><?php _e('Default Size', $this->text_domain); ?></th>
13
  <td>
26
  <th scope="row"><?php _e('Show Download Link',$this->text_domain);?></th>
27
  <td>
28
  <?php
29
+ $downoptions= array('alluser' => __('For all users',$this->text_domain),'logged' => __('For Logged-in users',$this->text_domain),'none' => __('No Download',$this->text_domain));
30
  ead_selectbuilder('ead_download', $downoptions,esc_attr( get_option('ead_download','none')));
31
  ?>
32
  </td>
33
  </tr>
34
  </table>
35
+ <div class="ead-form-footer">
36
  <?php submit_button(); ?>
37
+ </div>
38
  </form>
39
  </div><!-- #general-->
40
+ <div class="ead-banner">
41
+ <a href="http://goo.gl/wJTQlc" target="_blank"><img src="<?php echo $this->plugin_url;?>images/eadplus-banner.png"></a>
42
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  </div><!-- .ead-left-wrap -->
44
  <div class="ead-right-wrap">
45
+ <div class="ead-right-inner">
46
+ <a href="http://awsm.in" target="_blank" title="AWSM Innovations"><img src="http://awsm.in/innovations/ead/logo2.jpg" alt="AWSM!"></a>
 
 
47
  <ul class="awsm-social">
48
  <li><a href="https://www.facebook.com/awsminnovations" target="_blank" title="AWSM Innovations"><span class="awsm-icon awsm-icon-facebook">Facebook</span></a></li>
49
  <li><a href="https://twitter.com/awsmin" target="_blank" title="AWSM Innovations"><span class="awsm-icon awsm-icon-twitter">Twitter</span></a></li>
50
  <li><a href="https://github.com/awsmin" target="_blank" title="AWSM Innovations"><span class="awsm-icon awsm-icon-github">Github</span></a></li>
51
  <li><a href="https://www.behance.net/awsmin" target="_blank" title="AWSM Innovations"><span class="awsm-icon awsm-icon-behance">Behance</span></a></li>
52
  </ul>
53
+ </div>
54
+ <div class="clearfix row-col">
55
+ <div class="col-2">
56
+ <a href="https://wordpress.org/support/view/plugin-reviews/embed-any-document#postform" target="_blank">
57
+ <img src="<?php echo $this->plugin_url;?>images/star.gif"><?php _e('Like the plugin?', $this->text_domain);?><br/><?php _e('Rate Now!', $this->text_domain);?>
58
+ </a>
59
+ </div>
60
+ <div class="col-2">
61
+ <a href="http://awsm.in/support" target="_blank">
62
+ <img src="<?php echo $this->plugin_url;?>images/ticket.gif"><?php _e('Need Help?', $this->text_domain);?><br/><?php _e('Open a Ticket', $this->text_domain);?>
63
+ </a>
64
+ </div>
65
+ </div>
66
+ <div class="ead-right-inner">
67
+ <h3>More Links</h3>
68
+ <ol>
69
+ <li><a href="http://awsm.in/ead-plus-documentation/#embedding" target="_blank" title="How to Embed Documents?"><?php _e('How to Embed Documents?', $this->text_domain); ?></a></li>
70
+ <li><a href="http://awsm.in/ead-plus-documentation/#viewers" target="_blank" title="About Viewers"><?php _e('About Viewers', $this->text_domain); ?></a></li>
71
+ <li><a href="http://awsm.in/ead-plus-documentation/#shortcode" target="_blank" title="Shortcode & Attributes"><?php _e('Shortcode & Attributes', $this->text_domain); ?></a></li>
72
+ <li><a href="http://awsm.in/support" target="_blank" title="FAQs"><?php _e('FAQs', $this->text_domain); ?></a></li>
73
+ </ol>
74
  </div>
75
  </div><!-- .ead-right-wrap -->
76
  <div class="clear"></div>
77
+ </div><!-- .wrap -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/support-mail.php CHANGED
@@ -23,7 +23,7 @@ if ( 'POST' == $_SERVER['REQUEST_METHOD']) {
23
  </table>';
24
  add_filter('wp_mail_content_type',create_function('', 'return "text/html"; '));
25
  $tomail='hello@awsm.in';
26
- $subject = "[EAD] Support Request From ". get_option('blogname');
27
  $headers = "Reply-To: <" . $email_id . ">\n";
28
  if (wp_mail( $tomail, $subject, $mailmessage, $headers )) {
29
  $json['status'] = true;
23
  </table>';
24
  add_filter('wp_mail_content_type',create_function('', 'return "text/html"; '));
25
  $tomail='hello@awsm.in';
26
+ $subject = "[EAD-free] Support Request From ". get_option('blogname');
27
  $headers = "Reply-To: <" . $email_id . ">\n";
28
  if (wp_mail( $tomail, $subject, $mailmessage, $headers )) {
29
  $json['status'] = true;
js/embed.js CHANGED
@@ -1,174 +1,283 @@
1
- jQuery(document).ready(function ($) {
2
- var $popup = $('#embed-popup'),
3
- $wrap = $('#embed-popup-wrap'),
4
- $embedurl = $('#awsm_url'),
5
- $shortcode = $('#shortcode');
6
- $message = $('#embed_message p');
7
- $ActionPanel = $('.mceActionPanel');
8
- $container = $('.ead_container');
9
- var fileurl="";
10
- //Opens Embed popup
11
- $('body').on('click', '.awsm-embed', function (e) {
 
 
12
  ead_reset();
13
- e.preventDefault();
14
- $wrap.show();
15
- window.embed_target = $(this).data('target');
16
- $(this).magnificPopup({
17
- type: 'inline',
18
- alignTop: true,
19
- callbacks: {
20
- open: function () {
21
- // Change z-index
22
- $('body').addClass('mfp-shown');
23
- // Save selection
24
- mce_selection = (typeof tinyMCE !== 'undefined' && tinyMCE.activeEditor != null && tinyMCE.activeEditor.hasOwnProperty('selection')) ? tinyMCE.activeEditor.selection.getContent({
25
- format: "text"
26
- }) : '';
27
- },
28
- close: function () {
29
- // Remove narrow class
30
- $popup.removeClass('generator-narrow');
31
- // Clear selection
32
- mce_selection = '';
33
- // Change z-index
34
- $('body').removeClass('mfp-shown');
35
- }
36
- }
37
- }).magnificPopup('open');
38
- });
39
- //Update shortcode on change
40
- $( ".embed_download" ).change(function() {
41
- updateshortcode();
42
- });
43
- $('.embedval').blur(function(){
44
- updateshortcode();
45
- });
46
-
47
- //Tabs Support
48
- $('ul.tabs').delegate('li:not(.current)', 'click', function () {
49
- $(this).addClass('current').siblings().removeClass('current')
50
- .parents('div.section').find('div.box').eq($(this).index()).fadeIn(150).siblings('div.box').hide();
51
  });
52
-
53
- //Toggle advanced options
54
- $("#adv_options").click(function(){
55
- $(".advanced_options").toggle();
56
- });
57
  //Wordpress Uploader
58
  $('#upload_doc').click(open_media_window);
59
 
60
- //Insert Media window
61
- function open_media_window() {
62
- if (this.window === undefined) {
63
- this.window = wp.media({
64
- title: 'Embed Any Documet',
65
- multiple: false,
66
- library: {
67
- type: emebeder.validtypes,
68
- },
69
- button: {text: 'Insert'}
70
- });
71
-
72
- var self = this; // Needed to retrieve our variable in the anonymous function below
73
- this.window.on('select', function() {
74
- var file = self.window.state().get('selection').first().toJSON();
75
- fileurl=file.url;
76
- $shortcode.text(getshortcode(file.url));
77
- uploaddetails(file);
78
- });
79
- }
80
- this.window.open();
81
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  }
83
- //to getshortcode
84
- function getshortcode(url){
85
- var height=$('#ead_height').val(),width=$('#ead_width').val(),download=$('#ead_download').val(),heightstr="",widthstr="",downloadstr="";
86
- if(height!=emebeder.default_height) { heightstr = ' height="'+height+'"'; }
87
- if(width!=emebeder.default_width) { widthstr = ' width="'+width+'"'; }
88
- if(download!=emebeder.download) { downloadstr = ' download="'+download+'"'; }
89
- return '[embeddoc url="' + url + '"' + widthstr + heightstr + downloadstr +']';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  }
92
  //Print uploaded file details
93
- function uploaddetails(file){
94
  $('#insert_doc').removeAttr('disabled');
95
- $('#ead_filename').html(file.filename)
96
- $('#ead_filesize').html(file.filesizeHumanReadable);
97
- $('.upload-success').fadeIn();
 
 
 
 
98
  $container.hide();
 
99
  }
100
- //Add url
101
- $('#add_url').click(awsm_embded_url);
102
- function awsm_embded_url(){
103
- var checkurl = $embedurl.val();
104
- if (checkurl!='') {
105
- validateurl(checkurl);
106
- } else {
107
- $embedurl.addClass('urlerror');
108
- updateshortcode();
109
- }
110
-
 
 
 
 
 
111
  }
112
  //Validate file url
113
- function validateurl(url){
 
114
  $('#embed_message').hide();
115
- $('#add_url').val(emebeder.verify);
116
- $.ajax({
117
- type: 'POST',
118
- url: emebeder.ajaxurl,
119
- dataType: 'json',
120
- data: { action: 'validateurl',
121
- furl:url },
122
- success: function(data) {
123
- if(data.status){
124
- $embedurl.removeClass('urlerror');
125
- fileurl =url;
126
- updateshortcode();
127
- uploaddetails(data.file);
128
- }else{
129
- showmsg(data.message);
130
- }
131
- $('#add_url').val(emebeder.addurl);
132
- },
133
- });
134
  }
135
  //Show Message
136
- function showmsg(msg){
137
  $('#embed_message').fadeIn();
138
- $message.text(msg);
139
  }
140
- //insert Shortcode
141
- $('#insert_doc').click(awsm_shortcode);
142
- function awsm_shortcode(){
143
- if(fileurl){
144
- wp.media.editor.insert($shortcode.text());
145
- $.magnificPopup.close();
146
- }else{
147
- showmsg(emebeder.nocontent);
148
- }
149
-
150
  }
 
151
  //Update ShortCode
152
- function updateshortcode(){
153
- if(fileurl){
154
- $shortcode.text(getshortcode(fileurl));
155
- }else{
156
- $shortcode.text('');
157
- }
158
- }
159
- // Close Embed dialog
160
- $('#embed-popup').on('click', '.cancel_embed', function (e) {
161
- // Close popup
162
- $.magnificPopup.close();
163
- // Prevent default action
164
- e.preventDefault();
165
- });
166
- function ead_reset(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  $container.show();
168
  $embedurl.val('');
 
 
169
  $('.upload-success').hide();
170
- $(".advanced_options").hide();
171
  $('#embed_message').hide();
172
- $('#insert_doc').attr('disabled','disabled');
 
 
 
 
 
173
  }
174
  });
1
+ jQuery(document).ready(function($) {
2
+ var $embedurl = $('#awsm_url'),
3
+ $shortcode = $('#shortcode'),
4
+ $message = $('#embed_message p'),
5
+ $ActionPanel = $('.mceActionPanel'),
6
+ $container = $('.ead_container'),
7
+ fileurl = "",
8
+ newprovider = "",
9
+ frame,
10
+ msextension = emebeder.msextension,
11
+ drextension = emebeder.drextension;
12
+ //Opens Embed popup
13
+ $('body').on('click', '.awsm-embed', function(e) {
14
  ead_reset();
15
+ e.preventDefault();
16
+ $('body').addClass('ead-popup-on');
17
+ tb_show("Embed Any Document", "#TB_inline?inlineId=embed-popup-wrap&amp;width=1030&amp;modal=true", null);
18
+ tb_position();
19
+ return;
20
+ });
21
+
22
+ //Update shortcode on change
23
+ $(".ead_usc").change(function() {
24
+ newprovider = "";
25
+ updateshortcode($(this).attr('id'));
26
+ });
27
+ $('.embedval').keyup(function() {
28
+ updateshortcode($(this).attr('id'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  });
 
 
 
 
 
30
  //Wordpress Uploader
31
  $('#upload_doc').click(open_media_window);
32
 
33
+ //Add url
34
+ $('#add_url').click(awsm_embded_url);
35
+
36
+ //insert Shortcode
37
+ $('#insert_doc').click(awsm_shortcode);
38
+ // Add from URL support
39
+ $('#addDocUrl').on('click', function(e) {
40
+ e.preventDefault();
41
+ $('.addurl_box').fadeIn();
42
+ $('.ead-options').hide();
43
+ });
44
+ //Add fromrom URL cancel handler
45
+ $('.go-back').on('click', function(e) {
46
+ e.preventDefault();
47
+ $('.addurl_box').hide();
48
+ $('.ead-options').fadeIn();
49
+ });
50
+ // Close embed dialog
51
+ $('#embed-popup').on('click', '.cancel_embed,.mfp-close', function(e) {
52
+ // Prevent default action
53
+ e.preventDefault();
54
+ remove_eadpop();
55
+ });
56
+ //Insert Media window
57
+ function open_media_window() {
58
+ var uClass = 'upload';
59
+ if (frame) {
60
+ frame.open();
61
+ return;
62
+ }
63
+ frame = wp.media({
64
+ title: 'Embed Any Document',
65
+ multiple: false,
66
+ library: {
67
+ type: emebeder.validtypes,
68
+ },
69
+ button: {
70
+ text: 'Insert'
71
+ }
72
+ });
73
+ frame.on('select', function() {
74
+ var file = frame.state().get('selection').first().toJSON();
75
+ updateprovider(file, uClass);
76
+ });
77
+ frame.open();
78
  }
79
+
80
+
81
+ //update provider
82
+ function updateprovider(file, uClass) {
83
+ fileurl = file.url;
84
+ validViewer(file, uClass);
85
+ updateshortcode();
86
+ uploaddetails(file, uClass);
87
+ }
88
+ //sanitize width and height
89
+ function sanitize(dim) {
90
+ if (dim.indexOf("%") == -1) {
91
+ dim = dim.replace(/[^0-9]/g, '');
92
+ dim += "px";
93
+ } else {
94
+ dim = dim.replace(/[^0-9]/g, '');
95
+ dim += "%";
96
+ }
97
+ return dim;
98
+ }
99
+ //Thickbox Handler
100
+ function tb_position() {
101
+ var tbWindow = $('#TB_window');
102
+ var width = $(window).width();
103
+ var H = $(window).height();
104
+ var W = ( 1080 < width ) ? 1080 : width;
105
 
106
+ if ( tbWindow.size() ) {
107
+ tbWindow.width( W - 50 ).height( H - 45 );
108
+ //$('#TB_iframeContent').width( W - 50 ).height( H - 75 );
109
+ $('#TB_ajaxContent').css({'width':'100%','height':'100%','padding':'0'});
110
+ tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
111
+ if ( typeof document.body.style.maxWidth != 'undefined' )
112
+ tbWindow.css({'top':'20px','margin-top':'0'});
113
+ $('#TB_title').css({'background-color':'#fff','color':'#cfcfcf'});
114
+ };
115
+ };
116
+ $(window).resize( function() { tb_position() } );
117
+ //to getshortcode
118
+ function getshortcode(url, item) {
119
+ var height = sanitize($('#ead_height').val()),
120
+ width = sanitize($('#ead_width').val()),
121
+ download = $('#ead_download').val(),
122
+ provider = $('#ead_provider').val(),
123
+ heightstr = "",
124
+ widthstr = "",
125
+ downloadstr = "",
126
+ providerstr = "",
127
+ drivestr = "";
128
+ if (itemcheck('height', item)) {
129
+ heightstr = ' height="' + height + '"';
130
+ }
131
+ if (itemcheck('width', item)) {
132
+ widthstr = ' width="' + width + '"';
133
+ }
134
+ if (itemcheck('download', item)) {
135
+ downloadstr = ' download="' + download + '"';
136
+ }
137
+ if (itemcheck('provider', item)) {
138
+ providerstr = ' viewer="' + provider + '"';
139
+ }
140
+ return '[embeddoc url="' + url + '"' + widthstr + heightstr + downloadstr + providerstr + drivestr + ']';
141
+ }
142
+ // Checks with default setting value
143
+ function itemcheck(item, dataitem) {
144
+ var check = $('#ead_' + item).val();
145
+ var datacheck = 'ead_' + item;
146
+ if (datacheck == dataitem) {
147
+ return true;
148
+ } else if (check != emebeder[item]) {
149
+ return true;
150
+ }
151
+ return false;
152
  }
153
  //Print uploaded file details
154
+ function uploaddetails(file, uClass) {
155
  $('#insert_doc').removeAttr('disabled');
156
+ $('#ead_filename').html(file.filename);
157
+ if (file.filesizeHumanReadable) {
158
+ $('#ead_filesize').html(file.filesizeHumanReadable);
159
+ } else {
160
+ $('#ead_filesize').html('&nbsp;');
161
+ }
162
+ $('.upload-success').fadeIn();
163
  $container.hide();
164
+ UploadClass(uClass);
165
  }
166
+
167
+
168
+ function awsm_embded_url() {
169
+ var checkurl = $embedurl.val();
170
+ if (checkurl !== '') {
171
+ validateurl(checkurl);
172
+ } else {
173
+ $embedurl.addClass('urlerror');
174
+ updateshortcode();
175
+ }
176
+ }
177
+ function isUrlValid(url) {
178
+ if (!/^http:\/\//.test(url)) {
179
+ url = "http://" + url;
180
+ }
181
+ return /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(url);
182
  }
183
  //Validate file url
184
+ function validateurl(url) {
185
+ var uClass = 'link';
186
  $('#embed_message').hide();
187
+ if(isUrlValid(url)){
188
+ fileurl = url;
189
+ $('#insert_doc').removeAttr('disabled');
190
+ $('#ead_filename').html('From URL');
191
+ $('#ead_filesize').html('&nbsp;');
192
+ $('.upload-success').fadeIn();
193
+ $container.hide();
194
+ UploadClass(uClass);
195
+ updateshortcode();
196
+ }else{
197
+ showmsg(emebeder.invalidurl);
198
+ }
 
 
 
 
 
 
 
199
  }
200
  //Show Message
201
+ function showmsg(msg) {
202
  $('#embed_message').fadeIn();
203
+ $message.text(msg);
204
  }
205
+
206
+
207
+ function awsm_shortcode() {
208
+ if (fileurl) {
209
+ wp.media.editor.insert($shortcode.text());
210
+ remove_eadpop();
211
+ } else {
212
+ showmsg(emebeder.nocontent);
213
+ }
 
214
  }
215
+
216
  //Update ShortCode
217
+ function updateshortcode(item) {
218
+ item = typeof item !== 'undefined' ? item : false;
219
+ if (fileurl) {
220
+ $shortcode.text(getshortcode(fileurl, item));
221
+ } else {
222
+ $shortcode.text('');
223
+ }
224
+ }
225
+
226
+ //UploadClass
227
+ function UploadClass(uPclass) {
228
+ $(".uploaded-doccument").removeClass("ead-link ead-upload ead-dropbox ead-drive ead-box");
229
+ $('.uploaded-doccument').addClass('ead-' + uPclass);
230
+ }
231
+ //close popup
232
+ function remove_eadpop(){
233
+ // Close popup
234
+ tb_remove();
235
+ setTimeout(function() {
236
+ $('body').removeClass('ead-popup-on');
237
+ }, 800);
238
+ }
239
+ //Convert Filesize to human Readable filesize
240
+ function humanFileSize(bytes) {
241
+ var thresh = 1024;
242
+ if (bytes < thresh) return bytes + ' B';
243
+ var units = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
244
+ var u = -1;
245
+ do {
246
+ bytes /= thresh;
247
+ ++u;
248
+ } while (bytes >= thresh);
249
+ return bytes.toFixed(1) + ' ' + units[u];
250
+ }
251
+ // Viewer Check
252
+ function validViewer(file, provider) {
253
+ var cprovider = ["link", "upload"];
254
+ var validext = msextension.split(',');
255
+ var ext = '.' + file.filename.split('.').pop();
256
+ $("#new_provider option[value='microsoft']").attr('disabled', false);
257
+ if ($.inArray(provider, cprovider) != -1) {
258
+ if ($.inArray(ext, validext) == -1) {
259
+ newprovider = "google";
260
+ $("#new_provider option[value='google']").attr("selected", "selected");
261
+ $("#new_provider option[value='microsoft']").attr('disabled', true);
262
+ } else {
263
+ newprovider = "microsoft";
264
+ $("#new_provider option[value='microsoft']").attr("selected", "selected");
265
+ }
266
+ }
267
+ }
268
+ //Reset form data
269
+ function ead_reset() {
270
  $container.show();
271
  $embedurl.val('');
272
+ $('.ead-options').fadeIn();
273
+ $('.addurl_box').hide();
274
  $('.upload-success').hide();
 
275
  $('#embed_message').hide();
276
+ $('#insert_doc').attr('disabled', 'disabled');
277
+ $('#new_provider').show();
278
+ $('#ead_pseudo').hide();
279
+ newprovider = "";
280
+ $("#new_provider option[value='microsoft']").attr('disabled', false);
281
+ $('#ead_downloadc').show();
282
  }
283
  });
language/ead-en.mo ADDED
Binary file
language/ead-en.po ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Embed Any Document\n"
4
+ "POT-Creation-Date: 2014-12-31 14:58+0530\n"
5
+ "PO-Revision-Date: 2014-12-31 14:58+0530\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: Awsm Innovations <hello@awsm.in>\n"
8
+ "Language: en\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.6.10\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-KeywordsList: __;_e\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+ "X-Poedit-SearchPath-1: ..\n"
19
+
20
+ #: ../aswm-embed.php:81 ../inc/popup.php:6
21
+ msgid "Add Document"
22
+ msgstr ""
23
+
24
+ #: ../aswm-embed.php:106
25
+ msgid "Settings"
26
+ msgstr ""
27
+
28
+ #: ../aswm-embed.php:133
29
+ msgid "Nothing to insert"
30
+ msgstr ""
31
+
32
+ #: ../aswm-embed.php:134
33
+ msgid "Add URL"
34
+ msgstr ""
35
+
36
+ #: ../aswm-embed.php:135
37
+ msgid "Verifying..."
38
+ msgstr ""
39
+
40
+ #: ../aswm-embed.php:184
41
+ msgid "Download"
42
+ msgstr ""
43
+
44
+ #: ../aswm-embed.php:207
45
+ msgid "No Url Found"
46
+ msgstr ""
47
+
48
+ #: ../aswm-embed.php:221 ../aswm-embed.php:248
49
+ msgid "You do not have sufficient permissions to access this page."
50
+ msgstr ""
51
+
52
+ #: ../aswm-embed.php:281
53
+ msgid "Buy Pro Version"
54
+ msgstr ""
55
+
56
+ #: ../aswm-embed.php:283
57
+ msgid "Add from "
58
+ msgstr ""
59
+
60
+ #: ../inc/functions.php:89 ../inc/functions.php:126
61
+ msgid "Done"
62
+ msgstr ""
63
+
64
+ #: ../inc/functions.php:94
65
+ msgid "Document"
66
+ msgstr ""
67
+
68
+ #: ../inc/functions.php:102
69
+ msgid "File format is not supported."
70
+ msgstr ""
71
+
72
+ #: ../inc/functions.php:109
73
+ msgid "Sorry, the file URL is not valid."
74
+ msgstr ""
75
+
76
+ #: ../inc/functions.php:129
77
+ msgid "The document you have chosen is a not public."
78
+ msgstr ""
79
+
80
+ #: ../inc/functions.php:129
81
+ msgid ""
82
+ " Only the owner and explicitly shared collaborators will be able to view it."
83
+ msgstr ""
84
+
85
+ #: ../inc/popup.php:13
86
+ msgid "Upload Document"
87
+ msgstr ""
88
+
89
+ #: ../inc/popup.php:14
90
+ msgid "Add from URL"
91
+ msgstr ""
92
+
93
+ #: ../inc/popup.php:20
94
+ msgid "Enter document URL"
95
+ msgstr ""
96
+
97
+ #: ../inc/popup.php:34
98
+ msgid "Advanced Options"
99
+ msgstr ""
100
+
101
+ #: ../inc/popup.php:44 ../inc/settings.php:30
102
+ msgid "Show Download Link"
103
+ msgstr ""
104
+
105
+ #: ../inc/popup.php:46 ../inc/settings.php:33
106
+ msgid "For all users"
107
+ msgstr ""
108
+
109
+ #: ../inc/popup.php:46 ../inc/settings.php:33
110
+ msgid "For Logged-in users"
111
+ msgstr ""
112
+
113
+ #: ../inc/popup.php:46 ../inc/settings.php:33
114
+ msgid "No Download"
115
+ msgstr ""
116
+
117
+ #: ../inc/popup.php:51 ../inc/popup.php:58
118
+ msgid "Viewer"
119
+ msgstr ""
120
+
121
+ #: ../inc/popup.php:53
122
+ msgid "Google Docs Viewer"
123
+ msgstr ""
124
+
125
+ #: ../inc/popup.php:53
126
+ msgid "Microsoft Office Online"
127
+ msgstr ""
128
+
129
+ #: ../inc/popup.php:68
130
+ msgid "Shortcode Preview"
131
+ msgstr ""
132
+
133
+ #: ../inc/popup.php:77
134
+ msgid "Insert"
135
+ msgstr ""
136
+
137
+ #: ../inc/popup.php:77
138
+ msgid "Loading..."
139
+ msgstr ""
140
+
141
+ #: ../inc/popup.php:81
142
+ msgid "Cancel"
143
+ msgstr ""
144
+
145
+ #: ../inc/settings.php:3
146
+ msgid "Embed Any Document by AWSM.in"
147
+ msgstr ""
148
+
149
+ #: ../inc/settings.php:5
150
+ msgid "General Settings"
151
+ msgstr ""
152
+
153
+ #: ../inc/settings.php:6
154
+ msgid "Support"
155
+ msgstr ""
156
+
157
+ #: ../inc/settings.php:7
158
+ msgid "Get Plus Version"
159
+ msgstr ""
160
+
161
+ #: ../inc/settings.php:16
162
+ msgid "Default Size"
163
+ msgstr ""
164
+
165
+ #: ../inc/settings.php:18
166
+ msgid "Width"
167
+ msgstr ""
168
+
169
+ #: ../inc/settings.php:22
170
+ msgid "Height"
171
+ msgstr ""
172
+
173
+ #: ../inc/settings.php:26
174
+ msgid "Enter values in pixels or percentage (Example: 500px or 100%)"
175
+ msgstr ""
176
+
177
+ #: ../inc/settings.php:48
178
+ msgid "Name"
179
+ msgstr ""
180
+
181
+ #: ../inc/settings.php:52
182
+ msgid "Email ID"
183
+ msgstr ""
184
+
185
+ #: ../inc/settings.php:56
186
+ msgid "Problem"
187
+ msgstr ""
188
+
189
+ #: ../inc/settings.php:60
190
+ msgid "Submit"
191
+ msgstr ""
192
+
193
+ #: ../inc/support-mail.php:8
194
+ msgid "Please Fill Required Fields"
195
+ msgstr ""
196
+
197
+ #: ../inc/support-mail.php:30
198
+ msgid "We will get back to you soon"
199
+ msgstr ""
200
+
201
+ #: ../inc/support-mail.php:33
202
+ msgid "Something went wrong"
203
+ msgstr ""
204
+
205
+ #: ../inc/support-mail.php:38
206
+ msgid "Cheating ?"
207
+ msgstr ""
language/ead.mo ADDED
Binary file
language/ead.pot CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Embed Any Document\n"
4
- "POT-Creation-Date: 2014-11-07 14:45+0530\n"
5
- "PO-Revision-Date: 2014-11-07 14:45+0530\n"
6
  "Last-Translator: \n"
7
  "Language-Team: Awsm Innovations <hello@awsm.in>\n"
8
  "Language: en\n"
@@ -10,185 +10,206 @@ msgstr ""
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "X-Generator: Poedit 1.6.10\n"
13
-
14
- #: aswm-embed.php:77
15
- #: inc/popup.php:6
 
 
 
 
 
16
  msgid "Add Document"
17
  msgstr ""
18
 
19
- #: aswm-embed.php:102
20
  msgid "Settings"
21
  msgstr ""
22
 
23
- #: aswm-embed.php:111
24
- #: aswm-embed.php:156
25
- #: aswm-embed.php:174
26
- #: aswm-embed.php:185
27
- msgid "You do not have sufficient permissions to access this page."
28
  msgstr ""
29
 
30
- #: aswm-embed.php:129
31
- msgid "Nothing to insert"
32
  msgstr ""
33
 
34
- #: aswm-embed.php:130
35
  msgid "Add URL"
36
  msgstr ""
37
 
38
- #: aswm-embed.php:131
39
  msgid "Verifying..."
40
  msgstr ""
41
 
42
- #: inc/functions.php:87
43
  msgid "Download"
44
  msgstr ""
45
 
46
- #: inc/functions.php:105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  msgid "Done"
48
  msgstr ""
49
 
50
- #: inc/functions.php:110
51
  msgid "Document"
52
  msgstr ""
53
 
54
- #: inc/functions.php:115
55
  msgid "File format is not supported."
56
  msgstr ""
57
 
58
- #: inc/functions.php:120
59
- msgid "Not a valid URL. Please try again."
60
  msgstr ""
61
 
62
- #: inc/functions.php:127
63
- msgid "Sorry, the file URL is not valid."
64
  msgstr ""
65
 
66
- #: inc/functions.php:175
67
- msgid "No Url Found"
 
68
  msgstr ""
69
 
70
- #: inc/popup.php:12
71
- msgid "Upload and Embed"
72
  msgstr ""
73
 
74
- #: inc/popup.php:13
75
- msgid "Add From URL"
76
  msgstr ""
77
 
78
- #: inc/popup.php:21
79
  msgid "Enter document URL"
80
  msgstr ""
81
 
82
- #: inc/popup.php:33
83
  msgid "Advanced Options"
84
  msgstr ""
85
 
86
- #: inc/popup.php:43
87
- #: inc/settings.php:38
88
  msgid "Show Download Link"
89
  msgstr ""
90
 
91
- #: inc/popup.php:45
92
- #: inc/settings.php:41
93
  msgid "For all users"
94
  msgstr ""
95
 
96
- #: inc/popup.php:45
97
- #: inc/settings.php:41
98
  msgid "For Logged-in users"
99
  msgstr ""
100
 
101
- #: inc/popup.php:45
102
- #: inc/settings.php:41
103
- msgid "None"
 
 
 
 
 
 
 
 
 
 
 
104
  msgstr ""
105
 
106
- #: inc/popup.php:53
107
  msgid "Shortcode Preview"
108
  msgstr ""
109
 
110
- #: inc/popup.php:62
111
  msgid "Insert"
112
  msgstr ""
113
 
114
- #: inc/popup.php:66
115
- msgid "Cancel"
116
  msgstr ""
117
 
118
- #: inc/settings.php:3
119
- msgid "Embed Any Document by AWSM.in"
120
  msgstr ""
121
 
122
- #: inc/settings.php:5
123
- msgid "General Settings"
124
  msgstr ""
125
 
126
- #: inc/settings.php:6
127
- msgid "Support"
128
  msgstr ""
129
 
130
- #: inc/settings.php:15
131
- msgid "Embed Using"
132
  msgstr ""
133
 
134
- #: inc/settings.php:18
135
- msgid "Google Docs Viewer"
136
  msgstr ""
137
 
138
- #: inc/settings.php:18
139
- msgid "Microsoft Office Online"
140
  msgstr ""
141
 
142
- #: inc/settings.php:24
143
- msgid "Default Size"
144
  msgstr ""
145
 
146
- #: inc/settings.php:26
147
- msgid "Width"
148
  msgstr ""
149
 
150
- #: inc/settings.php:30
151
- msgid "Height"
152
  msgstr ""
153
 
154
- #: inc/settings.php:34
155
- msgid "Enter values in pixels or percentage (Example: 300px or 100%)"
156
  msgstr ""
157
 
158
- #: inc/settings.php:55
159
- msgid "Name"
160
  msgstr ""
161
 
162
- #: inc/settings.php:62
163
- msgid "Email ID"
164
  msgstr ""
165
 
166
- #: inc/settings.php:69
167
- msgid "Problem"
168
  msgstr ""
169
 
170
- #: inc/settings.php:77
171
- msgid "Submit"
172
  msgstr ""
173
 
174
- #: inc/support-mail.php:8
175
  msgid "Please Fill Required Fields"
176
  msgstr ""
177
 
178
- #: inc/support-mail.php:30
179
  msgid "We will get back to you soon"
180
  msgstr ""
181
 
182
- #: inc/support-mail.php:33
183
  msgid "Something went wrong"
184
  msgstr ""
185
 
186
- #: inc/support-mail.php:38
187
  msgid "Cheating ?"
188
  msgstr ""
189
-
190
- #: inc/functions.php:180
191
- msgid "File Not Found"
192
- msgstr ""
193
-
194
-
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Embed Any Document\n"
4
+ "POT-Creation-Date: 2015-06-25 15:46+0530\n"
5
+ "PO-Revision-Date: 2015-06-25 15:47+0530\n"
6
  "Last-Translator: \n"
7
  "Language-Team: Awsm Innovations <hello@awsm.in>\n"
8
  "Language: en\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "X-Generator: Poedit 1.6.10\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Poedit-KeywordsList: __;_e\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+ "X-Poedit-SearchPath-1: ..\n"
19
+
20
+ #: ../aswm-embed.php:81 ../inc/popup.php:6
21
  msgid "Add Document"
22
  msgstr ""
23
 
24
+ #: ../aswm-embed.php:106
25
  msgid "Settings"
26
  msgstr ""
27
 
28
+ #: ../aswm-embed.php:132
29
+ msgid "Nothing to insert"
 
 
 
30
  msgstr ""
31
 
32
+ #: ../aswm-embed.php:133
33
+ msgid "Invalid URL"
34
  msgstr ""
35
 
36
+ #: ../aswm-embed.php:134
37
  msgid "Add URL"
38
  msgstr ""
39
 
40
+ #: ../aswm-embed.php:135
41
  msgid "Verifying..."
42
  msgstr ""
43
 
44
+ #: ../aswm-embed.php:181
45
  msgid "Download"
46
  msgstr ""
47
 
48
+ #: ../aswm-embed.php:204
49
+ msgid "No Url Found"
50
+ msgstr ""
51
+
52
+ #: ../aswm-embed.php:218 ../aswm-embed.php:245
53
+ msgid "You do not have sufficient permissions to access this page."
54
+ msgstr ""
55
+
56
+ #: ../aswm-embed.php:278
57
+ msgid "Buy Pro Version"
58
+ msgstr ""
59
+
60
+ #: ../aswm-embed.php:280
61
+ msgid "Add from "
62
+ msgstr ""
63
+
64
+ #: ../inc/functions.php:89 ../inc/functions.php:126
65
  msgid "Done"
66
  msgstr ""
67
 
68
+ #: ../inc/functions.php:94
69
  msgid "Document"
70
  msgstr ""
71
 
72
+ #: ../inc/functions.php:102
73
  msgid "File format is not supported."
74
  msgstr ""
75
 
76
+ #: ../inc/functions.php:109
77
+ msgid "Sorry, the file URL is not valid."
78
  msgstr ""
79
 
80
+ #: ../inc/functions.php:129
81
+ msgid "The document you have chosen is a not public."
82
  msgstr ""
83
 
84
+ #: ../inc/functions.php:129
85
+ msgid ""
86
+ " Only the owner and explicitly shared collaborators will be able to view it."
87
  msgstr ""
88
 
89
+ #: ../inc/popup.php:13
90
+ msgid "Upload Document"
91
  msgstr ""
92
 
93
+ #: ../inc/popup.php:14
94
+ msgid "Add from URL"
95
  msgstr ""
96
 
97
+ #: ../inc/popup.php:20
98
  msgid "Enter document URL"
99
  msgstr ""
100
 
101
+ #: ../inc/popup.php:37
102
  msgid "Advanced Options"
103
  msgstr ""
104
 
105
+ #: ../inc/popup.php:43 ../inc/settings.php:26
 
106
  msgid "Show Download Link"
107
  msgstr ""
108
 
109
+ #: ../inc/popup.php:45 ../inc/settings.php:29
 
110
  msgid "For all users"
111
  msgstr ""
112
 
113
+ #: ../inc/popup.php:45 ../inc/settings.php:29
 
114
  msgid "For Logged-in users"
115
  msgstr ""
116
 
117
+ #: ../inc/popup.php:45 ../inc/settings.php:29
118
+ msgid "No Download"
119
+ msgstr ""
120
+
121
+ #: ../inc/popup.php:50 ../inc/popup.php:57
122
+ msgid "Viewer"
123
+ msgstr ""
124
+
125
+ #: ../inc/popup.php:52
126
+ msgid "Google Docs Viewer"
127
+ msgstr ""
128
+
129
+ #: ../inc/popup.php:52
130
+ msgid "Microsoft Office Online"
131
  msgstr ""
132
 
133
+ #: ../inc/popup.php:67
134
  msgid "Shortcode Preview"
135
  msgstr ""
136
 
137
+ #: ../inc/popup.php:76
138
  msgid "Insert"
139
  msgstr ""
140
 
141
+ #: ../inc/popup.php:76
142
+ msgid "Loading..."
143
  msgstr ""
144
 
145
+ #: ../inc/popup.php:80
146
+ msgid "Cancel"
147
  msgstr ""
148
 
149
+ #: ../inc/settings.php:3
150
+ msgid "Embed Any Document by AWSM.in"
151
  msgstr ""
152
 
153
+ #: ../inc/settings.php:12
154
+ msgid "Default Size"
155
  msgstr ""
156
 
157
+ #: ../inc/settings.php:14
158
+ msgid "Width"
159
  msgstr ""
160
 
161
+ #: ../inc/settings.php:18
162
+ msgid "Height"
163
  msgstr ""
164
 
165
+ #: ../inc/settings.php:22
166
+ msgid "Enter values in pixels or percentage (Example: 500px or 100%)"
167
  msgstr ""
168
 
169
+ #: ../inc/settings.php:57
170
+ msgid "Like the plugin?"
171
  msgstr ""
172
 
173
+ #: ../inc/settings.php:57
174
+ msgid "Rate Now!"
175
  msgstr ""
176
 
177
+ #: ../inc/settings.php:62
178
+ msgid "Need Help?"
179
  msgstr ""
180
 
181
+ #: ../inc/settings.php:62
182
+ msgid "Open a Ticket"
183
  msgstr ""
184
 
185
+ #: ../inc/settings.php:69
186
+ msgid "How to Embed Documents?"
187
  msgstr ""
188
 
189
+ #: ../inc/settings.php:70
190
+ msgid "About Viewers"
191
  msgstr ""
192
 
193
+ #: ../inc/settings.php:71
194
+ msgid "Shortcode & Attributes"
195
  msgstr ""
196
 
197
+ #: ../inc/settings.php:72
198
+ msgid "FAQs"
199
  msgstr ""
200
 
201
+ #: ../inc/support-mail.php:8
202
  msgid "Please Fill Required Fields"
203
  msgstr ""
204
 
205
+ #: ../inc/support-mail.php:30
206
  msgid "We will get back to you soon"
207
  msgstr ""
208
 
209
+ #: ../inc/support-mail.php:33
210
  msgid "Something went wrong"
211
  msgstr ""
212
 
213
+ #: ../inc/support-mail.php:38
214
  msgid "Cheating ?"
215
  msgstr ""
 
 
 
 
 
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://awsm.in/donate
4
  Tags: embed documents, upload pdf, embed ppt, document viewer, pdf viewer, pdf viewer plugin, display pdf, embed pdf, embed pdf in wordpress, word, word viewer, word document, embed word, word plugin, doc, doc viewer, docx, docx viewer, excel, excel plugin, xls, xlsx, spreadsheet, embed spreadsheet, powerpoint, powerpoint viewer, ppt, ppt viewer, pptx, image viewer
5
  Author URI: http://awsm.in
6
  Requires at least: 3.5
7
- Tested up to: 4.0
8
  Stable tag: trunk
9
  License: GPLv2
10
 
@@ -65,7 +65,7 @@ Upload or link the documents to your site using the ‘Add Document’ button in
65
  1. ‘Add Document’ button integrated into WordPress visual editor
66
  2. Add document popup
67
  3. Inserting Document
68
- 4. Settings panel
69
 
70
 
71
  == Frequently Asked Questions ==
@@ -81,12 +81,65 @@ Great. Send it to ead@awsm.in. We will answer it as soon as we can.
81
 
82
  == Changelog ==
83
 
84
- = V1.0.1 - 2014-11-12 =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  * Removed unsupported file types.
86
  * Updated support tab.
87
 
 
 
 
 
88
  == Upgrade Notice ==
89
 
90
- = V1.0.1 =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  * Removed unsupported file types.
92
- * Updated support tab.
 
 
 
4
  Tags: embed documents, upload pdf, embed ppt, document viewer, pdf viewer, pdf viewer plugin, display pdf, embed pdf, embed pdf in wordpress, word, word viewer, word document, embed word, word plugin, doc, doc viewer, docx, docx viewer, excel, excel plugin, xls, xlsx, spreadsheet, embed spreadsheet, powerpoint, powerpoint viewer, ppt, ppt viewer, pptx, image viewer
5
  Author URI: http://awsm.in
6
  Requires at least: 3.5
7
+ Tested up to: 4.3.1
8
  Stable tag: trunk
9
  License: GPLv2
10
 
65
  1. ‘Add Document’ button integrated into WordPress visual editor
66
  2. Add document popup
67
  3. Inserting Document
68
+ 4. Add from URL
69
 
70
 
71
  == Frequently Asked Questions ==
81
 
82
  == Changelog ==
83
 
84
+ = V 2.2.1 - 2015-10-03 =
85
+ * New Language localization.
86
+
87
+ = V 2.2 - 2015-06-24 =
88
+ * Replaced magnific popup with thickbox.
89
+ * Fixed: Media library serach bug.
90
+ * UI Improvements
91
+
92
+ = V 2.1 - 2015-01-25 =
93
+ * Missing image fix.
94
+ * Error handling.
95
+
96
+ = V 2.0 - 2014-12-31 =
97
+ * UI Improvements
98
+ * Various bug fixes
99
+ * Performance improvements
100
+ * Introduced plus version with cloud support
101
+
102
+ = V 1.0.2 - 2014-11-24 =
103
+ * Added option in advanced option to choose viewer.
104
+ * Added option in settings to enable and disable media library insert.
105
+ * Fixed: Editor permission issue.
106
+
107
+ = V 1.1.1- 2014-12-8 =
108
+ * Removed media insert override option.
109
+
110
+ = V 1.0.1 - 2014-11-12 =
111
  * Removed unsupported file types.
112
  * Updated support tab.
113
 
114
+ = V 1.1 - 2014-11-12 =
115
+ * File Not Found fix
116
+
117
+
118
  == Upgrade Notice ==
119
 
120
+ = V 2.2.1 - 2015-10-03 =
121
+ * New Language localization.
122
+
123
+ = V 2.2 =
124
+ * Replaced magnific popup with thickbox.
125
+ * Fixed: Media library serach bug.
126
+ * UI Improvements
127
+
128
+ = V 2.1 =
129
+ * Missing image fix.
130
+ * Error handling.
131
+
132
+ = V 2.0 =
133
+ * UI Improvements
134
+ * Various bug fixes
135
+ * Performance improvements
136
+
137
+ = V 1.1.1=
138
+ * Removed media insert override option.
139
+
140
+ = V 1.0.1 =
141
  * Removed unsupported file types.
142
+ * Updated support tab.
143
+
144
+ = V 1.1 =
145
+ * File Not Found fix
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
screenshot-3.png CHANGED
Binary file
screenshot-4.png CHANGED
Binary file