fnp
/
fnpeditor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f098ff9
)
editor: tweaking some action descriptions
author
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 23 Apr 2014 14:48:21 +0000
(16:48 +0200)
committer
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 23 Apr 2014 14:48:21 +0000
(16:48 +0200)
src/editor/plugins/core/core.js
patch
|
blob
|
history
src/editor/plugins/core/lists.js
patch
|
blob
|
history
src/editor/plugins/core/switch.js
patch
|
blob
|
history
src/editor/plugins/core/templates.js
patch
|
blob
|
history
diff --git
a/src/editor/plugins/core/core.js
b/src/editor/plugins/core/core.js
index
b678ca3
..
ed0cf28
100644
(file)
--- a/
src/editor/plugins/core/core.js
+++ b/
src/editor/plugins/core/core.js
@@
-158,7
+158,7
@@
var commentAction = {
params.fragment instanceof params.fragment.NodeFragment && !params.fragment.node.isRoot()
};
if(state.allowed) {
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;
}
}
return state;
}
@@
-310,7
+310,12
@@
var linkAction = {
if(params.fragment instanceof params.fragment.CaretFragment) {
if(params.fragment.node.isInside('link')) {
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 {allowed: false};
diff --git
a/src/editor/plugins/core/lists.js
b/src/editor/plugins/core/lists.js
index
427673e
..
0c017f8
100644
(file)
--- a/
src/editor/plugins/core/lists.js
+++ b/
src/editor/plugins/core/lists.js
@@
-101,6
+101,7
@@
var toggleListAction = function(type) {
return false;
};
return false;
};
+ var label = type === 'Bullet' ? gettext('bull. list') : gettext('num. list');
return {
name: 'toggle' + type + 'List',
return {
name: 'toggle' + type + 'List',
@@
-109,7
+110,7
@@
var toggleListAction = function(type) {
fragment: {type: 'context', name: 'fragment'}
},
stateDefaults: {
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()) {
},
getState: function(params) {
if(!params.fragment || !params.fragment.isValid()) {
@@
-121,7
+122,7
@@
var toggleListAction = function(type) {
if((list.getClass() === 'list' && type === 'Enum') || (list.getClass() === 'list.enum' && type === 'Bullet')) {
return {
allowed: true,
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
};
}
execute: execute.changeType
};
}
diff --git
a/src/editor/plugins/core/switch.js
b/src/editor/plugins/core/switch.js
index
9b34721
..
ff49eb8
100644
(file)
--- a/
src/editor/plugins/core/switch.js
+++ b/
src/editor/plugins/core/switch.js
@@
-14,7
+14,7
@@
var createSwitchAction = function(createParams) {
},
getState: function(params) {
var state = {
},
getState: function(params) {
var state = {
- label:
this.config.label
+ label:
createParams.to.name
},
f = params.fragment,
description;
},
f = params.fragment,
description;
@@
-39,7
+39,7
@@
var createSwitchAction = function(createParams) {
toSwitch = toSwitch.getParent(createParams.from);
}
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,
return _.extend(state, {
allowed: !!toSwitch,
toggled: alreadyInTarget,
diff --git
a/src/editor/plugins/core/templates.js
b/src/editor/plugins/core/templates.js
index
7d6d74f
..
bca8467
100644
(file)
--- a/
src/editor/plugins/core/templates.js
+++ b/
src/editor/plugins/core/templates.js
@@
-34,7
+34,7
@@
var insertTemplateAction = {
};
}
};
}
- 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,
return {
allowed: true,
description: description,