├── 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 |
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("