Compare commits
	
		
			20 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					9d57c66492 | ||
| 
						 | 
					1503056c65 | ||
| 
						 | 
					df5819ee32 | ||
| 
						 | 
					76d9d51e5a | ||
| 
						 | 
					e06188d9c2 | ||
| 
						 | 
					39b9dae216 | ||
| 
						 | 
					655b3117b7 | ||
| 
						 | 
					67c4e8663f | ||
| 
						 | 
					057de03068 | ||
| 
						 | 
					3bcc504ab2 | ||
| 
						 | 
					d0ea91c0bb | ||
| 
						 | 
					ab43fefc49 | ||
| 
						 | 
					8d4337d091 | ||
| 
						 | 
					a47b7ac969 | ||
| 
						 | 
					574857233d | ||
| 
						 | 
					4e0545036d | ||
| 
						 | 
					efa628b099 | ||
| 
						 | 
					132c4e9f35 | ||
| 
						 | 
					4e5028dc0f | ||
| 
						 | 
					d97c6ab369 | 
							
								
								
									
										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.
 | 
					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>
 | 
				
			||||||
 | 
				
			|||||||
@ -1 +0,0 @@
 | 
				
			|||||||
Subproject commit db284fbf911dc4f9d0cb99bb512d9663dcfd0ece
 | 
					 | 
				
			||||||
