Move edit menu item stuff into QR.oekaki.menu.

This commit is contained in:
ccd0 2016-02-14 14:00:30 -08:00
parent dbf2911891
commit 0a49c5a0eb
2 changed files with 43 additions and 42 deletions

View File

@ -406,7 +406,7 @@ Main =
['Reply Hiding (Menu)', PostHiding.menu] ['Reply Hiding (Menu)', PostHiding.menu]
['Delete Link', DeleteLink] ['Delete Link', DeleteLink]
['Filter (Menu)', Filter.menu] ['Filter (Menu)', Filter.menu]
['Edit Link', QR.oekaki] ['Edit Link', QR.oekaki.menu]
['Download Link', DownloadLink] ['Download Link', DownloadLink]
['Archive Link', ArchiveLink] ['Archive Link', ArchiveLink]
['Quote Inlining', QuoteInline] ['Quote Inlining', QuoteInline]

View File

@ -1,4 +1,5 @@
QR.oekaki = QR.oekaki =
menu:
init: -> init: ->
return unless Conf['Quick Reply'] and Conf['Edit Link'] return unless Conf['Quick Reply'] and Conf['Edit Link']
@ -12,13 +13,13 @@ QR.oekaki =
el: a el: a
order: 95 order: 95
open: (post) -> open: (post) ->
QR.oekaki.post = post QR.oekaki.menu.post = post
{file} = post {file} = post
!!file and (file.isImage or file.isVideo) !!file and (file.isImage or file.isVideo)
editFile: -> editFile: ->
return unless QR.postingIsEnabled return unless QR.postingIsEnabled
{post} = QR.oekaki {post} = QR.oekaki.menu
QR.quote.call post.nodes.root QR.quote.call post.nodes.root
{isVideo} = post.file {isVideo} = post.file
currentTime = post.file.fullImage?.currentTime or 0 currentTime = post.file.fullImage?.currentTime or 0