Dotclear

Changeset 3993:c402c96de044


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

Switching from inline JS variables to JSON script, import/export plugin

Location:
plugins/importExport
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • plugins/importExport/inc/class.dc.import.flat.php

    r3874 r3993  
    151151 
    152152        echo 
    153         '<script type="text/javascript">' . "\n" . 
    154         dcPage::jsVar('dotclear.msg.confirm_full_import', 
    155             __('Are you sure you want to import a full backup file?')) . 
    156             "$(function() {" . 
    157             "$('#up_single_file').change(function() { " . 
    158             "if (this.value != '') { $('#public_single_file').val(''); } " . 
    159             "}); " . 
    160             "$('#public_single_file').change(function() { " . 
    161             "if (this.value != '') { $('#up_single_file').val(''); } " . 
    162             "}); " . 
    163             "$('#up_full_file').change(function() { " . 
    164             "if (this.value != '') { $('#public_full_file').val(''); } " . 
    165             "}); " . 
    166             "$('#public_full_file').change(function() { " . 
    167             "if (this.value != '') { $('#up_full_file').val(''); } " . 
    168             "}); " . 
    169             "$('#formfull').submit(function() { " . 
    170             "return window.confirm(dotclear.msg.confirm_full_import); " . 
    171             "}); " . 
    172             "});\n" . 
    173             "</script>\n"; 
    174  
     153        dcPage::jsJson('ie_import_flat_msg', 
     154            ['confirm_full_import' => __('Are you sure you want to import a full backup file?')]) . 
     155        dcPage::jsLoad(dcPage::getPF('importExport/js/import_flat.js')); 
    175156        echo 
    176157        '<form action="' . $this->getURL(true) . '" method="post" enctype="multipart/form-data" class="fieldset">' . 
  • plugins/importExport/index.php

    r3874 r3993  
    6262    <title>' . $title . '</title>' . 
    6363dcPage::cssLoad(dcPage::getPF('importExport/style.css')) . 
     64dcPage::jsJson('ie_msg', ['please_wait' => __('Please wait...')]) . 
    6465dcPage::jsLoad(dcPage::getPF('importExport/js/script.js')) . 
    65 '<script type="text/javascript"> 
    66     ' . dcPage::jsVar('dotclear.msg.please_wait', __('Please wait...')) . ' 
    67     </script> 
    68 </head> 
     66'</head> 
    6967<body>'; 
    7068 
  • plugins/importExport/js/script.js

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

Sites map