From 5ecd636b8104cbc7c20c68afedaaba68d0298d68 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Fri, 10 Apr 2015 17:55:03 +0200 Subject: client: domain type_attributes are now a list for ordering First type is default, and order is for shift-up/down selection, filter menu and type drop down in properties menu (so, basically everywhere). --- src/client/model/types.js | 8 ++---- src/client/textanalysis.js | 2 +- src/local/domain/cri.rhizi.net/domain_types.js | 24 ++++++++-------- src/local/domain/default.rhizi.net/domain_types.js | 28 +++++++++---------- src/local/domain/leap.rhizi.net/domain_types.js | 32 +++++++++++----------- 5 files changed, 46 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/client/model/types.js b/src/client/model/types.js index 867969ea..ac10f374 100644 --- a/src/client/model/types.js +++ b/src/client/model/types.js @@ -2,13 +2,11 @@ define(['underscore', 'util', 'model/domain_types'], function(_, util, domain_types) { -var nodetypes, - all_attributes, - type_attributes = domain_types.type_attributes, +var all_attributes, + type_attributes = _.object(domain_types.type_attributes), + nodetypes = _.map(domain_types.type_attributes, 0), attribute_titles = domain_types.attribute_titles; -nodetypes = _.keys(type_attributes); - if (undefined === type_attributes['_defaults']) { type_attributes['_defaults'] = { 'title': 'default', diff --git a/src/client/textanalysis.js b/src/client/textanalysis.js index 0e64fed3..1a98f765 100644 --- a/src/client/textanalysis.js +++ b/src/client/textanalysis.js @@ -12,7 +12,7 @@ var separator_string = rz_config.separator_string; var typeindex = 0, nodetypes = model_types.nodetypes, nodetypes_count = nodetypes.length, - default_nodetype = util.first_contained(nodetypes, ['collaborator', 'person'], nodetypes[0]), + default_nodetype = nodetypes[0], node_name_to_type = {}; util.assert(nodetypes.indexOf(default_nodetype) !== -1); diff --git a/src/local/domain/cri.rhizi.net/domain_types.js b/src/local/domain/cri.rhizi.net/domain_types.js index c8610aa9..7f3ff6f8 100644 --- a/src/local/domain/cri.rhizi.net/domain_types.js +++ b/src/local/domain/cri.rhizi.net/domain_types.js @@ -1,6 +1,6 @@ define({ - type_attributes: { - 'internship': { + type_attributes: [ + ['internship', { 'title': 'Internship', 'attributes': ['status', 'startdate', 'enddate', 'description', 'url', @@ -12,24 +12,24 @@ define({ 'city', 'country', ], - }, - 'skill': { + }], + ['skill', { 'title': 'Skill', 'attributes': ['description', 'url'], - }, - 'interest': { + }], + ['interest', { 'title': 'Interesst', 'attributes': ['description', 'url'], - }, - 'person': { + }], + ['person', { 'title': 'Person', 'attributes': ['description', 'url'], - }, - 'club': { + }], + ['club', { 'title': 'Club', 'attributes': ['description', 'url'], - } - }, + }] + ], attribute_titles: { 'name': 'Name', 'type': 'Type', diff --git a/src/local/domain/default.rhizi.net/domain_types.js b/src/local/domain/default.rhizi.net/domain_types.js index 4daa17cc..46279f7e 100644 --- a/src/local/domain/default.rhizi.net/domain_types.js +++ b/src/local/domain/default.rhizi.net/domain_types.js @@ -1,10 +1,10 @@ define({ - type_attributes: { - 'keyword': { + type_attributes: [ + ['keyword', { 'title': 'Keyword', 'attributes': ['description', 'url'], - }, - 'person': { + }], + ['person', { 'title': 'Person', 'attributes': ['affiliation', 'street-address', @@ -14,24 +14,24 @@ define({ 'name', 'url' ], - }, - 'project': { + }], + ['project', { 'title': 'Project', 'attributes': ['description', 'url'], - }, - 'project_component': { + }], + ['project_component', { 'title': 'Project Component', 'attributes': ['description', 'url'], - }, - 'objective': { + }], + ['objective', { 'title': 'Objective', 'attributes': ['description', 'url'], - }, - 'resource': { + }], + ['resource', { 'title': 'Objective', 'attributes': ['description', 'url'], - } - }, + }] + ], attribute_titles: { 'affiliation': 'Affiliation', 'description': 'Description', diff --git a/src/local/domain/leap.rhizi.net/domain_types.js b/src/local/domain/leap.rhizi.net/domain_types.js index af56acbc..7025c245 100644 --- a/src/local/domain/leap.rhizi.net/domain_types.js +++ b/src/local/domain/leap.rhizi.net/domain_types.js @@ -1,10 +1,6 @@ define({ - type_attributes: { - 'keyword': { - 'title': 'Keyword', - 'attributes': ['description', 'url'], - }, - 'collaborator': { + type_attributes: [ + ['collaborator', { 'title': 'Collaborator', 'attributes': ['affiliation', 'description', @@ -13,24 +9,28 @@ define({ 'name', 'url' ], - }, - 'project': { + }], + ['keyword', { + 'title': 'Keyword', + 'attributes': ['description', 'url'], + }], + ['project', { 'title': 'Project', 'attributes': ['description', 'url', 'rhizi-url'], - }, - 'idea': { + }], + ['idea', { 'title': 'Idea', 'attributes': ['description', 'url'], - }, - 'need': { + }], + ['need', { 'title': 'Need', 'attributes': ['description', 'url'], - }, - 'resource': { + }], + ['resource', { 'title': 'Resource', 'attributes': ['description', 'url'], - } - }, + }] + ], attribute_titles: { 'affiliation': 'Affiliation', 'description': 'Description', -- cgit v1.3.1