# HG changeset patch
# User veltr
# Date 1331310563 -3600
# Node ID 0dd21c2983805044f284c016ee165f9a5461c95d
# Parent 18ca612e9ff0ebc472c902242b4f06710d86613f
Integration pour cinecast
diff -r 18ca612e9ff0 -r 0dd21c298380 src/css/LdtPlayer.css
--- a/src/css/LdtPlayer.css Thu Mar 08 18:38:46 2012 +0100
+++ b/src/css/LdtPlayer.css Fri Mar 09 17:29:23 2012 +0100
@@ -1,3 +1,20 @@
+/* Some general styling classes */
+
+.Ldt-floatClear {
+ display: block; width: 100%; height: 0; clear: both;
+}
+
+ul.Ldt-floatList {
+ padding: 0; margin: 0; list-style: none;
+}
+
+.Ldt-floatList li {
+ float: left;
+}
+
+
+/* */
+
#demo-frame > div.demo { padding: 5px !important; };
button.ui-button-icon-only {
@@ -139,12 +156,11 @@
/* player */
.Ldt-controler {
- font-size: 62.5%;
+ font-size: 10px;
font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
background:url('imgs/player_gradient.png') repeat-x transparent ;
height: 25px;
- border-top: 1px solid #b6b8b8;
- border-bottom: 1px solid #b6b8b8;
+ border: 1px solid #b6b8b8;
}
@@ -156,67 +172,70 @@
float: right;
}
-.Ldt-button {
- border-left: 1px solid #b6b8b8;
+.Ldt-Ctrl-button {
float: left;
+ width: 30px; height: 25px;
+ background: url('imgs/player-sprites.png');
cursor: pointer;
-
+}
+
+.Ldt-Ctrl-spacer {
+ float: left; width: 1px; height: 25px; background: #b6b8b8;
}
.Ldt-CtrlPlay {
-
- background-position: 0 0;
- width: 59px;
- height: 25px;
+ margin: 0 15px;
}
.Ldt-CtrlPlay-PlayState {
- background:url('imgs/play_sprite.png') no-repeat transparent ;
+ background-position: 0 0;
}
-.Ldt-CtrlPlay-PauseState {
- background:url('imgs/pause_sprite.png') no-repeat transparent ;
-}
-
-.Ldt-CtrlPlay:hover {
+.Ldt-CtrlPlay-PlayState:hover {
background-position: 0 -25px;
}
-.Ldt-CtrlPlay:active {
+.Ldt-CtrlPlay-PlayState:active {
background-position: 0 -50px;
}
+.Ldt-CtrlPlay-PauseState {
+ background-position: -30px 0;
+}
+
+.Ldt-CtrlPlay-PauseState:hover {
+ background-position: -30px -25px;
+}
+
+.Ldt-CtrlPlay-PauseState:active {
+ background-position: -30px -50px;
+}
+
+
.Ldt-CtrlAnnotate {
- background:url('imgs/annotate_sprite.png') no-repeat scroll 0 0 transparent ;
- width: 33px;
- height: 25px;
- border-right: 1px solid #b6b8b8;
- float: left;
+ margin: 0 2px;
+ background-position: -60px 0;
}
.Ldt-CtrlAnnotate:hover {
- background-position: 0 -25px;
+ background-position: -60px -25px;
}
.Ldt-CtrlAnnotate:active {
- background-position: 0 -50px;
+ background-position: -60px -50px;
}
.Ldt-CtrlSearch {
- background:url('imgs/search_sprite.png') no-repeat scroll 0 0 transparent ;
- width: 33px;
- height: 25px;
- border-right: 1px solid #b6b8b8;
- float: left;
- border-left: none;
+ margin: 0 2px;
+ background-position: -90px 0;
}
.Ldt-CtrlSearch:hover {
- background-position: 0 -25px;
+ background-position: -90px -25px;
}
.Ldt-CtrlSearch:active {
- background-position: 0 -50px;
+ background-position: -90px -50px;
}
.LdtSearch {
@@ -230,68 +249,55 @@
}
.Ldt-Time {
- position: inherit;
float: left;
- border-right: 1px solid #b6b8b8;
- height: 25px;
- padding-right: 2px;
+ margin: 5px;
font-size: 12px;
font-family: Arial, Verdana, sans-serif;
}
.Ldt-ElapsedTime {
- margin-top: 4px;
- margin-right: 2px;
float: left;
color: #4a4a4a;
}
.Ldt-TimeSeparator {
- margin-top: 4px;
+ margin: 0 4px;
float: left;
- padding-left: 1px;
- padding-right: 1px;
}
.Ldt-TotalTime {
- margin-top: 4px;
- margin-left: 2px;
float: left;
color: #b2b2b2;
}
.Ldt-CtrlSound {
- width: 33px;
- height: 25px;
- border-right: 1px solid #b6b8b8;
- float: right;
- border-left: none;
+ margin: 0 2px;
}
.Ldt-CtrlSound-SoundState {
- background:url('imgs/sound_sprite.png') no-repeat scroll 0 0 transparent ;
+ background-position: -120px 0;
+}
+
+.Ldt-CtrlSound-SoundState:hover {
+ background-position: -120px -25px;
+}
+
+.Ldt-CtrlSound-SoundState:active {
+ background-position: -120px -50px;
}
.Ldt-CtrlSound-MuteState {
- background:url('imgs/mute_sprite.png') no-repeat scroll 0 0 transparent ;
-}
-
-.Ldt-CtrlSound:hover {
- background-position: 0 -25px;
+ background-position: -150px 0;
}
-.Ldt-CtrlSound:active {
- background-position: 0 -50px;
+.Ldt-CtrlSound-MuteState:hover {
+ background-position: -150px -25px;
}
-/*
-.Ldt-CtrlSound {
- float: right;
- border-left: none;
- height: 25px;
- top: 7px;
- position: inherit;
+
+.Ldt-CtrlSound-MuteState:active {
+ background-position: -150px -50px;
}
-*/
+
.Ldt-cleaner {
clear:both;
}
@@ -652,63 +658,59 @@
float: left;
}
-.Ldt-createAnnotation-Container {
- display: table;
- border-collapse: collapse;
- width: 100%;
+.Ldt-createAnnotation-Container {
+ float: left; width: 100%; clear: both;
}
-.Ldt-createAnnotation-userAvatar {
+.Ldt-createAnnotation-userAvatar {
+ float: right;
width: 48px;
- display: table-cell;
- vertical-align: top;
-}
-
-.Ldt-createAnnotation-userAvatar img {
- display: block;
+ height: 48px;
+ margin: 7px 0;
border: 1px solid #babcbc;
}
+.Ldt-createAnnotation-userAvatar img {
+ float: right;
+ display: block;
+ max-width: 100%;
+ max-height: 100%;
+}
+
.Ldt-createAnnotation-profileArrow {
- display: table-cell;
+ float: right;
vertical-align: top;
height: 48px;
width: 15px;
- padding-right: 5px;
- padding-left: 3px;
- background:url('imgs/profile_arrow.png');
- background-repeat: no-repeat;
- background-position: center;
+ margin: 7px 5px;
+ background:url('imgs/profile_arrow.png') center no-repeat;
}
.Ldt-createAnnotation-Description {
- display: table-cell;
- width: 100%;
- height: 48px;
- vertical-align: top;
- -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
- -moz-box-sizing: border-box; /* Firefox, other Gecko */
- box-sizing: border-box; /* Opera/IE 8+ */
+ float: left;
+ width: 520px;
+ height: 56px; padding: 2px;
+ resize: none;
}
-.Ldt-createAnnotation-present-keyword {
+.Ldt-createAnnotation-btnblock {
+ float: left; width: 450px; margin: 5px 0;
+}
+
+.Ldt-createAnnotation-btnblock label {
+ float: left; margin-left: 12px; margin: 2px 8px 2px 0; font-size: 12px;
+}
+
+.Ldt-createAnnotation-keyword-button {
border: 1px solid #ffffff;
background-color: #217bcb;
color: #ffffff;
- padding: 3px;
- padding-left: 4px;
- padding-right: 4px;
+ padding: 3px 4px;
cursor: pointer;
}
-.Ldt-createAnnotation-absent-keyword {
- border: 1px solid #ffffff;
+.Ldt-createAnnotation-active-button .Ldt-createAnnotation-keyword-button {
background-color: #d93c71;
- color: #ffffff;
- padding: 3px;
- padding-left: 4px;
- padding-right: 4px;
- cursor: pointer;
}
.Ldt-createAnnotation-submitButton {
@@ -722,6 +724,10 @@
width: 48px;
position: relative;
margin-top: 3px;
+ padding: 28px 0 0;
+ font-size: 13px;
+ border: none;
+ text-align: center;
}
.Ldt-createAnnotation-endScreen {
@@ -750,9 +756,6 @@
}
/* polemic tweet annotation buttons */
-.Ldt-createAnnotation-polemics {
- padding-top: 2px;
-}
.Ldt-createAnnotation-polemic-button {
margin: 0;
@@ -763,12 +766,13 @@
height: 26px;
text-indent: -999px;
background: url(imgs/polemic_buttons_sprite.png);
+ cursor: pointer;
}
.Ldt-createAnnotation-polemic-positive:hover {
background-position: 0 -26px;
}
-.Ldt-createAnnotation-polemic-positive.Ldt-createAnnotation-polemic-active {
+.Ldt-createAnnotation-active-button .Ldt-createAnnotation-polemic-positive {
background-position: 0 -52px;
}
@@ -778,7 +782,7 @@
.Ldt-createAnnotation-polemic-negative:hover {
background-position: -38px -26px;
}
-.Ldt-createAnnotation-polemic-negative.Ldt-createAnnotation-polemic-active {
+.Ldt-createAnnotation-active-button .Ldt-createAnnotation-polemic-negative {
background-position: -38px -52px;
}
@@ -788,7 +792,7 @@
.Ldt-createAnnotation-polemic-reference:hover {
background-position: -76px -26px;
}
-.Ldt-createAnnotation-polemic-reference.Ldt-createAnnotation-polemic-active {
+.Ldt-createAnnotation-active-button .Ldt-createAnnotation-polemic-reference {
background-position: -76px -52px;
}
@@ -798,7 +802,7 @@
.Ldt-createAnnotation-polemic-question:hover {
background-position: -114px -26px;
}
-.Ldt-createAnnotation-polemic-question.Ldt-createAnnotation-polemic-active {
+.Ldt-createAnnotation-active-button .Ldt-createAnnotation-polemic-question {
background-position: -114px -52px;
}
diff -r 18ca612e9ff0 -r 0dd21c298380 src/css/LdtPlayerFc.css
--- a/src/css/LdtPlayerFc.css Thu Mar 08 18:38:46 2012 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +0,0 @@
- #demo-frame > div.demo { padding: 5px !important; };
-
- button.ui-button-icon-only {
- height:1.5em;
- width:1.5em;
- }
-
- #Ldt-loader{
- background:url(imgs/transBlack.gif);
- width:10px;
- height:10px;
- }
-
- #Ldt-controler {
- font-size: 62.5%;
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- background-color:#EEE;
- height:35px;
- padding:5px;
- }
-
- .Ldt-iri-chapter{
- padding-top:10px;
- padding-bottom:5px;
- border-left:solid 1px #000;
- border-right:solid 1px #000;
- }
-
- #Ldt-loader {
- background:url(imgs/loader_fc.gif) no-repeat;
- width:20px;
- height:16px;
- float:left;
- }
-
- .tooltip {
- display:none;
- background:transparent url(imgs/white_arrow_mini.png);
- font-size:12px;
- height:55px;
- width:180px;
- padding:10px;
- padding-left:15px;
- padding-top:15px;
- padding-right:15px;
- color:#000;
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- }
- #Ldt-Root{
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- }
- #Ldt-Hat{
- height:3px;
- }
- #Ldt-Annotations{
- padding-left:5px;
- width:470px;
- float:left;
- font-size: 62.5%;
- }
- #Ldt-SaTitle{
- padding-top:2px;
- padding-bottom:5px;
- font-size:18px;
- height:22p;
- color:#4D4D4D;
- }
- #Ldt-SaDescription{
- font-size:12px;
- }
- #Ldt-Show-Arrow-container{
- margin-left:60px;
- }
- #Ldt-Show-Arrow{
- position:relative;
- background:url(imgs/purple_arrow_Show.png);
- width:27px;
- height:13px;
- margin-top:12px;
- margin-left:-10px;
- z-index:999999999;
- }
-
- #Ldt-output{
- display:none;
- }
- #Ldt-Show-Tags{
- position:relative;
- height:13px;
- margin-top:-10px;
- border: solid 1px #000;
- }
- #Ldt-ShowAnnotation-video{
- position:absolute;
- z-index: 999;
- padding:5px;
- background:url(imgs/transBlack.png);
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- color:#FFF;
- }
- #Ldt-ShowAnnotation-audio{
- position:relative;
- padding:5px;
- background-color:#decfe2;
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- color:#4D4D4D;
- }
- #Ldt-SaKeyword{
- background-color:#bc85be;
- color:#4D4D4D;
- padding:5px;
- font-weight:bold;
- text-align:left;
- float:left;
- font-size:10px;
- }
- #Ldt-SaShareTools{
- text-align:right;
- float:right;
- }
-
-
- #Ldt-PlaceHolder{
- position:absolue;
- float:none;
- }
- .Ldt-Search-select{
- padding-top:25px;
- }
- .Ldt-Search-unselect{
- border-top:0px;
- }
-
- .Ldt-mode-radio{
- visibility:hidden;
- height:0px;
- display:none
- }
-
- .Ldt-Control1{
- width:60px;
- float:left;
- }
- .Ldt-Control2{
- padding-left:10px;
- width:60px;
- float:left;
- }
- .Ldt-cleaner {
- clear:both;
- }
- .share {
- background:url('imgs/widget20.png') no-repeat scroll 0 0 transparent ;
- display:block;
- height:16px;
- line-height:16px !important;
- overflow:hidden;
- width:16px;
- float:left;
- cursor:pointer;
- margin:2px;
- }
- .shareFacebook{
- background-position:0 -704px;
- }
- .shareMySpace{
- background-position:0 -736px;
- }
- .shareTwitter{
- background-position:0 -1072px;
- }
- .shareGoogle{
- background-position:0 -752px;
- }
- .shareDelicious{
- background-position:0 -672px;
- }
- .shareJamesPot{
- background-position:0 -1808px;
- }
-
-
\ No newline at end of file
diff -r 18ca612e9ff0 -r 0dd21c298380 src/css/LdtPlayerUniverScience.css
--- a/src/css/LdtPlayerUniverScience.css Thu Mar 08 18:38:46 2012 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
- #demo-frame > div.demo { padding: 5px !important; };
-
- .ui-widget {
- font-size: 1.5em;
- }
- #Ldt-loader {
- background:url(imgs/loader.gif) no-repeat;
- width:20px;
- height:16px;
- float:left;
- }
-
- #Ldt-controler {
- font-size: 62.5%;
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- background-color:#262626;
- height:35px;
- padding:5px;
-
- margin-left:213px;
- }
-
- .Ldt-iri-chapter{
- padding-top:10px;
- padding-bottom:5px;
- border-left:solid 1px #000;
- border-right:solid 1px #000;
- }
-
- .tooltip {
- display:none;
- background:transparent url(imgs/white_arrow_mini.png);
- font-size:12px;
- height:55px;
- width:180px;
- padding:10px;
- padding-left:15px;
- padding-top:15px;
- padding-right:15px;
- color:#000;
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- }
- #Ldt-Root{
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- }
- #Ldt-Hat{
- height:3px;
- }
- #Ldt-Annotations{
- padding-left:5px;
- width:470px;
- float:left;
- font-size: 62.5%;
- }
- #Ldt-SaTitle{
- padding-top:2px;
- padding-bottom:5px;
- font-size:18px;
- height:22p;
- }
- #Ldt-SaDescription{
- font-size:12px;
- visibility:hidden;
- display:none;
- }
- #Ldt-Show-Arrow-container{
- margin-left:60px;
- }
- #Ldt-Show-Arrow{
- position:relative;
- background:url(http://www.cybunk.com/iritest/universcience/des-souris-dans-un-labyrinthe_fichiers/grey_arrow_Show.png);
- width:27px;
- height:13px;
- margin-top:20px;
- margin-left:-10px;
- }
-
- #Ldt-Show-Tags{
- position:relative;
- height:13px;
- margin-top:-10px;
- border: solid 1px #000;
- }
- #Ldt-ShowAnnotation-video{
- position:absolute;
- z-index: 999;
- padding:5px;
- background:url(imgs/transBlack.png);
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- color:#FFF;
- }
- #Ldt-ShowAnnotation-audio{
- position:relative;
- padding:5px;
- background-color:#131313;
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- color:#fff;
- margin-left:213px;
- }
- #Ldt-SaKeyword{
- background-color:#444343;
- color:#fff;
- padding:5px;
- font-weight:bold;
- text-align:left;
- float:left;
- font-size:10px;
-
- margin-left:213px;
- }
- #Ldt-SaShareTools{
- text-align:right;
- float:right;
- }
-
-
- #Ldt-PlaceHolder{
- position:absolue;
- float:none;
- }
-
- .Ldt-mode-radio{
- visibility:hidden;
- height:0px;
- display:none
- }
-
- .Ldt-Control1{
- width:60px;
- float:left;
- }
- .Ldt-Control2{
- padding-left:10px;
- width:60px;
- float:left;
- }
- .Ldt-cleaner {
- clear:both;
- }
- .share {
- background:url('imgs/widget20.png') no-repeat scroll 0 0 transparent ;
- display:block;
- height:16px;
- line-height:16px !important;
- overflow:hidden;
- width:16px;
- float:left;
- cursor:pointer;
- margin:2px;
- }
- .shareFacebook{
- background-position:0 -704px;
- }
- .shareMySpace{
- background-position:0 -736px;
- }
- .shareTwitter{
- background-position:0 -1072px;
- }
- .shareGoogle{
- background-position:0 -752px;
- }
- .shareDelicious{
- background-position:0 -672px;
- }
- .shareJamesPot{
- background-position:0 -1808px;
- }
-
-
\ No newline at end of file
diff -r 18ca612e9ff0 -r 0dd21c298380 src/css/demo.css
--- a/src/css/demo.css Thu Mar 08 18:38:46 2012 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
- #demo-frame > div.demo { padding: 5px !important; };
-
- button.ui-button-icon-only {
- height:1.5em;
- width:1.5em;
- }
-
- #Ldt-loader{
- background:url(imgs/transBlack.gif);
- width:10px;
- height:10px;
- }
-
- #Ldt-controler {
- font-size: 62.5%;
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- background-color:#DECFE2;
- height:35px;
- padding:5px;
- }
-
- .Ldt-iri-chapter{
- padding-top:10px;
- padding-bottom:5px;
- border-left:solid 1px #000;
- border-right:solid 1px #000;
- }
-
- #Ldt-loader {
- background:url(imgs/loader_fc.gif) no-repeat;
- width:20px;
- height:16px;
- float:left;
- }
-
- .tooltip {
- display:none;
- background:transparent url(imgs/white_arrow_mini.png);
- font-size:12px;
- height:55px;
- width:180px;
- padding:10px;
- padding-left:15px;
- padding-top:15px;
- padding-right:15px;
- color:#000;
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- }
- #Ldt-Root{
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- }
- #Ldt-Hat{
- height:3px;
- }
- #Ldt-Annotations{
- padding-left:5px;
- width:470px;
- float:left;
- font-size: 62.5%;
- }
- #Ldt-SaTitle{
- padding-top:2px;
- padding-bottom:5px;
- font-size:18px;
- height:22p;
- color:#FFF;
- }
- #Ldt-SaDescription{
- font-size:12px;
- }
- #Ldt-Show-Arrow-container{
- margin-left:60px;
- }
- #Ldt-Show-Arrow{
- position:relative;
- background:url(imgs/grey_arrow_Show.png);
- width:27px;
- height:13px;
- margin-top:12px;
- margin-left:-10px;
- }
-
- #Ldt-output{
- display:none;
- }
- #Ldt-Show-Tags{
- position:relative;
- height:13px;
- margin-top:-10px;
- border: solid 1px #000;
- }
- #Ldt-ShowAnnotation-video{
- position:absolute;
- z-index: 999;
- padding:5px;
- background:url(imgs/transBlack.png);
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- color:#FFF;
- }
- #Ldt-ShowAnnotation-audio{
- position:relative;
- padding:5px;
- background-color:#773584;
- font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
- color:#000000;
- }
- #Ldt-SaKeyword{
- background-color:#28042D;
- color:#FFFFFF;
- padding:5px;
- font-weight:bold;
- text-align:left;
- float:left;
- font-size:10px;
- }
- #Ldt-SaShareTools{
- text-align:right;
- float:right;
- }
-
-
- #Ldt-PlaceHolder{
- position:absolue;
- float:none;
- }
-
- .Ldt-mode-radio{
- visibility:hidden;
- height:0px;
- display:none
- }
-
- .Ldt-Control1{
- width:60px;
- float:left;
- }
- .Ldt-Control2{
- padding-left:10px;
- width:60px;
- float:left;
- }
- .Ldt-cleaner {
- clear:both;
- }
- .share {
- background:url('imgs/widget20.png') no-repeat scroll 0 0 transparent ;
- display:block;
- height:16px;
- line-height:16px !important;
- overflow:hidden;
- width:16px;
- float:left;
- cursor:pointer;
- margin:2px;
- }
- .shareFacebook{
- background-position:0 -704px;
- }
- .shareMySpace{
- background-position:0 -736px;
- }
- .shareTwitter{
- background-position:0 -1072px;
- }
- .shareGoogle{
- background-position:0 -752px;
- }
- .shareDelicious{
- background-position:0 -672px;
- }
- .shareJamesPot{
- background-position:0 -1808px;
- }
-
-
\ No newline at end of file
diff -r 18ca612e9ff0 -r 0dd21c298380 src/css/imgs/annotate_sprite.png
Binary file src/css/imgs/annotate_sprite.png has changed
diff -r 18ca612e9ff0 -r 0dd21c298380 src/css/imgs/mute_sprite.png
Binary file src/css/imgs/mute_sprite.png has changed
diff -r 18ca612e9ff0 -r 0dd21c298380 src/css/imgs/pause_sprite.png
Binary file src/css/imgs/pause_sprite.png has changed
diff -r 18ca612e9ff0 -r 0dd21c298380 src/css/imgs/play_sprite.png
Binary file src/css/imgs/play_sprite.png has changed
diff -r 18ca612e9ff0 -r 0dd21c298380 src/css/imgs/player-sprites.png
Binary file src/css/imgs/player-sprites.png has changed
diff -r 18ca612e9ff0 -r 0dd21c298380 src/css/imgs/search_sprite.png
Binary file src/css/imgs/search_sprite.png has changed
diff -r 18ca612e9ff0 -r 0dd21c298380 src/css/imgs/sound_sprite.png
Binary file src/css/imgs/sound_sprite.png has changed
diff -r 18ca612e9ff0 -r 0dd21c298380 src/js/widgets/createAnnotationWidget.js
--- a/src/js/widgets/createAnnotationWidget.js Thu Mar 08 18:38:46 2012 +0100
+++ b/src/js/widgets/createAnnotationWidget.js Fri Mar 09 17:29:23 2012 +0100
@@ -51,7 +51,7 @@
// Add onclick event to both polemic and keywords buttons
- this.selector.find(".Ldt-createAnnotation-keywords button, .Ldt-createAnnotation-polemics button").click(function() {
+ this.selector.find(".Ldt-createAnnotation-btnblock button").click(function() {
_this.addKeyword(IriSP.jQuery(this).text());
});
@@ -195,42 +195,19 @@
IriSP.createAnnotationWidget.prototype.handleTextChanges = function(event) {
var contents = this.selector.find(".Ldt-createAnnotation-Description").val();
- this.selector.find(".Ldt-createAnnotation-keywords button").each(function() {
- var _rx = IriSP.regexpFromText(IriSP.jQuery(this).text());
- if (_rx.test(contents)) {
- IriSP.jQuery(this).removeClass("Ldt-createAnnotation-absent-keyword")
- .addClass("Ldt-createAnnotation-present-keyword");
- } else {
- IriSP.jQuery(this).addClass("Ldt-createAnnotation-absent-keyword")
- .removeClass("Ldt-createAnnotation-present-keyword");
- }
- });
-
- this.selector.find(".Ldt-createAnnotation-polemics button").each(function() {
+ this.selector.find(".Ldt-createAnnotation-btnblock button").each(function() {
var _rx = IriSP.regexpFromText(IriSP.jQuery(this).text());
if (_rx.test(contents)) {
- IriSP.jQuery(this).addClass("Ldt-createAnnotation-polemic-active");
+ IriSP.jQuery(this).parent().addClass("Ldt-createAnnotation-active-button");
} else {
- IriSP.jQuery(this).removeClass("Ldt-createAnnotation-polemic-active");
+ IriSP.jQuery(this).parent().removeClass("Ldt-createAnnotation-active-button");
}
});
- if (this.polemic_mode) {
- /* Also go through the polemics to highlight the buttons */
- for (var polemic in this.polemics) {
- /* Add the active class to the button */
- var classname = "Ldt-createAnnotation-polemic-" + this.polemics[polemic];
- if (contents.indexOf(polemic) != -1) {
- this.selector.find("." + classname).addClass("Ldt-createAnnotation-polemic-active");
- } else {
- if (this.selector.find("." + classname).addClass("Ldt-createAnnotation-polemic-active"))
- this.selector.find("." + classname).removeClass("Ldt-createAnnotation-polemic-active")
- }
- }
- }
+
};
IriSP.createAnnotationWidget.prototype.showStartScreen = function() {
- this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
+ this.selector.find(".Ldt-createAnnotation-screen").hide();
this.selector.find(".Ldt-createAnnotation-startScreen").show();
var jqTextfield = this.selector.find(".Ldt-createAnnotation-Description"); // handle on the textfield. used for the closure
@@ -249,20 +226,20 @@
};
IriSP.createAnnotationWidget.prototype.showWaitScreen = function() {
- this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
+ this.selector.find(".Ldt-createAnnotation-screen").hide();
this.selector.find(".Ldt-createAnnotation-waitScreen").show();
this._state = "waitScreen";
};
IriSP.createAnnotationWidget.prototype.showErrorScreen = function() {
- this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
+ this.selector.find(".Ldt-createAnnotation-screen").hide();
this.selector.find(".Ldt-createAnnotation-errorScreen").show();
this._state = "errorScreen";
};
/** update show the final screen with links to share the created annotation */
IriSP.createAnnotationWidget.prototype.showEndScreen = function(annotation) {
- this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
+ this.selector.find(".Ldt-createAnnotation-screen").hide();
if (this.cinecast_version) {
this.selector.find(".Ldt-createAnnotation-Title").parent().show();
diff -r 18ca612e9ff0 -r 0dd21c298380 src/js/widgets/playerWidget.js
--- a/src/js/widgets/playerWidget.js Thu Mar 08 18:38:46 2012 +0100
+++ b/src/js/widgets/playerWidget.js Fri Mar 09 17:29:23 2012 +0100
@@ -13,7 +13,7 @@
var height = this.height;
var heightS = this.height-20;
- var playerTempl = IriSP.templToHTML(IriSP.player_template, {"share_template" : IriSP.share_template});
+ var playerTempl = IriSP.templToHTML(IriSP.player_template, this._config);
this.selector.append(playerTempl);
this.selector.children(".Ldt-controler").show();
@@ -39,8 +39,6 @@
this.selector.find(".Ldt-CtrlSearch").click(function() { self.searchButtonHandler.call(self); });
this.selector.find('.Ldt-CtrlSound').click(function() { self.muteHandler.call(self); } );
-
- this.selector.find(".Ldt-CtrlPlay").attr( "style", "background-color:#CD21C24;" );
/*
var searchButtonPos = this.selector.find(".Ldt-CtrlSearch").position();
diff -r 18ca612e9ff0 -r 0dd21c298380 src/templates/createAnnotationWidget.html
--- a/src/templates/createAnnotationWidget.html Thu Mar 08 18:38:46 2012 +0100
+++ b/src/templates/createAnnotationWidget.html Fri Mar 09 17:29:23 2012 +0100
@@ -9,39 +9,41 @@
{{^cinecast_version}}
";
-IriSP.tweetWidget_template = "{{! template for the tweet widget }}";/* utils.js - various utils that don't belong anywhere else */
+IriSP.tweetWidget_template = "{{! template for the tweet widget }}";/* utils.js - various utils that don't belong anywhere else */
/* trace function, for debugging */
@@ -1296,6 +1296,11 @@
}
}
*/
+
+/* Creates regexps from text */
+IriSP.regexpFromText = function(_text) {
+ return new RegExp('(' + _text.replace(/(\W)/gim,'\\$1') + ')','gim');
+}
/* wrapper that simulates popcorn.js because
popcorn is a bit unstable at the time */
@@ -1636,7 +1641,7 @@
IriSP.paths = {};
-IriSP.libdir = "js/libs/";
+IriSP.libdir = "/metadataplayer/src/js/libs/";
IriSP.jwplayer_swf_path = "../test/libs/player.swf";
IriSP.platform_url = "http://192.168.56.101/pf";
IriSP.default_templates_vars = { };
@@ -1703,16 +1708,17 @@
keywords: ["#faux-raccord", "#mot-clef"],
polemic_mode: true, /* enable polemics ? */
/* polemics - the corresponding class names defined in the css should be for instance :
- Ldt-createAnnotation-polemic-plusplus for plusplus
+ Ldt-createAnnotation-polemic-positive for positive
Ldt-createAnnotation-polemic-equalequal for equalequal, etc.
*/
- polemics: {"++" : "positive", "--" : "negative", "==" : "reference", "??" : "question"},
+ polemics: [ { "className" : "positive", "keyword" : "++" }, { "className" : "negative", "keyword" : "--" }, { "className" : "reference", "keyword" : "==" }, { "className" : "question", "keyword" : "??" } ],
cinecast_version: true, /* put to false to enable the platform version, true for the festival cinecast one. */
/* where does the widget PUT the annotations - this is a mustache template. id refers to the id of the media ans is filled
by the widget.
*/
- api_endpoint_template: platform_url + "/ldtplatform/api/ldt/annotations/{{id}}.json"
+ api_endpoint_template: platform_url + "/ldtplatform/api/ldt/annotations/{{id}}.json",
+ api_method: "PUT"
},
"SparklineWidget" : {
column_width: 10 // the width of a column in pixels.
@@ -1815,11 +1821,32 @@
}
if (config.hasOwnProperty("layoutManager")) {
- this.layoutManager = config.layoutManager;
+ this.layoutManager = config.layoutManager;
+ }
+ if (typeof this.selector != "undefined") {
+ this.selector.addClass("Ldt-TraceMe").addClass("Ldt-Widget");
}
};
+// This functions checks for configuration options
+
+IriSP.Widget.prototype.checkOption = function(_name, _default) {
+ this[_name] = (
+ typeof this._config[_name] != "undefined"
+ ? this._config[_name]
+ : (
+ (typeof IriSP.widgetsDefaults[this._config.type] != "undefined" && IriSP.widgetsDefaults[this._config.type][_name] != "undefined")
+ ? IriSP.widgetsDefaults[this._config.type][_name]
+ : (
+ typeof _default != "undefined"
+ ? _default
+ : null
+ )
+ )
+ )
+}
+
/**
* This method responsible of drawing a widget on screen.
*/
@@ -2145,8 +2172,14 @@
var i = 0;
for(i = 0; i < widgetConfig.requires.length; i++) {
- var widgetName = widgetConfig.requires[i]["type"];
- widget[widgetName] = IriSP.instantiateWidget(popcornInstance, serialFactory, layoutManager, widgetConfig.requires[i], defaultOptions);
+ var widgetName = widgetConfig.requires[i]["type"],
+ _configobj = IriSP.jQuery.extend({}, widgetConfig.requires[i]),
+ _div = document.createElement('div'),
+ _container = IriSP.guid(arr.container + '_' + widgetName + '_');
+ _configobj.container = _container;
+ _div.id = _container;
+ widget.selector.append(_div);
+ widget[widgetName] = IriSP.instantiateWidget(popcornInstance, serialFactory, layoutManager, _configobj, defaultOptions);
}
}
@@ -3050,15 +3083,23 @@
IriSP.createAnnotationWidget = function(Popcorn, config, Serializer) {
IriSP.Widget.call(this, Popcorn, config, Serializer);
this._hidden = true;
- this.keywords = IriSP.widgetsDefaults["createAnnotationWidget"].keywords;
-
- this.polemic_mode = IriSP.widgetsDefaults["createAnnotationWidget"].polemic_mode;
- this.polemics = IriSP.widgetsDefaults["createAnnotationWidget"].polemics;
-
- this.cinecast_version = IriSP.widgetsDefaults["createAnnotationWidget"].cinecast_version;
- this.api_endpoint_template = IriSP.widgetsDefaults["createAnnotationWidget"].api_endpoint_template;
-
- this.ids = {}; /* a dictionnary linking buttons ids to keywords */
+
+ this.checkOption("keywords");
+ this.checkOption("polemic_mode", true);
+ this.checkOption("polemics");
+ this.checkOption("cinecast_version", false);
+ this.checkOption("api_endpoint_template");
+ this.checkOption("show_from_field", true);
+ this.checkOption("api_method");
+
+ if (!IriSP.null_or_undefined(IriSP.user)) {
+ if (!IriSP.null_or_undefined(IriSP.user.avatar)) {
+ this.user_avatar = IriSP.user.avatar;
+ }
+ if (!IriSP.null_or_undefined(IriSP.user.name)) {
+ this.user_name = IriSP.user.name;
+ }
+ }
/* variables to save the current position of the slicer */
if (this.cinecast_version) {
@@ -3078,14 +3119,9 @@
IriSP.createAnnotationWidget.prototype.draw = function() {
var _this = this;
- var template_params = {cinecast_version: this.cinecast_version,
- polemic_mode: this.polemic_mode};
-
- if (!IriSP.null_or_undefined(IriSP.user) && !IriSP.null_or_undefined(IriSP.user.avatar))
- template_params["user_avatar"] = IriSP.user.avatar;
var annotationMarkup = IriSP.templToHTML(IriSP.createAnnotationWidget_template,
- template_params);
+ this);
this.selector.append(annotationMarkup);
@@ -3094,70 +3130,12 @@
else {
this.showStartScreen();
}
-
- // add the keywords.
- for (var i = 0; i < this.keywords.length; i++) {
- var keyword = this.keywords[i];
- var id = IriSP.guid("button_");
- var templ = IriSP.templToHTML("
{{keyword}} ",
- {keyword: keyword, id: id});
-
- this.ids[keyword] = id; // save it for the function that handle textarea changes.
-
- this.selector.find(".Ldt-createAnnotation-keywords").append(templ);
- this.selector.find("#" + id).click(function(keyword) { return function() {
- var contents = _this.selector.find(".Ldt-createAnnotation-Description").val();
- if (contents.indexOf(keyword) != -1) {
- var newVal = contents.replace(" " + keyword, "");
- if (newVal == contents)
- newVal = contents.replace(keyword, "");
- } else {
- if (contents === "")
- var newVal = keyword;
- else
- var newVal = contents + " " + keyword;
- }
-
- _this.selector.find(".Ldt-createAnnotation-Description").val(newVal);
- // we use a custom event because there's no simple way to test for a js
- // change in a textfield.
- _this.selector.find(".Ldt-createAnnotation-Description").trigger("js_mod");
- // also call our update function.
- //_this.handleTextChanges();
- }
- }(keyword));
- }
-
- // add the polemic buttons.
- if(this.polemic_mode)
- for (var polemic in this.polemics) {
-
- var classname = IriSP.templToHTML("Ldt-createAnnotation-polemic-{{classname}}", {classname : this.polemics[polemic]});
-
- var templ = IriSP.templToHTML("
{{polemic}} ",
- {classname: classname, polemic: polemic});
-
- this.selector.find(".Ldt-createAnnotation-polemics").append(templ);
- this.selector.find("." + classname).click(function(polemic) { return function() {
- var contents = _this.selector.find(".Ldt-createAnnotation-Description").val();
- if (contents.indexOf(polemic) != -1) {
- var newVal = contents.replace(" " + polemic, "");
- if (newVal == contents)
- newVal = contents.replace(polemic, "");
- } else {
- if (contents === "")
- var newVal = polemic;
- else
- var newVal = contents + " " + polemic;
- }
-
- _this.selector.find(".Ldt-createAnnotation-Description").val(newVal);
-
- // also call our update function.
- _this.handleTextChanges();
- }
- }(polemic));
- }
+
+ // Add onclick event to both polemic and keywords buttons
+
+ this.selector.find(".Ldt-createAnnotation-btnblock button").click(function() {
+ _this.addKeyword(IriSP.jQuery(this).text());
+ });
// js_mod is a custom event because there's no simple way to test for a js
// change in a textfield.
@@ -3227,6 +3205,19 @@
}
};
+/* Handles adding keywords and polemics */
+IriSP.createAnnotationWidget.prototype.addKeyword = function(_keyword) {
+ var _field = this.selector.find(".Ldt-createAnnotation-Description"),
+ _rx = IriSP.regexpFromText(_keyword),
+ _contents = _field.val();
+ _contents = ( _rx.test(_contents)
+ ? _contents.replace(_rx,"").replace(" "," ").trim()
+ : _contents.trim() + " " + _keyword
+ );
+ _field.val(_contents);
+ _field.trigger("js_mod");
+}
+
/** handles clicks on the annotate button. Works only for the non-cinecast version */
IriSP.createAnnotationWidget.prototype.handleAnnotateSignal = function() {
@@ -3286,41 +3277,19 @@
IriSP.createAnnotationWidget.prototype.handleTextChanges = function(event) {
var contents = this.selector.find(".Ldt-createAnnotation-Description").val();
- for(var keyword in this.ids) {
-
- var id = this.ids[keyword];
-
- if (contents.indexOf(keyword) != -1) {
- /* the word is present in the textarea but the button is not toggled */
- if (this.selector.find("#" + id).hasClass("Ldt-createAnnotation-absent-keyword"))
- this.selector.find("#" + id).removeClass("Ldt-createAnnotation-absent-keyword")
- .addClass("Ldt-createAnnotation-present-keyword");
- } else {
- /* the word is absent from the textarea but the button is toggled */
- if (this.selector.find("#" + id).hasClass("Ldt-createAnnotation-present-keyword")) {
- this.selector.find("#" + id).removeClass("Ldt-createAnnotation-present-keyword")
- .addClass("Ldt-createAnnotation-absent-keyword");
+ this.selector.find(".Ldt-createAnnotation-btnblock button").each(function() {
+ var _rx = IriSP.regexpFromText(IriSP.jQuery(this).text());
+ if (_rx.test(contents)) {
+ IriSP.jQuery(this).parent().addClass("Ldt-createAnnotation-active-button");
+ } else {
+ IriSP.jQuery(this).parent().removeClass("Ldt-createAnnotation-active-button");
}
- }
- }
-
- if (this.polemic_mode) {
- /* Also go through the polemics to highlight the buttons */
- for (var polemic in this.polemics) {
- /* Add the active class to the button */
- var classname = "Ldt-createAnnotation-polemic-" + this.polemics[polemic];
- if (contents.indexOf(polemic) != -1) {
- this.selector.find("." + classname).addClass("Ldt-createAnnotation-polemic-active");
- } else {
- if (this.selector.find("." + classname).addClass("Ldt-createAnnotation-polemic-active"))
- this.selector.find("." + classname).removeClass("Ldt-createAnnotation-polemic-active")
- }
- }
- }
+ });
+
};
IriSP.createAnnotationWidget.prototype.showStartScreen = function() {
- this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
+ this.selector.find(".Ldt-createAnnotation-screen").hide();
this.selector.find(".Ldt-createAnnotation-startScreen").show();
var jqTextfield = this.selector.find(".Ldt-createAnnotation-Description"); // handle on the textfield. used for the closure
@@ -3339,20 +3308,20 @@
};
IriSP.createAnnotationWidget.prototype.showWaitScreen = function() {
- this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
+ this.selector.find(".Ldt-createAnnotation-screen").hide();
this.selector.find(".Ldt-createAnnotation-waitScreen").show();
this._state = "waitScreen";
};
IriSP.createAnnotationWidget.prototype.showErrorScreen = function() {
- this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
+ this.selector.find(".Ldt-createAnnotation-screen").hide();
this.selector.find(".Ldt-createAnnotation-errorScreen").show();
this._state = "errorScreen";
};
/** update show the final screen with links to share the created annotation */
IriSP.createAnnotationWidget.prototype.showEndScreen = function(annotation) {
- this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
+ this.selector.find(".Ldt-createAnnotation-screen").hide();
if (this.cinecast_version) {
this.selector.find(".Ldt-createAnnotation-Title").parent().show();
@@ -3376,7 +3345,7 @@
var _this = this;
var textfield = this.selector.find(".Ldt-createAnnotation-Description");
var contents = textfield.val();
-
+
if (contents === "") {
if (this.selector.find(".Ldt-createAnnotation-errorMessage").length === 0) {
this.selector.find(".Ldt-createAnnotation-Container")
@@ -3456,20 +3425,23 @@
annotation.content["data"] = contents;
var meta = apiJson["meta"];
- if (!IriSP.null_or_undefined(IriSP.user) && !IriSP.null_or_undefined(IriSP.user.name))
- meta.creator = IriSP.user.name;
- else
- meta.creator = "An User";
+
+
+ var _username = this.selector.find(".Ldt-createAnnotation-userName").val();
+ meta.creator = (
+ (_username && _username.length)
+ ? _username
+ : (
+ (!IriSP.null_or_undefined(IriSP.user) && !IriSP.null_or_undefined(IriSP.user.name))
+ ? IriSP.user.name
+ : "Anonymous user"
+ )
+ );
meta.created = Date().toString();
- annotation["tags"] = [];
-
- for (var i = 0; i < this.keywords.length; i++) {
- var keyword = this.keywords[i];
- if (contents.indexOf(keyword) != -1)
- annotation["tags"].push(keyword);
- }
+ // All #hashtags are added to tags
+ annotation.tags = contents.match(/(#[\S]*)/g);
var jsonString = JSON.stringify(apiJson);
var project_id = this._serializer._data.meta.id;
@@ -3480,7 +3452,7 @@
IriSP.jQuery.ajax({
url: url,
- type: 'PUT',
+ type: this.api_method,
contentType: 'application/json',
data: jsonString,
//dataType: 'json',
@@ -3549,7 +3521,7 @@
var height = this.height;
var heightS = this.height-20;
- var playerTempl = IriSP.templToHTML(IriSP.player_template, {"share_template" : IriSP.share_template});
+ var playerTempl = IriSP.templToHTML(IriSP.player_template, this._config);
this.selector.append(playerTempl);
this.selector.children(".Ldt-controler").show();
@@ -3575,8 +3547,6 @@
this.selector.find(".Ldt-CtrlSearch").click(function() { self.searchButtonHandler.call(self); });
this.selector.find('.Ldt-CtrlSound').click(function() { self.muteHandler.call(self); } );
-
- this.selector.find(".Ldt-CtrlPlay").attr( "style", "background-color:#CD21C24;" );
/*
var searchButtonPos = this.selector.find(".Ldt-CtrlSearch").position();
@@ -3594,9 +3564,9 @@
/* Update the elasped time div */
IriSP.PlayerWidget.prototype.timeDisplayUpdater = function() {
- if (this._previousSecond === undefined)
+ if (this._previousSecond === undefined) {
this._previousSecond = this._Popcorn.roundTime();
-
+ }
else {
/* we're still in the same second, so it's not necessary to update time */
if (this._Popcorn.roundTime() == this._previousSecond)
@@ -3813,7 +3783,7 @@
var duration = this._serializer.getDuration(); // timescale width
var frameLength = lineSize / frameSize; // frame timescale
var timeline;
- var colors = new Array("","#1D973D","#C5A62D","#CE0A15","#036AAE","#585858");
+ var colors = new Array("","#1D973D","#036AAE","#CE0A15","#C5A62D","#585858");
// array
//var tweets = new Array();
@@ -4079,15 +4049,18 @@
e.time = frames[i].mytweetsID[k].timeframe;
e.title = frames[i].mytweetsID[k].title;
e.id = frames[i].mytweetsID[k].cinecast_id;
- var pos = IriSP.jQuery(e.node).offset();
- e.x = pos.left;
- e.y = pos.top;
this.svgElements[e.id] = e;
- IriSP.jQuery(e.node).mouseenter(function(element) { return function (event) {
- // event.clientX and event.clientY are to raphael what event.pageX and pageY are to jquery.
- self.TooltipWidget.show.call(self.TooltipWidget, element.title, element.attr("fill"), event.pageX - 106, event.pageY - 160);
+ IriSP.jQuery(e.node).mouseenter(function(element) { return function (_e) {
+ self.TooltipWidget.show.call(self.TooltipWidget, element.title, element.attr("fill"), element.attrs.x + element.attrs.width / 2, element.attrs.y - 2);
element.displayed = true;
+ self._Popcorn.trigger("IriSP.TraceWidget.MouseEvents", {
+ "widget" : "StackGraphWidget",
+ "type": "mousemove",
+ "x": _e.pageX,
+ "y": _e.pageY,
+ "annotation_id": element.id
+ });
}}(e)).mousedown(function(element) { return function () {
self._Popcorn.currentTime(element.time/1000);
self._Popcorn.trigger("IriSP.PolemicTweet.click", element.id);
@@ -4254,7 +4227,7 @@
if (typeof(view_type) === "undefined") {
view_type = this._serializer.getNonTweetIds()[0];
}
- this.positionMarker = this.selector.children(":first");
+ this.positionMarker = this.selector.find(".Ldt-SegmentPositionMarker");
this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.positionUpdater));
@@ -4337,16 +4310,9 @@
(function(divTitle) {
return function(event) {
IriSP.jQuery(this).animate({opacity: 0.6}, 5);
- var offset = IriSP.jQuery(this).offset();
- var correction = IriSP.jQuery(this).outerWidth() / 2;
-
- var offset_x = offset.left + correction - 106;
- if (offset_x < 0)
- offset_x = 0;
-
- var offset_y = offset.top;
-
- self.TooltipWidget.show(divTitle, color, offset_x, offset_y - 160);
+ var offset_x = IriSP.jQuery(this).position().left + IriSP.jQuery(this).outerWidth() / 2;
+
+ self.TooltipWidget.show(divTitle, color, offset_x, 0);
} })(divTitle)).mouseout(function(){
IriSP.jQuery(this).animate({opacity: 0.3}, 5);
self.TooltipWidget.hide();
@@ -5071,14 +5037,19 @@
var _this = this;
this.selector
.click(IriSP.wrap(this, this.clickHandler))
- .mousemove(function(event) {
- _this.updateTooltip(event);
-
- // Also tell the world where the mouse is hovering.
- var relX = event.pageX - _this.selector.offset().left;
- var duration = _this._serializer.getDuration();
- var Time = ((relX / _this.width) * duration).toFixed(2);
- _this._Popcorn.trigger("IriSP.StackGraphWidget.mouseOver", Time);
+ .mousemove(function(_e) {
+ _this.updateTooltip(_e);
+ // Trace
+ var relX = _e.pageX - _this.selector.offset().left;
+ var _duration = _this._serializer.getDuration();
+ var _time = parseInt((relX / _this.width) * _duration);
+ _this._Popcorn.trigger("IriSP.TraceWidget.MouseEvents", {
+ "widget" : "StackGraphWidget",
+ "type": "mousemove",
+ "x": _e.pageX,
+ "y": _e.pageY,
+ "time": _time
+ });
})
.mouseout(function() {
@@ -5111,7 +5082,7 @@
};
IriSP.StackGraphWidget.prototype.updateTooltip = function(event) {
- var _segment = ~~(this.sliceCount * (event.pageX - this.selector.offset().left)/this.width),
+ var _segment = Math.max(0,Math.min(this.groups.length - 1, Math.floor(this.sliceCount * (event.pageX - this.selector.offset().left)/this.width))),
_valeurs = this.groups[_segment],
_width = this.width / this.sliceCount,
_html = '
' + IriSP._(this.tagconf).map(function(_tag, _i) {
@@ -5124,7 +5095,7 @@
+ '';
}).join('') + ' ';
this.TooltipWidget._shown = false; // Vraiment, on ne peut pas ouvrir le widget s'il n'est pas encore ouvert ?
- this.TooltipWidget.show('','',event.pageX - 105, event.pageY - 160);
+ this.TooltipWidget.show('','',(_segment + .5)* this.width / this.sliceCount, 0);
this.TooltipWidget.selector.find(".tip").html(_html);
this.rectangleFocus.attr({
"x" : _segment * _width,
@@ -5140,23 +5111,29 @@
IriSP.TagCloudWidget.prototype.draw = function() {
- var _stopwords = [
- 'aussi', 'and', 'avec', 'aux', 'car', 'cette', 'comme', 'dans', 'donc', 'des', 'elle', 'est',
- 'être', 'eux', 'fait', 'ici', 'ils', 'les', 'leur', 'leurs', 'mais', 'mes', 'même', 'mon', 'notre',
- 'non', 'nos', 'nous', 'ont', 'par', 'pas', 'peu', 'pour', 'que', 'qui', 'ses' ,'son', 'sont', 'sur',
- 'tes', 'très', 'the', 'ton', 'tous', 'tout', 'une', 'votre', 'vos', 'vous'
- ],
+ var _urlRegExp = /https?:\/\/[0-9a-zA-Z\.%\/-_]+/g,
+ _stopWords = [
+ 'aussi', 'and', 'avec', 'aux', 'bien', 'car', 'cette', 'comme', 'dans', 'donc', 'des', 'elle', 'encore', 'entre', 'est',
+ 'être', 'eux', 'faire', 'fait', 'http', 'ici', 'ils', 'les', 'leur', 'leurs', 'mais', 'mes', 'même', 'mon', 'notre',
+ 'non', 'nos', 'nous', 'ont', 'par', 'pas', 'peu', 'peut', 'plus', 'pour', 'que', 'qui', 'sans', 'ses' ,'son', 'sont', 'sur',
+ 'tes', 'très', 'the', 'ton', 'tous', 'tout', 'une', 'votre', 'vos', 'vous' ],
_regexpword = /[^\s\.&;,'"!\?\d\(\)\+\[\]\\\…\-«»:\/]{3,}/g,
_words = {},
_showTitle = !this._config.excludeTitle,
_showDescription = !this._config.excludeDescription,
+ _excludePattern = this._config.excludePattern || null,
_tagCount = this._config.tagCount || 30;
+ if (typeof this._config.excludeWords !== "undefined" && this._config.excludeWords.length) {
+ IriSP._(this._config.excludeWords).each(function(_w) {
+ _stopWords.push(_w.toLowerCase());
+ });
+ }
IriSP._(this._serializer._data.annotations).each(function(_annotation) {
if (_annotation.content && _annotation.content.description) {
var _txt = (_showTitle ? _annotation.content.title : '') + ' ' + (_showDescription ? _annotation.content.description : '')
- IriSP._(_txt.toLowerCase().match(_regexpword)).each(function(_mot) {
- if (_stopwords.indexOf(_mot) == -1) {
+ IriSP._(_txt.toLowerCase().replace(_urlRegExp, '').match(_regexpword)).each(function(_mot) {
+ if (_stopWords.indexOf(_mot) == -1 && (_excludePattern == null || !_excludePattern.test(_mot))) {
_words[_mot] = 1 + (_words[_mot] || 0);
}
})
@@ -5189,7 +5166,7 @@
.shuffle()
.map(function(_word) {
var _size = 10 + _scale * Math.sqrt(_word.count - _min);
- return '
'
+ _word.word
@@ -5209,7 +5186,7 @@
var _rgxp = new RegExp("(" + searchString.replace(/(\W)/g,'\\$1') + ")","gi");
this.selector.find("li").each(function(_i, _e) {
_e.innerHTML = searchString.length ?
- _e.textContent.replace(_rgxp,'$1 ')
+ _e.textContent.replace(_rgxp,'$1 ')
: _e.textContent;
});
}));
@@ -5235,9 +5212,20 @@
IriSP.TooltipWidget.prototype.draw = function() {
var templ = Mustache.to_html(IriSP.tooltipWidget_template);
- // position the widget absolutely relative to document.
- this.selector.css("position", "static");
+ // position the widget absolutely relative to document. --- NOOOO !!!!
+ this.selector.css({
+ "position": "absolute",
+ "top": 0,
+ "left": 0
+ });
+ this.selector.parent().css({
+ "position": "relative"
+ });
this.selector.append(templ);
+ var _this = this;
+ this.selector.mouseover(function() {
+ _this.hide();
+ });
this.hide();
};
@@ -5253,22 +5241,148 @@
this.selector.find(".tipcolor").css("background-color", color);
this._displayedText = text;
- this.selector.find(".tiptext").html(text);
-
- if (x < 0)
- x = 0;
- if (y < 0)
- y = 0;
-
- this.selector.find(".tip").css("left", x).css("top", y);
- this.selector.find(".tip").show();
+ this.selector.find(".tiptext").html(text);
+
+ var _tip = this.selector.find(".tip");
+ _tip.show();
+ _tip.css({
+ "left": Math.floor(x - _tip.outerWidth() / 2)+"px",
+ "top": Math.floor(y - _tip.outerHeight())+"px"
+ });
this._shown = true;
};
IriSP.TooltipWidget.prototype.hide = function() {
this.selector.find(".tip").hide();
this._shown = false;
-};/* a widget that displays tweet - used in conjunction with the polemicWidget */
+};IriSP.TraceWidget = function(Popcorn, config, Serializer) {
+ IriSP.Widget.call(this, Popcorn, config, Serializer);
+ this.lastEvent = "";
+ var _this = this,
+ _listeners = [
+ "IriSP.ArrowWidget.releaseArrow",
+ "IriSP.SliceWidget.hide",
+ "IriSP.AnnotationsWidget.show",
+ "IriSP.AnnotationsWidget.hide",
+ "IriSP.ArrowWidget.blockArrow",
+ "IriSP.SliceWidget.position",
+ "IriSP.SliceWidget.show",
+ "IriSP.SliceWidget.hide",
+ "IriSP.createAnnotationWidget.addedAnnotation",
+ "IriSP.search.open",
+ "IriSP.search.closed",
+ "IriSP.search",
+ "IriSP.search.cleared",
+ "IriSP.search.matchFound",
+ "IriSP.search.noMatchFound",
+ "IriSP.search.triggeredSearch",
+ "IriSP.TraceWidget.MouseEvents",
+ "play",
+ "pause",
+ "volumechange",
+ "timeupdate",
+ "seeked",
+ "play",
+ "pause"
+ ];
+ IriSP._(_listeners).each(function(_listener) {
+ _this._Popcorn.listen(_listener, function(_arg) {
+ _this.eventHandler(_listener, _arg);
+ });
+ });
+
+}
+
+IriSP.TraceWidget.prototype = new IriSP.Widget();
+
+IriSP.TraceWidget.prototype.draw = function() {
+ this.mouseLocation = '';
+ var _this = this;
+ IriSP.jQuery(".Ldt-Widget").bind("click mouseover mouseout dragstart dragstop", function(_e) {
+ var _widget = this.id.match('LdtPlayer_widget_([^_]+)')[1],
+ _class = _e.target.className;
+ var _data = {
+ "type": _e.type,
+ "x": _e.clientX,
+ "y": _e.clientY,
+ "widget": _widget
+ }
+ if (typeof _class == "string" && _class.indexOf('Ldt-TraceMe') != -1) {
+ var _name = _e.target.localName,
+ _id = _e.target.id,
+ _text = _e.target.textContent.trim(),
+ _title = _e.target.title,
+ _value = _e.target.value;
+ _data.target = _name + (_id.length ? '#' + _id : '') + (_class.length ? '.' + _class.replace(/\s/g,'.').replace(/\.Ldt-(Widget|TraceMe)/g,'') : '');
+ if (typeof _title == "string" && _title.length && _title.length < 140) {
+ _data.title = _title;
+ }
+ if (typeof _text == "string" && _text.length && _text.length < 140) {
+ _data.text = _text;
+ }
+ if (typeof _value == "string" && _value.length) {
+ _data.value = _value;
+ }
+ _this._Popcorn.trigger('IriSP.TraceWidget.MouseEvents', _data);
+ } else {
+ //console.log(_e.type+','+_this.mouseLocation+','+_widget);
+ if (_e.type == "mouseover") {
+ if (_this.mouseLocation != _widget) {
+ _this._Popcorn.trigger('IriSP.TraceWidget.MouseEvents', _data);
+ } else {
+ if (typeof _this.moTimeout != "undefined") {
+ clearTimeout(_this.moTimeout);
+ delete _this.moTimeout;
+ }
+ }
+ }
+ if (_e.type == "click") {
+ _this._Popcorn.trigger('IriSP.TraceWidget.MouseEvents', _data);
+ }
+ if (_e.type == "mouseout") {
+ if (typeof _this.moTimeout != "undefined") {
+ clearTimeout(_this.moTimeout);
+ }
+ _this.moTimeout = setTimeout(function() {
+ if (_data.widget != _this.mouseLocation) {
+ _this._Popcorn.trigger('IriSP.TraceWidget.MouseEvents', _data);
+ }
+ },100);
+ }
+ }
+ _this.mouseLocation = _widget;
+ });
+}
+
+IriSP.TraceWidget.prototype.eventHandler = function(_listener, _arg) {
+ var _traceName = 'Mdp_';
+ if (typeof _arg == "string" || typeof _arg == "number") {
+ _arg = { "value" : _arg }
+ }
+ if (typeof _arg == "undefined") {
+ _arg = {}
+ }
+ switch(_listener) {
+ case 'IriSP.TraceWidget.MouseEvents':
+ _traceName += _arg.widget + '_' + _arg.type;
+ delete _arg.widget;
+ delete _arg.type;
+ break;
+ case 'timeupdate':
+ case 'play':
+ case 'pause':
+ _arg.time = this._Popcorn.currentTime() * 1000;
+ case 'seeked':
+ case 'volumechange':
+ _traceName += 'Popcorn_' + _listener;
+ break;
+ default:
+ _traceName += _listener.replace('IriSP.','').replace('.','_');
+ }
+ this.lastEvent = _traceName;
+ console.log("trace('" + _traceName + "', " + JSON.stringify(_arg) + ");");
+}
+/* a widget that displays tweet - used in conjunction with the polemicWidget */
IriSP.TweetsWidget = function(Popcorn, config, Serializer) {
IriSP.Widget.call(this, Popcorn, config, Serializer);
diff -r 18ca612e9ff0 -r 0dd21c298380 test/integration/allocine_dossier_independant/polemic-allocine.htm
--- a/test/integration/allocine_dossier_independant/polemic-allocine.htm Thu Mar 08 18:38:46 2012 +0100
+++ b/test/integration/allocine_dossier_independant/polemic-allocine.htm Fri Mar 09 17:29:23 2012 +0100
@@ -29,16 +29,16 @@
var config = {
gui:{
- width:650,
+ width:610,
height:2100,
container:'LdtPlayer',
- css:'css/LdtPlayer.css',
+ css:'css/LdtPlayer.css?42',
default_options : {
metadata:{
format:'cinelab',
src: json_url,
type:'json'},
- width: 640
+ width: 610
},
widgets: [
{type: "StackGraphWidget",
@@ -53,10 +53,8 @@
{type: "AnnotationsListWidget",
container: "AnnotationsListContainer"},
{type: "SliderWidget"},
- {type: "PlayerWidget", // please note that type refers directly to the constructor of the widget.
- mode: "radio"},
- {type: "ArrowWidget"},
- {type: "TweetsWidget"},
+ {type: "PlayerWidget",
+ disable_annotate_btn: true},
{type: "createAnnotationWidget",
polemic_mode: false,
cinecast_version: true,