Remove the Download Link config on non-crx extensions.

This commit is contained in:
Nicolas Stepien 2013-04-17 16:08:38 +02:00
parent 6f50ec0115
commit 8298f7e35d
3 changed files with 6 additions and 11 deletions

View File

@ -33,7 +33,9 @@ Config =
'Thread Hiding Link': [true, 'Add a link to hide entire threads.']
'Reply Hiding Link': [true, 'Add a link to hide single replies.']
'Delete Link': [true, 'Add post and image deletion links to the menu.']
'Download Link': [true, 'Add a download with original filename link to the menu. Chrome-only currently.']
<% if (type === 'crx') { %>
'Download Link': [true, 'Add a download with original filename link to the menu.']
<% } %>
'Archive Link': [true, 'Add an archive link to the menu.']
'Monitoring':
'Thread Updater': [true, 'Fetch and insert new replies. Has more options in its own dialog.']

View File

@ -1737,15 +1737,8 @@ DeleteLink =
DownloadLink =
init: ->
<% if (type === 'userscript') { %>
# Firefox won't let us download cross-domain content.
return
<% } %>
return if g.VIEW is 'catalog' or !Conf['Menu'] or !Conf['Download Link']
# Test for download feature support.
return unless 'download' of $.el 'a'
a = $.el 'a',
className: 'download-link'
textContent: 'Download file'

View File

@ -791,7 +791,7 @@ QR =
QR.mimeTypes = mimeTypes.split ', '
# Add empty mimeType to avoid errors with URLs selected in Window's file dialog.
QR.mimeTypes.push ''
nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value
nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value
<% if (type !== 'userjs') { %>
# Opera's accept attribute is fucked up
nodes.fileInput.accept = "text/*, #{mimeTypes}"
@ -826,8 +826,8 @@ QR =
$.on elm, 'blur', QR.focusout
$.on elm, 'focus', QR.focusin
<% } %>
$.on QR.nodes.el, 'focusin', QR.focusin
$.on QR.nodes.el, 'focusout', QR.focusout
$.on dialog, 'focusin', QR.focusin
$.on dialog, 'focusout', QR.focusout
for node in [nodes.fileButton, nodes.filename.parentNode]
$.on node, 'click', QR.openFileInput
$.on nodes.autohide, 'change', QR.toggleHide