Changeset 3174729
- Timestamp:
- 10/24/2024 05:56:02 AM (18 months ago)
- Location:
- filerobot-digital-asset-management-and-acceleration
- Files:
-
- 31 added
- 5 edited
-
tags/4.0.8 (added)
-
tags/4.0.8/.gitignore (added)
-
tags/4.0.8/LICENSE.txt (added)
-
tags/4.0.8/README.txt (added)
-
tags/4.0.8/assets (added)
-
tags/4.0.8/assets/scripts (added)
-
tags/4.0.8/assets/scripts/core.js (added)
-
tags/4.0.8/assets/scripts/filerobot-enfold-theme.js (added)
-
tags/4.0.8/assets/scripts/fmaw.js (added)
-
tags/4.0.8/assets/scripts/image_editor.js (added)
-
tags/4.0.8/assets/scripts/jquery.initialize.js (added)
-
tags/4.0.8/assets/styles (added)
-
tags/4.0.8/assets/styles/acf-fmaw.css (added)
-
tags/4.0.8/assets/styles/core.css (added)
-
tags/4.0.8/assets/styles/flexboxgrid.min.css (added)
-
tags/4.0.8/assets/styles/gutenberg-fmaw-only.css (added)
-
tags/4.0.8/assets/styles/gutenberg-fmaw.css (added)
-
tags/4.0.8/filerobot_api.php (added)
-
tags/4.0.8/filerobot_class.php (added)
-
tags/4.0.8/filerobot_description_page.php (added)
-
tags/4.0.8/filerobot_fmaw_page.php (added)
-
tags/4.0.8/filerobot_image_edit_page.php (added)
-
tags/4.0.8/filerobot_log_page.php (added)
-
tags/4.0.8/filerobot_main_admin_page.php (added)
-
tags/4.0.8/filerobot_settings_page.php (added)
-
tags/4.0.8/filerobot_support_page.php (added)
-
tags/4.0.8/languages (added)
-
tags/4.0.8/languages/filerobot-en_US.mo (added)
-
tags/4.0.8/languages/filerobot-en_US.po (added)
-
tags/4.0.8/languages/filerobot.pot (added)
-
tags/4.0.8/loader.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/assets/scripts/fmaw.js (modified) (2 diffs)
-
trunk/filerobot_class.php (modified) (previous)
-
trunk/filerobot_fmaw_page.php (modified) (4 diffs)
-
trunk/loader.php (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
filerobot-digital-asset-management-and-acceleration/trunk/README.txt
r3168170 r3174729 5 5 Tested up to: 6.6.2 6 6 Requires at least: 4.8 7 Stable tag: 4.0. 77 Stable tag: 4.0.8 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 213 213 * Compatible with the theme Enfold 214 214 * Change plugin name to Scaleflex DAM 215 = 4.0.8 = 216 * Remove cron schedule 217 * Fix bug can't replace image in Editor 215 218 216 219 == Upgrade Notice == -
filerobot-digital-asset-management-and-acceleration/trunk/assets/scripts/fmaw.js
r3168170 r3174729 291 291 restoreDefaultButtons( (jQuery(e.target).parents('.image-details').length > 0) ? '.button.media-button-replace' : '.button.media-button-select' ); 292 292 } 293 }); 294 295 //Replace attachment 296 jQuery(wp.media).on('click', '.replace-attachment', function(e) { 297 loadFmawContent('body'); 293 298 }); 294 299 } … … 424 429 dataType: 'html' 425 430 }).done(function (res) { 426 jQuery(media_frame).html( res);431 jQuery(media_frame).html('<div class="attachments-browser has-load-more">' + res + '</div>'); 427 432 428 433 jQuery('.media-modal:visible .media-frame-content').removeClass('wait-for-render'); -
filerobot-digital-asset-management-and-acceleration/trunk/filerobot_fmaw_page.php
r3168170 r3174729 240 240 241 241 let disableExport = false; 242 if (page_name && page_name === ' filerobot-fmaw') {242 if (page_name && page_name === 'scaleflex-dam-widget') { 243 243 disableExport = true; 244 244 } … … 330 330 331 331 if (successful) { 332 // console.dir(successful);333 334 332 let to_insert = []; 335 333 334 console.log(successful); 335 336 336 successful.forEach((item, key) => { 337 to_insert.push(item .uuid);337 to_insert.push(item); 338 338 }); 339 340 if (to_insert.length === 0) { 341 return; 342 } 343 344 if (disableExport) { 345 fmaw_insert_attachment_to_db(to_insert); 346 } 339 347 340 348 if (isGutenberg || mediaFrameType === 'generic') { … … 1237 1245 console.log('Element not found.'); 1238 1246 } 1247 } 1248 1249 function fmaw_insert_attachment_to_db(to_insert) { 1250 to_insert.forEach(function(item, key) { 1251 let data = { 1252 fr_data : item, 1253 action : 'filerobot_widget_insert_attachment_to_db', 1254 }; 1255 1256 jQuery.ajax({ 1257 type: 'POST', 1258 url: ajaxurl, 1259 data: data, 1260 dataType: 'html' 1261 }).done(function (res) { 1262 res = JSON.parse(res); 1263 if (res.success) { 1264 console.log('Asset upload success!'); 1265 } 1266 }); 1267 }); 1239 1268 } 1240 1269 … … 1445 1474 1446 1475 } else if (wp.media.editor) { 1447 wp.media.editor.insert(res.data); 1476 if (jQuery('#media-frame-title h1').text() === 'Replace image') { 1477 let newImgElement = jQuery(res.data); 1478 let newImgUrl = newImgElement.attr('src'); 1479 let imgElement = jQuery(tinymce.activeEditor.selection.getContent()); 1480 imgElement.attr('src', newImgUrl); 1481 } else { 1482 wp.media.editor.insert(res.data); 1483 } 1448 1484 } 1449 1485
Note: See TracChangeset
for help on using the changeset viewer.