Example #1
0
 function createMetaFolder(dirPath) {
   if (dirPath.lastIndexOf(TSCORE.metaFolder) >= dirPath.length - TSCORE.metaFolder.length) {
     console.log("Can not create meta folder in a meta folder");
     return;
   }
   var metaDirPath = dirPath + TSCORE.dirSeparator + TSCORE.metaFolder;
   TSCORE.IO.createDirectoryPromise(metaDirPath).then(function() {
     console.log("Metafolder created: " + metaDirPath);
   }).catch(function(error) {
     console.log("Creating metafolder failed, it was probably already created " + error);
   });
 }
Example #2
0
 $('#createNewDirectoryButton').on('click', function() {
   // TODO validate folder name
   var dirPath = $('#createNewDirectoryButton').attr('path') + TSCORE.dirSeparator + $('#newDirectoryName').val();
   TSCORE.IO.createDirectoryPromise(dirPath).then(function() {
     TSPOSTIO.createDirectory(dirPath);
   }, function(error) {
     TSCORE.hideLoadingAnimation();
     console.error("Creating directory " + dirPath + " failed" + error);
     if (error) {
       TSCORE.showAlertDialog(error);
     } else {
       TSCORE.showAlertDialog("Creating " + dirPath + " failed.");
     }
   });
 });