Dotclear

Changeset 3919:f0be8a8c7715 for inc


Ignore:
Timestamp:
11/06/18 13:29:04 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Switching from inline JS variables to JSON script. Includes a copy of getData() function in common.js

Location:
inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inc/admin/lib.dc.page.php

    r3915 r3919  
    172172        '  <meta name="viewport" content="width=device-width, initial-scale=1.0" />' . "\n" . 
    173173        '  <title>' . $title . ' - ' . html::escapeHTML($core->blog->name) . ' - ' . html::escapeHTML(DC_VENDOR_NAME) . ' - ' . DC_VERSION . '</title>' . "\n"; 
    174  
    175         echo self::jsUtil(); 
    176174 
    177175        if ($core->auth->user_prefs->interface->darkmode) { 
     
    449447        '  <meta name="GOOGLEBOT" content="NOSNIPPET" />' . "\n"; 
    450448 
    451         echo self::jsUtil(); 
    452  
    453449        if ($core->auth->user_prefs->interface->darkmode) { 
    454450            $js['darkMode'] = 1; 
     
    724720 
    725721        return $ret; 
    726     } 
    727  
    728     public static function jsUtil() 
    729     { 
    730         $core = self::getCore(); 
    731         return self::jsLoad($core->blog->getPF('util.js')); 
    732722    } 
    733723 
  • inc/core/class.dc.utils.php

    r3913 r3919  
    137137    public static function jsJson($id, $vars) 
    138138    { 
    139         // Use echo dcUtils::jsLoad($core->blog->getPF('util.js')); to use the JS getData() decoder 
    140         // or echo dcPage::jsUtil(); in admin mode 
     139        // Use echo dcUtils::jsLoad($core->blog->getPF('util.js')); to use the JS getData() decoder in public mode 
    141140        $ret = '<script type="application/json" id="' . html::escapeHTML($id) . '-data">' . "\n" . 
    142141            json_encode($vars, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES) . "\n" . '</script>'; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map