Embed Any Document - Version 1.0.1

Version Description

  • 2014-11-12 =
  • Removed unsupported file types.
  • Updated support tab.

=

Download this release

Release Info

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

Version 1.0.1

aswm-embed.php ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
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 {
13
+ private static $instance = null;
14
+ private $plugin_path;
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
+ */
23
+ public static function get_instance() {
24
+ // If an instance hasn't been created and set to $instance create an instance and set it to $instance.
25
+ if ( null == self::$instance ) {
26
+ self::$instance = new self;
27
+ }
28
+ return self::$instance;
29
+ }
30
+
31
+ /**
32
+ * Initializes the plugin by setting localization, hooks, filters, and administrative functions.
33
+ */
34
+ private function __construct() {
35
+
36
+ $this->plugin_path = plugin_dir_path( __FILE__ );
37
+ $this->plugin_url = plugin_dir_url( __FILE__ );
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
+
44
+ add_action( 'media_buttons', array( $this, 'embedbutton' ),1000);
45
+
46
+ add_shortcode( 'embeddoc', array( $this, 'embed_shortcode'));
47
+
48
+ //Admin Settings menu
49
+ add_action('admin_menu', array($this, 'admin_menu'));
50
+ add_action( 'admin_init', array($this, 'register_eadsettings'));
51
+ //Add easy settings link
52
+ add_filter( "plugin_action_links_" . plugin_basename( __FILE__ ),array($this, 'settingslink'));
53
+ //ajax validate file url
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
+ /**
67
+ * Embed any Docs Button
68
+ */
69
+ public function embedbutton( $args = array() ) {
70
+ // Check user previlage
71
+ if ( !current_user_can( 'edit_posts' )) return;
72
+ // Prepares button target
73
+ $target = is_string( $args ) ? $args : 'content';
74
+ // Prepare args
75
+ $args = wp_parse_args( $args, array(
76
+ 'target' => $target,
77
+ 'text' => __( 'Add Document', $this->text_domain),
78
+ 'class' => 'awsm-embed button',
79
+ 'icon' => plugins_url( 'images/ead-small.png', __FILE__ ),
80
+ 'echo' => true,
81
+ 'shortcode' => false
82
+ ) );
83
+ // Prepare EAD icon
84
+ if ( $args['icon'] ) $args['icon'] = '<img src="' . $args['icon'] . '" /> ';
85
+ // Print button in media column
86
+ $button = '<a href="javascript:void(0);" class="' . $args['class'] . '" title="' . $args['text'] . '" data-mfp-src="#embed-popup-wrap" data-target="' . $args['target'] . '" >' . $args['icon'] . $args['text'] . '</a>';
87
+ // Show generator popup
88
+ //add_action( 'wp_footer', array( $this, 'embedpopup' ) );
89
+ add_action( 'admin_footer', array($this, 'embedpopup' ) );
90
+ // Request assets
91
+ wp_enqueue_media();
92
+ //Loads Support css and js
93
+ $this->embed_helper();
94
+ // Print/return result
95
+ if ( $args['echo'] ) echo $button;
96
+ return $button;
97
+ }
98
+ /**
99
+ * Admin Easy access settings link
100
+ */
101
+ function settingslink( $links ) {
102
+ $settings_link = '<a href="options-general.php?page='.$this->settings_slug.'">' . __('Settings', $this->text_domain) . '</a>';
103
+ array_unshift( $links, $settings_link );
104
+ return $links;
105
+ }
106
+ /**
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
150
+ */
151
+ public function admin_menu() {
152
+ $eadsettings = add_options_page('Embed Any Document', 'Embed Any Document', 'manage_options',$this->settings_slug, array($this, 'settings_page'));
153
+ add_action( 'admin_print_styles-' . $eadsettings, array($this,'setting_styles'));
154
+ }
155
+ public function settings_page() {
156
+ if (!current_user_can('manage_options')) {
157
+ wp_die(__('You do not have sufficient permissions to access this page.'));
158
+ }
159
+ include($this->plugin_path.'inc/settings.php');
160
+ }
161
+ /**
162
+ * Register Settings
163
+ */
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);
180
+ }
181
+ /**
182
+ * Ajax Contact Form
183
+ */
184
+ function supportform(){
185
+ if (!current_user_can('manage_options')) {
186
+ wp_die(__('You do not have sufficient permissions to access this page.'));
187
+ }
188
+ include($this->plugin_path.'inc/support-mail.php');
189
+ }
190
+ /**
191
+ * Plugin function
192
+ */
193
+ function run_plugin(){
194
+ $this->adminfunctions();
195
+ }
196
+ /**
197
+ * Admin Functions init
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
+ */
218
+ function additional_mimes($mimes){
219
+ return array_merge($mimes,array (
220
+ 'svg' => 'image/svg+xml',
221
+ 'ai' => 'application/postscript',
222
+ ));
223
+ }
224
+ }
225
+
226
+ Awsm_embed::get_instance();
css/embed.css ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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;
141
+ border-color: #eee #eee #eee #7ad03a;
142
+ padding: 1px 12px;
143
+ }
144
+ div.awsm-error {
145
+ background: none repeat scroll 0 0 #fff;
146
+ border-color: #eee #eee #eee #dd3d36;
147
+ padding: 1px 12px;
148
+ }
149
+ 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
+ }
css/magnific-popup.css ADDED
@@ -0,0 +1,366 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Magnific Popup CSS */
2
+ .mfp-bg {
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ z-index: 1042;
8
+ overflow: hidden;
9
+ position: fixed;
10
+ background: #0b0b0b;
11
+ opacity: 0.8;
12
+ filter: alpha(opacity=80); }
13
+
14
+ .mfp-wrap {
15
+ top: 0;
16
+ left: 0;
17
+ width: 100%;
18
+ height: 100%;
19
+ z-index: 1043;
20
+ position: fixed;
21
+ outline: none !important;
22
+ -webkit-backface-visibility: hidden; }
23
+
24
+ .mfp-container {
25
+ text-align: center;
26
+ position: absolute;
27
+ width: 100%;
28
+ height: 100%;
29
+ left: 0;
30
+ top: 0;
31
+ padding: 0 8px;
32
+ -webkit-box-sizing: border-box;
33
+ -moz-box-sizing: border-box;
34
+ box-sizing: border-box; }
35
+
36
+ .mfp-container:before {
37
+ content: '';
38
+ display: inline-block;
39
+ height: 100%;
40
+ vertical-align: middle; }
41
+
42
+ .mfp-align-top .mfp-container:before {
43
+ display: none; }
44
+
45
+ .mfp-content {
46
+ position: relative;
47
+ display: inline-block;
48
+ vertical-align: middle;
49
+ margin: 0 auto;
50
+ text-align: left;
51
+ z-index: 1045; }
52
+
53
+ .mfp-inline-holder .mfp-content, .mfp-ajax-holder .mfp-content {
54
+ width: 100%;
55
+ cursor: auto; }
56
+
57
+ .mfp-ajax-cur {
58
+ cursor: progress; }
59
+
60
+ .mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
61
+ cursor: -moz-zoom-out;
62
+ cursor: -webkit-zoom-out;
63
+ cursor: zoom-out; }
64
+
65
+ .mfp-zoom {
66
+ cursor: pointer;
67
+ cursor: -webkit-zoom-in;
68
+ cursor: -moz-zoom-in;
69
+ cursor: zoom-in; }
70
+
71
+ .mfp-auto-cursor .mfp-content {
72
+ cursor: auto; }
73
+
74
+ .mfp-close, .mfp-arrow, .mfp-preloader, .mfp-counter {
75
+ -webkit-user-select: none;
76
+ -moz-user-select: none;
77
+ user-select: none; }
78
+
79
+ .mfp-loading.mfp-figure {
80
+ display: none; }
81
+
82
+ .mfp-hide {
83
+ display: none !important; }
84
+
85
+ .mfp-preloader {
86
+ color: #cccccc;
87
+ position: absolute;
88
+ top: 50%;
89
+ width: auto;
90
+ text-align: center;
91
+ margin-top: -0.8em;
92
+ left: 8px;
93
+ right: 8px;
94
+ z-index: 1044; }
95
+ .mfp-preloader a {
96
+ color: #cccccc; }
97
+ .mfp-preloader a:hover {
98
+ color: white; }
99
+
100
+ .mfp-s-ready .mfp-preloader {
101
+ display: none; }
102
+
103
+ .mfp-s-error .mfp-content {
104
+ display: none; }
105
+
106
+ button.mfp-close, button.mfp-arrow {
107
+ overflow: visible;
108
+ cursor: pointer;
109
+ background: transparent;
110
+ border: 0;
111
+ -webkit-appearance: none;
112
+ display: block;
113
+ outline: none;
114
+ padding: 0;
115
+ z-index: 1046;
116
+ -webkit-box-shadow: none;
117
+ box-shadow: none; }
118
+ button::-moz-focus-inner {
119
+ padding: 0;
120
+ border: 0; }
121
+
122
+ .mfp-close {
123
+ width: 44px;
124
+ height: 44px;
125
+ line-height: 44px;
126
+ position: absolute;
127
+ right: 0;
128
+ top: 0;
129
+ text-decoration: none;
130
+ text-align: center;
131
+ opacity: 0.65;
132
+ filter: alpha(opacity=65);
133
+ padding: 0 0 18px 10px;
134
+ color: white;
135
+ font-style: normal;
136
+ font-size: 28px;
137
+ font-family: Arial, Baskerville, monospace; }
138
+ .mfp-close:hover, .mfp-close:focus {
139
+ opacity: 1;
140
+ filter: alpha(opacity=100); }
141
+
142
+ .mfp-close-btn-in .mfp-close {
143
+ color: #333333; }
144
+
145
+ .mfp-image-holder .mfp-close, .mfp-iframe-holder .mfp-close {
146
+ color: white;
147
+ right: -6px;
148
+ text-align: right;
149
+ padding-right: 6px;
150
+ width: 100%; }
151
+
152
+ .mfp-counter {
153
+ position: absolute;
154
+ top: 0;
155
+ right: 0;
156
+ color: #cccccc;
157
+ font-size: 12px;
158
+ line-height: 18px; }
159
+
160
+ .mfp-arrow {
161
+ position: absolute;
162
+ opacity: 0.65;
163
+ filter: alpha(opacity=65);
164
+ margin: 0;
165
+ top: 50%;
166
+ margin-top: -55px;
167
+ padding: 0;
168
+ width: 90px;
169
+ height: 110px;
170
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
171
+ .mfp-arrow:active {
172
+ margin-top: -54px; }
173
+ .mfp-arrow:hover, .mfp-arrow:focus {
174
+ opacity: 1;
175
+ filter: alpha(opacity=100); }
176
+ .mfp-arrow:before, .mfp-arrow:after, .mfp-arrow .mfp-b, .mfp-arrow .mfp-a {
177
+ content: '';
178
+ display: block;
179
+ width: 0;
180
+ height: 0;
181
+ position: absolute;
182
+ left: 0;
183
+ top: 0;
184
+ margin-top: 35px;
185
+ margin-left: 35px;
186
+ border: medium inset transparent; }
187
+ .mfp-arrow:after, .mfp-arrow .mfp-a {
188
+ border-top-width: 13px;
189
+ border-bottom-width: 13px;
190
+ top: 8px; }
191
+ .mfp-arrow:before, .mfp-arrow .mfp-b {
192
+ border-top-width: 21px;
193
+ border-bottom-width: 21px;
194
+ opacity: 0.7; }
195
+
196
+ .mfp-arrow-left {
197
+ left: 0; }
198
+ .mfp-arrow-left:after, .mfp-arrow-left .mfp-a {
199
+ border-right: 17px solid white;
200
+ margin-left: 31px; }
201
+ .mfp-arrow-left:before, .mfp-arrow-left .mfp-b {
202
+ margin-left: 25px;
203
+ border-right: 27px solid #3f3f3f; }
204
+
205
+ .mfp-arrow-right {
206
+ right: 0; }
207
+ .mfp-arrow-right:after, .mfp-arrow-right .mfp-a {
208
+ border-left: 17px solid white;
209
+ margin-left: 39px; }
210
+ .mfp-arrow-right:before, .mfp-arrow-right .mfp-b {
211
+ border-left: 27px solid #3f3f3f; }
212
+
213
+ .mfp-iframe-holder {
214
+ padding-top: 40px;
215
+ padding-bottom: 40px; }
216
+ .mfp-iframe-holder .mfp-content {
217
+ line-height: 0;
218
+ width: 100%;
219
+ max-width: 900px; }
220
+ .mfp-iframe-holder .mfp-close {
221
+ top: -40px; }
222
+
223
+ .mfp-iframe-scaler {
224
+ width: 100%;
225
+ height: 0;
226
+ overflow: hidden;
227
+ padding-top: 56.25%; }
228
+ .mfp-iframe-scaler iframe {
229
+ position: absolute;
230
+ display: block;
231
+ top: 0;
232
+ left: 0;
233
+ width: 100%;
234
+ height: 100%;
235
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
236
+ background: black; }
237
+
238
+ /* Main image in popup */
239
+ img.mfp-img {
240
+ width: auto;
241
+ max-width: 100%;
242
+ height: auto;
243
+ display: block;
244
+ line-height: 0;
245
+ -webkit-box-sizing: border-box;
246
+ -moz-box-sizing: border-box;
247
+ box-sizing: border-box;
248
+ padding: 40px 0 40px;
249
+ margin: 0 auto; }
250
+
251
+ /* The shadow behind the image */
252
+ .mfp-figure {
253
+ line-height: 0; }
254
+ .mfp-figure:after {
255
+ content: '';
256
+ position: absolute;
257
+ left: 0;
258
+ top: 40px;
259
+ bottom: 40px;
260
+ display: block;
261
+ right: 0;
262
+ width: auto;
263
+ height: auto;
264
+ z-index: -1;
265
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
266
+ background: #444444; }
267
+ .mfp-figure small {
268
+ color: #bdbdbd;
269
+ display: block;
270
+ font-size: 12px;
271
+ line-height: 14px; }
272
+ .mfp-figure figure {
273
+ margin: 0; }
274
+
275
+ .mfp-bottom-bar {
276
+ margin-top: -36px;
277
+ position: absolute;
278
+ top: 100%;
279
+ left: 0;
280
+ width: 100%;
281
+ cursor: auto; }
282
+
283
+ .mfp-title {
284
+ text-align: left;
285
+ line-height: 18px;
286
+ color: #f3f3f3;
287
+ word-wrap: break-word;
288
+ padding-right: 36px; }
289
+
290
+ .mfp-image-holder .mfp-content {
291
+ max-width: 100%; }
292
+
293
+ .mfp-gallery .mfp-image-holder .mfp-figure {
294
+ cursor: pointer; }
295
+
296
+ @media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
297
+ /**
298
+ * Remove all paddings around the image on small screen
299
+ */
300
+ .mfp-img-mobile .mfp-image-holder {
301
+ padding-left: 0;
302
+ padding-right: 0; }
303
+ .mfp-img-mobile img.mfp-img {
304
+ padding: 0; }
305
+ .mfp-img-mobile .mfp-figure:after {
306
+ top: 0;
307
+ bottom: 0; }
308
+ .mfp-img-mobile .mfp-figure small {
309
+ display: inline;
310
+ margin-left: 5px; }
311
+ .mfp-img-mobile .mfp-bottom-bar {
312
+ background: rgba(0, 0, 0, 0.6);
313
+ bottom: 0;
314
+ margin: 0;
315
+ top: auto;
316
+ padding: 3px 5px;
317
+ position: fixed;
318
+ -webkit-box-sizing: border-box;
319
+ -moz-box-sizing: border-box;
320
+ box-sizing: border-box; }
321
+ .mfp-img-mobile .mfp-bottom-bar:empty {
322
+ padding: 0; }
323
+ .mfp-img-mobile .mfp-counter {
324
+ right: 5px;
325
+ top: 3px; }
326
+ .mfp-img-mobile .mfp-close {
327
+ top: 0;
328
+ right: 0;
329
+ width: 35px;
330
+ height: 35px;
331
+ line-height: 35px;
332
+ background: rgba(0, 0, 0, 0.6);
333
+ position: fixed;
334
+ text-align: center;
335
+ padding: 0; } }
336
+
337
+ @media all and (max-width: 900px) {
338
+ .mfp-arrow {
339
+ -webkit-transform: scale(0.75);
340
+ transform: scale(0.75); }
341
+ .mfp-arrow-left {
342
+ -webkit-transform-origin: 0;
343
+ transform-origin: 0; }
344
+ .mfp-arrow-right {
345
+ -webkit-transform-origin: 100%;
346
+ transform-origin: 100%; }
347
+ .mfp-container {
348
+ padding-left: 6px;
349
+ padding-right: 6px; } }
350
+
351
+ .mfp-ie7 .mfp-img {
352
+ padding: 0; }
353
+ .mfp-ie7 .mfp-bottom-bar {
354
+ width: 600px;
355
+ left: 50%;
356
+ margin-left: -300px;
357
+ margin-top: 5px;
358
+ padding-bottom: 5px; }
359
+ .mfp-ie7 .mfp-container {
360
+ padding: 0; }
361
+ .mfp-ie7 .mfp-content {
362
+ padding-top: 44px; }
363
+ .mfp-ie7 .mfp-close {
364
+ top: 0;
365
+ right: 0;
366
+ padding-top: 0; }
css/settings.css ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ img {
2
+ max-width: 100%;
3
+ height: auto;
4
+ }
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;
21
+ }
22
+ .nav-tab-wrapper a {
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;
31
+ }
32
+ .form-table {
33
+ margin-top: 0;
34
+ padding-top: 0.5em;
35
+ }
36
+ h2.nav-tab-wrapper {
37
+ border: none;
38
+ padding-left: 0;
39
+ }
40
+ h2.ead-title {
41
+ background: url(../images/icon-ead.png) no-repeat 0 14px;
42
+ padding-left: 46px;
43
+ padding-bottom: 25px;
44
+ }
45
+ .ead-left-wrap {
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;
81
+ height: 21px;
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;
132
+ border-color: #eee #eee #eee #7ad03a;
133
+ padding: 1px 12px;
134
+ }
135
+ div.awsm-error {
136
+ background: none repeat scroll 0 0 #fff;
137
+ border-color: #eee #eee #eee #dd3d36;
138
+ padding: 1px 12px;
139
+ }
140
+ 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;
168
+ 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
+ }
images/donate.gif ADDED
Binary file
images/ead-button.png ADDED
Binary file
images/ead-icon-sprite.jpg ADDED
Binary file
images/ead-small.png ADDED
Binary file
images/icon-close.png ADDED
Binary file
images/icon-ead.png ADDED
Binary file
images/icon-no.png ADDED
Binary file
images/icon-success.png ADDED
Binary file
images/icon-yes.png ADDED
Binary file
inc/functions.php ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ *
29
+ * @since 1.0
30
+ * @return Human readable file size
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
+ }
38
+
39
+ /**
40
+ * Sanitize dimensions (width, height)
41
+ *
42
+ * @since 1.0
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
189
+ *
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
+ ?>
inc/mime_types.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $mimetypes = array(
3
+ // Text formats
4
+ 'txt|asc|c|cc|h' => 'text/plain',
5
+ 'rtx' => 'text/richtext',
6
+ 'css' => 'text/css',
7
+ // Misc application formats
8
+ 'js' => 'application/javascript',
9
+ 'pdf' => 'application/pdf',
10
+ 'ai' => 'application/postscript',
11
+ 'tif' => 'image/tiff',
12
+ 'tiff' => 'image/tiff',
13
+ // MS Office formats
14
+ 'doc' => 'application/msword',
15
+ 'pot|pps|ppt' => 'application/vnd.ms-powerpoint',
16
+ 'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',
17
+ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
18
+ 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
19
+ 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
20
+ 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
21
+ 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
22
+ 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
23
+ // iWork formats
24
+ 'pages' => 'application/vnd.apple.pages',
25
+ //Additional Mime Types
26
+ 'svg' => 'image/svg+xml',
27
+ );
28
+ ?>
inc/popup.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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">
28
+ <div class="inner">
29
+ <div class="uploaded-doccument">
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>
inc/settings.php ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>
53
+ <div class="f-left ead-frame-width"><?php _e('Width', $this->text_domain); ?>
54
+ <input type="text" class="small" name="ead_width" value="<?php echo esc_attr( get_option('ead_width','100%') ); ?>" />
55
+ </div>
56
+ <div class="f-left ead-frame-height">
57
+ <?php _e('Height', $this->text_domain); ?>
58
+ <input type="text" class="small" name="ead_height" value="<?php echo esc_attr( get_option('ead_height','500px') ); ?>" />
59
+ </div>
60
+ <div class="clear"></div>
61
+ <span class="note"><?php _e('Enter values in pixels or percentage (Example: 500px or 100%)', $this->text_domain); ?></span>
62
+ </td>
63
+ </tr>
64
+ <tr valign="top">
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>
inc/support-mail.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) { exit; }
3
+ if ( 'POST' == $_SERVER['REQUEST_METHOD']) {
4
+ parse_str($_POST['contact'],$postdata);
5
+ parse_str($_POST['contact']);
6
+ if ( !$site_name OR !$email_id OR !$problem ){
7
+ $json['status'] = false;
8
+ $json['message'] = __('Please Fill Required Fields', $this->text_domain);
9
+ echo json_encode( $json);
10
+ die(0);
11
+ }
12
+ $emaildata = array('site_name'=>'Name','email_id'=>'Email','problem'=>'Problem');
13
+ $mailmessage = 'New Support request from: '.get_option('blogname') . "\r\n\r\n";
14
+ $mailmessage .= '<table width="99%" cellspacing="0" cellpadding="1" border="0" bgcolor="#EAEAEA">
15
+ <tbody>
16
+ <tr>
17
+ <td><table width="100%" cellspacing="0" cellpadding="5" border="0" bgcolor="#FFFFFF">
18
+ <tbody>'.ead_getemailnode($emaildata,$postdata).'</tbody>
19
+ </table>
20
+ </td>
21
+ </tr>
22
+ </tbody>
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;
30
+ $json['message'] = __('We will get back to you soon', $this->text_domain);
31
+ } else {
32
+ $json['status'] = false;
33
+ $json['message'] = __('Something went wrong', $this->text_domain);
34
+ }
35
+ echo json_encode($json);
36
+ }else{
37
+ $json['status'] = false;
38
+ $json['message'] = __('Cheating ?', $this->text_domain);
39
+ echo json_encode($json);
40
+ }
41
+ die(0);
42
+ ?>
43
+
js/embed.js ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ });
js/magnific-popup.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! Magnific Popup - v0.9.9 - 2014-09-06
2
+ * http://dimsemenov.com/plugins/magnific-popup/
3
+ * Copyright (c) 2014 Dmitry Semenov; */
4
+ (function(e){var t,n,i,o,r,a,s,l="Close",c="BeforeClose",d="AfterClose",u="BeforeAppend",p="MarkupParse",f="Open",m="Change",g="mfp",h="."+g,v="mfp-ready",C="mfp-removing",y="mfp-prevent-close",w=function(){},b=!!window.jQuery,I=e(window),x=function(e,n){t.ev.on(g+e+h,n)},k=function(t,n,i,o){var r=document.createElement("div");return r.className="mfp-"+t,i&&(r.innerHTML=i),o?n&&n.appendChild(r):(r=e(r),n&&r.appendTo(n)),r},T=function(n,i){t.ev.triggerHandler(g+n,i),t.st.callbacks&&(n=n.charAt(0).toLowerCase()+n.slice(1),t.st.callbacks[n]&&t.st.callbacks[n].apply(t,e.isArray(i)?i:[i]))},E=function(n){return n===s&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),s=n),t.currTemplate.closeBtn},_=function(){e.magnificPopup.instance||(t=new w,t.init(),e.magnificPopup.instance=t)},S=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1};w.prototype={constructor:w,init:function(){var n=navigator.appVersion;t.isIE7=-1!==n.indexOf("MSIE 7."),t.isIE8=-1!==n.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(n),t.isIOS=/iphone|ipad|ipod/gi.test(n),t.supportsTransition=S(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),o=e(document),t.popupsCache={}},open:function(n){i||(i=e(document.body));var r;if(n.isObj===!1){t.items=n.items.toArray(),t.index=0;var s,l=n.items;for(r=0;l.length>r;r++)if(s=l[r],s.parsed&&(s=s.el[0]),s===n.el[0]){t.index=r;break}}else t.items=e.isArray(n.items)?n.items:[n.items],t.index=n.index||0;if(t.isOpen)return t.updateItemHTML(),void 0;t.types=[],a="",t.ev=n.mainEl&&n.mainEl.length?n.mainEl.eq(0):o,n.key?(t.popupsCache[n.key]||(t.popupsCache[n.key]={}),t.currTemplate=t.popupsCache[n.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,n),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=k("bg").on("click"+h,function(){t.close()}),t.wrap=k("wrap").attr("tabindex",-1).on("click"+h,function(e){t._checkIfClose(e.target)&&t.close()}),t.container=k("container",t.wrap)),t.contentContainer=k("content"),t.st.preloader&&(t.preloader=k("preloader",t.container,t.st.tLoading));var c=e.magnificPopup.modules;for(r=0;c.length>r;r++){var d=c[r];d=d.charAt(0).toUpperCase()+d.slice(1),t["init"+d].call(t)}T("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(x(p,function(e,t,n,i){n.close_replaceWith=E(i.type)}),a+=" mfp-close-btn-in"):t.wrap.append(E())),t.st.alignTop&&(a+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:I.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:o.height(),position:"absolute"}),t.st.enableEscapeKey&&o.on("keyup"+h,function(e){27===e.keyCode&&t.close()}),I.on("resize"+h,function(){t.updateSize()}),t.st.closeOnContentClick||(a+=" mfp-auto-cursor"),a&&t.wrap.addClass(a);var u=t.wH=I.height(),m={};if(t.fixedContentPos&&t._hasScrollBar(u)){var g=t._getScrollbarSize();g&&(m.marginRight=g)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):m.overflow="hidden");var C=t.st.mainClass;return t.isIE7&&(C+=" mfp-ie7"),C&&t._addClassToMFP(C),t.updateItemHTML(),T("BuildControls"),e("html").css(m),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||i),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(v),t._setFocus()):t.bgOverlay.addClass(v),o.on("focusin"+h,t._onFocusIn)},16),t.isOpen=!0,t.updateSize(u),T(f),n},close:function(){t.isOpen&&(T(c),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(C),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){T(l);var n=C+" "+v+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(n+=t.st.mainClass+" "),t._removeClassFromMFP(n),t.fixedContentPos){var i={marginRight:""};t.isIE7?e("body, html").css("overflow",""):i.overflow="",e("html").css(i)}o.off("keyup"+h+" focusin"+h),t.ev.off(h),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,T(d)},updateSize:function(e){if(t.isIOS){var n=document.documentElement.clientWidth/window.innerWidth,i=window.innerHeight*n;t.wrap.css("height",i),t.wH=i}else t.wH=e||I.height();t.fixedContentPos||t.wrap.css("height",t.wH),T("Resize")},updateItemHTML:function(){var n=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),n.parsed||(n=t.parseEl(t.index));var i=n.type;if(T("BeforeChange",[t.currItem?t.currItem.type:"",i]),t.currItem=n,!t.currTemplate[i]){var o=t.st[i]?t.st[i].markup:!1;T("FirstMarkupParse",o),t.currTemplate[i]=o?e(o):!0}r&&r!==n.type&&t.container.removeClass("mfp-"+r+"-holder");var a=t["get"+i.charAt(0).toUpperCase()+i.slice(1)](n,t.currTemplate[i]);t.appendContent(a,i),n.preloaded=!0,T(m,n),r=n.type,t.container.prepend(t.contentContainer),T("AfterChange")},appendContent:function(e,n){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&t.currTemplate[n]===!0?t.content.find(".mfp-close").length||t.content.append(E()):t.content=e:t.content="",T(u),t.container.addClass("mfp-"+n+"-holder"),t.contentContainer.append(t.content)},parseEl:function(n){var i,o=t.items[n];if(o.tagName?o={el:e(o)}:(i=o.type,o={data:o,src:o.src}),o.el){for(var r=t.types,a=0;r.length>a;a++)if(o.el.hasClass("mfp-"+r[a])){i=r[a];break}o.src=o.el.attr("data-mfp-src"),o.src||(o.src=o.el.attr("href"))}return o.type=i||t.st.type||"inline",o.index=n,o.parsed=!0,t.items[n]=o,T("ElementParse",o),t.items[n]},addGroup:function(e,n){var i=function(i){i.mfpEl=this,t._openClick(i,e,n)};n||(n={});var o="click.magnificPopup";n.mainEl=e,n.items?(n.isObj=!0,e.off(o).on(o,i)):(n.isObj=!1,n.delegate?e.off(o).on(o,n.delegate,i):(n.items=e,e.off(o).on(o,i)))},_openClick:function(n,i,o){var r=void 0!==o.midClick?o.midClick:e.magnificPopup.defaults.midClick;if(r||2!==n.which&&!n.ctrlKey&&!n.metaKey){var a=void 0!==o.disableOn?o.disableOn:e.magnificPopup.defaults.disableOn;if(a)if(e.isFunction(a)){if(!a.call(t))return!0}else if(a>I.width())return!0;n.type&&(n.preventDefault(),t.isOpen&&n.stopPropagation()),o.el=e(n.mfpEl),o.delegate&&(o.items=i.find(o.delegate)),t.open(o)}},updateStatus:function(e,i){if(t.preloader){n!==e&&t.container.removeClass("mfp-s-"+n),i||"loading"!==e||(i=t.st.tLoading);var o={status:e,text:i};T("UpdateStatus",o),e=o.status,i=o.text,t.preloader.html(i),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),n=e}},_checkIfClose:function(n){if(!e(n).hasClass(y)){var i=t.st.closeOnContentClick,o=t.st.closeOnBgClick;if(i&&o)return!0;if(!t.content||e(n).hasClass("mfp-close")||t.preloader&&n===t.preloader[0])return!0;if(n===t.content[0]||e.contains(t.content[0],n)){if(i)return!0}else if(o&&e.contains(document,n))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?o.height():document.body.scrollHeight)>(e||I.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(n){return n.target===t.wrap[0]||e.contains(t.wrap[0],n.target)?void 0:(t._setFocus(),!1)},_parseMarkup:function(t,n,i){var o;i.data&&(n=e.extend(i.data,n)),T(p,[t,n,i]),e.each(n,function(e,n){if(void 0===n||n===!1)return!0;if(o=e.split("_"),o.length>1){var i=t.find(h+"-"+o[0]);if(i.length>0){var r=o[1];"replaceWith"===r?i[0]!==n[0]&&i.replaceWith(n):"img"===r?i.is("img")?i.attr("src",n):i.replaceWith('<img src="'+n+'" class="'+i.attr("class")+'" />'):i.attr(o[1],n)}}else t.find(h+"-"+e).html(n)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:w.prototype,modules:[],open:function(t,n){return _(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=n||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,n){n.options&&(e.magnificPopup.defaults[t]=n.options),e.extend(this.proto,n.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&times;</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(n){_();var i=e(this);if("string"==typeof n)if("open"===n){var o,r=b?i.data("magnificPopup"):i[0].magnificPopup,a=parseInt(arguments[1],10)||0;r.items?o=r.items[a]:(o=i,r.delegate&&(o=o.find(r.delegate)),o=o.eq(a)),t._openClick({mfpEl:o},i,r)}else t.isOpen&&t[n].apply(t,Array.prototype.slice.call(arguments,1));else n=e.extend(!0,{},n),b?i.data("magnificPopup",n):i[0].magnificPopup=n,t.addGroup(i,n);return i};var P,O,z,M="inline",B=function(){z&&(O.after(z.addClass(P)).detach(),z=null)};e.magnificPopup.registerModule(M,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(M),x(l+"."+M,function(){B()})},getInline:function(n,i){if(B(),n.src){var o=t.st.inline,r=e(n.src);if(r.length){var a=r[0].parentNode;a&&a.tagName&&(O||(P=o.hiddenClass,O=k(P),P="mfp-"+P),z=r.after(O).detach().removeClass(P)),t.updateStatus("ready")}else t.updateStatus("error",o.tNotFound),r=e("<div>");return n.inlineElement=r,r}return t.updateStatus("ready"),t._parseMarkup(i,{},n),i}}});var F,H="ajax",L=function(){F&&i.removeClass(F)},A=function(){L(),t.req&&t.req.abort()};e.magnificPopup.registerModule(H,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){t.types.push(H),F=t.st.ajax.cursor,x(l+"."+H,A),x("BeforeChange."+H,A)},getAjax:function(n){F&&i.addClass(F),t.updateStatus("loading");var o=e.extend({url:n.src,success:function(i,o,r){var a={data:i,xhr:r};T("ParseAjax",a),t.appendContent(e(a.data),H),n.finished=!0,L(),t._setFocus(),setTimeout(function(){t.wrap.addClass(v)},16),t.updateStatus("ready"),T("AjaxContentAdded")},error:function(){L(),n.finished=n.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",n.src))}},t.st.ajax.settings);return t.req=e.ajax(o),""}}});var j,N=function(n){if(n.data&&void 0!==n.data.title)return n.data.title;var i=t.st.image.titleSrc;if(i){if(e.isFunction(i))return i.call(t,n);if(n.el)return n.el.attr(i)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var e=t.st.image,n=".image";t.types.push("image"),x(f+n,function(){"image"===t.currItem.type&&e.cursor&&i.addClass(e.cursor)}),x(l+n,function(){e.cursor&&i.removeClass(e.cursor),I.off("resize"+h)}),x("Resize"+n,t.resizeImage),t.isLowIE&&x("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var n=0;t.isLowIE&&(n=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-n)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,j&&clearInterval(j),e.isCheckingImgSize=!1,T("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var n=0,i=e.img[0],o=function(r){j&&clearInterval(j),j=setInterval(function(){return i.naturalWidth>0?(t._onImageHasSize(e),void 0):(n>200&&clearInterval(j),n++,3===n?o(10):40===n?o(50):100===n&&o(500),void 0)},r)};o(1)},getImage:function(n,i){var o=0,r=function(){n&&(n.img[0].complete?(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("ready")),n.hasSize=!0,n.loaded=!0,T("ImageLoadComplete")):(o++,200>o?setTimeout(r,100):a()))},a=function(){n&&(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("error",s.tError.replace("%url%",n.src))),n.hasSize=!0,n.loaded=!0,n.loadError=!0)},s=t.st.image,l=i.find(".mfp-img");if(l.length){var c=document.createElement("img");c.className="mfp-img",n.img=e(c).on("load.mfploader",r).on("error.mfploader",a),c.src=n.src,l.is("img")&&(n.img=n.img.clone()),c=n.img[0],c.naturalWidth>0?n.hasSize=!0:c.width||(n.hasSize=!1)}return t._parseMarkup(i,{title:N(n),img_replaceWith:n.img},n),t.resizeImage(),n.hasSize?(j&&clearInterval(j),n.loadError?(i.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",n.src))):(i.removeClass("mfp-loading"),t.updateStatus("ready")),i):(t.updateStatus("loading"),n.loading=!0,n.hasSize||(n.imgHidden=!0,i.addClass("mfp-loading"),t.findImageSize(n)),i)}}});var W,R=function(){return void 0===W&&(W=void 0!==document.createElement("p").style.MozTransform),W};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,n=t.st.zoom,i=".zoom";if(n.enabled&&t.supportsTransition){var o,r,a=n.duration,s=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),i="all "+n.duration/1e3+"s "+n.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},r="transition";return o["-webkit-"+r]=o["-moz-"+r]=o["-o-"+r]=o[r]=i,t.css(o),t},d=function(){t.content.css("visibility","visible")};x("BuildControls"+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.content.css("visibility","hidden"),e=t._getItemToZoom(),!e)return d(),void 0;r=s(e),r.css(t._getOffset()),t.wrap.append(r),o=setTimeout(function(){r.css(t._getOffset(!0)),o=setTimeout(function(){d(),setTimeout(function(){r.remove(),e=r=null,T("ZoomAnimationEnded")},16)},a)},16)}}),x(c+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.st.removalDelay=a,!e){if(e=t._getItemToZoom(),!e)return;r=s(e)}r.css(t._getOffset(!0)),t.wrap.append(r),t.content.css("visibility","hidden"),setTimeout(function(){r.css(t._getOffset())},16)}}),x(l+i,function(){t._allowZoom()&&(d(),r&&r.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return t.currItem.hasSize?t.currItem.img:!1},_getOffset:function(n){var i;i=n?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var o=i.offset(),r=parseInt(i.css("padding-top"),10),a=parseInt(i.css("padding-bottom"),10);o.top-=e(window).scrollTop()-r;var s={width:i.width(),height:(b?i.innerHeight():i[0].offsetHeight)-a-r};return R()?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var Z="iframe",q="//about:blank",D=function(e){if(t.currTemplate[Z]){var n=t.currTemplate[Z].find("iframe");n.length&&(e||(n[0].src=q),t.isIE8&&n.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(Z,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(Z),x("BeforeChange",function(e,t,n){t!==n&&(t===Z?D():n===Z&&D(!0))}),x(l+"."+Z,function(){D()})},getIframe:function(n,i){var o=n.src,r=t.st.iframe;e.each(r.patterns,function(){return o.indexOf(this.index)>-1?(this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1):void 0});var a={};return r.srcAction&&(a[r.srcAction]=o),t._parseMarkup(i,a,n),t.updateStatus("ready"),i}}});var K=function(e){var n=t.items.length;return e>n-1?e-n:0>e?n+e:e},Y=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=t.st.gallery,i=".mfp-gallery",r=Boolean(e.fn.mfpFastClick);return t.direction=!0,n&&n.enabled?(a+=" mfp-gallery",x(f+i,function(){n.navigateByImgClick&&t.wrap.on("click"+i,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),o.on("keydown"+i,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),x("UpdateStatus"+i,function(e,n){n.text&&(n.text=Y(n.text,t.currItem.index,t.items.length))}),x(p+i,function(e,i,o,r){var a=t.items.length;o.counter=a>1?Y(n.tCounter,r.index,a):""}),x("BuildControls"+i,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var i=n.arrowMarkup,o=t.arrowLeft=e(i.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(y),a=t.arrowRight=e(i.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(y),s=r?"mfpFastClick":"click";o[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(k("b",o[0],!1,!0),k("a",o[0],!1,!0),k("b",a[0],!1,!0),k("a",a[0],!1,!0)),t.container.append(o.add(a))}}),x(m+i,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),x(l+i,function(){o.off(i),t.wrap.off("click"+i),t.arrowLeft&&r&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}),void 0):!1},next:function(){t.direction=!0,t.index=K(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=K(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,n=t.st.gallery.preload,i=Math.min(n[0],t.items.length),o=Math.min(n[1],t.items.length);for(e=1;(t.direction?o:i)>=e;e++)t._preloadItem(t.index+e);for(e=1;(t.direction?i:o)>=e;e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=K(n),!t.items[n].preloaded){var i=t.items[n];i.parsed||(i=t.parseEl(n)),T("LazyLoad",i),"image"===i.type&&(i.img=e('<img class="mfp-img" />').on("load.mfploader",function(){i.hasSize=!0}).on("error.mfploader",function(){i.hasSize=!0,i.loadError=!0,T("LazyLoadError",i)}).attr("src",i.src)),i.preloaded=!0}}}});var U="retina";e.magnificPopup.registerModule(U,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,n=e.ratio;n=isNaN(n)?n():n,n>1&&(x("ImageHasSize."+U,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),x("ElementParse."+U,function(t,i){i.src=e.replaceSrc(i,n)}))}}}}),function(){var t=1e3,n="ontouchstart"in window,i=function(){I.off("touchmove"+r+" touchend"+r)},o="mfpFastClick",r="."+o;e.fn.mfpFastClick=function(o){return e(this).each(function(){var a,s=e(this);if(n){var l,c,d,u,p,f;s.on("touchstart"+r,function(e){u=!1,f=1,p=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=p.clientX,d=p.clientY,I.on("touchmove"+r,function(e){p=e.originalEvent?e.originalEvent.touches:e.touches,f=p.length,p=p[0],(Math.abs(p.clientX-c)>10||Math.abs(p.clientY-d)>10)&&(u=!0,i())}).on("touchend"+r,function(e){i(),u||f>1||(a=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){a=!1},t),o())})})}s.on("click"+r,function(){a||o()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+r+" click"+r),n&&I.off("touchmove"+r+" touchend"+r)}}(),_()})(window.jQuery||window.Zepto);
language/ead-en_US.mo ADDED
Binary file
language/ead-en_US.po ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-10 11:22+0530\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: Awsm Innovations <hello@awsm.in>\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.6.10\n"
12
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "Language: en_US\n"
14
+
15
+ #: aswm-embed.php:77 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 aswm-embed.php:156 aswm-embed.php:174 aswm-embed.php:185
24
+ msgid "You do not have sufficient permissions to access this page."
25
+ msgstr ""
26
+
27
+ #: aswm-embed.php:129
28
+ msgid "Nothing to insert"
29
+ msgstr ""
30
+
31
+ #: aswm-embed.php:130
32
+ msgid "Add URL"
33
+ msgstr ""
34
+
35
+ #: aswm-embed.php:131
36
+ msgid "Verifying..."
37
+ msgstr ""
38
+
39
+ #: inc/functions.php:87
40
+ msgid "Download"
41
+ msgstr ""
42
+
43
+ #: inc/functions.php:105
44
+ msgid "Done"
45
+ msgstr ""
46
+
47
+ #: inc/functions.php:110
48
+ msgid "Document"
49
+ msgstr ""
50
+
51
+ #: inc/functions.php:115
52
+ msgid "File format is not supported."
53
+ msgstr ""
54
+
55
+ #: inc/functions.php:120
56
+ msgid "Not a valid URL. Please try again."
57
+ msgstr ""
58
+
59
+ #: inc/functions.php:127
60
+ msgid "Sorry, the file URL is not valid."
61
+ msgstr ""
62
+
63
+ #: inc/functions.php:175
64
+ msgid "No Url Found"
65
+ msgstr ""
66
+
67
+ #: inc/popup.php:12
68
+ msgid "Upload and Embed"
69
+ msgstr ""
70
+
71
+ #: inc/popup.php:13
72
+ msgid "Add From URL"
73
+ msgstr ""
74
+
75
+ #: inc/popup.php:21
76
+ msgid "Enter document URL"
77
+ msgstr ""
78
+
79
+ #: inc/popup.php:33
80
+ msgid "Advanced Options"
81
+ msgstr ""
82
+
83
+ #: inc/popup.php:43 inc/settings.php:38
84
+ msgid "Show Download Link"
85
+ msgstr ""
86
+
87
+ #: inc/popup.php:45 inc/settings.php:41
88
+ msgid "For all users"
89
+ msgstr ""
90
+
91
+ #: inc/popup.php:45 inc/settings.php:41
92
+ msgid "For Logged-in users"
93
+ msgstr ""
94
+
95
+ #: inc/popup.php:45 inc/settings.php:41
96
+ msgid "None"
97
+ msgstr ""
98
+
99
+ #: inc/popup.php:53
100
+ msgid "Shortcode Preview"
101
+ msgstr ""
102
+
103
+ #: inc/popup.php:62
104
+ msgid "Insert"
105
+ msgstr ""
106
+
107
+ #: inc/popup.php:66
108
+ msgid "Cancel"
109
+ msgstr ""
110
+
111
+ #: inc/settings.php:3
112
+ msgid "Embed Any Document by AWSM.in"
113
+ msgstr ""
114
+
115
+ #: inc/settings.php:5
116
+ msgid "General Settings"
117
+ msgstr ""
118
+
119
+ #: inc/settings.php:6
120
+ msgid "Support"
121
+ msgstr ""
122
+
123
+ #: inc/settings.php:15
124
+ msgid "Embed Using"
125
+ msgstr ""
126
+
127
+ #: inc/settings.php:18
128
+ msgid "Google Docs Viewer"
129
+ msgstr ""
130
+
131
+ #: inc/settings.php:18
132
+ msgid "Microsoft Office Online"
133
+ msgstr ""
134
+
135
+ #: inc/settings.php:24
136
+ msgid "Default Size"
137
+ msgstr ""
138
+
139
+ #: inc/settings.php:26
140
+ msgid "Width"
141
+ msgstr ""
142
+
143
+ #: inc/settings.php:30
144
+ msgid "Height"
145
+ msgstr ""
146
+
147
+ #: inc/settings.php:34
148
+ msgid "Enter values in pixels or percentage (Example: 300px or 100%)"
149
+ msgstr ""
150
+
151
+ #: inc/settings.php:55
152
+ msgid "Name"
153
+ msgstr ""
154
+
155
+ #: inc/settings.php:62
156
+ msgid "Email ID"
157
+ msgstr ""
158
+
159
+ #: inc/settings.php:69
160
+ msgid "Problem"
161
+ msgstr ""
162
+
163
+ #: inc/settings.php:77
164
+ msgid "Submit"
165
+ msgstr ""
166
+
167
+ #: inc/support-mail.php:8
168
+ msgid "Please Fill Required Fields"
169
+ msgstr ""
170
+
171
+ #: inc/support-mail.php:30
172
+ msgid "We will get back to you soon"
173
+ msgstr ""
174
+
175
+ #: inc/support-mail.php:33
176
+ msgid "Something went wrong"
177
+ msgstr ""
178
+
179
+ #: inc/support-mail.php:38
180
+ msgid "Cheating ?"
181
+ msgstr ""
182
+
183
+ #: inc/functions.php:180
184
+ msgid "File Not Found"
185
+ msgstr ""
language/ead.pot ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"
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
+
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
+
readme.txt ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Embed Any Document ===
2
+ Contributors: awsmin
3
+ 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
+
11
+ Easiest way to upload and display PDF, MS Office and more documents on your WordPress website using Google Docs Viewer or Microsoft Office Online.
12
+
13
+ == Summary ==
14
+
15
+ Seamlessly embed and display PDF, Microsoft Word, Excel and PowerPoint documents on your WordPress website.
16
+
17
+ == Description ==
18
+
19
+ 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.
20
+
21
+ <a href="http://dev.awsm.in/innovations/embed-any-document-plugin-demo/">Live Demo</a>
22
+
23
+ <h4>Supported file types</h4>
24
+
25
+ * Microsoft Word (docx, docm, dotm, dotx)
26
+ * Microsoft Excel (xlsx, xlsb, xls, xlsm)
27
+ * Microsoft PowerPoint (pptx, ppsx, ppt, pps, pptm, potm, ppam, potx, ppsm)
28
+ * Adobe Portable Document Format (pdf)
29
+ * Text files (txt)
30
+ * TIFF Images (tif, tiff)
31
+ * Adobe Illustrator (ai)
32
+ * Scalable Vector Graphics (svg)
33
+
34
+ <h4>Key Benefits of Embed Any Document WordPress plugin </h4>
35
+
36
+ 1. <strong>Easy to Upload and Embed.</strong> Embed Any Document is integrated seamlessly into the post editor. With a click of ‘Add Document’ button it lets you upload documents directly into media library and embed them.
37
+
38
+ 2. <strong>No 3rd party plugin needed.</strong> The plugin uses Google Docs Viewer and Microsoft Office Online’s services to display the documents in your website. You will not require any additional browser plugins to view the documents and you can expect maximum compatibility for your documents.
39
+
40
+ 3. <strong>Option to choose the viewer.</strong> You can choose between Google Docs Viewer and Microsoft Office Online to display your document. If one service is down, you can switch to another easily.
41
+
42
+ 4. <strong>Cross-browser compatibility.</strong> The viewers are mobile-ready and cross-browser compatible.
43
+
44
+ 5. <strong>Clean and Minimal UI.</strong> Embed Any Document comes with a clean and clutter-free UI.
45
+
46
+ <h4>Video Demo</h4>
47
+
48
+ [youtube https://www.youtube.com/watch?v=DUW_aEEcBrI]
49
+
50
+ For more information and instructions visit <a href="http://awsm.in/embed-any-document/" target="_blank">our website.</a>.
51
+
52
+ This is an <a href="http://awsm.in" target=“_blank”>AWSM</a> Project.
53
+
54
+
55
+ == Installation ==
56
+
57
+ 1. Upload the entire `embed-any-documents` folder to the `/wp-content/plugins/` directory.
58
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
59
+ 3. Done.
60
+
61
+ Upload or link the documents to your site using the ‘Add Document’ button in the Visual editor.
62
+
63
+ == Screenshots ==
64
+
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 ==
72
+
73
+ = How do I add documents? =
74
+ Once the plugin is activated you can find ‘Add Document’ button in your WordPress visual editor. Just click on that and follow your heart.
75
+
76
+ = File not found error in my localhost site! =
77
+ The viewers (Google Docs Viewer and Microsoft Office Online) do not support locally hosted files. Your document has to be available online for the viewers to access.
78
+
79
+ = I have another question that you must add in your FAQ. =
80
+ 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.
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.png ADDED
Binary file