Changeset 2585543
- Timestamp:
- 08/19/2021 02:45:36 PM (5 years ago)
- Location:
- code-injection/trunk
- Files:
-
- 9 edited
-
assets/css/code-editor.css (modified) (1 diff)
-
assets/js/code-editor.js (modified) (3 diffs)
-
assets/js/essentials.js (modified) (1 diff)
-
code-injection.php (modified) (2 diffs)
-
includes/code-type.php (modified) (2 diffs)
-
languages/code-injection-fa_IR.mo (modified) (previous)
-
languages/code-injection-fa_IR.po (modified) (1 diff)
-
languages/code-injection.pot (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
code-injection/trunk/assets/css/code-editor.css
r2584954 r2585543 171 171 } 172 172 173 #title.disabled-input{ 174 pointer-events:none; 175 } 176 177 #titlewrap .copy-btn{ 178 position: absolute; 179 right: 0%; 180 top:0; 181 182 width: 67px; 183 height: 30px; 184 color: #50575e; 185 text-decoration: none; 186 text-align: center; 187 display: flex; 188 justify-content: space-around; 189 align-items: center; 190 } 191 192 #titlewrap .copy-btn:hover{ 193 color: white; 194 } 195 173 196 input.apple-switch { 174 197 position: relative; -
code-injection/trunk/assets/js/code-editor.js
r2584954 r2585543 31 31 32 32 33 function updatePostTitle() {34 var $title = $("#title");33 function updatePostTitle() { 34 var $title = $("#title"); 35 35 var $wrap = $("#titlewrap"); 36 if ($title .val().length == 0) {36 if ($title.val().length == 0) { 37 37 $wrap.addClass('busy'); 38 38 $.get(_ci.ajax_url, { … … 41 41 }, function (result) { 42 42 $wrap.removeClass('busy'); 43 if (result.success){43 if (result.success) { 44 44 $title.val(result.data); 45 45 46 } 46 47 }).fail(function () { … … 212 213 }); 213 214 214 215 $("#title").attr("disabled", true); 215 $("#title").addClass("disabled-input"); 216 217 $copybtn = $('<a href="javascript:void(0)" class="copy-btn">' + 218 __("Copy", "code-injection") + 219 '<span class="dashicons dashicons-external"></span></a>') 220 .on('click', function () { 221 window.ci.ctc($("#title")[0] , true); 222 }); 223 224 $("#titlewrap").append($copybtn); 216 225 217 226 -
code-injection/trunk/assets/js/essentials.js
r2584954 r2585543 8 8 window.ci = {}; 9 9 10 window.ci.ctc = function (element ) {10 window.ci.ctc = function (element , val = false) { 11 11 12 var text = $(element).text();12 var text = val ? $(element).val() : $(element).text(); 13 13 var $temp = $(`<input value="${text}" />`).css({ 14 14 'position': 'absolute', -
code-injection/trunk/code-injection.php
r2584954 r2585543 5 5 * Plugin URI: https://github.com/Rmanaf/wp-code-injection 6 6 * Description: This plugin allows you to inject code snippets into the pages. 7 * Version: 2.4. 97 * Version: 2.4.10 8 8 * Author: Rmanaf 9 9 * Author URI: https://profiles.wordpress.org/rmanaf/ … … 34 34 private static $role_version = '1.0.0'; 35 35 36 private static $version = '2.4. 9';36 private static $version = '2.4.10'; 37 37 38 38 function __construct() -
code-injection/trunk/includes/code-type.php
r2584954 r2585543 32 32 add_action("admin_enqueue_scripts", "$clazz::print_scripts", 51); 33 33 34 add_filter("title_save_pre", "$clazz::auto_generate_post_title" );34 add_filter("title_save_pre", "$clazz::auto_generate_post_title" , 10, 1); 35 35 36 36 add_filter("user_can_richedit", "$clazz::disable_wysiwyg"); … … 297 297 } 298 298 299 300 299 if (isset($post->ID)) { 301 300 302 if (empty($_POST['post_title'])) { 303 304 if (!empty($title)) { 301 if ('code' !== get_post_type($post->ID)) { 302 return $title; 303 } 304 305 if (empty($_POST['title'])) { 306 307 if (!empty($title) && $title !== "Auto Draft") { 305 308 return $title; 306 309 } 307 310 308 if ('code' == get_post_type($post->ID)) { 309 return WP_Code_Injection_Plugin::generate_id('code-'); 310 } 311 } 311 $title = WP_Code_Injection_Plugin::generate_id('code-'); 312 313 }else{ 314 315 $title = $_POST['title']; 316 317 } 318 312 319 } 313 320 -
code-injection/trunk/languages/code-injection-fa_IR.po
r2576471 r2585543 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Code Injection 2.4. 8\n"5 "Project-Id-Version: Code Injection 2.4.10\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/code-injection\n" 7 7 "Last-Translator: \n" -
code-injection/trunk/languages/code-injection.pot
r2576471 r2585543 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Code Injection 2.4. 8\n"5 "Project-Id-Version: Code Injection 2.4.10\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/code-injection\n" 7 7 "Last-Translator: \n" -
code-injection/trunk/readme.txt
r2584954 r2585543 4 4 Requires at least: 4.5.0 5 5 Tested up to: 5.8.0 6 Stable tag: 2.4. 96 Stable tag: 2.4.10 7 7 License: MIT License 8 8 License URI: https://github.com/Rmanaf/wp-code-injection/blob/master/LICENSE
Note: See TracChangeset
for help on using the changeset viewer.