editor: cleanup - removing unnecessary wlxml class handling code in canvas generic...
[fnpeditor.git] / src / editor / utils / wlxml.js
index 5f1b84d..9935655 100644 (file)
@@ -6,17 +6,17 @@ define([
 
 
 
-return {
-    wlxmlTagNames: {
-        '': '',
+var names = {
+    tag: {
+        '': '-',
         section: 'sekcja',
         header: 'nagłówek',
         div: 'blok',
         span: 'tekst',
         aside: 'poboczny'
     },
-    wlxmlClassNames: {
-        '': '',
+    'class': {
+        '': '-',
         author: 'autor',
         title: 'tytuł',
         cite: 'cytat',
@@ -33,4 +33,16 @@ return {
     }
 };
 
+return {
+    getLabel: function(of, name) {
+        return (names[of] && (names[of][name] || name)) || '?';
+    },
+    getTagLabel: function(tagName) {
+        return this.getLabel('tag', tagName);
+    },
+    getClassLabel: function(className) {
+        return this.getLabel('class', className);
+    }
+};
+
 });
\ No newline at end of file