Compare commits
	
		
			7 Commits
		
	
	
		
			master
			...
			jon/upload
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 8dccc8218f | ||
|  | c5c7b0d713 | ||
|  | 27f7b25677 | ||
|  | a3cb728afd | ||
|  | 77a97ddcfc | ||
|  | e703b8743c | ||
|  | 0dce885778 | 
| @ -1,7 +1,7 @@ | ||||
| Daplie Web App | ||||
| OAuth3 Web App | ||||
| -------------- | ||||
| 
 | ||||
| Prototype Daplie Web App. | ||||
| Prototype OAuth3 Web App. | ||||
| 
 | ||||
| No build tools or fancy web server required. | ||||
| 
 | ||||
| @ -9,7 +9,7 @@ Clone and load the HTML. That's all. | ||||
| 
 | ||||
| ```bash | ||||
| npm install -g serve-https | ||||
| git clone git@git.daplie.com:Daplie/walnut_launchpad.git | ||||
| git clone git@git.coolaj86.com:coolaj86/walnut_launchpad.html.git | ||||
| 
 | ||||
| # install oauth3 to /assets/oauth3.org | ||||
| pushd walnut_launchpad | ||||
| @ -18,4 +18,4 @@ bash ./install.sh | ||||
| serve-https | ||||
| ``` | ||||
| 
 | ||||
| <https://localhost.daplie.me:8443> | ||||
| <https://localhost.example.com:8443> | ||||
|  | ||||
							
								
								
									
										21
									
								
								js/app.js
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								js/app.js
									
									
									
									
									
								
							| @ -156,21 +156,36 @@ app.config([ | ||||
| 
 | ||||
| app.run(['$rootScope', '$state', 'Auth', '$location', function($rootScope, $state, Auth, $location) { | ||||
|   $rootScope.urlCrumbs = []; | ||||
|   var Crumbs = new Object(); | ||||
|   var param; | ||||
|   Crumbs = { | ||||
|     absUrl: decodeURIComponent($location.$$absUrl), | ||||
|     url: decodeURIComponent($location.$$url), | ||||
|     path: $location.$$path, | ||||
|     params: $location.$$search, | ||||
|   }; | ||||
|   if (Crumbs.url.includes('%')) { | ||||
|     param = $location.$$path; | ||||
|   } | ||||
|   $rootScope.urlCrumbs.push(Crumbs); | ||||
| 
 | ||||
|   $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) { | ||||
|     var requiresLogin = toState.data.requiresLogin; | ||||
|     var Crumbs = new Object(); | ||||
|     Crumbs = { | ||||
|       absUrl: $location.$$absUrl, | ||||
|       url: $location.$$url, | ||||
|       absUrl: decodeURIComponent($location.$$absUrl), | ||||
|       url: decodeURIComponent($location.$$url), | ||||
|       path: $location.$$path, | ||||
|       params: $location.$$search, | ||||
|       toPath: toState.url, | ||||
|       fromPath: fromState.url | ||||
|     }; | ||||
|     $rootScope.urlCrumbs.push(Crumbs); | ||||
| 
 | ||||
|     if (requiresLogin && !Auth.isLoggedIn()) { | ||||
|       event.preventDefault(); | ||||
|       $state.go('splash-page', { 'toState': toState.name }); | ||||
|     } else { | ||||
|       window.location.replace($rootScope.urlCrumbs[0].absUrl); | ||||
|     } | ||||
|   }); | ||||
| }]); | ||||
|  | ||||
| @ -126,6 +126,7 @@ app.controller('loginCtrl', [ | ||||
|   }; | ||||
| 
 | ||||
|   vm.auth = function () { | ||||
|     console.log('this ran'); | ||||
|     var subject = vm.currentSubject; | ||||
|     var issuer = vm.issuerName; | ||||
|     return vm.newOauth3.authenticate({ | ||||
|  | ||||
| @ -396,7 +396,9 @@ app.controller('websiteCtrl', [ | ||||
|     vm.folderName = ''; | ||||
|   }; | ||||
| 
 | ||||
| 
 | ||||
|   vm.Sites.allContents = function (r) { | ||||
|     vm.filesInfo = []; | ||||
|     vm.copyR = r; | ||||
|     var pkg = Auth.oauth3.pkg('www@daplie.com'); | ||||
|     return pkg.contents({ | ||||
| @ -415,6 +417,7 @@ app.controller('websiteCtrl', [ | ||||
|         result.data.forEach(function(data){ | ||||
|           if (data.file) { | ||||
|             vm.siteFiles.push(data.name); | ||||
|             vm.filesInfo.push(data); | ||||
|           } | ||||
|           if (data.directory) { | ||||
|             vm.siteDirectories.push(data.name); | ||||
| @ -434,12 +437,19 @@ app.controller('websiteCtrl', [ | ||||
|   vm.closeFileUploadsContainers = function () { | ||||
|     vm.uploadFolderContainer = false; | ||||
|     vm.uploadFileContainer = false; | ||||
|     vm.folderStructure = undefined; | ||||
|   }; | ||||
| 
 | ||||
|   vm.Sites.fileContents = function (file, r) { | ||||
|     var path = vm.breadcrumbsPath; | ||||
|     path.push(file); | ||||
|     path = path.join('/'); | ||||
|     vm.folderStructure = undefined; | ||||
|     var files = vm.filesInfo; | ||||
|     Object.keys(files).forEach(function (key) { | ||||
|       if (files[key]['name'] === file) { | ||||
|         vm.selectFile = files[key]; | ||||
|       } | ||||
|     }); | ||||
|     var path = vm.breadcrumbsPath.join('/'); | ||||
|     path = path + '/' + file | ||||
|     cleanPathQuery(path); | ||||
|     var pkg = Auth.oauth3.pkg('www@daplie.com'); | ||||
|     return pkg.contentRange({ | ||||
| @ -448,6 +458,8 @@ app.controller('websiteCtrl', [ | ||||
|       tld: r.tld, | ||||
|       sld: r.sld, | ||||
|       sub: r.sub, | ||||
|       offset: 0, | ||||
|       length: vm.selectFile.size, | ||||
|       path: vm.cleanedPath | ||||
|     }).then(function (result) { | ||||
|       vm.folderStructure = result; | ||||
| @ -457,6 +469,7 @@ app.controller('websiteCtrl', [ | ||||
|   vm.Sites.contents = function (r, dir) { | ||||
|     vm.siteFiles = []; | ||||
|     vm.siteDirectories = []; | ||||
|     vm.filesInfo = []; | ||||
|     dir = dir + '/'; | ||||
|     cleanPathQuery(dir); | ||||
|     dir = vm.cleanedPath; | ||||
| @ -477,6 +490,7 @@ app.controller('websiteCtrl', [ | ||||
|       result.data.forEach(function(data){ | ||||
|         if (data.file) { | ||||
|           vm.siteFiles.push(data.name); | ||||
|           vm.filesInfo.push(data); | ||||
|         } | ||||
|         if (data.directory) { | ||||
|           vm.siteDirectories.push(data.name); | ||||
| @ -608,7 +622,6 @@ app.controller('websiteCtrl', [ | ||||
|       cleanPathQuery(vm.breadcrumbsPath.join('/')); | ||||
|       path = vm.cleanedPath; | ||||
|     } | ||||
|     debugger; | ||||
|     // FIXME: Figure out how to download specific folders
 | ||||
|     return pkg.archive({ | ||||
|       hostname: r.domain | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user