@ -759,3 +759,37 @@ multiselect .dropdown-menu > li > a {
 | 
				
			|||||||
  width: 350px;
 | 
					  width: 350px;
 | 
				
			||||||
  height: 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;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -1,3 +1,10 @@
 | 
				
			|||||||
 | 
					app.directive('referrerNotification', [function () {
 | 
				
			||||||
 | 
					  return {
 | 
				
			||||||
 | 
					    restrict: 'EA',
 | 
				
			||||||
 | 
					    templateUrl: '/templates/widgets/referrer.html',
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					}]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
app.controller('loginCtrl', [
 | 
					app.controller('loginCtrl', [
 | 
				
			||||||
  '$scope', '$timeout', 'Auth', '$location', 'localStorageService', '$rootScope', 'azp@oauth3.org', '$stateParams'
 | 
					  '$scope', '$timeout', 'Auth', '$location', 'localStorageService', '$rootScope', 'azp@oauth3.org', '$stateParams'
 | 
				
			||||||
, function ($scope, $timeout, Auth, $location, localStorageService, $rootScope, Oauth3, $stateParams) {
 | 
					, function ($scope, $timeout, Auth, $location, localStorageService, $rootScope, Oauth3, $stateParams) {
 | 
				
			||||||
@ -16,6 +23,29 @@ app.controller('loginCtrl', [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  vm.showAdvanced = true;
 | 
					  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.toggleAdvanced = function () {
 | 
				
			||||||
    vm.showAdvanced = !vm.showAdvanced;
 | 
					    vm.showAdvanced = !vm.showAdvanced;
 | 
				
			||||||
    vm.independentIssuer = !vm.independentIssuer;
 | 
					    vm.independentIssuer = !vm.independentIssuer;
 | 
				
			||||||
 | 
				
			|||||||
@ -75,6 +75,7 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
  vm.copyUploadPath = '';
 | 
					  vm.copyUploadPath = '';
 | 
				
			||||||
  vm.displaySpinner = '';
 | 
					  vm.displaySpinner = '';
 | 
				
			||||||
  vm.deleteAll = '';
 | 
					  vm.deleteAll = '';
 | 
				
			||||||
 | 
					  vm.referrerSelectedDomain = false;
 | 
				
			||||||
  vm.alertNotification = {
 | 
					  vm.alertNotification = {
 | 
				
			||||||
    hidden: 'hidden'
 | 
					    hidden: 'hidden'
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
@ -175,30 +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 () {
 | 
					  vm.setRecord = function () {
 | 
				
			||||||
    // TODO set record based on (record.host === sub + domain.domain)
 | 
					    // TODO set record based on (record.host === sub + domain.domain)
 | 
				
			||||||
    var sub = vm.newRecord;
 | 
					    var sub = vm.newRecord;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ('@' === sub) {
 | 
					    if ('@' === sub || sub === undefined) {
 | 
				
			||||||
      sub = '';
 | 
					      sub = '';
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    vm.record = { sub: sub, host: (sub ? sub + '.' : '') + vm.domain.domain };
 | 
					    vm.record = { sub: sub, host: (sub ? sub + '.' : '') + vm.domain.domain };
 | 
				
			||||||
    vm.currentHost = vm.record.host;
 | 
					    vm.currentHost = vm.record.host;
 | 
				
			||||||
 | 
					 | 
				
			||||||
    console.log('[setRecord] vm.record:');
 | 
					    console.log('[setRecord] vm.record:');
 | 
				
			||||||
    console.log(vm.record);
 | 
					    console.log(vm.record);
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  vm.shareInit = function () {
 | 
					  vm.paramInit = function () {
 | 
				
			||||||
 | 
					    // Share example -> ?token=fe8386d7ad6273bd9ca29864148c0d2d©
 | 
				
			||||||
    if ($rootScope.urlCrumbs[$rootScope.urlCrumbs.length -1].params.token !== undefined) {
 | 
					    if ($rootScope.urlCrumbs[$rootScope.urlCrumbs.length -1].params.token !== undefined) {
 | 
				
			||||||
      vm.Shares.inviteToken = $rootScope.urlCrumbs[$rootScope.urlCrumbs.length -1].params.token;
 | 
					      vm.Shares.inviteToken = $rootScope.urlCrumbs[$rootScope.urlCrumbs.length -1].params.token;
 | 
				
			||||||
      var result = { data: { info: true } };
 | 
					      var result = { data: { info: true } };
 | 
				
			||||||
      var msg = "You have a new share.";
 | 
					      var msg = "You have a new share.";
 | 
				
			||||||
      vm.buildNotification(result, msg);
 | 
					      vm.buildNotification(result, msg);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    // 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.selectRecord = function (record) {
 | 
				
			||||||
    vm.record = record;
 | 
					    vm.record = record;
 | 
				
			||||||
    vm.newRecord = record.sub;
 | 
					    vm.newRecord = record.sub;
 | 
				
			||||||
@ -224,7 +242,7 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
    , domain: opts.domain
 | 
					    , domain: opts.domain
 | 
				
			||||||
    , tld: opts.tld
 | 
					    , tld: opts.tld
 | 
				
			||||||
    , sld: opts.sld
 | 
					    , sld: opts.sld
 | 
				
			||||||
    //, sub: opts.record.sub
 | 
					    , sub: opts.sub
 | 
				
			||||||
    , multipart: { site: opts.newFile }
 | 
					    , multipart: { site: opts.newFile }
 | 
				
			||||||
    , progress: function (ev) {
 | 
					    , progress: function (ev) {
 | 
				
			||||||
        // TODO must digest
 | 
					        // TODO must digest
 | 
				
			||||||
@ -245,12 +263,15 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
        vm.uploadFileContainer = false;
 | 
					        vm.uploadFileContainer = false;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      vm.buildNotification(result, msg);
 | 
					      vm.buildNotification(result, msg);
 | 
				
			||||||
 | 
					      if (vm.copyR !== undefined) {
 | 
				
			||||||
        vm.cleanArrays();
 | 
					        vm.cleanArrays();
 | 
				
			||||||
        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) {
 | 
					      } else {
 | 
				
			||||||
      console.log(err);
 | 
					        $location.url($location.path());
 | 
				
			||||||
 | 
					        vm.listSites();
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -281,8 +302,7 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (!vm.currentHost) {
 | 
					    if (!vm.currentHost) {
 | 
				
			||||||
      window.alert('No hostname chosen.');
 | 
					      vm.setRecord();
 | 
				
			||||||
      return;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (vm.domain) {
 | 
					    if (vm.domain) {
 | 
				
			||||||
@ -293,6 +313,7 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        sld = vm.domain.sld;
 | 
					        sld = vm.domain.sld;
 | 
				
			||||||
        tld = vm.domain.tld;
 | 
					        tld = vm.domain.tld;
 | 
				
			||||||
 | 
					        sub = vm.domain.sub;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      parts = vm.currentHost.split('.');
 | 
					      parts = vm.currentHost.split('.');
 | 
				
			||||||
@ -313,11 +334,12 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
    // (because two users could both claim a single domain)
 | 
					    // (because two users could both claim a single domain)
 | 
				
			||||||
    // We're claiming it at the top level (i.e. example.com)
 | 
					    // 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)
 | 
					    // 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) {
 | 
					    return pkg.request(domainReq).then(function (result) {
 | 
				
			||||||
      var sess;
 | 
					      var sess;
 | 
				
			||||||
      var prom;
 | 
					      var prom;
 | 
				
			||||||
      var def;
 | 
					      var def;
 | 
				
			||||||
 | 
					      var sub;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // can validate automatically
 | 
					      // can validate automatically
 | 
				
			||||||
      if (vm.domain.session && vm._isSubDomain(vm.currentHost, vm.domain.domain)) {
 | 
					      if (vm.domain.session && vm._isSubDomain(vm.currentHost, vm.domain.domain)) {
 | 
				
			||||||
@ -331,7 +353,11 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if (sess) {
 | 
					        if (sess) {
 | 
				
			||||||
          prom = Auth.get(sess).then(function (oauth3) {
 | 
					          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 });
 | 
				
			||||||
          });
 | 
					          });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@ -378,9 +404,12 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
    , domain: r.domain
 | 
					    , domain: r.domain
 | 
				
			||||||
    , tld: r.tld
 | 
					    , tld: r.tld
 | 
				
			||||||
    , sld: r.sld
 | 
					    , sld: r.sld
 | 
				
			||||||
    //, sub: r.sub
 | 
					    , sub: r.sub
 | 
				
			||||||
    , path: r.shareAccess.path
 | 
					    , path: r.shareAccess.path
 | 
				
			||||||
    }).then(function (result) {
 | 
					    }).then(function (result) {
 | 
				
			||||||
 | 
					      if (result.data.error) {
 | 
				
			||||||
 | 
					        vm.folderStructure = result;
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
        vm.cleanArrays();
 | 
					        vm.cleanArrays();
 | 
				
			||||||
        vm.folderStructure = result;
 | 
					        vm.folderStructure = result;
 | 
				
			||||||
        result.data.forEach(function(data){
 | 
					        result.data.forEach(function(data){
 | 
				
			||||||
@ -391,6 +420,7 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
            vm.siteDirectories.push(data.name);
 | 
					            vm.siteDirectories.push(data.name);
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
      vm.displaySpinner = 'hidden';
 | 
					      vm.displaySpinner = 'hidden';
 | 
				
			||||||
      vm.currentFolder = vm.breadcrumbs[vm.breadcrumbs.length - 1];
 | 
					      vm.currentFolder = vm.breadcrumbs[vm.breadcrumbs.length - 1];
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
@ -406,6 +436,24 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
    vm.uploadFileContainer = false;
 | 
					    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.Sites.contents = function (r, dir) {
 | 
				
			||||||
    vm.siteFiles = [];
 | 
					    vm.siteFiles = [];
 | 
				
			||||||
    vm.siteDirectories = [];
 | 
					    vm.siteDirectories = [];
 | 
				
			||||||
@ -420,7 +468,7 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
      domain: r.domain,
 | 
					      domain: r.domain,
 | 
				
			||||||
      tld: r.tld,
 | 
					      tld: r.tld,
 | 
				
			||||||
      sld: r.sld,
 | 
					      sld: r.sld,
 | 
				
			||||||
      // sub: r.sub,
 | 
					      sub: r.sub,
 | 
				
			||||||
      path: dir
 | 
					      path: dir
 | 
				
			||||||
    }).then(function (result) {
 | 
					    }).then(function (result) {
 | 
				
			||||||
      vm.cleanArrays();
 | 
					      vm.cleanArrays();
 | 
				
			||||||
@ -528,12 +576,13 @@ 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
 | 
				
			||||||
    , tld: r.tld
 | 
					    , tld: r.tld
 | 
				
			||||||
    , sld: r.sld
 | 
					    , sld: r.sld
 | 
				
			||||||
    //, sub: vm.record.sub
 | 
					    , sub: r.sub
 | 
				
			||||||
    , path: opts.path || r.path
 | 
					    , path: opts.path || r.path
 | 
				
			||||||
    , confirm: opts.confirm || r.confirm
 | 
					    , confirm: opts.confirm || r.confirm
 | 
				
			||||||
    }).then(function (result) {
 | 
					    }).then(function (result) {
 | 
				
			||||||
@ -545,18 +594,29 @@ 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;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    debugger;
 | 
				
			||||||
 | 
					    // FIXME: Figure out how to download specific folders
 | 
				
			||||||
    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: r.sub
 | 
				
			||||||
    //, path: vm.uploadPath
 | 
					    , path: 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?
 | 
				
			||||||
@ -566,7 +626,9 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  vm.shareFolderFrom = function (r, opts) {
 | 
					  vm.shareFolderFrom = function (r, opts) {
 | 
				
			||||||
    var sharePath;
 | 
					    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 = '/';
 | 
					      sharePath = '/';
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      sharePath = cleanPathQuery(vm.breadcrumbsPath.join('/'));
 | 
					      sharePath = cleanPathQuery(vm.breadcrumbsPath.join('/'));
 | 
				
			||||||
@ -601,14 +663,17 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
    , domain: r.domain
 | 
					    , domain: r.domain
 | 
				
			||||||
    , tld: r.tld
 | 
					    , tld: r.tld
 | 
				
			||||||
    , sld: r.sld
 | 
					    , sld: r.sld
 | 
				
			||||||
    //, sub: r.sub
 | 
					    , sub: r.sub
 | 
				
			||||||
    , path: opts.sharePath || r.sharePath
 | 
					    , path: opts.sharePath || r.sharePath
 | 
				
			||||||
    , mode: opts.shareMode || r.shareMode
 | 
					    , mode: opts.shareMode || r.shareMode
 | 
				
			||||||
    }).then(function (result) {
 | 
					    }).then(function (result) {
 | 
				
			||||||
      var arr = r.sharedWith || [];
 | 
					      var arr = r.sharedWith || [];
 | 
				
			||||||
      arr.push(result.data);
 | 
					      arr.push(result.data);
 | 
				
			||||||
      r.sharedWith = arr;
 | 
					      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);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -644,7 +709,7 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
    , hostname: r.domain
 | 
					    , hostname: r.domain
 | 
				
			||||||
    , tld: r.tld
 | 
					    , tld: r.tld
 | 
				
			||||||
    , sld: r.sld
 | 
					    , sld: r.sld
 | 
				
			||||||
    //, sub: r.sub
 | 
					    , sub: r.sub
 | 
				
			||||||
    , path: r.sharePath
 | 
					    , path: r.sharePath
 | 
				
			||||||
    }).then(function (result) {
 | 
					    }).then(function (result) {
 | 
				
			||||||
      vm.displaySpinner = 'hidden';
 | 
					      vm.displaySpinner = 'hidden';
 | 
				
			||||||
@ -659,18 +724,18 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
    if (!window.confirm("Delete this site?")) {
 | 
					    if (!window.confirm("Delete this site?")) {
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    s.sharePath = '/';
 | 
				
			||||||
    vm.Shares.remove(r, s);
 | 
					    vm.Shares.remove(r, s);
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  vm.Shares.remove = function (r, s) {
 | 
					  vm.Shares.remove = function (r, s) {
 | 
				
			||||||
    console.log('Shares.remove');
 | 
					 | 
				
			||||||
    var pkg = Auth.oauth3.pkg('www@daplie.com');
 | 
					    var pkg = Auth.oauth3.pkg('www@daplie.com');
 | 
				
			||||||
    return pkg.removeShare({
 | 
					    return pkg.removeShare({
 | 
				
			||||||
      domain: s.domain
 | 
					      domain: s.domain
 | 
				
			||||||
    , hostname: s.domain
 | 
					    , hostname: s.domain
 | 
				
			||||||
    , tld: s.tld
 | 
					    , tld: s.tld
 | 
				
			||||||
    , sld: s.sld
 | 
					    , sld: s.sld
 | 
				
			||||||
    //, sub: r.sub
 | 
					    , sub: r.sub
 | 
				
			||||||
    , path: s.sharePath
 | 
					    , path: s.sharePath
 | 
				
			||||||
    , challenge: s.challenge
 | 
					    , challenge: s.challenge
 | 
				
			||||||
    }).then(function (result) {
 | 
					    }).then(function (result) {
 | 
				
			||||||
@ -681,6 +746,7 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
      console.log(result);
 | 
					      console.log(result);
 | 
				
			||||||
      var index;
 | 
					      var index;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (r.sharedWith !== undefined) {
 | 
				
			||||||
        r.sharedWith.forEach(function (_s, i) {
 | 
					        r.sharedWith.forEach(function (_s, i) {
 | 
				
			||||||
          if (s.challenge === _s.challenge) {
 | 
					          if (s.challenge === _s.challenge) {
 | 
				
			||||||
            index = i;
 | 
					            index = i;
 | 
				
			||||||
@ -689,6 +755,7 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        r.sharedWith.splice(index, 1);
 | 
					        r.sharedWith.splice(index, 1);
 | 
				
			||||||
        //r.usersnames = r.sharedWith.map().join(',');
 | 
					        //r.usersnames = r.sharedWith.map().join(',');
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -728,8 +795,17 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
  Auth.api('domains.list', {}).then(function (els) {
 | 
					  Auth.api('domains.list', {}).then(function (els) {
 | 
				
			||||||
    // console.log('[init] domains.list els:');
 | 
					    // console.log('[init] domains.list els:');
 | 
				
			||||||
    // console.log(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;
 | 
					      vm.domains = els;
 | 
				
			||||||
      $scope.domain = vm.domains;
 | 
					      $scope.domain = vm.domains;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  vm.listSites();
 | 
					  vm.listSites();
 | 
				
			||||||
@ -757,10 +833,12 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
        vm.breadcrumbs.push(crumb);
 | 
					        vm.breadcrumbs.push(crumb);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					    if (vm.copyR !== undefined) {
 | 
				
			||||||
      if (vm.copyR.shareAccess.path !== '/') {
 | 
					      if (vm.copyR.shareAccess.path !== '/') {
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        vm.breadcrumbs.unshift('root');
 | 
					        vm.breadcrumbs.unshift('root');
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  vm.checkShareRights = function (r) {
 | 
					  vm.checkShareRights = function (r) {
 | 
				
			||||||
@ -787,8 +865,12 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
  $scope.$watch('vm.selectedDomain', function (domainSelected) {
 | 
					  $scope.$watch('vm.selectedDomain', function (domainSelected) {
 | 
				
			||||||
    if (domainSelected !== undefined) {
 | 
					    if (domainSelected !== undefined) {
 | 
				
			||||||
      vm.dom = domainSelected;
 | 
					      vm.dom = domainSelected;
 | 
				
			||||||
 | 
					      if (domainSelected.description === undefined) {
 | 
				
			||||||
 | 
					        vm.selectDomain(domainSelected);
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
        vm.selectDomain(vm.selectedDomain.description);
 | 
					        vm.selectDomain(vm.selectedDomain.description);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  vm.getSharedAccess = function (access) {
 | 
					  vm.getSharedAccess = function (access) {
 | 
				
			||||||
@ -882,6 +964,8 @@ app.controller('websiteCtrl', [
 | 
				
			|||||||
      vm.websiteTiles = false;
 | 
					      vm.websiteTiles = false;
 | 
				
			||||||
      vm.showBackBtn = false;
 | 
					      vm.showBackBtn = false;
 | 
				
			||||||
      vm.autoPopulateWebPath = '';
 | 
					      vm.autoPopulateWebPath = '';
 | 
				
			||||||
 | 
					      vm.displaySpinner = '';
 | 
				
			||||||
 | 
					      vm.folderStructure = undefined;
 | 
				
			||||||
    }, 150);
 | 
					    }, 150);
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
}]);
 | 
					}]);
 | 
				
			||||||
 | 
				
			|||||||
@ -13,7 +13,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
 | 
				
			|||||||
    , url: OAUTH3.url.normalize(providerUri)
 | 
					    , url: OAUTH3.url.normalize(providerUri)
 | 
				
			||||||
        + '/api/www@daplie.com/acl/sites/' + opts.hostname
 | 
					        + '/api/www@daplie.com/acl/sites/' + opts.hostname
 | 
				
			||||||
        + '?' + OAUTH3.utils.query.stringify({
 | 
					        + '?' + 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
 | 
					          , strip: opts.strip, path: opts.path
 | 
				
			||||||
          })
 | 
					          })
 | 
				
			||||||
    , session: session
 | 
					    , session: session
 | 
				
			||||||
@ -28,7 +28,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    return OAUTH3.url.normalize(providerUri.replace(/api\./, 'assets.'))
 | 
					    return OAUTH3.url.normalize(providerUri.replace(/api\./, 'assets.'))
 | 
				
			||||||
      + '/assets/www@daplie.com/acl/archives/' + opts.hostname
 | 
					      + '/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) {
 | 
					, listShares: function (opts) {
 | 
				
			||||||
@ -40,7 +40,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
 | 
				
			|||||||
      method: 'GET'
 | 
					      method: 'GET'
 | 
				
			||||||
    , url: OAUTH3.url.normalize(providerUri)
 | 
					    , url: OAUTH3.url.normalize(providerUri)
 | 
				
			||||||
        + '/api/www@daplie.com/acl/shares/' + (opts.domain || opts.hostname)
 | 
					        + '/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
 | 
					    , session: session
 | 
				
			||||||
    }).then(function (result) {
 | 
					    }).then(function (result) {
 | 
				
			||||||
      return result;
 | 
					      return result;
 | 
				
			||||||
@ -55,7 +55,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
 | 
				
			|||||||
      method: 'DELETE'
 | 
					      method: 'DELETE'
 | 
				
			||||||
    , url: OAUTH3.url.normalize(providerUri)
 | 
					    , url: OAUTH3.url.normalize(providerUri)
 | 
				
			||||||
        + '/api/www@daplie.com/acl/shares/' + (opts.domain || opts.hostname) + '/' + (opts.challenge || opts.token)
 | 
					        + '/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
 | 
					    , session: session
 | 
				
			||||||
    }).then(function (result) {
 | 
					    }).then(function (result) {
 | 
				
			||||||
      return result;
 | 
					      return result;
 | 
				
			||||||
@ -93,7 +93,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
 | 
				
			|||||||
      method: 'POST'
 | 
					      method: 'POST'
 | 
				
			||||||
    , url: OAUTH3.url.normalize(providerUri)
 | 
					    , url: OAUTH3.url.normalize(providerUri)
 | 
				
			||||||
        + '/api/www@daplie.com/acl/shares/accept/' + opts.token
 | 
					        + '/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
 | 
					    , session: session
 | 
				
			||||||
    }).then(function (result) {
 | 
					    }).then(function (result) {
 | 
				
			||||||
      return result;
 | 
					      return result;
 | 
				
			||||||
@ -115,12 +115,11 @@ OAUTH3._pkgs['www@daplie.com'] = {
 | 
				
			|||||||
, archive: function (opts) {
 | 
					, archive: function (opts) {
 | 
				
			||||||
    var providerUri = opts.audience;
 | 
					    var providerUri = opts.audience;
 | 
				
			||||||
    var session = opts.session;
 | 
					    var session = opts.session;
 | 
				
			||||||
 | 
					 | 
				
			||||||
    return OAUTH3.request({
 | 
					    return OAUTH3.request({
 | 
				
			||||||
      method: 'POST'
 | 
					      method: 'POST'
 | 
				
			||||||
    , url: OAUTH3.url.normalize(providerUri)
 | 
					    , url: OAUTH3.url.normalize(providerUri)
 | 
				
			||||||
        + '/api/www@daplie.com/acl/archives/' + opts.hostname
 | 
					        + '/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
 | 
					    , session: session
 | 
				
			||||||
    }).then(function (result) {
 | 
					    }).then(function (result) {
 | 
				
			||||||
      return result;
 | 
					      return result;
 | 
				
			||||||
@ -134,7 +133,22 @@ OAUTH3._pkgs['www@daplie.com'] = {
 | 
				
			|||||||
      method: 'GET'
 | 
					      method: 'GET'
 | 
				
			||||||
    , url: OAUTH3.url.normalize(providerUri)
 | 
					    , url: OAUTH3.url.normalize(providerUri)
 | 
				
			||||||
        + '/api/www@daplie.com/acl/fs/' + opts.hostname
 | 
					        + '/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
 | 
					    , session: session
 | 
				
			||||||
    }).then(function (result) {
 | 
					    }).then(function (result) {
 | 
				
			||||||
      return result;
 | 
					      return result;
 | 
				
			||||||
@ -149,7 +163,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
 | 
				
			|||||||
    , url: OAUTH3.url.normalize(providerUri)
 | 
					    , url: OAUTH3.url.normalize(providerUri)
 | 
				
			||||||
        + '/api/www@daplie.com/acl/sites/' + opts.hostname
 | 
					        + '/api/www@daplie.com/acl/sites/' + opts.hostname
 | 
				
			||||||
        + '?' + OAUTH3.utils.query.stringify({
 | 
					        + '?' + 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
 | 
					          , path: opts.path, confirm: opts.confirm
 | 
				
			||||||
          })
 | 
					          })
 | 
				
			||||||
    , session: session
 | 
					    , session: session
 | 
				
			||||||
@ -187,7 +201,6 @@ OAUTH3._pkgs['www@daplie.com'] = {
 | 
				
			|||||||
    , session: session
 | 
					    , session: session
 | 
				
			||||||
    }).then(function (result) {
 | 
					    }).then(function (result) {
 | 
				
			||||||
      // result.data
 | 
					      // result.data
 | 
				
			||||||
 | 
					 | 
				
			||||||
      return result;
 | 
					      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 panel-default">
 | 
				
			||||||
    <div class="panel-body">
 | 
					    <div class="panel-body">
 | 
				
			||||||
      <div class="media">
 | 
					      <div class="media">
 | 
				
			||||||
@ -8,14 +10,8 @@
 | 
				
			|||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div class="media-body">
 | 
					        <div class="media-body">
 | 
				
			||||||
          <h3 class="media-heading">What to do?</h3>
 | 
					          <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
 | 
					          <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>
 | 
				
			||||||
         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>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>
 | 
					          <p>Choose a few of these goals to "test out" in a few different ways:</p>
 | 
				
			||||||
          <ul>
 | 
					          <ul>
 | 
				
			||||||
            <li>Share a photo with a family member</li>
 | 
					            <li>Share a photo with a family member</li>
 | 
				
			||||||
@ -33,3 +29,4 @@
 | 
				
			|||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
    </div>
 | 
					    </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">
 | 
					  <div class="row">
 | 
				
			||||||
    <notification-bar></notification-bar>
 | 
					    <notification-bar></notification-bar>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
  <div class="row">
 | 
					  <div class="row">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <h1>Create Share</h1>
 | 
					    <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
 | 
					      Create Share
 | 
				
			||||||
    </button>
 | 
					    </button>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -43,7 +43,7 @@
 | 
				
			|||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <div class="input-group">
 | 
					            <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="input-group-btn">
 | 
				
			||||||
                <div class="btn-group">
 | 
					                <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>
 | 
					                  <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 class="input-group">
 | 
				
			||||||
              <div>
 | 
					              <div>
 | 
				
			||||||
                <label>Select .zip upload</label>
 | 
					                <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>
 | 
				
			||||||
              <div ng-if="vm.isZip" >
 | 
					              <div ng-if="vm.isZip" >
 | 
				
			||||||
                <label>
 | 
					                <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>
 | 
					                    <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>
 | 
				
			||||||
 | 
				
			|||||||
@ -19,17 +19,18 @@
 | 
				
			|||||||
      </ul>
 | 
					      </ul>
 | 
				
			||||||
      <ul class="tree files-only ls-none">
 | 
					      <ul class="tree files-only ls-none">
 | 
				
			||||||
        <li ng-repeat="file in vm.siteFiles track by $index">
 | 
					        <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>
 | 
					        </li>
 | 
				
			||||||
      </ul>
 | 
					      </ul>
 | 
				
			||||||
      <div class="folder-actions">
 | 
					      <div class="folder-actions">
 | 
				
			||||||
        <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>
 | 
				
			||||||
@ -38,6 +39,8 @@
 | 
				
			|||||||
          <hr>
 | 
					          <hr>
 | 
				
			||||||
          <div>
 | 
					          <div>
 | 
				
			||||||
            <input type="file" ng-model="r.newFile" class="form-control" daplie-file-change="vm.Sites.setUpload(r)" />
 | 
					            <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.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="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>
 | 
					            <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