params.fragment instanceof params.fragment.NodeFragment && !params.fragment.node.isRoot()
};
if(state.allowed) {
- state.description = gettext('Insert comment after current node');
+ state.description = gettext('Insert comment');
}
return state;
}
if(params.fragment instanceof params.fragment.CaretFragment) {
if(params.fragment.node.isInside('link')) {
- return {allowed: true, toggled: true, execute: editLink};
+ return {
+ allowed: true,
+ toggled: true,
+ description: gettext('Edit link'),
+ execute: editLink
+ };
}
}
return {allowed: false};
return false;
};
+ var label = type === 'Bullet' ? gettext('bull. list') : gettext('num. list');
return {
name: 'toggle' + type + 'List',
fragment: {type: 'context', name: 'fragment'}
},
stateDefaults: {
- label: type === 'Bullet' ? gettext('bull. list') : gettext('num. list')
+ label: label
},
getState: function(params) {
if(!params.fragment || !params.fragment.isValid()) {
if((list.getClass() === 'list' && type === 'Enum') || (list.getClass() === 'list.enum' && type === 'Bullet')) {
return {
allowed: true,
- description: interpolate(gettext('Change list type to %s'), [type]),
+ description: interpolate(gettext('Change list type to %s'), [label]),
execute: execute.changeType
};
}
},
getState: function(params) {
var state = {
- label: this.config.label
+ label: createParams.to.name
},
f = params.fragment,
description;
toSwitch = toSwitch.getParent(createParams.from);
}
- description = 'Switch to ' + createParams.to.name;
+ description = gettext('Switch to') + ' ' + createParams.to.name;
return _.extend(state, {
allowed: !!toSwitch,
toggled: alreadyInTarget,
};
}
- description = interpolate(gettext('Insert template %s after %s'), [params.template.name, params.fragment.node.getNearestElementNode().getTagName()]);
+ description = interpolate(gettext('Insert template %s'), [params.template.name]);
return {
allowed: true,
description: description,