Skip to content

Commit

Permalink
Add title for button and fix remarks (#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-andrey authored Sep 18, 2020
1 parent 67ca29f commit 91b1bdd
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 10 deletions.
16 changes: 16 additions & 0 deletions addon/instance-initializers/i18n-for-object.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { isNone } from '@ember/utils';

export function initialize(application) {
let i18n = application.lookup('service:i18n');
if (isNone(i18n)) {
return;
}

window.i18n = i18n;
}

export default {
name: 'i18n-for-object',
after: ['ember-i18n', 'i18n'],
initialize
};
6 changes: 5 additions & 1 deletion addon/locales/en/components/fd-diagram-editing-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ export default {
'toggler-caption': 'Additional settings',
'system-caption': 'Catalog',
'description-caption': 'Description',
'description-placeholder': 'Diagram description'
'description-placeholder': 'Diagram description',
'remove-button-title': 'Remove object',
'color-button-title': 'Object appearance settings',
'open-edit-form-title': 'Open edit form',
'collapse-title': 'Collapse object'
};
6 changes: 5 additions & 1 deletion addon/locales/ru/components/fd-diagram-editing-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ export default {
'toggler-caption': 'Дополнительные настройки',
'system-caption': 'Каталог',
'description-caption': 'Описание',
'description-placeholder': 'Описание диаграммы'
'description-placeholder': 'Описание диаграммы',
'remove-button-title': 'Удалить объект',
'color-button-title': 'Настройки внешнего вида объекта',
'open-edit-form-title': 'Открыть форму редактирования свойств',
'collapse-title': 'Свернуть объект'
};
16 changes: 8 additions & 8 deletions addon/locales/ru/forms/fd-setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ export default {
'frontend-repo-url': 'Адрес репозитория клиентской части',
'backend-repo-url': 'Адрес репозитория серверной части',
'repo-url-placeholder': 'Введите адрес',
'frontend-login': 'Логин для рапозитория с клиентской частью',
'backend-login': 'Логин для рапозитория с серверной частью',
'frontend-login': 'Логин для репозитория с клиентской частью',
'backend-login': 'Логин для репозитория с серверной частью',
'login-placeholder': 'Введите логин',
'frontend-password': 'Пароль для рапозитория с клиентской частью',
'backend-password': 'Пароль для рапозитория с серверной частью',
'frontend-password': 'Пароль для репозитория с клиентской частью',
'backend-password': 'Пароль для репозитория с серверной частью',
'password-placeholder': 'Введите пароль',
'frontend-branch': 'Ветка для клиентской части',
'backend-branch': 'Ветка для серверной части',
'branch-placeholder': 'Введите имя ветки',
'frontend-pub-key': 'Открытый SSH ключ для рапозитория с клиентской частью',
'backend-pub-key': 'Открытый SSH ключ для рапозитория с серверной частью',
'frontend-pub-key': 'Открытый SSH ключ для репозитория с клиентской частью',
'backend-pub-key': 'Открытый SSH ключ для репозитория с серверной частью',
'pub-key-placeholder': 'Введите открытый SSH ключ',
'frontend-pri-key': 'Закрытый SSH ключ для рапозитория с клиентской частью',
'backend-pri-key': 'Закрытый SSH ключ для рапозитория с серверной частью',
'frontend-pri-key': 'Закрытый SSH ключ для репозитория с клиентской частью',
'backend-pri-key': 'Закрытый SSH ключ для репозитория с серверной частью',
'pri-key-placeholder': 'Введите закрытый SSH ключ',
'frontend-publish': 'Публикация приложения в gh-pages',
'git-disconnect-button-caption': 'Отключить учетную запись от Github',
Expand Down
1 change: 1 addition & 0 deletions addon/objects/uml-primitives/fd-uml-association.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ joint.shapes.flexberry.uml.AssociationView = MultiplicityView.extend({
buttons.pushObject({
name: 'open-edit-form-button',
text: '&#xf013',
title: window.i18n.t('components.fd-diagram-editing-panel.open-edit-form-title').string,
handler: this.openEditForm.bind(this),
attrs: {
'element': { atConnectionRatio: .4 },
Expand Down
2 changes: 2 additions & 0 deletions addon/objects/uml-primitives/fd-uml-class.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ joint.shapes.flexberry.uml.ClassView = joint.shapes.flexberry.uml.PrimitiveEleme
buttons.pushObject({
name: 'collapse-button',
text: collapsed ? '&#xf065' : '&#xf066',
title: window.i18n.t('components.fd-diagram-editing-panel.collapse-title').string,
handler: this.collapseElementViewHandler.bind(this),
attrs: {
'element': {'ref-x': 0,'ref-y': 0, 'ref': '.joint-highlight-stroke' },
Expand All @@ -478,6 +479,7 @@ joint.shapes.flexberry.uml.ClassView = joint.shapes.flexberry.uml.PrimitiveEleme
buttons.pushObject({
name: 'open-edit-form-button',
text: '&#xf013',
title: window.i18n.t('components.fd-diagram-editing-panel.open-edit-form-title').string,
handler: this.openEditForm.bind(this),
attrs: {
'element': { 'ref-dx': -28, 'ref-y': 0, 'ref': '.joint-highlight-stroke' },
Expand Down
1 change: 1 addition & 0 deletions addon/objects/uml-primitives/fd-uml-complex-transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ joint.shapes.flexberry.uml.ComplexTransitionHView = joint.shapes.flexberry.uml.P
return A([{
name: 'remove-button',
text: '&#xe915',
title: window.i18n.t('components.fd-diagram-editing-panel.remove-button-title').string,
handler: this.removeElement.bind(this),
attrs: {
'element': {'ref-dx': 10,'ref-y': -15, 'ref': '.joint-highlight-stroke' },
Expand Down
1 change: 1 addition & 0 deletions addon/objects/uml-primitives/fd-uml-composition.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ joint.shapes.flexberry.uml.CompositionView = MultiplicityView.extend({
buttons.pushObject({
name: 'open-edit-form-button',
text: '&#xf013',
title: window.i18n.t('components.fd-diagram-editing-panel.open-edit-form-title').string,
handler: this.openEditForm.bind(this),
attrs: {
'element': { atConnectionRatio: .4 },
Expand Down
5 changes: 5 additions & 0 deletions addon/objects/uml-primitives/fd-uml-primitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,12 @@ joint.highlighters.strokeAndButtons = {
g.setAttributeNS(null, 'class', name || '');
let circle = document.createElementNS(svgNS, 'circle');
let text = document.createElementNS(svgNS, 'text');
let title = document.createElementNS(svgNS, 'title');
text.innerHTML = get(button, 'text');
title.innerHTML = get(button, 'title');
g.appendChild(circle);
g.appendChild(text);
g.appendChild(title);
g.onmousedown = this._onMouseDown;
g.onclick = get(button, 'handler');
if (!isArray(this._buttons[id])) {
Expand Down Expand Up @@ -367,6 +370,7 @@ joint.shapes.flexberry.uml.PrimitiveElementView = joint.dia.ElementView.extend({
return A([{
name: 'remove-button',
text: '&#xe915',
title: window.i18n.t('components.fd-diagram-editing-panel.remove-button-title').string,
handler: this.removeElement.bind(this),
attrs: {
'element': {'ref-dx': 0,'ref-y': 0, 'ref': '.joint-highlight-stroke' },
Expand All @@ -376,6 +380,7 @@ joint.shapes.flexberry.uml.PrimitiveElementView = joint.dia.ElementView.extend({
}, {
name: 'color-button',
text: '&#xf1fc',
title: window.i18n.t('components.fd-diagram-editing-panel.color-button-title').string,
handler: this.changeColorElement.bind(this),
attrs: {
'element': {'ref-dx': -14,'ref-y': 0, 'ref': '.joint-highlight-stroke' },
Expand Down
2 changes: 2 additions & 0 deletions addon/objects/uml-primitives/links-view/fd-empty-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export let EmptyView = joint.dia.LinkView.extend({
return A([{
name: 'remove-button',
text: '&#xe915',
title: window.i18n.t('components.fd-diagram-editing-panel.remove-button-title').string,
handler: this.removeLink.bind(this),
attrs: {
'element': { atConnectionRatio: .2 },
Expand All @@ -214,6 +215,7 @@ export let EmptyView = joint.dia.LinkView.extend({
}, {
name: 'color-button',
text: '&#xf1fc',
title: window.i18n.t('components.fd-diagram-editing-panel.color-button-title').string,
handler: this.changeColorElement.bind(this),
attrs: {
'element': { atConnectionRatio: .3 },
Expand Down
1 change: 1 addition & 0 deletions app/instance-initializers/i18n-for-object.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default, initialize } from 'ember-flexberry-designer/instance-initializers/i18n-for-object';

0 comments on commit 91b1bdd

Please sign in to comment.