Skip to content

Commit

Permalink
0.9.8 release
Browse files Browse the repository at this point in the history
  • Loading branch information
djplaner committed Oct 23, 2022
1 parent a297da1 commit 788fa5d
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 30 deletions.
2 changes: 1 addition & 1 deletion dev/canvas-collections.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ class cc_View {



const CC_VERSION = "0.9.7";
const CC_VERSION = "0.9.8";

const CV_DEFAULT_DATE_LABEL = "Starting";

Expand Down
6 changes: 3 additions & 3 deletions docs/latest-version.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Latest Version **0.9.7**
# Latest Version **0.9.8**

Canvas Collections remains very much under active development. New versions with new features (and bug fixes) are released weekly. It is recommended to always have [the latest version installed](./getting-started/install/types-pre-requisites.md).

## Current Status

version **0.9.7** of Canvas Collections
version **0.9.8** of Canvas Collections

- Should work on all Canvas instances, but intended largely for use at Griffith University

Expand All @@ -16,7 +16,7 @@ version **0.9.7** of Canvas Collections

## Release Notes

See [the 0.9.7 release notes](https://github.com/djplaner/canvas-collections/releases/tag/v0.9.7) for more information on the latest version.
See [the 0.9.8 release notes](https://github.com/djplaner/canvas-collections/releases/tag/v0.9.8) for more information on the latest version.

## Which version are you using?

Expand Down
Binary file modified docs/pics/version.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "canvas-collections",
"version": "0.9.7",
"version": "0.9.8",
"description": "Modify Canvas LMS modules to support collections of modules and their representation",
"main": "dist/index.js",
"type": "module",
Expand Down
54 changes: 35 additions & 19 deletions release/canvas-collections.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name canvas-collections
// @namespace https://djon.es/
// @version 0.9.7
// @version 0.9.8
// @description Modify Canvas LMS modules to support collections of modules and their representation
// @author David Jones
// @match https://*/courses/*
Expand Down Expand Up @@ -945,7 +945,7 @@ class cc_View {



const CC_VERSION = "0.9.7";
const CC_VERSION = "0.9.8";

const CV_DEFAULT_DATE_LABEL = "Starting";

Expand Down Expand Up @@ -5070,6 +5070,14 @@ class CollectionsModel {
}
}

getCourseId() {
return this.controller.parentController.courseId;
}

getModulesUrl() {
return `/courses/${this.getCourseId()}/modules`;
}

getEditMode() {
return this.controller.parentController.editMode;
}
Expand Down Expand Up @@ -6995,7 +7003,8 @@ class GriffithCardsView extends cc_View {

let cardClass = "cc-card";
let cardContentClass = "cc-card-content";
let CARD_LINK = `<a href="#module_${module.id}" class="cc-card-link"></a>`;
const modulesUrl = this.model.getModulesUrl();
let CARD_LINK = `<a href="${modulesUrl}#module_${module.id}" class="cc-card-link"></a>`;
if (module.hasOwnProperty('fyi') && module.fyi) {
cardClass = 'cc-card-unclickable';
cardContentClass = "cc-unclickable-card-content";
Expand Down Expand Up @@ -7541,11 +7550,12 @@ class GriffithCardsView extends cc_View {
return '';
}
const engage = this.generateCardEngage(module);
const modulesUrl = this.model.getModulesUrl();
let LINK_ITEM = `
<!-- <p>&nbsp;<br /> &nbsp;</p> -->
<div class="cc-card-engage">
<div class="cc-card-engage-button">
<a href="#module_${module.id}" class="gu-engage">
<a href="${modulesUrl}#module_${module.id}" class="gu-engage">
${engage}
</a>
</div>
Expand Down Expand Up @@ -7682,34 +7692,39 @@ class GriffithCardsView extends cc_View {

//---------------
// update all the a.cc-card-link and a.gu-engage and add a href
let currentUrl = window.location.href;
// let currentUrl = window.location.href;
// the current url should be the modules page, remove the # and anything after it
currentUrl = currentUrl.split('#')[0];
/* currentUrl = currentUrl.split('#')[0];
// if no "modules" at end of url, add it
if (currentUrl.indexOf('modules') === -1) {
currentUrl += '/modules';
}
} */

const modulesUrl = this.model.getModulesUrl();
let cardLinks = [];
let links = div.querySelectorAll('a.cc-card-link');
for (let i = 0; i < links.length; i++) {
let link = links[i];
link.href = currentUrl + link.getAttribute('href');
//link.href = modulesUrl + link.getAttribute('href');
link.href = link.getAttribute('href');
cardLinks[i] = link;
}

// declare array cardLinks
let cardLinks = [];
links = div.querySelectorAll('a.gu-engage');
/* links = div.querySelectorAll('a.gu-engage');
for (let i = 0; i < links.length; i++) {
let link = links[i];
link.href = currentUrl + link.getAttribute('href');
// save the link for later use
cardLinks[i] = link.href;
}
} */
// add a link around the img.cc-card-image
let images = div.querySelectorAll('img.cc-card-image');
for (let i = 0; i < images.length; i++) {
let image = images[i];
let module = undefined;
if (image.dataset.hasOwnProperty('moduleid')) {
//let images = div.querySelectorAll('img.cc-card-image');
let cardBanners = div.querySelectorAll('div.cc-card-banner-container');
for (let i = 0; i < cardBanners.length; i++) {
let banner = cardBanners[i];
let module = 0;
const image = banner.querySelector('img.cc-card-image');
if (image && image.dataset.hasOwnProperty('moduleid')) {
const moduleid = image.dataset.moduleid;
if (modules.hasOwnProperty(moduleid)) {
module = modules[parseInt(moduleid)];
Expand All @@ -7722,7 +7737,7 @@ class GriffithCardsView extends cc_View {

let link = doc.createElement('a');
link.classList.add('cc-card-link-image');
link.href = currentUrl;
link.href = `${modulesUrl}#modules_${module.id}`;
link.innerHTML = image.outerHTML;
image.parentNode.replaceChild(link, image);
}
Expand All @@ -7748,7 +7763,8 @@ class GriffithCardsView extends cc_View {
// set link class to cc-card-link-title
link.classList.add('cc-card-link-title');
//link.href = currentUrl;
link.href = cardLinks[i];
//link.href = cardLinks[i];
link.href = `${modulesUrl}#modules_${moduleid}`;
link.innerHTML = title.innerHTML;
title.innerHTML = link.outerHTML;
}
Expand Down
8 changes: 4 additions & 4 deletions site/latest-version/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<div data-md-component="skip">


<a href="#latest-version-097" class="md-skip">
<a href="#latest-version-098" class="md-skip">
Skip to content
</a>

Expand Down Expand Up @@ -1392,10 +1392,10 @@
</a>


<h1 id="latest-version-097">Latest Version <strong>0.9.7</strong></h1>
<h1 id="latest-version-098">Latest Version <strong>0.9.8</strong></h1>
<p>Canvas Collections remains very much under active development. New versions with new features (and bug fixes) are released weekly. It is recommended to always have <a href="../getting-started/install/types-pre-requisites/">the latest version installed</a>.</p>
<h2 id="current-status">Current Status</h2>
<p>version <strong>0.9.7</strong> of Canvas Collections</p>
<p>version <strong>0.9.8</strong> of Canvas Collections</p>
<ul>
<li>
<p>Should work on all Canvas instances, but intended largely for use at Griffith University</p>
Expand All @@ -1407,7 +1407,7 @@ <h2 id="current-status">Current Status</h2>
</li>
</ul>
<h2 id="release-notes">Release Notes</h2>
<p>See <a href="https://github.com/djplaner/canvas-collections/releases/tag/v0.9.7">the 0.9.7 release notes</a> for more information on the latest version.</p>
<p>See <a href="https://github.com/djplaner/canvas-collections/releases/tag/v0.9.8">the 0.9.8 release notes</a> for more information on the latest version.</p>
<h2 id="which-version-are-you-using">Which version are you using?</h2>
<p>As shown in the following image, teacher/designer roles can see the version details (circled in red) in the Collections box at the top of the modules page.</p>
<p><img alt="" src="../pics/version.png" /> </p>
Expand Down
Binary file modified site/pics/version.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion site/search/search_index.json

Large diffs are not rendered by default.

Binary file modified site/sitemap.xml.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Configuration/cc_ConfigurationView.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import { cc_View } from '../cc_View.js';

const CC_VERSION = "0.9.7";
const CC_VERSION = "0.9.8";

const CV_DEFAULT_DATE_LABEL = "Starting";

Expand Down

0 comments on commit 788fa5d

Please sign in to comment.