diff --git a/css/styles.css b/css/styles.css index a548e1d..f9223ff 100644 --- a/css/styles.css +++ b/css/styles.css @@ -784,7 +784,7 @@ multiselect .dropdown-menu > li > a { z-index: -1; } -.referrer-modal h2 { +.referrer-modal h4 { font-family: 'Montserrat', Verdana, Sans-Serif; color: coral; } diff --git a/js/app.js b/js/app.js index a81e87e..666dc8e 100644 --- a/js/app.js +++ b/js/app.js @@ -168,7 +168,6 @@ app.run(['$rootScope', '$state', 'Auth', '$location', function($rootScope, $stat fromPath: fromState.url }; $rootScope.urlCrumbs.push(Crumbs); - console.log($rootScope.urlCrumbs); if (requiresLogin && !Auth.isLoggedIn()) { event.preventDefault(); $state.go('splash-page', { 'toState': toState.name }); diff --git a/js/controllers/login-controller.js b/js/controllers/login-controller.js index 55e58f7..b050f70 100644 --- a/js/controllers/login-controller.js +++ b/js/controllers/login-controller.js @@ -29,14 +29,18 @@ app.controller('loginCtrl', [ if ($location.hash() !== '') { var str = $location.hash(); var domain = str.split('=')[1]; - vm.referrerAlert.msg = domain + " has been created. What next?" - debugger - + 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'; }; } } diff --git a/js/controllers/website-controller.js b/js/controllers/website-controller.js index 41a4ec2..4c569ce 100644 --- a/js/controllers/website-controller.js +++ b/js/controllers/website-controller.js @@ -75,6 +75,7 @@ app.controller('websiteCtrl', [ vm.copyUploadPath = ''; vm.displaySpinner = ''; vm.deleteAll = ''; + vm.referrerSelectedDomain = false; vm.alertNotification = { hidden: 'hidden' }; @@ -189,16 +190,26 @@ app.controller('websiteCtrl', [ console.log(vm.record); }; - vm.shareInit = function () { + vm.paramInit = function () { + // Share example -> ?token=fe8386d7ad6273bd9ca29864148c0d2d if ($rootScope.urlCrumbs[$rootScope.urlCrumbs.length -1].params.token !== undefined) { vm.Shares.inviteToken = $rootScope.urlCrumbs[$rootScope.urlCrumbs.length -1].params.token; var result = { data: { info: true } }; var msg = "You have a new share."; vm.buildNotification(result, msg); } + console.log($rootScope,$location); + // 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; @@ -361,7 +372,6 @@ app.controller('websiteCtrl', [ r.newFile = vm.newFile; } analyzeFile(r.newFile, r); - debugger; console.log(r); }; @@ -560,7 +570,7 @@ app.controller('websiteCtrl', [ path = vm.cleanedPath; } debugger; - // FIXME: Figure out how to download specific folders + // FIXME: Figure out how to download specific folders return pkg.archive({ hostname: r.domain , domain: r.domain @@ -744,8 +754,20 @@ app.controller('websiteCtrl', [ Auth.api('domains.list', {}).then(function (els) { // console.log('[init] domains.list els:'); // console.log(els); - vm.domains = els; - $scope.domain = vm.domains; + if (vm.referrerSelectedDomain) { + Object.keys(els).forEach(function (key) { + console.log(key); + console.log(els[key]) + if (els[key]['domain'] === vm.referrerSelectedDomainName) { + // vm.domains = els[key]; + vm.domains = []; + $scope.domain = vm.domains; + } + }) + } else { + vm.domains = els; + $scope.domain = vm.domains; + } }); vm.listSites(); diff --git a/templates/website.html b/templates/website.html index 18447f9..3bd9ee2 100644 --- a/templates/website.html +++ b/templates/website.html @@ -1,11 +1,11 @@ -
+

Create Share

- diff --git a/templates/widgets/referrer.html b/templates/widgets/referrer.html index cd7d42d..564c3a1 100644 --- a/templates/widgets/referrer.html +++ b/templates/widgets/referrer.html @@ -1,9 +1,9 @@ -
+
-

{{ vm.referrerAlert.msg }}

-

asdf

+

{{ vm.referrerAlert.title }}

+

{{ vm.referrerAlert.msg }}

Close - Maybe later - Do it now + Maybe later + Do it now