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. | No build tools or fancy web server required. | ||||||
| 
 | 
 | ||||||
| @ -9,7 +9,7 @@ Clone and load the HTML. That's all. | |||||||
| 
 | 
 | ||||||
| ```bash | ```bash | ||||||
| npm install -g serve-https | 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 | # install oauth3 to /assets/oauth3.org | ||||||
| pushd walnut_launchpad | pushd walnut_launchpad | ||||||
| @ -18,4 +18,4 @@ bash ./install.sh | |||||||
| serve-https | 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) { | app.run(['$rootScope', '$state', 'Auth', '$location', function($rootScope, $state, Auth, $location) { | ||||||
|   $rootScope.urlCrumbs = []; |   $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) { |   $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) { | ||||||
|     var requiresLogin = toState.data.requiresLogin; |     var requiresLogin = toState.data.requiresLogin; | ||||||
|     var Crumbs = new Object(); |  | ||||||
|     Crumbs = { |     Crumbs = { | ||||||
|       absUrl: $location.$$absUrl, |       absUrl: decodeURIComponent($location.$$absUrl), | ||||||
|       url: $location.$$url, |       url: decodeURIComponent($location.$$url), | ||||||
|       path: $location.$$path, |       path: $location.$$path, | ||||||
|       params: $location.$$search, |       params: $location.$$search, | ||||||
|       toPath: toState.url, |       toPath: toState.url, | ||||||
|       fromPath: fromState.url |       fromPath: fromState.url | ||||||
|     }; |     }; | ||||||
|     $rootScope.urlCrumbs.push(Crumbs); |     $rootScope.urlCrumbs.push(Crumbs); | ||||||
|  | 
 | ||||||
|     if (requiresLogin && !Auth.isLoggedIn()) { |     if (requiresLogin && !Auth.isLoggedIn()) { | ||||||
|       event.preventDefault(); |       event.preventDefault(); | ||||||
|       $state.go('splash-page', { 'toState': toState.name }); |       $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 () { |   vm.auth = function () { | ||||||
|  |     console.log('this ran'); | ||||||
|     var subject = vm.currentSubject; |     var subject = vm.currentSubject; | ||||||
|     var issuer = vm.issuerName; |     var issuer = vm.issuerName; | ||||||
|     return vm.newOauth3.authenticate({ |     return vm.newOauth3.authenticate({ | ||||||
|  | |||||||
| @ -396,7 +396,9 @@ app.controller('websiteCtrl', [ | |||||||
|     vm.folderName = ''; |     vm.folderName = ''; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|   vm.Sites.allContents = function (r) { |   vm.Sites.allContents = function (r) { | ||||||
|  |     vm.filesInfo = []; | ||||||
|     vm.copyR = r; |     vm.copyR = r; | ||||||
|     var pkg = Auth.oauth3.pkg('www@daplie.com'); |     var pkg = Auth.oauth3.pkg('www@daplie.com'); | ||||||
|     return pkg.contents({ |     return pkg.contents({ | ||||||
| @ -415,6 +417,7 @@ app.controller('websiteCtrl', [ | |||||||
|         result.data.forEach(function(data){ |         result.data.forEach(function(data){ | ||||||
|           if (data.file) { |           if (data.file) { | ||||||
|             vm.siteFiles.push(data.name); |             vm.siteFiles.push(data.name); | ||||||
|  |             vm.filesInfo.push(data); | ||||||
|           } |           } | ||||||
|           if (data.directory) { |           if (data.directory) { | ||||||
|             vm.siteDirectories.push(data.name); |             vm.siteDirectories.push(data.name); | ||||||
| @ -434,12 +437,19 @@ app.controller('websiteCtrl', [ | |||||||
|   vm.closeFileUploadsContainers = function () { |   vm.closeFileUploadsContainers = function () { | ||||||
|     vm.uploadFolderContainer = false; |     vm.uploadFolderContainer = false; | ||||||
|     vm.uploadFileContainer = false; |     vm.uploadFileContainer = false; | ||||||
|  |     vm.folderStructure = undefined; | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   vm.Sites.fileContents = function (file, r) { |   vm.Sites.fileContents = function (file, r) { | ||||||
|     var path = vm.breadcrumbsPath; |     vm.folderStructure = undefined; | ||||||
|     path.push(file); |     var files = vm.filesInfo; | ||||||
|     path = path.join('/'); |     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); |     cleanPathQuery(path); | ||||||
|     var pkg = Auth.oauth3.pkg('www@daplie.com'); |     var pkg = Auth.oauth3.pkg('www@daplie.com'); | ||||||
|     return pkg.contentRange({ |     return pkg.contentRange({ | ||||||
| @ -448,6 +458,8 @@ app.controller('websiteCtrl', [ | |||||||
|       tld: r.tld, |       tld: r.tld, | ||||||
|       sld: r.sld, |       sld: r.sld, | ||||||
|       sub: r.sub, |       sub: r.sub, | ||||||
|  |       offset: 0, | ||||||
|  |       length: vm.selectFile.size, | ||||||
|       path: vm.cleanedPath |       path: vm.cleanedPath | ||||||
|     }).then(function (result) { |     }).then(function (result) { | ||||||
|       vm.folderStructure = result; |       vm.folderStructure = result; | ||||||
| @ -457,6 +469,7 @@ app.controller('websiteCtrl', [ | |||||||
|   vm.Sites.contents = function (r, dir) { |   vm.Sites.contents = function (r, dir) { | ||||||
|     vm.siteFiles = []; |     vm.siteFiles = []; | ||||||
|     vm.siteDirectories = []; |     vm.siteDirectories = []; | ||||||
|  |     vm.filesInfo = []; | ||||||
|     dir = dir + '/'; |     dir = dir + '/'; | ||||||
|     cleanPathQuery(dir); |     cleanPathQuery(dir); | ||||||
|     dir = vm.cleanedPath; |     dir = vm.cleanedPath; | ||||||
| @ -477,6 +490,7 @@ app.controller('websiteCtrl', [ | |||||||
|       result.data.forEach(function(data){ |       result.data.forEach(function(data){ | ||||||
|         if (data.file) { |         if (data.file) { | ||||||
|           vm.siteFiles.push(data.name); |           vm.siteFiles.push(data.name); | ||||||
|  |           vm.filesInfo.push(data); | ||||||
|         } |         } | ||||||
|         if (data.directory) { |         if (data.directory) { | ||||||
|           vm.siteDirectories.push(data.name); |           vm.siteDirectories.push(data.name); | ||||||
| @ -608,7 +622,6 @@ app.controller('websiteCtrl', [ | |||||||
|       cleanPathQuery(vm.breadcrumbsPath.join('/')); |       cleanPathQuery(vm.breadcrumbsPath.join('/')); | ||||||
|       path = vm.cleanedPath; |       path = vm.cleanedPath; | ||||||
|     } |     } | ||||||
|     debugger; |  | ||||||
|     // FIXME: Figure out how to download specific folders
 |     // FIXME: Figure out how to download specific folders
 | ||||||
|     return pkg.archive({ |     return pkg.archive({ | ||||||
|       hostname: r.domain |       hostname: r.domain | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user