~canonical-sysadmins/wordpress/4.2.4

« back to all changes in this revision

Viewing changes to wp-includes/class-wp-editor.php

  • Committer: Paul Gear
  • Date: 2015-04-24 01:35:20 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: paul.gear@canonical.com-20150424013520-w4p9ksth76zh6opw
Merge new upstream release 4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
                        // A cookie (set when a user resizes the editor) overrides the height.
118
118
                        $cookie = (int) get_user_setting( 'ed_size' );
119
119
 
120
 
                        // Upgrade an old TinyMCE cookie if it is still around, and the new one isn't.
121
 
                        if ( ! $cookie && isset( $_COOKIE['TinyMCE_content_size'] ) ) {
122
 
                                parse_str( $_COOKIE['TinyMCE_content_size'], $cookie );
123
 
                                $cookie = $cookie['ch'];
124
 
                        }
125
 
 
126
120
                        if ( $cookie )
127
121
                                $set['editor_height'] = $cookie;
128
122
                }
360
354
                                                'wordpress',
361
355
                                                'wpautoresize',
362
356
                                                'wpeditimage',
 
357
                                                'wpemoji',
363
358
                                                'wpgallery',
364
359
                                                'wplink',
365
360
                                                'wpdialogs',
490
485
                                                ],
491
486
                                                strikethrough: {inline: 'del'}
492
487
                                        }",
493
 
                                        'block_formats' =>
494
 
                                                'Paragraph=p;' .
495
 
                                                'Pre=pre;' .
496
 
                                                'Heading 1=h1;' .
497
 
                                                'Heading 2=h2;' .
498
 
                                                'Heading 3=h3;' .
499
 
                                                'Heading 4=h4;' .
500
 
                                                'Heading 5=h5;' .
501
 
                                                'Heading 6=h6',
502
488
                                        'relative_urls' => false,
503
489
                                        'remove_script_host' => false,
504
490
                                        'convert_urls' => false,
512
498
                                        // Limit the preview styles in the menu/toolbar
513
499
                                        'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform',
514
500
 
 
501
                                        'end_container_on_empty_block' => true,
515
502
                                        'wpeditimage_disable_captions' => $no_captions,
516
503
                                        'wpeditimage_html5_captions' => current_theme_supports( 'html5', 'caption' ),
517
504
                                        'plugins' => implode( ',', $plugins ),
584
571
                                 */
585
572
                                $mce_buttons = apply_filters( 'mce_buttons', $mce_buttons, $editor_id );
586
573
 
 
574
                                $mce_buttons_2 = array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo' );
 
575
 
 
576
                                if ( ! wp_is_mobile() ) {
 
577
                                        $mce_buttons_2[] = 'wp_help';
 
578
                                }
 
579
 
587
580
                                /**
588
581
                                 * Filter the second-row list of TinyMCE buttons (Visual tab).
589
582
                                 *
592
585
                                 * @param array  $buttons   Second-row list of buttons.
593
586
                                 * @param string $editor_id Unique editor identifier, e.g. 'content'.
594
587
                                 */
595
 
                                $mce_buttons_2 = apply_filters( 'mce_buttons_2', array( 'formatselect', 'underline', 'alignjustify', 'forecolor', 'pastetext', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' ), $editor_id );
 
588
                                $mce_buttons_2 = apply_filters( 'mce_buttons_2', $mce_buttons_2, $editor_id );
596
589
 
597
590
                                /**
598
591
                                 * Filter the third-row list of TinyMCE buttons (Visual tab).
1251
1244
                $width = isset( $content_width ) && 800 > $content_width ? $content_width : 800;
1252
1245
                $width = $width + 22; // compensate for the padding and border
1253
1246
                $dfw_width = get_user_setting( 'dfw_width', $width );
1254
 
                $save = isset( $post->post_status ) && $post->post_status == 'publish' ? __('Update') : __('Save');
 
1247
                $save = $post && $post->post_status == 'publish' ? __('Update') : __('Save');
1255
1248
 
1256
1249
                ?>
1257
1250
                <div id="wp-fullscreen-body" class="wp-core-ui<?php if ( is_rtl() ) echo ' rtl'; ?>" data-theme-width="<?php echo (int) $width; ?>" data-dfw-width="<?php echo (int) $dfw_width; ?>">
1316
1309
 
1317
1310
                <div id="wp-fullscreen-save">
1318
1311
                        <input type="button" class="button button-primary right" value="<?php echo $save; ?>" onclick="wp.editor.fullscreen.save();" />
1319
 
                        <span class="wp-fullscreen-saved-message"><?php if ( $post->post_status == 'publish' ) _e('Updated.'); else _e('Saved.'); ?></span>
 
1312
                        <span class="wp-fullscreen-saved-message"><?php if ( $post && $post->post_status == 'publish' ) _e('Updated.'); else _e('Saved.'); ?></span>
1320
1313
                        <span class="wp-fullscreen-error-message"><?php _e('Save failed.'); ?></span>
1321
1314
                        <span class="spinner"></span>
1322
1315
                </div>
1448
1441
                        <div id="link-options">
1449
1442
                                <p class="howto"><?php _e( 'Enter the destination URL' ); ?></p>
1450
1443
                                <div>
1451
 
                                        <label><span><?php _e( 'URL' ); ?></span><input id="url-field" type="text" name="href" /></label>
 
1444
                                        <label><span><?php _e( 'URL' ); ?></span><input id="wp-link-url" type="text" /></label>
1452
1445
                                </div>
1453
 
                                <div>
1454
 
                                        <label><span><?php _e( 'Title' ); ?></span><input id="link-title-field" type="text" name="linktitle" /></label>
 
1446
                                <div class="wp-link-text-field">
 
1447
                                        <label><span><?php _e( 'Link Text' ); ?></span><input id="wp-link-text" type="text" /></label>
1455
1448
                                </div>
1456
1449
                                <div class="link-target">
1457
 
                                        <label><span>&nbsp;</span><input type="checkbox" id="link-target-checkbox" /> <?php _e( 'Open link in a new window/tab' ); ?></label>
 
1450
                                        <label><span>&nbsp;</span><input type="checkbox" id="wp-link-target" /> <?php _e( 'Open link in a new window/tab' ); ?></label>
1458
1451
                                </div>
1459
1452
                        </div>
1460
1453
                        <p class="howto"><a href="#" id="wp-link-search-toggle"><?php _e( 'Or link to existing content' ); ?></a></p>
1462
1455
                                <div class="link-search-wrapper">
1463
1456
                                        <label>
1464
1457
                                                <span class="search-label"><?php _e( 'Search' ); ?></span>
1465
 
                                                <input type="search" id="search-field" class="link-search-field" autocomplete="off" />
 
1458
                                                <input type="search" id="wp-link-search" class="link-search-field" autocomplete="off" />
1466
1459
                                                <span class="spinner"></span>
1467
1460
                                        </label>
1468
1461
                                </div>