Compare commits

...

7 Commits

Author SHA1 Message Date
AJ ONeal 8dccc8218f update urls 2018-05-17 03:00:59 -06:00
Jon Lambson c5c7b0d713 remove debugger 2017-11-13 15:04:23 -07:00
Jon Lambson 27f7b25677 fixed for logged in users 2017-11-13 14:55:01 -07:00
Jon Lambson a3cb728afd fixing path weirdness 2017-11-13 14:27:18 -07:00
Jon Lambson 77a97ddcfc console.logs 2017-11-13 12:11:24 -07:00
Jon Lambson e703b8743c added
;
2017-11-13 11:21:33 -07:00
Jon Lambson 0dce885778 adding more info to contentRange params 2017-11-08 15:11:35 -07:00
4 changed files with 40 additions and 11 deletions

View File

@ -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>

View File

@ -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);
}
});
}]);

View File

@ -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({

View File

@ -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