1
0
Эх сурвалжийг харах

Password field: Titles for show/hide password links.

AntonLV 2 жил өмнө
parent
commit
60c8dd4c84

+ 3 - 0
inc/js/jquery.webForms.js

@@ -149,13 +149,16 @@
 
             $(this).find("a").on("click", function () {
                 var oIcon = $(this).find("i");
+                var oLink = oIcon.parents("a:first");
                 var oFld = $(this).parents(".bx-form-input-wrapper-password:first").find("input");
                 if (oIcon.hasClass("eye")) {
                     oIcon.removeClass("eye").addClass("eye-slash");
+                    oLink.attr('title', _t('_sys_form_input_password_hide'));
                     oFld.attr("type", "text");
                 }
                 else {
                     oIcon.addClass("eye").removeClass("eye-slash");
+                    oLink.attr('title', _t('_sys_form_input_password_show'));
                     oFld.attr("type", "password");
                 }
             });

+ 3 - 1
install/sql/system.sql

@@ -6254,7 +6254,9 @@ INSERT INTO `sys_preloader`(`module`, `type`, `content`, `active`, `order`) VALU
 ('system', 'js_translation', '_error occured', 1, 2),
 ('system', 'js_translation', '_sys_loading', 1, 3),
 ('system', 'js_translation', '_copyright', 1, 4),
-('system', 'js_translation', '_sys_redirect_confirmation', 1, 5);
+('system', 'js_translation', '_sys_redirect_confirmation', 1, 5),
+('system', 'js_translation', '_sys_form_input_password_show', 1, 6),
+('system', 'js_translation', '_sys_form_input_password_hide', 1, 7);
             
 -- --------------------------------------------------------
 

+ 2 - 0
modules/boonex/english/data/langs/system/en.xml

@@ -2562,6 +2562,8 @@ If it is not enabled then please consider implement this optimization, since it
         <string name="_sys_form_input_sys_labels"><![CDATA[Labels]]></string>
         <string name="_sys_form_input_labels"><![CDATA[Labels]]></string>
         <string name="_sys_form_input_labels_placeholder"><![CDATA[Add Label]]></string>
+        <string name="_sys_form_input_password_show"><![CDATA[Show password]]></string>
+        <string name="_sys_form_input_password_hide"><![CDATA[Hide password]]></string>
         <string name="_sys_form_labels"><![CDATA[Labels]]></string>
         <string name="_sys_form_labels_display_select"><![CDATA[Select labels display]]></string>
         <string name="_sys_form_labels_input_caption_system_name"><![CDATA[Name]]></string>

+ 2 - 0
modules/boonex/russian/data/langs/system/ru.xml

@@ -2533,6 +2533,8 @@
         <string name="_sys_form_input_sys_labels"><![CDATA[Метки]]></string>
         <string name="_sys_form_input_labels"><![CDATA[Метки]]></string>
 	<string name="_sys_form_input_labels_placeholder"><![CDATA[Добавить метку]]></string>
+        <string name="_sys_form_input_password_show"><![CDATA[Показать пароль]]></string>
+        <string name="_sys_form_input_password_hide"><![CDATA[Скрыть пароль]]></string>
         <string name="_sys_form_labels"><![CDATA[Метки]]></string>
         <string name="_sys_form_labels_display_select"><![CDATA[Выбор метки]]></string>
         <string name="_sys_form_labels_input_caption_system_name"><![CDATA[Имя]]></string>

+ 1 - 1
template/form_field_password.html

@@ -1,2 +1,2 @@
 __input__
-<a href="javascript:void(0)"><i class="sys-icon briefcase eye"></i></a>
+<a href="javascript:void(0)" title="<bx_text_attribute:_sys_form_input_password_show />"><i class="sys-icon briefcase eye"></i></a>