\ No newline at end of file
diff --git a/DataOne.AngularFrontendShowcases/app/allProfiles/allProfiles_Material.html b/DataOne.AngularFrontendShowcases/app/allProfiles/allProfiles_Material.html
new file mode 100644
index 0000000..b1ddebd
--- /dev/null
+++ b/DataOne.AngularFrontendShowcases/app/allProfiles/allProfiles_Material.html
@@ -0,0 +1,62 @@
+
+
1. Lorem ipsum dolor sit amet, ne quod novum mei. Sea omnium invenire mediocrem at, in lobortis conclusionemque nam. Ne deleniti appetere reprimique pro, inani labitur disputationi te sed. At vix sale omnesque, id pro labitur reformidans accommodare, cum labores honestatis eu. Nec quem lucilius in, eam praesent reformidans no. Sed laudem aliquam ne.
+
2. Facete delenit argumentum cum at. Pro rebum nostrum contentiones ad. Mel exerci tritani maiorum at, mea te audire phaedrum, mel et nibh aliquam. Malis causae equidem vel eu. Noster melius vis ea, duis alterum oporteat ea sea. Per cu vide munere fierent.
+
3. Ad sea dolor accusata consequuntur. Sit facete convenire reprehendunt et. Usu cu nonumy dissentiet, mei choro omnes fuisset ad. Te qui docendi accusam efficiantur, doming noster prodesset eam ei. In vel posse movet, ut convenire referrentur eum, ceteros singulis intellegam eu sit.
+
4. Est in vivendum comprehensam conclusionemque, alia cetero iriure no usu, te cibo deterruisset pro. Ludus epicurei quo id, ex cum iudicabit intellegebat. Ex modo deseruisse quo, mel noster menandri sententiae ea, duo et tritani malorum recteque. Nullam suscipit partiendo nec id, indoctum vulputate per ex. Et has enim habemus tibique. Cu latine electram cum, ridens propriae intellegat eu mea.
+
5. Duo at aliquid mnesarchum, nec ne impetus hendrerit. Ius id aeterno debitis atomorum, et sed feugait voluptua, brute tibique no vix. Eos modo esse ex, ei omittam imperdiet pro. Vel assum albucius incorrupte no. Vim viris prompta repudiare ne, vel ut viderer scripserit, dicant appetere argumentum mel ea. Eripuit feugait tincidunt pri ne, cu facilisi molestiae usu.
+
6. Qui utamur tacimates quaestio ad, quod graece omnium ius ut. Pri ut vero debitis interpretaris, qui cu mentitum adipiscing disputationi. Voluptatum mediocritatem quo ut. Fabulas dolorem ei has, quem molestie persequeris et sit.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DataOne.AngularFrontendShowcases/app/createProfile/createProfile_Material.html b/DataOne.AngularFrontendShowcases/app/createProfile/createProfile_Material.html
new file mode 100644
index 0000000..aea3869
--- /dev/null
+++ b/DataOne.AngularFrontendShowcases/app/createProfile/createProfile_Material.html
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
+ account_circle
+
+
+
+ Bitte einen Benutzernamen eingeben (kein ; erlaubt).
+
+
+
+
+
+
+ face
+
+
+
+ Bitte einen Namen angeben.
+
+
+
+
+
+
+
+
+
+ place
+
+
+
Bitte eine gültige PLZ angeben.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Männlich
+ Weiblich
+
+
+
+
+
+
+
+
+
+ description
+
+
+
+
+
+ Ich bin kein Roboter
+ Ich bin ein Roboter
+
+
1. Lorem ipsum dolor sit amet, ne quod novum mei. Sea omnium invenire mediocrem at, in lobortis conclusionemque nam. Ne deleniti appetere reprimique pro, inani labitur disputationi te sed. At vix sale omnesque, id pro labitur reformidans accommodare, cum labores honestatis eu. Nec quem lucilius in, eam praesent reformidans no. Sed laudem aliquam ne.
+
2. Facete delenit argumentum cum at. Pro rebum nostrum contentiones ad. Mel exerci tritani maiorum at, mea te audire phaedrum, mel et nibh aliquam. Malis causae equidem vel eu. Noster melius vis ea, duis alterum oporteat ea sea. Per cu vide munere fierent.
+
3. Ad sea dolor accusata consequuntur. Sit facete convenire reprehendunt et. Usu cu nonumy dissentiet, mei choro omnes fuisset ad. Te qui docendi accusam efficiantur, doming noster prodesset eam ei. In vel posse movet, ut convenire referrentur eum, ceteros singulis intellegam eu sit.
+
4. Est in vivendum comprehensam conclusionemque, alia cetero iriure no usu, te cibo deterruisset pro. Ludus epicurei quo id, ex cum iudicabit intellegebat. Ex modo deseruisse quo, mel noster menandri sententiae ea, duo et tritani malorum recteque. Nullam suscipit partiendo nec id, indoctum vulputate per ex. Et has enim habemus tibique. Cu latine electram cum, ridens propriae intellegat eu mea.
+
5. Duo at aliquid mnesarchum, nec ne impetus hendrerit. Ius id aeterno debitis atomorum, et sed feugait voluptua, brute tibique no vix. Eos modo esse ex, ei omittam imperdiet pro. Vel assum albucius incorrupte no. Vim viris prompta repudiare ne, vel ut viderer scripserit, dicant appetere argumentum mel ea. Eripuit feugait tincidunt pri ne, cu facilisi molestiae usu.
+
6. Qui utamur tacimates quaestio ad, quod graece omnium ius ut. Pri ut vero debitis interpretaris, qui cu mentitum adipiscing disputationi. Voluptatum mediocritatem quo ut. Fabulas dolorem ei has, quem molestie persequeris et sit.
+
+
+
+ Ich stimme den Nutzungsbedingungen zu. *
+
+
+ Zum Anlegen eines neuen Benutzers, muss den Nutzungsbedingungen zugestimmt werden.
+
\ No newline at end of file
diff --git a/DataOne.AngularFrontendShowcases/app/factories/notifications.bootstrap.prompt.html b/DataOne.AngularFrontendShowcases/app/factories/notifications.bootstrap.prompt.html
new file mode 100644
index 0000000..6a24138
--- /dev/null
+++ b/DataOne.AngularFrontendShowcases/app/factories/notifications.bootstrap.prompt.html
@@ -0,0 +1,24 @@
+
+
+
{{title}}
+
+
+
{{text}}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DataOne.AngularFrontendShowcases/app/factories/notifications.factory.js b/DataOne.AngularFrontendShowcases/app/factories/notifications.factory.js
new file mode 100644
index 0000000..35c97be
--- /dev/null
+++ b/DataOne.AngularFrontendShowcases/app/factories/notifications.factory.js
@@ -0,0 +1,145 @@
+(function () {
+ 'use strict';
+
+ angular.module('app').factory('notifications', notifications);
+
+ notifications.$inject = ['$mdDialog', '$mdToast', '$uibModal'];
+
+ function notifications($mdDialog, $mdToast, $uibModal) {
+ var material = {
+ showMessage: showMaterialToast,
+ showConfirm: showMaterialConfirm,
+ showPrompt: showMaterialPrompt
+ };
+
+ var bootstrap = {
+ showMessage: showBootstrapToast,
+ showConfirm: showBootstrapConfirm,
+ showPrompt: showBootstrapPrompt
+ }
+
+ return {
+ material: material,
+ bootstrap: bootstrap
+ };
+
+ function showMaterialToast(text) {
+ var toast = $mdToast.show($mdToast.simple()
+ .textContent(text)
+ .action('x')
+ .hideDelay(1500)
+ .position('top right'));
+ }
+
+ function showMaterialConfirm(title, text, confirmText, cancelText, confirmCallback, cancelCallback) {
+ var confirm = $mdDialog.confirm();
+ confirm.title(title);
+ confirm.textContent(text);
+ confirm.ok(confirmText);
+ confirm.cancel(cancelText);
+ confirm.clickOutsideToClose(true);
+
+ $mdDialog.show(confirm).then(confirmCallback, cancelCallback);
+ }
+
+ function showMaterialPrompt(title, text, placeholder, confirmText, cancelText, confirmCallback, cancelCallback) {
+ var prompt = $mdDialog.prompt();
+ prompt.title(title);
+ prompt.textContent(text);
+ prompt.placeholder(placeholder);
+ prompt.ok(confirmText);
+ prompt.cancel(cancelText);
+
+ $mdDialog.show(prompt).then(function (result) {
+ confirmCallback(result);
+ },
+ cancelCallback);
+ }
+
+ function showBootstrapToast(text, kind) {
+ var toastId = 'uib-toast';
+ var toast = document.getElementById(toastId);
+
+ if (toast) {
+ clearTimeout(toast.timeoutId);
+ hideToast(toast);
+ }
+ else {
+ toast = document.createElement('div');
+ toast.id = toastId;
+ toast.setAttribute('uib-alert', '');
+
+ var toastText = document.createElement('span');
+ toastText.id = 'uib-toast-text';
+ toastText.innerText = text;
+ toast.appendChild(toastText);
+
+ var close = document.createElement('button');
+ close.className = 'close';
+ close.innerText = 'x';
+ close.style.minWidth = '0';
+ close.addEventListener('click', function () {
+ clearTimeout(toast.timeoutId);
+ hideToast(toast);
+ });
+ toast.appendChild(close);
+
+ document.body.appendChild(toast);
+ }
+ toast.className = 'alert alert-' + kind;
+
+ document.getElementById('uib-toast-text').innerText = text;
+
+ setTimeout(function () {
+ toast.style.opacity = '1';
+ toast.style.visibility = 'visible';
+ toast.style.marginTop = '0';
+ }, 250);
+
+ toast.timeoutId = setTimeout(function () { hideToast(toast); }, 2700);
+
+ function hideToast(t) {
+ t.style.opacity = '0';
+ toast.style.visibility = 'hidden';
+ t.style.marginTop = '-100px';
+ }
+ }
+
+ function showBootstrapConfirm(title, text, confirmText, cancelText, confirmCallback, cancelCallback) {
+ var modelInstance = $uibModal.open({
+ templateUrl: '../factories/notifications.bootstrap.confirm.html',
+ controller: 'ConfirmController',
+ resolve: {
+ items: function () {
+ return {
+ title: title,
+ text: text,
+ confirmText: confirmText,
+ cancelText: cancelText
+ }
+ }
+ }
+ });
+ modelInstance.result.then(confirmCallback, cancelCallback);
+ }
+
+ function showBootstrapPrompt(title, text, placeholder, confirmText, cancelText, confirmCallback, cancelCallback) {
+ var modelInstance = $uibModal.open({
+ templateUrl: '../factories/notifications.bootstrap.prompt.html',
+ controller: 'ConfirmController',
+ resolve: {
+ items: function () {
+ return {
+ title: title,
+ text: text,
+ placeholder: placeholder,
+ confirmText: confirmText,
+ cancelText: cancelText
+ }
+ }
+ }
+ });
+ modelInstance.result.then(confirmCallback, cancelCallback);
+ }
+ }
+})();
\ No newline at end of file
diff --git a/DataOne.AngularFrontendShowcases/app/factories/profiles.factory.js b/DataOne.AngularFrontendShowcases/app/factories/profiles.factory.js
new file mode 100644
index 0000000..d22066b
--- /dev/null
+++ b/DataOne.AngularFrontendShowcases/app/factories/profiles.factory.js
@@ -0,0 +1,402 @@
+(function () {
+ 'use strict';
+ angular.module('app').factory('profilesFactory', profilesFactory);
+
+ profilesFactory.$inject = ['$http', '$q', 'OwnUser'];
+
+ function profilesFactory($http, $q, OwnUser) {
+ var _listTitle = 'UserList';
+ var _ownUser = OwnUser;
+ var _ownProfile = null;
+ var _isOwnProfile = true;
+
+ return {
+ get isOwnProfile() { return _isOwnProfile },
+ createProfile: createProfile,
+ updateProfile: updateProfile,
+ getProfile: getProfile,
+ getProfilePicture: getProfilePicture,
+ getAllProfiles: getAllProfiles,
+ getOwnContacts: getOwnContacts,
+ addContact: addContact,
+ removeContact: removeContact
+ };
+
+ function createProfile(profileValues) {
+ var deferred = $q.defer();
+
+ getProfile(profileValues.username).then(function (profile) {
+ deferred.reject('Der Benutzer existiert bereits!');
+ }, function (error) {
+ var context = SP.ClientContext;
+ context = context.get_current();
+ var web = context.get_web();
+ var list = web.get_lists().getByTitle(_listTitle);
+
+ var itemCreateInfo = new SP.ListItemCreationInformation();
+ var listItem = list.addItem(itemCreateInfo);
+
+ listItem.set_item('Title', profileValues.username);
+ listItem.set_item('RealName', profileValues.realName);
+ listItem.set_item('UeberMich', profileValues.aboutMe);
+ listItem.set_item('PLZ', profileValues.plz);
+ listItem.set_item('Roboter', profileValues.isRobot);
+ listItem.set_item('Gender', profileValues.gender);
+ listItem.update();
+
+ context.load(listItem);
+ context.executeQueryAsync(Function.createDelegate(this, function (sender, args) {
+ deferred.resolve('user created');
+ }), Function.createDelegate(this, function (sender, args) {
+ deferred.reject(args.get_message());
+ }));
+ });
+ return deferred.promise;
+ }
+
+ function updateProfile(updatedProfile) {
+ var deferred = $q.defer();
+
+ var context = SP.ClientContext;
+ context = context.get_current();
+ var web = context.get_web();
+ var list = web.get_lists().getByTitle(_listTitle);
+
+ var listItem = list.getItemById(updatedProfile.id);
+
+ listItem.set_item('RealName', updatedProfile.realName);
+ listItem.set_item('UeberMich', updatedProfile.aboutMe);
+ listItem.set_item('PLZ', updatedProfile.plz);
+
+ updatedProfile.hobbies = updatedProfile.hobbies.filter(function (x, index, array) {
+ return array.indexOf(x) == index;
+ });
+ updatedProfile.hobbies.forEach(function (value, index, array) {
+ array[index] = value.trim();
+ });
+ listItem.set_item('Hobbys', updatedProfile.hobbies.join(';'));
+
+ updatedProfile.games = updatedProfile.games.filter(function (x, index, array) {
+ return array.indexOf(x) == index;
+ });
+ updatedProfile.games.forEach(function (value, index, array) {
+ array[index] = value.trim();
+ });
+ listItem.set_item('Spiele', updatedProfile.games.join(';'));
+
+ updatedProfile.music = updatedProfile.music.filter(function (x, index, array) {
+ return array.indexOf(x) == index;
+ });
+ updatedProfile.music.forEach(function (value, index, array) {
+ array[index] = value.trim();
+ });
+ listItem.set_item('Musik', updatedProfile.music.join(';'));
+
+ listItem.set_item('Birthday', updatedProfile.birthday);
+ listItem.set_item('Groesse', updatedProfile.size);
+ listItem.set_item('Kontakte', updatedProfile.allContacts);
+ listItem.set_item('Roboter', updatedProfile.isRobot);
+ listItem.set_item('Bundesland', updatedProfile.state);
+ listItem.set_item('Gender', updatedProfile.gender);
+ listItem.set_item('Bild', updatedProfile.picture);
+ listItem.update();
+
+ context.load(listItem);
+ context.executeQueryAsync(Function.createDelegate(this, function (sender, args) {
+ deferred.resolve();
+ if (updatedProfile.username == _ownUser) {
+ _isOwnProfile = true;
+ // only update if successful
+ _ownProfile = {};
+ angular.copy(updatedProfile, _ownProfile);
+ }
+ }), Function.createDelegate(this, function (sender, args) {
+ deferred.reject(args.get_message());
+ console.debug(args.get_message());
+ }));
+
+ return deferred.promise;
+ }
+
+ function getProfile(username) {
+ var deferred = $q.defer();
+ var profile = {};
+
+ if (!username || username == _ownUser) {
+ username = _ownUser;
+ _isOwnProfile = true;
+ }
+ else {
+ _isOwnProfile = false;
+ }
+ if (_isOwnProfile && _ownProfile) {
+ var returnObject = {};
+ angular.copy(_ownProfile, returnObject);
+ deferred.resolve(returnObject);
+ return deferred.promise;
+ }
+
+ var context = SP.ClientContext;
+ context = context.get_current();
+ var web = context.get_web();
+ var list = web.get_lists().getByTitle(_listTitle);
+
+ var camlQuery = new SP.CamlQuery();
+ camlQuery.set_viewXml("" + username + "");
+
+ var collListItem = list.getItems(camlQuery);
+
+ context.load(collListItem);
+ context.executeQueryAsync(Function.createDelegate(this, function (sender, args) {
+ var listItem = collListItem.getItemAtIndex(0);
+
+ if (!listItem) {
+ deferred.reject('user not found');
+ return deferred.promise;
+ }
+
+ var user = listItem.get_item('Title');
+ profile.id = listItem.get_item('ID');
+ profile.username = username;
+ profile.realName = listItem.get_item('RealName');
+ profile.aboutMe = listItem.get_item('UeberMich');
+ profile.plz = listItem.get_item('PLZ');
+
+ var hobbies = listItem.get_item('Hobbys');
+ profile.hobbies = hobbies == null ? [] : hobbies.split(';');
+
+ var games = listItem.get_item('Spiele');
+ profile.games = games == null ? [] : games.split(';');
+
+ var music = listItem.get_item('Musik');
+ profile.music = music == null ? [] : music.split(';');
+
+ profile.birthday = listItem.get_item('Birthday');
+ profile.size = listItem.get_item('Groesse');
+ if (!profile.size) {
+ profile.size = 50;
+ }
+ profile.allContacts = listItem.get_item('Kontakte') || "";
+ profile.isRobot = listItem.get_item('Roboter');
+ profile.state = listItem.get_item('Bundesland');
+ profile.gender = listItem.get_item('Gender');
+
+ if (listItem.get_item('Bild')) {
+ profile.picture = listItem.get_item('Bild');
+ }
+ if (username == _ownUser) {
+ _ownProfile = {};
+ angular.copy(profile, _ownProfile);
+ }
+ deferred.resolve(profile);
+ }), Function.createDelegate(this, function (sender, args) {
+ deferred.reject(args.get_message());
+ console.debug(args.get_message());
+ }));
+ return deferred.promise;
+ }
+
+ function getProfilePicture(username, index) {
+ var deferred = $q.defer();
+ var picture;
+
+ var context = SP.ClientContext;
+ context = context.get_current();
+ var web = context.get_web();
+ var list = web.get_lists().getByTitle(_listTitle);
+
+ var camlQuery = new SP.CamlQuery();
+ camlQuery.set_viewXml("" + username + "");
+ camlQuery.ViewFields = "";
+
+ var collListItem = list.getItems(camlQuery);
+
+ context.load(collListItem);
+ context.executeQueryAsync(Function.createDelegate(this, function (sender, args) {
+ var listItemEnumerator = collListItem.getEnumerator();
+
+ while (listItemEnumerator.moveNext()) {
+ var listItem = listItemEnumerator.get_current();
+ picture = listItem.get_item('Bild');
+ break;
+ }
+ deferred.resolve({ picture: picture, index: index });
+ }), Function.createDelegate(this, function (sender, args) {
+ deferred.reject(args.get_message());
+ console.debug(args.get_message());
+ }));
+ return deferred.promise;
+ }
+
+ function getAllProfiles(lastId) {
+ var deferred = $q.defer();
+
+ if (!_ownProfile) {
+ getProfile(_ownUser).then(function (profile) {
+ getAll(lastId).then(function (d) {
+ deferred.resolve(d);
+ }, function (e) {
+ deferred.reject(e);
+ });
+ });
+ }
+ else {
+ getAll(lastId).then(function (d) {
+ deferred.resolve(d);
+ }, function (e) {
+ deferred.reject(e);
+ });;
+ }
+ return deferred.promise;
+ }
+
+ function getAll(lastId) {
+ var deferred = $q.defer();
+ var profiles = [];
+
+ $http({
+ method: 'GET',
+ url: location.pathname.slice(0, location.pathname.indexOf('app')) + "_api/lists/GetByTitle('UserList')/Items?$top=10&$skiptoken=Paged=TRUE%26p_ID=" + lastId,
+ headers: {
+ 'accept': 'application/json;odata=verbose'
+ }
+ }).then(function success(response) {
+ var allProfiles = response.data.d.results;
+ var id = 0;
+
+ for (var i = 0; i < allProfiles.length; i++) {
+ var listItem = allProfiles[i];
+ var profile = {};
+ id = listItem['ID'];
+ profile.id = id;
+ profile.username = listItem['Title'];
+
+ if (profile.username == _ownUser) {
+ continue;
+ }
+
+ profile.realName = listItem['RealName'];
+ profile.birthday = listItem['Birthday'];
+ profile.plz = listItem['PLZ'];
+ profile.gender = listItem['Gender'];
+ profile.state = listItem['Bundesland'];
+ profile.isRobot = listItem['Roboter'];
+ profile.isContact = false;
+
+ if (_ownProfile && _ownProfile.username) {
+ var allContacts = _ownProfile.allContacts.split(';');
+ for (var j = 0; j < allContacts.length; j++) {
+ if (allContacts[j] == profile.username) {
+ profile.isContact = true;
+ break;
+ }
+ }
+ }
+ if (listItem['Bild']) {
+ profile.picture = listItem['Bild'].Url;
+ }
+
+ if (profile.birthday) {
+ profile.birthday = new Date(profile.birthday);
+ profile.age = Date.now() - profile.birthday.getTime();
+ profile.age = Math.abs(new Date(profile.age).getUTCFullYear() - 1970);
+ }
+
+ profiles.push(profile);
+ }
+ if (!response.data.d.__next) {
+ id = 0;
+ }
+ deferred.resolve({
+ id: id,
+ profiles: profiles
+ });
+ }, function error(response) {
+ deferred.reject(response.status);
+ })
+
+ return deferred.promise;
+ }
+
+ function getOwnContacts() {
+ var deferred = $q.defer();
+
+ if (_ownProfile && _ownProfile.allContacts) {
+ deferred.resolve(_ownProfile.allContacts);
+ }
+ getProfile(_ownUser).then(function (profile) {
+ deferred.resolve(profile.allContacts);
+ }, function (error) {
+ deferred.resolve("");
+ });
+ return deferred.promise;
+ }
+
+ function addContact(contact) {
+ var deferred = $q.defer();
+
+ if (!_ownProfile) {
+ deferred.reject(error);
+ }
+ else {
+ add();
+ }
+
+ function add() {
+ var allContacts = _ownProfile.allContacts.split(';');
+ for (var i = 0; i < allContacts.length; i++) {
+ if (allContacts[i] == contact) {
+ deferred.reject('contact already exists');
+ return;
+ }
+ }
+
+ if (_ownProfile.allContacts.length > 0 && !_ownProfile.allContacts.endsWith(';')) {
+ contact = ';' + contact;
+ }
+ _ownProfile.allContacts = _ownProfile.allContacts.concat(contact);
+
+ updateProfile(_ownProfile).then(function (message) {
+ deferred.resolve(message);
+ }, function (error) {
+ deferred.reject(error)
+ });
+ }
+
+ return deferred.promise;
+ }
+
+ function removeContact(contact) {
+ var deferred = $q.defer();
+
+ if (!_ownProfile) {
+ deferred.reject(error);
+ }
+ else {
+ remove();
+ }
+
+ function remove() {
+ var contacts = _ownProfile.allContacts.split(';');
+ for (var i = 0; i < contacts.length; i++) {
+ if (contacts[i] == contact) {
+ contacts.splice(i, 1);
+ break;
+ }
+ }
+ var all = contacts[0];
+ for (var i = 1; i < contacts.length; i++) {
+ all += ';' + contacts[i];
+ }
+ _ownProfile.allContacts = all || "";
+ updateProfile(_ownProfile).then(function (message) {
+ deferred.resolve(message);
+ }, function (error) {
+ deferred.reject(error);
+ });
+ }
+
+ return deferred.promise;
+ }
+ }
+})();
\ No newline at end of file
diff --git a/DataOne.AngularFrontendShowcases/app/init.js b/DataOne.AngularFrontendShowcases/app/init.js
new file mode 100644
index 0000000..b9511ea
--- /dev/null
+++ b/DataOne.AngularFrontendShowcases/app/init.js
@@ -0,0 +1,12 @@
+(function () {
+ 'use strict';
+
+ ExecuteOrDelayUntilScriptLoaded(initializePage, "sp.js");
+
+ function initializePage() {
+ var meta = document.createElement('meta');
+ meta.name = 'viewport';
+ meta.content = 'width=device-width, initial-scale=1.0, target-densitydpi=device-dpi';
+ document.head.appendChild(meta);
+ }
+})();
\ No newline at end of file
diff --git a/DataOne.AngularFrontendShowcases/app/layout/Default.aspx b/DataOne.AngularFrontendShowcases/app/layout/Default.aspx
new file mode 100644
index 0000000..18f7911
--- /dev/null
+++ b/DataOne.AngularFrontendShowcases/app/layout/Default.aspx
@@ -0,0 +1,67 @@
+<%-- The following 4 lines are ASP.NET directives needed when using SharePoint components --%>
+
+<%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" MasterPageFile="~masterurl/default.master" Language="C#" %>
+
+<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
+<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
+<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
+
+<%-- The markup and script in the following Content element will be placed in the of the page --%>
+
+
+
+
+
+
+
+
+ <%-- angular material --%>
+
+
+
+
+
+ <%-- bootstrap ui --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<%-- The markup in the following Content element will be placed in the TitleArea of the page --%>
+
+ Angular Frontend Showcases
+
+
+<%-- The markup and script in the following Content element will be placed in the of the page --%>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DataOne.AngularFrontendShowcases/app/layout/navigation.controller.js b/DataOne.AngularFrontendShowcases/app/layout/navigation.controller.js
new file mode 100644
index 0000000..7594bd9
--- /dev/null
+++ b/DataOne.AngularFrontendShowcases/app/layout/navigation.controller.js
@@ -0,0 +1,68 @@
+(function () {
+ angular.module('app').controller('NavigationController', NavigationController);
+
+ NavigationController.$inject = ['$document', '$location', '$scope', '$state', 'OwnUser'];
+
+ function NavigationController($document, $location, $scope, $state, OwnUser) {
+ $scope.currentPage = $state.current.name;
+ $scope.isNavCollapsed = true;
+ $scope.removeParams = removeParams;
+ $scope.toggleFramework = toggleFramework;
+
+ $document.ready(function () {
+ activateFramework();
+ });
+
+ function activateFramework() {
+ if (!sessionStorage.getItem('UiFramework')) {
+ sessionStorage.setItem('UiFramework', 'material');
+ toggleFramework();
+ }
+ else {
+ setStyle(sessionStorage.getItem('UiFramework'));
+ }
+ }
+
+ function removeParams() {
+ var params = $location.search();
+ if (!params.name || params.name == OwnUser) {
+ return;
+ }
+ $location.search('name', '');
+ $state.reload();
+ }
+
+ function setStyle(framework) {
+ switch (framework) {
+ case 'material':
+ stylesToDisable = document.getElementsByClassName('bootstrap-stylesheet');
+ stylesToEnable = document.getElementsByClassName('material-stylesheet');
+ break;
+ case 'bootstrap':
+ stylesToDisable = document.getElementsByClassName('material-stylesheet');
+ stylesToEnable = document.getElementsByClassName('bootstrap-stylesheet');
+ break;
+ }
+ for (var i = 0; i < stylesToEnable.length; i++) {
+ stylesToEnable[i].disabled = false;
+ }
+ for (var i = 0; i < stylesToDisable.length; i++) {
+ stylesToDisable[i].disabled = true;
+ }
+ }
+
+ function toggleFramework() {
+ switch (sessionStorage.getItem('UiFramework')) {
+ case 'material':
+ sessionStorage.setItem('UiFramework', 'bootstrap');
+ setStyle('bootstrap')
+ break;
+ case 'bootstrap':
+ sessionStorage.setItem('UiFramework', 'material');
+ setStyle('material');
+ break;
+ }
+ $state.reload();
+ }
+ }
+})();
\ No newline at end of file
diff --git a/DataOne.AngularFrontendShowcases/app/layout/navigation_Bootstrap.html b/DataOne.AngularFrontendShowcases/app/layout/navigation_Bootstrap.html
new file mode 100644
index 0000000..3899bb2
--- /dev/null
+++ b/DataOne.AngularFrontendShowcases/app/layout/navigation_Bootstrap.html
@@ -0,0 +1,31 @@
+
\ No newline at end of file
diff --git a/DataOne.AngularFrontendShowcases/app/layout/navigation_Material.html b/DataOne.AngularFrontendShowcases/app/layout/navigation_Material.html
new file mode 100644
index 0000000..676ca03
--- /dev/null
+++ b/DataOne.AngularFrontendShowcases/app/layout/navigation_Material.html
@@ -0,0 +1,16 @@
+
+
+ account_boxProfil
+
+
+ listAlle
+
+
+ person_addNeu
+
+
+
+ brush Framework wechseln
+
+
+
\ No newline at end of file
diff --git a/DataOne.AngularFrontendShowcases/app/oneProfile/oneProfile.controller.js b/DataOne.AngularFrontendShowcases/app/oneProfile/oneProfile.controller.js
new file mode 100644
index 0000000..90f501a
--- /dev/null
+++ b/DataOne.AngularFrontendShowcases/app/oneProfile/oneProfile.controller.js
@@ -0,0 +1,377 @@
+(function () {
+ 'use strict';
+
+ angular.module('app').controller('OneProfileController', OneProfileController);
+
+ OneProfileController.$inject = ['$document', '$location', '$mdDialog', 'notifications', 'profilesFactory', '$scope'];
+
+ function OneProfileController($document, $location, $mdDialog, notifications, profilesFactory, $scope) {
+ var _states = [
+ "Baden-Württemberg", "Bayern", "Berlin ", "Brandenburg", "Bremen ", "Hamburg ", "Hessen", "Mecklenburg-Vorpommern", "Niedersachsen",
+ "Nordrhein-Westfalen", "Rheinland-Pfalz", "Saarland", "Sachsen", "Sachsen-Anhalt", "Schleswig-Holstein", "Thüringen"
+ ];
+
+ $scope.addContact = addContact;
+ $scope.addNewGame = addNewGame;
+ $scope.addNewHobby = addNewHobby;
+ $scope.addNewMusic = addNewMusic;
+ $scope.allContactsNotLoaded = true;
+ $scope.dateOptions = null;
+ $scope.getColor = getColor;
+ $scope.isContact = false;
+ $scope.isDatepickerOpen = false;
+ $scope.isEditModeOn = false;
+ $scope.isLoading = true;
+ $scope.isOwnProfile = false;
+ $scope.isValidBirthday = true;
+ $scope.hobbies = [];
+ $scope.minDate = new Date(1900, 0, 2);
+ $scope.profile = null;
+ $scope.querySearch = querySearch;
+ $scope.removeContact = removeContact;
+ $scope.removeHobby = removeHobby;
+ $scope.removeGame = removeGame;
+ $scope.removeMusic = removeMusic;
+ $scope.reset = reset;
+ $scope.selectedHobby = null;
+ $scope.searchText = null;
+ $scope.showConfirm = showConfirm;
+ $scope.showProfile = showProfile;
+ $scope.showPrompt = showPrompt;
+ $scope.states = _states;
+ $scope.today = new Date();
+ $scope.toggleMode = toggleMode;
+ $scope.validateBirthday = validateBirthday;
+
+ $document.ready(function () {
+ activate();
+ });
+
+ var _profileWithoutChanges = {};
+
+ var _colors = {
+ a: '#5d636d', b: '#2678ff', c: '#7ea5e5', d: '#26cae0', e: '#109674', f: '#6797b9', g: '#11b247', h: '#5a8c3f', i: '#97c41b', j: '#5e6814', k: '#69731b', l: '#bf0000', m: '#dbb915',
+ n: '#b99f22', o: '#f2a710', p: '#af7a0f', q: '#c39a48', r: '#e56b0d', s: '#e55339', t: '#fc9988', u: '#5953aa', v: '#100699', w: '#8632e5', x: '#86719e', y: '#d16fd4', z: '#af4667'
+ };
+
+ var _hobbies = ['Angeln', 'Bouldern', 'Capoera', 'Dart', 'Eiskunstlauf', 'Fallschirmspringen', 'Gartenarbeit', 'Handball', 'Internet', 'Jonglieren', 'Kampfsport', 'Lesen', 'Mountainbiken',
+ 'Nähen', 'Ornithologie', 'Programmieren', 'Quenya', 'Reisen', 'Schwimmen', 'Tauchen', 'Unterwasserhockey', 'Volleyball', 'Wasserski', 'Xyolophon', 'Yakzucht', 'Zeichnen'];
+
+ function activate() {
+ $scope.hobbies = _hobbies;
+ var params = $location.search();
+ var username = params.name;
+
+ profilesFactory.getProfile(username).then(function (profile) {
+ reload(profile);
+ }, function (error) {
+ showToast('Fehler beim Laden des Benutzers!', 'danger');
+ console.error(error);
+ });
+ $scope.isOwnProfile = profilesFactory.isOwnProfile;
+
+ if (!$scope.isOwnProfile) {
+ profilesFactory.getOwnContacts().then(function (contacts) {
+ setIsContact(contacts, username)
+ });
+ }
+
+ var profilePicture = document.getElementById('profile-picture');
+ if (profilePicture) {
+ profilePicture.onload = function () {
+ if (this.width >= this.height) {
+ document.getElementById('profile-picture').className = 'wide';
+ }
+ }
+ }
+ }
+
+ function addContact() {
+ $scope.isContact = true;
+ profilesFactory.addContact($scope.profile.username).then(function (success) {
+ showToast($scope.profile.username + ' ist jetzt ein Favorit von dir!', 'info');
+ }, function (error) {
+ showToast($scope.profile.username + ' konnte nicht hinzugefügt werden! ', 'danger');
+ });
+ }
+
+ function addNewGame() {
+ if ($scope.newGame && $scope.profile.games.indexOf($scope.newGame) < 0) {
+ $scope.profile.games.push($scope.newGame);
+ }
+ $scope.newGame = '';
+ }
+
+ function addNewHobby() {
+ if ($scope.newHobby && $scope.profile.hobbies.indexOf($scope.newHobby) < 0) {
+ $scope.profile.hobbies.push($scope.newHobby);
+ }
+ $scope.newHobby = '';
+ }
+
+ function addNewMusic() {
+ if ($scope.newMusic && $scope.profile.music.indexOf($scope.newMusic) < 0) {
+ $scope.profile.music.push($scope.newMusic);
+ }
+ $scope.newMusic = '';
+ }
+
+ $scope.dateOptions = { // TODO
+ maxDate: $scope.today,
+ minDate: $scope.minDate,
+ startingDay: 1,
+ datepickerMode: 'year',
+ showWeeks: false
+ }
+
+ function getColor(chipName) {
+ var firstChar = chipName[0].toLowerCase();
+ return _colors[firstChar] || 'black';
+ }
+
+ function querySearch(query) {
+ return query ? _hobbies.filter(createFilterFor(query)) : [];
+ }
+
+ function removeContact() {
+ $scope.isContact = false;
+ profilesFactory.removeContact($scope.profile.username).then(function (success) {
+ showToast($scope.profile.username + ' wurde von deinen Favoriten entfernt!', 'info');
+ }, function (error) {
+ showToast($scope.profile.username + ' konnte nicht entfernt werden! ', 'danger');
+ });
+ }
+
+ function removeHobby(hobby) {
+ var index = $scope.profile.hobbies.indexOf(hobby);
+ $scope.profile.hobbies.splice(index, 1);
+ }
+
+ function removeGame(game) {
+ var index = $scope.profile.games.indexOf(game);
+ $scope.profile.games.splice(index, 1);
+ }
+
+ function removeMusic(music) {
+ var index = $scope.profile.music.indexOf(music);
+ $scope.profile.music.splice(index, 1);
+ }
+
+ function reset() {
+ $scope.profile = angular.copy(_profileWithoutChanges);
+ toggleMode();
+ setContacts();
+ setContactPictures();
+
+ // to show contacts in BS-UI tabset
+ setTimeout(function () {
+ try {
+ document.getElementById('tabset')
+ .getElementsByTagName('ul')[0]
+ .getElementsByTagName('li')[0]
+ .getElementsByTagName('a')[0]
+ .click();
+ }
+ catch (ignored) { }
+ }, 1);
+ }
+
+ function setIsContact(allContacts, username) {
+ $scope.allContactsNotLoaded = false;
+
+ var all = allContacts.split(';');
+ for (var i = 0; i < all.length; i++) {
+ if (all[i] == username) {
+ $scope.isContact = true;
+ return;
+ }
+ }
+ $scope.isContact = false;
+ }
+
+ function setContacts() {
+ var contacts = [];
+
+ if ($scope.profile.allContacts) {
+ var allContacts = $scope.profile.allContacts.split(';');
+
+ for (var i = 0; i < allContacts.length; i++) {
+ var contact = {};
+ contact.name = allContacts[i];
+ contacts.push(contact);
+ }
+ }
+ $scope.profile.contacts = [];
+ var contactsPerTab = 12;
+ for (var j = 0; j < contacts.length; j++) {
+ if (j % contactsPerTab == 0) {
+ var sliceEnd = j + contactsPerTab >= contacts.length ? contacts.length : j + contactsPerTab;
+ var subArray = contacts.slice(j, sliceEnd);
+ // add dummies to last contact tab
+ if (subArray.length < contactsPerTab) {
+ var dummies = contactsPerTab - subArray.length;
+ for (var d = 0; d < dummies; d++) {
+ subArray.push({ name: 'dummy', isDummy: true });
+ }
+ }
+ $scope.profile.contacts.push(subArray);
+ }
+ }
+ }
+
+ function setContactPictures() {
+ for (var page = 0; page < $scope.profile.contacts.length; page++) {
+ for (var j = 0; j < $scope.profile.contacts[page].length; j++) {
+ var contact = $scope.profile.contacts[page][j];
+
+ profilesFactory.getProfilePicture(contact.name, { page: page, j: j }).then(function (response) {
+ $scope.profile.contacts[response.index.page][response.index.j].picture = response.picture ? response.picture.$1_1 : null;
+ });
+ }
+ }
+ }
+
+ function showConfirm(event) {
+ if (!$scope.isOwnProfile) {
+ return;
+ }
+ notifications[sessionStorage.getItem('UiFramework')].showConfirm('Änderungen speichern?', 'Alle Änderungen werden dann übernommen.', 'Speichern', 'Abbrechen', update, function () { });
+ }
+
+ function showProfile(contact) {
+ $location.search('name', contact);
+ activate();
+ }
+
+ function showPrompt(event) {
+ $scope.activeSlide = 0;
+ notifications[sessionStorage.getItem('UiFramework')].showPrompt('Bild ändern', 'Hier eine Bild-URL angeben:', 'https://...bild.jpg', 'Ok', 'Abbrechen',
+ function (result) {
+ var picture = new SP.FieldUrlValue();
+ picture.set_description('Profile picture');
+ picture.set_url(result);
+
+ var img = new Image();
+ img.onload = function (e) {
+ $scope.profile.picture = picture;
+ };
+ img.onerror = function () {
+ showToast('Fehlerhafte Bild-URL angegeben!', 'warning');
+ };
+ img.src = result;
+ }, function () { });
+ }
+
+ function toggleMode() {
+ $scope.isEditModeOn = !$scope.isEditModeOn;
+ }
+
+ function validateBirthday() {
+ try {
+ var dateParts = toGermanDate($scope.profile.birthday).split('.');
+ var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
+
+ if (date.getTime() < $scope.minDate.getTime() || date.getTime() > $scope.today.getTime()) {
+ $scope.isValidBirthday = false;
+ return;
+ }
+ }
+ catch (e) {
+ $scope.isValidBirthday = true;
+ console.error('error during validation');
+ return;
+ }
+ $scope.isValidBirthday = true;
+ }
+
+ function reload(profile) {
+ $scope.isLoading = false;
+ $scope.profile = profile;
+ $scope.profile.formattedBirthday = toGermanDate(profile.birthday);
+
+ setContacts();
+ setContactPictures();
+
+ // to show contacts in BS-UI tabset
+ setTimeout(function () {
+ try {
+ document.getElementById('tabset')
+ .getElementsByTagName('ul')[0]
+ .getElementsByTagName('li')[0]
+ .getElementsByTagName('a')[0]
+ .click();
+ }
+ catch (ignored) { }
+ }, 1);
+
+ _profileWithoutChanges = angular.copy($scope.profile);
+ }
+
+ function showResultToast(success) {
+ if (success) {
+ showToast('Änderungen gespeichert!', 'success');
+ reload($scope.profile);
+ }
+ else {
+ showToast('Fehler beim Speichern!', 'danger');
+ $scope.profile = angular.copy(_profileWithoutChanges);
+ }
+ }
+
+ function toGermanDate(date) {
+ if (date) {
+ return date.getDate() + '.' + (date.getMonth()+1) + '.' + date.getFullYear();
+ }
+ return null;
+ }
+
+ function update() {
+ if (!$scope.profileForm.$valid) {
+ showResultToast(false);
+ return;
+ }
+ profilesFactory.updateProfile($scope.profile).then(function (success) {
+ showResultToast(true);
+ }, function (error) {
+ showResultToast(false);
+ });
+ toggleMode();
+ }
+
+ function showToast(text, kind) {
+ notifications[sessionStorage.getItem('UiFramework')].showMessage(text, kind);
+ }
+
+ function createFilterFor(query) {
+ var lowerCaseQuery = query.toLowerCase();
+
+ return function filterFn(hobby) {
+ return (hobby.toLowerCase().indexOf(lowerCaseQuery) == 0);
+ }
+ }
+
+ $scope.$watch('profile.size', function (newSize, oldSize) {
+ if (!$scope.profile) {
+ return;
+ }
+ //if (!oldSize && newSize != $scope.profile.size) {
+ // $scope.profile.size = 50;
+ // console.log('profile.size set to ', newSize);
+ // // TODO fix error with material; if set to 50 set to actual value (if not 50 too)
+ // return;
+ //}
+ if ($scope.profile.numberSize != newSize && newSize >= 50 && newSize <= 260) {
+ $scope.profile.numberSize = parseInt(newSize);
+ }
+ });
+
+ $scope.$watch('profile.numberSize', function (newSize, oldSize) {
+ if (!$scope.profile) {
+ return;
+ }
+ if ($scope.profile.size != newSize && newSize >= 50 && newSize <= 260) {
+ $scope.profile.size = parseInt(newSize);
+ }
+ });
+ }
+})();
\ No newline at end of file
diff --git a/DataOne.AngularFrontendShowcases/app/oneProfile/oneProfile_Bootstrap.html b/DataOne.AngularFrontendShowcases/app/oneProfile/oneProfile_Bootstrap.html
new file mode 100644
index 0000000..34f3cf9
--- /dev/null
+++ b/DataOne.AngularFrontendShowcases/app/oneProfile/oneProfile_Bootstrap.html
@@ -0,0 +1,328 @@
+laden...
+
+
+
+
+
+
+
Mein Profil
+
Profil von {{profile.username}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Beispielbild {{slide.id}}
+
+
+
+
+
+
+
{{profile.aboutMe}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{profile.realName}}
+
+
+ {{profile.plz}}
+
+
+ {{profile.formattedBirthday}}
+
+
+
+
+ {{profile.size}}
+
+
+ {{profile.state}}
+
+
+
+ Ja
+ Nein
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Favoriten
+
+
+
+
+
+
+
+
+
+
+ {{contact.name}}
+
+
+
+
+
+
+
+
+
+ {{contact.name}}
+
+
+
+
+
+
+
+
+
+ {{contact.name}}
+
+
+
+
+
+
+
+
+
+
+
Hobbys:
+
+
+
+
+ {{hobby}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Spiele:
+
+
+
+
+ {{game}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Musik:
+
+
+
+
+ {{music}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Favoriten
+
+
+
+
+
+
+
+
+
+
+ {{contact.name}}
+
+
+
+
+
+
+
+
+
+ {{contact.name}}
+
+
+
+
+
+
+
+
+
+ {{contact.name}}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DataOne.AngularFrontendShowcases/app/oneProfile/oneProfile_Material.html b/DataOne.AngularFrontendShowcases/app/oneProfile/oneProfile_Material.html
new file mode 100644
index 0000000..95db782
--- /dev/null
+++ b/DataOne.AngularFrontendShowcases/app/oneProfile/oneProfile_Material.html
@@ -0,0 +1,294 @@
+
+
+
+
+
+
+
+
+
+
Profil von {{ profile.username }}
+
Mein Profil
+
+
+
+ {{profile.username}} ist ein Roboter
+ android
+
+
+ {{profile.username}} ist ein Mensch
+ accessibility
+
+
+
+ undo
+ Zurücksetzen
+
+
+ done
+ Speichern
+
+
+ settings
+ Ändern
+
+
',compile:d}}e.$inject=["inputDirective","$mdAria","$mdConstant","$mdTheming","$mdUtil","$mdInteraction"],t.module("material.components.checkbox",["material.core"]).directive("mdCheckbox",e)}(),function(){t.module("material.components.chips",["material.core","material.components.autocomplete"])}(),function(){!function(){function e(e,n,o){function r(e,t){try{t&&e.css(s(t))}catch(n){o.error(n.message)}}function a(e){var t=c(e);return d(t)}function d(t,o){o=o||!1;var i=e.PALETTES[t.palette][t.hue];return i=o?i.contrast:i.value,n.supplant("rgba({0}, {1}, {2}, {3})",[i[0],i[1],i[2],i[3]||t.opacity])}function s(e){var n={},o=e.hasOwnProperty("color");return t.forEach(e,function(e,t){var i=c(e),r=t.indexOf("background")>-1;n[t]=d(i),r&&!o&&(n.color=d(i,!0))}),n}function l(n){return t.isDefined(e.THEMES[n.split("-")[0]])}function c(n){var o=n.split("-"),i=t.isDefined(e.THEMES[o[0]]),r=i?o.splice(0,1)[0]:e.defaultTheme();return{theme:r,palette:m(o,r),hue:u(o,r),opacity:o[2]||1}}function m(t,o){var r=t.length>1&&i.indexOf(t[1])!==-1,a=t[0].replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();if(r&&(a=t[0]+"-"+t.splice(1,1)),i.indexOf(a)===-1){var d=e.THEMES[o].colors[a];if(!d)throw new Error(n.supplant("mdColors: couldn't find '{palette}' in the palettes.",{palette:a}));a=d.name}return a}function u(t,o){var i=e.THEMES[o].colors;if("hue"===t[1]){var r=parseInt(t.splice(2,1)[0],10);if(r<1||r>3)throw new Error(n.supplant("mdColors: 'hue-{hueNumber}' is not a valid hue, can be only 'hue-1', 'hue-2' and 'hue-3'",{hueNumber:r}));if(t[1]="hue-"+r,!(t[0]in i))throw new Error(n.supplant("mdColors: 'hue-x' can only be used with [{availableThemes}], but was used with '{usedTheme}'",{availableThemes:Object.keys(i).join(", "),usedTheme:t[0]}));return i[t[0]].hues[t[1]]}return t[1]||i[t[0]in i?t[0]:"primary"].hues["default"]}return i=i||Object.keys(e.PALETTES),{applyThemeColors:r,getThemeColor:a,hasTheme:l}}function n(e,n,i,r){return{restrict:"A",require:["^?mdTheme"],compile:function(a,d){function s(){var e=d.mdColors,i=e.indexOf("::")>-1,r=!!i||o.test(d.mdColors);d.mdColors=e.replace("::","");var a=t.isDefined(d.mdColorsWatch);return!i&&!r&&(!a||n.parseAttributeBoolean(d.mdColorsWatch))}var l=s();return function(n,o,a,d){var s=d[0],c={},m=function(t){"string"!=typeof t&&(t=""),a.mdColors||(a.mdColors="{}");var o=r(a.mdColors)(n);return s&&Object.keys(o).forEach(function(n){var i=o[n];e.hasTheme(i)||(o[n]=(t||s.$mdTheme)+"-"+i)}),u(o),o},u=function(e){if(!t.equals(e,c)){var n=Object.keys(c);c.background&&!n.color&&n.push("color"),n.forEach(function(e){o.css(e,"")})}c=e},p=t.noop;s&&(p=s.registerChanges(function(t){e.applyThemeColors(o,m(t))})),n.$on("$destroy",function(){p()});try{l?n.$watch(m,t.bind(this,e.applyThemeColors,o),!0):e.applyThemeColors(o,m())}catch(h){i.error(h.message)}}}}}n.$inject=["$mdColors","$mdUtil","$log","$parse"],e.$inject=["$mdTheming","$mdUtil","$log"];var o=/^{((\s|,)*?["'a-zA-Z-]+?\s*?:\s*?('|")[a-zA-Z0-9-.]*('|"))+\s*}$/,i=null;t.module("material.components.colors",["material.core"]).directive("mdColors",n).service("$mdColors",e)}()}(),function(){function e(e){function t(e,t){this.$scope=e,this.$element=t}return{restrict:"E",controller:["$scope","$element",t],link:function(t,o){o.addClass("_md"),e(o),t.$broadcast("$mdContentLoaded",o),n(o[0])}}}function n(e){t.element(e).on("$md.pressdown",function(t){"t"===t.pointer.type&&(t.$materialScrollFixed||(t.$materialScrollFixed=!0,0===e.scrollTop?e.scrollTop=1:e.scrollHeight===e.scrollTop+e.offsetHeight&&(e.scrollTop-=1)))})}e.$inject=["$mdTheming"],t.module("material.components.content",["material.core"]).directive("mdContent",e)}(),function(){t.module("material.components.datepicker",["material.core","material.components.icon","material.components.virtualRepeat"])}(),function(){function e(e,n,o){return{restrict:"E",link:function(i,r){r.addClass("_md"),n(r),e(function(){function e(){r.toggleClass("md-content-overflow",a.scrollHeight>a.clientHeight)}var n,a=r[0].querySelector("md-dialog-content");a&&(n=a.getElementsByTagName("img"),e(),t.element(n).on("load",e)),i.$on("$destroy",function(){o.destroy(r)})})}}}function o(e){function o(e,t){return{template:['',' ','
{{ dialog.title }}
',' ','
',"
{{::dialog.mdTextContent}}
","
",' ',' '," "," "," ",' '," {{ dialog.cancel }}"," ",' '," {{ dialog.ok }}"," "," ",""].join("").replace(/\s\s+/g,""),controller:function(){var n="prompt"==this.$type;n&&this.initialValue&&(this.result=this.initialValue),this.hide=function(){e.hide(!n||this.result)},this.abort=function(){e.cancel()},this.keypress=function(n){n.keyCode===t.KEY_CODE.ENTER&&e.hide(this.result)}},controllerAs:"dialog",bindToController:!0}}function i(e,o,i,d,s,l,c,m,u,p,h,f,g){function b(e){e.defaultTheme=h.defaultTheme(),C(e)}function v(e,t,n,o){if(o){var i=o.htmlContent||n.htmlContent||"",r=o.textContent||n.textContent||o.content||n.content||"";if(i&&!p.has("$sanitize"))throw Error("The ngSanitize module must be loaded in order to use htmlContent.");if(i&&r)throw Error("md-dialog cannot have both `htmlContent` and `textContent`");o.mdHtmlContent=i,o.mdTextContent=r}}function E(e,n,o,r){function a(){n[0].querySelector(".md-actions")&&u.warn("Using a class of md-actions is deprecated, please use .")}function d(){function e(){return n[0].querySelector(".dialog-close, md-dialog-actions button:last-child")}if(o.focusOnOpen){var t=i.findFocusTarget(n)||e()||s;t.focus()}}t.element(l[0].body).addClass("md-dialog-is-showing");var s=n.find("md-dialog");if(s.hasClass("ng-cloak")){var c="$mdDialog: using `` will affect the dialog opening animations.";u.warn(c,n[0])}return y(o),A(s,o),T(e,n,o),M(n,o),_(n,o).then(function(){w(n,o),a(),d()})}function $(e,n,o){function i(){return x(n,o)}function d(){t.element(l[0].body).removeClass("md-dialog-is-showing"),o.contentElement&&o.reverseContainerStretch(),o.cleanupElement(),o.$destroy||"keyboard"!==o.originInteraction||o.origin.focus()}return o.deactivateListeners(),o.unlockScreenReader(),o.hideBackdrop(o.$destroy),r&&r.parentNode&&r.parentNode.removeChild(r),a&&a.parentNode&&a.parentNode.removeChild(a),o.$destroy?d():i().then(d)}function C(e){var n;e.targetEvent&&e.targetEvent.target&&(n=t.element(e.targetEvent.target));var o=n&&n.controller("mdTheme");if(o){e.themeWatch=o.$shouldWatch;var i=e.theme||o.$mdTheme;i&&(e.scope.theme=i);var r=o.registerChanges(function(t){e.scope.theme=t,e.themeWatch||r()})}}function y(e){function o(e,o){var i=t.element(e||{});if(i&&i.length){var r={top:0,left:0,height:0,width:0},a=t.isFunction(i[0].getBoundingClientRect);return t.extend(o||{},{element:a?i:n,bounds:a?i[0].getBoundingClientRect():t.extend({},r,i[0]),focus:t.bind(i,i.focus)})}}function i(e,n){return t.isString(e)&&(e=l[0].querySelector(e)),t.element(e||n)}e.origin=t.extend({element:null,bounds:null,focus:t.noop},e.origin||{}),e.parent=i(e.parent,m),e.closeTo=o(i(e.closeTo)),e.openFrom=o(i(e.openFrom)),e.targetEvent&&(e.origin=o(e.targetEvent.target,e.origin),e.originInteraction=g.getLastInteractionType())}function M(n,o){var r=t.element(c),a=i.debounce(function(){k(n,o)},60),s=[],l=function(){var t="alert"==o.$type?e.hide:e.cancel;i.nextTick(t,!0)};if(o.escapeToClose){var m=o.parent,u=function(e){e.keyCode===d.KEY_CODE.ESCAPE&&(e.stopPropagation(),e.preventDefault(),l())};n.on("keydown",u),m.on("keydown",u),s.push(function(){n.off("keydown",u),m.off("keydown",u)})}if(r.on("resize",a),s.push(function(){r.off("resize",a)}),o.clickOutsideToClose){var p,h=n,f=function(e){p=e.target},g=function(e){p===h[0]&&e.target===h[0]&&(e.stopPropagation(),e.preventDefault(),l())};h.on("mousedown",f),h.on("mouseup",g),s.push(function(){h.off("mousedown",f),h.off("mouseup",g)})}o.deactivateListeners=function(){s.forEach(function(e){e()}),o.deactivateListeners=null}}function T(e,t,n){n.disableParentScroll&&(n.restoreScroll=i.disableScrollAround(t,n.parent)),n.hasBackdrop&&(n.backdrop=i.createBackdrop(e,"md-dialog-backdrop md-opaque"),s.enter(n.backdrop,n.parent)),n.hideBackdrop=function(e){n.backdrop&&(e?n.backdrop.remove():s.leave(n.backdrop)),n.disableParentScroll&&(n.restoreScroll&&n.restoreScroll(),delete n.restoreScroll),n.hideBackdrop=null}}function A(e,t){var n="alert"===t.$type?"alertdialog":"dialog",d=e.find("md-dialog-content"),s=e.attr("id"),l="dialogContent_"+(s||i.nextUid());e.attr({role:n,tabIndex:"-1"}),0===d.length&&(d=e,s&&(l=s)),d.attr("id",l),e.attr("aria-describedby",l),t.ariaLabel?o.expect(e,"aria-label",t.ariaLabel):o.expectAsync(e,"aria-label",function(){var e=d.text().split(/\s+/);return e.length>3&&(e=e.slice(0,3).concat("...")),e.join(" ")}),r=document.createElement("div"),r.classList.add("md-dialog-focus-trap"),r.tabIndex=0,a=r.cloneNode(!1);var c=function(){e.focus()};r.addEventListener("focus",c),a.addEventListener("focus",c),e[0].parentNode.insertBefore(r,e[0]),e.after(a)}function w(e,t){function n(e){for(;e.parentNode;){if(e===document.body)return;for(var t=e.parentNode.children,i=0;i/g.test(e)?""+(e||"")+"":e||""}var o=f.startSymbol(),i=f.endSymbol(),r=o+(t.themeWatch?"":"::")+"theme"+i;return'
',scope:{direction:"@?mdDirection",isOpen:"=?mdOpen"},bindToController:!0,controller:"MdFabController",controllerAs:"vm",link:e}}function o(){function n(n,o,i){if(o){var r=n[0],a=n.controller("mdFabToolbar"),d=r.querySelector(".md-fab-toolbar-background"),s=r.querySelector("md-fab-trigger button"),l=r.querySelector("md-toolbar"),c=r.querySelector("md-fab-trigger button md-icon"),m=n.find("md-fab-actions").children();if(s&&d){var u=e.getComputedStyle(s).getPropertyValue("background-color"),p=r.offsetWidth,h=(r.offsetHeight,2*(p/s.offsetWidth));d.style.backgroundColor=u,d.style.borderRadius=p+"px",a.isOpen?(l.style.pointerEvents="inherit",d.style.width=s.offsetWidth+"px",d.style.height=s.offsetHeight+"px",d.style.transform="scale("+h+")",d.style.transitionDelay="0ms",c&&(c.style.transitionDelay=".3s"),t.forEach(m,function(e,t){e.style.transitionDelay=25*(m.length-t)+"ms"})):(l.style.pointerEvents="none",d.style.transform="scale(1)",d.style.top="0",n.hasClass("md-right")&&(d.style.left="0",d.style.right=null),n.hasClass("md-left")&&(d.style.right="0",d.style.left=null),d.style.transitionDelay="200ms",c&&(c.style.transitionDelay="0ms"),t.forEach(m,function(e,t){e.style.transitionDelay=200+25*t+"ms"}))}}}return{addClass:function(e,t,o){n(e,t,o),o()},removeClass:function(e,t,o){n(e,t,o),o()}}}t.module("material.components.fabToolbar",["material.core","material.components.fabShared","material.components.fabActions"]).directive("mdFabToolbar",n).animation(".md-fab-toolbar",o).service("mdFabToolbarAnimation",o)}()}(),function(){function e(e,o,i,r){function a(n,a,d,s){function l(){for(var e in o.MEDIA)r(e),r.getQuery(o.MEDIA[e]).addListener(M);return r.watchResponsiveAttributes(["md-cols","md-row-height","md-gutter"],d,m)}function c(){s.layoutDelegate=t.noop,T();for(var e in o.MEDIA)r.getQuery(o.MEDIA[e]).removeListener(M)}function m(e){null==e?s.invalidateLayout():r(e)&&s.invalidateLayout()}function u(e){var o=g(),r={tileSpans:b(o),colCount:v(),rowMode:C(),rowHeight:$(),gutter:E()};if(e||!t.equals(r,A)){var d=i(r.colCount,r.tileSpans,o).map(function(e,n){return{grid:{element:a,style:f(r.colCount,n,r.gutter,r.rowMode,r.rowHeight)},tiles:e.map(function(e,i){return{element:t.element(o[i]),style:h(e.position,e.spans,r.colCount,n,r.gutter,r.rowMode,r.rowHeight)}})}}).reflow().performance();n.mdOnLayout({$event:{performance:d}}),A=r}}function p(e){return w+e+k}function h(e,t,n,o,i,r,a){var d=1/n*100,s=(n-1)/n,l=_({share:d,gutterShare:s,gutter:i}),c={left:x({unit:l,offset:e.col,gutter:i}),width:S({unit:l,span:t.col,gutter:i}),paddingTop:"",marginTop:"",top:"",height:""};switch(r){case"fixed":c.top=x({unit:a,offset:e.row,gutter:i}),c.height=S({unit:a,span:t.row,gutter:i});break;case"ratio":var m=d/a,u=_({share:m,gutterShare:s,gutter:i});c.paddingTop=S({unit:u,span:t.row,gutter:i}),c.marginTop=x({unit:u,offset:e.row,gutter:i});break;case"fit":var p=(o-1)/o,m=1/o*100,u=_({share:m,gutterShare:p,gutter:i});c.top=x({unit:u,offset:e.row,gutter:i}),c.height=S({unit:u,span:t.row,gutter:i})}return c}function f(e,t,n,o,i){var r={};switch(o){case"fixed":r.height=S({unit:i,span:t,gutter:n}),r.paddingBottom="";break;case"ratio":var a=1===e?0:(e-1)/e,d=1/e*100,s=d*(1/i),l=_({share:s,gutterShare:a,gutter:n});r.height="",r.paddingBottom=S({unit:l,span:t,gutter:n});break;case"fit":}return r}function g(){return[].filter.call(a.children(),function(e){return"MD-GRID-TILE"==e.tagName&&!e.$$mdDestroyed})}function b(e){return[].map.call(e,function(e){var n=t.element(e).controller("mdGridTile");return{row:parseInt(r.getResponsiveAttribute(n.$attrs,"md-rowspan"),10)||1,col:parseInt(r.getResponsiveAttribute(n.$attrs,"md-colspan"),10)||1}})}function v(){var e=parseInt(r.getResponsiveAttribute(d,"md-cols"),10);if(isNaN(e))throw"md-grid-list: md-cols attribute was not found, or contained a non-numeric value";return e}function E(){return y(r.getResponsiveAttribute(d,"md-gutter")||1)}function $(){var e=r.getResponsiveAttribute(d,"md-row-height");if(!e)throw"md-grid-list: md-row-height attribute was not found";switch(C()){case"fixed":return y(e);case"ratio":var t=e.split(":");return parseFloat(t[0])/parseFloat(t[1]);case"fit":return 0}}function C(){var e=r.getResponsiveAttribute(d,"md-row-height");if(!e)throw"md-grid-list: md-row-height attribute was not found";return"fit"==e?"fit":e.indexOf(":")!==-1?"ratio":"fixed"}function y(e){return/\D$/.test(e)?e:e+"px"}a.addClass("_md"),a.attr("role","list"),s.layoutDelegate=u;var M=t.bind(s,s.invalidateLayout),T=l();n.$on("$destroy",c);var A,w=e.startSymbol(),k=e.endSymbol(),_=e(p("share")+"% - ("+p("gutter")+" * "+p("gutterShare")+")"),x=e("calc(("+p("unit")+" + "+p("gutter")+") * "+p("offset")+")"),S=e("calc(("+p("unit")+") * "+p("span")+" + ("+p("span")+" - 1) * "+p("gutter")+")")}return{restrict:"E",controller:n,scope:{mdOnLayout:"&"},link:a}}function n(e){this.layoutInvalidated=!1,this.tilesInvalidated=!1,this.$timeout_=e.nextTick,this.layoutDelegate=t.noop}function o(e){function n(t,n){var o,a,d,s,l,c;return s=e.time(function(){a=i(t,n)}),o={layoutInfo:function(){return a},map:function(t){return l=e.time(function(){var e=o.layoutInfo();d=t(e.positioning,e.rowCount)}),o},reflow:function(t){return c=e.time(function(){var e=t||r;e(d.grid,d.tiles)}),o},performance:function(){return{tileCount:n.length,layoutTime:s,mapTime:l,reflowTime:c,totalTime:s+l+c}}}}function o(e,t){e.element.css(e.style),t.forEach(function(e){e.element.css(e.style)})}function i(e,t){function n(t,n){if(t.col>e)throw"md-grid-list: Tile at position "+n+" has a colspan ("+t.col+") that exceeds the column count ("+e+")";for(var a=0,c=0;c-a=e?o():(a=l.indexOf(0,d),a!==-1&&(c=r(a+1))!==-1?d=c+1:(a=c=0,o()));return i(a,t.col,t.row),d=a+t.col,{col:a,row:s}}function o(){d=0,s++,i(0,e,-1)}function i(e,t,n){for(var o=e;o",transclude:!0,scope:{},controller:["$attrs",function(e){this.$attrs=e}],link:n}}function r(){return{template:"",transclude:!0}}n.$inject=["$mdUtil"],o.$inject=["$mdUtil"],e.$inject=["$interpolate","$mdConstant","$mdGridLayout","$mdMedia"],i.$inject=["$mdMedia"],t.module("material.components.gridList",["material.core"]).directive("mdGridList",e).directive("mdGridTile",i).directive("mdGridTileFooter",r).directive("mdGridTileHeader",r).factory("$mdGridLayout",o),n.prototype={invalidateTiles:function(){this.tilesInvalidated=!0,this.invalidateLayout()},invalidateLayout:function(){this.layoutInvalidated||(this.layoutInvalidated=!0,this.$timeout_(t.bind(this,this.layout)))},layout:function(){try{this.layoutDelegate(this.tilesInvalidated)}finally{this.layoutInvalidated=!1,this.tilesInvalidated=!1}}}}(),function(){t.module("material.components.icon",["material.core"])}(),function(){function n(e,t){function n(t){var n=t[0].querySelector(r),o=t[0].querySelector(a);return n&&t.addClass("md-icon-left"),o&&t.addClass("md-icon-right"),function(t,n){e(n)}}function o(e,n,o,i){var r=this;r.isErrorGetter=o.mdIsError&&t(o.mdIsError),r.delegateClick=function(){r.input.focus()},r.element=n,r.setFocused=function(e){n.toggleClass("md-input-focused",!!e)},r.setHasValue=function(e){n.toggleClass("md-input-has-value",!!e)},r.setHasPlaceholder=function(e){n.toggleClass("md-input-has-placeholder",!!e)},r.setInvalid=function(e){e?i.addClass(n,"md-input-invalid"):i.removeClass(n,"md-input-invalid")},e.$watch(function(){return r.label&&r.input},function(e){e&&!r.label.attr("for")&&r.label.attr("for",r.input.attr("id"))})}o.$inject=["$scope","$element","$attrs","$animate"];var i=["INPUT","TEXTAREA","SELECT","MD-SELECT"],r=i.reduce(function(e,t){return e.concat(["md-icon ~ "+t,".md-icon ~ "+t])},[]).join(","),a=i.reduce(function(e,t){return e.concat([t+" ~ md-icon",t+" ~ .md-icon"])},[]).join(",");return{restrict:"E",compile:n,controller:o}}function o(){return{restrict:"E",require:"^?mdInputContainer",link:function(e,t,n,o){!o||n.mdNoFloat||t.hasClass("md-container-ignore")||(o.label=t,e.$on("$destroy",function(){o.label=null}))}}}function i(e,n,o,i,r){function a(a,d,s,l){function c(e){return h.setHasValue(!g.$isEmpty(e)),e}function m(){h.label&&s.$observe("required",function(e){h.label.toggleClass("md-required",e&&!E)})}function u(){h.setHasValue(d.val().length>0||(d[0].validity||{}).badInput)}function p(){function o(){d.attr("rows",1).css("height","auto").addClass("md-no-flex");var e=l();if(!$){var t=d[0].style.padding||"";$=d.css("padding",0).prop("offsetHeight"),d[0].style.padding=t}if(b&&$&&(e=Math.max(e,$*b)),v&&$){var n=$*v;n-1&&g.$formatters.splice(e,1)}}function u(){function e(e){e.preventDefault(),c=!0,u=e.clientY,p=parseFloat(d.css("height"))||d.prop("offsetHeight")}function n(e){c&&(e.preventDefault(),m(),f.addClass("md-input-resized"))}function o(e){c&&d.css("height",p+e.pointer.distanceY+"px")}function i(e){c&&(c=!1,f.removeClass("md-input-resized"))}if(!s.hasOwnProperty("mdNoResize")){var l=t.element(''),c=!1,u=null,p=0,f=h.element,g=r.register(l,"drag",{horizontal:!1});d.wrap('
').after(l),l.on("mousedown",e),f.on("$md.dragstart",n).on("$md.drag",o).on("$md.dragend",i),a.$on("$destroy",function(){l.off("mousedown",e).remove(),f.off("$md.dragstart",n).off("$md.drag",o).off("$md.dragend",i),g(),l=null,f=null,g=null})}}var p=!s.hasOwnProperty("mdNoAutogrow");if(u(),p){var b=s.hasOwnProperty("rows")?parseInt(s.rows):NaN,v=s.hasOwnProperty("maxRows")?parseInt(s.maxRows):NaN,E=a.$on("md-resize-textarea",o),$=null,C=d[0];if(i(function(){e.nextTick(o)},10,!1),d.on("input",o),f&&g.$formatters.push(c),b||d.attr("rows",1),t.element(n).on("resize",o),a.$on("$destroy",m),s.hasOwnProperty("mdDetectHidden")){var y=function(){var e=!1;return function(){var t=0===C.offsetHeight;t===!1&&e===!0&&o(),e=t}}();a.$watch(function(){return e.nextTick(y,!1),!0})}}}var h=l[0],f=!!l[1],g=l[1]||e.fakeNgModel(),b=l[2],v=t.isDefined(s.readonly),E=e.parseAttributeBoolean(s.mdNoAsterisk),$=d[0].tagName.toLowerCase();if(h){if("hidden"===s.type)return void d.attr("aria-hidden","true");if(h.input){if(h.input[0].contains(d[0]))return;throw new Error(" can only have *one* ,