webui: rename tooltip to title

- use title for input's elements 'title' attribute
- tooltip for Bootstrap's tooltip component

https://fedorahosted.org/freeipa/ticket/4471

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
Petr Vobornik 2014-07-24 16:01:44 +02:00
parent 4832f2986d
commit def8696819
8 changed files with 43 additions and 47 deletions

View File

@ -405,7 +405,7 @@ IPA.dialog = function(spec) {
that.title_node = $('<h4/>', {
'class': 'modal-title',
text: that.title
text: that.title || ''
}).appendTo(that.header_node);
return that.header_node;

View File

@ -666,7 +666,7 @@ IPA.dnszone_name_widget = function(spec) {
IPA.force_dnszone_add_checkbox_widget = function(spec) {
var metadata = IPA.get_command_option('dnszone_add', spec.name);
spec.label = metadata.label;
spec.tooltip = metadata.doc;
spec.title = metadata.doc;
return IPA.checkbox_widget(spec);
};

View File

@ -1118,9 +1118,9 @@ exp.facet_header = IPA.facet_header = function(spec) {
that.update_breadcrumb(limited_value);
var title_info = {
title: that.facet.label,
text: that.facet.label,
pkey: limited_value,
pkey_tooltip: value
pkey_title: value
};
that.title_widget.update(title_info);
};
@ -1277,7 +1277,7 @@ exp.facet_header = IPA.facet_header = function(spec) {
}
that.title_widget.create(container);
that.title_widget.update({ title: that.facet.label });
that.title_widget.update({ text: that.facet.label });
if (!that.facet.disable_facet_tabs) {
that.facet_tabs = $('<div/>', {
@ -1349,7 +1349,7 @@ exp.facet_header = IPA.facet_header = function(spec) {
/**
* Reflect facet's action state summary into title widget class and icon
* tooltip.
* title.
*/
that.update_summary = function() {
var summary = that.facet.action_state.summary();
@ -1357,7 +1357,7 @@ exp.facet_header = IPA.facet_header = function(spec) {
if (summary.state.length > 0) {
var css_class = summary.state.join(' ');
that.title_widget.set_class(css_class);
that.title_widget.set_icon_tooltip(summary.description);
that.title_widget.set_icon_title(summary.description);
}
};
@ -1409,30 +1409,26 @@ exp.facet_title = IPA.facet_title = function(spec) {
*
* @param {Object} data
* @param {string} data.pkey
* @param {string} data.text
* @param {string} data.title
* @param {string} data.tooltip
* @param {string} data.icon_tooltip
* @param {string} data.icon_title
* @param {string} data.css_class css class for title container
*/
that.update = function(data) {
var tooltip = data.tooltip || data.title;
var pkey_tooltip = data.pkey_tooltip || data.pkey;
var icon_tooltip = data.icon_tooltip || '';
that.title.text(data.title);
that.title.prop('title', tooltip);
that.title.text(data.text);
that.title.prop('title', data.title || '');
that.title_container.toggleClass('no-pkey', !data.pkey);
if (data.pkey) {
that.title.text(data.title + ': ');
that.title.text(data.text + ': ');
that.pkey.text(data.pkey);
that.pkey.attr('title', pkey_tooltip);
that.pkey.attr('title', data.pkey_title || data.pkey);
}
if (data.css_class) that.set_class(data.css_class);
that.set_icon_tooltip(icon_tooltip);
that.set_icon_title(data.icon_title || '');
};
/**
@ -1487,12 +1483,12 @@ exp.facet_title = IPA.facet_title = function(spec) {
};
/**
* Set icon tooltip
* Set icon title
*
* @param {string} tooltip
* @param {string} title
*/
that.set_icon_tooltip = function(tooltip) {
that.icon.attr('title', tooltip);
that.set_icon_title = function(title) {
that.icon.attr('title', title);
};
return that;

View File

@ -112,10 +112,10 @@ field.field = IPA.field = function(spec) {
that.label = text.get(spec.label);
/**
* Tooltip
* Title
* @property {string}
*/
that.tooltip = text.get(spec.tooltip);
that.title = text.get(spec.title);
/**
* Measurement unit
@ -299,8 +299,8 @@ field.field = IPA.field = function(spec) {
if (!that.label) {
that.label = that.metadata.label || '';
}
if (!that.tooltip) {
that.tooltip = that.metadata.doc || '';
if (!that.title) {
that.title = that.metadata.doc || '';
}
}

View File

@ -531,7 +531,7 @@ IPA.host_dnsrecord_entity_link_widget = function(spec) {
IPA.force_host_add_checkbox_widget = function(spec) {
var metadata = IPA.get_command_option('host_add', spec.name);
spec.label = metadata.label;
spec.tooltip = metadata.doc;
spec.title = metadata.doc;
return IPA.checkbox_widget(spec);
};

View File

@ -56,27 +56,27 @@ return {
{
name: 'ipabaseid',
label: '@i18n:objects.idrange.ipabaseid',
tooltip: '@mo-param:idrange:ipabaseid:label'
title: '@mo-param:idrange:ipabaseid:label'
},
{
name: 'ipaidrangesize',
label: '@i18n:objects.idrange.ipaidrangesize',
tooltip: '@mo-param:idrange:ipaidrangesize:label'
title: '@mo-param:idrange:ipaidrangesize:label'
},
{
name: 'ipabaserid',
label: '@i18n:objects.idrange.ipabaserid',
tooltip: '@mo-param:idrange:ipabaserid:label'
title: '@mo-param:idrange:ipabaserid:label'
},
{
name: 'ipasecondarybaserid',
label: '@i18n:objects.idrange.ipasecondarybaserid',
tooltip: '@mo-param:idrange:ipasecondarybaserid:label'
title: '@mo-param:idrange:ipasecondarybaserid:label'
},
{
name: 'ipanttrusteddomainsid',
label: '@i18n:objects.idrange.ipanttrusteddomainsid',
tooltip: '@mo-param:idrange:ipanttrusteddomainsid:label'
title: '@mo-param:idrange:ipanttrusteddomainsid:label'
}
]
}
@ -91,17 +91,17 @@ return {
{
name: 'ipabaseid',
label: '@i18n:objects.idrange.ipabaseid',
tooltip: '@mo-param:idrange:ipabaseid:label'
title: '@mo-param:idrange:ipabaseid:label'
},
{
name: 'ipaidrangesize',
label: '@i18n:objects.idrange.ipaidrangesize',
tooltip: '@mo-param:idrange:ipaidrangesize:label'
title: '@mo-param:idrange:ipaidrangesize:label'
},
{
name: 'ipabaserid',
label: '@i18n:objects.idrange.ipabaserid',
tooltip: '@mo-param:idrange:ipabaserid:label'
title: '@mo-param:idrange:ipabaserid:label'
},
{
name: 'iparangetype',
@ -135,12 +135,12 @@ return {
{
name: 'ipasecondarybaserid',
label: '@i18n:objects.idrange.ipasecondarybaserid',
tooltip: '@mo-param:idrange:ipasecondarybaserid:label'
title: '@mo-param:idrange:ipasecondarybaserid:label'
},
{
name: 'ipanttrusteddomainsid',
label: '@i18n:objects.idrange.ipanttrusteddomainsid',
tooltip: '@mo-param:idrange:ipanttrusteddomainsid:label',
title: '@mo-param:idrange:ipanttrusteddomainsid:label',
enabled: false
}
],

View File

@ -48,7 +48,7 @@ var MenuItem = {
label: '',
/**
* Title/Tooltip
* Title
*/
title: '',

View File

@ -102,10 +102,10 @@ IPA.widget = function(spec) {
that.label = text.get(spec.label);
/**
* Helper text
* Title text
* @property {string}
*/
that.tooltip = text.get(spec.tooltip);
that.title = text.get(spec.title);
/**
* Measurement unit
@ -732,7 +732,7 @@ IPA.text_widget = function(spec) {
id: id,
'class': 'form-control',
size: that.size,
title: that.tooltip,
title: that.title,
placeholder: that.placeholder,
keyup: function() {
that.on_value_changed();
@ -1313,7 +1313,7 @@ IPA.option_widget_base = function(spec, that) {
// classic properties
that.name = spec.name;
that.label = spec.label;
that.tooltip = spec.tooltip;
that.title = spec.title;
that.sort = spec.sort === undefined ? false : spec.sort;
that.value_changed = that.value_changed || IPA.observer();
@ -1488,12 +1488,12 @@ IPA.option_widget_base = function(spec, that) {
name: input_name,
disabled: !enabled,
value: option.value,
title: option.tooltip || that.tooltip,
title: option.title || that.title || '',
change: that.on_input_change
}, opt_cont);
option.label_node = construct.create('label', {
title: option.tooltip || that.tooltip,
title: option.title || that.title || '',
'for': id
}, opt_cont);
option.label_node.textContent = option.label || '';
@ -2093,7 +2093,7 @@ IPA.textarea_widget = function (spec) {
cols: that.cols,
'class': 'form-control',
readOnly: !!that.read_only,
title: that.tooltip,
title: that.title || '',
placeholder: that.placeholder,
keyup: function() {
that.on_value_changed();
@ -3485,7 +3485,7 @@ IPA.combobox_widget = function(spec) {
name: that.name,
'class': 'form-control',
id: id,
title: that.tooltip,
title: that.title,
keydown: that.on_input_keydown,
mousedown: that.on_no_close,
click: function() {
@ -4251,7 +4251,7 @@ IPA.button_widget = function(spec) {
that.button = IPA.button({
id: that.id,
name: that.name,
title: that.tooltip,
title: that.title,
label: that.label,
'class': that['class'],
button_class: that.button_class,