Dotclear

Changeset 3987:dcc501ff21f4 for plugins


Ignore:
Timestamp:
06/28/19 11:38:01 (6 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Switching from inline JS variables to JSON script, antispam plugin

Location:
plugins/antispam
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/antispam/index.php

    r3902 r3987  
    9696<head> 
    9797  <title><?php echo ($filter_gui !== false ? sprintf(__('%s configuration'), $filter->name) . ' - ' : '') . $page_name; ?></title> 
    98   <script type="text/javascript"> 
    99   <?php 
    100 echo dcPage::jsVar('dotclear.msg.confirm_spam_delete', __('Are you sure you want to delete all spams?')); 
    101 ?> 
    102   </script> 
    10398  <?php 
    10499echo dcPage::jsPageTabs($default_tab); 
     
    107102    echo 
    108103    dcPage::jsLoad('js/jquery/jquery-ui.custom.js') . 
    109     dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js') . 
    110     dcPage::jsLoad(dcPage::getPF('antispam/js/antispam.js')); 
     104    dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js'); 
    111105} 
    112 echo dcPage::cssLoad(dcPage::getPF('antispam/style.css')); 
     106echo 
     107    dcPage::jsJson('antispam', ['confirm_spam_delete' => __('Are you sure you want to delete all spams?')]) . 
     108    dcPage::jsLoad(dcPage::getPF('antispam/js/antispam.js')) . 
     109    dcPage::cssLoad(dcPage::getPF('antispam/style.css')); 
    113110?> 
    114111</head> 
  • plugins/antispam/js/antispam.js

    r3880 r3987  
    1 /*global $, dotclear */ 
     1/*global $, dotclear, getData */ 
    22'use strict'; 
     3 
     4Object.assign(dotclear.msg, getData('antispam')); 
    35 
    46$(function() { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map