File tree 6 files changed +73
-39
lines changed
taglib/au/org/ala/biocollect
6 files changed +73
-39
lines changed Original file line number Diff line number Diff line change @@ -388,6 +388,7 @@ modules = {
388
388
audio {
389
389
dependsOn " modernizr"
390
390
resource url : ' js/audio.js'
391
+ resource url : ' css/audio-control.css'
391
392
resource url : ' vendor/recorderjs/recorder.js'
392
393
// resource url: 'vendor/libmp3lame/libmp3lame.min.js'
393
394
}
Original file line number Diff line number Diff line change @@ -559,6 +559,8 @@ class ModelJSTagLib {
559
559
}})(data['${ col.name} ']);
560
560
"""
561
561
break ;
562
+ case ' audio' :
563
+ out << INDENT * 3 << " this.${ col.name} = new AudioViewModel({downloadUrl: '${ grailsApplication.config.grails.serverURL} /download/file?filename='}, data['${ col.name} '])\n " ;
562
564
563
565
}
564
566
modelConstraints(col, out)
@@ -916,7 +918,7 @@ class ModelJSTagLib {
916
918
}
917
919
918
920
def audioModel (model , out ) {
919
- out << INDENT * 4 << " self.data.${ model.name} = new AudioViewModel();\n "
921
+ out << INDENT * 4 << " self.data.${ model.name} = new AudioViewModel({downloadUrl: ' ${ grailsApplication.config.grails.serverURL } /download/file?filename='} );\n "
920
922
populateAudioList(model, out)
921
923
}
922
924
Original file line number Diff line number Diff line change 9
9
</audio >
10
10
11
11
<div >
12
- <a href =" " data-bind =" attr: {href: transients.downloadUrl()}" ><i class =" fa fa-download" >  ; </i >Download</a >
12
+ <a href =" " data-bind =" attr: {href: transients.downloadUrl()}" class = " download " ><i class =" fa fa-download" >  ; </i >Download</a >
13
13
</div >
14
14
</div >
15
15
30
30
</label >
31
31
32
32
<div class =" controls" >
33
- <input id =" attribution" class =" input-xxlarge " type =" text" data-bind =" value: attribution" >
33
+ <input id =" attribution" class =" input-xlarge " type =" text" data-bind =" value: attribution" >
34
34
</div >
35
35
</div >
36
36
37
37
<div class =" control-group" >
38
38
<label class =" control-label" for =" notes" >Notes:</label >
39
39
40
40
<div class =" controls" >
41
- <input id =" notes" class =" input-xxlarge" type =" text" data-bind =" value: notes" >
41
+ <textarea rows =" 4" class =" input-xlarge" id =" notes" data-bind =" value: notes" ></textarea >
42
+ %{--<input id =" notes" class =" input-xxlarge" type =" text" data-bind =" value: notes" >--}%
42
43
</div >
43
44
</div >
44
45
71
72
</div >
72
73
</div >
73
74
74
- <div id =" recordingControls" data-bind =" visible: ${ name } .transients.html5AudioSupport()" class =" inline-block" >
75
+ <div id =" recordingControls" data-bind =" visible: ${ name } .transients.html5AudioSupport()" class =" inline-block" style = " display : none " >
75
76
<span data-bind =" click: ${ name } .startRecording, visible: !${ name } .transients.recording()" class =" btn" ><span
76
77
class =" fa fa-circle red" >  ; </span >Start recording</span >
77
78
<span data-bind =" click: ${ name } .stopRecording, visible: ${ name } .transients.recording()" class =" btn" ><span
Original file line number Diff line number Diff line change
1
+ .audio-thumbnail {
2
+ border : 1px solid white;
3
+ min-width : 350px ;
4
+ max-width : 350px ;
5
+ width : 350px ;
6
+ display : inline-block;
7
+ margin-right : 10px ;
8
+ margin-bottom : 10px ;
9
+ border-radius : 5px ;
10
+ vertical-align : top;
11
+ }
12
+
13
+ .audio-thumbnail audio {
14
+ padding-left : 25px ;
15
+ }
16
+
17
+ .audio-thumbnail .download {
18
+ float : right;
19
+ }
20
+
21
+ .output-label {
22
+ float : left;
23
+ width : 100px ;
24
+ text-align : right;
25
+ font-weight : bold;
26
+ padding-right : 10px ;
27
+ }
28
+
29
+ table .audio-input-panel .span3 , table .audio-input-panel .span2 , table .audio-input-panel .span7 {
30
+ width : 100% ;
31
+ }
32
+
33
+ table .audio-input-panel .btn {
34
+ float : right;
35
+ margin-right : 20px ;
36
+ }
37
+
38
+ table audio {
39
+ margin-left : 20px ;
40
+ }
41
+
42
+ table .download {
43
+ margin-left : 20px ;
44
+ margin-bottom : 20px ;
45
+ display : block;
46
+ }
47
+
48
+ .audio-input-panel .control-label {
49
+ width : 85px !important ;
50
+ }
51
+
52
+ .audio-input-panel .controls {
53
+ margin-left : 100px !important ;
54
+ }
Original file line number Diff line number Diff line change @@ -361,36 +361,3 @@ th .popover {
361
361
padding-top : 10px ;
362
362
padding-bottom : 5px ;
363
363
}
364
-
365
- audio ::before {
366
- content : '\f08e' ;
367
- font-family : FontAwesome;
368
- }
369
-
370
- .audio-thumbnail {
371
- border : 1px solid white;
372
- min-width : 350px ;
373
- max-width : 350px ;
374
- width : 350px ;
375
- display : inline-block;
376
- margin-right : 10px ;
377
- margin-bottom : 10px ;
378
- border-radius : 5px ;
379
- vertical-align : top;
380
- }
381
-
382
- .audio-thumbnail audio {
383
- padding-left : 25px ;
384
- }
385
-
386
- .audio-thumbnail .download {
387
- float : right;
388
- }
389
-
390
- .output-label {
391
- float : left;
392
- width : 100px ;
393
- text-align : right;
394
- font-weight : bold;
395
- padding-right : 10px ;
396
- }
Original file line number Diff line number Diff line change 1
- function AudioViewModel ( ) {
1
+ function AudioViewModel ( config , files ) {
2
2
var self = this ;
3
3
4
4
var recorder = null ;
@@ -7,6 +7,15 @@ function AudioViewModel() {
7
7
self . transients . recording = ko . observable ( false ) ;
8
8
self . files = ko . observableArray ( ) ;
9
9
10
+ if ( ! _ . isUndefined ( files ) && ! _ . isEmpty ( files ) ) {
11
+ files . forEach ( function ( file ) {
12
+ if ( _ . isUndefined ( file . url ) ) {
13
+ file . url = config . downloadUrl + file . filename ;
14
+ }
15
+ self . files . push ( new AudioItem ( file ) ) ;
16
+ } ) ;
17
+ }
18
+
10
19
self . transients . html5AudioSupport = ko . pureComputed ( function ( ) {
11
20
var supported = false ;
12
21
if ( Modernizr . getusermedia ) {
You can’t perform that action at this time.
0 commit comments