This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
forked from CIDI/kennethware-2.0
-
Notifications
You must be signed in to change notification settings - Fork 1
/
canvasGlobal.js
executable file
·68 lines (58 loc) · 2.63 KB
/
canvasGlobal.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*jslint browser: true, sloppy: false, eqeq: false, vars: false, maxerr: 50, indent: 4, plusplus: true */
/*global $, jQuery, alert, console, tinyMCE */
// These tools were designed to facilitate rapid course development in the Canvas LMS
// Copyright (C) 2014 Kenneth Larsen - Center for Innovative Design and Instruction
// Utah State University
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
// This program 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 Affero General Public License for more details.
// http://www.gnu.org/licenses/agpl-3.0.html
////////////////////////////////////////////////////
// KENNETHWARE CONFIG //
////////////////////////////////////////////////////
// Development version will be loaded in the following courses
var iframeID,
// Path to where the canvasCustomTools folder is located
klToolsPath = 'https://<path to tools>/',
// Path to the tools_variables file
klToolsVariablesFile = klToolsPath + 'js/tools_variables.js',
// Path to additional_customization file
klToolsAdditionalCustomizationFile = klToolsPath + 'js/additional_customization.js',
klFontAwesomePath = '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css',
coursenum;
function klGetCourseNum() {
'use strict';
var matches, killspot;
// Parse Course Number - It is stored in the variable "coursenum"
coursenum = null;
matches = location.pathname.match(/\/courses\/(.*)/);
if (matches) {
coursenum = matches[1];
killspot = coursenum.indexOf("/", 0);
if (killspot >= 0) {
coursenum = coursenum.slice(0, killspot);
}
}
}
klGetCourseNum();
// Pull in custom variables
$.getScript(klToolsVariablesFile, function () {
'use strict';
console.log("tools_variables.js loaded");
// Additional Customization
$.getScript(klToolsAdditionalCustomizationFile, function () {
console.log("additional_customization.js loaded");
// Run code to initialize tools
$.getScript(klToolsPath + "js/master_controls.js", function () {
console.log("master_controls.js loaded");
});
});
});
////////////////////////////////////////////////////
// END KENNETHWARE CONFIG //
////////////////////////////////////////////////////