abcjs-rails 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/assets/javascripts/abcjs-rails.js +1 -0
- data/app/assets/javascripts/abcjs/api/abc_tunebook.js +158 -0
- data/app/assets/javascripts/abcjs/data/abc_tune.js +686 -0
- data/app/assets/javascripts/abcjs/edit/abc_editor.js +414 -0
- data/app/assets/javascripts/abcjs/midi/abc_midiwriter.js +698 -0
- data/app/assets/javascripts/abcjs/parse/abc_common.js +76 -0
- data/app/assets/javascripts/abcjs/parse/abc_parse.js +1385 -0
- data/app/assets/javascripts/abcjs/parse/abc_parse_directive.js +546 -0
- data/app/assets/javascripts/abcjs/parse/abc_parse_header.js +521 -0
- data/app/assets/javascripts/abcjs/parse/abc_parse_key_voice.js +781 -0
- data/app/assets/javascripts/abcjs/parse/abc_tokenizer.js +751 -0
- data/app/assets/javascripts/abcjs/write/abc_glyphs.js +105 -0
- data/app/assets/javascripts/abcjs/write/abc_graphelements.js +781 -0
- data/app/assets/javascripts/abcjs/write/abc_layout.js +959 -0
- data/app/assets/javascripts/abcjs/write/abc_write.js +487 -0
- data/app/assets/javascripts/abcjs/write/raphael.js +3395 -0
- data/app/assets/javascripts/abcjs/write/sprintf.js +61 -0
- data/lib/abcjs-rails/version.rb +1 -1
- metadata +18 -1
@@ -0,0 +1,61 @@
|
|
1
|
+
/**
|
2
|
+
* sprintf() for JavaScript v.0.4
|
3
|
+
*
|
4
|
+
* Copyright (c) 2007 Alexandru Marasteanu <http://alexei.417.ro/>
|
5
|
+
* Thanks to David Baird (unit test and patch).
|
6
|
+
*
|
7
|
+
* This program is free software; you can redistribute it and/or modify it under
|
8
|
+
* the terms of the GNU General Public License as published by the Free Software
|
9
|
+
* Foundation; either version 2 of the License, or (at your option) any later
|
10
|
+
* version.
|
11
|
+
*
|
12
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
13
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
14
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
15
|
+
* details.
|
16
|
+
*
|
17
|
+
* You should have received a copy of the GNU General Public License along with
|
18
|
+
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
19
|
+
* Place, Suite 330, Boston, MA 02111-1307 USA
|
20
|
+
*/
|
21
|
+
|
22
|
+
//function str_repeat(i, m) { for (var o = []; m > 0; o[--m] = i); return(o.join('')); }
|
23
|
+
|
24
|
+
if (!window.ABCJS)
|
25
|
+
window.ABCJS = {};
|
26
|
+
|
27
|
+
if (!window.ABCJS.write)
|
28
|
+
window.ABCJS.write = {};
|
29
|
+
|
30
|
+
ABCJS.write.sprintf = function() {
|
31
|
+
var i = 0, a, f = arguments[i++], o = [], m, p, c, x;
|
32
|
+
while (f) {
|
33
|
+
if (m = /^[^\x25]+/.exec(f)) o.push(m[0]);
|
34
|
+
else if (m = /^\x25{2}/.exec(f)) o.push('%');
|
35
|
+
else if (m = /^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)) {
|
36
|
+
if (((a = arguments[m[1] || i++]) == null) || (a == undefined)) throw("Too few arguments.");
|
37
|
+
if (/[^s]/.test(m[7]) && (typeof(a) != 'number'))
|
38
|
+
throw("Expecting number but found " + typeof(a));
|
39
|
+
switch (m[7]) {
|
40
|
+
case 'b': a = a.toString(2); break;
|
41
|
+
case 'c': a = String.fromCharCode(a); break;
|
42
|
+
case 'd': a = parseInt(a); break;
|
43
|
+
case 'e': a = m[6] ? a.toExponential(m[6]) : a.toExponential(); break;
|
44
|
+
case 'f': a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a); break;
|
45
|
+
case 'o': a = a.toString(8); break;
|
46
|
+
case 's': a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a); break;
|
47
|
+
case 'u': a = Math.abs(a); break;
|
48
|
+
case 'x': a = a.toString(16); break;
|
49
|
+
case 'X': a = a.toString(16).toUpperCase(); break;
|
50
|
+
}
|
51
|
+
a = (/[def]/.test(m[7]) && m[2] && a > 0 ? '+' + a : a);
|
52
|
+
c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' ';
|
53
|
+
x = m[5] - String(a).length;
|
54
|
+
p = m[5] ? str_repeat(c, x) : '';
|
55
|
+
o.push(m[4] ? a + p : p + a);
|
56
|
+
}
|
57
|
+
else throw ("Huh ?!");
|
58
|
+
f = f.substring(m[0].length);
|
59
|
+
}
|
60
|
+
return o.join('');
|
61
|
+
};
|
data/lib/abcjs-rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abcjs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -36,6 +36,23 @@ extra_rdoc_files: []
|
|
36
36
|
files:
|
37
37
|
- lib/abcjs-rails/version.rb
|
38
38
|
- lib/abcjs-rails.rb
|
39
|
+
- app/assets/javascripts/abcjs/api/abc_tunebook.js
|
40
|
+
- app/assets/javascripts/abcjs/data/abc_tune.js
|
41
|
+
- app/assets/javascripts/abcjs/edit/abc_editor.js
|
42
|
+
- app/assets/javascripts/abcjs/midi/abc_midiwriter.js
|
43
|
+
- app/assets/javascripts/abcjs/parse/abc_common.js
|
44
|
+
- app/assets/javascripts/abcjs/parse/abc_parse.js
|
45
|
+
- app/assets/javascripts/abcjs/parse/abc_parse_directive.js
|
46
|
+
- app/assets/javascripts/abcjs/parse/abc_parse_header.js
|
47
|
+
- app/assets/javascripts/abcjs/parse/abc_parse_key_voice.js
|
48
|
+
- app/assets/javascripts/abcjs/parse/abc_tokenizer.js
|
49
|
+
- app/assets/javascripts/abcjs/write/abc_glyphs.js
|
50
|
+
- app/assets/javascripts/abcjs/write/abc_graphelements.js
|
51
|
+
- app/assets/javascripts/abcjs/write/abc_layout.js
|
52
|
+
- app/assets/javascripts/abcjs/write/abc_write.js
|
53
|
+
- app/assets/javascripts/abcjs/write/raphael.js
|
54
|
+
- app/assets/javascripts/abcjs/write/sprintf.js
|
55
|
+
- app/assets/javascripts/abcjs-rails.js
|
39
56
|
- LICENSE
|
40
57
|
- README.md
|
41
58
|
homepage: http://paulrosen.net
|