diff --git a/css/styles.css b/css/styles.css
index 095493c..616cebd 100644
--- a/css/styles.css
+++ b/css/styles.css
@@ -632,3 +632,47 @@ h2.ssb-title {
.folder-actions-list li {
padding: 5px 0px;
}
+
+
+
+multiselect {
+ display:block;
+}
+multiselect .btn {
+ width: 100%;
+ background-color: #FFF;
+}
+multiselect .btn.error{
+ border: 1px solid #da4f49 !important;
+}
+multiselect .dropdown-menu {
+ max-height: 300px;
+ overflow-y: auto;
+}
+multiselect .dropdown-menu {
+ width: 100%;
+ box-sizing: border-box;
+ padding: 2px;
+}
+multiselect .dropdown-menu > li > a {
+ padding: 3px 10px;
+ cursor:pointer;
+}
+.icon-ok:before {
+ content: "\f00c";
+ font-family: FontAwesome;
+ font-style: normal;
+ font-weight: normal;
+ text-decoration: inherit;
+ color: #000;
+ font-size: 14px;
+}
+.icon-remove:before {
+ content: "\f00d";
+ font-family: FontAwesome;
+ font-style: normal;
+ font-weight: normal;
+ text-decoration: inherit;
+ color: #000;
+ font-size: 14px;
+}
diff --git a/index.html b/index.html
index 01143de..31bff41 100644
--- a/index.html
+++ b/index.html
@@ -34,6 +34,7 @@
+
diff --git a/js/app.js b/js/app.js
index 01313a5..a83d6ed 100644
--- a/js/app.js
+++ b/js/app.js
@@ -4,7 +4,7 @@
var angular = window.angular;
var OAUTH3 = window.OAUTH3;
-var app = window.app = angular.module('launchpad', ['oauth3.org', 'ui.router', 'LocalStorageModule', 'angucomplete-alt', 'ez.fileTree']);
+var app = window.app = angular.module('launchpad', ['oauth3.org', 'ui.router', 'LocalStorageModule', 'angucomplete-alt', 'ez.fileTree', 'ui.multiselect']);
app.directive('daplieFileChange', function () {
return {
diff --git a/js/controllers/website-controller.js b/js/controllers/website-controller.js
index 16f4aad..eba9bc6 100644
--- a/js/controllers/website-controller.js
+++ b/js/controllers/website-controller.js
@@ -523,6 +523,12 @@ app.controller('websiteCtrl', [
vm.Shares = {};
vm.Shares.invite = function (r) {
+ if (vm.copiedShareMode === undefined) {
+ r.shareMode = '';
+ } else {
+ r.shareMode = vm.copiedShareMode;
+ }
+ r.sharePath = vm.autoPopulateWebPath;
var pkg = Auth.oauth3.pkg('www@daplie.com');
return pkg.invite({
comment: r.shareEmail
@@ -652,6 +658,22 @@ app.controller('websiteCtrl', [
}
});
+ $scope.$watch('selectedAccess', function (selectedAccess) {
+ if (selectedAccess.length !== 0) {
+ vm.accessLevelArry = [];
+ vm.prettyAccessArray = [];
+ selectedAccess.forEach(function(letter) {
+ vm.prettyAccessArray.push(letter.name);
+ vm.accessLevelArry.push(letter.value);
+ });
+ vm.prettyShareMode = vm.prettyAccessArray.join(", ");
+ vm.copiedShareMode = vm.accessLevelArry.join(",");
+ }
+ });
+
+ $scope.selectedAccess = [];
+ $scope.accessLevel = [{ name: 'Read', value: 'r' }, { name: 'Write', value: 'w' }, { name: 'Invite', value: 'x' }];
+
$scope.localDomainSearch = function(str, domain) {
var matches = [];
domain.forEach(function(domain) {
@@ -695,6 +717,7 @@ app.controller('websiteCtrl', [
vm.displayFileTree = false;
vm.websiteTiles = false;
vm.showBackBtn = false;
+ vm.autoPopulateWebPath = '';
}, 150);
};
}]);
@@ -744,5 +767,5 @@ app.filter('stringify', function() {
app.filter('capitalize', function() {
return function(input) {
return (!!input) ? input.charAt(0).toUpperCase() + input.substr(1).toLowerCase() : '';
- }
+ };
});
diff --git a/js/lib/angular/multiselect-dropdown.js b/js/lib/angular/multiselect-dropdown.js
new file mode 100644
index 0000000..aaa60f6
--- /dev/null
+++ b/js/lib/angular/multiselect-dropdown.js
@@ -0,0 +1,262 @@
+angular.module('ui.multiselect', [])
+
+//from bootstrap-ui typeahead parser
+.factory('optionParser', ['$parse', function ($parse) {
+
+ var TYPEAHEAD_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+(.*)$/;
+
+ return {
+ parse: function (input) {
+
+ var match = input.match(TYPEAHEAD_REGEXP), modelMapper, viewMapper, source;
+ if (!match) {
+ throw new Error(
+ "Expected typeahead specification in form of '_modelValue_ (as _label_)? for _item_ in _collection_'" +
+ " but got '" + input + "'.");
+ }
+
+ return {
+ itemName: match[3],
+ source: $parse(match[4]),
+ viewMapper: $parse(match[2] || match[1]),
+ modelMapper: $parse(match[1])
+ };
+ }
+ };
+ }])
+
+ .directive('multiselect', ['$parse', '$document', '$compile', 'optionParser',
+
+ function ($parse, $document, $compile, optionParser) {
+ return {
+ restrict: 'E',
+ require: 'ngModel',
+ link: function (originalScope, element, attrs, modelCtrl) {
+
+ var exp = attrs.options,
+ parsedResult = optionParser.parse(exp),
+ isMultiple = attrs.multiple ? true : false,
+ required = false,
+ scope = originalScope.$new(),
+ changeHandler = attrs.change || anguler.noop;
+
+ scope.items = [];
+ scope.header = 'Select';
+ scope.multiple = isMultiple;
+ scope.disabled = false;
+
+ originalScope.$on('$destroy', function () {
+ scope.$destroy();
+ });
+
+ var popUpEl = angular.element('
Share Path: /
-Actions Allowed: rwx
+Actions Allowed: {{ vm.prettyShareMode }}
Invite: pending