mirror of https://github.com/zulip/zulip.git
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:
parent
6c1a50da76
commit
e6833b6427
|
@ -15,7 +15,6 @@
|
|||
"XDate": false,
|
||||
"zxcvbn": false,
|
||||
"LazyLoad": false,
|
||||
"Dropbox": false,
|
||||
"SockJS": false,
|
||||
"marked": false,
|
||||
"md5": false,
|
||||
|
|
|
@ -705,22 +705,6 @@ exports.initialize = function () {
|
|||
|
||||
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
|
||||
$(document).on('usermention_completed.zulip', function (event, data) {
|
||||
if (compose_state.get_message_type() !== 'stream') {
|
||||
|
@ -998,24 +982,6 @@ exports.initialize = function () {
|
|||
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(
|
||||
upload.options({
|
||||
mode: 'compose',
|
||||
|
|
|
@ -13,7 +13,6 @@ exports.mark_read_at_bottom = true;
|
|||
exports.propagate_topic_edits = true;
|
||||
exports.clicking_notification_causes_narrow = true;
|
||||
exports.collapsible = false;
|
||||
exports.dropbox_integration = false;
|
||||
exports.reminders_in_message_action_menu = false;
|
||||
|
||||
return exports;
|
||||
|
|
|
@ -15,10 +15,6 @@
|
|||
<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">
|
||||
|
||||
{% if dropboxAppKey %}
|
||||
<script type="text/javascript">var dropboxAppKey = "{{ dropboxAppKey }}";</script>
|
||||
{% endif %}
|
||||
|
||||
{# We need to import jQuery before Bootstrap #}
|
||||
{% stylesheet 'common' %}
|
||||
{% block page_params %}
|
||||
|
|
|
@ -106,8 +106,6 @@
|
|||
id="emoji_map" href="#" title="{{ _('Add emoji') }}"></a>
|
||||
<a class="message-control-button icon-vector-font"
|
||||
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"
|
||||
id="attach_files" href="#" title="{{ _('Attach files') }}"></a>
|
||||
{% if jitsi_server_url %}
|
||||
|
|
|
@ -136,9 +136,3 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
|
|||
'settings_comments_path': settings_comments_path,
|
||||
'platform': platform,
|
||||
}
|
||||
|
||||
|
||||
def add_metrics(request: HttpRequest) -> Dict[str, str]:
|
||||
return {
|
||||
'dropboxAppKey': settings.DROPBOX_APP_KEY
|
||||
}
|
||||
|
|
|
@ -1232,7 +1232,6 @@ base_template_engine_settings = {
|
|||
],
|
||||
'context_processors': [
|
||||
'zerver.context_processors.zulip_default_context',
|
||||
'zerver.context_processors.add_metrics',
|
||||
'django.template.context_processors.i18n',
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue