Skip to content

Commit c227350

Browse files
authored
Neon.js v3.0.0 release
2 parents 55a8bdd + 91bb22c commit c227350

File tree

162 files changed

+81159
-12061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+81159
-12061
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
/node_modules
2-
/public/uploads/backup
32
/public/*.js
3+
/public/*.rng
4+
/public/img
5+
/public/uploads/*
6+
/views/*.png
7+
/dist
48
.DS_Store

CONTRIBUTING.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Contributing to Neon2
2+
3+
## Bugs
4+
5+
For reporting bugs to Neon2, please follow the process outlined on the
6+
[issues wiki page](https://github.com/DDMAL/Neon2/wiki/Issues).
7+
8+
## Branches and Naming
9+
10+
When developing a feature or fixing a bug or doing anything more substantial than fixing a typo, it's best to
11+
create a *feature* or *fix* branch addressing it and create a pull request rather than committing directly to
12+
`develop` or `master`.
13+
14+
Feature branches introduce new features to Neon2. Fix branches fix something not working. If an issue exists
15+
for the feature or branch, it is recommended to name the branch after the branch type followed by a forward slash
16+
and the issue number. (e.g. if a branch is to introduce a feature described in issue number 20, the branch should
17+
be named `feature/20`.)
18+
If there is no issue number and for some reason it is best not to create one, replace the number with something
19+
descriptive of what the branch is doing.
20+
21+
## Commits
22+
23+
Commit titles should be short while more should be elaborated on in the body if necessary.
24+
Referencing an issue in a commit is not necessary, but recommended.
25+
26+
### Updates to Third-Party Code
27+
28+
In cases where the Verovio toolkit or another compiled feature **not** managed by yarn is updated,
29+
include a reference to the commit it was compiled from in the commit body.
30+
If the project is hosted on GitHub, the reference should be in the form of
31+
`[user]/[repo]@[commit]` so a link can automatically be created. So a commit from the DDMAL verovio would be
32+
`DDMAL/verovio@[commit]`.
33+
If the project is hosted elsewhere, the short commit SHA-1 and where the repository can be found is enough.
34+
35+
## Pull Requests
36+
37+
Before opening a pull request, perform automated tests to ensure nothing has broken and manually test any fixes
38+
or features. The pull request contents should reference the related issue, if any, and include an overview of
39+
what was done.
40+
Requesting a reviewer is not required, but recommended for anything that isn't straightforward.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Distributed Digital Music Archives and Libraries Lab
3+
Copyright (c) 2018, 2019 Juliette Regimbal, Zoé McLennan, Andrew Tran
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
Neon2
1+
Neon3
22
=====
33
[![Build_Status](https://travis-ci.org/DDMAL/Neon2.svg?branch=master)](https://travis-ci.org/DDMAL/Neon2)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5+
[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)
56

67
**N**eume **E**ditor **ON**line.
78

89

9-
Neon2 is a browser-based music notation editor written in JavaScript using the Verovio music engraving library. The editor can be used to manipulate digitally encoded early musical scores in square-note notation.
10+
Neon3 is a browser-based music notation editor written in JavaScript using the Verovio music engraving library. The editor can be used to manipulate digitally encoded early musical scores in square-note notation.
1011

1112

12-
Neon2 is a re-write of [Neon.JS](https://github.com/DDMAL/Neon.js) using a modified version of [Verovio](https://github.com/DDMAL/verovio) to render MEI-Neume files according to the MEI 4.0 specifications.
13+
Neon2 is a re-write of [Neon.JS](https://github.com/DDMAL/Neon.js) using a modified version of [Verovio](https://github.com/DDMAL/verovio) to render MEI-Neume files according to the MEI 4.0 specifications.
1314

1415
Requirements
1516
------------
16-
* [yarn](https://yarnpkg.com/en/docs/install):
17+
* [yarn](https://yarnpkg.com/en/docs/install):
1718
* `brew install yarn` on Mac
1819

1920
Setup
@@ -36,6 +37,12 @@ yarn start
3637

3738
4. Access the page at: <http://localhost:8080>.
3839

40+
41+
Instructions
42+
-----------
43+
44+
Neon.js has two main modes: viewer and editor. To learn how to use both, [read the instructions on our wiki.](https://github.com/DDMAL/Neon2/wiki/Instructions)
45+
3946
Test
4047
----
4148

@@ -48,3 +55,8 @@ brew install geckodriver
4855
Then you can run the tests locally using `yarn test`. We use [jest](https://facebook.github.io/jest/) to script our tests.
4956

5057
*These tests require the server to be running on `localhost:8080`*
58+
59+
Verovio
60+
-------
61+
62+
Verovio is present as an npm package under `src/verovio-dev` with the name `verovio-dev`. Its contents come from the `emscripten/npm-dev` folder in a Verovio project folder.

doc/Color.js.html

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>JSDoc: Source: Color.js</title>
6+
7+
<script src="scripts/prettify/prettify.js"> </script>
8+
<script src="scripts/prettify/lang-css.js"> </script>
9+
<!--[if lt IE 9]>
10+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11+
<![endif]-->
12+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14+
</head>
15+
16+
<body>
17+
18+
<div id="main">
19+
20+
<h1 class="page-title">Source: Color.js</h1>
21+
22+
23+
24+
25+
26+
27+
<section>
28+
<article>
29+
<pre class="prettyprint source linenums"><code>/** @module Color */
30+
31+
const $ = require('jquery');
32+
33+
/**
34+
* Set a highlight by a different grouping. Either staff, syllable, or neume.
35+
* @param {string} grouping - The grouping name.
36+
*/
37+
export function setGroupingHighlight (grouping) {
38+
unsetGroupingHighlight();
39+
if (grouping === 'staff') {
40+
setStaffHighlight();
41+
return;
42+
}
43+
44+
let groups = Array.from($('.' + grouping));
45+
for (var i = 0; i &lt; groups.length; i++) {
46+
let groupColor = ColorPalette[i % ColorPalette.length];
47+
if (!$(groups[i]).parents('.selected').length &amp;&amp; !$(groups[i]).hasClass('selected')) {
48+
groups[i].setAttribute('fill', groupColor);
49+
$(groups[i]).addClass('highlighted');
50+
} else {
51+
if (!$(groups[i]).hasClass('selected')) {
52+
groups[i].setAttribute('fill', null);
53+
} else {
54+
groups[i].setAttribute('fill', '#d00');
55+
}
56+
$(groups[i]).removeClass('highlighted');
57+
}
58+
}
59+
}
60+
61+
/**
62+
* Unset highlight for all grouping types
63+
*/
64+
export function unsetGroupingHighlight () {
65+
unsetStaffHighlight();
66+
let highlighted = Array.from($('.highlighted').filter((index, elem) => { return !$(elem.parentElement).hasClass('selected'); }));
67+
highlighted.forEach(elem => {
68+
elem.setAttribute('fill', null);
69+
$(elem).removeClass('highlighted');
70+
});
71+
}
72+
73+
/**
74+
* Highlight each staff a different color.
75+
*/
76+
export function setStaffHighlight () {
77+
let staves = Array.from(document.getElementsByClassName('staff'));
78+
for (var i = 0; i &lt; staves.length; i++) {
79+
let staffColor = ColorPalette[i % ColorPalette.length];
80+
highlight(staves[i], staffColor);
81+
}
82+
}
83+
84+
/**
85+
* Remove the highlight from each staff.
86+
*/
87+
export function unsetStaffHighlight () {
88+
unhighlight('.staff');
89+
}
90+
91+
/**
92+
* Highlight a staff a certain color.
93+
* @param {SVGSVGElement} staff - The staff's SVG element.
94+
* @param {string} color - The color to highlight the staff.
95+
*/
96+
export function highlight (staff, color) {
97+
let children = Array.from($('#' + staff.id).children());
98+
children.forEach(child => {
99+
if (child.tagName === 'path') {
100+
child.setAttribute('stroke', color);
101+
} else {
102+
child.setAttribute('fill', color);
103+
}
104+
$(child).addClass('highlighted');
105+
});
106+
}
107+
108+
/**
109+
* Remove the highlight from a staff.
110+
* @param {(SVGSVGElement|string)} staff - The staff's SVG element or a JQuery selector.
111+
*/
112+
export function unhighlight (staff) {
113+
let children = Array.from($(staff).filter(':not(.selected)').children('.highlighted'));
114+
children.forEach(elem => {
115+
if (elem.tagName === 'path') {
116+
elem.setAttribute('stroke', '#000000');
117+
} else {
118+
elem.removeAttribute('fill');
119+
}
120+
});
121+
$(staff).filter(':not(.selected)').children('.highlighted').removeClass('highlighted');
122+
}
123+
124+
/**
125+
* Color palette from Figure 2 (Colors optimized for color-blind
126+
* individuals) from
127+
* ["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}
128+
* @type {string[]}
129+
*/
130+
const ColorPalette = [
131+
// "rgb(0,0,0)",
132+
'rgb(230, 159, 0)',
133+
'rgb(86, 180, 233)',
134+
'rgb(0, 158, 115)',
135+
'rgb(240, 228, 66)',
136+
'rgb(0, 114, 178)',
137+
'rgb(213, 94, 0)',
138+
'rgb(204, 121, 167)'
139+
];
140+
</code></pre>
141+
</article>
142+
</section>
143+
144+
145+
146+
147+
</div>
148+
149+
<nav>
150+
<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>
151+
</nav>
152+
153+
<br class="clear">
154+
155+
<footer>
156+
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)
157+
</footer>
158+
159+
<script> prettyPrint(); </script>
160+
<script src="scripts/linenumber.js"> </script>
161+
</body>
162+
</html>

0 commit comments

Comments
 (0)