mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
File uploads using Dropbox.
(imported from commit c552133fc7025eca526fbfef24fd544260d7111b)
This commit is contained in:
@@ -7,6 +7,7 @@ exports.mark_read_at_bottom = page_params.staging;
|
|||||||
exports.summarize_read_while_narrowed = page_params.staging;
|
exports.summarize_read_while_narrowed = page_params.staging;
|
||||||
exports.twenty_four_hour_time = _.contains([],
|
exports.twenty_four_hour_time = _.contains([],
|
||||||
page_params.email);
|
page_params.email);
|
||||||
|
exports.dropbox_integration = page_params.staging || _.contains(['dropbox.com'], page_params.domain);
|
||||||
return exports;
|
return exports;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|||||||
@@ -1096,6 +1096,10 @@ $(function () {
|
|||||||
if (window.XMLHttpRequest && (new XMLHttpRequest()).upload) {
|
if (window.XMLHttpRequest && (new XMLHttpRequest()).upload) {
|
||||||
$("#compose #attach_files").removeClass("notdisplayed");
|
$("#compose #attach_files").removeClass("notdisplayed");
|
||||||
}
|
}
|
||||||
|
if (feature_flags.dropbox_integration && Dropbox.isBrowserSupported()) {
|
||||||
|
$("#compose #attach_dropbox_files").removeClass("notdisplayed");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Event bindings for "Compose" pane
|
// Event bindings for "Compose" pane
|
||||||
|
|
||||||
@@ -1107,6 +1111,24 @@ $(function () {
|
|||||||
$("#compose #file_input").trigger("click");
|
$("#compose #file_input").trigger("click");
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
$("#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 = $("#new_message_content");
|
||||||
|
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
|
||||||
|
};
|
||||||
|
Dropbox.choose(options);
|
||||||
|
});
|
||||||
|
|
||||||
$("#subscriptions_table").on("mouseover", ".subscription_header", function (e) {
|
$("#subscriptions_table").on("mouseover", ".subscription_header", function (e) {
|
||||||
$(this).addClass("active");
|
$(this).addClass("active");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<![endif]-->
|
<![endif]-->
|
||||||
<link href="/static/favicon.ico?v=2" rel="shortcut icon">
|
<link href="/static/favicon.ico?v=2" rel="shortcut icon">
|
||||||
|
|
||||||
|
<script type="text/javascript" src="https://www.dropbox.com/static/api/1/dropins.js" id="dropboxjs" data-app-key="xxxxxxxxxxxxxxx"></script>
|
||||||
{# mixpanel #}
|
{# mixpanel #}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function(e,b){if(!b.__SV){var a,f,i,g;window.mixpanel=b;a=e.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===e.location.protocol?"https:":"http:")+'//cdn.mxpnl.com/libs/mixpanel-2.2.min.js';f=e.getElementsByTagName("script")[0];f.parentNode.insertBefore(a,f);b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==
|
(function(e,b){if(!b.__SV){var a,f,i,g;window.mixpanel=b;a=e.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===e.location.protocol?"https:":"http:")+'//cdn.mxpnl.com/libs/mixpanel-2.2.min.js';f=e.getElementsByTagName("script")[0];f.parentNode.insertBefore(a,f);b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==
|
||||||
|
|||||||
@@ -57,6 +57,9 @@
|
|||||||
<td id="left-of-compose">
|
<td id="left-of-compose">
|
||||||
<div>
|
<div>
|
||||||
<input type="file" id="file_input" class="notvisible pull-left" multiple />
|
<input type="file" id="file_input" class="notvisible pull-left" multiple />
|
||||||
|
{# TODO UPDATE ICON #}
|
||||||
|
<a class="message-control-button icon-vector-dropbox notdisplayed"
|
||||||
|
id="attach_dropbox_files" href="#" title="Attach files from Dropbox"></a><br />
|
||||||
<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><br />
|
id="attach_files" href="#" title="Attach files"></a><br />
|
||||||
<a class="message-control-button icon-vector-font"
|
<a class="message-control-button icon-vector-font"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// Global variables, categorized by place of definition.
|
// Global variables, categorized by place of definition.
|
||||||
var globals =
|
var globals =
|
||||||
// Third-party libraries
|
// Third-party libraries
|
||||||
' $ _ jQuery Spinner Handlebars XDate zxcvbn Intl mixpanel Notification'
|
' $ _ jQuery Spinner Handlebars XDate zxcvbn Intl mixpanel Notification Dropbox'
|
||||||
|
|
||||||
// Node-based unit tests
|
// Node-based unit tests
|
||||||
+ ' module'
|
+ ' module'
|
||||||
|
|||||||
Reference in New Issue
Block a user