diff ape.js @ 2028:c7848cef5a56

Feature #1232: <commentBoxPrefix> node now in <interface> of audioHolder. If not specified, default is 'Comment on track'
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Thu, 04 Jun 2015 10:06:42 +0100
parents 04c2ec6496ef
children 907abe027ebc
line wrap: on
line diff
--- a/ape.js	Thu Jun 04 09:45:32 2015 +0100
+++ b/ape.js	Thu Jun 04 10:06:42 2015 +0100
@@ -307,6 +307,13 @@
 		scaleDOM.style.left = Math.floor((pixelPosition-($(scaleDOM).width()/2)))+'px';
 		scaleDOM.setAttributeNode(value);
 	});
+	
+	var commentBoxPrefix = interfaceObj.find('commentBoxPrefix');
+	if (commentBoxPrefix.length != 0) {
+		commentBoxPrefix = commentBoxPrefix[0].textContent;
+	} else {
+		commentBoxPrefix = "Comment on track";
+	}
 
 	// Extract the hostURL attribute. If not set, create an empty string.
 	var hostURL = textXML.attributes['hostURL'];
@@ -413,7 +420,7 @@
 			trackComment.id = 'comment-div-'+index;
 			// Create a string next to each comment asking for a comment
 			var trackString = document.createElement('span');
-			trackString.innerHTML = 'Comment on track '+index;
+			trackString.innerHTML = commentBoxPrefix+' '+index;
 			// Create the HTML5 comment box 'textarea'
 			var trackCommentBox = document.createElement('textarea');
 			trackCommentBox.rows = '4';