Skip to content

Commit

Permalink
Update #86by49k6p - canvas.js updated to include spectrum.js from amd
Browse files Browse the repository at this point in the history
  • Loading branch information
nihaalshaikh committed Sep 10, 2024
1 parent 44d4737 commit a13a4db
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 30 deletions.
2 changes: 1 addition & 1 deletion amd/build/canvas.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion amd/build/canvas.min.js.map

Large diffs are not rendered by default.

29 changes: 10 additions & 19 deletions amd/src/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
**/
/* global fabric */
/* eslint no-unused-expressions: "off", no-console:off, no-invalid-this:"off",no-script-url:"off", block-scoped-var: "off" */
define(['jquery', 'core/notification'], function($, notification) {
define(['jquery', 'core/notification', 'mod_gcanvas/spectrum'], function ($, notification) {
'use strict';

/**
Expand Down Expand Up @@ -978,27 +978,18 @@ define(['jquery', 'core/notification'], function($, notification) {
* Init
* @param {object} args
*/
initialise: function(args) {
initialise: function (args) {

// Load spectrum javascript form here.
$.getScript(M.cfg.wwwroot + "/mod/gcanvas/javascript/spectrum.js").done(function() {
// Load the args passed from PHP.
setOptions(args);

// Load the args passed from PHP.
setOptions(args);
// Set internal debug console.
setDebug(opts.debugjs);

// Set internal debug console.
setDebug(opts.debugjs);

$.noConflict();
$(document).ready(function() {
debug.log('Canvas Module v1.2');
canvasModule.init();
});
}).fail(function(jqxhr, settings, exception) {
// Display loading issue in console.
debug.log(jqxhr);
debug.log(settings);
debug.log(exception);
$.noConflict();
$(document).ready(function () {
debug.log('Canvas Module v1.2');
canvasModule.init();
});
}
};
Expand Down
Empty file added amd/src/spectrum.js
Empty file.
1 change: 0 additions & 1 deletion javascript/spectrum.js

This file was deleted.

9 changes: 1 addition & 8 deletions thirdpartylibs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
<license>MIT</license>
<licenseversion></licenseversion>
</library>
<library>
<location>javascript/spectrum.js</location>
<name>spectrum.js</name>
<version>1.8.0</version>
<license>MIT</license>
<licenseversion></licenseversion>
</library>
<library>
<location>css/spectrum.css</location>
<name>spectrum.css</name>
Expand All @@ -28,4 +21,4 @@
<license>Graphics licensed under CC-BY</license>
<licenseversion>4.0</licenseversion>
</library>
</libraries>
</libraries>

0 comments on commit a13a4db

Please sign in to comment.