Make WordPress Core

Changeset 6641


Ignore:
Timestamp:
01/22/2008 06:23:46 AM (16 years ago)
Author:
ryan
Message:

Port wphelp plugin to tinyMCE 3.0. Props azaozz. see #5703

Location:
trunk/wp-includes/js/tinymce
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/plugins/wordpress/langs/en.js

    r5880 r6641  
    1313}
    1414
    15 tinyMCE.addToLang('',{
     15tinyMCE.addI18n('',{
    1616wordpress_more_button : 'Split post with More tag (' + metaKey + '+t)',
    1717wordpress_page_button : 'Split post with Page tag',
  • trunk/wp-includes/js/tinymce/plugins/wphelp/editor_plugin.js

    r4747 r6641  
    1 /* Import plugin specific language pack */
    2 tinyMCE.importPluginLanguagePack('wphelp', '');
     1/* WordPress Help plugin for TinyMCE 3.x */
    32
    4 function TinyMCE_wphelp_getControlHTML(control_name) {
    5     switch (control_name) {
    6         case "wphelp":
    7             var titleHelp = tinyMCE.getLang('lang_help_button_title');
    8             var buttons = '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceWordPressHelp\')" target="_self" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceWordPressHelp\');return false;"><img id="{$editor_id}_help" src="{$pluginurl}/images/help.gif" title="'+titleHelp+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';
    9             var hiddenControls = '<div class="zerosize">'
    10             + '<input type="button" accesskey="b" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Bold\',false);" />'
    11             + '<input type="button" accesskey="i" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Italic\',false);" />'
    12             + '<input type="button" accesskey="d" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Strikethrough\',false);" />'
    13             + '<input type="button" accesskey="l" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'InsertUnorderedList\',false);" />'
    14             + '<input type="button" accesskey="o" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'InsertOrderedList\',false);" />'
    15             + '<input type="button" accesskey="w" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Outdent\',false);" />'
    16             + '<input type="button" accesskey="q" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Indent\',false);" />'
    17             + '<input type="button" accesskey="f" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'JustifyLeft\',false);" />'
    18             + '<input type="button" accesskey="c" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'JustifyCenter\',false);" />'
    19             + '<input type="button" accesskey="r" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'JustifyRight\',false);" />'
    20             + '<input type="button" accesskey="a" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceLink\',true);" />'
    21             + '<input type="button" accesskey="s" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'unlink\',false);" />'
    22             + '<input type="button" accesskey="m" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceImage\',true);" />'
    23             + '<input type="button" accesskey="t" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');" />'
    24             + '<input type="button" accesskey="u" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Undo\',false);" />'
    25             + '<input type="button" accesskey="y" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Redo\',false);" />'
    26             + '<input type="button" accesskey="e" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceCodeEditor\',false);" />'
    27             + '<input type="button" accesskey="h" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceWordPressHelp\',false);" />'
    28             + '</div>';
    29             return buttons+hiddenControls;
    30     }
     3(function() {
    314
    32     return "";
    33 }
     5//    tinymce.PluginManager.requireLangPack('wphelp');
     6   
     7    tinymce.create('tinymce.plugins.WP_Help', {
     8   
     9        init : function(ed, url) {
     10            // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
     11            ed.addCommand('wpHelp', function() {
     12                ed.windowManager.open({
     13                    file : tinymce.baseURL + '/wp-mce-help.php',
     14                    width : 450,
     15                    height : 420,
     16                    inline : 1
     17                }, {
     18                    plugin_url : url, // Plugin absolute URL
     19                    resizable : 'yes',
     20                    scrollbars : 'yes'
     21                });
     22            });
    3423
    35 function TinyMCE_wphelp_execCommand(editor_id, element, command, user_interface, value) {
     24            // Register example button
     25            ed.addButton('wphelp', {
     26                title : ed.getLang('advanced.help_desc'),
     27                cmd : 'wpHelp',
     28                image : url + '/images/help.gif'
     29            });
    3630
    37     // Handle commands
    38     switch (command) {
    39         case "mceWordPressHelp":
    40             var template = new Array();
     31            // Add a node change handler, selects the button in the UI when a image is selected
     32            ed.onNodeChange.add(function(ed, cm, n) {
     33                cm.setActive('wphelp', n.nodeName == 'IMG');
     34            });
     35        },
     36       
     37        getInfo : function() {
     38            return {
     39                longname : 'WordPress Help plugin',
     40                author : 'WordPress',
     41                authorurl : 'http://wordpress.org',
     42                infourl : 'http://wordpress.org',
     43                version : "3.0"
     44            };
     45        }
     46    });
    4147
    42             template['file']   = tinyMCE.baseURL + '/wp-mce-help.php';
    43             template['width']  = 480;
    44             template['height'] = 380;
    45 
    46             args = {
    47                 resizable : 'yes',
    48                 scrollbars : 'yes'
    49             };
    50 
    51             tinyMCE.openWindow(template, args);
    52             return true;
    53     }
    54 
    55     // Pass to next handler in chain
    56     return false;
    57 }
     48    // Register plugin
     49    tinymce.PluginManager.add('wphelp', tinymce.plugins.WP_Help);
     50})();
  • trunk/wp-includes/js/tinymce/tiny_mce_config.php

    r6632 r6641  
    2828    $invalid_elements = apply_filters('mce_invalid_elements', '');
    2929
    30     $plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'media' );
     30    $plugins = array( 'safari', 'inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress', 'wphelp', 'media' );
    3131    $plugins = apply_filters('mce_plugins', $plugins);
    3232    $plugins = implode($plugins, ',');
  • trunk/wp-includes/js/tinymce/wp-mce-help.php

    r6026 r6641  
    77<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
    88<title><?php _e('Rich Editor Help') ?></title>
     9<script type="text/javascript" src="tiny_mce_popup.js"></script>
    910<?php wp_admin_css(); ?>
    1011<style type="text/css">
    1112    #wphead {
    1213        padding-top: 5px;
    13         padding-bottom: 5px;
    1414        padding-left: 15px;
    15         font-size: 90%;
     15        font-size: 80%;
    1616    }
    1717    #adminmenu {
    1818        padding-top: 2px;
    19         padding-bottom: 2px;
    2019        padding-left: 15px;
    21         font-size: 94%;
     20        font-size: 80%;
    2221    }
    2322    #user_info {
    24         margin-top: 15px;
     23        right: 5%;
     24        top: 5px;
    2525    }
    2626    h2 {
     
    3636    }
    3737    #flipper {
    38         margin: 5px 10px 3px;
    39     }
     38        margin: 0;
     39        padding: 5px 20px 10px;
     40        background-color: #fff;
     41    }
     42    * html {
     43        overflow-x: hidden;
     44        overflow-y: scroll;
     45    }
    4046    #flipper div p {
    4147        margin-top: 0.4em;
     
    7379    #buttoncontainer {
    7480        text-align: center;
     81        margin-bottom: 20px;
    7582    }
    7683    #buttoncontainer a, #buttoncontainer a:hover {
     
    107114            t = d('tab'+i.toString());
    108115            if ( n == i ) {
    109                 c.className = '';
     116                c.className = 'vizible';
    110117                t.className = 'current';
    111118            } else {
     
    115122        }
    116123    }
     124   
     125    function init() {
     126        document.getElementById('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion;
     127        document.getElementById('date').innerHTML = tinymce.releaseDate;
     128    }
     129    tinyMCEPopup.onInit.add(init);
     130   
     131    // For modal dialogs in IE
     132    if (tinymce.isIE)
     133       document.write('<base target="_self" />');
    117134</script>
    118135</head>
     
    133150    <h2><?php _e('Rich Editing Basics') ?></h2>
    134151    <p><?php _e('<em>Rich editing</em>, also called WYSIWYG for What You See Is What You Get, means your text is formatted as you type. The rich editor creates HTML code behind the scenes while you concentrate on writing. Font styles, links and images all appear approximately as they will on the internet.') ?></p>
    135     <p><?php _e('WordPress includes a rich HTML editor that works well in most web browsers used today. It is powerful but it has limitations. Pasting text from other word processors may not give the results you expect. If you do not like the way the rich editor works, you may turn it off in the Your Profile and Personal Options form, under Users in the admin menu.') ?></p>
     152    <p><?php _e('WordPress includes a rich HTML editor that works well in most web browsers used today. It is powerful but it has limitations. Pasting text from other word processors may not give the results you expect. For best compatibility, use the "Paste as Plain Text" or "Paste from Word" buttons located on the extended (second) toolbar row.') ?></p>
     153    <p><?php _e('While using the editor, most basic keyboard shortcuts work like in any other text editor. For example: Shift+Enter inserts line break, Ctrl+C = copy, Ctrl+X = cut, Ctrl+Z = undo, Ctrl+Y = redo, Ctrl+B = bold, Ctrl+I = italic, Ctrl+U = underline, etc. (on Mac use the Apple key instead of Ctrl).') ?></p>
     154    <p><?php _e('If you do not like the way the rich editor works, you may turn it off in the Your Profile and Personal Options form, under Users in the admin menu.') ?></p>
    136155</div>
    137156
     
    147166<div id="content3" class="hidden">
    148167    <h2><?php _e('Writing at Full Speed') ?></h2>
    149     <p><?php _e('Rather than reaching for your mouse to click on the toolbar, use these access keys. Windows and Linux use Alt+&lt;letter>. Macintosh uses Ctrl+&lt;letter>.') ?></p>
     168    <p><?php _e('Rather than reaching for your mouse to click on the toolbar, use these access keys. Windows and Linux use Alt+&lt;letter>. Macintosh uses Ctrl+&lt;letter>.') ?></p>
    150169    <table id="keys" width="100%" border="0">
    151170        <tr class="top"><th class="key center"><?php _e('Letter') ?></th><th class="left"><?php _e('Action') ?></th><th class="key center"><?php _e('Letter') ?></th><th class="left"><?php _e('Action') ?></th></tr>
     
    164183<div id="content4" class="hidden">
    165184    <h2><?php _e('About TinyMCE'); ?></h2>
    166     <p><?php printf(__('Version: %s'), '2.0.9') ?></p>
     185   
     186    <p><?php _e('Version:'); ?> <span id="version"></span> (<span id="date"></span>)</p>
    167187    <p><?php printf(__('TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under %sLGPL</a> by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.'), '<a href="'.get_bloginfo('url').'/wp-includes/js/tinymce/license.txt" target="_blank" title="'.__('GNU Library General Public Licence').'">') ?></p>
    168     <p><?php _e('Copyright &copy; 2005, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.') ?></p>
     188    <p><?php _e('Copyright &copy; 2003-2007, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.') ?></p>
    169189    <p><?php _e('For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.') ?></p>
    170190
Note: See TracChangeset for help on using the changeset viewer.