-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
162 changed files
with
81,159 additions
and
12,061 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
/node_modules | ||
/public/uploads/backup | ||
/public/*.js | ||
/public/*.rng | ||
/public/img | ||
/public/uploads/* | ||
/views/*.png | ||
/dist | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Contributing to Neon2 | ||
|
||
## Bugs | ||
|
||
For reporting bugs to Neon2, please follow the process outlined on the | ||
[issues wiki page](https://github.com/DDMAL/Neon2/wiki/Issues). | ||
|
||
## Branches and Naming | ||
|
||
When developing a feature or fixing a bug or doing anything more substantial than fixing a typo, it's best to | ||
create a *feature* or *fix* branch addressing it and create a pull request rather than committing directly to | ||
`develop` or `master`. | ||
|
||
Feature branches introduce new features to Neon2. Fix branches fix something not working. If an issue exists | ||
for the feature or branch, it is recommended to name the branch after the branch type followed by a forward slash | ||
and the issue number. (e.g. if a branch is to introduce a feature described in issue number 20, the branch should | ||
be named `feature/20`.) | ||
If there is no issue number and for some reason it is best not to create one, replace the number with something | ||
descriptive of what the branch is doing. | ||
|
||
## Commits | ||
|
||
Commit titles should be short while more should be elaborated on in the body if necessary. | ||
Referencing an issue in a commit is not necessary, but recommended. | ||
|
||
### Updates to Third-Party Code | ||
|
||
In cases where the Verovio toolkit or another compiled feature **not** managed by yarn is updated, | ||
include a reference to the commit it was compiled from in the commit body. | ||
If the project is hosted on GitHub, the reference should be in the form of | ||
`[user]/[repo]@[commit]` so a link can automatically be created. So a commit from the DDMAL verovio would be | ||
`DDMAL/verovio@[commit]`. | ||
If the project is hosted elsewhere, the short commit SHA-1 and where the repository can be found is enough. | ||
|
||
## Pull Requests | ||
|
||
Before opening a pull request, perform automated tests to ensure nothing has broken and manually test any fixes | ||
or features. The pull request contents should reference the related issue, if any, and include an overview of | ||
what was done. | ||
Requesting a reviewer is not required, but recommended for anything that isn't straightforward. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>JSDoc: Source: Color.js</title> | ||
|
||
<script src="scripts/prettify/prettify.js"> </script> | ||
<script src="scripts/prettify/lang-css.js"> </script> | ||
<!--[if lt IE 9]> | ||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> | ||
<![endif]--> | ||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> | ||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> | ||
</head> | ||
|
||
<body> | ||
|
||
<div id="main"> | ||
|
||
<h1 class="page-title">Source: Color.js</h1> | ||
|
||
|
||
|
||
|
||
|
||
|
||
<section> | ||
<article> | ||
<pre class="prettyprint source linenums"><code>/** @module Color */ | ||
|
||
const $ = require('jquery'); | ||
|
||
/** | ||
* Set a highlight by a different grouping. Either staff, syllable, or neume. | ||
* @param {string} grouping - The grouping name. | ||
*/ | ||
export function setGroupingHighlight (grouping) { | ||
unsetGroupingHighlight(); | ||
if (grouping === 'staff') { | ||
setStaffHighlight(); | ||
return; | ||
} | ||
|
||
let groups = Array.from($('.' + grouping)); | ||
for (var i = 0; i < groups.length; i++) { | ||
let groupColor = ColorPalette[i % ColorPalette.length]; | ||
if (!$(groups[i]).parents('.selected').length && !$(groups[i]).hasClass('selected')) { | ||
groups[i].setAttribute('fill', groupColor); | ||
$(groups[i]).addClass('highlighted'); | ||
} else { | ||
if (!$(groups[i]).hasClass('selected')) { | ||
groups[i].setAttribute('fill', null); | ||
} else { | ||
groups[i].setAttribute('fill', '#d00'); | ||
} | ||
$(groups[i]).removeClass('highlighted'); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Unset highlight for all grouping types | ||
*/ | ||
export function unsetGroupingHighlight () { | ||
unsetStaffHighlight(); | ||
let highlighted = Array.from($('.highlighted').filter((index, elem) => { return !$(elem.parentElement).hasClass('selected'); })); | ||
highlighted.forEach(elem => { | ||
elem.setAttribute('fill', null); | ||
$(elem).removeClass('highlighted'); | ||
}); | ||
} | ||
|
||
/** | ||
* Highlight each staff a different color. | ||
*/ | ||
export function setStaffHighlight () { | ||
let staves = Array.from(document.getElementsByClassName('staff')); | ||
for (var i = 0; i < staves.length; i++) { | ||
let staffColor = ColorPalette[i % ColorPalette.length]; | ||
highlight(staves[i], staffColor); | ||
} | ||
} | ||
|
||
/** | ||
* Remove the highlight from each staff. | ||
*/ | ||
export function unsetStaffHighlight () { | ||
unhighlight('.staff'); | ||
} | ||
|
||
/** | ||
* Highlight a staff a certain color. | ||
* @param {SVGSVGElement} staff - The staff's SVG element. | ||
* @param {string} color - The color to highlight the staff. | ||
*/ | ||
export function highlight (staff, color) { | ||
let children = Array.from($('#' + staff.id).children()); | ||
children.forEach(child => { | ||
if (child.tagName === 'path') { | ||
child.setAttribute('stroke', color); | ||
} else { | ||
child.setAttribute('fill', color); | ||
} | ||
$(child).addClass('highlighted'); | ||
}); | ||
} | ||
|
||
/** | ||
* Remove the highlight from a staff. | ||
* @param {(SVGSVGElement|string)} staff - The staff's SVG element or a JQuery selector. | ||
*/ | ||
export function unhighlight (staff) { | ||
let children = Array.from($(staff).filter(':not(.selected)').children('.highlighted')); | ||
children.forEach(elem => { | ||
if (elem.tagName === 'path') { | ||
elem.setAttribute('stroke', '#000000'); | ||
} else { | ||
elem.removeAttribute('fill'); | ||
} | ||
}); | ||
$(staff).filter(':not(.selected)').children('.highlighted').removeClass('highlighted'); | ||
} | ||
|
||
/** | ||
* Color palette from Figure 2 (Colors optimized for color-blind | ||
* individuals) from | ||
* ["Points of view: Color blindness" by Bang Wong published in Nature Methods volume 8 on 27 May 2011]{@link https://www.nature.com/articles/nmeth.1618?WT.ec_id=NMETH-201106} | ||
* @type {string[]} | ||
*/ | ||
const ColorPalette = [ | ||
// "rgb(0,0,0)", | ||
'rgb(230, 159, 0)', | ||
'rgb(86, 180, 233)', | ||
'rgb(0, 158, 115)', | ||
'rgb(240, 228, 66)', | ||
'rgb(0, 114, 178)', | ||
'rgb(213, 94, 0)', | ||
'rgb(204, 121, 167)' | ||
]; | ||
</code></pre> | ||
</article> | ||
</section> | ||
|
||
|
||
|
||
|
||
</div> | ||
|
||
<nav> | ||
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Color.html">Color</a></li><li><a href="module-Compatibility.html">Compatibility</a></li><li><a href="module-Contents.html">Contents</a></li><li><a href="module-Controls.html">Controls</a></li><li><a href="module-Cursor.html">Cursor</a></li><li><a href="module-Grouping.html">Grouping</a></li><li><a href="module-Notification.html">Notification</a></li><li><a href="module-ResizeStaff.html">ResizeStaff</a></li><li><a href="module-Select.html">Select</a></li><li><a href="module-SelectOptions.html">SelectOptions</a></li><li><a href="module-Text.html">Text</a></li><li><a href="module-Warnings.html">Warnings</a></li><li><a href="module-Zoom.html">Zoom</a></li></ul><h3>Classes</h3><ul><li><a href="DragHandler.html">DragHandler</a></li><li><a href="EditMode.html">EditMode</a></li><li><a href="InfoBox.html">InfoBox</a></li><li><a href="InsertHandler.html">InsertHandler</a></li><li><a href="module-Notification-Notification.html">Notification</a></li><li><a href="module-ResizeStaff-Resize.html">Resize</a></li><li><a href="module-Select.ClickSelect.html">ClickSelect</a></li><li><a href="module-Select.DragSelect.html">DragSelect</a></li><li><a href="module-Zoom.ViewBox.html">ViewBox</a></li><li><a href="module-Zoom-ZoomHandler.html">ZoomHandler</a></li><li><a href="NeonCore.html">NeonCore</a></li><li><a href="NeonView.html">NeonView</a></li><li><a href="SplitHandler.html">SplitHandler</a></li></ul> | ||
</nav> | ||
|
||
<br class="clear"> | ||
|
||
<footer> | ||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Apr 25 2019 17:27:40 GMT-0400 (GMT-04:00) | ||
</footer> | ||
|
||
<script> prettyPrint(); </script> | ||
<script src="scripts/linenumber.js"> </script> | ||
</body> | ||
</html> |
Oops, something went wrong.