/* * Copyright 2007-2017 Charles du Jeu - Abstrium SAS * This file is part of Pydio. * * Pydio is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Pydio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Pydio. If not, see . * * The latest code can be found at . */ Class.create("TeamEditor", { CONTEXT_HOLDER: null, INSTANCE:null, initialize:function(){ }, open: function(oForm, contextHolder){ var textA = oForm.down('#team_edit_entries'); var users = [], userLabels = []; if(contextHolder){ this.CONTEXT_HOLDER = contextHolder; users = contextHolder.getUniqueNode().getMetadata().get('users').stripTags().strip().split(","); userLabels = contextHolder.getUniqueNode().getMetadata().get('users_labels').stripTags().strip().split(", "); oForm.down('#team_edit_label').setValue(contextHolder.getUniqueNode().getLabel()); } var createEntry = function(id, label){ var uElem = new Element('div', {className:'user_entry'}); uElem.writeAttribute('data-entry_id', id); uElem.update(''); textA.insert(uElem); var remove = new Element('span', {className:'delete_user_entry icon-remove-sign', style:'display:none'}).observe("click", function(){uElem.remove()}); uElem.insert(remove); uElem.observe('mouseover', function(){remove.setStyle({display:'inline'})}); uElem.observe('mouseout', function(){remove.setStyle({display:'none'})}); }; for(var i = 0; i