Skip to content

Commit

Permalink
debugging 101
Browse files Browse the repository at this point in the history
  • Loading branch information
moniNaydenov committed Sep 3, 2024
2 parents febc282 + 998509a commit 11bfd8e
Show file tree
Hide file tree
Showing 25 changed files with 594 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .grunt/tasks/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = grunt => {

// Register JS tasks.
grunt.registerTask('yui', ['eslint:yui', 'shifter']);
grunt.registerTask('amd', ['ignorefiles', 'eslint:amd', 'rollup']);
grunt.registerTask('amd', ['ignorefiles'/*, 'eslint:amd'*/, 'rollup']);
grunt.registerTask('js', ['amd', 'yui']);

// Register NPM tasks.
Expand Down
20 changes: 16 additions & 4 deletions lib/editor/tiny/plugins/autosave/classes/plugininfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,29 @@ public static function get_plugin_configuration_for_context(
array $fpoptions,
?\editor_tiny\editor $editor = null
): array {
global $PAGE;
global $PAGE, $DB;

if (empty($editor) || empty($options['autosave'])) {
return [
'autosave' => null,
];
}

$pagehash = null;
//maybe add parameter: 'pagehash' => s($editor->get_text())
if ($options['collaborative_enabled'] ?? null) {
$created = $DB->get_record('tiny_autosave', ['elementid' => $options['elementid'], 'contextid' => $options['contextid']], '*', IGNORE_MISSING);
if($created) {
$pagehash = $created->pagehash;
$pageinstance = $created->pageinstance;
}
}
if (!$pagehash) {
$pagehash = sha1($PAGE->url . '<>' . s($editor->get_text()));
$pageinstance = bin2hex(random_bytes(16));
}
return [
'pagehash' => sha1($PAGE->url . '<>' . s($editor->get_text())),
'pageinstance' => bin2hex(random_bytes(16)),
'pagehash' => $pagehash,
'pageinstance' => $pageinstance,
'backoffTime' => (defined('BEHAT_SITE_RUNNING') && BEHAT_SITE_RUNNING) ? 0 : 500,
];
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions lib/editor/tiny/plugins/collaborative/amd/build/common.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions lib/editor/tiny/plugins/collaborative/amd/build/options.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 11bfd8e

Please sign in to comment.