(path, mainPath, fromIndex = true, fromIndexNotMasterFolders = true, folder = false, gamepad = false)
| 2335 | |
| 2336 | // Show the comic context menu |
| 2337 | async function comicContextMenu(path, mainPath, fromIndex = true, fromIndexNotMasterFolders = true, folder = false, gamepad = false) |
| 2338 | { |
| 2339 | comicContextMenuIndex++; |
| 2340 | |
| 2341 | let isServer = fileManager.isServer(path); |
| 2342 | if(fileManager.isOpds(path)) return; |
| 2343 | |
| 2344 | const canBeDelete = (!fileManager.isServer(path) && !fileManager.lastCompressedFile(p.dirname(path))) ? true : false; |
| 2345 | |
| 2346 | dom.query('#index-context-menu .separator-remove').css({display: canBeDelete ? 'block' : 'none'}); |
| 2347 | |
| 2348 | // Remove |
| 2349 | let remove = document.querySelector('#index-context-menu .context-menu-remove'); |
| 2350 | |
| 2351 | if(fromIndexNotMasterFolders) |
| 2352 | { |
| 2353 | remove.style.display = 'block'; |
| 2354 | remove.setAttribute('onclick', 'dom.removeComic(\''+escapeQuotes(escapeBackSlash(path), 'simples')+'\');'); |
| 2355 | } |
| 2356 | else |
| 2357 | { |
| 2358 | remove.style.display = 'none'; |
| 2359 | } |
| 2360 | |
| 2361 | // Move to trash |
| 2362 | let moveToTrash = document.querySelector('#index-context-menu .context-menu-move-to-trash'); |
| 2363 | |
| 2364 | if(canBeDelete) |
| 2365 | { |
| 2366 | moveToTrash.style.display = 'block'; |
| 2367 | moveToTrash.setAttribute('onclick', 'dom.moveToTrash(\''+escapeQuotes(escapeBackSlash(path), 'simples')+'\', '+(fromIndexNotMasterFolders ? 'true' : 'false')+');'); |
| 2368 | } |
| 2369 | else |
| 2370 | { |
| 2371 | moveToTrash.style.display = 'none'; |
| 2372 | } |
| 2373 | |
| 2374 | // Delete permanently |
| 2375 | let deletePermanently = document.querySelector('#index-context-menu .context-menu-delete-permanently'); |
| 2376 | |
| 2377 | if(canBeDelete) |
| 2378 | { |
| 2379 | deletePermanently.style.display = 'block'; |
| 2380 | deletePermanently.setAttribute('onclick', 'dom.deletePermanently(\''+escapeQuotes(escapeBackSlash(path), 'simples')+'\', '+(fromIndexNotMasterFolders ? 'true' : 'false')+');'); |
| 2381 | } |
| 2382 | else |
| 2383 | { |
| 2384 | deletePermanently.style.display = 'none'; |
| 2385 | } |
| 2386 | |
| 2387 | dom.query('#index-context-menu .separator-labels').css({display: fromIndex ? 'block' : 'none'}); |
| 2388 | |
| 2389 | // Mark read an unread |
| 2390 | let markRead = document.querySelector('#index-context-menu .context-menu-mark-read'); |
| 2391 | let markUnread = document.querySelector('#index-context-menu .context-menu-mark-unread'); |
| 2392 | let separatorMark = document.querySelector('#index-context-menu .separator-mark'); |
| 2393 | |
| 2394 | if(fromIndex || folder) |
nothing calls this directly
no test coverage detected