Changeset 1057184
- Timestamp:
- 12/30/2014 11:06:47 PM (10 years ago)
- Location:
- fullscreen-preview-button/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
fullscreen-preview-button/trunk/README.txt
r657138 r1057184 1 === FullscreenPreview Button ===1 === Preview Button === 2 2 Contributors: alexkingorg 3 3 Tags: editor, fullscreen, preview 4 Requires at least: 3.55 Tested up to: 3.56 Stable tag: 1.24 Requires at least: 5 Tested up to: 6 Stable tag: 7 7 License: GPLv2 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 12 12 == Description == 13 13 14 This plugin adds a "preview" button to the fullscreen (distraction-free)editor.14 This plugin adds a "preview" button to the editor. 15 15 16 16 **Contributing** … … 56 56 == Changelog == 57 57 58 59 60 61 58 62 = 1.2 = 59 63 * First release on WordPress.org … … 69 73 == Upgrade Notice == 70 74 71 = 1.2=72 * First release on WordPress.org73 * Compatibility with WordPress 3.575 = = 76 * 77 * Compatibility with -
fullscreen-preview-button/trunk/fullscreen-preview-button.php
r657138 r1057184 2 2 3 3 /* 4 Plugin Name: FullscreenPreview Button5 Description: Add a preview button to the fullscreen editor toolbar.6 Version: 1.24 Plugin Name: Preview Button 5 Description: Add a preview button to the . 6 Version: 7 7 Author: Alex King 8 8 Author URI: http://alexking.org … … 14 14 <script type="text/javascript"> 15 15 ;(function($) { 16 var $preview = $('#post-preview'); 17 $preview.clone() 18 .removeAttr('id').removeClass('preview').addClass('right') 19 .css('margin-left', '5px') 20 .click(function(e) { 21 $preview.click(); 22 e.preventDefault(); 23 }) 24 .insertBefore('#wp-fullscreen-save input.button-primary'); 16 var $buttons = $('#wp-content-media-buttons'); 17 18 // add a preview button if one doesn't exist 19 $(document).on('dfw-on', function() { 20 var $exists = $buttons.find('#ak-fsp-button'); 21 if ($exists.length == 0) { 22 $buttons.append('<a href="#" id="ak-fsp-button" class="button"><?php _e('Preview'); ?></a>'); 23 } 24 }); 25 26 // when our preview button is clicked, execute the standard preview function 27 $(document).on('click', '#ak-fsp-button', function(e) { 28 e.preventDefault(); 29 $('#post-preview').click(); 30 $(this).blur(); 31 }); 32 33 // remove the preview button when exiting DFW 34 $(document).on('dfw-off', function() { 35 $buttons.find('#ak-fsp-button').remove(); 36 }); 25 37 }(jQuery)); 26 38 </script>
Note: See TracChangeset
for help on using the changeset viewer.