Dotclear


Ignore:
Timestamp:
06/25/19 10:19:23 (6 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Switching from inline JS variables to JSON script, user prefs page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/preferences.php

    r3902 r3981  
    417417-------------------------------------------------------- */ 
    418418dcPage::open($page_title, 
    419     dcPage::jsLoad('js/_preferences.js') . 
    420419    ($user_acc_nodragdrop ? '' : dcPage::jsLoad('js/_preferences-dragdrop.js')) . 
    421420    dcPage::jsLoad('js/jquery/jquery-ui.custom.js') . 
    422421    dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js') . 
    423422    dcPage::jsLoad('js/jquery/jquery.pwstrength.js') . 
    424     '<script type="text/javascript">' . "\n" . 
    425     "\$(function() {\n" . 
    426     "   \$('#new_pwd').pwstrength({texts: ['" . 
    427     sprintf(__('Password strength: %s'), __('very weak')) . "', '" . 
    428     sprintf(__('Password strength: %s'), __('weak')) . "', '" . 
    429     sprintf(__('Password strength: %s'), __('mediocre')) . "', '" . 
    430     sprintf(__('Password strength: %s'), __('strong')) . "', '" . 
    431     sprintf(__('Password strength: %s'), __('very strong')) . "']});\n" . 
    432     "});\n" . 
    433     "</script>\n" . 
     423    dcPage::jsJson('preferences', [ 
     424            sprintf(__('Password strength: %s'), __('very weak')), 
     425            sprintf(__('Password strength: %s'), __('weak')), 
     426            sprintf(__('Password strength: %s'), __('mediocre')), 
     427            sprintf(__('Password strength: %s'), __('strong')), 
     428            sprintf(__('Password strength: %s'), __('very strong')) 
     429        ]) . 
     430    dcPage::jsLoad('js/_preferences.js') . 
    434431    dcPage::jsPageTabs($default_tab) . 
    435432    dcPage::jsConfirmClose('user-form', 'opts-forms', 'favs-form') . 
Note: See TracChangeset for help on using the changeset viewer.

Sites map