/** * just the implementation of the callbacks */ /** * Apply project description data to dom elements * @param data: Project configuration data */ function applyProjectData(data, project) { if (project.hasOwnProperty('name')) { // project specific config canny.texts.setTexts({projectName : project.name}) } // FIXME: Categories should not be named "__description" as they would override the project description if (data.hasOwnProperty('keyDescriptions')) { // project specific config - if property is present canny.texts.setTexts({ projectDescription : (data.keyDescriptions['__description'] ? data.keyDescriptions['__description'] : '') }); } }
trade.initialize(function (userObject, sessionsEnabled) { if (userObject === null) { alert('A fatal error happens while loading the view') location.reload() return } canny.texts.setTexts({userName: userObject.name}); if (userObject.isAdmin) { document.body.classList.add('isAdmin'); } if (sessionsEnabled) { // trigger a "session keep alive" and detects if the user is not authenticated anymore or the server is down handleSessionTimeOut() } });
onNewDirectoryCreated : function(data) { canny.texts.setTexts({ projectName : data.directoryId }); }