Fix coding style complaints
This commit is contained in:
parent
a5ae82e870
commit
0606fc58a5
@ -5,7 +5,7 @@ $(document).ready(function(){
|
||||
var documentsSettings = {
|
||||
save : function() {
|
||||
$('#docs_apply').attr('disabled', true);
|
||||
var data = {
|
||||
var data = {
|
||||
converter : $('[name="docs_converter"]:checked').val()
|
||||
};
|
||||
|
||||
|
@ -14,8 +14,8 @@ $(document).ready(function(){
|
||||
$('#documents-default-path').blur(documentsSettings.save);
|
||||
$('#documents-default-path').keypress(function( event ) {
|
||||
if (event.which == 13) {
|
||||
event.preventDefault();
|
||||
documentsSettings.save();
|
||||
event.preventDefault();
|
||||
documentsSettings.save();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -8,7 +8,7 @@ $(document).ready(function(){
|
||||
$.post(OC.generateUrl('apps/documents/ajax/config/unstable'), data, documentsSettings.afterSave);
|
||||
},
|
||||
afterSave : function(){
|
||||
documentsMain.useUnstable = $('#webodf-unstable').attr('checked')==="checked"
|
||||
documentsMain.useUnstable = $('#webodf-unstable').attr('checked')==="checked";
|
||||
}
|
||||
};
|
||||
$('#webodf-unstable').change(documentsSettings.save);
|
||||
|
@ -13,21 +13,25 @@ var odfViewer = {
|
||||
],
|
||||
|
||||
register : function(response){
|
||||
var i,
|
||||
mimeRead,
|
||||
mimeUpdate;
|
||||
|
||||
if (response && response.mimes){
|
||||
jQuery.each(response.mimes, function(i, mime){
|
||||
odfViewer.supportedMimesRead.push(mime);
|
||||
odfViewer.supportedMimesUpdate.push(mime);
|
||||
});
|
||||
}
|
||||
for (var i = 0; i < odfViewer.supportedMimesRead.length; ++i) {
|
||||
var mime = odfViewer.supportedMimesRead[i];
|
||||
OCA.Files.fileActions.register(mime, 'View', OC.PERMISSION_READ, '', odfViewer.onView);
|
||||
OCA.Files.fileActions.setDefault(mime, 'View');
|
||||
for (i = 0; i < odfViewer.supportedMimesRead.length; ++i) {
|
||||
mimeRead = odfViewer.supportedMimesRead[i];
|
||||
OCA.Files.fileActions.register(mimeRead, 'View', OC.PERMISSION_READ, '', odfViewer.onView);
|
||||
OCA.Files.fileActions.setDefault(mimeRead, 'View');
|
||||
}
|
||||
for (var i = 0; i < odfViewer.supportedMimesUpdate.length; ++i) {
|
||||
var mime = odfViewer.supportedMimesUpdate[i];
|
||||
for (i = 0; i < odfViewer.supportedMimesUpdate.length; ++i) {
|
||||
mimeUpdate = odfViewer.supportedMimesUpdate[i];
|
||||
OCA.Files.fileActions.register(
|
||||
mime,
|
||||
mimeUpdate,
|
||||
'Edit',
|
||||
OC.PERMISSION_UPDATE,
|
||||
OC.imagePath('core', 'actions/rename'),
|
||||
@ -39,7 +43,7 @@ var odfViewer = {
|
||||
|
||||
dispatch : function(filename){
|
||||
if (odfViewer.supportedMimesUpdate.indexOf(OCA.Files.fileActions.getCurrentMimeType()) !== -1
|
||||
&& OCA.Files.fileActions.getCurrentPermissions() & OC.PERMISSION_UPDATE
|
||||
&& OCA.Files.fileActions.getCurrentPermissions() & OC.PERMISSION_UPDATE
|
||||
){
|
||||
odfViewer.onEdit(filename);
|
||||
} else {
|
||||
@ -48,7 +52,8 @@ var odfViewer = {
|
||||
},
|
||||
|
||||
onEdit : function(fileName, context){
|
||||
var fileId = context.$file.attr('data-id');
|
||||
var location,
|
||||
fileId = context.$file.attr('data-id');
|
||||
window.location = OC.linkTo('documents', 'index.php') + '#' + fileId;
|
||||
},
|
||||
|
||||
@ -58,12 +63,13 @@ var odfViewer = {
|
||||
|
||||
if (odfViewer.isDocuments){
|
||||
//Documents view
|
||||
var location = filename;
|
||||
location = filename;
|
||||
} else {
|
||||
//Public page, files app, etc
|
||||
var dirName = $('#dir').val()!='/' ? $('#dir').val() + '/' : '/';
|
||||
var location = OC.filePath('documents', 'ajax', 'download.php') + '?path=' + encodeURIComponent(dirName) + encodeURIComponent(filename)
|
||||
+ '&requesttoken=' + encodeURIComponent(oc_requesttoken);
|
||||
location = OC.filePath('documents', 'ajax', 'download.php') + '?path='
|
||||
+ encodeURIComponent(dirName) + encodeURIComponent(filename)
|
||||
+ '&requesttoken=' + encodeURIComponent(oc_requesttoken);
|
||||
OC.addStyle('documents', '3rdparty/webodf/wodotexteditor');
|
||||
}
|
||||
|
||||
|
@ -42,8 +42,7 @@ define("owncloud/widgets/ocToolbar",
|
||||
ocClose.startup();
|
||||
});
|
||||
return callback(ocToolbar);
|
||||
}
|
||||
;
|
||||
};
|
||||
// init
|
||||
makeWidget(function (widget) {
|
||||
return callback(widget);
|
||||
|
Loading…
x
Reference in New Issue
Block a user