Compare commits
	
		
			No commits in common. "master" and "v1.2.3" have entirely different histories.
		
	
	
		
	
		
							
								
								
									
										0
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										0
									
								
								.gitmodules
									
									
									
									
										vendored
									
									
								
							@ -1,7 +1,7 @@
 | 
			
		||||
OAuth3 Web App
 | 
			
		||||
Daplie Web App
 | 
			
		||||
--------------
 | 
			
		||||
 | 
			
		||||
Prototype OAuth3 Web App.
 | 
			
		||||
Prototype Daplie 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.coolaj86.com:coolaj86/walnut_launchpad.html.git
 | 
			
		||||
git clone git@git.daplie.com:Daplie/walnut_launchpad.git
 | 
			
		||||
 | 
			
		||||
# install oauth3 to /assets/oauth3.org
 | 
			
		||||
pushd walnut_launchpad
 | 
			
		||||
@ -18,4 +18,4 @@ bash ./install.sh
 | 
			
		||||
serve-https
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
<https://localhost.example.com:8443>
 | 
			
		||||
<https://localhost.daplie.me:8443>
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1
									
								
								assets/oauth3.org
									
									
									
									
									
										Submodule
									
								
							
							
								
								
								
								
								
								
									
									
								
							
						
						
									
										1
									
								
								assets/oauth3.org
									
									
									
									
									
										Submodule
									
								
							@ -0,0 +1 @@
 | 
			
		||||
Subproject commit db284fbf911dc4f9d0cb99bb512d9663dcfd0ece
 | 
			
		||||
