Create new document. Ref #34
This commit is contained in:
parent
6c05c370a6
commit
d64f046e06
File diff suppressed because one or more lines are too long
@ -12,6 +12,11 @@
|
|||||||
/**
|
/**
|
||||||
* Document routes
|
* Document routes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$this->create('documents_documents_create', 'ajax/documents/create')
|
||||||
|
->post()
|
||||||
|
->action('\OCA\Documents\DocumentController', 'create')
|
||||||
|
;
|
||||||
$this->create('documents_genesis', 'ajax/genesis/{es_id}')
|
$this->create('documents_genesis', 'ajax/genesis/{es_id}')
|
||||||
->post()
|
->post()
|
||||||
->action('\OCA\Documents\DocumentController', 'serve')
|
->action('\OCA\Documents\DocumentController', 'serve')
|
||||||
|
@ -113,6 +113,15 @@ var documentsMain = {
|
|||||||
documentsMain.initSession
|
documentsMain.initSession
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onCreate: function(event){
|
||||||
|
event.preventDefault();
|
||||||
|
$.post(
|
||||||
|
OC.Router.generate('documents_documents_create'),
|
||||||
|
{},
|
||||||
|
documentsMain.show
|
||||||
|
);
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* FIXME
|
* FIXME
|
||||||
*
|
*
|
||||||
@ -186,6 +195,12 @@ var documentsMain = {
|
|||||||
hideOverlay : function(){
|
hideOverlay : function(){
|
||||||
$('#documents-overlay,#documents-overlay-below').fadeOut('slow');
|
$('#documents-overlay,#documents-overlay-below').fadeOut('slow');
|
||||||
},
|
},
|
||||||
|
show: function(){
|
||||||
|
jQuery.when(documentsMain.loadDocuments())
|
||||||
|
.then(function(){
|
||||||
|
documentsMain.renderDocuments();
|
||||||
|
});
|
||||||
|
},
|
||||||
loadDocuments: function () {
|
loadDocuments: function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
var def = new $.Deferred();
|
var def = new $.Deferred();
|
||||||
@ -242,7 +257,7 @@ var documentsMain = {
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
$('.documentslist').on('click', 'li', function(event) {
|
$('.documentslist').on('click', 'li:not(.add-document)', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (documentsMain.isEditorMode){
|
if (documentsMain.isEditorMode){
|
||||||
return;
|
return;
|
||||||
@ -265,6 +280,8 @@ $(document).ready(function() {
|
|||||||
$(this).remove();
|
$(this).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.add-document').on('click', '.add', documentsMain.onCreate);
|
||||||
|
|
||||||
$('#inivite-input').autocomplete({
|
$('#inivite-input').autocomplete({
|
||||||
minLength: 1,
|
minLength: 1,
|
||||||
source: function(search, response) {
|
source: function(search, response) {
|
||||||
@ -296,10 +313,7 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery.when(documentsMain.loadDocuments())
|
documentsMain.show();
|
||||||
.then(function(){
|
|
||||||
documentsMain.renderDocuments();
|
|
||||||
});
|
|
||||||
//TODO show "no docs, please upload"
|
//TODO show "no docs, please upload"
|
||||||
//TODO when ending a session as the last user close session?
|
//TODO when ending a session as the last user close session?
|
||||||
|
|
||||||
|
@ -11,9 +11,9 @@
|
|||||||
<div id="documents-content">
|
<div id="documents-content">
|
||||||
<ul class="documentslist">
|
<ul class="documentslist">
|
||||||
<li class="add-document">
|
<li class="add-document">
|
||||||
<!-- <a class="add svg" target="_blank" href="">
|
<a class="add svg" target="_blank" href="">
|
||||||
<label><?php p('Add') ?></label>
|
<label><?php p('Add') ?></label>
|
||||||
</a> -->
|
</a>
|
||||||
<a class="upload svg" target="_blank" href="">
|
<a class="upload svg" target="_blank" href="">
|
||||||
<label><?php p('Upload') ?></label>
|
<label><?php p('Upload') ?></label>
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user