(sourceId = '')
| 229 | } |
| 230 | |
| 231 | function isTrashDisabledForSource(sourceId = '') { |
| 232 | const id = String(sourceId || getActiveSourceId() || '').trim(); |
| 233 | if (!id) return false; |
| 234 | |
| 235 | try { |
| 236 | if (typeof window.__frGetSourceMetaById === 'function') { |
| 237 | const meta = window.__frGetSourceMetaById(id); |
| 238 | if (meta && typeof meta === 'object' && Object.prototype.hasOwnProperty.call(meta, 'disableTrash')) { |
| 239 | return !!meta.disableTrash; |
| 240 | } |
| 241 | } |
| 242 | } catch (e) { /* ignore */ } |
| 243 | |
| 244 | const sel = document.getElementById('sourceSelector'); |
| 245 | if (sel) { |
| 246 | const opt = Array.from(sel.options).find(o => o.value === id); |
| 247 | if (opt) return opt.dataset?.sourceDisableTrash === '1'; |
| 248 | } |
| 249 | |
| 250 | return false; |
| 251 | } |
| 252 | |
| 253 | function isFtpSourceId(sourceId = '') { |
| 254 | const type = String(getSourceTypeById(sourceId || getActiveSourceId()) || '').toLowerCase(); |
no test coverage detected