@ -759,37 +759,3 @@ 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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,3 @@
 | 
			
		||||
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) {
 | 
			
		||||
@ -23,29 +16,6 @@ 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;
 | 
			
		||||
 | 
			
		||||
@ -75,7 +75,6 @@ app.controller('websiteCtrl', [
 | 
			
		||||
  vm.copyUploadPath = '';
 | 
			
		||||
  vm.displaySpinner = '';
 | 
			
		||||
  vm.deleteAll = '';
 | 
			
		||||
  vm.referrerSelectedDomain = false;
 | 
			
		||||
  vm.alertNotification = {
 | 
			
		||||
    hidden: 'hidden'
 | 
			
		||||
  };
 | 
			
		||||
@ -176,47 +175,30 @@ 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 || sub === undefined) {
 | 
			
		||||
    if ('@' === sub) {
 | 
			
		||||
      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.paramInit = function () {
 | 
			
		||||
    // Share example -> ?token=fe8386d7ad6273bd9ca29864148c0d2d©
 | 
			
		||||
  vm.shareInit = function () {
 | 
			
		||||
    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 have a new share.";
 | 
			
		||||
      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.record = record;
 | 
			
		||||
    vm.newRecord = record.sub;
 | 
			
		||||
@ -242,7 +224,7 @@ app.controller('websiteCtrl', [
 | 
			
		||||
    , domain: opts.domain
 | 
			
		||||
    , tld: opts.tld
 | 
			
		||||
    , sld: opts.sld
 | 
			
		||||
    , sub: opts.sub
 | 
			
		||||
    //, sub: opts.record.sub
 | 
			
		||||
    , multipart: { site: opts.newFile }
 | 
			
		||||
    , progress: function (ev) {
 | 
			
		||||
        // TODO must digest
 | 
			
		||||
@ -263,15 +245,12 @@ 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);
 | 
			
		||||
      } else {
 | 
			
		||||
        $location.url($location.path());
 | 
			
		||||
        vm.listSites();
 | 
			
		||||
      }
 | 
			
		||||
    }, function (err) {
 | 
			
		||||
      console.log(err);
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
@ -302,7 +281,8 @@ app.controller('websiteCtrl', [
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    if (!vm.currentHost) {
 | 
			
		||||
      vm.setRecord();
 | 
			
		||||
      window.alert('No hostname chosen.');
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (vm.domain) {
 | 
			
		||||
@ -313,7 +293,6 @@ app.controller('websiteCtrl', [
 | 
			
		||||
      } else {
 | 
			
		||||
        sld = vm.domain.sld;
 | 
			
		||||
        tld = vm.domain.tld;
 | 
			
		||||
        sub = vm.domain.sub;
 | 
			
		||||
      }
 | 
			
		||||
    } else {
 | 
			
		||||
      parts = vm.currentHost.split('.');
 | 
			
		||||
@ -334,12 +313,11 @@ 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: sub };
 | 
			
		||||
    var domainReq = { sld: sld, tld: tld, sub: undefined };
 | 
			
		||||
    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)) {
 | 
			
		||||
@ -353,11 +331,7 @@ app.controller('websiteCtrl', [
 | 
			
		||||
 | 
			
		||||
        if (sess) {
 | 
			
		||||
          prom = Auth.get(sess).then(function (oauth3) {
 | 
			
		||||
            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 });
 | 
			
		||||
            return oauth3.api('dns.set', { sld: sld, tld: tld, sub: ('' + result.data.prefix), type: 'TXT', ttl: 300, value: result.data.challenge });
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
@ -404,12 +378,9 @@ 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){
 | 
			
		||||
@ -420,7 +391,6 @@ app.controller('websiteCtrl', [
 | 
			
		||||
          vm.siteDirectories.push(data.name);
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
      }
 | 
			
		||||
      vm.displaySpinner = 'hidden';
 | 
			
		||||
      vm.currentFolder = vm.breadcrumbs[vm.breadcrumbs.length - 1];
 | 
			
		||||
    });
 | 
			
		||||
@ -436,24 +406,6 @@ 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 = [];
 | 
			
		||||
@ -468,7 +420,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();
 | 
			
		||||
@ -576,13 +528,12 @@ 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: r.sub
 | 
			
		||||
    //, sub: vm.record.sub
 | 
			
		||||
    , path: opts.path || r.path
 | 
			
		||||
    , confirm: opts.confirm || r.confirm
 | 
			
		||||
    }).then(function (result) {
 | 
			
		||||
@ -594,29 +545,18 @@ 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: r.sub
 | 
			
		||||
    , path: path
 | 
			
		||||
    //, sub: vm.record.sub
 | 
			
		||||
    //, path: vm.uploadPath
 | 
			
		||||
    }).then(function (result) {
 | 
			
		||||
      window.alert(JSON.stringify(result));
 | 
			
		||||
      // TODO use iframe to initiate download?
 | 
			
		||||
@ -626,9 +566,7 @@ app.controller('websiteCtrl', [
 | 
			
		||||
 | 
			
		||||
  vm.shareFolderFrom = function (r, opts) {
 | 
			
		||||
    var sharePath;
 | 
			
		||||
    if (vm.breadcrumbsPath === undefined && vm.breadcrumbs === undefined) {
 | 
			
		||||
      sharePath = '/';
 | 
			
		||||
    } else if (vm.breadcrumbsPath.join('/') === '' && vm.breadcrumbs.join('/') === '') {
 | 
			
		||||
    if (vm.breadcrumbsPath.join('/') === '' && vm.breadcrumbs.join('/') === '') {
 | 
			
		||||
      sharePath = '/';
 | 
			
		||||
    } else {
 | 
			
		||||
      sharePath = cleanPathQuery(vm.breadcrumbsPath.join('/'));
 | 
			
		||||
@ -663,17 +601,14 @@ 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;
 | 
			
		||||
      var path = result.data.path;
 | 
			
		||||
      var person = result.data.comment;
 | 
			
		||||
      var msg = "You have shared " + "'" + path + "'" + ' with ' + person + ".";
 | 
			
		||||
      vm.buildNotification(result, msg);
 | 
			
		||||
      window.alert(JSON.stringify(result.data));
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
@ -709,7 +644,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';
 | 
			
		||||
@ -724,18 +659,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) {
 | 
			
		||||
@ -746,7 +681,6 @@ 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;
 | 
			
		||||
@ -755,7 +689,6 @@ app.controller('websiteCtrl', [
 | 
			
		||||
 | 
			
		||||
      r.sharedWith.splice(index, 1);
 | 
			
		||||
      //r.usersnames = r.sharedWith.map().join(',');
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
@ -795,17 +728,8 @@ 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();
 | 
			
		||||
@ -833,12 +757,10 @@ 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) {
 | 
			
		||||
@ -865,12 +787,8 @@ 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) {
 | 
			
		||||
@ -964,8 +882,6 @@ 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,11 +115,12 @@ 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;
 | 
			
		||||
@ -133,22 +134,7 @@ 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 })
 | 
			
		||||
    , 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 })
 | 
			
		||||
        + '?' + OAUTH3.utils.query.stringify({ tld: opts.tld, sld: opts.sld/*, sub: opts.sub*/, path: opts.path })
 | 
			
		||||
    , session: session
 | 
			
		||||
    }).then(function (result) {
 | 
			
		||||
      return result;
 | 
			
		||||
@ -163,7 +149,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
 | 
			
		||||
@ -201,6 +187,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
 | 
			
		||||
    , session: session
 | 
			
		||||
    }).then(function (result) {
 | 
			
		||||
      // result.data
 | 
			
		||||
 | 
			
		||||
      return result;
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,4 @@
 | 
			
		||||
<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="media">
 | 
			
		||||
      <h5 class="media-heading">System Message > <span ng-bind="vm.session.subject"></span></h5>
 | 
			
		||||
@ -10,8 +8,14 @@
 | 
			
		||||
      </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>
 | 
			
		||||
@ -28,5 +32,4 @@
 | 
			
		||||
      <button ng-click="vm.hide_welcome_msg = true" type="button" name="button" class="btn btn-default"><i class="fa fa-thumbs-up" aria-hidden="true"></i> Okay</button>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
@ -1,11 +1,11 @@
 | 
			
		||||
<div class="container" ng-init="vm.paramInit()">
 | 
			
		||||
<div class="container" ng-init="vm.shareInit()">
 | 
			
		||||
  <div class="row">
 | 
			
		||||
    <notification-bar></notification-bar>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="row">
 | 
			
		||||
 | 
			
		||||
    <h1>Create Share</h1>
 | 
			
		||||
    <button class="btn btn-primary btn-lg create-share-btn"  title="..." data-toggle="modal" data-target=".create-website-modal">
 | 
			
		||||
    <button class="btn btn-primary btn-lg"  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()" ng-blur="vm.setRecordDomain(vm.selectedDomain)" />
 | 
			
		||||
              <input type="text" class="form-control" placeholder="www" ng-model="vm.newRecord" ng-change="vm.setRecord()" />
 | 
			
		||||
              <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.domain)" />
 | 
			
		||||
                <input type="file" ng-model="vm.newFile" class="form-control" daplie-file-change="vm.Sites.setUpload(vm.dom)" />
 | 
			
		||||
              </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 ng-if="r.shareAccess.invite" class="btn btn-danger" ng-click="vm.Shares.remove(r, share)">Remove Access</button>
 | 
			
		||||
                    <button class="btn btn-danger" ng-click="vm.Shares.remove(r, share)">Remove Access</button>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
              </li>
 | 
			
		||||
 | 
			
		||||
@ -19,18 +19,17 @@
 | 
			
		||||
      </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.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>
 | 
			
		||||
          <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>
 | 
			
		||||
        </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>
 | 
			
		||||
@ -39,8 +38,6 @@
 | 
			
		||||
          <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>
 | 
			
		||||
 | 
			
		||||
@ -1,9 +0,0 @@
 | 
			
		||||
<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