Changeset 1238493
- Timestamp:
- 09/05/2015 03:46:33 AM (10 years ago)
- Location:
- tinywym-editor/trunk
- Files:
-
- 5 edited
-
css/tinywym-styles.css (modified) (2 diffs)
-
js/mce-plugin.js (modified) (1 diff)
-
languages/twym_editor.pot (modified) (3 diffs)
-
readme.txt (modified) (4 diffs)
-
tinywym-editor.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tinywym-editor/trunk/css/tinywym-styles.css
r1216264 r1238493 7 7 .tiny-wym body { 8 8 background: #f4f4f4; 9 font-size: 16px; 9 10 } 10 11 … … 16 17 .tiny-wym img { 17 18 max-width: 100%; 19 height: auto; 18 20 } 19 21 -
tinywym-editor/trunk/js/mce-plugin.js
r1216264 r1238493 178 178 classes: 'cancel', 179 179 onclick: 'close', 180 styles: 'color: red; float: right;' 180 181 }, 181 182 { -
tinywym-editor/trunk/languages/twym_editor.pot
r1216264 r1238493 4 4 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 5 5 "Project-Id-Version: tinyWYM Editor\n" 6 "POT-Creation-Date: 2015-0 8-06 18:27+1000\n"7 "PO-Revision-Date: 2015-0 8-06 18:27+1000\n"6 "POT-Creation-Date: 2015-09-05 13:40+1000\n" 7 "PO-Revision-Date: 2015-09-05 13:39+1000\n" 8 8 "Last-Translator: \n" 9 9 "Language-Team: \n" … … 20 20 "X-Poedit-SearchPath-0: .\n" 21 21 "X-Poedit-SearchPathExcluded-0: *.js\n" 22 23 #: tinywym-editor.php:49 24 msgid "Settings" 25 msgstr "" 22 26 23 27 #: translations.php:14 … … 53 57 msgstr "" 54 58 59 #: twym-admin-settings.php:19 twym-admin-settings.php:50 60 msgid "tinyWYM Editor Settings" 61 msgstr "" 62 55 63 #. Plugin Name of the plugin/theme 64 #: twym-admin-settings.php:20 56 65 msgid "tinyWYM Editor" 57 66 msgstr "" 58 67 68 #: twym-admin-settings.php:41 69 msgid "administrator" 70 msgstr "" 71 72 #: twym-admin-settings.php:42 73 msgid "editor" 74 msgstr "" 75 76 #: twym-admin-settings.php:43 77 msgid "author" 78 msgstr "" 79 80 #: twym-admin-settings.php:44 81 msgid "contributor" 82 msgstr "" 83 84 #: twym-admin-settings.php:66 85 #, php-format 86 msgid "%s Settings" 87 msgstr "" 88 89 #: twym-admin-settings.php:70 90 #, php-format 91 msgid "Disable for %ss" 92 msgstr "" 93 94 #: twym-admin-settings.php:78 95 msgid "Compatibility" 96 msgstr "" 97 98 #: twym-admin-settings.php:80 99 msgid "" 100 "Some plugins, such as Beaver Builder, disable other editor plugins when " 101 "using custom instances of the WordPress editor. Check the box below if " 102 "tinyWYM Editor appears to be disabled in some editor instances." 103 msgstr "" 104 105 #: twym-admin-settings.php:84 106 msgid "Force enable tinyWYM Editor" 107 msgstr "" 108 109 #: twym-admin-settings.php:90 110 msgid "Theme Editor Styles" 111 msgstr "" 112 113 #: twym-admin-settings.php:92 114 msgid "" 115 "Many themes include their own editor stylesheet which may cause conflicts " 116 "with tinyWYM Editor's own stylesheet. If you would like to allow your " 117 "theme's editor stylesheet to load anyway, check the box below." 118 msgstr "" 119 120 #: twym-admin-settings.php:96 121 msgid "Allow theme editor styles" 122 msgstr "" 123 124 #: twym-admin-settings.php:104 125 msgid "Save Settings" 126 msgstr "" 127 59 128 #. Description of the plugin/theme 60 msgid "Converts WordPress's WYSIWYG visual editor into a WYSIWYM editor" 129 msgid "" 130 "tinyWYM Editor converts WordPress's WYSIWYG visual editor into a WYSIWYM " 131 "editor. tinyWYM Editor also give the the control anf flexibility of the text " 132 "editor without having to leave the visual editor." 61 133 msgstr "" 62 134 -
tinywym-editor/trunk/readme.txt
r1218764 r1238493 3 3 Tags: tinyMCE, WYSIWYM, WP Editor 4 4 Requires at least: 4.2.0 5 Tested up to: 4. 2.36 Stable tag: 1. 0.15 Tested up to: 4.3 6 Stable tag: 1.1 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 37 37 = How do I create an HTML element from a selection? = 38 38 39 To create a new element from a selection first select some text. tinyWYM Editor plugin adds a new button to the toolbar. Click it and a dialogue will appear with a field for your new tag and any attributes you want to give it. Click the 'Okay' button. (You can also hit Ctrl+T instead of clicking the button to open the dialogue.)39 To create a new element from a selection first select some text. tinyWYM Editor plugin adds a new button to the toolbar. Click it and a dialogue will appear with a field for your new tag and any attributes you want to give it. Enter your new HTML tag and any desired attributes, then click the 'Okay' button. (You can also hit Ctrl+T instead of clicking the button to open the dialogue.) 40 40 41 41 = How do I wrap one HTML element in another HTML element? = 42 42 43 To wrap an element in another element, place the caret inside the element that you want to wrap. tinyWYM Editor plugin adds a new button to the toolbar. Click it and a dialogue will appear with a field for your new tag and any attributes you want to give it. Click the 'Okay' button. (You can also hit Ctrl+T instead of clicking the button to open the dialogue.)43 To wrap an element in another element, place the caret inside the element that you want to wrap. tinyWYM Editor plugin adds a new button to the toolbar. Click it and a dialogue will appear with a field for your new tag and any attributes you want to give it. Enter your new HTML tag and any desired attributes, then click the 'Okay' button. (You can also hit Ctrl+T instead of clicking the button to open the dialogue.) 44 44 45 45 = How do I edit or add attributes to an HTML element? = 46 46 47 Click any element while holding the Alt key and a dialogue will appear where you can edit the current HTML tag and any attributes it might have or you want to give it. Click the 'Okay' button.47 Click any element while holding the Alt key and a dialogue will appear where you can edit the current HTML tag and any attributes it might have or you want to give it. Enter your new HTML tag and any desired attributes, then click the 'Okay' button. 48 48 49 49 = How do I unwrap an HTML element from its parent element or remove text from its containing element? = 50 50 51 Click any element while holding the Shift+Alt and that element will be removed from the markup but preserveany inner text or child elements.51 Click any element while holding the Shift+Alt and that element will be removed from the markup preserving any inner text or child elements. 52 52 53 53 = Why does tinyWYM Editor remove my theme's editor styles? = 54 54 55 tinyWYM Editor removes the current theme's editor stylesheet. It does this partly in order to prevent conflicts with the theme's editor styles, but mainly because it is assumed that if you are using tinyWYM editor it is because you want to see the markup being posted to the front end of the site and not what it will eventually look like. After all, that is what the plugin is for. 55 tinyWYM Editor removes the current theme's editor stylesheet by default, however, you can enable your theme's editor stylesheet by going to Settings - tinyWYM Editor and checking 'Allow theme editor styles'. tinyWYM Editor removes other editor styles partly in order to prevent conflicts, but also because it is assumed that if you are using tinyWYM editor it is because you want to see the _markup_ being posted to the front end of the site and not what it will eventually look like. After all, that is what the plugin is for. 56 57 = Can I disable tinyWYM Editor for certain users = 58 59 tinyWYM Editor allows administrators to disable tinyWYM for particular user roles; Administrators, Editors, Authors, or Contributors. Go to Settings - tinyWYM Editor. 56 60 57 61 == Screenshots == … … 60 64 2. With tinyWYM installed: empty tags and superfluous markup revealed. 61 65 3. tinyWYM Editor converts WordPress's WYSIWYG editor into a WYSIWYM editor. 62 4. Create any HTML tag from selection -Select text then click the button or hit Ctrl+T.63 5. Wrap the current element in a new HTML element -Place caret in element you want to wrap, then click the button or hit Ctrl+T.64 6. Wrap multiple elements in a new HTML element -Select elements you want to wrap, then click the button or hit Ctrl+T.66 4. Create any HTML tag from selection: Select text then click the button or hit Ctrl+T. 67 5. Wrap the current element in a new HTML element: Place caret in element you want to wrap, then click the button or hit Ctrl+T. 68 6. Wrap multiple elements in a new HTML element: Select elements you want to wrap, then click the button or hit Ctrl+T. 65 69 7. Enter the new HTML tag name and any attributes you want it to have, then click 'Okay'. 66 70 8. Elements are now wrapped in a new tag. 67 9. Edit any element -Alt+Click any element then edit its tag and attributes.71 9. Edit any element: Alt+Click any element then edit its tag and attributes. 68 72 69 73 == Changelog == 74 75 = 1.1 = 76 77 * Added new settings page 78 * Added option for admins to disable tinyWYM for Administrators, Editors, Authors, or Contributors. 79 * Added option to re-enable the current theme's editor styles. 80 * Added option to increase tinyWYM priority when loading scripts. (This was mainly to allow tinyWYM to work with BeaverBuilder's front end editor.) 81 82 = 1.0.2 = 83 84 * CSS improvements 85 * Increase script loading priority to allow for use with beaverbuilder 70 86 71 87 = 1.0.1 = … … 79 95 == Upgrade Notice == 80 96 97 = 1.1 = 98 99 * Added new setting page: Setting - tinyWYM Editor 100 101 = 1.0.2 = 102 103 * Improved CSS for images inside editor, plus tinyWYM is now works with beaverbuilder 104 81 105 = 1.0 = 82 106 -
tinywym-editor/trunk/tinywym-editor.php
r1216766 r1238493 2 2 /* 3 3 Plugin Name: tinyWYM Editor 4 Description: Converts WordPress's WYSIWYG visual editor into a WYSIWYM editor5 Version: 1. 0.14 Description: tinyWYM Editor converts WordPress's WYSIWYG visual editor into a WYSIWYM editor. tinyWYM Editor also give the the control anf flexibility of the text editor without having to leave the visual editor. 5 Version: 1.1 6 6 Author: Andrew Rickards 7 7 License: GPL-2.0+ … … 25 25 */ 26 26 27 //* If this file is called directly, abort ==================================== 27 //* If this file is called directly, abort ==================================== */ 28 28 if ( ! defined( 'ABSPATH' ) ) { 29 29 exit; 30 30 } 31 31 32 //* Load Plugin textdomain ==================================================== 32 //* Load Plugin textdomain ==================================================== */ 33 33 add_action( 'plugins_loaded', 'twym_load_textdomain' ); 34 34 … … 39 39 } 40 40 41 //* Remove Theme's Editor Stylesheet ========================================== 42 add_action( 'admin_init', 'twym_remove_editor_styles' ); 41 //* Admin Settings ============================================================ */ 42 include 'twym-admin-settings.php'; 43 44 //* Plugins Page Settings Link 45 add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'twym_settings_link' ); 46 47 function twym_settings_link ( $links ) { 48 49 $links[] = '<a href="' . admin_url( 'options-general.php?page=tinywym-settings' ) . '">' . __( 'Settings', 'twym_editor' ) . '</a>'; 50 51 return $links; 52 } 53 54 //* Remove Theme's Editor Stylesheet ========================================== */ 55 add_action( 'admin_init', 'twym_remove_editor_styles', 999 ); 43 56 44 57 function twym_remove_editor_styles() { 58 59 $settings = get_option( 'twym_settings' ); 60 $theme_styles = isset( $settings[ 'theme_styles' ] ) ? '1' : false; 61 62 if ( '1' === $theme_styles ) { 63 return; 64 } 45 65 46 66 remove_editor_styles(); … … 48 68 } 49 69 50 //* Add Editor Stylesheet ===================================================== 70 //* Add Editor Stylesheet ===================================================== */ 51 71 add_filter( 'mce_css', 'twym_add_editor_styles' ); 52 72 … … 63 83 } 64 84 65 //* Register tinyMCE Plugin & Button ========================================== 85 //* Register tinyMCE Plugin & Button ========================================== */ 66 86 add_action( 'init', 'twym_register_mce_plugin' ); 67 87 68 88 function twym_register_mce_plugin() { 89 90 // Get tinyWYM Settings 91 $settings = get_option( 'twym_settings' ); 92 $disabled = isset( $settings[ 'disable' ] ) ? $settings[ 'disable' ] : []; 93 $priority = isset( $settings[ 'force_enable' ] ) ? 99999999 : 10; 94 95 // Extract user roles disabled in settings 96 extract( $disabled ); 97 98 // Define user capabilities 99 $admin_capabilities = current_user_can( 'manage_options' ); 100 $editor_capabilities = current_user_can( 'edit_pages' ) && ! current_user_can( 'manage_options' ) ? true : false; 101 $author_capabilities = current_user_can( 'edit_published_posts' ) && ! current_user_can( 'edit_pages' ) ? true : false; 102 $contributor_capabilities = current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_published_posts' ) ? true : false; 103 104 // Disable editor for various various user roles 105 if ( isset( $administrator ) && $admin_capabilities ) { 106 return; 107 } 108 109 if ( isset( $editor ) && $editor_capabilities ) { 110 return; 111 } 112 113 if ( isset( $author ) && $author_capabilities ) { 114 return; 115 } 116 117 if ( isset( $contributor ) && $contributor_capabilities ) { 118 return; 119 } 69 120 70 121 // Check user permissions … … 76 127 if ( get_user_option('rich_editing') == 'true') { 77 128 78 add_filter( 'mce_external_plugins', 'twym_add_mce_plugin' );79 add_filter( 'mce_buttons', 'twym_register_mce_button' );129 add_filter( 'mce_external_plugins', 'twym_add_mce_plugin', $priority ); 130 add_filter( 'mce_buttons', 'twym_register_mce_button', $priority ); 80 131 81 132 // Admin Styles for Modal Form … … 83 134 84 135 } 136 137 // Tranlations 138 add_filter( 'mce_external_languages', 'twym_load_translation'); 85 139 86 140 } … … 104 158 } 105 159 106 //* Enqueue Admin Styles for Modal Form ======================================= 160 //* Enqueue Admin Styles for Modal Form ======================================= */ 107 161 function twym_enqueue_admin_style() { 108 162 … … 112 166 } 113 167 114 //* Load Translation File ===================================================== 115 add_filter( 'mce_external_languages', 'twym_load_translation'); 116 168 //* Load Translation File ===================================================== */ 117 169 function twym_load_translation( $locales ) { 118 170
Note: See TracChangeset
for help on using the changeset viewer.