Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter chidoti

    (@chidoti)

    It works fine! Thank you a lot!

    Thread Starter chidoti

    (@chidoti)

    Thank you a lot! Have a nice day!

    Thread Starter chidoti

    (@chidoti)

    Thanks a lot for the update.

    It’s ok to pay for that, but it’s an important feature indeed.
    Also a couple of suggestions:
    1. An option to set bold borders for some of the cells. Really helps to navigate complex tables.
    2. A cross hover which would show not only horizontal raw cell position but also a vertical column. That’s handy for tables with data (as opposed to “compare products” tables).

    • This reply was modified 4 years, 4 months ago by chidoti.
    Thread Starter chidoti

    (@chidoti)

    Thank you a lot for the support!

    Thread Starter chidoti

    (@chidoti)

    Now it’s clear for me. Thanks a lot!

    I have the same issue. It’s unclear why it happens, didn’t received such an issue previously. That’s make the plugin unusable ??

    Thread Starter chidoti

    (@chidoti)

    Thanks a lot Jake! You’ve explained it perfectly clear.

    Thread Starter chidoti

    (@chidoti)

    Thanks, Yui! I’ll keep that it mind, I didn’t know there. The feedback, surely meant only “it maybe useful to add an option read the English original”. Don’t consider my message as a complaint, as I am happy to use such a great product for free and really gratefull for it.

    chidoti

    (@chidoti)

    I love this plugin as it shows everything crisp unlike google docs embed. I was looking how to fix it and found that the problem is in pdf-viewer.php.
    FILTER_VALIDATE_URL doesn’t work with protocol relative url. So I used following idea from someone on the internet:
    public function validate($input)
    {
    $valid = filter_var($input, FILTER_VALIDATE_URL);

    + // Simple workaround for protocol relative urls.
    + // If sticking a protocol on the front makes it valid, assume it’s valid
    + if(!$valid)
    + $valid = filter_var(‘http:’.$input, FILTER_VALIDATE_URL);

    return !!$valid;
    }

    Change the function add_shortcode() with following code (it’s works the same as the example above actually)

    public function add_shortcode( $atts, $content = "" ) {
    		
    
    		
    		if ( !empty($content) && filter_var($content, FILTER_VALIDATE_URL) ) {
    
    			//TODO: filter URL to check if PDF only
    			
    			
    			if ( $this->older_ie($this->options['olderIE']) ) {
    				
    				$notice = str_replace('%%PDF_URL%%', $content, $this->options['ta_notice']);
    				echo html_entity_decode($notice);
    				
    			} else {
    				
    				$atts = shortcode_atts(
    					array(
    						'width' => $this->options['tx_width'],
    						'height' => $this->options['tx_height'],
    						'beta' => empty($this->options['beta']) ? 0 : "true",
    					), 
    					$atts,
    					'pdfviewer' 
    				);
    				
    				$pdfjs_mode = ( $atts['beta'] === "true" ) ? 'beta' : 'stable';
    				$pdfjs_url = plugin_dir_url( __FILE__ ).$pdfjs_mode.'/web/viewer.html?file='.$content;
    				
    				$pdfjs_iframe = '<iframe class="pdfjs-viewer" width="'.$atts['width'].'" height="'.$atts['height'].'" src="'.$pdfjs_url.'"></iframe> ';
    				
    				return $pdfjs_iframe;
    			}
    		} else {
    			
    			if ( !empty($content) && filter_var('https:'.$content, FILTER_VALIDATE_URL) ) {
    
    			//TODO: filter URL to check if PDF only
    			
    			
    				if ( $this->older_ie($this->options['olderIE']) ) {
    					
    					$notice = str_replace('%%PDF_URL%%', $content, $this->options['ta_notice']);
    					echo html_entity_decode($notice);
    				
    				} else {
    				
    					$atts = shortcode_atts(
    						array(
    							'width' => $this->options['tx_width'],
    							'height' => $this->options['tx_height'],
    							'beta' => empty($this->options['beta']) ? 0 : "true",
    						), 
    						$atts,
    						'pdfviewer' 
    					);
    				
    					$pdfjs_mode = ( $atts['beta'] === "true" ) ? 'beta' : 'stable';
    					$pdfjs_url = plugin_dir_url( __FILE__ ).$pdfjs_mode.'/web/viewer.html?file='.$content;
    				
    					$pdfjs_iframe = '<iframe class="pdfjs-viewer" width="'.$atts['width'].'" height="'.$atts['height'].'" src="'.$pdfjs_url.'"></iframe> ';
    				
    					return $pdfjs_iframe;
    				}			
    			} else {
    
    				if ( !empty($content) && filter_var('http:'.$content, FILTER_VALIDATE_URL) ) {
    
    			//TODO: filter URL to check if PDF only
    			
    			
    				if ( $this->older_ie($this->options['olderIE']) ) {
    					
    					$notice = str_replace('%%PDF_URL%%', $content, $this->options['ta_notice']);
    					echo html_entity_decode($notice);
    				
    				} else {
    				
    					$atts = shortcode_atts(
    						array(
    							'width' => $this->options['tx_width'],
    							'height' => $this->options['tx_height'],
    							'beta' => empty($this->options['beta']) ? 0 : "true",
    						), 
    						$atts,
    						'pdfviewer' 
    					);
    				
    					$pdfjs_mode = ( $atts['beta'] === "true" ) ? 'beta' : 'stable';
    					$pdfjs_url = plugin_dir_url( __FILE__ ).$pdfjs_mode.'/web/viewer.html?file='.$content;
    				
    					$pdfjs_iframe = '<iframe class="pdfjs-viewer" width="'.$atts['width'].'" height="'.$atts['height'].'" src="'.$pdfjs_url.'"></iframe> ';
    				
    					return $pdfjs_iframe;
    				}			
    			} else {
    
    				return 'Invalid URL for PDF Viewer';
    			}
    
    			}
    		}
    	}
    • This reply was modified 7 years ago by chidoti.
Viewing 9 replies - 1 through 9 (of 9 total)