├── include ├── version.php ├── ThePaste │ ├── Core │ │ ├── CoreInterface.php │ │ ├── Core.php │ │ ├── Singleton.php │ │ ├── ComponentInterface.php │ │ └── Plugin.php │ ├── Admin │ │ ├── TinyMce │ │ │ ├── TinyMceThePaste.php │ │ │ └── TinyMce.php │ │ ├── WritingOptions.php │ │ ├── UserOptions.php │ │ ├── Admin.php │ │ └── AbstractOptions.php │ └── Asset │ │ └── Asset.php ├── template │ ├── the-paste-instructions.php │ ├── icons.php │ ├── uploader.php │ └── image-list.php └── autoload.php ├── languages ├── the-paste-de_DE.mo ├── the-paste.pot └── the-paste-de_DE.po ├── css └── admin │ ├── mce │ ├── the-paste-editor.css │ ├── the-paste-toolbar.css │ ├── the-paste-editor.css.map │ └── the-paste-toolbar.css.map │ ├── the-paste.css │ └── the-paste.css.map ├── index.php ├── readme.txt └── js └── admin ├── the-paste.js ├── mce └── the-paste-plugin.js └── the-paste.js.map /include/version.php: -------------------------------------------------------------------------------- 1 | 'absolute_url', 23 | * ] 24 | */ 25 | public function get_asset_roots(); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /include/ThePaste/Core/Core.php: -------------------------------------------------------------------------------- 1 | 8 | 22 | -------------------------------------------------------------------------------- /include/autoload.php: -------------------------------------------------------------------------------- 1 | [ 20 | 'thepaste_onoff' => 'pastetext', 21 | 'thepaste_preferfiles' => 'thepaste_onoff', 22 | ], 23 | ]; 24 | 25 | /** 26 | * @inheritdoc 27 | */ 28 | protected $toolbar_css = true; 29 | 30 | /** 31 | * @inheritdoc 32 | */ 33 | protected $editor_css = true; 34 | 35 | /** 36 | * @inheritdoc 37 | */ 38 | protected function __construct() { 39 | 40 | $this->plugin_params = []; 41 | $this->mce_settings = [ 42 | 'paste_data_images' => false, // 43 | ]; 44 | 45 | parent::__construct(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /include/ThePaste/Core/Singleton.php: -------------------------------------------------------------------------------- 1 | bool, 17 | * 'messages' => array, 18 | * ] 19 | */ 20 | public function activate(); 21 | 22 | /** 23 | * Called on Plugin upgrade 24 | * @param string $new_version 25 | * @param string $old_version 26 | * @return array [ 27 | * 'success' => bool, 28 | * 'messages' => array, 29 | * ] 30 | */ 31 | public function upgrade( $new_version, $old_version ); 32 | 33 | /** 34 | * Called on Plugin deactivation 35 | * @return array [ 36 | * 'success' => bool, 37 | * 'messages' => array, 38 | * ] 39 | */ 40 | public function deactivate(); 41 | 42 | /** 43 | * Called on Plugin uninstall 44 | * @param string $new_version 45 | * @param string $old_version 46 | * @return array [ 47 | * 'success' => bool, 48 | * 'messages' => array, 49 | * ] 50 | */ 51 | public static function uninstall(); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /css/admin/mce/the-paste-editor.css: -------------------------------------------------------------------------------- 1 | /* WordPress Dashicons Vars */ 2 | /* generated from https://raw.githubusercontent.com/WordPress/dashicons/master/codepoints.json */ 3 | progress.the-paste-progress { 4 | --bar-height: 4px; 5 | --bar-margin: 0px; 6 | --bar-padding: 0px; 7 | --bar-color: transparent; 8 | --bar-background: currentColor; 9 | --bar-border-radius: 3px; 10 | padding: 1px; 11 | position: relative; 12 | background: rgba(0, 0, 0, 0.125); 13 | border-radius: 3px; 14 | height: 6px; 15 | margin: 8px 0; 16 | display: block; 17 | box-sizing: border-box; 18 | width: 100%; 19 | outline: 2px solid currentColor; 20 | outline-offset: 0px; 21 | border: none; 22 | } 23 | progress.the-paste-progress::-webkit-progress-bar { 24 | background-color: var(--bar-color); 25 | height: var(--bar-height); 26 | } 27 | progress.the-paste-progress::-webkit-progress-value { 28 | background-color: var(--bar-background); 29 | border-radius: var(--bar-border-radius); 30 | height: var(--bar-height); 31 | } 32 | progress.the-paste-progress::-moz-progress-bar { 33 | background-color: var(--bar-background); 34 | border-radius: var(--bar-border-radius); 35 | height: var(--bar-height); 36 | } 37 | /*# sourceMappingURL=the-paste-editor.css.map */ 38 | -------------------------------------------------------------------------------- /include/template/icons.php: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /include/template/uploader.php: -------------------------------------------------------------------------------- 1 | 8 | 34 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 8 | 20 | 56 | -------------------------------------------------------------------------------- /include/ThePaste/Admin/WritingOptions.php: -------------------------------------------------------------------------------- 1 | load(); 33 | 34 | parent::__construct(); 35 | 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | */ 41 | public function load() { 42 | $this->_options = get_option( $this->option_name, $this->defaults ); 43 | 44 | if ( ! is_array( $this->_options ) ) { 45 | $this->_options = []; 46 | } 47 | $this->_options = wp_parse_args( $this->_options, $this->defaults ); 48 | } 49 | 50 | /** 51 | * @inheritdoc 52 | */ 53 | public function save() { 54 | update_option( $this->option_name, (array) $this->options ); 55 | } 56 | 57 | /** 58 | * Setup options. 59 | * 60 | * @action admin_init 61 | */ 62 | public function register_settings() { 63 | 64 | $settings_section = 'the_paste_writing_settings'; 65 | 66 | add_settings_section( $settings_section, __( 'The Paste', 'the-paste' ), null, $this->optionset ); 67 | 68 | 69 | register_setting( $this->optionset, $this->option_name, [ $this, 'sanitize' ] ); 70 | add_settings_field( 71 | $this->option_name, 72 | __( 'Classic Editor', 'the-paste' ), 73 | [ $this, 'tinymce_ui' ], 74 | $this->optionset, 75 | $settings_section, 76 | [] 77 | ); 78 | add_settings_field( 79 | $this->option_name.'_quality', 80 | __( 'Image Quality', 'the-paste' ), 81 | [ $this, 'quality_ui' ], 82 | $this->optionset, 83 | $settings_section, 84 | [] 85 | ); 86 | add_settings_field( 87 | $this->option_name.'_filename', 88 | __( 'Default filename', 'the-paste' ), 89 | [ $this, 'filename_ui' ], 90 | $this->optionset, 91 | $settings_section, 92 | [] 93 | ); 94 | 95 | $option_name = 'the_paste_enable_profile'; 96 | register_setting( $this->optionset, $option_name, 'boolval' ); 97 | add_settings_field( 98 | $option_name, 99 | __( 'User profile options', 'the-paste' ), 100 | [ $this, 'checkbox_ui' ], 101 | $this->optionset, 102 | $settings_section, 103 | [ 104 | 'option_name' => $option_name, 105 | 'option_value' => (bool) get_option( $option_name ), 106 | 'option_label' => __( 'Allow users to manage their personal pasting options', 'the-paste' ) 107 | ] 108 | ); 109 | 110 | add_settings_field( 111 | $this->option_name.'_donate', 112 | __( 'Support The Paste', 'the-paste' ), 113 | [ $this, 'donate_ui' ], 114 | $this->optionset, 115 | $settings_section, 116 | [] 117 | ); 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /include/ThePaste/Admin/UserOptions.php: -------------------------------------------------------------------------------- 1 | load(); 22 | 23 | if ( get_option( 'the_paste_enable_profile' ) && current_user_can( 'upload_files' ) ) { 24 | add_action( 'personal_options', [ $this, 'personal_options' ] ); 25 | add_action( 'personal_options_update', [ $this, 'update_user' ] ); 26 | add_action( 'edit_user_profile_update', [ $this, 'update_user' ] ); 27 | } 28 | } 29 | 30 | /** 31 | * @inheritdoc 32 | */ 33 | public function load() { 34 | $this->_options = get_user_meta( get_current_user_id(), $this->option_name, true ); 35 | 36 | if ( ! is_array( $this->_options ) ) { 37 | $this->_options = []; 38 | } 39 | 40 | $this->_options = wp_parse_args( $this->_options, $this->defaults ); 41 | } 42 | 43 | /** 44 | * @inheritdoc 45 | */ 46 | public function save() { 47 | update_user_meta( get_current_user_id(), $this->option_name, $this->_options ); 48 | } 49 | 50 | /** 51 | * @action personal_options 52 | */ 53 | public function personal_options( $profile_user ) { 54 | 55 | if ( $profile_user->ID !== get_current_user_id() ) { 56 | return; 57 | } 58 | 59 | $this->load(); 60 | 61 | ?> 62 | 63 | 64 | 65 | 66 | 67 | 68 | tinymce_ui(); ?> 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | quality_ui(); ?> 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | filename_ui(); ?> 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | donate_ui(); ?> 96 | 97 | 98 | 99 | option_name ] ) ) { 108 | 109 | $options = wp_unslash( $_POST[ $this->option_name ] ); 110 | 111 | if ( ! is_array( $options ) ) { 112 | $options = []; 113 | } 114 | $options = array_intersect_key( $options, $this->defaults ); 115 | $options = wp_parse_args( $options, $this->defaults ); 116 | 117 | foreach ( $options as $option => $value ) { 118 | $this->$option = $value; 119 | } 120 | $this->save(); 121 | } 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /include/ThePaste/Core/Plugin.php: -------------------------------------------------------------------------------- 1 | plugin_file = $file; 30 | 31 | register_activation_hook( $this->get_plugin_file(), [ $this, 'activate' ] ); 32 | register_deactivation_hook( $this->get_plugin_file(), [ $this, 'deactivate'] ); 33 | register_uninstall_hook( $this->get_plugin_file(), [ __CLASS__, 'uninstall' ] ); 34 | 35 | add_action( 'admin_init', [ $this, 'maybe_upgrade' ] ); 36 | 37 | add_action( 'plugins_loaded', [ $this, 'load_textdomain' ] ); 38 | 39 | parent::__construct(); 40 | } 41 | 42 | /** 43 | * @return string full plugin file path 44 | */ 45 | public function get_plugin_file() { 46 | return $this->plugin_file; 47 | } 48 | 49 | /** 50 | * @return string full plugin file path 51 | */ 52 | public function get_plugin_dir() { 53 | return plugin_dir_path( $this->get_plugin_file() ); 54 | } 55 | 56 | /** 57 | * @return string full plugin url path 58 | */ 59 | public function get_plugin_url() { 60 | return plugin_dir_url( $this->get_plugin_file() ); 61 | } 62 | 63 | /** 64 | * @inheritdoc 65 | */ 66 | public function get_asset_roots() { 67 | return [ 68 | $this->get_plugin_dir() => $this->get_plugin_url(), 69 | ]; 70 | } 71 | 72 | /** 73 | * @return string plugin slug 74 | */ 75 | public function get_slug() { 76 | return basename( $this->get_plugin_dir() ); 77 | } 78 | 79 | /** 80 | * @return string Path to the main plugin file from plugins directory 81 | */ 82 | public function get_wp_plugin() { 83 | return plugin_basename( $this->get_plugin_file() ); 84 | } 85 | 86 | /** 87 | * @return string current plugin version 88 | */ 89 | public function version() { 90 | if ( is_null( $this->_version ) ) { 91 | $this->_version = include_once $this->get_plugin_dir() . '/include/version.php'; 92 | } 93 | return $this->_version; 94 | } 95 | 96 | /** 97 | * @param string $which Which plugin meta to get. NUll 98 | * @return string|array plugin meta 99 | */ 100 | public function get_plugin_meta( $which = null ) { 101 | if ( ! isset( $this->plugin_meta ) ) { 102 | $this->plugin_meta = get_plugin_data( $this->get_plugin_file() ); 103 | } 104 | if ( isset( $this->plugin_meta[ $which ] ) ) { 105 | return $this->plugin_meta[ $which ]; 106 | } 107 | return $this->plugin_meta; 108 | } 109 | 110 | /** 111 | * @action plugins_loaded 112 | */ 113 | public function maybe_upgrade() { 114 | // trigger upgrade 115 | $new_version = $this->version(); 116 | $old_version = get_site_option( 'the_paste_version' ); 117 | 118 | // call upgrade 119 | if ( version_compare($new_version, $old_version, '>' ) ) { 120 | 121 | $this->upgrade( $new_version, $old_version ); 122 | 123 | update_site_option( 'the_paste_version', $new_version ); 124 | 125 | } 126 | 127 | } 128 | 129 | /** 130 | * Load text domain 131 | * 132 | * @action plugins_loaded 133 | */ 134 | public function load_textdomain() { 135 | $path = pathinfo( $this->get_wp_plugin(), PATHINFO_DIRNAME ); 136 | load_plugin_textdomain( 'the-paste', false, $path . '/languages' ); 137 | } 138 | 139 | /** 140 | * @inheritdoc 141 | */ 142 | public function activate() { 143 | 144 | $this->maybe_upgrade(); 145 | 146 | foreach ( self::$components as $component ) { 147 | $comp = $component::instance(); 148 | $comp->activate(); 149 | } 150 | } 151 | 152 | /** 153 | * @inheritdoc 154 | */ 155 | public function upgrade( $new_version, $old_version ) { 156 | 157 | $result = [ 158 | 'success' => true, 159 | 'messages' => [], 160 | ]; 161 | 162 | foreach ( self::$components as $component ) { 163 | $comp = $component::instance(); 164 | $upgrade_result = $comp->upgrade( $new_version, $old_version ); 165 | $result['success'] &= $upgrade_result['success']; 166 | $result['messages'][] = $upgrade_result['message']; 167 | } 168 | 169 | return $result; 170 | } 171 | 172 | /** 173 | * @inheritdoc 174 | */ 175 | public function deactivate() { 176 | foreach ( self::$components as $component ) { 177 | $comp = $component::instance(); 178 | $comp->deactivate(); 179 | } 180 | } 181 | 182 | /** 183 | * @inheritdoc 184 | */ 185 | public static function uninstall() { 186 | foreach ( self::$components as $component ) { 187 | $comp = $component::instance(); 188 | $comp->uninstall(); 189 | } 190 | } 191 | 192 | } 193 | -------------------------------------------------------------------------------- /languages/the-paste.pot: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2025 Jörn Lund 2 | # This file is distributed under the GPL3. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: The Paste 2.1.4\n" 6 | "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/the-paste\n" 7 | "Last-Translator: FULL NAME \n" 8 | "Language-Team: LANGUAGE \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "POT-Creation-Date: 2025-12-05T14:31:29+01:00\n" 13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 | "X-Generator: WP-CLI 2.12.0\n" 15 | "X-Domain: the-paste\n" 16 | 17 | #. Plugin Name of the plugin 18 | #: index.php 19 | #: include/ThePaste/Admin/WritingOptions.php:66 20 | msgid "The Paste" 21 | msgstr "" 22 | 23 | #. Plugin URI of the plugin 24 | #: index.php 25 | msgid "https://wordpress.org/plugins/the-paste/" 26 | msgstr "" 27 | 28 | #. Description of the plugin 29 | #: index.php 30 | msgid "Paste files and image data from clipboard into the WordPress media library." 31 | msgstr "" 32 | 33 | #. Author of the plugin 34 | #: index.php 35 | msgid "Jörn Lund" 36 | msgstr "" 37 | 38 | #. Author URI of the plugin 39 | #: index.php 40 | msgid "https://github.com/mcguffin" 41 | msgstr "" 42 | 43 | #: include/template/image-list.php:10 44 | msgid "Upload Pasted Images" 45 | msgstr "" 46 | 47 | #: include/template/image-list.php:16 48 | #: include/template/uploader.php:29 49 | msgid "Upload" 50 | msgstr "" 51 | 52 | #: include/template/image-list.php:24 53 | msgid "Filename" 54 | msgstr "" 55 | 56 | #: include/template/image-list.php:25 57 | #: include/ThePaste/Admin/AbstractOptions.php:31 58 | msgid "Pasted" 59 | msgstr "" 60 | 61 | #: include/template/image-list.php:30 62 | msgid "WebP" 63 | msgstr "" 64 | 65 | #: include/template/image-list.php:34 66 | msgid "PNG" 67 | msgstr "" 68 | 69 | #: include/template/image-list.php:38 70 | msgid "jpeg" 71 | msgstr "" 72 | 73 | #: include/template/image-list.php:42 74 | msgid "SVG" 75 | msgstr "" 76 | 77 | #: include/template/image-list.php:46 78 | #: include/ThePaste/Admin/WritingOptions.php:80 79 | msgid "Image Quality" 80 | msgstr "" 81 | 82 | #: include/template/image-list.php:52 83 | msgid "Discard" 84 | msgstr "" 85 | 86 | #: include/template/the-paste-instructions.php:15 87 | msgid "Press +V to paste" 88 | msgstr "" 89 | 90 | #: include/template/the-paste-instructions.php:17 91 | msgid "Press ctrl+V to paste" 92 | msgstr "" 93 | 94 | #: include/template/uploader.php:13 95 | msgid "Try again" 96 | msgstr "" 97 | 98 | #: include/template/uploader.php:16 99 | msgid "Title" 100 | msgstr "" 101 | 102 | #: include/ThePaste/Admin/AbstractOptions.php:130 103 | msgid "Enable The Paste in TinyMCE" 104 | msgstr "" 105 | 106 | #: include/ThePaste/Admin/AbstractOptions.php:136 107 | #: include/ThePaste/Admin/Admin.php:108 108 | msgid "Prefer pasting files" 109 | msgstr "" 110 | 111 | #: include/ThePaste/Admin/AbstractOptions.php:187 112 | msgid "Available placeholders…" 113 | msgstr "" 114 | 115 | #. translators: 'Media Library' H1 from WP Core 116 | #: include/ThePaste/Admin/AbstractOptions.php:194 117 | #, php-format 118 | msgid "Current post title if available, ‘%s’ otherwise" 119 | msgstr "" 120 | 121 | #: include/ThePaste/Admin/AbstractOptions.php:199 122 | msgid "Display name of current user" 123 | msgstr "" 124 | 125 | #: include/ThePaste/Admin/AbstractOptions.php:201 126 | msgid "Login name of current user" 127 | msgstr "" 128 | 129 | #: include/ThePaste/Admin/AbstractOptions.php:203 130 | msgid "Current user ID" 131 | msgstr "" 132 | 133 | #: include/ThePaste/Admin/AbstractOptions.php:208 134 | msgid "Four-digit year" 135 | msgstr "" 136 | 137 | #: include/ThePaste/Admin/AbstractOptions.php:210 138 | msgid "Two-digit year" 139 | msgstr "" 140 | 141 | #: include/ThePaste/Admin/AbstractOptions.php:212 142 | msgid "Number of month with leading zero (01 to 12)" 143 | msgstr "" 144 | 145 | #: include/ThePaste/Admin/AbstractOptions.php:214 146 | msgid "Day of month with leading zero (01 to 31)" 147 | msgstr "" 148 | 149 | #: include/ThePaste/Admin/AbstractOptions.php:216 150 | msgid "Day of month (1 to 31)" 151 | msgstr "" 152 | 153 | #: include/ThePaste/Admin/AbstractOptions.php:218 154 | msgid "Two digit hour in 24-hour format" 155 | msgstr "" 156 | 157 | #: include/ThePaste/Admin/AbstractOptions.php:220 158 | msgid "Two digit hour in 12-hour format" 159 | msgstr "" 160 | 161 | #: include/ThePaste/Admin/AbstractOptions.php:222 162 | msgid "Two digit minute" 163 | msgstr "" 164 | 165 | #: include/ThePaste/Admin/AbstractOptions.php:224 166 | msgid "Two digit second" 167 | msgstr "" 168 | 169 | #: include/ThePaste/Admin/AbstractOptions.php:227 170 | msgid "Date based on locale" 171 | msgstr "" 172 | 173 | #: include/ThePaste/Admin/AbstractOptions.php:229 174 | msgid "Time based on locale" 175 | msgstr "" 176 | 177 | #: include/ThePaste/Admin/AbstractOptions.php:232 178 | msgid "Unix timestamp" 179 | msgstr "" 180 | 181 | #: include/ThePaste/Admin/AbstractOptions.php:246 182 | msgid "Paste some cash with PayPal" 183 | msgstr "" 184 | 185 | #: include/ThePaste/Admin/Admin.php:38 186 | #: include/ThePaste/Admin/Admin.php:107 187 | msgid "Use The Paste" 188 | msgstr "" 189 | 190 | #: include/ThePaste/Admin/Admin.php:39 191 | msgid "Paste as file" 192 | msgstr "" 193 | 194 | #: include/ThePaste/Admin/Admin.php:103 195 | msgid "Upload pasted images" 196 | msgstr "" 197 | 198 | #: include/ThePaste/Admin/Admin.php:104 199 | msgid "Upload image" 200 | msgstr "" 201 | 202 | #: include/ThePaste/Admin/Admin.php:106 203 | msgid "Copy & Paste" 204 | msgstr "" 205 | 206 | #: include/ThePaste/Admin/UserOptions.php:65 207 | msgid "The Paste: Classic Editor" 208 | msgstr "" 209 | 210 | #: include/ThePaste/Admin/UserOptions.php:74 211 | msgid "The Paste: Image Quality" 212 | msgstr "" 213 | 214 | #: include/ThePaste/Admin/UserOptions.php:83 215 | msgid "The Paste: Default filename" 216 | msgstr "" 217 | 218 | #: include/ThePaste/Admin/UserOptions.php:92 219 | #: include/ThePaste/Admin/WritingOptions.php:112 220 | msgid "Support The Paste" 221 | msgstr "" 222 | 223 | #: include/ThePaste/Admin/WritingOptions.php:72 224 | msgid "Classic Editor" 225 | msgstr "" 226 | 227 | #: include/ThePaste/Admin/WritingOptions.php:88 228 | msgid "Default filename" 229 | msgstr "" 230 | 231 | #: include/ThePaste/Admin/WritingOptions.php:99 232 | msgid "User profile options" 233 | msgstr "" 234 | 235 | #: include/ThePaste/Admin/WritingOptions.php:106 236 | msgid "Allow users to manage their personal pasting options" 237 | msgstr "" 238 | -------------------------------------------------------------------------------- /css/admin/the-paste.css: -------------------------------------------------------------------------------- 1 | /* WordPress Dashicons Vars */ 2 | /* generated from https://raw.githubusercontent.com/WordPress/dashicons/master/codepoints.json */ 3 | #the-paste { 4 | width: 0; 5 | height: 0; 6 | overflow: hidden; 7 | position: fixed; 8 | left: 100%; 9 | top: 0; 10 | z-index: -1; 11 | /*/ 12 | // Testing mode 13 | width: 0; 14 | height: 0; 15 | position: fixed; 16 | left: -9999px; 17 | background-color: #fff; 18 | border: 1px solid currentColor; 19 | box-sizing: border-box; 20 | z-index: -1; 21 | &:focus, 22 | &:focus-within { 23 | left: 30px; 24 | top:30px; 25 | width: 200px; 26 | height: 500px; 27 | outline: 3px solid currentColor; 28 | outline-offset: 3px; 29 | z-index: 9999; 30 | } 31 | //*/ 32 | } 33 | 34 | .the-paste-instructions body:not(:focus-within) { 35 | display: none; 36 | } 37 | .media-frame-title .the-paste-instructions:not([hidden]), .media-toolbar .the-paste-instructions:not([hidden]) { 38 | display: inline-block; 39 | } 40 | .media-frame-title .the-paste-instructions, .media-toolbar .the-paste-instructions { 41 | white-space: nowrap; 42 | } 43 | .media-frame-title .the-paste-instructions .upload-instructions, .media-toolbar .the-paste-instructions .upload-instructions { 44 | display: none; 45 | } 46 | .media-modal-content .media-toolbar .the-paste-instructions { 47 | display: none; 48 | } 49 | .media-frame-title > .the-paste-instructions:not([hidden]) { 50 | position: absolute; 51 | right: 56px; 52 | top: 0; 53 | height: 50px; 54 | display: flex; 55 | align-items: center; 56 | } 57 | 58 | .the-paste-image-list { 59 | background-color: #f0f0f1; 60 | height: 100%; 61 | } 62 | .the-paste-image-list .media-frame-title { 63 | left: 0; 64 | background-color: #fff; 65 | } 66 | .the-paste-image-list .content { 67 | position: absolute; 68 | left: 0; 69 | top: 50px; 70 | bottom: 100px; 71 | right: 0; 72 | display: grid; 73 | grid-template-columns: repeat(auto-fit, minmax(600px, 1fr)); 74 | grid-template-rows: repeat(auto-fit, -webkit-min-content); 75 | grid-template-rows: repeat(auto-fit, min-content); 76 | grid-gap: 1em; 77 | border: 1em solid #f0f0f1; 78 | overflow: auto; 79 | } 80 | .the-paste-image-list .media-frame-toolbar { 81 | bottom: 0; 82 | right: 0; 83 | left: 0; 84 | padding: 20px; 85 | height: 100px; 86 | display: flex; 87 | align-items: flex-end; 88 | box-sizing: border-box; 89 | background-color: #fff; 90 | text-align: right; 91 | } 92 | .the-paste-image-list .media-frame-toolbar button { 93 | margin-left: auto; 94 | } 95 | .the-paste-image-list button[type=button] { 96 | line-height: 1.5; 97 | padding: 0.5em 1em; 98 | } 99 | .the-paste-image-list button[type=button] span { 100 | display: block; 101 | margin: auto; 102 | } 103 | 104 | .the-paste-image-list-item { 105 | --toolbar-size: 100px; 106 | container-type: inline-size; 107 | container-name: thePasteItem; 108 | display: grid; 109 | grid-template-areas: "canvas" "name"; 110 | grid-template-rows: calc(100% - 2em - var(--toolbar-size)) var(--toolbar-size); 111 | grid-gap: 1em 2em; 112 | padding: 1em; 113 | background-color: #fff; 114 | height: 100%; 115 | min-height: 450px; 116 | overflow: hidden; 117 | box-sizing: border-box; 118 | } 119 | .the-paste-image-list-item canvas, .the-paste-image-list-item canvas + img { 120 | grid-area: canvas; 121 | margin: auto; 122 | max-width: 100%; 123 | } 124 | @container (width > 700px) { 125 | .the-paste-image-list-item canvas, .the-paste-image-list-item canvas + img { 126 | max-width: calc(100% - 2em); 127 | } 128 | } 129 | .the-paste-image-list-item canvas, .the-paste-image-list-item canvas + img { 130 | max-height: 100%; 131 | width: auto; 132 | height: auto; 133 | } 134 | .the-paste-image-list-item canvas { 135 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 136 | background-image: linear-gradient(45deg, #c3c4c7 25%, transparent 25%), linear-gradient(135deg, #c3c4c7 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #c3c4c7 75%), linear-gradient(135deg, transparent 75%, #c3c4c7 75%); 137 | background-size: 25px 25px; /* Must be a square */ 138 | background-position: 0 0, 12.5px 0, 12.5px -12.5px, 0px 12.5px; /* Must be half of one side of the square */ 139 | } 140 | .the-paste-image-list-item .the-paste-toolbar { 141 | grid-area: name; 142 | color: #646970; 143 | display: grid; 144 | grid-template-columns: -webkit-min-content auto -webkit-min-content; 145 | grid-template-columns: min-content auto min-content; 146 | grid-template-rows: auto 3em; 147 | grid-gap: 1em 3em; 148 | margin: 0; 149 | height: var(--toolbar-size); 150 | } 151 | @container (width > 700px) { 152 | .the-paste-image-list-item .the-paste-toolbar { 153 | margin: 1em; 154 | } 155 | } 156 | .the-paste-image-list-item .the-paste-toolbar .the-paste-filename { 157 | grid-column: 1/span 2; 158 | } 159 | .the-paste-image-list-item .the-paste-toolbar .the-paste-format { 160 | display: grid; 161 | grid-auto-flow: column; 162 | grid-gap: 1em; 163 | } 164 | .the-paste-image-list-item .the-paste-toolbar .the-paste-format label { 165 | display: flex; 166 | align-items: center; 167 | } 168 | .the-paste-image-list-item .the-paste-toolbar .the-paste-quality { 169 | display: flex; 170 | grid-gap: 1em; 171 | align-items: center; 172 | } 173 | .the-paste-image-list-item .the-paste-toolbar .the-paste-quality :first-child { 174 | width: -webkit-max-content; 175 | width: max-content; 176 | margin-left: auto; 177 | } 178 | .the-paste-image-list-item .the-paste-toolbar .the-paste-quality [type=range] { 179 | flex: 1 1 auto; 180 | max-width: 300px; 181 | } 182 | .the-paste-image-list-item .the-paste-toolbar .the-paste-quality [type=number] { 183 | width: 5em; 184 | } 185 | .the-paste-image-list-item .the-paste-toolbar [name=discard] { 186 | grid-column: 3; 187 | grid-row: 1/span 2; 188 | margin: 18px 0 auto 0; 189 | } 190 | .the-paste-image-list-item .the-paste-toolbar [name=discard], .the-paste-image-list-item .the-paste-toolbar [name=discard]:hover, .the-paste-image-list-item .the-paste-toolbar [name=discard]:focus { 191 | border-color: currentColor; 192 | } 193 | .the-paste-image-list-item .the-paste-toolbar [name=discard]:focus { 194 | box-shadow: 0 0 0 1px currentColor; 195 | } 196 | .the-paste-image-list-item .the-paste-toolbar [type=text] { 197 | display: block; 198 | width: 100%; 199 | font-size: 1.3em; 200 | } 201 | .the-paste-image-list-item .the-paste-format { 202 | margin: auto 0; 203 | } 204 | /*# sourceMappingURL=the-paste.css.map */ 205 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === The Paste === 2 | Contributors: podpirate 3 | Donate link: https://www.paypal.com/donate/?hosted_button_id=F8NKC6TCASUXE 4 | Tags: copy paste, clipboard, media library, productivity 5 | Requires at least: 4.8 6 | Tested up to: 6.9 7 | Requires PHP: 7.4 8 | Stable tag: 2.1.4 9 | License: GPLv2 or later 10 | License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 | 12 | Paste files and image data from clipboard and instantly upload them to the WordPress media library. 13 | 14 | == Description == 15 | 16 | Speed up your workflow by pasting files and image data directly into the WordPress media library. 17 | 18 | You can copy files and image data from many desktop applications: 19 | 20 | * macOS Finder 21 | * Windows Filesystem 22 | * Screenshots 23 | * Adobe Photoshop 24 | * Gimp 25 | * LibreOffice 26 | * GoogleDocs 27 | * Adobe XD 28 | * SVG from Adobe XD, Illustrator, Figma and Affinity Designer (**Note:** An additional plugin for SVG Support is required. My favorite: [Safe SVG](https://wordpress.org/plugins/safe-svg/)) 29 | * [And some more...](https://github.com/mcguffin/the-paste#applications-tested-so-far) 30 | 31 | … and paste it to Classic Editor or directly to the media library. 32 | 33 | The most recent Desktop versions of Chrome, Edge, Firefox and Safari are supported. 34 | 35 | Install [Safe SVG](https://wordpress.org/plugins/safe-svg/) to enable SVG support. 36 | 37 | [The paste at GitHub](https://github.com/mcguffin/the-paste) 38 | 39 | You like it? You can't stop pasting? [Paste some cash with PayPal](https://www.paypal.com/donate/?hosted_button_id=F8NKC6TCASUXE)! 40 | 41 | == Known Issues == 42 | - *Firefox* does not support pasting multiple files from the OS filesystem. 43 | - *Safari* lacks the support to convert images to the webP format. 44 | - Pasting in TinyMCE triggers a JavaScript error if [Real Media Library](https://wordpress.org/plugins/real-media-library-lite/) is active. Pasting in the media library is still working. 45 | - *Edge* is working suspiciously well, which is very unusal in the Microsoft world and must be considered a bug. 46 | 47 | == Installation == 48 | 49 | Follow the standard [WordPress plugin installation procedere](https://wordpress.org/documentation/article/manage-plugins/). 50 | 51 | == Screenshots == 52 | 53 | 1. Pasting into classic editor. You can either upload the image immediately or do so later. Disable ‘Paste as file’ to turn off pasting. 54 | 2. The media library is pastable too 55 | 3. Pasted multiple images from macOS Photos into Chrome 56 | 4. A layer pasted from Adobe Photoshop 2023 57 | 5. Pasted from Affinity Designer. SVG Clipboard contents on the right. 58 | 6. Plugin options (Settings > Writing) 59 | 60 | == Changelog == 61 | 62 | = 2.1.4 = 63 | * Fix Image dialog: hide webp option if extension not allowed in multisite 64 | * Fix: Fall back to pasting if tinymce content is pasted 65 | * Bind debug mode to constant SCRIPT_DEBUG 66 | 67 | = 2.1.3 = 68 | * Bring TinyMCE activation to Editor toolbar 69 | * SVG paste: Without SVG upload allowed you can still upload pasted SVG as raster image 70 | * Fix: Pasting with Safe SVG forbidden 71 | * Fix: render shortcode after inserting in tinymce 72 | 73 | = 2.1.2 = 74 | * Fix Classic Editor + Safari not pasting image (re-arrange js build) 75 | 76 | = 2.1.1 = 77 | * Fix PHP Fatal on Alpine/Solaris (`GLOB_BRACE`) 78 | * Fix some tweaks in block editor 79 | 80 | = 2.1.0 = 81 | * Introduce Admin Settings 82 | * Quality slider in image dialog 83 | * Pasting into image dialog now possible 84 | * TinyMCE: Remove DataURI pasting feature 85 | * TinyMCE: "Paste as File" is now "Prefer pasting files" 86 | * TinyMCE: Restore functionality of "Paste as Text" 87 | * TinyMCE: Use current attachment display settings when pasting 88 | * TinyMCE: Skip images with src from same origin 89 | * Fix: Resolve some Block Editor conflicts 90 | * Fix: Paste issue in Classic Block 91 | 92 | = 2.0.9 = 93 | * Fix: pasting plain HTML broken 94 | 95 | = 2.0.8 = 96 | * Introduce Image Quality option 97 | * Image Dialog: use generated filename if filename is empty 98 | * Rearrange user options 99 | * Add date and time format options for default filenames 100 | * Compatibility with [Advanced Editor Tools](https://wordpress.org/plugins/tinymce-advanced/) 101 | * Reduce JS filesize 102 | * Fix: missing TinyMCE toolbar icon 103 | * Fix: Image Quality setting not effective 104 | 105 | = 2.0.7 = 106 | * Support images from MS Teams chat 107 | * A11y: Paste Modal submit now submits on press enter 108 | * A11y: Aria hidden attributes on buttons 109 | * Fix: Cannot paste into textfield in paste modal 110 | * Fix: Filename entered in paste modal unfunctional 111 | 112 | = 2.0.6 = 113 | * Feature: Toggle image pasting in tinymce toolbar 114 | * Feature: Support SVG 115 | 116 | = 2.0.5 = 117 | * Fix: Compatibility issue with [Real Media Library](https://wordpress.org/plugins/real-media-library-lite/) 118 | 119 | = 2.0.4 = 120 | * Remove debugging artefact 121 | 122 | = 2.0.3 = 123 | * UI Tweak (instruction placement) 124 | * Fix: Classic editor plugin crashing 125 | * Fix: sometimes not pasting in Firefox 126 | * Fix: Dialog overlays media frame in Block Editor 127 | 128 | = 2.0.2 = 129 | * Paste from Google Docs (Docs and Presentation) 130 | * More Filename placeholders 131 | * Fix PHP Fatal if network activated on a multisite 132 | 133 | = 2.0.1 = 134 | * Fix: Filename placeholders 135 | 136 | = 2.0.0 = 137 | * Paste files and images in the media Library 138 | * Paste multiple files (except firefox) 139 | * Convert to WebP (except Safari) 140 | * Disable dataURI pasting in user profile (now default) 141 | * Performance: Check upload capability before scripts are loaded 142 | 143 | = 1.1.2 = 144 | * Fix: Fatal error in user profile 145 | * Fix: Compatibility with the SEO Framework 146 | 147 | = 1.1.1 = 148 | * Feature: Make pasting into tinyMCE optional. (Fixes unpredictable cursor position during file drop) 149 | * Fix: php 8.2 deprecation warnings 150 | 151 | = 1.1.0 = 152 | * Fix: PHP 8 warning 153 | * Fix: Add `data:` to wp_kses allowed protocols 154 | * TinyMCE: Users without file upload capability could not paste images as data-url. 155 | * TinyMCE: Don't show upload buttons if user are not allowed to upload files 156 | 157 | = 1.0.7 = 158 | * Fix auto upload large images 159 | 160 | = 1.0.5 = 161 | * Prevent Editor Crashes: Only embed images up to 262144 px, upload otherwise 162 | 163 | = 1.0.4 = 164 | * Support Text Widget 165 | * Better Media Titles 166 | 167 | = 1.0.3 = 168 | * Fix JS Error in TextWidget 169 | 170 | = 1.0.2 = 171 | * Performance improvements 172 | * Add Textdomain to plugin header 173 | * Remove unnecessary settings 174 | 175 | = 1.0.1 = 176 | * Update plugin URL 177 | * Fix double pasting 178 | 179 | = 1.0.0 = 180 | * Initial release 181 | 182 | == Upgrade Notice == 183 | 184 | Nothing noteworty here so far... 185 | -------------------------------------------------------------------------------- /include/ThePaste/Asset/Asset.php: -------------------------------------------------------------------------------- 1 | localize( [ 24 | * 'some_option' => 'some_value', 25 | * 'l10n' => [ 26 | * 'hello' => __('World','the-paste') 27 | * ], 28 | * ], 'l10n_varname' ) 29 | * ->deps( 'jquery' ) // or ->deps( [ 'jquery','wp-backbone' ] ) 30 | * ->footer( true ) // enqueue in footer 31 | * ->enqueue(); // actually enqueue script 32 | * 33 | */ 34 | class Asset { 35 | 36 | /** 37 | * @var string relative asset path 38 | */ 39 | private $asset; 40 | 41 | /** 42 | * @var string Absolute asset path 43 | */ 44 | private $path; 45 | 46 | /** 47 | * @var string Absolute asset url 48 | */ 49 | private $url; 50 | 51 | /** 52 | * @var array Dependencies 53 | */ 54 | private $deps = []; 55 | 56 | /** 57 | * @var array|boolean Localization 58 | */ 59 | private $in_footer = true; 60 | 61 | /** 62 | * @var string css|js 63 | */ 64 | private $type; 65 | 66 | /** 67 | * @var string 68 | */ 69 | private $handle; 70 | 71 | /** 72 | * @var array|boolean Localization 73 | */ 74 | private $l10n = false; 75 | 76 | /** 77 | * @var string css|js 78 | */ 79 | private $registered = false; 80 | 81 | /** 82 | * @var string Varname for script localization 83 | */ 84 | private $varname; 85 | 86 | /** 87 | * @var boolean Whether the script is localized 88 | */ 89 | private $localized; 90 | 91 | /** 92 | * @var Core\Core 93 | */ 94 | private $core = null; 95 | 96 | static function get( $asset ) { 97 | return new self($asset); 98 | } 99 | 100 | public function __construct( $asset ) { 101 | 102 | $this->core = Core\Core::instance(); 103 | 104 | $this->asset = preg_replace( '/^(\/+)/', '', $asset ); // unleadingslashit 105 | $this->type = strtolower( pathinfo( $this->asset, PATHINFO_EXTENSION )); 106 | $this->handle = $this->generate_handle(); 107 | $this->varname = str_replace( '-', '_', $this->handle ); 108 | $this->in_footer = $this->type === 'js'; 109 | $this->locate(); 110 | } 111 | 112 | /** 113 | * Generate script handle. 114 | */ 115 | private function generate_handle() { 116 | $asset = preg_replace( '/^(js|css)\//', '', $this->asset ); 117 | $pi = pathinfo( $asset ); 118 | $handle = str_replace( '/', '-', sprintf( '%s-%s', $pi['dirname'], $pi['filename'] ) ); 119 | $handle = preg_replace( '/[^a-z0-9_]/','-', $handle ); 120 | $handle = preg_replace( '/^(-+)/','', $handle ); 121 | return $handle; 122 | } 123 | 124 | /** 125 | * Locate asset file 126 | */ 127 | private function locate() { 128 | // !!! must know plugin or theme !!! 129 | $check = $this->core->get_asset_roots(); 130 | foreach ( $check as $root_path => $root_url ) { 131 | $root_path = untrailingslashit( $root_path ); 132 | $root_url = untrailingslashit( $root_url ); 133 | $path = $root_path . '/' . $this->asset; 134 | if ( file_exists( $path ) ) { 135 | $this->path = $path; 136 | $this->url = $root_url . '/' . $this->asset; 137 | return; 138 | } 139 | } 140 | throw new \Exception( sprintf( 'Couldn\'t locate %s', $this->asset ) ); 141 | } 142 | 143 | /** 144 | * Set Dependencies 145 | * 146 | * @param array $deps Dependencies 147 | */ 148 | public function deps( $deps = [] ) { 149 | $this->deps = (array) $deps; 150 | return $this; 151 | } 152 | 153 | /** 154 | * Add Dependency 155 | * 156 | * @param Asset|array|string $dep Dependency slug(s) or Asset instance 157 | */ 158 | public function add_dep( $dep ) { 159 | if ( $dep instanceof self ) { 160 | $dep = $dep->handle; 161 | } 162 | if ( is_array( $dep ) ) { 163 | foreach ( $dep as $d ) { 164 | $this-add_dep($d); 165 | } 166 | } else { 167 | if ( ! in_array( $dep, $this->deps ) ) { 168 | $this->deps[] = $dep; 169 | } 170 | } 171 | return $this; 172 | } 173 | 174 | /** 175 | * Set Dependencies 176 | * 177 | * @param boolean $in_footer Dependencies 178 | */ 179 | public function footer( $in_footer = true ) { 180 | $this->in_footer = $in_footer; 181 | return $this; 182 | } 183 | 184 | /** 185 | * Register asset 186 | * Wrapper for wp_register_[script|style] 187 | */ 188 | public function register( ) { 189 | if ( ! $this->registered ) { 190 | $fn = $this->type === 'js' ? 'wp_register_script' : 'wp_register_style'; 191 | $args = [ 192 | $this->handle, 193 | $this->url, 194 | $this->deps, 195 | $this->core->version() 196 | ]; 197 | if ( $this->in_footer ) { 198 | $args[] = $this->in_footer; 199 | } 200 | call_user_func_array( 201 | $fn, 202 | $args 203 | ); 204 | $this->registered = true; 205 | 206 | } 207 | return $this->_localize(); 208 | } 209 | 210 | /** 211 | * Enqueue asset 212 | * Wrapper for wp_enqueue_[script|style] 213 | * 214 | * @param string|array $deps Single Dependency or Dependencies array 215 | */ 216 | public function enqueue( $deps = [] ) { 217 | 218 | $fn = $this->type === 'js' ? 'wp_enqueue_script' : 'wp_enqueue_style'; 219 | 220 | if ( ! $this->registered ) { 221 | $this->register( $deps ); 222 | } 223 | 224 | call_user_func( $fn, $this->handle ); 225 | 226 | return $this; 227 | } 228 | 229 | /** 230 | * Localize 231 | * Wrapper for wp_localize_script 232 | * 233 | * @param array $l10n 234 | * @param null|string $varname 235 | */ 236 | public function localize( $l10n = [], $varname = null ) { 237 | if ( $this->type !== 'js' ) { 238 | throw new \Exception( 'Can\'t localize stylesheet' ); 239 | } 240 | if ( ! is_null( $varname ) ) { 241 | $this->varname = $varname; 242 | } 243 | if ( is_array( $l10n ) ) { 244 | $this->l10n = $l10n; 245 | } 246 | return $this->_localize(); 247 | } 248 | 249 | /** 250 | * Maybe call wp_localize_script 251 | */ 252 | private function _localize( ) { 253 | if ( $this->registered && ! $this->localized && is_array( $this->l10n ) ) { 254 | 255 | wp_localize_script( $this->handle, $this->varname, $this->l10n ); 256 | 257 | $this->localized = true; 258 | 259 | } 260 | return $this; 261 | } 262 | 263 | /** 264 | * magic getter 265 | */ 266 | public function __get( $var ) { 267 | switch ( $var ) { 268 | case 'asset': 269 | case 'handle': 270 | case 'in_footer': 271 | case 'path': 272 | case 'url': 273 | case 'varname': 274 | return $this->$var; 275 | case 'deps': 276 | return array_values( $this->$var ); 277 | } 278 | } 279 | 280 | } 281 | -------------------------------------------------------------------------------- /include/ThePaste/Admin/TinyMce/TinyMce.php: -------------------------------------------------------------------------------- 1 | [ 24 | * 'append_button' => false, 25 | * 'insert_button_at_position' => 3, 26 | * ], 27 | * 'mce_buttons_2' => [ 28 | * 'append_button_to_second_row' => false, 29 | * ], 30 | * ]; 31 | */ 32 | protected $editor_buttons = []; 33 | 34 | /** 35 | * Plugin params 36 | * An arbitrary array which will be made avaialable in JS 37 | * under the varname mce_{$module_name}. 38 | * 39 | */ 40 | protected $plugin_params = false; 41 | 42 | /** 43 | * TinyMCE Settings 44 | */ 45 | protected $mce_settings = false; 46 | 47 | /** 48 | * Load custom css for toolbar. 49 | * boolean 50 | */ 51 | protected $toolbar_css = false; 52 | 53 | /** 54 | * Load custom css for editor. 55 | * boolean 56 | */ 57 | protected $editor_css = false; 58 | 59 | /** 60 | * Asset dir for derived class 61 | * string path 62 | */ 63 | private $asset_dir_uri = null; 64 | 65 | /** 66 | * Asset dir for derived class 67 | * string path 68 | */ 69 | private $asset_dir_path = null; 70 | 71 | /** 72 | * Asset dir for derived class 73 | * string path 74 | */ 75 | private $theme = null; 76 | 77 | protected $script_dir = 'js'; 78 | protected $styles_dir = 'css'; 79 | 80 | private $plugin_js; 81 | private $prefix; 82 | 83 | /** 84 | * Private constructor 85 | */ 86 | protected function __construct() { 87 | 88 | if ( is_null( $this->module_name ) ) { 89 | throw( new Exception( '`$module_name` must be defined in a derived classes.' ) ); 90 | } 91 | 92 | $this->plugin_js = Asset\Asset::get( 'js/admin/mce/' . $this->module_name . '-plugin.js' ); 93 | $this->editor_css = Asset\Asset::get( 'css/admin/mce/' . $this->module_name . '-editor.css' ); 94 | $this->toolbar_css = Asset\Asset::get( 'css/admin/mce/' . $this->module_name . '-toolbar.css' ); 95 | 96 | $this->prefix = str_replace( '-', '_', $this->module_name ); 97 | 98 | $parts = array_slice( explode( '\\', get_class( $this ) ), 0, -1 ); 99 | array_unshift( $parts, 'include' ); 100 | 101 | $this->asset_dir_uri = trailingslashit( implode( DIRECTORY_SEPARATOR, $parts ) ); 102 | 103 | $this->asset_dir_path = trailingslashit( implode( DIRECTORY_SEPARATOR, $parts ) ); 104 | 105 | // add tinymce buttons 106 | $this->editor_buttons = wp_parse_args( $this->editor_buttons, [ 107 | 'mce_buttons' => false, 108 | 'mce_buttons_2' => false, 109 | ] ); 110 | 111 | foreach ( $this->editor_buttons as $hook => $buttons ) { 112 | if ( $buttons !== false ) { 113 | add_filter( $hook, [ $this, 'add_buttons' ] ); // prio: 114 | } 115 | } 116 | 117 | // add tinymce plugin parameters 118 | if ( $this->plugin_params !== false ) { 119 | add_action( 'wp_enqueue_editor', [ $this, 'action_enqueue_editor' ] ); 120 | } 121 | if ( $this->mce_settings !== false ) { 122 | add_action( 'tiny_mce_before_init', [ $this, 'tiny_mce_before_init' ] ); 123 | } 124 | 125 | if ( $this->editor_css !== false ) { 126 | add_filter('mce_css', [ $this, 'mce_css' ] ); 127 | } 128 | if ( $this->toolbar_css !== false ) { 129 | add_action( "admin_print_scripts", [ $this, 'enqueue_toolbar_css' ] ); 130 | } 131 | 132 | // will only work with default editor 133 | add_filter( 'mce_external_plugins', [ $this, 'add_plugin' ] ); 134 | 135 | parent::__construct(); 136 | 137 | } 138 | 139 | /** 140 | * Add MCE plugin 141 | * 142 | * @filter mce_external_plugins 143 | */ 144 | public function add_plugin( $plugins_array ) { 145 | 146 | $plugins_array[ $this->prefix ] = $this->plugin_js->url; 147 | return $plugins_array; 148 | } 149 | 150 | /** 151 | * Add toolbar Buttons. 152 | * 153 | * @filter mce_buttons, mce_buttons_2 154 | */ 155 | public function add_buttons( $buttons ) { 156 | $hook = current_filter(); 157 | if ( isset( $this->editor_buttons[ $hook ] ) && is_array( $this->editor_buttons[ $hook ] ) ) { 158 | foreach ( $this->editor_buttons[ $hook ] as $button => $position ) { 159 | if ( in_array( $button, $buttons ) ) { 160 | continue; 161 | } 162 | if ( is_string( $position ) ) { 163 | $position = array_search( $position, $buttons, true ); 164 | if ( false !== $position ) { 165 | $position++; 166 | } 167 | } 168 | if ( $position === false ) { 169 | $buttons[] = $button; 170 | } else if ( is_int( $position ) ) { 171 | array_splice( $buttons, $position, 0, $button ); 172 | } 173 | } 174 | } 175 | 176 | return array_unique( $buttons); 177 | } 178 | 179 | 180 | /** 181 | * Enqueue toolbar css 182 | * 183 | * @action admin_print_scripts 184 | */ 185 | public function enqueue_toolbar_css() { 186 | $asset_id = sprintf( 'tinymce-%s-toolbar-css', $this->module_name ); 187 | wp_enqueue_style( $asset_id, $this->get_toolbar_css_url() ); 188 | } 189 | 190 | /** 191 | * @return string URL to editor css 192 | */ 193 | protected function get_toolbar_css_url() { 194 | return $this->toolbar_css->url; 195 | } 196 | 197 | /** 198 | * Add editor css 199 | * 200 | * @filter mce_css 201 | */ 202 | public function mce_css( $styles ) { 203 | $styles .= ','. $this->get_mce_css_url(); 204 | return $styles; 205 | } 206 | 207 | /** 208 | * @return string URL to editor css 209 | */ 210 | protected function get_mce_css_url() { 211 | return $this->editor_css->url;// 212 | } 213 | /** 214 | * print plugin settings 215 | * 216 | * @action wp_enqueue_editor 217 | */ 218 | public function tiny_mce_before_init( $settings ) { 219 | return $this->mce_settings + $settings; 220 | } 221 | 222 | /** 223 | * print plugin settings 224 | * 225 | * @action wp_enqueue_editor 226 | */ 227 | public function action_enqueue_editor( $to_load ) { 228 | if ( $to_load['tinymce'] ) { 229 | add_action( 'admin_footer', [ $this, 'mce_localize' ] ); 230 | } 231 | } 232 | /** 233 | * print plugin settings 234 | * 235 | * @action admin_footer 236 | */ 237 | public function mce_localize( $to_load ) { 238 | $varname = sprintf( 'mce_%s', $this->prefix ); 239 | $params = json_encode($this->plugin_params ); 240 | printf( '', $varname, $params ); 241 | } 242 | 243 | /** 244 | * Get asset path for this editor plugin 245 | * 246 | * @param string $asset Dir part relative to theme root 247 | * @return path 248 | */ 249 | protected function getAssetPath( $asset ) { 250 | return $this->theme->getAssetPath( $this->asset_dir_path . ltrim( $asset, '/' ) ); 251 | } 252 | 253 | } 254 | -------------------------------------------------------------------------------- /include/ThePaste/Admin/Admin.php: -------------------------------------------------------------------------------- 1 | get_options()->tinymce_enabled ) { 36 | add_filter( 'tadv_allowed_buttons', function( $tadv_buttons ) { 37 | 38 | $tadv_buttons['thepaste_onoff'] = __( 'Use The Paste', 'the-paste' ); 39 | $tadv_buttons['thepaste_preferfiles'] = __( 'Paste as file', 'the-paste' ); 40 | add_action( 'admin_footer', [ $this, 'print_media_templates' ] ); 41 | 42 | return $tadv_buttons; 43 | }); 44 | } 45 | 46 | add_action( 'admin_init', [ $this, 'register_assets' ] ); 47 | add_action( 'wp_enqueue_media', [ $this, 'enqueue_assets' ] ); 48 | add_action( 'print_media_templates', [ $this, 'print_media_templates' ] ); 49 | add_action( 'wp_enqueue_editor', [ $this, 'enqueue_assets' ] ); 50 | add_action( "wp_ajax_{$this->ajax_action_onoff}", [ $this, 'ajax_tinymce_enable' ] ); 51 | add_action( "wp_ajax_{$this->ajax_action_preferfiles}", [ $this, 'ajax_tinymce_enable' ] ); 52 | /* 53 | 54 | */ 55 | // block editor 56 | // add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_assets' ] ); 57 | 58 | } 59 | 60 | /** 61 | * @action wp_ajax_the_paste_tinymce_enable 62 | */ 63 | public function ajax_tinymce_enable() { 64 | 65 | $action = wp_unslash( $_REQUEST['action'] ); 66 | 67 | check_ajax_referer( $action ); 68 | 69 | $enabled = isset( $_REQUEST['enabled'] ) 70 | ? (bool) wp_unslash( $_REQUEST['enabled'] ) 71 | : false; 72 | 73 | $user = UserOptions::instance(); 74 | if ( $action === $this->ajax_action_preferfiles ) { 75 | $user->tinymce = $enabled; 76 | } else if ( $action === $this->ajax_action_onoff ) { 77 | $user->tinymce_enabled = $enabled; 78 | } 79 | $user->save(); 80 | 81 | wp_send_json( [ 'success' => true ] ); 82 | } 83 | 84 | /** 85 | * Enqueue options Assets 86 | * @action admin_print_scripts 87 | */ 88 | public function register_assets() { 89 | 90 | $options = (object) $this->get_options(); 91 | $user = UserOptions::instance(); 92 | 93 | $this->mce = TinyMce\TinyMceThePaste::instance(); 94 | 95 | $current_user = wp_get_current_user(); 96 | 97 | $this->css = Asset\Asset::get('css/admin/the-paste.css')->register(); 98 | 99 | $this->js = Asset\Asset::get('js/admin/the-paste.js') 100 | ->deps( [ 'jquery', 'media-editor' ] ) 101 | ->localize( [ 102 | 'l10n' => [ 103 | 'upload_pasted_images' => __( 'Upload pasted images', 'the-paste' ), 104 | 'upload_image' => __( 'Upload image', 'the-paste' ), 105 | 'the_paste' => __( 'The Paste', 'plugin name', 'the-paste' ), 106 | 'copy_paste' => __( 'Copy & Paste', 'the-paste' ), 107 | 'paste_onoff' => __( 'Use The Paste', 'the-paste' ), 108 | 'paste_files' => __( 'Prefer pasting files', 'the-paste' ), 109 | ], 110 | 'options' => [ 111 | 'editor' => [ 112 | // 'auto_upload' => true, 113 | 'debugMode' => constant('SCRIPT_DEBUG'), 114 | 'preferfiles' => $user->tinymce, 115 | 'enabled' => $user->tinymce_enabled, 116 | 'preferfiles_ajax_url' => add_query_arg( [ 117 | 'action' => $this->ajax_action_preferfiles, 118 | '_ajax_nonce' => wp_create_nonce( $this->ajax_action_preferfiles ), 119 | ], admin_url( 'admin-ajax.php' ) ), 120 | 'onoff_ajax_url' => add_query_arg( [ 121 | 'action' => $this->ajax_action_onoff, 122 | '_ajax_nonce' => wp_create_nonce( $this->ajax_action_onoff ), 123 | ], admin_url( 'admin-ajax.php' ) ), 124 | ], 125 | 'mime_types' => $this->get_mimetype_mapping() + [ 'svg' => 'image/svg+xml' ], 126 | 'filename_values' => [ 127 | 'username' => $current_user->display_name, 128 | 'userlogin' => $current_user->user_login, 129 | 'userid' => $current_user->ID, 130 | ], 131 | 'jpeg_quality' => apply_filters( 'jpeg_quality', $options->image_quality, 'edit_image' ), 132 | /** 133 | * Filters the default filename 134 | * 135 | * @param String $filename The Filename. There are some placeholders: 136 | * Placeholders: 137 | * Name of current post 138 | * Display name of current user 139 | * Login name of current user 140 | * Current user ID 141 | * Date and Time placeholders (a subset of php's strftime() format characters): 142 | * %Y Four-digit year 143 | * %y Two-digit year 144 | * %m Number of month with leading zero (01 to 12) 145 | * %d Day of month with leading zero (01 to 31) 146 | * %e Day of month (1 to 31) 147 | * %H Two digit hour in 24-hour format 148 | * %I Two digit hour in 12-hour format 149 | * %M Two digit minute 150 | * %S Two digit second 151 | * %s Unix timestamp 152 | * %x Date based on locale 153 | * %X Time based on locale 154 | */ 155 | 'default_filename' => apply_filters( 'the_paste_default_filename', $user->default_filename ), 156 | ], 157 | ], 'thepaste' ) 158 | ->register(); 159 | } 160 | 161 | /** 162 | * @return AbstractOptions 163 | */ 164 | private function get_options() { 165 | if ( (bool) get_option( 'the_paste_enable_profile' ) ) { 166 | return UserOptions::instance()->options; 167 | } else { 168 | return WritingOptions::instance()->options; 169 | } 170 | } 171 | 172 | /** 173 | * Enqueue options Assets 174 | * @action admin_print_scripts 175 | */ 176 | public function enqueue_assets() { 177 | if ( current_user_can( 'upload_files' ) ) { 178 | if ( $this->css ) { 179 | $this->css->enqueue(); 180 | } 181 | if ( $this->js ) { 182 | $this->js->enqueue(); 183 | } 184 | } 185 | } 186 | 187 | /** 188 | * @action 'print_media_templates' 189 | */ 190 | public function print_media_templates() { 191 | if ( current_user_can( 'upload_files' ) ) { 192 | $rp = Core\Core::instance()->get_plugin_dir() . '/include/template/*.php'; 193 | foreach ( glob( $rp ) as $template_file ) { 194 | include $template_file; 195 | } 196 | } 197 | } 198 | 199 | /** 200 | * @return array 201 | */ 202 | private function get_mimetype_mapping() { 203 | 204 | $mime_mapping = []; 205 | 206 | foreach( get_allowed_mime_types() as $extensions => $mime ) { 207 | foreach( explode( '|', $extensions ) as $extension ) { 208 | $mime_mapping[$extension] = $mime; 209 | } 210 | } 211 | uksort( $mime_mapping, function($a,$b) { 212 | // handle ambigous file extensions: put prefered suffix o front 213 | if ( in_array($a,['jpg','gz','tif','mov','mpeg','m4v','3gp','3g2','txt','html','m4a','ra','ogg','mid','ppt','xls'])) { 214 | return -1; 215 | } 216 | return 0; 217 | }); 218 | return $mime_mapping; 219 | } 220 | } 221 | -------------------------------------------------------------------------------- /include/ThePaste/Admin/AbstractOptions.php: -------------------------------------------------------------------------------- 1 | true, 19 | 'tinymce' => true, // paste file data 20 | 'image_quality' => 90, 21 | 'default_filename' => '', 22 | ]; 23 | 24 | protected $_options = []; 25 | 26 | /** 27 | * @inheritdoc 28 | */ 29 | protected function __construct() { 30 | 31 | $this->defaults['default_filename'] = __( 'Pasted', 'the-paste' ); 32 | 33 | } 34 | 35 | /** 36 | * Load options from DB 37 | */ 38 | abstract public function load(); 39 | 40 | /** 41 | * Save options to DB 42 | */ 43 | abstract public function save(); 44 | 45 | /** 46 | * Getter 47 | * 48 | * @param string $what 49 | */ 50 | public function __get( $what ) { 51 | 52 | if ( isset( $this->defaults[$what] ) ) { 53 | $opt = wp_parse_args( $this->_options, $this->defaults ); 54 | return $opt[$what]; 55 | } else if ( 'options' === $what ) { 56 | return (object) $this->_options; 57 | } 58 | } 59 | 60 | /** 61 | * Getter 62 | * 63 | * @param string $what 64 | * @param mixed $value 65 | */ 66 | public function __set( $what, $value ) { 67 | 68 | if ( isset( $this->defaults[$what] ) ) { 69 | if ( in_array( $what, [ 'tinymce_enabled', 'tinymce' ] ) ) { // boolean options 70 | $this->_options[$what] = (boolean) $value; 71 | 72 | } else if ( in_array( $what, [ 'image_quality' ] ) ) { // boolean options 73 | $this->_options[$what] = absint( $value ); 74 | 75 | } else if ( in_array( $what, ['default_filename'] ) ) { // filename template 76 | $this->_options[$what] = strip_tags(trim( $value ), [ '', '', '', '' ] ); 77 | } 78 | } 79 | } 80 | 81 | /** 82 | * @param array 83 | */ 84 | public function sanitize( $options ) { 85 | if ( ! is_array( $options ) ) { 86 | return false; 87 | } 88 | foreach ( $options as $opt => $value ) { 89 | $this->$opt = $value; 90 | } 91 | return (array) $this->options; 92 | } 93 | 94 | /** 95 | * @param array $args [ 96 | * 'option_name' => string 97 | * 'option_value' => mixed 98 | * 'option_label' => string 99 | * 'option_description' => string 100 | * ] 101 | */ 102 | public function checkbox_ui( $args ) { 103 | /** 104 | */ 105 | ?> 110 | %s

', esc_html( $args['option_description'] ) ); 113 | } 114 | ?> 115 | mixed 121 | * ] 122 | */ 123 | public function tinymce_ui() { 124 | 125 | ?> 126 |

checkbox_ui([ 128 | 'option_name' => 'the_paste[tinymce_enabled]', 129 | 'option_value' => $this->tinymce_enabled, 130 | 'option_label' => __( 'Enable The Paste in TinyMCE', 'the-paste' ), 131 | ]); 132 | 133 | $this->checkbox_ui([ 134 | 'option_name' => 'the_paste[tinymce]', 135 | 'option_value' => $this->tinymce, 136 | 'option_label' => __( 'Prefer pasting files', 'the-paste' ), 137 | ]); 138 | 139 | ?>

140 | 148 | mixed 155 | * ] 156 | */ 157 | public function quality_ui() { 158 | ?> 159 | 163 | 170 | 179 | 182 |
183 | 187 |

188 | 189 |
190 |
<postname>
191 |
198 |
<username>
199 |
200 |
<userlogin>
201 |
202 |
<userid>
203 |
204 |
205 |

206 |
207 |
%Y
208 |
209 |
%y
210 |
211 |
%m
212 |
213 |
%d
214 |
215 |
%e
216 |
217 |
%H
218 |
219 |
%I
220 |
221 |
%M
222 |
223 |
%S
224 |
225 | 226 |
%x
227 |
228 |
%X
229 |
230 | 231 |
%s
232 |
233 |
234 |
235 | 243 |

244 | 245 | 246 | 247 | 248 |

249 | \n" 8 | "Language-Team: \n" 9 | "Language: de_DE\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 14 | "X-Generator: Poedit 3.0.1\n" 15 | "X-Poedit-SourceCharset: UTF-8\n" 16 | "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;" 17 | "_n_noop:1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;esc_attr__;" 18 | "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n" 19 | "X-Poedit-Basepath: ..\n" 20 | "X-Textdomain-Support: yes\n" 21 | "X-Poedit-SearchPath-0: .\n" 22 | "X-Poedit-SearchPathExcluded-0: node_modules\n" 23 | 24 | #. Plugin Name of the plugin 25 | #: include/ThePaste/Admin/WritingOptions.php:64 26 | msgid "The Paste" 27 | msgstr "" 28 | 29 | #. Plugin URI of the plugin 30 | msgid "https://wordpress.org/plugins/the-paste/" 31 | msgstr "" 32 | 33 | #. Description of the plugin 34 | msgid "" 35 | "Paste files and image data from clipboard into the WordPress media library." 36 | msgstr "Dateien und Bilder aus der Zwischenablage in die Mediathek einfügen." 37 | 38 | #. Author of the plugin 39 | msgid "Jörn Lund" 40 | msgstr "" 41 | 42 | #. Author URI of the plugin 43 | msgid "https://github.com/mcguffin" 44 | msgstr "" 45 | 46 | #: include/template/image-list.php:10 47 | msgid "Upload Pasted Images" 48 | msgstr "Eingefügte Bilder hochladen" 49 | 50 | # @ cheese 51 | #: include/template/image-list.php:16 include/template/uploader.php:29 52 | msgid "Upload" 53 | msgstr "Upload" 54 | 55 | #: include/template/image-list.php:24 56 | msgid "Filename" 57 | msgstr "Dateiname" 58 | 59 | #: include/template/image-list.php:25 include/ThePaste/Admin/UserOptions.php:19 60 | msgid "Pasted" 61 | msgstr "Eingefügt" 62 | 63 | #: include/template/image-list.php:30 64 | msgid "WebP" 65 | msgstr "WebP" 66 | 67 | #: include/template/image-list.php:34 68 | msgid "PNG" 69 | msgstr "PNG" 70 | 71 | #: include/template/image-list.php:38 72 | msgid "jpeg" 73 | msgstr "jpeg" 74 | 75 | #: include/template/image-list.php:42 76 | msgid "SVG" 77 | msgstr "SVG" 78 | 79 | #: include/template/image-list.php:48 80 | msgid "Discard" 81 | msgstr "Verwerfen" 82 | 83 | #: include/template/the-paste-instructions.php:15 84 | msgid "Press +V to paste" 85 | msgstr "+V zum einfügen" 86 | 87 | #: include/template/the-paste-instructions.php:17 88 | msgid "Press ctrl+V to paste" 89 | msgstr "ctrl+V zum einfügen" 90 | 91 | # @ cheese 92 | #: include/template/uploader.php:13 93 | msgid "Try again" 94 | msgstr "Nochmal" 95 | 96 | # @ default 97 | #: include/template/uploader.php:16 98 | msgid "Title" 99 | msgstr "Titel" 100 | 101 | #: include/ThePaste/Admin/AbstractOptions.php:121 102 | msgid "Enable The Paste in TinyMCE" 103 | msgstr "Aktiviere The Paste im TinyMCE" 104 | 105 | #: include/ThePaste/Admin/AbstractOptions.php:173 106 | msgid "Available placeholders…" 107 | msgstr "Verfügbare Platzhalter…" 108 | 109 | #. translators: 'Media Library' H1 from WP Core 110 | #: include/ThePaste/Admin/AbstractOptions.php:180 111 | msgid "Current post title if available, ‘%s’ otherwise" 112 | msgstr "Beitragstitel wenn verfügbar, ansonsten „%s“" 113 | 114 | #: include/ThePaste/Admin/AbstractOptions.php:185 115 | msgid "Display name of current user" 116 | msgstr "Öffentlicher Name des Benutzers" 117 | 118 | #: include/ThePaste/Admin/AbstractOptions.php:187 119 | msgid "Login name of current user" 120 | msgstr "Benutzername" 121 | 122 | #: include/ThePaste/Admin/AbstractOptions.php:189 123 | msgid "Current user ID" 124 | msgstr "Benutzer-ID" 125 | 126 | #: include/ThePaste/Admin/AbstractOptions.php:194 127 | msgid "Four-digit year" 128 | msgstr "Jahr vierstellig" 129 | 130 | #: include/ThePaste/Admin/AbstractOptions.php:196 131 | msgid "Two-digit year" 132 | msgstr "Jahr zweistellig" 133 | 134 | #: include/ThePaste/Admin/AbstractOptions.php:198 135 | msgid "Number of month with leading zero (01 to 12)" 136 | msgstr "Monat als Zahl mit führender Null (01 bis 12)" 137 | 138 | #: include/ThePaste/Admin/AbstractOptions.php:200 139 | msgid "Day of month with leading zero (01 to 31)" 140 | msgstr "Tag des Monats mit führender Null (01 bis 31)" 141 | 142 | #: include/ThePaste/Admin/AbstractOptions.php:202 143 | msgid "Day of month (1 to 31)" 144 | msgstr "Tag des Monats (1 bis 31)" 145 | 146 | #: include/ThePaste/Admin/AbstractOptions.php:204 147 | msgid "Two digit hour in 24-hour format" 148 | msgstr "Zweistellige Stunde im 24-Stunden-Format" 149 | 150 | #: include/ThePaste/Admin/AbstractOptions.php:206 151 | msgid "Two digit hour in 12-hour format" 152 | msgstr "Zweistellige Stunde im 12-Stunden-Format" 153 | 154 | #: include/ThePaste/Admin/AbstractOptions.php:208 155 | msgid "Two digit minute" 156 | msgstr "Zweistellige Minute" 157 | 158 | #: include/ThePaste/Admin/AbstractOptions.php:210 159 | msgid "Two digit second" 160 | msgstr "Zweistellige Sekunde" 161 | 162 | #: include/ThePaste/Admin/AbstractOptions.php:213 163 | msgid "Date based on locale" 164 | msgstr "Lokalisiertes Datum" 165 | 166 | #: include/ThePaste/Admin/AbstractOptions.php:215 167 | msgid "Time based on locale" 168 | msgstr "Lokalisierte Uhrzeit" 169 | 170 | #: include/ThePaste/Admin/AbstractOptions.php:218 171 | msgid "Unix timestamp" 172 | msgstr "Unix-Zeitstempel" 173 | 174 | #: include/ThePaste/Admin/AbstractOptions.php:232 175 | msgid "Paste some cash with PayPal" 176 | msgstr "Ein bisschen Cash mit PayPal einfügen" 177 | 178 | #: include/ThePaste/Admin/Admin.php:35 179 | msgid "Paste as file" 180 | msgstr "Als Datei einfügen" 181 | 182 | #: include/ThePaste/Admin/Admin.php:92 183 | msgid "Upload pasted images" 184 | msgstr "Eingefügte Bilder sofort hochladen" 185 | 186 | #: include/ThePaste/Admin/Admin.php:93 187 | msgid "Upload image" 188 | msgstr "Bild hochladen" 189 | 190 | #: include/ThePaste/Admin/Admin.php:95 191 | msgid "Copy & Paste" 192 | msgstr "Kopieren & Einfügen" 193 | 194 | #: include/ThePaste/Admin/Admin.php:96 195 | msgid "Prefer pasting files" 196 | msgstr "Bevorzugt Dateien einfügen" 197 | 198 | #: include/ThePaste/Admin/UserOptions.php:65 199 | msgid "The Paste: Classic Editor" 200 | msgstr "The Paste: Classic Editor" 201 | 202 | #: include/ThePaste/Admin/UserOptions.php:74 203 | msgid "The Paste: Image Quality" 204 | msgstr "The Paste: Bildqualität" 205 | 206 | #: include/ThePaste/Admin/UserOptions.php:83 207 | msgid "The Paste: Default filename" 208 | msgstr "The Paste: Standard-Dateiname" 209 | 210 | #: include/ThePaste/Admin/UserOptions.php:92 211 | #: include/ThePaste/Admin/WritingOptions.php:110 212 | msgid "Support The Paste" 213 | msgstr "The Paste unterstützen" 214 | 215 | #: include/ThePaste/Admin/WritingOptions.php:70 216 | msgid "Classic Editor" 217 | msgstr "Classic Editor" 218 | 219 | #: include/ThePaste/Admin/WritingOptions.php:78 220 | msgid "Image Quality" 221 | msgstr "Bildqualität" 222 | 223 | #: include/ThePaste/Admin/WritingOptions.php:86 224 | msgid "Default filename" 225 | msgstr "Standard-Dateiname" 226 | 227 | #: include/ThePaste/Admin/WritingOptions.php:97 228 | msgid "User profile options" 229 | msgstr "Einstellungen beim Profil bearbeiten" 230 | 231 | #: include/ThePaste/Admin/WritingOptions.php:104 232 | msgid "Allow users to manage their personal pasting options" 233 | msgstr "Erlaubt Benutzer:innen eigene Paste-Einstellungen" 234 | 235 | #~ msgid "The Paste: Enable Classic Editor" 236 | #~ msgstr "The Paste: Classic Editor aktivieren" 237 | 238 | #~ msgid "Allow pasting files and images in Classic Editor." 239 | #~ msgstr "Erlaubt das Einfügen von Bildern und Dateien im Classic Editor." 240 | 241 | #~ msgid "The Paste: Data URI Images" 242 | #~ msgstr "The Paste: Data-URI-Bilder" 243 | 244 | #~ msgid "Paste Data URI Images in Classic Editor." 245 | #~ msgstr "Data-URI-Bilder im Classic Editor einfügen." 246 | 247 | #~ msgid "" 248 | #~ "If this option is disabled, you can still upload existing data URI images." 249 | #~ msgstr "" 250 | #~ "Wenn deaktiviert, kannst bereits vorhandene Data-URI-Bilder trotzdem " 251 | #~ "hochladen." 252 | 253 | #~ msgid "Current post title if available, empty string otherwise" 254 | #~ msgstr "Beitragstitel wenn verfügbar, ansonsten leerer String" 255 | 256 | #~ msgid "Name of current user" 257 | #~ msgstr "Aktueller Benutzername" 258 | 259 | #~ msgid "Filename if available, ‘Pasted’ otherwise" 260 | #~ msgstr "Dateiname falls vorhanden, ansonsten ’Eingefügt'" 261 | 262 | # @ cheese 263 | #~ msgid "Snapshot" 264 | #~ msgstr "Schnappschuss" 265 | 266 | # @ cheese 267 | #~ msgid "Take Snapshot" 268 | #~ msgstr "Schnappschuss" 269 | 270 | #~ msgid "Pasted into" 271 | #~ msgstr "Eingefügt in" 272 | 273 | # @ default 274 | #~ msgid "Image" 275 | #~ msgstr "Bild" 276 | 277 | # @ cheese 278 | #~ msgid "No image data pasted." 279 | #~ msgstr "Kein Bild in der Zwischenablage." 280 | 281 | #~ msgid "Error pasting image data." 282 | #~ msgstr "Fehler beim Einfügen." 283 | 284 | # @ cheese 285 | #~ msgid "Paste some image Data from your clipboard" 286 | #~ msgstr "Füge Bilder aus der Zwischenablage ein" 287 | 288 | #~ msgid "Click here please..." 289 | #~ msgstr "Bitte hier klicken..." 290 | 291 | #~ msgid "Pasted Images" 292 | #~ msgstr "Eingefügte Bilder" 293 | 294 | #~ msgid "Pasteboard" 295 | #~ msgstr "Pasteboard" 296 | 297 | #~ msgid "Enable Copy-Paste image uploads." 298 | #~ msgstr "Copy-Paste Bilduploads aktivieren" 299 | 300 | # @ cheese 301 | #~ msgid "Webcam Record" 302 | #~ msgstr "Webcam Schnappschuss" 303 | 304 | # @ cheese 305 | #~ msgid "Record" 306 | #~ msgstr "Aufnahme" 307 | 308 | #~ msgid "An error occured." 309 | #~ msgstr "Ein Fehler ist aufgetreten." 310 | 311 | #~ msgid "Please allow camera access in your browser." 312 | #~ msgstr "Bitte erlauben Deinem Browser den Zugriff auf die Kamera!" 313 | 314 | #~ msgid "Enable Webcam image uploads." 315 | #~ msgstr "Webcam-Bildupload aktivieren." 316 | 317 | #~ msgid "" 318 | #~ "In some Browsers – e.g. Chrome – this will not work with non-HTTPS " 319 | #~ "connections." 320 | #~ msgstr "" 321 | #~ "In einigen Browsern, z.B. Chrome, wird das nicht ohne HTTPS-Verbindung " 322 | #~ "funktionieren." 323 | 324 | # @ cheese 325 | #~ msgid "Paste from Clipboard" 326 | #~ msgstr "Aus der Zwischenablage" 327 | 328 | # @ cheese 329 | #~ msgid "Your Browser does not support pasting processable image data." 330 | #~ msgstr "Ihr Browser kann hier leider keine brauchbaren Bilddaten einfügen." 331 | -------------------------------------------------------------------------------- /css/admin/mce/the-paste-editor.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["variables/_dashicons.scss","admin/mce/the-paste-editor.scss","admin/mce/the-paste-editor.css"],"names":[],"mappings":"AAAA,6BAAA;AACA,gGAAA;ACCA;EACC,iBAAA;EACA,iBAAA;EACA,kBAAA;EACA,wBAAA;EACA,8BAAA;EACA,wBAAA;EACA,YAAA;EACA,kBAAA;EACA,gCAAA;EACA,kBAAA;EACA,WAAA;EACA,aAAA;EACA,cAAA;EACA,sBAAA;EACA,WAAA;EACA,+BAAA;EACA,mBAAA;EACA,YAAA;ACCD;ADAC;EACC,kCAAA;EACA,yBAAA;ACEF;ADAC;EACC,uCAAA;EACA,uCAAA;EACA,yBAAA;ACEF;ADAC;EACC,uCAAA;EACA,uCAAA;EACA,yBAAA;ACEF","file":"the-paste-editor.css","sourcesContent":["/* WordPress Dashicons Vars */\n/* generated from https://raw.githubusercontent.com/WordPress/dashicons/master/codepoints.json */\n\n$dashicon-menu: '\\f333';\n$dashicon-admin-site: '\\f319';\n$dashicon-dashboard: '\\f226';\n$dashicon-admin-media: '\\f104';\n$dashicon-admin-page: '\\f105';\n$dashicon-admin-comments: '\\f101';\n$dashicon-admin-appearance: '\\f100';\n$dashicon-admin-plugins: '\\f106';\n$dashicon-admin-users: '\\f110';\n$dashicon-admin-tools: '\\f107';\n$dashicon-admin-settings: '\\f108';\n$dashicon-admin-network: '\\f112';\n$dashicon-admin-generic: '\\f111';\n$dashicon-admin-home: '\\f102';\n$dashicon-admin-collapse: '\\f148';\n$dashicon-filter: '\\f536';\n$dashicon-admin-customizer: '\\f540';\n$dashicon-admin-multisite: '\\f541';\n$dashicon-admin-links: '\\f103';\n$dashicon-admin-post: '\\f109';\n$dashicon-format-image: '\\f128';\n$dashicon-format-gallery: '\\f161';\n$dashicon-format-audio: '\\f127';\n$dashicon-format-video: '\\f126';\n$dashicon-format-chat: '\\f125';\n$dashicon-format-status: '\\f130';\n$dashicon-format-aside: '\\f123';\n$dashicon-format-quote: '\\f122';\n$dashicon-welcome-write-blog: '\\f119';\n$dashicon-welcome-add-page: '\\f133';\n$dashicon-welcome-view-site: '\\f115';\n$dashicon-welcome-widgets-menus: '\\f116';\n$dashicon-welcome-comments: '\\f117';\n$dashicon-welcome-learn-more: '\\f118';\n$dashicon-image-crop: '\\f165';\n$dashicon-image-rotate: '\\f531';\n$dashicon-image-rotate-left: '\\f166';\n$dashicon-image-rotate-right: '\\f167';\n$dashicon-image-flip-vertical: '\\f168';\n$dashicon-image-flip-horizontal: '\\f169';\n$dashicon-image-filter: '\\f533';\n$dashicon-undo: '\\f171';\n$dashicon-redo: '\\f172';\n$dashicon-editor-bold: '\\f200';\n$dashicon-editor-italic: '\\f201';\n$dashicon-editor-ul: '\\f203';\n$dashicon-editor-ol: '\\f204';\n$dashicon-editor-quote: '\\f205';\n$dashicon-editor-alignleft: '\\f206';\n$dashicon-editor-aligncenter: '\\f207';\n$dashicon-editor-alignright: '\\f208';\n$dashicon-editor-insertmore: '\\f209';\n$dashicon-editor-spellcheck: '\\f210';\n$dashicon-editor-expand: '\\f211';\n$dashicon-editor-contract: '\\f506';\n$dashicon-editor-kitchensink: '\\f212';\n$dashicon-editor-underline: '\\f213';\n$dashicon-editor-justify: '\\f214';\n$dashicon-editor-textcolor: '\\f215';\n$dashicon-editor-paste-word: '\\f216';\n$dashicon-editor-paste-text: '\\f217';\n$dashicon-editor-removeformatting: '\\f218';\n$dashicon-editor-video: '\\f219';\n$dashicon-editor-customchar: '\\f220';\n$dashicon-editor-outdent: '\\f221';\n$dashicon-editor-indent: '\\f222';\n$dashicon-editor-help: '\\f223';\n$dashicon-editor-strikethrough: '\\f224';\n$dashicon-editor-unlink: '\\f225';\n$dashicon-editor-rtl: '\\f320';\n$dashicon-editor-break: '\\f474';\n$dashicon-editor-code: '\\f475';\n$dashicon-editor-code-duplicate: '\\f494';\n$dashicon-editor-paragraph: '\\f476';\n$dashicon-editor-table: '\\f535';\n$dashicon-align-left: '\\f135';\n$dashicon-align-right: '\\f136';\n$dashicon-align-center: '\\f134';\n$dashicon-align-none: '\\f138';\n$dashicon-lock: '\\f160';\n$dashicon-lock-duplicate: '\\f315';\n$dashicon-unlock: '\\f528';\n$dashicon-calendar: '\\f145';\n$dashicon-calendar-alt: '\\f508';\n$dashicon-visibility: '\\f177';\n$dashicon-hidden: '\\f530';\n$dashicon-post-status: '\\f173';\n$dashicon-edit: '\\f464';\n$dashicon-edit-large: '\\f327';\n$dashicon-sticky: '\\f537';\n$dashicon-external: '\\f504';\n$dashicon-arrow-up: '\\f142';\n$dashicon-arrow-up-duplicate: '\\f143';\n$dashicon-arrow-down: '\\f140';\n$dashicon-arrow-left: '\\f141';\n$dashicon-arrow-right: '\\f139';\n$dashicon-arrow-up-alt: '\\f342';\n$dashicon-arrow-down-alt: '\\f346';\n$dashicon-arrow-left-alt: '\\f340';\n$dashicon-arrow-right-alt: '\\f344';\n$dashicon-arrow-up-alt2: '\\f343';\n$dashicon-arrow-down-alt2: '\\f347';\n$dashicon-arrow-left-alt2: '\\f341';\n$dashicon-arrow-right-alt2: '\\f345';\n$dashicon-leftright: '\\f229';\n$dashicon-sort: '\\f156';\n$dashicon-randomize: '\\f503';\n$dashicon-list-view: '\\f163';\n$dashicon-excerpt-view: '\\f164';\n$dashicon-grid-view: '\\f509';\n$dashicon-move: '\\f545';\n$dashicon-hammer: '\\f308';\n$dashicon-art: '\\f309';\n$dashicon-migrate: '\\f310';\n$dashicon-performance: '\\f311';\n$dashicon-universal-access: '\\f483';\n$dashicon-universal-access-alt: '\\f507';\n$dashicon-tickets: '\\f486';\n$dashicon-nametag: '\\f484';\n$dashicon-clipboard: '\\f481';\n$dashicon-heart: '\\f487';\n$dashicon-megaphone: '\\f488';\n$dashicon-schedule: '\\f489';\n$dashicon-wordpress: '\\f120';\n$dashicon-wordpress-alt: '\\f324';\n$dashicon-pressthis: '\\f157';\n$dashicon-update: '\\f463';\n$dashicon-screenoptions: '\\f180';\n$dashicon-cart: '\\f174';\n$dashicon-feedback: '\\f175';\n$dashicon-translation: '\\f326';\n$dashicon-tag: '\\f323';\n$dashicon-category: '\\f318';\n$dashicon-archive: '\\f480';\n$dashicon-tagcloud: '\\f479';\n$dashicon-text: '\\f478';\n$dashicon-media-archive: '\\f501';\n$dashicon-media-audio: '\\f500';\n$dashicon-media-code: '\\f499';\n$dashicon-media-default: '\\f498';\n$dashicon-media-document: '\\f497';\n$dashicon-media-interactive: '\\f496';\n$dashicon-media-spreadsheet: '\\f495';\n$dashicon-media-text: '\\f491';\n$dashicon-media-video: '\\f490';\n$dashicon-playlist-audio: '\\f492';\n$dashicon-playlist-video: '\\f493';\n$dashicon-controls-play: '\\f522';\n$dashicon-controls-pause: '\\f523';\n$dashicon-controls-forward: '\\f519';\n$dashicon-controls-skipforward: '\\f517';\n$dashicon-controls-back: '\\f518';\n$dashicon-controls-skipback: '\\f516';\n$dashicon-controls-repeat: '\\f515';\n$dashicon-controls-volumeon: '\\f521';\n$dashicon-controls-volumeoff: '\\f520';\n$dashicon-yes: '\\f147';\n$dashicon-no: '\\f158';\n$dashicon-no-alt: '\\f335';\n$dashicon-plus: '\\f132';\n$dashicon-plus-alt: '\\f502';\n$dashicon-plus-alt2: '\\f543';\n$dashicon-minus: '\\f460';\n$dashicon-dismiss: '\\f153';\n$dashicon-marker: '\\f159';\n$dashicon-star-filled: '\\f155';\n$dashicon-star-half: '\\f459';\n$dashicon-star-empty: '\\f154';\n$dashicon-flag: '\\f227';\n$dashicon-info: '\\f348';\n$dashicon-warning: '\\f534';\n$dashicon-share: '\\f237';\n$dashicon-share1: '\\f237';\n$dashicon-share-alt: '\\f240';\n$dashicon-share-alt2: '\\f242';\n$dashicon-twitter: '\\f301';\n$dashicon-rss: '\\f303';\n$dashicon-email: '\\f465';\n$dashicon-email-alt: '\\f466';\n$dashicon-facebook: '\\f304';\n$dashicon-facebook-alt: '\\f305';\n$dashicon-networking: '\\f325';\n$dashicon-googleplus: '\\f462';\n$dashicon-location: '\\f230';\n$dashicon-location-alt: '\\f231';\n$dashicon-camera: '\\f306';\n$dashicon-images-alt: '\\f232';\n$dashicon-images-alt2: '\\f233';\n$dashicon-video-alt: '\\f234';\n$dashicon-video-alt2: '\\f235';\n$dashicon-video-alt3: '\\f236';\n$dashicon-vault: '\\f178';\n$dashicon-shield: '\\f332';\n$dashicon-shield-alt: '\\f334';\n$dashicon-sos: '\\f468';\n$dashicon-search: '\\f179';\n$dashicon-slides: '\\f181';\n$dashicon-analytics: '\\f183';\n$dashicon-chart-pie: '\\f184';\n$dashicon-chart-bar: '\\f185';\n$dashicon-chart-line: '\\f238';\n$dashicon-chart-area: '\\f239';\n$dashicon-groups: '\\f307';\n$dashicon-businessman: '\\f338';\n$dashicon-id: '\\f336';\n$dashicon-id-alt: '\\f337';\n$dashicon-products: '\\f312';\n$dashicon-awards: '\\f313';\n$dashicon-forms: '\\f314';\n$dashicon-testimonial: '\\f473';\n$dashicon-portfolio: '\\f322';\n$dashicon-book: '\\f330';\n$dashicon-book-alt: '\\f331';\n$dashicon-download: '\\f316';\n$dashicon-upload: '\\f317';\n$dashicon-backup: '\\f321';\n$dashicon-clock: '\\f469';\n$dashicon-lightbulb: '\\f339';\n$dashicon-microphone: '\\f482';\n$dashicon-desktop: '\\f472';\n$dashicon-laptop: '\\f547';\n$dashicon-tablet: '\\f471';\n$dashicon-smartphone: '\\f470';\n$dashicon-phone: '\\f525';\n$dashicon-smiley: '\\f328';\n$dashicon-index-card: '\\f510';\n$dashicon-carrot: '\\f511';\n$dashicon-building: '\\f512';\n$dashicon-store: '\\f513';\n$dashicon-album: '\\f514';\n$dashicon-palmtree: '\\f527';\n$dashicon-tickets-alt: '\\f524';\n$dashicon-money: '\\f526';\n$dashicon-thumbs-up: '\\f529';\n$dashicon-thumbs-down: '\\f542';\n$dashicon-layout: '\\f538';\n$dashicon-paperclip: '\\f546';\n$dashicon-email-alt2: '\\f467';\n$dashicon-menu-alt: '\\f228';\n$dashicon-trash: '\\f182';\n$dashicon-heading: '\\f10e';\n$dashicon-insert: '\\f10f';\n$dashicon-align-full-width: '\\f114';\n$dashicon-button: '\\f11a';\n$dashicon-align-wide: '\\f11b';\n$dashicon-ellipsis: '\\f11c';\n$dashicon-buddicons-activity: '\\f452';\n$dashicon-buddicons-buddypress-logo: '\\f448';\n$dashicon-buddicons-community: '\\f453';\n$dashicon-buddicons-forums: '\\f449';\n$dashicon-buddicons-friends: '\\f454';\n$dashicon-buddicons-groups: '\\f456';\n$dashicon-buddicons-pm: '\\f457';\n$dashicon-buddicons-replies: '\\f451';\n$dashicon-buddicons-topics: '\\f450';\n$dashicon-buddicons-tracking: '\\f455';\n$dashicon-admin-site-alt: '\\f11d';\n$dashicon-admin-site-alt2: '\\f11e';\n$dashicon-admin-site-alt3: '\\f11f';\n$dashicon-rest-api: '\\f124';\n$dashicon-yes-alt: '\\f12a';\n$dashicon-buddicons-bbpress-logo: '\\f477';\n$dashicon-tide: '\\f10d';\n$dashicon-editor-ol-rtl: '\\f12c';\n$dashicon-instagram: '\\f12d';\n$dashicon-businessperson: '\\f12e';\n$dashicon-businesswoman: '\\f12f';\n$dashicon-color-picker: '\\f131';\n$dashicon-camera-alt: '\\f129';\n$dashicon-editor-ltr: '\\f10c';\n$dashicon-cloud: '\\f176';\n$dashicon-twitter-alt: '\\f302';\n$dashicon-menu-alt2: '\\f329';\n$dashicon-menu-alt3: '\\f349';\n$dashicon-plugins-checked: '\\f485';\n$dashicon-text-page: '\\f121';\n$dashicon-update-alt: '\\f113';\n$dashicon-code-standards: '\\f13a';\n$dashicon-align-pull-left: '\\f10a';\n$dashicon-align-pull-right: '\\f10b';\n$dashicon-block-default: '\\f12b';\n$dashicon-cloud-saved: '\\f137';\n$dashicon-cloud-upload: '\\f13b';\n$dashicon-columns: '\\f13c';\n$dashicon-cover-image: '\\f13d';\n$dashicon-embed-audio: '\\f13e';\n$dashicon-embed-generic: '\\f13f';\n$dashicon-embed-photo: '\\f144';\n$dashicon-embed-post: '\\f146';\n$dashicon-embed-video: '\\f149';\n$dashicon-exit: '\\f14a';\n$dashicon-html: '\\f14b';\n$dashicon-info-outline: '\\f14c';\n$dashicon-insert-after: '\\f14d';\n$dashicon-insert-before: '\\f14e';\n$dashicon-remove: '\\f14f';\n$dashicon-shortcode: '\\f150';\n$dashicon-table-col-after: '\\f151';\n$dashicon-table-col-before: '\\f152';\n$dashicon-table-col-delete: '\\f15a';\n$dashicon-table-row-after: '\\f15b';\n$dashicon-table-row-before: '\\f15c';\n$dashicon-table-row-delete: '\\f15d';\n$dashicon-saved: '\\f15e';\n$dashicon-airplane: '\\f15f';\n$dashicon-amazon: '\\f162';\n$dashicon-bank: '\\f16a';\n$dashicon-beer: '\\f16c';\n$dashicon-bell: '\\f16d';\n$dashicon-calculator: '\\f16e';\n$dashicon-coffee: '\\f16f';\n$dashicon-database-add: '\\f170';\n$dashicon-database-export: '\\f17a';\n$dashicon-database-import: '\\f17b';\n$dashicon-database-remove: '\\f17c';\n$dashicon-database-view: '\\f17d';\n$dashicon-database: '\\f17e';\n$dashicon-drumstick: '\\f17f';\n$dashicon-edit-page: '\\f186';\n$dashicon-food: '\\f187';\n$dashicon-fullscreen-alt: '\\f188';\n$dashicon-fullscreen-exit-alt: '\\f189';\n$dashicon-games: '\\f18a';\n$dashicon-google: '\\f18b';\n$dashicon-hourglass: '\\f18c';\n$dashicon-linkedin: '\\f18d';\n$dashicon-money-alt: '\\f18e';\n$dashicon-open-folder: '\\f18f';\n$dashicon-pdf: '\\f190';\n$dashicon-pets: '\\f191';\n$dashicon-pinterest: '\\f192';\n$dashicon-printer: '\\f193';\n$dashicon-privacy: '\\f194';\n$dashicon-reddit: '\\f195';\n$dashicon-spotify: '\\f196';\n$dashicon-superhero-alt: '\\f197';\n$dashicon-superhero: '\\f198';\n$dashicon-twitch: '\\f199';\n$dashicon-whatsapp: '\\f19a';\n$dashicon-youtube: '\\f19b';\n$dashicon-car: '\\f16b';\n$dashicon-podio: '\\f19c';\n$dashicon-xing: '\\f19d';\n","@use \"../../variables/index\" as *;\n\nprogress.the-paste-progress {\n\t--bar-height: 4px;\n\t--bar-margin: 0px;\n\t--bar-padding: 0px;\n\t--bar-color: transparent;\n\t--bar-background: currentColor;\n\t--bar-border-radius: 3px;\n\tpadding: 1px;\n\tposition: relative;\n\tbackground: rgba(0,0,0,0.125);\n\tborder-radius: 3px;\n\theight: 6px;\n\tmargin: 8px 0;\n\tdisplay: block;\n\tbox-sizing: border-box;\n\twidth: 100%;\n\toutline: 2px solid currentColor;\n\toutline-offset: 0px;\n\tborder:none;\n\t&::-webkit-progress-bar {\n\t\tbackground-color: var(--bar-color);\n\t\theight: var(--bar-height);\n\t}\n\t&::-webkit-progress-value {\n\t\tbackground-color: var(--bar-background);\n\t\tborder-radius: var(--bar-border-radius);\n\t\theight: var(--bar-height);\n\t}\n\t&::-moz-progress-bar {\n\t\tbackground-color: var(--bar-background);\n\t\tborder-radius: var(--bar-border-radius);\n\t\theight: var(--bar-height);\n\t}\n}\n","/* WordPress Dashicons Vars */\n/* generated from https://raw.githubusercontent.com/WordPress/dashicons/master/codepoints.json */\nprogress.the-paste-progress {\n --bar-height: 4px;\n --bar-margin: 0px;\n --bar-padding: 0px;\n --bar-color: transparent;\n --bar-background: currentColor;\n --bar-border-radius: 3px;\n padding: 1px;\n position: relative;\n background: rgba(0, 0, 0, 0.125);\n border-radius: 3px;\n height: 6px;\n margin: 8px 0;\n display: block;\n box-sizing: border-box;\n width: 100%;\n outline: 2px solid currentColor;\n outline-offset: 0px;\n border: none;\n}\nprogress.the-paste-progress::-webkit-progress-bar {\n background-color: var(--bar-color);\n height: var(--bar-height);\n}\nprogress.the-paste-progress::-webkit-progress-value {\n background-color: var(--bar-background);\n border-radius: var(--bar-border-radius);\n height: var(--bar-height);\n}\nprogress.the-paste-progress::-moz-progress-bar {\n background-color: var(--bar-background);\n border-radius: var(--bar-border-radius);\n height: var(--bar-height);\n}"]} -------------------------------------------------------------------------------- /css/admin/mce/the-paste-toolbar.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["variables/_dashicons.scss","admin/mce/the-paste-toolbar.scss","admin/mce/the-paste-toolbar.css"],"names":[],"mappings":"AAAA,6BAAA;AACA,gGAAA;ACGC;EACC,gBDoNgB,ECpNW,wDAAA;EAC3B,qBAAA;EACA,WAAA;EACA,YAAA;EACA,eAAA;EACA,cAAA;EACA,sBAAA;EACA,wBAAA;EACA,gBAAA;EACA,kBAAA;EACA,mBAAA;EACA,kBAAA;EACA,gCAAA;ACDF;;ADMC;EACC,WAAA;EACA,oDAAA;UAAA,4CAAA;EACA,8BAAA;EACA,qBAAA;EACA,WAAA;EACA,YAAA;EACA,eAAA;EACA,cAAA;EACA,mBAAA;EACA,kBAAA;EACA,gCAAA;ACHF;;ADQC;EACC,WAAA;EACA,sDAAA;UAAA,8CAAA;EACA,8BAAA;EACA,qBAAA;EACA,WAAA;EACA,YAAA;EACA,eAAA;EACA,cAAA;EACA,mBAAA;EACA,kBAAA;EACA,gCAAA;EACA,qBAAA;ACLF;ADME;EACC,oBAAA;EACA,cAAA;ACJH","file":"the-paste-toolbar.css","sourcesContent":["/* WordPress Dashicons Vars */\n/* generated from https://raw.githubusercontent.com/WordPress/dashicons/master/codepoints.json */\n\n$dashicon-menu: '\\f333';\n$dashicon-admin-site: '\\f319';\n$dashicon-dashboard: '\\f226';\n$dashicon-admin-media: '\\f104';\n$dashicon-admin-page: '\\f105';\n$dashicon-admin-comments: '\\f101';\n$dashicon-admin-appearance: '\\f100';\n$dashicon-admin-plugins: '\\f106';\n$dashicon-admin-users: '\\f110';\n$dashicon-admin-tools: '\\f107';\n$dashicon-admin-settings: '\\f108';\n$dashicon-admin-network: '\\f112';\n$dashicon-admin-generic: '\\f111';\n$dashicon-admin-home: '\\f102';\n$dashicon-admin-collapse: '\\f148';\n$dashicon-filter: '\\f536';\n$dashicon-admin-customizer: '\\f540';\n$dashicon-admin-multisite: '\\f541';\n$dashicon-admin-links: '\\f103';\n$dashicon-admin-post: '\\f109';\n$dashicon-format-image: '\\f128';\n$dashicon-format-gallery: '\\f161';\n$dashicon-format-audio: '\\f127';\n$dashicon-format-video: '\\f126';\n$dashicon-format-chat: '\\f125';\n$dashicon-format-status: '\\f130';\n$dashicon-format-aside: '\\f123';\n$dashicon-format-quote: '\\f122';\n$dashicon-welcome-write-blog: '\\f119';\n$dashicon-welcome-add-page: '\\f133';\n$dashicon-welcome-view-site: '\\f115';\n$dashicon-welcome-widgets-menus: '\\f116';\n$dashicon-welcome-comments: '\\f117';\n$dashicon-welcome-learn-more: '\\f118';\n$dashicon-image-crop: '\\f165';\n$dashicon-image-rotate: '\\f531';\n$dashicon-image-rotate-left: '\\f166';\n$dashicon-image-rotate-right: '\\f167';\n$dashicon-image-flip-vertical: '\\f168';\n$dashicon-image-flip-horizontal: '\\f169';\n$dashicon-image-filter: '\\f533';\n$dashicon-undo: '\\f171';\n$dashicon-redo: '\\f172';\n$dashicon-editor-bold: '\\f200';\n$dashicon-editor-italic: '\\f201';\n$dashicon-editor-ul: '\\f203';\n$dashicon-editor-ol: '\\f204';\n$dashicon-editor-quote: '\\f205';\n$dashicon-editor-alignleft: '\\f206';\n$dashicon-editor-aligncenter: '\\f207';\n$dashicon-editor-alignright: '\\f208';\n$dashicon-editor-insertmore: '\\f209';\n$dashicon-editor-spellcheck: '\\f210';\n$dashicon-editor-expand: '\\f211';\n$dashicon-editor-contract: '\\f506';\n$dashicon-editor-kitchensink: '\\f212';\n$dashicon-editor-underline: '\\f213';\n$dashicon-editor-justify: '\\f214';\n$dashicon-editor-textcolor: '\\f215';\n$dashicon-editor-paste-word: '\\f216';\n$dashicon-editor-paste-text: '\\f217';\n$dashicon-editor-removeformatting: '\\f218';\n$dashicon-editor-video: '\\f219';\n$dashicon-editor-customchar: '\\f220';\n$dashicon-editor-outdent: '\\f221';\n$dashicon-editor-indent: '\\f222';\n$dashicon-editor-help: '\\f223';\n$dashicon-editor-strikethrough: '\\f224';\n$dashicon-editor-unlink: '\\f225';\n$dashicon-editor-rtl: '\\f320';\n$dashicon-editor-break: '\\f474';\n$dashicon-editor-code: '\\f475';\n$dashicon-editor-code-duplicate: '\\f494';\n$dashicon-editor-paragraph: '\\f476';\n$dashicon-editor-table: '\\f535';\n$dashicon-align-left: '\\f135';\n$dashicon-align-right: '\\f136';\n$dashicon-align-center: '\\f134';\n$dashicon-align-none: '\\f138';\n$dashicon-lock: '\\f160';\n$dashicon-lock-duplicate: '\\f315';\n$dashicon-unlock: '\\f528';\n$dashicon-calendar: '\\f145';\n$dashicon-calendar-alt: '\\f508';\n$dashicon-visibility: '\\f177';\n$dashicon-hidden: '\\f530';\n$dashicon-post-status: '\\f173';\n$dashicon-edit: '\\f464';\n$dashicon-edit-large: '\\f327';\n$dashicon-sticky: '\\f537';\n$dashicon-external: '\\f504';\n$dashicon-arrow-up: '\\f142';\n$dashicon-arrow-up-duplicate: '\\f143';\n$dashicon-arrow-down: '\\f140';\n$dashicon-arrow-left: '\\f141';\n$dashicon-arrow-right: '\\f139';\n$dashicon-arrow-up-alt: '\\f342';\n$dashicon-arrow-down-alt: '\\f346';\n$dashicon-arrow-left-alt: '\\f340';\n$dashicon-arrow-right-alt: '\\f344';\n$dashicon-arrow-up-alt2: '\\f343';\n$dashicon-arrow-down-alt2: '\\f347';\n$dashicon-arrow-left-alt2: '\\f341';\n$dashicon-arrow-right-alt2: '\\f345';\n$dashicon-leftright: '\\f229';\n$dashicon-sort: '\\f156';\n$dashicon-randomize: '\\f503';\n$dashicon-list-view: '\\f163';\n$dashicon-excerpt-view: '\\f164';\n$dashicon-grid-view: '\\f509';\n$dashicon-move: '\\f545';\n$dashicon-hammer: '\\f308';\n$dashicon-art: '\\f309';\n$dashicon-migrate: '\\f310';\n$dashicon-performance: '\\f311';\n$dashicon-universal-access: '\\f483';\n$dashicon-universal-access-alt: '\\f507';\n$dashicon-tickets: '\\f486';\n$dashicon-nametag: '\\f484';\n$dashicon-clipboard: '\\f481';\n$dashicon-heart: '\\f487';\n$dashicon-megaphone: '\\f488';\n$dashicon-schedule: '\\f489';\n$dashicon-wordpress: '\\f120';\n$dashicon-wordpress-alt: '\\f324';\n$dashicon-pressthis: '\\f157';\n$dashicon-update: '\\f463';\n$dashicon-screenoptions: '\\f180';\n$dashicon-cart: '\\f174';\n$dashicon-feedback: '\\f175';\n$dashicon-translation: '\\f326';\n$dashicon-tag: '\\f323';\n$dashicon-category: '\\f318';\n$dashicon-archive: '\\f480';\n$dashicon-tagcloud: '\\f479';\n$dashicon-text: '\\f478';\n$dashicon-media-archive: '\\f501';\n$dashicon-media-audio: '\\f500';\n$dashicon-media-code: '\\f499';\n$dashicon-media-default: '\\f498';\n$dashicon-media-document: '\\f497';\n$dashicon-media-interactive: '\\f496';\n$dashicon-media-spreadsheet: '\\f495';\n$dashicon-media-text: '\\f491';\n$dashicon-media-video: '\\f490';\n$dashicon-playlist-audio: '\\f492';\n$dashicon-playlist-video: '\\f493';\n$dashicon-controls-play: '\\f522';\n$dashicon-controls-pause: '\\f523';\n$dashicon-controls-forward: '\\f519';\n$dashicon-controls-skipforward: '\\f517';\n$dashicon-controls-back: '\\f518';\n$dashicon-controls-skipback: '\\f516';\n$dashicon-controls-repeat: '\\f515';\n$dashicon-controls-volumeon: '\\f521';\n$dashicon-controls-volumeoff: '\\f520';\n$dashicon-yes: '\\f147';\n$dashicon-no: '\\f158';\n$dashicon-no-alt: '\\f335';\n$dashicon-plus: '\\f132';\n$dashicon-plus-alt: '\\f502';\n$dashicon-plus-alt2: '\\f543';\n$dashicon-minus: '\\f460';\n$dashicon-dismiss: '\\f153';\n$dashicon-marker: '\\f159';\n$dashicon-star-filled: '\\f155';\n$dashicon-star-half: '\\f459';\n$dashicon-star-empty: '\\f154';\n$dashicon-flag: '\\f227';\n$dashicon-info: '\\f348';\n$dashicon-warning: '\\f534';\n$dashicon-share: '\\f237';\n$dashicon-share1: '\\f237';\n$dashicon-share-alt: '\\f240';\n$dashicon-share-alt2: '\\f242';\n$dashicon-twitter: '\\f301';\n$dashicon-rss: '\\f303';\n$dashicon-email: '\\f465';\n$dashicon-email-alt: '\\f466';\n$dashicon-facebook: '\\f304';\n$dashicon-facebook-alt: '\\f305';\n$dashicon-networking: '\\f325';\n$dashicon-googleplus: '\\f462';\n$dashicon-location: '\\f230';\n$dashicon-location-alt: '\\f231';\n$dashicon-camera: '\\f306';\n$dashicon-images-alt: '\\f232';\n$dashicon-images-alt2: '\\f233';\n$dashicon-video-alt: '\\f234';\n$dashicon-video-alt2: '\\f235';\n$dashicon-video-alt3: '\\f236';\n$dashicon-vault: '\\f178';\n$dashicon-shield: '\\f332';\n$dashicon-shield-alt: '\\f334';\n$dashicon-sos: '\\f468';\n$dashicon-search: '\\f179';\n$dashicon-slides: '\\f181';\n$dashicon-analytics: '\\f183';\n$dashicon-chart-pie: '\\f184';\n$dashicon-chart-bar: '\\f185';\n$dashicon-chart-line: '\\f238';\n$dashicon-chart-area: '\\f239';\n$dashicon-groups: '\\f307';\n$dashicon-businessman: '\\f338';\n$dashicon-id: '\\f336';\n$dashicon-id-alt: '\\f337';\n$dashicon-products: '\\f312';\n$dashicon-awards: '\\f313';\n$dashicon-forms: '\\f314';\n$dashicon-testimonial: '\\f473';\n$dashicon-portfolio: '\\f322';\n$dashicon-book: '\\f330';\n$dashicon-book-alt: '\\f331';\n$dashicon-download: '\\f316';\n$dashicon-upload: '\\f317';\n$dashicon-backup: '\\f321';\n$dashicon-clock: '\\f469';\n$dashicon-lightbulb: '\\f339';\n$dashicon-microphone: '\\f482';\n$dashicon-desktop: '\\f472';\n$dashicon-laptop: '\\f547';\n$dashicon-tablet: '\\f471';\n$dashicon-smartphone: '\\f470';\n$dashicon-phone: '\\f525';\n$dashicon-smiley: '\\f328';\n$dashicon-index-card: '\\f510';\n$dashicon-carrot: '\\f511';\n$dashicon-building: '\\f512';\n$dashicon-store: '\\f513';\n$dashicon-album: '\\f514';\n$dashicon-palmtree: '\\f527';\n$dashicon-tickets-alt: '\\f524';\n$dashicon-money: '\\f526';\n$dashicon-thumbs-up: '\\f529';\n$dashicon-thumbs-down: '\\f542';\n$dashicon-layout: '\\f538';\n$dashicon-paperclip: '\\f546';\n$dashicon-email-alt2: '\\f467';\n$dashicon-menu-alt: '\\f228';\n$dashicon-trash: '\\f182';\n$dashicon-heading: '\\f10e';\n$dashicon-insert: '\\f10f';\n$dashicon-align-full-width: '\\f114';\n$dashicon-button: '\\f11a';\n$dashicon-align-wide: '\\f11b';\n$dashicon-ellipsis: '\\f11c';\n$dashicon-buddicons-activity: '\\f452';\n$dashicon-buddicons-buddypress-logo: '\\f448';\n$dashicon-buddicons-community: '\\f453';\n$dashicon-buddicons-forums: '\\f449';\n$dashicon-buddicons-friends: '\\f454';\n$dashicon-buddicons-groups: '\\f456';\n$dashicon-buddicons-pm: '\\f457';\n$dashicon-buddicons-replies: '\\f451';\n$dashicon-buddicons-topics: '\\f450';\n$dashicon-buddicons-tracking: '\\f455';\n$dashicon-admin-site-alt: '\\f11d';\n$dashicon-admin-site-alt2: '\\f11e';\n$dashicon-admin-site-alt3: '\\f11f';\n$dashicon-rest-api: '\\f124';\n$dashicon-yes-alt: '\\f12a';\n$dashicon-buddicons-bbpress-logo: '\\f477';\n$dashicon-tide: '\\f10d';\n$dashicon-editor-ol-rtl: '\\f12c';\n$dashicon-instagram: '\\f12d';\n$dashicon-businessperson: '\\f12e';\n$dashicon-businesswoman: '\\f12f';\n$dashicon-color-picker: '\\f131';\n$dashicon-camera-alt: '\\f129';\n$dashicon-editor-ltr: '\\f10c';\n$dashicon-cloud: '\\f176';\n$dashicon-twitter-alt: '\\f302';\n$dashicon-menu-alt2: '\\f329';\n$dashicon-menu-alt3: '\\f349';\n$dashicon-plugins-checked: '\\f485';\n$dashicon-text-page: '\\f121';\n$dashicon-update-alt: '\\f113';\n$dashicon-code-standards: '\\f13a';\n$dashicon-align-pull-left: '\\f10a';\n$dashicon-align-pull-right: '\\f10b';\n$dashicon-block-default: '\\f12b';\n$dashicon-cloud-saved: '\\f137';\n$dashicon-cloud-upload: '\\f13b';\n$dashicon-columns: '\\f13c';\n$dashicon-cover-image: '\\f13d';\n$dashicon-embed-audio: '\\f13e';\n$dashicon-embed-generic: '\\f13f';\n$dashicon-embed-photo: '\\f144';\n$dashicon-embed-post: '\\f146';\n$dashicon-embed-video: '\\f149';\n$dashicon-exit: '\\f14a';\n$dashicon-html: '\\f14b';\n$dashicon-info-outline: '\\f14c';\n$dashicon-insert-after: '\\f14d';\n$dashicon-insert-before: '\\f14e';\n$dashicon-remove: '\\f14f';\n$dashicon-shortcode: '\\f150';\n$dashicon-table-col-after: '\\f151';\n$dashicon-table-col-before: '\\f152';\n$dashicon-table-col-delete: '\\f15a';\n$dashicon-table-row-after: '\\f15b';\n$dashicon-table-row-before: '\\f15c';\n$dashicon-table-row-delete: '\\f15d';\n$dashicon-saved: '\\f15e';\n$dashicon-airplane: '\\f15f';\n$dashicon-amazon: '\\f162';\n$dashicon-bank: '\\f16a';\n$dashicon-beer: '\\f16c';\n$dashicon-bell: '\\f16d';\n$dashicon-calculator: '\\f16e';\n$dashicon-coffee: '\\f16f';\n$dashicon-database-add: '\\f170';\n$dashicon-database-export: '\\f17a';\n$dashicon-database-import: '\\f17b';\n$dashicon-database-remove: '\\f17c';\n$dashicon-database-view: '\\f17d';\n$dashicon-database: '\\f17e';\n$dashicon-drumstick: '\\f17f';\n$dashicon-edit-page: '\\f186';\n$dashicon-food: '\\f187';\n$dashicon-fullscreen-alt: '\\f188';\n$dashicon-fullscreen-exit-alt: '\\f189';\n$dashicon-games: '\\f18a';\n$dashicon-google: '\\f18b';\n$dashicon-hourglass: '\\f18c';\n$dashicon-linkedin: '\\f18d';\n$dashicon-money-alt: '\\f18e';\n$dashicon-open-folder: '\\f18f';\n$dashicon-pdf: '\\f190';\n$dashicon-pets: '\\f191';\n$dashicon-pinterest: '\\f192';\n$dashicon-printer: '\\f193';\n$dashicon-privacy: '\\f194';\n$dashicon-reddit: '\\f195';\n$dashicon-spotify: '\\f196';\n$dashicon-superhero-alt: '\\f197';\n$dashicon-superhero: '\\f198';\n$dashicon-twitch: '\\f199';\n$dashicon-whatsapp: '\\f19a';\n$dashicon-youtube: '\\f19b';\n$dashicon-car: '\\f16b';\n$dashicon-podio: '\\f19c';\n$dashicon-xing: '\\f19d';\n","@use \"../../variables/index\" as *;\n\n\n.mce-i-thepaste {\n\t&::before {\n\t\tcontent: $dashicon-upload; /* https://developer.wordpress.org/resource/dashicons/ */\n\t\tdisplay: inline-block;\n\t\twidth: 20px;\n\t\theight: 20px;\n\t\tfont-size: 20px;\n\t\tline-height: 1;\n\t\tfont-family: dashicons;\n\t\ttext-decoration: inherit;\n\t\tfont-weight: 400;\n\t\tfont-style: normal;\n\t\tvertical-align: top;\n\t\ttext-align: center;\n\t\ttransition: color .1s ease-in 0;\n\t}\n}\n\n.mce-i-thepaste_preferfiles {\n\t&::before {\n\t\tcontent: '';\n\t\tclip-path: url(#the-paste-editor-paste-file);\n\t\tbackground-color: currentcolor;\n\t\tdisplay: inline-block;\n\t\twidth: 20px;\n\t\theight: 20px;\n\t\tfont-size: 20px;\n\t\tline-height: 1;\n\t\tvertical-align: top;\n\t\ttext-align: center;\n\t\ttransition: color .1s ease-in 0;\n\t}\n}\n\n.mce-i-thepaste_onoff {\n\t&::before {\n\t\tcontent: '';\n\t\tclip-path: url(#the-paste-editor-paste-toggle);\n\t\tbackground-color: currentcolor;\n\t\tdisplay: inline-block;\n\t\twidth: 20px;\n\t\theight: 20px;\n\t\tfont-size: 20px;\n\t\tline-height: 1;\n\t\tvertical-align: top;\n\t\ttext-align: center;\n\t\ttransition: color .1s ease-in 0;\n\t\ttransform: scaleX(-1);\n\t\t.mce-active & {\n\t\t\ttransform: scaleX(1);\n\t\t\tcolor: wp-color(green-50);\n\t\t}\n\t}\n}\n","/* WordPress Dashicons Vars */\n/* generated from https://raw.githubusercontent.com/WordPress/dashicons/master/codepoints.json */\n.mce-i-thepaste::before {\n content: \"\\f317\"; /* https://developer.wordpress.org/resource/dashicons/ */\n display: inline-block;\n width: 20px;\n height: 20px;\n font-size: 20px;\n line-height: 1;\n font-family: dashicons;\n text-decoration: inherit;\n font-weight: 400;\n font-style: normal;\n vertical-align: top;\n text-align: center;\n transition: color 0.1s ease-in 0;\n}\n\n.mce-i-thepaste_preferfiles::before {\n content: \"\";\n clip-path: url(#the-paste-editor-paste-file);\n background-color: currentcolor;\n display: inline-block;\n width: 20px;\n height: 20px;\n font-size: 20px;\n line-height: 1;\n vertical-align: top;\n text-align: center;\n transition: color 0.1s ease-in 0;\n}\n\n.mce-i-thepaste_onoff::before {\n content: \"\";\n clip-path: url(#the-paste-editor-paste-toggle);\n background-color: currentcolor;\n display: inline-block;\n width: 20px;\n height: 20px;\n font-size: 20px;\n line-height: 1;\n vertical-align: top;\n text-align: center;\n transition: color 0.1s ease-in 0;\n transform: scaleX(-1);\n}\n.mce-active .mce-i-thepaste_onoff::before {\n transform: scaleX(1);\n color: #008a20;\n}"]} -------------------------------------------------------------------------------- /js/admin/the-paste.js: -------------------------------------------------------------------------------- 1 | !function u(D,e,F){function t(n,a){if(!e[n]){if(!D[n]){var o="function"==typeof require&&require;if(!a&&o)return o(n,!0);if(i)return i(n,!0);var s=new Error("Cannot find module '"+n+"'");throw s.code="MODULE_NOT_FOUND",s}var r=e[n]={exports:{}};D[n][0].call(r.exports,function(u){return t(D[n][1][u]||u)},r,r.exports,u,D,e,F)}return e[n].exports}for(var i="function"==typeof require&&require,n=0;n{this.$el.prop("hidden",!document.hasFocus())},100)}});_.extend(wp.media.view.MediaFrame.prototype,{_parentInitialize:wp.media.view.MediaFrame.prototype.initialize,initialize:function(u){this._parentInitialize.apply(this,arguments),this.on("attach",this.addPasteInstructions,this),this.pasteInstructions=new a,this.pasteInstructions.render()},addPasteInstructions:function(){this.$el.find("#media-frame-title").append(this.pasteInstructions.el)}}),_.extend(wp.media.view.AttachmentsBrowser.prototype,{_parentInitialize:wp.media.view.AttachmentsBrowser.prototype.initialize,initialize:function(){this._parentInitialize.apply(this,arguments);const u=new a({priority:-10});u.render(),this.toolbar.set("pasteInstructions",u),document.addEventListener("paste",async u=>{if(!this.$el.is(":visible"))return;const D=Array.from(u.clipboardData.files);return D.length&&(u.preventDefault(),u.stopPropagation()),D.push(...await F.default.clipboardItemsToFiles(u.clipboardData.items)),D.length?await this.handlePastedFiles(D):void 0},{capture:!0})},handlePastedFiles:async function(u){const D=[],e=this.controller.uploader.uploader.uploader;if(u.forEach(u=>{/^image\//.test(u.type)?D.push(u):e.addFile(i.rml.file(u))}),D.length){(await(0,t.default)(D)).forEach(u=>e.addFile(i.rml.file(u)))}}})},{compat:2,converter:3,"image-dialog":5}],2:[function(u,D,e){"use strict";const F=new class{get svg(){return _wpPluploadSettings.defaults.filters.mime_types[0].extensions.split(",").includes("svg")}get webp(){return 0==document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}};D.exports={rml:{file:u=>(u.getSource||(u.getSource=()=>u),u)},supports:F}},{}],3:[function(u,D,e){"use strict";u("compat");var F=u("filename");const t={clipboardItemsToFiles:u=>{const D=[];return new Promise((e,F)=>{const i=Array.from(u).map(u=>{if("string"===u.kind){const i=(e=u.type,null!==(F={"text/plain":async u=>{const D=await t.itemToString(u);return D.toLowerCase().indexOf("=0&&(new DOMParser).parseFromString(D,"image/svg+xml").querySelector("svg")?[t.stringToFile(D,"image/svg+xml")]:[]},"text/html":async u=>{const D=new URL(document.location),e=document.createElement("div");e.innerHTML=await t.itemToString(u);const F=Array.from(e.querySelectorAll("img")).filter(u=>{const e=new URL(u.src);return!["http:","https:"].includes(e.protocol)||D.hostname!==e.hostname}).map(u=>t.elementToFile(u));return new Promise((u,D)=>{Promise.allSettled(F).then(D=>u(Array.from(D).map(u=>u.value)))})}}[e])&&void 0!==F?F:()=>new Promise((u,D)=>u([])));return i(u).then(u=>{D.push(...u.filter(u=>u.size>0))}).catch(u=>console.error(u))}var e,F});Promise.allSettled(i).then(()=>e(D))})},clipboardItemsToHtml:async u=>{let D,e;for(D=0;Dnew Promise((D,e)=>{u.getAsString(async u=>{const e=Object.values(JSON.parse(JSON.parse(u).data).image_urls);D(e)})}),gdocsItemToFiles:async u=>{let D;const e=await t.gdocsItemToSources(u),F=[];for(D=0;Dnew Promise((D,e)=>{u.getAsString(u=>D(u))}),elementToFile:async u=>await t.urlToFile(u.src,u.alt),urlToFile:async function(u){let D,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const F=u.substr(0,u.indexOf(":"));return"data"===F?D=t.dataUrlToFile(u,e):["blob","http","https"].includes(F)&&(D=await t.blobUrlToFile(u,e)),D},urlToMime:async u=>{const D=u.substr(0,u.indexOf(":"));let e;return"data"===D?e=t.dataUrlToMime(u):["blob","http","https"].includes(D)&&(e=await t.blobUrlToMime(u)),e},urlToType:async u=>{const D=await t.urlToMime(u);return D.substr(0,D.indexOf("/"))},urlToBlobUrl:async u=>{const D=await t.blobUrlToFile(u);return t.fileToBlobUrl(D)},stringToFile:(u,D)=>t.blobToFile(new Blob([u],{type:D})),blobToFile:function(u){let D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new File([u],(0,F.safeFilename)(u,D),{type:u.type})},blobUrlToMime:async u=>(await t.blobUrlToBlob(u)).type,blobUrlToType:async u=>{const D=await t.blobUrlToBlob(u);return D.type.substr(0,D.type.indexOf("/"))},blobUrlToBlob:async function(u){return await fetch(u).then(u=>u.blob())},blobUrlToFile:async function(u){let D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const e=await t.blobUrlToBlob(u);return t.blobToFile(e,D)},blobUrlToDataUrl:async u=>{const D=await fetch(u).then(u=>u.blob());return await t.fileToDataUrl(D)},dataUrlToMime:u=>u.match("data:([^;]+);")[1],dataUrlToType:u=>u.match("data:([^/]+)/")[1],dataUrlToBlob:u=>{let D=u.split(","),e=D[0].match(/:(.*?);/)[1],F=atob(D[1]),t=F.length,i=new Uint8Array(t);for(;t--;)i[t]=F.charCodeAt(t);return new Blob([i],{type:e})},dataUrlToFile:function(u){let D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t.blobToFile(t.dataUrlToBlob(u),D)},dataUrlToBlobUrl:u=>t.fileToBlobUrl(t.dataUrlToBlob(u)),fileToBlobUrl:u=>URL.createObjectURL(u),fileToDataUrl:u=>new Promise((D,e)=>{const F=new FileReader;F.addEventListener("load",()=>D(F.result)),F.readAsDataURL(u)})};D.exports=t},{compat:2,filename:4}],4:[function(u,D,e){"use strict";var F,t=(F=u("mime"))&&F.__esModule?F:{default:F};const i=u=>{var D,e,F;const t=function(u){let D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return("00"+u.toString()).substr(-D)};let i=thepaste.options.default_filename;const n=new Date,a=(null===(D=document.querySelector('#post [name="post_title"]#title'))||void 0===D?void 0:D.value)||(null===(e=document.querySelector(".wp-block-post-title"))||void 0===e?void 0:e.textContent)||(null===(F=document.querySelector("h1"))||void 0===F?void 0:F.textContent),o=thepaste.options.filename_values,s=[{s:"%Y",r:n.getFullYear()},{s:"%y",r:n.getFullYear()%100},{s:"%m",r:t(n.getMonth()+1)},{s:"%d",r:t(n.getDate())},{s:"%e",r:n.getDate()},{s:"%H",r:t(n.getHours())},{s:"%I",r:t(n.getHours()%12)},{s:"%M",r:t(n.getMinutes())},{s:"%S",r:t(n.getSeconds())},{s:"%s",r:Math.floor(n.getTime()/1e3)},{s:"%x",r:n.toLocaleDateString()},{s:"%X",r:n.toLocaleTimeString()}];return void 0!==a?s.push({s:"",r:a}):s.push({s:"",r:""}),Object.keys(o).forEach(u=>{o[u]?s.push({s:"<".concat(u,">"),r:o[u]}):s.push({s:"<".concat(u,">"),r:""})}),s.forEach(function(u){i=i.replace(u.s,u.r)}),"string"==typeof u&&(i+="."+u),i};D.exports={generateFilename:i,safeFilename:function(u){let D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=u.type;const F=t.default.extension(e);return D=D.replace(/(?:[\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u0605\u061C\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u086F\u0890-\u0896\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A\u0C3B\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B\u0C5E\u0C5F\u0C64\u0C65\u0C70-\u0C76\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDB\u0CDF\u0CE4\u0CE5\u0CF0\u0CF4-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u1716-\u171E\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ADE\u1ADF\u1AEC-\u1AFF\u1B4D\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C8B-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFB-\u1CFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u2028-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\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uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCBC-\uDCBF\uDCC2-\uDCCF\uDCD9-\uDCFF\uDE58-\uDE5F\uDE6E\uDE6F\uDE7D-\uDE7F\uDE8B-\uDE8D\uDEC7\uDEC9-\uDECC\uDEDD\uDEDE\uDEEB-\uDEEE\uDEF9-\uDEFF\uDF93\uDFFB-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEAE\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD88D[\uDC7A-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,"-").trim(),D||(D=i(F)),F!==D.split(".").pop()&&(D+=".".concat(F)),D}}},{mime:7}],5:[function(u,D,e){(function(e){(function(){"use strict";var F=i("undefined"!=typeof window?window.jQuery:void 0!==e?e.jQuery:null),t=i(u("image-list"));function i(u){return u&&u.__esModule?u:{default:u}}let n=null,a=null;D.exports=u=>new Promise((D,e)=>{if(null!==n)return a.addFiles(u),void D([]);n=new wp.media.view.Modal({events:{keydown:function(u){"Enter"===u.key?a.submit():"Escape"===u.key&&n.close()},"click .media-modal-close":function(u){n.close()}},controller:{trigger:()=>{}},title:thepaste.l10n.the_paste}),a=new t.default({controller:n});const i=(0,F.default)("body").is(".modal-open");a.on("thepaste:submit",async()=>{const u=await a.getFiles();n.close(),D(u)}),a.on("thepaste:cancel",()=>{n.close(),D([])}),n.content(a),a.addFiles(u),n.open(),n.on("close",()=>{(0,F.default)("body").toggleClass("the-paste-modal-open",!1),(0,F.default)("body").toggleClass("modal-open",i),setTimeout(()=>{n.remove(),n=null},10)}),(0,F.default)("body").toggleClass("the-paste-modal-open",!0)})}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"image-list":6}],6:[function(u,D,e){"use strict";var F=a(u("converter")),t=a(u("mime")),i=u("compat"),n=u("filename");function a(u){return u&&u.__esModule?u:{default:u}}const o=wp.media.View.extend({tagName:"form",template:wp.template("the-paste-image-list-item"),className:"the-paste-image-list-item",events:{'click [name="discard"]':"discard",'change [name="the-paste-format"]':"updateView"},initialize:function(u){let{file:D}=u;wp.media.View.prototype.initialize.apply(this,arguments),this.file=D,new Promise((u,e)=>{const t=new Image;t.addEventListener("load",function(){u(t)}),t.src=F.default.fileToBlobUrl(D)}).then(u=>{let D=u.width&&u.height;this.canvas=this.$("canvas").get(0),"image/svg+xml"===this.file.type&&(D?document.body.append(u):this.canvas.after(u)),this.canvas.width=u.width,this.canvas.height=u.height,this.canvas.getContext("2d").drawImage(u,0,0),"image/svg+xml"===this.file.type&&(D?u.remove():this.$('[data-format]:not([data-format="image/svg+xml"])').remove())})},updateView:function(){const u=this.$('[name="the-paste-format"]:checked').val();u!==this.file.type&&["image/webp","image/jpeg"].includes(u)?this.$(".the-paste-quality").show():this.$(".the-paste-quality").hide()},render:function(){wp.media.View.prototype.render.apply(this,arguments);const u=this.file.type,D=this.file.name.replace(/\.([^\.]*)$/,"");"image/webp"!==u&&(i.supports.webp&&t.default.extension("image/webp")||this.$('[data-format="image/webp"]').remove()),this.$('[name="the-paste-format"][value="'.concat(u,'"]')).prop("checked",!0),this.$('[name="the-paste-filename"]').val(D),this.$('[name="the-paste-filename"]').prop("placeholder",(0,n.generateFilename)()),i.supports.svg&&"image/svg+xml"===u||(this.$('[data-format="image/svg+xml"]').remove(),"image/svg+xml"===u&&this.$('[name="the-paste-format"][value="image/png"]').prop("checked",!0)),this.updateView()},getFile:function(){const u=this.$('[name="the-paste-format"]:checked').val(),D=this.$('[name="the-paste-filename"]').val()||(0,n.generateFilename)(),e="".concat(D,".").concat(t.default.extension(u)),i=parseFloat(this.$('[name="the-paste-quality"]').val())||thepaste.options.jpeg_quality;return this.file.type===u?new Promise((D,F)=>{D(new File([this.file],e,{type:u}))}):new Promise((D,t)=>{this.canvas.toBlob(u=>{D(F.default.blobToFile(u,e))},u,.01*i)})},discard:function(){this.controller.discardItem(this)}}),s=wp.media.View.extend({template:wp.template("the-paste-image-list"),className:"the-paste-image-list",events:{"click .media-frame-toolbar button":"submit"},initialize:function(){wp.media.View.prototype.initialize.apply(this,arguments),this.files=[],this.items=[],this.button=new wp.media.view.Button({className:"button-primary button-hero"}),this.render()},discardItem:function(u){this.files=this.files.filter(D=>D!==u.file),this.items=this.items.filter(D=>D!==u),u.$el.remove(),this.items.length||this.trigger("thepaste:cancel")},addFiles:function(u){this.files.push(...u),u.forEach(u=>{const D=new o({file:u,controller:this});D.render(),this.$(".content").append(D.$el),this.items.push(D),D.render()})},getFiles:async function(){const u=[];for(const D of this.items)u.push(await D.getFile());return u},submit:function(){this.trigger("thepaste:submit")}});D.exports=s},{compat:2,converter:3,filename:4,mime:7}],7:[function(u,D,e){"use strict";const F=Object.keys(thepaste.options.mime_types),t=Object.values(thepaste.options.mime_types);F.push("zip"),t.push("application/x-zip-compressed"),D.exports={extension:u=>{const D=t.indexOf(u);return-1!==D&&F[D]},type:u=>{const D=F.indexOf(u);return-1!==D&&t[D]}}},{}]},{},[1]); 2 | //# sourceMappingURL=the-paste.js.map 3 | -------------------------------------------------------------------------------- /css/admin/the-paste.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["variables/_dashicons.scss","admin/the-paste.scss","admin/the-paste.css"],"names":[],"mappings":"AAAA,6BAAA;AACA,gGAAA;ACCA;EAGC,QAAA;EACA,SAAA;EACA,gBAAA;EACA,eAAA;EACA,UAAA;EACA,MAAA;EACA,WAAA;EACA;;;;;;;;;;;;;;;;;;;;KAAA;ACmBD;;ADSC;EACC,aAAA;ACNF;ADUE;EACC,qBAAA;ACRH;ADKC;EAKC,mBAAA;ACPF;ADQE;EAC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A;ACTH;ADUG;EACC,0BAAA;EAAA,kBAAA;EACA,iBAAA;ACRJ;ADUG;EACC,cAAA;EACA,gBAAA;ACRJ;ADUG;EACC,UAAA;ACRJ;ADYE;EACC,cAAA;EACA,kBAAA;EACA,qBAAA;ACVH;ADWG;EAGC,0BAAA;ACXJ;ADaG;EACC,kCAAA;ACXJ;ADeE;EACC,cAAA;EACA,WAAA;EACA,gBAAA;ACbH;ADgBC;EACC,cAAA;ACdF","file":"the-paste.css","sourcesContent":["/* WordPress Dashicons Vars */\n/* generated from https://raw.githubusercontent.com/WordPress/dashicons/master/codepoints.json */\n\n$dashicon-menu: '\\f333';\n$dashicon-admin-site: '\\f319';\n$dashicon-dashboard: '\\f226';\n$dashicon-admin-media: '\\f104';\n$dashicon-admin-page: '\\f105';\n$dashicon-admin-comments: '\\f101';\n$dashicon-admin-appearance: '\\f100';\n$dashicon-admin-plugins: '\\f106';\n$dashicon-admin-users: '\\f110';\n$dashicon-admin-tools: '\\f107';\n$dashicon-admin-settings: '\\f108';\n$dashicon-admin-network: '\\f112';\n$dashicon-admin-generic: '\\f111';\n$dashicon-admin-home: '\\f102';\n$dashicon-admin-collapse: '\\f148';\n$dashicon-filter: '\\f536';\n$dashicon-admin-customizer: '\\f540';\n$dashicon-admin-multisite: '\\f541';\n$dashicon-admin-links: '\\f103';\n$dashicon-admin-post: '\\f109';\n$dashicon-format-image: '\\f128';\n$dashicon-format-gallery: '\\f161';\n$dashicon-format-audio: '\\f127';\n$dashicon-format-video: '\\f126';\n$dashicon-format-chat: '\\f125';\n$dashicon-format-status: '\\f130';\n$dashicon-format-aside: '\\f123';\n$dashicon-format-quote: '\\f122';\n$dashicon-welcome-write-blog: '\\f119';\n$dashicon-welcome-add-page: '\\f133';\n$dashicon-welcome-view-site: '\\f115';\n$dashicon-welcome-widgets-menus: '\\f116';\n$dashicon-welcome-comments: '\\f117';\n$dashicon-welcome-learn-more: '\\f118';\n$dashicon-image-crop: '\\f165';\n$dashicon-image-rotate: '\\f531';\n$dashicon-image-rotate-left: '\\f166';\n$dashicon-image-rotate-right: '\\f167';\n$dashicon-image-flip-vertical: '\\f168';\n$dashicon-image-flip-horizontal: '\\f169';\n$dashicon-image-filter: '\\f533';\n$dashicon-undo: '\\f171';\n$dashicon-redo: '\\f172';\n$dashicon-editor-bold: '\\f200';\n$dashicon-editor-italic: '\\f201';\n$dashicon-editor-ul: '\\f203';\n$dashicon-editor-ol: '\\f204';\n$dashicon-editor-quote: '\\f205';\n$dashicon-editor-alignleft: '\\f206';\n$dashicon-editor-aligncenter: '\\f207';\n$dashicon-editor-alignright: '\\f208';\n$dashicon-editor-insertmore: '\\f209';\n$dashicon-editor-spellcheck: '\\f210';\n$dashicon-editor-expand: '\\f211';\n$dashicon-editor-contract: '\\f506';\n$dashicon-editor-kitchensink: '\\f212';\n$dashicon-editor-underline: '\\f213';\n$dashicon-editor-justify: '\\f214';\n$dashicon-editor-textcolor: '\\f215';\n$dashicon-editor-paste-word: '\\f216';\n$dashicon-editor-paste-text: '\\f217';\n$dashicon-editor-removeformatting: '\\f218';\n$dashicon-editor-video: '\\f219';\n$dashicon-editor-customchar: '\\f220';\n$dashicon-editor-outdent: '\\f221';\n$dashicon-editor-indent: '\\f222';\n$dashicon-editor-help: '\\f223';\n$dashicon-editor-strikethrough: '\\f224';\n$dashicon-editor-unlink: '\\f225';\n$dashicon-editor-rtl: '\\f320';\n$dashicon-editor-break: '\\f474';\n$dashicon-editor-code: '\\f475';\n$dashicon-editor-code-duplicate: '\\f494';\n$dashicon-editor-paragraph: '\\f476';\n$dashicon-editor-table: '\\f535';\n$dashicon-align-left: '\\f135';\n$dashicon-align-right: '\\f136';\n$dashicon-align-center: '\\f134';\n$dashicon-align-none: '\\f138';\n$dashicon-lock: '\\f160';\n$dashicon-lock-duplicate: '\\f315';\n$dashicon-unlock: '\\f528';\n$dashicon-calendar: '\\f145';\n$dashicon-calendar-alt: '\\f508';\n$dashicon-visibility: '\\f177';\n$dashicon-hidden: '\\f530';\n$dashicon-post-status: '\\f173';\n$dashicon-edit: '\\f464';\n$dashicon-edit-large: '\\f327';\n$dashicon-sticky: '\\f537';\n$dashicon-external: '\\f504';\n$dashicon-arrow-up: '\\f142';\n$dashicon-arrow-up-duplicate: '\\f143';\n$dashicon-arrow-down: '\\f140';\n$dashicon-arrow-left: '\\f141';\n$dashicon-arrow-right: '\\f139';\n$dashicon-arrow-up-alt: '\\f342';\n$dashicon-arrow-down-alt: '\\f346';\n$dashicon-arrow-left-alt: '\\f340';\n$dashicon-arrow-right-alt: '\\f344';\n$dashicon-arrow-up-alt2: '\\f343';\n$dashicon-arrow-down-alt2: '\\f347';\n$dashicon-arrow-left-alt2: '\\f341';\n$dashicon-arrow-right-alt2: '\\f345';\n$dashicon-leftright: '\\f229';\n$dashicon-sort: '\\f156';\n$dashicon-randomize: '\\f503';\n$dashicon-list-view: '\\f163';\n$dashicon-excerpt-view: '\\f164';\n$dashicon-grid-view: '\\f509';\n$dashicon-move: '\\f545';\n$dashicon-hammer: '\\f308';\n$dashicon-art: '\\f309';\n$dashicon-migrate: '\\f310';\n$dashicon-performance: '\\f311';\n$dashicon-universal-access: '\\f483';\n$dashicon-universal-access-alt: '\\f507';\n$dashicon-tickets: '\\f486';\n$dashicon-nametag: '\\f484';\n$dashicon-clipboard: '\\f481';\n$dashicon-heart: '\\f487';\n$dashicon-megaphone: '\\f488';\n$dashicon-schedule: '\\f489';\n$dashicon-wordpress: '\\f120';\n$dashicon-wordpress-alt: '\\f324';\n$dashicon-pressthis: '\\f157';\n$dashicon-update: '\\f463';\n$dashicon-screenoptions: '\\f180';\n$dashicon-cart: '\\f174';\n$dashicon-feedback: '\\f175';\n$dashicon-translation: '\\f326';\n$dashicon-tag: '\\f323';\n$dashicon-category: '\\f318';\n$dashicon-archive: '\\f480';\n$dashicon-tagcloud: '\\f479';\n$dashicon-text: '\\f478';\n$dashicon-media-archive: '\\f501';\n$dashicon-media-audio: '\\f500';\n$dashicon-media-code: '\\f499';\n$dashicon-media-default: '\\f498';\n$dashicon-media-document: '\\f497';\n$dashicon-media-interactive: '\\f496';\n$dashicon-media-spreadsheet: '\\f495';\n$dashicon-media-text: '\\f491';\n$dashicon-media-video: '\\f490';\n$dashicon-playlist-audio: '\\f492';\n$dashicon-playlist-video: '\\f493';\n$dashicon-controls-play: '\\f522';\n$dashicon-controls-pause: '\\f523';\n$dashicon-controls-forward: '\\f519';\n$dashicon-controls-skipforward: '\\f517';\n$dashicon-controls-back: '\\f518';\n$dashicon-controls-skipback: '\\f516';\n$dashicon-controls-repeat: '\\f515';\n$dashicon-controls-volumeon: '\\f521';\n$dashicon-controls-volumeoff: '\\f520';\n$dashicon-yes: '\\f147';\n$dashicon-no: '\\f158';\n$dashicon-no-alt: '\\f335';\n$dashicon-plus: '\\f132';\n$dashicon-plus-alt: '\\f502';\n$dashicon-plus-alt2: '\\f543';\n$dashicon-minus: '\\f460';\n$dashicon-dismiss: '\\f153';\n$dashicon-marker: '\\f159';\n$dashicon-star-filled: '\\f155';\n$dashicon-star-half: '\\f459';\n$dashicon-star-empty: '\\f154';\n$dashicon-flag: '\\f227';\n$dashicon-info: '\\f348';\n$dashicon-warning: '\\f534';\n$dashicon-share: '\\f237';\n$dashicon-share1: '\\f237';\n$dashicon-share-alt: '\\f240';\n$dashicon-share-alt2: '\\f242';\n$dashicon-twitter: '\\f301';\n$dashicon-rss: '\\f303';\n$dashicon-email: '\\f465';\n$dashicon-email-alt: '\\f466';\n$dashicon-facebook: '\\f304';\n$dashicon-facebook-alt: '\\f305';\n$dashicon-networking: '\\f325';\n$dashicon-googleplus: '\\f462';\n$dashicon-location: '\\f230';\n$dashicon-location-alt: '\\f231';\n$dashicon-camera: '\\f306';\n$dashicon-images-alt: '\\f232';\n$dashicon-images-alt2: '\\f233';\n$dashicon-video-alt: '\\f234';\n$dashicon-video-alt2: '\\f235';\n$dashicon-video-alt3: '\\f236';\n$dashicon-vault: '\\f178';\n$dashicon-shield: '\\f332';\n$dashicon-shield-alt: '\\f334';\n$dashicon-sos: '\\f468';\n$dashicon-search: '\\f179';\n$dashicon-slides: '\\f181';\n$dashicon-analytics: '\\f183';\n$dashicon-chart-pie: '\\f184';\n$dashicon-chart-bar: '\\f185';\n$dashicon-chart-line: '\\f238';\n$dashicon-chart-area: '\\f239';\n$dashicon-groups: '\\f307';\n$dashicon-businessman: '\\f338';\n$dashicon-id: '\\f336';\n$dashicon-id-alt: '\\f337';\n$dashicon-products: '\\f312';\n$dashicon-awards: '\\f313';\n$dashicon-forms: '\\f314';\n$dashicon-testimonial: '\\f473';\n$dashicon-portfolio: '\\f322';\n$dashicon-book: '\\f330';\n$dashicon-book-alt: '\\f331';\n$dashicon-download: '\\f316';\n$dashicon-upload: '\\f317';\n$dashicon-backup: '\\f321';\n$dashicon-clock: '\\f469';\n$dashicon-lightbulb: '\\f339';\n$dashicon-microphone: '\\f482';\n$dashicon-desktop: '\\f472';\n$dashicon-laptop: '\\f547';\n$dashicon-tablet: '\\f471';\n$dashicon-smartphone: '\\f470';\n$dashicon-phone: '\\f525';\n$dashicon-smiley: '\\f328';\n$dashicon-index-card: '\\f510';\n$dashicon-carrot: '\\f511';\n$dashicon-building: '\\f512';\n$dashicon-store: '\\f513';\n$dashicon-album: '\\f514';\n$dashicon-palmtree: '\\f527';\n$dashicon-tickets-alt: '\\f524';\n$dashicon-money: '\\f526';\n$dashicon-thumbs-up: '\\f529';\n$dashicon-thumbs-down: '\\f542';\n$dashicon-layout: '\\f538';\n$dashicon-paperclip: '\\f546';\n$dashicon-email-alt2: '\\f467';\n$dashicon-menu-alt: '\\f228';\n$dashicon-trash: '\\f182';\n$dashicon-heading: '\\f10e';\n$dashicon-insert: '\\f10f';\n$dashicon-align-full-width: '\\f114';\n$dashicon-button: '\\f11a';\n$dashicon-align-wide: '\\f11b';\n$dashicon-ellipsis: '\\f11c';\n$dashicon-buddicons-activity: '\\f452';\n$dashicon-buddicons-buddypress-logo: '\\f448';\n$dashicon-buddicons-community: '\\f453';\n$dashicon-buddicons-forums: '\\f449';\n$dashicon-buddicons-friends: '\\f454';\n$dashicon-buddicons-groups: '\\f456';\n$dashicon-buddicons-pm: '\\f457';\n$dashicon-buddicons-replies: '\\f451';\n$dashicon-buddicons-topics: '\\f450';\n$dashicon-buddicons-tracking: '\\f455';\n$dashicon-admin-site-alt: '\\f11d';\n$dashicon-admin-site-alt2: '\\f11e';\n$dashicon-admin-site-alt3: '\\f11f';\n$dashicon-rest-api: '\\f124';\n$dashicon-yes-alt: '\\f12a';\n$dashicon-buddicons-bbpress-logo: '\\f477';\n$dashicon-tide: '\\f10d';\n$dashicon-editor-ol-rtl: '\\f12c';\n$dashicon-instagram: '\\f12d';\n$dashicon-businessperson: '\\f12e';\n$dashicon-businesswoman: '\\f12f';\n$dashicon-color-picker: '\\f131';\n$dashicon-camera-alt: '\\f129';\n$dashicon-editor-ltr: '\\f10c';\n$dashicon-cloud: '\\f176';\n$dashicon-twitter-alt: '\\f302';\n$dashicon-menu-alt2: '\\f329';\n$dashicon-menu-alt3: '\\f349';\n$dashicon-plugins-checked: '\\f485';\n$dashicon-text-page: '\\f121';\n$dashicon-update-alt: '\\f113';\n$dashicon-code-standards: '\\f13a';\n$dashicon-align-pull-left: '\\f10a';\n$dashicon-align-pull-right: '\\f10b';\n$dashicon-block-default: '\\f12b';\n$dashicon-cloud-saved: '\\f137';\n$dashicon-cloud-upload: '\\f13b';\n$dashicon-columns: '\\f13c';\n$dashicon-cover-image: '\\f13d';\n$dashicon-embed-audio: '\\f13e';\n$dashicon-embed-generic: '\\f13f';\n$dashicon-embed-photo: '\\f144';\n$dashicon-embed-post: '\\f146';\n$dashicon-embed-video: '\\f149';\n$dashicon-exit: '\\f14a';\n$dashicon-html: '\\f14b';\n$dashicon-info-outline: '\\f14c';\n$dashicon-insert-after: '\\f14d';\n$dashicon-insert-before: '\\f14e';\n$dashicon-remove: '\\f14f';\n$dashicon-shortcode: '\\f150';\n$dashicon-table-col-after: '\\f151';\n$dashicon-table-col-before: '\\f152';\n$dashicon-table-col-delete: '\\f15a';\n$dashicon-table-row-after: '\\f15b';\n$dashicon-table-row-before: '\\f15c';\n$dashicon-table-row-delete: '\\f15d';\n$dashicon-saved: '\\f15e';\n$dashicon-airplane: '\\f15f';\n$dashicon-amazon: '\\f162';\n$dashicon-bank: '\\f16a';\n$dashicon-beer: '\\f16c';\n$dashicon-bell: '\\f16d';\n$dashicon-calculator: '\\f16e';\n$dashicon-coffee: '\\f16f';\n$dashicon-database-add: '\\f170';\n$dashicon-database-export: '\\f17a';\n$dashicon-database-import: '\\f17b';\n$dashicon-database-remove: '\\f17c';\n$dashicon-database-view: '\\f17d';\n$dashicon-database: '\\f17e';\n$dashicon-drumstick: '\\f17f';\n$dashicon-edit-page: '\\f186';\n$dashicon-food: '\\f187';\n$dashicon-fullscreen-alt: '\\f188';\n$dashicon-fullscreen-exit-alt: '\\f189';\n$dashicon-games: '\\f18a';\n$dashicon-google: '\\f18b';\n$dashicon-hourglass: '\\f18c';\n$dashicon-linkedin: '\\f18d';\n$dashicon-money-alt: '\\f18e';\n$dashicon-open-folder: '\\f18f';\n$dashicon-pdf: '\\f190';\n$dashicon-pets: '\\f191';\n$dashicon-pinterest: '\\f192';\n$dashicon-printer: '\\f193';\n$dashicon-privacy: '\\f194';\n$dashicon-reddit: '\\f195';\n$dashicon-spotify: '\\f196';\n$dashicon-superhero-alt: '\\f197';\n$dashicon-superhero: '\\f198';\n$dashicon-twitch: '\\f199';\n$dashicon-whatsapp: '\\f19a';\n$dashicon-youtube: '\\f19b';\n$dashicon-car: '\\f16b';\n$dashicon-podio: '\\f19c';\n$dashicon-xing: '\\f19d';\n","@use \"../variables/index\" as *;\n\n#the-paste {\n\t//*\n\t// Prod mode\n\twidth: 0;\n\theight: 0;\n\toverflow:hidden;\n\tposition: fixed;\n\tleft: 100%;\n\ttop:0;\n\tz-index: -1;\n\t/*/\n\t// Testing mode\n\twidth: 0;\n\theight: 0;\n\tposition: fixed;\n\tleft: -9999px;\n\tbackground-color: #fff;\n\tborder: 1px solid currentColor;\n\tbox-sizing: border-box;\n\tz-index: -1;\n\t&:focus,\n\t&:focus-within {\n\t\tleft: 30px;\n\t\ttop:30px;\n\t\twidth: 200px;\n\t\theight: 500px;\n\t\toutline: 3px solid currentColor;\n\t\toutline-offset: 3px;\n\t\tz-index: 9999;\n\t}\n\t//*/\n}\n\n.media-frame-title {\n\n}\n.the-paste-instructions {\n\n\tbody:not(:focus-within) {\n\t\tdisplay: none;\n\t}\n\t.media-frame-title &,\n\t.media-toolbar & {\n\t\t&:not([hidden]) {\n\t\t\tdisplay: inline-block;\n\t\t}\n\t\twhite-space: nowrap;\n\t\t.upload-instructions {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\t.media-modal-content .media-toolbar & {\n\t\tdisplay: none;\n\t}\n\t.media-frame-title > &:not([hidden]) {\n\t\tposition: absolute;\n\t\tright:56px;\n\t\ttop:0;\n\t\theight: 50px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n}\n\n.the-paste-image-list {\n\tbackground-color: wp-color(gray-2);\n\theight:100%;\n\t.media-frame-title {\n\t\tleft:0;\n\t\tbackground-color: #fff;\n\t}\n\t.content {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\ttop: 50px;\n\t\tbottom: 100px;\n\t\tright: 0;\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(600px, 1fr));\n\t\tgrid-template-rows: repeat(auto-fit, min-content);\n\t\tgrid-gap: 1em;\n\t\tborder: 1em solid wp-color(gray-2);\n\t\t// padding: 2em;\n\t\toverflow: auto;\n\t}\n\t.media-frame-toolbar {\n\t\tbottom: 0;\n\t\tright: 0;\n\t\tleft: 0;\n\t\tpadding: 20px;\n\t\theight: 100px;\n\t\tdisplay: flex;\n\t\talign-items: flex-end;\n\t\tbox-sizing: border-box;\n\t\tbackground-color: #fff;\n\t\ttext-align: right;\n\t\tbutton {\n\t\t\tmargin-left: auto;\n\t\t}\n\t}\n\tbutton[type=\"button\"] {\n\t\tline-height: 1.5;\n\t\tpadding: 0.5em 1em;\n\t\tspan {\n\t\t\tdisplay: block;\n\t\t\tmargin: auto;\n\t\t}\n\t}\n}\n.the-paste-image-list-item {\n\t--toolbar-size: 100px;\n\tcontainer-type: inline-size;\n\tcontainer-name: thePasteItem;\n\tdisplay: grid;\n\tgrid-template-areas: 'canvas'\n\t\t'name';\n\t// grid-template-columns: auto min-content;\n\tgrid-template-rows: calc(100% - 2em - var(--toolbar-size)) var(--toolbar-size);\n\tgrid-gap: 1em 2em;\n\tpadding: 1em;\n\tbackground-color: #fff;\n\theight: 100%;\n\tmin-height: 450px;\n\toverflow: hidden;\n\tbox-sizing: border-box;\n\tcanvas {\n\t\t&,\n\t\t& + img {\n\t\t\tgrid-area: canvas;\n\t\t\tmargin: auto;\n\t\t\tmax-width: 100%;\n\t\t\t@container (width > 700px) {\n\t\t\t\tmax-width: calc(100% - 2em);\n\t\t\t}\n\t\t\tmax-height: 100%;\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t}\n\t\tbox-shadow: 0 0 10px rgba(0,0,0,0.1);\n\t\tbackground-image:\n\t\t\tlinear-gradient(45deg, wp-color(gray-10) 25%, transparent 25%),\n\t\t\tlinear-gradient(135deg, wp-color(gray-10) 25%, transparent 25%),\n\t\t\tlinear-gradient(45deg, transparent 75%, wp-color(gray-10) 75%),\n\t\t\tlinear-gradient(135deg, transparent 75%, wp-color(gray-10) 75%);\n\t\tbackground-size: 25px 25px; /* Must be a square */\n\t\tbackground-position: 0 0, 12.5px 0, 12.5px -12.5px, 0px 12.5px; /* Must be half of one side of the square */\n\t}\n\t.the-paste-toolbar {\n\t\tgrid-area: name;\n\t\tcolor: wp-color(gray-50);\n\t\tdisplay: grid;\n\t\tgrid-template-columns: min-content auto min-content;\n\t\tgrid-template-rows: auto 3em;\n\t\tgrid-gap: 1em 3em;\n\t\tmargin: 0;\n\t\theight: var(--toolbar-size);\n\t\t@container (width > 700px) {\n\t\t\t// display: none;\n\t\t\tmargin: 1em;\n\t\t}\n\n\t\t.the-paste-filename {\n\t\t\tgrid-column: 1 /span 2;\n\t\t}\n\t\t.the-paste-format {\n\t\t\tdisplay: grid;\n\t\t\tgrid-auto-flow: column;\n\t\t\tgrid-gap: 1em;\n\t\t\tlabel {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t}\n\t\t}\n\t\t.the-paste-quality {\n\t\t\tdisplay: flex;\n\t\t\tgrid-gap: 1em;\n\t\t\talign-items: center;\n\t\t\t:first-child {\n\t\t\t\twidth: max-content;\n\t\t\t\tmargin-left: auto;\n\t\t\t}\n\t\t\t[type=\"range\"] {\n\t\t\t\tflex:1 1 auto;\n\t\t\t\tmax-width: 300px;\n\t\t\t}\n\t\t\t[type=\"number\"] {\n\t\t\t\twidth: 5em;\n\t\t\t}\n\t\t}\n\n\t\t[name=\"discard\"] {\n\t\t\tgrid-column: 3;\n\t\t\tgrid-row: 1 / span 2;\n\t\t\tmargin: 18px 0 auto 0;\n\t\t\t&,\n\t\t\t&:hover,\n\t\t\t&:focus {\n\t\t\t\tborder-color: currentColor;\n\t\t\t}\n\t\t\t&:focus {\n\t\t\t\tbox-shadow: 0 0 0 1px currentColor;\n\t\t\t}\n\t\t}\n\n\t\t[type=\"text\"] {\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tfont-size: 1.3em;\n\t\t}\n\t}\n\t.the-paste-format {\n\t\tmargin: auto 0;\n\t}\n\n}\n","/* WordPress Dashicons Vars */\n/* generated from https://raw.githubusercontent.com/WordPress/dashicons/master/codepoints.json */\n#the-paste {\n width: 0;\n height: 0;\n overflow: hidden;\n position: fixed;\n left: 100%;\n top: 0;\n z-index: -1;\n /*/\n // Testing mode\n width: 0;\n height: 0;\n position: fixed;\n left: -9999px;\n background-color: #fff;\n border: 1px solid currentColor;\n box-sizing: border-box;\n z-index: -1;\n &:focus,\n &:focus-within {\n \tleft: 30px;\n \ttop:30px;\n \twidth: 200px;\n \theight: 500px;\n \toutline: 3px solid currentColor;\n \toutline-offset: 3px;\n \tz-index: 9999;\n }\n //*/\n}\n\n.the-paste-instructions body:not(:focus-within) {\n display: none;\n}\n.media-frame-title .the-paste-instructions:not([hidden]), .media-toolbar .the-paste-instructions:not([hidden]) {\n display: inline-block;\n}\n.media-frame-title .the-paste-instructions, .media-toolbar .the-paste-instructions {\n white-space: nowrap;\n}\n.media-frame-title .the-paste-instructions .upload-instructions, .media-toolbar .the-paste-instructions .upload-instructions {\n display: none;\n}\n.media-modal-content .media-toolbar .the-paste-instructions {\n display: none;\n}\n.media-frame-title > .the-paste-instructions:not([hidden]) {\n position: absolute;\n right: 56px;\n top: 0;\n height: 50px;\n display: flex;\n align-items: center;\n}\n\n.the-paste-image-list {\n background-color: #f0f0f1;\n height: 100%;\n}\n.the-paste-image-list .media-frame-title {\n left: 0;\n background-color: #fff;\n}\n.the-paste-image-list .content {\n position: absolute;\n left: 0;\n top: 50px;\n bottom: 100px;\n right: 0;\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));\n grid-template-rows: repeat(auto-fit, min-content);\n grid-gap: 1em;\n border: 1em solid #f0f0f1;\n overflow: auto;\n}\n.the-paste-image-list .media-frame-toolbar {\n bottom: 0;\n right: 0;\n left: 0;\n padding: 20px;\n height: 100px;\n display: flex;\n align-items: flex-end;\n box-sizing: border-box;\n background-color: #fff;\n text-align: right;\n}\n.the-paste-image-list .media-frame-toolbar button {\n margin-left: auto;\n}\n.the-paste-image-list button[type=button] {\n line-height: 1.5;\n padding: 0.5em 1em;\n}\n.the-paste-image-list button[type=button] span {\n display: block;\n margin: auto;\n}\n\n.the-paste-image-list-item {\n --toolbar-size: 100px;\n container-type: inline-size;\n container-name: thePasteItem;\n display: grid;\n grid-template-areas: \"canvas\" \"name\";\n grid-template-rows: calc(100% - 2em - var(--toolbar-size)) var(--toolbar-size);\n grid-gap: 1em 2em;\n padding: 1em;\n background-color: #fff;\n height: 100%;\n min-height: 450px;\n overflow: hidden;\n box-sizing: border-box;\n}\n.the-paste-image-list-item canvas, .the-paste-image-list-item canvas + img {\n grid-area: canvas;\n margin: auto;\n max-width: 100%;\n}\n@container (width > 700px) {\n .the-paste-image-list-item canvas, .the-paste-image-list-item canvas + img {\n max-width: calc(100% - 2em);\n }\n}\n.the-paste-image-list-item canvas, .the-paste-image-list-item canvas + img {\n max-height: 100%;\n width: auto;\n height: auto;\n}\n.the-paste-image-list-item canvas {\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);\n background-image: linear-gradient(45deg, #c3c4c7 25%, transparent 25%), linear-gradient(135deg, #c3c4c7 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #c3c4c7 75%), linear-gradient(135deg, transparent 75%, #c3c4c7 75%);\n background-size: 25px 25px; /* Must be a square */\n background-position: 0 0, 12.5px 0, 12.5px -12.5px, 0px 12.5px; /* Must be half of one side of the square */\n}\n.the-paste-image-list-item .the-paste-toolbar {\n grid-area: name;\n color: #646970;\n display: grid;\n grid-template-columns: min-content auto min-content;\n grid-template-rows: auto 3em;\n grid-gap: 1em 3em;\n margin: 0;\n height: var(--toolbar-size);\n}\n@container (width > 700px) {\n .the-paste-image-list-item .the-paste-toolbar {\n margin: 1em;\n }\n}\n.the-paste-image-list-item .the-paste-toolbar .the-paste-filename {\n grid-column: 1/span 2;\n}\n.the-paste-image-list-item .the-paste-toolbar .the-paste-format {\n display: grid;\n grid-auto-flow: column;\n grid-gap: 1em;\n}\n.the-paste-image-list-item .the-paste-toolbar .the-paste-format label {\n display: flex;\n align-items: center;\n}\n.the-paste-image-list-item .the-paste-toolbar .the-paste-quality {\n display: flex;\n grid-gap: 1em;\n align-items: center;\n}\n.the-paste-image-list-item .the-paste-toolbar .the-paste-quality :first-child {\n width: max-content;\n margin-left: auto;\n}\n.the-paste-image-list-item .the-paste-toolbar .the-paste-quality [type=range] {\n flex: 1 1 auto;\n max-width: 300px;\n}\n.the-paste-image-list-item .the-paste-toolbar .the-paste-quality [type=number] {\n width: 5em;\n}\n.the-paste-image-list-item .the-paste-toolbar [name=discard] {\n grid-column: 3;\n grid-row: 1/span 2;\n margin: 18px 0 auto 0;\n}\n.the-paste-image-list-item .the-paste-toolbar [name=discard], .the-paste-image-list-item .the-paste-toolbar [name=discard]:hover, .the-paste-image-list-item .the-paste-toolbar [name=discard]:focus {\n border-color: currentColor;\n}\n.the-paste-image-list-item .the-paste-toolbar [name=discard]:focus {\n box-shadow: 0 0 0 1px currentColor;\n}\n.the-paste-image-list-item .the-paste-toolbar [type=text] {\n display: block;\n width: 100%;\n font-size: 1.3em;\n}\n.the-paste-image-list-item .the-paste-format {\n margin: auto 0;\n}"]} -------------------------------------------------------------------------------- /js/admin/mce/the-paste-plugin.js: -------------------------------------------------------------------------------- 1 | !function u(D,e,t){function F(n,i){if(!e[n]){if(!D[n]){var s="function"==typeof require&&require;if(!i&&s)return s(n,!0);if(o)return o(n,!0);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}var a=e[n]={exports:{}};D[n][0].call(a.exports,function(u){return F(D[n][1][u]||u)},a,a.exports,u,D,e,t)}return e[n].exports}for(var o="function"==typeof require&&require,n=0;n1&&void 0!==arguments[1])||arguments[1];return c._=new E(u,D),E.get()}static get(){return c._}static destroy(){c._=null}static setEnabled(u){C._=u}get isAsync(){return s(l,this)}get hasPastedFiles(){return this.files.length>0}get pastedContent(){return this.isAsync?'

':this.files.map((u,D)=>{const e=URL.createObjectURL(u);return'

').concat(u.name,'

')}).join("")}get files(){return s(a,this)}constructor(u,D){if(n(this,a,[]),n(this,l,!1),this.clipboardData=u.clipboardData,this.body=u.target.closest("body"),!this.hasClipboardKind("string","x-tinymce/html")){var t;if(C._)i(a,this,Array.from(null!==(t=this.clipboardData.files)&&void 0!==t?t:[])),this.files.length&&D||i(l,this,this.hasClipboardKind("string","text/html"));(this.isAsync||this.files.length)&&(this.isAsync?(async()=>{let D,t;const F=new URL(document.location),o=await e.default.clipboardItemsToHtml(u.clipboardData.items),n=document.createElement("div"),i=this.body.querySelector("#the-pasted-async"),s=[];n.innerHTML=o,s.push(...Array.from(n.querySelectorAll("img")));const r=Array.from(n.childNodes).filter(u=>[Node.ELEMENT_NODE,Node.TEXT_NODE].includes(u.nodeType));for(D=0;De.kind===u&&e.type===D).length>0}dumpClipboardData(){const u="[the paste]";return Array.from(this.clipboardData.files).forEach(D=>console.log(u,D)),Array.from(this.clipboardData.items).forEach(D=>{console.log(u,D,D.kind,D.type),"string"===D.kind?D.getAsString(e=>console.log(u,e,D.kind,D.type)):console.log(u,D.getAsFile())}),this}}var c={_:null},C={_:!0};tinymce.PluginManager.add("the_paste",function(u){let D,e,o;u.addButton("thepaste_onoff",{icon:"thepaste_onoff",tooltip:thepaste.l10n.paste_onoff,onPostRender:function(){e=this},onClick:function(){this.active(!this.active()),fetch("".concat(thepaste.options.editor.onoff_ajax_url,"&enabled=").concat(this.active()?1:0)),D.disabled(!this.active())},active:thepaste.options.editor.enabled}),u.addButton("thepaste_preferfiles",{icon:"thepaste_preferfiles",tooltip:thepaste.l10n.paste_files,onPostRender:function(){D=this},onClick:function(){this.active(!this.active()),fetch("".concat(thepaste.options.editor.preferfiles_ajax_url,"&enabled=").concat(this.active()?1:0))},disabled:!thepaste.options.editor.enabled,active:thepaste.options.editor.preferfiles}),u.once("preinit",function(){u.wp&&u.wp._createToolbar&&(o=u.wp._createToolbar(["wp_img_alignleft","wp_img_aligncenter","wp_img_alignright","wp_img_alignnone","wp_img_thepaste_upload","wp_img_edit","wp_img_remove"]))}),u.addButton("wp_img_thepaste_upload",{icon:"dashicon dashicons dashicons-upload thepaste-upload",tooltip:thepaste.l10n.upload_image,onclick:function(){F.default.inlineUpload(u.selection.getNode())}}),u.on("wptoolbar",function(D){var e;"IMG"!==D.element.nodeName||u.wp.isPlaceholder(D.element)||(D.toolbar=o,e=o.$el.find(".thepaste-upload").closest(".mce-btn"),!function(u){const D=u.src.substring(0,5);return"blob:"===D||"data:"===D}(D.element)?e.hide():e.show())});const n=()=>Array.from(u.dom.doc.body.querySelectorAll('[src^="blob:"]:not(.--paste-process),[src^="data:"]:not(.--paste-process)'));u.on("PastePlainTextToggle",u=>{let{state:t}=u;E.setEnabled(!t),e.disabled(t),D.disabled(t)}).on("init",()=>{u.dom.doc.body.addEventListener("FilesPasted",async u=>{let D,e;const o=n();for(D=0;Dt.default.error(u.message,!0)||e.remove())})}).on("Paste",t=>{if(document.body.matches(".modal-open")||!e.active())return;const F=!D||D.active(),o=E.init(t,F);if(thepaste.options.editor.debugMode&&o.dumpClipboardData(),!o.isAsync&&!o.files.length)return void E.destroy();const i=u=>{let D;(D=o.pastedContent)&&(u.content=D),E.destroy()},s=D=>{setTimeout(()=>u.dom.doc.body.dispatchEvent(new Event("FilesPasted"))),u.off("PastePreProcess",i),u.off("PastePostProcess",s)};u.once("input",async D=>{const e=n();let t,F;if(e.length){for(t=0;tu.dom.doc.body.dispatchEvent(new Event("FilesPasted"))),e.length===o.files.length&&(u.off("PastePreProcess",i),u.off("PastePostProcess",s))}}).on("PastePreProcess",i).on("PastePostProcess",s)})})}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{converter:3,notices:6,uploader:7}],2:[function(u,D,e){"use strict";const t=new class{get svg(){return _wpPluploadSettings.defaults.filters.mime_types[0].extensions.split(",").includes("svg")}get webp(){return 0==document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}};D.exports={rml:{file:u=>(u.getSource||(u.getSource=()=>u),u)},supports:t}},{}],3:[function(u,D,e){"use strict";u("compat");var t=u("filename");const F={clipboardItemsToFiles:u=>{const D=[];return new Promise((e,t)=>{const o=Array.from(u).map(u=>{if("string"===u.kind){const o=(e=u.type,null!==(t={"text/plain":async u=>{const D=await F.itemToString(u);return D.toLowerCase().indexOf("=0&&(new DOMParser).parseFromString(D,"image/svg+xml").querySelector("svg")?[F.stringToFile(D,"image/svg+xml")]:[]},"text/html":async u=>{const D=new URL(document.location),e=document.createElement("div");e.innerHTML=await F.itemToString(u);const t=Array.from(e.querySelectorAll("img")).filter(u=>{const e=new URL(u.src);return!["http:","https:"].includes(e.protocol)||D.hostname!==e.hostname}).map(u=>F.elementToFile(u));return new Promise((u,D)=>{Promise.allSettled(t).then(D=>u(Array.from(D).map(u=>u.value)))})}}[e])&&void 0!==t?t:()=>new Promise((u,D)=>u([])));return o(u).then(u=>{D.push(...u.filter(u=>u.size>0))}).catch(u=>console.error(u))}var e,t});Promise.allSettled(o).then(()=>e(D))})},clipboardItemsToHtml:async u=>{let D,e;for(D=0;Dnew Promise((D,e)=>{u.getAsString(async u=>{const e=Object.values(JSON.parse(JSON.parse(u).data).image_urls);D(e)})}),gdocsItemToFiles:async u=>{let D;const e=await F.gdocsItemToSources(u),t=[];for(D=0;Dnew Promise((D,e)=>{u.getAsString(u=>D(u))}),elementToFile:async u=>await F.urlToFile(u.src,u.alt),urlToFile:async function(u){let D,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const t=u.substr(0,u.indexOf(":"));return"data"===t?D=F.dataUrlToFile(u,e):["blob","http","https"].includes(t)&&(D=await F.blobUrlToFile(u,e)),D},urlToMime:async u=>{const D=u.substr(0,u.indexOf(":"));let e;return"data"===D?e=F.dataUrlToMime(u):["blob","http","https"].includes(D)&&(e=await F.blobUrlToMime(u)),e},urlToType:async u=>{const D=await F.urlToMime(u);return D.substr(0,D.indexOf("/"))},urlToBlobUrl:async u=>{const D=await F.blobUrlToFile(u);return F.fileToBlobUrl(D)},stringToFile:(u,D)=>F.blobToFile(new Blob([u],{type:D})),blobToFile:function(u){let D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new File([u],(0,t.safeFilename)(u,D),{type:u.type})},blobUrlToMime:async u=>(await F.blobUrlToBlob(u)).type,blobUrlToType:async u=>{const D=await F.blobUrlToBlob(u);return D.type.substr(0,D.type.indexOf("/"))},blobUrlToBlob:async function(u){return await fetch(u).then(u=>u.blob())},blobUrlToFile:async function(u){let D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const e=await F.blobUrlToBlob(u);return F.blobToFile(e,D)},blobUrlToDataUrl:async u=>{const D=await fetch(u).then(u=>u.blob());return await F.fileToDataUrl(D)},dataUrlToMime:u=>u.match("data:([^;]+);")[1],dataUrlToType:u=>u.match("data:([^/]+)/")[1],dataUrlToBlob:u=>{let D=u.split(","),e=D[0].match(/:(.*?);/)[1],t=atob(D[1]),F=t.length,o=new Uint8Array(F);for(;F--;)o[F]=t.charCodeAt(F);return new Blob([o],{type:e})},dataUrlToFile:function(u){let D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return F.blobToFile(F.dataUrlToBlob(u),D)},dataUrlToBlobUrl:u=>F.fileToBlobUrl(F.dataUrlToBlob(u)),fileToBlobUrl:u=>URL.createObjectURL(u),fileToDataUrl:u=>new Promise((D,e)=>{const t=new FileReader;t.addEventListener("load",()=>D(t.result)),t.readAsDataURL(u)})};D.exports=F},{compat:2,filename:4}],4:[function(u,D,e){"use strict";var t,F=(t=u("mime"))&&t.__esModule?t:{default:t};const o=u=>{var D,e,t;const F=function(u){let D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return("00"+u.toString()).substr(-D)};let o=thepaste.options.default_filename;const n=new Date,i=(null===(D=document.querySelector('#post [name="post_title"]#title'))||void 0===D?void 0:D.value)||(null===(e=document.querySelector(".wp-block-post-title"))||void 0===e?void 0:e.textContent)||(null===(t=document.querySelector("h1"))||void 0===t?void 0:t.textContent),s=thepaste.options.filename_values,r=[{s:"%Y",r:n.getFullYear()},{s:"%y",r:n.getFullYear()%100},{s:"%m",r:F(n.getMonth()+1)},{s:"%d",r:F(n.getDate())},{s:"%e",r:n.getDate()},{s:"%H",r:F(n.getHours())},{s:"%I",r:F(n.getHours()%12)},{s:"%M",r:F(n.getMinutes())},{s:"%S",r:F(n.getSeconds())},{s:"%s",r:Math.floor(n.getTime()/1e3)},{s:"%x",r:n.toLocaleDateString()},{s:"%X",r:n.toLocaleTimeString()}];return void 0!==i?r.push({s:"",r:i}):r.push({s:"",r:""}),Object.keys(s).forEach(u=>{s[u]?r.push({s:"<".concat(u,">"),r:s[u]}):r.push({s:"<".concat(u,">"),r:""})}),r.forEach(function(u){o=o.replace(u.s,u.r)}),"string"==typeof u&&(o+="."+u),o};D.exports={generateFilename:o,safeFilename:function(u){let D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",e=u.type;const t=F.default.extension(e);return D=D.replace(/(?:[\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EE\u05F5-\u0605\u061C\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB\u07FC\u082E\u082F\u083F\u085C\u085D\u085F\u086B-\u086F\u0890-\u0896\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A77-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C0D\u0C11\u0C29\u0C3A\u0C3B\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B\u0C5E\u0C5F\u0C64\u0C65\u0C70-\u0C76\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDB\u0CDF\u0CE4\u0CE5\u0CF0\u0CF4-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D50-\u0D53\u0D64\u0D65\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u1716-\u171E\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ADE\u1ADF\u1AEC-\u1AFF\u1B4D\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C8B-\u1C8F\u1CBB\u1CBC\u1CC8-\u1CCF\u1CFB-\u1CFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u2028-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20C2-\u20CF\u20F1-\u20FF\u218C-\u218F\u242A-\u243F\u244B-\u245F\u2B74\u2B75\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E5E-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u3040\u3097\u3098\u3100-\u3104\u3130\u318F\u31E6-\u31EE\u321F\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7DD-\uA7F0\uA82D-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C6-\uA8CD\uA8DA-\uA8DF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB6C-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\u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\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDDAE-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED9-\uDEDB\uDEED-\uDEEF\uDEFD-\uDEFF\uDFDA-\uDFDF\uDFEC-\uDFEF\uDFF1-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCBC-\uDCBF\uDCC2-\uDCCF\uDCD9-\uDCFF\uDE58-\uDE5F\uDE6E\uDE6F\uDE7D-\uDE7F\uDE8B-\uDE8D\uDEC7\uDEC9-\uDECC\uDEDD\uDEDE\uDEEB-\uDEEE\uDEF9-\uDEFF\uDF93\uDFFB-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEAE\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD88D[\uDC7A-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,"-").trim(),D||(D=o(t)),t!==D.split(".").pop()&&(D+=".".concat(t)),D}}},{mime:5}],5:[function(u,D,e){"use strict";const t=Object.keys(thepaste.options.mime_types),F=Object.values(thepaste.options.mime_types);t.push("zip"),F.push("application/x-zip-compressed"),D.exports={extension:u=>{const D=F.indexOf(u);return-1!==D&&t[D]},type:u=>{const D=t.indexOf(u);return-1!==D&&F[D]}}},{}],6:[function(u,D,e){(function(u){(function(){"use strict";var e,t=(e="undefined"!=typeof window?window.jQuery:void 0!==u?u.jQuery:null)&&e.__esModule?e:{default:e};class F{static success(u){let D=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o.call(F,"updated",u,D)}static notify(u){let D=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o.call(F,"",u,D)}static warn(u){let D=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o.call(F,"notice-warning",u,D)}static error(u){let D=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o.call(F,"error",u,D)}}function o(u,D){let e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const F="".concat(u," notice ").concat(e?"is-dismissible":"").trim(),o='

').concat(D,"

"),n=(0,t.default)(".wp-header-end").first();(0,t.default)(o).insertAfter(n),(0,t.default)(document).trigger("wp-updates-notice-added")}'");D.exports=F}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(u,D,e){"use strict";var t,F=s(u("mime")),o=s(u("converter")),n=s(u("notices")),i=u("compat");function s(u){return u&&u.__esModule?u:{default:u}}function r(u,D,e){a(u,D),D.set(u,e)}function a(u,D){if(D.has(u))throw new TypeError("Cannot initialize the same private elements twice on an object")}function l(u,D,e){return(D=function(u){var D=function(u,D){if("object"!=typeof u||!u)return u;var e=u[Symbol.toPrimitive];if(void 0!==e){var t=e.call(u,D||"default");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===D?String:Number)(u)}(u,"string");return"symbol"==typeof D?D:D+""}(D))in u?Object.defineProperty(u,D,{value:e,enumerable:!0,configurable:!0,writable:!0}):u[D]=e,u}function E(u,D){return u.get(c(u,D))}function c(u,D,e){if("function"==typeof u?u===D:u.has(D))return arguments.length<3?D:e;throw new TypeError("Private element is not present on this object")}const C=_wpPluploadSettings.defaults.filters.mime_types[0].extensions.split(","),d=Math.min(209715200,parseInt(_wpPluploadSettings.defaults.filters.max_file_size));var p=new WeakMap,A=new WeakMap,B=new WeakMap,f=new WeakMap,h=new WeakSet;class m{static get ready(){return!!m.workflow.uploader.uploader&&!!m.workflow.uploader.uploader.ready}static get workflow(){return v._||(v._=wp.media.editor.open(window.wpActiveEditor,{frame:"post",state:"insert",title:thepaste.l10n.copy_paste,multiple:!1})),v._}static get uploader(){return m.workflow.uploader.uploader.uploader}static get(u){return new m(u)}constructor(u){var D,e,t=this;a(D=this,e=h),e.add(D),l(this,"onUploaded",()=>{}),l(this,"onProgress",()=>{}),l(this,"onError",()=>{}),r(this,p,void 0),r(this,A,(u,D)=>{c(h,this,g).call(this,D)&&this.onProgress(D.percent)}),r(this,B,(u,D,e)=>{c(h,this,g).call(this,D)&&(this.onUploaded(D),c(h,this,w).call(this))}),r(this,f,function(u,D){c(h,t,g).call(t,D)&&t.onError(D)}),u.name||(u.name=T.getFilename(F.default.extension(u.type))),function(u,D,e){u.set(c(u,D),e)}(p,this,i.rml.file(u))}destructor(){m.workflow.close()}upload(){m.ready?c(h,this,b).call(this):m.workflow.once("uploader:ready",()=>{c(h,this,b).call(this)})}dump(){console.log(arguments)}}function g(u){return E(p,this).name===u.name&&E(p,this).size===u.size}function b(){c(h,this,y).call(this),t.uploader.addFile(E(p,this)),t.workflow.close()}function y(){t.uploader.bind("UploadProgress",E(A,this),this),t.uploader.bind("FileUploaded",E(B,this),this),t.uploader.bind("Error",E(f,this),this)}function w(){t.uploader.unbind("UploadProgress",E(A,this),this),t.uploader.unbind("FileUploaded",E(B,this),this),t.uploader.unbind("Error",E(f,this),this)}t=m;var v={_:void 0};const T={inlineUpload:async u=>{var D;const e=await o.default.elementToFile(u),t=m.get(e),i=document.createElement("progress");if(i.classList.add("the-paste-progress"),!(u=>!!u&&u.size<=d)(e))throw new ErrorEvent("the-paste-upload",{message:"File size exceeds ".concat(d," byte")});if(!(u=>!!u&&C.includes(F.default.extension(u.type)))(e))throw new ErrorEvent("the-paste-upload",{message:"Type ".concat(e.type," not allowed")});i.max=100,null===(D=u.parentNode)||void 0===D||D.insertBefore(i,u),u.remove(),t.onProgress=u=>{i.value=u},t.onError=u=>{console.error(u),n.default.error("".concat(thepaste.l10n.the_paste,": ").concat(u.message," File: ").concat(e.name,""),!0),i.remove()},t.onUploaded=u=>{const D=document.createElement("p"),e=u.attachment.attributes,t=getUserSetting("urlbutton","none");"image"===e.type?D.innerHTML=wp.media.string.image({link:t,align:getUserSetting("align","none"),size:getUserSetting("imgsize","medium")},e):"video"===e.type?D.innerHTML=wp.media.string.video({link:"none"!==t?t:"embed"},e):"audio"===e.type?D.innerHTML=wp.media.string.audio({link:"none"!==t?t:"embed"},e):D.innerHTML=wp.media.string.link({link:"none"!==t?t:"file"},e),i.replaceWith(D.childNodes[0])},t.upload()},getFilename:u=>{const D=function(u){let D=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return("00"+u.toString()).substr(-D)};let e=thepaste.options.default_filename;const t=new Date,F=document.querySelector('#post [name="post_title"]#title').value,o=(document.querySelector(".display-name").textContent,[{s:"%Y",r:t.getFullYear()},{s:"%y",r:t.getFullYear()%100},{s:"%m",r:D(t.getMonth()+1)},{s:"%d",r:D(t.getDate())},{s:"%e",r:t.getDate()},{s:"%H",r:D(t.getHours())},{s:"%I",r:D(t.getHours()%12)},{s:"%M",r:D(t.getMinutes())},{s:"%S",r:D(t.getSeconds())},{s:"%s",r:Math.floor(t.getTime()/1e3)}]);return void 0!==F?o.push({s:"",r:F}):o.push({s:"",r:""}),o.forEach(function(u){e=e.replace(u.s,u.r)}),"string"==typeof u&&(e+="."+u),e}};D.exports=T},{compat:2,converter:3,mime:5,notices:6}]},{},[1]); 2 | //# sourceMappingURL=the-paste-plugin.js.map 3 | -------------------------------------------------------------------------------- /js/admin/the-paste.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["admin/node_modules/browser-pack/_prelude.js","admin/src/js/admin/the-paste/index.js","admin/src/js/lib/compat.js","admin/src/js/lib/converter.js","admin/src/js/lib/filename.js","admin/src/js/lib/image-dialog.js","admin/src/js/lib/image-list.js","admin/src/js/lib/mime.js"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","module","_converter","_interopRequireDefault","_imageDialog","_compat","__esModule","default","PasteInstructions","wp","media","View","extend","template","className","render","prototype","apply","this","arguments","setInterval","$el","prop","document","hasFocus","_","view","MediaFrame","_parentInitialize","initialize","title","on","addPasteInstructions","pasteInstructions","find","append","el","AttachmentsBrowser","priority","toolbar","set","addEventListener","async","is","files","Array","from","clipboardData","preventDefault","stopPropagation","push","clipboardItemsToFiles","items","handlePastedFiles","capture","images","uploader","controller","forEach","file","test","type","addFile","rml","supports","svg","_wpPluploadSettings","defaults","filters","mime_types","extensions","split","includes","webp","createElement","toDataURL","indexOf","getSource","_filename","Converter","clipboardItems","Promise","resolve","reject","promises","map","item","kind","handler","_textPlain$textHtml","str","itemToString","toLowerCase","DOMParser","parseFromString","querySelector","stringToFile","loc","URL","location","div","innerHTML","imgs","querySelectorAll","filter","img","src","protocol","hostname","elementToFile","allSettled","then","result","promise","value","fl","size","catch","err","console","error","clipboardItemsToHtml","gdocsItemToSources","getAsString","Object","values","JSON","parse","data","image_urls","gdocsItemToFiles","sources","blobUrlToFile","urlToFile","alt","url","filename","undefined","schema","substr","dataUrlToFile","urlToMime","mime","dataUrlToMime","blobUrlToMime","urlToType","urlToBlobUrl","fileToBlobUrl","blobToFile","Blob","blob","File","safeFilename","blobUrlToBlob","blobUrl","blobUrlToType","fetch","blobUrlToDataUrl","fileToDataUrl","dataurl","match","dataUrlToType","dataUrlToBlob","arr","bstr","atob","u8arr","Uint8Array","charCodeAt","dataUrlToBlobUrl","createObjectURL","fr","FileReader","readAsDataURL","_mime","generateFilename","suffix","_document$querySelect","_document$querySelect2","_document$querySelect3","zerofill","len","toString","name","thepaste","options","default_filename","now","Date","postname","textContent","replace_values","filename_values","s","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","Math","floor","getTime","toLocaleDateString","toLocaleTimeString","keys","k","concat","replace","extension","trim","pop","_jquery","window","global","_imageList","modal","list","addFiles","Modal","events","keydown","key","submit","close","trigger","l10n","the_paste","isModal","getFiles","content","open","toggleClass","setTimeout","remove","ImageListItem","tagName","_ref","rawImage","Image","hasSize","width","height","canvas","$","get","body","after","getContext","drawImage","updateView","outputFormat","val","show","hide","basename","getFile","quality","parseFloat","jpeg_quality","toBlob","discard","discardItem","ImageList","button","Button","it","exts","types","idx","ext"],"mappings":"CAAA,SAAAA,EAAAC,EAAAC,EAAAC,GAAA,SAAAC,EAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,KAAAJ,EAAAI,GAAA,KAAAE,EAAA,mBAAAC,iBAAA,IAAAF,GAAAC,EAAA,OAAAA,EAAAF,GAAA,MAAAI,EAAA,OAAAA,EAAAJ,GAAA,OAAAK,EAAA,IAAAC,MAAA,uBAAAN,EAAA,WAAAK,EAAAE,KAAA,mBAAAF,CAAA,KAAAG,EAAAX,EAAAG,GAAA,CAAAS,QAAA,IAAAb,EAAAI,GAAA,GAAAU,KAAAF,EAAAC,QAAA,SAAAd,GAAA,OAAAI,EAAAH,EAAAI,GAAA,GAAAL,MAAA,EAAAa,IAAAC,QAAAd,EAAAC,EAAAC,EAAAC,EAAA,QAAAD,EAAAG,GAAAS,OAAA,SAAAL,EAAA,mBAAAD,iBAAAH,EAAA,EAAAA,EAAAF,EAAAa,OAAAX,IAAAD,EAAAD,EAAAE,IAAA,OAAAD,CAAA,eAAAI,EAAAS,EAAAH,G,aCAA,IAAAI,EAAAC,EAAAX,EAAA,cACAY,EAAAD,EAAAX,EAAA,iBACAa,EAAAb,EAAA,UAA4B,SAAAW,EAAAlB,GAAA,OAAAA,KAAAqB,WAAArB,EAAA,CAAAsB,QAAAtB,EAAA,CAI5B,MAAMuB,EAAoBC,GAAGC,MAAMC,KAAKC,OAAO,CAC9CC,SAAUJ,GAAGI,SAAS,0BACtBC,UAAW,yBACXC,OAAQ,WACPN,GAAGC,MAAMC,KAAKK,UAAUD,OAAO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MAAM4D,OAAQ7C,GAAQA,IAAS2B,EAAK3B,MACtDzC,KAAKkC,MAAQlC,KAAKkC,MAAMoD,OAAQkK,GAAMA,IAAOpL,GAC7CA,EAAKjE,IAAIqN,SACFxN,KAAKkC,MAAMpD,QACjBkB,KAAK+M,QAAQ,kBAEf,EACAP,SAAU,SAAU9K,GACnB1B,KAAK0B,MAAMM,QAASN,GACpBA,EAAMc,QAASC,IACd,MAAM2B,EAAO,IAAIqJ,EAAc,CAAChL,OAAKF,WAAWvC,OAChDoE,EAAKvE,SACLG,KAAKkO,EAAE,YAAYjN,OAAOmD,EAAKjE,KAC/BH,KAAKkC,MAAMF,KAAMoC,GACjBA,EAAKvE,UAEP,EACAsN,SAAU3L,iBACT,MAAME,EAAQ,GACd,IAAM,MAAM0C,KAAQpE,KAAKkC,MACxBR,EAAMM,WAAYoC,EAAK0K,WAExB,OAAOpN,CACR,EACAmL,OAAQ,WACP7M,KAAK+M,QAAQ,kBACd,IAGDhO,EAAOH,QAAUyQ,C,4EC1JjB,MAAMI,EAAQ/I,OAAOiF,KAAMrB,SAASC,QAAQpH,YACtCuM,EAAQhJ,OAAOC,OAAQ2D,SAASC,QAAQpH,YAG9CsM,EAAKzN,KAAK,OACV0N,EAAM1N,KAAK,gCAEXjD,EAAOH,QAAU,CAChBmN,UAAWpJ,IACV,MAAMgN,EAAMD,EAAMhM,QAASf,GAC3B,OAAQ,IAAMgN,GAAMF,EAAKE,IAE1BhN,KAAMiN,IACL,MAAMD,EAAMF,EAAK/L,QAASkM,GAC1B,OAAQ,IAAMD,GAAMD,EAAMC,I","file":"the-paste.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i {\n\t\t\tthis.$el.prop('hidden', ! document.hasFocus() )\n\t\t}, 100 )\n\t}\n})\n\n_.extend( wp.media.view.MediaFrame.prototype, {\n\t_parentInitialize:\twp.media.view.MediaFrame.prototype.initialize,\n\tinitialize: function(title) {\n\t\tthis._parentInitialize.apply(this,arguments);\n\t\tthis.on( 'attach', this.addPasteInstructions, this );\n\t\tthis.pasteInstructions = new PasteInstructions()\n\t\tthis.pasteInstructions.render()\n\t},\n\taddPasteInstructions: function() {\n\t\tthis.$el.find('#media-frame-title').append(this.pasteInstructions.el)\n\t}\n})\n\n// set uploader global var\n_.extend( wp.media.view.AttachmentsBrowser.prototype, {\n\t_parentInitialize:\twp.media.view.AttachmentsBrowser.prototype.initialize,\n\tinitialize:\tfunction() {\n\n\t\tthis._parentInitialize.apply(this,arguments);\n\n\t\tconst pasteInstructions = new PasteInstructions({\n\t\t\tpriority : -10,\n\t\t})\n\t\tpasteInstructions.render()\n\t\tthis.toolbar.set( 'pasteInstructions', pasteInstructions );\n\n\t\tdocument.addEventListener( 'paste', async e => {\n\n\t\t\tif ( ! this.$el.is(':visible') ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst files = Array.from( e.clipboardData.files )\n\n\t\t\t// prevent event bubbling to block editor element. File gets uploaded twice otherwise.\n\t\t\tif ( files.length ) {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t}\n\n\t\t\tfiles.push( ... await Converter.clipboardItemsToFiles( e.clipboardData.items ) ) // why did we do this?\n\n\t\t\tif ( files.length ) {\n\t\t\t\treturn await this.handlePastedFiles( files )\n\t\t\t}\n\n\t\t}, { capture: true } )\n\t},\n\thandlePastedFiles: async function(files) {\n\t\tconst images = [],\n\t\t\tuploader = this.controller.uploader.uploader.uploader\n\t\tfiles.forEach( file => {\n\t\t\tif ( /^image\\//.test( file.type ) ) {\n\t\t\t\timages.push(file)\n\t\t\t} else {\n\t\t\t\tuploader.addFile( rml.file(file) )\n\t\t\t}\n\t\t} )\n\t\tif ( images.length ) {\n\t\t\tconst uploadFiles = await imageDialog( images )\n\t\t\tuploadFiles.forEach( file => uploader.addFile( rml.file(file) ) )\n\t\t}\n\t}\n})\n","// Compatibility with [Real Media Library](https://wordpress.org/plugins/real-media-library-lite/)\n// @see https://github.com/mcguffin/the-paste/issues/47\n\nclass Supports {\n\tget svg() {\n\t\treturn _wpPluploadSettings.defaults.filters.mime_types[0].extensions.split(',').includes('svg')\n\t}\n\tget webp() {\n\t\treturn document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') == 0\n\t}\n}\n\nconst rml = {\n\tfile: file => {\n\t\tif ( ! file.getSource ) {\n\t\t\t// return native file object\n\t\t\t// mimic mOxie.Blob.getSource()\n\t\t\tfile.getSource = () => {\n\t\t\t\treturn file\n\t\t\t}\n\t\t}\n\t\treturn file\n\t}\n}\n\nconst supports = new Supports()\n\nmodule.exports = { rml, supports }\n","import { supports } from 'compat'\nimport { safeFilename } from 'filename'\n\n\nconst itemHandler = type => {\n\treturn {\n\t\t'text/plain': async item => {\n\t\t\tconst str = await Converter.itemToString( item )\n\t\t\tif ( str.toLowerCase().indexOf('= 0 ) {\n\t\t\t\tconst domParser = new DOMParser()\n\t\t\t\tif ( domParser.parseFromString(str,'image/svg+xml').querySelector('svg') ) {\n\t\t\t\t\treturn [ Converter.stringToFile( str, 'image/svg+xml' ) ]\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn []\n\t\t},\n\t\t'text/html': async item => {\n\t\t\tconst loc = new URL( document.location )\n\t\t\tconst div = document.createElement('div')\n\t\t\tdiv.innerHTML = await Converter.itemToString( item )\n\n\t\t\tconst imgs = Array.from( div.querySelectorAll('img') )\n\t\t\t\t.filter( img => {\n\t\t\t\t\t// remove images from same domain\n\t\t\t\t\tconst u = new URL(img.src)\n\t\t\t\t\treturn ! ['http:','https:'].includes(u.protocol) || loc.hostname !== u.hostname\n\t\t\t\t} )\n\t\t\t\t.map( img => Converter.elementToFile(img) )\n\n\t\t\treturn new Promise( (resolve,reject) => {\n\t\t\t\tPromise.allSettled( imgs ).then( result => resolve( Array.from(result).map( promise => promise.value )) )\n\t\t\t})\n\t\t},\n\t\t// 'application/x-vnd.google-docs-image-clip+wrapped': async item => await Converter.gdocsItemToFiles( item ), // <== dont need this\n\t}[type]??(()=>new Promise((resolve,reject)=>resolve([])))\n}\n\nconst Converter = {\n\tclipboardItemsToFiles: clipboardItems => {\n\t\tconst files = []\n\t\treturn new Promise((resolve,reject) => {\n\t\t\tconst promises = Array.from(clipboardItems).map( item => {\n\t\t\t\tif ( 'string' === item.kind ) {\n\t\t\t\t\tconst handler = itemHandler(item.type)\n\t\t\t\t\treturn handler( item )\n\t\t\t\t\t\t.then( f => {\n\t\t\t\t\t\t\tfiles.push( ...f.filter( fl => fl.size > 0 ) )\n\t\t\t\t\t\t} )\n\t\t\t\t\t\t.catch( err => console.error(err) )\n\t\t\t\t}\n\t\t\t})\n\t\t\tPromise.allSettled(promises).then( () => resolve(files))\n\t\t})\n\t},\n\tclipboardItemsToHtml: async clipboardItems => {\n\t\tlet i, item\n\t\tfor ( i=0; i < clipboardItems.length; i++ ) {\n\t\t\titem = clipboardItems[i]\n\t\t\tif ( 'string' === item.kind && 'text/html' === item.type ) {\n\t\t\t\treturn await Converter.itemToString( item )\n\t\t\t}\n\t\t}\n\t\treturn ''\n\t},\n\tgdocsItemToSources: async item => new Promise( (resolve, reject) => {\n\t\titem.getAsString( async str => {\n\t\t\tconst src = Object.values(JSON.parse(JSON.parse( str ).data ).image_urls )\n\t\t\tresolve(src)\n\t\t} )\n\t}),\n\tgdocsItemToFiles: async item => {\n\t\tlet i\n\t\tconst sources = await Converter.gdocsItemToSources(item)\n\t\tconst files = []\n\t\tfor ( i=0;i new Promise( (resolve, reject) => {\n\t\titem.getAsString( str => resolve(str) )\n\t}),\n\n\telementToFile: async el => {\n\t\tconst file = await Converter.urlToFile(el.src,el.alt)\n\t\treturn file\n\t},\n\n\turlToFile: async ( url, filename = '') => {\n\t\tlet file\n\t\tconst schema = url.substr( 0, url.indexOf(':') )\n\t\tif ( 'data' === schema ) {\n\t\t\tfile = Converter.dataUrlToFile( url, filename )\n\t\t} else if ( ['blob','http','https'].includes( schema ) ) {\n\t\t\tfile = await Converter.blobUrlToFile( url, filename )\n\t\t}\n\t\treturn file\n\t},\n\turlToMime: async url => {\n\t\tconst schema = url.substr( 0, url.indexOf(':') )\n\t\tlet mime\n\t\tif ( 'data' === schema ) {\n\t\t\tmime = Converter.dataUrlToMime( url )\n\t\t} else if ( ['blob','http','https'].includes( schema ) ) {\n\t\t\tmime = await Converter.blobUrlToMime( url )\n\t\t}\n\t\treturn mime\n\t},\n\turlToType: async url => {\n\t\tconst mime = await Converter.urlToMime(url)\n\t\treturn mime.substr( 0, mime.indexOf('/'))\n\t},\n\turlToBlobUrl: async (url) => {\n\t\tconst file = await Converter.blobUrlToFile( url )\n\t\treturn Converter.fileToBlobUrl( file )\n\t},\n\n\tstringToFile: (str, type) => {\n\t\treturn Converter.blobToFile( new Blob( [str], {type} ) )\n\t},\n\n\tblobToFile: ( blob, filename = '' ) => {\n\t\treturn new File([blob], safeFilename( blob, filename ), { type: blob.type } );\n\t},\n\tblobUrlToMime: async blobUrl =>{\n\t\tconst blob = await Converter.blobUrlToBlob(blobUrl)\n\t\treturn blob.type\n\t},\n\tblobUrlToType: async blobUrl => {\n\t\tconst blob = await Converter.blobUrlToBlob(blobUrl)\n\t\treturn blob.type.substr(0,blob.type.indexOf('/'))\n\t},\n\tblobUrlToBlob: async ( blobUrl, filename = '' ) => {\n\t\tconst blob = await fetch( blobUrl ).then( r => r.blob() );\n\t\treturn blob\n\t},\n\tblobUrlToFile: async ( blobUrl, filename = '' ) => {\n\t\tconst blob = await Converter.blobUrlToBlob(blobUrl)\n\t\treturn Converter.blobToFile( blob, filename )\n\t},\n\tblobUrlToDataUrl: async blobUrl => {\n\t\tconst blob = await fetch(blobUrl).then( r => r.blob() );\n\t\tconst dataurl = await Converter.fileToDataUrl(blob)\n\t\treturn dataurl\n\t},\n\n\n\tdataUrlToMime: dataurl => dataurl.match('data:([^;]+);')[1],\n\n\tdataUrlToType: dataurl => dataurl.match('data:([^\\/]+)\\/')[1],\n\n\tdataUrlToBlob: ( dataurl ) => {\n\t\tlet arr = dataurl.split(','),\n\t\t\ttype = arr[0].match(/:(.*?);/)[1],\n\t\t\tbstr = atob(arr[1]),\n\t\t\tn = bstr.length,\n\t\t\tu8arr = new Uint8Array(n);\n\n\t\twhile(n--){\n\t\t\tu8arr[n] = bstr.charCodeAt(n);\n\t\t}\n\t\treturn new Blob( [u8arr], { type: type } )\n\t},\n\n\tdataUrlToFile: ( dataurl, filename = '' ) => Converter.blobToFile( Converter.dataUrlToBlob(dataurl), filename ),\n\n\tdataUrlToBlobUrl: dataurl => Converter.fileToBlobUrl( Converter.dataUrlToBlob( dataurl ) ),\n\n\tfileToBlobUrl: file => URL.createObjectURL(file),\n\n\tfileToDataUrl: file => new Promise( ( resolve, reject ) => {\n\t\tconst fr = new FileReader()\n\t\tfr.addEventListener('load', () => resolve( fr.result ) )\n\t\tfr.readAsDataURL( file )\n\t}),\n}\n\nmodule.exports = Converter\n","import mime from 'mime'\n\n/**\n *\tGenerate a filename\n */\nconst generateFilename = suffix => {\n\n\tconst zerofill = (n,len = 2) => {\n\t\treturn ('00' + n.toString()).substr(-len)\n\t}\n\n\tlet name = thepaste.options.default_filename\n\n\tconst now = new Date(),\n\t\tpostname = document.querySelector('#post [name=\"post_title\"]#title')?.value\n\t\t\t|| document.querySelector('.wp-block-post-title')?.textContent\n\t\t\t|| document.querySelector('h1')?.textContent,\n\t\treplace_values = thepaste.options.filename_values,\n\t\t// username = document.querySelector('.display-name')?.textContent,\n\t\tmap = [\n\t\t\t{ s: '%Y', r: now.getFullYear() },\n\t\t\t{ s: '%y', r: now.getFullYear() % 100 },\n\t\t\t{ s: '%m', r: zerofill(now.getMonth() + 1) },\n\t\t\t{ s: '%d', r: zerofill(now.getDate()) },\n\t\t\t{ s: '%e', r: now.getDate() },\n\t\t\t{ s: '%H', r: zerofill(now.getHours()) },\n\t\t\t{ s: '%I', r: zerofill(now.getHours() % 12 ) },\n\t\t\t{ s: '%M', r: zerofill(now.getMinutes()) },\n\t\t\t{ s: '%S', r: zerofill(now.getSeconds()) },\n\t\t\t{ s: '%s', r: Math.floor( now.getTime() / 1000 ) },\n\t\t\t{ s: '%x', r: now.toLocaleDateString() },\n\t\t\t{ s: '%X', r: now.toLocaleTimeString() }\n\t\t];\n\tif ( 'undefined' !== typeof postname ) {\n\t\tmap.push( { s: '', r: postname } );\n\t} else {\n\t\tmap.push( { s: '', r: '' } );\n\t}\n\tObject.keys( replace_values ).forEach( k => {\n\t\tif ( !! replace_values[k] ) {\n\t\t\tmap.push( { s: `<${k}>`, r: replace_values[k] } );\n\t\t} else {\n\t\t\tmap.push( { s: `<${k}>`, r: '' } );\n\t\t}\n\t})\n\tmap.forEach(function(el){\n\t\tname = name.replace( el.s, el.r )\n\t})\n\tif ( 'string' === typeof suffix) {\n\t\tname += '.' + suffix;\n\t}\n\treturn name;\n}\nconst safeFilename = ( file, filename = '' ) => {\n\tlet type = file.type\n\n\tconst suffix = mime.extension(type)\n\tfilename = filename.replace(/[^\\p{L}\\p{M}\\p{S}\\p{N}\\p{P}\\p{Zs}]/ug,'-').trim()\n\tif ( ! filename ) {\n\t\tfilename = generateFilename( suffix )\n\t}\n\tif ( suffix !== filename.split('.').pop() ) {\n\t\tfilename += `.${suffix}`\n\t}\n\treturn filename\n}\n\nmodule.exports = { generateFilename, safeFilename }\n","import $ from 'jquery'\nimport ImageList from 'image-list'\n\nlet modal = null\nlet list = null\n\nconst imageDialog = images => {\n\treturn new Promise( (resolve,reject) => {\n\t\tif ( modal !== null ) {\n\t\t\tlist.addFiles(images)\n\t\t\tresolve([])\n\t\t\treturn\n\t\t}\n\t\tmodal = new wp.media.view.Modal( {\n\t\t\tevents: {\n\t\t\t\t'keydown': function(e) {\n\t\t\t\t\tif ( e.key === 'Enter' ) {\n\t\t\t\t\t\tlist.submit()\n\t\t\t\t\t} else if ( e.key === 'Escape' ) {\n\t\t\t\t\t\tmodal.close()\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'click .media-modal-close': function(e) {\n\t\t\t\t\tmodal.close()\n\t\t\t\t}\n\t\t\t},\n\t\t\tcontroller : {\n\t\t\t\ttrigger: () => {},\n\t\t\t},\n\t\t\ttitle : thepaste.l10n.the_paste\n\t\t} );\n\t\tlist = new ImageList( { controller: modal })\n\t\tconst isModal = $('body').is('.modal-open')\n\t\tlist.on( 'thepaste:submit', async () => {\n\t\t\tconst files = await list.getFiles()\n\t\t\tmodal.close()\n\t\t\tresolve( files )\n\t\t})\n\t\tlist.on('thepaste:cancel',() => {\n\t\t\tmodal.close()\n\t\t\tresolve([])\n\t\t} )\n\t\tmodal.content( list );\n\t\tlist.addFiles(images)\n\t\tmodal.open();\n\t\tmodal.on('close', () => {\n\t\t\t$('body').toggleClass( 'the-paste-modal-open', false )\n\t\t\t$('body').toggleClass( 'modal-open', isModal )\n\t\t\tsetTimeout( () => {\n\t\t\t\tmodal.remove()\n\t\t\t\tmodal = null\n\t\t\t}, 10 )\n\t\t})\n\t\t$('body').toggleClass( 'the-paste-modal-open', true )\n\t})\n}\n\nmodule.exports = imageDialog\n","import Converter from 'converter'\nimport mime from 'mime'\nimport { supports } from 'compat'\nimport { generateFilename } from 'filename'\n\nconst ImageListItem = wp.media.View.extend({\n\ttagName:'form',\n\ttemplate: wp.template('the-paste-image-list-item'),\n\tclassName: 'the-paste-image-list-item',\n\tevents: {\n\t\t'click [name=\"discard\"]': 'discard',\n\t\t'change [name=\"the-paste-format\"]': 'updateView',\n\t},\n\tinitialize : function( { file } ) {\n\t\twp.media.View.prototype.initialize.apply( this, arguments );\n\t\tthis.file = file\n\t\tnew Promise( (resolve,reject) => {\n\t\t\tconst rawImage = new Image();\n\t\t\trawImage.addEventListener(\"load\", function () {\n\t\t\t\tresolve(rawImage);\n\t\t\t});\n\t\t\trawImage.src = Converter.fileToBlobUrl(file);\n\t\t})\n\t\t.then( rawImage => {\n\t\t\tlet hasSize = rawImage.width && rawImage.height\n\t\t\tthis.canvas = this.$('canvas').get(0)\n\n\t\t\tif ( 'image/svg+xml' === this.file.type ) {\n\t\t\t\t// append image to DOM to get actual size\n\t\t\t\tif ( hasSize ) {\n\t\t\t\t\tdocument.body.append(rawImage)\n\t\t\t\t} else {\n\t\t\t\t\tthis.canvas.after(rawImage)\n\t\t\t\t}\n\t\t\t}\n\t\t\t// draw canvas\n\t\t\tthis.canvas.width = rawImage.width;\n\t\t\tthis.canvas.height = rawImage.height;\n\t\t\tthis.canvas.getContext(\"2d\").drawImage(rawImage, 0, 0);\n\n\t\t\tif ( 'image/svg+xml' === this.file.type ) {\n\t\t\t\tif ( hasSize ) {\n\t\t\t\t\trawImage.remove()\n\t\t\t\t} else {\n\t\t\t\t\t// no known size: svg only\n\t\t\t\t\tthis.$(`[data-format]:not([data-format=\"image/svg+xml\"])`).remove()\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t},\n\tupdateView: function() {\n\t\t// if input fmt != output fmt\n\t\tconst outputFormat = this.$('[name=\"the-paste-format\"]:checked').val()\n\t\tif ( outputFormat !== this.file.type && ['image/webp','image/jpeg'].includes( outputFormat ) ) {\n\t\t\tthis.$('.the-paste-quality').show()\n\t\t} else {\n\t\t\tthis.$('.the-paste-quality').hide()\n\t\t}\n\t},\n\trender: function() {\n\t\twp.media.View.prototype.render.apply(this,arguments);\n\n\t\tconst type = this.file.type\n\t\tconst basename = this.file.name.replace(/\\.([^\\.]*)$/,'')\n\n\t\tif ( 'image/webp' !== type ) {\n\t\t\tif ( ! supports.webp || ! mime.extension('image/webp') ) {\n\t\t\t\tthis.$(`[data-format=\"image/webp\"]`).remove()\n\t\t\t}\n\t\t}\n\n\t\tthis.$(`[name=\"the-paste-format\"][value=\"${type}\"]`).prop('checked', true )\n\t\tthis.$('[name=\"the-paste-filename\"]').val( basename )\n\t\tthis.$('[name=\"the-paste-filename\"]').prop( 'placeholder', generateFilename() )\n\n\t\tif ( ! supports.svg || 'image/svg+xml' !== type ) {\n\t\t\tthis.$(`[data-format=\"image/svg+xml\"]`).remove()\n\t\t\tif ( 'image/svg+xml' === type ) {\n\t\t\t\tthis.$(`[name=\"the-paste-format\"][value=\"image/png\"]`).prop('checked',true)\n\t\t\t}\n\t\t}\n\n\t\tthis.updateView()\n\t},\n\tgetFile: function() {\n\t\tconst type = this.$('[name=\"the-paste-format\"]:checked').val()\n\t\tconst name = this.$('[name=\"the-paste-filename\"]').val() || generateFilename()\n\t\tconst filename = `${name}.${mime.extension(type)}`\n\t\tconst quality = parseFloat( this.$('[name=\"the-paste-quality\"]').val() ) || thepaste.options.jpeg_quality\n\t\t// upload as-is\n\n\t\tif ( this.file.type === type ) {\n\t\t\treturn new Promise((resolve,reject) => {\n\t\t\t\tresolve( new File( [this.file], filename, { type } ) )\n\t\t\t})\n\t\t}\n\n\t\t// type conversion\n\t\treturn new Promise((resolve,reject) => {\n\t\t\tthis.canvas.toBlob( blob => {\n\t\t\t\tresolve( Converter.blobToFile( blob, filename ) )\n\t\t\t}, type, quality * 0.01 )\n\t\t})\n\t},\n\tdiscard: function() {\n\t\tthis.controller.discardItem(this)\n\t}\n})\n\nconst ImageList = wp.media.View.extend({\n\ttemplate: wp.template('the-paste-image-list'),\n\tclassName: 'the-paste-image-list',\n\tevents: {\n\t\t'click .media-frame-toolbar button': 'submit',\n\t},\n\tinitialize : function() {\n\t\twp.media.View.prototype.initialize.apply( this, arguments );\n\t\tthis.files = []\n\t\tthis.items = []\n\t\tthis.button = new wp.media.view.Button({\n\t\t\tclassName: 'button-primary button-hero',\n\t\t})\n\t\tthis.render()\n\t},\n\tdiscardItem:function(item) {\n\t\tthis.files = this.files.filter( file => file !== item.file )\n\t\tthis.items = this.items.filter( it => it !== item )\n\t\titem.$el.remove()\n\t\tif ( ! this.items.length ) {\n\t\t\tthis.trigger('thepaste:cancel')\n\t\t}\n\t},\n\taddFiles: function( files ) {\n\t\tthis.files.push( ...files )\n\t\tfiles.forEach( file => {\n\t\t\tconst item = new ImageListItem({file,controller:this})\n\t\t\titem.render()\n\t\t\tthis.$('.content').append(item.$el)\n\t\t\tthis.items.push( item )\n\t\t\titem.render()\n\t\t} )\n\t},\n\tgetFiles: async function() {\n\t\tconst files = []\n\t\tfor ( const item of this.items ) {\n\t\t\tfiles.push( await item.getFile() )\n\t\t}\n\t\treturn files\n\t},\n\tsubmit: function() {\n\t\tthis.trigger('thepaste:submit')\n\t},\n})\n\nmodule.exports = ImageList\n","const exts = Object.keys( thepaste.options.mime_types )\nconst types = Object.values( thepaste.options.mime_types )\n\n// windows\nexts.push('zip')\ntypes.push('application/x-zip-compressed')\n\nmodule.exports = {\n\textension: type => {\n\t\tconst idx = types.indexOf( type )\n\t\treturn -1 !== idx ? exts[idx] : false\n\t},\n\ttype: ext => {\n\t\tconst idx = exts.indexOf( ext )\n\t\treturn -1 !== idx ? types[idx] : false\n\t}\n}\n"]} --------------------------------------------------------------------------------