Linux aries.aptans.com 4.18.0-348.20.1.lve.1.el8.x86_64 #1 SMP Wed Mar 16 08:45:39 EDT 2022 x86_64
Apache
: 135.181.142.107 | : 172.69.17.27
Cant Read [ /etc/named.conf ]
7.4.33
aja
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
aja /
public_html /
ead.aptans /
course /
amd /
src /
[ HOME SHELL ]
Name
Size
Permission
Action
local
[ DIR ]
drwxr-xr-x
actions.js
27.44
KB
-rw-rw-r--
activitychooser.js
15.3
KB
-rw-r--r--
copy_modal.js
5.99
KB
-rw-r--r--
downloadcontent.js
4.53
KB
-rw-r--r--
events.js
1.06
KB
-rw-rw-r--
manual_completion_toggle.js
4.86
KB
-rw-r--r--
recommendations.js
1.67
KB
-rw-r--r--
repository.js
4.06
KB
-rw-rw-r--
view.js
1.63
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : manual_completion_toggle.js
// This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Provides the functionality for toggling the manual completion state of a course module through * the manual completion button. * * @module core_course/manual_completion_toggle * @copyright 2021 Jun Pataleta <jun@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ import Templates from 'core/templates'; import Notification from 'core/notification'; import {toggleManualCompletion} from 'core_course/repository'; import * as CourseEvents from 'core_course/events'; /** * Selectors in the manual completion template. * * @type {{MANUAL_TOGGLE: string}} */ const SELECTORS = { MANUAL_TOGGLE: 'button[data-action=toggle-manual-completion]', }; /** * Toggle type values for the data-toggletype attribute in the core_course/completion_manual template. * * @type {{TOGGLE_UNDO: string, TOGGLE_MARK_DONE: string}} */ const TOGGLE_TYPES = { TOGGLE_MARK_DONE: 'manual:mark-done', TOGGLE_UNDO: 'manual:undo', }; /** * Whether the event listener has already been registered for this module. * * @type {boolean} */ let registered = false; /** * Registers the click event listener for the manual completion toggle button. */ export const init = () => { if (registered) { return; } document.addEventListener('click', (e) => { const toggleButton = e.target.closest(SELECTORS.MANUAL_TOGGLE); if (toggleButton) { e.preventDefault(); toggleManualCompletionState(toggleButton).catch(Notification.exception); } }); registered = true; }; /** * Toggles the manual completion state of the module for the given user. * * @param {HTMLElement} toggleButton * @returns {Promise<void>} */ const toggleManualCompletionState = async(toggleButton) => { // Make a copy of the original content of the button. const originalInnerHtml = toggleButton.innerHTML; // Disable the button to prevent double clicks. toggleButton.setAttribute('disabled', 'disabled'); // Get button data. const toggleType = toggleButton.getAttribute('data-toggletype'); const cmid = toggleButton.getAttribute('data-cmid'); const activityname = toggleButton.getAttribute('data-activityname'); // Get the target completion state. const completed = toggleType === TOGGLE_TYPES.TOGGLE_MARK_DONE; // Replace the button contents with the loading icon. const loadingHtml = await Templates.render('core/loading', {}); await Templates.replaceNodeContents(toggleButton, loadingHtml, ''); try { // Call the webservice to update the manual completion status. await toggleManualCompletion(cmid, completed); // All good so far. Refresh the manual completion button to reflect its new state by re-rendering the template. const templateContext = { cmid: cmid, activityname: activityname, overallcomplete: completed, overallincomplete: !completed, istrackeduser: true, // We know that we're tracking completion for this user given the presence of this button. }; const renderObject = await Templates.renderForPromise('core_course/completion_manual', templateContext); // Replace the toggle button with the newly loaded template. const replacedNode = await Templates.replaceNode(toggleButton, renderObject.html, renderObject.js); const newToggleButton = replacedNode.pop(); // Build manualCompletionToggled custom event. const withAvailability = toggleButton.getAttribute('data-withavailability'); const toggledEvent = new CustomEvent(CourseEvents.manualCompletionToggled, { bubbles: true, detail: { cmid, activityname, completed, withAvailability, } }); // Dispatch the manualCompletionToggled custom event. newToggleButton.dispatchEvent(toggledEvent); } catch (exception) { // In case of an error, revert the original state and appearance of the button. toggleButton.removeAttribute('disabled'); toggleButton.innerHTML = originalInnerHtml; // Show the exception. Notification.exception(exception); } };
Close