Browse Source

Added "Upload" button to present a document.

pull/70/head
Joachim Bauch 12 years ago
parent
commit
58ce0c1450
  1. 4
      src/styles/components/_presentation.scss
  2. 27
      static/js/directives/presentation.js
  3. 1
      static/partials/presentation.html

4
src/styles/components/_presentation.scss

@ -45,6 +45,10 @@ @@ -45,6 +45,10 @@
text-align: center;
}
.presentationpane .welcome button {
margin-top: 30px;
}
.presentationpane .welcome .progress span {
text-shadow: none;
}

27
static/js/directives/presentation.js

@ -304,16 +304,13 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, @@ -304,16 +304,13 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($,
$scope.$emit("openPdf", file);
};
// create drag-drop target
var namespace = "file_" + $scope.id;
var binder = fileUpload.bindDrop(namespace, $element, _.bind(function(files) {
console.log("Files dragged", files);
var filesSelected = function(files) {
if (files.length > 1) {
alertify.dialog.alert(translation._("Only single PDF documents can be shared at this time."));
return;
}
_.each(files, _.bind(function(f) {
_.each(files, function(f) {
var info = $.extend({
id: f.id
}, f.info);
@ -323,13 +320,29 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, @@ -323,13 +320,29 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($,
return;
}
$scope.startPresentingFile(f, info);
}, this));
}, this));
});
};
// create drag-drop target
var namespace = "file_" + $scope.id;
var binder = fileUpload.bindDrop(namespace, $element, function(files) {
console.log("Files dragged", files);
filesSelected(files);
});
binder.namespace = function() {
// Inject own id into namespace.
return namespace + "_" + $scope.myid;
};
var clickBinder = fileUpload.bindClick(namespace, $element.find('.welcome button')[0], function(files) {
console.log("Files selected", files);
filesSelected(files);
});
clickBinder.namespace = function() {
// Inject own id into namespace.
return namespace + "_" + $scope.myid;
};
$scope.showPresentation = function() {
console.log("Presentation active");
$scope.layout.presentation = true;

1
static/partials/presentation.html

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
<div class="welcome container-fluid" ng-hide="maxPageNumber !== -1 || downloading">
<h1>{{_('Please drop a PDF document here to present it to the other participants.')}}</h1>
<div class="presentation-target fa fa-file-pdf-o"></div>
<button class="btn btn-lg btn-primary center-block">Upload</button>
</div>
<pdfcanvas ng-hide="maxPageNumber === -1 || downloading" />
</div>

Loading…
Cancel
Save