Advertisement
sgaffney

evs add button

Feb 7th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.05 KB | None | 0 0
  1. <?php
  2. // And for non-tinyMCE and general functions
  3. function wp_evs_integrate_basic() {
  4.     ?>
  5.     <script type="text/javascript">
  6.     function WPEVSPopup() {
  7.      var evscode = prompt('Please enter your EasyVideoSuite code here. Audio files and lightboxes will work also!');
  8.      if(typeof(evscode) == 'string' && evscode.length > 0) {
  9.             var url = '<?php echo plugins_url('/wp-evs/images/placeholder.png?v=1'); ?>';
  10.  
  11.             evscode = evscode.replace('<!--', '').replace('//-->', '');
  12.  
  13.             evscode = base64_encode(evscode);
  14.  
  15.             var html = '<img class="wpevs-container" src="'+url+'" style="display: block; width: 400px; height: 200px;" alt="'+evscode+'" />';
  16.             edInsertContent(edCanvas, html);
  17.      }
  18.     }
  19.  
  20.     jQuery(document).ready(function() {
  21.         setTimeout(function() {
  22.             jQuery('#ed_toolbar').append('<input type="button" class="ed_button" onclick="WPEVSPopup()" title="Click" value="Embed an evs video" />');
  23.         }, 500);
  24.     });
  25.     </script>
  26.     <?php
  27. }
  28. add_action('edit_form_advanced', 'wp_evs_integrate_basic');
  29. add_action('edit_page_form', 'wp_evs_integrate_basic');
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement