Attached Files |
crome_wrong_autocomplete_fix.patch [^] (12,485 bytes) 2011-12-30 10:39
[Show Content]
Index: admin_templates/config/config_general.tpl
===================================================================
--- admin_templates/config/config_general.tpl (revision 14949)
+++ admin_templates/config/config_general.tpl (working copy)
@@ -5,79 +5,94 @@
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
-<tbody>
- <tr>
- <td>
- <script type="text/javascript">
+ <tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ function validate_password_fields() {
+ var $validated = true;
- function ValidatePassFld(fieldId){
- var passFld=document.getElementById(fieldId);
- var passVerifyFld=document.getElementById('verify_'+fieldId);
- if (passFld && passVerifyFld && passFld.value == passVerifyFld.value) {
- return true;
- }
- else {
- var passErrorCell=document.getElementById('error_'+fieldId);
- if (passErrorCell){
- passErrorCell.innerHTML='<inp2:m_phrase name="la_error_PasswordMatch" />';
- }
- return false;
- }
- }
+ $("input[primarytype='password']", '#' + $form_name).each(
+ function ($e) {
+ if ( !validate_password_field(this.id) ) {
+ $validated = false;
+ }
+ }
+ );
- function ValidatePassFields(){
- var el=false;
- var validated=true;
- for (var i=0; i<document.forms.kernel_form.elements.length; i++){
- el=document.forms.kernel_form.elements[i];
- if (el.getAttribute('primarytype')=='password'){
- if (!ValidatePassFld(el.id)){
- validated=false;
- }
- }
- }
- return validated;
- }
+ return $validated;
+ }
- function toggle_section($label) {
- var $table = document.getElementById('config_table');
- var $row = null;
- var $is_visible = false;
+ function validate_password_field($field_id) {
+ var password_field = document.getElementById($field_id),
+ password_verify_field = document.getElementById('verify_' + $field_id);
- for (var $i = 0; $i < $table.rows.length; $i++) {
- $row = $table.rows[$i];
- if ($row.getAttribute('header_label') != $label) {
- continue;
- }
+ if ( password_field && password_verify_field && password_field.value == password_verify_field.value ) {
+ return true;
+ }
+ else {
+ var password_error_cell = document.getElementById('error_' + $field_id);
- if (!$row.style.display) {
- $row.style.display = document.all ? 'block' : 'table-row';
- }
+ if ( password_error_cell ) {
+ $(window).scrollTop($(password_field).position().top - 15);
+ password_error_cell.innerHTML = '<inp2:m_Phrase name="la_error_PasswordMatch"/>';
+ }
- $is_visible = !($row.style.display == 'none');
- $row.style.display = $is_visible ? 'none' : (document.all ? 'block' : 'table-row');
+ return false;
+ }
+ }
- document.getElementById('toggle_mark['+$label+']').innerHTML = '[' + ($is_visible ? '+' : '-') + ']';
- }
- }
+ function toggle_section($label) {
+ var $table = document.getElementById('config_table');
+ var $row = null;
+ var $is_visible = false;
- var a_toolbar = new ToolBar();
- a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
- if (ValidatePassFields()){
- submit_event('conf','<inp2:conf_SaveEvent/>');
+ for (var $i = 0; $i < $table.rows.length; $i++) {
+ $row = $table.rows[$i];
+ if ( $row.getAttribute('header_label') != $label ) {
+ continue;
}
+
+ if ( !$row.style.display ) {
+ $row.style.display = document.all ? 'block' : 'table-row';
+ }
+
+ $is_visible = !($row.style.display == 'none');
+ $row.style.display = $is_visible ? 'none' : (document.all ? 'block' : 'table-row');
+
+ document.getElementById('toggle_mark[' + $label + ']').innerHTML = '[' + ($is_visible ? '+' : '-') + ']';
}
- ) );
- a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
- submit_event('conf','OnCancel');
- }
- ) );
+ }
- a_toolbar.Render();
- </script>
- </td>
- </tr>
-</tbody>
+ var a_toolbar = new ToolBar();
+
+ a_toolbar.AddButton(
+ new ToolBarButton(
+ 'select',
+ '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>',
+ function() {
+ submit_event('conf','<inp2:conf_SaveEvent/>');
+ }
+ )
+ );
+
+ a_toolbar.AddButton(
+ new ToolBarButton(
+ 'cancel',
+ '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>',
+ function() {
+ submit_event('conf','OnCancel');
+ }
+ )
+ );
+
+ <inp2:m_ModuleInclude template = "config/custom_toolbar"/>
+
+ a_toolbar.Render();
+ </script>
+ </td>
+ </tr>
+ </tbody>
</table>
<inp2:m_include t="incs/config_blocks"/>
@@ -129,6 +144,13 @@
$menu_frame.parent.location.href = $menu_frame.parent.location.href;
</inp2:m_if>
+
+ Application.setHook(
+ 'conf:*',
+ function ($event) {
+ $event.status = $event.Name == 'OnCancel' ? true : validate_password_fields();
+ }
+ );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: admin_templates/config/config_universal.tpl
===================================================================
--- admin_templates/config/config_universal.tpl (revision 14949)
+++ admin_templates/config/config_universal.tpl (working copy)
@@ -6,92 +6,94 @@
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
-<tbody>
- <tr>
- <td>
- <script type="text/javascript">
- function ValidatePassFld(fieldId) {
- var passFld=document.getElementById(fieldId);
- var passVerifyFld=document.getElementById('verify_'+fieldId);
- if (passFld && passVerifyFld && passFld.value == passVerifyFld.value) {
- return true;
- }
- else {
- var passErrorCell=document.getElementById('error_'+fieldId);
- if (passErrorCell){
- passErrorCell.innerHTML='<inp2:m_phrase name="la_error_PasswordMatch" />';
- }
- return false;
- }
- }
+ <tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ function validate_password_fields() {
+ var $validated = true;
- function ValidatePassFields() {
- var el=false;
- var validated=true;
- for (var i=0; i<document.forms.kernel_form.elements.length; i++){
- el=document.forms.kernel_form.elements[i];
- if (el.getAttribute('primarytype')=='password'){
- if (!ValidatePassFld(el.id)){
- validated=false;
- }
- }
- }
- return validated;
- }
+ $("input[primarytype='password']", '#' + $form_name).each(
+ function ($e) {
+ if ( !validate_password_field(this.id) ) {
+ $validated = false;
+ }
+ }
+ );
- function toggle_section($label) {
- var $table = document.getElementById('config_table');
- var $row = null;
- var $is_visible = false;
+ return $validated;
+ }
- for (var $i = 0; $i < $table.rows.length; $i++) {
- $row = $table.rows[$i];
- if ($row.getAttribute('header_label') != $label) {
- continue;
- }
+ function validate_password_field($field_id) {
+ var password_field = document.getElementById($field_id),
+ password_verify_field = document.getElementById('verify_' + $field_id);
- if (!$row.style.display) {
- $row.style.display = document.all ? 'block' : 'table-row';
- }
+ if ( password_field && password_verify_field && password_field.value == password_verify_field.value ) {
+ return true;
+ }
+ else {
+ var password_error_cell = document.getElementById('error_' + $field_id);
- $is_visible = !($row.style.display == 'none');
- $row.style.display = $is_visible ? 'none' : (document.all ? 'block' : 'table-row');
+ if ( password_error_cell ) {
+ $(window).scrollTop($(password_field).position().top - 15);
+ password_error_cell.innerHTML = '<inp2:m_Phrase name="la_error_PasswordMatch"/>';
+ }
- document.getElementById('toggle_mark['+$label+']').innerHTML = '[' + ($is_visible ? '+' : '-') + ']';
- }
- }
+ return false;
+ }
+ }
- var a_toolbar = new ToolBar();
+ function toggle_section($label) {
+ var $row = null,
+ $is_visible = false,
+ $table = document.getElementById('config_table');
- a_toolbar.AddButton(
- new ToolBarButton(
- 'select',
- '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>',
- function() {
- if (ValidatePassFields()) {
- submit_event('conf', '<inp2:conf_SaveEvent/>');
+ for (var $i = 0; $i < $table.rows.length; $i++) {
+ $row = $table.rows[$i];
+ if ( $row.getAttribute('header_label') != $label ) {
+ continue;
}
- }
- )
- );
- a_toolbar.AddButton(
- new ToolBarButton(
- 'cancel',
- '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>',
- function() {
- submit_event('conf', 'OnCancel');
+ if ( !$row.style.display ) {
+ $row.style.display = document.all ? 'block' : 'table-row';
+ }
+
+ $is_visible = !($row.style.display == 'none');
+ $row.style.display = $is_visible ? 'none' : (document.all ? 'block' : 'table-row');
+
+ document.getElementById('toggle_mark[' + $label + ']').innerHTML = '[' + ($is_visible ? '+' : '-') + ']';
}
- )
- );
+ }
- <inp2:m_ModuleInclude template="config/custom_toolbar"/>
+ var a_toolbar = new ToolBar();
- a_toolbar.Render();
- </script>
- </td>
- </tr>
-</tbody>
+ a_toolbar.AddButton(
+ new ToolBarButton(
+ 'select',
+ '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>',
+ function () {
+ submit_event('conf', '<inp2:conf_SaveEvent/>');
+ }
+ )
+ );
+
+ a_toolbar.AddButton(
+ new ToolBarButton(
+ 'cancel',
+ '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>',
+ function () {
+ submit_event('conf', 'OnCancel');
+ }
+ )
+ );
+
+ <inp2:m_ModuleInclude template = "config/custom_toolbar"/>
+
+ a_toolbar.Render();
+ </script>
+ </td>
+ </tr>
+ </tbody>
</table>
<inp2:m_include t="incs/config_blocks"/>
@@ -113,6 +115,13 @@
$menu_frame.parent.location.href = $menu_frame.parent.location.href;
</inp2:m_if>
+
+ Application.setHook(
+ 'conf:*',
+ function ($event) {
+ $event.status = $event.Name == 'OnCancel' ? true : validate_password_fields();
+ }
+ );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: admin_templates/incs/config_blocks.tpl
===================================================================
--- admin_templates/incs/config_blocks.tpl (revision 14949)
+++ admin_templates/incs/config_blocks.tpl (working copy)
@@ -3,13 +3,13 @@
</inp2:m_DefineElement>
<inp2:m_DefineElement name="config_edit_password">
- <input type="password" tabindex="<inp2:m_get param='tab_index'/>" primarytype="password" name="<inp2:InputName field='$field'/>" id="<inp2:InputName field='$field'/>" value="" />
+ <input type="password" autocomplete="off" tabindex="<inp2:m_get param='tab_index'/>" primarytype="password" name="<inp2:InputName field='$field'/>" id="<inp2:InputName field='$field'/>" value="" />
<inp2:m_Inc param="tab_index" by="1"/>
- <input type="password" tabindex="<inp2:m_get param='tab_index'/>" name="verify_<inp2:InputName field='$field'/>" id="verify_<inp2:InputName field='$field'/>" value="" />
+ <input type="password" autocomplete="off" tabindex="<inp2:m_get param='tab_index'/>" name="verify_<inp2:InputName field='$field'/>" id="verify_<inp2:InputName field='$field'/>" value="" />
<span class="error" id="error_<inp2:InputName field="$field"/>"></span>
<script type="text/javascript">
- addLoadEvent(
+ $(document).ready(
function() {
// fixes Firefox 2.0+ bug will password autocomplete
document.getElementById('<inp2:InputName field="$field"/>').value = '';
crome_wrong_autocomplete_fix-additional-EditUserAdmin.patch [^] (4,883 bytes) 2012-01-06 16:25
[Show Content]
Index: admin_templates/incs/form_blocks.tpl
===================================================================
--- admin_templates/incs/form_blocks.tpl (revision 15012)
+++ admin_templates/incs/form_blocks.tpl (working copy)
@@ -183,10 +183,10 @@
<!--##<td class="error-cell"><inp2:{$prefix}_Error field="$field"/> </td>##-->
</inp2:m_DefineElement>
-<inp2:m_DefineElement name="inp_edit_box" class="" format="" maxlength="" onblur="" onchange="" size="" onkeyup="" allow_html="" edit_template="popups/editor" style="width: 100%" after_text="">
+<inp2:m_DefineElement name="inp_edit_box" class="" format="" maxlength="" onblur="" onchange="" size="" onkeyup="" allow_html="" edit_template="popups/editor" style="width: 100%" after_text="" autocomplete="">
<inp2:m_RenderElement design="form_row" pass_params="1">
<td class="control-cell">
- <input style="<inp2:m_Param name='style'/>" type="text" name="<inp2:{$prefix}_InputName field='$field'/>" id="<inp2:{$prefix}_InputName field='$field'/>" value="<inp2:{$prefix}_Field field='$field' format='$format'/>" tabindex="<inp2:m_Get name='tab_index'/>" size="<inp2:m_param name='size'/>" maxlength="<inp2:m_param name='maxlength'/>" class="<inp2:m_param name='class'/>" onblur="<inp2:m_Param name='onblur'/>" onkeyup="<inp2:m_Param name='onkeyup'/>" onchange="<inp2:m_Param name='onchange'/>"><inp2:m_Param name="after_text"/>
+ <input style="<inp2:m_Param name='style'/>" type="text" name="<inp2:{$prefix}_InputName field='$field'/>" id="<inp2:{$prefix}_InputName field='$field'/>" value="<inp2:{$prefix}_Field field='$field' format='$format'/>" tabindex="<inp2:m_Get name='tab_index'/>" size="<inp2:m_param name='size'/>" maxlength="<inp2:m_param name='maxlength'/>" class="<inp2:m_param name='class'/>" onblur="<inp2:m_Param name='onblur'/>" onkeyup="<inp2:m_Param name='onkeyup'/>" onchange="<inp2:m_Param name='onchange'/>" autocomplete="<inp2:m_Param name='autocomplete'/>"><inp2:m_Param name="after_text"/>
</td>
</inp2:m_RenderElement>
</inp2:m_DefineElement>
@@ -278,7 +278,7 @@
<inp2:m_DefineElement name="inp_edit_password" class="" size="" style="">
<inp2:m_RenderElement design="form_row" pass_params="1">
<td class="control-cell">
- <input style="<inp2:m_Param name='style'/>" type="password" name="<inp2:{$prefix}_InputName field='$field'/>" id="<inp2:{$prefix}_InputName field='$field'/>" value="<inp2:{$prefix}_Field name='{$field}_plain'/>" tabindex="<inp2:m_Get name='tab_index'/>" size="<inp2:m_param name='size'/>" class="<inp2:m_param name='class'/>" />
+ <input style="<inp2:m_Param name='style'/>" autocomplete="off" type="password" name="<inp2:{$prefix}_InputName field='$field'/>" id="<inp2:{$prefix}_InputName field='$field'/>" value="<inp2:{$prefix}_Field name='{$field}_plain'/>" tabindex="<inp2:m_Get name='tab_index'/>" size="<inp2:m_param name='size'/>" class="<inp2:m_param name='class'/>" />
<script type="text/javascript">
$(document).ready(
Index: admin_templates/users/admins_edit.tpl
===================================================================
--- admin_templates/users/admins_edit.tpl (revision 15012)
+++ admin_templates/users/admins_edit.tpl (working copy)
@@ -68,7 +68,7 @@
<table class="edit-form">
<inp2:m_RenderElement name="subsection" prefix="u" fields="PortalUserId,Username,Password,FirstName,LastName,Email" title="la_section_General"/>
<inp2:m_RenderElement name="inp_id_label" prefix="u" field="PortalUserId" title="la_fld_Id"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Username" title="la_fld_Username"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Username" title="la_fld_Username" autocomplete="off"/>
<inp2:m_RenderElement name="password_fields" />
<inp2:m_RenderElement name="inp_edit_box" prefix="u" field="FirstName" title="la_fld_FirstName"/>
Index: admin_templates/users/users_edit.tpl
===================================================================
--- admin_templates/users/users_edit.tpl (revision 15012)
+++ admin_templates/users/users_edit.tpl (working copy)
@@ -64,7 +64,7 @@
<table class="edit-form">
<inp2:m_RenderElement name="subsection" prefix="u" fields="PortalUserId,Username,Password" title="la_section_General"/>
<inp2:m_RenderElement name="inp_id_label" prefix="u" field="PortalUserId" title="la_fld_Id"/>
- <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Username" title="la_fld_Username"/>
+ <inp2:m_RenderElement name="inp_edit_box" prefix="u" field="Username" title="la_fld_Username" autocomplete="off"/>
<inp2:m_RenderElement name="password_fields" />
<inp2:m_RenderElement name="subsection" prefix="u" fields="FirstName,LastName,Company,Email,dob,Phone,Fax,Street,Street2,City,State,Zip,Country" title="la_prompt_PersonalInfo"/> <!-- OLD PHRASE, la_section_PersonalInformation -->
|