451 this.lignes = new Array(); |
451 this.lignes = new Array(); |
452 |
452 |
453 __IriSP.trace("__IriSP.Media","Media ID : "+id); |
453 __IriSP.trace("__IriSP.Media","Media ID : "+id); |
454 __IriSP.trace("__IriSP.Media","Media URL : "+url); |
454 __IriSP.trace("__IriSP.Media","Media URL : "+url); |
455 __IriSP.trace("__IriSP.Media","Media title : "+title); |
455 __IriSP.trace("__IriSP.Media","Media title : "+title); |
456 } |
456 }; |
457 __IriSP.Media.prototype.createPlayerMedia = function (width,height,MyStreamer,MySwfPath){ |
457 __IriSP.Media.prototype.createPlayerMedia = function (width,height,MyStreamer,MySwfPath){ |
458 __IriSP.MyApiPlayer = new __IriSP.APIplayer(width,height,this.url,this.duration,MyStreamer,MySwfPath); |
458 __IriSP.MyApiPlayer = new __IriSP.APIplayer(width,height,this.url,this.duration,MyStreamer,MySwfPath); |
459 //createPlayer(width,height,this.url,this.duration,MyStreamer,MySwfPath); |
459 //createPlayer(width,height,this.url,this.duration,MyStreamer,MySwfPath); |
460 } |
460 }; |
461 __IriSP.Media.prototype.getMediaDuration = function (){ |
461 __IriSP.Media.prototype.getMediaDuration = function (){ |
462 return (this.duration); |
462 return (this.duration); |
463 } |
463 }; |
464 __IriSP.Media.prototype.getMediaTitle = function (){ |
464 __IriSP.Media.prototype.getMediaTitle = function (){ |
465 return (this.title); |
465 return (this.title); |
466 } |
466 }; |
467 |
467 |
468 |
468 |
469 |
469 |
470 /* INTERFACE : SLIDER ( CONTROL BAR ) | BUTTON () */ |
470 /* INTERFACE : SLIDER ( CONTROL BAR ) | BUTTON () */ |
471 __IriSP.createInterface = function(width,height,duration){ |
471 __IriSP.createInterface = function(width,height,duration){ |
619 |
619 |
620 } else if(__IriSP.config.player.type=='vimeo') { |
620 } else if(__IriSP.config.player.type=='vimeo') { |
621 __IriSP.trace("vimeo",status); |
621 __IriSP.trace("vimeo",status); |
622 var status = 0; |
622 var status = 0; |
623 if (status!=1){__IriSP.player.api_play(); |
623 if (status!=1){__IriSP.player.api_play(); |
624 }else{__IriSP.player.remote(moogaloop, 'api_pause') |
624 }else{__IriSP.player.remote(moogaloop, 'api_pause'); |
625 } |
625 } |
626 |
626 |
627 |
627 |
628 } |
628 } |
629 } |
629 }; |
630 __IriSP.APIplayer.prototype.mute = function(){ |
630 __IriSP.APIplayer.prototype.mute = function(){ |
631 __IriSP.player.sendEvent('MUTE'); |
631 __IriSP.player.sendEvent('MUTE'); |
632 |
632 |
633 //alert(__IriSP.jQuery(".ui-icon-volume-on").css("background-position-x")); |
633 //alert(__IriSP.jQuery(".ui-icon-volume-on").css("background-position-x")); |
634 if (__IriSP.jQuery(".ui-icon-volume-on").css("background-position")=="-144px -160px"){ |
634 if (__IriSP.jQuery(".ui-icon-volume-on").css("background-position")=="-144px -160px"){ |
635 __IriSP.jQuery(".ui-icon-volume-on").css("background-position","-130px -160px"); |
635 __IriSP.jQuery(".ui-icon-volume-on").css("background-position","-130px -160px"); |
636 } else { |
636 } else { |
637 __IriSP.jQuery(".ui-icon-volume-on").css("background-position","-144px -160px"); |
637 __IriSP.jQuery(".ui-icon-volume-on").css("background-position","-144px -160px"); |
638 } |
638 } |
639 } |
639 }; |
640 __IriSP.APIplayer.prototype.share = function(network){ |
640 __IriSP.APIplayer.prototype.share = function(network){ |
641 |
641 |
642 var MyMessage = encodeURIComponent("J'écoute Les Retours du Dimanche : "); |
642 var MyMessage = encodeURIComponent("J'écoute Les Retours du Dimanche : "); |
643 var MyURLNow = window.location.href; |
643 var MyURLNow = window.location.href; |
644 var shareURL; |
644 var shareURL; |
657 //alert(network+" non actif pour l'instant : "+MyURLNow); |
657 //alert(network+" non actif pour l'instant : "+MyURLNow); |
658 } |
658 } |
659 |
659 |
660 window.open(shareURL+encodeURIComponent(MyURLNow)); |
660 window.open(shareURL+encodeURIComponent(MyURLNow)); |
661 //window.location.href = shareURL+encodeURIComponent(MyURLNow); |
661 //window.location.href = shareURL+encodeURIComponent(MyURLNow); |
662 } |
662 }; |
663 __IriSP.APIplayer.prototype.seek = function (time){ |
663 __IriSP.APIplayer.prototype.seek = function (time){ |
664 __IriSP.trace("__IriSP.APIplayer.prototype.seek",time); |
664 __IriSP.trace("__IriSP.APIplayer.prototype.seek",time); |
665 if(__IriSP.config.player.type=='jwplayer'){ |
665 if(__IriSP.config.player.type=='jwplayer'){ |
666 __IriSP.player.sendEvent('SEEK', time); |
666 __IriSP.player.sendEvent('SEEK', time); |
667 } else if(__IriSP.config.player.type=='dailymotion' |
667 } else if(__IriSP.config.player.type=='dailymotion' |
668 || __IriSP.config.player.type=='youtube') { |
668 || __IriSP.config.player.type=='youtube') { |
669 __IriSP.player.seekTo(time); |
669 __IriSP.player.seekTo(time); |
670 } |
670 } |
671 this.changePageUrlOffset(time); |
671 this.changePageUrlOffset(time); |
672 } |
672 }; |
673 __IriSP.APIplayer.prototype.update = function (time){ |
673 __IriSP.APIplayer.prototype.update = function (time){ |
674 this.hashchangeUpdate = true; |
674 this.hashchangeUpdate = true; |
675 __IriSP.player.sendEvent('SEEK', time); |
675 __IriSP.player.sendEvent('SEEK', time); |
676 } |
676 }; |
677 __IriSP.APIplayer.prototype.changePageUrlOffset = function (time) { |
677 __IriSP.APIplayer.prototype.changePageUrlOffset = function (time) { |
678 //alert(time); |
678 //alert(time); |
679 __IriSP.trace("__IriSP.APIplayer.prototype.changePageUrlOffset","CHANGE URL "+time); |
679 __IriSP.trace("__IriSP.APIplayer.prototype.changePageUrlOffset","CHANGE URL "+time); |
680 window.location.hash = "#t=" + time; |
680 window.location.hash = __IriSP.addTimeFragment(window.location.hash,time); |
681 window.location.href = window.location.href; |
681 window.location.href = window.location.href; |
682 } |
682 }; |
683 |
683 |
684 /* MEDIA FRAGMENT FUNCTION */ |
684 /* MEDIA FRAGMENT FUNCTION */ |
685 |
685 |
686 __IriSP.jumpToTimeoffset = function (form) { |
686 __IriSP.jumpToTimeoffset = function (form) { |
687 var time = form.time.value; |
687 var time = form.time.value; |
688 __IriSP.MyApiPlayer.changePageUrlOffset(time); |
688 __IriSP.MyApiPlayer.changePageUrlOffset(time); |
689 } |
689 }; |
690 __IriSP.retrieveTimeFragment = function (url) { |
690 __IriSP.retrieveTimeFragment = function (url) { |
691 var pageoffset = 0; |
691 var pageoffset = ""; |
692 var offsettime = 0; |
692 var offsettime = 0; |
693 |
693 |
694 if (url.split("#")[1] != null) { |
694 url_components = url.split("#"); |
695 pageoffset = url.split("#")[1]; |
695 |
696 if (pageoffset.substring(2) != null) { |
696 if (url_components.length > 1){ |
697 offsettime = pageoffset.substring(2); |
697 anchors = url_components[1]; |
698 } |
698 |
699 } |
699 anchors_components = []; |
700 return offsettime; |
700 if(anchors.indexOf(";")>=0) { |
701 } |
701 anchors_components = anchors.split(";"); |
|
702 } |
|
703 else if (anchors.indexOf("&")>=0) { |
|
704 anchors_components = anchors.split("&"); |
|
705 } |
|
706 |
|
707 var len = anchors_components.length; |
|
708 for(var i=0;i<len;i++) { |
|
709 comp = anchors_components[i]; |
|
710 if(comp.indexOf("t=") === 0) { |
|
711 pageoffset = comp; |
|
712 } |
|
713 } |
|
714 if (pageoffset.substring(2) != null) { |
|
715 offsettime = pageoffset.substring(2); |
|
716 } |
|
717 } |
|
718 return offsettime; |
|
719 }; |
|
720 __IriSP.addTimeFragment = function (hash_part,time) { |
|
721 |
|
722 if (time.length === 0) { |
|
723 return hash_part; |
|
724 } |
|
725 var t_pos = hash_part.indexOf("t="); |
|
726 var res = ""; |
|
727 if (t_pos >= 0) { |
|
728 res = hash_part.replace(/t=\d*/, "t="+time); |
|
729 } |
|
730 else { |
|
731 res = hash_part; |
|
732 if(res.length === 0) { |
|
733 res = "#"; |
|
734 } |
|
735 if(hash_part.length > 0 && hash_part !=="#" ) { |
|
736 res = res + "&"; |
|
737 } |
|
738 res = res + "t="+time; |
|
739 } |
|
740 return res; |
|
741 }; |
|
742 |
702 __IriSP.ignoreTimeFragment = function(url){ |
743 __IriSP.ignoreTimeFragment = function(url){ |
703 if (url.split("#")[1] != null) { |
744 if (url.split("#")[1] != null) { |
704 var pageurl= url.split("#")[0]; |
745 var pageurl= url.split("#")[0]; |
705 } |
746 } |
706 return pageurl; |
747 return pageurl; |
707 } |
748 }; |
708 |
749 |
709 |
750 |
710 /* CODE SPECIAL JW PLAYER creation + listener */ |
751 /* CODE SPECIAL JW PLAYER creation + listener */ |
711 |
752 |
712 __IriSP.currentPosition = 0; |
753 __IriSP.currentPosition = 0; |
780 var time = __IriSP.retrieveTimeFragment(url); |
821 var time = __IriSP.retrieveTimeFragment(url); |
781 __IriSP.startPosition = time; |
822 __IriSP.startPosition = time; |
782 __IriSP.DailymotionAddListeners(); |
823 __IriSP.DailymotionAddListeners(); |
783 |
824 |
784 __IriSP.MyApiPlayer.ready(playerid); |
825 __IriSP.MyApiPlayer.ready(playerid); |
785 } |
826 }; |
786 __IriSP.DailymotionAddListeners = function () { |
827 __IriSP.DailymotionAddListeners = function () { |
787 if (__IriSP.player) { |
828 if (__IriSP.player) { |
788 __IriSP.trace("__IriSP.addListeners","ADD Listener "); |
829 __IriSP.trace("__IriSP.addListeners","ADD Listener "); |
789 //__IriSP.player.addEventListener("onStateChange", "__IriSP.DailymotionPositionListener"); |
830 //__IriSP.player.addEventListener("onStateChange", "__IriSP.DailymotionPositionListener"); |
790 setTimeout("__IriSP.DailymotionPositionListener()",100); |
831 setTimeout("__IriSP.DailymotionPositionListener()",100); |
825 |
866 |
826 |
867 |
827 __IriSP.YouTubeAddListeners(); |
868 __IriSP.YouTubeAddListeners(); |
828 __IriSP.trace("onYouTubePlayerReady=",time); |
869 __IriSP.trace("onYouTubePlayerReady=",time); |
829 //__IriSP.MyApiPlayer.ready(playerid); |
870 //__IriSP.MyApiPlayer.ready(playerid); |
830 } |
871 }; |
831 __IriSP.YouTubeAddListeners = function () { |
872 __IriSP.YouTubeAddListeners = function () { |
832 if (__IriSP.player) { |
873 if (__IriSP.player) { |
833 __IriSP.trace("__IriSP.addListeners","ADD Listener "); |
874 __IriSP.trace("__IriSP.addListeners","ADD Listener "); |
834 __IriSP.player.addEventListener("onStateChange", "__IriSP.YouTubeStateMonitor"); |
875 __IriSP.player.addEventListener("onStateChange", "__IriSP.YouTubeStateMonitor"); |
835 setTimeout("__IriSP.YouTubePositionListener()",100); |
876 setTimeout("__IriSP.YouTubePositionListener()",100); |
836 __IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener"); |
877 __IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener"); |
837 //__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor'); |
878 //__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor'); |
838 } else { |
879 } else { |
839 __IriSP.setTimeout("__IriSP.YouTubePositionListener()",100); |
880 __IriSP.setTimeout("__IriSP.YouTubePositionListener()",100); |
840 } |
881 } |
841 } |
882 }; |
842 __IriSP.YouTubePositionListener = function() { |
883 __IriSP.YouTubePositionListener = function() { |
843 |
884 |
844 __IriSP.currentPosition = __IriSP.player.getCurrentTime(); |
885 __IriSP.currentPosition = __IriSP.player.getCurrentTime(); |
845 //__IriSP.trace("__IriSP.YouTubePositionListener",__IriSP.currentPosition); |
886 //__IriSP.trace("__IriSP.YouTubePositionListener",__IriSP.currentPosition); |
846 //__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition); |
887 //__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition); |
897 |
938 |
898 |
939 |
899 __IriSP.YouTubeAddListeners(); |
940 __IriSP.YouTubeAddListeners(); |
900 __IriSP.trace("onYouTubePlayerReady=",time); |
941 __IriSP.trace("onYouTubePlayerReady=",time); |
901 //__IriSP.MyApiPlayer.ready(playerid); |
942 //__IriSP.MyApiPlayer.ready(playerid); |
902 } |
943 }; |
903 __IriSP.VimeoAddListeners = function () { |
944 __IriSP.VimeoAddListeners = function () { |
904 if (__IriSP.player) { |
945 if (__IriSP.player) { |
905 __IriSP.trace("__IriSP.addListeners","ADD Listener "); |
946 __IriSP.trace("__IriSP.addListeners","ADD Listener "); |
906 __IriSP.player.addEventListener("onStateChange", "__IriSP.YouTubeStateMonitor"); |
947 __IriSP.player.addEventListener("onStateChange", "__IriSP.YouTubeStateMonitor"); |
907 setTimeout("__IriSP.YouTubePositionListener()",100); |
948 setTimeout("__IriSP.YouTubePositionListener()",100); |
908 __IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener"); |
949 __IriSP.player.addModelListener("VOLUME", "__IriSP.volumeListener"); |
909 //__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor'); |
950 //__IriSP.player.addModelListener('STATE', '__IriSP.stateMonitor'); |
910 } else { |
951 } else { |
911 __IriSP.setTimeout("__IriSP.YouTubePositionListener()",100); |
952 __IriSP.setTimeout("__IriSP.YouTubePositionListener()",100); |
912 } |
953 } |
913 } |
954 }; |
914 __IriSP.VimeoPositionListener = function() { |
955 __IriSP.VimeoPositionListener = function() { |
915 |
956 |
916 __IriSP.currentPosition = __IriSP.player.getCurrentTime(); |
957 __IriSP.currentPosition = __IriSP.player.getCurrentTime(); |
917 //__IriSP.trace("__IriSP.YouTubePositionListener",__IriSP.currentPosition); |
958 //__IriSP.trace("__IriSP.YouTubePositionListener",__IriSP.currentPosition); |
918 //__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition); |
959 //__IriSP.trace("__IriSP.currentPosition",__IriSP.currentPosition); |
973 __IriSP.startPosition = time; |
1014 __IriSP.startPosition = time; |
974 //__IriSP.trace("__IriSP.playerReady"," LISTENER LAUCHER"); |
1015 //__IriSP.trace("__IriSP.playerReady"," LISTENER LAUCHER"); |
975 __IriSP.addListeners(); |
1016 __IriSP.addListeners(); |
976 //__IriSP.trace("__IriSP.playerReady"," LISTENER END"); |
1017 //__IriSP.trace("__IriSP.playerReady"," LISTENER END"); |
977 |
1018 |
978 } |
1019 }; |
979 __IriSP.addListeners = function () { |
1020 __IriSP.addListeners = function () { |
980 if (__IriSP.player) { |
1021 if (__IriSP.player) { |
981 __IriSP.trace("__IriSP.addListeners","ADD Listener "); |
1022 __IriSP.trace("__IriSP.addListeners","ADD Listener "); |
982 __IriSP.player.addModelListener("TIME", "__IriSP.positionListener"); |
1023 __IriSP.player.addModelListener("TIME", "__IriSP.positionListener"); |
983 __IriSP.player.addControllerListener("VOLUME", "__IriSP.volumeListener"); |
1024 __IriSP.player.addControllerListener("VOLUME", "__IriSP.volumeListener"); |
1023 //__IriSP.jQuery("#amount").val(obj.position+" s"); |
1064 //__IriSP.jQuery("#amount").val(obj.position+" s"); |
1024 // afficher annotation |
1065 // afficher annotation |
1025 __IriSP.MyLdt.checkTime(__IriSP.currentPosition); |
1066 __IriSP.MyLdt.checkTime(__IriSP.currentPosition); |
1026 |
1067 |
1027 |
1068 |
1028 } |
1069 }; |
1029 __IriSP.volumeListener = function (obj) { |
1070 __IriSP.volumeListener = function (obj) { |
1030 __IriSP.currentVolume = obj.percentage; |
1071 __IriSP.currentVolume = obj.percentage; |
1031 var tmp = document.getElementById("vol"); |
1072 var tmp = document.getElementById("vol"); |
1032 if (tmp) { tmp.innerHTML = "volume: " + __IriSP.currentVolume; } |
1073 if (tmp) { tmp.innerHTML = "volume: " + __IriSP.currentVolume; } |
1033 } |
1074 }; |
1034 |
1075 |
1035 |
1076 |
1036 |
1077 |
1037 |
1078 |
1038 /* UTIL */ |
1079 /* UTIL */ |
1039 // code from http://stackoverflow.com/questions/822452/strip-html-from-text-javascript |
1080 // code from http://stackoverflow.com/questions/822452/strip-html-from-text-javascript |
1040 __IriSP.stripHtml = function(s){ |
1081 __IriSP.stripHtml = function(s){ |
1041 return s.replace(/\\&/g, '&').replace(/\\</g, '<').replace(/\\>/g, '>').replace(/\\t/g, ' ').replace(/\\n/g, '<br />').replace(/'/g, ''').replace(/"/g, '"'); |
1082 return s.replace(/\\&/g, '&').replace(/\\</g, '<').replace(/\\>/g, '>').replace(/\\t/g, ' ').replace(/\\n/g, '<br />').replace(/'/g, ''').replace(/"/g, '"'); |
1042 } |
1083 }; |
1043 // conversion de couleur Decimal vers HexaDecimal || 000 si fff |
1084 // conversion de couleur Decimal vers HexaDecimal || 000 si fff |
1044 __IriSP.DEC_HEXA_COLOR = function (dec){ |
1085 __IriSP.DEC_HEXA_COLOR = function (dec){ |
1045 var hexa='0123456789ABCDEF',hex=''; |
1086 var hexa='0123456789ABCDEF',hex=''; |
1046 var tmp; |
1087 var tmp; |
1047 while (dec>15){ |
1088 while (dec>15){ |
1085 this.annotations = new Array(); |
1126 this.annotations = new Array(); |
1086 this.duration = duration; |
1127 this.duration = duration; |
1087 this.annotationOldRead=""; |
1128 this.annotationOldRead=""; |
1088 __IriSP.LDTligne = this; |
1129 __IriSP.LDTligne = this; |
1089 __IriSP.trace("__IriSP.Ligne","CREATE "+__IriSP.LDTligne); |
1130 __IriSP.trace("__IriSP.Ligne","CREATE "+__IriSP.LDTligne); |
1090 } |
1131 }; |
1091 __IriSP.Ligne.prototype.addAnnotation = function (json){ |
1132 __IriSP.Ligne.prototype.addAnnotation = function (json){ |
1092 var myAnnotation = new __IriSP.Annotation(json,this.duration); |
1133 var myAnnotation = new __IriSP.Annotation(json,this.duration); |
1093 this.annotations.push(myAnnotation); |
1134 this.annotations.push(myAnnotation); |
1094 //__IriSP.trace("__IriSP.Ligne.prototype.addAnnotation ","add annotation "+title); |
1135 //__IriSP.trace("__IriSP.Ligne.prototype.addAnnotation ","add annotation "+title); |
1095 } |
1136 }; |
1096 __IriSP.Ligne.prototype.onClickLigneAnnotation = function(id){ |
1137 __IriSP.Ligne.prototype.onClickLigneAnnotation = function(id){ |
1097 //changePageUrlOffset(currentPosition); |
1138 //changePageUrlOffset(currentPosition); |
1098 //player.sendEvent('SEEK', this.start); |
1139 //player.sendEvent('SEEK', this.start); |
1099 //__IriSP.trace("SEEK",this.start); |
1140 //__IriSP.trace("SEEK",this.start); |
1100 } |
1141 }; |
1101 __IriSP.Ligne.prototype.searchLigneAnnotation = function(id){ |
1142 __IriSP.Ligne.prototype.searchLigneAnnotation = function(id){ |
1102 /*for (){ |
1143 /*for (){ |
1103 }*/ |
1144 }*/ |
1104 } |
1145 }; |
1105 __IriSP.Ligne.prototype.listAnnotations = function(){ |
1146 __IriSP.Ligne.prototype.listAnnotations = function(){ |
1106 |
1147 |
1107 } |
1148 }; |
1108 __IriSP.Ligne.prototype.nextAnnotation = function (){ |
1149 __IriSP.Ligne.prototype.nextAnnotation = function (){ |
1109 var annotationCibleNumber = this.numAnnotation(this.annotationOldRead)+1; |
1150 var annotationCibleNumber = this.numAnnotation(this.annotationOldRead)+1; |
1110 var annotationCible = this.annotations[annotationCibleNumber]; |
1151 var annotationCible = this.annotations[annotationCibleNumber]; |
1111 |
1152 |
1112 if(annotationCibleNumber<this.annotations.length-1){ |
1153 if(annotationCibleNumber<this.annotations.length-1){ |
1113 annotationCible.begin |
1154 annotationCible.begin; |
1114 __IriSP.player .sendEvent('SEEK', annotationCible.begin/1000); |
1155 __IriSP.player .sendEvent('SEEK', annotationCible.begin/1000); |
1115 __IriSP.trace("LIGNE ","| next = "+annotationCibleNumber+" - "+this.annotations.length+" | seek :"+annotationCible.begin/1000); |
1156 __IriSP.trace("LIGNE ","| next = "+annotationCibleNumber+" - "+this.annotations.length+" | seek :"+annotationCible.begin/1000); |
1116 }else{ |
1157 }else{ |
1117 __IriSP.player .sendEvent('SEEK', this.annotations[0].begin/1000); |
1158 __IriSP.player .sendEvent('SEEK', this.annotations[0].begin/1000); |
1118 } |
1159 } |
1119 |
1160 |
1120 |
1161 |
1121 } |
1162 }; |
1122 __IriSP.Ligne.prototype.numAnnotation = function (annotationCible){ |
1163 __IriSP.Ligne.prototype.numAnnotation = function (annotationCible){ |
1123 for (var i=0; i < this.annotations.length; ++i){ |
1164 for (var i=0; i < this.annotations.length; ++i){ |
1124 if(annotationCible == this.annotations[i]){ |
1165 if(annotationCible == this.annotations[i]){ |
1125 return i; |
1166 return i; |
1126 } |
1167 } |
1127 } |
1168 } |
1128 } |
1169 }; |
1129 __IriSP.Ligne.prototype.checkTime = function(time){ |
1170 __IriSP.Ligne.prototype.checkTime = function(time){ |
1130 var annotationTempo = -1; |
1171 var annotationTempo = -1; |
1131 |
1172 |
1132 for (var i=0; i < this.annotations.length; ++i){ |
1173 for (var i=0; i < this.annotations.length; ++i){ |
1133 annotationTempo = this.annotations[i]; |
1174 annotationTempo = this.annotations[i]; |
1223 //var thisNode = __IriSP.jQuery(); |
1264 //var thisNode = __IriSP.jQuery(); |
1224 //addTip("#"+this.id, __IriSP.stripHtml(titleForDiv),"#000"); |
1265 //addTip("#"+this.id, __IriSP.stripHtml(titleForDiv),"#000"); |
1225 |
1266 |
1226 __IriSP.jQuery("#"+this.id).fadeTo(0,0.3); |
1267 __IriSP.jQuery("#"+this.id).fadeTo(0,0.3); |
1227 __IriSP.jQuery("#"+this.id).mouseover(function() { |
1268 __IriSP.jQuery("#"+this.id).mouseover(function() { |
1228 __IriSP.jQuery("#"+this.id).animate({opacity: 0.6}, 5) |
1269 __IriSP.jQuery("#"+this.id).animate({opacity: 0.6}, 5); |
1229 }).mouseout(function(){ |
1270 }).mouseout(function(){ |
1230 __IriSP.jQuery("#"+this.id).animate({opacity: 0.3}, 5) |
1271 __IriSP.jQuery("#"+this.id).animate({opacity: 0.3}, 5); |
1231 }); |
1272 }); |
1232 __IriSP.trace("__IriSP.Annotation.prototype.draw","ADD ANOTATION : "+this.begin+" "+this.end+" "+__IriSP.stripHtml(this.title)+" | "+startPourcent+" | "+endPourcent+" | duration = "+this.duration); |
1273 __IriSP.trace("__IriSP.Annotation.prototype.draw","ADD ANOTATION : "+this.begin+" "+this.end+" "+__IriSP.stripHtml(this.title)+" | "+startPourcent+" | "+endPourcent+" | duration = "+this.duration); |
1233 |
1274 |
1234 } |
1275 }; |
1235 __IriSP.Annotation.prototype.drawTags = function(){ |
1276 __IriSP.Annotation.prototype.drawTags = function(){ |
1236 var KeywordPattern = '<a href=\"\"> '+' </a>'; |
1277 var KeywordPattern = '<a href=\"\"> '+' </a>'; |
1237 |
1278 |
1238 //__IriSP.trace(" !? Tags : ",this.tags); |
1279 //__IriSP.trace(" !? Tags : ",this.tags); |
1239 |
1280 |
1240 if (this.tags!=undefined){ |
1281 if (this.tags!=undefined){ |
1241 for (var i = 0; i < this.tags.length; ++i){ |
1282 for (var i = 0; i < this.tags.length; ++i){ |
1242 this.htmlTags += '<span> '+__IriSP.MyTags.getTitle(this.tags[i]['id-ref'])+' </span>'+" , "; |
1283 this.htmlTags += '<span> '+__IriSP.MyTags.getTitle(this.tags[i]['id-ref'])+' </span>'+" , "; |
1243 } |
1284 } |
1244 } |
1285 } |
1245 } |
1286 }; |
1246 __IriSP.Annotation.prototype.tootTipAnnotation = function() { |
1287 __IriSP.Annotation.prototype.tootTipAnnotation = function() { |
1247 // 1 chercher le div correspondant |
1288 // 1 chercher le div correspondant |
1248 // 2 y mettre les information |
1289 // 2 y mettre les information |
1249 return this.color + ' ' + this.type + ' apple'; |
1290 return this.color + ' ' + this.type + ' apple'; |
1250 } |
1291 }; |
1251 __IriSP.Annotation.prototype.onRollOverAnnotation = function (){ |
1292 __IriSP.Annotation.prototype.onRollOverAnnotation = function (){ |
1252 //this.tootTip(); |
1293 //this.tootTip(); |
1253 } |
1294 }; |
1254 __IriSP.Annotation.prototype.timeToPourcent = function(time,timetotal){ |
1295 __IriSP.Annotation.prototype.timeToPourcent = function(time,timetotal){ |
1255 return (parseInt(Math.round(time/timetotal*100))); |
1296 return (parseInt(Math.round(time/timetotal*100))); |
1256 } |
1297 }; |
1257 |
1298 |
1258 |
1299 |
1259 /* CLASS Tags */ |
1300 /* CLASS Tags */ |
1260 |
1301 |
1261 __IriSP.Tags = function(object){ |
1302 __IriSP.Tags = function(object){ |
1262 this.myTags = object; |
1303 this.myTags = object; |
1263 this.htmlTags = null; |
1304 this.htmlTags = null; |
1264 this.weigthMax = 0; |
1305 this.weigthMax = 0; |
1265 //this.mySegments = new array(); |
1306 //this.mySegments = new array(); |
1266 } |
1307 }; |
1267 __IriSP.Tags.prototype.addAnnotation = function (annotation){ |
1308 __IriSP.Tags.prototype.addAnnotation = function (annotation){ |
1268 for (var i = 0; i < this.myTags.length; ++i){ |
1309 for (var i = 0; i < this.myTags.length; ++i){ |
1269 this.myTags[i].mySegments = new Array(); |
1310 this.myTags[i].mySegments = new Array(); |
1270 if (annotation.tags!=null){ |
1311 if (annotation.tags!=null){ |
1271 for (var j = 0; j < annotation.tags.length; ++j){ |
1312 for (var j = 0; j < annotation.tags.length; ++j){ |
1272 if (this.myTags[i]['id'] == annotation.tags[j]['id-ref']){ |
1313 if (this.myTags[i]['id'] == annotation.tags[j]['id-ref']){ |
1273 this.myTags[i].mySegments.push([annotation.begin,annotation.end,annotation.id]); |
1314 this.myTags[i].mySegments.push([annotation.begin,annotation.end,annotation.id]); |
1274 var weigthTempo = this.myTags[i].mySegments.length |
1315 var weigthTempo = this.myTags[i].mySegments.length; |
1275 var tempo = this.myTags[i].mySegments[weigthTempo-1]; |
1316 var tempo = this.myTags[i].mySegments[weigthTempo-1]; |
1276 //__IriSP.trace ("__IriSP.Tags.prototype.addAnnotation "," "+this.myTags[i]['meta']['dc:title']+" "+this.myTags[i]['id']+" : "+tempo[0]+" - "+tempo[1]); |
1317 //__IriSP.trace ("__IriSP.Tags.prototype.addAnnotation "," "+this.myTags[i]['meta']['dc:title']+" "+this.myTags[i]['id']+" : "+tempo[0]+" - "+tempo[1]); |
1277 |
1318 |
1278 if (this.weigthMax < weigthTempo ){ |
1319 if (this.weigthMax < weigthTempo ){ |
1279 this.weigthMax = weigthTempo; |
1320 this.weigthMax = weigthTempo; |
1280 } |
1321 } |
1281 } |
1322 } |
1282 } |
1323 } |
1283 } |
1324 } |
1284 } |
1325 } |
1285 } |
1326 }; |
1286 __IriSP.Tags.prototype.getTitle = function (id){ |
1327 __IriSP.Tags.prototype.getTitle = function (id){ |
1287 for (var i = 0; i < this.myTags.length; ++i){ |
1328 for (var i = 0; i < this.myTags.length; ++i){ |
1288 if(this.myTags[i]['id']==id){ |
1329 if(this.myTags[i]['id']==id){ |
1289 return(this.myTags[i]['meta']['dc:title']); |
1330 return(this.myTags[i]['meta']['dc:title']); |
1290 } |
1331 } |
1291 } |
1332 } |
1292 |
1333 |
1293 } |
1334 }; |
1294 __IriSP.Tags.prototype.draw = function (){ |
1335 __IriSP.Tags.prototype.draw = function (){ |
1295 |
1336 |
1296 __IriSP.trace("__IriSP.Tags.prototype.draw"," !!! WELL START " ); |
1337 __IriSP.trace("__IriSP.Tags.prototype.draw"," !!! WELL START " ); |
1297 for (var i = 0; i < this.myTags.length; ++i){ |
1338 for (var i = 0; i < this.myTags.length; ++i){ |
1298 __IriSP.trace("__IriSP.Tags.prototype.draw"," ADD Tags : "+this.myTags[i]['id']); |
1339 __IriSP.trace("__IriSP.Tags.prototype.draw"," ADD Tags : "+this.myTags[i]['id']); |