From 8298f7e35d9b4279d56746b54b240bc9626b9b85 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 17 Apr 2013 16:08:38 +0200 Subject: [PATCH] Remove the Download Link config on non-crx extensions. --- src/config.coffee | 4 +++- src/features.coffee | 7 ------- src/qr.coffee | 6 +++--- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/config.coffee b/src/config.coffee index acc178684..1be799305 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -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.'] diff --git a/src/features.coffee b/src/features.coffee index fbc45b7ed..a895da9e9 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -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' diff --git a/src/qr.coffee b/src/qr.coffee index 54d8c5447..575e1653f 100644 --- a/src/qr.coffee +++ b/src/qr.coffee @@ -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