fixes some translation issues and enter key

This commit is contained in:
Volkan Gezer 2014-06-01 03:43:36 +02:00
parent b3ba009672
commit d3fa6ac77a
3 changed files with 13 additions and 5 deletions

View File

@ -15,13 +15,15 @@ namespace OCA\Documents;
\OCP\JSON::callCheck(); \OCP\JSON::callCheck();
\OCP\JSON::checkLoggedIn(); \OCP\JSON::checkLoggedIn();
$l = \OC_L10N::get('documents');
$savePath = isset($_POST['savePath']) ? $_POST['savePath'] : null; $savePath = isset($_POST['savePath']) ? $_POST['savePath'] : null;
if (!is_null($savePath)){ if (!is_null($savePath)){
if (\OC\Files\Filesystem::file_exists($savePath) ===false ){ if (\OC\Files\Filesystem::file_exists($savePath) ===false ){
if(!\OC\Files\Filesystem::mkdir($savePath)){ if(!\OC\Files\Filesystem::mkdir($savePath)){
\OCP\JSON::error( \OCP\JSON::error(
array( array(
'data' => array('message'=>'') 'data' => array('message'=> $l->t('An error occurred while changing directory.'))
) )
); );
} }
@ -29,7 +31,7 @@ if (!is_null($savePath)){
\OCP\Config::setUserValue(\OCP\User::getUser(), 'documents', 'save_path', $savePath); \OCP\Config::setUserValue(\OCP\User::getUser(), 'documents', 'save_path', $savePath);
\OCP\JSON::success( \OCP\JSON::success(
array( array(
'data' => array('message'=>'') 'data' => array('message'=> $l->t('Directory saved successfully.'))
) )
); );
exit(); exit();

View File

@ -12,4 +12,10 @@ $(document).ready(function(){
} }
}; };
$('#documents-default-path').blur(documentsSettings.save); $('#documents-default-path').blur(documentsSettings.save);
$('#documents-default-path').keypress(function( event ) {
if (event.which == 13) {
event.preventDefault();
documentsSettings.save();
}
});
}); });

View File

@ -4,7 +4,7 @@
<a class="icon-add add svg" target="_blank" href=""> <a class="icon-add add svg" target="_blank" href="">
<label><?php p($l->t('New document')) ?></label> <label><?php p($l->t('New document')) ?></label>
</a> </a>
<div id="upload" title="<?php p($l->t('Upload') . ' max. '.$_['uploadMaxHumanFilesize']) ?>"> <div id="upload" title="<?php p($l->t('Upload (max. %s)', array($_['uploadMaxHumanFilesize']))) ?>">
<form data-upload-id="1" <form data-upload-id="1"
id="data-upload-form" id="data-upload-form"
class="file_upload_form" class="file_upload_form"