Example #1
0
  function startSearch() {
    if (TSCORE.IO.stopWatchingDirectories) {
      TSCORE.IO.stopWatchingDirectories();
    }
    if ($('#searchBox').val().length > 0) {
      var origSearchVal = $('#searchBox').val(); 
      origSearchVal = origSearchVal.trim();

      if ($('#searchRecursive').prop('checked')) {
        $('#searchBox').val(origSearchVal);
      } else {
        if (origSearchVal.indexOf(TSCORE.Search.recursiveSymbol) === 0) {
          $('#searchBox').val(origSearchVal);
        } else {
          //origSearchVal = origSearchVal.substring(1, origSearchVal.length);
          $('#searchBox').val(TSCORE.Search.recursiveSymbol + " " + origSearchVal);
        }
      }

      if (TSCORE.PRO && TSCORE.PRO.Search) {
        TSCORE.PRO.Search.addQueryToHistory(origSearchVal);
      }
      TSCORE.Search.nextQuery = $('#searchBox').val();
    }
    $('#searchOptions').hide();
    TSCORE.PerspectiveManager.redrawCurrentPerspective();
  }
Example #2
0
 $('#copyFilesButton').click(function(e) {
   e.preventDefault();
   TSCORE.showWaitingDialog('Please wait, while files are being copied.');
   var newFilePath, filePath;
   var fileOperations = [];
   for (var i = 0; i < TSCORE.selectedFiles.length; i++) {
     var newFilePath = $('#moveCopyDirectoryPath').val() + TSCORE.dirSeparator + TSCORE.TagUtils.extractFileName(TSCORE.selectedFiles[i]);
     var filePath = TSCORE.selectedFiles[i];
     fileOperations.push(TSCORE.IO.copyFilePromise(filePath, newFilePath));
   }
   if (TSCORE.IO.stopWatchingDirectories) {
     TSCORE.IO.stopWatchingDirectories();
   }
   Promise.all(fileOperations).then(function(success) {
     // TODO handle copying sidecar files
     TSCORE.hideWaitingDialog();
     TSCORE.navigateToDirectory(TSCORE.currentPath);
     TSCORE.showSuccessDialog("Files successfully copied");
   }, function(err) {
     TSCORE.hideWaitingDialog();
     TSCORE.showAlertDialog("Copying files failed");
   });
 });
Example #3
0
 function() {
   if (TSCORE.IO.stopWatchingDirectories) {
     TSCORE.IO.stopWatchingDirectories();
   }
   TSCORE.IOUtils.deleteFiles(TSCORE.Utils.getUniqueSelectedFiles());
 }