cleanup: Remove the legacy Dropbox file upload integration.

This has been hard-disabled for years, we have no plans to re-enable
it, and it has some hacky code in it.
This commit is contained in:
Tim Abbott 2018-04-11 11:39:48 -07:00
parent 6c1a50da76
commit e6833b6427
7 changed files with 0 additions and 49 deletions

View File

@ -15,7 +15,6 @@
"XDate": false, "XDate": false,
"zxcvbn": false, "zxcvbn": false,
"LazyLoad": false, "LazyLoad": false,
"Dropbox": false,
"SockJS": false, "SockJS": false,
"marked": false, "marked": false,
"md5": false, "md5": false,

View File

@ -705,22 +705,6 @@ exports.initialize = function () {
upload.feature_check($("#compose #attach_files")); upload.feature_check($("#compose #attach_files"));
// Lazy load the Dropbox script, since it can slow our page load
// otherwise, and isn't enabled for all users. Also, this Dropbox
// script isn't under an open source license, so we can't (for legal
// reasons) minify it with our own code.
if (feature_flags.dropbox_integration) {
LazyLoad.js('https://www.dropbox.com/static/api/1/dropins.js', function () {
// Successful load. We should now have window.Dropbox.
if (! _.has(window, 'Dropbox')) {
blueslip.error('Dropbox script reports loading but window.Dropbox undefined');
} else if (Dropbox.isBrowserSupported()) {
Dropbox.init({appKey: window.dropboxAppKey});
$("#compose #attach_dropbox_files").removeClass("notdisplayed");
}
});
}
// Show a warning if a user @-mentions someone who will not receive this message // Show a warning if a user @-mentions someone who will not receive this message
$(document).on('usermention_completed.zulip', function (event, data) { $(document).on('usermention_completed.zulip', function (event, data) {
if (compose_state.get_message_type() !== 'stream') { if (compose_state.get_message_type() !== 'stream') {
@ -998,24 +982,6 @@ exports.initialize = function () {
exports.clear_preview_area(); exports.clear_preview_area();
}); });
$("#compose").on("click", "#attach_dropbox_files", function (e) {
e.preventDefault();
var options = {
// Required. Called when a user selects an item in the Chooser.
success: function (files) {
var textbox = $("#compose-textarea");
var links = _.map(files, function (file) { return '[' + file.name + '](' + file.link +')'; })
.join(' ') + ' ';
textbox.val(textbox.val() + links);
},
// Optional. A value of false (default) limits selection to a single file, while
// true enables multiple file selection.
multiselect: true,
iframe: true,
};
Dropbox.choose(options);
});
$("#compose").filedrop( $("#compose").filedrop(
upload.options({ upload.options({
mode: 'compose', mode: 'compose',

View File

@ -13,7 +13,6 @@ exports.mark_read_at_bottom = true;
exports.propagate_topic_edits = true; exports.propagate_topic_edits = true;
exports.clicking_notification_causes_narrow = true; exports.clicking_notification_causes_narrow = true;
exports.collapsible = false; exports.collapsible = false;
exports.dropbox_integration = false;
exports.reminders_in_message_action_menu = false; exports.reminders_in_message_action_menu = false;
return exports; return exports;

View File

@ -15,10 +15,6 @@
<link href="/static/favicon.ico?v=2" rel="shortcut icon"> <link href="/static/favicon.ico?v=2" rel="shortcut icon">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
{% if dropboxAppKey %}
<script type="text/javascript">var dropboxAppKey = "{{ dropboxAppKey }}";</script>
{% endif %}
{# We need to import jQuery before Bootstrap #} {# We need to import jQuery before Bootstrap #}
{% stylesheet 'common' %} {% stylesheet 'common' %}
{% block page_params %} {% block page_params %}

View File

@ -106,8 +106,6 @@
id="emoji_map" href="#" title="{{ _('Add emoji') }}"></a> id="emoji_map" href="#" title="{{ _('Add emoji') }}"></a>
<a class="message-control-button icon-vector-font" <a class="message-control-button icon-vector-font"
title="{{ _('Formatting') }}" data-overlay-trigger="markdown-help"></a> title="{{ _('Formatting') }}" data-overlay-trigger="markdown-help"></a>
<a class="message-control-button icon-vector-dropbox notdisplayed"
id="attach_dropbox_files" href="#" title="{{ _('Attach files from Dropbox') }}"></a>
<a class="message-control-button icon-vector-paper-clip notdisplayed" <a class="message-control-button icon-vector-paper-clip notdisplayed"
id="attach_files" href="#" title="{{ _('Attach files') }}"></a> id="attach_files" href="#" title="{{ _('Attach files') }}"></a>
{% if jitsi_server_url %} {% if jitsi_server_url %}

View File

@ -136,9 +136,3 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
'settings_comments_path': settings_comments_path, 'settings_comments_path': settings_comments_path,
'platform': platform, 'platform': platform,
} }
def add_metrics(request: HttpRequest) -> Dict[str, str]:
return {
'dropboxAppKey': settings.DROPBOX_APP_KEY
}

View File

@ -1232,7 +1232,6 @@ base_template_engine_settings = {
], ],
'context_processors': [ 'context_processors': [
'zerver.context_processors.zulip_default_context', 'zerver.context_processors.zulip_default_context',
'zerver.context_processors.add_metrics',
'django.template.context_processors.i18n', 'django.template.context_processors.i18n',
], ],
}, },