Make WordPress Core


Ignore:
Timestamp:
06/12/2014 02:48:17 AM (11 years ago)
Author:
azaozz
Message:

wpView:

  • Don't wrap single-line URLs in [embed]. Use them directly in generating a view.
  • If the embedding HTML contains a script, "sandbox" it in an iframe to prevent it from changing the editor DOM.
  • Automatically add toolbar and overlay when needed.
  • Try to embed single-line URLs only if they are pasted in an empty paragraph.

Props avryl, see #28195

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media-template.php

    r28683 r28748  
    995995
    996996    <script type="text/html" id="tmpl-editor-gallery">
    997         <div class="toolbar">
    998             <div class="dashicons dashicons-edit edit"></div><div class="dashicons dashicons-no-alt remove"></div>
    999         </div>
    1000997        <# if ( data.attachments ) { #>
    1001998            <div class="gallery gallery-columns-{{ data.columns }}">
     
    10281025
    10291026    <script type="text/html" id="tmpl-editor-audio">
    1030         <div class="toolbar">
    1031             <div class="dashicons dashicons-edit edit"></div>
    1032             <div class="dashicons dashicons-no-alt remove"></div>
    1033         </div>
    10341027        <?php wp_underscore_audio_template() ?>
    1035         <div class="wpview-overlay"></div>
    10361028    </script>
    10371029
    10381030    <script type="text/html" id="tmpl-editor-video">
    1039         <div class="toolbar">
    1040             <div class="dashicons dashicons-edit edit"></div>
    1041             <div class="dashicons dashicons-no-alt remove"></div>
    1042         </div>
    10431031        <?php wp_underscore_video_template() ?>
    1044         <div class="wpview-overlay"></div>
    10451032    </script>
    10461033
     
    10481035
    10491036    <script type="text/html" id="tmpl-editor-playlist">
    1050         <div class="toolbar">
    1051             <div class="dashicons dashicons-edit edit"></div>
    1052             <div class="dashicons dashicons-no-alt remove"></div>
    1053         </div>
    10541037        <# if ( data.tracks ) { #>
    10551038            <div class="wp-playlist wp-{{ data.type }}-playlist wp-playlist-{{ data.style }}">
     
    10631046                <div class="wp-playlist-prev"></div>
    10641047            </div>
    1065             <div class="wpview-overlay"></div>
    10661048        <# } else { #>
    10671049            <div class="wpview-error">
     
    10741056        <img class="crop-image" src="{{ data.url }}">
    10751057        <div class="upload-errors"></div>
    1076     </script>
    1077 
    1078     <script type="text/html" id="tmpl-editor-embed">
    1079         <div class="toolbar">
    1080             <div class="dashicons dashicons-no-alt remove"></div>
    1081         </div>
    1082         {{{ data.content }}}
    1083         <div class="wpview-overlay"></div>
    10841058    </script>
    10851059
Note: See TracChangeset for help on using the changeset viewer.