NPM Resource Changed ? ? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
10 Jun 2019

Replaces #24335
Thanks @bahl24

Summary of Changes

Creates an es6.js file in the build/media_source/com_templates/

Testing Instructions

Patch.
Run npm
Edit Cassiopea template style
Template(Styles) -> Menu Assignment -> 'Toggle Selection' buttons

After patch

template_assignment

Note:

There may be another way to format the es6.js. Please comment before merge.
@C-Lodder
@dgrammatiko

avatar infograf768 infograf768 - open - 10 Jun 2019
avatar infograf768 infograf768 - change - 10 Jun 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Jun 2019
Category Administration com_templates JavaScript Repository NPM Change
avatar infograf768 infograf768 - change - 10 Jun 2019
The description was changed
avatar infograf768 infograf768 - edited - 10 Jun 2019
avatar infograf768 infograf768 - change - 10 Jun 2019
Labels Added: NPM Resource Changed ?
47ba13d 10 Jun 2019 avatar infograf768 more
avatar infograf768
infograf768 - comment - 10 Jun 2019

I guess I need help to solve hound : is defined but never used no-unused-vars...

avatar dgrammatiko
dgrammatiko - comment - 10 Jun 2019

@infograf768 couple things here:

  • DO NOT use Global vars (eg instead of toggleAll() you need to do Joomla.toggleAll() )
  • Wrap the code in an IIFE ( () => { /** your code here */ }();

eg:

/**
 * @copyright  Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
Joomla = window.Joomla || {};

(Joomla => {
  Joomla.toggleAll = () => {
    const checkBoxes = [].slice.call(document.querySelectorAll('.chk-menulink'));
    const value = checkBoxes[0].checked;
    checkBoxes.forEach((checkBox) => {
      checkBox.checked = !value;
    });
  };

  Joomla.toggleMenutype = (a) => {
    const checkBox = [].slice.call(document.getElementsByClassName(a));
    const value = checkBox[0].checked;
    checkBox.forEach((element) => {
      element.checked = !value;
    });
  };
})(Joomla);
avatar infograf768
infograf768 - comment - 10 Jun 2019

Tks, testing now

avatar infograf768
infograf768 - comment - 10 Jun 2019

Would be nice to use hound on localhost

avatar roland-d
roland-d - comment - 10 Jun 2019
avatar dgrammatiko
dgrammatiko - comment - 10 Jun 2019

@infograf768 you can use the lint command eg npx eslint . or npm run lint:js
Bonus you can run npx eslint . --fix to autofix the CS

avatar richard67
richard67 - comment - 10 Jun 2019

I have tested this item successfully on ed17974


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25155.

avatar richard67 richard67 - test_item - 10 Jun 2019 - Tested successfully
avatar richard67
richard67 - comment - 10 Jun 2019

I have not tested this item.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25155.

avatar richard67
richard67 - comment - 10 Jun 2019

I have not tested this item.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25155.

avatar richard67 richard67 - test_item - 10 Jun 2019 - Not tested
829e7d7 10 Jun 2019 avatar infograf768 oops
avatar infograf768
infograf768 - comment - 10 Jun 2019

@richard67
Should be OK now.

avatar richard67
richard67 - comment - 10 Jun 2019

I have tested this item successfully on 37b9809


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25155.

avatar richard67 richard67 - test_item - 10 Jun 2019 - Tested successfully
avatar Quy
Quy - comment - 10 Jun 2019

I have tested this item successfully on 37b9809


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25155.

avatar Quy
Quy - comment - 10 Jun 2019

I have tested this item successfully on 37b9809


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25155.

avatar Quy Quy - test_item - 10 Jun 2019 - Tested successfully
avatar joomla-cms-bot joomla-cms-bot - edited - 10 Jun 2019
avatar Quy Quy - change - 10 Jun 2019
Status Pending Ready to Commit
avatar Quy
Quy - comment - 10 Jun 2019

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25155.

avatar Quy
Quy - comment - 10 Jun 2019

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25155.

avatar wilsonge wilsonge - change - 10 Jun 2019
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-06-10 23:01:36
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 10 Jun 2019
avatar wilsonge wilsonge - merge - 10 Jun 2019
avatar wilsonge
wilsonge - comment - 10 Jun 2019

Thanks!

Add a Comment

Login with GitHub to post a comment