forms.js 1.1 KB

123456789101112131415161718192021222324252627282930
  1. function bx_base_text_select_thumb(eCheckbox) {
  2. bx_base_text_select_ghost(eCheckbox, 'thumb');
  3. }
  4. function bx_base_text_select_ghost(eCheckbox, sName) {
  5. var eCont = $(eCheckbox).parents('.bx-form-input-files-result');
  6. if (!eCont.length)
  7. return;
  8. eCont.find('.bx-base-text-use-as-' + sName + ' input:checked').each (function () {
  9. if($(this).attr('id') != $(eCheckbox).attr('id'))
  10. $(this).css('border', '1px solid red').attr('checked', false);
  11. });
  12. }
  13. function bx_base_text_delete_ghost (iFileId, sFileUrl, sFileIcon, aEditors, oUploaderInstance) {
  14. if ('undefined' !== typeof(bx_editor_remove_img)) {
  15. bx_editor_remove_img (
  16. aEditors,
  17. ['img[src="' + sFileIcon + '"]', 'img[src="' + sFileUrl + '"]', '#bx-base-text-img-' + iFileId, '.bx-base-text-icon-' + iFileId]
  18. );
  19. }
  20. oUploaderInstance.deleteGhost(iFileId);
  21. }
  22. function bx_base_text_insert_to_post (iFileId, sFileUrl, sEditorId) {
  23. bx_editor_insert_img (sEditorId, 'bx-base-text-img-' + iFileId, sFileUrl, 'bx-base-text-img');
  24. }