[DE mobile] Localization EditImage.

This commit is contained in:
Alexander Yuzhin 2016-11-18 17:01:41 +03:00
parent 6584fa1f24
commit 26e5b8bdcd
4 changed files with 113 additions and 56 deletions

View file

@ -46,7 +46,7 @@ define([
], function (core) {
'use strict';
DE.Controllers.EditImage = Backbone.Controller.extend((function() {
DE.Controllers.EditImage = Backbone.Controller.extend(_.extend((function() {
// Private
var _stack = [],
_imageObject = undefined,
@ -303,20 +303,20 @@ define([
if ($input) {
var value = ($input.val()).replace(/ /g, '');
_.delay(function () {
if (!_.isEmpty(value)) {
if ((/((^https?)|(^ftp)):\/\/.+/i.test(value))) {
if (!_.isEmpty(value)) {
if ((/((^https?)|(^ftp)):\/\/.+/i.test(value))) {
DE.getController('EditContainer').hideModal();
_.defer(function () {
var image = new Asc.asc_CImgProperty();
image.put_ImageUrl(value);
me.api.ImgApply(image);
DE.getController('EditContainer').hideModal();
} else {
uiApp.alert(me.txtNotUrl);
}
});
} else {
uiApp.alert(me.textEmptyImgUrl);
uiApp.alert(me.txtNotUrl);
}
}, 300);
} else {
uiApp.alert(me.textEmptyImgUrl);
}
}
},
@ -393,8 +393,8 @@ define([
return imageExist;
},
textEmptyImgUrl : 'You need to specify image URL.',
txtNotUrl : 'This field should be a URL in the format \"http://www.example.com\"'
};
})());
textEmptyImgUrl: 'You need to specify image URL.',
txtNotUrl: 'This field should be a URL in the format \"http://www.example.com\"'
}
})(), DE.Controllers.EditImage || {}))
});

View file

@ -6,7 +6,7 @@
<a id="image-wrap" class="item-link">
<div class="item-content">
<div class="item-inner">
<div class="item-title">Wrap</div>
<div class="item-title"><%= scope.textWrap %></div>
</div>
</div>
</a>
@ -15,7 +15,7 @@
<a id="image-replace" class="item-link">
<div class="item-content">
<div class="item-inner">
<div class="item-title">Replace</div>
<div class="item-title"><%= scope.textReplace %></div>
</div>
</div>
</a>
@ -24,7 +24,7 @@
<a id="image-reorder" class="item-link">
<div class="item-content">
<div class="item-inner">
<div class="item-title">Reorder</div>
<div class="item-title"><%= scope.textReorder %></div>
</div>
</div>
</a>
@ -35,16 +35,16 @@
<ul>
<li>
<% if (android) { %>
<a id="image-default" class="button button-raised button-fill" style="margin: 20px 16px;">Default Size</a>
<a id="image-default" class="button button-raised button-fill" style="margin: 20px 16px;"><%= scope.textDefault %></a>
<% } else { %>
<a id="image-default" class="item-link list-button" style="text-align: center;">Default Size</a>
<a id="image-default" class="item-link list-button" style="text-align: center;"><%= scope.textDefault %></a>
<% } %>
</li>
<li>
<% if (android) { %>
<a id="image-default" class="button button-raised button-fill" style="margin: 20px 16px; background-color: #f44336;">Remove Image</a>
<a id="image-default" class="button button-raised button-fill" style="margin: 20px 16px; background-color: #f44336;"><%= scope.textRemove %></a>
<% } else { %>
<a id="image-remove" class="item-link list-button" style="text-align: center; color: #f00">Remove Image</a>
<a id="image-remove" class="item-link list-button" style="text-align: center; color: #f00"><%= scope.textRemove %></a>
<% } %>
</li>
</ul>
@ -55,8 +55,8 @@
<div id="edit-image-reorder-view">
<div class="navbar">
<div class="navbar-inner">
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span>Back</span><% } %></a></div>
<div class="center sliding">Reorder</div>
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textReorder %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
@ -69,7 +69,7 @@
<div class="item-content">
<div class="item-media"><i class="icon icon-search"></i></div>
<div class="item-inner">
<div class="item-title">Bring to Foreground</div>
<div class="item-title"><%= scope.textToForeground %></div>
</div>
</div>
</a>
@ -79,7 +79,7 @@
<div class="item-content">
<div class="item-media"><i class="icon icon-search"></i></div>
<div class="item-inner">
<div class="item-title">Send to Background</div>
<div class="item-title"><%= scope.textToBackground %></div>
</div>
</div>
</a>
@ -89,7 +89,7 @@
<div class="item-content">
<div class="item-media"><i class="icon icon-search"></i></div>
<div class="item-inner">
<div class="item-title">Move Forward</div>
<div class="item-title"><%= scope.textForward %></div>
</div>
</div>
</a>
@ -99,7 +99,7 @@
<div data-type="move-down" class="item-content">
<div class="item-media"><i class="icon icon-search"></i></div>
<div class="item-inner">
<div class="item-title">Move Backward</div>
<div class="item-title"><%= scope.textBackward %></div>
</div>
</div>
</a>
@ -114,8 +114,8 @@
<div id="edit-image-wrap-view">
<div class="navbar">
<div class="navbar-inner">
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span>Back</span><% } %></a></div>
<div class="center sliding">Wrap</div>
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textWrap %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
@ -132,7 +132,7 @@
<div class="item-media"><i class="icon icon-search"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title">Inline</div>
<div class="item-title"><%= scope.textInline %></div>
</div>
</label>
</li>
@ -145,7 +145,7 @@
<div class="item-media"><i class="icon icon-search"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title">Square</div>
<div class="item-title"><%= scope.textSquare %></div>
</div>
</label>
</li>
@ -158,7 +158,7 @@
<div class="item-media"><i class="icon icon-search"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title">Tight</div>
<div class="item-title"><%= scope.textTight %></div>
</div>
</label>
</li>
@ -171,7 +171,7 @@
<div class="item-media"><i class="icon icon-search"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title">Through</div>
<div class="item-title"><%= scope.textThrough %></div>
</div>
</label>
</li>
@ -184,7 +184,7 @@
<div class="item-media"><i class="icon icon-search"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title">Top and Bottom</div>
<div class="item-title"><%= scope.textTopBottom %></div>
</div>
</label>
</li>
@ -197,7 +197,7 @@
<div class="item-media"><i class="icon icon-search"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title">In Front</div>
<div class="item-title"><%= scope.textInFront %></div>
</div>
</label>
</li>
@ -210,13 +210,13 @@
<div class="item-media"><i class="icon icon-search"></i></div>
<% } %>
<div class="item-inner">
<div class="item-title">Behind</div>
<div class="item-title"><%= scope.textBehind %></div>
</div>
</label>
</li>
</ul>
</div>
<div class="content-block-title align">Align</div>
<div class="content-block-title align"><%= scope.textAlign %></div>
<div class="list-block align">
<ul>
<li id="edit-image-align">
@ -237,7 +237,7 @@
<li id="edit-image-movetext">
<div class="item-content">
<div class="item-inner">
<div class="item-title">Move with Text</div>
<div class="item-title"><%= scope.textMoveText %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
@ -250,7 +250,7 @@
<li id="edit-image-overlap">
<div class="item-content">
<div class="item-inner">
<div class="item-title">Allow Overlap</div>
<div class="item-title">><%= scope.textOverlap %></div>
<div class="item-after">
<label class="label-switch">
<input type="checkbox">
@ -262,7 +262,7 @@
</li>
</ul>
</div>
<div class="content-block-title distance">Distance from text</div>
<div class="content-block-title distance"><%= scope.textDistanceText %></div>
<div class="list-block distance" style="margin-bottom: 40px;">
<ul>
<li id="table-distance">
@ -287,8 +287,8 @@
<div id="edit-image-replace-view">
<div class="navbar">
<div class="navbar-inner">
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span>Back</span><% } %></a></div>
<div class="center sliding">Replace</div>
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textReplace %></div>
<div class="right"><% if (phone) { %><a href="#" class="link icon-only close-picker"><i class="icon icon-expand-down"></i></a><% } %></div>
</div>
</div>
@ -303,7 +303,7 @@
<i class="icon icon-search"></i>
</div>
<div class="item-inner">
<div class="item-title">Picture from Library</div>
<div class="item-title"><%= scope.textFromLibrary %></div>
</div>
</div>
</a>
@ -315,7 +315,7 @@
<i class="icon icon-search"></i>
</div>
<div class="item-inner">
<div class="item-title">Picture from URL</div>
<div class="item-title"><%= scope.textFromURL %></div>
</div>
</div>
</a>
@ -330,20 +330,20 @@
<div id="edit-image-url-view">
<div class="navbar">
<div class="navbar-inner">
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span>Back</span><% } %></a></div>
<div class="center sliding">Link Settings</div>
<div class="left sliding"><a href="#" class="back link"><i class="icon icon-back"></i><% if (!android) { %><span><%= scope.textBack %></span><% } %></a></div>
<div class="center sliding"><%= scope.textLinkSettings %></div>
</div>
</div>
<div class="page edit-image-url-link">
<div class="page-content">
<div class="content-block-title">Address</div>
<div class="content-block-title"><%= scope.textAddress %></div>
<div class="list-block">
<ul>
<li>
<div class="item-content">
<div class="item-inner">
<div class="item-input">
<input type="url" placeholder="Image URL">
<input type="url" placeholder="<%= scope.textImageURL %>">
</div>
</div>
</div>
@ -352,11 +352,11 @@
</div>
<div class="list-block disabled buttons">
<% if (android) { %>
<a href="#" class="button button-fill button-raised" style="margin: 20px 16px;">Replace Image</a>
<a href="#" class="button button-fill button-raised" style="margin: 20px 16px;"><%= scope.textReplaceImg %></a>
<% } else { %>
<ul>
<li>
<a href="#" class="list-button item-link">Replace Image</a>
<a href="#" class="list-button item-link"><%= scope.textReplaceImg %></a>
</li>
</ul>
<% } %>

