Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix selector in js for Moodle 3.9 #13

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open

Conversation

markanyx
Copy link

Also backward compatible for versions before 3.9

sharpchi and others added 30 commits March 14, 2014 14:36
Allowing all course formats.
When a user chose to hide or show one or more activities, the context
was not set and an error was thrown. Added a call to $PAGE->set_context
to correct this.
- Added $plugin->component in version.php in preparation for Moodle
  3.0 compatibility
- Changed $plugin->release to be an actual version number
- Renamed README to README.txt for compliance with Moodle.org's
  plugin uploading tool
- Advanced $plugin->version to today's date due to these changes
- Corrected the Github URLs in README.txt
- Bumped human-readable version to 1.1.1
Previously, this block was only usable with the Topics or Weekly
course formats. However, it functions perfectly well with the
Flexible Sections and Collapsed Topics formats, also, and so those
are now whitelisted for use with this block. I would have preferred
using a blacklist rather than a whitelist, but the Moodle code that
checks this doesn't check for true/false. Instead, it simply assumes
any entries present are able to use this block, and so we are stuck
with a whitelist (for now).
Instead of using an explicit whitelist of course formats allowed to
use this block, change applicable_formats() to allow any course format
to use this block while still proscribing its use for plugins and tags.
This is needed because there are many course formats, some of which
are custom and, thus, specific to a single organization (and yet should
still be able to use this block).
A problem was discovered where the checkbox variable would be null
when a non-input HTML element, such as LI, had an id conforming to
the pattern expected by Mass Actions when attempting to carry out
the user's selected action. This resulted in a Javascript error
that rendered the block unusable and made the page appear
unresponsive to the user. By simply checking that the checkbox
variable is not null first, we can ensure we skip and do not attempt
to process non-input elements.
A problem was discovered where the checkbox variable would be null
when a non-input HTML element, such as LI, had an id conforming to
the pattern expected by Mass Actions when attempting to carry out
the user's selected action. This resulted in a Javascript error
that rendered the block unusable and made the page appear
unresponsive to the user. By simply checking that the checkbox
variable is not null first, we can ensure we skip and do not attempt
to process non-input elements.
This corrects a spelling error in the CSS class assigned to the
checkboxes, changing it from module_sector_checkbox to
module_selector_checkbox.
Added confirmation dialog for mass deletions
Updated the README and incremented the version number since the
deletion confirmation prompt from rlorenzo was added.
This just cleans up things like non-cuddled 'else's, single-line
comments that don't start with a capital letter and end with a
punctuation mark, extraneous white-space, and so on. None of this
is worth incrementing the version number or updating the README.
Enables users to select one or more modules and duplicate them to
a course section of their choosing.
Multiple checkboxes would display for activities in sub-sections.
The number of checkboxes displayed was equal to the number of
levels 'deep'/'nested' the section was to which the activity belonged.
I forgot to give proper credit for the source of the latest
change. This corrects that oversight.
This adds a div that is shown when Javascript is disabled, which
informs the user that Javascript is required to use this block. It
also surrounds the regular content of the block with a div that is
only shown when Javascript is enabled.
This moves the string displayed when Javascript is disabled into
the language file. I have updated the French language file with
help from Google Translate. If any French users have a better
translation, I'd be happy to use that, instead. The Hebrew language
file has not been updated since I lack the characterset.
This fixes the regression that causes checkboxes not to be drawn
when a course is in Flexible Sections format.
This fixes all the Travis CI warnings and errors.
This makes the plugin compatible with the OneTopic course format.
This changes the documentation to reflect this version of the plugin
is compatible with Moodle 2.8 and later.
This removes the h3 tag requirement from module.js so the plugin
will work better with themes that use other tags for section
headings.
cdsmith-umn and others added 21 commits November 15, 2016 12:10
This fixes a bug with compatibility with the OneTopic course format
where the plugin would only work with topics named with the 'Topic
X' convention, where X is an integer greater than -1.
This increases the version number to indicate it is not backward
compatible and sets the minimum Moodle version to that for 3.2.
This improves the code support for the OneTopic course format.
This removes the old code that was supposed to support the OneTopic
format, but never quite did.
This fixes one line of code that got overlooked in the change from
sections containing an array of modules to using a modules object.
The documentation for the sections object has also been updated.
This removes one of the non-Javascript deletion confirmation pages
and corrects calls to redirect() to prevent errors being thrown
on deletion confirmation pages.
This fixes the jshint errors thrown when running Travis-CI builds.
This fixes a bug where checkboxes would not display when using the
Boost theme.
This converts the plug-in from using the YUI library to using AMD
and jQuery, and contains a number of behavioural and other
technical improvements.
There were two typos this branch inherited from moodle-33-master.
I fixed those to prevent them propagating to future branches.
I also updated the roadmap to add two items that I intend to work
on in the near-term. I'm hoping to get to the rest of the roadmap
early next year.
This commit re-implements the deletion confirmation page due to
requests received to re-implement it.

It also adds a configuration page with a setting for
enabling|disabling the block checking whether javascript is
enabled in the user's browser prior to displaying the block itself.
This setting can be locked and customized for each user.
For reasons of it being a complete pain-in-the-ass and really not
necessary.
The "hidden" class was still assigned to the div in which the
block displays.
This corrects the function call of append() to appendChild() when
drawing checkboxes. Current versions of Chrome and Firefox are
fault-tolerant of this, but older versions of Firefox are
demonstrably intolerant and throw JS errors
This corrects most of the pre-check lint warnings in the javascript,
and the phpdoc warnings. This involved a major re-factoring of the
javascript, which has been tested in both Chrome (current version)
and Firefox (v45.9.0). It has also been tested with the following
course formats: weeks, topics, onetopic, flexsections, and topcoll.
This fixes two phpdoc errors reported by Moodle's code pre-check
process.
When no checkboxes are checked, the alert that is supposed to
inform the user they need to check at least one item was instead
simply outputting [object Object]. This has been fixed.
This commit mostly breaks out the changes from Github user 'adpe'
into multiple functions to make it easier to read. Some effort was
put into reducing code duplication, especially when it comes to
writing out select menus and hyperlinks since their logic is almost
identical. Finally, updated styles.css to prevent unordered list
discs ("bullets") from displaying next to the block's elements.
This corrects six style lint errors discovered after submitting
the updated plugin to Moodle Plugins directory.
@markanyx markanyx marked this pull request as draft April 14, 2021 07:06
@markanyx
Copy link
Author

Edited
amd/src/block_massaction.js and its corresponding amd/build/block_massaction.min.js

massaction.zip

@markanyx markanyx marked this pull request as ready for review April 14, 2021 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants