Author: ygrego Date: 2015-06-09 15:48:11 +0000 (Tue, 09 Jun 2015) New Revision: 1671 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1671 Log: Refactoring of the classes MetadataManager and Metadata in ES6 classes. Modified: oipf/lib/js/utils/EventManager.js oipf/lib/js/utils/MetaData.js oipf/lib/js/utils/MetadataManager.js Modified: oipf/lib/js/utils/EventManager.js =================================================================== --- oipf/lib/js/utils/EventManager.js 2015-06-09 15:43:19 UTC (rev 1670) +++ oipf/lib/js/utils/EventManager.js 2015-06-09 15:48:11 UTC (rev 1671) @@ -47,5 +47,3 @@ return new CustomEvent(type, {detail: param}); } } - - Modified: oipf/lib/js/utils/MetaData.js =================================================================== --- oipf/lib/js/utils/MetaData.js 2015-06-09 15:43:19 UTC (rev 1670) +++ oipf/lib/js/utils/MetaData.js 2015-06-09 15:48:11 UTC (rev 1671) @@ -1,9 +1,9 @@ -/* +/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ -var MetaData = Class.extend({ - -}); +class MetaData { + +} Modified: oipf/lib/js/utils/MetadataManager.js =================================================================== --- oipf/lib/js/utils/MetadataManager.js 2015-06-09 15:43:19 UTC (rev 1670) +++ oipf/lib/js/utils/MetadataManager.js 2015-06-09 15:48:11 UTC (rev 1671) @@ -1,27 +1,29 @@ -/* +/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ -var MetadataManager = Class.extend({ - - metadata: {}, - - addMetadata: function(metadata) { +class MetadataManager { + + constructor() { + this.metadata = {}; + } + + addMetadata(metadata) { var type = metadata.type; - + if (type) { this.metadata[type] = metadata; return true; } return false; - }, - - getMetadata: function(type) { + } + + getMetadata(type) { if (type && this.metadata) { return this.metadata[type]; } return null; } -}); +}