comparison core.js @ 2176:76b11b865550

Outside Reference HTML now in core interfaceContext.
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Tue, 22 Mar 2016 11:52:12 +0000
parents d90cbba6299b
children aebb9754d491
comparison
equal deleted inserted replaced
2175:d90cbba6299b 2176:76b11b865550
2839 2839
2840 this.deleteCommentQuestions = function() 2840 this.deleteCommentQuestions = function()
2841 { 2841 {
2842 this.commentQuestions = []; 2842 this.commentQuestions = [];
2843 }; 2843 };
2844
2845 this.outsideReferenceDOM = function(audioObject,index,inject)
2846 {
2847 this.parent = audioObject;
2848 this.outsideReferenceHolder = document.createElement('button');
2849 this.outsideReferenceHolder.id = 'outside-reference';
2850 this.outsideReferenceHolder.className = 'outside-reference';
2851 this.outsideReferenceHolder.setAttribute('track-id',index);
2852 this.outsideReferenceHolder.textContent = "Play Reference";
2853 this.outsideReferenceHolder.disabled = true;
2854
2855 this.outsideReferenceHolder.onclick = function(event)
2856 {
2857 audioEngineContext.play(event.currentTarget.getAttribute('track-id'));
2858 };
2859 inject.appendChild(this.outsideReferenceHolder);
2860 this.enable = function()
2861 {
2862 if (this.parent.state == 1)
2863 {
2864 this.outsideReferenceHolder.disabled = false;
2865 }
2866 };
2867 this.updateLoading = function(progress)
2868 {
2869 if (progress != 100)
2870 {
2871 progress = String(progress);
2872 progress = progress.split('.')[0];
2873 this.outsideReferenceHolder.textContent = progress+'%';
2874 } else {
2875 this.outsideReferenceHolder.textContent = "Play Reference";
2876 }
2877 };
2878 this.startPlayback = function()
2879 {
2880 // Called when playback has begun
2881 $('.track-slider').removeClass('track-slider-playing');
2882 $('.comment-div').removeClass('comment-box-playing');
2883 this.outsideReferenceHolder.style.backgroundColor = "#FDD";
2884 };
2885 this.stopPlayback = function()
2886 {
2887 // Called when playback has stopped. This gets called even if playback never started!
2888 this.outsideReferenceHolder.style.backgroundColor = "";
2889 };
2890 this.exportXMLDOM = function(audioObject)
2891 {
2892 return null;
2893 };
2894 this.getValue = function()
2895 {
2896 return 0;
2897 };
2898 this.getPresentedId = function()
2899 {
2900 return 'Reference';
2901 };
2902 this.canMove = function()
2903 {
2904 return false;
2905 };
2906 this.error = function() {
2907 // audioObject has an error!!
2908 this.outsideReferenceHolder.textContent = "Error";
2909 this.outsideReferenceHolder.style.backgroundColor = "#F00";
2910 }
2911 }
2844 2912
2845 this.playhead = new function() 2913 this.playhead = new function()
2846 { 2914 {
2847 this.object = document.createElement('div'); 2915 this.object = document.createElement('div');
2848 this.object.className = 'playhead'; 2916 this.object.className = 'playhead';