ability to upload file (without unpacking) to arbitrary locations
This commit is contained in:
		
							parent
							
								
									3ba63bc818
								
							
						
					
					
						commit
						16f44e72ae
					
				@ -87,6 +87,14 @@ app.controller('websiteCtrl', [
 | 
			
		||||
    if (!vm.domain) {
 | 
			
		||||
      vm.domain = { domain: vm.newDomain };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!vm.domain.tld) {
 | 
			
		||||
      var parts = vm.domain.domain.split('.');
 | 
			
		||||
      vm.domain.sld = parts.shift();
 | 
			
		||||
      vm.domain.tld = parts.join('.');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    vm.setRecord();
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  vm.selectDomain = function (domain) {
 | 
			
		||||
@ -110,6 +118,20 @@ app.controller('websiteCtrl', [
 | 
			
		||||
    });
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  vm.setRecord = function () {
 | 
			
		||||
    // TODO set record based on (record.host === sub + domain.domain)
 | 
			
		||||
    var sub = vm.newRecord;
 | 
			
		||||
 | 
			
		||||
    if ('@' === sub) {
 | 
			
		||||
      sub = '';
 | 
			
		||||
    }
 | 
			
		||||
    vm.record = { sub: sub, host: (sub ? sub + '.' : '') + vm.domain.domain };
 | 
			
		||||
    vm.currentHost = vm.record.host;
 | 
			
		||||
 | 
			
		||||
    console.log('vm.record', vm.record);
 | 
			
		||||
    console.log('vm.currentHost', vm.currentHost);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  vm.selectRecord = function (record) {
 | 
			
		||||
    vm.record = record;
 | 
			
		||||
    vm.newRecord = record.sub;
 | 
			
		||||
@ -160,17 +182,15 @@ app.controller('websiteCtrl', [
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // already validated
 | 
			
		||||
    if (vm.sites.some(function (r) {
 | 
			
		||||
      return -1 !== ('.' + vm.currentHost).indexOf(('.' + r.domain));
 | 
			
		||||
    })) {
 | 
			
		||||
      vm._createWebsite(pkg);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (vm.domain) {
 | 
			
		||||
      parts = vm.domain.domain.split('.');
 | 
			
		||||
      sld = parts.shift();
 | 
			
		||||
      tld = parts.join('.');
 | 
			
		||||
      if (!vm.domain.tld || !vm.domain.sld) {
 | 
			
		||||
        parts = vm.domain.domain.split('.');
 | 
			
		||||
        sld = parts.shift();
 | 
			
		||||
        tld = parts.join('.');
 | 
			
		||||
      } else {
 | 
			
		||||
        sld = vm.domain.sld;
 | 
			
		||||
        tld = vm.domain.tld;
 | 
			
		||||
      }
 | 
			
		||||
    } else {
 | 
			
		||||
      parts = vm.currentHost.split('.');
 | 
			
		||||
      // TODO get list of tlds
 | 
			
		||||
@ -179,6 +199,14 @@ app.controller('websiteCtrl', [
 | 
			
		||||
      sub = parts.join('.');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // already validated
 | 
			
		||||
    if (vm.sites.some(function (r) {
 | 
			
		||||
      return -1 !== ('.' + vm.currentHost).indexOf(('.' + r.domain));
 | 
			
		||||
    })) {
 | 
			
		||||
      vm._createWebsite(pkg);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // We're making a request to claim a domain
 | 
			
		||||
    // (because two users could both claim a single domain)
 | 
			
		||||
    // We're claiming it at the top level (i.e. example.com)
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,7 @@ OAUTH3._pkgs['www@daplie.com'] = {
 | 
			
		||||
  add: function (opts) {
 | 
			
		||||
    var providerUri = opts.audience;
 | 
			
		||||
    var session = opts.session;
 | 
			
		||||
    debugger;
 | 
			
		||||
 | 
			
		||||
    return OAUTH3.request({
 | 
			
		||||
      method: 'POST'
 | 
			
		||||
    , url: OAUTH3.url.normalize(providerUri)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user