View file

@ -48,7 +48,7 @@ define([
], function (editTemplate, $, _, Backbone) {
'use strict';
DE.Views.EditImage = Backbone.View.extend((function() {
DE.Views.EditImage = Backbone.View.extend(_.extend((function() {
// private
return {
@ -83,7 +83,8 @@ define([
render: function () {
this.layout = $('<div/>').append(this.template({
android : Common.SharedSettings.get('android'),
phone : Common.SharedSettings.get('phone')
phone : Common.SharedSettings.get('phone'),
scope : this
}));
return this;
@ -149,7 +150,35 @@ define([
_.delay(function () {
$('.edit-image-url-link input[type="url"]').focus();
}, 1000);
}
},
textWrap: 'Wrap',
textReplace: 'Replace',
textReorder: 'Reorder',
textDefault: 'Default Size',
textRemove: 'Remove Image',
textBack: 'Back',
textToForeground: 'Bring to Foreground',
textToBackground: 'Send to Background',
textForward: 'Move Forward',
textBackward: 'Move Backward',
textInline: 'Inline',
textSquare: 'Square',
textTight: 'Tight',
textThrough: 'Through',
textTopBottom: 'Top and Bottom',
textInFront: 'In Front',
textBehind: 'Behind',
textAlign: 'Align',
textMoveText: 'Move with Text',
textOverlap: 'Allow Overlap',
textDistanceText: 'Distance from Text',
textFromLibrary: 'Picture from Library',
textFromURL: 'Picture from URL',
textLinkSettings: 'Link Settings',
textAddress: 'Address',
textImageURL: 'Image URL',
textReplaceImg: 'Replace Image'
}
})());
})(), DE.Views.EditImage || {}))
});

View file

@ -220,7 +220,35 @@
"DE.Views.EditHyperlink.textDisplay": "Display",
"DE.Views.EditHyperlink.textTip": "Screen Tip",
"DE.Views.EditHyperlink.textEdit": "Edit Link",
"DE.Views.EditHyperlink.textRemove": "Remove Link"
"DE.Views.EditHyperlink.textRemove": "Remove Link",
"DE.Controllers.EditImage.textEmptyImgUrl": "You need to specify image URL.",
"DE.Controllers.EditImage.txtNotUrl": "This field should be a URL in the format 'http://www.example.com",
"DE.Views.EditImage.textWrap": "Wrap",
"DE.Views.EditImage.textReplace": "Replace",
"DE.Views.EditImage.textReorder": "Reorder",
"DE.Views.EditImage.textDefault": "Default Size",
"DE.Views.EditImage.textRemove": "Remove Image",
"DE.Views.EditImage.textBack": "Back",
"DE.Views.EditImage.textToForeground": "Bring to Foreground",
"DE.Views.EditImage.textToBackground": "Send to Background",
"DE.Views.EditImage.textForward": "Move Forward",
"DE.Views.EditImage.textBackward": "Move Backward",
"DE.Views.EditImage.textInline": "Inline",
"DE.Views.EditImage.textSquare": "Square",
"DE.Views.EditImage.textTight": "Tight",
"DE.Views.EditImage.textThrough": "Through",
"DE.Views.EditImage.textTopBottom": "Top and Bottom",
"DE.Views.EditImage.textInFront": "In Front",
"DE.Views.EditImage.textBehind": "Behind",
"DE.Views.EditImage.textAlign": "Align",
"DE.Views.EditImage.textMoveText": "Move with Text",
"DE.Views.EditImage.textOverlap": "Allow Overlap",
"DE.Views.EditImage.textDistanceText": "Distance from Text",
"DE.Views.EditImage.textFromLibrary": "Picture from Library",
"DE.Views.EditImage.textFromURL": "Picture from URL",
"DE.Views.EditImage.textLinkSettings": "Link Settings",
"DE.Views.EditImage.textAddress": "Address",
"DE.Views.EditImage.textImageURL": "Image URL",
"DE.Views.EditImage.textReplaceImg": "Replace Image"
}