-
Notifications
You must be signed in to change notification settings - Fork 37
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
markanyx
wants to merge
51
commits into
hqhoang:master
Choose a base branch
from
at-tools:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Edited |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also backward compatible for versions before 3.9