added a download btn which doesnt work
This commit is contained in:
		
							parent
							
								
									d97c6ab369
								
							
						
					
					
						commit
						132c4e9f35
					
				@ -249,8 +249,6 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
      var path = vm.breadcrumbsPath.join('/');
 | 
					      var path = vm.breadcrumbsPath.join('/');
 | 
				
			||||||
      cleanPathQuery(path);
 | 
					      cleanPathQuery(path);
 | 
				
			||||||
      vm.Sites.contents(vm.copyR, vm.cleanedPath);
 | 
					      vm.Sites.contents(vm.copyR, vm.cleanedPath);
 | 
				
			||||||
    }, function (err) {
 | 
					 | 
				
			||||||
      console.log(err);
 | 
					 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -363,6 +361,7 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
      r.newFile = vm.newFile;
 | 
					      r.newFile = vm.newFile;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    analyzeFile(r.newFile, r);
 | 
					    analyzeFile(r.newFile, r);
 | 
				
			||||||
 | 
					    debugger;
 | 
				
			||||||
    console.log(r);
 | 
					    console.log(r);
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -528,6 +527,7 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    var pkg = Auth.oauth3.pkg('www@daplie.com');
 | 
					    var pkg = Auth.oauth3.pkg('www@daplie.com');
 | 
				
			||||||
 | 
					    var removedPath = opts.path;
 | 
				
			||||||
    return pkg.remove({
 | 
					    return pkg.remove({
 | 
				
			||||||
      hostname: r.domain
 | 
					      hostname: r.domain
 | 
				
			||||||
    , domain: r.domain
 | 
					    , domain: r.domain
 | 
				
			||||||
@ -545,18 +545,27 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
        cleanPathQuery(vm.breadcrumbsPath.join('/'));
 | 
					        cleanPathQuery(vm.breadcrumbsPath.join('/'));
 | 
				
			||||||
        vm.Sites.contents(vm.copyR, vm.cleanedPath);
 | 
					        vm.Sites.contents(vm.copyR, vm.cleanedPath);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					      var msg = 'Successfully deleted ' + "'" + removedPath + "'.";
 | 
				
			||||||
 | 
					      vm.buildNotification(result, msg);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  vm.Sites.archive = function (r) {
 | 
					  vm.Sites.archive = function (r) {
 | 
				
			||||||
    var pkg = Auth.oauth3.pkg('www@daplie.com');
 | 
					    var pkg = Auth.oauth3.pkg('www@daplie.com');
 | 
				
			||||||
 | 
					    var path;
 | 
				
			||||||
 | 
					    if (vm.breadcrumbsPath === undefined && vm.breadcrumbs === undefined) {
 | 
				
			||||||
 | 
					      path = r.shareAccess.path;
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      cleanPathQuery(vm.breadcrumbsPath.join('/'));
 | 
				
			||||||
 | 
					      path = vm.cleanedPath;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    return pkg.archive({
 | 
					    return pkg.archive({
 | 
				
			||||||
      hostname: r.domain
 | 
					      hostname: r.domain
 | 
				
			||||||
    , domain: r.domain
 | 
					    , domain: r.domain
 | 
				
			||||||
    , tld: r.tld
 | 
					    , tld: r.tld
 | 
				
			||||||
    , sld: r.sld
 | 
					    , sld: r.sld
 | 
				
			||||||
    // , sub: vm.record.sub
 | 
					    // , sub: vm.record.sub
 | 
				
			||||||
    //, path: vm.uploadPath
 | 
					    , path: r.domain + path
 | 
				
			||||||
    }).then(function (result) {
 | 
					    }).then(function (result) {
 | 
				
			||||||
      window.alert(JSON.stringify(result));
 | 
					      window.alert(JSON.stringify(result));
 | 
				
			||||||
      // TODO use iframe to initiate download?
 | 
					      // TODO use iframe to initiate download?
 | 
				
			||||||
 | 
				
			|||||||
@ -240,7 +240,7 @@
 | 
				
			|||||||
                    <p><b>Invite:</b> <em ng-if="share.pending" class="text-muted">pending</em> <span ng-if="!share.pending" class="text-muted">Accepted</span></p>
 | 
					                    <p><b>Invite:</b> <em ng-if="share.pending" class="text-muted">pending</em> <span ng-if="!share.pending" class="text-muted">Accepted</span></p>
 | 
				
			||||||
                  </div>
 | 
					                  </div>
 | 
				
			||||||
                  <div class="media-right align-self-center">
 | 
					                  <div class="media-right align-self-center">
 | 
				
			||||||
                    <button class="btn btn-danger" ng-click="vm.Shares.remove(r, share)">Remove Access</button>
 | 
					                    <button ng-if="r.shareAccess.invite" class="btn btn-danger" ng-click="vm.Shares.remove(r, share)">Remove Access</button>
 | 
				
			||||||
                  </div>
 | 
					                  </div>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
              </li>
 | 
					              </li>
 | 
				
			||||||
 | 
				
			|||||||
@ -26,10 +26,11 @@
 | 
				
			|||||||
        <hr>
 | 
					        <hr>
 | 
				
			||||||
        <div>
 | 
					        <div>
 | 
				
			||||||
          <button ng-if="r.shareAccess.invite" type="button" name="button" class="btn btn-block btn-primary" ng-click="vm.showAction('invite');">Share folder</button>
 | 
					          <button ng-if="r.shareAccess.invite" type="button" name="button" class="btn btn-block btn-primary" ng-click="vm.showAction('invite');">Share folder</button>
 | 
				
			||||||
 | 
					          <button type="button" name="button" class="btn btn-block btn-primary" ng-click="vm.Sites.archive(r)">Download folder</button>
 | 
				
			||||||
          <ul class="ls-none folder-actions-list">
 | 
					          <ul class="ls-none folder-actions-list">
 | 
				
			||||||
            <li ng-if="r.shareAccess.write"><span><i class="fa fa-upload cp"></i> <a ng-click="vm.autoPopulateFolderName(); vm.uploadFileContainer = true; vm.uploadFolderContainer = false; vm.cleanUploads(r);" class="cp">Upload files</a></span></li>
 | 
					            <li ng-if="r.shareAccess.write"><span><i class="fa fa-upload cp"></i> <a ng-click="vm.autoPopulateFolderName(); vm.uploadFileContainer = true; vm.uploadFolderContainer = false; vm.cleanUploads(r);" class="cp">Upload files</a></span></li>
 | 
				
			||||||
            <li ng-if="r.shareAccess.write"><span><i class="fa fa-folder cp"></i> <a ng-click="vm.uploadFolderContainer = true; vm.uploadFileContainer = false; vm.cleanUploads(r);" class="cp">New folder</a></span></li>
 | 
					            <li ng-if="r.shareAccess.write"><span><i class="fa fa-folder cp"></i> <a ng-click="vm.uploadFolderContainer = true; vm.uploadFileContainer = false; vm.cleanUploads(r);" class="cp">New folder</a></span></li>
 | 
				
			||||||
            <li ng-if="r.shareAccess.write"><span><i class="fa fa-trash cp"></i> <a ng-click="vm.triggerDeleteFolder(vm.currentFolder, r); vm.cleanUploads(r);" data="{{ vm.currentFolder }}" class="cp">Delete {{ vm.currentFolder | capitalize }} Folder</a></span></li>
 | 
					            <li ng-if="r.shareAccess.write"><span><i class="fa fa-trash cp"></i> <a ng-click="vm.triggerDeleteFolder(vm.currentFolder, r); vm.cleanUploads(r);" data="{{ vm.currentFolder }}" class="cp">Delete {{ vm.currentFolder | capitalize }} folder</a></span></li>
 | 
				
			||||||
          </ul>
 | 
					          </ul>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user