Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d57c66492 | ||
|
|
1503056c65 | ||
|
|
df5819ee32 | ||
|
|
76d9d51e5a | ||
|
|
e06188d9c2 | ||
|
|
39b9dae216 | ||
|
|
655b3117b7 | ||
|
|
67c4e8663f | ||
|
|
057de03068 | ||
|
|
3bcc504ab2 | ||
|
|
d0ea91c0bb | ||
|
|
ab43fefc49 | ||
|
|
8d4337d091 | ||
|
|
a47b7ac969 | ||
|
|
574857233d | ||
|
|
4e0545036d | ||
|
|
efa628b099 | ||
|
|
132c4e9f35 | ||
|
|
4e5028dc0f | ||
|
|
d97c6ab369 | ||
|
|
b897d8275a | ||
|
|
e9d0ce0846 | ||
|
|
8f987882d2 | ||
|
|
9368a25fd2 | ||
|
|
b97bf25788 |
0
.gitmodules
vendored
Normal file
0
.gitmodules
vendored
Normal 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>
|
||||
|
||||
@ -1 +0,0 @@
|
||||
Subproject commit db284fbf911dc4f9d0cb99bb512d9663dcfd0ece
|
||||
@ -759,3 +759,37 @@ multiselect .dropdown-menu > li > a {
|
||||
width: 350px;
|
||||
height: 350px;
|
||||
}
|
||||
.referrer-modal div {
|
||||
position: relative;
|
||||
background-color: #3D3D3D;
|
||||
max-width: 600px;
|
||||
min-width: 150px;
|
||||
padding: 15px;
|
||||
text-align: center;
|
||||
margin: 50px auto 0 auto;
|
||||
border-radius: 5px;
|
||||
z-index: 9999;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 0 5px 1px grey;
|
||||
}
|
||||
|
||||
.referrer-modal div::before {
|
||||
content: '';
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.referrer-modal h4 {
|
||||
font-family: 'Montserrat', Verdana, Sans-Serif;
|
||||
color: coral;
|
||||
}
|
||||
|
||||
.referrer-modal p {
|
||||
font-family: 'Source Sans Pro', Verdana, Sans-Serif;
|
||||
color: white;
|
||||
}
|
||||
|
||||
30
js/app.js
30
js/app.js
@ -155,31 +155,23 @@ app.config([
|
||||
}]);
|
||||
|
||||
app.run(['$rootScope', '$state', 'Auth', '$location', function($rootScope, $state, Auth, $location) {
|
||||
$rootScope.urlArray = [];
|
||||
$rootScope.urlInfo = {
|
||||
url: $location.$$url,
|
||||
path: $location.$$path,
|
||||
params: $location.$$search
|
||||
};
|
||||
$rootScope.urlCrumbs = [];
|
||||
$rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) {
|
||||
var requiresLogin = toState.data.requiresLogin;
|
||||
toState.data.session = $location.search();
|
||||
$rootScope.redirectedURL = toState.url;
|
||||
var query = $location.search();
|
||||
$rootScope.urlArray.push($rootScope.redirectedURL);
|
||||
|
||||
var Crumbs = new Object();
|
||||
Crumbs = {
|
||||
absUrl: $location.$$absUrl,
|
||||
url: $location.$$url,
|
||||
path: $location.$$path,
|
||||
params: $location.$$search,
|
||||
toPath: toState.url,
|
||||
fromPath: fromState.url
|
||||
};
|
||||
$rootScope.urlCrumbs.push(Crumbs);
|
||||
if (requiresLogin && !Auth.isLoggedIn()) {
|
||||
event.preventDefault();
|
||||
if (!angular.equals(toState.data.session, {})) {
|
||||
toState.data.session.token = OAUTH3.jwt.decode(query.access_token);
|
||||
toState.data.session.refresh = OAUTH3.jwt.decode(query.refresh_token);
|
||||
Auth.add(query);
|
||||
$state.go('app.' + $rootScope.redirectedURL);
|
||||
} else {
|
||||
$state.go('splash-page', { 'toState': toState.name });
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}]);
|
||||
}());
|
||||
|
||||
@ -1,3 +1,10 @@
|
||||
app.directive('referrerNotification', [function () {
|
||||
return {
|
||||
restrict: 'EA',
|
||||
templateUrl: '/templates/widgets/referrer.html',
|
||||
};
|
||||
}]);
|
||||
|
||||
app.controller('loginCtrl', [
|
||||
'$scope', '$timeout', 'Auth', '$location', 'localStorageService', '$rootScope', 'azp@oauth3.org', '$stateParams'
|
||||
, function ($scope, $timeout, Auth, $location, localStorageService, $rootScope, Oauth3, $stateParams) {
|
||||
@ -16,6 +23,29 @@ app.controller('loginCtrl', [
|
||||
|
||||
vm.showAdvanced = true;
|
||||
|
||||
vm.hideReferrerNotification = 'hidden';
|
||||
vm.referrerInit = function () {
|
||||
vm.referrerAlert = {};
|
||||
if ($location.hash() !== '') {
|
||||
var str = $location.hash();
|
||||
var domain = str.split('=')[1];
|
||||
vm.referrerAlert.title = domain + " has been created. What's next?";
|
||||
vm.referrerAlert.msg = "Do this next... Or do this... Or this...";
|
||||
if (str.indexOf('referrer') === 0) {
|
||||
vm.hideReferrerNotification = '';
|
||||
vm.closeReferrerModal = function () {
|
||||
var popup = document.querySelector('.referrer-pop-up');
|
||||
popup.style.display = 'none';
|
||||
$location.url($location.path());
|
||||
};
|
||||
vm.sendToShares = function (){
|
||||
$location.path('/website');
|
||||
vm.hideReferrerNotification = 'hidden';
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
vm.toggleAdvanced = function () {
|
||||
vm.showAdvanced = !vm.showAdvanced;
|
||||
vm.independentIssuer = !vm.independentIssuer;
|
||||
@ -105,12 +135,15 @@ app.controller('loginCtrl', [
|
||||
session.subject = subject;
|
||||
session.issuer = issuer;
|
||||
Auth.add(session);
|
||||
if ($rootScope.redirectedURL === '/splash-page') {
|
||||
debugger;
|
||||
if (Auth.sessions.length === 1) {
|
||||
if ($rootScope.urlCrumbs[0].path === '/splash-page') {
|
||||
$location.path('/home');
|
||||
} else {
|
||||
debugger;
|
||||
$location.path('/' + $rootScope.redirectedURL);
|
||||
window.location.replace($rootScope.urlCrumbs[0].absUrl);
|
||||
}
|
||||
} else {
|
||||
location.reload();
|
||||
// window.location.replace($rootScope.urlCrumbs[$rootScope.urlCrumbs.length -1].absUrl);
|
||||
}
|
||||
}, function (err) {
|
||||
console.error('auth error');
|
||||
|
||||
@ -66,8 +66,8 @@ app.directive('notificationBar', [function () {
|
||||
}]);
|
||||
|
||||
app.controller('websiteCtrl', [
|
||||
'$scope', '$q', 'Auth', 'azp@oauth3.org', '$timeout', '$sce', '$rootScope',
|
||||
function ($scope, $q, Auth, Oauth3, $timeout, $sce, $rootScope) {
|
||||
'$scope', '$q', 'Auth', 'azp@oauth3.org', '$timeout', '$sce', '$rootScope', '$location',
|
||||
function ($scope, $q, Auth, Oauth3, $timeout, $sce, $rootScope, $location) {
|
||||
|
||||
var vm = this;
|
||||
var angular = window.angular;
|
||||
@ -75,6 +75,7 @@ app.controller('websiteCtrl', [
|
||||
vm.copyUploadPath = '';
|
||||
vm.displaySpinner = '';
|
||||
vm.deleteAll = '';
|
||||
vm.referrerSelectedDomain = false;
|
||||
vm.alertNotification = {
|
||||
hidden: 'hidden'
|
||||
};
|
||||
@ -175,31 +176,47 @@ app.controller('websiteCtrl', [
|
||||
});
|
||||
};
|
||||
|
||||
vm.setRecordDomain = function(domain) {
|
||||
vm.domain.sub = vm.newRecord || '';
|
||||
if (vm.record !== undefined) {
|
||||
domain.title = vm.record.host;
|
||||
domain.description.domain = vm.record.host;
|
||||
domain.originalObject.domain = vm.record.host;
|
||||
}
|
||||
};
|
||||
|
||||
vm.setRecord = function () {
|
||||
// TODO set record based on (record.host === sub + domain.domain)
|
||||
var sub = vm.newRecord;
|
||||
|
||||
if ('@' === sub) {
|
||||
if ('@' === sub || sub === undefined) {
|
||||
sub = '';
|
||||
}
|
||||
vm.record = { sub: sub, host: (sub ? sub + '.' : '') + vm.domain.domain };
|
||||
vm.currentHost = vm.record.host;
|
||||
|
||||
console.log('[setRecord] vm.record:');
|
||||
console.log(vm.record);
|
||||
};
|
||||
|
||||
vm.shareInit = function () {
|
||||
if ($rootScope.urlInfo.params.token !== undefined) {
|
||||
console.log('FISH STICKS', $rootScope.urlInfo);
|
||||
vm.paramInit = function () {
|
||||
// Share example -> ?token=fe8386d7ad6273bd9ca29864148c0d2d©
|
||||
if ($rootScope.urlCrumbs[$rootScope.urlCrumbs.length -1].params.token !== undefined) {
|
||||
vm.Shares.inviteToken = $rootScope.urlCrumbs[$rootScope.urlCrumbs.length -1].params.token;
|
||||
var result = { data: { info: true } };
|
||||
var msg = "You can only view inside the ";
|
||||
var msg = "You have a new share.";
|
||||
vm.buildNotification(result, msg);
|
||||
// debugger;
|
||||
}
|
||||
// Referrer example -> #referrer=daplieeleven.daplie.me
|
||||
vm.referrerSelectedDomainName = $location.url().split('=')[1];
|
||||
if ($location.url().includes('referrer')) {
|
||||
$timeout(function() {
|
||||
var el = document.querySelector('.create-share-btn');
|
||||
el.click();
|
||||
vm.referrerSelectedDomain = true;
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
vm.selectRecord = function (record) {
|
||||
vm.record = record;
|
||||
vm.newRecord = record.sub;
|
||||
@ -225,7 +242,7 @@ app.controller('websiteCtrl', [
|
||||
, domain: opts.domain
|
||||
, tld: opts.tld
|
||||
, sld: opts.sld
|
||||
//, sub: opts.record.sub
|
||||
, sub: opts.sub
|
||||
, multipart: { site: opts.newFile }
|
||||
, progress: function (ev) {
|
||||
// TODO must digest
|
||||
@ -246,12 +263,15 @@ app.controller('websiteCtrl', [
|
||||
vm.uploadFileContainer = false;
|
||||
}
|
||||
vm.buildNotification(result, msg);
|
||||
if (vm.copyR !== undefined) {
|
||||
vm.cleanArrays();
|
||||
var path = vm.breadcrumbsPath.join('/');
|
||||
cleanPathQuery(path);
|
||||
vm.Sites.contents(vm.copyR, vm.cleanedPath);
|
||||
}, function (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
$location.url($location.path());
|
||||
vm.listSites();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@ -282,8 +302,7 @@ app.controller('websiteCtrl', [
|
||||
return;
|
||||
}
|
||||
if (!vm.currentHost) {
|
||||
window.alert('No hostname chosen.');
|
||||
return;
|
||||
vm.setRecord();
|
||||
}
|
||||
|
||||
if (vm.domain) {
|
||||
@ -294,6 +313,7 @@ app.controller('websiteCtrl', [
|
||||
} else {
|
||||
sld = vm.domain.sld;
|
||||
tld = vm.domain.tld;
|
||||
sub = vm.domain.sub;
|
||||
}
|
||||
} else {
|
||||
parts = vm.currentHost.split('.');
|
||||
@ -314,11 +334,12 @@ app.controller('websiteCtrl', [
|
||||
// (because two users could both claim a single domain)
|
||||
// We're claiming it at the top level (i.e. example.com)
|
||||
// but we could also claim it at the subdomain level (needs UI update)
|
||||
var domainReq = { sld: sld, tld: tld, sub: undefined };
|
||||
var domainReq = { sld: sld, tld: tld, sub: sub };
|
||||
return pkg.request(domainReq).then(function (result) {
|
||||
var sess;
|
||||
var prom;
|
||||
var def;
|
||||
var sub;
|
||||
|
||||
// can validate automatically
|
||||
if (vm.domain.session && vm._isSubDomain(vm.currentHost, vm.domain.domain)) {
|
||||
@ -332,7 +353,11 @@ app.controller('websiteCtrl', [
|
||||
|
||||
if (sess) {
|
||||
prom = Auth.get(sess).then(function (oauth3) {
|
||||
return oauth3.api('dns.set', { sld: sld, tld: tld, sub: ('' + result.data.prefix), type: 'TXT', ttl: 300, value: result.data.challenge });
|
||||
sub = result.data.prefix;
|
||||
if (result.data.sub) {
|
||||
sub += '.' + result.data.sub;
|
||||
}
|
||||
return oauth3.api('dns.set', { sld: sld, tld: tld, sub: sub, type: 'TXT', ttl: 5, value: result.data.challenge });
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -379,9 +404,12 @@ app.controller('websiteCtrl', [
|
||||
, domain: r.domain
|
||||
, tld: r.tld
|
||||
, sld: r.sld
|
||||
//, sub: r.sub
|
||||
, sub: r.sub
|
||||
, path: r.shareAccess.path
|
||||
}).then(function (result) {
|
||||
if (result.data.error) {
|
||||
vm.folderStructure = result;
|
||||
} else {
|
||||
vm.cleanArrays();
|
||||
vm.folderStructure = result;
|
||||
result.data.forEach(function(data){
|
||||
@ -392,6 +420,7 @@ app.controller('websiteCtrl', [
|
||||
vm.siteDirectories.push(data.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
vm.displaySpinner = 'hidden';
|
||||
vm.currentFolder = vm.breadcrumbs[vm.breadcrumbs.length - 1];
|
||||
});
|
||||
@ -407,6 +436,24 @@ app.controller('websiteCtrl', [
|
||||
vm.uploadFileContainer = false;
|
||||
};
|
||||
|
||||
vm.Sites.fileContents = function (file, r) {
|
||||
var path = vm.breadcrumbsPath;
|
||||
path.push(file);
|
||||
path = path.join('/');
|
||||
cleanPathQuery(path);
|
||||
var pkg = Auth.oauth3.pkg('www@daplie.com');
|
||||
return pkg.contentRange({
|
||||
hostname: r.domain,
|
||||
domain: r.domain,
|
||||
tld: r.tld,
|
||||
sld: r.sld,
|
||||
sub: r.sub,
|
||||
path: vm.cleanedPath
|
||||
}).then(function (result) {
|
||||
vm.folderStructure = result;
|
||||
});
|
||||
};
|
||||
|
||||
vm.Sites.contents = function (r, dir) {
|
||||
vm.siteFiles = [];
|
||||
vm.siteDirectories = [];
|
||||
@ -421,7 +468,7 @@ app.controller('websiteCtrl', [
|
||||
domain: r.domain,
|
||||
tld: r.tld,
|
||||
sld: r.sld,
|
||||
// sub: r.sub,
|
||||
sub: r.sub,
|
||||
path: dir
|
||||
}).then(function (result) {
|
||||
vm.cleanArrays();
|
||||
@ -529,12 +576,13 @@ app.controller('websiteCtrl', [
|
||||
return;
|
||||
}
|
||||
var pkg = Auth.oauth3.pkg('www@daplie.com');
|
||||
var removedPath = opts.path;
|
||||
return pkg.remove({
|
||||
hostname: r.domain
|
||||
, domain: r.domain
|
||||
, tld: r.tld
|
||||
, sld: r.sld
|
||||
//, sub: vm.record.sub
|
||||
, sub: r.sub
|
||||
, path: opts.path || r.path
|
||||
, confirm: opts.confirm || r.confirm
|
||||
}).then(function (result) {
|
||||
@ -546,18 +594,29 @@ app.controller('websiteCtrl', [
|
||||
cleanPathQuery(vm.breadcrumbsPath.join('/'));
|
||||
vm.Sites.contents(vm.copyR, vm.cleanedPath);
|
||||
}
|
||||
var msg = 'Successfully deleted ' + "'" + removedPath + "'.";
|
||||
vm.buildNotification(result, msg);
|
||||
});
|
||||
};
|
||||
|
||||
vm.Sites.archive = function (r) {
|
||||
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;
|
||||
}
|
||||
debugger;
|
||||
// FIXME: Figure out how to download specific folders
|
||||
return pkg.archive({
|
||||
hostname: r.domain
|
||||
, domain: r.domain
|
||||
, tld: r.tld
|
||||
, sld: r.sld
|
||||
//, sub: vm.record.sub
|
||||
//, path: vm.uploadPath
|
||||
, sub: r.sub
|
||||
, path: path
|
||||
}).then(function (result) {
|
||||
window.alert(JSON.stringify(result));
|
||||
// TODO use iframe to initiate download?
|
||||
@ -567,7 +626,9 @@ app.controller('websiteCtrl', [
|
||||
|
||||
vm.shareFolderFrom = function (r, opts) {
|
||||
var sharePath;
|
||||
if (vm.breadcrumbsPath.join('/') === '' && vm.breadcrumbs.join('/') === '') {
|
||||
if (vm.breadcrumbsPath === undefined && vm.breadcrumbs === undefined) {
|
||||
sharePath = '/';
|
||||
} else if (vm.breadcrumbsPath.join('/') === '' && vm.breadcrumbs.join('/') === '') {
|
||||
sharePath = '/';
|
||||
} else {
|
||||
sharePath = cleanPathQuery(vm.breadcrumbsPath.join('/'));
|
||||
@ -602,14 +663,17 @@ app.controller('websiteCtrl', [
|
||||
, domain: r.domain
|
||||
, tld: r.tld
|
||||
, sld: r.sld
|
||||
//, sub: r.sub
|
||||
, sub: r.sub
|
||||
, path: opts.sharePath || r.sharePath
|
||||
, mode: opts.shareMode || r.shareMode
|
||||
}).then(function (result) {
|
||||
var arr = r.sharedWith || [];
|
||||
arr.push(result.data);
|
||||
r.sharedWith = arr;
|
||||
window.alert(JSON.stringify(result.data));
|
||||
var path = result.data.path;
|
||||
var person = result.data.comment;
|
||||
var msg = "You have shared " + "'" + path + "'" + ' with ' + person + ".";
|
||||
vm.buildNotification(result, msg);
|
||||
});
|
||||
};
|
||||
|
||||
@ -618,8 +682,23 @@ app.controller('websiteCtrl', [
|
||||
return pkg.acceptInvite({
|
||||
token: vm.Shares.inviteToken
|
||||
}).then(function (result) {
|
||||
window.alert(JSON.stringify(result));
|
||||
if (result.data.error) {
|
||||
var msg = result.data.error.message + '.';
|
||||
vm.buildNotification(result, msg);
|
||||
} else {
|
||||
var person = result.data.comment;
|
||||
var path = result.data.path;
|
||||
var shareMode = result.data.mode;
|
||||
var domain = result.data.domain;
|
||||
var msg = 'You accepted a share ' + "'" + domain + "'" + ' from ' + person + '. Take a look at your verified websites below.';
|
||||
vm.buildNotification(result, msg);
|
||||
vm.listSites();
|
||||
}
|
||||
if ($location.$$search.token) {
|
||||
delete $location.$$search.token;
|
||||
vm.Shares.inviteToken = '';
|
||||
$location.$$compose();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@ -630,7 +709,7 @@ app.controller('websiteCtrl', [
|
||||
, hostname: r.domain
|
||||
, tld: r.tld
|
||||
, sld: r.sld
|
||||
//, sub: r.sub
|
||||
, sub: r.sub
|
||||
, path: r.sharePath
|
||||
}).then(function (result) {
|
||||
vm.displaySpinner = 'hidden';
|
||||
@ -645,18 +724,18 @@ app.controller('websiteCtrl', [
|
||||
if (!window.confirm("Delete this site?")) {
|
||||
return;
|
||||
}
|
||||
s.sharePath = '/';
|
||||
vm.Shares.remove(r, s);
|
||||
};
|
||||
|
||||
vm.Shares.remove = function (r, s) {
|
||||
console.log('Shares.remove');
|
||||
var pkg = Auth.oauth3.pkg('www@daplie.com');
|
||||
return pkg.removeShare({
|
||||
domain: s.domain
|
||||
, hostname: s.domain
|
||||
, tld: s.tld
|
||||
, sld: s.sld
|
||||
//, sub: r.sub
|
||||
, sub: r.sub
|
||||
, path: s.sharePath
|
||||
, challenge: s.challenge
|
||||
}).then(function (result) {
|
||||
@ -667,6 +746,7 @@ app.controller('websiteCtrl', [
|
||||
console.log(result);
|
||||
var index;
|
||||
|
||||
if (r.sharedWith !== undefined) {
|
||||
r.sharedWith.forEach(function (_s, i) {
|
||||
if (s.challenge === _s.challenge) {
|
||||
index = i;
|
||||
@ -675,6 +755,7 @@ app.controller('websiteCtrl', [
|
||||
|
||||
r.sharedWith.splice(index, 1);
|
||||
//r.usersnames = r.sharedWith.map().join(',');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@ -714,8 +795,17 @@ app.controller('websiteCtrl', [
|
||||
Auth.api('domains.list', {}).then(function (els) {
|
||||
// console.log('[init] domains.list els:');
|
||||
// console.log(els);
|
||||
if (vm.referrerSelectedDomain) {
|
||||
Object.keys(els).forEach(function (key) {
|
||||
if (els[key]['domain'] === vm.referrerSelectedDomainName) {
|
||||
$scope.domain = [];
|
||||
$scope.domain.push(els[key]);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
vm.domains = els;
|
||||
$scope.domain = vm.domains;
|
||||
}
|
||||
});
|
||||
|
||||
vm.listSites();
|
||||
@ -743,10 +833,12 @@ app.controller('websiteCtrl', [
|
||||
vm.breadcrumbs.push(crumb);
|
||||
}
|
||||
});
|
||||
if (vm.copyR !== undefined) {
|
||||
if (vm.copyR.shareAccess.path !== '/') {
|
||||
} else {
|
||||
vm.breadcrumbs.unshift('root');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
vm.checkShareRights = function (r) {
|
||||
@ -773,8 +865,12 @@ app.controller('websiteCtrl', [
|
||||
$scope.$watch('vm.selectedDomain', function (domainSelected) {
|
||||
if (domainSelected !== undefined) {
|
||||
vm.dom = domainSelected;
|
||||
if (domainSelected.description === undefined) {
|
||||
vm.selectDomain(domainSelected);
|
||||
} else {
|
||||
vm.selectDomain(vm.selectedDomain.description);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
vm.getSharedAccess = function (access) {
|
||||
@ -856,6 +952,7 @@ app.controller('websiteCtrl', [
|
||||
message: msg
|
||||
};
|
||||
}
|
||||
window.scrollTo(0, 0);
|
||||
};
|
||||
|
||||
vm.closeAllOpenActions = function () {
|
||||
@ -867,6 +964,8 @@ app.controller('websiteCtrl', [
|
||||
vm.websiteTiles = false;
|
||||
vm.showBackBtn = false;
|
||||
vm.autoPopulateWebPath = '';
|
||||
vm.displaySpinner = '';
|
||||
vm.folderStructure = undefined;
|
||||
}, 150);
|
||||
};
|
||||
}]);
|
||||
|
||||
@ -13,7 +13,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
|
||||
, url: OAUTH3.url.normalize(providerUri)
|
||||
+ '/api/www@daplie.com/acl/sites/' + opts.hostname
|
||||
+ '?' + OAUTH3.utils.query.stringify({
|
||||
tld: opts.tld, sld: opts.sld/*, sub: opts.sub*/, unzip: opts.unzip
|
||||
tld: opts.tld, sld: opts.sld, sub: opts.sub, unzip: opts.unzip
|
||||
, strip: opts.strip, path: opts.path
|
||||
})
|
||||
, session: session
|
||||
@ -28,7 +28,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
|
||||
|
||||
return OAUTH3.url.normalize(providerUri.replace(/api\./, 'assets.'))
|
||||
+ '/assets/www@daplie.com/acl/archives/' + opts.hostname
|
||||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld/*, sub: opts.sub*/, strip: opts.strip, path: opts.path })
|
||||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld, sub: opts.sub, strip: opts.strip, path: opts.path })
|
||||
;
|
||||
}
|
||||
, listShares: function (opts) {
|
||||
@ -40,7 +40,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
|
||||
method: 'GET'
|
||||
, url: OAUTH3.url.normalize(providerUri)
|
||||
+ '/api/www@daplie.com/acl/shares/' + (opts.domain || opts.hostname)
|
||||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld/*, sub: opts.sub*/, path: opts.path })
|
||||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld, sub: opts.sub, path: opts.path })
|
||||
, session: session
|
||||
}).then(function (result) {
|
||||
return result;
|
||||
@ -55,7 +55,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
|
||||
method: 'DELETE'
|
||||
, url: OAUTH3.url.normalize(providerUri)
|
||||
+ '/api/www@daplie.com/acl/shares/' + (opts.domain || opts.hostname) + '/' + (opts.challenge || opts.token)
|
||||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld/*, sub: opts.sub*/, path: opts.path })
|
||||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld, sub: opts.sub, path: opts.path })
|
||||
, session: session
|
||||
}).then(function (result) {
|
||||
return result;
|
||||
@ -93,7 +93,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
|
||||
method: 'POST'
|
||||
, url: OAUTH3.url.normalize(providerUri)
|
||||
+ '/api/www@daplie.com/acl/shares/accept/' + opts.token
|
||||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld/*, sub: opts.sub*/ })
|
||||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld, sub: opts.sub })
|
||||
, session: session
|
||||
}).then(function (result) {
|
||||
return result;
|
||||
@ -115,12 +115,11 @@ OAUTH3._pkgs['www@daplie.com'] = {
|
||||
, archive: function (opts) {
|
||||
var providerUri = opts.audience;
|
||||
var session = opts.session;
|
||||
|
||||
return OAUTH3.request({
|
||||
method: 'POST'
|
||||
, url: OAUTH3.url.normalize(providerUri)
|
||||
+ '/api/www@daplie.com/acl/archives/' + opts.hostname
|
||||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld/*, sub: opts.sub*/, strip: opts.strip, path: opts.path })
|
||||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld, sub: opts.sub, strip: opts.strip, path: opts.path })
|
||||
, session: session
|
||||
}).then(function (result) {
|
||||
return result;
|
||||
@ -134,7 +133,22 @@ OAUTH3._pkgs['www@daplie.com'] = {
|
||||
method: 'GET'
|
||||
, url: OAUTH3.url.normalize(providerUri)
|
||||
+ '/api/www@daplie.com/acl/fs/' + opts.hostname
|
||||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld/*, sub: opts.sub*/, path: opts.path })
|
||||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld, sub: opts.sub, path: opts.path })
|
||||
, session: session
|
||||
}).then(function (result) {
|
||||
return result;
|
||||
});
|
||||
}
|
||||
, contentRange: function (opts) {
|
||||
var providerUri = opts.audience;
|
||||
var session = opts.session;
|
||||
|
||||
return OAUTH3.request({
|
||||
method: 'GET'
|
||||
, url: OAUTH3.url.normalize(providerUri)
|
||||
+ '/api/www@daplie.com/acl/fs/' + opts.hostname
|
||||
+ '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld, sub: opts.sub, path: opts.path
|
||||
, offset: opts.offset, length: opts.length, json: true })
|
||||
, session: session
|
||||
}).then(function (result) {
|
||||
return result;
|
||||
@ -149,7 +163,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
|
||||
, url: OAUTH3.url.normalize(providerUri)
|
||||
+ '/api/www@daplie.com/acl/sites/' + opts.hostname
|
||||
+ '?' + OAUTH3.utils.query.stringify({
|
||||
tld: opts.tld, sld: opts.sld/*, sub: opts.sub*/
|
||||
tld: opts.tld, sld: opts.sld, sub: opts.sub
|
||||
, path: opts.path, confirm: opts.confirm
|
||||
})
|
||||
, session: session
|
||||
@ -187,7 +201,6 @@ OAUTH3._pkgs['www@daplie.com'] = {
|
||||
, session: session
|
||||
}).then(function (result) {
|
||||
// result.data
|
||||
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
<div ng-controller="loginCtrl as vm" ng-init="vm.referrerInit()">
|
||||
<referrer-notification></referrer-notification>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="media">
|
||||
@ -8,14 +10,8 @@
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<h3 class="media-heading">What to do?</h3>
|
||||
<p>This is a prototype. It's essentially like a bunch of pictures that you can click through. You can type
|
||||
in certain areas, but not all of the buttons "work". It's mostly just clickable "screenshots".</p>
|
||||
|
||||
<p>For this demo you are "Jane Smith".
|
||||
As part of the setup for this device you chose
|
||||
<a href="feed.html">https://jane.smith.net</a> as your personal page
|
||||
and jane@smith.net as your messaging address.</p>
|
||||
|
||||
<p>This is a prototype. It's essentially like a bunch of pictures that you can click through. You can type in certain areas, but not all of the buttons "work". It's mostly just clickable "screenshots".</p>
|
||||
<p>For this demo you are "Jane Smith".As part of the setup for this device you chose <a href="feed.html">https://jane.smith.net</a> as your personal page and jane@smith.net as your messaging address.</p>
|
||||
<p>Choose a few of these goals to "test out" in a few different ways:</p>
|
||||
<ul>
|
||||
<li>Share a photo with a family member</li>
|
||||
@ -33,3 +29,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
<div class="container" ng-init="vm.shareInit()">
|
||||
<div class="container" ng-init="vm.paramInit()">
|
||||
<div class="row">
|
||||
<notification-bar></notification-bar>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<h1>Create Share</h1>
|
||||
<button class="btn btn-primary btn-lg" title="..." data-toggle="modal" data-target=".create-website-modal">
|
||||
<button class="btn btn-primary btn-lg create-share-btn" title="..." data-toggle="modal" data-target=".create-website-modal">
|
||||
Create Share
|
||||
</button>
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
</div>
|
||||
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="www" ng-model="vm.newRecord" ng-change="vm.setRecord()" />
|
||||
<input type="text" class="form-control" placeholder="www" ng-model="vm.newRecord" ng-change="vm.setRecord()" ng-blur="vm.setRecordDomain(vm.selectedDomain)" />
|
||||
<div class="input-group-btn">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span>
|
||||
@ -58,7 +58,7 @@
|
||||
<div class="input-group">
|
||||
<div>
|
||||
<label>Select .zip upload</label>
|
||||
<input type="file" ng-model="vm.newFile" class="form-control" daplie-file-change="vm.Sites.setUpload(vm.dom)" />
|
||||
<input type="file" ng-model="vm.newFile" class="form-control" daplie-file-change="vm.Sites.setUpload(vm.domain)" />
|
||||
</div>
|
||||
<div ng-if="vm.isZip" >
|
||||
<label>
|
||||
@ -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>
|
||||
</div>
|
||||
<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>
|
||||
</li>
|
||||
|
||||
@ -19,17 +19,18 @@
|
||||
</ul>
|
||||
<ul class="tree files-only ls-none">
|
||||
<li ng-repeat="file in vm.siteFiles track by $index">
|
||||
<span class="tree_label filez">{{ file }}</span><span class="pull-right"><button ng-if="r.shareAccess.write" type="button" class="btn btn-danger btn-xs" ng-click="vm.deleteFilesFrom(r, file); vm.closeFileUploadsContainers();" data="{{ file }}" ><i class="fa fa-trash"></i></button></span><br>
|
||||
<span class="tree_label filez">{{ file }}</span><span class="pull-right"><button ng-if="r.shareAccess.read" type="button" class="btn btn-default btn-xs" ng-click="vm.Sites.fileContents(file, r);" data="{{ file }}" ><i class="fa fa-code"></i></button> <button ng-if="r.shareAccess.write" type="button" class="btn btn-danger btn-xs" ng-click="vm.deleteFilesFrom(r, file); vm.closeFileUploadsContainers();" data="{{ file }}" ><i class="fa fa-trash"></i></button></span><br>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="folder-actions">
|
||||
<hr>
|
||||
<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 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">
|
||||
<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-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>
|
||||
</div>
|
||||
</div>
|
||||
@ -38,6 +39,8 @@
|
||||
<hr>
|
||||
<div>
|
||||
<input type="file" ng-model="r.newFile" class="form-control" daplie-file-change="vm.Sites.setUpload(r)" />
|
||||
<div ng-if="!r.isZip"><label><input type="checkbox" ng-model="r.indexableFile" /> Indexable?</label></div>
|
||||
<div ng-if="!r.isZip"><label><input type="checkbox" ng-model="r.publicFile" /> Public?</label></div>
|
||||
<div ng-if="r.isZip"><label><input type="checkbox" ng-model="r.unzip" /> Unpack .zip</label></div>
|
||||
<div ng-if="r.unzip"><label><input type="checkbox" ng-model="r.stripZip" /> Strip zip directory root</label></div>
|
||||
<div ng-if="vm.isZip" ><label>Unzip directory</label> <input type="text" ng-model="vm.unzipPath" /></div>
|
||||
|
||||
9
templates/widgets/referrer.html
Normal file
9
templates/widgets/referrer.html
Normal file
@ -0,0 +1,9 @@
|
||||
<div class="referrer-modal {{ vm.hideReferrerNotification }}">
|
||||
<div class="referrer-pop-up">
|
||||
<h4>{{ vm.referrerAlert.title }}</h4>
|
||||
<p>{{ vm.referrerAlert.msg }}</p>
|
||||
<a class="btn btn-danger close-referrer-pop-up" ng-click="vm.closeReferrerModal()">Close</a>
|
||||
<a class="btn btn-default" ng-click="vm.closeReferrerModal()">Maybe later</a>
|
||||
<a class="btn btn-success" ng-click="vm.sendToShares()">Do it now</a>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
x
Reference in New Issue
Block a user