(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i').appendTo(pluginContainer); globals.container.append("\n
\n
Logged user
\n
\n
\n
\n "); globals.container.append('
'); globals.container.append("\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n\n \n
\n "); globals.user = user; globals.container.find('.panel-user .panel-body').html(user._login); $('#newpasswordinput, #newpasswordinput2').on('keyup', function () { if ($('#newpasswordinput').val() == $('#confirmpasswordinput').val()) { if ($('#newpasswordinput').val() == "") { $('#message').html(''); } else { $('#message').html('Matching').css('color', 'green'); } } else $('#message').html('Not Matching').css('color', 'red'); }); if (user._name != null) { $("#nameinput").val(user._name); } if (user._surname != null) { $("#surnameinput").val(user._surname); } if (user._email != null) { $("#emailinput").val(user._email); } globals.container.find('.btn-submit').on('click', function () { return Submit(); }); } }); } function Submit() { var email = $("#emailinput").val(); var name = $("#nameinput").val(); var surname = $("#surnameinput").val(); var newpassword = $("#newpasswordinput").val(); var confirmpassword = $("#confirmpasswordinput").val(); var output = ""; output += "\"email\":\"".concat(email, "\""); output += ",\"name\":\"".concat(name, "\""); output += ",\"surname\":\"".concat(surname, "\""); if (newpassword != "") { if (newpassword != confirmpassword) { alert("Passwords don't match!"); return; } output += ",\"password\":\"".concat(newpassword, "\""); } if (output === "") { return; } $.ajax({ method: 'PATCH', url: minerva.ServerConnector._serverBaseUrl + 'api/users/' + globals.user._login + '/', data: "{\"user\":{".concat(output, "}}"), success: function success(response) { if (globals.user._name != null) { $("#nameinput").val(globals.user._name); } if (globals.user._surname != null) { $("#surnameinput").val(globals.user._surname); } if (globals.user._email != null) { $("#emailinput").val(globals.user._email); } $("#newpasswordinput").val(''); $("#confirmpasswordinput").val(''); $('#message').html(''); alert('Update successful.'); }, error: function error(response) { alert('Failed to update user data.'); } }); } function searchListener(entites) {} },{"../css/styles.css":1,"core-js/modules/es.array.find":78,"core-js/modules/es.array.includes":79,"core-js/modules/es.array.map":80,"core-js/modules/es.array.slice":81,"core-js/modules/es.object.to-string":82,"core-js/modules/es.regexp.to-string":83,"core-js/modules/es.string.includes":84,"core-js/modules/es.string.split":85}],3:[function(require,module,exports){ 'use strict'; // For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field. var styleElementsInsertedAtTop = []; var insertStyleElement = function(styleElement, options) { var head = document.head || document.getElementsByTagName('head')[0]; var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1]; options = options || {}; options.insertAt = options.insertAt || 'bottom'; if (options.insertAt === 'top') { if (!lastStyleElementInsertedAtTop) { head.insertBefore(styleElement, head.firstChild); } else if (lastStyleElementInsertedAtTop.nextSibling) { head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling); } else { head.appendChild(styleElement); } styleElementsInsertedAtTop.push(styleElement); } else if (options.insertAt === 'bottom') { head.appendChild(styleElement); } else { throw new Error('Invalid value for parameter \'insertAt\'. Must be \'top\' or \'bottom\'.'); } }; module.exports = { // Create a tag with optional data attributes createLink: function(href, attributes) { var head = document.head || document.getElementsByTagName('head')[0]; var link = document.createElement('link'); link.href = href; link.rel = 'stylesheet'; for (var key in attributes) { if ( ! attributes.hasOwnProperty(key)) { continue; } var value = attributes[key]; link.setAttribute('data-' + key, value); } head.appendChild(link); }, // Create a